]> git.proxmox.com Git - pve-eslint.git/commitdiff
import 8.23.1 source
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 15 Sep 2022 09:13:41 +0000 (11:13 +0200)
committerDominik Csapak <d.csapak@proxmox.com>
Thu, 15 Sep 2022 09:13:41 +0000 (11:13 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
1442 files changed:
Makefile
eslint/.c8rc [new file with mode: 0644]
eslint/.eslintignore
eslint/.eslintrc.js
eslint/.github/ISSUE_TEMPLATE.md [deleted file]
eslint/.github/ISSUE_TEMPLATE/NEW_SYNTAX.md [deleted file]
eslint/.github/ISSUE_TEMPLATE/bug-report.yml
eslint/.github/ISSUE_TEMPLATE/new-syntax.yml [new file with mode: 0644]
eslint/.github/PULL_REQUEST_TEMPLATE.md
eslint/.github/dependabot.yml [new file with mode: 0644]
eslint/.github/workflows/ci.yml
eslint/.github/workflows/codeql-analysis.yml
eslint/.github/workflows/stale.yml
eslint/.markdownlint.yml
eslint/.nycrc [deleted file]
eslint/CHANGELOG.md
eslint/CONTRIBUTING.md
eslint/Makefile.js
eslint/README.md
eslint/bin/eslint.js
eslint/conf/globals.js
eslint/docs/.eleventy.js [new file with mode: 0644]
eslint/docs/README.md
eslint/docs/about/index.md [deleted file]
eslint/docs/developer-guide/README.md [deleted file]
eslint/docs/developer-guide/architecture.md [deleted file]
eslint/docs/developer-guide/architecture/dependency.svg [deleted file]
eslint/docs/developer-guide/code-conventions.md [deleted file]
eslint/docs/developer-guide/code-path-analysis.md [deleted file]
eslint/docs/developer-guide/code-path-analysis/README.md [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-forinstatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-forstatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-hello-world.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-ifstatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-switchstatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/example-whilestatement.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/helo.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg [deleted file]
eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg [deleted file]
eslint/docs/developer-guide/contributing/README.md [deleted file]
eslint/docs/developer-guide/contributing/changes.md [deleted file]
eslint/docs/developer-guide/contributing/new-rules.md [deleted file]
eslint/docs/developer-guide/contributing/pull-requests.md [deleted file]
eslint/docs/developer-guide/contributing/reporting-bugs.md [deleted file]
eslint/docs/developer-guide/contributing/rule-changes.md [deleted file]
eslint/docs/developer-guide/contributing/working-on-issues.md [deleted file]
eslint/docs/developer-guide/development-environment.md [deleted file]
eslint/docs/developer-guide/nodejs-api.md [deleted file]
eslint/docs/developer-guide/scope-manager-interface.md [deleted file]
eslint/docs/developer-guide/selectors.md [deleted file]
eslint/docs/developer-guide/shareable-configs.md [deleted file]
eslint/docs/developer-guide/source-code.md [deleted file]
eslint/docs/developer-guide/unit-tests.md [deleted file]
eslint/docs/developer-guide/working-with-custom-formatters.md [deleted file]
eslint/docs/developer-guide/working-with-custom-parsers.md [deleted file]
eslint/docs/developer-guide/working-with-plugins.md [deleted file]
eslint/docs/developer-guide/working-with-rules-deprecated.md [deleted file]
eslint/docs/developer-guide/working-with-rules.md [deleted file]
eslint/docs/maintainer-guide/README.md [deleted file]
eslint/docs/maintainer-guide/governance.md [deleted file]
eslint/docs/maintainer-guide/issues.md [deleted file]
eslint/docs/maintainer-guide/pullrequests.md [deleted file]
eslint/docs/maintainer-guide/releases.md [deleted file]
eslint/docs/maintainer-guide/working-groups.md [deleted file]
eslint/docs/package.json [new file with mode: 0644]
eslint/docs/rules/accessor-pairs.md [deleted file]
eslint/docs/rules/array-bracket-newline.md [deleted file]
eslint/docs/rules/array-bracket-spacing.md [deleted file]
eslint/docs/rules/array-callback-return.md [deleted file]
eslint/docs/rules/array-element-newline.md [deleted file]
eslint/docs/rules/arrow-body-style.md [deleted file]
eslint/docs/rules/arrow-parens.md [deleted file]
eslint/docs/rules/arrow-spacing.md [deleted file]
eslint/docs/rules/block-scoped-var.md [deleted file]
eslint/docs/rules/block-spacing.md [deleted file]
eslint/docs/rules/brace-style.md [deleted file]
eslint/docs/rules/callback-return.md [deleted file]
eslint/docs/rules/camelcase.md [deleted file]
eslint/docs/rules/capitalized-comments.md [deleted file]
eslint/docs/rules/class-methods-use-this.md [deleted file]
eslint/docs/rules/comma-dangle.md [deleted file]
eslint/docs/rules/comma-spacing.md [deleted file]
eslint/docs/rules/comma-style.md [deleted file]
eslint/docs/rules/complexity.md [deleted file]
eslint/docs/rules/computed-property-spacing.md [deleted file]
eslint/docs/rules/consistent-return.md [deleted file]
eslint/docs/rules/consistent-this.md [deleted file]
eslint/docs/rules/constructor-super.md [deleted file]
eslint/docs/rules/curly.md [deleted file]
eslint/docs/rules/default-case-last.md [deleted file]
eslint/docs/rules/default-case.md [deleted file]
eslint/docs/rules/default-param-last.md [deleted file]
eslint/docs/rules/dot-location.md [deleted file]
eslint/docs/rules/dot-notation.md [deleted file]
eslint/docs/rules/eol-last.md [deleted file]
eslint/docs/rules/eqeqeq.md [deleted file]
eslint/docs/rules/for-direction.md [deleted file]
eslint/docs/rules/func-call-spacing.md [deleted file]
eslint/docs/rules/func-name-matching.md [deleted file]
eslint/docs/rules/func-names.md [deleted file]
eslint/docs/rules/func-style.md [deleted file]
eslint/docs/rules/function-call-argument-newline.md [deleted file]
eslint/docs/rules/function-paren-newline.md [deleted file]
eslint/docs/rules/generator-star-spacing.md [deleted file]
eslint/docs/rules/generator-star.md [deleted file]
eslint/docs/rules/getter-return.md [deleted file]
eslint/docs/rules/global-require.md [deleted file]
eslint/docs/rules/global-strict.md [deleted file]
eslint/docs/rules/grouped-accessor-pairs.md [deleted file]
eslint/docs/rules/guard-for-in.md [deleted file]
eslint/docs/rules/handle-callback-err.md [deleted file]
eslint/docs/rules/id-blacklist.md [deleted file]
eslint/docs/rules/id-denylist.md [deleted file]
eslint/docs/rules/id-length.md [deleted file]
eslint/docs/rules/id-match.md [deleted file]
eslint/docs/rules/implicit-arrow-linebreak.md [deleted file]
eslint/docs/rules/indent-legacy.md [deleted file]
eslint/docs/rules/indent.md [deleted file]
eslint/docs/rules/init-declarations.md [deleted file]
eslint/docs/rules/jsx-quotes.md [deleted file]
eslint/docs/rules/key-spacing.md [deleted file]
eslint/docs/rules/keyword-spacing.md [deleted file]
eslint/docs/rules/line-comment-position.md [deleted file]
eslint/docs/rules/linebreak-style.md [deleted file]
eslint/docs/rules/lines-around-comment.md [deleted file]
eslint/docs/rules/lines-around-directive.md [deleted file]
eslint/docs/rules/lines-between-class-members.md [deleted file]
eslint/docs/rules/max-classes-per-file.md [deleted file]
eslint/docs/rules/max-depth.md [deleted file]
eslint/docs/rules/max-len.md [deleted file]
eslint/docs/rules/max-lines-per-function.md [deleted file]
eslint/docs/rules/max-lines.md [deleted file]
eslint/docs/rules/max-nested-callbacks.md [deleted file]
eslint/docs/rules/max-params.md [deleted file]
eslint/docs/rules/max-statements-per-line.md [deleted file]
eslint/docs/rules/max-statements.md [deleted file]
eslint/docs/rules/multiline-comment-style.md [deleted file]
eslint/docs/rules/multiline-ternary.md [deleted file]
eslint/docs/rules/new-cap.md [deleted file]
eslint/docs/rules/new-parens.md [deleted file]
eslint/docs/rules/newline-after-var.md [deleted file]
eslint/docs/rules/newline-before-return.md [deleted file]
eslint/docs/rules/newline-per-chained-call.md [deleted file]
eslint/docs/rules/no-alert.md [deleted file]
eslint/docs/rules/no-array-constructor.md [deleted file]
eslint/docs/rules/no-arrow-condition.md [deleted file]
eslint/docs/rules/no-async-promise-executor.md [deleted file]
eslint/docs/rules/no-await-in-loop.md [deleted file]
eslint/docs/rules/no-bitwise.md [deleted file]
eslint/docs/rules/no-buffer-constructor.md [deleted file]
eslint/docs/rules/no-caller.md [deleted file]
eslint/docs/rules/no-case-declarations.md [deleted file]
eslint/docs/rules/no-catch-shadow.md [deleted file]
eslint/docs/rules/no-class-assign.md [deleted file]
eslint/docs/rules/no-comma-dangle.md [deleted file]
eslint/docs/rules/no-compare-neg-zero.md [deleted file]
eslint/docs/rules/no-cond-assign.md [deleted file]
eslint/docs/rules/no-confusing-arrow.md [deleted file]
eslint/docs/rules/no-console.md [deleted file]
eslint/docs/rules/no-const-assign.md [deleted file]
eslint/docs/rules/no-constant-condition.md [deleted file]
eslint/docs/rules/no-constructor-return.md [deleted file]
eslint/docs/rules/no-continue.md [deleted file]
eslint/docs/rules/no-control-regex.md [deleted file]
eslint/docs/rules/no-debugger.md [deleted file]
eslint/docs/rules/no-delete-var.md [deleted file]
eslint/docs/rules/no-div-regex.md [deleted file]
eslint/docs/rules/no-dupe-args.md [deleted file]
eslint/docs/rules/no-dupe-class-members.md [deleted file]
eslint/docs/rules/no-dupe-else-if.md [deleted file]
eslint/docs/rules/no-dupe-keys.md [deleted file]
eslint/docs/rules/no-duplicate-case.md [deleted file]
eslint/docs/rules/no-duplicate-imports.md [deleted file]
eslint/docs/rules/no-else-return.md [deleted file]
eslint/docs/rules/no-empty-character-class.md [deleted file]
eslint/docs/rules/no-empty-class.md [deleted file]
eslint/docs/rules/no-empty-function.md [deleted file]
eslint/docs/rules/no-empty-label.md [deleted file]
eslint/docs/rules/no-empty-pattern.md [deleted file]
eslint/docs/rules/no-empty.md [deleted file]
eslint/docs/rules/no-eq-null.md [deleted file]
eslint/docs/rules/no-eval.md [deleted file]
eslint/docs/rules/no-ex-assign.md [deleted file]
eslint/docs/rules/no-extend-native.md [deleted file]
eslint/docs/rules/no-extra-bind.md [deleted file]
eslint/docs/rules/no-extra-boolean-cast.md [deleted file]
eslint/docs/rules/no-extra-label.md [deleted file]
eslint/docs/rules/no-extra-parens.md [deleted file]
eslint/docs/rules/no-extra-semi.md [deleted file]
eslint/docs/rules/no-extra-strict.md [deleted file]
eslint/docs/rules/no-fallthrough.md [deleted file]
eslint/docs/rules/no-floating-decimal.md [deleted file]
eslint/docs/rules/no-func-assign.md [deleted file]
eslint/docs/rules/no-global-assign.md [deleted file]
eslint/docs/rules/no-implicit-coercion.md [deleted file]
eslint/docs/rules/no-implicit-globals.md [deleted file]
eslint/docs/rules/no-implied-eval.md [deleted file]
eslint/docs/rules/no-import-assign.md [deleted file]
eslint/docs/rules/no-inline-comments.md [deleted file]
eslint/docs/rules/no-inner-declarations.md [deleted file]
eslint/docs/rules/no-invalid-regexp.md [deleted file]
eslint/docs/rules/no-invalid-this.md [deleted file]
eslint/docs/rules/no-irregular-whitespace.md [deleted file]
eslint/docs/rules/no-iterator.md [deleted file]
eslint/docs/rules/no-label-var.md [deleted file]
eslint/docs/rules/no-labels.md [deleted file]
eslint/docs/rules/no-lone-blocks.md [deleted file]
eslint/docs/rules/no-lonely-if.md [deleted file]
eslint/docs/rules/no-loop-func.md [deleted file]
eslint/docs/rules/no-loss-of-precision.md [deleted file]
eslint/docs/rules/no-magic-numbers.md [deleted file]
eslint/docs/rules/no-misleading-character-class.md [deleted file]
eslint/docs/rules/no-mixed-operators.md [deleted file]
eslint/docs/rules/no-mixed-requires.md [deleted file]
eslint/docs/rules/no-mixed-spaces-and-tabs.md [deleted file]
eslint/docs/rules/no-multi-assign.md [deleted file]
eslint/docs/rules/no-multi-spaces.md [deleted file]
eslint/docs/rules/no-multi-str.md [deleted file]
eslint/docs/rules/no-multiple-empty-lines.md [deleted file]
eslint/docs/rules/no-native-reassign.md [deleted file]
eslint/docs/rules/no-negated-condition.md [deleted file]
eslint/docs/rules/no-negated-in-lhs.md [deleted file]
eslint/docs/rules/no-nested-ternary.md [deleted file]
eslint/docs/rules/no-new-func.md [deleted file]
eslint/docs/rules/no-new-object.md [deleted file]
eslint/docs/rules/no-new-require.md [deleted file]
eslint/docs/rules/no-new-symbol.md [deleted file]
eslint/docs/rules/no-new-wrappers.md [deleted file]
eslint/docs/rules/no-new.md [deleted file]
eslint/docs/rules/no-nonoctal-decimal-escape.md [deleted file]
eslint/docs/rules/no-obj-calls.md [deleted file]
eslint/docs/rules/no-octal-escape.md [deleted file]
eslint/docs/rules/no-octal.md [deleted file]
eslint/docs/rules/no-param-reassign.md [deleted file]
eslint/docs/rules/no-path-concat.md [deleted file]
eslint/docs/rules/no-plusplus.md [deleted file]
eslint/docs/rules/no-process-env.md [deleted file]
eslint/docs/rules/no-process-exit.md [deleted file]
eslint/docs/rules/no-promise-executor-return.md [deleted file]
eslint/docs/rules/no-proto.md [deleted file]
eslint/docs/rules/no-prototype-builtins.md [deleted file]
eslint/docs/rules/no-redeclare.md [deleted file]
eslint/docs/rules/no-regex-spaces.md [deleted file]
eslint/docs/rules/no-reserved-keys.md [deleted file]
eslint/docs/rules/no-restricted-exports.md [deleted file]
eslint/docs/rules/no-restricted-globals.md [deleted file]
eslint/docs/rules/no-restricted-imports.md [deleted file]
eslint/docs/rules/no-restricted-modules.md [deleted file]
eslint/docs/rules/no-restricted-properties.md [deleted file]
eslint/docs/rules/no-restricted-syntax.md [deleted file]
eslint/docs/rules/no-return-assign.md [deleted file]
eslint/docs/rules/no-return-await.md [deleted file]
eslint/docs/rules/no-script-url.md [deleted file]
eslint/docs/rules/no-self-assign.md [deleted file]
eslint/docs/rules/no-self-compare.md [deleted file]
eslint/docs/rules/no-sequences.md [deleted file]
eslint/docs/rules/no-setter-return.md [deleted file]
eslint/docs/rules/no-shadow-restricted-names.md [deleted file]
eslint/docs/rules/no-shadow.md [deleted file]
eslint/docs/rules/no-space-before-semi.md [deleted file]
eslint/docs/rules/no-spaced-func.md [deleted file]
eslint/docs/rules/no-sparse-arrays.md [deleted file]
eslint/docs/rules/no-sync.md [deleted file]
eslint/docs/rules/no-tabs.md [deleted file]
eslint/docs/rules/no-template-curly-in-string.md [deleted file]
eslint/docs/rules/no-ternary.md [deleted file]
eslint/docs/rules/no-this-before-super.md [deleted file]
eslint/docs/rules/no-throw-literal.md [deleted file]
eslint/docs/rules/no-trailing-spaces.md [deleted file]
eslint/docs/rules/no-undef-init.md [deleted file]
eslint/docs/rules/no-undef.md [deleted file]
eslint/docs/rules/no-undefined.md [deleted file]
eslint/docs/rules/no-underscore-dangle.md [deleted file]
eslint/docs/rules/no-unexpected-multiline.md [deleted file]
eslint/docs/rules/no-unmodified-loop-condition.md [deleted file]
eslint/docs/rules/no-unneeded-ternary.md [deleted file]
eslint/docs/rules/no-unreachable-loop.md [deleted file]
eslint/docs/rules/no-unreachable.md [deleted file]
eslint/docs/rules/no-unsafe-finally.md [deleted file]
eslint/docs/rules/no-unsafe-negation.md [deleted file]
eslint/docs/rules/no-unsafe-optional-chaining.md [deleted file]
eslint/docs/rules/no-unused-expressions.md [deleted file]
eslint/docs/rules/no-unused-labels.md [deleted file]
eslint/docs/rules/no-unused-private-class-members.md [deleted file]
eslint/docs/rules/no-unused-vars.md [deleted file]
eslint/docs/rules/no-use-before-define.md [deleted file]
eslint/docs/rules/no-useless-backreference.md [deleted file]
eslint/docs/rules/no-useless-call.md [deleted file]
eslint/docs/rules/no-useless-catch.md [deleted file]
eslint/docs/rules/no-useless-computed-key.md [deleted file]
eslint/docs/rules/no-useless-concat.md [deleted file]
eslint/docs/rules/no-useless-constructor.md [deleted file]
eslint/docs/rules/no-useless-escape.md [deleted file]
eslint/docs/rules/no-useless-rename.md [deleted file]
eslint/docs/rules/no-useless-return.md [deleted file]
eslint/docs/rules/no-var.md [deleted file]
eslint/docs/rules/no-void.md [deleted file]
eslint/docs/rules/no-warning-comments.md [deleted file]
eslint/docs/rules/no-whitespace-before-property.md [deleted file]
eslint/docs/rules/no-with.md [deleted file]
eslint/docs/rules/no-wrap-func.md [deleted file]
eslint/docs/rules/nonblock-statement-body-position.md [deleted file]
eslint/docs/rules/object-curly-newline.md [deleted file]
eslint/docs/rules/object-curly-spacing.md [deleted file]
eslint/docs/rules/object-property-newline.md [deleted file]
eslint/docs/rules/object-shorthand.md [deleted file]
eslint/docs/rules/one-var-declaration-per-line.md [deleted file]
eslint/docs/rules/one-var.md [deleted file]
eslint/docs/rules/operator-assignment.md [deleted file]
eslint/docs/rules/operator-linebreak.md [deleted file]
eslint/docs/rules/padded-blocks.md [deleted file]
eslint/docs/rules/padding-line-between-statements.md [deleted file]
eslint/docs/rules/prefer-arrow-callback.md [deleted file]
eslint/docs/rules/prefer-const.md [deleted file]
eslint/docs/rules/prefer-destructuring.md [deleted file]
eslint/docs/rules/prefer-exponentiation-operator.md [deleted file]
eslint/docs/rules/prefer-named-capture-group.md [deleted file]
eslint/docs/rules/prefer-numeric-literals.md [deleted file]
eslint/docs/rules/prefer-object-spread.md [deleted file]
eslint/docs/rules/prefer-promise-reject-errors.md [deleted file]
eslint/docs/rules/prefer-reflect.md [deleted file]
eslint/docs/rules/prefer-regex-literals.md [deleted file]
eslint/docs/rules/prefer-rest-params.md [deleted file]
eslint/docs/rules/prefer-spread.md [deleted file]
eslint/docs/rules/prefer-template.md [deleted file]
eslint/docs/rules/quote-props.md [deleted file]
eslint/docs/rules/quotes.md [deleted file]
eslint/docs/rules/radix.md [deleted file]
eslint/docs/rules/require-atomic-updates.md [deleted file]
eslint/docs/rules/require-await.md [deleted file]
eslint/docs/rules/require-jsdoc.md [deleted file]
eslint/docs/rules/require-unicode-regexp.md [deleted file]
eslint/docs/rules/require-yield.md [deleted file]
eslint/docs/rules/rest-spread-spacing.md [deleted file]
eslint/docs/rules/semi-spacing.md [deleted file]
eslint/docs/rules/semi-style.md [deleted file]
eslint/docs/rules/semi.md [deleted file]
eslint/docs/rules/sort-imports.md [deleted file]
eslint/docs/rules/sort-keys.md [deleted file]
eslint/docs/rules/sort-vars.md [deleted file]
eslint/docs/rules/space-after-function-name.md [deleted file]
eslint/docs/rules/space-after-keywords.md [deleted file]
eslint/docs/rules/space-before-blocks.md [deleted file]
eslint/docs/rules/space-before-function-paren.md [deleted file]
eslint/docs/rules/space-before-function-parentheses.md [deleted file]
eslint/docs/rules/space-before-keywords.md [deleted file]
eslint/docs/rules/space-in-brackets.md [deleted file]
eslint/docs/rules/space-in-parens.md [deleted file]
eslint/docs/rules/space-infix-ops.md [deleted file]
eslint/docs/rules/space-return-throw-case.md [deleted file]
eslint/docs/rules/space-unary-ops.md [deleted file]
eslint/docs/rules/space-unary-word-ops.md [deleted file]
eslint/docs/rules/spaced-comment.md [deleted file]
eslint/docs/rules/spaced-line-comment.md [deleted file]
eslint/docs/rules/strict.md [deleted file]
eslint/docs/rules/switch-colon-spacing.md [deleted file]
eslint/docs/rules/symbol-description.md [deleted file]
eslint/docs/rules/template-curly-spacing.md [deleted file]
eslint/docs/rules/template-tag-spacing.md [deleted file]
eslint/docs/rules/unicode-bom.md [deleted file]
eslint/docs/rules/use-isnan.md [deleted file]
eslint/docs/rules/valid-jsdoc.md [deleted file]
eslint/docs/rules/valid-typeof.md [deleted file]
eslint/docs/rules/vars-on-top.md [deleted file]
eslint/docs/rules/wrap-iife.md [deleted file]
eslint/docs/rules/wrap-regex.md [deleted file]
eslint/docs/rules/yield-star-spacing.md [deleted file]
eslint/docs/rules/yoda.md [deleted file]
eslint/docs/src/_data/config.json [new file with mode: 0644]
eslint/docs/src/_data/eslintVersion.js [new file with mode: 0644]
eslint/docs/src/_data/further_reading_links.json [new file with mode: 0644]
eslint/docs/src/_data/helpers.js [new file with mode: 0644]
eslint/docs/src/_data/languages.json [new file with mode: 0644]
eslint/docs/src/_data/links.json [new file with mode: 0644]
eslint/docs/src/_data/navigation.json [new file with mode: 0644]
eslint/docs/src/_data/rule_versions.json [new file with mode: 0644]
eslint/docs/src/_data/rules.json [new file with mode: 0644]
eslint/docs/src/_data/rules_meta.json [new file with mode: 0644]
eslint/docs/src/_data/site.js [new file with mode: 0644]
eslint/docs/src/_data/sites/en.yml [new file with mode: 0644]
eslint/docs/src/_data/versions.json [new file with mode: 0644]
eslint/docs/src/_includes/components/_component.njk [new file with mode: 0644]
eslint/docs/src/_includes/components/alert.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/button.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/code-tabs.html [new file with mode: 0644]
eslint/docs/src/_includes/components/docs-index.html [new file with mode: 0644]
eslint/docs/src/_includes/components/docs-toc.html [new file with mode: 0644]
eslint/docs/src/_includes/components/hero.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/language-switcher.html [new file with mode: 0644]
eslint/docs/src/_includes/components/logo.html [new file with mode: 0644]
eslint/docs/src/_includes/components/nav-search.html [new file with mode: 0644]
eslint/docs/src/_includes/components/nav-version-switcher.html [new file with mode: 0644]
eslint/docs/src/_includes/components/navigation.html [new file with mode: 0644]
eslint/docs/src/_includes/components/related-rules.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/rule-categories.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/rule-list.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/rule.macro.html [new file with mode: 0644]
eslint/docs/src/_includes/components/search.html [new file with mode: 0644]
eslint/docs/src/_includes/components/social-icons.html [new file with mode: 0644]
eslint/docs/src/_includes/components/theme-switcher.html [new file with mode: 0644]
eslint/docs/src/_includes/components/version-switcher.html [new file with mode: 0644]
eslint/docs/src/_includes/layouts/base.html [new file with mode: 0644]
eslint/docs/src/_includes/layouts/components.html [new file with mode: 0644]
eslint/docs/src/_includes/layouts/doc.html [new file with mode: 0644]
eslint/docs/src/_includes/layouts/main.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/analytics.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/carbon-ad.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/docs-footer.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/docs-header.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/docs-left-sidebar.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/languages-list.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/site-footer.html [new file with mode: 0644]
eslint/docs/src/_includes/partials/versions-list.html [new file with mode: 0644]
eslint/docs/src/about/index.md [new file with mode: 0644]
eslint/docs/src/assets/fonts/Consolas.woff [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter-Regular-subset.woff2 [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/OFL.txt [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/README.txt [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Black.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Light.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 [new file with mode: 0644]
eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff [new file with mode: 0644]
eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 [new file with mode: 0644]
eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/OFL.txt [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/README.txt [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/OFL.txt [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf [new file with mode: 0644]
eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf [new file with mode: 0644]
eslint/docs/src/assets/images/404.png [new file with mode: 0644]
eslint/docs/src/assets/images/architecture/dependency.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-forinstatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-forstatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-hello-world.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-ifstatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-switchstatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/example-whilestatement.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/helo.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg [new file with mode: 0644]
eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/arrow-left.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/arrow-right.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/arrow-top-right.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/chevron-down.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/copy.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/correct.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/discord.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/facebook.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/features-list-icon.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/github-icon-mono.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/github-img.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/github-large.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/github-small.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/github.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/google.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/incorrect.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/languages.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/learn-more-arrow.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/link.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/linkedin.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/menu.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/minus-circle.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/npm.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/open-collectione-mono.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/opencollective-img.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/plus-circle.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/search.svg [new file with mode: 0644]
eslint/docs/src/assets/images/icons/twitter.svg [new file with mode: 0644]
eslint/docs/src/assets/images/logo/brand-colors.svg [new file with mode: 0644]
eslint/docs/src/assets/js/components-index.js [new file with mode: 0644]
eslint/docs/src/assets/js/css-vars-ponyfill@2.js [new file with mode: 0644]
eslint/docs/src/assets/js/focus-visible.js [new file with mode: 0644]
eslint/docs/src/assets/js/inert-polyfill.js [new file with mode: 0644]
eslint/docs/src/assets/js/main.js [new file with mode: 0644]
eslint/docs/src/assets/js/search.js [new file with mode: 0644]
eslint/docs/src/assets/js/tabs.js [new file with mode: 0644]
eslint/docs/src/assets/js/themes.js [new file with mode: 0644]
eslint/docs/src/assets/scss/carbon-ads.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/alert.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/buttons.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/docs-index.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/docs-navigation.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/hero.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/index.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/language-switcher.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/resources.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/rules.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/search.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/social-icons.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/tabs.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/theme-switcher.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/toc.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/components/version-switcher.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/docs-footer.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/docs-header.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/docs.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/forms.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/foundations.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/languages.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/print.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/styles.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/syntax-highlighter.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/tokens/spacing.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/tokens/themes.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/tokens/typography.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/tokens/ui.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/utilities.scss [new file with mode: 0644]
eslint/docs/src/assets/scss/versions.scss [new file with mode: 0644]
eslint/docs/src/developer-guide/architecture/index.md [new file with mode: 0644]
eslint/docs/src/developer-guide/code-conventions.md [new file with mode: 0644]
eslint/docs/src/developer-guide/code-path-analysis.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/changes.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/index.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/new-rules.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/pull-requests.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/reporting-bugs.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/rule-changes.md [new file with mode: 0644]
eslint/docs/src/developer-guide/contributing/working-on-issues.md [new file with mode: 0644]
eslint/docs/src/developer-guide/development-environment.md [new file with mode: 0644]
eslint/docs/src/developer-guide/index.md [new file with mode: 0644]
eslint/docs/src/developer-guide/nodejs-api.md [new file with mode: 0644]
eslint/docs/src/developer-guide/package-json-conventions.md [new file with mode: 0644]
eslint/docs/src/developer-guide/scope-manager-interface.md [new file with mode: 0644]
eslint/docs/src/developer-guide/selectors.md [new file with mode: 0644]
eslint/docs/src/developer-guide/shareable-configs.md [new file with mode: 0644]
eslint/docs/src/developer-guide/source-code.md [new file with mode: 0644]
eslint/docs/src/developer-guide/unit-tests.md [new file with mode: 0644]
eslint/docs/src/developer-guide/working-with-custom-formatters.md [new file with mode: 0644]
eslint/docs/src/developer-guide/working-with-custom-parsers.md [new file with mode: 0644]
eslint/docs/src/developer-guide/working-with-plugins.md [new file with mode: 0644]
eslint/docs/src/developer-guide/working-with-rules-deprecated.md [new file with mode: 0644]
eslint/docs/src/developer-guide/working-with-rules.md [new file with mode: 0644]
eslint/docs/src/library/alert.md [new file with mode: 0644]
eslint/docs/src/library/buttons.md [new file with mode: 0644]
eslint/docs/src/library/code-blocks.md [new file with mode: 0644]
eslint/docs/src/library/code-tabs.md [new file with mode: 0644]
eslint/docs/src/library/language-switcher.md [new file with mode: 0644]
eslint/docs/src/library/library.json [new file with mode: 0644]
eslint/docs/src/library/link-card.md [new file with mode: 0644]
eslint/docs/src/library/related-rules.md [new file with mode: 0644]
eslint/docs/src/library/rule-categories.md [new file with mode: 0644]
eslint/docs/src/library/rule-list.md [new file with mode: 0644]
eslint/docs/src/library/rule.md [new file with mode: 0644]
eslint/docs/src/library/social-icons.md [new file with mode: 0644]
eslint/docs/src/library/theme-switcher.md [new file with mode: 0644]
eslint/docs/src/library/version-switcher.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/governance.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/index.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/issues.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/pullrequests.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/releases.md [new file with mode: 0644]
eslint/docs/src/maintainer-guide/working-groups.md [new file with mode: 0644]
eslint/docs/src/pages/404.html [new file with mode: 0644]
eslint/docs/src/pages/component-library.html [new file with mode: 0644]
eslint/docs/src/pages/index.md [new file with mode: 0644]
eslint/docs/src/pages/languages.md [new file with mode: 0644]
eslint/docs/src/pages/pages.11tydata.json [new file with mode: 0644]
eslint/docs/src/pages/rules.md [new file with mode: 0644]
eslint/docs/src/pages/versions.md [new file with mode: 0644]
eslint/docs/src/rules/accessor-pairs.md [new file with mode: 0644]
eslint/docs/src/rules/array-bracket-newline.md [new file with mode: 0644]
eslint/docs/src/rules/array-bracket-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/array-callback-return.md [new file with mode: 0644]
eslint/docs/src/rules/array-element-newline.md [new file with mode: 0644]
eslint/docs/src/rules/arrow-body-style.md [new file with mode: 0644]
eslint/docs/src/rules/arrow-parens.md [new file with mode: 0644]
eslint/docs/src/rules/arrow-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/block-scoped-var.md [new file with mode: 0644]
eslint/docs/src/rules/block-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/brace-style.md [new file with mode: 0644]
eslint/docs/src/rules/callback-return.md [new file with mode: 0644]
eslint/docs/src/rules/camelcase.md [new file with mode: 0644]
eslint/docs/src/rules/capitalized-comments.md [new file with mode: 0644]
eslint/docs/src/rules/class-methods-use-this.md [new file with mode: 0644]
eslint/docs/src/rules/comma-dangle.md [new file with mode: 0644]
eslint/docs/src/rules/comma-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/comma-style.md [new file with mode: 0644]
eslint/docs/src/rules/complexity.md [new file with mode: 0644]
eslint/docs/src/rules/computed-property-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/consistent-return.md [new file with mode: 0644]
eslint/docs/src/rules/consistent-this.md [new file with mode: 0644]
eslint/docs/src/rules/constructor-super.md [new file with mode: 0644]
eslint/docs/src/rules/curly.md [new file with mode: 0644]
eslint/docs/src/rules/default-case-last.md [new file with mode: 0644]
eslint/docs/src/rules/default-case.md [new file with mode: 0644]
eslint/docs/src/rules/default-param-last.md [new file with mode: 0644]
eslint/docs/src/rules/dot-location.md [new file with mode: 0644]
eslint/docs/src/rules/dot-notation.md [new file with mode: 0644]
eslint/docs/src/rules/eol-last.md [new file with mode: 0644]
eslint/docs/src/rules/eqeqeq.md [new file with mode: 0644]
eslint/docs/src/rules/for-direction.md [new file with mode: 0644]
eslint/docs/src/rules/func-call-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/func-name-matching.md [new file with mode: 0644]
eslint/docs/src/rules/func-names.md [new file with mode: 0644]
eslint/docs/src/rules/func-style.md [new file with mode: 0644]
eslint/docs/src/rules/function-call-argument-newline.md [new file with mode: 0644]
eslint/docs/src/rules/function-paren-newline.md [new file with mode: 0644]
eslint/docs/src/rules/generator-star-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/generator-star.md [new file with mode: 0644]
eslint/docs/src/rules/getter-return.md [new file with mode: 0644]
eslint/docs/src/rules/global-require.md [new file with mode: 0644]
eslint/docs/src/rules/global-strict.md [new file with mode: 0644]
eslint/docs/src/rules/grouped-accessor-pairs.md [new file with mode: 0644]
eslint/docs/src/rules/guard-for-in.md [new file with mode: 0644]
eslint/docs/src/rules/handle-callback-err.md [new file with mode: 0644]
eslint/docs/src/rules/id-blacklist.md [new file with mode: 0644]
eslint/docs/src/rules/id-denylist.md [new file with mode: 0644]
eslint/docs/src/rules/id-length.md [new file with mode: 0644]
eslint/docs/src/rules/id-match.md [new file with mode: 0644]
eslint/docs/src/rules/implicit-arrow-linebreak.md [new file with mode: 0644]
eslint/docs/src/rules/indent-legacy.md [new file with mode: 0644]
eslint/docs/src/rules/indent.md [new file with mode: 0644]
eslint/docs/src/rules/init-declarations.md [new file with mode: 0644]
eslint/docs/src/rules/jsx-quotes.md [new file with mode: 0644]
eslint/docs/src/rules/key-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/keyword-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/line-comment-position.md [new file with mode: 0644]
eslint/docs/src/rules/linebreak-style.md [new file with mode: 0644]
eslint/docs/src/rules/lines-around-comment.md [new file with mode: 0644]
eslint/docs/src/rules/lines-around-directive.md [new file with mode: 0644]
eslint/docs/src/rules/lines-between-class-members.md [new file with mode: 0644]
eslint/docs/src/rules/max-classes-per-file.md [new file with mode: 0644]
eslint/docs/src/rules/max-depth.md [new file with mode: 0644]
eslint/docs/src/rules/max-len.md [new file with mode: 0644]
eslint/docs/src/rules/max-lines-per-function.md [new file with mode: 0644]
eslint/docs/src/rules/max-lines.md [new file with mode: 0644]
eslint/docs/src/rules/max-nested-callbacks.md [new file with mode: 0644]
eslint/docs/src/rules/max-params.md [new file with mode: 0644]
eslint/docs/src/rules/max-statements-per-line.md [new file with mode: 0644]
eslint/docs/src/rules/max-statements.md [new file with mode: 0644]
eslint/docs/src/rules/multiline-comment-style.md [new file with mode: 0644]
eslint/docs/src/rules/multiline-ternary.md [new file with mode: 0644]
eslint/docs/src/rules/new-cap.md [new file with mode: 0644]
eslint/docs/src/rules/new-parens.md [new file with mode: 0644]
eslint/docs/src/rules/newline-after-var.md [new file with mode: 0644]
eslint/docs/src/rules/newline-before-return.md [new file with mode: 0644]
eslint/docs/src/rules/newline-per-chained-call.md [new file with mode: 0644]
eslint/docs/src/rules/no-alert.md [new file with mode: 0644]
eslint/docs/src/rules/no-array-constructor.md [new file with mode: 0644]
eslint/docs/src/rules/no-arrow-condition.md [new file with mode: 0644]
eslint/docs/src/rules/no-async-promise-executor.md [new file with mode: 0644]
eslint/docs/src/rules/no-await-in-loop.md [new file with mode: 0644]
eslint/docs/src/rules/no-bitwise.md [new file with mode: 0644]
eslint/docs/src/rules/no-buffer-constructor.md [new file with mode: 0644]
eslint/docs/src/rules/no-caller.md [new file with mode: 0644]
eslint/docs/src/rules/no-case-declarations.md [new file with mode: 0644]
eslint/docs/src/rules/no-catch-shadow.md [new file with mode: 0644]
eslint/docs/src/rules/no-class-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-comma-dangle.md [new file with mode: 0644]
eslint/docs/src/rules/no-compare-neg-zero.md [new file with mode: 0644]
eslint/docs/src/rules/no-cond-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-confusing-arrow.md [new file with mode: 0644]
eslint/docs/src/rules/no-console.md [new file with mode: 0644]
eslint/docs/src/rules/no-const-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-constant-binary-expression.md [new file with mode: 0644]
eslint/docs/src/rules/no-constant-condition.md [new file with mode: 0644]
eslint/docs/src/rules/no-constructor-return.md [new file with mode: 0644]
eslint/docs/src/rules/no-continue.md [new file with mode: 0644]
eslint/docs/src/rules/no-control-regex.md [new file with mode: 0644]
eslint/docs/src/rules/no-debugger.md [new file with mode: 0644]
eslint/docs/src/rules/no-delete-var.md [new file with mode: 0644]
eslint/docs/src/rules/no-div-regex.md [new file with mode: 0644]
eslint/docs/src/rules/no-dupe-args.md [new file with mode: 0644]
eslint/docs/src/rules/no-dupe-class-members.md [new file with mode: 0644]
eslint/docs/src/rules/no-dupe-else-if.md [new file with mode: 0644]
eslint/docs/src/rules/no-dupe-keys.md [new file with mode: 0644]
eslint/docs/src/rules/no-duplicate-case.md [new file with mode: 0644]
eslint/docs/src/rules/no-duplicate-imports.md [new file with mode: 0644]
eslint/docs/src/rules/no-else-return.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty-character-class.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty-class.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty-function.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty-label.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty-pattern.md [new file with mode: 0644]
eslint/docs/src/rules/no-empty.md [new file with mode: 0644]
eslint/docs/src/rules/no-eq-null.md [new file with mode: 0644]
eslint/docs/src/rules/no-eval.md [new file with mode: 0644]
eslint/docs/src/rules/no-ex-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-extend-native.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-bind.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-boolean-cast.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-label.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-parens.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-semi.md [new file with mode: 0644]
eslint/docs/src/rules/no-extra-strict.md [new file with mode: 0644]
eslint/docs/src/rules/no-fallthrough.md [new file with mode: 0644]
eslint/docs/src/rules/no-floating-decimal.md [new file with mode: 0644]
eslint/docs/src/rules/no-func-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-global-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-implicit-coercion.md [new file with mode: 0644]
eslint/docs/src/rules/no-implicit-globals.md [new file with mode: 0644]
eslint/docs/src/rules/no-implied-eval.md [new file with mode: 0644]
eslint/docs/src/rules/no-import-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-inline-comments.md [new file with mode: 0644]
eslint/docs/src/rules/no-inner-declarations.md [new file with mode: 0644]
eslint/docs/src/rules/no-invalid-regexp.md [new file with mode: 0644]
eslint/docs/src/rules/no-invalid-this.md [new file with mode: 0644]
eslint/docs/src/rules/no-irregular-whitespace.md [new file with mode: 0644]
eslint/docs/src/rules/no-iterator.md [new file with mode: 0644]
eslint/docs/src/rules/no-label-var.md [new file with mode: 0644]
eslint/docs/src/rules/no-labels.md [new file with mode: 0644]
eslint/docs/src/rules/no-lone-blocks.md [new file with mode: 0644]
eslint/docs/src/rules/no-lonely-if.md [new file with mode: 0644]
eslint/docs/src/rules/no-loop-func.md [new file with mode: 0644]
eslint/docs/src/rules/no-loss-of-precision.md [new file with mode: 0644]
eslint/docs/src/rules/no-magic-numbers.md [new file with mode: 0644]
eslint/docs/src/rules/no-misleading-character-class.md [new file with mode: 0644]
eslint/docs/src/rules/no-mixed-operators.md [new file with mode: 0644]
eslint/docs/src/rules/no-mixed-requires.md [new file with mode: 0644]
eslint/docs/src/rules/no-mixed-spaces-and-tabs.md [new file with mode: 0644]
eslint/docs/src/rules/no-multi-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-multi-spaces.md [new file with mode: 0644]
eslint/docs/src/rules/no-multi-str.md [new file with mode: 0644]
eslint/docs/src/rules/no-multiple-empty-lines.md [new file with mode: 0644]
eslint/docs/src/rules/no-native-reassign.md [new file with mode: 0644]
eslint/docs/src/rules/no-negated-condition.md [new file with mode: 0644]
eslint/docs/src/rules/no-negated-in-lhs.md [new file with mode: 0644]
eslint/docs/src/rules/no-nested-ternary.md [new file with mode: 0644]
eslint/docs/src/rules/no-new-func.md [new file with mode: 0644]
eslint/docs/src/rules/no-new-object.md [new file with mode: 0644]
eslint/docs/src/rules/no-new-require.md [new file with mode: 0644]
eslint/docs/src/rules/no-new-symbol.md [new file with mode: 0644]
eslint/docs/src/rules/no-new-wrappers.md [new file with mode: 0644]
eslint/docs/src/rules/no-new.md [new file with mode: 0644]
eslint/docs/src/rules/no-nonoctal-decimal-escape.md [new file with mode: 0644]
eslint/docs/src/rules/no-obj-calls.md [new file with mode: 0644]
eslint/docs/src/rules/no-octal-escape.md [new file with mode: 0644]
eslint/docs/src/rules/no-octal.md [new file with mode: 0644]
eslint/docs/src/rules/no-param-reassign.md [new file with mode: 0644]
eslint/docs/src/rules/no-path-concat.md [new file with mode: 0644]
eslint/docs/src/rules/no-plusplus.md [new file with mode: 0644]
eslint/docs/src/rules/no-process-env.md [new file with mode: 0644]
eslint/docs/src/rules/no-process-exit.md [new file with mode: 0644]
eslint/docs/src/rules/no-promise-executor-return.md [new file with mode: 0644]
eslint/docs/src/rules/no-proto.md [new file with mode: 0644]
eslint/docs/src/rules/no-prototype-builtins.md [new file with mode: 0644]
eslint/docs/src/rules/no-redeclare.md [new file with mode: 0644]
eslint/docs/src/rules/no-regex-spaces.md [new file with mode: 0644]
eslint/docs/src/rules/no-reserved-keys.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-exports.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-globals.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-imports.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-modules.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-properties.md [new file with mode: 0644]
eslint/docs/src/rules/no-restricted-syntax.md [new file with mode: 0644]
eslint/docs/src/rules/no-return-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-return-await.md [new file with mode: 0644]
eslint/docs/src/rules/no-script-url.md [new file with mode: 0644]
eslint/docs/src/rules/no-self-assign.md [new file with mode: 0644]
eslint/docs/src/rules/no-self-compare.md [new file with mode: 0644]
eslint/docs/src/rules/no-sequences.md [new file with mode: 0644]
eslint/docs/src/rules/no-setter-return.md [new file with mode: 0644]
eslint/docs/src/rules/no-shadow-restricted-names.md [new file with mode: 0644]
eslint/docs/src/rules/no-shadow.md [new file with mode: 0644]
eslint/docs/src/rules/no-space-before-semi.md [new file with mode: 0644]
eslint/docs/src/rules/no-spaced-func.md [new file with mode: 0644]
eslint/docs/src/rules/no-sparse-arrays.md [new file with mode: 0644]
eslint/docs/src/rules/no-sync.md [new file with mode: 0644]
eslint/docs/src/rules/no-tabs.md [new file with mode: 0644]
eslint/docs/src/rules/no-template-curly-in-string.md [new file with mode: 0644]
eslint/docs/src/rules/no-ternary.md [new file with mode: 0644]
eslint/docs/src/rules/no-this-before-super.md [new file with mode: 0644]
eslint/docs/src/rules/no-throw-literal.md [new file with mode: 0644]
eslint/docs/src/rules/no-trailing-spaces.md [new file with mode: 0644]
eslint/docs/src/rules/no-undef-init.md [new file with mode: 0644]
eslint/docs/src/rules/no-undef.md [new file with mode: 0644]
eslint/docs/src/rules/no-undefined.md [new file with mode: 0644]
eslint/docs/src/rules/no-underscore-dangle.md [new file with mode: 0644]
eslint/docs/src/rules/no-unexpected-multiline.md [new file with mode: 0644]
eslint/docs/src/rules/no-unmodified-loop-condition.md [new file with mode: 0644]
eslint/docs/src/rules/no-unneeded-ternary.md [new file with mode: 0644]
eslint/docs/src/rules/no-unreachable-loop.md [new file with mode: 0644]
eslint/docs/src/rules/no-unreachable.md [new file with mode: 0644]
eslint/docs/src/rules/no-unsafe-finally.md [new file with mode: 0644]
eslint/docs/src/rules/no-unsafe-negation.md [new file with mode: 0644]
eslint/docs/src/rules/no-unsafe-optional-chaining.md [new file with mode: 0644]
eslint/docs/src/rules/no-unused-expressions.md [new file with mode: 0644]
eslint/docs/src/rules/no-unused-labels.md [new file with mode: 0644]
eslint/docs/src/rules/no-unused-private-class-members.md [new file with mode: 0644]
eslint/docs/src/rules/no-unused-vars.md [new file with mode: 0644]
eslint/docs/src/rules/no-use-before-define.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-backreference.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-call.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-catch.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-computed-key.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-concat.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-constructor.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-escape.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-rename.md [new file with mode: 0644]
eslint/docs/src/rules/no-useless-return.md [new file with mode: 0644]
eslint/docs/src/rules/no-var.md [new file with mode: 0644]
eslint/docs/src/rules/no-void.md [new file with mode: 0644]
eslint/docs/src/rules/no-warning-comments.md [new file with mode: 0644]
eslint/docs/src/rules/no-whitespace-before-property.md [new file with mode: 0644]
eslint/docs/src/rules/no-with.md [new file with mode: 0644]
eslint/docs/src/rules/no-wrap-func.md [new file with mode: 0644]
eslint/docs/src/rules/nonblock-statement-body-position.md [new file with mode: 0644]
eslint/docs/src/rules/object-curly-newline.md [new file with mode: 0644]
eslint/docs/src/rules/object-curly-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/object-property-newline.md [new file with mode: 0644]
eslint/docs/src/rules/object-shorthand.md [new file with mode: 0644]
eslint/docs/src/rules/one-var-declaration-per-line.md [new file with mode: 0644]
eslint/docs/src/rules/one-var.md [new file with mode: 0644]
eslint/docs/src/rules/operator-assignment.md [new file with mode: 0644]
eslint/docs/src/rules/operator-linebreak.md [new file with mode: 0644]
eslint/docs/src/rules/padded-blocks.md [new file with mode: 0644]
eslint/docs/src/rules/padding-line-between-statements.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-arrow-callback.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-const.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-destructuring.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-exponentiation-operator.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-named-capture-group.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-numeric-literals.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-object-has-own.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-object-spread.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-promise-reject-errors.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-reflect.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-regex-literals.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-rest-params.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-spread.md [new file with mode: 0644]
eslint/docs/src/rules/prefer-template.md [new file with mode: 0644]
eslint/docs/src/rules/quote-props.md [new file with mode: 0644]
eslint/docs/src/rules/quotes.md [new file with mode: 0644]
eslint/docs/src/rules/radix.md [new file with mode: 0644]
eslint/docs/src/rules/require-atomic-updates.md [new file with mode: 0644]
eslint/docs/src/rules/require-await.md [new file with mode: 0644]
eslint/docs/src/rules/require-jsdoc.md [new file with mode: 0644]
eslint/docs/src/rules/require-unicode-regexp.md [new file with mode: 0644]
eslint/docs/src/rules/require-yield.md [new file with mode: 0644]
eslint/docs/src/rules/rest-spread-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/semi-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/semi-style.md [new file with mode: 0644]
eslint/docs/src/rules/semi.md [new file with mode: 0644]
eslint/docs/src/rules/sort-imports.md [new file with mode: 0644]
eslint/docs/src/rules/sort-keys.md [new file with mode: 0644]
eslint/docs/src/rules/sort-vars.md [new file with mode: 0644]
eslint/docs/src/rules/space-after-function-name.md [new file with mode: 0644]
eslint/docs/src/rules/space-after-keywords.md [new file with mode: 0644]
eslint/docs/src/rules/space-before-blocks.md [new file with mode: 0644]
eslint/docs/src/rules/space-before-function-paren.md [new file with mode: 0644]
eslint/docs/src/rules/space-before-function-parentheses.md [new file with mode: 0644]
eslint/docs/src/rules/space-before-keywords.md [new file with mode: 0644]
eslint/docs/src/rules/space-in-brackets.md [new file with mode: 0644]
eslint/docs/src/rules/space-in-parens.md [new file with mode: 0644]
eslint/docs/src/rules/space-infix-ops.md [new file with mode: 0644]
eslint/docs/src/rules/space-return-throw-case.md [new file with mode: 0644]
eslint/docs/src/rules/space-unary-ops.md [new file with mode: 0644]
eslint/docs/src/rules/space-unary-word-ops.md [new file with mode: 0644]
eslint/docs/src/rules/spaced-comment.md [new file with mode: 0644]
eslint/docs/src/rules/spaced-line-comment.md [new file with mode: 0644]
eslint/docs/src/rules/strict.md [new file with mode: 0644]
eslint/docs/src/rules/switch-colon-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/symbol-description.md [new file with mode: 0644]
eslint/docs/src/rules/template-curly-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/template-tag-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/unicode-bom.md [new file with mode: 0644]
eslint/docs/src/rules/use-isnan.md [new file with mode: 0644]
eslint/docs/src/rules/valid-jsdoc.md [new file with mode: 0644]
eslint/docs/src/rules/valid-typeof.md [new file with mode: 0644]
eslint/docs/src/rules/vars-on-top.md [new file with mode: 0644]
eslint/docs/src/rules/wrap-iife.md [new file with mode: 0644]
eslint/docs/src/rules/wrap-regex.md [new file with mode: 0644]
eslint/docs/src/rules/yield-star-spacing.md [new file with mode: 0644]
eslint/docs/src/rules/yoda.md [new file with mode: 0644]
eslint/docs/src/src.json [new file with mode: 0644]
eslint/docs/src/static/apple-touch-icon.png [new file with mode: 0644]
eslint/docs/src/static/favicon-32x32.png [new file with mode: 0644]
eslint/docs/src/static/favicon.ico [new file with mode: 0644]
eslint/docs/src/static/favicon.png [new file with mode: 0644]
eslint/docs/src/static/feed.njk [new file with mode: 0644]
eslint/docs/src/static/icon-192.png [new file with mode: 0644]
eslint/docs/src/static/icon-512.png [new file with mode: 0644]
eslint/docs/src/static/icon.svg [new file with mode: 0644]
eslint/docs/src/static/manifest.webmanifest [new file with mode: 0644]
eslint/docs/src/static/robots.njk [new file with mode: 0644]
eslint/docs/src/static/serviceworker.js [new file with mode: 0644]
eslint/docs/src/static/sitemap.njk [new file with mode: 0644]
eslint/docs/src/user-guide/command-line-interface.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/configuration-files-new.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/configuration-files.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/ignoring-code.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/index.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/language-options.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/plugins.md [new file with mode: 0644]
eslint/docs/src/user-guide/configuring/rules.md [new file with mode: 0644]
eslint/docs/src/user-guide/formatters/html-formatter-example.html [new file with mode: 0644]
eslint/docs/src/user-guide/formatters/index.md [new file with mode: 0644]
eslint/docs/src/user-guide/getting-started.md [new file with mode: 0644]
eslint/docs/src/user-guide/index.md [new file with mode: 0644]
eslint/docs/src/user-guide/integrations.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-from-jscs.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-1.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-2.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-3.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-4.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-5.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-6.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-7.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/migrating-to-8.0.0.md [new file with mode: 0644]
eslint/docs/src/user-guide/rule-deprecation.md [new file with mode: 0644]
eslint/docs/user-guide/README.md [deleted file]
eslint/docs/user-guide/command-line-interface.md [deleted file]
eslint/docs/user-guide/configuring/README.md [deleted file]
eslint/docs/user-guide/configuring/configuration-files.md [deleted file]
eslint/docs/user-guide/configuring/ignoring-code.md [deleted file]
eslint/docs/user-guide/configuring/language-options.md [deleted file]
eslint/docs/user-guide/configuring/plugins.md [deleted file]
eslint/docs/user-guide/configuring/rules.md [deleted file]
eslint/docs/user-guide/getting-started.md [deleted file]
eslint/docs/user-guide/integrations.md [deleted file]
eslint/docs/user-guide/migrating-from-jscs.md [deleted file]
eslint/docs/user-guide/migrating-to-1.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-2.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-3.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-4.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-5.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-6.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-7.0.0.md [deleted file]
eslint/docs/user-guide/migrating-to-8.0.0.md [deleted file]
eslint/docs/user-guide/rule-deprecation.md [deleted file]
eslint/eslint.config.js [new file with mode: 0644]
eslint/lib/cli-engine/cli-engine.js
eslint/lib/cli-engine/file-enumerator.js
eslint/lib/cli-engine/formatters/html.js
eslint/lib/cli-engine/lint-result-cache.js
eslint/lib/cli.js
eslint/lib/config/default-config.js
eslint/lib/config/flat-config-array.js
eslint/lib/config/flat-config-helpers.js
eslint/lib/config/rule-validator.js
eslint/lib/eslint/eslint.js
eslint/lib/eslint/flat-eslint.js [new file with mode: 0644]
eslint/lib/eslint/index.js
eslint/lib/init/autoconfig.js [deleted file]
eslint/lib/init/config-file.js [deleted file]
eslint/lib/init/config-initializer.js [deleted file]
eslint/lib/init/config-rule.js [deleted file]
eslint/lib/init/npm-utils.js [deleted file]
eslint/lib/init/source-code-utils.js [deleted file]
eslint/lib/linter/apply-disable-directives.js
eslint/lib/linter/code-path-analysis/code-path-segment.js
eslint/lib/linter/code-path-analysis/code-path-state.js
eslint/lib/linter/code-path-analysis/code-path.js
eslint/lib/linter/code-path-analysis/debug-helpers.js
eslint/lib/linter/code-path-analysis/id-generator.js
eslint/lib/linter/config-comment-parser.js
eslint/lib/linter/linter.js
eslint/lib/linter/timing.js
eslint/lib/options.js
eslint/lib/rule-tester/flat-rule-tester.js [new file with mode: 0644]
eslint/lib/rule-tester/rule-tester.js
eslint/lib/rules/accessor-pairs.js
eslint/lib/rules/array-bracket-newline.js
eslint/lib/rules/array-bracket-spacing.js
eslint/lib/rules/array-callback-return.js
eslint/lib/rules/array-element-newline.js
eslint/lib/rules/arrow-body-style.js
eslint/lib/rules/arrow-parens.js
eslint/lib/rules/arrow-spacing.js
eslint/lib/rules/block-scoped-var.js
eslint/lib/rules/block-spacing.js
eslint/lib/rules/brace-style.js
eslint/lib/rules/callback-return.js
eslint/lib/rules/camelcase.js
eslint/lib/rules/capitalized-comments.js
eslint/lib/rules/class-methods-use-this.js
eslint/lib/rules/comma-dangle.js
eslint/lib/rules/comma-spacing.js
eslint/lib/rules/comma-style.js
eslint/lib/rules/complexity.js
eslint/lib/rules/computed-property-spacing.js
eslint/lib/rules/consistent-return.js
eslint/lib/rules/consistent-this.js
eslint/lib/rules/constructor-super.js
eslint/lib/rules/curly.js
eslint/lib/rules/default-case-last.js
eslint/lib/rules/default-case.js
eslint/lib/rules/default-param-last.js
eslint/lib/rules/dot-location.js
eslint/lib/rules/dot-notation.js
eslint/lib/rules/eol-last.js
eslint/lib/rules/eqeqeq.js
eslint/lib/rules/for-direction.js
eslint/lib/rules/func-call-spacing.js
eslint/lib/rules/func-name-matching.js
eslint/lib/rules/func-names.js
eslint/lib/rules/func-style.js
eslint/lib/rules/function-call-argument-newline.js
eslint/lib/rules/function-paren-newline.js
eslint/lib/rules/generator-star-spacing.js
eslint/lib/rules/getter-return.js
eslint/lib/rules/global-require.js
eslint/lib/rules/grouped-accessor-pairs.js
eslint/lib/rules/guard-for-in.js
eslint/lib/rules/handle-callback-err.js
eslint/lib/rules/id-blacklist.js
eslint/lib/rules/id-denylist.js
eslint/lib/rules/id-length.js
eslint/lib/rules/id-match.js
eslint/lib/rules/implicit-arrow-linebreak.js
eslint/lib/rules/indent-legacy.js
eslint/lib/rules/indent.js
eslint/lib/rules/index.js
eslint/lib/rules/init-declarations.js
eslint/lib/rules/jsx-quotes.js
eslint/lib/rules/key-spacing.js
eslint/lib/rules/keyword-spacing.js
eslint/lib/rules/line-comment-position.js
eslint/lib/rules/linebreak-style.js
eslint/lib/rules/lines-around-comment.js
eslint/lib/rules/lines-around-directive.js
eslint/lib/rules/lines-between-class-members.js
eslint/lib/rules/max-classes-per-file.js
eslint/lib/rules/max-depth.js
eslint/lib/rules/max-len.js
eslint/lib/rules/max-lines-per-function.js
eslint/lib/rules/max-lines.js
eslint/lib/rules/max-nested-callbacks.js
eslint/lib/rules/max-params.js
eslint/lib/rules/max-statements-per-line.js
eslint/lib/rules/max-statements.js
eslint/lib/rules/multiline-comment-style.js
eslint/lib/rules/multiline-ternary.js
eslint/lib/rules/new-cap.js
eslint/lib/rules/new-parens.js
eslint/lib/rules/newline-after-var.js
eslint/lib/rules/newline-before-return.js
eslint/lib/rules/newline-per-chained-call.js
eslint/lib/rules/no-alert.js
eslint/lib/rules/no-array-constructor.js
eslint/lib/rules/no-async-promise-executor.js
eslint/lib/rules/no-await-in-loop.js
eslint/lib/rules/no-bitwise.js
eslint/lib/rules/no-buffer-constructor.js
eslint/lib/rules/no-caller.js
eslint/lib/rules/no-case-declarations.js
eslint/lib/rules/no-catch-shadow.js
eslint/lib/rules/no-class-assign.js
eslint/lib/rules/no-compare-neg-zero.js
eslint/lib/rules/no-cond-assign.js
eslint/lib/rules/no-confusing-arrow.js
eslint/lib/rules/no-console.js
eslint/lib/rules/no-const-assign.js
eslint/lib/rules/no-constant-binary-expression.js [new file with mode: 0644]
eslint/lib/rules/no-constant-condition.js
eslint/lib/rules/no-constructor-return.js
eslint/lib/rules/no-continue.js
eslint/lib/rules/no-control-regex.js
eslint/lib/rules/no-debugger.js
eslint/lib/rules/no-delete-var.js
eslint/lib/rules/no-div-regex.js
eslint/lib/rules/no-dupe-args.js
eslint/lib/rules/no-dupe-class-members.js
eslint/lib/rules/no-dupe-else-if.js
eslint/lib/rules/no-dupe-keys.js
eslint/lib/rules/no-duplicate-case.js
eslint/lib/rules/no-duplicate-imports.js
eslint/lib/rules/no-else-return.js
eslint/lib/rules/no-empty-character-class.js
eslint/lib/rules/no-empty-function.js
eslint/lib/rules/no-empty-pattern.js
eslint/lib/rules/no-empty.js
eslint/lib/rules/no-eq-null.js
eslint/lib/rules/no-eval.js
eslint/lib/rules/no-ex-assign.js
eslint/lib/rules/no-extend-native.js
eslint/lib/rules/no-extra-bind.js
eslint/lib/rules/no-extra-boolean-cast.js
eslint/lib/rules/no-extra-label.js
eslint/lib/rules/no-extra-parens.js
eslint/lib/rules/no-extra-semi.js
eslint/lib/rules/no-fallthrough.js
eslint/lib/rules/no-floating-decimal.js
eslint/lib/rules/no-func-assign.js
eslint/lib/rules/no-global-assign.js
eslint/lib/rules/no-implicit-coercion.js
eslint/lib/rules/no-implicit-globals.js
eslint/lib/rules/no-implied-eval.js
eslint/lib/rules/no-import-assign.js
eslint/lib/rules/no-inline-comments.js
eslint/lib/rules/no-inner-declarations.js
eslint/lib/rules/no-invalid-regexp.js
eslint/lib/rules/no-invalid-this.js
eslint/lib/rules/no-irregular-whitespace.js
eslint/lib/rules/no-iterator.js
eslint/lib/rules/no-label-var.js
eslint/lib/rules/no-labels.js
eslint/lib/rules/no-lone-blocks.js
eslint/lib/rules/no-lonely-if.js
eslint/lib/rules/no-loop-func.js
eslint/lib/rules/no-loss-of-precision.js
eslint/lib/rules/no-magic-numbers.js
eslint/lib/rules/no-misleading-character-class.js
eslint/lib/rules/no-mixed-operators.js
eslint/lib/rules/no-mixed-requires.js
eslint/lib/rules/no-mixed-spaces-and-tabs.js
eslint/lib/rules/no-multi-assign.js
eslint/lib/rules/no-multi-spaces.js
eslint/lib/rules/no-multi-str.js
eslint/lib/rules/no-multiple-empty-lines.js
eslint/lib/rules/no-native-reassign.js
eslint/lib/rules/no-negated-condition.js
eslint/lib/rules/no-negated-in-lhs.js
eslint/lib/rules/no-nested-ternary.js
eslint/lib/rules/no-new-func.js
eslint/lib/rules/no-new-object.js
eslint/lib/rules/no-new-require.js
eslint/lib/rules/no-new-symbol.js
eslint/lib/rules/no-new-wrappers.js
eslint/lib/rules/no-new.js
eslint/lib/rules/no-nonoctal-decimal-escape.js
eslint/lib/rules/no-obj-calls.js
eslint/lib/rules/no-octal-escape.js
eslint/lib/rules/no-octal.js
eslint/lib/rules/no-param-reassign.js
eslint/lib/rules/no-path-concat.js
eslint/lib/rules/no-plusplus.js
eslint/lib/rules/no-process-env.js
eslint/lib/rules/no-process-exit.js
eslint/lib/rules/no-promise-executor-return.js
eslint/lib/rules/no-proto.js
eslint/lib/rules/no-prototype-builtins.js
eslint/lib/rules/no-redeclare.js
eslint/lib/rules/no-regex-spaces.js
eslint/lib/rules/no-restricted-exports.js
eslint/lib/rules/no-restricted-globals.js
eslint/lib/rules/no-restricted-imports.js
eslint/lib/rules/no-restricted-modules.js
eslint/lib/rules/no-restricted-properties.js
eslint/lib/rules/no-restricted-syntax.js
eslint/lib/rules/no-return-assign.js
eslint/lib/rules/no-return-await.js
eslint/lib/rules/no-script-url.js
eslint/lib/rules/no-self-assign.js
eslint/lib/rules/no-self-compare.js
eslint/lib/rules/no-sequences.js
eslint/lib/rules/no-setter-return.js
eslint/lib/rules/no-shadow-restricted-names.js
eslint/lib/rules/no-shadow.js
eslint/lib/rules/no-spaced-func.js
eslint/lib/rules/no-sparse-arrays.js
eslint/lib/rules/no-sync.js
eslint/lib/rules/no-tabs.js
eslint/lib/rules/no-template-curly-in-string.js
eslint/lib/rules/no-ternary.js
eslint/lib/rules/no-this-before-super.js
eslint/lib/rules/no-throw-literal.js
eslint/lib/rules/no-trailing-spaces.js
eslint/lib/rules/no-undef-init.js
eslint/lib/rules/no-undef.js
eslint/lib/rules/no-undefined.js
eslint/lib/rules/no-underscore-dangle.js
eslint/lib/rules/no-unexpected-multiline.js
eslint/lib/rules/no-unmodified-loop-condition.js
eslint/lib/rules/no-unneeded-ternary.js
eslint/lib/rules/no-unreachable-loop.js
eslint/lib/rules/no-unreachable.js
eslint/lib/rules/no-unsafe-finally.js
eslint/lib/rules/no-unsafe-negation.js
eslint/lib/rules/no-unsafe-optional-chaining.js
eslint/lib/rules/no-unused-expressions.js
eslint/lib/rules/no-unused-labels.js
eslint/lib/rules/no-unused-private-class-members.js
eslint/lib/rules/no-unused-vars.js
eslint/lib/rules/no-use-before-define.js
eslint/lib/rules/no-useless-backreference.js
eslint/lib/rules/no-useless-call.js
eslint/lib/rules/no-useless-catch.js
eslint/lib/rules/no-useless-computed-key.js
eslint/lib/rules/no-useless-concat.js
eslint/lib/rules/no-useless-constructor.js
eslint/lib/rules/no-useless-escape.js
eslint/lib/rules/no-useless-rename.js
eslint/lib/rules/no-useless-return.js
eslint/lib/rules/no-var.js
eslint/lib/rules/no-void.js
eslint/lib/rules/no-warning-comments.js
eslint/lib/rules/no-whitespace-before-property.js
eslint/lib/rules/no-with.js
eslint/lib/rules/nonblock-statement-body-position.js
eslint/lib/rules/object-curly-newline.js
eslint/lib/rules/object-curly-spacing.js
eslint/lib/rules/object-property-newline.js
eslint/lib/rules/object-shorthand.js
eslint/lib/rules/one-var-declaration-per-line.js
eslint/lib/rules/one-var.js
eslint/lib/rules/operator-assignment.js
eslint/lib/rules/operator-linebreak.js
eslint/lib/rules/padded-blocks.js
eslint/lib/rules/padding-line-between-statements.js
eslint/lib/rules/prefer-arrow-callback.js
eslint/lib/rules/prefer-const.js
eslint/lib/rules/prefer-destructuring.js
eslint/lib/rules/prefer-exponentiation-operator.js
eslint/lib/rules/prefer-named-capture-group.js
eslint/lib/rules/prefer-numeric-literals.js
eslint/lib/rules/prefer-object-has-own.js [new file with mode: 0644]
eslint/lib/rules/prefer-object-spread.js
eslint/lib/rules/prefer-promise-reject-errors.js
eslint/lib/rules/prefer-reflect.js
eslint/lib/rules/prefer-regex-literals.js
eslint/lib/rules/prefer-rest-params.js
eslint/lib/rules/prefer-spread.js
eslint/lib/rules/prefer-template.js
eslint/lib/rules/quote-props.js
eslint/lib/rules/quotes.js
eslint/lib/rules/radix.js
eslint/lib/rules/require-atomic-updates.js
eslint/lib/rules/require-await.js
eslint/lib/rules/require-jsdoc.js
eslint/lib/rules/require-unicode-regexp.js
eslint/lib/rules/require-yield.js
eslint/lib/rules/rest-spread-spacing.js
eslint/lib/rules/semi-spacing.js
eslint/lib/rules/semi-style.js
eslint/lib/rules/semi.js
eslint/lib/rules/sort-imports.js
eslint/lib/rules/sort-keys.js
eslint/lib/rules/sort-vars.js
eslint/lib/rules/space-before-blocks.js
eslint/lib/rules/space-before-function-paren.js
eslint/lib/rules/space-in-parens.js
eslint/lib/rules/space-infix-ops.js
eslint/lib/rules/space-unary-ops.js
eslint/lib/rules/spaced-comment.js
eslint/lib/rules/strict.js
eslint/lib/rules/switch-colon-spacing.js
eslint/lib/rules/symbol-description.js
eslint/lib/rules/template-curly-spacing.js
eslint/lib/rules/template-tag-spacing.js
eslint/lib/rules/unicode-bom.js
eslint/lib/rules/use-isnan.js
eslint/lib/rules/utils/ast-utils.js
eslint/lib/rules/valid-jsdoc.js
eslint/lib/rules/valid-typeof.js
eslint/lib/rules/vars-on-top.js
eslint/lib/rules/wrap-iife.js
eslint/lib/rules/wrap-regex.js
eslint/lib/rules/yield-star-spacing.js
eslint/lib/rules/yoda.js
eslint/lib/shared/deprecation-warnings.js
eslint/lib/shared/logging.js
eslint/lib/shared/types.js
eslint/lib/source-code/token-store/cursor.js
eslint/lib/unsupported-api.js
eslint/messages/all-files-ignored.js
eslint/messages/extend-config-missing.js
eslint/messages/failed-to-read-json.js
eslint/messages/file-not-found.js
eslint/messages/no-config-found.js
eslint/messages/plugin-invalid.js
eslint/messages/plugin-missing.js
eslint/messages/print-config-with-directory-path.js
eslint/messages/whitespace-found.js
eslint/package.json
eslint/templates/blogpost.md.ejs
eslint/templates/formatter-examples.md.ejs
eslint/tests/_utils/test-lazy-loading-rules.js [new file with mode: 0644]
eslint/tests/bin/eslint.js
eslint/tests/fixtures/autoconfig/source-with-comments.js [deleted file]
eslint/tests/fixtures/autoconfig/source.js [deleted file]
eslint/tests/fixtures/bin/eslint.config.js [new file with mode: 0644]
eslint/tests/fixtures/cli-engine/deprecated-rule-config/eslint.config.js [new file with mode: 0644]
eslint/tests/fixtures/config-hierarchy/broken/add-conf.js [new file with mode: 0644]
eslint/tests/fixtures/config-hierarchy/broken/override-conf.js [new file with mode: 0644]
eslint/tests/fixtures/config-initializer/lib/doubleQuotes.js [deleted file]
eslint/tests/fixtures/config-initializer/lib/no-semi.js [deleted file]
eslint/tests/fixtures/config-initializer/new-es-features/new-es-features.js [deleted file]
eslint/tests/fixtures/config-initializer/parse-error/parse-error.js [deleted file]
eslint/tests/fixtures/config-initializer/singleQuotes.js [deleted file]
eslint/tests/fixtures/config-initializer/tests/console-log.js [deleted file]
eslint/tests/fixtures/config-initializer/tests/doubleQuotes.js [deleted file]
eslint/tests/fixtures/configurations/env-browser.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/env-node.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/es6.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/plugins-with-prefix.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/processors.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/quotes-error.js [new file with mode: 0644]
eslint/tests/fixtures/configurations/semi-error.js [new file with mode: 0644]
eslint/tests/fixtures/eslint.config.js [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/.eslintignoreForNegationTest [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/.eslintignoreWithEscapedBrackets [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/brackets/[index.js [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/brackets/[index].js [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/brackets/index.js [new file with mode: 0644]
eslint/tests/fixtures/ignored-paths/brackets/index].js [new file with mode: 0644]
eslint/tests/fixtures/lazy-loading-rules/.eslintrc.js [new file with mode: 0644]
eslint/tests/fixtures/lazy-loading-rules/foo.js [new file with mode: 0644]
eslint/tests/fixtures/max-warnings/eslint.config.js [new file with mode: 0644]
eslint/tests/fixtures/parsers/arrow-parens/identifer-type.js [deleted file]
eslint/tests/fixtures/parsers/arrow-parens/identifier-type.js [new file with mode: 0644]
eslint/tests/fixtures/parsers/function-paren-newline/arrow-function-return-type.js [new file with mode: 0644]
eslint/tests/fixtures/rules/eslint.js [new file with mode: 0644]
eslint/tests/fixtures/rules/missing-rule.js [new file with mode: 0644]
eslint/tests/fixtures/shallow-glob/eslint.config.js [new file with mode: 0644]
eslint/tests/fixtures/shallow-glob/subdir/broken.js [new file with mode: 0644]
eslint/tests/fixtures/shallow-glob/subdir/subsubdir/broken.js [new file with mode: 0644]
eslint/tests/fixtures/shallow-glob/subdir/subsubdir/plain.jsx [new file with mode: 0644]
eslint/tests/fixtures/shallow-glob/target-dir/passing.js [new file with mode: 0644]
eslint/tests/fixtures/testers/rule-tester/modify-ast-at-first.js
eslint/tests/fixtures/testers/rule-tester/modify-ast-at-last.js
eslint/tests/fixtures/testers/rule-tester/modify-ast.js
eslint/tests/fixtures/testers/rule-tester/no-eval.js
eslint/tests/fixtures/testers/rule-tester/no-invalid-args.js
eslint/tests/fixtures/testers/rule-tester/no-invalid-schema.js
eslint/tests/fixtures/testers/rule-tester/no-schema-violation.js
eslint/tests/fixtures/testers/rule-tester/no-test-filename
eslint/tests/fixtures/testers/rule-tester/no-test-global.js
eslint/tests/fixtures/testers/rule-tester/no-test-settings.js
eslint/tests/fixtures/testers/rule-tester/no-var.js
eslint/tests/lib/cli-engine/cli-engine.js
eslint/tests/lib/cli-engine/file-enumerator.js
eslint/tests/lib/cli.js
eslint/tests/lib/config/flat-config-array.js
eslint/tests/lib/config/flat-config-helpers.js [new file with mode: 0644]
eslint/tests/lib/eslint/eslint.config.js [new file with mode: 0644]
eslint/tests/lib/eslint/eslint.js
eslint/tests/lib/eslint/flat-eslint.js [new file with mode: 0644]
eslint/tests/lib/init/autoconfig.js [deleted file]
eslint/tests/lib/init/config-file.js [deleted file]
eslint/tests/lib/init/config-initializer.js [deleted file]
eslint/tests/lib/init/config-rule.js [deleted file]
eslint/tests/lib/init/npm-utils.js [deleted file]
eslint/tests/lib/init/source-code-utils.js [deleted file]
eslint/tests/lib/linter/apply-disable-directives.js
eslint/tests/lib/linter/code-path-analysis/code-path.js
eslint/tests/lib/linter/config-comment-parser.js
eslint/tests/lib/linter/linter.js
eslint/tests/lib/linter/node-event-generator.js
eslint/tests/lib/options.js
eslint/tests/lib/rule-tester/flat-rule-tester.js [new file with mode: 0644]
eslint/tests/lib/rule-tester/rule-tester.js
eslint/tests/lib/rules/array-bracket-newline.js
eslint/tests/lib/rules/arrow-parens.js
eslint/tests/lib/rules/camelcase.js
eslint/tests/lib/rules/comma-dangle.js
eslint/tests/lib/rules/comma-spacing.js
eslint/tests/lib/rules/computed-property-spacing.js
eslint/tests/lib/rules/function-paren-newline.js
eslint/tests/lib/rules/id-match.js
eslint/tests/lib/rules/indent.js
eslint/tests/lib/rules/key-spacing.js
eslint/tests/lib/rules/keyword-spacing.js
eslint/tests/lib/rules/lines-around-comment.js
eslint/tests/lib/rules/max-lines-per-function.js
eslint/tests/lib/rules/no-confusing-arrow.js
eslint/tests/lib/rules/no-constant-binary-expression.js [new file with mode: 0644]
eslint/tests/lib/rules/no-constant-condition.js
eslint/tests/lib/rules/no-control-regex.js
eslint/tests/lib/rules/no-eval.js
eslint/tests/lib/rules/no-extra-parens.js
eslint/tests/lib/rules/no-fallthrough.js
eslint/tests/lib/rules/no-inline-comments.js
eslint/tests/lib/rules/no-invalid-this.js
eslint/tests/lib/rules/no-misleading-character-class.js
eslint/tests/lib/rules/no-multi-assign.js
eslint/tests/lib/rules/no-octal.js
eslint/tests/lib/rules/no-redeclare.js
eslint/tests/lib/rules/no-restricted-exports.js
eslint/tests/lib/rules/no-restricted-imports.js
eslint/tests/lib/rules/no-self-assign.js
eslint/tests/lib/rules/no-shadow.js
eslint/tests/lib/rules/no-underscore-dangle.js
eslint/tests/lib/rules/no-unused-vars.js
eslint/tests/lib/rules/no-use-before-define.js
eslint/tests/lib/rules/no-useless-rename.js
eslint/tests/lib/rules/no-warning-comments.js
eslint/tests/lib/rules/object-shorthand.js
eslint/tests/lib/rules/operator-assignment.js
eslint/tests/lib/rules/padding-line-between-statements.js
eslint/tests/lib/rules/prefer-const.js
eslint/tests/lib/rules/prefer-object-has-own.js [new file with mode: 0644]
eslint/tests/lib/rules/prefer-regex-literals.js
eslint/tests/lib/rules/prefer-template.js
eslint/tests/lib/rules/quotes.js
eslint/tests/lib/rules/sort-keys.js
eslint/tests/lib/rules/space-unary-ops.js
eslint/tests/lib/rules/utils/ast-utils.js
eslint/tests/lib/rules/utils/fix-tracker.js
eslint/tests/lib/rules/valid-typeof.js
eslint/tests/lib/rules/wrap-iife.js
eslint/tests/lib/unsupported-api.js
eslint/tests/tools/config-rule.js [new file with mode: 0644]
eslint/tools/code-sample-minimizer.js
eslint/tools/config-rule.js [new file with mode: 0644]
eslint/tools/fetch-docs-links.js [new file with mode: 0644]
eslint/tools/internal-rules/no-invalid-meta.js
eslint/tools/internal-testers/event-generator-tester.js
eslint/tools/rule-types.json

index ec492fa76f3c78557e7edcd29b3bfe257e13efa9..66b36f6468841ea5afc3bd809ad708e01316c971 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
 
 SRCDIR=src
 UPSTREAM=eslint
-UPSTREAMTAG=v8.4.0
+UPSTREAMTAG=v8.23.1
 BUILDSRC=${UPSTREAM}-${UPSTREAMTAG}
 
 all: ${DEB}
diff --git a/eslint/.c8rc b/eslint/.c8rc
new file mode 100644 (file)
index 0000000..040f203
--- /dev/null
@@ -0,0 +1,13 @@
+{
+    "include": [
+        "bin/**/*.js",
+        "conf/**/*.js",
+        "lib/**/*.js"
+    ],
+    "reporter": [
+        "lcov",
+        "text-summary",
+        "cobertura"
+    ],
+    "sourceMap": true
+}
index b8414c9c832d970721d290cbada4ef8717de60ee..905f2a39ddf278e5d45886ad87441d5400fefcba 100644 (file)
@@ -1,6 +1,7 @@
 /build/**
 /coverage/**
 /docs/**
+!/docs/.eleventy.js
 /jsdoc/**
 /templates/**
 /tests/bench/**
index f97d93a1bf5ea3c42aa6f382b2e4344b7b45b7bd..1a39568fee0c36693c4ebfcaa0235edb95a29d88 100644 (file)
@@ -1,10 +1,26 @@
+/*
+ * IMPORTANT!
+ *
+ * Any changes made to this file must also be made to eslint.config.js.
+ *
+ * Internally, ESLint is using the eslint.config.js file to lint itself.
+ * This file is needed too, because:
+ *
+ * 1. There are tests that expect .eslintrc.js to be present to actually run.
+ * 2. ESLint VS Code extension expects eslintrc config files to be
+ *    present to work correctly.
+ *
+ * Once we no longer need to support both eslintrc and flat config, we will
+ * remove this file.
+ */
+
+
 "use strict";
 
 const path = require("path");
 
 const INTERNAL_FILES = {
     CLI_ENGINE_PATTERN: "lib/cli-engine/**/*",
-    INIT_PATTERN: "lib/init/**/*",
     LINTER_PATTERN: "lib/linter/**/*",
     RULE_TESTER_PATTERN: "lib/rule-tester/**/*",
     RULES_PATTERN: "lib/rules/**/*",
@@ -47,8 +63,7 @@ module.exports = {
         "internal-rules"
     ],
     extends: [
-        "eslint",
-        "plugin:eslint-plugin/recommended"
+        "eslint"
     ],
     parserOptions: {
         ecmaVersion: 2021
@@ -64,21 +79,29 @@ module.exports = {
         }
     },
     rules: {
-        "eslint-plugin/prefer-message-ids": "error",
-        "eslint-plugin/prefer-output-null": "error",
-        "eslint-plugin/prefer-placeholders": "error",
-        "eslint-plugin/prefer-replace-text": "error",
-        "eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
-        "eslint-plugin/require-meta-docs-description": "error",
-        "eslint-plugin/test-case-property-ordering": "error",
-        "eslint-plugin/test-case-shorthand-strings": "error",
         "internal-rules/multiline-comment-style": "error"
     },
     overrides: [
+        {
+            files: ["tools/*.js"],
+            rules: {
+                "no-console": "off"
+            }
+        },
         {
             files: ["lib/rules/*", "tools/internal-rules/*"],
             excludedFiles: ["index.js"],
+            extends: [
+                "plugin:eslint-plugin/rules-recommended"
+            ],
             rules: {
+                "eslint-plugin/no-missing-message-ids": "error",
+                "eslint-plugin/no-unused-message-ids": "error",
+                "eslint-plugin/prefer-message-ids": "error",
+                "eslint-plugin/prefer-placeholders": "error",
+                "eslint-plugin/prefer-replace-text": "error",
+                "eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
+                "eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow)" }],
                 "internal-rules/no-invalid-meta": "error"
             }
         },
@@ -89,6 +112,17 @@ module.exports = {
                 "eslint-plugin/require-meta-docs-url": ["error", { pattern: "https://eslint.org/docs/rules/{{name}}" }]
             }
         },
+        {
+            files: ["tests/lib/rules/*", "tests/tools/internal-rules/*"],
+            extends: [
+                "plugin:eslint-plugin/tests-recommended"
+            ],
+            rules: {
+                "eslint-plugin/prefer-output-null": "error",
+                "eslint-plugin/test-case-property-ordering": "error",
+                "eslint-plugin/test-case-shorthand-strings": "error"
+            }
+        },
         {
             files: ["tests/**/*"],
             env: { mocha: true },
@@ -105,7 +139,7 @@ module.exports = {
             files: ["lib/*"],
             excludedFiles: ["lib/unsupported-api.js"],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns()
                 ]]
             }
@@ -113,29 +147,18 @@ module.exports = {
         {
             files: [INTERNAL_FILES.CLI_ENGINE_PATTERN],
             rules: {
-                "node/no-restricted-require": ["error", [
-                    ...createInternalFilesPatterns(INTERNAL_FILES.CLI_ENGINE_PATTERN),
-                    resolveAbsolutePath("lib/init/index.js")
-                ]]
-            }
-        },
-        {
-            files: [INTERNAL_FILES.INIT_PATTERN],
-            rules: {
-                "node/no-restricted-require": ["error", [
-                    ...createInternalFilesPatterns(INTERNAL_FILES.INIT_PATTERN),
-                    resolveAbsolutePath("lib/rule-tester/index.js")
+                "n/no-restricted-require": ["error", [
+                    ...createInternalFilesPatterns(INTERNAL_FILES.CLI_ENGINE_PATTERN)
                 ]]
             }
         },
         {
             files: [INTERNAL_FILES.LINTER_PATTERN],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns(INTERNAL_FILES.LINTER_PATTERN),
                     "fs",
                     resolveAbsolutePath("lib/cli-engine/index.js"),
-                    resolveAbsolutePath("lib/init/index.js"),
                     resolveAbsolutePath("lib/rule-tester/index.js")
                 ]]
             }
@@ -143,11 +166,10 @@ module.exports = {
         {
             files: [INTERNAL_FILES.RULES_PATTERN],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns(INTERNAL_FILES.RULES_PATTERN),
                     "fs",
                     resolveAbsolutePath("lib/cli-engine/index.js"),
-                    resolveAbsolutePath("lib/init/index.js"),
                     resolveAbsolutePath("lib/linter/index.js"),
                     resolveAbsolutePath("lib/rule-tester/index.js"),
                     resolveAbsolutePath("lib/source-code/index.js")
@@ -157,10 +179,9 @@ module.exports = {
         {
             files: ["lib/shared/**/*"],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns(),
                     resolveAbsolutePath("lib/cli-engine/index.js"),
-                    resolveAbsolutePath("lib/init/index.js"),
                     resolveAbsolutePath("lib/linter/index.js"),
                     resolveAbsolutePath("lib/rule-tester/index.js"),
                     resolveAbsolutePath("lib/source-code/index.js")
@@ -170,11 +191,10 @@ module.exports = {
         {
             files: [INTERNAL_FILES.SOURCE_CODE_PATTERN],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns(INTERNAL_FILES.SOURCE_CODE_PATTERN),
                     "fs",
                     resolveAbsolutePath("lib/cli-engine/index.js"),
-                    resolveAbsolutePath("lib/init/index.js"),
                     resolveAbsolutePath("lib/linter/index.js"),
                     resolveAbsolutePath("lib/rule-tester/index.js"),
                     resolveAbsolutePath("lib/rules/index.js")
@@ -184,10 +204,9 @@ module.exports = {
         {
             files: [INTERNAL_FILES.RULE_TESTER_PATTERN],
             rules: {
-                "node/no-restricted-require": ["error", [
+                "n/no-restricted-require": ["error", [
                     ...createInternalFilesPatterns(INTERNAL_FILES.RULE_TESTER_PATTERN),
-                    resolveAbsolutePath("lib/cli-engine/index.js"),
-                    resolveAbsolutePath("lib/init/index.js")
+                    resolveAbsolutePath("lib/cli-engine/index.js")
                 ]]
             }
         }
diff --git a/eslint/.github/ISSUE_TEMPLATE.md b/eslint/.github/ISSUE_TEMPLATE.md
deleted file mode 100644 (file)
index 3af794a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
-    ESLint adheres to the Open JS Foundation Code of Conduct:
-    https://eslint.org/conduct
-
-    This template is for bug reports. If you are here for another reason, please see below:
-
-    1. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules
-    2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes
-    3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes
-    4. If you have any questions, please stop by our chatroom: https://eslint.org/chat
-
-    Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.
--->
-
-**Tell us about your environment**
-
-<!--
-    If you are using ESLint v6.5.0 or later, you can run ESLint with the `--env-info` flag and paste the output here.
--->
-
-* **ESLint Version:**
-* **Node Version:**
-* **npm Version:**
-
-**What parser (default, `@babel/eslint-parser`, `@typescript-eslint/parser`, etc.) are you using?**
-
-**Please show your full configuration:**
-
-<details>
-<summary>Configuration</summary>
-
-<!-- Paste your configuration below: -->
-```js
-
-```
-
-</details>
-
-**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.**
-
-<!-- Paste the source code below: -->
-```js
-
-```
-
-<!-- Paste the command you used to run ESLint: -->
-```bash
-
-```
-
-**What did you expect to happen?**
-
-**What actually happened? Please include the actual, raw output from ESLint.**
diff --git a/eslint/.github/ISSUE_TEMPLATE/NEW_SYNTAX.md b/eslint/.github/ISSUE_TEMPLATE/NEW_SYNTAX.md
deleted file mode 100644 (file)
index e03cb6e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
----
-name: "\U0001F4DD Request new syntax support"
-about: Request new stage 4 syntax be supported.
-title: ''
-labels:
-    - core
-    - new syntax
-assignees: ''
-
----
-
-<!--
-    ESLint adheres to the Open JS Foundation Code of Conduct:
-    https://eslint.org/conduct
--->
-
-**What is the name of the syntax to implement?**
-
-<!-- for example, "class fields" -->
-
-**Please provide the TC39 URL for the syntax proposal:**
-
-
-
-**Please provide some example code for the new syntax:**
-
-```js
-// example code here
-```
-
-## Implementation Checklist
-
-Please check off all items that have already been completed. Be sure to paste the pull request URLs next to each item so we can verify the work as done.
-
-- [ ] Ecma262 update: <!-- paste PR URL for this syntax here -->
-- [ ] ESTree update: <!-- paste PR URL for this ESTree update here -->
-- [ ] Acorn update: <!-- paste PR URL for this syntax here -->
-- [ ] `eslint-visitor-keys` update: <!-- paste PR URL for this syntax here -->
-- [ ] `espree` update: <!-- paste PR URL for this syntax here -->
-- [ ] `eslint-scope` update: <!-- paste PR URL for this syntax here -->
-- [ ] `eslint` update: <!-- paste PR URL for this syntax here -->
-
-**Are you willing to submit a pull request to implement this syntax?**
index 8c477f4424002cd99e9000c6dfcc24b3cbe0fa30..18c135356382cbc8b9a8a06e39dfe97f5e038618 100644 (file)
@@ -39,7 +39,7 @@ body:
   attributes:
     label: What did you do?
     description: |
-      Please include a *minimal* reproduction case with source code, configuration file, any other information about how you're using ESLint. You can use Markdown in this field.
+      Please include a *minimal* reproduction case. If possible, include a link to a reproduction of the problem in the [ESLint demo](https://eslint.org/demo). Otherwise, include source code, configuration file(s), and any other information about how you're using ESLint. You can use Markdown in this field.
     value: |
       <details>
       <summary>Configuration</summary>
diff --git a/eslint/.github/ISSUE_TEMPLATE/new-syntax.yml b/eslint/.github/ISSUE_TEMPLATE/new-syntax.yml
new file mode 100644 (file)
index 0000000..467ff0f
--- /dev/null
@@ -0,0 +1,60 @@
+name: "\U0001F4DD Request for new syntax support"
+description: "Request new stage 4 syntax be supported."
+labels:
+  - core
+  - new syntax
+body:
+- type: markdown
+  attributes:
+    value: By opening an issue, you agree to abide by the [Open JS Foundation Code of Conduct](https://eslint.org/conduct).
+- type: input
+  attributes:
+    label: Syntax name
+    description: What is the name of the syntax to implement?
+    placeholder: e.g. "class fields"
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Syntax proposal URL
+    description: Please provide the TC39 URL for the syntax proposal.
+    placeholder: e.g. https://github.com/tc39/proposal-top-level-await
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Example code
+    description: Please provide some example code for the new syntax.
+    render: js
+  validations:
+    required: true
+- type: checkboxes
+  attributes:
+    label: Implementation Checklist
+    description: |
+      Please check off all items that have already been completed. Be sure to paste the pull request URLs next to each item so we can verify the work as done.
+    options:
+      - label: "Ecma262 update: <!-- paste PR URL for this syntax here -->"
+        required: false
+      - label: "ESTree update: <!-- paste PR URL for this ESTree update here -->"
+        required: false
+      - label: "Acorn update: <!-- paste PR URL for this syntax here -->"
+        required: false
+      - label: "`eslint-visitor-keys` update: <!-- paste PR URL for this syntax here -->"
+        required: false
+      - label: "`espree` update: <!-- paste PR URL for this syntax here -->"
+        required: false
+      - label: "`eslint-scope` update: <!-- paste PR URL for this syntax here -->"
+        required: false
+      - label: "`eslint` update: <!-- paste PR URL for this syntax here -->"
+        required: false
+- type: checkboxes
+  attributes:
+    label: Participation
+    options:
+      - label: I am willing to submit a pull request for this change.
+        required: false
+- type: textarea
+  attributes:
+    label: Additional comments
+    description: Is there anything else that's important for the team to know?
index e2d756628cb853ab08aaa9d8e91971bfe89d19d8..8c4bf8eb1b750b42fa55aba03fd052499a4b74a6 100644 (file)
@@ -1,7 +1,7 @@
 <!--
     Thank you for contributing!
 
-    ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
+    ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct).
 -->
 
 #### Prerequisites checklist
@@ -42,5 +42,6 @@
 
 #### What changes did you make? (Give an overview)
 
-
 #### Is there anything you'd like reviewers to focus on?
+
+<!-- markdownlint-disable-file MD004 -->
diff --git a/eslint/.github/dependabot.yml b/eslint/.github/dependabot.yml
new file mode 100644 (file)
index 0000000..5ace460
--- /dev/null
@@ -0,0 +1,6 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "weekly"
index 1087ab4e4debe038b1579d3fd177a781272ea3bc..9401ec5492482aa5e066e0a53e5c55236ff1fb81 100644 (file)
@@ -1,17 +1,20 @@
 name: CI
 on:
   push:
-    branches: [master, main]
+    branches: [main]
   pull_request:
-    branches: [master, main]
+    branches: [main]
+
+permissions:
+  contents: read
 
 jobs:
   verify_files:
     name: Verify Files
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
-    - uses: actions/setup-node@v2
+    - uses: actions/checkout@v3
+    - uses: actions/setup-node@v3
       with:
         node-version: '16.x'
     - name: Install Packages
@@ -22,22 +25,27 @@ jobs:
       run: node Makefile checkRuleFiles
     - name: Check Licenses
       run: node Makefile checkLicenses
+    - name: Install Docs Packages
+      working-directory: docs
+      run: npm install
+    - name: Lint Docs JS Files
+      run: node Makefile lintDocsJS
 
   test_on_node:
     name: Test
     strategy:
       matrix:
         os: [ubuntu-latest]
-        node: [17.x, 16.x, 14.x, 12.x, "12.22.0"]
+        node: [18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"]
         include:
         - os: windows-latest
-          node: "12.x"
+          node: "16.x"
         - os: macOS-latest
-          node: "12.x"
+          node: "16.x"
     runs-on: ${{ matrix.os }}
     steps:
-    - uses: actions/checkout@v2
-    - uses: actions/setup-node@v2
+    - uses: actions/checkout@v3
+    - uses: actions/setup-node@v3
       with:
         node-version: ${{ matrix.node }}
     - name: Install Packages
@@ -51,10 +59,10 @@ jobs:
     name: Browser Test
     runs-on: ubuntu-latest
     steps:
-    - uses: actions/checkout@v2
-    - uses: actions/setup-node@v2
+    - uses: actions/checkout@v3
+    - uses: actions/setup-node@v3
       with:
-        node-version: '12'
+        node-version: '16'
     - name: Install Packages
       run: npm install
     - name: Test
index ef362a4b64de5ae3abbb97b2fe32b8d2a76e0ee8..e2995e66d4047f275eea4036b4c81e8d43b818f3 100644 (file)
@@ -13,10 +13,10 @@ name: "CodeQL"
 
 on:
   push:
-    branches: [master, main]
+    branches: [main]
   pull_request:
     # The branches below must be a subset of the branches above
-    branches: [master, main]
+    branches: [main]
   schedule:
     - cron: '28 17 * * 5'
 
@@ -39,11 +39,11 @@ jobs:
 
     steps:
     - name: Checkout repository
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
 
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
+      uses: github/codeql-action/init@v2
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,10 +54,10 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
+      uses: github/codeql-action/autobuild@v2
 
     # ℹ️ Command-line programs to run using the OS shell.
-    # 📚 https://git.io/JvXDl
+    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
 
     # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
     #    and modify them (or add more) to build your code if your project
@@ -68,4 +68,4 @@ jobs:
     #   make release
 
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      uses: github/codeql-action/analyze@v2
index 45740229477bde8bd82a6f96dfd4de5e021bad09..8680ebdadc48c529b337b20de375e96d3ad72a27 100644 (file)
@@ -18,7 +18,7 @@ jobs:
       pull-requests: write
 
     steps:
-    - uses: actions/stale@v3
+    - uses: actions/stale@v5
       with:
         repo-token: ${{ secrets.GITHUB_TOKEN }}
         days-before-stale: 60
index c37cf77fbbc98db194e3a3b38cec183b8f094b20..79c1f0fbecf377a69cfc476c63f4042f776d5c40 100644 (file)
@@ -2,10 +2,11 @@ default: true
 
 # Exclusions for deliberate/widespread violations
 MD002: false     # First header should be a h1 header
+MD004:           # Unordered list style
+    style: asterisk
 MD007:           # Unordered list indentation
     indent: 4
 MD013: false     # Line length
-MD014: false     # Dollar signs used before commands without showing output
 MD019: false     # Multiple spaces after hash on atx style header
 MD021: false     # Multiple spaces inside hashes on closed atx style header
 MD024: false     # Multiple headers with the same content
@@ -14,4 +15,5 @@ MD029: false     # Ordered list item prefix
 MD030: false     # Spaces after list markers
 MD033: false     # Allow inline HTML
 MD041: false     # First line in file should be a top level header
-MD046: false     # Code block style
+MD046:           # Code block style
+    style: fenced
diff --git a/eslint/.nycrc b/eslint/.nycrc
deleted file mode 100644 (file)
index 040f203..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "include": [
-        "bin/**/*.js",
-        "conf/**/*.js",
-        "lib/**/*.js"
-    ],
-    "reporter": [
-        "lcov",
-        "text-summary",
-        "cobertura"
-    ],
-    "sourceMap": true
-}
index 3b78599132d8a835dca955dd13a0ea526b30f4c7..be53ce6aff75c4276265fad1a3ae26572a3348b8 100644 (file)
@@ -1,3 +1,333 @@
+v8.23.1 - September 12, 2022
+
+* [`b719893`](https://github.com/eslint/eslint/commit/b71989388a921886caa4c6cb48729bbf60c46100) fix: Upgrade eslintrc to stop redefining plugins (#16297) (Brandon Mills)
+* [`734b54e`](https://github.com/eslint/eslint/commit/734b54eb9c6c4839c0f99ebe18dc5695754aac1d) fix: improve autofix for the `prefer-const` rule (#16292) (Nitin Kumar)
+* [`6a923ff`](https://github.com/eslint/eslint/commit/6a923ff9257a4f009cefed049ebb59a4b5acdab5) fix: Ensure that glob patterns are normalized (#16287) (Nicholas C. Zakas)
+* [`38e8171`](https://github.com/eslint/eslint/commit/38e8171d9b170f400ac340368d044b2093114e94) perf: migrate rbTree to js-sdsl (#16267) (Zilong Yao)
+* [`16cba3f`](https://github.com/eslint/eslint/commit/16cba3f31294a673721864267aa13ea35233326b) docs: fix mobile double tap issue (#16293) (Sam Chen)
+* [`c6900f8`](https://github.com/eslint/eslint/commit/c6900f89a89f3de5d3c50c69a1bc62eac6eb76d7) fix: Ensure globbing doesn't include subdirectories (#16272) (Nicholas C. Zakas)
+* [`e098b5f`](https://github.com/eslint/eslint/commit/e098b5f80472e80c70603306e77e14ea15f1a93b) docs: keyboard control to search results (#16222) (Shanmughapriyan S)
+* [`1b5b2a7`](https://github.com/eslint/eslint/commit/1b5b2a7de504f2971a6a488d8a57442e73b56a51) docs: add Consolas font and prioritize resource loading (#16225) (Amaresh  S M)
+* [`1c388fb`](https://github.com/eslint/eslint/commit/1c388fb37739cc09dbd0b4aa59e9d45674280ad5) chore: switch nyc to c8 (#16263) (唯然)
+* [`67db10c`](https://github.com/eslint/eslint/commit/67db10c51dbb871a201eab444f6a73fbc1e4fc75) chore: enable linting `.eleventy.js` again (#16274) (Milos Djermanovic)
+* [`1ae8236`](https://github.com/eslint/eslint/commit/1ae8236a2e71c9dead20ba9da60d8cc9e317859a) docs: copy & use main package version in docs on release (#16252) (Jugal Thakkar)
+* [`42bfbd7`](https://github.com/eslint/eslint/commit/42bfbd7b7b91106e5f279a05f40c20769e3cd29f) chore: fix `npm run perf` crashes (#16258) (唯然)
+* [`279f0af`](https://github.com/eslint/eslint/commit/279f0afc14617c037da482919942beef87f56e45) docs: Improve id-denylist documentation (#16223) (Mert Ciflikli)
+
+v8.23.0 - August 26, 2022
+
+* [`2e004ab`](https://github.com/eslint/eslint/commit/2e004ab990a4a5a4efc44974da005d2161490256) chore: upgrade @eslint/eslintrc@1.3.1 (#16249) (Milos Djermanovic)
+* [`d35fbbe`](https://github.com/eslint/eslint/commit/d35fbbef895e8f4ac6eaf1756349230769a02b4d) chore: Upgrade to espree@9.4.0 (#16243) (Milos Djermanovic)
+* [`3e5839e`](https://github.com/eslint/eslint/commit/3e5839ecae96aecfbc1ac9526e88e0105e671032) feat: Enable eslint.config.js lookup from CLI (#16235) (Nicholas C. Zakas)
+* [`30b1a2d`](https://github.com/eslint/eslint/commit/30b1a2dac9060673101485841c4c7521675bf917) feat: add `allowEmptyCase` option to no-fallthrough rule (#15887) (Amaresh  S M)
+* [`ed26229`](https://github.com/eslint/eslint/commit/ed26229a19359b356f3a401698488c1707d4c029) test: add no-extra-parens tests with rest properties (#16236) (Milos Djermanovic)
+* [`deaf69f`](https://github.com/eslint/eslint/commit/deaf69ffd8f9b97b4b8c29a244a79969ff14c80a) chore: fix off-by-one `min-width: 1023px` media queries (#15974) (Milos Djermanovic)
+* [`63dec9f`](https://github.com/eslint/eslint/commit/63dec9fdee793be9bf2939e1bda0717b9cc6dcf8) refactor: simplify `parseListConfig` (#16241) (Milos Djermanovic)
+* [`43f03aa`](https://github.com/eslint/eslint/commit/43f03aa96b632039b1d9cad097a70b227bb7d348) feat: no-warning-comments support comments with decoration (#16120) (Lachlan Hunt)
+* [`b1918da`](https://github.com/eslint/eslint/commit/b1918da0f6cb8fe690c7377667616ec7cb57111e) docs: package.json conventions (#16206) (Patrick McElhaney)
+* [`0e03c33`](https://github.com/eslint/eslint/commit/0e03c333a70bebd00307deead0befa519f983f44) docs: remove word immediately (#16217) (Strek)
+* [`c6790db`](https://github.com/eslint/eslint/commit/c6790db6494e64a5261d74c0f3c4dc6139c59435) docs: add anchor link for "migrating from jscs" (#16207) (Percy Ma)
+* [`7137344`](https://github.com/eslint/eslint/commit/71373442c42b356f34179dba18f860e1d79a780d) docs: auto-generation edit link (#16213) (Percy Ma)
+
+v8.22.0 - August 13, 2022
+
+* [`2b97607`](https://github.com/eslint/eslint/commit/2b97607675e1d0920a3abedd736e2ae00ed26d52) feat: Implement caching for FlatESLint (#16190) (Nicholas C. Zakas)
+* [`fd5d3d3`](https://github.com/eslint/eslint/commit/fd5d3d37c97001fad1d9ae4386f76b3587cceba9) feat: add `methodsIgnorePattern` option to object-shorthand rule (#16185) (Milos Djermanovic)
+* [`9f5a752`](https://github.com/eslint/eslint/commit/9f5a75206675f2404ad6733640cf05ab44b02274) docs: optimize image assets (#16170) (Sam Chen)
+* [`61b2948`](https://github.com/eslint/eslint/commit/61b2948cb71ec505d2f7e904c7ad77ee1da64db2) docs: add svgo command to pre commit hook (#16178) (Amaresh  S M)
+* [`784096d`](https://github.com/eslint/eslint/commit/784096d37808e59ce8cc07c3c18018b31a31c3f8) docs: improve search result UI (#16187) (Sam Chen)
+* [`d0f4cb4`](https://github.com/eslint/eslint/commit/d0f4cb42e86b4b9c7bdf91e88a4ec0d36074f36b) docs: use shorthand property name in example (#16180) (Kevin Elliott)
+* [`10a6e0e`](https://github.com/eslint/eslint/commit/10a6e0e14488e4ae9ab267fb5db2ec0c5bb85d59) chore: remove deploy workflow for playground (#16186) (Milos Djermanovic)
+
+v8.21.0 - August 1, 2022
+
+* [`7b43ea1`](https://github.com/eslint/eslint/commit/7b43ea14a8af5fc3dbac38fa9d5bc71741328c16) feat: Implement FlatESLint (#16149) (Nicholas C. Zakas)
+* [`8892511`](https://github.com/eslint/eslint/commit/889251194867b1f394c571a5982249329fa44cfd) chore: Upgrade to Espree 9.3.3 (#16173) (Brandon Mills)
+* [`92bf49a`](https://github.com/eslint/eslint/commit/92bf49a4b39dde728fbc6d348e62c7009e21cf7d) feat: improve the key width calculation in `key-spacing` rule (#16154) (Nitin Kumar)
+* [`c461542`](https://github.com/eslint/eslint/commit/c4615421cb4825e2ad22e275ec9439756d56299c) feat: add new `allowLineSeparatedGroups` option to the `sort-keys` rule (#16138) (Nitin Kumar)
+* [`1cdcbca`](https://github.com/eslint/eslint/commit/1cdcbca8a961a057a9db40df412f249545befe2b) feat: add deprecation warnings for legacy API in `RuleTester` (#16063) (Nitin Kumar)
+* [`0396775`](https://github.com/eslint/eslint/commit/03967755270ae28eec651281c50b6990d3983f48) fix: lines-around-comment apply `allowBlockStart` for switch statements (#16153) (Nitin Kumar)
+* [`2aadc93`](https://github.com/eslint/eslint/commit/2aadc93272f1ab7f40246c6b18c4056660f2b3a2) docs: add anchors to headings inside docs content (#16134) (Strek)
+* [`1233bee`](https://github.com/eslint/eslint/commit/1233beea3938fc4234c8f75917776832226fc3c8) chore: switch to eslint-plugin-node's maintained fork (#16150) (唯然)
+* [`97b95c0`](https://github.com/eslint/eslint/commit/97b95c068d5b35fae68ca919257b61430271ac76) chore: upgrade puppeteer v13 (#16151) (唯然)
+
+v8.20.0 - July 16, 2022
+
+* [`bbf8df4`](https://github.com/eslint/eslint/commit/bbf8df41c901d41753ca4f3f0baf021944782597) chore: Mark autogenerated release blog post as draft (#16130) (Nicholas C. Zakas)
+* [`845c4f4`](https://github.com/eslint/eslint/commit/845c4f40274ccb3727c624db44c7a23aafa71318) docs: Add website team details (#16115) (Nicholas C. Zakas)
+* [`5a0dfdb`](https://github.com/eslint/eslint/commit/5a0dfdb9938ffdcea52047466bac11ea983f4b29) docs: Link to blog post in no-constant-binary-expression (#16112) (Jordan Eldredge)
+* [`bc692a9`](https://github.com/eslint/eslint/commit/bc692a9bf5c664c646ce386eff44eb706c231127) docs: remove install command (#16084) (Strek)
+* [`30be0ed`](https://github.com/eslint/eslint/commit/30be0ed4d84dd436e6c2e345e264c10b2bd37308) fix: no-warning-comments rule escapes special RegEx characters in terms (#16090) (Lachlan Hunt)
+* [`ca83178`](https://github.com/eslint/eslint/commit/ca83178b18cd5d649bd52a20aef8f8b3f48d3085) feat: catch preprocess errors (#16105) (JounQin)
+* [`49ca3f0`](https://github.com/eslint/eslint/commit/49ca3f090425e06fdf6e66bcf2415508c46671e1) docs: don't show toc when content not found (#16095) (Amaresh  S M)
+* [`ba19e3f`](https://github.com/eslint/eslint/commit/ba19e3f80a32ceae82e0ed6c0acf16061d8370da) docs: enhance 404 page UI (#16097) (Amaresh  S M)
+* [`bfe5e88`](https://github.com/eslint/eslint/commit/bfe5e884098874bb512609bcd94a5e5ed797839d) fix: ignore spacing before `]` and `}` in comma-spacing (#16113) (Milos Djermanovic)
+* [`a75d3b4`](https://github.com/eslint/eslint/commit/a75d3b47b84f59c080c0c8301ae859fa64aa0f0f) docs: remove unused meta.docs.category field in working-with-rules page (#16109) (Brandon Scott)
+* [`cdc0206`](https://github.com/eslint/eslint/commit/cdc020639022dd931863460273de61f4ed4ce0f8) docs: add formatters page edit link (#16094) (Amaresh  S M)
+* [`4d1ed22`](https://github.com/eslint/eslint/commit/4d1ed22dede531108c8a7899d513f64f0662c135) docs: preselect default theme (#16098) (Strek)
+* [`4b79612`](https://github.com/eslint/eslint/commit/4b79612f0bdf860142401033f32fe9a5b8cd7d03) docs: add missing correct/incorrect containers (#16087) (Milos Djermanovic)
+* [`09f6acb`](https://github.com/eslint/eslint/commit/09f6acbf2136e3084a3174607ab29a48d5d519b0) docs: fix UI bug on rules index and details pages (#16082) (Deepshika S)
+* [`f5db264`](https://github.com/eslint/eslint/commit/f5db264931fd6259e064b5cf24b4233f5aaa4c7d) docs: remove remaining duplicate rule descriptions (#16093) (Milos Djermanovic)
+* [`32a6b2a`](https://github.com/eslint/eslint/commit/32a6b2a5caae8fa3734dfbdb9640bb4963fc5f4f) docs: Add scroll behaviour smooth (#16056) (Amaresh  S M)
+* [`eee4306`](https://github.com/eslint/eslint/commit/eee43067f635c0ec3b61e416f47849029d12268d) chore: update internal lint dependencies (#16088) (Bryan Mishkin)
+* [`9615a42`](https://github.com/eslint/eslint/commit/9615a42c9f065188024423a28b603cb93dad18d4) chore: update formatter examples template to avoid markdown lint error (#16085) (Milos Djermanovic)
+* [`62541ed`](https://github.com/eslint/eslint/commit/62541edf5843ff8e01f14f870701d5df0b2c1cb5) chore: fix markdown linting error (#16083) (唯然)
+
+v8.19.0 - July 1, 2022
+
+* [`7023628`](https://github.com/eslint/eslint/commit/7023628eb3af1bcc0151afab2bf617217fae51b1) feat: add importNames support for patterns in no-restricted-imports (#16059) (Brandon Scott)
+* [`472c368`](https://github.com/eslint/eslint/commit/472c3681364833f697d726abc3c33fbe2663eeb7) feat: fix handling of blockless `with` statements in indent rule (#16068) (Milos Djermanovic)
+* [`fc81848`](https://github.com/eslint/eslint/commit/fc81848238ee0f6ff93615875ea4b8e95dc09249) fix: throw helpful exception when rule has wrong return type (#16075) (Bryan Mishkin)
+* [`e884933`](https://github.com/eslint/eslint/commit/e88493395b3be2b08e14e9b84d20d2733f78582c) chore: use `github-slugger` for markdown anchors (#16067) (Strek)
+* [`02e9cb0`](https://github.com/eslint/eslint/commit/02e9cb01e7663af3a3fd16725afc7d71e73b9eed) chore: revamp carbon ad style (#16078) (Amaresh  S M)
+* [`3ae0574`](https://github.com/eslint/eslint/commit/3ae0574fc78c4a2b406625e4792cb2859cb9bcb1) docs: Remove duplicate rule descriptions (#16052) (Amaresh  S M)
+* [`b6aee95`](https://github.com/eslint/eslint/commit/b6aee9591ecc2e2f5738ab8bef20faac1e05b5c3) chore: remove unwanted comments from rules markdown (#16054) (Strek)
+* [`f50cf43`](https://github.com/eslint/eslint/commit/f50cf436aaa5dff1273f4753dd3fc6782f95a045) docs: Add base href to each page to fix relative URLs (#16046) (Nicholas C. Zakas)
+* [`6840940`](https://github.com/eslint/eslint/commit/6840940a766d671831d5cee0e3c0e2f4e642632a) chore: correctly use .markdownlintignore in Makefile (#16060) (Bryan Mishkin)
+* [`ae4b449`](https://github.com/eslint/eslint/commit/ae4b449719d496fd611903d596341ec4c1d81c16) docs: make logo link clickable on small width screens (#16058) (Milos Djermanovic)
+* [`280f898`](https://github.com/eslint/eslint/commit/280f898bff9b809327e4c94cea3632ba95af4485) docs: use only fenced code blocks (#16044) (Milos Djermanovic)
+* [`f5d63b9`](https://github.com/eslint/eslint/commit/f5d63b9e15d9f325ef4953b683cb67133b05e9ea) docs: add listener only if element exists (#16045) (Amaresh  S M)
+* [`8b639cc`](https://github.com/eslint/eslint/commit/8b639ccb2fb0f0a7d7aaee1f1fc2881a237de95d) docs: add missing migrating-to-8.0.0 in the user guide (#16048) (唯然)
+* [`b8e68c1`](https://github.com/eslint/eslint/commit/b8e68c1f7e2b8fa5c108216f74dcd3100aa33b0f) docs: Update release process (#16036) (Nicholas C. Zakas)
+* [`48904fb`](https://github.com/eslint/eslint/commit/48904fb00fc5001e534034e2e513ca99f3ada35e) chore: add missing images (#16017) (Amaresh  S M)
+* [`910f741`](https://github.com/eslint/eslint/commit/910f741885a18b7744d4125e98e554312bc873eb) chore: add architecture to nav (#16039) (Strek)
+* [`9bb24c1`](https://github.com/eslint/eslint/commit/9bb24c1deb7ab6743080520d11aefe9c6b8b8f2d) chore: add correct incorrect in all rules doc (#16021) (Deepshika S)
+* [`5a96af8`](https://github.com/eslint/eslint/commit/5a96af853dcbe29c9f125a63528f3fec9fc0aae8) chore: prepare versions data file (#16035) (Nicholas C. Zakas)
+* [`50afe6f`](https://github.com/eslint/eslint/commit/50afe6fe8c92a1d5d52415e149d52e1e129c3cc7) chore: Included githubactions in the dependabot config (#15985) (Naveen)
+* [`6d0cb11`](https://github.com/eslint/eslint/commit/6d0cb11c6d134896d8920c9bf3cc3e492f0eb8e2) docs: remove table of contents from markdown text (#15999) (Nitin Kumar)
+* [`473411e`](https://github.com/eslint/eslint/commit/473411e61d46c2bbac70e9a66d434d477851d98a) chore: add deploy workflow for playground (#16034) (Milos Djermanovic)
+* [`a30b66c`](https://github.com/eslint/eslint/commit/a30b66c030bf45864784c0550276267e5a146697) chore: fix print style (#16025) (Amaresh  S M)
+* [`f4dad59`](https://github.com/eslint/eslint/commit/f4dad59e5c7e966291d6f8c1456a465ae5629061) chore: add noindex meta tag (#16016) (Milos Djermanovic)
+* [`db387a8`](https://github.com/eslint/eslint/commit/db387a87b23c398ed691ba35bdf3b6aa7dcfe750) chore: fix sitemap (#16026) (Milos Djermanovic)
+* [`285fbc5`](https://github.com/eslint/eslint/commit/285fbc5e6a92c50e1195f252675b599ecd929b9d) chore: remove TOC from printable (#16020) (Strek)
+* [`8e84c21`](https://github.com/eslint/eslint/commit/8e84c2148cc2d25a7076e73233ae41bc1a000a53) chore: remove ligatures from fonts (#16019) (Strek)
+
+v8.18.0 - June 17, 2022
+
+* [`f6e2e63`](https://github.com/eslint/eslint/commit/f6e2e632fa3710cfa467b15350b08dea6e0e3dfc) chore: fix 'replaced by' rule list (#16007) (Milos Djermanovic)
+* [`ed49f15`](https://github.com/eslint/eslint/commit/ed49f15fad96060501927ca27ebda1a4c736ed04) build: remove unwanted parallel and image-min for dev server (#15986) (Strek)
+* [`4871047`](https://github.com/eslint/eslint/commit/4871047dbd0c5ef5e4089425a85ac85dcd9cf263) docs: Update analytics, canonical URL, ads (#15996) (Nicholas C. Zakas)
+* [`d94dc84`](https://github.com/eslint/eslint/commit/d94dc84ae76a36b4ee9268c40d8536d2f5b1c63c) chore: remove unused deprecation warnings (#15994) (Francesco Trotta)
+* [`a6273b8`](https://github.com/eslint/eslint/commit/a6273b83b103c463937936ef2404575758a7baa4) feat: account for rule creation time in performance reports (#15982) (Nitin Kumar)
+* [`cddad14`](https://github.com/eslint/eslint/commit/cddad1495fbc1750c26330f7aadc6647e2eebac3) docs: Add correct/incorrect containers (#15998) (Nicholas C. Zakas)
+* [`b04bc6f`](https://github.com/eslint/eslint/commit/b04bc6f1d558d9ad5eb57383a779fec5a170b3d3) docs: Add rules meta info to rule pages (#15902) (Nicholas C. Zakas)
+* [`f364d47`](https://github.com/eslint/eslint/commit/f364d47013d146cdea42b27a7b24d105223f5ffe) fix: Make no-unused-vars treat for..of loops same as for..in loops (#15868) (Alex Bass)
+* [`1324f10`](https://github.com/eslint/eslint/commit/1324f10ac58d3685fdb656a4fc9d1e5c9d035e42) docs: unify the wording referring to optional exception (#15893) (Abdelrahman Elkady)
+* [`cdcf11e`](https://github.com/eslint/eslint/commit/cdcf11e457a2455bd8875d78651fec55dd148139) chore: fix versions link (#15995) (Milos Djermanovic)
+* [`d2a8715`](https://github.com/eslint/eslint/commit/d2a871543a12143fa0ecea13d7508021fd019031) chore: add trailing slash to `pathPrefix` (#15993) (Milos Djermanovic)
+* [`58a1bf0`](https://github.com/eslint/eslint/commit/58a1bf0de33adb1d54c8051090f01984daa08c86) chore: tweak URL rewriting for local previews (#15992) (Milos Djermanovic)
+* [`ad54d02`](https://github.com/eslint/eslint/commit/ad54d0246797cdd849948e7a5d31571c498af7aa) docs: add missing trailing slash to some internal links (#15991) (Milos Djermanovic)
+* [`80404d2`](https://github.com/eslint/eslint/commit/80404d28f040df49706ba2c1e954aee945711aa9) chore: remove docs deploy workflow (#15984) (Nicholas C. Zakas)
+* [`df7768e`](https://github.com/eslint/eslint/commit/df7768e16a5ab55da97749bb89ff19f98ce0cc6c) docs: Switch to version-relative URLs (#15978) (Nicholas C. Zakas)
+* [`71bc750`](https://github.com/eslint/eslint/commit/71bc75012b1377d3c7e57deea0ad06f99c4c65bf) chore: Set permissions for GitHub actions (#15971) (Naveen)
+* [`90ff647`](https://github.com/eslint/eslint/commit/90ff64742ede6ef29018cb967fc4f20d7b85b592) chore: avoid generating subdirectories for each page on new docs site (#15967) (Milos Djermanovic)
+* [`21d6479`](https://github.com/eslint/eslint/commit/21d647904dc30f9484b22acdd9243a6d0ecfba38) docs: change some absolute links to relative (#15970) (Milos Djermanovic)
+* [`f31216a`](https://github.com/eslint/eslint/commit/f31216a90a6204ed1fd56547772376a10f5d3ebb) docs: Update README team and sponsors (ESLint Jenkins)
+
+v8.17.0 - June 3, 2022
+
+* [`b915018`](https://github.com/eslint/eslint/commit/b9150186bcc0f2732a69ab0ebd83a9b2fb2e6552) docs: Update website UI to latest (#15944) (Nicholas C. Zakas)
+* [`55319e1`](https://github.com/eslint/eslint/commit/55319e133f0862a008db3557d7350f154f2c784f) feat: fix indent bug with semicolon-first style (#15951) (Milos Djermanovic)
+* [`f6d7920`](https://github.com/eslint/eslint/commit/f6d79209821241c8e03c183b5844a024da0efe8a) feat: add `allowNamedExports` option to no-use-before-define (#15953) (Milos Djermanovic)
+* [`f0bb609`](https://github.com/eslint/eslint/commit/f0bb6099668f54ae6f444126b90dbb1146248146) docs: Update Exponentiation operator MDN link (#15960) (Pranjal Jain)
+* [`da694b9`](https://github.com/eslint/eslint/commit/da694b9d7cb0247541bcabbf943d1289e0e30167) chore: avoid theme flashes (#15927) (Strek)
+* [`baa0153`](https://github.com/eslint/eslint/commit/baa01530469ec233fb60380a0960c1550f9d9a45) docs: Use correct past tense "left" instead of "leaved" (#15950) (Frederik Braun)
+* [`f836743`](https://github.com/eslint/eslint/commit/f836743e95cb8ad3bdd4e88687dbe2f16bfade62) chore: Use build hook for docs deploy (#15945) (Nicholas C. Zakas)
+* [`ce035e5`](https://github.com/eslint/eslint/commit/ce035e5fac632ba8d4f1860f92465f22d6b44d42) test: cleanup typos (#15937) (Nick Schonning)
+* [`1351a9b`](https://github.com/eslint/eslint/commit/1351a9b875aa32a8961a68457dde03ede9ef7c78) docs: Add Resources section to rule pages (#15901) (Nicholas C. Zakas)
+* [`68cf0fb`](https://github.com/eslint/eslint/commit/68cf0fb7f645da5d992a5e749fc6c1311d30e75a) docs: cleanup typos (#15936) (Nick Schonning)
+* [`54c0953`](https://github.com/eslint/eslint/commit/54c09530c778eb4076d89777165d59db96c9acb5) fix: cleanup typos (#15939) (Nick Schonning)
+* [`845a7af`](https://github.com/eslint/eslint/commit/845a7af90ce03b383c8f09654ac049fc161dbb9f) fix: typo ocatal -> octal (#15940) (Nick Schonning)
+* [`10249ad`](https://github.com/eslint/eslint/commit/10249ad1a961463b6b347be71c074951ab8e2652) chore: use addEventListener instead of addListener (#15923) (Amaresh  S M)
+* [`5f5c1fb`](https://github.com/eslint/eslint/commit/5f5c1fb1083573ea511d0dae7913651db0dca772) chore: lint eleventy config file (#15904) (Milos Djermanovic)
+* [`8513d37`](https://github.com/eslint/eslint/commit/8513d37c725509c9e9ec1dbbc431f20d32632cf3) chore: update Rule typedefs (#15915) (Milos Djermanovic)
+* [`13b62ae`](https://github.com/eslint/eslint/commit/13b62aeb710a68e5d838a4d3847c487af1ba9520) docs: use-dart-sass instead of node-sass (#15912) (Deepshika S)
+* [`c81c5d6`](https://github.com/eslint/eslint/commit/c81c5d6ef1ba5808cca95ab965a162802af9b7cc) docs: add social media links (#15920) (Deepshika S)
+* [`0d6a50b`](https://github.com/eslint/eslint/commit/0d6a50b41f2fe444fd222463adad48473eaf9b7d) docs: fix openjs link (#15917) (Amaresh  S M)
+* [`54910f5`](https://github.com/eslint/eslint/commit/54910f5a3bf6615f8ac03d33fd26fc1fa6dea21f) docs: display version in mobile view (#15909) (Amaresh  S M)
+* [`55534f1`](https://github.com/eslint/eslint/commit/55534f1a7040fad94bb5726759fbb9acb60d1c24) test: ensure no-restricted-imports works with NodeJS imports (#15907) (Nick Mazuk)
+
+v8.16.0 - May 20, 2022
+
+* [`1768d0d`](https://github.com/eslint/eslint/commit/1768d0de58e10046ed3e54f0fa52be48ba41f12b) chore: upgrade @eslint/eslintrc@1.3.0 (#15903) (Milos Djermanovic)
+* [`050d5f4`](https://github.com/eslint/eslint/commit/050d5f4e0456ae9a9d769f4306bc0d60058b0898) docs: Static further reading links (#15890) (Nicholas C. Zakas)
+* [`cab0c22`](https://github.com/eslint/eslint/commit/cab0c2287e12561d869dfcfcd1c4e14c9d6d70d5) feat: add Unicode flag suggestion in no-misleading-character-class (#15867) (Milos Djermanovic)
+* [`c686e4c`](https://github.com/eslint/eslint/commit/c686e4c4a04525118f5585fd76bdba59dddf3a97) chore: Add deploy workflow for docs site (#15894) (Nicholas C. Zakas)
+* [`38ae956`](https://github.com/eslint/eslint/commit/38ae9564a41e1d38adad55976565d85c5c981e1d) feat: check Unicode code point escapes in no-control-regex (#15862) (Milos Djermanovic)
+* [`36287c0`](https://github.com/eslint/eslint/commit/36287c00d56596fbb2672cfe3f9b9dd24b2926da) docs: fix absolute paths in related rules shortcode to work from /docs (#15892) (Milos Djermanovic)
+* [`90b6990`](https://github.com/eslint/eslint/commit/90b69901efd265fd11425540928793f1387095cc) docs: fix absolute links in rule macro to work from /docs (#15891) (Milos Djermanovic)
+* [`f437249`](https://github.com/eslint/eslint/commit/f437249a3bedb47155d33ac753b821ae31b814fa) docs: Adjust docs site path prefix (#15889) (Nicholas C. Zakas)
+* [`6e16025`](https://github.com/eslint/eslint/commit/6e16025e8fbffa0e1d0c977cb4b6eae30a502d9b) docs: update 'Related Rules' and 'Further Reading' in remaining rules (#15884) (Milos Djermanovic)
+* [`c7894cd`](https://github.com/eslint/eslint/commit/c7894cd433319e09b10a80b260a5398dac0d5dab) chore: enable some rules from eslint-plugin-unicorn internally (#15878) (Bryan Mishkin)
+* [`ea65cb5`](https://github.com/eslint/eslint/commit/ea65cb5435162ad29559d175e68f5b6d97e6cdcc) chore: upgrade eslint-plugin-eslint-plugin@^4.2.0 (#15882) (唯然)
+* [`cc29c69`](https://github.com/eslint/eslint/commit/cc29c696a08430fcbf202482306b8c3dbccc0257) chore: Upgrade official GitHub actions to latest versions (#15880) (Darius Dzien)
+* [`5891c75`](https://github.com/eslint/eslint/commit/5891c7533f500110129fdea7b9b63c8a409da0bd) chore: Refactor rule docs format (#15869) (Nicholas C. Zakas)
+* [`ee69cd3`](https://github.com/eslint/eslint/commit/ee69cd30b3551b3adebfd959a44a9a149221946a) feat: Update global variables (#15871) (Sébastien Règne)
+* [`1d39f69`](https://github.com/eslint/eslint/commit/1d39f698a22e2995bbfcf90b6dafd196a173092a) docs: remove confusing examples for no-mixed-operators (#15875) (Milos Djermanovic)
+* [`3071d76`](https://github.com/eslint/eslint/commit/3071d76772c002bd7b03053be5be54da52c01242) docs: Fix some grammar issues (#15837) (byodian)
+* [`3f09aab`](https://github.com/eslint/eslint/commit/3f09aab709980ca974b721de474be2dd183409a2) fix: function-paren-newline crash on "new new Foo();" (#15850) (coderaiser)
+
+v8.15.0 - May 6, 2022
+
+* [`1ba6a92`](https://github.com/eslint/eslint/commit/1ba6a926eedcfe725900ed95cf029cff02d0355a) chore: upgrade @eslint/eslintrc@1.2.3 (#15847) (Milos Djermanovic)
+* [`8bf9440`](https://github.com/eslint/eslint/commit/8bf9440ac47907ffd27aba095428908e7ddeae8a) fix: "use strict" should not trigger strict mode in ES3 (#15846) (Milos Djermanovic)
+* [`28116cc`](https://github.com/eslint/eslint/commit/28116ccce4b99da3d5aa9b8994dd3652df7b1cab) docs: update AST node names link in no-restricted-syntax (#15843) (Milos Djermanovic)
+* [`8167aa7`](https://github.com/eslint/eslint/commit/8167aa7d43d00f1a0e8400f73c0dd66798fd4c56) chore: bump version of minimatch due to security issue PRISMA-2022-0039 (#15774) (Jan Opravil)
+* [`272965f`](https://github.com/eslint/eslint/commit/272965feda8adfbf5bfa0e01b37df27ce70fc9fd) docs: fix h1 heading on formatters page (#15834) (Milos Djermanovic)
+* [`a798166`](https://github.com/eslint/eslint/commit/a7981669fffe33deaf4fbe295f660edc8ccad4cd) docs: update example for running individual rule tests (#15833) (Milos Djermanovic)
+* [`b8995a4`](https://github.com/eslint/eslint/commit/b8995a40087f3a1e4e87c239951f91ddaac73571) chore: Implement docs site (#15815) (Nicholas C. Zakas)
+* [`ab37d3b`](https://github.com/eslint/eslint/commit/ab37d3ba302856007beb833c34b56658a34bbb5d) feat: add `enforceInClassFields` option to no-underscore-dangle (#15818) (Roberto Cestari)
+* [`57e732b`](https://github.com/eslint/eslint/commit/57e732be4e349470fad3e3cc44d96bf0746a598b) docs: mark `SourceCode#getJSDocComment` deprecated in working-with-rules (#15829) (Milos Djermanovic)
+* [`9a90abf`](https://github.com/eslint/eslint/commit/9a90abf59e31247c03a24ca789cd6157504f63ed) docs: update docs directory in working-with-rules (#15830) (Milos Djermanovic)
+* [`810adda`](https://github.com/eslint/eslint/commit/810addac9b958c03d69f5f8f21d47ff7fb4c5db6) docs: add more examples for prefer-object-spread (#15831) (coderaiser)
+* [`06b1edb`](https://github.com/eslint/eslint/commit/06b1edb68f251558601bf68d47e6bbde693089c9) docs: clarify no-control-regex rule (#15808) (Milos Djermanovic)
+* [`6494e3e`](https://github.com/eslint/eslint/commit/6494e3e8916f0a07226bdd8c8f6b2c5f0884bf6b) chore: update link in `codeql-analysis.yml` (#15817) (Milos Djermanovic)
+* [`9ecd42f`](https://github.com/eslint/eslint/commit/9ecd42f36462331a0d697e74323a4d24f0cf02fc) docs: Fixed typo in code comment (#15812) (Addison G)
+* [`36503ec`](https://github.com/eslint/eslint/commit/36503ec8b6fca292be8e584792fc2ad056df4d2f) chore: enable no-constant-binary-expression in eslint-config-eslint (#15807) (唯然)
+* [`de992b7`](https://github.com/eslint/eslint/commit/de992b7016e3d91092de7748f0375943ad2c77f0) docs: remove links to 2fa document (#15804) (Milos Djermanovic)
+* [`5222659`](https://github.com/eslint/eslint/commit/52226593974fc7fcb60f1be73b165863b3d1a7fb) docs: fix 'Related Rules' heading in no-constant-binary-expression (#15799) (Milos Djermanovic)
+* [`e70ae81`](https://github.com/eslint/eslint/commit/e70ae8116256e5b69c6eac1ed71c0fa33a8e6d7a) docs: Update README team and sponsors (ESLint Jenkins)
+
+v8.14.0 - April 22, 2022
+
+* [`35fa1dd`](https://github.com/eslint/eslint/commit/35fa1dd8932ef3e55c37ec0e4b73b5d88f187e69) fix: allow project paths to have URL-encoded characters (#15795) (Milos Djermanovic)
+* [`735458c`](https://github.com/eslint/eslint/commit/735458cc96d4ecdb4ed97448b63ed4a579890b13) chore: add static frontmatter to no-constant-binary-expression docs (#15798) (Milos Djermanovic)
+* [`ab6363d`](https://github.com/eslint/eslint/commit/ab6363dffb9dfd9c6a9abb5292fc712745fe7a64) feat: Add rule no-constant-binary-expression (#15296) (Jordan Eldredge)
+* [`db28f2c`](https://github.com/eslint/eslint/commit/db28f2c9ea6b654f615daf2f7e6f1a2034b85062) chore: Add static frontmatter to docs (#15782) (Nicholas C. Zakas)
+* [`c2407e8`](https://github.com/eslint/eslint/commit/c2407e81caf2d50325d9aa09bae70d38615ddf2c) build: add node v18 (#15791) (唯然)
+* [`413f1d5`](https://github.com/eslint/eslint/commit/413f1d55f0ad05b6fe75bdde6df423253806797d) fix: update `astUtils.isDirectiveComment` with `globals` and `exported` (#15775) (Milos Djermanovic)
+* [`3bca59e`](https://github.com/eslint/eslint/commit/3bca59e30de73fb82d4def262ae1df72089df80d) chore: markdownlint autofix on commit (#15783) (Nicholas C. Zakas)
+
+v8.13.0 - April 8, 2022
+
+* [`274acbd`](https://github.com/eslint/eslint/commit/274acbd56537f6b8199da1ac9e7bced74ae81b56) feat: fix no-eval logic for `this` in arrow functions (#15755) (Milos Djermanovic)
+* [`bb4c0d5`](https://github.com/eslint/eslint/commit/bb4c0d530a231a8a14ed70ad61c06e284bbaaef0) chore: Refactor docs to work with docs.eslint.org (#15744) (Nicholas C. Zakas)
+* [`97b57ae`](https://github.com/eslint/eslint/commit/97b57ae3ebae9150456f5516c64b6d2ba75b4038) fix: invalid operator in operator-assignment messages (#15759) (Milos Djermanovic)
+* [`c32482e`](https://github.com/eslint/eslint/commit/c32482e4fd4ad09f3d5fd960dc1fb7c1b4e56f23) docs: Typo in space-infix-ops docs  (#15754) (kmin-jeong)
+* [`f2c2d35`](https://github.com/eslint/eslint/commit/f2c2d350425268efa4b78ee6e0a2df8860e0efad) docs: disambiguate types `FormatterFunction` and `LoadedFormatter` (#15727) (Francesco Trotta)
+* [`d36f12f`](https://github.com/eslint/eslint/commit/d36f12f71b3e4f9e9552f1054d7a75be4dc03671) chore: remove `lib/init` from eslint config (#15748) (Milos Djermanovic)
+* [`a59a4e6`](https://github.com/eslint/eslint/commit/a59a4e6e9217b3cc503c0a702b9e3b02b20b980d) chore: replace `trimLeft`/`trimRight` with `trimStart`/`trimEnd` (#15750) (Milos Djermanovic)
+
+v8.12.0 - March 25, 2022
+
+* [`685a67a`](https://github.com/eslint/eslint/commit/685a67a62bdea19ca9ce12008a034b8d31162422) feat: fix logic for top-level `this` in no-invalid-this and no-eval (#15712) (Milos Djermanovic)
+* [`18f5e05`](https://github.com/eslint/eslint/commit/18f5e05bce10503186989d81ca484abb185a2c9d) chore: padding-line-between-statements remove useless `additionalItems` (#15706) (Martin Sadovy)
+
+v8.11.0 - March 11, 2022
+
+* [`6814922`](https://github.com/eslint/eslint/commit/68149221637faa8e4f2718773e751126b7ae8ac9) fix: escaping for square brackets in ignore patterns (#15666) (Milos Djermanovic)
+* [`c481cec`](https://github.com/eslint/eslint/commit/c481cecacc728618832b4044374e445d332b4381) docs: add fast-eslint-8 to atom integrations (userguide) (#15695) (db developer)
+* [`800bd25`](https://github.com/eslint/eslint/commit/800bd258e4484de24323809ebbf13fc72fcbabac) feat: add `destructuredArrayIgnorePattern` option in `no-unused-vars` (#15649) (Nitin Kumar)
+* [`8933fe7`](https://github.com/eslint/eslint/commit/8933fe7afcc7cdd99cc0efccc08e8fe3a5e2996f) feat: Catch `undefined` and `Boolean()` in no-constant-condition (#15613) (Jordan Eldredge)
+* [`d2255db`](https://github.com/eslint/eslint/commit/d2255db24526de604b4a34e90c870158c4ea277e) docs: Add clarification about `eslint-enable` (#15680) (dosisod)
+* [`385c9ad`](https://github.com/eslint/eslint/commit/385c9ad685b24b1821ec4085596b3aad299fb751) chore: rm trailing space in docs (#15689) (唯然)
+* [`f90fd9d`](https://github.com/eslint/eslint/commit/f90fd9d779a5b28dfd15ca3f993e6b3cd09e71e8) feat: Add ESLint favicon to the HTML report document (#15671) (Mahdi Hosseinzadeh)
+* [`8b9433c`](https://github.com/eslint/eslint/commit/8b9433c90c842d8ec06f633df7fbba6ac6d5036b) docs: add object pattern to first section of computed-property-spacing (#15679) (Milos Djermanovic)
+* [`de800c3`](https://github.com/eslint/eslint/commit/de800c3c0b8e3f85921b40eaa97134fef12effa2) docs: link to minimatch docs added.  (#15688) (Gaurav Tewari)
+* [`57b8a57`](https://github.com/eslint/eslint/commit/57b8a57be75ed2379fe39c93168175090dfe4cdd) feat: `valid-typeof` always ban `undefined` (#15635) (Zzzen)
+* [`8f675b1`](https://github.com/eslint/eslint/commit/8f675b1f7f6c0591abe36c20410d226bd9e1faa6) docs: sort-imports add single named import example (#15675) (Arye Eidelman)
+* [`c178ce7`](https://github.com/eslint/eslint/commit/c178ce7044b5c19db2f4aabfdbe58003db5062fd) fix: extend the autofix range in comma-dangle to ensure the last element (#15669) (Milos Djermanovic)
+
+v8.10.0 - February 25, 2022
+
+* [`cdc5802`](https://github.com/eslint/eslint/commit/cdc58025d9a8b522f516c3665d225b69a76c4ee1) fix: Avoid `__dirname` for built-in configs (#15616) (DoZerg)
+* [`7cec74e`](https://github.com/eslint/eslint/commit/7cec74e842b6e51da1b00a9e9b2c9da97dd17362) chore: upgrade @eslint/eslintrc@1.2.0 (#15648) (Milos Djermanovic)
+* [`6e2c325`](https://github.com/eslint/eslint/commit/6e2c325324479df1b3f868cf00a529b67d2c3d82) feat: Add `ignoreOnInitialization` option to no-shadow rule (#14963) (Soufiane Boutahlil)
+* [`1005bd5`](https://github.com/eslint/eslint/commit/1005bd525a08208fee124149a6ad4cf9da20d7d5) docs: update CLA information (#15630) (Nitin Kumar)
+* [`5d65c3b`](https://github.com/eslint/eslint/commit/5d65c3bc1e514ed07406c502437a1642913b27ed) docs: Fix typo in `no-irregular-whitespace` (#15634) (Ryota Sekiya)
+* [`11c8580`](https://github.com/eslint/eslint/commit/11c8580de0dcedd5577cffe2b23d23a322cc97df) chore: read `ESLINT_MOCHA_TIMEOUT` env var in Makefile.js (#15626) (Piggy)
+* [`b93af98`](https://github.com/eslint/eslint/commit/b93af98b3c417225a027cabc964c38e779adb945) docs: add links between rules about whitespace around block curly braces (#15625) (Milos Djermanovic)
+* [`ebc0460`](https://github.com/eslint/eslint/commit/ebc0460c411ea608ba5bab05829a1fd122fe21e8) docs: update babel links (#15624) (Milos Djermanovic)
+* [`115cae5`](https://github.com/eslint/eslint/commit/115cae54125b9ef509af90620f51d4a692b51ab7) feat: `--debug` prints time it takes to parse a file (#15609) (Bartek Iwańczuk)
+* [`345e70d`](https://github.com/eslint/eslint/commit/345e70d9d6490fb12b18953f56f3cea28fd61d83) feat: Add `onlyOneSimpleParam` option to no-confusing-arrow rule (#15566) (Gautam Arora)
+* [`bfaa548`](https://github.com/eslint/eslint/commit/bfaa5488bbc794c0d160fb55bd277a2c618953b2) test: add integration tests with built-in configs (#15612) (Milos Djermanovic)
+* [`39a2fb3`](https://github.com/eslint/eslint/commit/39a2fb3f448a7096bfb2fc172fef6cc3f6a7ed3b) perf: fix lazy loading of core rules (#15606) (Milos Djermanovic)
+* [`3fc9196`](https://github.com/eslint/eslint/commit/3fc919626ef6a00e35bb6b559b60a1e89cf6ca1a) chore: include `tests/conf` in test runs (#15610) (Milos Djermanovic)
+* [`ee7c5d1`](https://github.com/eslint/eslint/commit/ee7c5d14a2cb5ce352d1851cec858b942572d2cc) fix: false positive in `camelcase` with combined properties (#15581) (Nitin Kumar)
+
+v8.9.0 - February 11, 2022
+
+* [`68f64a9`](https://github.com/eslint/eslint/commit/68f64a9218341e5e9d83270c72587e1b413846de) feat: update eslint-scope to ignore `"use strict"` directives in ES3 (#15595) (Milos Djermanovic)
+* [`db57639`](https://github.com/eslint/eslint/commit/db576396d20f5e31af1a90f8e5d88e08284a1672) feat: add `es2016`, `es2018`, `es2019`, and `es2022` environments (#15587) (Milos Djermanovic)
+* [`586d45c`](https://github.com/eslint/eslint/commit/586d45c54b8468fb23376b7b2aedf984cf701cc2) chore: Upgrade to espree@9.3.1 (#15600) (Milos Djermanovic)
+* [`623e1e2`](https://github.com/eslint/eslint/commit/623e1e28643381025b393a379493d9baea9b4869) chore: Upgrade to eslint-visitor-keys@3.3.0 (#15599) (Milos Djermanovic)
+* [`570a036`](https://github.com/eslint/eslint/commit/570a03699c5abfbcde39bb00fba39329695771e5) docs: add `one-var` example with `for-loop` initializer (#15596) (Milos Djermanovic)
+* [`2dc38aa`](https://github.com/eslint/eslint/commit/2dc38aa653f1d5137a9abf82024c67a11620bb7c) feat: fix bug with arrow function return types in function-paren-newline (#15541) (Milos Djermanovic)
+* [`355b23d`](https://github.com/eslint/eslint/commit/355b23d0c4e050be4e53292f552a47c10ec6e00e) chore: fix outdated link to Code of Conduct in PR template (#15578) (Rich Trott)
+* [`417191d`](https://github.com/eslint/eslint/commit/417191dff0dbfa353675c409e25f27f578ee1559) docs: Remove the $ prefix in terminal commands (#15565) (Andreas Lewis)
+* [`389ff34`](https://github.com/eslint/eslint/commit/389ff34e26cb8ebad49e5ace0280a1f859f8d7ca) docs: add missing `Variable#scope` property in the scope manager docs (#15571) (Milos Djermanovic)
+* [`b10fef2`](https://github.com/eslint/eslint/commit/b10fef25c99134d514fec4ddde19302661db5974) ci: use Node 16 for browser test (#15569) (Milos Djermanovic)
+* [`f63795d`](https://github.com/eslint/eslint/commit/f63795dc710f6394d884932034a3e0cbe48f4ad2) docs: no-eval replace dead link with working one (#15568) (rasenplanscher)
+* [`6f940c3`](https://github.com/eslint/eslint/commit/6f940c3ce715327f282c197d0f71b91848e5d83d) feat: Implement FlatRuleTester (#15519) (Nicholas C. Zakas)
+* [`0383591`](https://github.com/eslint/eslint/commit/0383591a6cd7083455af9e34fa9333da7fed46bf) docs: Remove old Markdown issue template (#15556) (Brandon Mills)
+* [`92f89fb`](https://github.com/eslint/eslint/commit/92f89fb0647fef10468fd70d6782a845d75330e3) chore: suggest demo link in bug report template (#15557) (Brandon Mills)
+* [`a8dd5a2`](https://github.com/eslint/eslint/commit/a8dd5a286bcb68595b85cd29490e081251a2c3c7) docs: add 'when not to use it' section in no-duplicate-case docs (#15563) (Milos Djermanovic)
+* [`1ad439e`](https://github.com/eslint/eslint/commit/1ad439ed1d6c4ee50183c8f5d146a771e6c1be4c) docs: add missed verb in docs (#15550) (Jeff Mosawy)
+
+v8.8.0 - January 28, 2022
+
+* [`5d60812`](https://github.com/eslint/eslint/commit/5d60812d440762dff72420714273c714c4c5d074) feat: implement rfc 2021-suppression-support (#15459) (Yiwei Ding)
+* [`5769cc2`](https://github.com/eslint/eslint/commit/5769cc23eca7197bb5993a0201cc269a056d4dfd) docs: fix relative link (#15544) (Nick Schonning)
+* [`ccbc35f`](https://github.com/eslint/eslint/commit/ccbc35ff3ebc89bb524a8fd8dc60df9408e58275) docs: trimmed rules h1s to just be rule names (#15514) (Josh Goldberg)
+* [`851f1f1`](https://github.com/eslint/eslint/commit/851f1f18bd1a5da32c1b645bfcb28fadc627ad9e) docs: fixed typo in comment (#15531) (Jiapei Liang)
+* [`7d7af55`](https://github.com/eslint/eslint/commit/7d7af55759eab2328aeeb71098d91f4a5e41b269) docs: address upcoming violation of markdownlint rule MD050/strong-style (#15529) (David Anson)
+
+v8.7.0 - January 15, 2022
+
+* [`369fb1b`](https://github.com/eslint/eslint/commit/369fb1b066279d761e59502111c2580834a41648) chore: Upgrade to eslint-visitor-keys@3.2.0 (#15526) (Brandon Mills)
+* [`a8db9a5`](https://github.com/eslint/eslint/commit/a8db9a597672d3f9122f1cc8de8dfeb6a7f6aeac) fix: no-invalid-this false positive in class field initializer (#15495) (Milos Djermanovic)
+* [`19ad061`](https://github.com/eslint/eslint/commit/19ad061290e1e97f760cfdce90a651cea9042c32) feat: no-restricted-imports support casing (#15439) (gfyoung)
+* [`f50f849`](https://github.com/eslint/eslint/commit/f50f849d2d2d92f28a944846cda209eaf624b9f4) docs: Update CLI docs to prefer local install (#15513) (Nicholas C. Zakas)
+* [`0469eb1`](https://github.com/eslint/eslint/commit/0469eb1028e82e71a2da8608a1b8864dc3f47f24) docs: Update shell code fences for new website (#15522) (Olga)
+* [`02d6426`](https://github.com/eslint/eslint/commit/02d642690282189664b9551e02fb7ff0e4b5c4fb) fix: Correctly consume RuleTester statics (#15507) (Brad Zacher)
+* [`db15802`](https://github.com/eslint/eslint/commit/db15802ec4d129c89e563a4bf43ec610292695ab) fix: Add property `fatalErrorCount` to ignored file results (#15520) (Francesco Trotta)
+* [`03ac8cf`](https://github.com/eslint/eslint/commit/03ac8cfc773279c01a62897692160f9a883ff4f5) fix: Prevent false positives with no-constant-condition (#15486) (Jordan Eldredge)
+* [`564ecdb`](https://github.com/eslint/eslint/commit/564ecdb992c6e236fa3ca903f8b2a645afc32d7e) feat: Support arbitrary module namespace names in no-restricted-imports (#15491) (Milos Djermanovic)
+* [`968a02a`](https://github.com/eslint/eslint/commit/968a02af455f76446269afe07191c6aa37d44a88) feat: Support arbitrary module namespace names in no-useless-rename (#15493) (Milos Djermanovic)
+* [`ba6317b`](https://github.com/eslint/eslint/commit/ba6317b4031c9f782b317bd1d9913e70b5625f28) ci: remove master branch from CI configs (#15501) (Milos Djermanovic)
+* [`0d2b9a6`](https://github.com/eslint/eslint/commit/0d2b9a6dfa544f7ab084425eafc90a90aa14bcae) feat: move `eslint --init` to @eslint/create-config (#15150) (唯然)
+* [`79b6340`](https://github.com/eslint/eslint/commit/79b6340d6ced0ad62628de6e51dce18d50a5be9f) chore: fixed typo in client-Engine (#15497) (Abhay Gupta)
+* [`127f524`](https://github.com/eslint/eslint/commit/127f524337f92dd72d36e71e646c91c9715ad444) feat: false negative with `property` option in `id-match` (#15474) (Nitin Kumar)
+* [`359b2c1`](https://github.com/eslint/eslint/commit/359b2c18233cb48f7dae9433a877e5727fab3411) feat: Support arbitrary module namespace names in the camelcase rule (#15490) (Milos Djermanovic)
+* [`3549571`](https://github.com/eslint/eslint/commit/3549571702dc3e0d9a4d3de615adb6abb13859c4) feat: Support arbitrary module namespace names in the quotes rule (#15479) (Milos Djermanovic)
+* [`5563c45`](https://github.com/eslint/eslint/commit/5563c454901aafd54e01521e923cdcbaf051b08d) feat: Support arbitrary module namespace names in keyword-spacing (#15481) (Milos Djermanovic)
+* [`fd3683f`](https://github.com/eslint/eslint/commit/fd3683f2f5ead78a2444163cab6849784a966a0a) feat: Support arbitrary module namespace names in no-restricted-exports (#15478) (Milos Djermanovic)
+* [`6278281`](https://github.com/eslint/eslint/commit/6278281fab5e1a9623c32ace62a050561e1c0a21) chore: switch `new syntax` issue template to forms (#15480) (Nitin Kumar)
+
+v8.6.0 - December 31, 2021
+
+* [`3a384fc`](https://github.com/eslint/eslint/commit/3a384fc287cebb7be5fe5ed95497d578437a503a) chore: Upgrade espree to 9.3.0 (#15473) (Brandon Mills)
+* [`1443cc2`](https://github.com/eslint/eslint/commit/1443cc2fc8785157936b864258924fe9bcd23210) chore: Update blogpost.md.ejs (#15468) (Nicholas C. Zakas)
+* [`6c4dee2`](https://github.com/eslint/eslint/commit/6c4dee2e87dac8d0751ce2426ded651ed0986112) docs: Document homedir is a configuration root (#15469) (Bas Bosman)
+* [`6802a54`](https://github.com/eslint/eslint/commit/6802a54837ea008bef4d5ae11522941693ba5ef6) feat: handle logical assignment in no-self-assign (#14152) (Zzzen)
+* [`3b38018`](https://github.com/eslint/eslint/commit/3b38018ef5cb004ad5bc011de726bd2df2eb2f3f) feat: allow to define `eslint-disable-next-line` in multiple lines (#15436) (Nitin Kumar)
+* [`51c37b1`](https://github.com/eslint/eslint/commit/51c37b118aed9c0d7a0efd40c491efca04c82ef9) docs: consistency changes (#15404) (Bas Bosman)
+* [`28e907a`](https://github.com/eslint/eslint/commit/28e907a4ca05a026d156f814f4118f8fe713e99d) refactor: remove unused parameter in `linter.js` (#15451) (Milos Djermanovic)
+* [`eaa08d3`](https://github.com/eslint/eslint/commit/eaa08d3055b195bce59cc96bb63ac29038cd7c7d) test: add tests for `allowReserved` parser option with flat config (#15450) (Milos Djermanovic)
+* [`9d6fe5a`](https://github.com/eslint/eslint/commit/9d6fe5a6b65f397bafc5eb0a995e96717cdc9b53) feat: false negative with `onlyDeclarations` + `properties` in id-match (#15431) (Nitin Kumar)
+* [`775d181`](https://github.com/eslint/eslint/commit/775d18138244a28ebe1cb92849cd0f4e8cd27672) docs: Mention character classes in no-useless-escape (#15421) (Sebastian Simon)
+
+v8.5.0 - December 17, 2021
+
+* [`7d832d4`](https://github.com/eslint/eslint/commit/7d832d4ad55f3c987aca8d858809cbcb77697648) fix: improve `prefer-template` fixer (#15230) (Nitin Kumar)
+* [`94e77a6`](https://github.com/eslint/eslint/commit/94e77a693fd5124c9057320310b41e92567d7e76) feat: Suggestions support for `prefer-regex-literals` (#15077) (Yash Singh)
+* [`314c84c`](https://github.com/eslint/eslint/commit/314c84c1b83b32e75587ce7a77130eac7e2a8f49) docs: add an incorrect code example in for-direction (#15434) (Holger Jeromin)
+* [`981fb48`](https://github.com/eslint/eslint/commit/981fb48991448bec171d7d4332d7dc514252f83f) fix: do not report global references in `id-match` rule (#15420) (Nitin Kumar)
+* [`3928175`](https://github.com/eslint/eslint/commit/3928175d01c6ac2b37147b3256c56df8faf2c6c4) docs: add destructuring examples for `computed-property-spacing` (#15423) (Nitin Kumar)
+* [`225f211`](https://github.com/eslint/eslint/commit/225f2111ebcfc6bcd2d475f5261c85eb00fb0191) test: add destructuring test cases for `computed-property-spacing` (#15424) (Nitin Kumar)
+* [`f13d4a6`](https://github.com/eslint/eslint/commit/f13d4a6cf7c7ff6160be7426fc6fe02e3e37a0b7) fix: improve autofix of `prefer-object-has-own` (#15419) (Nitin Kumar)
+* [`f4559a0`](https://github.com/eslint/eslint/commit/f4559a0f7150ad7494658bd5ea846cfca5073caf) fix: add helpful message when test case has non-string code/name (#15425) (Bryan Mishkin)
+* [`a53e59e`](https://github.com/eslint/eslint/commit/a53e59eab7da52e3df095a679a6fdab74a7bce6f) docs: add more examples for `array-element-newline` rule (#15427) (Nitin Kumar)
+* [`f2c7ba6`](https://github.com/eslint/eslint/commit/f2c7ba6c34c8943dc24a1c41317d536c1a63cb36) ci: use node v16 for `macOS` and `windows` jobs (#15418) (Nitin Kumar)
+* [`eafaf52`](https://github.com/eslint/eslint/commit/eafaf52464c01072fcf7be2bd2d91cd0b3ae67d0) feat: add `prefer-object-has-own` rule (#15346) (Nitin Kumar)
+* [`74cf0a0`](https://github.com/eslint/eslint/commit/74cf0a040e1a83990d8d7eb57e1f5ce919a11ebe) docs: update CLA info (#15370) (Nitin Kumar)
+* [`e84195e`](https://github.com/eslint/eslint/commit/e84195ea39b5cf54d7a551c62671af80b859f1ac) docs: fix heading level for an option in `class-methods-use-this` rule (#15399) (Takuya Fukuju)
+
+v8.4.1 - December 6, 2021
+
+* [`234e3d9`](https://github.com/eslint/eslint/commit/234e3d98eeab8956cefb14c982b9c348c21bb2d9) fix: revert changes to reported locations in max-lines-per-function (#15397) (Milos Djermanovic)
+* [`fa4d483`](https://github.com/eslint/eslint/commit/fa4d4830a0e77f92154079ada17ffb893ce64232) docs: fix typo in example for `sort-keys` rule (#15393) (Nitin Kumar)
+
 v8.4.0 - December 3, 2021
 
 * [`efede90`](https://github.com/eslint/eslint/commit/efede90d59edc5cca9cd739df7e98f1ff00ca37d) chore: upgrade @eslint/eslintrc@1.0.5 (#15389) (Milos Djermanovic)
index 8f2246f3b4e3205751b9698189c82f77759e974e..40163d868470a4c04760285e283adaabddfd237c 100644 (file)
@@ -19,7 +19,7 @@ To report a security vulnerability in ESLint, please use our [HackerOne program]
 
 ## Contributing Code
 
-Please sign our [Contributor License Agreement](https://cla.js.foundation/eslint/eslint) and read over the [Pull Request Guidelines](https://eslint.org/docs/developer-guide/contributing/pull-requests).
+In order to submit code or documentation to an ESLint project, you’ll be asked to sign our CLA when you send your first pull request. (Read more about the Open JS Foundation CLA process at <https://cla.openjsf.org/>.) Also, please read over the [Pull Request Guidelines](https://eslint.org/docs/developer-guide/contributing/pull-requests).
 
 ## Full Documentation
 
index 3730e9b8db2aee0f2bae6b0ce666446deb8f8f7e..cbfc0c0ea02e3ad4ff98ede8798b19fe939389db 100644 (file)
@@ -12,9 +12,9 @@
 
 const checker = require("npm-license"),
     ReleaseOps = require("eslint-release"),
-    dateformat = require("dateformat"),
     fs = require("fs"),
     glob = require("glob"),
+    marked = require("marked"),
     markdownlint = require("markdownlint"),
     os = require("os"),
     path = require("path"),
@@ -22,6 +22,7 @@ const checker = require("npm-license"),
     ejs = require("ejs"),
     loadPerf = require("load-perf"),
     yaml = require("js-yaml"),
+    ignore = require("ignore"),
     { CLIEngine } = require("./lib/cli-engine"),
     builtinRules = require("./lib/rules/index");
 
@@ -32,7 +33,7 @@ require("shelljs/make");
  * @see https://github.com/shelljs/shelljs/blob/124d3349af42cb794ae8f78fc9b0b538109f7ca7/make.js#L4
  * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3aa2d09b6408380598cfb802743b07e1edb725f3/types/shelljs/make.d.ts#L8-L11
  */
-const { cat, cd, cp, echo, exec, exit, find, ls, mkdir, pwd, rm, test } = require("shelljs");
+const { cat, cd, echo, exec, exit, find, ls, mkdir, pwd, test } = require("shelljs");
 
 //------------------------------------------------------------------------------
 // Settings
@@ -59,8 +60,10 @@ const NODE = "node ", // intentional extra space
     TEMP_DIR = "./tmp/",
     DEBUG_DIR = "./debug/",
     BUILD_DIR = "build",
-    DOCS_DIR = "../website/docs",
-    SITE_DIR = "../website/",
+    SITE_DIR = "../eslint.org",
+    DOCS_DIR = "./docs",
+    DOCS_SRC_DIR = path.join(DOCS_DIR, "src"),
+    DOCS_DATA_DIR = path.join(DOCS_SRC_DIR, "_data"),
     PERF_TMP_DIR = path.join(TEMP_DIR, "eslint", "performance"),
 
     // Utilities - intentional extra space at the end of each string
@@ -70,15 +73,20 @@ const NODE = "node ", // intentional extra space
     // Files
     RULE_FILES = glob.sync("lib/rules/*.js").filter(filePath => path.basename(filePath) !== "index.js"),
     JSON_FILES = find("conf/").filter(fileType("json")),
-    MARKDOWNLINT_IGNORED_FILES = fs.readFileSync(path.join(__dirname, ".markdownlintignore"), "utf-8").split("\n"),
-    MARKDOWN_FILES_ARRAY = find("docs/").concat(ls(".")).filter(fileType("md")).filter(file => !MARKDOWNLINT_IGNORED_FILES.includes(file)),
-    TEST_FILES = "\"tests/{bin,lib,tools}/**/*.js\"",
-    PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslintrc.yml"),
+    MARKDOWNLINT_IGNORE_INSTANCE = ignore().add(fs.readFileSync(path.join(__dirname, ".markdownlintignore"), "utf-8")),
+    MARKDOWN_FILES_ARRAY = MARKDOWNLINT_IGNORE_INSTANCE.filter(find("docs/").concat(ls(".")).filter(fileType("md"))),
+    TEST_FILES = "\"tests/{bin,conf,lib,tools}/**/*.js\"",
+    PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslint.config.js"),
     PERF_MULTIFILES_TARGET_DIR = path.join(PERF_TMP_DIR, "eslint"),
-    PERF_MULTIFILES_TARGETS = `"${PERF_MULTIFILES_TARGET_DIR + path.sep}{lib,tests${path.sep}lib}${path.sep}**${path.sep}*.js"`,
+
+    /*
+     * glob arguments with Windows separator `\` don't work:
+     * https://github.com/eslint/eslint/issues/16259
+     */
+    PERF_MULTIFILES_TARGETS = `"${TEMP_DIR}eslint/performance/eslint/{lib,tests/lib}/**/*.js"`,
 
     // Settings
-    MOCHA_TIMEOUT = 10000;
+    MOCHA_TIMEOUT = parseInt(process.env.ESLINT_MOCHA_TIMEOUT, 10) || 10000;
 
 //------------------------------------------------------------------------------
 // Helpers
@@ -143,10 +151,10 @@ function generateBlogPost(releaseInfo, prereleaseMajorVersion) {
         now = new Date(),
         month = now.getMonth() + 1,
         day = now.getDate(),
-        filename = `../website/_posts/${now.getFullYear()}-${
+        filename = path.join(SITE_DIR, `src/content/blog/${now.getFullYear()}-${
             month < 10 ? `0${month}` : month}-${
             day < 10 ? `0${day}` : day}-eslint-v${
-            releaseInfo.version}-released.md`;
+            releaseInfo.version}-released.md`);
 
     output.to(filename);
 }
@@ -154,21 +162,16 @@ function generateBlogPost(releaseInfo, prereleaseMajorVersion) {
 /**
  * Generates a doc page with formatter result examples
  * @param {Object} formatterInfo Linting results from each formatter
- * @param {string} [prereleaseVersion] The version used for a prerelease. This
- *      changes where the output is stored.
  * @returns {void}
  */
-function generateFormatterExamples(formatterInfo, prereleaseVersion) {
+function generateFormatterExamples(formatterInfo) {
     const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
-    let filename = "../website/docs/user-guide/formatters/index.md",
-        htmlFilename = "../website/docs/user-guide/formatters/html-formatter-example.html";
-
-    if (prereleaseVersion) {
-        filename = filename.replace("/docs", `/docs/${prereleaseVersion}`);
-        htmlFilename = htmlFilename.replace("/docs", `/docs/${prereleaseVersion}`);
-        if (!test("-d", path.dirname(filename))) {
-            mkdir(path.dirname(filename));
-        }
+    const outputDir = path.join(DOCS_SRC_DIR, "user-guide/formatters/"),
+        filename = path.join(outputDir, "index.md"),
+        htmlFilename = path.join(outputDir, "html-formatter-example.html");
+
+    if (!test("-d", outputDir)) {
+        mkdir(outputDir);
     }
 
     output.to(filename);
@@ -180,10 +183,13 @@ function generateFormatterExamples(formatterInfo, prereleaseVersion) {
  * @returns {void}
  */
 function generateRuleIndexPage() {
-    const outputFile = "../website/_data/rules.yml",
+    const docsSiteOutputFile = path.join(DOCS_DATA_DIR, "rules.json"),
+        docsSiteMetaOutputFile = path.join(DOCS_DATA_DIR, "rules_meta.json"),
         ruleTypes = "conf/rule-type-list.json",
         ruleTypesData = JSON.parse(cat(path.resolve(ruleTypes)));
 
+    const meta = {};
+
     RULE_FILES
         .map(filename => [filename, path.basename(filename, ".js")])
         .sort((a, b) => a[1].localeCompare(b[1]))
@@ -192,6 +198,20 @@ function generateRuleIndexPage() {
             const basename = pair[1];
             const rule = require(path.resolve(filename));
 
+            /*
+             * Eleventy interprets the {{ }} in messages as being variables,
+             * which can cause an error if there's syntax it doesn't expect.
+             * Because we don't use this info in the website anyway, it's safer
+             * to just remove it.
+             *
+             * Also removing the schema because we don't need it.
+             */
+            meta[basename] = {
+                ...rule.meta,
+                schema: void 0,
+                messages: void 0
+            };
+
             if (rule.meta.deprecated) {
                 ruleTypesData.deprecated.rules.push({
                     name: basename,
@@ -218,9 +238,9 @@ function generateRuleIndexPage() {
     // `.rules` will be `undefined` if all rules in category are deprecated.
     ruleTypesData.types = ruleTypesData.types.filter(ruleType => !!ruleType.rules);
 
-    const output = yaml.dump(ruleTypesData, { sortKeys: true });
+    JSON.stringify(ruleTypesData, null, 4).to(docsSiteOutputFile);
+    JSON.stringify(meta, null, 4).to(docsSiteMetaOutputFile);
 
-    output.to(outputFile);
 }
 
 /**
@@ -234,18 +254,14 @@ function commitSiteToGit(tag) {
 
     cd(SITE_DIR);
     exec("git add -A .");
-    exec(`git commit -m "Autogenerated new docs and demo at ${dateformat(new Date())}"`);
-
-    if (tag) {
-        exec(`git tag ${tag}`);
-    }
-
-    exec("git fetch origin && git rebase origin/master");
+    exec(`git commit -m "Added release blog post for ${tag}"`);
+    exec(`git tag ${tag}`);
+    exec("git fetch origin && git rebase origin/main");
     cd(currentDir);
 }
 
 /**
- * Publishes the changes in an adjacent `website` repository to the remote. The
+ * Publishes the changes in an adjacent `eslint.org` repository to the remote. The
  * site should already have local commits (e.g. from running `commitSiteToGit`).
  * @returns {void}
  */
@@ -253,7 +269,7 @@ function publishSite() {
     const currentDir = pwd();
 
     cd(SITE_DIR);
-    exec("git push origin master --tags");
+    exec("git push origin HEAD --tags");
     cd(currentDir);
 }
 
@@ -270,6 +286,17 @@ function generateRelease() {
     target.gensite();
     generateBlogPost(releaseInfo);
     commitSiteToGit(`v${releaseInfo.version}`);
+
+    echo("Updating version in docs package");
+    const docsPackagePath = path.join(__dirname, "docs", "package.json");
+    const docsPackage = require(docsPackagePath);
+
+    docsPackage.version = releaseInfo.version;
+    fs.writeFileSync(docsPackagePath, `${JSON.stringify(docsPackage, null, 4)}\n`);
+
+    echo("Updating commit with docs data");
+    exec("git add docs/ && git commit --amend --no-edit");
+    exec(`git tag -a -f v${releaseInfo.version} -m ${releaseInfo.version}`);
 }
 
 /**
@@ -317,6 +344,10 @@ function generatePrerelease(prereleaseId) {
  */
 function publishRelease() {
     ReleaseOps.publishRelease();
+
+    // push to latest branch to trigger docs deploy
+    exec("git push origin HEAD:latest -f");
+
     publishSite();
 }
 
@@ -481,8 +512,17 @@ target.lint = function([fix = false] = []) {
     let errors = 0,
         lastReturn;
 
+    /*
+     * In order to successfully lint JavaScript files in the `docs` directory, dependencies declared in `docs/package.json`
+     * would have to be installed in `docs/node_modules`. In particular, eslint-plugin-node rules examine `docs/node_modules`
+     * when analyzing `require()` calls from CJS modules in the `docs` directory. Since our release process does not run `npm install`
+     * in the `docs` directory, linting would fail and break the release. Also, working on the main `eslint` package does not require
+     * installing dependencies declared in `docs/package.json`, so most contributors will not have `docs/node_modules` locally.
+     * Therefore, we add `--ignore-pattern docs` to exclude linting the `docs` directory from this command.
+     * There is a separate command `target.lintDocsJS` for linting JavaScript files in the `docs` directory.
+     */
     echo("Validating JavaScript files");
-    lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} .`);
+    lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} . --ignore-pattern docs`);
     if (lastReturn.code !== 0) {
         errors++;
     }
@@ -501,6 +541,21 @@ target.lint = function([fix = false] = []) {
     }
 };
 
+target.lintDocsJS = function([fix = false] = []) {
+    let errors = 0;
+
+    echo("Validating JavaScript files in the docs directory");
+    const lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} docs/.eleventy.js`);
+
+    if (lastReturn.code !== 0) {
+        errors++;
+    }
+
+    if (errors) {
+        exit(1);
+    }
+};
+
 target.fuzz = function({ amount = 1000, fuzzBrokenAutofixes = false } = {}) {
     const fuzzerRunner = require("./tools/fuzzer-runner");
     const fuzzResults = fuzzerRunner.run({ amount, fuzzBrokenAutofixes });
@@ -546,12 +601,12 @@ target.mocha = () => {
 
     echo("Running unit tests");
 
-    lastReturn = exec(`${getBinFile("nyc")} -- ${MOCHA} --forbid-only -R progress -t ${MOCHA_TIMEOUT} -c ${TEST_FILES}`);
+    lastReturn = exec(`${getBinFile("c8")} -- ${MOCHA} --forbid-only -R progress -t ${MOCHA_TIMEOUT} -c ${TEST_FILES}`);
     if (lastReturn.code !== 0) {
         errors++;
     }
 
-    lastReturn = exec(`${getBinFile("nyc")} check-coverage --statement 98 --branch 97 --function 98 --lines 98`);
+    lastReturn = exec(`${getBinFile("c8")} check-coverage --statement 98 --branch 97 --function 98 --lines 98`);
     if (lastReturn.code !== 0) {
         errors++;
     }
@@ -582,48 +637,14 @@ target.test = function() {
     target.checkLicenses();
 };
 
-target.gensite = function(prereleaseVersion) {
-    echo("Generating eslint.org");
-
-    let docFiles = [
-        "/rules/",
-        "/user-guide/",
-        "/maintainer-guide/",
-        "/developer-guide/",
-        "/about/"
-    ];
-
-    // append version
-    if (prereleaseVersion) {
-        docFiles = docFiles.map(docFile => `/${prereleaseVersion}${docFile}`);
-    }
-
-    // 1. create temp and build directory
-    echo("> Creating a temporary directory (Step 1)");
-    if (!test("-d", TEMP_DIR)) {
-        mkdir(TEMP_DIR);
-    }
-
-    // 2. remove old files from the site
-    echo("> Removing old files (Step 2)");
-    docFiles.forEach(filePath => {
-        const fullPath = path.join(DOCS_DIR, filePath),
-            htmlFullPath = fullPath.replace(".md", ".html");
-
-        if (test("-f", fullPath)) {
-            rm("-rf", fullPath);
+target.gensite = function() {
+    echo("Generating documentation");
 
-            if (filePath.indexOf(".md") >= 0 && test("-f", htmlFullPath)) {
-                rm("-rf", htmlFullPath);
-            }
-        }
-    });
+    const DOCS_RULES_DIR = path.join(DOCS_SRC_DIR, "rules");
+    const RULE_VERSIONS_FILE = path.join(DOCS_SRC_DIR, "_data/rule_versions.json");
 
-    // 3. Copy docs folder to a temporary directory
-    echo("> Copying the docs folder (Step 3)");
-    cp("-rf", "docs/*", TEMP_DIR);
-
-    let versions = test("-f", "./versions.json") ? JSON.parse(cat("./versions.json")) : {};
+    // Set up rule version information
+    let versions = test("-f", RULE_VERSIONS_FILE) ? JSON.parse(cat(RULE_VERSIONS_FILE)) : {};
 
     if (!versions.added) {
         versions = {
@@ -632,149 +653,45 @@ target.gensite = function(prereleaseVersion) {
         };
     }
 
-    const { Linter } = require(".");
-    const rules = new Linter().getRules();
-
-    const RECOMMENDED_TEXT = "\n\n(recommended) The `\"extends\": \"eslint:recommended\"` property in a configuration file enables this rule.";
-    const FIXABLE_TEXT = "\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.";
-    const HAS_SUGGESTIONS_TEXT = "\n\n(hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions).";
+    // 1. Update rule meta data by checking rule docs - important to catch removed rules
+    echo("> Updating rule version meta data (Step 1)");
+    const ruleDocsFiles = find(DOCS_RULES_DIR);
 
-    // 4. Loop through all files in temporary directory
-    process.stdout.write("> Updating files (Steps 4-9): 0/... - ...\r");
-    const tempFiles = find(TEMP_DIR);
-    const length = tempFiles.length;
-
-    tempFiles.forEach((filename, i) => {
+    ruleDocsFiles.forEach((filename, i) => {
         if (test("-f", filename) && path.extname(filename) === ".md") {
 
-            const rulesUrl = "https://github.com/eslint/eslint/tree/HEAD/lib/rules/",
-                testsUrl = "https://github.com/eslint/eslint/tree/HEAD/tests/lib/rules/",
-                docsUrl = "https://github.com/eslint/eslint/tree/HEAD/docs/rules/",
-                baseName = path.basename(filename),
-                sourceBaseName = `${path.basename(filename, ".md")}.js`,
-                sourcePath = path.join("lib/rules", sourceBaseName),
-                ruleName = path.basename(filename, ".md"),
-                filePath = path.join("docs", path.relative("tmp", filename));
-            let text = cat(filename),
-                ruleType = "",
-                title;
-
-            process.stdout.write(`> Updating files (Steps 4-9): ${i}/${length} - ${filePath + " ".repeat(30)}\r`);
-
-            // 5. Prepend page title and layout variables at the top of rules
-            if (path.dirname(filename).indexOf("rules") >= 0) {
-
-                // Find out if the rule requires a special docs portion (e.g. if it is recommended and/or fixable)
-                const rule = rules.get(ruleName);
-                const isRecommended = rule && rule.meta.docs.recommended;
-                const isFixable = rule && rule.meta.fixable;
-                const hasSuggestions = rule && rule.meta.hasSuggestions;
-
-                // Incorporate the special portion into the documentation content
-                const textSplit = text.split("\n");
-                const ruleHeading = textSplit[0];
-                const ruleDocsContent = textSplit.slice(1).join("\n");
-
-                text = `${ruleHeading}${isRecommended ? RECOMMENDED_TEXT : ""}${isFixable ? FIXABLE_TEXT : ""}${hasSuggestions ? HAS_SUGGESTIONS_TEXT : ""}\n${ruleDocsContent}`;
-                title = `${ruleName} - Rules`;
-
-                if (rule && rule.meta) {
-                    ruleType = `rule_type: ${rule.meta.type}`;
-                }
-            } else {
+            echo(`> Updating rule version meta data (Step 1: ${i + 1}/${ruleDocsFiles.length}): ${filename}`);
 
-                // extract the title from the file itself
-                title = text.match(/#([^#].+)\n/u);
-                if (title) {
-                    title = title[1].trim();
-                } else {
-                    title = "Documentation";
-                }
-            }
+            const baseName = path.basename(filename, ".md"),
+                sourceBaseName = `${baseName}.js`,
+                sourcePath = path.join("lib/rules", sourceBaseName);
 
-            text = [
-                "---",
-                `title: ${title}`,
-                "layout: doc",
-                `edit_link: https://github.com/eslint/eslint/edit/main/${filePath}`,
-                ruleType,
-                "---",
-                "<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->",
-                "",
-                text
-            ].join("\n");
-
-            // 6. Remove .md extension for relative links and change README to empty string
-            text = text.replace(/\((?!https?:\/\/)([^)]*?)\.md(.*?)\)/gu, "($1$2)").replace("README.html", "");
-
-            // 7. Check if there's a trailing white line at the end of the file, if there isn't one, add it
-            if (!/\n$/u.test(text)) {
-                text = `${text}\n`;
+            if (!versions.added[baseName]) {
+                versions.added[baseName] = getFirstVersionOfFile(sourcePath);
             }
 
-            // 8. Append first version of ESLint rule was added at.
-            if (filename.indexOf("rules/") !== -1) {
-                if (!versions.added[baseName]) {
-                    versions.added[baseName] = getFirstVersionOfFile(sourcePath);
-                }
-                const added = versions.added[baseName];
-
-                if (!versions.removed[baseName] && !test("-f", sourcePath)) {
-                    versions.removed[baseName] = getFirstVersionOfDeletion(sourcePath);
-                }
-                const removed = versions.removed[baseName];
-
-                text += "\n## Version\n\n";
-                text += removed
-                    ? `This rule was introduced in ESLint ${added} and removed in ${removed}.\n`
-                    : `This rule was introduced in ESLint ${added}.\n`;
-
-                text += "\n## Resources\n\n";
-                if (!removed) {
-                    text += `* [Rule source](${rulesUrl}${sourceBaseName})\n`;
-                    text += `* [Test source](${testsUrl}${sourceBaseName})\n`;
-                }
-                text += `* [Documentation source](${docsUrl}${baseName})\n`;
+            if (!versions.removed[baseName] && !test("-f", sourcePath)) {
+                versions.removed[baseName] = getFirstVersionOfDeletion(sourcePath);
             }
 
-            // 9. Update content of the file with changes
-            text.to(filename.replace("README.md", "index.md"));
         }
     });
-    JSON.stringify(versions).to("./versions.json");
-    echo(`> Updating files (Steps 4-9)${" ".repeat(50)}`);
 
-    // 10. Copy temporary directory to site's docs folder
-    echo("> Copying the temporary directory into the site's docs folder (Step 10)");
-    let outputDir = DOCS_DIR;
+    JSON.stringify(versions, null, 4).to(RULE_VERSIONS_FILE);
 
-    if (prereleaseVersion) {
-        outputDir += `/${prereleaseVersion}`;
-        if (!test("-d", outputDir)) {
-            mkdir(outputDir);
-        }
-    }
-    cp("-rf", `${TEMP_DIR}*`, outputDir);
+    // 2. Generate rules index page meta data
+    echo("> Generating the rules index page (Step 2)");
+    generateRuleIndexPage();
 
-    // 11. Generate rules index page
-    if (prereleaseVersion) {
-        echo("> Skipping generating rules index page because this is a prerelease (Step 11)");
-    } else {
-        echo("> Generating the rules index page (Step 11)");
-        generateRuleIndexPage();
-    }
+    // 3. Create Example Formatter Output Page
+    echo("> Creating the formatter examples (Step 3)");
+    generateFormatterExamples(getFormatterResults());
 
-    // 12. Delete temporary directory
-    echo("> Removing the temporary directory (Step 12)");
-    rm("-rf", TEMP_DIR);
-
-    // 13. Create Example Formatter Output Page
-    echo("> Creating the formatter examples (Step 14)");
-    generateFormatterExamples(getFormatterResults(), prereleaseVersion);
-
-    echo("Done generating eslint.org");
+    echo("Done generating documentation");
 };
 
+target.generateRuleIndexPage = generateRuleIndexPage;
+
 target.webpack = function(mode = "none") {
     exec(`${getBinFile("webpack")} --mode=${mode} --output-path=${BUILD_DIR}`);
 };
@@ -788,9 +705,11 @@ target.checkRuleFiles = function() {
 
     RULE_FILES.forEach(filename => {
         const basename = path.basename(filename, ".js");
-        const docFilename = `docs/rules/${basename}.md`;
+        const docFilename = `docs/src/rules/${basename}.md`;
         const docText = cat(docFilename);
+        const docMarkdown = marked.lexer(docText, { gfm: true, silent: false });
         const ruleCode = cat(filename);
+        const knownHeaders = ["Rule Details", "Options", "Environments", "Examples", "Known Limitations", "When Not To Use It", "Compatibility"];
 
         /**
          * Check if basename is present in rule-types.json file.
@@ -806,21 +725,42 @@ target.checkRuleFiles = function() {
          * @param {string} id id to check for
          * @returns {boolean} true if present
          * @private
+         * @todo Will remove this check when the main heading is automatically generated from rule metadata.
          */
         function hasIdInTitle(id) {
-            const idOldAtEndOfTitleRegExp = new RegExp(`^# (.*?) \\(${id}\\)`, "u"); // original format
-            const idNewAtBeginningOfTitleRegExp = new RegExp(`^# ${id}: `, "u"); // new format is same as rules index
+            return new RegExp(`title: ${id}`, "u").test(docText);
+        }
+
+        /**
+         * Check if all H2 headers are known and in the expected order
+         * Only H2 headers are checked as H1 and H3 are variable and/or rule specific.
+         * @returns {boolean} true if all headers are known and in the right order
+         */
+        function hasKnownHeaders() {
+            const headers = docMarkdown.filter(token => token.type === "heading" && token.depth === 2).map(header => header.text);
+
+            for (const header of headers) {
+                if (!knownHeaders.includes(header)) {
+                    return false;
+                }
+            }
+
             /*
-             * 1. Added support for new format.
-             * 2. Will remove support for old format after all docs files have new format.
-             * 3. Will remove this check when the main heading is automatically generated from rule metadata.
+             * Check only the subset of used headers for the correct order
              */
+            const presentHeaders = knownHeaders.filter(header => headers.includes(header));
 
-            return idNewAtBeginningOfTitleRegExp.test(docText) || idOldAtEndOfTitleRegExp.test(docText);
+            for (let i = 0; i < presentHeaders.length; ++i) {
+                if (presentHeaders[i] !== headers[i]) {
+                    return false;
+                }
+            }
+
+            return true;
         }
 
         /**
-         * Check if deprecated information is in rule code and READNE.md.
+         * Check if deprecated information is in rule code and README.md.
          * @returns {boolean} true if present
          * @private
          */
@@ -848,11 +788,17 @@ target.checkRuleFiles = function() {
             errors++;
         } else {
 
-            // check for proper doc format
+            // check for proper doc h1 format
             if (!hasIdInTitle(basename)) {
                 console.error("Missing id in the doc page's title of rule %s", basename);
                 errors++;
             }
+
+            // check for proper doc headers
+            if (!hasKnownHeaders()) {
+                console.error("Unknown or misplaced header in the doc page of rule %s, allowed headers (and their order) are: '%s'", basename, knownHeaders.join("', '"));
+                errors++;
+            }
         }
 
         // check for recommended configuration
@@ -977,19 +923,21 @@ function downloadMultifilesTestTarget(cb) {
  * @returns {void}
  */
 function createConfigForPerformanceTest() {
-    const content = [
-        "root: true",
-        "env:",
-        "    node: true",
-        "    es6: true",
-        "rules:"
-    ];
+    let rules = "";
 
     for (const [ruleId] of builtinRules) {
-        content.push(`    ${ruleId}: 1`);
+        rules += (`    "${ruleId}": 1,\n`);
+    }
+
+    const content = `
+module.exports = [{
+    "languageOptions": {sourceType: "commonjs"},
+    "rules": {
+    ${rules}
     }
+}];`;
 
-    content.join("\n").to(PERF_ESLINTRC);
+    content.to(PERF_ESLINTRC);
 }
 
 /**
@@ -1049,7 +997,7 @@ function time(cmd, runs, runNumber, results, cb) {
 function runPerformanceTest(title, targets, multiplier, cb) {
     const cpuSpeed = os.cpus()[0].speed,
         max = multiplier / cpuSpeed,
-        cmd = `${ESLINT}--config "${PERF_ESLINTRC}" --no-eslintrc --no-ignore ${targets}`;
+        cmd = `${ESLINT}--config "${PERF_ESLINTRC}" --no-config-lookup --no-ignore ${targets}`;
 
     echo("");
     echo(title);
index e8b005d7de39cddab18b7086bd0933035504ef4c..309db3dc84998d8e88bf690ccf4d2ad007143c98 100644 (file)
@@ -45,27 +45,21 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
 
 Prerequisites: [Node.js](https://nodejs.org/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
 
-You can install ESLint using npm:
+You can install and configure ESLint using this command:
 
-```sh
-$ npm install eslint --save-dev
-```
-
-You should then set up a configuration file:
-
-```sh
-$ ./node_modules/.bin/eslint --init
+```shell
+npm init @eslint/config
 ```
 
 After that, you can run ESLint on any file or directory like this:
 
-```sh
-./node_modules/.bin/eslint yourfile.js
+```shell
+./node_modules/.bin/eslint yourfile.js
 ```
 
 ## <a name="configuration"></a>Configuration
 
-After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
+After running `npm init @eslint/config`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
 
 ```json
 {
@@ -129,7 +123,7 @@ ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2
 
 ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis.
 
-In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel.
+In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel.
 
 Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
 
@@ -235,15 +229,15 @@ Milos Djermanovic
 The people who review and implement new features.
 
 <table><tbody><tr><td align="center" valign="top" width="11%">
-<a href="https://github.com/mysticatea">
-<img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
-Toru Nagashima
-</a>
-</td><td align="center" valign="top" width="11%">
 <a href="https://github.com/aladdin-add">
 <img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br />
 唯然
 </a>
+</td><td align="center" valign="top" width="11%">
+<a href="https://github.com/snitin315">
+<img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br />
+Nitin Kumar
+</a>
 </td></tr></tbody></table>
 
 ### Committers
@@ -261,6 +255,11 @@ Brett Zamir
 Bryan Mishkin
 </a>
 </td><td align="center" valign="top" width="11%">
+<a href="https://github.com/SaraSoueidan">
+<img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br />
+Sara Soueidan
+</a>
+</td><td align="center" valign="top" width="11%">
 <a href="https://github.com/g-plane">
 <img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
 Pig Fang
@@ -275,11 +274,6 @@ Anix
 <img src="https://github.com/yeonjuan.png?s=75" width="75" height="75"><br />
 YeonJuan
 </a>
-</td><td align="center" valign="top" width="11%">
-<a href="https://github.com/snitin315">
-<img src="https://github.com/snitin315.png?s=75" width="75" height="75"><br />
-Nitin Kumar
-</a>
 </td></tr></tbody></table>
 
 <!--teamend-->
@@ -292,9 +286,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
 <!--sponsorsstart-->
 <h3>Platinum Sponsors</h3>
 <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
-<p><a href="https://contra.com"><img src="https://images.opencollective.com/contra1/c70f93f/logo.png" alt="Contra" height="96"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://google.com/chrome"><img src="https://images.opencollective.com/chrome/dc55bd4/logo.png" alt="Chrome's Web Framework & Tools Performance Fund" height="96"></a> <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://coinbase.com"><img src="https://avatars.githubusercontent.com/u/1885080?v=4" alt="Coinbase" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
+<p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a></p><h3>Silver Sponsors</h3>
 <p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
-<p><a href="https://sumatosoft.com/"><img src="https://images.opencollective.com/sumatosoft1/cab6013/logo.png" alt="SumatoSoft" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://www.practiceignition.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Practice Ignition" height="32"></a></p>
+<p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p>
 <!--sponsorsend-->
 
 ## <a name="technology-sponsors"></a>Technology Sponsors
index 6b05356b9dbfafd166b046f0e1641b697939d285..7094ac77bc4bda99ec565d13dda6cc853b43e652 100755 (executable)
@@ -9,9 +9,6 @@
 
 "use strict";
 
-// to use V8's code cache to speed up instantiation time
-require("v8-compile-cache");
-
 // must do this initialization *before* other requires in order to work
 if (process.argv.includes("--debug")) {
     require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
@@ -69,7 +66,7 @@ function getErrorMessage(error) {
     // Lazy loading because this is used only if an error happened.
     const util = require("util");
 
-    // Foolproof -- thirdparty module might throw non-object.
+    // Foolproof -- third-party module might throw non-object.
     if (typeof error !== "object" || error === null) {
         return String(error);
     }
@@ -124,13 +121,20 @@ ${message}`);
 
     // Call the config initializer if `--init` is present.
     if (process.argv.includes("--init")) {
-        await require("../lib/init/config-initializer").initializeConfig();
+
+        // `eslint --init` has been moved to `@eslint/create-config`
+        console.warn("You can also run this command directly using 'npm init @eslint/config'.");
+
+        const spawn = require("cross-spawn");
+
+        spawn.sync("npm", ["init", "@eslint/config"], { encoding: "utf8", stdio: "inherit" });
         return;
     }
 
     // Otherwise, call the CLI.
     process.exitCode = await require("../lib/cli").execute(
         process.argv,
-        process.argv.includes("--stdin") ? await readStdin() : null
+        process.argv.includes("--stdin") ? await readStdin() : null,
+        true
     );
 }()).catch(onFatalError);
index 076ffb2af94229c87133ceac387c7053dfaca73a..6018b7af15c2eaeb59f06a956d9cf89d790538fc 100644 (file)
@@ -124,6 +124,10 @@ const es2022 = {
     ...es2021
 };
 
+const es2023 = {
+    ...es2022
+};
+
 
 //-----------------------------------------------------------------------------
 // Exports
@@ -140,5 +144,6 @@ module.exports = {
     es2019,
     es2020,
     es2021,
-    es2022
+    es2022,
+    es2023
 };
diff --git a/eslint/docs/.eleventy.js b/eslint/docs/.eleventy.js
new file mode 100644 (file)
index 0000000..b3e3026
--- /dev/null
@@ -0,0 +1,500 @@
+"use strict";
+
+const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
+const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
+const pluginRss = require("@11ty/eleventy-plugin-rss");
+const pluginTOC = require("eleventy-plugin-nesting-toc");
+const markdownItAnchor = require("markdown-it-anchor");
+const markdownItContainer = require("markdown-it-container");
+const Image = require("@11ty/eleventy-img");
+const path = require("path");
+const { slug } = require("github-slugger");
+const yaml = require("js-yaml");
+
+const {
+    DateTime
+} = require("luxon");
+
+module.exports = function(eleventyConfig) {
+
+    /*
+     * The docs stored in the eslint repo are loaded through eslint.org at
+     * at /docs/head to show the most recent version of the documentation
+     * based on the HEAD commit. This gives users a preview of what's coming
+     * in the next release. This is the way that the site works locally so
+     * it's easier to see if URLs are broken.
+     *
+     * When a release is published, HEAD is pushed to the "latest" branch.
+     * Netlify deploys that branch as well, and in that case, we want the
+     * docs to be loaded from /docs/latest on eslint.org.
+     *
+     * The path prefix is turned off for deploy previews so we can properly
+     * see changes before deployed.
+     */
+
+    let pathPrefix = "/docs/head/";
+
+    if (process.env.CONTEXT === "deploy-preview") {
+        pathPrefix = "/";
+    } else if (process.env.BRANCH === "latest") {
+        pathPrefix = "/docs/latest/";
+    }
+
+    //------------------------------------------------------------------------------
+    // Data
+    //------------------------------------------------------------------------------
+
+    // Load site-specific data
+    const siteName = process.env.ESLINT_SITE_NAME || "en";
+
+    eleventyConfig.addGlobalData("site_name", siteName);
+    eleventyConfig.addGlobalData("GIT_BRANCH", process.env.BRANCH);
+    eleventyConfig.addGlobalData("NOINDEX", process.env.BRANCH !== "latest");
+    eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
+
+    //------------------------------------------------------------------------------
+    // Filters
+    //------------------------------------------------------------------------------
+
+    eleventyConfig.addFilter("limitTo", (arr, limit) => arr.slice(0, limit));
+
+    eleventyConfig.addFilter("jsonify", variable => JSON.stringify(variable));
+
+    /**
+     * Takes in a string and converts to a slug
+     * @param {string} text text to be converted into slug
+     * @returns {string} slug to be used as anchors
+     */
+    function slugify(text) {
+        return slug(text.replace(/[<>()[\]{}]/gu, ""))
+        // eslint-disable-next-line no-control-regex -- used regex from https://github.com/eslint/archive-website/blob/master/_11ty/plugins/markdown-plugins.js#L37
+            .replace(/[^\u{00}-\u{FF}]/gu, "");
+    }
+
+    eleventyConfig.addFilter("slugify", str => {
+        if (!str) {
+            return "";
+        }
+
+        return slugify(str);
+    });
+
+    eleventyConfig.addFilter("URIencode", str => {
+        if (!str) {
+            return "";
+        }
+        return encodeURI(str);
+    });
+
+    /* order collection by the order specified in the front matter */
+    eleventyConfig.addFilter("sortByPageOrder", values => values.slice().sort((a, b) => a.data.order - b.data.order));
+
+    eleventyConfig.addFilter("readableDate", dateObj => {
+
+        // turn it into a JS Date string
+        const date = new Date(dateObj);
+
+        // pass it to luxon for formatting
+        return DateTime.fromJSDate(date).toFormat("dd MMM, yyyy");
+    });
+
+    eleventyConfig.addFilter("blogPermalinkDate", dateObj => {
+
+        // turn it into a JS Date string
+        const date = new Date(dateObj);
+
+        // pass it to luxon for formatting
+        return DateTime.fromJSDate(date).toFormat("yyyy/MM");
+    });
+
+    eleventyConfig.addFilter("readableDateFromISO", ISODate => DateTime.fromISO(ISODate).toUTC().toLocaleString(DateTime.DATE_FULL));
+
+    eleventyConfig.addFilter("dollars", value => new Intl.NumberFormat("en-US", {
+        style: "currency",
+        currency: "USD"
+    }).format(value));
+
+    /*
+     * parse markdown from includes, used for author bios
+     * Source: https://github.com/11ty/eleventy/issues/658
+     */
+    eleventyConfig.addFilter("markdown", value => {
+        const markdown = require("markdown-it")({
+            html: true
+        });
+
+        return markdown.render(value);
+    });
+
+    /*
+     * Removes `.html` suffix from the given url.
+     * `page.url` will include the `.html` suffix for all documents
+     * except for those written as `index.html` (their `page.url` ends with a `/`).
+     */
+    eleventyConfig.addFilter("prettyURL", url => {
+        if (url.endsWith(".html")) {
+            return url.slice(0, -".html".length);
+        }
+
+        return url;
+    });
+
+    //------------------------------------------------------------------------------
+    // Plugins
+    //------------------------------------------------------------------------------
+
+    eleventyConfig.addPlugin(eleventyNavigationPlugin);
+    eleventyConfig.addPlugin(syntaxHighlight, {
+        alwaysWrapLineHighlights: true
+    });
+    eleventyConfig.addPlugin(pluginRss);
+    eleventyConfig.addPlugin(pluginTOC, {
+        tags: ["h2", "h3", "h4"],
+        wrapper: "nav", // Element to put around the root `ol`
+        wrapperClass: "c-toc", // Class for the element around the root `ol`
+        headingText: "", // Optional text to show in heading above the wrapper element
+        headingTag: "h2" // Heading tag when showing heading above the wrapper element
+    });
+
+    /** @typedef {import("markdown-it/lib/token")} MarkdownItToken A MarkdownIt token. */
+
+    /**
+     * Generates HTML markup for an inline alert.
+     * @param {"warning"|"tip"|"important"} type The type of alert to create.
+     * @param {Array<MarkdownItToken>} tokens Array of MarkdownIt tokens to use.
+     * @param {number} index The index of the current token in the tokens array.
+     * @returns {string} The markup for the alert.
+     */
+    function generateAlertMarkup(type, tokens, index) {
+        if (tokens[index].nesting === 1) {
+            return `
+                <aside role="note" class="alert alert--${type}">
+                    <svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
+                        <path d="M9.49999 6.66667V10M9.49999 13.3333H9.50832M17.8333 10C17.8333 14.6024 14.1024 18.3333 9.49999 18.3333C4.89762 18.3333 1.16666 14.6024 1.16666 10C1.16666 5.39763 4.89762 1.66667 9.49999 1.66667C14.1024 1.66667 17.8333 5.39763 17.8333 10Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+                    </svg>
+                    <div class="alert__content">
+                        <span class="alert__type">${type[0].toUpperCase()}${type.slice(1)}</span>
+                        <div class="alert__text">
+            `.trim();
+        }
+
+        return `
+                        </div>
+                    </div>
+                </aside>
+        `.trim();
+    }
+
+    const markdownIt = require("markdown-it");
+
+    eleventyConfig.setLibrary("md",
+        markdownIt({ html: true, linkify: true, typographer: true })
+            .use(markdownItAnchor, {
+                slugify
+            })
+            .use(markdownItContainer, "correct", {})
+            .use(markdownItContainer, "incorrect", {})
+            .use(markdownItContainer, "warning", {
+                render(tokens, idx) {
+                    return generateAlertMarkup("warning", tokens, idx);
+                }
+            })
+            .use(markdownItContainer, "tip", {
+                render(tokens, idx) {
+                    return generateAlertMarkup("tip", tokens, idx);
+                }
+            })
+            .use(markdownItContainer, "important", {
+                render(tokens, idx) {
+                    return generateAlertMarkup("important", tokens, idx);
+                }
+            })
+            .disable("code"));
+
+    //------------------------------------------------------------------------------
+    // Shortcodes
+    //------------------------------------------------------------------------------
+
+    eleventyConfig.addNunjucksShortcode("link", function(url) {
+
+        // eslint-disable-next-line no-invalid-this -- Eleventy API
+        const urlData = this.ctx.further_reading_links[url];
+
+        if (!urlData) {
+            throw new Error(`Data missing for ${url}`);
+        }
+
+        const {
+            domain,
+            title,
+            logo
+        } = urlData;
+
+        return `
+        <article class="resource">
+            <div class="resource__image">
+                <img class="resource__img" width="75" height="75" src="${logo}" alt="Avatar image for ${domain}" onerror="this.onerror = null; this.src = '/icon.svg'" />
+            </div>
+            <div class="resource__content">
+                <a href="${url}" class="resource__title"> ${title} </a><br>
+                <span class="resource__domain"> ${domain}</span>
+            </div>
+            <svg class="c-icon resource__icon" width="13" height="12" viewBox="0 0 13 12" fill="none">
+            <path d="M1.5 11L11.5 1M11.5 1H1.5M11.5 1V11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+            </svg>
+        </article>`;
+    });
+
+    eleventyConfig.addShortcode("fixable", () => `
+        <div class="rule-category">
+            <span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
+            <p class="rule-category__description">
+                if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
+            </p>
+        </div>`);
+
+    eleventyConfig.addShortcode("recommended", () => `
+        <div class="rule-category">
+            <span class="rule-category__icon">✅ <span class="visually-hidden">Recommended</span></span>
+            <p class="rule-category__description">
+                if the <code>"extends": "eslint:recommended"</code> property in a configuration file enables the rule.
+            </p>
+        </div>`);
+
+    eleventyConfig.addShortcode("hasSuggestions", () => `
+        <div class="rule-category">
+            <span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
+            <p class="rule-category__description">
+                if some problems reported by the rule are manually fixable by editor suggestions
+            </p>
+        </div>`);
+
+    eleventyConfig.addShortcode("related_rules", arr => {
+        const rules = arr;
+        let items = "";
+
+        rules.forEach(rule => {
+            const listItem = `<li class="related-rules__list__item">
+                <a href="${pathPrefix}rules/${rule}">
+                    <span>${rule}</span>
+                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false">
+                        <path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
+                    </svg>
+                </a>
+            </li>`;
+
+            items += listItem;
+        });
+
+        return `
+        <ul class="related-rules__list" role="list">
+           ${items}
+        </ul>`;
+    });
+
+    eleventyConfig.addShortcode("important", (text, url) => `
+        <div role="note" class="alert alert--important">
+            <svg class="alert__icon" aria-hidden="true" focusable="false" width="21" height="18" viewBox="0 0 21 18" fill="none">
+                <path d="M10.4998 6.66666V9.99999M10.4998 13.3333H10.5081M9.0748 2.38333L2.01647 14.1667C1.87094 14.4187 1.79394 14.7044 1.79313 14.9954C1.79231 15.2864 1.86771 15.5726 2.01183 15.8254C2.15594 16.0783 2.36374 16.2889 2.61456 16.4365C2.86538 16.5841 3.15047 16.6635 3.44147 16.6667H17.5581C17.8491 16.6635 18.1342 16.5841 18.385 16.4365C18.6359 16.2889 18.8437 16.0783 18.9878 15.8254C19.1319 15.5726 19.2073 15.2864 19.2065 14.9954C19.2057 14.7044 19.1287 14.4187 18.9831 14.1667L11.9248 2.38333C11.7762 2.13841 11.5671 1.93593 11.3175 1.7954C11.0679 1.65487 10.7862 1.58104 10.4998 1.58104C10.2134 1.58104 9.93175 1.65487 9.68214 1.7954C9.43254 1.93593 9.22336 2.13841 9.0748 2.38333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+            </svg>
+            <div class="alert__content">
+                <span class="alert__type">Important</span>
+                <div class="alert__text">${text}</div>
+                <a href="${url}" class="alert__learn-more">Learn more</a>
+            </div>
+        </div>`);
+
+    eleventyConfig.addShortcode("warning", (text, url) => `
+        <div role="note" class="alert alert--warning">
+            <svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
+                <path d="M9.49999 6.66667V10M9.49999 13.3333H9.50832M17.8333 10C17.8333 14.6024 14.1024 18.3333 9.49999 18.3333C4.89762 18.3333 1.16666 14.6024 1.16666 10C1.16666 5.39763 4.89762 1.66667 9.49999 1.66667C14.1024 1.66667 17.8333 5.39763 17.8333 10Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+            </svg>
+            <div class="alert__content">
+                <span class="alert__type">Warning</span>
+                <div class="alert__text">${text}</div>
+                <a href="${url}" class="alert__learn-more">Learn more</a>
+            </div>
+        </div>`);
+
+    eleventyConfig.addShortcode("tip", (text, url) => `
+        <div role="note" class="alert alert--tip">
+            <svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
+                <path d="M17.8333 9.23333V10C17.8323 11.797 17.2504 13.5456 16.1744 14.9849C15.0985 16.4241 13.5861 17.4771 11.8628 17.9866C10.1395 18.4961 8.29771 18.4349 6.61205 17.8122C4.92639 17.1894 3.4872 16.0384 2.50912 14.5309C1.53105 13.0234 1.06648 11.2401 1.18472 9.44693C1.30296 7.6538 1.99766 5.94694 3.16522 4.58089C4.33278 3.21485 5.91064 2.26282 7.66348 1.86679C9.41632 1.47076 11.2502 1.65195 12.8917 2.38333M17.8333 3.33333L9.49999 11.675L6.99999 9.175" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+            </svg>
+            <div class="alert__content">
+                <span class="alert__type">Tip</span>
+                <div class="alert__text">${text}</div>
+                <a href="${url}" class="alert__learn-more">Learn more</a>
+            </div>
+        </div>`);
+
+
+    eleventyConfig.addWatchTarget("./src/assets/");
+
+    //------------------------------------------------------------------------------
+    // File PassThroughs
+    //------------------------------------------------------------------------------
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/static": "/"
+    });
+
+    eleventyConfig.addPassthroughCopy("./src/assets/");
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.png": "/assets/images"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.jpg": "/assets/images"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.jpeg": "/assets/images"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.svg": "/assets/images"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.mp4": "/assets/videos"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./src/content/**/*.pdf": "/assets/documents"
+    });
+
+    eleventyConfig.addPassthroughCopy({
+        "./node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js": "/assets/js/algoliasearch.js"
+    });
+
+    //------------------------------------------------------------------------------
+    // Collections
+    //------------------------------------------------------------------------------
+
+    eleventyConfig.addCollection("docs", collection => collection.getFilteredByGlob("./src/**/**/*.md"));
+
+    eleventyConfig.addCollection("library", collection => collection.getFilteredByGlob("./src/library/**/*.md"));
+
+
+    // START, eleventy-img (https://www.11ty.dev/docs/plugins/image/)
+    /* eslint-disable-next-line jsdoc/require-jsdoc
+       --
+       This shortcode is currently unused. If we are going to use it, add JSDoc
+       and describe what exactly is this doing.
+    */
+    function imageShortcode(source, alt, cls, sizes = "(max-width: 768px) 100vw, 50vw") {
+        const options = {
+            widths: [600, 900, 1500],
+            formats: ["webp", "jpeg"],
+            urlPath: "/assets/images/",
+            outputDir: "./_site/assets/images/",
+            filenameFormat(id, src, width, format) {
+                const extension = path.extname(src);
+                const name = path.basename(src, extension);
+
+                return `${name}-${width}w.${format}`;
+            }
+        };
+
+        /**
+         * Resolves source
+         * @returns {string} URL or a local file path
+         */
+        function getSRC() {
+            if (source.startsWith("http://") || source.startsWith("https://")) {
+                return source;
+            }
+
+            /*
+             * for convenience, you only need to use the image's name in the shortcode,
+             * and this will handle appending the full path to it
+             */
+            return path.join("./src/assets/images/", source);
+        }
+
+        const fullSrc = getSRC();
+
+
+        // generate images
+        Image(fullSrc, options); // eslint-disable-line new-cap -- `Image` is a function
+
+        const imageAttributes = {
+            alt,
+            class: cls,
+            sizes,
+            loading: "lazy",
+            decoding: "async"
+        };
+
+        // get metadata
+        const metadata = Image.statsSync(fullSrc, options);
+
+        return Image.generateHTML(metadata, imageAttributes);
+    }
+    eleventyConfig.addShortcode("image", imageShortcode);
+
+    // END, eleventy-img
+
+    //------------------------------------------------------------------------------
+    // Settings
+    //------------------------------------------------------------------------------
+
+    /*
+     * When we run `eleventy --serve`, Eleventy 1.x uses browser-sync to serve the content.
+     * By default, browser-sync (more precisely, underlying serve-static) will not serve
+     * `foo/bar.html` when we request `foo/bar`. Thus, we need to rewrite URLs to append `.html`
+     * so that pretty links without `.html` can work in a local development environment.
+     *
+     * There's no need to rewrite URLs that end with `/`, because that already works well
+     * (server will return the content of `index.html` in the directory).
+     * URLs with a file extension, like main.css, main.js, sitemap.xml, etc. should not be rewritten
+     */
+    eleventyConfig.setBrowserSyncConfig({
+        middleware: (req, res, next) => {
+            if (!/(?:\.[a-zA-Z][^/]*|\/)$/u.test(req.url)) {
+                req.url += ".html";
+            }
+            return next();
+        }
+    });
+
+    /*
+     * Generate the sitemap only in certain contexts to prevent unwanted discovery of sitemaps that
+     * contain URLs we'd prefer not to appear in search results (URLs in sitemaps are considered important).
+     * In particular, we don't want to deploy https://eslint.org/docs/head/sitemap.xml
+     * We want to generate the sitemap for:
+     *   - Local previews
+     *   - Netlify deploy previews
+     *   - Netlify production deploy of the `latest` branch (https://eslint.org/docs/latest/sitemap.xml)
+     *
+     * Netlify always sets `CONTEXT` environment variable. If it isn't set, we assume this is a local build.
+     */
+    if (
+        process.env.CONTEXT && // if this is a build on Netlify ...
+        process.env.CONTEXT !== "deploy-preview" && // ... and not for a deploy preview ...
+        process.env.BRANCH !== "latest" // .. and not of the `latest` branch ...
+    ) {
+        eleventyConfig.ignores.add("src/static/sitemap.njk"); // ... then don't generate the sitemap.
+    }
+
+
+    return {
+        passthroughFileCopy: true,
+
+        pathPrefix,
+
+        markdownTemplateEngine: "njk",
+        dataTemplateEngine: "njk",
+        htmlTemplateEngine: "njk",
+
+        dir: {
+            input: "src",
+            includes: "_includes",
+            layouts: "_includes/layouts",
+            data: "_data",
+            output: "_site"
+        }
+    };
+};
index 8f5223a74d822b2d7b596ee383fac8557d1288c4..ee5f64e100ec84225ee5c8ac61c65bbe1b4a2125 100644 (file)
@@ -1,17 +1,27 @@
-# Documentation
+# ESLint Documentation
 
-Welcome to our documentation pages! What would you like to view?
+## Run Locally
 
-## [User Guide](user-guide)
+```shell
+npm start
+```
 
-Intended for end users of ESLint. Contains information about core rules, configuration, command line options, formatters, and integrations,
-as well as guides for migrating from earlier versions of ESLint.
+## Scripts
 
-## [Developer Guide](developer-guide)
+To update the links data file, run this from the root folder (not the `docs` folder):
 
-Intended for contributors to ESLint and people who wish to extend ESLint. Contains information about contributing to ESLint; creating custom
-rules, configurations, plugins, and formatters; and information about our architecture and Node.js API.
+```shell
+npm run docs:update-links
+```
 
-## [Maintainer Guide](maintainer-guide)
+To lint JS files, run this from the root folder (not the `docs` folder):
 
-Intended for maintainers of ESLint.
+```shell
+npm run lint:docsjs
+```
+
+To autofix JS files, run this from the root folder (not the `docs` folder):
+
+```shell
+npm run fix:docsjs
+```
diff --git a/eslint/docs/about/index.md b/eslint/docs/about/index.md
deleted file mode 100644 (file)
index a9c5acb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# About
-
-ESLint is an open source JavaScript linting utility originally created by Nicholas C. Zakas in June 2013. Code [linting][] is a type of static analysis that is frequently used to find problematic patterns or code that doesn't adhere to certain style guidelines. There are code linters for most programming languages, and compilers sometimes incorporate linting into the compilation process.
-
-JavaScript, being a dynamic and loosely-typed language, is especially prone to developer error. Without the benefit of a compilation process, JavaScript code is typically executed in order to find syntax or other errors. Linting tools like ESLint allow developers to discover problems with their JavaScript code without executing it.
-
-The primary reason ESLint was created was to allow developers to create their own linting rules. ESLint is designed to have all rules completely pluggable. The default rules are written just like any plugin rules would be. They can all follow the same pattern, both for the rules themselves as well as tests. While ESLint will ship with some built-in rules to make it useful from the start, you'll be able to dynamically load rules at any point in time.
-
-ESLint is written using Node.js to provide a fast runtime environment and easy installation via [npm][].
-
-[linting]: https://en.wikipedia.org/wiki/Lint_(software)
-[npm]: https://npmjs.org/
-
-## Philosophy
-
-Everything is pluggable:
-
-* Rule API is used both by bundled and custom rules
-* Formatter API is used both by bundled and custom formatters
-* Additional rules and formatters can be specified at runtime
-* Rules and formatters don't have to be bundled to be used
-
-Every rule:
-
-* Is standalone
-* Can be turned off or on (nothing can be deemed "too important to turn off")
-* Can be set to a warning or error individually
-
-Additionally:
-
-* Rules are "agenda free" - ESLint does not promote any particular coding style
-* Any bundled rules are generalizable
-
-The project:
-
-* Values documentation and clear communication
-* Is as transparent as possible
-* Believes in the importance of testing
diff --git a/eslint/docs/developer-guide/README.md b/eslint/docs/developer-guide/README.md
deleted file mode 100644 (file)
index a5e6592..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# Developer Guide
-
-This guide is intended for those who wish to:
-
-* Contribute code to ESLint
-* Create their own rules for ESLint
-
-In order to work with ESLint as a developer, it's recommended that:
-
-* You know JavaScript, since ESLint is written in JavaScript.
-* You have some familiarity with Node.js, since ESLint runs on it.
-* You're comfortable with command-line programs.
-* You understand unit tests and why they're important.
-
-If that sounds like you, then continue reading to get started.
-
-## Section 1: Get the [Source Code](source-code.md)
-
-Before you can get started, you'll need to get a copy of the ESLint source code. This section explains how to do that and a little about the source code structure.
-
-## Section 2: Set up a [Development Environment](development-environment.md)
-
-Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code.
-
-## Section 3: Run the [Unit Tests](unit-tests.md)
-
-There are a lot of unit tests included with ESLint to make sure that we're keeping on top of code quality. This section explains how to run the unit tests.
-
-## Section 4: [Working with Rules](working-with-rules.md)
-
-You're finally ready to start working with rules. You may want to fix an existing rule or create a new one. This section explains how to do all of that.
-
-## Section 5: [Working with Plugins](working-with-plugins.md)
-
-You've developed library-specific rules for ESLint and you want to share them with the community. You can publish an ESLint plugin on npm.
-
-## Section 6: [Working with Custom Parsers](working-with-custom-parsers.md)
-
-If you aren't going to use the default parser of ESLint, this section explains about using custom parsers.
-
-## Section 7: [Node.js API](nodejs-api.md)
-
-If you're interested in writing a tool that uses ESLint, then you can use the Node.js API to get programmatic access to functionality.
-
-## Section 8: [Contributing](contributing/)
-
-Once you've made changes that you want to share with the community, the next step is to submit those changes back via a pull request.
diff --git a/eslint/docs/developer-guide/architecture.md b/eslint/docs/developer-guide/architecture.md
deleted file mode 100644 (file)
index 6531c28..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-# Architecture
-
-<center><img alt="dependency graph" src="./architecture/dependency.svg"></center>
-
-At a high level, there are a few key parts to ESLint:
-
-* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing.
-* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `ESLint`, `RuleTester`, and `SourceCode`.
-* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output.
-* `lib/init/` - this module contains `--init` functionality that set up a configuration file for end users.
-* `lib/cli-engine/` - this module is `CLIEngine` class that finds source code files and configuration files then does code verifying with the `Linter` class. This includes the loading logic of configuration files, parsers, plugins, and formatters.
-* `lib/linter/` - this module is the core `Linter` class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
-* `lib/rule-tester/` - this module is `RuleTester` class that is a wrapper around Mocha so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks.
-* `lib/source-code/` - this module is `SourceCode` class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code.
-* `lib/rules/` - this contains built-in rules that verify source code.
-
-## The `cli` object
-
-The `cli` object is the API for the command line interface. Literally, the `bin/eslint.js` file simply passes arguments to the `cli` object and then sets `process.exitCode` to the returned exit code.
-
-The main method is `cli.execute()`, which accepts an array of strings that represent the command line options (as if `process.argv` were passed without the first two arguments). If you want to run ESLint from inside of another program and have it act like the CLI, then `cli` is the object to use.
-
-This object's responsibilities include:
-
-* Interpreting command line arguments
-* Reading from the file system
-* Outputting to the console
-* Outputting to the filesystem
-* Use a formatter
-* Returning the correct exit code
-
-This object may not:
-
-* Call `process.exit()` directly
-* Perform any asynchronous operations
-
-## The `CLIEngine` object
-
-The `CLIEngine` type represents the core functionality of the CLI except that it reads nothing from the command line and doesn't output anything by default. Instead, it accepts many (but not all) of the arguments that are passed into the CLI. It reads both configuration and source files as well as managing the environment that is passed into the `Linter` object.
-
-The main method of the `CLIEngine` is `executeOnFiles()`, which accepts an array of file and directory names to run the linter on.
-
-This object's responsibilities include:
-
-* Managing the execution environment for `Linter`
-* Reading from the file system
-* Reading configuration information from config files (including `.eslintrc` and `package.json`)
-
-This object may not:
-
-* Call `process.exit()` directly
-* Perform any asynchronous operations
-* Output to the console
-* Use formatters
-
-## The `Linter` object
-
-The main method of the `Linter` object is `verify()` and accepts two arguments: the source text to verify and a configuration object (the baked configuration of the given configuration file plus command line options). The method first parses the given text with `espree` (or whatever the configured parser is) and retrieves the AST. The AST is produced with both line/column and range locations which are useful for reporting location of issues and retrieving the source text related to an AST node, respectively.
-
-Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `Linter` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":exit", such as "Identifier:exit" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available.
-
-This object's responsibilities include:
-
-* Inspecting JavaScript code strings
-* Creating an AST for the code
-* Executing rules on the AST
-* Reporting back the results of the execution
-
-This object may not:
-
-* Call `process.exit()` directly
-* Perform any asynchronous operations
-* Use Node.js-specific features
-* Access the file system
-* Call `console.log()` or any other similar method
-
-## Rules
-
-Individual rules are the most specialized part of the ESLint architecture. Rules can do very little, they are simply a set of instructions executed against an AST that is provided. They do get some context information passed in, but the primary responsibility of a rule is to inspect the AST and report warnings.
-
-These objects' responsibilities are:
-
-* Inspect the AST for specific patterns
-* Reporting warnings when certain patterns are found
-
-These objects may not:
-
-* Call `process.exit()` directly
-* Perform any asynchronous operations
-* Use Node.js-specific features
-* Access the file system
-* Call `console.log()` or any other similar method
diff --git a/eslint/docs/developer-guide/architecture/dependency.svg b/eslint/docs/developer-guide/architecture/dependency.svg
deleted file mode 100644 (file)
index 3b0c74c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="522px" preserveAspectRatio="none" style="width:439px;height:522px;" version="1.1" viewBox="0 0 439 522" width="439px" zoomAndPan="magnify"><defs><filter height="300%" id="f255kzea4atd2" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--cluster  bin --><polygon fill="#FFFFFF" filter="url(#f255kzea4atd2)" points="271,24,271,24.0701,279,23.8619,287,24.0644,295,24.1332,303,23.7622,311,24,310.9753,23.9922,312.2644,28.4168,313.678,32.8805,315.1783,37.3713,316.3801,41.7685,318,46.2969,318,46.8505,327.5,45.6666,337,46.0991,346.5,46.7288,356,46.2111,365.5,46.3651,375,46.2969,374.9681,46.2969,375.1785,57.0807,375.2391,67.8646,375.5857,78.6484,375.6711,89.4323,375.6793,100.2161,375,111,375,111.2546,364.6,111.4636,354.2,111.7022,343.8,110.2788,333.4,111.6785,323,110.7035,312.6,111.5338,302.2,110.505,291.8,110.9315,281.4,111.7416,271,111,270.9513,111,271.1053,101.3333,271.3386,91.6667,271.4162,82,270.9961,72.3333,271.2872,62.6667,270.4276,53,271.2844,43.3333,271.5482,33.6667,271,24" style="stroke: #000000; stroke-width: 1.5;"/><path d="M271,46.2969 L271,46.5771 L280.4,45.7444 L289.8,46.5546 L299.2,46.8298 L308.6,45.3457 L318,46.2969 " fill="#FFFFFF" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="24" x="280" y="38.9951">bin</text><!--cluster  lib --><polygon fill="#FFFFFF" filter="url(#f255kzea4atd2)" points="22,135,22,135.0701,28.8,134.8619,35.6,135.0644,42.4,135.1332,49.2,134.7622,56,135,55.9753,134.9922,57.2644,139.4168,58.678,143.8805,60.1783,148.3713,61.3801,152.7685,63,157.2969,63,157.8505,73.1143,156.6666,83.2286,157.0991,93.3429,157.7288,103.4571,157.2111,113.5714,157.3651,123.6857,157.2649,133.8,157.4754,143.9143,157.536,154.0286,157.8826,164.1429,157.9679,174.2571,157.9761,184.3714,157.5515,194.4857,157.7605,204.6,157.9991,214.7143,156.5757,224.8286,157.9754,234.9429,157.0004,245.0571,157.8307,255.1714,156.8019,265.2857,157.2284,275.4,158.0385,285.5143,157.2481,295.6286,157.4022,305.7429,157.6355,315.8571,157.7131,325.9714,157.293,336.0857,157.5841,346.2,156.7245,356.3143,157.5813,366.4286,157.8451,376.5429,157.7414,386.6571,157.9099,396.7714,156.8138,406.8857,156.6447,417,157.2969,416.3786,157.2969,416.9411,167.3741,416.8035,177.4513,417.6814,187.5286,416.8253,197.6058,416.6569,207.683,417.2283,217.7603,416.3332,227.8375,416.4809,237.9147,417.649,247.992,417.4357,258.0692,417.7345,268.1464,416.6782,278.2237,417.3192,288.3009,417.5904,298.3781,416.5276,308.4554,416.9041,318.5326,417.126,328.6098,417.6518,338.6871,416.9958,348.7643,417.4626,358.8415,416.4462,368.9188,416.3227,378.996,417.5036,389.0732,416.2831,399.1504,417.509,409.2277,417.2066,419.3049,416.7321,429.3821,416.6462,439.4594,417.4588,449.5366,416.7007,459.6138,417.5919,469.6911,416.4473,479.7683,417.6174,489.8455,417.4843,499.9228,417,510,417,510.245,407.125,510.0472,397.25,510.7266,387.375,510.6136,377.5,510.1693,367.625,510.2682,357.75,509.8697,347.875,510.7165,338,510.1549,328.125,510.1726,318.25,509.3916,308.375,509.5948,298.5,510.5307,288.625,510.4298,278.75,509.9571,268.875,509.6778,259,509.7811,249.125,509.3138,239.25,510.4147,229.375,510.7396,219.5,510.5264,209.625,510.6949,199.75,509.8633,189.875,510.0872,180,509.6124,170.125,510.284,160.25,510.2468,150.375,510.5524,140.5,509.7703,130.625,509.8656,120.75,510.4435,110.875,510.5673,101,509.4875,91.125,509.8061,81.25,510.1493,71.375,509.3892,61.5,510.3534,51.625,510.258,41.75,509.8992,31.875,510.1422,22,510,22.7287,510,21.6871,500.1316,22.315,490.2632,22.2856,480.3947,22.1158,470.5263,22.1409,460.6579,22.1135,450.7895,21.3758,440.9211,21.5992,431.0526,21.5385,421.1842,22.0638,411.3158,22.0881,401.4474,22.1617,391.5789,21.709,381.7105,21.9325,371.8421,21.8798,361.9737,22.5769,352.1053,22.4266,342.2368,21.5145,332.3684,21.9271,322.5,21.4228,312.6316,22.2884,302.7632,22.6085,292.8947,22.5446,283.0263,21.5644,273.1579,22.464,263.2895,21.2572,253.4211,22.2002,243.5526,21.7007,233.6842,22.0967,223.8158,22.2403,213.9474,22.4721,204.0789,21.2801,194.2105,22.4755,184.3421,22.1782,174.4737,22.3553,164.6053,22.7478,154.7368,22.0055,144.8684,22,135" style="stroke: #000000; stroke-width: 1.5;"/><path d="M22,157.2969 L22,157.3903 L30.2,157.1127 L38.4,157.3828 L46.6,157.4745 L54.8,156.9798 L63,157.2969 " fill="#FFFFFF" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="18" x="31" y="149.9951">lib</text><!--entity ESLint--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="287,59,287,59.2102,297.2857,58.5857,307.5714,59.1933,317.8571,59.3997,328.1429,58.2866,338.4286,58.9223,348.7143,58.5735,359,59,358.8722,59,358.9773,66.2594,358.7695,73.5188,359.1845,80.7781,358.7899,88.0375,359,95.2969,359,95.0991,348.7143,95.7288,338.4286,95.2111,328.1429,95.3651,317.8571,95.2649,307.5714,95.4754,297.2857,95.536,287,95.2969,287.1952,95.2969,287.2237,88.0375,287.2264,80.7781,287.0849,73.5188,287.1545,66.2594,287,59" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="52" x="297" y="81.9951">eslint.js</text><!--entity CLI--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="258.5,170,258.5,170.2102,268.3,169.5857,278.1,170.1933,287.9,170.3997,297.7,169.2866,307.5,170,307.4741,170,307.3578,177.2594,307.3722,184.5188,307.4773,191.7781,307.2695,199.0375,307.5,206.2969,307.5,206.8505,297.7,205.6666,287.9,206.0991,278.1,206.7288,268.3,206.2111,258.5,206.2969,258.5227,206.2969,258.4894,199.0375,258.5595,191.7781,258.5797,184.5188,258.6952,177.2594,258.5,170" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="29" x="268.5" y="192.9951">cli.js</text><!--entity API--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="130.5,170,130.5,170.2102,139.6667,169.5857,148.8333,170.1933,158,170.3997,167.1667,169.2866,176.3333,169.9223,185.5,170,185.3578,170,185.3722,177.2594,185.4773,184.5188,185.2695,191.7781,185.6845,199.0375,185.5,206.2969,185.5,205.6666,176.3333,206.0991,167.1667,206.7288,158,206.2111,148.8333,206.3651,139.6667,206.2649,130.5,206.2969,130.5595,206.2969,130.5797,199.0375,130.6952,191.7781,130.7237,184.5188,130.7264,177.2594,130.5,170" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="35" x="140.5" y="192.9951">api.js</text><!--entity Init--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="343,170,343,170.0701,351,169.8619,359,170.0644,367,170.1332,375,169.7622,383,170,382.9741,170,382.8578,177.2594,382.8722,184.5188,382.9773,191.7781,382.7695,199.0375,383,206.2969,383,206.4814,375,206.0868,367,206.231,359,206.4409,351,206.2683,343,206.2969,343.0227,206.2969,342.9894,199.0375,343.0595,191.7781,343.0797,184.5188,343.1952,177.2594,343,170" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="20" x="353" y="192.9951">init</text><!--entity CLIEngine--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="239.5,266,239.5,266.2102,249.1667,265.5857,258.8333,266.1933,268.5,266.3997,278.1667,265.2866,287.8333,265.9223,297.5,265.5735,307.1667,265.6165,316.8333,265.9318,326.5,266,326.2695,266,326.6845,273.2594,326.2899,280.5188,326.4341,287.7781,326.644,295.0375,326.5,302.2969,326.5,302.2111,316.8333,302.3651,307.1667,302.2649,297.5,302.4754,287.8333,302.536,278.1667,302.8826,268.5,302.9679,258.8333,302.9761,249.1667,302.5515,239.5,302.2969,239.6545,302.2969,239.7341,295.0375,239.2596,287.7781,239.7262,280.5188,239.4012,273.2594,239.5,266" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="67" x="249.5" y="288.9951">cli-engine</text><!--entity Linter--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="178,362,178,362.2102,188.8,361.5857,199.6,362.1933,210.4,362.3997,221.2,361.2866,232,362,231.9741,362,231.8578,369.2594,231.8722,376.5188,231.9773,383.7781,231.7695,391.0375,232,398.2969,232,398.8505,221.2,397.6666,210.4,398.0991,199.6,398.7288,188.8,398.2111,178,398.2969,178.0227,398.2969,177.9894,391.0375,178.0595,383.7781,178.0797,376.5188,178.1952,369.2594,178,362" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="34" x="188" y="384.9951">linter</text><!--entity SourceCode--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="94,458,94,458.2102,103.8182,457.5857,113.6364,458.1933,123.4545,458.3997,133.2727,457.2866,143.0909,457.9223,152.9091,457.5735,162.7273,457.6165,172.5455,457.9318,182.3636,457.3086,192.1818,458.5536,202,458,201.7899,458,201.9341,465.2594,202.144,472.5188,201.9714,479.7781,202.0227,487.0375,202,494.2969,202,494.2649,192.1818,494.4754,182.3636,494.536,172.5455,494.8826,162.7273,494.9679,152.9091,494.9761,143.0909,494.5515,133.2727,494.7605,123.4545,494.9991,113.6364,493.5757,103.8182,494.9754,94,494.2969,93.9012,494.2969,94.1779,487.0375,93.835,479.7781,93.9772,472.5188,94.2472,465.2594,94,458" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="88" x="104" y="480.9951">source-code</text><!--entity RuleTester--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="75,266,75,266.2102,85.2222,265.5857,95.4444,266.1933,105.6667,266.3997,115.8889,265.2866,126.1111,265.9223,136.3333,265.5735,146.5556,265.6165,156.7778,265.9318,167,266,166.7695,266,167.1845,273.2594,166.7899,280.5188,166.9341,287.7781,167.144,295.0375,167,302.2969,167,302.2111,156.7778,302.3651,146.5556,302.2649,136.3333,302.4754,126.1111,302.536,115.8889,302.8826,105.6667,302.9679,95.4444,302.9761,85.2222,302.5515,75,302.2969,75.1545,302.2969,75.2341,295.0375,74.7596,287.7781,75.2262,280.5188,74.9012,273.2594,75,266" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="72" x="85" y="288.9951">rule-tester</text><!--entity Rules--><polygon fill="#F8F8F8" filter="url(#f255kzea4atd2)" points="292,458,292,458.2102,302.8,457.5857,313.6,458.1933,324.4,458.3997,335.2,457.2866,346,458,345.9741,458,345.8578,465.2594,345.8722,472.5188,345.9773,479.7781,345.7695,487.0375,346,494.2969,346,494.8505,335.2,493.6666,324.4,494.0991,313.6,494.7288,302.8,494.2111,292,494.2969,292.0227,494.2969,291.9894,487.0375,292.0595,479.7781,292.0797,472.5188,292.1952,465.2594,292,458" style="stroke: #000000; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="34" x="302" y="480.9951">rules</text><!--link CLI to CLIEngine--><path d="M283,206.241 L283.2802,206.241 L282.4476,217.0844 L283.2577,227.9278 L283.5329,238.7712 L282.0488,249.6146 L283,260.458 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="283,265.868,283.064,265.8965,283.6738,264.0119,284.6589,262.2942,285.5217,260.5221,285.9827,258.5714,287,256.868,286.9817,256.8497,286.0995,257.5675,285.3096,258.3776,284.5839,259.2519,283.637,259.905,283,260.868,283.1305,260.9985,282.0514,259.9194,281.3534,259.2214,280.7018,258.5698,279.7798,257.6478,279,256.868,279.0208,256.8772,279.7903,258.6637,280.6544,260.4922,281.4728,262.3004,282.3784,264.1473,283,265.868" style="stroke: #383838; stroke-width: 1.0;"/><!--link API to Linter--><path d="M164.598,206.218 L164.6858,206.2498 L165.3624,208.7409 L166.5537,211.4186 L167.5775,214.0355 L168.0499,216.4526 L169.2854,219.1463 L169.2528,219.1351 L170.1313,222.0705 L171.1745,225.0624 L172.3322,228.0937 L173.0954,230.9895 L174.4111,234.075 L174.6456,234.1496 L175.1581,237.1793 L176.3552,240.4267 L177.6359,243.7006 L178.4305,246.82 L179.4808,250.0207 L179.5099,250.029 L180.3709,253.2127 L181.3648,256.434 L182.2946,259.6372 L183.3466,262.875 L184,266 L184.2895,266.0718 L184.8849,268.4606 L185.2936,270.8033 L185.9756,273.2136 L186.6705,275.6272 L186.9594,277.9401 L186.6468,277.8693 L187.8079,280.4546 L187.9397,282.8068 L188.8539,285.3361 L188.9623,287.683 L189.7313,290.1795 L189.7015,290.1733 L190.5688,292.7088 L190.7398,295.0987 L191.3217,297.5745 L191.9381,300.0575 L192.3056,302.4885 L192.4872,302.5238 L192.7773,304.9179 L193.3776,307.3724 L193.476,309.7291 L194.3231,312.2317 L194.6724,314.6373 L194.9123,314.6799 L195.6811,319.2515 L196.569,323.8442 L196.9035,328.3385 L197.6437,332.905 L198.7433,337.5354 L198.4706,337.4917 L199.3416,341.4314 L199.9053,345.3218 L200.9148,349.2836 L201.1632,353.1236 L201.864,357.036 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="202.609,361.988,202.6765,362.0066,202.999,360.0523,203.7174,358.207,204.3069,356.3263,204.4723,354.3287,205.2247,352.4928,205.2039,352.4775,204.4383,353.3186,203.7779,354.2373,203.1904,355.2099,202.3513,355.9966,201.8647,357.0437,201.9743,357.1922,200.8298,356.2027,200.0052,355.6467,199.2197,355.1435,198.207,354.3327,197.3138,353.6837,197.333,353.6959,198.3639,355.3388,199.4821,357.0374,200.5582,358.7091,201.7146,360.4321,202.609,361.988" style="stroke: #383838; stroke-width: 1.0;"/><!--link API to CLIEngine--><path d="M180.637,206.023 L180.8054,206.247 L188.6809,211.8801 L197.5437,218.8263 L206.085,225.3449 L213.5689,230.4574 L222.4542,237.4335 L230.5506,243.3605 L238.9609,249.705 L247.5895,256.3397 L256.02,262.711 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="260.109,265.786,260.1702,265.8201,259.0305,263.9976,258.2496,262.3749,257.3519,260.6872,256.0699,258.7855,255.3198,257.18,255.2942,257.1763,255.3376,258.2802,255.5104,259.4025,255.7731,260.5374,255.726,261.6285,256.1128,262.781,256.1386,262.9637,254.9631,262.7315,253.8631,263.0329,252.7724,263.3993,251.628,263.387,250.5118,263.5739,250.5169,263.5961,252.4288,264.006,254.364,264.5167,256.288,264.9788,258.2334,265.5338,260.109,265.786" style="stroke: #383838; stroke-width: 1.0;"/><!--link API to RuleTester--><path d="M151.214,206.241 L151.4748,206.3436 L147.1148,215.147 L144.2835,224.5521 L140.9544,233.7612 L135.9882,242.3259 L133.1917,251.7447 L129.703,260.891 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="127.743,265.868,127.7922,265.9179,129.0498,264.3877,130.5956,263.1501,132.0475,261.8172,133.1909,260.1709,134.7614,258.9584,134.7511,258.9347,133.6673,259.2795,132.6356,259.744,131.6401,260.2918,130.5198,260.5527,129.5743,261.2154,129.7435,261.2891,128.9303,260.0942,128.6111,259.1143,128.3521,258.1606,127.7425,257.0544,127.3173,256.0283,127.34,256.0293,127.3918,257.9958,127.547,259.9668,127.6524,261.9356,127.8529,263.9085,127.743,265.868" style="stroke: #383838; stroke-width: 1.0;"/><!--link API to SourceCode--><path d="M130.322,201.197 L130.3661,201.2794 L128.3323,202.0528 L126.5568,203.309 L124.6972,204.4081 L122.561,204.99 L120.8077,206.2877 L120.7901,206.258 L118.6963,207.3171 L116.6911,208.526 L114.7475,209.839 L112.5916,210.7931 L110.7332,212.25 L110.8691,212.4552 L108.5175,213.3821 L106.5627,214.908 L104.6563,216.5069 L102.4682,217.6807 L100.4283,219.0781 L100.4466,219.1023 L98.3788,220.6043 L96.394,222.2166 L94.3692,223.7757 L92.4209,225.4363 L90.2232,226.766 L90.4195,226.9906 L88.4668,228.7017 L86.3875,230.268 L84.4936,232.0463 L82.6083,233.8346 L80.4478,235.308 L80.2166,235.086 L78.8622,237.3949 L76.7465,238.9728 L75.2096,241.1064 L73.0766,242.6678 L71.4322,244.6982 L71.4081,244.6796 L70.1076,246.9466 L68.2447,248.778 L66.7136,250.8664 L65.2104,252.9765 L63.5062,254.9308 L63.6657,255.0246 L62.2035,257.1438 L61.0138,259.4232 L59.3832,261.4434 L58.4102,263.8502 L57,266 L57.2262,266.0905 L56.1593,268.6338 L55.2046,271.2221 L53.7282,273.6016 L52.6342,276.1342 L51.8792,278.8023 L51.6099,278.741 L51.259,281.4103 L50.6046,284.0106 L50.3904,286.711 L49.4247,289.2404 L48.9057,291.8715 L48.7537,291.8598 L48.8036,294.529 L48.2038,297.1483 L48.066,299.8031 L48.3804,302.4925 L47.8896,305.1202 L48.0829,305.1311 L48.3658,307.8068 L48.0474,310.4486 L48.4821,313.1328 L48.7527,315.8078 L48.6409,318.4612 L48.4341,318.4251 L49.0647,321.1231 L49.6276,323.8092 L50.3235,326.5186 L50.5021,329.1377 L50.9697,331.8072 L51.1677,331.8626 L51.4759,334.3935 L52.1663,337.0314 L53.4149,339.8257 L53.6358,342.3321 L54.6859,345.0708 L54.8977,345.1502 L55.7546,347.7218 L56.5399,350.2665 L57.4869,352.8719 L58.8077,355.6176 L59.5996,358.1647 L59.4788,358.109 L61.0227,360.8423 L61.745,363.1966 L63.4015,365.9818 L64.532,368.5244 L65.5208,371.0017 L65.6166,371.0534 L66.887,373.5102 L68.5005,376.1521 L69.804,378.6268 L70.9779,381.0315 L72.2595,383.4944 L72.3612,383.5565 L73.6833,385.8764 L75.4777,388.4848 L76.7379,390.7669 L78.2179,393.1832 L79.6257,395.5555 L79.4017,395.404 L81.0373,397.763 L82.9426,400.3045 L84.4662,402.5878 L85.8529,404.7785 L87.4295,407.0977 L87.3142,407.0128 L88.9614,409.2272 L90.4045,411.2912 L92.4088,413.7685 L94.1353,416.0413 L95.4809,418.0337 L95.6644,418.1789 L97.3449,420.2739 L98.6769,422.0929 L100.3767,424.2032 L101.8331,426.1207 L103.59,428.2761 L103.6865,428.3575 L105.2692,430.2392 L106.9683,432.219 L108.2979,433.8873 L109.9256,435.807 L111.5666,437.7378 L111.7138,437.8689 L113.2858,439.6242 L114.4583,441.0237 L116.0949,442.8366 L117.7396,444.6567 L119.221,446.3313 L119.0227,446.1459 L120.7641,447.9662 L122.1615,449.4649 L123.4735,450.8836 L124.9808,452.485 L126.363,453.9694 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="130.215,457.9467,130.2808,457.9708,129.4077,456.0497,128.9201,454.2698,128.3071,452.4439,127.281,450.4668,126.8266,448.6991,126.8007,448.6986,126.6664,449.828,126.6627,450.9595,126.7497,452.0924,126.524,453.2203,126.7363,454.3552,126.7393,454.5397,125.6018,454.1271,124.4728,454.2532,123.345,454.445,122.211,454.2544,121.0802,454.2649,121.0887,454.286,122.9032,454.9914,124.7564,455.7928,126.5909,456.5479,128.461,457.3914,130.215,457.9467" style="stroke: #383838; stroke-width: 1.0;"/><!--link Init to Linter--><path d="M364.479,206.028 L364.5724,206.0308 L364.3539,207.9725 L364.6828,209.9306 L364.8334,211.8834 L364.3979,213.8185 L364.7738,215.7781 L364.7393,215.7777 L364.5593,218.014 L364.5534,220.2522 L364.6685,222.4917 L364.3666,224.7266 L364.6488,226.968 L364.8944,226.9829 L364.2207,229.3971 L364.264,231.8549 L364.3948,234.318 L364.0166,236.7502 L363.9061,239.1986 L363.9362,239.2023 L363.5803,241.7714 L363.3615,244.3572 L363.0766,246.9349 L362.9178,249.5279 L362.3477,252.0711 L362.6404,252.1285 L362.1296,254.7523 L361.4301,257.339 L361.0068,259.98 L360.5965,262.6235 L359.7759,265.1865 L359.4682,265.0966 L359.3087,267.8628 L358.1361,270.3332 L357.7336,273.0285 L356.538,275.4922 L355.9926,278.1457 L355.9645,278.1339 L355.2581,280.7538 L353.8955,283.099 L352.9201,285.6063 L351.9773,288.1272 L350.7999,290.5499 L350.959,290.6443 L349.4384,292.839 L348.1897,295.1951 L346.5012,297.29 L345.4687,299.7745 L344,302 L344.1881,302.1549 L342.0187,304.7175 L339.9427,307.357 L337.4328,309.6394 L335.2409,312.1835 L333.3309,314.9597 L333.1421,314.7582 L330.841,317.2567 L328.3273,319.5282 L326.1221,322.129 L323.39,324.1675 L320.9711,326.5402 L320.8792,326.4185 L318.3143,328.6727 L315.3566,330.4067 L312.6783,332.5106 L310.2731,334.9764 L307.3814,336.7977 L307.4841,336.9619 L304.6829,338.8725 L301.562,340.2728 L298.8414,342.3124 L296.0336,344.2127 L293.0226,345.7884 L292.9242,345.6029 L290.0693,347.3067 L287.1821,348.9498 L284.3582,350.7122 L281.2882,352.0106 L278.3557,353.5683 L278.441,353.7553 L275.3506,354.6694 L272.425,355.9446 L269.74,357.7471 L266.6119,358.5786 L263.8414,360.1936 L263.9249,360.4038 L261.0951,361.3843 L258.237,362.2937 L255.4428,363.3636 L252.796,364.8045 L249.9405,365.7204 L249.8966,365.5949 L247.462,366.8657 L244.7288,367.2824 L242.3352,368.6702 L239.7503,369.5113 L237.114,370.205 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="232.067,371.819,232.0746,371.8886,234.0101,371.8955,235.9903,372.3107,237.9559,372.5929,239.8737,372.4379,241.8577,372.8881,241.8458,372.865,240.7869,372.2433,239.7878,371.7377,238.8303,371.3128,237.7295,370.6098,236.8295,370.2963,236.9935,370.3808,237.1611,369.1944,237.8076,368.2548,238.5125,367.3453,238.8775,366.2606,239.4213,365.2681,239.4364,365.2851,237.9433,366.5703,236.5192,367.9329,235.0617,369.2582,233.6677,370.6546,232.067,371.819" style="stroke: #383838; stroke-width: 1.0;"/><!--link Init to CLIEngine--><path d="M348.327,206.241 L348.5404,206.4226 L341.1576,213.8127 L335.0258,222.2675 L328.4867,230.3755 L320.6078,237.3434 L314.5045,245.8224 L307.4017,253.4507 L301.086,261.749 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="297.58,265.868,297.6103,265.9312,299.2961,264.8912,301.1596,264.2216,302.9652,263.4314,304.5805,262.2446,306.4593,261.6067,306.4572,261.5809,305.3202,261.5558,304.1936,261.6608,303.0743,261.8563,301.9299,261.7399,300.8206,262.0603,301.0046,262.0751,300.5205,260.9158,300.5735,259.7996,300.692,258.6887,300.4293,257.5471,300.367,256.4217,300.3889,256.4281,299.7994,258.308,299.3093,260.2171,298.7713,262.112,298.3247,264.034,297.58,265.868" style="stroke: #383838; stroke-width: 1.0;"/><!--link Init to Rules--><path d="M363.642,206.316 L363.7354,206.3174 L363.5159,210.2338 L363.844,214.1583 L363.9937,218.0802 L363.5571,221.9934 L363.9322,225.9186 L363.8976,225.9185 L363.736,228.2327 L363.7484,230.5473 L363.8819,232.8623 L363.5983,235.1761 L363.8989,237.4916 L364.1449,237.4959 L363.5754,239.9637 L363.7241,242.4441 L363.9606,244.926 L363.6871,247.399 L363.6817,249.8766 L363.7121,249.8777 L363.5776,252.4602 L363.5812,255.0475 L363.5181,257.6324 L363.5821,260.2218 L363.232,262.7968 L363.5298,262.8133 L363.3872,265.4492 L363.0526,268.0745 L362.9991,270.7153 L362.9588,273.3569 L362.501,275.9753 L362.1815,275.9495 L362.5893,278.6315 L361.9452,281.2287 L362.1008,283.8904 L361.4328,286.4856 L361.4399,289.1353 L361.4096,289.1319 L361.4795,291.7449 L360.8424,294.2788 L360.6225,296.8593 L360.4375,299.4438 L360,302 L360.1832,302.0257 L359.707,304.0758 L359.5439,306.1698 L358.8743,308.1928 L358.9602,310.3217 L358.5438,312.3802 L358.7844,312.4184 L358.4055,314.5135 L358.146,316.6276 L357.3315,318.6537 L356.9238,320.7443 L356.8767,322.892 L356.6046,322.8444 L356.4805,325.005 L356.0498,327.1119 L356.0638,329.2966 L355.3185,331.3486 L355.0246,333.4794 L354.8748,333.451 L354.722,335.6197 L353.9289,337.6671 L353.5912,339.8007 L353.699,342.0188 L353.0134,344.0865 L353.2029,344.1261 L352.4537,348.3632 L351.1149,352.4771 L350.5145,356.7453 L349.7533,360.9799 L348.6172,365.1362 L348.4126,365.0889 L347.6313,369.2181 L346.783,373.3317 L346.0663,377.4757 L344.8378,381.5016 L343.8953,385.5935 L344.0947,385.6432 L342.6883,389.4175 L341.667,393.2878 L341.2081,397.2983 L339.7137,401.0506 L339.0547,405.0112 L339.2734,405.0691 L338.1931,408.6208 L337.0388,412.1529 L336.0516,415.7292 L335.4502,419.4079 L334.3028,422.9418 L334.1746,422.9061 L333.6649,426.2116 L332.2836,429.2743 L331.8933,432.6131 L330.9451,435.7964 L329.8465,438.9379 L329.951,438.9682 L329.0759,441.6666 L328.5752,444.4736 L327.7363,447.1825 L326.7559,449.8502 L325.893,452.5521 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="324.406,457.5402,324.4592,457.5858,325.5821,455.954,327.0169,454.5894,328.3502,453.1378,329.3493,451.4002,330.811,450.0585,330.7986,450.0357,329.7481,450.4714,328.7597,451.0221,327.8144,451.6526,326.7204,452.0079,325.8347,452.7487,325.9971,452.8364,325.1119,451.6535,324.7007,450.7268,324.3473,449.8314,323.6574,448.7541,323.1445,447.7725,323.1671,447.7754,323.3863,449.7246,323.7081,451.6872,323.9805,453.6433,324.3473,455.6117,324.406,457.5402" style="stroke: #383838; stroke-width: 1.0;"/><!--link CLIEngine to Linter--><path d="M268.694,302.241 L268.9097,302.42 L261.6889,309.8179 L255.7323,318.265 L249.3641,326.3704 L241.642,333.3525 L235.7143,341.8234 L228.7764,349.4562 L222.634,357.749 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="219.216,361.868,219.2471,361.9308,220.9199,360.87,222.7749,360.1773,224.5706,359.3648,226.1711,358.1581,228.0418,357.497,228.0394,357.4712,226.9021,357.4601,225.7769,357.5791,224.6601,357.7884,223.5144,357.6863,222.4092,358.0205,222.5929,358.0375,222.0953,356.8745,222.1342,355.7613,222.2385,354.6542,221.9619,353.5117,221.8857,352.3879,221.9076,352.394,221.3415,354.281,220.8751,356.1961,220.3606,358.0976,219.9379,360.0249,219.216,361.868" style="stroke: #383838; stroke-width: 1.0;"/><!--link RuleTester to Linter--><path d="M136.407,302.241 L136.616,302.4277 L143.0812,309.8026 L150.7715,318.2722 L158.0628,326.3852 L164.0423,333.326 L171.7605,341.8205 L178.4998,349.4404 L186.01,357.749 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="189.691,361.868,189.7577,361.8894,188.9568,359.9505,188.5469,358.1371,188.0096,356.2829,187.0537,354.2941,186.6773,352.4916,186.6515,352.4901,186.4718,353.6132,186.4226,354.7435,186.464,355.879,186.1931,356.9969,186.3596,358.1395,186.37,358.3237,185.2182,357.8662,184.0967,357.9466,182.9789,358.0926,181.8397,357.8568,180.7117,357.8218,180.721,357.8425,182.5032,358.6213,184.3279,359.4945,186.132,360.3222,187.9753,361.2367,189.691,361.868" style="stroke: #383838; stroke-width: 1.0;"/><!--link Linter to Rules--><path d="M225.645,398.023 L225.8233,398.2392 L232.9039,403.872 L241.0296,410.7723 L248.815,417.2599 L255.4812,422.3901 L263.6307,429.3192 L270.9452,435.2357 L278.592,441.5551 L286.4699,448.1548 L294.138,454.5001 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="298.124,457.7863,298.1867,457.8176,297.1204,455.9624,296.4215,454.2906,295.603,452.5591,294.391,450.6311,293.7236,448.9751,293.6978,448.9727,293.6906,450.0877,293.8133,451.2152,294.0263,452.3514,293.928,453.4577,294.2659,454.6059,294.2835,454.7896,293.1196,454.5053,292.0072,454.7572,290.9012,455.0746,289.7585,455.0113,288.635,455.1482,288.6411,455.1701,290.53,455.6655,292.4466,456.2608,294.3498,456.8078,296.2785,457.4468,298.124,457.7863" style="stroke: #383838; stroke-width: 1.0;"/><!--link Linter to SourceCode--><path d="M194.545,398.241 L194.7846,398.3863 L188.5061,407.1346 L183.6324,416.7347 L178.3012,426.0574 L171.4657,434.4679 L166.6239,444.0874 L161.146,453.3211 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="158.388,457.8683,158.428,457.9258,159.9267,456.6308,161.6598,455.6729,163.3165,454.6053,164.7223,453.1765,166.4755,452.2476,166.4694,452.2225,165.3428,452.3787,164.2473,452.6617,163.1734,453.0329,162.0251,453.1003,160.981,453.5932,161.1603,453.6371,160.5079,452.4444,160.3788,451.3798,160.3135,450.3308,159.8768,449.1909,159.6354,448.0988,159.658,448.1016,159.3754,450.0513,159.1955,452.0141,158.966,453.9706,158.8311,455.9391,158.388,457.8683" style="stroke: #383838; stroke-width: 1.0;"/><!--link ESLint to CLI--><path d="M316.75,95.031 L317.0131,95.1275 L312.5652,104.8308 L309.6597,115.1001 L306.2519,125.185 L301.1925,134.6639 L298.322,144.946 L294.2193,154.7759 L291.087,164.962 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="289.338,169.729,289.3883,169.7778,290.61,168.2187,292.1266,166.9455,293.5472,165.5793,294.652,163.9068,296.1939,162.6582,296.1831,162.6347,295.1076,163.0046,294.0869,163.493,293.1045,164.0638,291.9905,164.3506,291.0607,165.0351,291.2282,165.1127,290.3947,163.9202,290.0501,162.9541,289.7652,162.0157,289.1332,160.9165,288.6838,159.9019,288.7065,159.9034,288.804,161.8666,289.0048,163.8367,289.1558,165.8035,289.402,167.7765,289.338,169.729" style="stroke: #383838; stroke-width: 1.0;"/><!--link ESLint to Init--><path d="M329.25,95.031 L329.5131,95.1275 L332.3975,104.8308 L336.8242,115.1001 L340.7487,125.185 L343.0216,134.6639 L347.4834,144.946 L350.713,154.7759 L354.913,164.962 " fill="none" style="stroke: #383838; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><polygon fill="#383838" points="356.662,169.729,356.7319,169.7337,356.655,167.7544,356.988,165.8024,357.1875,163.8416,356.9481,161.8515,357.3162,159.9019,357.2927,159.891,356.7118,160.8688,356.2495,161.9015,355.8695,162.9723,355.2056,163.9117,354.9393,165.0351,355.0168,165.2026,353.8244,164.3691,352.8583,164.0246,351.9199,163.7396,350.8207,163.1077,349.8061,162.6582,349.8224,162.674,351.1696,164.065,352.5912,165.528,353.9768,166.9562,355.431,168.4507,356.662,169.729" style="stroke: #383838; stroke-width: 1.0;"/><!--
-@startuml
-skinparam monochrome true
-skinparam handwritten true
-
-folder " bin " {
-    rectangle "eslint.js" as ESLint
-}
-
-folder " lib " {
-    rectangle "cli.js" as CLI
-    rectangle "api.js" as API
-    rectangle "init" as Init
-    rectangle "cli-engine" as CLIEngine
-    rectangle "linter" as Linter
-    rectangle "source-code" as SourceCode
-    rectangle "rule-tester" as RuleTester
-    rectangle "rules" as Rules
-
-    CLI ..> CLIEngine
-
-    API ..> Linter
-    API ..> CLIEngine
-    API ..> RuleTester
-    API ..> SourceCode
-
-    Init ..> Linter
-    Init ..> CLIEngine
-    Init ..> Rules
-
-    CLIEngine ..> Linter
-
-    RuleTester ..> Linter
-
-    Linter ..> Rules
-    Linter ..> SourceCode
-}
-
-ESLint ..> CLI
-ESLint ..> Init
-@enduml
-
-PlantUML version 1.2019.03(Sun Mar 10 11:04:44 UTC 2019)
-(GPL source distribution)
-Java Runtime: Java(TM) SE Runtime Environment
-JVM: Java HotSpot(TM) 64-Bit Server VM
-Java Version: 1.7.0_25-b15
-Operating System: Linux
-Default Encoding: UTF-8
-Language: en
-Country: US
---></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-conventions.md b/eslint/docs/developer-guide/code-conventions.md
deleted file mode 100644 (file)
index 0c1cbe6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Code Conventions
-
-Code conventions for ESLint are determined by
-[eslint-config-eslint](https://www.npmjs.com/package/eslint-config-eslint).
-
-The rationales for the specific rules in use can be found by looking to the
-project documentation for any given rule. If the rule is one of our own, see
-our own [rule documentation](https://eslint.org/docs/rules/) and otherwise, see
-the documentation of the plugin in which the rule can be found.
diff --git a/eslint/docs/developer-guide/code-path-analysis.md b/eslint/docs/developer-guide/code-path-analysis.md
deleted file mode 100644 (file)
index 2b01bc7..0000000
+++ /dev/null
@@ -1,548 +0,0 @@
-# Code Path Analysis Details
-
-ESLint's rules can use code paths.
-The code path is execution routes of programs.
-It forks/joins at such as `if` statements.
-
-```js
-if (a && b) {
-    foo();
-}
-bar();
-```
-
-![Code Path Example](./code-path-analysis/helo.svg)
-
-## Objects
-
-Program is expressed with several code paths.
-A code path is expressed with objects of two kinds: `CodePath` and `CodePathSegment`.
-
-### `CodePath`
-
-`CodePath` expresses whole of one code path.
-This object exists for each function and the global.
-This has references of both the initial segment and the final segments of a code path.
-
-`CodePath` has the following properties:
-
-* `id` (`string`) - A unique string. Respective rules can use `id` to save additional information for each code path.
-* `origin` (`string`) - The reason that the code path was started. May be `"program"`, `"function"`, `"class-field-initializer"`, or `"class-static-block"`.
-* `initialSegment` (`CodePathSegment`) - The initial segment of this code path.
-* `finalSegments` (`CodePathSegment[]`) - The final segments which includes both returned and thrown.
-* `returnedSegments` (`CodePathSegment[]`) - The final segments which includes only returned.
-* `thrownSegments` (`CodePathSegment[]`) - The final segments which includes only thrown.
-* `currentSegments` (`CodePathSegment[]`) - Segments of the current position.
-* `upper` (`CodePath|null`) - The code path of the upper function/global scope.
-* `childCodePaths` (`CodePath[]`) - Code paths of functions this code path contains.
-
-### `CodePathSegment`
-
-`CodePathSegment` is a part of a code path.
-A code path is expressed with plural `CodePathSegment` objects, it's similar to doubly linked list.
-Difference from doubly linked list is what there are forking and merging (the next/prev are plural).
-
-`CodePathSegment` has the following properties:
-
-* `id` (`string`) - A unique string. Respective rules can use `id` to save additional information for each segment.
-* `nextSegments` (`CodePathSegment[]`) - The next segments. If forking, there are two or more. If final, there is nothing.
-* `prevSegments` (`CodePathSegment[]`) - The previous segments. If merging, there are two or more. If initial, there is nothing.
-* `reachable` (`boolean`) - A flag which shows whether or not it's reachable. This becomes `false` when preceded by `return`, `throw`, `break`, or `continue`.
-
-## Events
-
-There are five events related to code paths, and you can define event handlers in rules.
-
-```js
-module.exports = function(context) {
-    return {
-        /**
-         * This is called at the start of analyzing a code path.
-         * In this time, the code path object has only the initial segment.
-         *
-         * @param {CodePath} codePath - The new code path.
-         * @param {ASTNode} node - The current node.
-         * @returns {void}
-         */
-        "onCodePathStart": function(codePath, node) {
-            // do something with codePath
-        },
-
-        /**
-         * This is called at the end of analyzing a code path.
-         * In this time, the code path object is complete.
-         *
-         * @param {CodePath} codePath - The completed code path.
-         * @param {ASTNode} node - The current node.
-         * @returns {void}
-         */
-        "onCodePathEnd": function(codePath, node) {
-            // do something with codePath
-        },
-
-        /**
-         * This is called when a code path segment was created.
-         * It meant the code path is forked or merged.
-         * In this time, the segment has the previous segments and has been
-         * judged reachable or not.
-         *
-         * @param {CodePathSegment} segment - The new code path segment.
-         * @param {ASTNode} node - The current node.
-         * @returns {void}
-         */
-        "onCodePathSegmentStart": function(segment, node) {
-            // do something with segment
-        },
-
-        /**
-         * This is called when a code path segment was leaved.
-         * In this time, the segment does not have the next segments yet.
-         *
-         * @param {CodePathSegment} segment - The leaved code path segment.
-         * @param {ASTNode} node - The current node.
-         * @returns {void}
-         */
-        "onCodePathSegmentEnd": function(segment, node) {
-            // do something with segment
-        },
-
-        /**
-         * This is called when a code path segment was looped.
-         * Usually segments have each previous segments when created,
-         * but when looped, a segment is added as a new previous segment into a
-         * existing segment.
-         *
-         * @param {CodePathSegment} fromSegment - A code path segment of source.
-         * @param {CodePathSegment} toSegment - A code path segment of destination.
-         * @param {ASTNode} node - The current node.
-         * @returns {void}
-         */
-        "onCodePathSegmentLoop": function(fromSegment, toSegment, node) {
-            // do something with segment
-        }
-    };
-};
-```
-
-### About `onCodePathSegmentLoop`
-
-This event is always fired when the next segment has existed already.
-That timing is the end of loops mainly.
-
-For Example 1:
-
-```js
-while (a) {
-    a = foo();
-}
-bar();
-```
-
-1. First, the analysis advances to the end of loop.
-
-   ![Loop Event's Example 1](./code-path-analysis/loop-event-example-while-1.svg)
-
-2. Second, it creates the looping path.
-   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
-   It fires `onCodePathSegmentLoop` instead.
-
-   ![Loop Event's Example 2](./code-path-analysis/loop-event-example-while-2.svg)
-
-3. Last, it advances to the end.
-
-   ![Loop Event's Example 3](./code-path-analysis/loop-event-example-while-3.svg)
-
-For example 2:
-
-```js
-for (let i = 0; i < 10; ++i) {
-    foo(i);
-}
-bar();
-```
-
-1. `for` statements are more complex.
-   First, the analysis advances to `ForStatement.update`.
-   The `update` segment is hovered at first.
-
-   ![Loop Event's Example 1](./code-path-analysis/loop-event-example-for-1.svg)
-
-2. Second, it advances to `ForStatement.body`.
-   Of course the `body` segment is preceded by the `test` segment.
-   It keeps the `update` segment hovering.
-
-   ![Loop Event's Example 2](./code-path-analysis/loop-event-example-for-2.svg)
-
-3. Third, it creates the looping path from `body` segment to `update` segment.
-   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
-   It fires `onCodePathSegmentLoop` instead.
-
-   ![Loop Event's Example 3](./code-path-analysis/loop-event-example-for-3.svg)
-
-4. Fourth, also it creates the looping path from `update` segment to `test` segment.
-   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
-   It fires `onCodePathSegmentLoop` instead.
-
-   ![Loop Event's Example 4](./code-path-analysis/loop-event-example-for-4.svg)
-
-5. Last, it advances to the end.
-
-   ![Loop Event's Example 5](./code-path-analysis/loop-event-example-for-5.svg)
-
-## Usage Examples
-
-### To check whether or not this is reachable
-
-```js
-function isReachable(segment) {
-    return segment.reachable;
-}
-
-module.exports = function(context) {
-    var codePathStack = [];
-
-    return {
-        // Stores CodePath objects.
-        "onCodePathStart": function(codePath) {
-            codePathStack.push(codePath);
-        },
-        "onCodePathEnd": function(codePath) {
-            codePathStack.pop();
-        },
-
-        // Checks reachable or not.
-        "ExpressionStatement": function(node) {
-            var codePath = codePathStack[codePathStack.length - 1];
-
-            // Checks the current code path segments.
-            if (!codePath.currentSegments.some(isReachable)) {
-                context.report({message: "Unreachable!", node: node});
-            }
-        }
-    };
-};
-```
-
-See Also:
-[no-unreachable](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-unreachable.js),
-[no-fallthrough](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-fallthrough.js),
-[consistent-return](https://github.com/eslint/eslint/blob/HEAD/lib/rules/consistent-return.js)
-
-### To check state of a code path
-
-This example is checking whether or not the parameter `cb` is called in every path.
-Instances of `CodePath` and `CodePathSegment` are shared to every rule.
-So a rule must not modify those instances.
-Please use a map of information instead.
-
-```js
-function hasCb(node, context) {
-    if (node.type.indexOf("Function") !== -1) {
-        return context.getDeclaredVariables(node).some(function(v) {
-            return v.type === "Parameter" && v.name === "cb";
-        });
-    }
-    return false;
-}
-
-function isCbCalled(info) {
-    return info.cbCalled;
-}
-
-module.exports = function(context) {
-    var funcInfoStack = [];
-    var segmentInfoMap = Object.create(null);
-
-    return {
-        // Checks `cb`.
-        "onCodePathStart": function(codePath, node) {
-            funcInfoStack.push({
-                codePath: codePath,
-                hasCb: hasCb(node, context)
-            });
-        },
-        "onCodePathEnd": function(codePath, node) {
-            funcInfoStack.pop();
-
-            // Checks `cb` was called in every paths.
-            var cbCalled = codePath.finalSegments.every(function(segment) {
-                var info = segmentInfoMap[segment.id];
-                return info.cbCalled;
-            });
-
-            if (!cbCalled) {
-                context.report({
-                    message: "`cb` should be called in every path.",
-                    node: node
-                });
-            }
-        },
-
-        // Manages state of code paths.
-        "onCodePathSegmentStart": function(segment) {
-            var funcInfo = funcInfoStack[funcInfoStack.length - 1];
-
-            // Ignores if `cb` doesn't exist.
-            if (!funcInfo.hasCb) {
-                return;
-            }
-
-            // Initialize state of this path.
-            var info = segmentInfoMap[segment.id] = {
-                cbCalled: false
-            };
-
-            // If there are the previous paths, merges state.
-            // Checks `cb` was called in every previous path.
-            if (segment.prevSegments.length > 0) {
-                info.cbCalled = segment.prevSegments.every(isCbCalled);
-            }
-        },
-
-        // Checks reachable or not.
-        "CallExpression": function(node) {
-            var funcInfo = funcInfoStack[funcInfoStack.length - 1];
-
-            // Ignores if `cb` doesn't exist.
-            if (!funcInfo.hasCb) {
-                return;
-            }
-
-            // Sets marks that `cb` was called.
-            var callee = node.callee;
-            if (callee.type === "Identifier" && callee.name === "cb") {
-                funcInfo.codePath.currentSegments.forEach(function(segment) {
-                    var info = segmentInfoMap[segment.id];
-                    info.cbCalled = true;
-                });
-            }
-        }
-    };
-};
-```
-
-See Also:
-[constructor-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/constructor-super.js),
-[no-this-before-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-this-before-super.js)
-
-## Code Path Examples
-
-### Hello World
-
-```js
-console.log("Hello world!");
-```
-
-![Hello World](./code-path-analysis/example-hello-world.svg)
-
-### `IfStatement`
-
-```js
-if (a) {
-    foo();
-} else {
-    bar();
-}
-```
-
-![`IfStatement`](./code-path-analysis/example-ifstatement.svg)
-
-### `IfStatement` (chain)
-
-```js
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (c) {
-    hoge();
-}
-```
-
-![`IfStatement` (chain)](./code-path-analysis/example-ifstatement-chain.svg)
-
-### `SwitchStatement`
-
-```js
-switch (a) {
-    case 0:
-        foo();
-        break;
-
-    case 1:
-    case 2:
-        bar();
-        // fallthrough
-
-    case 3:
-        hoge();
-        break;
-}
-```
-
-![`SwitchStatement`](./code-path-analysis/example-switchstatement.svg)
-
-### `SwitchStatement` (has `default`)
-
-```js
-switch (a) {
-    case 0:
-        foo();
-        break;
-
-    case 1:
-    case 2:
-        bar();
-        // fallthrough
-
-    case 3:
-        hoge();
-        break;
-
-    default:
-        fuga();
-        break;
-}
-```
-
-![`SwitchStatement` (has `default`)](./code-path-analysis/example-switchstatement-has-default.svg)
-
-### `TryStatement` (try-catch)
-
-```js
-try {
-    foo();
-    if (a) {
-        throw new Error();
-    }
-    bar();
-} catch (err) {
-    hoge(err);
-}
-last();
-```
-
-It creates the paths from `try` block to `catch` block at:
-
-* `throw` statements.
-* The first throwable node (e.g. a function call) in the `try` block.
-* The end of the `try` block.
-
-![`TryStatement` (try-catch)](./code-path-analysis/example-trystatement-try-catch.svg)
-
-### `TryStatement` (try-finally)
-
-```js
-try {
-    foo();
-    bar();
-} finally {
-    fuga();
-}
-last();
-```
-
-If there is not `catch` block, `finally` block has two current segments.
-At this time, `CodePath.currentSegments.length` is `2`.
-One is the normal path, and another is the leaving path (`throw` or `return`).
-
-![`TryStatement` (try-finally)](./code-path-analysis/example-trystatement-try-finally.svg)
-
-### `TryStatement` (try-catch-finally)
-
-```js
-try {
-    foo();
-    bar();
-} catch (err) {
-    hoge(err);
-} finally {
-    fuga();
-}
-last();
-```
-
-![`TryStatement` (try-catch-finally)](./code-path-analysis/example-trystatement-try-catch-finally.svg)
-
-### `WhileStatement`
-
-```js
-while (a) {
-    foo();
-    if (b) {
-        continue;
-    }
-    bar();
-}
-```
-
-![`WhileStatement`](./code-path-analysis/example-whilestatement.svg)
-
-### `DoWhileStatement`
-
-```js
-do {
-    foo();
-    bar();
-} while (a);
-```
-
-![`DoWhileStatement`](./code-path-analysis/example-dowhilestatement.svg)
-
-### `ForStatement`
-
-```js
-for (let i = 0; i < 10; ++i) {
-    foo();
-    if (b) {
-        break;
-    }
-    bar();
-}
-```
-
-![`ForStatement`](./code-path-analysis/example-forstatement.svg)
-
-### `ForStatement` (for ever)
-
-```js
-for (;;) {
-    foo();
-}
-bar();
-```
-
-![`ForStatement` (for ever)](./code-path-analysis/example-forstatement-for-ever.svg)
-
-### `ForInStatement`
-
-```js
-for (let key in obj) {
-    foo(key);
-}
-```
-
-![`ForInStatement`](./code-path-analysis/example-forinstatement.svg)
-
-### When there is a function
-
-```js
-function foo(a) {
-    if (a) {
-        return;
-    }
-    bar();
-}
-
-foo(false);
-```
-
-It creates two code paths.
-
-* The global's
-
-  ![When there is a function](./code-path-analysis/example-when-there-is-a-function-g.svg)
-
-* The function's
-
-  ![When there is a function](./code-path-analysis/example-when-there-is-a-function-f.svg)
diff --git a/eslint/docs/developer-guide/code-path-analysis/README.md b/eslint/docs/developer-guide/code-path-analysis/README.md
deleted file mode 100644 (file)
index 2b6fd74..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[Code Path Analysis Details](../code-path-analysis.md)
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg
deleted file mode 100644 (file)
index 4a3d528..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0"?>
-<svg width="167pt" height="422pt" viewBox="0.00 0.00 167.00 422.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 418)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="74" cy="-405" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="123.479,-359.602 24.5211,-359.602 12.5211,-347.602 12.5211,-330.398 24.5211,-318.398 123.479,-318.398 135.479,-330.398 135.479,-347.602 123.479,-359.602"></polygon>
-<path fill="white" stroke="white" d="M24.5211,-359.602C18.5211,-359.602 12.5211,-353.602 12.5211,-347.602"></path>
-<path fill="white" stroke="white" d="M12.5211,-330.398C12.5211,-324.398 18.5211,-318.398 24.5211,-318.398"></path>
-<path fill="white" stroke="white" d="M123.479,-318.398C129.479,-318.398 135.479,-324.398 135.479,-330.398"></path>
-<path fill="white" stroke="white" d="M135.479,-347.602C135.479,-353.602 129.479,-359.602 123.479,-359.602"></path>
-<polyline fill="none" stroke="black" points="123.479,-359.602 24.5211,-359.602 "></polyline>
-<path fill="none" stroke="black" d="M24.5211,-359.602C18.5211,-359.602 12.5211,-353.602 12.5211,-347.602"></path>
-<polyline fill="none" stroke="black" points="12.5211,-347.602 12.5211,-330.398 "></polyline>
-<path fill="none" stroke="black" d="M12.5211,-330.398C12.5211,-324.398 18.5211,-318.398 24.5211,-318.398"></path>
-<polyline fill="none" stroke="black" points="24.5211,-318.398 123.479,-318.398 "></polyline>
-<path fill="none" stroke="black" d="M123.479,-318.398C129.479,-318.398 135.479,-324.398 135.479,-330.398"></path>
-<polyline fill="none" stroke="black" points="135.479,-330.398 135.479,-347.602 "></polyline>
-<path fill="none" stroke="black" d="M135.479,-347.602C135.479,-353.602 129.479,-359.602 123.479,-359.602"></path>
-<text text-anchor="middle" x="74" y="-343.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="74" y="-326.4" font-family="Times,serif" font-size="14.00">DoWhileStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M74,-395.894C74,-389.274 74,-379.485 74,-369.94"></path>
-<polygon fill="black" stroke="black" points="77.5001,-369.842 74,-359.842 70.5001,-369.842 77.5001,-369.842"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="74" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="74" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="129.147,-282.401 18.8526,-282.401 6.85263,-270.401 6.85263,-151.599 18.8526,-139.599 129.147,-139.599 141.147,-151.599 141.147,-270.401 129.147,-282.401"></polygon>
-<path fill="white" stroke="white" d="M18.8526,-282.401C12.8526,-282.401 6.85263,-276.401 6.85263,-270.401"></path>
-<path fill="white" stroke="white" d="M6.85263,-151.599C6.85263,-145.599 12.8526,-139.599 18.8526,-139.599"></path>
-<path fill="white" stroke="white" d="M129.147,-139.599C135.147,-139.599 141.147,-145.599 141.147,-151.599"></path>
-<path fill="white" stroke="white" d="M141.147,-270.401C141.147,-276.401 135.147,-282.401 129.147,-282.401"></path>
-<polyline fill="none" stroke="black" points="129.147,-282.401 18.8526,-282.401 "></polyline>
-<path fill="none" stroke="black" d="M18.8526,-282.401C12.8526,-282.401 6.85263,-276.401 6.85263,-270.401"></path>
-<polyline fill="none" stroke="black" points="6.85263,-270.401 6.85263,-151.599 "></polyline>
-<path fill="none" stroke="black" d="M6.85263,-151.599C6.85263,-145.599 12.8526,-139.599 18.8526,-139.599"></path>
-<polyline fill="none" stroke="black" points="18.8526,-139.599 129.147,-139.599 "></polyline>
-<path fill="none" stroke="black" d="M129.147,-139.599C135.147,-139.599 141.147,-145.599 141.147,-151.599"></path>
-<polyline fill="none" stroke="black" points="141.147,-151.599 141.147,-270.401 "></polyline>
-<path fill="none" stroke="black" d="M141.147,-270.401C141.147,-276.401 135.147,-282.401 129.147,-282.401"></path>
-<text text-anchor="middle" x="74" y="-265.6" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="74" y="-248.8" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="74" y="-232" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="74" y="-215.2" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="74" y="-198.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="74" y="-181.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="74" y="-164.8" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-<text text-anchor="middle" x="74" y="-148" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M74,-318.313C74,-310.915 74,-301.974 74,-292.455"></path>
-<polygon fill="black" stroke="black" points="77.5001,-292.368 74,-282.368 70.5001,-292.368 77.5001,-292.368"></polygon>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M141.337,-232.995C151.84,-229.707 159,-222.375 159,-211 159,-203.357 155.768,-197.54 150.461,-193.548"></path>
-<polygon fill="black" stroke="black" points="151.849,-190.329 141.337,-189.005 148.729,-196.596 151.849,-190.329"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="136.144,-103.602 11.8558,-103.602 -0.144212,-91.6019 -0.144212,-74.3981 11.8558,-62.3981 136.144,-62.3981 148.144,-74.3981 148.144,-91.6019 136.144,-103.602"></polygon>
-<path fill="white" stroke="white" d="M11.8558,-103.602C5.85579,-103.602 -0.144212,-97.6019 -0.144212,-91.6019"></path>
-<path fill="white" stroke="white" d="M-0.144212,-74.3981C-0.144212,-68.3981 5.85579,-62.3981 11.8558,-62.3981"></path>
-<path fill="white" stroke="white" d="M136.144,-62.3981C142.144,-62.3981 148.144,-68.3981 148.144,-74.3981"></path>
-<path fill="white" stroke="white" d="M148.144,-91.6019C148.144,-97.6019 142.144,-103.602 136.144,-103.602"></path>
-<polyline fill="none" stroke="black" points="136.144,-103.602 11.8558,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M11.8558,-103.602C5.85579,-103.602 -0.144212,-97.6019 -0.144212,-91.6019"></path>
-<polyline fill="none" stroke="black" points="-0.144212,-91.6019 -0.144212,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M-0.144212,-74.3981C-0.144212,-68.3981 5.85579,-62.3981 11.8558,-62.3981"></path>
-<polyline fill="none" stroke="black" points="11.8558,-62.3981 136.144,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M136.144,-62.3981C142.144,-62.3981 148.144,-68.3981 148.144,-74.3981"></path>
-<polyline fill="none" stroke="black" points="148.144,-74.3981 148.144,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M148.144,-91.6019C148.144,-97.6019 142.144,-103.602 136.144,-103.602"></path>
-<text text-anchor="middle" x="74" y="-87.2" font-family="Times,serif" font-size="14.00">DoWhileStatement:exit</text>
-<text text-anchor="middle" x="74" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M74,-139.632C74,-130.564 74,-121.701 74,-113.811"></path>
-<polygon fill="black" stroke="black" points="77.5001,-113.726 74,-103.726 70.5001,-113.726 77.5001,-113.726"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_3-&gt;final</title>
-<path fill="none" stroke="black" d="M74,-62.3316C74,-54.2587 74,-44.8663 74,-36.5198"></path>
-<polygon fill="black" stroke="black" points="77.5001,-36.3487 74,-26.3488 70.5001,-36.3488 77.5001,-36.3487"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-forinstatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-forinstatement.svg
deleted file mode 100644 (file)
index 00da11e..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0"?>
-<svg width="185pt" height="538pt" viewBox="0.00 0.00 185.00 538.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 534)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-521" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="153.319,-475.602 74.6808,-475.602 62.6808,-463.602 62.6808,-446.398 74.6808,-434.398 153.319,-434.398 165.319,-446.398 165.319,-463.602 153.319,-475.602"></polygon>
-<path fill="white" stroke="white" d="M74.6808,-475.602C68.6808,-475.602 62.6808,-469.602 62.6808,-463.602"></path>
-<path fill="white" stroke="white" d="M62.6808,-446.398C62.6808,-440.398 68.6808,-434.398 74.6808,-434.398"></path>
-<path fill="white" stroke="white" d="M153.319,-434.398C159.319,-434.398 165.319,-440.398 165.319,-446.398"></path>
-<path fill="white" stroke="white" d="M165.319,-463.602C165.319,-469.602 159.319,-475.602 153.319,-475.602"></path>
-<polyline fill="none" stroke="black" points="153.319,-475.602 74.6808,-475.602 "></polyline>
-<path fill="none" stroke="black" d="M74.6808,-475.602C68.6808,-475.602 62.6808,-469.602 62.6808,-463.602"></path>
-<polyline fill="none" stroke="black" points="62.6808,-463.602 62.6808,-446.398 "></polyline>
-<path fill="none" stroke="black" d="M62.6808,-446.398C62.6808,-440.398 68.6808,-434.398 74.6808,-434.398"></path>
-<polyline fill="none" stroke="black" points="74.6808,-434.398 153.319,-434.398 "></polyline>
-<path fill="none" stroke="black" d="M153.319,-434.398C159.319,-434.398 165.319,-440.398 165.319,-446.398"></path>
-<polyline fill="none" stroke="black" points="165.319,-446.398 165.319,-463.602 "></polyline>
-<path fill="none" stroke="black" d="M165.319,-463.602C165.319,-469.602 159.319,-475.602 153.319,-475.602"></path>
-<text text-anchor="middle" x="114" y="-459.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="114" y="-442.4" font-family="Times,serif" font-size="14.00">ForInStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M114,-511.894C114,-505.274 114,-495.485 114,-485.94"></path>
-<polygon fill="black" stroke="black" points="117.5,-485.842 114,-475.842 110.5,-485.842 117.5,-485.842"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="114" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="151.097,-398 76.9034,-398 64.9034,-386 64.9034,-374 76.9034,-362 151.097,-362 163.097,-374 163.097,-386 151.097,-398"></polygon>
-<path fill="white" stroke="white" d="M76.9034,-398C70.9034,-398 64.9034,-392 64.9034,-386"></path>
-<path fill="white" stroke="white" d="M64.9034,-374C64.9034,-368 70.9034,-362 76.9034,-362"></path>
-<path fill="white" stroke="white" d="M151.097,-362C157.097,-362 163.097,-368 163.097,-374"></path>
-<path fill="white" stroke="white" d="M163.097,-386C163.097,-392 157.097,-398 151.097,-398"></path>
-<polyline fill="none" stroke="black" points="151.097,-398 76.9034,-398 "></polyline>
-<path fill="none" stroke="black" d="M76.9034,-398C70.9034,-398 64.9034,-392 64.9034,-386"></path>
-<polyline fill="none" stroke="black" points="64.9034,-386 64.9034,-374 "></polyline>
-<path fill="none" stroke="black" d="M64.9034,-374C64.9034,-368 70.9034,-362 76.9034,-362"></path>
-<polyline fill="none" stroke="black" points="76.9034,-362 151.097,-362 "></polyline>
-<path fill="none" stroke="black" d="M151.097,-362C157.097,-362 163.097,-368 163.097,-374"></path>
-<polyline fill="none" stroke="black" points="163.097,-374 163.097,-386 "></polyline>
-<path fill="none" stroke="black" d="M163.097,-386C163.097,-392 157.097,-398 151.097,-398"></path>
-<text text-anchor="middle" x="114" y="-375.8" font-family="Times,serif" font-size="14.00">Identifier (obj)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M114,-434.052C114,-426.216 114,-417.089 114,-408.636"></path>
-<polygon fill="black" stroke="black" points="117.5,-408.439 114,-398.439 110.5,-408.439 117.5,-408.439"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="119.617,-326.401 14.3833,-326.401 2.38328,-314.401 2.38328,-279.599 14.3833,-267.599 119.617,-267.599 131.617,-279.599 131.617,-314.401 119.617,-326.401"></polygon>
-<path fill="white" stroke="white" d="M14.3833,-326.401C8.38328,-326.401 2.38328,-320.401 2.38328,-314.401"></path>
-<path fill="white" stroke="white" d="M2.38328,-279.599C2.38328,-273.599 8.38328,-267.599 14.3833,-267.599"></path>
-<path fill="white" stroke="white" d="M119.617,-267.599C125.617,-267.599 131.617,-273.599 131.617,-279.599"></path>
-<path fill="white" stroke="white" d="M131.617,-314.401C131.617,-320.401 125.617,-326.401 119.617,-326.401"></path>
-<polyline fill="none" stroke="black" points="119.617,-326.401 14.3833,-326.401 "></polyline>
-<path fill="none" stroke="black" d="M14.3833,-326.401C8.38328,-326.401 2.38328,-320.401 2.38328,-314.401"></path>
-<polyline fill="none" stroke="black" points="2.38328,-314.401 2.38328,-279.599 "></polyline>
-<path fill="none" stroke="black" d="M2.38328,-279.599C2.38328,-273.599 8.38328,-267.599 14.3833,-267.599"></path>
-<polyline fill="none" stroke="black" points="14.3833,-267.599 119.617,-267.599 "></polyline>
-<path fill="none" stroke="black" d="M119.617,-267.599C125.617,-267.599 131.617,-273.599 131.617,-279.599"></path>
-<polyline fill="none" stroke="black" points="131.617,-279.599 131.617,-314.401 "></polyline>
-<path fill="none" stroke="black" d="M131.617,-314.401C131.617,-320.401 125.617,-326.401 119.617,-326.401"></path>
-<text text-anchor="middle" x="67" y="-309.6" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="67" y="-292.8" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="67" y="-276" font-family="Times,serif" font-size="14.00">Identifier (key)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_3-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M104.033,-361.822C99.4992,-354.009 93.9468,-344.44 88.5344,-335.112"></path>
-<polygon fill="black" stroke="black" points="91.4721,-333.201 83.4259,-326.309 85.4175,-336.715 91.4721,-333.201"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_5</title>
-<polygon fill="white" stroke="white" points="165.484,-103.602 62.5157,-103.602 50.5157,-91.6019 50.5157,-74.3981 62.5157,-62.3981 165.484,-62.3981 177.484,-74.3981 177.484,-91.6019 165.484,-103.602"></polygon>
-<path fill="white" stroke="white" d="M62.5157,-103.602C56.5157,-103.602 50.5157,-97.6019 50.5157,-91.6019"></path>
-<path fill="white" stroke="white" d="M50.5157,-74.3981C50.5157,-68.3981 56.5157,-62.3981 62.5157,-62.3981"></path>
-<path fill="white" stroke="white" d="M165.484,-62.3981C171.484,-62.3981 177.484,-68.3981 177.484,-74.3981"></path>
-<path fill="white" stroke="white" d="M177.484,-91.6019C177.484,-97.6019 171.484,-103.602 165.484,-103.602"></path>
-<polyline fill="none" stroke="black" points="165.484,-103.602 62.5157,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M62.5157,-103.602C56.5157,-103.602 50.5157,-97.6019 50.5157,-91.6019"></path>
-<polyline fill="none" stroke="black" points="50.5157,-91.6019 50.5157,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M50.5157,-74.3981C50.5157,-68.3981 56.5157,-62.3981 62.5157,-62.3981"></path>
-<polyline fill="none" stroke="black" points="62.5157,-62.3981 165.484,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M165.484,-62.3981C171.484,-62.3981 177.484,-68.3981 177.484,-74.3981"></path>
-<polyline fill="none" stroke="black" points="177.484,-74.3981 177.484,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M177.484,-91.6019C177.484,-97.6019 171.484,-103.602 165.484,-103.602"></path>
-<text text-anchor="middle" x="114" y="-87.2" font-family="Times,serif" font-size="14.00">ForInStatement:exit</text>
-<text text-anchor="middle" x="114" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge8" class="edge"><title>s1_3-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M124.891,-361.573C130.533,-351.566 136.88,-338.531 140,-326 159.973,-245.771 162.566,-220.329 143,-140 140.717,-130.626 136.569,-121.069 132.111,-112.567"></path>
-<polygon fill="black" stroke="black" points="135.155,-110.84 127.225,-103.814 129.043,-114.251 135.155,-110.84"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="122.147,-232 11.8526,-232 -0.147372,-220 -0.147372,-152 11.8526,-140 122.147,-140 134.147,-152 134.147,-220 122.147,-232"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-232C5.85263,-232 -0.147372,-226 -0.147372,-220"></path>
-<path fill="white" stroke="white" d="M-0.147372,-152C-0.147372,-146 5.85263,-140 11.8526,-140"></path>
-<path fill="white" stroke="white" d="M122.147,-140C128.147,-140 134.147,-146 134.147,-152"></path>
-<path fill="white" stroke="white" d="M134.147,-220C134.147,-226 128.147,-232 122.147,-232"></path>
-<polyline fill="none" stroke="black" points="122.147,-232 11.8526,-232 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-232C5.85263,-232 -0.147372,-226 -0.147372,-220"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-220 -0.147372,-152 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-152C-0.147372,-146 5.85263,-140 11.8526,-140"></path>
-<polyline fill="none" stroke="black" points="11.8526,-140 122.147,-140 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-140C128.147,-140 134.147,-146 134.147,-152"></path>
-<polyline fill="none" stroke="black" points="134.147,-152 134.147,-220 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-220C134.147,-226 128.147,-232 122.147,-232"></path>
-<text text-anchor="middle" x="67" y="-215.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-198.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-181.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-165" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-148.2" font-family="Times,serif" font-size="14.00">Identifier (key)</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M60.9942,-267.646C60.5136,-259.848 60.2658,-251.114 60.2507,-242.351"></path>
-<polygon fill="black" stroke="black" points="63.7527,-242.134 60.34,-232.104 56.7529,-242.073 63.7527,-242.134"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M73.66,-232.104C73.8235,-240.564 73.7642,-249.334 73.4822,-257.568"></path>
-<polygon fill="black" stroke="black" points="69.982,-257.492 73.0058,-267.646 76.9742,-257.823 69.982,-257.492"></polygon>
-</g>
-
-<g id="edge10" class="edge"><title>s1_4-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M88.0256,-139.817C92.2417,-130.757 96.5653,-121.466 100.445,-113.128"></path>
-<polygon fill="black" stroke="black" points="103.718,-114.392 104.763,-103.849 97.3711,-111.439 103.718,-114.392"></polygon>
-</g>
-
-<g id="edge11" class="edge"><title>s1_5-&gt;final</title>
-<path fill="none" stroke="black" d="M114,-62.3316C114,-54.2587 114,-44.8663 114,-36.5198"></path>
-<polygon fill="black" stroke="black" points="117.5,-36.3487 114,-26.3488 110.5,-36.3488 117.5,-36.3487"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg b/eslint/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg
deleted file mode 100644 (file)
index b4bdb23..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<svg width="160pt" height="216pt" viewBox="0.00 0.00 160.00 216.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 212)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="67" cy="-199" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="100.573,-153.602 33.4267,-153.602 21.4267,-141.602 21.4267,-124.398 33.4267,-112.398 100.573,-112.398 112.573,-124.398 112.573,-141.602 100.573,-153.602"></polygon>
-<path fill="white" stroke="white" d="M33.4267,-153.602C27.4267,-153.602 21.4267,-147.602 21.4267,-141.602"></path>
-<path fill="white" stroke="white" d="M21.4267,-124.398C21.4267,-118.398 27.4267,-112.398 33.4267,-112.398"></path>
-<path fill="white" stroke="white" d="M100.573,-112.398C106.573,-112.398 112.573,-118.398 112.573,-124.398"></path>
-<path fill="white" stroke="white" d="M112.573,-141.602C112.573,-147.602 106.573,-153.602 100.573,-153.602"></path>
-<polyline fill="none" stroke="black" points="100.573,-153.602 33.4267,-153.602 "></polyline>
-<path fill="none" stroke="black" d="M33.4267,-153.602C27.4267,-153.602 21.4267,-147.602 21.4267,-141.602"></path>
-<polyline fill="none" stroke="black" points="21.4267,-141.602 21.4267,-124.398 "></polyline>
-<path fill="none" stroke="black" d="M21.4267,-124.398C21.4267,-118.398 27.4267,-112.398 33.4267,-112.398"></path>
-<polyline fill="none" stroke="black" points="33.4267,-112.398 100.573,-112.398 "></polyline>
-<path fill="none" stroke="black" d="M100.573,-112.398C106.573,-112.398 112.573,-118.398 112.573,-124.398"></path>
-<polyline fill="none" stroke="black" points="112.573,-124.398 112.573,-141.602 "></polyline>
-<path fill="none" stroke="black" d="M112.573,-141.602C112.573,-147.602 106.573,-153.602 100.573,-153.602"></path>
-<text text-anchor="middle" x="67" y="-137.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="67" y="-120.4" font-family="Times,serif" font-size="14.00">ForStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M67,-189.894C67,-183.274 67,-173.485 67,-163.94"></path>
-<polygon fill="black" stroke="black" points="70.5001,-163.842 67,-153.842 63.5001,-163.842 70.5001,-163.842"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="122.147,-75.7003 11.8526,-75.7003 -0.147372,-63.7003 -0.147372,-12.2997 11.8526,-0.299733 122.147,-0.299733 134.147,-12.2997 134.147,-63.7003 122.147,-75.7003"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-75.7003C5.85263,-75.7003 -0.147372,-69.7003 -0.147372,-63.7003"></path>
-<path fill="white" stroke="white" d="M-0.147372,-12.2997C-0.147372,-6.29973 5.85263,-0.299733 11.8526,-0.299733"></path>
-<path fill="white" stroke="white" d="M122.147,-0.299733C128.147,-0.299733 134.147,-6.29973 134.147,-12.2997"></path>
-<path fill="white" stroke="white" d="M134.147,-63.7003C134.147,-69.7003 128.147,-75.7003 122.147,-75.7003"></path>
-<polyline fill="none" stroke="black" points="122.147,-75.7003 11.8526,-75.7003 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-75.7003C5.85263,-75.7003 -0.147372,-69.7003 -0.147372,-63.7003"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-63.7003 -0.147372,-12.2997 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-12.2997C-0.147372,-6.29973 5.85263,-0.299733 11.8526,-0.299733"></path>
-<polyline fill="none" stroke="black" points="11.8526,-0.299733 122.147,-0.299733 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-0.299733C128.147,-0.299733 134.147,-6.29973 134.147,-12.2997"></path>
-<polyline fill="none" stroke="black" points="134.147,-12.2997 134.147,-63.7003 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-63.7003C134.147,-69.7003 128.147,-75.7003 122.147,-75.7003"></path>
-<text text-anchor="middle" x="67" y="-59" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-42.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-25.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-8.6" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M67,-112.277C67,-104.524 67,-95.2648 67,-85.9799"></path>
-<polygon fill="black" stroke="black" points="70.5001,-85.9648 67,-75.9648 63.5001,-85.9648 70.5001,-85.9648"></polygon>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M134.337,-54.1523C144.84,-51.7376 152,-46.3535 152,-38 152,-32.518 148.916,-28.3148 143.828,-25.3905"></path>
-<polygon fill="black" stroke="black" points="144.93,-22.0659 134.337,-21.8477 142.482,-28.6239 144.93,-22.0659"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-forstatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-forstatement.svg
deleted file mode 100644 (file)
index 376d91b..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-<?xml version="1.0"?>
-<svg width="350pt" height="646pt" viewBox="0.00 0.00 350.00 646.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 642)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="174" cy="-629" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="226.617,-583.3 121.383,-583.3 109.383,-571.3 109.383,-486.7 121.383,-474.7 226.617,-474.7 238.617,-486.7 238.617,-571.3 226.617,-583.3"></polygon>
-<path fill="white" stroke="white" d="M121.383,-583.3C115.383,-583.3 109.383,-577.3 109.383,-571.3"></path>
-<path fill="white" stroke="white" d="M109.383,-486.7C109.383,-480.7 115.383,-474.7 121.383,-474.7"></path>
-<path fill="white" stroke="white" d="M226.617,-474.7C232.617,-474.7 238.617,-480.7 238.617,-486.7"></path>
-<path fill="white" stroke="white" d="M238.617,-571.3C238.617,-577.3 232.617,-583.3 226.617,-583.3"></path>
-<polyline fill="none" stroke="black" points="226.617,-583.3 121.383,-583.3 "></polyline>
-<path fill="none" stroke="black" d="M121.383,-583.3C115.383,-583.3 109.383,-577.3 109.383,-571.3"></path>
-<polyline fill="none" stroke="black" points="109.383,-571.3 109.383,-486.7 "></polyline>
-<path fill="none" stroke="black" d="M109.383,-486.7C109.383,-480.7 115.383,-474.7 121.383,-474.7"></path>
-<polyline fill="none" stroke="black" points="121.383,-474.7 226.617,-474.7 "></polyline>
-<path fill="none" stroke="black" d="M226.617,-474.7C232.617,-474.7 238.617,-480.7 238.617,-486.7"></path>
-<polyline fill="none" stroke="black" points="238.617,-486.7 238.617,-571.3 "></polyline>
-<path fill="none" stroke="black" d="M238.617,-571.3C238.617,-577.3 232.617,-583.3 226.617,-583.3"></path>
-<text text-anchor="middle" x="174" y="-566.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="174" y="-550" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="174" y="-533.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="174" y="-516.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="174" y="-499.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="174" y="-482.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M174,-619.98C174,-613.675 174,-604.238 174,-593.813"></path>
-<polygon fill="black" stroke="black" points="177.5,-593.586 174,-583.586 170.5,-593.586 177.5,-593.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="58" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="58" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="220.233,-438.401 127.767,-438.401 115.767,-426.401 115.767,-391.599 127.767,-379.599 220.233,-379.599 232.233,-391.599 232.233,-426.401 220.233,-438.401"></polygon>
-<path fill="white" stroke="white" d="M127.767,-438.401C121.767,-438.401 115.767,-432.401 115.767,-426.401"></path>
-<path fill="white" stroke="white" d="M115.767,-391.599C115.767,-385.599 121.767,-379.599 127.767,-379.599"></path>
-<path fill="white" stroke="white" d="M220.233,-379.599C226.233,-379.599 232.233,-385.599 232.233,-391.599"></path>
-<path fill="white" stroke="white" d="M232.233,-426.401C232.233,-432.401 226.233,-438.401 220.233,-438.401"></path>
-<polyline fill="none" stroke="black" points="220.233,-438.401 127.767,-438.401 "></polyline>
-<path fill="none" stroke="black" d="M127.767,-438.401C121.767,-438.401 115.767,-432.401 115.767,-426.401"></path>
-<polyline fill="none" stroke="black" points="115.767,-426.401 115.767,-391.599 "></polyline>
-<path fill="none" stroke="black" d="M115.767,-391.599C115.767,-385.599 121.767,-379.599 127.767,-379.599"></path>
-<polyline fill="none" stroke="black" points="127.767,-379.599 220.233,-379.599 "></polyline>
-<path fill="none" stroke="black" d="M220.233,-379.599C226.233,-379.599 232.233,-385.599 232.233,-391.599"></path>
-<polyline fill="none" stroke="black" points="232.233,-391.599 232.233,-426.401 "></polyline>
-<path fill="none" stroke="black" d="M232.233,-426.401C232.233,-432.401 226.233,-438.401 220.233,-438.401"></path>
-<text text-anchor="middle" x="174" y="-421.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="174" y="-404.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="174" y="-388" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M174,-474.524C174,-465.777 174,-456.867 174,-448.572"></path>
-<polygon fill="black" stroke="black" points="177.5,-448.452 174,-438.452 170.5,-448.452 177.5,-448.452"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="229.147,-343.3 118.853,-343.3 106.853,-331.3 106.853,-246.7 118.853,-234.7 229.147,-234.7 241.147,-246.7 241.147,-331.3 229.147,-343.3"></polygon>
-<path fill="white" stroke="white" d="M118.853,-343.3C112.853,-343.3 106.853,-337.3 106.853,-331.3"></path>
-<path fill="white" stroke="white" d="M106.853,-246.7C106.853,-240.7 112.853,-234.7 118.853,-234.7"></path>
-<path fill="white" stroke="white" d="M229.147,-234.7C235.147,-234.7 241.147,-240.7 241.147,-246.7"></path>
-<path fill="white" stroke="white" d="M241.147,-331.3C241.147,-337.3 235.147,-343.3 229.147,-343.3"></path>
-<polyline fill="none" stroke="black" points="229.147,-343.3 118.853,-343.3 "></polyline>
-<path fill="none" stroke="black" d="M118.853,-343.3C112.853,-343.3 106.853,-337.3 106.853,-331.3"></path>
-<polyline fill="none" stroke="black" points="106.853,-331.3 106.853,-246.7 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-246.7C106.853,-240.7 112.853,-234.7 118.853,-234.7"></path>
-<polyline fill="none" stroke="black" points="118.853,-234.7 229.147,-234.7 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-234.7C235.147,-234.7 241.147,-240.7 241.147,-246.7"></path>
-<polyline fill="none" stroke="black" points="241.147,-246.7 241.147,-331.3 "></polyline>
-<path fill="none" stroke="black" d="M241.147,-331.3C241.147,-337.3 235.147,-343.3 229.147,-343.3"></path>
-<text text-anchor="middle" x="174" y="-326.8" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="174" y="-310" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="174" y="-293.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="174" y="-276.4" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="174" y="-259.6" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="174" y="-242.8" font-family="Times,serif" font-size="14.00">Identifier (b)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M174,-379.736C174,-371.725 174,-362.664 174,-353.458"></path>
-<polygon fill="black" stroke="black" points="177.5,-353.454 174,-343.454 170.5,-353.454 177.5,-353.454"></polygon>
-</g>
-
-<g id="node9" class="node"><title>s1_8</title>
-<polygon fill="white" stroke="white" points="104.239,-103.602 11.761,-103.602 -0.239018,-91.6019 -0.239018,-74.3981 11.761,-62.3981 104.239,-62.3981 116.239,-74.3981 116.239,-91.6019 104.239,-103.602"></polygon>
-<path fill="white" stroke="white" d="M11.761,-103.602C5.76098,-103.602 -0.239018,-97.6019 -0.239018,-91.6019"></path>
-<path fill="white" stroke="white" d="M-0.239018,-74.3981C-0.239018,-68.3981 5.76098,-62.3981 11.761,-62.3981"></path>
-<path fill="white" stroke="white" d="M104.239,-62.3981C110.239,-62.3981 116.239,-68.3981 116.239,-74.3981"></path>
-<path fill="white" stroke="white" d="M116.239,-91.6019C116.239,-97.6019 110.239,-103.602 104.239,-103.602"></path>
-<polyline fill="none" stroke="black" points="104.239,-103.602 11.761,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M11.761,-103.602C5.76098,-103.602 -0.239018,-97.6019 -0.239018,-91.6019"></path>
-<polyline fill="none" stroke="black" points="-0.239018,-91.6019 -0.239018,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M-0.239018,-74.3981C-0.239018,-68.3981 5.76098,-62.3981 11.761,-62.3981"></path>
-<polyline fill="none" stroke="black" points="11.761,-62.3981 104.239,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M104.239,-62.3981C110.239,-62.3981 116.239,-68.3981 116.239,-74.3981"></path>
-<polyline fill="none" stroke="black" points="116.239,-74.3981 116.239,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M116.239,-91.6019C116.239,-97.6019 110.239,-103.602 104.239,-103.602"></path>
-<text text-anchor="middle" x="58" y="-87.2" font-family="Times,serif" font-size="14.00">ForStatement:exit</text>
-<text text-anchor="middle" x="58" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge9" class="edge"><title>s1_2-&gt;s1_8</title>
-<path fill="none" stroke="black" d="M133.184,-379.539C120.713,-369.392 107.737,-357.181 98,-344 56.1121,-287.297 50.0603,-267.081 36,-198 30.8588,-172.74 31.2034,-165.328 36,-140 37.7044,-131.001 40.8223,-121.596 44.1855,-113.12"></path>
-<polygon fill="black" stroke="black" points="47.5078,-114.249 48.1762,-103.676 41.0598,-111.525 47.5078,-114.249"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_5</title>
-<polygon fill="white" stroke="white" points="138.572,-189.602 57.4276,-189.602 45.4276,-177.602 45.4276,-160.398 57.4276,-148.398 138.572,-148.398 150.572,-160.398 150.572,-177.602 138.572,-189.602"></polygon>
-<path fill="white" stroke="white" d="M57.4276,-189.602C51.4276,-189.602 45.4276,-183.602 45.4276,-177.602"></path>
-<path fill="white" stroke="white" d="M45.4276,-160.398C45.4276,-154.398 51.4276,-148.398 57.4276,-148.398"></path>
-<path fill="white" stroke="white" d="M138.572,-148.398C144.572,-148.398 150.572,-154.398 150.572,-160.398"></path>
-<path fill="white" stroke="white" d="M150.572,-177.602C150.572,-183.602 144.572,-189.602 138.572,-189.602"></path>
-<polyline fill="none" stroke="black" points="138.572,-189.602 57.4276,-189.602 "></polyline>
-<path fill="none" stroke="black" d="M57.4276,-189.602C51.4276,-189.602 45.4276,-183.602 45.4276,-177.602"></path>
-<polyline fill="none" stroke="black" points="45.4276,-177.602 45.4276,-160.398 "></polyline>
-<path fill="none" stroke="black" d="M45.4276,-160.398C45.4276,-154.398 51.4276,-148.398 57.4276,-148.398"></path>
-<polyline fill="none" stroke="black" points="57.4276,-148.398 138.572,-148.398 "></polyline>
-<path fill="none" stroke="black" d="M138.572,-148.398C144.572,-148.398 150.572,-154.398 150.572,-160.398"></path>
-<polyline fill="none" stroke="black" points="150.572,-160.398 150.572,-177.602 "></polyline>
-<path fill="none" stroke="black" d="M150.572,-177.602C150.572,-183.602 144.572,-189.602 138.572,-189.602"></path>
-<text text-anchor="middle" x="98" y="-173.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="98" y="-156.4" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M139.558,-234.524C131.519,-222.042 123.266,-209.228 116.254,-198.342"></path>
-<polygon fill="black" stroke="black" points="119.046,-196.213 110.689,-189.701 113.161,-200.003 119.046,-196.213"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_7</title>
-<polygon fill="white" stroke="white" points="291.147,-198.401 180.853,-198.401 168.853,-186.401 168.853,-151.599 180.853,-139.599 291.147,-139.599 303.147,-151.599 303.147,-186.401 291.147,-198.401"></polygon>
-<path fill="white" stroke="white" d="M180.853,-198.401C174.853,-198.401 168.853,-192.401 168.853,-186.401"></path>
-<path fill="white" stroke="white" d="M168.853,-151.599C168.853,-145.599 174.853,-139.599 180.853,-139.599"></path>
-<path fill="white" stroke="white" d="M291.147,-139.599C297.147,-139.599 303.147,-145.599 303.147,-151.599"></path>
-<path fill="white" stroke="white" d="M303.147,-186.401C303.147,-192.401 297.147,-198.401 291.147,-198.401"></path>
-<polyline fill="none" stroke="black" points="291.147,-198.401 180.853,-198.401 "></polyline>
-<path fill="none" stroke="black" d="M180.853,-198.401C174.853,-198.401 168.853,-192.401 168.853,-186.401"></path>
-<polyline fill="none" stroke="black" points="168.853,-186.401 168.853,-151.599 "></polyline>
-<path fill="none" stroke="black" d="M168.853,-151.599C168.853,-145.599 174.853,-139.599 180.853,-139.599"></path>
-<polyline fill="none" stroke="black" points="180.853,-139.599 291.147,-139.599 "></polyline>
-<path fill="none" stroke="black" d="M291.147,-139.599C297.147,-139.599 303.147,-145.599 303.147,-151.599"></path>
-<polyline fill="none" stroke="black" points="303.147,-151.599 303.147,-186.401 "></polyline>
-<path fill="none" stroke="black" d="M303.147,-186.401C303.147,-192.401 297.147,-198.401 291.147,-198.401"></path>
-<text text-anchor="middle" x="236" y="-181.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="236" y="-164.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="236" y="-148" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge11" class="edge"><title>s1_3-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M202.098,-234.524C206.898,-225.389 211.791,-216.075 216.313,-207.47"></path>
-<polygon fill="black" stroke="black" points="219.498,-208.932 221.051,-198.452 213.301,-205.676 219.498,-208.932"></polygon>
-</g>
-
-<g id="edge13" class="edge"><title>s1_5-&gt;s1_8</title>
-<path fill="none" stroke="black" d="M88.5206,-148.093C83.5391,-137.632 77.3402,-124.615 71.833,-113.049"></path>
-<polygon fill="black" stroke="black" points="74.8708,-111.288 67.4114,-103.764 68.5508,-114.297 74.8708,-111.288"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="329.977,-103.602 236.023,-103.602 224.023,-91.6019 224.023,-74.3981 236.023,-62.3981 329.977,-62.3981 341.977,-74.3981 341.977,-91.6019 329.977,-103.602"></polygon>
-<path fill="white" stroke="white" d="M236.023,-103.602C230.023,-103.602 224.023,-97.6019 224.023,-91.6019"></path>
-<path fill="white" stroke="white" d="M224.023,-74.3981C224.023,-68.3981 230.023,-62.3981 236.023,-62.3981"></path>
-<path fill="white" stroke="white" d="M329.977,-62.3981C335.977,-62.3981 341.977,-68.3981 341.977,-74.3981"></path>
-<path fill="white" stroke="white" d="M341.977,-91.6019C341.977,-97.6019 335.977,-103.602 329.977,-103.602"></path>
-<polyline fill="none" stroke="black" points="329.977,-103.602 236.023,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M236.023,-103.602C230.023,-103.602 224.023,-97.6019 224.023,-91.6019"></path>
-<polyline fill="none" stroke="black" points="224.023,-91.6019 224.023,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M224.023,-74.3981C224.023,-68.3981 230.023,-62.3981 236.023,-62.3981"></path>
-<polyline fill="none" stroke="black" points="236.023,-62.3981 329.977,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M329.977,-62.3981C335.977,-62.3981 341.977,-68.3981 341.977,-74.3981"></path>
-<polyline fill="none" stroke="black" points="341.977,-74.3981 341.977,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M341.977,-91.6019C341.977,-97.6019 335.977,-103.602 329.977,-103.602"></path>
-<text text-anchor="middle" x="283" y="-87.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="283" y="-70.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_7-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M251.912,-139.561C256.814,-130.801 262.209,-121.158 267.109,-112.4"></path>
-<polygon fill="black" stroke="black" points="270.167,-114.104 271.995,-103.668 264.058,-110.686 270.167,-114.104"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M296.225,-103.814C302.324,-114.132 308.891,-127.235 312,-140 318.1,-165.046 317.141,-172.74 312,-198 297.94,-267.081 291.888,-287.297 250,-344 242.317,-354.4 232.617,-364.197 222.74,-372.853"></path>
-<polygon fill="black" stroke="black" points="220.202,-370.415 214.816,-379.539 224.716,-375.765 220.202,-370.415"></polygon>
-</g>
-
-<g id="edge14" class="edge"><title>s1_8-&gt;final</title>
-<path fill="none" stroke="black" d="M58,-62.3316C58,-54.2587 58,-44.8663 58,-36.5198"></path>
-<polygon fill="black" stroke="black" points="61.5001,-36.3487 58,-26.3488 54.5001,-36.3488 61.5001,-36.3487"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-hello-world.svg b/eslint/docs/developer-guide/code-path-analysis/example-hello-world.svg
deleted file mode 100644 (file)
index 26c4038..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-<svg width="146pt" height="250pt" viewBox="0.00 0.00 146.00 250.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 246)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="69" cy="-233" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="126.042,-187.601 11.9578,-187.601 -0.0421557,-175.601 -0.0421557,-74.3994 11.9578,-62.3994 126.042,-62.3994 138.042,-74.3994 138.042,-175.601 126.042,-187.601"></polygon>
-<path fill="white" stroke="white" d="M11.9578,-187.601C5.95784,-187.601 -0.0421557,-181.601 -0.0421557,-175.601"></path>
-<path fill="white" stroke="white" d="M-0.0421557,-74.3994C-0.0421557,-68.3994 5.95784,-62.3994 11.9578,-62.3994"></path>
-<path fill="white" stroke="white" d="M126.042,-62.3994C132.042,-62.3994 138.042,-68.3994 138.042,-74.3994"></path>
-<path fill="white" stroke="white" d="M138.042,-175.601C138.042,-181.601 132.042,-187.601 126.042,-187.601"></path>
-<polyline fill="none" stroke="black" points="126.042,-187.601 11.9578,-187.601 "></polyline>
-<path fill="none" stroke="black" d="M11.9578,-187.601C5.95784,-187.601 -0.0421557,-181.601 -0.0421557,-175.601"></path>
-<polyline fill="none" stroke="black" points="-0.0421557,-175.601 -0.0421557,-74.3994 "></polyline>
-<path fill="none" stroke="black" d="M-0.0421557,-74.3994C-0.0421557,-68.3994 5.95784,-62.3994 11.9578,-62.3994"></path>
-<polyline fill="none" stroke="black" points="11.9578,-62.3994 126.042,-62.3994 "></polyline>
-<path fill="none" stroke="black" d="M126.042,-62.3994C132.042,-62.3994 138.042,-68.3994 138.042,-74.3994"></path>
-<polyline fill="none" stroke="black" points="138.042,-74.3994 138.042,-175.601 "></polyline>
-<path fill="none" stroke="black" d="M138.042,-175.601C138.042,-181.601 132.042,-187.601 126.042,-187.601"></path>
-<text text-anchor="middle" x="69" y="-171.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="69" y="-154.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="69" y="-137.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="69" y="-120.8" font-family="Times,serif" font-size="14.00">MemberExpression</text>
-<text text-anchor="middle" x="69" y="-104" font-family="Times,serif" font-size="14.00">Identifier (console)</text>
-<text text-anchor="middle" x="69" y="-87.2" font-family="Times,serif" font-size="14.00">Identifier (log)</text>
-<text text-anchor="middle" x="69" y="-70.4" font-family="Times,serif" font-size="14.00">Literal (Hello world!)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M69,-223.682C69,-217.432 69,-208.196 69,-197.86"></path>
-<polygon fill="black" stroke="black" points="72.5001,-197.675 69,-187.675 65.5001,-197.675 72.5001,-197.675"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="69" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="69" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;final</title>
-<path fill="none" stroke="black" d="M69,-62.2476C69,-53.0345 69,-44.0781 69,-36.4335"></path>
-<polygon fill="black" stroke="black" points="72.5001,-36.2949 69,-26.2949 65.5001,-36.2949 72.5001,-36.2949"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg b/eslint/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg
deleted file mode 100644 (file)
index 88c2b6e..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0"?>
-<svg width="371pt" height="562pt" viewBox="0.00 0.00 371.00 562.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 558)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-545" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="145.339,-500.401 82.6614,-500.401 70.6614,-488.401 70.6614,-453.599 82.6614,-441.599 145.339,-441.599 157.339,-453.599 157.339,-488.401 145.339,-500.401"></polygon>
-<path fill="white" stroke="white" d="M82.6614,-500.401C76.6614,-500.401 70.6614,-494.401 70.6614,-488.401"></path>
-<path fill="white" stroke="white" d="M70.6614,-453.599C70.6614,-447.599 76.6614,-441.599 82.6614,-441.599"></path>
-<path fill="white" stroke="white" d="M145.339,-441.599C151.339,-441.599 157.339,-447.599 157.339,-453.599"></path>
-<path fill="white" stroke="white" d="M157.339,-488.401C157.339,-494.401 151.339,-500.401 145.339,-500.401"></path>
-<polyline fill="none" stroke="black" points="145.339,-500.401 82.6614,-500.401 "></polyline>
-<path fill="none" stroke="black" d="M82.6614,-500.401C76.6614,-500.401 70.6614,-494.401 70.6614,-488.401"></path>
-<polyline fill="none" stroke="black" points="70.6614,-488.401 70.6614,-453.599 "></polyline>
-<path fill="none" stroke="black" d="M70.6614,-453.599C70.6614,-447.599 76.6614,-441.599 82.6614,-441.599"></path>
-<polyline fill="none" stroke="black" points="82.6614,-441.599 145.339,-441.599 "></polyline>
-<path fill="none" stroke="black" d="M145.339,-441.599C151.339,-441.599 157.339,-447.599 157.339,-453.599"></path>
-<polyline fill="none" stroke="black" points="157.339,-453.599 157.339,-488.401 "></polyline>
-<path fill="none" stroke="black" d="M157.339,-488.401C157.339,-494.401 151.339,-500.401 145.339,-500.401"></path>
-<text text-anchor="middle" x="114" y="-483.6" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="114" y="-466.8" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="114" y="-450" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M114,-535.741C114,-529.393 114,-520.126 114,-510.615"></path>
-<polygon fill="black" stroke="black" points="117.5,-510.324 114,-500.324 110.5,-510.324 117.5,-510.324"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="181" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="181" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="122.147,-215.7 11.8526,-215.7 -0.147372,-203.7 -0.147372,-152.3 11.8526,-140.3 122.147,-140.3 134.147,-152.3 134.147,-203.7 122.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-215.7C5.85263,-215.7 -0.147372,-209.7 -0.147372,-203.7"></path>
-<path fill="white" stroke="white" d="M-0.147372,-152.3C-0.147372,-146.3 5.85263,-140.3 11.8526,-140.3"></path>
-<path fill="white" stroke="white" d="M122.147,-140.3C128.147,-140.3 134.147,-146.3 134.147,-152.3"></path>
-<path fill="white" stroke="white" d="M134.147,-203.7C134.147,-209.7 128.147,-215.7 122.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="122.147,-215.7 11.8526,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-215.7C5.85263,-215.7 -0.147372,-209.7 -0.147372,-203.7"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-203.7 -0.147372,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-152.3C-0.147372,-146.3 5.85263,-140.3 11.8526,-140.3"></path>
-<polyline fill="none" stroke="black" points="11.8526,-140.3 122.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-140.3C128.147,-140.3 134.147,-146.3 134.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="134.147,-152.3 134.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-203.7C134.147,-209.7 128.147,-215.7 122.147,-215.7"></path>
-<text text-anchor="middle" x="67" y="-199" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-182.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-165.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-148.6" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M107.798,-441.544C101.706,-412.948 92.4152,-367.562 86,-328 80.4738,-293.921 75.5819,-255.241 72.1462,-225.832"></path>
-<polygon fill="black" stroke="black" points="75.6165,-225.373 70.993,-215.84 68.6626,-226.175 75.6165,-225.373"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="193.429,-405.602 130.571,-405.602 118.571,-393.602 118.571,-376.398 130.571,-364.398 193.429,-364.398 205.429,-376.398 205.429,-393.602 193.429,-405.602"></polygon>
-<path fill="white" stroke="white" d="M130.571,-405.602C124.571,-405.602 118.571,-399.602 118.571,-393.602"></path>
-<path fill="white" stroke="white" d="M118.571,-376.398C118.571,-370.398 124.571,-364.398 130.571,-364.398"></path>
-<path fill="white" stroke="white" d="M193.429,-364.398C199.429,-364.398 205.429,-370.398 205.429,-376.398"></path>
-<path fill="white" stroke="white" d="M205.429,-393.602C205.429,-399.602 199.429,-405.602 193.429,-405.602"></path>
-<polyline fill="none" stroke="black" points="193.429,-405.602 130.571,-405.602 "></polyline>
-<path fill="none" stroke="black" d="M130.571,-405.602C124.571,-405.602 118.571,-399.602 118.571,-393.602"></path>
-<polyline fill="none" stroke="black" points="118.571,-393.602 118.571,-376.398 "></polyline>
-<path fill="none" stroke="black" d="M118.571,-376.398C118.571,-370.398 124.571,-364.398 130.571,-364.398"></path>
-<polyline fill="none" stroke="black" points="130.571,-364.398 193.429,-364.398 "></polyline>
-<path fill="none" stroke="black" d="M193.429,-364.398C199.429,-364.398 205.429,-370.398 205.429,-376.398"></path>
-<polyline fill="none" stroke="black" points="205.429,-376.398 205.429,-393.602 "></polyline>
-<path fill="none" stroke="black" d="M205.429,-393.602C205.429,-399.602 199.429,-405.602 193.429,-405.602"></path>
-<text text-anchor="middle" x="162" y="-389.2" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="162" y="-372.4" font-family="Times,serif" font-size="14.00">Identifier (b)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_1-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M130.251,-441.561C135.257,-432.801 140.767,-423.158 145.771,-414.4"></path>
-<polygon fill="black" stroke="black" points="148.839,-416.087 150.761,-405.668 142.761,-412.614 148.839,-416.087"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_9</title>
-<polygon fill="white" stroke="white" points="222.147,-103.602 139.853,-103.602 127.853,-91.6019 127.853,-74.3981 139.853,-62.3981 222.147,-62.3981 234.147,-74.3981 234.147,-91.6019 222.147,-103.602"></polygon>
-<path fill="white" stroke="white" d="M139.853,-103.602C133.853,-103.602 127.853,-97.6019 127.853,-91.6019"></path>
-<path fill="white" stroke="white" d="M127.853,-74.3981C127.853,-68.3981 133.853,-62.3981 139.853,-62.3981"></path>
-<path fill="white" stroke="white" d="M222.147,-62.3981C228.147,-62.3981 234.147,-68.3981 234.147,-74.3981"></path>
-<path fill="white" stroke="white" d="M234.147,-91.6019C234.147,-97.6019 228.147,-103.602 222.147,-103.602"></path>
-<polyline fill="none" stroke="black" points="222.147,-103.602 139.853,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M139.853,-103.602C133.853,-103.602 127.853,-97.6019 127.853,-91.6019"></path>
-<polyline fill="none" stroke="black" points="127.853,-91.6019 127.853,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M127.853,-74.3981C127.853,-68.3981 133.853,-62.3981 139.853,-62.3981"></path>
-<polyline fill="none" stroke="black" points="139.853,-62.3981 222.147,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M222.147,-62.3981C228.147,-62.3981 234.147,-68.3981 234.147,-74.3981"></path>
-<polyline fill="none" stroke="black" points="234.147,-74.3981 234.147,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M234.147,-91.6019C234.147,-97.6019 228.147,-103.602 222.147,-103.602"></path>
-<text text-anchor="middle" x="181" y="-87.2" font-family="Times,serif" font-size="14.00">IfStatement:exit</text>
-<text text-anchor="middle" x="181" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M112.056,-140.244C124.376,-130.194 137.475,-119.507 148.909,-110.179"></path>
-<polygon fill="black" stroke="black" points="151.37,-112.689 156.906,-103.655 146.945,-107.265 151.37,-112.689"></polygon>
-</g>
-
-<g id="edge15" class="edge"><title>s1_9-&gt;final</title>
-<path fill="none" stroke="black" d="M181,-62.3316C181,-54.2587 181,-44.8663 181,-36.5198"></path>
-<polygon fill="black" stroke="black" points="184.5,-36.3487 181,-26.3488 177.5,-36.3488 184.5,-36.3487"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="217.147,-327.7 106.853,-327.7 94.8526,-315.7 94.8526,-264.3 106.853,-252.3 217.147,-252.3 229.147,-264.3 229.147,-315.7 217.147,-327.7"></polygon>
-<path fill="white" stroke="white" d="M106.853,-327.7C100.853,-327.7 94.8526,-321.7 94.8526,-315.7"></path>
-<path fill="white" stroke="white" d="M94.8526,-264.3C94.8526,-258.3 100.853,-252.3 106.853,-252.3"></path>
-<path fill="white" stroke="white" d="M217.147,-252.3C223.147,-252.3 229.147,-258.3 229.147,-264.3"></path>
-<path fill="white" stroke="white" d="M229.147,-315.7C229.147,-321.7 223.147,-327.7 217.147,-327.7"></path>
-<polyline fill="none" stroke="black" points="217.147,-327.7 106.853,-327.7 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-327.7C100.853,-327.7 94.8526,-321.7 94.8526,-315.7"></path>
-<polyline fill="none" stroke="black" points="94.8526,-315.7 94.8526,-264.3 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-264.3C94.8526,-258.3 100.853,-252.3 106.853,-252.3"></path>
-<polyline fill="none" stroke="black" points="106.853,-252.3 217.147,-252.3 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-252.3C223.147,-252.3 229.147,-258.3 229.147,-264.3"></path>
-<polyline fill="none" stroke="black" points="229.147,-264.3 229.147,-315.7 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-315.7C229.147,-321.7 223.147,-327.7 217.147,-327.7"></path>
-<text text-anchor="middle" x="162" y="-311" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="162" y="-294.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-277.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-260.6" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M162,-364.277C162,-356.524 162,-347.265 162,-337.98"></path>
-<polygon fill="black" stroke="black" points="165.5,-337.965 162,-327.965 158.5,-337.965 165.5,-337.965"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_5</title>
-<polygon fill="white" stroke="white" points="322.339,-310.602 259.661,-310.602 247.661,-298.602 247.661,-281.398 259.661,-269.398 322.339,-269.398 334.339,-281.398 334.339,-298.602 322.339,-310.602"></polygon>
-<path fill="white" stroke="white" d="M259.661,-310.602C253.661,-310.602 247.661,-304.602 247.661,-298.602"></path>
-<path fill="white" stroke="white" d="M247.661,-281.398C247.661,-275.398 253.661,-269.398 259.661,-269.398"></path>
-<path fill="white" stroke="white" d="M322.339,-269.398C328.339,-269.398 334.339,-275.398 334.339,-281.398"></path>
-<path fill="white" stroke="white" d="M334.339,-298.602C334.339,-304.602 328.339,-310.602 322.339,-310.602"></path>
-<polyline fill="none" stroke="black" points="322.339,-310.602 259.661,-310.602 "></polyline>
-<path fill="none" stroke="black" d="M259.661,-310.602C253.661,-310.602 247.661,-304.602 247.661,-298.602"></path>
-<polyline fill="none" stroke="black" points="247.661,-298.602 247.661,-281.398 "></polyline>
-<path fill="none" stroke="black" d="M247.661,-281.398C247.661,-275.398 253.661,-269.398 259.661,-269.398"></path>
-<polyline fill="none" stroke="black" points="259.661,-269.398 322.339,-269.398 "></polyline>
-<path fill="none" stroke="black" d="M322.339,-269.398C328.339,-269.398 334.339,-275.398 334.339,-281.398"></path>
-<polyline fill="none" stroke="black" points="334.339,-281.398 334.339,-298.602 "></polyline>
-<path fill="none" stroke="black" d="M334.339,-298.602C334.339,-304.602 328.339,-310.602 322.339,-310.602"></path>
-<text text-anchor="middle" x="291" y="-294.2" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="291" y="-277.4" font-family="Times,serif" font-size="14.00">Identifier (c)</text>
-</g>
-
-<g id="edge10" class="edge"><title>s1_3-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M189.358,-364.277C208.598,-350.406 234.528,-331.712 255.382,-316.678"></path>
-<polygon fill="black" stroke="black" points="257.617,-319.382 263.682,-310.694 253.523,-313.703 257.617,-319.382"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M165.397,-252.35C169.069,-212.728 174.851,-150.341 178.25,-113.673"></path>
-<polygon fill="black" stroke="black" points="181.744,-113.893 179.182,-103.613 174.774,-113.247 181.744,-113.893"></polygon>
-</g>
-
-<g id="edge14" class="edge"><title>s1_5-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M266.084,-269.392C250.495,-255.908 231.136,-236.742 219,-216 200.205,-183.878 190.203,-141.864 185.259,-113.957"></path>
-<polygon fill="black" stroke="black" points="188.697,-113.293 183.604,-104.002 181.791,-114.441 188.697,-113.293"></polygon>
-</g>
-
-<g id="node9" class="node"><title>s1_6</title>
-<polygon fill="white" stroke="white" points="350.147,-215.7 239.853,-215.7 227.853,-203.7 227.853,-152.3 239.853,-140.3 350.147,-140.3 362.147,-152.3 362.147,-203.7 350.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M239.853,-215.7C233.853,-215.7 227.853,-209.7 227.853,-203.7"></path>
-<path fill="white" stroke="white" d="M227.853,-152.3C227.853,-146.3 233.853,-140.3 239.853,-140.3"></path>
-<path fill="white" stroke="white" d="M350.147,-140.3C356.147,-140.3 362.147,-146.3 362.147,-152.3"></path>
-<path fill="white" stroke="white" d="M362.147,-203.7C362.147,-209.7 356.147,-215.7 350.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="350.147,-215.7 239.853,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M239.853,-215.7C233.853,-215.7 227.853,-209.7 227.853,-203.7"></path>
-<polyline fill="none" stroke="black" points="227.853,-203.7 227.853,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M227.853,-152.3C227.853,-146.3 233.853,-140.3 239.853,-140.3"></path>
-<polyline fill="none" stroke="black" points="239.853,-140.3 350.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M350.147,-140.3C356.147,-140.3 362.147,-146.3 362.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="362.147,-152.3 362.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M362.147,-203.7C362.147,-209.7 356.147,-215.7 350.147,-215.7"></path>
-<text text-anchor="middle" x="295" y="-199" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="295" y="-182.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="295" y="-165.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="295" y="-148.6" font-family="Times,serif" font-size="14.00">Identifier (hoge)</text>
-</g>
-
-<g id="edge11" class="edge"><title>s1_5-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M291.715,-269.334C292.153,-257.284 292.734,-241.309 293.286,-226.147"></path>
-<polygon fill="black" stroke="black" points="296.795,-225.959 293.66,-215.839 289.799,-225.705 296.795,-225.959"></polygon>
-</g>
-
-<g id="edge12" class="edge"><title>s1_6-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M249.944,-140.244C237.624,-130.194 224.525,-119.507 213.091,-110.179"></path>
-<polygon fill="black" stroke="black" points="215.055,-107.265 205.094,-103.655 210.63,-112.689 215.055,-107.265"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-ifstatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-ifstatement.svg
deleted file mode 100644 (file)
index 7ea670a..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0"?>
-<svg width="294pt" height="372pt" viewBox="0.00 0.00 294.00 372.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 368)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="143" cy="-355" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="174.339,-310.401 111.661,-310.401 99.6614,-298.401 99.6614,-263.599 111.661,-251.599 174.339,-251.599 186.339,-263.599 186.339,-298.401 174.339,-310.401"></polygon>
-<path fill="white" stroke="white" d="M111.661,-310.401C105.661,-310.401 99.6614,-304.401 99.6614,-298.401"></path>
-<path fill="white" stroke="white" d="M99.6614,-263.599C99.6614,-257.599 105.661,-251.599 111.661,-251.599"></path>
-<path fill="white" stroke="white" d="M174.339,-251.599C180.339,-251.599 186.339,-257.599 186.339,-263.599"></path>
-<path fill="white" stroke="white" d="M186.339,-298.401C186.339,-304.401 180.339,-310.401 174.339,-310.401"></path>
-<polyline fill="none" stroke="black" points="174.339,-310.401 111.661,-310.401 "></polyline>
-<path fill="none" stroke="black" d="M111.661,-310.401C105.661,-310.401 99.6614,-304.401 99.6614,-298.401"></path>
-<polyline fill="none" stroke="black" points="99.6614,-298.401 99.6614,-263.599 "></polyline>
-<path fill="none" stroke="black" d="M99.6614,-263.599C99.6614,-257.599 105.661,-251.599 111.661,-251.599"></path>
-<polyline fill="none" stroke="black" points="111.661,-251.599 174.339,-251.599 "></polyline>
-<path fill="none" stroke="black" d="M174.339,-251.599C180.339,-251.599 186.339,-257.599 186.339,-263.599"></path>
-<polyline fill="none" stroke="black" points="186.339,-263.599 186.339,-298.401 "></polyline>
-<path fill="none" stroke="black" d="M186.339,-298.401C186.339,-304.401 180.339,-310.401 174.339,-310.401"></path>
-<text text-anchor="middle" x="143" y="-293.6" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="143" y="-276.8" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="143" y="-260" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M143,-345.741C143,-339.393 143,-330.126 143,-320.615"></path>
-<polygon fill="black" stroke="black" points="146.5,-320.324 143,-310.324 139.5,-320.324 146.5,-320.324"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="143" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="143" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="122.147,-215.7 11.8526,-215.7 -0.147372,-203.7 -0.147372,-152.3 11.8526,-140.3 122.147,-140.3 134.147,-152.3 134.147,-203.7 122.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-215.7C5.85263,-215.7 -0.147372,-209.7 -0.147372,-203.7"></path>
-<path fill="white" stroke="white" d="M-0.147372,-152.3C-0.147372,-146.3 5.85263,-140.3 11.8526,-140.3"></path>
-<path fill="white" stroke="white" d="M122.147,-140.3C128.147,-140.3 134.147,-146.3 134.147,-152.3"></path>
-<path fill="white" stroke="white" d="M134.147,-203.7C134.147,-209.7 128.147,-215.7 122.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="122.147,-215.7 11.8526,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-215.7C5.85263,-215.7 -0.147372,-209.7 -0.147372,-203.7"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-203.7 -0.147372,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-152.3C-0.147372,-146.3 5.85263,-140.3 11.8526,-140.3"></path>
-<polyline fill="none" stroke="black" points="11.8526,-140.3 122.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-140.3C128.147,-140.3 134.147,-146.3 134.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="134.147,-152.3 134.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-203.7C134.147,-209.7 128.147,-215.7 122.147,-215.7"></path>
-<text text-anchor="middle" x="67" y="-199" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-182.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-165.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-148.6" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M121.628,-251.597C115.176,-243.023 107.927,-233.39 100.871,-224.013"></path>
-<polygon fill="black" stroke="black" points="103.554,-221.757 94.7444,-215.871 97.9604,-225.966 103.554,-221.757"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="274.147,-215.7 163.853,-215.7 151.853,-203.7 151.853,-152.3 163.853,-140.3 274.147,-140.3 286.147,-152.3 286.147,-203.7 274.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M163.853,-215.7C157.853,-215.7 151.853,-209.7 151.853,-203.7"></path>
-<path fill="white" stroke="white" d="M151.853,-152.3C151.853,-146.3 157.853,-140.3 163.853,-140.3"></path>
-<path fill="white" stroke="white" d="M274.147,-140.3C280.147,-140.3 286.147,-146.3 286.147,-152.3"></path>
-<path fill="white" stroke="white" d="M286.147,-203.7C286.147,-209.7 280.147,-215.7 274.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="274.147,-215.7 163.853,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M163.853,-215.7C157.853,-215.7 151.853,-209.7 151.853,-203.7"></path>
-<polyline fill="none" stroke="black" points="151.853,-203.7 151.853,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M151.853,-152.3C151.853,-146.3 157.853,-140.3 163.853,-140.3"></path>
-<polyline fill="none" stroke="black" points="163.853,-140.3 274.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M274.147,-140.3C280.147,-140.3 286.147,-146.3 286.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="286.147,-152.3 286.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M286.147,-203.7C286.147,-209.7 280.147,-215.7 274.147,-215.7"></path>
-<text text-anchor="middle" x="219" y="-199" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="219" y="-182.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="219" y="-165.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="219" y="-148.6" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_1-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M164.372,-251.597C170.824,-243.023 178.073,-233.39 185.129,-224.013"></path>
-<polygon fill="black" stroke="black" points="188.04,-225.966 191.256,-215.871 182.446,-221.757 188.04,-225.966"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="184.147,-103.602 101.853,-103.602 89.8526,-91.6019 89.8526,-74.3981 101.853,-62.3981 184.147,-62.3981 196.147,-74.3981 196.147,-91.6019 184.147,-103.602"></polygon>
-<path fill="white" stroke="white" d="M101.853,-103.602C95.8526,-103.602 89.8526,-97.6019 89.8526,-91.6019"></path>
-<path fill="white" stroke="white" d="M89.8526,-74.3981C89.8526,-68.3981 95.8526,-62.3981 101.853,-62.3981"></path>
-<path fill="white" stroke="white" d="M184.147,-62.3981C190.147,-62.3981 196.147,-68.3981 196.147,-74.3981"></path>
-<path fill="white" stroke="white" d="M196.147,-91.6019C196.147,-97.6019 190.147,-103.602 184.147,-103.602"></path>
-<polyline fill="none" stroke="black" points="184.147,-103.602 101.853,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M101.853,-103.602C95.8526,-103.602 89.8526,-97.6019 89.8526,-91.6019"></path>
-<polyline fill="none" stroke="black" points="89.8526,-91.6019 89.8526,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M89.8526,-74.3981C89.8526,-68.3981 95.8526,-62.3981 101.853,-62.3981"></path>
-<polyline fill="none" stroke="black" points="101.853,-62.3981 184.147,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M184.147,-62.3981C190.147,-62.3981 196.147,-68.3981 196.147,-74.3981"></path>
-<polyline fill="none" stroke="black" points="196.147,-74.3981 196.147,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M196.147,-91.6019C196.147,-97.6019 190.147,-103.602 184.147,-103.602"></path>
-<text text-anchor="middle" x="143" y="-87.2" font-family="Times,serif" font-size="14.00">IfStatement:exit</text>
-<text text-anchor="middle" x="143" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M97.0372,-140.244C104.852,-130.681 113.137,-120.543 120.488,-111.547"></path>
-<polygon fill="black" stroke="black" points="123.32,-113.613 126.938,-103.655 117.899,-109.184 123.32,-113.613"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;final</title>
-<path fill="none" stroke="black" d="M143,-62.3316C143,-54.2587 143,-44.8663 143,-36.5198"></path>
-<polygon fill="black" stroke="black" points="146.5,-36.3487 143,-26.3488 139.5,-36.3488 146.5,-36.3487"></polygon>
-</g>
-
-<g id="edge7" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M188.963,-140.244C181.148,-130.681 172.863,-120.543 165.512,-111.547"></path>
-<polygon fill="black" stroke="black" points="168.101,-109.184 159.062,-103.655 162.68,-113.613 168.101,-109.184"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg b/eslint/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg
deleted file mode 100644 (file)
index 26c45fa..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-<?xml version="1.0"?>
-<svg width="347pt" height="802pt" viewBox="0.00 0.00 347.00 802.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 798)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="121" cy="-785" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="164.156,-740 77.8443,-740 65.8443,-728 65.8443,-660 77.8443,-648 164.156,-648 176.156,-660 176.156,-728 164.156,-740"></polygon>
-<path fill="white" stroke="white" d="M77.8443,-740C71.8443,-740 65.8443,-734 65.8443,-728"></path>
-<path fill="white" stroke="white" d="M65.8443,-660C65.8443,-654 71.8443,-648 77.8443,-648"></path>
-<path fill="white" stroke="white" d="M164.156,-648C170.156,-648 176.156,-654 176.156,-660"></path>
-<path fill="white" stroke="white" d="M176.156,-728C176.156,-734 170.156,-740 164.156,-740"></path>
-<polyline fill="none" stroke="black" points="164.156,-740 77.8443,-740 "></polyline>
-<path fill="none" stroke="black" d="M77.8443,-740C71.8443,-740 65.8443,-734 65.8443,-728"></path>
-<polyline fill="none" stroke="black" points="65.8443,-728 65.8443,-660 "></polyline>
-<path fill="none" stroke="black" d="M65.8443,-660C65.8443,-654 71.8443,-648 77.8443,-648"></path>
-<polyline fill="none" stroke="black" points="77.8443,-648 164.156,-648 "></polyline>
-<path fill="none" stroke="black" d="M164.156,-648C170.156,-648 176.156,-654 176.156,-660"></path>
-<polyline fill="none" stroke="black" points="176.156,-660 176.156,-728 "></polyline>
-<path fill="none" stroke="black" d="M176.156,-728C176.156,-734 170.156,-740 164.156,-740"></path>
-<text text-anchor="middle" x="121" y="-723.4" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="121" y="-706.6" font-family="Times,serif" font-size="14.00">SwitchStatement</text>
-<text text-anchor="middle" x="121" y="-689.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="121" y="-673" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="121" y="-656.2" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M121,-775.787C121,-769.525 121,-760.299 121,-750.297"></path>
-<polygon fill="black" stroke="black" points="124.5,-750.119 121,-740.119 117.5,-750.119 124.5,-750.119"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="162" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="162" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="122.147,-533.7 11.8526,-533.7 -0.147372,-521.7 -0.147372,-470.3 11.8526,-458.3 122.147,-458.3 134.147,-470.3 134.147,-521.7 122.147,-533.7"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-533.7C5.85263,-533.7 -0.147372,-527.7 -0.147372,-521.7"></path>
-<path fill="white" stroke="white" d="M-0.147372,-470.3C-0.147372,-464.3 5.85263,-458.3 11.8526,-458.3"></path>
-<path fill="white" stroke="white" d="M122.147,-458.3C128.147,-458.3 134.147,-464.3 134.147,-470.3"></path>
-<path fill="white" stroke="white" d="M134.147,-521.7C134.147,-527.7 128.147,-533.7 122.147,-533.7"></path>
-<polyline fill="none" stroke="black" points="122.147,-533.7 11.8526,-533.7 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-533.7C5.85263,-533.7 -0.147372,-527.7 -0.147372,-521.7"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-521.7 -0.147372,-470.3 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-470.3C-0.147372,-464.3 5.85263,-458.3 11.8526,-458.3"></path>
-<polyline fill="none" stroke="black" points="11.8526,-458.3 122.147,-458.3 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-458.3C128.147,-458.3 134.147,-464.3 134.147,-470.3"></path>
-<polyline fill="none" stroke="black" points="134.147,-470.3 134.147,-521.7 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-521.7C134.147,-527.7 128.147,-533.7 122.147,-533.7"></path>
-<text text-anchor="middle" x="67" y="-517" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-500.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-483.4" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-466.6" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M108.476,-647.541C99.8727,-616.316 88.4862,-574.987 79.8204,-543.533"></path>
-<polygon fill="black" stroke="black" points="83.14,-542.405 77.1095,-533.694 76.3914,-544.264 83.14,-542.405"></polygon>
-</g>
-
-<g id="node9" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="191.072,-611.602 132.928,-611.602 120.928,-599.602 120.928,-582.398 132.928,-570.398 191.072,-570.398 203.072,-582.398 203.072,-599.602 191.072,-611.602"></polygon>
-<path fill="white" stroke="white" d="M132.928,-611.602C126.928,-611.602 120.928,-605.602 120.928,-599.602"></path>
-<path fill="white" stroke="white" d="M120.928,-582.398C120.928,-576.398 126.928,-570.398 132.928,-570.398"></path>
-<path fill="white" stroke="white" d="M191.072,-570.398C197.072,-570.398 203.072,-576.398 203.072,-582.398"></path>
-<path fill="white" stroke="white" d="M203.072,-599.602C203.072,-605.602 197.072,-611.602 191.072,-611.602"></path>
-<polyline fill="none" stroke="black" points="191.072,-611.602 132.928,-611.602 "></polyline>
-<path fill="none" stroke="black" d="M132.928,-611.602C126.928,-611.602 120.928,-605.602 120.928,-599.602"></path>
-<polyline fill="none" stroke="black" points="120.928,-599.602 120.928,-582.398 "></polyline>
-<path fill="none" stroke="black" d="M120.928,-582.398C120.928,-576.398 126.928,-570.398 132.928,-570.398"></path>
-<polyline fill="none" stroke="black" points="132.928,-570.398 191.072,-570.398 "></polyline>
-<path fill="none" stroke="black" d="M191.072,-570.398C197.072,-570.398 203.072,-576.398 203.072,-582.398"></path>
-<polyline fill="none" stroke="black" points="203.072,-582.398 203.072,-599.602 "></polyline>
-<path fill="none" stroke="black" d="M203.072,-599.602C203.072,-605.602 197.072,-611.602 191.072,-611.602"></path>
-<text text-anchor="middle" x="162" y="-595.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="162" y="-578.4" font-family="Times,serif" font-size="14.00">Literal (1)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_1-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M139.341,-647.817C143.019,-638.757 146.791,-629.466 150.176,-621.128"></path>
-<polygon fill="black" stroke="black" points="153.424,-622.431 153.943,-611.849 146.938,-619.798 153.424,-622.431"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_14</title>
-<polygon fill="white" stroke="white" points="217.321,-103.602 106.679,-103.602 94.6789,-91.6019 94.6789,-74.3981 106.679,-62.3981 217.321,-62.3981 229.321,-74.3981 229.321,-91.6019 217.321,-103.602"></polygon>
-<path fill="white" stroke="white" d="M106.679,-103.602C100.679,-103.602 94.6789,-97.6019 94.6789,-91.6019"></path>
-<path fill="white" stroke="white" d="M94.6789,-74.3981C94.6789,-68.3981 100.679,-62.3981 106.679,-62.3981"></path>
-<path fill="white" stroke="white" d="M217.321,-62.3981C223.321,-62.3981 229.321,-68.3981 229.321,-74.3981"></path>
-<path fill="white" stroke="white" d="M229.321,-91.6019C229.321,-97.6019 223.321,-103.602 217.321,-103.602"></path>
-<polyline fill="none" stroke="black" points="217.321,-103.602 106.679,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M106.679,-103.602C100.679,-103.602 94.6789,-97.6019 94.6789,-91.6019"></path>
-<polyline fill="none" stroke="black" points="94.6789,-91.6019 94.6789,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M94.6789,-74.3981C94.6789,-68.3981 100.679,-62.3981 106.679,-62.3981"></path>
-<polyline fill="none" stroke="black" points="106.679,-62.3981 217.321,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M217.321,-62.3981C223.321,-62.3981 229.321,-68.3981 229.321,-74.3981"></path>
-<polyline fill="none" stroke="black" points="229.321,-74.3981 229.321,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M229.321,-91.6019C229.321,-97.6019 223.321,-103.602 217.321,-103.602"></path>
-<text text-anchor="middle" x="162" y="-87.2" font-family="Times,serif" font-size="14.00">SwitchStatement:exit</text>
-<text text-anchor="middle" x="162" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge11" class="edge"><title>s1_2-&gt;s1_14</title>
-<path fill="none" stroke="black" d="M65.9609,-458.127C65.4872,-409.946 67.6815,-323.315 86,-252 99.1928,-200.639 127.133,-145.406 145.212,-112.816"></path>
-<polygon fill="black" stroke="black" points="148.402,-114.284 150.254,-103.852 142.301,-110.852 148.402,-114.284"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_7</title>
-<polygon fill="white" stroke="white" points="217.147,-422.401 106.853,-422.401 94.8526,-410.401 94.8526,-375.599 106.853,-363.599 217.147,-363.599 229.147,-375.599 229.147,-410.401 217.147,-422.401"></polygon>
-<path fill="white" stroke="white" d="M106.853,-422.401C100.853,-422.401 94.8526,-416.401 94.8526,-410.401"></path>
-<path fill="white" stroke="white" d="M94.8526,-375.599C94.8526,-369.599 100.853,-363.599 106.853,-363.599"></path>
-<path fill="white" stroke="white" d="M217.147,-363.599C223.147,-363.599 229.147,-369.599 229.147,-375.599"></path>
-<path fill="white" stroke="white" d="M229.147,-410.401C229.147,-416.401 223.147,-422.401 217.147,-422.401"></path>
-<polyline fill="none" stroke="black" points="217.147,-422.401 106.853,-422.401 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-422.401C100.853,-422.401 94.8526,-416.401 94.8526,-410.401"></path>
-<polyline fill="none" stroke="black" points="94.8526,-410.401 94.8526,-375.599 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-375.599C94.8526,-369.599 100.853,-363.599 106.853,-363.599"></path>
-<polyline fill="none" stroke="black" points="106.853,-363.599 217.147,-363.599 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-363.599C223.147,-363.599 229.147,-369.599 229.147,-375.599"></path>
-<polyline fill="none" stroke="black" points="229.147,-375.599 229.147,-410.401 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-410.401C229.147,-416.401 223.147,-422.401 217.147,-422.401"></path>
-<text text-anchor="middle" x="162" y="-405.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-388.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-372" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="node6" class="node"><title>s1_9</title>
-<polygon fill="white" stroke="white" points="217.147,-327.7 106.853,-327.7 94.8526,-315.7 94.8526,-264.3 106.853,-252.3 217.147,-252.3 229.147,-264.3 229.147,-315.7 217.147,-327.7"></polygon>
-<path fill="white" stroke="white" d="M106.853,-327.7C100.853,-327.7 94.8526,-321.7 94.8526,-315.7"></path>
-<path fill="white" stroke="white" d="M94.8526,-264.3C94.8526,-258.3 100.853,-252.3 106.853,-252.3"></path>
-<path fill="white" stroke="white" d="M217.147,-252.3C223.147,-252.3 229.147,-258.3 229.147,-264.3"></path>
-<path fill="white" stroke="white" d="M229.147,-315.7C229.147,-321.7 223.147,-327.7 217.147,-327.7"></path>
-<polyline fill="none" stroke="black" points="217.147,-327.7 106.853,-327.7 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-327.7C100.853,-327.7 94.8526,-321.7 94.8526,-315.7"></path>
-<polyline fill="none" stroke="black" points="94.8526,-315.7 94.8526,-264.3 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-264.3C94.8526,-258.3 100.853,-252.3 106.853,-252.3"></path>
-<polyline fill="none" stroke="black" points="106.853,-252.3 217.147,-252.3 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-252.3C223.147,-252.3 229.147,-258.3 229.147,-264.3"></path>
-<polyline fill="none" stroke="black" points="229.147,-264.3 229.147,-315.7 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-315.7C229.147,-321.7 223.147,-327.7 217.147,-327.7"></path>
-<text text-anchor="middle" x="162" y="-311" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-294.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-277.4" font-family="Times,serif" font-size="14.00">Identifier (hoge)</text>
-<text text-anchor="middle" x="162" y="-260.6" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_7-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M162,-363.597C162,-355.629 162,-346.747 162,-338.005"></path>
-<polygon fill="black" stroke="black" points="165.5,-337.871 162,-327.871 158.5,-337.871 165.5,-337.871"></polygon>
-</g>
-
-<g id="edge13" class="edge"><title>s1_9-&gt;s1_14</title>
-<path fill="none" stroke="black" d="M162,-252.35C162,-212.728 162,-150.341 162,-113.673"></path>
-<polygon fill="black" stroke="black" points="165.5,-113.613 162,-103.613 158.5,-113.613 165.5,-113.613"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_12</title>
-<polygon fill="white" stroke="white" points="327.147,-215.7 216.853,-215.7 204.853,-203.7 204.853,-152.3 216.853,-140.3 327.147,-140.3 339.147,-152.3 339.147,-203.7 327.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M216.853,-215.7C210.853,-215.7 204.853,-209.7 204.853,-203.7"></path>
-<path fill="white" stroke="white" d="M204.853,-152.3C204.853,-146.3 210.853,-140.3 216.853,-140.3"></path>
-<path fill="white" stroke="white" d="M327.147,-140.3C333.147,-140.3 339.147,-146.3 339.147,-152.3"></path>
-<path fill="white" stroke="white" d="M339.147,-203.7C339.147,-209.7 333.147,-215.7 327.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="327.147,-215.7 216.853,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M216.853,-215.7C210.853,-215.7 204.853,-209.7 204.853,-203.7"></path>
-<polyline fill="none" stroke="black" points="204.853,-203.7 204.853,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M204.853,-152.3C204.853,-146.3 210.853,-140.3 216.853,-140.3"></path>
-<polyline fill="none" stroke="black" points="216.853,-140.3 327.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M327.147,-140.3C333.147,-140.3 339.147,-146.3 339.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="339.147,-152.3 339.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M339.147,-203.7C339.147,-209.7 333.147,-215.7 327.147,-215.7"></path>
-<text text-anchor="middle" x="272" y="-199" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="272" y="-182.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="272" y="-165.4" font-family="Times,serif" font-size="14.00">Identifier (fuga)</text>
-<text text-anchor="middle" x="272" y="-148.6" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge15" class="edge"><title>s1_12-&gt;s1_14</title>
-<path fill="none" stroke="black" d="M228.525,-140.244C216.638,-130.194 203.998,-119.507 192.965,-110.179"></path>
-<polygon fill="black" stroke="black" points="195.145,-107.439 185.248,-103.655 190.625,-112.785 195.145,-107.439"></polygon>
-</g>
-
-<g id="edge25" class="edge"><title>s1_14-&gt;final</title>
-<path fill="none" stroke="black" d="M162,-62.3316C162,-54.2587 162,-44.8663 162,-36.5198"></path>
-<polygon fill="black" stroke="black" points="165.5,-36.3487 162,-26.3488 158.5,-36.3488 165.5,-36.3487"></polygon>
-</g>
-
-<g id="edge17" class="edge"><title>s1_4-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M162,-570.128C162,-537.987 162,-474.03 162,-432.674"></path>
-<polygon fill="black" stroke="black" points="165.5,-432.424 162,-422.424 158.5,-432.424 165.5,-432.424"></polygon>
-</g>
-
-<g id="node10" class="node"><title>s1_6</title>
-<polygon fill="white" stroke="white" points="260.072,-516.602 201.928,-516.602 189.928,-504.602 189.928,-487.398 201.928,-475.398 260.072,-475.398 272.072,-487.398 272.072,-504.602 260.072,-516.602"></polygon>
-<path fill="white" stroke="white" d="M201.928,-516.602C195.928,-516.602 189.928,-510.602 189.928,-504.602"></path>
-<path fill="white" stroke="white" d="M189.928,-487.398C189.928,-481.398 195.928,-475.398 201.928,-475.398"></path>
-<path fill="white" stroke="white" d="M260.072,-475.398C266.072,-475.398 272.072,-481.398 272.072,-487.398"></path>
-<path fill="white" stroke="white" d="M272.072,-504.602C272.072,-510.602 266.072,-516.602 260.072,-516.602"></path>
-<polyline fill="none" stroke="black" points="260.072,-516.602 201.928,-516.602 "></polyline>
-<path fill="none" stroke="black" d="M201.928,-516.602C195.928,-516.602 189.928,-510.602 189.928,-504.602"></path>
-<polyline fill="none" stroke="black" points="189.928,-504.602 189.928,-487.398 "></polyline>
-<path fill="none" stroke="black" d="M189.928,-487.398C189.928,-481.398 195.928,-475.398 201.928,-475.398"></path>
-<polyline fill="none" stroke="black" points="201.928,-475.398 260.072,-475.398 "></polyline>
-<path fill="none" stroke="black" d="M260.072,-475.398C266.072,-475.398 272.072,-481.398 272.072,-487.398"></path>
-<polyline fill="none" stroke="black" points="272.072,-487.398 272.072,-504.602 "></polyline>
-<path fill="none" stroke="black" d="M272.072,-504.602C272.072,-510.602 266.072,-516.602 260.072,-516.602"></path>
-<text text-anchor="middle" x="231" y="-500.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="231" y="-483.4" font-family="Times,serif" font-size="14.00">Literal (2)</text>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M176.633,-570.277C186.422,-557.084 199.447,-539.528 210.294,-524.908"></path>
-<polygon fill="black" stroke="black" points="213.24,-526.811 216.388,-516.694 207.619,-522.64 213.24,-526.811"></polygon>
-</g>
-
-<g id="edge9" class="edge"><title>s1_6-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M217.368,-475.046C208.766,-462.455 197.392,-445.806 187.191,-430.874"></path>
-<polygon fill="black" stroke="black" points="189.882,-428.608 181.351,-422.325 184.102,-432.557 189.882,-428.608"></polygon>
-</g>
-
-<g id="node11" class="node"><title>s1_8</title>
-<polygon fill="white" stroke="white" points="317.072,-413.602 258.928,-413.602 246.928,-401.602 246.928,-384.398 258.928,-372.398 317.072,-372.398 329.072,-384.398 329.072,-401.602 317.072,-413.602"></polygon>
-<path fill="white" stroke="white" d="M258.928,-413.602C252.928,-413.602 246.928,-407.602 246.928,-401.602"></path>
-<path fill="white" stroke="white" d="M246.928,-384.398C246.928,-378.398 252.928,-372.398 258.928,-372.398"></path>
-<path fill="white" stroke="white" d="M317.072,-372.398C323.072,-372.398 329.072,-378.398 329.072,-384.398"></path>
-<path fill="white" stroke="white" d="M329.072,-401.602C329.072,-407.602 323.072,-413.602 317.072,-413.602"></path>
-<polyline fill="none" stroke="black" points="317.072,-413.602 258.928,-413.602 "></polyline>
-<path fill="none" stroke="black" d="M258.928,-413.602C252.928,-413.602 246.928,-407.602 246.928,-401.602"></path>
-<polyline fill="none" stroke="black" points="246.928,-401.602 246.928,-384.398 "></polyline>
-<path fill="none" stroke="black" d="M246.928,-384.398C246.928,-378.398 252.928,-372.398 258.928,-372.398"></path>
-<polyline fill="none" stroke="black" points="258.928,-372.398 317.072,-372.398 "></polyline>
-<path fill="none" stroke="black" d="M317.072,-372.398C323.072,-372.398 329.072,-378.398 329.072,-384.398"></path>
-<polyline fill="none" stroke="black" points="329.072,-384.398 329.072,-401.602 "></polyline>
-<path fill="none" stroke="black" d="M329.072,-401.602C329.072,-407.602 323.072,-413.602 317.072,-413.602"></path>
-<text text-anchor="middle" x="288" y="-397.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="288" y="-380.4" font-family="Times,serif" font-size="14.00">Literal (3)</text>
-</g>
-
-<g id="edge19" class="edge"><title>s1_6-&gt;s1_8</title>
-<path fill="none" stroke="black" d="M242.261,-475.046C250.693,-460.106 262.349,-439.452 271.784,-422.734"></path>
-<polygon fill="black" stroke="black" points="274.895,-424.342 276.762,-413.913 268.799,-420.902 274.895,-424.342"></polygon>
-</g>
-
-<g id="edge20" class="edge"><title>s1_8-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M263.407,-372.286C249.805,-361.383 232.341,-347.384 215.751,-334.086"></path>
-<polygon fill="black" stroke="black" points="217.69,-331.155 207.698,-327.631 213.312,-336.617 217.69,-331.155"></polygon>
-</g>
-
-<g id="node12" class="node"><title>s1_11</title>
-<polygon fill="white" stroke="white" points="317.072,-308 258.928,-308 246.928,-296 246.928,-284 258.928,-272 317.072,-272 329.072,-284 329.072,-296 317.072,-308"></polygon>
-<path fill="white" stroke="white" d="M258.928,-308C252.928,-308 246.928,-302 246.928,-296"></path>
-<path fill="white" stroke="white" d="M246.928,-284C246.928,-278 252.928,-272 258.928,-272"></path>
-<path fill="white" stroke="white" d="M317.072,-272C323.072,-272 329.072,-278 329.072,-284"></path>
-<path fill="white" stroke="white" d="M329.072,-296C329.072,-302 323.072,-308 317.072,-308"></path>
-<polyline fill="none" stroke="black" points="317.072,-308 258.928,-308 "></polyline>
-<path fill="none" stroke="black" d="M258.928,-308C252.928,-308 246.928,-302 246.928,-296"></path>
-<polyline fill="none" stroke="black" points="246.928,-296 246.928,-284 "></polyline>
-<path fill="none" stroke="black" d="M246.928,-284C246.928,-278 252.928,-272 258.928,-272"></path>
-<polyline fill="none" stroke="black" points="258.928,-272 317.072,-272 "></polyline>
-<path fill="none" stroke="black" d="M317.072,-272C323.072,-272 329.072,-278 329.072,-284"></path>
-<polyline fill="none" stroke="black" points="329.072,-284 329.072,-296 "></polyline>
-<path fill="none" stroke="black" d="M329.072,-296C329.072,-302 323.072,-308 317.072,-308"></path>
-<text text-anchor="middle" x="288" y="-285.8" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-</g>
-
-<g id="edge22" class="edge"><title>s1_8-&gt;s1_11</title>
-<path fill="none" stroke="black" d="M288,-372.046C288,-356.766 288,-335.511 288,-318.601"></path>
-<polygon fill="black" stroke="black" points="291.5,-318.223 288,-308.223 284.5,-318.223 291.5,-318.223"></polygon>
-</g>
-
-<g id="edge23" class="edge"><title>s1_11-&gt;s1_12</title>
-<path fill="none" stroke="black" d="M285.5,-271.813C283.695,-259.403 281.166,-242.015 278.784,-225.64"></path>
-<polygon fill="black" stroke="black" points="282.231,-225.02 277.328,-215.628 275.304,-226.028 282.231,-225.02"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-switchstatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-switchstatement.svg
deleted file mode 100644 (file)
index 778017e..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0"?>
-<svg width="337pt" height="690pt" viewBox="0.00 0.00 337.00 690.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 686)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="121" cy="-673" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="164.156,-628 77.8443,-628 65.8443,-616 65.8443,-548 77.8443,-536 164.156,-536 176.156,-548 176.156,-616 164.156,-628"></polygon>
-<path fill="white" stroke="white" d="M77.8443,-628C71.8443,-628 65.8443,-622 65.8443,-616"></path>
-<path fill="white" stroke="white" d="M65.8443,-548C65.8443,-542 71.8443,-536 77.8443,-536"></path>
-<path fill="white" stroke="white" d="M164.156,-536C170.156,-536 176.156,-542 176.156,-548"></path>
-<path fill="white" stroke="white" d="M176.156,-616C176.156,-622 170.156,-628 164.156,-628"></path>
-<polyline fill="none" stroke="black" points="164.156,-628 77.8443,-628 "></polyline>
-<path fill="none" stroke="black" d="M77.8443,-628C71.8443,-628 65.8443,-622 65.8443,-616"></path>
-<polyline fill="none" stroke="black" points="65.8443,-616 65.8443,-548 "></polyline>
-<path fill="none" stroke="black" d="M65.8443,-548C65.8443,-542 71.8443,-536 77.8443,-536"></path>
-<polyline fill="none" stroke="black" points="77.8443,-536 164.156,-536 "></polyline>
-<path fill="none" stroke="black" d="M164.156,-536C170.156,-536 176.156,-542 176.156,-548"></path>
-<polyline fill="none" stroke="black" points="176.156,-548 176.156,-616 "></polyline>
-<path fill="none" stroke="black" d="M176.156,-616C176.156,-622 170.156,-628 164.156,-628"></path>
-<text text-anchor="middle" x="121" y="-611.4" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="121" y="-594.6" font-family="Times,serif" font-size="14.00">SwitchStatement</text>
-<text text-anchor="middle" x="121" y="-577.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="121" y="-561" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="121" y="-544.2" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M121,-663.787C121,-657.525 121,-648.299 121,-638.297"></path>
-<polygon fill="black" stroke="black" points="124.5,-638.119 121,-628.119 117.5,-638.119 124.5,-638.119"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="170" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="170" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="122.147,-421.7 11.8526,-421.7 -0.147372,-409.7 -0.147372,-358.3 11.8526,-346.3 122.147,-346.3 134.147,-358.3 134.147,-409.7 122.147,-421.7"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-421.7C5.85263,-421.7 -0.147372,-415.7 -0.147372,-409.7"></path>
-<path fill="white" stroke="white" d="M-0.147372,-358.3C-0.147372,-352.3 5.85263,-346.3 11.8526,-346.3"></path>
-<path fill="white" stroke="white" d="M122.147,-346.3C128.147,-346.3 134.147,-352.3 134.147,-358.3"></path>
-<path fill="white" stroke="white" d="M134.147,-409.7C134.147,-415.7 128.147,-421.7 122.147,-421.7"></path>
-<polyline fill="none" stroke="black" points="122.147,-421.7 11.8526,-421.7 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-421.7C5.85263,-421.7 -0.147372,-415.7 -0.147372,-409.7"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-409.7 -0.147372,-358.3 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-358.3C-0.147372,-352.3 5.85263,-346.3 11.8526,-346.3"></path>
-<polyline fill="none" stroke="black" points="11.8526,-346.3 122.147,-346.3 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-346.3C128.147,-346.3 134.147,-352.3 134.147,-358.3"></path>
-<polyline fill="none" stroke="black" points="134.147,-358.3 134.147,-409.7 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-409.7C134.147,-415.7 128.147,-421.7 122.147,-421.7"></path>
-<text text-anchor="middle" x="67" y="-405" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-388.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-371.4" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-354.6" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M108.476,-535.541C99.8727,-504.316 88.4862,-462.987 79.8204,-431.533"></path>
-<polygon fill="black" stroke="black" points="83.14,-430.405 77.1095,-421.694 76.3914,-432.264 83.14,-430.405"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="191.072,-499.602 132.928,-499.602 120.928,-487.602 120.928,-470.398 132.928,-458.398 191.072,-458.398 203.072,-470.398 203.072,-487.602 191.072,-499.602"></polygon>
-<path fill="white" stroke="white" d="M132.928,-499.602C126.928,-499.602 120.928,-493.602 120.928,-487.602"></path>
-<path fill="white" stroke="white" d="M120.928,-470.398C120.928,-464.398 126.928,-458.398 132.928,-458.398"></path>
-<path fill="white" stroke="white" d="M191.072,-458.398C197.072,-458.398 203.072,-464.398 203.072,-470.398"></path>
-<path fill="white" stroke="white" d="M203.072,-487.602C203.072,-493.602 197.072,-499.602 191.072,-499.602"></path>
-<polyline fill="none" stroke="black" points="191.072,-499.602 132.928,-499.602 "></polyline>
-<path fill="none" stroke="black" d="M132.928,-499.602C126.928,-499.602 120.928,-493.602 120.928,-487.602"></path>
-<polyline fill="none" stroke="black" points="120.928,-487.602 120.928,-470.398 "></polyline>
-<path fill="none" stroke="black" d="M120.928,-470.398C120.928,-464.398 126.928,-458.398 132.928,-458.398"></path>
-<polyline fill="none" stroke="black" points="132.928,-458.398 191.072,-458.398 "></polyline>
-<path fill="none" stroke="black" d="M191.072,-458.398C197.072,-458.398 203.072,-464.398 203.072,-470.398"></path>
-<polyline fill="none" stroke="black" points="203.072,-470.398 203.072,-487.602 "></polyline>
-<path fill="none" stroke="black" d="M203.072,-487.602C203.072,-493.602 197.072,-499.602 191.072,-499.602"></path>
-<text text-anchor="middle" x="162" y="-483.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="162" y="-466.4" font-family="Times,serif" font-size="14.00">Literal (1)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_1-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M139.341,-535.817C143.019,-526.757 146.791,-517.466 150.176,-509.128"></path>
-<polygon fill="black" stroke="black" points="153.424,-510.431 153.943,-499.849 146.938,-507.798 153.424,-510.431"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_11</title>
-<polygon fill="white" stroke="white" points="225.321,-103.602 114.679,-103.602 102.679,-91.6019 102.679,-74.3981 114.679,-62.3981 225.321,-62.3981 237.321,-74.3981 237.321,-91.6019 225.321,-103.602"></polygon>
-<path fill="white" stroke="white" d="M114.679,-103.602C108.679,-103.602 102.679,-97.6019 102.679,-91.6019"></path>
-<path fill="white" stroke="white" d="M102.679,-74.3981C102.679,-68.3981 108.679,-62.3981 114.679,-62.3981"></path>
-<path fill="white" stroke="white" d="M225.321,-62.3981C231.321,-62.3981 237.321,-68.3981 237.321,-74.3981"></path>
-<path fill="white" stroke="white" d="M237.321,-91.6019C237.321,-97.6019 231.321,-103.602 225.321,-103.602"></path>
-<polyline fill="none" stroke="black" points="225.321,-103.602 114.679,-103.602 "></polyline>
-<path fill="none" stroke="black" d="M114.679,-103.602C108.679,-103.602 102.679,-97.6019 102.679,-91.6019"></path>
-<polyline fill="none" stroke="black" points="102.679,-91.6019 102.679,-74.3981 "></polyline>
-<path fill="none" stroke="black" d="M102.679,-74.3981C102.679,-68.3981 108.679,-62.3981 114.679,-62.3981"></path>
-<polyline fill="none" stroke="black" points="114.679,-62.3981 225.321,-62.3981 "></polyline>
-<path fill="none" stroke="black" d="M225.321,-62.3981C231.321,-62.3981 237.321,-68.3981 237.321,-74.3981"></path>
-<polyline fill="none" stroke="black" points="237.321,-74.3981 237.321,-91.6019 "></polyline>
-<path fill="none" stroke="black" d="M237.321,-91.6019C237.321,-97.6019 231.321,-103.602 225.321,-103.602"></path>
-<text text-anchor="middle" x="170" y="-87.2" font-family="Times,serif" font-size="14.00">SwitchStatement:exit</text>
-<text text-anchor="middle" x="170" y="-70.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge11" class="edge"><title>s1_2-&gt;s1_11</title>
-<path fill="none" stroke="black" d="M62.3638,-346.027C57.9153,-295.816 56.5654,-204.896 94,-140 100.985,-127.891 111.753,-117.634 123.007,-109.339"></path>
-<polygon fill="black" stroke="black" points="125.004,-112.213 131.24,-103.648 121.024,-106.455 125.004,-112.213"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_7</title>
-<polygon fill="white" stroke="white" points="217.147,-310.401 106.853,-310.401 94.8526,-298.401 94.8526,-263.599 106.853,-251.599 217.147,-251.599 229.147,-263.599 229.147,-298.401 217.147,-310.401"></polygon>
-<path fill="white" stroke="white" d="M106.853,-310.401C100.853,-310.401 94.8526,-304.401 94.8526,-298.401"></path>
-<path fill="white" stroke="white" d="M94.8526,-263.599C94.8526,-257.599 100.853,-251.599 106.853,-251.599"></path>
-<path fill="white" stroke="white" d="M217.147,-251.599C223.147,-251.599 229.147,-257.599 229.147,-263.599"></path>
-<path fill="white" stroke="white" d="M229.147,-298.401C229.147,-304.401 223.147,-310.401 217.147,-310.401"></path>
-<polyline fill="none" stroke="black" points="217.147,-310.401 106.853,-310.401 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-310.401C100.853,-310.401 94.8526,-304.401 94.8526,-298.401"></path>
-<polyline fill="none" stroke="black" points="94.8526,-298.401 94.8526,-263.599 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-263.599C94.8526,-257.599 100.853,-251.599 106.853,-251.599"></path>
-<polyline fill="none" stroke="black" points="106.853,-251.599 217.147,-251.599 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-251.599C223.147,-251.599 229.147,-257.599 229.147,-263.599"></path>
-<polyline fill="none" stroke="black" points="229.147,-263.599 229.147,-298.401 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-298.401C229.147,-304.401 223.147,-310.401 217.147,-310.401"></path>
-<text text-anchor="middle" x="162" y="-293.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-276.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-260" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="node6" class="node"><title>s1_9</title>
-<polygon fill="white" stroke="white" points="225.147,-215.7 114.853,-215.7 102.853,-203.7 102.853,-152.3 114.853,-140.3 225.147,-140.3 237.147,-152.3 237.147,-203.7 225.147,-215.7"></polygon>
-<path fill="white" stroke="white" d="M114.853,-215.7C108.853,-215.7 102.853,-209.7 102.853,-203.7"></path>
-<path fill="white" stroke="white" d="M102.853,-152.3C102.853,-146.3 108.853,-140.3 114.853,-140.3"></path>
-<path fill="white" stroke="white" d="M225.147,-140.3C231.147,-140.3 237.147,-146.3 237.147,-152.3"></path>
-<path fill="white" stroke="white" d="M237.147,-203.7C237.147,-209.7 231.147,-215.7 225.147,-215.7"></path>
-<polyline fill="none" stroke="black" points="225.147,-215.7 114.853,-215.7 "></polyline>
-<path fill="none" stroke="black" d="M114.853,-215.7C108.853,-215.7 102.853,-209.7 102.853,-203.7"></path>
-<polyline fill="none" stroke="black" points="102.853,-203.7 102.853,-152.3 "></polyline>
-<path fill="none" stroke="black" d="M102.853,-152.3C102.853,-146.3 108.853,-140.3 114.853,-140.3"></path>
-<polyline fill="none" stroke="black" points="114.853,-140.3 225.147,-140.3 "></polyline>
-<path fill="none" stroke="black" d="M225.147,-140.3C231.147,-140.3 237.147,-146.3 237.147,-152.3"></path>
-<polyline fill="none" stroke="black" points="237.147,-152.3 237.147,-203.7 "></polyline>
-<path fill="none" stroke="black" d="M237.147,-203.7C237.147,-209.7 231.147,-215.7 225.147,-215.7"></path>
-<text text-anchor="middle" x="170" y="-199" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="170" y="-182.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="170" y="-165.4" font-family="Times,serif" font-size="14.00">Identifier (hoge)</text>
-<text text-anchor="middle" x="170" y="-148.6" font-family="Times,serif" font-size="14.00">BreakStatement</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_7-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M164.25,-251.597C164.881,-243.629 165.584,-234.747 166.277,-226.005"></path>
-<polygon fill="black" stroke="black" points="169.779,-226.116 167.08,-215.871 162.801,-225.563 169.779,-226.116"></polygon>
-</g>
-
-<g id="edge13" class="edge"><title>s1_9-&gt;s1_11</title>
-<path fill="none" stroke="black" d="M170,-140.244C170,-131.462 170,-122.195 170,-113.772"></path>
-<polygon fill="black" stroke="black" points="173.5,-113.655 170,-103.655 166.5,-113.655 173.5,-113.655"></polygon>
-</g>
-
-<g id="edge21" class="edge"><title>s1_11-&gt;final</title>
-<path fill="none" stroke="black" d="M170,-62.3316C170,-54.2587 170,-44.8663 170,-36.5198"></path>
-<polygon fill="black" stroke="black" points="173.5,-36.3487 170,-26.3488 166.5,-36.3488 173.5,-36.3487"></polygon>
-</g>
-
-<g id="edge15" class="edge"><title>s1_4-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M162,-458.128C162,-425.987 162,-362.03 162,-320.674"></path>
-<polygon fill="black" stroke="black" points="165.5,-320.424 162,-310.424 158.5,-320.424 165.5,-320.424"></polygon>
-</g>
-
-<g id="node9" class="node"><title>s1_6</title>
-<polygon fill="white" stroke="white" points="260.072,-404.602 201.928,-404.602 189.928,-392.602 189.928,-375.398 201.928,-363.398 260.072,-363.398 272.072,-375.398 272.072,-392.602 260.072,-404.602"></polygon>
-<path fill="white" stroke="white" d="M201.928,-404.602C195.928,-404.602 189.928,-398.602 189.928,-392.602"></path>
-<path fill="white" stroke="white" d="M189.928,-375.398C189.928,-369.398 195.928,-363.398 201.928,-363.398"></path>
-<path fill="white" stroke="white" d="M260.072,-363.398C266.072,-363.398 272.072,-369.398 272.072,-375.398"></path>
-<path fill="white" stroke="white" d="M272.072,-392.602C272.072,-398.602 266.072,-404.602 260.072,-404.602"></path>
-<polyline fill="none" stroke="black" points="260.072,-404.602 201.928,-404.602 "></polyline>
-<path fill="none" stroke="black" d="M201.928,-404.602C195.928,-404.602 189.928,-398.602 189.928,-392.602"></path>
-<polyline fill="none" stroke="black" points="189.928,-392.602 189.928,-375.398 "></polyline>
-<path fill="none" stroke="black" d="M189.928,-375.398C189.928,-369.398 195.928,-363.398 201.928,-363.398"></path>
-<polyline fill="none" stroke="black" points="201.928,-363.398 260.072,-363.398 "></polyline>
-<path fill="none" stroke="black" d="M260.072,-363.398C266.072,-363.398 272.072,-369.398 272.072,-375.398"></path>
-<polyline fill="none" stroke="black" points="272.072,-375.398 272.072,-392.602 "></polyline>
-<path fill="none" stroke="black" d="M272.072,-392.602C272.072,-398.602 266.072,-404.602 260.072,-404.602"></path>
-<text text-anchor="middle" x="231" y="-388.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="231" y="-371.4" font-family="Times,serif" font-size="14.00">Literal (2)</text>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M176.633,-458.277C186.422,-445.084 199.447,-427.528 210.294,-412.908"></path>
-<polygon fill="black" stroke="black" points="213.24,-414.811 216.388,-404.694 207.619,-410.64 213.24,-414.811"></polygon>
-</g>
-
-<g id="edge9" class="edge"><title>s1_6-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M217.368,-363.046C208.766,-350.455 197.392,-333.806 187.191,-318.874"></path>
-<polygon fill="black" stroke="black" points="189.882,-316.608 181.351,-310.325 184.102,-320.557 189.882,-316.608"></polygon>
-</g>
-
-<g id="node10" class="node"><title>s1_8</title>
-<polygon fill="white" stroke="white" points="317.072,-301.602 258.928,-301.602 246.928,-289.602 246.928,-272.398 258.928,-260.398 317.072,-260.398 329.072,-272.398 329.072,-289.602 317.072,-301.602"></polygon>
-<path fill="white" stroke="white" d="M258.928,-301.602C252.928,-301.602 246.928,-295.602 246.928,-289.602"></path>
-<path fill="white" stroke="white" d="M246.928,-272.398C246.928,-266.398 252.928,-260.398 258.928,-260.398"></path>
-<path fill="white" stroke="white" d="M317.072,-260.398C323.072,-260.398 329.072,-266.398 329.072,-272.398"></path>
-<path fill="white" stroke="white" d="M329.072,-289.602C329.072,-295.602 323.072,-301.602 317.072,-301.602"></path>
-<polyline fill="none" stroke="black" points="317.072,-301.602 258.928,-301.602 "></polyline>
-<path fill="none" stroke="black" d="M258.928,-301.602C252.928,-301.602 246.928,-295.602 246.928,-289.602"></path>
-<polyline fill="none" stroke="black" points="246.928,-289.602 246.928,-272.398 "></polyline>
-<path fill="none" stroke="black" d="M246.928,-272.398C246.928,-266.398 252.928,-260.398 258.928,-260.398"></path>
-<polyline fill="none" stroke="black" points="258.928,-260.398 317.072,-260.398 "></polyline>
-<path fill="none" stroke="black" d="M317.072,-260.398C323.072,-260.398 329.072,-266.398 329.072,-272.398"></path>
-<polyline fill="none" stroke="black" points="329.072,-272.398 329.072,-289.602 "></polyline>
-<path fill="none" stroke="black" d="M329.072,-289.602C329.072,-295.602 323.072,-301.602 317.072,-301.602"></path>
-<text text-anchor="middle" x="288" y="-285.2" font-family="Times,serif" font-size="14.00">SwitchCase</text>
-<text text-anchor="middle" x="288" y="-268.4" font-family="Times,serif" font-size="14.00">Literal (3)</text>
-</g>
-
-<g id="edge17" class="edge"><title>s1_6-&gt;s1_8</title>
-<path fill="none" stroke="black" d="M242.261,-363.046C250.693,-348.106 262.349,-327.452 271.784,-310.734"></path>
-<polygon fill="black" stroke="black" points="274.895,-312.342 276.762,-301.913 268.799,-308.902 274.895,-312.342"></polygon>
-</g>
-
-<g id="edge18" class="edge"><title>s1_8-&gt;s1_9</title>
-<path fill="none" stroke="black" d="M264.968,-260.286C252.403,-249.531 236.318,-235.764 220.972,-222.628"></path>
-<polygon fill="black" stroke="black" points="222.909,-219.68 213.036,-215.836 218.358,-224.998 222.909,-219.68"></polygon>
-</g>
-
-<g id="edge20" class="edge"><title>s1_8-&gt;s1_11</title>
-<path fill="none" stroke="black" d="M286.047,-260.183C282.381,-231.387 272.302,-177.344 246,-140 237.722,-128.247 226.195,-117.974 214.617,-109.546"></path>
-<polygon fill="black" stroke="black" points="216.439,-106.551 206.223,-103.741 212.457,-112.308 216.439,-106.551"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg b/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg
deleted file mode 100644 (file)
index fbc0083..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0"?>
-<svg width="237pt" height="652pt" viewBox="0.00 0.00 237.00 652.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 648)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-635" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="169.147,-589.3 58.8526,-589.3 46.8526,-577.3 46.8526,-492.7 58.8526,-480.7 169.147,-480.7 181.147,-492.7 181.147,-577.3 169.147,-589.3"></polygon>
-<path fill="white" stroke="white" d="M58.8526,-589.3C52.8526,-589.3 46.8526,-583.3 46.8526,-577.3"></path>
-<path fill="white" stroke="white" d="M46.8526,-492.7C46.8526,-486.7 52.8526,-480.7 58.8526,-480.7"></path>
-<path fill="white" stroke="white" d="M169.147,-480.7C175.147,-480.7 181.147,-486.7 181.147,-492.7"></path>
-<path fill="white" stroke="white" d="M181.147,-577.3C181.147,-583.3 175.147,-589.3 169.147,-589.3"></path>
-<polyline fill="none" stroke="black" points="169.147,-589.3 58.8526,-589.3 "></polyline>
-<path fill="none" stroke="black" d="M58.8526,-589.3C52.8526,-589.3 46.8526,-583.3 46.8526,-577.3"></path>
-<polyline fill="none" stroke="black" points="46.8526,-577.3 46.8526,-492.7 "></polyline>
-<path fill="none" stroke="black" d="M46.8526,-492.7C46.8526,-486.7 52.8526,-480.7 58.8526,-480.7"></path>
-<polyline fill="none" stroke="black" points="58.8526,-480.7 169.147,-480.7 "></polyline>
-<path fill="none" stroke="black" d="M169.147,-480.7C175.147,-480.7 181.147,-486.7 181.147,-492.7"></path>
-<polyline fill="none" stroke="black" points="181.147,-492.7 181.147,-577.3 "></polyline>
-<path fill="none" stroke="black" d="M181.147,-577.3C181.147,-583.3 175.147,-589.3 169.147,-589.3"></path>
-<text text-anchor="middle" x="114" y="-572.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="114" y="-556" font-family="Times,serif" font-size="14.00">TryStatement</text>
-<text text-anchor="middle" x="114" y="-539.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="114" y="-522.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="114" y="-505.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="114" y="-488.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M114,-625.98C114,-619.675 114,-610.238 114,-599.813"></path>
-<polygon fill="black" stroke="black" points="117.5,-599.586 114,-589.586 110.5,-599.586 117.5,-599.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="114" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="217.147,-444.401 106.853,-444.401 94.8526,-432.401 94.8526,-397.599 106.853,-385.599 217.147,-385.599 229.147,-397.599 229.147,-432.401 217.147,-444.401"></polygon>
-<path fill="white" stroke="white" d="M106.853,-444.401C100.853,-444.401 94.8526,-438.401 94.8526,-432.401"></path>
-<path fill="white" stroke="white" d="M94.8526,-397.599C94.8526,-391.599 100.853,-385.599 106.853,-385.599"></path>
-<path fill="white" stroke="white" d="M217.147,-385.599C223.147,-385.599 229.147,-391.599 229.147,-397.599"></path>
-<path fill="white" stroke="white" d="M229.147,-432.401C229.147,-438.401 223.147,-444.401 217.147,-444.401"></path>
-<polyline fill="none" stroke="black" points="217.147,-444.401 106.853,-444.401 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-444.401C100.853,-444.401 94.8526,-438.401 94.8526,-432.401"></path>
-<polyline fill="none" stroke="black" points="94.8526,-432.401 94.8526,-397.599 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-397.599C94.8526,-391.599 100.853,-385.599 106.853,-385.599"></path>
-<polyline fill="none" stroke="black" points="106.853,-385.599 217.147,-385.599 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-385.599C223.147,-385.599 229.147,-391.599 229.147,-397.599"></path>
-<polyline fill="none" stroke="black" points="229.147,-397.599 229.147,-432.401 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-432.401C229.147,-438.401 223.147,-444.401 217.147,-444.401"></path>
-<text text-anchor="middle" x="162" y="-427.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-410.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-394" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M135.753,-480.524C139.43,-471.486 143.177,-462.273 146.646,-453.744"></path>
-<polygon fill="black" stroke="black" points="149.9,-455.033 150.426,-444.452 143.416,-452.396 149.9,-455.033"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-349.601 11.8526,-349.601 -0.147372,-337.601 -0.147372,-236.399 11.8526,-224.399 122.147,-224.399 134.147,-236.399 134.147,-337.601 122.147,-349.601"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-349.601C5.85263,-349.601 -0.147372,-343.601 -0.147372,-337.601"></path>
-<path fill="white" stroke="white" d="M-0.147372,-236.399C-0.147372,-230.399 5.85263,-224.399 11.8526,-224.399"></path>
-<path fill="white" stroke="white" d="M122.147,-224.399C128.147,-224.399 134.147,-230.399 134.147,-236.399"></path>
-<path fill="white" stroke="white" d="M134.147,-337.601C134.147,-343.601 128.147,-349.601 122.147,-349.601"></path>
-<polyline fill="none" stroke="black" points="122.147,-349.601 11.8526,-349.601 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-349.601C5.85263,-349.601 -0.147372,-343.601 -0.147372,-337.601"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-337.601 -0.147372,-236.399 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-236.399C-0.147372,-230.399 5.85263,-224.399 11.8526,-224.399"></path>
-<polyline fill="none" stroke="black" points="11.8526,-224.399 122.147,-224.399 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-224.399C128.147,-224.399 134.147,-230.399 134.147,-236.399"></path>
-<polyline fill="none" stroke="black" points="134.147,-236.399 134.147,-337.601 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-337.601C134.147,-343.601 128.147,-349.601 122.147,-349.601"></path>
-<text text-anchor="middle" x="67" y="-333.2" font-family="Times,serif" font-size="14.00">CatchClause</text>
-<text text-anchor="middle" x="67" y="-316.4" font-family="Times,serif" font-size="14.00">Identifier (err)</text>
-<text text-anchor="middle" x="67" y="-299.6" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-282.8" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-266" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-249.2" font-family="Times,serif" font-size="14.00">Identifier (hoge)</text>
-<text text-anchor="middle" x="67" y="-232.4" font-family="Times,serif" font-size="14.00">Identifier (err)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_1-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M95.6637,-480.644C92.0449,-468.693 88.5753,-456 86,-444 80.162,-416.798 75.9602,-386.514 73.0174,-359.921"></path>
-<polygon fill="black" stroke="black" points="76.492,-359.495 71.9505,-349.923 69.5315,-360.238 76.492,-359.495"></polygon>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M140.68,-385.723C134.355,-377.334 127.129,-367.75 119.731,-357.939"></path>
-<polygon fill="black" stroke="black" points="122.308,-355.543 113.493,-349.665 116.719,-359.757 122.308,-355.543"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="169.147,-187.601 58.8526,-187.601 46.8526,-175.601 46.8526,-74.3994 58.8526,-62.3994 169.147,-62.3994 181.147,-74.3994 181.147,-175.601 169.147,-187.601"></polygon>
-<path fill="white" stroke="white" d="M58.8526,-187.601C52.8526,-187.601 46.8526,-181.601 46.8526,-175.601"></path>
-<path fill="white" stroke="white" d="M46.8526,-74.3994C46.8526,-68.3994 52.8526,-62.3994 58.8526,-62.3994"></path>
-<path fill="white" stroke="white" d="M169.147,-62.3994C175.147,-62.3994 181.147,-68.3994 181.147,-74.3994"></path>
-<path fill="white" stroke="white" d="M181.147,-175.601C181.147,-181.601 175.147,-187.601 169.147,-187.601"></path>
-<polyline fill="none" stroke="black" points="169.147,-187.601 58.8526,-187.601 "></polyline>
-<path fill="none" stroke="black" d="M58.8526,-187.601C52.8526,-187.601 46.8526,-181.601 46.8526,-175.601"></path>
-<polyline fill="none" stroke="black" points="46.8526,-175.601 46.8526,-74.3994 "></polyline>
-<path fill="none" stroke="black" d="M46.8526,-74.3994C46.8526,-68.3994 52.8526,-62.3994 58.8526,-62.3994"></path>
-<polyline fill="none" stroke="black" points="58.8526,-62.3994 169.147,-62.3994 "></polyline>
-<path fill="none" stroke="black" d="M169.147,-62.3994C175.147,-62.3994 181.147,-68.3994 181.147,-74.3994"></path>
-<polyline fill="none" stroke="black" points="181.147,-74.3994 181.147,-175.601 "></polyline>
-<path fill="none" stroke="black" d="M181.147,-175.601C181.147,-181.601 175.147,-187.601 169.147,-187.601"></path>
-<text text-anchor="middle" x="114" y="-171.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="114" y="-154.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="114" y="-137.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="114" y="-120.8" font-family="Times,serif" font-size="14.00">Identifier (fuga)</text>
-<text text-anchor="middle" x="114" y="-104" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="114" y="-87.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="114" y="-70.4" font-family="Times,serif" font-size="14.00">Identifier (last)</text>
-</g>
-
-<g id="edge9" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M160.835,-385.75C158.918,-348.425 154.135,-280.766 143,-224 141.313,-215.398 139.196,-206.466 136.88,-197.651"></path>
-<polygon fill="black" stroke="black" points="140.195,-196.504 134.191,-187.774 133.441,-198.342 140.195,-196.504"></polygon>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M85.1714,-224.14C87.7514,-215.357 90.4217,-206.266 93.0491,-197.322"></path>
-<polygon fill="black" stroke="black" points="96.4165,-198.277 95.8769,-187.696 89.7003,-196.304 96.4165,-198.277"></polygon>
-</g>
-
-<g id="edge10" class="edge"><title>s1_4-&gt;final</title>
-<path fill="none" stroke="black" d="M114,-62.2476C114,-53.0345 114,-44.0781 114,-36.4335"></path>
-<polygon fill="black" stroke="black" points="117.5,-36.2949 114,-26.2949 110.5,-36.2949 117.5,-36.2949"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg b/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg
deleted file mode 100644 (file)
index c6f1879..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0"?>
-<svg width="323pt" height="680pt" viewBox="0.00 0.00 323.00 680.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 676)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="248" cy="-663" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="303.147,-617.3 192.853,-617.3 180.853,-605.3 180.853,-520.7 192.853,-508.7 303.147,-508.7 315.147,-520.7 315.147,-605.3 303.147,-617.3"></polygon>
-<path fill="white" stroke="white" d="M192.853,-617.3C186.853,-617.3 180.853,-611.3 180.853,-605.3"></path>
-<path fill="white" stroke="white" d="M180.853,-520.7C180.853,-514.7 186.853,-508.7 192.853,-508.7"></path>
-<path fill="white" stroke="white" d="M303.147,-508.7C309.147,-508.7 315.147,-514.7 315.147,-520.7"></path>
-<path fill="white" stroke="white" d="M315.147,-605.3C315.147,-611.3 309.147,-617.3 303.147,-617.3"></path>
-<polyline fill="none" stroke="black" points="303.147,-617.3 192.853,-617.3 "></polyline>
-<path fill="none" stroke="black" d="M192.853,-617.3C186.853,-617.3 180.853,-611.3 180.853,-605.3"></path>
-<polyline fill="none" stroke="black" points="180.853,-605.3 180.853,-520.7 "></polyline>
-<path fill="none" stroke="black" d="M180.853,-520.7C180.853,-514.7 186.853,-508.7 192.853,-508.7"></path>
-<polyline fill="none" stroke="black" points="192.853,-508.7 303.147,-508.7 "></polyline>
-<path fill="none" stroke="black" d="M303.147,-508.7C309.147,-508.7 315.147,-514.7 315.147,-520.7"></path>
-<polyline fill="none" stroke="black" points="315.147,-520.7 315.147,-605.3 "></polyline>
-<path fill="none" stroke="black" d="M315.147,-605.3C315.147,-611.3 309.147,-617.3 303.147,-617.3"></path>
-<text text-anchor="middle" x="248" y="-600.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="248" y="-584" font-family="Times,serif" font-size="14.00">TryStatement</text>
-<text text-anchor="middle" x="248" y="-567.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="248" y="-550.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="248" y="-533.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="248" y="-516.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M248,-653.98C248,-647.675 248,-638.238 248,-627.813"></path>
-<polygon fill="black" stroke="black" points="251.5,-627.586 248,-617.586 244.5,-627.586 251.5,-627.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="142" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="142" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="238.339,-471.602 175.661,-471.602 163.661,-459.602 163.661,-442.398 175.661,-430.398 238.339,-430.398 250.339,-442.398 250.339,-459.602 238.339,-471.602"></polygon>
-<path fill="white" stroke="white" d="M175.661,-471.602C169.661,-471.602 163.661,-465.602 163.661,-459.602"></path>
-<path fill="white" stroke="white" d="M163.661,-442.398C163.661,-436.398 169.661,-430.398 175.661,-430.398"></path>
-<path fill="white" stroke="white" d="M238.339,-430.398C244.339,-430.398 250.339,-436.398 250.339,-442.398"></path>
-<path fill="white" stroke="white" d="M250.339,-459.602C250.339,-465.602 244.339,-471.602 238.339,-471.602"></path>
-<polyline fill="none" stroke="black" points="238.339,-471.602 175.661,-471.602 "></polyline>
-<path fill="none" stroke="black" d="M175.661,-471.602C169.661,-471.602 163.661,-465.602 163.661,-459.602"></path>
-<polyline fill="none" stroke="black" points="163.661,-459.602 163.661,-442.398 "></polyline>
-<path fill="none" stroke="black" d="M163.661,-442.398C163.661,-436.398 169.661,-430.398 175.661,-430.398"></path>
-<polyline fill="none" stroke="black" points="175.661,-430.398 238.339,-430.398 "></polyline>
-<path fill="none" stroke="black" d="M238.339,-430.398C244.339,-430.398 250.339,-436.398 250.339,-442.398"></path>
-<polyline fill="none" stroke="black" points="250.339,-442.398 250.339,-459.602 "></polyline>
-<path fill="none" stroke="black" d="M250.339,-459.602C250.339,-465.602 244.339,-471.602 238.339,-471.602"></path>
-<text text-anchor="middle" x="207" y="-455.2" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="207" y="-438.4" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M228.101,-508.611C224.581,-499.169 221.038,-489.663 217.887,-481.208"></path>
-<polygon fill="black" stroke="black" points="221.164,-479.98 214.392,-471.833 214.605,-482.425 221.164,-479.98"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_6</title>
-<polygon fill="white" stroke="white" points="250.147,-281.601 139.853,-281.601 127.853,-269.601 127.853,-168.399 139.853,-156.399 250.147,-156.399 262.147,-168.399 262.147,-269.601 250.147,-281.601"></polygon>
-<path fill="white" stroke="white" d="M139.853,-281.601C133.853,-281.601 127.853,-275.601 127.853,-269.601"></path>
-<path fill="white" stroke="white" d="M127.853,-168.399C127.853,-162.399 133.853,-156.399 139.853,-156.399"></path>
-<path fill="white" stroke="white" d="M250.147,-156.399C256.147,-156.399 262.147,-162.399 262.147,-168.399"></path>
-<path fill="white" stroke="white" d="M262.147,-269.601C262.147,-275.601 256.147,-281.601 250.147,-281.601"></path>
-<polyline fill="none" stroke="black" points="250.147,-281.601 139.853,-281.601 "></polyline>
-<path fill="none" stroke="black" d="M139.853,-281.601C133.853,-281.601 127.853,-275.601 127.853,-269.601"></path>
-<polyline fill="none" stroke="black" points="127.853,-269.601 127.853,-168.399 "></polyline>
-<path fill="none" stroke="black" d="M127.853,-168.399C127.853,-162.399 133.853,-156.399 139.853,-156.399"></path>
-<polyline fill="none" stroke="black" points="139.853,-156.399 250.147,-156.399 "></polyline>
-<path fill="none" stroke="black" d="M250.147,-156.399C256.147,-156.399 262.147,-162.399 262.147,-168.399"></path>
-<polyline fill="none" stroke="black" points="262.147,-168.399 262.147,-269.601 "></polyline>
-<path fill="none" stroke="black" d="M262.147,-269.601C262.147,-275.601 256.147,-281.601 250.147,-281.601"></path>
-<text text-anchor="middle" x="195" y="-265.2" font-family="Times,serif" font-size="14.00">CatchClause</text>
-<text text-anchor="middle" x="195" y="-248.4" font-family="Times,serif" font-size="14.00">Identifier (err)</text>
-<text text-anchor="middle" x="195" y="-231.6" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="195" y="-214.8" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="195" y="-198" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="195" y="-181.2" font-family="Times,serif" font-size="14.00">Identifier (hoge)</text>
-<text text-anchor="middle" x="195" y="-164.4" font-family="Times,serif" font-size="14.00">Identifier (err)</text>
-</g>
-
-<g id="edge9" class="edge"><title>s1_1-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M265.496,-508.624C279.169,-458.161 292.566,-381 271,-318 267.758,-308.528 263.185,-299.263 257.874,-290.444"></path>
-<polygon fill="black" stroke="black" points="260.672,-288.323 252.338,-281.781 254.774,-292.092 260.672,-288.323"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="250.329,-393.7 163.671,-393.7 151.671,-381.7 151.671,-330.3 163.671,-318.3 250.329,-318.3 262.329,-330.3 262.329,-381.7 250.329,-393.7"></polygon>
-<path fill="white" stroke="white" d="M163.671,-393.7C157.671,-393.7 151.671,-387.7 151.671,-381.7"></path>
-<path fill="white" stroke="white" d="M151.671,-330.3C151.671,-324.3 157.671,-318.3 163.671,-318.3"></path>
-<path fill="white" stroke="white" d="M250.329,-318.3C256.329,-318.3 262.329,-324.3 262.329,-330.3"></path>
-<path fill="white" stroke="white" d="M262.329,-381.7C262.329,-387.7 256.329,-393.7 250.329,-393.7"></path>
-<polyline fill="none" stroke="black" points="250.329,-393.7 163.671,-393.7 "></polyline>
-<path fill="none" stroke="black" d="M163.671,-393.7C157.671,-393.7 151.671,-387.7 151.671,-381.7"></path>
-<polyline fill="none" stroke="black" points="151.671,-381.7 151.671,-330.3 "></polyline>
-<path fill="none" stroke="black" d="M151.671,-330.3C151.671,-324.3 157.671,-318.3 163.671,-318.3"></path>
-<polyline fill="none" stroke="black" points="163.671,-318.3 250.329,-318.3 "></polyline>
-<path fill="none" stroke="black" d="M250.329,-318.3C256.329,-318.3 262.329,-324.3 262.329,-330.3"></path>
-<polyline fill="none" stroke="black" points="262.329,-330.3 262.329,-381.7 "></polyline>
-<path fill="none" stroke="black" d="M262.329,-381.7C262.329,-387.7 256.329,-393.7 250.329,-393.7"></path>
-<text text-anchor="middle" x="207" y="-377" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="207" y="-360.2" font-family="Times,serif" font-size="14.00">ThrowStatement</text>
-<text text-anchor="middle" x="207" y="-343.4" font-family="Times,serif" font-size="14.00">NewExpression</text>
-<text text-anchor="middle" x="207" y="-326.6" font-family="Times,serif" font-size="14.00">Identifier (Error)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M207,-430.277C207,-422.524 207,-413.265 207,-403.98"></path>
-<polygon fill="black" stroke="black" points="210.5,-403.965 207,-393.965 203.5,-403.965 210.5,-403.965"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_5</title>
-<polygon fill="white" stroke="white" points="122.147,-385.401 11.8526,-385.401 -0.147372,-373.401 -0.147372,-338.599 11.8526,-326.599 122.147,-326.599 134.147,-338.599 134.147,-373.401 122.147,-385.401"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-385.401C5.85263,-385.401 -0.147372,-379.401 -0.147372,-373.401"></path>
-<path fill="white" stroke="white" d="M-0.147372,-338.599C-0.147372,-332.599 5.85263,-326.599 11.8526,-326.599"></path>
-<path fill="white" stroke="white" d="M122.147,-326.599C128.147,-326.599 134.147,-332.599 134.147,-338.599"></path>
-<path fill="white" stroke="white" d="M134.147,-373.401C134.147,-379.401 128.147,-385.401 122.147,-385.401"></path>
-<polyline fill="none" stroke="black" points="122.147,-385.401 11.8526,-385.401 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-385.401C5.85263,-385.401 -0.147372,-379.401 -0.147372,-373.401"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-373.401 -0.147372,-338.599 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-338.599C-0.147372,-332.599 5.85263,-326.599 11.8526,-326.599"></path>
-<polyline fill="none" stroke="black" points="11.8526,-326.599 122.147,-326.599 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-326.599C128.147,-326.599 134.147,-332.599 134.147,-338.599"></path>
-<polyline fill="none" stroke="black" points="134.147,-338.599 134.147,-373.401 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-373.401C134.147,-379.401 128.147,-385.401 122.147,-385.401"></path>
-<text text-anchor="middle" x="67" y="-368.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-351.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-335" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge11" class="edge"><title>s1_2-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M177.31,-430.277C160.103,-418.847 137.967,-404.142 118.045,-390.909"></path>
-<polygon fill="black" stroke="black" points="119.93,-387.959 109.664,-385.341 116.057,-393.79 119.93,-387.959"></polygon>
-</g>
-
-<g id="edge13" class="edge"><title>s1_3-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M203.721,-318.111C202.995,-309.943 202.201,-301.016 201.398,-291.982"></path>
-<polygon fill="black" stroke="black" points="204.863,-291.422 200.491,-281.771 197.89,-292.042 204.863,-291.422"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_5-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M93.833,-326.7C104.348,-315.609 116.912,-302.359 129.551,-289.029"></path>
-<polygon fill="black" stroke="black" points="132.227,-291.293 136.567,-281.628 127.147,-286.477 132.227,-291.293"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_7</title>
-<polygon fill="white" stroke="white" points="197.147,-120.401 86.8526,-120.401 74.8526,-108.401 74.8526,-73.5986 86.8526,-61.5986 197.147,-61.5986 209.147,-73.5986 209.147,-108.401 197.147,-120.401"></polygon>
-<path fill="white" stroke="white" d="M86.8526,-120.401C80.8526,-120.401 74.8526,-114.401 74.8526,-108.401"></path>
-<path fill="white" stroke="white" d="M74.8526,-73.5986C74.8526,-67.5986 80.8526,-61.5986 86.8526,-61.5986"></path>
-<path fill="white" stroke="white" d="M197.147,-61.5986C203.147,-61.5986 209.147,-67.5986 209.147,-73.5986"></path>
-<path fill="white" stroke="white" d="M209.147,-108.401C209.147,-114.401 203.147,-120.401 197.147,-120.401"></path>
-<polyline fill="none" stroke="black" points="197.147,-120.401 86.8526,-120.401 "></polyline>
-<path fill="none" stroke="black" d="M86.8526,-120.401C80.8526,-120.401 74.8526,-114.401 74.8526,-108.401"></path>
-<polyline fill="none" stroke="black" points="74.8526,-108.401 74.8526,-73.5986 "></polyline>
-<path fill="none" stroke="black" d="M74.8526,-73.5986C74.8526,-67.5986 80.8526,-61.5986 86.8526,-61.5986"></path>
-<polyline fill="none" stroke="black" points="86.8526,-61.5986 197.147,-61.5986 "></polyline>
-<path fill="none" stroke="black" d="M197.147,-61.5986C203.147,-61.5986 209.147,-67.5986 209.147,-73.5986"></path>
-<polyline fill="none" stroke="black" points="209.147,-73.5986 209.147,-108.401 "></polyline>
-<path fill="none" stroke="black" d="M209.147,-108.401C209.147,-114.401 203.147,-120.401 197.147,-120.401"></path>
-<text text-anchor="middle" x="142" y="-103.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="142" y="-86.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="142" y="-70" font-family="Times,serif" font-size="14.00">Identifier (last)</text>
-</g>
-
-<g id="edge15" class="edge"><title>s1_5-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M73.536,-326.764C82.7028,-287.987 100.357,-216.205 119,-156 121.611,-147.569 124.658,-138.605 127.664,-130.139"></path>
-<polygon fill="black" stroke="black" points="131.044,-131.083 131.145,-120.489 124.459,-128.708 131.044,-131.083"></polygon>
-</g>
-
-<g id="edge7" class="edge"><title>s1_6-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M168.966,-156.107C165.165,-147.072 161.351,-138.005 157.838,-129.652"></path>
-<polygon fill="black" stroke="black" points="160.974,-128.08 153.87,-120.219 154.521,-130.794 160.974,-128.08"></polygon>
-</g>
-
-<g id="edge16" class="edge"><title>s1_7-&gt;final</title>
-<path fill="none" stroke="black" d="M142,-61.7004C142,-53.2282 142,-44.0665 142,-36.0585"></path>
-<polygon fill="black" stroke="black" points="145.5,-36.0267 142,-26.0267 138.5,-36.0267 145.5,-36.0267"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg b/eslint/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg
deleted file mode 100644 (file)
index 8b1fb92..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0"?>
-<svg width="294pt" height="490pt" viewBox="0.00 0.00 294.00 490.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 486)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="171" cy="-473" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="226.147,-427.3 115.853,-427.3 103.853,-415.3 103.853,-330.7 115.853,-318.7 226.147,-318.7 238.147,-330.7 238.147,-415.3 226.147,-427.3"></polygon>
-<path fill="white" stroke="white" d="M115.853,-427.3C109.853,-427.3 103.853,-421.3 103.853,-415.3"></path>
-<path fill="white" stroke="white" d="M103.853,-330.7C103.853,-324.7 109.853,-318.7 115.853,-318.7"></path>
-<path fill="white" stroke="white" d="M226.147,-318.7C232.147,-318.7 238.147,-324.7 238.147,-330.7"></path>
-<path fill="white" stroke="white" d="M238.147,-415.3C238.147,-421.3 232.147,-427.3 226.147,-427.3"></path>
-<polyline fill="none" stroke="black" points="226.147,-427.3 115.853,-427.3 "></polyline>
-<path fill="none" stroke="black" d="M115.853,-427.3C109.853,-427.3 103.853,-421.3 103.853,-415.3"></path>
-<polyline fill="none" stroke="black" points="103.853,-415.3 103.853,-330.7 "></polyline>
-<path fill="none" stroke="black" d="M103.853,-330.7C103.853,-324.7 109.853,-318.7 115.853,-318.7"></path>
-<polyline fill="none" stroke="black" points="115.853,-318.7 226.147,-318.7 "></polyline>
-<path fill="none" stroke="black" d="M226.147,-318.7C232.147,-318.7 238.147,-324.7 238.147,-330.7"></path>
-<polyline fill="none" stroke="black" points="238.147,-330.7 238.147,-415.3 "></polyline>
-<path fill="none" stroke="black" d="M238.147,-415.3C238.147,-421.3 232.147,-427.3 226.147,-427.3"></path>
-<text text-anchor="middle" x="171" y="-410.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="171" y="-394" font-family="Times,serif" font-size="14.00">TryStatement</text>
-<text text-anchor="middle" x="171" y="-377.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="171" y="-360.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="171" y="-343.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="171" y="-326.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M171,-463.98C171,-457.675 171,-448.238 171,-437.813"></path>
-<polygon fill="black" stroke="black" points="174.5,-437.586 171,-427.586 167.5,-437.586 174.5,-437.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="67" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="67" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>thrown</title>
-<ellipse fill="white" stroke="black" cx="219" cy="-13" rx="11" ry="11"></ellipse>
-<text text-anchor="middle" x="219" y="-8.8" font-family="Times,serif" font-size="14.00">✘</text>
-</g>
-
-<g id="node5" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="179.147,-282.401 68.8526,-282.401 56.8526,-270.401 56.8526,-235.599 68.8526,-223.599 179.147,-223.599 191.147,-235.599 191.147,-270.401 179.147,-282.401"></polygon>
-<path fill="white" stroke="white" d="M68.8526,-282.401C62.8526,-282.401 56.8526,-276.401 56.8526,-270.401"></path>
-<path fill="white" stroke="white" d="M56.8526,-235.599C56.8526,-229.599 62.8526,-223.599 68.8526,-223.599"></path>
-<path fill="white" stroke="white" d="M179.147,-223.599C185.147,-223.599 191.147,-229.599 191.147,-235.599"></path>
-<path fill="white" stroke="white" d="M191.147,-270.401C191.147,-276.401 185.147,-282.401 179.147,-282.401"></path>
-<polyline fill="none" stroke="black" points="179.147,-282.401 68.8526,-282.401 "></polyline>
-<path fill="none" stroke="black" d="M68.8526,-282.401C62.8526,-282.401 56.8526,-276.401 56.8526,-270.401"></path>
-<polyline fill="none" stroke="black" points="56.8526,-270.401 56.8526,-235.599 "></polyline>
-<path fill="none" stroke="black" d="M56.8526,-235.599C56.8526,-229.599 62.8526,-223.599 68.8526,-223.599"></path>
-<polyline fill="none" stroke="black" points="68.8526,-223.599 179.147,-223.599 "></polyline>
-<path fill="none" stroke="black" d="M179.147,-223.599C185.147,-223.599 191.147,-229.599 191.147,-235.599"></path>
-<polyline fill="none" stroke="black" points="191.147,-235.599 191.147,-270.401 "></polyline>
-<path fill="none" stroke="black" d="M191.147,-270.401C191.147,-276.401 185.147,-282.401 179.147,-282.401"></path>
-<text text-anchor="middle" x="124" y="-265.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="124" y="-248.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="124" y="-232" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M149.7,-318.524C146.1,-309.486 142.431,-300.273 139.034,-291.744"></path>
-<polygon fill="black" stroke="black" points="142.284,-290.447 135.332,-282.452 135.781,-293.037 142.284,-290.447"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="274.147,-162.7 163.853,-162.7 151.853,-150.7 151.853,-99.2997 163.853,-87.2997 274.147,-87.2997 286.147,-99.2997 286.147,-150.7 274.147,-162.7"></polygon>
-<path fill="white" stroke="white" d="M163.853,-162.7C157.853,-162.7 151.853,-156.7 151.853,-150.7"></path>
-<path fill="white" stroke="white" d="M151.853,-99.2997C151.853,-93.2997 157.853,-87.2997 163.853,-87.2997"></path>
-<path fill="white" stroke="white" d="M274.147,-87.2997C280.147,-87.2997 286.147,-93.2997 286.147,-99.2997"></path>
-<path fill="white" stroke="white" d="M286.147,-150.7C286.147,-156.7 280.147,-162.7 274.147,-162.7"></path>
-<polyline fill="none" stroke="black" points="274.147,-162.7 163.853,-162.7 "></polyline>
-<path fill="none" stroke="black" d="M163.853,-162.7C157.853,-162.7 151.853,-156.7 151.853,-150.7"></path>
-<polyline fill="none" stroke="black" points="151.853,-150.7 151.853,-99.2997 "></polyline>
-<path fill="none" stroke="black" d="M151.853,-99.2997C151.853,-93.2997 157.853,-87.2997 163.853,-87.2997"></path>
-<polyline fill="none" stroke="black" points="163.853,-87.2997 274.147,-87.2997 "></polyline>
-<path fill="none" stroke="black" d="M274.147,-87.2997C280.147,-87.2997 286.147,-93.2997 286.147,-99.2997"></path>
-<polyline fill="none" stroke="black" points="286.147,-99.2997 286.147,-150.7 "></polyline>
-<path fill="none" stroke="black" d="M286.147,-150.7C286.147,-156.7 280.147,-162.7 274.147,-162.7"></path>
-<text text-anchor="middle" x="219" y="-146" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="219" y="-129.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="219" y="-112.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="219" y="-95.6" font-family="Times,serif" font-size="14.00">Identifier (fuga)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_1-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M190.026,-318.681C193.772,-306.729 197.356,-294.025 200,-282 207.95,-245.85 212.809,-204.204 215.622,-173.04"></path>
-<polygon fill="black" stroke="black" points="219.124,-173.16 216.499,-162.896 212.15,-172.557 219.124,-173.16"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-187.601 11.8526,-187.601 -0.147372,-175.601 -0.147372,-74.3994 11.8526,-62.3994 122.147,-62.3994 134.147,-74.3994 134.147,-175.601 122.147,-187.601"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-187.601C5.85263,-187.601 -0.147372,-181.601 -0.147372,-175.601"></path>
-<path fill="white" stroke="white" d="M-0.147372,-74.3994C-0.147372,-68.3994 5.85263,-62.3994 11.8526,-62.3994"></path>
-<path fill="white" stroke="white" d="M122.147,-62.3994C128.147,-62.3994 134.147,-68.3994 134.147,-74.3994"></path>
-<path fill="white" stroke="white" d="M134.147,-175.601C134.147,-181.601 128.147,-187.601 122.147,-187.601"></path>
-<polyline fill="none" stroke="black" points="122.147,-187.601 11.8526,-187.601 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-187.601C5.85263,-187.601 -0.147372,-181.601 -0.147372,-175.601"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-175.601 -0.147372,-74.3994 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-74.3994C-0.147372,-68.3994 5.85263,-62.3994 11.8526,-62.3994"></path>
-<polyline fill="none" stroke="black" points="11.8526,-62.3994 122.147,-62.3994 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-62.3994C128.147,-62.3994 134.147,-68.3994 134.147,-74.3994"></path>
-<polyline fill="none" stroke="black" points="134.147,-74.3994 134.147,-175.601 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-175.601C134.147,-181.601 128.147,-187.601 122.147,-187.601"></path>
-<text text-anchor="middle" x="67" y="-171.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-154.4" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-137.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-120.8" font-family="Times,serif" font-size="14.00">Identifier (fuga)</text>
-<text text-anchor="middle" x="67" y="-104" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-87.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-70.4" font-family="Times,serif" font-size="14.00">Identifier (last)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M111.208,-223.723C107.527,-215.585 103.337,-206.324 99.038,-196.821"></path>
-<polygon fill="black" stroke="black" points="102.207,-195.333 94.896,-187.665 95.8289,-198.219 102.207,-195.333"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M145.32,-223.723C156.979,-208.26 171.698,-188.737 184.91,-171.214"></path>
-<polygon fill="black" stroke="black" points="188.029,-172.891 191.255,-162.799 182.44,-168.677 188.029,-172.891"></polygon>
-</g>
-
-<g id="edge10" class="edge"><title>s1_3-&gt;final</title>
-<path fill="none" stroke="black" d="M67,-62.2476C67,-53.0345 67,-44.0781 67,-36.4335"></path>
-<polygon fill="black" stroke="black" points="70.5001,-36.2949 67,-26.2949 63.5001,-36.2949 70.5001,-36.2949"></polygon>
-</g>
-
-<g id="edge12" class="edge"><title>s1_4-&gt;thrown</title>
-<path fill="none" stroke="black" d="M219,-87.3716C219,-69.6416 219,-49.034 219,-34.1808"></path>
-<polygon fill="black" stroke="black" points="222.5,-34.087 219,-24.087 215.5,-34.087 222.5,-34.087"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg b/eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg
deleted file mode 100644 (file)
index a912700..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0"?>
-<svg width="270pt" height="328pt" viewBox="0.00 0.00 270.00 328.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 324)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="125" cy="-311" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s2_1</title>
-<polygon fill="white" stroke="white" points="178.307,-265.3 71.6933,-265.3 59.6933,-253.3 59.6933,-168.7 71.6933,-156.7 178.307,-156.7 190.307,-168.7 190.307,-253.3 178.307,-265.3"></polygon>
-<path fill="white" stroke="white" d="M71.6933,-265.3C65.6933,-265.3 59.6933,-259.3 59.6933,-253.3"></path>
-<path fill="white" stroke="white" d="M59.6933,-168.7C59.6933,-162.7 65.6933,-156.7 71.6933,-156.7"></path>
-<path fill="white" stroke="white" d="M178.307,-156.7C184.307,-156.7 190.307,-162.7 190.307,-168.7"></path>
-<path fill="white" stroke="white" d="M190.307,-253.3C190.307,-259.3 184.307,-265.3 178.307,-265.3"></path>
-<polyline fill="none" stroke="black" points="178.307,-265.3 71.6933,-265.3 "></polyline>
-<path fill="none" stroke="black" d="M71.6933,-265.3C65.6933,-265.3 59.6933,-259.3 59.6933,-253.3"></path>
-<polyline fill="none" stroke="black" points="59.6933,-253.3 59.6933,-168.7 "></polyline>
-<path fill="none" stroke="black" d="M59.6933,-168.7C59.6933,-162.7 65.6933,-156.7 71.6933,-156.7"></path>
-<polyline fill="none" stroke="black" points="71.6933,-156.7 178.307,-156.7 "></polyline>
-<path fill="none" stroke="black" d="M178.307,-156.7C184.307,-156.7 190.307,-162.7 190.307,-168.7"></path>
-<polyline fill="none" stroke="black" points="190.307,-168.7 190.307,-253.3 "></polyline>
-<path fill="none" stroke="black" d="M190.307,-253.3C190.307,-259.3 184.307,-265.3 178.307,-265.3"></path>
-<text text-anchor="middle" x="125" y="-248.8" font-family="Times,serif" font-size="14.00">FunctionDeclaration</text>
-<text text-anchor="middle" x="125" y="-232" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="125" y="-215.2" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="125" y="-198.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="125" y="-181.6" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="125" y="-164.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s2_1</title>
-<path fill="none" stroke="black" d="M125,-301.98C125,-295.675 125,-286.238 125,-275.813"></path>
-<polygon fill="black" stroke="black" points="128.5,-275.586 125,-265.586 121.5,-275.586 128.5,-275.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="125" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="125" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s2_2</title>
-<polygon fill="white" stroke="white" points="98.0684,-111.602 11.9316,-111.602 -0.0684189,-99.6019 -0.0684189,-82.3981 11.9316,-70.3981 98.0684,-70.3981 110.068,-82.3981 110.068,-99.6019 98.0684,-111.602"></polygon>
-<path fill="white" stroke="white" d="M11.9316,-111.602C5.93158,-111.602 -0.0684189,-105.602 -0.0684189,-99.6019"></path>
-<path fill="white" stroke="white" d="M-0.0684189,-82.3981C-0.0684189,-76.3981 5.93158,-70.3981 11.9316,-70.3981"></path>
-<path fill="white" stroke="white" d="M98.0684,-70.3981C104.068,-70.3981 110.068,-76.3981 110.068,-82.3981"></path>
-<path fill="white" stroke="white" d="M110.068,-99.6019C110.068,-105.602 104.068,-111.602 98.0684,-111.602"></path>
-<polyline fill="none" stroke="black" points="98.0684,-111.602 11.9316,-111.602 "></polyline>
-<path fill="none" stroke="black" d="M11.9316,-111.602C5.93158,-111.602 -0.0684189,-105.602 -0.0684189,-99.6019"></path>
-<polyline fill="none" stroke="black" points="-0.0684189,-99.6019 -0.0684189,-82.3981 "></polyline>
-<path fill="none" stroke="black" d="M-0.0684189,-82.3981C-0.0684189,-76.3981 5.93158,-70.3981 11.9316,-70.3981"></path>
-<polyline fill="none" stroke="black" points="11.9316,-70.3981 98.0684,-70.3981 "></polyline>
-<path fill="none" stroke="black" d="M98.0684,-70.3981C104.068,-70.3981 110.068,-76.3981 110.068,-82.3981"></path>
-<polyline fill="none" stroke="black" points="110.068,-82.3981 110.068,-99.6019 "></polyline>
-<path fill="none" stroke="black" d="M110.068,-99.6019C110.068,-105.602 104.068,-111.602 98.0684,-111.602"></path>
-<text text-anchor="middle" x="55" y="-95.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="55" y="-78.4" font-family="Times,serif" font-size="14.00">ReturnStatement</text>
-</g>
-
-<g id="edge3" class="edge"><title>s2_1-&gt;s2_2</title>
-<path fill="none" stroke="black" d="M93.277,-156.524C85.8726,-144.042 78.2709,-131.228 71.813,-120.342"></path>
-<polygon fill="black" stroke="black" points="74.7991,-118.516 66.6869,-111.701 68.7787,-122.087 74.7991,-118.516"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s2_4</title>
-<polygon fill="white" stroke="white" points="250.147,-120.401 139.853,-120.401 127.853,-108.401 127.853,-73.5986 139.853,-61.5986 250.147,-61.5986 262.147,-73.5986 262.147,-108.401 250.147,-120.401"></polygon>
-<path fill="white" stroke="white" d="M139.853,-120.401C133.853,-120.401 127.853,-114.401 127.853,-108.401"></path>
-<path fill="white" stroke="white" d="M127.853,-73.5986C127.853,-67.5986 133.853,-61.5986 139.853,-61.5986"></path>
-<path fill="white" stroke="white" d="M250.147,-61.5986C256.147,-61.5986 262.147,-67.5986 262.147,-73.5986"></path>
-<path fill="white" stroke="white" d="M262.147,-108.401C262.147,-114.401 256.147,-120.401 250.147,-120.401"></path>
-<polyline fill="none" stroke="black" points="250.147,-120.401 139.853,-120.401 "></polyline>
-<path fill="none" stroke="black" d="M139.853,-120.401C133.853,-120.401 127.853,-114.401 127.853,-108.401"></path>
-<polyline fill="none" stroke="black" points="127.853,-108.401 127.853,-73.5986 "></polyline>
-<path fill="none" stroke="black" d="M127.853,-73.5986C127.853,-67.5986 133.853,-61.5986 139.853,-61.5986"></path>
-<polyline fill="none" stroke="black" points="139.853,-61.5986 250.147,-61.5986 "></polyline>
-<path fill="none" stroke="black" d="M250.147,-61.5986C256.147,-61.5986 262.147,-67.5986 262.147,-73.5986"></path>
-<polyline fill="none" stroke="black" points="262.147,-73.5986 262.147,-108.401 "></polyline>
-<path fill="none" stroke="black" d="M262.147,-108.401C262.147,-114.401 256.147,-120.401 250.147,-120.401"></path>
-<text text-anchor="middle" x="195" y="-103.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="195" y="-86.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="195" y="-70" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge5" class="edge"><title>s2_1-&gt;s2_4</title>
-<path fill="none" stroke="black" d="M156.723,-156.524C162.2,-147.291 167.785,-137.877 172.935,-129.195"></path>
-<polygon fill="black" stroke="black" points="176.03,-130.838 178.122,-120.452 170.01,-127.267 176.03,-130.838"></polygon>
-</g>
-
-<g id="edge7" class="edge"><title>s2_2-&gt;final</title>
-<path fill="none" stroke="black" d="M73.3917,-70.0319C84.6046,-57.8578 98.7782,-42.4693 109.434,-30.9007"></path>
-<polygon fill="black" stroke="black" points="112.278,-32.9792 116.478,-23.2526 107.129,-28.2369 112.278,-32.9792"></polygon>
-</g>
-
-<g id="edge9" class="edge"><title>s2_4-&gt;final</title>
-<path fill="none" stroke="black" d="M168.935,-61.7004C159.292,-51.2315 148.68,-39.7098 140.301,-30.6129"></path>
-<polygon fill="black" stroke="black" points="142.676,-28.0244 133.326,-23.0401 137.527,-32.7668 142.676,-28.0244"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg b/eslint/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg
deleted file mode 100644 (file)
index 7bde3ea..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<svg width="142pt" height="234pt" viewBox="0.00 0.00 142.00 234.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 230)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="67" cy="-217" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="122.147,-171.3 11.8526,-171.3 -0.147372,-159.3 -0.147372,-74.6998 11.8526,-62.6998 122.147,-62.6998 134.147,-74.6998 134.147,-159.3 122.147,-171.3"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-171.3C5.85263,-171.3 -0.147372,-165.3 -0.147372,-159.3"></path>
-<path fill="white" stroke="white" d="M-0.147372,-74.6998C-0.147372,-68.6998 5.85263,-62.6998 11.8526,-62.6998"></path>
-<path fill="white" stroke="white" d="M122.147,-62.6998C128.147,-62.6998 134.147,-68.6998 134.147,-74.6998"></path>
-<path fill="white" stroke="white" d="M134.147,-159.3C134.147,-165.3 128.147,-171.3 122.147,-171.3"></path>
-<polyline fill="none" stroke="black" points="122.147,-171.3 11.8526,-171.3 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-171.3C5.85263,-171.3 -0.147372,-165.3 -0.147372,-159.3"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-159.3 -0.147372,-74.6998 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-74.6998C-0.147372,-68.6998 5.85263,-62.6998 11.8526,-62.6998"></path>
-<polyline fill="none" stroke="black" points="11.8526,-62.6998 122.147,-62.6998 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-62.6998C128.147,-62.6998 134.147,-68.6998 134.147,-74.6998"></path>
-<polyline fill="none" stroke="black" points="134.147,-74.6998 134.147,-159.3 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-159.3C134.147,-165.3 128.147,-171.3 122.147,-171.3"></path>
-<text text-anchor="middle" x="67" y="-154.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="67" y="-138" font-family="Times,serif" font-size="14.00">FunctionDeclaration</text>
-<text text-anchor="middle" x="67" y="-121.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-104.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-87.6" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-70.8" font-family="Times,serif" font-size="14.00">Literal (false)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M67,-207.98C67,-201.675 67,-192.238 67,-181.813"></path>
-<polygon fill="black" stroke="black" points="70.5001,-181.586 67,-171.586 63.5001,-181.586 70.5001,-181.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="67" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="67" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;final</title>
-<path fill="none" stroke="black" d="M67,-62.6102C67,-53.3058 67,-44.1078 67,-36.2584"></path>
-<polygon fill="black" stroke="black" points="70.5001,-36.1896 67,-26.1896 63.5001,-36.1897 70.5001,-36.1896"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/example-whilestatement.svg b/eslint/docs/developer-guide/code-path-analysis/example-whilestatement.svg
deleted file mode 100644 (file)
index d833dc0..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0"?>
-<svg width="408pt" height="416pt" viewBox="0.00 0.00 408.00 416.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 412)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="193" cy="-399" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="234.149,-353.602 151.851,-353.602 139.851,-341.602 139.851,-324.398 151.851,-312.398 234.149,-312.398 246.149,-324.398 246.149,-341.602 234.149,-353.602"></polygon>
-<path fill="white" stroke="white" d="M151.851,-353.602C145.851,-353.602 139.851,-347.602 139.851,-341.602"></path>
-<path fill="white" stroke="white" d="M139.851,-324.398C139.851,-318.398 145.851,-312.398 151.851,-312.398"></path>
-<path fill="white" stroke="white" d="M234.149,-312.398C240.149,-312.398 246.149,-318.398 246.149,-324.398"></path>
-<path fill="white" stroke="white" d="M246.149,-341.602C246.149,-347.602 240.149,-353.602 234.149,-353.602"></path>
-<polyline fill="none" stroke="black" points="234.149,-353.602 151.851,-353.602 "></polyline>
-<path fill="none" stroke="black" d="M151.851,-353.602C145.851,-353.602 139.851,-347.602 139.851,-341.602"></path>
-<polyline fill="none" stroke="black" points="139.851,-341.602 139.851,-324.398 "></polyline>
-<path fill="none" stroke="black" d="M139.851,-324.398C139.851,-318.398 145.851,-312.398 151.851,-312.398"></path>
-<polyline fill="none" stroke="black" points="151.851,-312.398 234.149,-312.398 "></polyline>
-<path fill="none" stroke="black" d="M234.149,-312.398C240.149,-312.398 246.149,-318.398 246.149,-324.398"></path>
-<polyline fill="none" stroke="black" points="246.149,-324.398 246.149,-341.602 "></polyline>
-<path fill="none" stroke="black" d="M246.149,-341.602C246.149,-347.602 240.149,-353.602 234.149,-353.602"></path>
-<text text-anchor="middle" x="193" y="-337.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="193" y="-320.4" font-family="Times,serif" font-size="14.00">WhileStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M193,-389.894C193,-383.274 193,-373.485 193,-363.94"></path>
-<polygon fill="black" stroke="black" points="196.5,-363.842 193,-353.842 189.5,-363.842 196.5,-363.842"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="335" cy="-29" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="335" cy="-29" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="224.339,-276 161.661,-276 149.661,-264 149.661,-252 161.661,-240 224.339,-240 236.339,-252 236.339,-264 224.339,-276"></polygon>
-<path fill="white" stroke="white" d="M161.661,-276C155.661,-276 149.661,-270 149.661,-264"></path>
-<path fill="white" stroke="white" d="M149.661,-252C149.661,-246 155.661,-240 161.661,-240"></path>
-<path fill="white" stroke="white" d="M224.339,-240C230.339,-240 236.339,-246 236.339,-252"></path>
-<path fill="white" stroke="white" d="M236.339,-264C236.339,-270 230.339,-276 224.339,-276"></path>
-<polyline fill="none" stroke="black" points="224.339,-276 161.661,-276 "></polyline>
-<path fill="none" stroke="black" d="M161.661,-276C155.661,-276 149.661,-270 149.661,-264"></path>
-<polyline fill="none" stroke="black" points="149.661,-264 149.661,-252 "></polyline>
-<path fill="none" stroke="black" d="M149.661,-252C149.661,-246 155.661,-240 161.661,-240"></path>
-<polyline fill="none" stroke="black" points="161.661,-240 224.339,-240 "></polyline>
-<path fill="none" stroke="black" d="M224.339,-240C230.339,-240 236.339,-246 236.339,-252"></path>
-<polyline fill="none" stroke="black" points="236.339,-252 236.339,-264 "></polyline>
-<path fill="none" stroke="black" d="M236.339,-264C236.339,-270 230.339,-276 224.339,-276"></path>
-<text text-anchor="middle" x="193" y="-253.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M193,-312.052C193,-304.216 193,-295.089 193,-286.636"></path>
-<polygon fill="black" stroke="black" points="196.5,-286.439 193,-276.439 189.5,-286.439 196.5,-286.439"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="201.147,-203.3 90.8526,-203.3 78.8526,-191.3 78.8526,-106.7 90.8526,-94.6998 201.147,-94.6998 213.147,-106.7 213.147,-191.3 201.147,-203.3"></polygon>
-<path fill="white" stroke="white" d="M90.8526,-203.3C84.8526,-203.3 78.8526,-197.3 78.8526,-191.3"></path>
-<path fill="white" stroke="white" d="M78.8526,-106.7C78.8526,-100.7 84.8526,-94.6998 90.8526,-94.6998"></path>
-<path fill="white" stroke="white" d="M201.147,-94.6998C207.147,-94.6998 213.147,-100.7 213.147,-106.7"></path>
-<path fill="white" stroke="white" d="M213.147,-191.3C213.147,-197.3 207.147,-203.3 201.147,-203.3"></path>
-<polyline fill="none" stroke="black" points="201.147,-203.3 90.8526,-203.3 "></polyline>
-<path fill="none" stroke="black" d="M90.8526,-203.3C84.8526,-203.3 78.8526,-197.3 78.8526,-191.3"></path>
-<polyline fill="none" stroke="black" points="78.8526,-191.3 78.8526,-106.7 "></polyline>
-<path fill="none" stroke="black" d="M78.8526,-106.7C78.8526,-100.7 84.8526,-94.6998 90.8526,-94.6998"></path>
-<polyline fill="none" stroke="black" points="90.8526,-94.6998 201.147,-94.6998 "></polyline>
-<path fill="none" stroke="black" d="M201.147,-94.6998C207.147,-94.6998 213.147,-100.7 213.147,-106.7"></path>
-<polyline fill="none" stroke="black" points="213.147,-106.7 213.147,-191.3 "></polyline>
-<path fill="none" stroke="black" d="M213.147,-191.3C213.147,-197.3 207.147,-203.3 201.147,-203.3"></path>
-<text text-anchor="middle" x="146" y="-186.8" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="146" y="-170" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="146" y="-153.2" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="146" y="-136.4" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="146" y="-119.6" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="146" y="-102.8" font-family="Times,serif" font-size="14.00">Identifier (b)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M185.449,-239.809C182.111,-232.21 177.961,-222.761 173.617,-212.872"></path>
-<polygon fill="black" stroke="black" points="176.817,-211.454 169.59,-203.706 170.408,-214.269 176.817,-211.454"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_7</title>
-<polygon fill="white" stroke="white" points="388.314,-169.602 281.686,-169.602 269.686,-157.602 269.686,-140.398 281.686,-128.398 388.314,-128.398 400.314,-140.398 400.314,-157.602 388.314,-169.602"></polygon>
-<path fill="white" stroke="white" d="M281.686,-169.602C275.686,-169.602 269.686,-163.602 269.686,-157.602"></path>
-<path fill="white" stroke="white" d="M269.686,-140.398C269.686,-134.398 275.686,-128.398 281.686,-128.398"></path>
-<path fill="white" stroke="white" d="M388.314,-128.398C394.314,-128.398 400.314,-134.398 400.314,-140.398"></path>
-<path fill="white" stroke="white" d="M400.314,-157.602C400.314,-163.602 394.314,-169.602 388.314,-169.602"></path>
-<polyline fill="none" stroke="black" points="388.314,-169.602 281.686,-169.602 "></polyline>
-<path fill="none" stroke="black" d="M281.686,-169.602C275.686,-169.602 269.686,-163.602 269.686,-157.602"></path>
-<polyline fill="none" stroke="black" points="269.686,-157.602 269.686,-140.398 "></polyline>
-<path fill="none" stroke="black" d="M269.686,-140.398C269.686,-134.398 275.686,-128.398 281.686,-128.398"></path>
-<polyline fill="none" stroke="black" points="281.686,-128.398 388.314,-128.398 "></polyline>
-<path fill="none" stroke="black" d="M388.314,-128.398C394.314,-128.398 400.314,-134.398 400.314,-140.398"></path>
-<polyline fill="none" stroke="black" points="400.314,-140.398 400.314,-157.602 "></polyline>
-<path fill="none" stroke="black" d="M400.314,-157.602C400.314,-163.602 394.314,-169.602 388.314,-169.602"></path>
-<text text-anchor="middle" x="335" y="-153.2" font-family="Times,serif" font-size="14.00">WhileStatement:exit</text>
-<text text-anchor="middle" x="335" y="-136.4" font-family="Times,serif" font-size="14.00">Program:exit</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_2-&gt;s1_7</title>
-<path fill="none" stroke="black" d="M215.815,-239.809C238.735,-222.537 274.341,-195.708 300.672,-175.867"></path>
-<polygon fill="black" stroke="black" points="302.987,-178.505 308.867,-169.692 298.774,-172.914 302.987,-178.505"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="110.49,-49.6019 11.5095,-49.6019 -0.490457,-37.6019 -0.490457,-20.3981 11.5095,-8.3981 110.49,-8.3981 122.49,-20.3981 122.49,-37.6019 110.49,-49.6019"></polygon>
-<path fill="white" stroke="white" d="M11.5095,-49.6019C5.50954,-49.6019 -0.490457,-43.6019 -0.490457,-37.6019"></path>
-<path fill="white" stroke="white" d="M-0.490457,-20.3981C-0.490457,-14.3981 5.50954,-8.3981 11.5095,-8.3981"></path>
-<path fill="white" stroke="white" d="M110.49,-8.3981C116.49,-8.3981 122.49,-14.3981 122.49,-20.3981"></path>
-<path fill="white" stroke="white" d="M122.49,-37.6019C122.49,-43.6019 116.49,-49.6019 110.49,-49.6019"></path>
-<polyline fill="none" stroke="black" points="110.49,-49.6019 11.5095,-49.6019 "></polyline>
-<path fill="none" stroke="black" d="M11.5095,-49.6019C5.50954,-49.6019 -0.490457,-43.6019 -0.490457,-37.6019"></path>
-<polyline fill="none" stroke="black" points="-0.490457,-37.6019 -0.490457,-20.3981 "></polyline>
-<path fill="none" stroke="black" d="M-0.490457,-20.3981C-0.490457,-14.3981 5.50954,-8.3981 11.5095,-8.3981"></path>
-<polyline fill="none" stroke="black" points="11.5095,-8.3981 110.49,-8.3981 "></polyline>
-<path fill="none" stroke="black" d="M110.49,-8.3981C116.49,-8.3981 122.49,-14.3981 122.49,-20.3981"></path>
-<polyline fill="none" stroke="black" points="122.49,-20.3981 122.49,-37.6019 "></polyline>
-<path fill="none" stroke="black" d="M122.49,-37.6019C122.49,-43.6019 116.49,-49.6019 110.49,-49.6019"></path>
-<text text-anchor="middle" x="61" y="-33.2" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="61" y="-16.4" font-family="Times,serif" font-size="14.00">ContinueStatement</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M107.479,-94.524C98.3982,-81.9176 89.0729,-68.9717 81.181,-58.0159"></path>
-<polygon fill="black" stroke="black" points="83.876,-55.7691 75.1912,-49.7007 78.1962,-59.8605 83.876,-55.7691"></polygon>
-</g>
-
-<g id="node8" class="node"><title>s1_6</title>
-<polygon fill="white" stroke="white" points="282.147,-58.4014 171.853,-58.4014 159.853,-46.4014 159.853,-11.5986 171.853,0.401379 282.147,0.401379 294.147,-11.5986 294.147,-46.4014 282.147,-58.4014"></polygon>
-<path fill="white" stroke="white" d="M171.853,-58.4014C165.853,-58.4014 159.853,-52.4014 159.853,-46.4014"></path>
-<path fill="white" stroke="white" d="M159.853,-11.5986C159.853,-5.59862 165.853,0.401379 171.853,0.401379"></path>
-<path fill="white" stroke="white" d="M282.147,0.401379C288.147,0.401379 294.147,-5.59862 294.147,-11.5986"></path>
-<path fill="white" stroke="white" d="M294.147,-46.4014C294.147,-52.4014 288.147,-58.4014 282.147,-58.4014"></path>
-<polyline fill="none" stroke="black" points="282.147,-58.4014 171.853,-58.4014 "></polyline>
-<path fill="none" stroke="black" d="M171.853,-58.4014C165.853,-58.4014 159.853,-52.4014 159.853,-46.4014"></path>
-<polyline fill="none" stroke="black" points="159.853,-46.4014 159.853,-11.5986 "></polyline>
-<path fill="none" stroke="black" d="M159.853,-11.5986C159.853,-5.59862 165.853,0.401379 171.853,0.401379"></path>
-<polyline fill="none" stroke="black" points="171.853,0.401379 282.147,0.401379 "></polyline>
-<path fill="none" stroke="black" d="M282.147,0.401379C288.147,0.401379 294.147,-5.59862 294.147,-11.5986"></path>
-<polyline fill="none" stroke="black" points="294.147,-11.5986 294.147,-46.4014 "></polyline>
-<path fill="none" stroke="black" d="M294.147,-46.4014C294.147,-52.4014 288.147,-58.4014 282.147,-58.4014"></path>
-<text text-anchor="middle" x="227" y="-41.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="227" y="-24.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="227" y="-8" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge9" class="edge"><title>s1_3-&gt;s1_6</title>
-<path fill="none" stroke="black" d="M182.708,-94.524C189.112,-85.1942 195.644,-75.6786 201.656,-66.9212"></path>
-<polygon fill="black" stroke="black" points="204.696,-68.677 207.47,-58.4517 198.925,-64.7154 204.696,-68.677"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M55.8178,-49.8729C48.0052,-84.5943 37.3518,-157.069 70,-204 86.0013,-227.001 114.192,-240.092 139.552,-247.506"></path>
-<polygon fill="black" stroke="black" points="138.9,-250.955 149.466,-250.168 140.715,-244.194 138.9,-250.955"></polygon>
-</g>
-
-<g id="edge12" class="edge"><title>s1_7-&gt;final</title>
-<path fill="none" stroke="black" d="M335,-128.249C335,-107.258 335,-74.136 335,-52.2408"></path>
-<polygon fill="black" stroke="black" points="338.5,-52.2172 335,-42.2173 331.5,-52.2173 338.5,-52.2172"></polygon>
-</g>
-
-<g id="edge10" class="edge"><title>s1_6-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M230.184,-58.3131C233.209,-93.2424 235.52,-154.122 222,-204 219.488,-213.268 215.064,-222.685 210.417,-230.959"></path>
-<polygon fill="black" stroke="black" points="207.291,-229.367 205.165,-239.747 213.299,-232.958 207.291,-229.367"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/helo.svg b/eslint/docs/developer-guide/code-path-analysis/helo.svg
deleted file mode 100644 (file)
index e2dd9f2..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0"?>
-<svg width="238pt" height="478pt" viewBox="0.00 0.00 238.00 478.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 474)">
-<title>Code Path 1</title>
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="164" cy="-461" rx="9" ry="9"></ellipse>
-</g>
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="212.228,-415.7 115.772,-415.7 103.772,-403.7 103.772,-352.3 115.772,-340.3 212.228,-340.3 224.228,-352.3 224.228,-403.7 212.228,-415.7"></polygon>
-<path fill="white" stroke="white" d="M115.772,-415.7C109.772,-415.7 103.772,-409.7 103.772,-403.7"></path>
-<path fill="white" stroke="white" d="M103.772,-352.3C103.772,-346.3 109.772,-340.3 115.772,-340.3"></path>
-<path fill="white" stroke="white" d="M212.228,-340.3C218.228,-340.3 224.228,-346.3 224.228,-352.3"></path>
-<path fill="white" stroke="white" d="M224.228,-403.7C224.228,-409.7 218.228,-415.7 212.228,-415.7"></path>
-<polyline fill="none" stroke="black" points="212.228,-415.7 115.772,-415.7 "></polyline>
-<path fill="none" stroke="black" d="M115.772,-415.7C109.772,-415.7 103.772,-409.7 103.772,-403.7"></path>
-<polyline fill="none" stroke="black" points="103.772,-403.7 103.772,-352.3 "></polyline>
-<path fill="none" stroke="black" d="M103.772,-352.3C103.772,-346.3 109.772,-340.3 115.772,-340.3"></path>
-<polyline fill="none" stroke="black" points="115.772,-340.3 212.228,-340.3 "></polyline>
-<path fill="none" stroke="black" d="M212.228,-340.3C218.228,-340.3 224.228,-346.3 224.228,-352.3"></path>
-<polyline fill="none" stroke="black" points="224.228,-352.3 224.228,-403.7 "></polyline>
-<path fill="none" stroke="black" d="M224.228,-403.7C224.228,-409.7 218.228,-415.7 212.228,-415.7"></path>
-<text text-anchor="middle" x="164" y="-399" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="164" y="-382.2" font-family="Times,serif" font-size="14.00">IfStatement</text>
-<text text-anchor="middle" x="164" y="-365.4" font-family="Times,serif" font-size="14.00">LogicalExpression</text>
-<text text-anchor="middle" x="164" y="-348.6" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M164,-451.937C164,-445.515 164,-435.952 164,-425.848"></path>
-<polygon fill="black" stroke="black" points="167.5,-425.66 164,-415.66 160.5,-425.66 167.5,-425.66"></polygon>
-</g>
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="162" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="162" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="159.429,-304 96.5714,-304 84.5714,-292 84.5714,-280 96.5714,-268 159.429,-268 171.429,-280 171.429,-292 159.429,-304"></polygon>
-<path fill="white" stroke="white" d="M96.5714,-304C90.5714,-304 84.5714,-298 84.5714,-292"></path>
-<path fill="white" stroke="white" d="M84.5714,-280C84.5714,-274 90.5714,-268 96.5714,-268"></path>
-<path fill="white" stroke="white" d="M159.429,-268C165.429,-268 171.429,-274 171.429,-280"></path>
-<path fill="white" stroke="white" d="M171.429,-292C171.429,-298 165.429,-304 159.429,-304"></path>
-<polyline fill="none" stroke="black" points="159.429,-304 96.5714,-304 "></polyline>
-<path fill="none" stroke="black" d="M96.5714,-304C90.5714,-304 84.5714,-298 84.5714,-292"></path>
-<polyline fill="none" stroke="black" points="84.5714,-292 84.5714,-280 "></polyline>
-<path fill="none" stroke="black" d="M84.5714,-280C84.5714,-274 90.5714,-268 96.5714,-268"></path>
-<polyline fill="none" stroke="black" points="96.5714,-268 159.429,-268 "></polyline>
-<path fill="none" stroke="black" d="M159.429,-268C165.429,-268 171.429,-274 171.429,-280"></path>
-<polyline fill="none" stroke="black" points="171.429,-280 171.429,-292 "></polyline>
-<path fill="none" stroke="black" d="M171.429,-292C171.429,-298 165.429,-304 159.429,-304"></path>
-<text text-anchor="middle" x="128" y="-281.8" font-family="Times,serif" font-size="14.00">Identifier (b)</text>
-</g>
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M149.357,-340.394C145.815,-331.536 142.092,-322.229 138.765,-313.912"></path>
-<polygon fill="black" stroke="black" points="141.905,-312.338 134.941,-304.353 135.405,-314.938 141.905,-312.338"></polygon>
-</g>
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="217.147,-120.401 106.853,-120.401 94.8526,-108.401 94.8526,-73.5986 106.853,-61.5986 217.147,-61.5986 229.147,-73.5986 229.147,-108.401 217.147,-120.401"></polygon>
-<path fill="white" stroke="white" d="M106.853,-120.401C100.853,-120.401 94.8526,-114.401 94.8526,-108.401"></path>
-<path fill="white" stroke="white" d="M94.8526,-73.5986C94.8526,-67.5986 100.853,-61.5986 106.853,-61.5986"></path>
-<path fill="white" stroke="white" d="M217.147,-61.5986C223.147,-61.5986 229.147,-67.5986 229.147,-73.5986"></path>
-<path fill="white" stroke="white" d="M229.147,-108.401C229.147,-114.401 223.147,-120.401 217.147,-120.401"></path>
-<polyline fill="none" stroke="black" points="217.147,-120.401 106.853,-120.401 "></polyline>
-<path fill="none" stroke="black" d="M106.853,-120.401C100.853,-120.401 94.8526,-114.401 94.8526,-108.401"></path>
-<polyline fill="none" stroke="black" points="94.8526,-108.401 94.8526,-73.5986 "></polyline>
-<path fill="none" stroke="black" d="M94.8526,-73.5986C94.8526,-67.5986 100.853,-61.5986 106.853,-61.5986"></path>
-<polyline fill="none" stroke="black" points="106.853,-61.5986 217.147,-61.5986 "></polyline>
-<path fill="none" stroke="black" d="M217.147,-61.5986C223.147,-61.5986 229.147,-67.5986 229.147,-73.5986"></path>
-<polyline fill="none" stroke="black" points="229.147,-73.5986 229.147,-108.401 "></polyline>
-<path fill="none" stroke="black" d="M229.147,-108.401C229.147,-114.401 223.147,-120.401 217.147,-120.401"></path>
-<text text-anchor="middle" x="162" y="-103.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="162" y="-86.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="162" y="-70" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-<g id="edge7" class="edge"><title>s1_1-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M173.704,-340.118C176.287,-328.633 178.715,-315.867 180,-304 186.559,-243.442 177.199,-172.935 169.707,-130.425"></path>
-<polygon fill="black" stroke="black" points="173.135,-129.714 167.902,-120.501 166.248,-130.966 173.135,-129.714"></polygon>
-</g>
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-231.7 11.8526,-231.7 -0.147372,-219.7 -0.147372,-168.3 11.8526,-156.3 122.147,-156.3 134.147,-168.3 134.147,-219.7 122.147,-231.7"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-231.7C5.85263,-231.7 -0.147372,-225.7 -0.147372,-219.7"></path>
-<path fill="white" stroke="white" d="M-0.147372,-168.3C-0.147372,-162.3 5.85263,-156.3 11.8526,-156.3"></path>
-<path fill="white" stroke="white" d="M122.147,-156.3C128.147,-156.3 134.147,-162.3 134.147,-168.3"></path>
-<path fill="white" stroke="white" d="M134.147,-219.7C134.147,-225.7 128.147,-231.7 122.147,-231.7"></path>
-<polyline fill="none" stroke="black" points="122.147,-231.7 11.8526,-231.7 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-231.7C5.85263,-231.7 -0.147372,-225.7 -0.147372,-219.7"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-219.7 -0.147372,-168.3 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-168.3C-0.147372,-162.3 5.85263,-156.3 11.8526,-156.3"></path>
-<polyline fill="none" stroke="black" points="11.8526,-156.3 122.147,-156.3 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-156.3C128.147,-156.3 134.147,-162.3 134.147,-168.3"></path>
-<polyline fill="none" stroke="black" points="134.147,-168.3 134.147,-219.7 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-219.7C134.147,-225.7 128.147,-231.7 122.147,-231.7"></path>
-<text text-anchor="middle" x="67" y="-215" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-198.2" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-181.4" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-164.6" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M116.239,-267.647C110.883,-259.746 104.269,-249.988 97.6462,-240.216"></path>
-<polygon fill="black" stroke="black" points="100.363,-237.985 91.855,-231.671 94.5683,-241.913 100.363,-237.985"></polygon>
-</g>
-<g id="edge9" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M133.482,-267.966C136.637,-257.648 140.465,-244.17 143,-232 150.074,-198.038 155.131,-158.871 158.24,-130.616"></path>
-<polygon fill="black" stroke="black" points="161.754,-130.67 159.337,-120.355 154.794,-129.926 161.754,-130.67"></polygon>
-</g>
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M101.566,-156.251C110.27,-146.997 119.601,-137.077 128.264,-127.867"></path>
-<polygon fill="black" stroke="black" points="131.053,-130.01 135.355,-120.328 125.954,-125.214 131.053,-130.01"></polygon>
-</g>
-<g id="edge10" class="edge"><title>s1_4-&gt;final</title>
-<path fill="none" stroke="black" d="M162,-61.7004C162,-53.2282 162,-44.0665 162,-36.0585"></path>
-<polygon fill="black" stroke="black" points="165.5,-36.0267 162,-26.0267 158.5,-36.0267 165.5,-36.0267"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg
deleted file mode 100644 (file)
index 4975540..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<svg width="136pt" height="344pt" viewBox="0.00 0.00 136.00 344.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 340)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="64" cy="-327" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="116.617,-281.3 11.3833,-281.3 -0.616716,-269.3 -0.616716,-184.7 11.3833,-172.7 116.617,-172.7 128.617,-184.7 128.617,-269.3 116.617,-281.3"></polygon>
-<path fill="white" stroke="white" d="M11.3833,-281.3C5.38328,-281.3 -0.616716,-275.3 -0.616716,-269.3"></path>
-<path fill="white" stroke="white" d="M-0.616716,-184.7C-0.616716,-178.7 5.38328,-172.7 11.3833,-172.7"></path>
-<path fill="white" stroke="white" d="M116.617,-172.7C122.617,-172.7 128.617,-178.7 128.617,-184.7"></path>
-<path fill="white" stroke="white" d="M128.617,-269.3C128.617,-275.3 122.617,-281.3 116.617,-281.3"></path>
-<polyline fill="none" stroke="black" points="116.617,-281.3 11.3833,-281.3 "></polyline>
-<path fill="none" stroke="black" d="M11.3833,-281.3C5.38328,-281.3 -0.616716,-275.3 -0.616716,-269.3"></path>
-<polyline fill="none" stroke="black" points="-0.616716,-269.3 -0.616716,-184.7 "></polyline>
-<path fill="none" stroke="black" d="M-0.616716,-184.7C-0.616716,-178.7 5.38328,-172.7 11.3833,-172.7"></path>
-<polyline fill="none" stroke="black" points="11.3833,-172.7 116.617,-172.7 "></polyline>
-<path fill="none" stroke="black" d="M116.617,-172.7C122.617,-172.7 128.617,-178.7 128.617,-184.7"></path>
-<polyline fill="none" stroke="black" points="128.617,-184.7 128.617,-269.3 "></polyline>
-<path fill="none" stroke="black" d="M128.617,-269.3C128.617,-275.3 122.617,-281.3 116.617,-281.3"></path>
-<text text-anchor="middle" x="64" y="-264.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="64" y="-248" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="64" y="-231.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="64" y="-214.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="64" y="-197.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="64" y="-180.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M64,-317.98C64,-311.675 64,-302.238 64,-291.813"></path>
-<polygon fill="black" stroke="black" points="67.5001,-291.586 64,-281.586 60.5001,-291.586 67.5001,-291.586"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="110.233,-136.401 17.7673,-136.401 5.76729,-124.401 5.76729,-89.5986 17.7673,-77.5986 110.233,-77.5986 122.233,-89.5986 122.233,-124.401 110.233,-136.401"></polygon>
-<path fill="white" stroke="white" d="M17.7673,-136.401C11.7673,-136.401 5.76729,-130.401 5.76729,-124.401"></path>
-<path fill="white" stroke="white" d="M5.76729,-89.5986C5.76729,-83.5986 11.7673,-77.5986 17.7673,-77.5986"></path>
-<path fill="white" stroke="white" d="M110.233,-77.5986C116.233,-77.5986 122.233,-83.5986 122.233,-89.5986"></path>
-<path fill="white" stroke="white" d="M122.233,-124.401C122.233,-130.401 116.233,-136.401 110.233,-136.401"></path>
-<polyline fill="none" stroke="black" points="110.233,-136.401 17.7673,-136.401 "></polyline>
-<path fill="none" stroke="black" d="M17.7673,-136.401C11.7673,-136.401 5.76729,-130.401 5.76729,-124.401"></path>
-<polyline fill="none" stroke="black" points="5.76729,-124.401 5.76729,-89.5986 "></polyline>
-<path fill="none" stroke="black" d="M5.76729,-89.5986C5.76729,-83.5986 11.7673,-77.5986 17.7673,-77.5986"></path>
-<polyline fill="none" stroke="black" points="17.7673,-77.5986 110.233,-77.5986 "></polyline>
-<path fill="none" stroke="black" d="M110.233,-77.5986C116.233,-77.5986 122.233,-83.5986 122.233,-89.5986"></path>
-<polyline fill="none" stroke="black" points="122.233,-89.5986 122.233,-124.401 "></polyline>
-<path fill="none" stroke="black" d="M122.233,-124.401C122.233,-130.401 116.233,-136.401 110.233,-136.401"></path>
-<text text-anchor="middle" x="64" y="-119.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="64" y="-102.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="64" y="-86" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M64,-172.524C64,-163.777 64,-154.867 64,-146.572"></path>
-<polygon fill="black" stroke="black" points="67.5001,-146.452 64,-136.452 60.5001,-146.452 67.5001,-146.452"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="110.977,-41.6019 17.0234,-41.6019 5.02345,-29.6019 5.02345,-12.3981 17.0234,-0.398095 110.977,-0.398095 122.977,-12.3981 122.977,-29.6019 110.977,-41.6019"></polygon>
-<path fill="white" stroke="white" d="M17.0234,-41.6019C11.0234,-41.6019 5.02345,-35.6019 5.02345,-29.6019"></path>
-<path fill="white" stroke="white" d="M5.02345,-12.3981C5.02345,-6.3981 11.0234,-0.398095 17.0234,-0.398095"></path>
-<path fill="white" stroke="white" d="M110.977,-0.398095C116.977,-0.398095 122.977,-6.3981 122.977,-12.3981"></path>
-<path fill="white" stroke="white" d="M122.977,-29.6019C122.977,-35.6019 116.977,-41.6019 110.977,-41.6019"></path>
-<polyline fill="none" stroke="black" points="110.977,-41.6019 17.0234,-41.6019 "></polyline>
-<path fill="none" stroke="black" d="M17.0234,-41.6019C11.0234,-41.6019 5.02345,-35.6019 5.02345,-29.6019"></path>
-<polyline fill="none" stroke="black" points="5.02345,-29.6019 5.02345,-12.3981 "></polyline>
-<path fill="none" stroke="black" d="M5.02345,-12.3981C5.02345,-6.3981 11.0234,-0.398095 17.0234,-0.398095"></path>
-<polyline fill="none" stroke="black" points="17.0234,-0.398095 110.977,-0.398095 "></polyline>
-<path fill="none" stroke="black" d="M110.977,-0.398095C116.977,-0.398095 122.977,-6.3981 122.977,-12.3981"></path>
-<polyline fill="none" stroke="black" points="122.977,-12.3981 122.977,-29.6019 "></polyline>
-<path fill="none" stroke="black" d="M122.977,-29.6019C122.977,-35.6019 116.977,-41.6019 110.977,-41.6019"></path>
-<text text-anchor="middle" x="64" y="-25.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="64" y="-8.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="none" d="M64,-77.5614C64,-69.2619 64,-60.1709 64,-51.7903"></path>
-<polygon fill="none" stroke="none" points="67.5001,-51.6677 64,-41.6677 60.5001,-51.6678 67.5001,-51.6677"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg
deleted file mode 100644 (file)
index d35bddf..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0"?>
-<svg width="278pt" height="394pt" viewBox="0.00 0.00 278.00 394.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 390)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="139" cy="-377" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="191.617,-331.3 86.3833,-331.3 74.3833,-319.3 74.3833,-234.7 86.3833,-222.7 191.617,-222.7 203.617,-234.7 203.617,-319.3 191.617,-331.3"></polygon>
-<path fill="white" stroke="white" d="M86.3833,-331.3C80.3833,-331.3 74.3833,-325.3 74.3833,-319.3"></path>
-<path fill="white" stroke="white" d="M74.3833,-234.7C74.3833,-228.7 80.3833,-222.7 86.3833,-222.7"></path>
-<path fill="white" stroke="white" d="M191.617,-222.7C197.617,-222.7 203.617,-228.7 203.617,-234.7"></path>
-<path fill="white" stroke="white" d="M203.617,-319.3C203.617,-325.3 197.617,-331.3 191.617,-331.3"></path>
-<polyline fill="none" stroke="black" points="191.617,-331.3 86.3833,-331.3 "></polyline>
-<path fill="none" stroke="black" d="M86.3833,-331.3C80.3833,-331.3 74.3833,-325.3 74.3833,-319.3"></path>
-<polyline fill="none" stroke="black" points="74.3833,-319.3 74.3833,-234.7 "></polyline>
-<path fill="none" stroke="black" d="M74.3833,-234.7C74.3833,-228.7 80.3833,-222.7 86.3833,-222.7"></path>
-<polyline fill="none" stroke="black" points="86.3833,-222.7 191.617,-222.7 "></polyline>
-<path fill="none" stroke="black" d="M191.617,-222.7C197.617,-222.7 203.617,-228.7 203.617,-234.7"></path>
-<polyline fill="none" stroke="black" points="203.617,-234.7 203.617,-319.3 "></polyline>
-<path fill="none" stroke="black" d="M203.617,-319.3C203.617,-325.3 197.617,-331.3 191.617,-331.3"></path>
-<text text-anchor="middle" x="139" y="-314.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="139" y="-298" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="139" y="-281.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="139" y="-264.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="139" y="-247.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="139" y="-230.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M139,-367.98C139,-361.675 139,-352.238 139,-341.813"></path>
-<polygon fill="black" stroke="black" points="142.5,-341.586 139,-331.586 135.5,-341.586 142.5,-341.586"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="185.233,-186.401 92.7673,-186.401 80.7673,-174.401 80.7673,-139.599 92.7673,-127.599 185.233,-127.599 197.233,-139.599 197.233,-174.401 185.233,-186.401"></polygon>
-<path fill="white" stroke="white" d="M92.7673,-186.401C86.7673,-186.401 80.7673,-180.401 80.7673,-174.401"></path>
-<path fill="white" stroke="white" d="M80.7673,-139.599C80.7673,-133.599 86.7673,-127.599 92.7673,-127.599"></path>
-<path fill="white" stroke="white" d="M185.233,-127.599C191.233,-127.599 197.233,-133.599 197.233,-139.599"></path>
-<path fill="white" stroke="white" d="M197.233,-174.401C197.233,-180.401 191.233,-186.401 185.233,-186.401"></path>
-<polyline fill="none" stroke="black" points="185.233,-186.401 92.7673,-186.401 "></polyline>
-<path fill="none" stroke="black" d="M92.7673,-186.401C86.7673,-186.401 80.7673,-180.401 80.7673,-174.401"></path>
-<polyline fill="none" stroke="black" points="80.7673,-174.401 80.7673,-139.599 "></polyline>
-<path fill="none" stroke="black" d="M80.7673,-139.599C80.7673,-133.599 86.7673,-127.599 92.7673,-127.599"></path>
-<polyline fill="none" stroke="black" points="92.7673,-127.599 185.233,-127.599 "></polyline>
-<path fill="none" stroke="black" d="M185.233,-127.599C191.233,-127.599 197.233,-133.599 197.233,-139.599"></path>
-<polyline fill="none" stroke="black" points="197.233,-139.599 197.233,-174.401 "></polyline>
-<path fill="none" stroke="black" d="M197.233,-174.401C197.233,-180.401 191.233,-186.401 185.233,-186.401"></path>
-<text text-anchor="middle" x="139" y="-169.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="139" y="-152.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="139" y="-136" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M139,-222.524C139,-213.777 139,-204.867 139,-196.572"></path>
-<polygon fill="black" stroke="black" points="142.5,-196.452 139,-186.452 135.5,-196.452 142.5,-196.452"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-92 11.8526,-92 -0.147372,-80 -0.147372,-12 11.8526,0 122.147,0 134.147,-12 134.147,-80 122.147,-92"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-92C5.85263,-92 -0.147372,-86 -0.147372,-80"></path>
-<path fill="white" stroke="white" d="M-0.147372,-12C-0.147372,-6 5.85263,0 11.8526,0"></path>
-<path fill="white" stroke="white" d="M122.147,0C128.147,0 134.147,-6 134.147,-12"></path>
-<path fill="white" stroke="white" d="M134.147,-80C134.147,-86 128.147,-92 122.147,-92"></path>
-<polyline fill="none" stroke="black" points="122.147,-92 11.8526,-92 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-92C5.85263,-92 -0.147372,-86 -0.147372,-80"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-80 -0.147372,-12 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-12C-0.147372,-6 5.85263,0 11.8526,0"></path>
-<polyline fill="none" stroke="black" points="11.8526,0 122.147,0 "></polyline>
-<path fill="none" stroke="black" d="M122.147,0C128.147,0 134.147,-6 134.147,-12"></path>
-<polyline fill="none" stroke="black" points="134.147,-12 134.147,-80 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-80C134.147,-86 128.147,-92 122.147,-92"></path>
-<text text-anchor="middle" x="67" y="-75.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-58.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-41.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-25" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-8.2" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M120.271,-127.646C114.784,-119.339 108.595,-109.971 102.429,-100.636"></path>
-<polygon fill="black" stroke="black" points="105.226,-98.519 96.7935,-92.1041 99.3848,-102.377 105.226,-98.519"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="257.977,-66.6019 164.023,-66.6019 152.023,-54.6019 152.023,-37.3981 164.023,-25.3981 257.977,-25.3981 269.977,-37.3981 269.977,-54.6019 257.977,-66.6019"></polygon>
-<path fill="white" stroke="white" d="M164.023,-66.6019C158.023,-66.6019 152.023,-60.6019 152.023,-54.6019"></path>
-<path fill="white" stroke="white" d="M152.023,-37.3981C152.023,-31.3981 158.023,-25.3981 164.023,-25.3981"></path>
-<path fill="white" stroke="white" d="M257.977,-25.3981C263.977,-25.3981 269.977,-31.3981 269.977,-37.3981"></path>
-<path fill="white" stroke="white" d="M269.977,-54.6019C269.977,-60.6019 263.977,-66.6019 257.977,-66.6019"></path>
-<polyline fill="none" stroke="black" points="257.977,-66.6019 164.023,-66.6019 "></polyline>
-<path fill="none" stroke="black" d="M164.023,-66.6019C158.023,-66.6019 152.023,-60.6019 152.023,-54.6019"></path>
-<polyline fill="none" stroke="black" points="152.023,-54.6019 152.023,-37.3981 "></polyline>
-<path fill="none" stroke="black" d="M152.023,-37.3981C152.023,-31.3981 158.023,-25.3981 164.023,-25.3981"></path>
-<polyline fill="none" stroke="black" points="164.023,-25.3981 257.977,-25.3981 "></polyline>
-<path fill="none" stroke="black" d="M257.977,-25.3981C263.977,-25.3981 269.977,-31.3981 269.977,-37.3981"></path>
-<polyline fill="none" stroke="black" points="269.977,-37.3981 269.977,-54.6019 "></polyline>
-<path fill="none" stroke="black" d="M269.977,-54.6019C269.977,-60.6019 263.977,-66.6019 257.977,-66.6019"></path>
-<text text-anchor="middle" x="211" y="-50.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="211" y="-33.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="none" d="M157.729,-127.646C168.417,-111.466 181.766,-91.2577 192.427,-75.1175"></path>
-<polygon fill="none" stroke="none" points="195.448,-76.8939 198.039,-66.6208 189.607,-73.0357 195.448,-76.8939"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg
deleted file mode 100644 (file)
index a1af0e6..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<svg width="186pt" height="472pt" viewBox="0.00 0.00 186.00 472.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 468)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-455" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="166.617,-409.3 61.3833,-409.3 49.3833,-397.3 49.3833,-312.7 61.3833,-300.7 166.617,-300.7 178.617,-312.7 178.617,-397.3 166.617,-409.3"></polygon>
-<path fill="white" stroke="white" d="M61.3833,-409.3C55.3833,-409.3 49.3833,-403.3 49.3833,-397.3"></path>
-<path fill="white" stroke="white" d="M49.3833,-312.7C49.3833,-306.7 55.3833,-300.7 61.3833,-300.7"></path>
-<path fill="white" stroke="white" d="M166.617,-300.7C172.617,-300.7 178.617,-306.7 178.617,-312.7"></path>
-<path fill="white" stroke="white" d="M178.617,-397.3C178.617,-403.3 172.617,-409.3 166.617,-409.3"></path>
-<polyline fill="none" stroke="black" points="166.617,-409.3 61.3833,-409.3 "></polyline>
-<path fill="none" stroke="black" d="M61.3833,-409.3C55.3833,-409.3 49.3833,-403.3 49.3833,-397.3"></path>
-<polyline fill="none" stroke="black" points="49.3833,-397.3 49.3833,-312.7 "></polyline>
-<path fill="none" stroke="black" d="M49.3833,-312.7C49.3833,-306.7 55.3833,-300.7 61.3833,-300.7"></path>
-<polyline fill="none" stroke="black" points="61.3833,-300.7 166.617,-300.7 "></polyline>
-<path fill="none" stroke="black" d="M166.617,-300.7C172.617,-300.7 178.617,-306.7 178.617,-312.7"></path>
-<polyline fill="none" stroke="black" points="178.617,-312.7 178.617,-397.3 "></polyline>
-<path fill="none" stroke="black" d="M178.617,-397.3C178.617,-403.3 172.617,-409.3 166.617,-409.3"></path>
-<text text-anchor="middle" x="114" y="-392.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="114" y="-376" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="114" y="-359.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="114" y="-342.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="114" y="-325.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="114" y="-308.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M114,-445.98C114,-439.675 114,-430.238 114,-419.813"></path>
-<polygon fill="black" stroke="black" points="117.5,-419.586 114,-409.586 110.5,-419.586 117.5,-419.586"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="160.233,-264.401 67.7673,-264.401 55.7673,-252.401 55.7673,-217.599 67.7673,-205.599 160.233,-205.599 172.233,-217.599 172.233,-252.401 160.233,-264.401"></polygon>
-<path fill="white" stroke="white" d="M67.7673,-264.401C61.7673,-264.401 55.7673,-258.401 55.7673,-252.401"></path>
-<path fill="white" stroke="white" d="M55.7673,-217.599C55.7673,-211.599 61.7673,-205.599 67.7673,-205.599"></path>
-<path fill="white" stroke="white" d="M160.233,-205.599C166.233,-205.599 172.233,-211.599 172.233,-217.599"></path>
-<path fill="white" stroke="white" d="M172.233,-252.401C172.233,-258.401 166.233,-264.401 160.233,-264.401"></path>
-<polyline fill="none" stroke="black" points="160.233,-264.401 67.7673,-264.401 "></polyline>
-<path fill="none" stroke="black" d="M67.7673,-264.401C61.7673,-264.401 55.7673,-258.401 55.7673,-252.401"></path>
-<polyline fill="none" stroke="black" points="55.7673,-252.401 55.7673,-217.599 "></polyline>
-<path fill="none" stroke="black" d="M55.7673,-217.599C55.7673,-211.599 61.7673,-205.599 67.7673,-205.599"></path>
-<polyline fill="none" stroke="black" points="67.7673,-205.599 160.233,-205.599 "></polyline>
-<path fill="none" stroke="black" d="M160.233,-205.599C166.233,-205.599 172.233,-211.599 172.233,-217.599"></path>
-<polyline fill="none" stroke="black" points="172.233,-217.599 172.233,-252.401 "></polyline>
-<path fill="none" stroke="black" d="M172.233,-252.401C172.233,-258.401 166.233,-264.401 160.233,-264.401"></path>
-<text text-anchor="middle" x="114" y="-247.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="114" y="-230.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="114" y="-214" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M114,-300.524C114,-291.777 114,-282.867 114,-274.572"></path>
-<polygon fill="black" stroke="black" points="117.5,-274.452 114,-264.452 110.5,-274.452 117.5,-274.452"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-170 11.8526,-170 -0.147372,-158 -0.147372,-90 11.8526,-78 122.147,-78 134.147,-90 134.147,-158 122.147,-170"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<path fill="white" stroke="white" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<path fill="white" stroke="white" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<path fill="white" stroke="white" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<polyline fill="none" stroke="black" points="122.147,-170 11.8526,-170 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-158 -0.147372,-90 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<polyline fill="none" stroke="black" points="11.8526,-78 122.147,-78 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<polyline fill="none" stroke="black" points="134.147,-90 134.147,-158 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M101.774,-205.646C98.3019,-197.594 94.3994,-188.543 90.4971,-179.493"></path>
-<polygon fill="black" stroke="black" points="93.6221,-177.901 86.4485,-170.104 87.1942,-180.673 93.6221,-177.901"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="160.977,-41.6019 67.0234,-41.6019 55.0234,-29.6019 55.0234,-12.3981 67.0234,-0.398095 160.977,-0.398095 172.977,-12.3981 172.977,-29.6019 160.977,-41.6019"></polygon>
-<path fill="white" stroke="white" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<path fill="white" stroke="white" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<path fill="white" stroke="white" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<path fill="white" stroke="white" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<polyline fill="none" stroke="black" points="160.977,-41.6019 67.0234,-41.6019 "></polyline>
-<path fill="none" stroke="black" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<polyline fill="none" stroke="black" points="55.0234,-29.6019 55.0234,-12.3981 "></polyline>
-<path fill="none" stroke="black" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<polyline fill="none" stroke="black" points="67.0234,-0.398095 160.977,-0.398095 "></polyline>
-<path fill="none" stroke="black" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<polyline fill="none" stroke="black" points="172.977,-12.3981 172.977,-29.6019 "></polyline>
-<path fill="none" stroke="black" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="red" d="M88.0256,-77.8174C92.2417,-68.7572 96.5653,-59.4661 100.445,-51.1281"></path>
-<polygon fill="red" stroke="red" points="103.718,-52.392 104.763,-41.8489 97.3711,-49.4386 103.718,-52.392"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="none" d="M127.225,-41.8137C133.324,-52.1325 139.891,-65.235 143,-78 152.676,-117.727 151.633,-130.033 143,-170 141.091,-178.837 137.857,-187.92 134.226,-196.368"></path>
-<polygon fill="none" stroke="none" points="130.985,-195.038 130.005,-205.588 137.35,-197.952 130.985,-195.038"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg
deleted file mode 100644 (file)
index a4ee87e..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<svg width="186pt" height="472pt" viewBox="0.00 0.00 186.00 472.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 468)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="114" cy="-455" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="166.617,-409.3 61.3833,-409.3 49.3833,-397.3 49.3833,-312.7 61.3833,-300.7 166.617,-300.7 178.617,-312.7 178.617,-397.3 166.617,-409.3"></polygon>
-<path fill="white" stroke="white" d="M61.3833,-409.3C55.3833,-409.3 49.3833,-403.3 49.3833,-397.3"></path>
-<path fill="white" stroke="white" d="M49.3833,-312.7C49.3833,-306.7 55.3833,-300.7 61.3833,-300.7"></path>
-<path fill="white" stroke="white" d="M166.617,-300.7C172.617,-300.7 178.617,-306.7 178.617,-312.7"></path>
-<path fill="white" stroke="white" d="M178.617,-397.3C178.617,-403.3 172.617,-409.3 166.617,-409.3"></path>
-<polyline fill="none" stroke="black" points="166.617,-409.3 61.3833,-409.3 "></polyline>
-<path fill="none" stroke="black" d="M61.3833,-409.3C55.3833,-409.3 49.3833,-403.3 49.3833,-397.3"></path>
-<polyline fill="none" stroke="black" points="49.3833,-397.3 49.3833,-312.7 "></polyline>
-<path fill="none" stroke="black" d="M49.3833,-312.7C49.3833,-306.7 55.3833,-300.7 61.3833,-300.7"></path>
-<polyline fill="none" stroke="black" points="61.3833,-300.7 166.617,-300.7 "></polyline>
-<path fill="none" stroke="black" d="M166.617,-300.7C172.617,-300.7 178.617,-306.7 178.617,-312.7"></path>
-<polyline fill="none" stroke="black" points="178.617,-312.7 178.617,-397.3 "></polyline>
-<path fill="none" stroke="black" d="M178.617,-397.3C178.617,-403.3 172.617,-409.3 166.617,-409.3"></path>
-<text text-anchor="middle" x="114" y="-392.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="114" y="-376" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="114" y="-359.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="114" y="-342.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="114" y="-325.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="114" y="-308.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M114,-445.98C114,-439.675 114,-430.238 114,-419.813"></path>
-<polygon fill="black" stroke="black" points="117.5,-419.586 114,-409.586 110.5,-419.586 117.5,-419.586"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="160.233,-264.401 67.7673,-264.401 55.7673,-252.401 55.7673,-217.599 67.7673,-205.599 160.233,-205.599 172.233,-217.599 172.233,-252.401 160.233,-264.401"></polygon>
-<path fill="white" stroke="white" d="M67.7673,-264.401C61.7673,-264.401 55.7673,-258.401 55.7673,-252.401"></path>
-<path fill="white" stroke="white" d="M55.7673,-217.599C55.7673,-211.599 61.7673,-205.599 67.7673,-205.599"></path>
-<path fill="white" stroke="white" d="M160.233,-205.599C166.233,-205.599 172.233,-211.599 172.233,-217.599"></path>
-<path fill="white" stroke="white" d="M172.233,-252.401C172.233,-258.401 166.233,-264.401 160.233,-264.401"></path>
-<polyline fill="none" stroke="black" points="160.233,-264.401 67.7673,-264.401 "></polyline>
-<path fill="none" stroke="black" d="M67.7673,-264.401C61.7673,-264.401 55.7673,-258.401 55.7673,-252.401"></path>
-<polyline fill="none" stroke="black" points="55.7673,-252.401 55.7673,-217.599 "></polyline>
-<path fill="none" stroke="black" d="M55.7673,-217.599C55.7673,-211.599 61.7673,-205.599 67.7673,-205.599"></path>
-<polyline fill="none" stroke="black" points="67.7673,-205.599 160.233,-205.599 "></polyline>
-<path fill="none" stroke="black" d="M160.233,-205.599C166.233,-205.599 172.233,-211.599 172.233,-217.599"></path>
-<polyline fill="none" stroke="black" points="172.233,-217.599 172.233,-252.401 "></polyline>
-<path fill="none" stroke="black" d="M172.233,-252.401C172.233,-258.401 166.233,-264.401 160.233,-264.401"></path>
-<text text-anchor="middle" x="114" y="-247.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="114" y="-230.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="114" y="-214" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M114,-300.524C114,-291.777 114,-282.867 114,-274.572"></path>
-<polygon fill="black" stroke="black" points="117.5,-274.452 114,-264.452 110.5,-274.452 117.5,-274.452"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-170 11.8526,-170 -0.147372,-158 -0.147372,-90 11.8526,-78 122.147,-78 134.147,-90 134.147,-158 122.147,-170"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<path fill="white" stroke="white" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<path fill="white" stroke="white" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<path fill="white" stroke="white" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<polyline fill="none" stroke="black" points="122.147,-170 11.8526,-170 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-158 -0.147372,-90 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<polyline fill="none" stroke="black" points="11.8526,-78 122.147,-78 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<polyline fill="none" stroke="black" points="134.147,-90 134.147,-158 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M101.774,-205.646C98.3019,-197.594 94.3994,-188.543 90.4971,-179.493"></path>
-<polygon fill="black" stroke="black" points="93.6221,-177.901 86.4485,-170.104 87.1942,-180.673 93.6221,-177.901"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="160.977,-41.6019 67.0234,-41.6019 55.0234,-29.6019 55.0234,-12.3981 67.0234,-0.398095 160.977,-0.398095 172.977,-12.3981 172.977,-29.6019 160.977,-41.6019"></polygon>
-<path fill="white" stroke="white" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<path fill="white" stroke="white" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<path fill="white" stroke="white" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<path fill="white" stroke="white" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<polyline fill="none" stroke="black" points="160.977,-41.6019 67.0234,-41.6019 "></polyline>
-<path fill="none" stroke="black" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<polyline fill="none" stroke="black" points="55.0234,-29.6019 55.0234,-12.3981 "></polyline>
-<path fill="none" stroke="black" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<polyline fill="none" stroke="black" points="67.0234,-0.398095 160.977,-0.398095 "></polyline>
-<path fill="none" stroke="black" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<polyline fill="none" stroke="black" points="172.977,-12.3981 172.977,-29.6019 "></polyline>
-<path fill="none" stroke="black" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M88.0256,-77.8174C92.2417,-68.7572 96.5653,-59.4661 100.445,-51.1281"></path>
-<polygon fill="black" stroke="black" points="103.718,-52.392 104.763,-41.8489 97.3711,-49.4386 103.718,-52.392"></polygon>
-</g>
-
-<g id="edge7" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="red" d="M127.225,-41.8137C133.324,-52.1325 139.891,-65.235 143,-78 152.676,-117.727 151.633,-130.033 143,-170 141.091,-178.837 137.857,-187.92 134.226,-196.368"></path>
-<polygon fill="red" stroke="red" points="130.985,-195.038 130.005,-205.588 137.35,-197.952 130.985,-195.038"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg
deleted file mode 100644 (file)
index cba3a01..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0"?>
-<svg width="332pt" height="472pt" viewBox="0.00 0.00 332.00 472.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 468)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="162" cy="-455" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="214.617,-409.3 109.383,-409.3 97.3833,-397.3 97.3833,-312.7 109.383,-300.7 214.617,-300.7 226.617,-312.7 226.617,-397.3 214.617,-409.3"></polygon>
-<path fill="white" stroke="white" d="M109.383,-409.3C103.383,-409.3 97.3833,-403.3 97.3833,-397.3"></path>
-<path fill="white" stroke="white" d="M97.3833,-312.7C97.3833,-306.7 103.383,-300.7 109.383,-300.7"></path>
-<path fill="white" stroke="white" d="M214.617,-300.7C220.617,-300.7 226.617,-306.7 226.617,-312.7"></path>
-<path fill="white" stroke="white" d="M226.617,-397.3C226.617,-403.3 220.617,-409.3 214.617,-409.3"></path>
-<polyline fill="none" stroke="black" points="214.617,-409.3 109.383,-409.3 "></polyline>
-<path fill="none" stroke="black" d="M109.383,-409.3C103.383,-409.3 97.3833,-403.3 97.3833,-397.3"></path>
-<polyline fill="none" stroke="black" points="97.3833,-397.3 97.3833,-312.7 "></polyline>
-<path fill="none" stroke="black" d="M97.3833,-312.7C97.3833,-306.7 103.383,-300.7 109.383,-300.7"></path>
-<polyline fill="none" stroke="black" points="109.383,-300.7 214.617,-300.7 "></polyline>
-<path fill="none" stroke="black" d="M214.617,-300.7C220.617,-300.7 226.617,-306.7 226.617,-312.7"></path>
-<polyline fill="none" stroke="black" points="226.617,-312.7 226.617,-397.3 "></polyline>
-<path fill="none" stroke="black" d="M226.617,-397.3C226.617,-403.3 220.617,-409.3 214.617,-409.3"></path>
-<text text-anchor="middle" x="162" y="-392.8" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="162" y="-376" font-family="Times,serif" font-size="14.00">ForStatement</text>
-<text text-anchor="middle" x="162" y="-359.2" font-family="Times,serif" font-size="14.00">VariableDeclaration</text>
-<text text-anchor="middle" x="162" y="-342.4" font-family="Times,serif" font-size="14.00">VariableDeclarator</text>
-<text text-anchor="middle" x="162" y="-325.6" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="162" y="-308.8" font-family="Times,serif" font-size="14.00">Literal (0)</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M162,-445.98C162,-439.675 162,-430.238 162,-419.813"></path>
-<polygon fill="black" stroke="black" points="165.5,-419.586 162,-409.586 158.5,-419.586 165.5,-419.586"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="257" cy="-21" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="257" cy="-21" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="208.233,-264.401 115.767,-264.401 103.767,-252.401 103.767,-217.599 115.767,-205.599 208.233,-205.599 220.233,-217.599 220.233,-252.401 208.233,-264.401"></polygon>
-<path fill="white" stroke="white" d="M115.767,-264.401C109.767,-264.401 103.767,-258.401 103.767,-252.401"></path>
-<path fill="white" stroke="white" d="M103.767,-217.599C103.767,-211.599 109.767,-205.599 115.767,-205.599"></path>
-<path fill="white" stroke="white" d="M208.233,-205.599C214.233,-205.599 220.233,-211.599 220.233,-217.599"></path>
-<path fill="white" stroke="white" d="M220.233,-252.401C220.233,-258.401 214.233,-264.401 208.233,-264.401"></path>
-<polyline fill="none" stroke="black" points="208.233,-264.401 115.767,-264.401 "></polyline>
-<path fill="none" stroke="black" d="M115.767,-264.401C109.767,-264.401 103.767,-258.401 103.767,-252.401"></path>
-<polyline fill="none" stroke="black" points="103.767,-252.401 103.767,-217.599 "></polyline>
-<path fill="none" stroke="black" d="M103.767,-217.599C103.767,-211.599 109.767,-205.599 115.767,-205.599"></path>
-<polyline fill="none" stroke="black" points="115.767,-205.599 208.233,-205.599 "></polyline>
-<path fill="none" stroke="black" d="M208.233,-205.599C214.233,-205.599 220.233,-211.599 220.233,-217.599"></path>
-<polyline fill="none" stroke="black" points="220.233,-217.599 220.233,-252.401 "></polyline>
-<path fill="none" stroke="black" d="M220.233,-252.401C220.233,-258.401 214.233,-264.401 208.233,-264.401"></path>
-<text text-anchor="middle" x="162" y="-247.6" font-family="Times,serif" font-size="14.00">BinaryExpression</text>
-<text text-anchor="middle" x="162" y="-230.8" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-<text text-anchor="middle" x="162" y="-214" font-family="Times,serif" font-size="14.00">Literal (10)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M162,-300.524C162,-291.777 162,-282.867 162,-274.572"></path>
-<polygon fill="black" stroke="black" points="165.5,-274.452 162,-264.452 158.5,-274.452 165.5,-274.452"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="122.147,-170 11.8526,-170 -0.147372,-158 -0.147372,-90 11.8526,-78 122.147,-78 134.147,-90 134.147,-158 122.147,-170"></polygon>
-<path fill="white" stroke="white" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<path fill="white" stroke="white" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<path fill="white" stroke="white" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<path fill="white" stroke="white" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<polyline fill="none" stroke="black" points="122.147,-170 11.8526,-170 "></polyline>
-<path fill="none" stroke="black" d="M11.8526,-170C5.85263,-170 -0.147372,-164 -0.147372,-158"></path>
-<polyline fill="none" stroke="black" points="-0.147372,-158 -0.147372,-90 "></polyline>
-<path fill="none" stroke="black" d="M-0.147372,-90C-0.147372,-84 5.85263,-78 11.8526,-78"></path>
-<polyline fill="none" stroke="black" points="11.8526,-78 122.147,-78 "></polyline>
-<path fill="none" stroke="black" d="M122.147,-78C128.147,-78 134.147,-84 134.147,-90"></path>
-<polyline fill="none" stroke="black" points="134.147,-90 134.147,-158 "></polyline>
-<path fill="none" stroke="black" d="M134.147,-158C134.147,-164 128.147,-170 122.147,-170"></path>
-<text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-<text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M137.288,-205.646C129.826,-197.085 121.382,-187.396 113,-177.779"></path>
-<polygon fill="black" stroke="black" points="115.52,-175.343 106.311,-170.104 110.243,-179.942 115.52,-175.343"></polygon>
-</g>
-
-<g id="node7" class="node"><title>s1_5</title>
-<polygon fill="white" stroke="white" points="312.147,-153.401 201.853,-153.401 189.853,-141.401 189.853,-106.599 201.853,-94.5986 312.147,-94.5986 324.147,-106.599 324.147,-141.401 312.147,-153.401"></polygon>
-<path fill="white" stroke="white" d="M201.853,-153.401C195.853,-153.401 189.853,-147.401 189.853,-141.401"></path>
-<path fill="white" stroke="white" d="M189.853,-106.599C189.853,-100.599 195.853,-94.5986 201.853,-94.5986"></path>
-<path fill="white" stroke="white" d="M312.147,-94.5986C318.147,-94.5986 324.147,-100.599 324.147,-106.599"></path>
-<path fill="white" stroke="white" d="M324.147,-141.401C324.147,-147.401 318.147,-153.401 312.147,-153.401"></path>
-<polyline fill="none" stroke="black" points="312.147,-153.401 201.853,-153.401 "></polyline>
-<path fill="none" stroke="black" d="M201.853,-153.401C195.853,-153.401 189.853,-147.401 189.853,-141.401"></path>
-<polyline fill="none" stroke="black" points="189.853,-141.401 189.853,-106.599 "></polyline>
-<path fill="none" stroke="black" d="M189.853,-106.599C189.853,-100.599 195.853,-94.5986 201.853,-94.5986"></path>
-<polyline fill="none" stroke="black" points="201.853,-94.5986 312.147,-94.5986 "></polyline>
-<path fill="none" stroke="black" d="M312.147,-94.5986C318.147,-94.5986 324.147,-100.599 324.147,-106.599"></path>
-<polyline fill="none" stroke="black" points="324.147,-106.599 324.147,-141.401 "></polyline>
-<path fill="none" stroke="black" d="M324.147,-141.401C324.147,-147.401 318.147,-153.401 312.147,-153.401"></path>
-<text text-anchor="middle" x="257" y="-136.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="257" y="-119.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="257" y="-103" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge7" class="edge"><title>s1_2-&gt;s1_5</title>
-<path fill="none" stroke="black" d="M186.712,-205.646C198.587,-192.021 212.952,-175.539 225.593,-161.035"></path>
-<polygon fill="black" stroke="black" points="228.48,-163.05 232.412,-153.212 223.203,-158.451 228.48,-163.05"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="160.977,-41.6019 67.0234,-41.6019 55.0234,-29.6019 55.0234,-12.3981 67.0234,-0.398095 160.977,-0.398095 172.977,-12.3981 172.977,-29.6019 160.977,-41.6019"></polygon>
-<path fill="white" stroke="white" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<path fill="white" stroke="white" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<path fill="white" stroke="white" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<path fill="white" stroke="white" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<polyline fill="none" stroke="black" points="160.977,-41.6019 67.0234,-41.6019 "></polyline>
-<path fill="none" stroke="black" d="M67.0234,-41.6019C61.0234,-41.6019 55.0234,-35.6019 55.0234,-29.6019"></path>
-<polyline fill="none" stroke="black" points="55.0234,-29.6019 55.0234,-12.3981 "></polyline>
-<path fill="none" stroke="black" d="M55.0234,-12.3981C55.0234,-6.3981 61.0234,-0.398095 67.0234,-0.398095"></path>
-<polyline fill="none" stroke="black" points="67.0234,-0.398095 160.977,-0.398095 "></polyline>
-<path fill="none" stroke="black" d="M160.977,-0.398095C166.977,-0.398095 172.977,-6.3981 172.977,-12.3981"></path>
-<polyline fill="none" stroke="black" points="172.977,-12.3981 172.977,-29.6019 "></polyline>
-<path fill="none" stroke="black" d="M172.977,-29.6019C172.977,-35.6019 166.977,-41.6019 160.977,-41.6019"></path>
-<text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14.00">UpdateExpression</text>
-<text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14.00">Identifier (i)</text>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M88.0256,-77.8174C92.2417,-68.7572 96.5653,-59.4661 100.445,-51.1281"></path>
-<polygon fill="black" stroke="black" points="103.718,-52.392 104.763,-41.8489 97.3711,-49.4386 103.718,-52.392"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_4-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M126.427,-41.7344C132.399,-52.1392 139.091,-65.3421 143,-78 155.006,-116.879 159.472,-163.404 161.108,-195.471"></path>
-<polygon fill="black" stroke="black" points="157.624,-195.923 161.561,-205.76 164.618,-195.615 157.624,-195.923"></polygon>
-</g>
-
-<g id="edge8" class="edge"><title>s1_5-&gt;final</title>
-<path fill="none" stroke="black" d="M257,-94.5971C257,-78.6959 257,-59.1538 257,-44.3521"></path>
-<polygon fill="black" stroke="black" points="260.5,-44.0959 257,-34.0959 253.5,-44.096 260.5,-44.0959"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg
deleted file mode 100644 (file)
index 8036529..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<svg width="152pt" height="322pt" viewBox="0.00 0.00 152.00 322.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 318)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="72" cy="-305" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="113.149,-259.602 30.8505,-259.602 18.8505,-247.602 18.8505,-230.398 30.8505,-218.398 113.149,-218.398 125.149,-230.398 125.149,-247.602 113.149,-259.602"></polygon>
-<path fill="white" stroke="white" d="M30.8505,-259.602C24.8505,-259.602 18.8505,-253.602 18.8505,-247.602"></path>
-<path fill="white" stroke="white" d="M18.8505,-230.398C18.8505,-224.398 24.8505,-218.398 30.8505,-218.398"></path>
-<path fill="white" stroke="white" d="M113.149,-218.398C119.149,-218.398 125.149,-224.398 125.149,-230.398"></path>
-<path fill="white" stroke="white" d="M125.149,-247.602C125.149,-253.602 119.149,-259.602 113.149,-259.602"></path>
-<polyline fill="none" stroke="black" points="113.149,-259.602 30.8505,-259.602 "></polyline>
-<path fill="none" stroke="black" d="M30.8505,-259.602C24.8505,-259.602 18.8505,-253.602 18.8505,-247.602"></path>
-<polyline fill="none" stroke="black" points="18.8505,-247.602 18.8505,-230.398 "></polyline>
-<path fill="none" stroke="black" d="M18.8505,-230.398C18.8505,-224.398 24.8505,-218.398 30.8505,-218.398"></path>
-<polyline fill="none" stroke="black" points="30.8505,-218.398 113.149,-218.398 "></polyline>
-<path fill="none" stroke="black" d="M113.149,-218.398C119.149,-218.398 125.149,-224.398 125.149,-230.398"></path>
-<polyline fill="none" stroke="black" points="125.149,-230.398 125.149,-247.602 "></polyline>
-<path fill="none" stroke="black" d="M125.149,-247.602C125.149,-253.602 119.149,-259.602 113.149,-259.602"></path>
-<text text-anchor="middle" x="72" y="-243.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="72" y="-226.4" font-family="Times,serif" font-size="14.00">WhileStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M72,-295.894C72,-289.274 72,-279.485 72,-269.94"></path>
-<polygon fill="black" stroke="black" points="75.5001,-269.842 72,-259.842 68.5001,-269.842 75.5001,-269.842"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="103.339,-182 40.6614,-182 28.6614,-170 28.6614,-158 40.6614,-146 103.339,-146 115.339,-158 115.339,-170 103.339,-182"></polygon>
-<path fill="white" stroke="white" d="M40.6614,-182C34.6614,-182 28.6614,-176 28.6614,-170"></path>
-<path fill="white" stroke="white" d="M28.6614,-158C28.6614,-152 34.6614,-146 40.6614,-146"></path>
-<path fill="white" stroke="white" d="M103.339,-146C109.339,-146 115.339,-152 115.339,-158"></path>
-<path fill="white" stroke="white" d="M115.339,-170C115.339,-176 109.339,-182 103.339,-182"></path>
-<polyline fill="none" stroke="black" points="103.339,-182 40.6614,-182 "></polyline>
-<path fill="none" stroke="black" d="M40.6614,-182C34.6614,-182 28.6614,-176 28.6614,-170"></path>
-<polyline fill="none" stroke="black" points="28.6614,-170 28.6614,-158 "></polyline>
-<path fill="none" stroke="black" d="M28.6614,-158C28.6614,-152 34.6614,-146 40.6614,-146"></path>
-<polyline fill="none" stroke="black" points="40.6614,-146 103.339,-146 "></polyline>
-<path fill="none" stroke="black" d="M103.339,-146C109.339,-146 115.339,-152 115.339,-158"></path>
-<polyline fill="none" stroke="black" points="115.339,-158 115.339,-170 "></polyline>
-<path fill="none" stroke="black" d="M115.339,-170C115.339,-176 109.339,-182 103.339,-182"></path>
-<text text-anchor="middle" x="72" y="-159.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M72,-218.052C72,-210.216 72,-201.089 72,-192.636"></path>
-<polygon fill="black" stroke="black" points="75.5001,-192.439 72,-182.439 68.5001,-192.439 75.5001,-192.439"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="132.317,-109.3 11.6828,-109.3 -0.317209,-97.3002 -0.317209,-12.6998 11.6828,-0.699817 132.317,-0.699817 144.317,-12.6998 144.317,-97.3002 132.317,-109.3"></polygon>
-<path fill="white" stroke="white" d="M11.6828,-109.3C5.68279,-109.3 -0.317209,-103.3 -0.317209,-97.3002"></path>
-<path fill="white" stroke="white" d="M-0.317209,-12.6998C-0.317209,-6.69982 5.68279,-0.699817 11.6828,-0.699817"></path>
-<path fill="white" stroke="white" d="M132.317,-0.699817C138.317,-0.699817 144.317,-6.69982 144.317,-12.6998"></path>
-<path fill="white" stroke="white" d="M144.317,-97.3002C144.317,-103.3 138.317,-109.3 132.317,-109.3"></path>
-<polyline fill="none" stroke="black" points="132.317,-109.3 11.6828,-109.3 "></polyline>
-<path fill="none" stroke="black" d="M11.6828,-109.3C5.68279,-109.3 -0.317209,-103.3 -0.317209,-97.3002"></path>
-<polyline fill="none" stroke="black" points="-0.317209,-97.3002 -0.317209,-12.6998 "></polyline>
-<path fill="none" stroke="black" d="M-0.317209,-12.6998C-0.317209,-6.69982 5.68279,-0.699817 11.6828,-0.699817"></path>
-<polyline fill="none" stroke="black" points="11.6828,-0.699817 132.317,-0.699817 "></polyline>
-<path fill="none" stroke="black" d="M132.317,-0.699817C138.317,-0.699817 144.317,-6.69982 144.317,-12.6998"></path>
-<polyline fill="none" stroke="black" points="144.317,-12.6998 144.317,-97.3002 "></polyline>
-<path fill="none" stroke="black" d="M144.317,-97.3002C144.317,-103.3 138.317,-109.3 132.317,-109.3"></path>
-<text text-anchor="middle" x="72" y="-92.8" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="72" y="-76" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="72" y="-59.2" font-family="Times,serif" font-size="14.00">AssignmentExpression</text>
-<text text-anchor="middle" x="72" y="-42.4" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="72" y="-25.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="72" y="-8.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M72,-145.809C72,-138.443 72,-129.338 72,-119.779"></path>
-<polygon fill="black" stroke="black" points="75.5001,-119.706 72,-109.706 68.5001,-119.706 75.5001,-119.706"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg
deleted file mode 100644 (file)
index 63355dd..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<svg width="152pt" height="322pt" viewBox="0.00 0.00 152.00 322.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 318)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="72" cy="-305" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node2" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="113.149,-259.602 30.8505,-259.602 18.8505,-247.602 18.8505,-230.398 30.8505,-218.398 113.149,-218.398 125.149,-230.398 125.149,-247.602 113.149,-259.602"></polygon>
-<path fill="white" stroke="white" d="M30.8505,-259.602C24.8505,-259.602 18.8505,-253.602 18.8505,-247.602"></path>
-<path fill="white" stroke="white" d="M18.8505,-230.398C18.8505,-224.398 24.8505,-218.398 30.8505,-218.398"></path>
-<path fill="white" stroke="white" d="M113.149,-218.398C119.149,-218.398 125.149,-224.398 125.149,-230.398"></path>
-<path fill="white" stroke="white" d="M125.149,-247.602C125.149,-253.602 119.149,-259.602 113.149,-259.602"></path>
-<polyline fill="none" stroke="black" points="113.149,-259.602 30.8505,-259.602 "></polyline>
-<path fill="none" stroke="black" d="M30.8505,-259.602C24.8505,-259.602 18.8505,-253.602 18.8505,-247.602"></path>
-<polyline fill="none" stroke="black" points="18.8505,-247.602 18.8505,-230.398 "></polyline>
-<path fill="none" stroke="black" d="M18.8505,-230.398C18.8505,-224.398 24.8505,-218.398 30.8505,-218.398"></path>
-<polyline fill="none" stroke="black" points="30.8505,-218.398 113.149,-218.398 "></polyline>
-<path fill="none" stroke="black" d="M113.149,-218.398C119.149,-218.398 125.149,-224.398 125.149,-230.398"></path>
-<polyline fill="none" stroke="black" points="125.149,-230.398 125.149,-247.602 "></polyline>
-<path fill="none" stroke="black" d="M125.149,-247.602C125.149,-253.602 119.149,-259.602 113.149,-259.602"></path>
-<text text-anchor="middle" x="72" y="-243.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="72" y="-226.4" font-family="Times,serif" font-size="14.00">WhileStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M72,-295.894C72,-289.274 72,-279.485 72,-269.94"></path>
-<polygon fill="black" stroke="black" points="75.5001,-269.842 72,-259.842 68.5001,-269.842 75.5001,-269.842"></polygon>
-</g>
-
-<g id="node3" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="103.339,-182 40.6614,-182 28.6614,-170 28.6614,-158 40.6614,-146 103.339,-146 115.339,-158 115.339,-170 103.339,-182"></polygon>
-<path fill="white" stroke="white" d="M40.6614,-182C34.6614,-182 28.6614,-176 28.6614,-170"></path>
-<path fill="white" stroke="white" d="M28.6614,-158C28.6614,-152 34.6614,-146 40.6614,-146"></path>
-<path fill="white" stroke="white" d="M103.339,-146C109.339,-146 115.339,-152 115.339,-158"></path>
-<path fill="white" stroke="white" d="M115.339,-170C115.339,-176 109.339,-182 103.339,-182"></path>
-<polyline fill="none" stroke="black" points="103.339,-182 40.6614,-182 "></polyline>
-<path fill="none" stroke="black" d="M40.6614,-182C34.6614,-182 28.6614,-176 28.6614,-170"></path>
-<polyline fill="none" stroke="black" points="28.6614,-170 28.6614,-158 "></polyline>
-<path fill="none" stroke="black" d="M28.6614,-158C28.6614,-152 34.6614,-146 40.6614,-146"></path>
-<polyline fill="none" stroke="black" points="40.6614,-146 103.339,-146 "></polyline>
-<path fill="none" stroke="black" d="M103.339,-146C109.339,-146 115.339,-152 115.339,-158"></path>
-<polyline fill="none" stroke="black" points="115.339,-158 115.339,-170 "></polyline>
-<path fill="none" stroke="black" d="M115.339,-170C115.339,-176 109.339,-182 103.339,-182"></path>
-<text text-anchor="middle" x="72" y="-159.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M72,-218.052C72,-210.216 72,-201.089 72,-192.636"></path>
-<polygon fill="black" stroke="black" points="75.5001,-192.439 72,-182.439 68.5001,-192.439 75.5001,-192.439"></polygon>
-</g>
-
-<g id="node4" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="132.317,-109.3 11.6828,-109.3 -0.317209,-97.3002 -0.317209,-12.6998 11.6828,-0.699817 132.317,-0.699817 144.317,-12.6998 144.317,-97.3002 132.317,-109.3"></polygon>
-<path fill="white" stroke="white" d="M11.6828,-109.3C5.68279,-109.3 -0.317209,-103.3 -0.317209,-97.3002"></path>
-<path fill="white" stroke="white" d="M-0.317209,-12.6998C-0.317209,-6.69982 5.68279,-0.699817 11.6828,-0.699817"></path>
-<path fill="white" stroke="white" d="M132.317,-0.699817C138.317,-0.699817 144.317,-6.69982 144.317,-12.6998"></path>
-<path fill="white" stroke="white" d="M144.317,-97.3002C144.317,-103.3 138.317,-109.3 132.317,-109.3"></path>
-<polyline fill="none" stroke="black" points="132.317,-109.3 11.6828,-109.3 "></polyline>
-<path fill="none" stroke="black" d="M11.6828,-109.3C5.68279,-109.3 -0.317209,-103.3 -0.317209,-97.3002"></path>
-<polyline fill="none" stroke="black" points="-0.317209,-97.3002 -0.317209,-12.6998 "></polyline>
-<path fill="none" stroke="black" d="M-0.317209,-12.6998C-0.317209,-6.69982 5.68279,-0.699817 11.6828,-0.699817"></path>
-<polyline fill="none" stroke="black" points="11.6828,-0.699817 132.317,-0.699817 "></polyline>
-<path fill="none" stroke="black" d="M132.317,-0.699817C138.317,-0.699817 144.317,-6.69982 144.317,-12.6998"></path>
-<polyline fill="none" stroke="black" points="144.317,-12.6998 144.317,-97.3002 "></polyline>
-<path fill="none" stroke="black" d="M144.317,-97.3002C144.317,-103.3 138.317,-109.3 132.317,-109.3"></path>
-<text text-anchor="middle" x="72" y="-92.8" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="72" y="-76" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="72" y="-59.2" font-family="Times,serif" font-size="14.00">AssignmentExpression</text>
-<text text-anchor="middle" x="72" y="-42.4" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="72" y="-25.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="72" y="-8.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M66.8852,-145.809C66.0803,-138.443 65.5726,-129.338 65.362,-119.779"></path>
-<polygon fill="black" stroke="black" points="68.861,-119.666 65.25,-109.706 61.8615,-119.744 68.861,-119.666"></polygon>
-</g>
-
-<g id="edge6" class="edge"><title>s1_3-&gt;s1_2</title>
-<path fill="none" stroke="red" d="M78.75,-109.706C78.7461,-118.71 78.4872,-127.707 77.9735,-135.675"></path>
-<polygon fill="red" stroke="red" points="74.4717,-135.549 77.1148,-145.809 81.4467,-136.14 74.4717,-135.549"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg b/eslint/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg
deleted file mode 100644 (file)
index cb21c43..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0"?>
-<svg width="305pt" height="384pt" viewBox="0.00 0.00 305.00 384.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 380)">
-<title>_anonymous_0</title>
-
-<g id="node1" class="node"><title>initial</title>
-<ellipse fill="black" stroke="black" cx="72" cy="-367" rx="9" ry="9"></ellipse>
-</g>
-
-<g id="node3" class="node"><title>s1_1</title>
-<polygon fill="white" stroke="white" points="113.149,-321.602 30.8505,-321.602 18.8505,-309.602 18.8505,-292.398 30.8505,-280.398 113.149,-280.398 125.149,-292.398 125.149,-309.602 113.149,-321.602"></polygon>
-<path fill="white" stroke="white" d="M30.8505,-321.602C24.8505,-321.602 18.8505,-315.602 18.8505,-309.602"></path>
-<path fill="white" stroke="white" d="M18.8505,-292.398C18.8505,-286.398 24.8505,-280.398 30.8505,-280.398"></path>
-<path fill="white" stroke="white" d="M113.149,-280.398C119.149,-280.398 125.149,-286.398 125.149,-292.398"></path>
-<path fill="white" stroke="white" d="M125.149,-309.602C125.149,-315.602 119.149,-321.602 113.149,-321.602"></path>
-<polyline fill="none" stroke="black" points="113.149,-321.602 30.8505,-321.602 "></polyline>
-<path fill="none" stroke="black" d="M30.8505,-321.602C24.8505,-321.602 18.8505,-315.602 18.8505,-309.602"></path>
-<polyline fill="none" stroke="black" points="18.8505,-309.602 18.8505,-292.398 "></polyline>
-<path fill="none" stroke="black" d="M18.8505,-292.398C18.8505,-286.398 24.8505,-280.398 30.8505,-280.398"></path>
-<polyline fill="none" stroke="black" points="30.8505,-280.398 113.149,-280.398 "></polyline>
-<path fill="none" stroke="black" d="M113.149,-280.398C119.149,-280.398 125.149,-286.398 125.149,-292.398"></path>
-<polyline fill="none" stroke="black" points="125.149,-292.398 125.149,-309.602 "></polyline>
-<path fill="none" stroke="black" d="M125.149,-309.602C125.149,-315.602 119.149,-321.602 113.149,-321.602"></path>
-<text text-anchor="middle" x="72" y="-305.2" font-family="Times,serif" font-size="14.00">Program</text>
-<text text-anchor="middle" x="72" y="-288.4" font-family="Times,serif" font-size="14.00">WhileStatement</text>
-</g>
-
-<g id="edge2" class="edge"><title>initial-&gt;s1_1</title>
-<path fill="none" stroke="black" d="M72,-357.894C72,-351.274 72,-341.485 72,-331.94"></path>
-<polygon fill="black" stroke="black" points="75.5001,-331.842 72,-321.842 68.5001,-331.842 75.5001,-331.842"></polygon>
-</g>
-
-<g id="node2" class="node"><title>final</title>
-<ellipse fill="black" stroke="black" cx="230" cy="-13" rx="9" ry="9"></ellipse>
-<ellipse fill="none" stroke="black" cx="230" cy="-13" rx="13" ry="13"></ellipse>
-</g>
-
-<g id="node4" class="node"><title>s1_2</title>
-<polygon fill="white" stroke="white" points="103.339,-244 40.6614,-244 28.6614,-232 28.6614,-220 40.6614,-208 103.339,-208 115.339,-220 115.339,-232 103.339,-244"></polygon>
-<path fill="white" stroke="white" d="M40.6614,-244C34.6614,-244 28.6614,-238 28.6614,-232"></path>
-<path fill="white" stroke="white" d="M28.6614,-220C28.6614,-214 34.6614,-208 40.6614,-208"></path>
-<path fill="white" stroke="white" d="M103.339,-208C109.339,-208 115.339,-214 115.339,-220"></path>
-<path fill="white" stroke="white" d="M115.339,-232C115.339,-238 109.339,-244 103.339,-244"></path>
-<polyline fill="none" stroke="black" points="103.339,-244 40.6614,-244 "></polyline>
-<path fill="none" stroke="black" d="M40.6614,-244C34.6614,-244 28.6614,-238 28.6614,-232"></path>
-<polyline fill="none" stroke="black" points="28.6614,-232 28.6614,-220 "></polyline>
-<path fill="none" stroke="black" d="M28.6614,-220C28.6614,-214 34.6614,-208 40.6614,-208"></path>
-<polyline fill="none" stroke="black" points="40.6614,-208 103.339,-208 "></polyline>
-<path fill="none" stroke="black" d="M103.339,-208C109.339,-208 115.339,-214 115.339,-220"></path>
-<polyline fill="none" stroke="black" points="115.339,-220 115.339,-232 "></polyline>
-<path fill="none" stroke="black" d="M115.339,-232C115.339,-238 109.339,-244 103.339,-244"></path>
-<text text-anchor="middle" x="72" y="-221.8" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-</g>
-
-<g id="edge3" class="edge"><title>s1_1-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M72,-280.052C72,-272.216 72,-263.089 72,-254.636"></path>
-<polygon fill="black" stroke="black" points="75.5001,-254.439 72,-244.439 68.5001,-254.439 75.5001,-254.439"></polygon>
-</g>
-
-<g id="node5" class="node"><title>s1_3</title>
-<polygon fill="white" stroke="white" points="132.317,-171.3 11.6828,-171.3 -0.317209,-159.3 -0.317209,-74.6998 11.6828,-62.6998 132.317,-62.6998 144.317,-74.6998 144.317,-159.3 132.317,-171.3"></polygon>
-<path fill="white" stroke="white" d="M11.6828,-171.3C5.68279,-171.3 -0.317209,-165.3 -0.317209,-159.3"></path>
-<path fill="white" stroke="white" d="M-0.317209,-74.6998C-0.317209,-68.6998 5.68279,-62.6998 11.6828,-62.6998"></path>
-<path fill="white" stroke="white" d="M132.317,-62.6998C138.317,-62.6998 144.317,-68.6998 144.317,-74.6998"></path>
-<path fill="white" stroke="white" d="M144.317,-159.3C144.317,-165.3 138.317,-171.3 132.317,-171.3"></path>
-<polyline fill="none" stroke="black" points="132.317,-171.3 11.6828,-171.3 "></polyline>
-<path fill="none" stroke="black" d="M11.6828,-171.3C5.68279,-171.3 -0.317209,-165.3 -0.317209,-159.3"></path>
-<polyline fill="none" stroke="black" points="-0.317209,-159.3 -0.317209,-74.6998 "></polyline>
-<path fill="none" stroke="black" d="M-0.317209,-74.6998C-0.317209,-68.6998 5.68279,-62.6998 11.6828,-62.6998"></path>
-<polyline fill="none" stroke="black" points="11.6828,-62.6998 132.317,-62.6998 "></polyline>
-<path fill="none" stroke="black" d="M132.317,-62.6998C138.317,-62.6998 144.317,-68.6998 144.317,-74.6998"></path>
-<polyline fill="none" stroke="black" points="144.317,-74.6998 144.317,-159.3 "></polyline>
-<path fill="none" stroke="black" d="M144.317,-159.3C144.317,-165.3 138.317,-171.3 132.317,-171.3"></path>
-<text text-anchor="middle" x="72" y="-154.8" font-family="Times,serif" font-size="14.00">BlockStatement</text>
-<text text-anchor="middle" x="72" y="-138" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="72" y="-121.2" font-family="Times,serif" font-size="14.00">AssignmentExpression</text>
-<text text-anchor="middle" x="72" y="-104.4" font-family="Times,serif" font-size="14.00">Identifier (a)</text>
-<text text-anchor="middle" x="72" y="-87.6" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="72" y="-70.8" font-family="Times,serif" font-size="14.00">Identifier (foo)</text>
-</g>
-
-<g id="edge4" class="edge"><title>s1_2-&gt;s1_3</title>
-<path fill="none" stroke="black" d="M66.8852,-207.809C66.0803,-200.443 65.5726,-191.338 65.362,-181.779"></path>
-<polygon fill="black" stroke="black" points="68.861,-181.666 65.25,-171.706 61.8615,-181.744 68.861,-181.666"></polygon>
-</g>
-
-<g id="node6" class="node"><title>s1_4</title>
-<polygon fill="white" stroke="white" points="285.147,-146.401 174.853,-146.401 162.853,-134.401 162.853,-99.5986 174.853,-87.5986 285.147,-87.5986 297.147,-99.5986 297.147,-134.401 285.147,-146.401"></polygon>
-<path fill="white" stroke="white" d="M174.853,-146.401C168.853,-146.401 162.853,-140.401 162.853,-134.401"></path>
-<path fill="white" stroke="white" d="M162.853,-99.5986C162.853,-93.5986 168.853,-87.5986 174.853,-87.5986"></path>
-<path fill="white" stroke="white" d="M285.147,-87.5986C291.147,-87.5986 297.147,-93.5986 297.147,-99.5986"></path>
-<path fill="white" stroke="white" d="M297.147,-134.401C297.147,-140.401 291.147,-146.401 285.147,-146.401"></path>
-<polyline fill="none" stroke="black" points="285.147,-146.401 174.853,-146.401 "></polyline>
-<path fill="none" stroke="black" d="M174.853,-146.401C168.853,-146.401 162.853,-140.401 162.853,-134.401"></path>
-<polyline fill="none" stroke="black" points="162.853,-134.401 162.853,-99.5986 "></polyline>
-<path fill="none" stroke="black" d="M162.853,-99.5986C162.853,-93.5986 168.853,-87.5986 174.853,-87.5986"></path>
-<polyline fill="none" stroke="black" points="174.853,-87.5986 285.147,-87.5986 "></polyline>
-<path fill="none" stroke="black" d="M285.147,-87.5986C291.147,-87.5986 297.147,-93.5986 297.147,-99.5986"></path>
-<polyline fill="none" stroke="black" points="297.147,-99.5986 297.147,-134.401 "></polyline>
-<path fill="none" stroke="black" d="M297.147,-134.401C297.147,-140.401 291.147,-146.401 285.147,-146.401"></path>
-<text text-anchor="middle" x="230" y="-129.6" font-family="Times,serif" font-size="14.00">ExpressionStatement</text>
-<text text-anchor="middle" x="230" y="-112.8" font-family="Times,serif" font-size="14.00">CallExpression</text>
-<text text-anchor="middle" x="230" y="-96" font-family="Times,serif" font-size="14.00">Identifier (bar)</text>
-</g>
-
-<g id="edge6" class="edge"><title>s1_2-&gt;s1_4</title>
-<path fill="none" stroke="black" d="M98.7745,-207.789C114.625,-197.523 135.053,-184.16 153,-172 162.409,-165.625 172.395,-158.724 181.947,-152.055"></path>
-<polygon fill="black" stroke="black" points="184.021,-154.875 190.205,-146.273 180.006,-149.141 184.021,-154.875"></polygon>
-</g>
-
-<g id="edge5" class="edge"><title>s1_3-&gt;s1_2</title>
-<path fill="none" stroke="black" d="M78.75,-171.706C78.7461,-180.71 78.4872,-189.707 77.9735,-197.675"></path>
-<polygon fill="black" stroke="black" points="74.4717,-197.549 77.1148,-207.809 81.4467,-198.14 74.4717,-197.549"></polygon>
-</g>
-
-<g id="edge7" class="edge"><title>s1_4-&gt;final</title>
-<path fill="none" stroke="black" d="M230,-87.5873C230,-71.4284 230,-51.4784 230,-36.4288"></path>
-<polygon fill="black" stroke="black" points="233.5,-36.0194 230,-26.0195 226.5,-36.0195 233.5,-36.0194"></polygon>
-</g>
-</g>
-</svg>
\ No newline at end of file
diff --git a/eslint/docs/developer-guide/contributing/README.md b/eslint/docs/developer-guide/contributing/README.md
deleted file mode 100644 (file)
index 25a8894..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# Contributing
-
-One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well.
-
-This guide is intended for anyone who wants to contribute to an ESLint project. Please read it carefully as it answers a lot of the questions many newcomers have when first working with our projects.
-
-## Read the [Code of Conduct](https://eslint.org/conduct)
-
-ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). We kindly request that you read over our code of conduct before contributing.
-
-## [Signing the CLA](https://openjsf.org/about/the-openjs-foundation-cla/)
-
-In order to submit code or documentation to an ESLint project, you will need to electronically sign our [Contributor License Agreement](https://github.com/openjs-foundation/easycla). The CLA is the commonly used Apache-style template, and is you giving us permission to use your contribution. You only need to sign the CLA once for any OpenJS Foundation projects that use EasyCLA.
-
-## [Bug Reporting](reporting-bugs)
-
-Think you found a problem? We'd love to hear about it. This section explains how to submit a bug, the type of information we need to properly verify it, and the overall process.
-
-## Proposing a [New Rule](new-rules.md)
-
-We get a lot of proposals for new rules in ESLint. This section explains how we determine which rules are accepted and what information you should provide to help us evaluate your proposal.
-
-## Proposing a [Rule Change](rule-changes.md)
-
-Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals.
-
-## Requesting a [Change](changes.md)
-
-If you'd like to request a change other than a bug fix or new rule, this section explains that process.
-
-## Reporting a security vulnerability
-
-To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint).
-
-## [Working on Issues](working-on-issues.md)
-
-Have some extra time and want to contribute? This section talks about the process of working on issues.
-
-## Submitting a [Pull Request](pull-requests.md)
-
-We're always looking for contributions from the community. This section explains the requirements for pull requests and the process of contributing code.
diff --git a/eslint/docs/developer-guide/contributing/changes.md b/eslint/docs/developer-guide/contributing/changes.md
deleted file mode 100644 (file)
index 3c13051..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Change Requests
-
-If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new?template=CHANGE.md) on GitHub. Be sure to include the following information:
-
-1. The version of ESLint you are using.
-1. The problem you want to solve.
-1. Your take on the correct solution to problem.
-
-If you're requesting a change to a rule, it's helpful to include this information as well:
-
-1. What you did.
-1. What you would like to happen.
-1. What actually happened.
-
-Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues.
-
-**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
diff --git a/eslint/docs/developer-guide/contributing/new-rules.md b/eslint/docs/developer-guide/contributing/new-rules.md
deleted file mode 100644 (file)
index e4a19e4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# New Rules
-
-ESLint is all about rules. For most of the project's lifetime, we've had over 200 rules, and that list continues to grow. However, we can't just accept any proposed rule because all rules need to work cohesively together. As such, we have some guidelines around which rules can be part of the ESLint core and which are better off as custom rules and plugins.
-
-**Note:** As of 2020, we only accept rules related to new ECMAScript features. We prefer that new rules be implemented in plugins.
-
-## Core Rule Guidelines
-
-In general, ESLint core rules must be:
-
-1. **Widely applicable.** The rules we distribute need to be of importance to a large number of developers. Individual preferences for uncommon patterns are not supported.
-1. **Generic.** Rules cannot be so specific that users will have trouble understanding when to use them. A rule is typically too specific if describing what it does requires more than two "and"s (if a and b and c and d, then this rule warns).
-1. **Atomic.** Rules must function completely on their own. Rules are expressly forbidden from knowing about the state or presence of other rules.
-1. **Unique.** No two rules can produce the same warning. Overlapping rules confuse end users and there is an expectation that core ESLint rules do not overlap.
-1. **Library agnostic.** Rules must be based solely on JavaScript runtime environments and not on specific libraries or frameworks. For example, core rules shouldn't only apply if you're using jQuery but we may have some rules that apply only if you're using Node.js (a runtime).
-1. **No conflicts.** No rule must directly conflict with another rule. For example, if we have a rule requiring semicolons, we cannot also have a rule disallowing semicolons (which is why we have one rule, `semi`, that does both).
-
-Even though these are the formal criteria for inclusion, each rule is evaluated on its own basis.
-
-## Proposing a Rule
-
-If you want to propose a new rule, please see how to [create a pull request](/docs/developer-guide/contributing/pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new?template=NEW_RULE.md).
-
-We need all of this information in order to determine whether or not the rule is a good core rule candidate.
-
-## Accepting a Rule
-
-In order for a rule to be accepted in the ESLint core, it must:
-
-1. Fulfill all the criteria listed in the "Core Rule Guidelines" section
-1. Have an ESLint team member champion inclusion of the rule
-1. Be related to an ECMAScript feature that has reached stage 4 in the preceding 12 months
-
-Keep in mind that we have over 200 rules, and that is daunting both for end users and the ESLint team (who has to maintain them). As such, any new rules must be deemed of high importance to be considered for inclusion in ESLint.
-
-## Implementation is Your Responsibility
-
-The ESLint team doesn't implement new rules that are suggested by users because we have a limited number of people and need to focus on the overall roadmap. Once a rule is accepted, you are responsible for implementing and documenting the rule. You may, alternately, recruit another person to help you implement the rule. The ESLint team member who championed the rule is your resource to help guide you through the rest of this process.
-
-## Alternative: Creating Your Own Rules
-
-Remember that ESLint is completely pluggable, which means you can create your own rules and distribute them using plugins. We did this on purpose because we don't want to be the gatekeepers for all possible rules. Even if we don't accept a rule into the core, that doesn't mean you can't have the exact rule that you want. See the [working with rules](../working-with-rules.md) and [working with plugins](../working-with-plugins.md) documentation for more information.
diff --git a/eslint/docs/developer-guide/contributing/pull-requests.md b/eslint/docs/developer-guide/contributing/pull-requests.md
deleted file mode 100644 (file)
index 58fe6f9..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-# Pull Requests
-
-If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don't file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests.
-
-## Getting Started
-
-If you'd like to work on a pull request and you've never submitted code before, follow these steps:
-
-1. Sign our [Contributor License Agreement](https://cla.js.foundation/eslint/eslint).
-1. Set up a [development environment](../development-environment.md).
-1. If you want to implement a breaking change or a change to the core, ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](working-on-issues.md). Bug fixes, documentation changes, and other pull requests do not require an issue.
-
-After that, you're ready to start working on code.
-
-## Working with Code
-
-The process of submitting a pull request is fairly straightforward and generally follows the same pattern each time:
-
-1. [Create a new branch](#step1)
-2. [Make your changes](#step2)
-3. [Rebase onto upstream](#step3)
-4. [Run the tests](#step4)
-5. [Double check your submission](#step5)
-6. [Push your changes](#step6)
-7. [Submit the pull request](#step7)
-
-Details about each step are found below.
-
-### Step 1: Create a new branch<a name="step1"></a>
-
-The first step to sending a pull request is to create a new branch in your ESLint fork. Give the branch a descriptive name that describes what it is you're fixing, such as:
-
-```sh
-$ git checkout -b issue1234
-```
-
-You should do all of your development for the issue in this branch.
-
-**Note:** Do not combine fixes for multiple issues into one branch. Use a separate branch for each issue you're working on.
-
-### Step 2: Make your changes<a name="step2"></a>
-
-Make the changes to the code and tests, following the [code conventions](../code-conventions.md) as you go. Once you have finished, commit the changes to your branch:
-
-```sh
-$ git add -A
-$ git commit
-```
-
-All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. Here's an example commit message:
-
-```pt
-tag: Short description of what you did
-
-Longer description here if necessary
-
-Fixes #1234
-```
-
-The first line of the commit message (the summary) must have a specific format. This format is checked by our build tools.
-
-The `tag` is one of the following:
-
-* `fix` - for a bug fix.
-* `feat` - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
-* `fix!` - for a backwards-incompatible bug fix.
-* `feat!` - for a backwards-incompatible enhancement or feature.
-* `docs` - changes to documentation only.
-* `chore` - for changes that aren't user-facing.
-* `build` - changes to build process only.
-* `refactor` - a change that doesn't affect APIs or user experience.
-* `test` - just changes to test files.
-* `ci` - changes to our CI configuration files and scripts.
-* `perf` - a code change that improves performance.
-
-Use the [labels of the issue you are working on](working-on-issues.md#issue-labels) to determine the best tag.
-
-The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned in the body of the commit message in the format `Fixes #1234`. If the commit doesn't completely fix the issue, then use `Refs #1234` instead of `Fixes #1234`.
-
-Here are some good commit message summary examples:
-
-```pt
-build: Update Travis to only test Node 0.10
-fix: Semi rule incorrectly flagging extra semicolon
-chore: Upgrade Esprima to 1.2, switch to using comment attachment
-```
-
-The commit message format is important because these messages are used to create a changelog for each release. The tag and issue number help to create more consistent and useful changelogs.
-
-### Step 3: Rebase onto upstream<a name="step3"></a>
-
-Before you send the pull request, be sure to rebase onto the upstream source. This ensures your code is running on the latest available code.
-
-```sh
-git fetch upstream
-git rebase upstream/main
-```
-
-### Step 4: Run the tests<a name="step4"></a>
-
-After rebasing, be sure to run all of the tests once again to make sure nothing broke:
-
-```sh
-npm test
-```
-
-If there are any failing tests, update your code until all tests pass.
-
-### Step 5: Double check your submission<a name="step5"></a>
-
-With your code ready to go, this is a good time to double-check your submission to make sure it follows our conventions. Here are the things to check:
-
-* Make sure your commit is formatted correctly.
-* The pull request must have a description. The description should explain what you did and how its effects can be seen.
-* The commit message is properly formatted.
-* The change introduces no functional regression. Be sure to run `npm test` to verify your changes before submitting a pull request.
-* Make separate pull requests for unrelated changes. Large pull requests with multiple unrelated changes may be closed without merging.
-* All changes must be accompanied by tests, even if the feature you're working on previously had no tests.
-* All user-facing changes must be accompanied by appropriate documentation.
-* Follow the [Code Conventions](../code-conventions.md).
-
-### Step 6: Push your changes<a name="step6"></a>
-
-Next, push your changes to your clone:
-
-```sh
-git push origin issue1234
-```
-
-If you are unable to push because some references are old, do a forced push instead:
-
-```sh
-git push -f origin issue1234
-```
-
-### Step 7: Send the pull request<a name="step7"></a>
-
-Now you're ready to send the pull request. Go to your ESLint fork and then follow the [GitHub documentation](https://help.github.com/articles/creating-a-pull-request) on how to send a pull request.
-
-## Following Up
-
-Once your pull request is sent, it's time for the team to review it. As such, please make sure to:
-
-1. Monitor the status of the Travis CI build for your pull request. If it fails, please investigate why. We cannot merge pull requests that fail Travis for any reason.
-1. Respond to comments left on the pull request from team members. Remember, we want to help you land your code, so please be receptive to our feedback.
-1. We may ask you to make changes, rebase, or squash your commits.
-
-### Updating the Commit Message
-
-If your commit message is in the incorrect format, you'll be asked to update it. You can do so via:
-
-```sh
-$ git commit --amend
-```
-
-This will open up your editor so you can make changes. After that, you'll need to do a forced push to your branch:
-
-```sh
-$ git push origin issue1234 -f
-```
-
-### Updating the Code
-
-If we ask you to make code changes, there's no need to close the pull request and create a new one. Just go back to the branch on your fork and make your changes. Then, when you're ready, you can add your changes into the branch:
-
-```sh
-$ git add -A
-$ git commit
-$ git push origin issue1234
-```
-
-When updating the code, it's usually better to add additional commits to your branch rather than amending the original commit, because reviewers can easily tell which changes were made in response to a particular review. When we merge pull requests, we will squash all the commits from your branch into a single commit on the `main` branch.
-
-The commit messages in subsequent commits do not need to be in any specific format because these commits do not show up in the changelog.
-
-### Rebasing
-
-If your code is out-of-date, we might ask you to rebase. That means we want you to apply your changes on top of the latest upstream code. Make sure you have set up a [development environment](../development-environment.md) and then you can rebase using these commands:
-
-```sh
-$ git fetch upstream
-$ git rebase upstream/main
-```
-
-You might find that there are merge conflicts when you attempt to rebase. Please [resolve the conflicts](https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/) and then do a forced push to your branch:
-
-```sh
-$ git push origin issue1234 -f
-```
diff --git a/eslint/docs/developer-guide/contributing/reporting-bugs.md b/eslint/docs/developer-guide/contributing/reporting-bugs.md
deleted file mode 100644 (file)
index 4dd0da0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Reporting Bugs
-
-If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests.md) on GitHub.
-
-Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues.
-
-**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
diff --git a/eslint/docs/developer-guide/contributing/rule-changes.md b/eslint/docs/developer-guide/contributing/rule-changes.md
deleted file mode 100644 (file)
index d45ddbe..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# Rule Changes
-
-Occasionally, a core ESLint rule needs to be changed. This is not necessarily a bug, but rather, an enhancement that makes a rule more configurable. In those situations, we will consider making changes to rules.
-
-## Proposing a Rule Change
-
-To propose a change to an existing rule, [create a pull request](/docs/developer-guide/contributing/pull-requests.md) or [new issue](https://github.com/eslint/eslint/issues/new?template=RULE_CHANGE.md) and fill out the template.
-
-We need all of this information in order to determine whether or not the change is a good candidate for inclusion.
-
-## Accepting a Rule Change
-
-In order for a rule change to be accepted into ESLint, it must:
-
-1. Adhere to the [Core Rule Guidelines](new-rules.md#core-rule-guidelines)
-1. Have an ESLint team member champion the change
-1. Be important enough that rule is deemed incomplete without this change
-
-## Implementation is Your Responsibility
-
-The ESLint team doesn't implement rule changes that are suggested by users because we have a limited number of people and need to focus on the overall roadmap. Once a rule change is accepted, you are responsible for implementing and documenting it. You may, alternately, recruit another person to help you. The ESLint team member who championed the rule is your resource to help guide you through the rest of this process.
diff --git a/eslint/docs/developer-guide/contributing/working-on-issues.md b/eslint/docs/developer-guide/contributing/working-on-issues.md
deleted file mode 100644 (file)
index 9e666d6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# Working on Issues
-
-Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all of the things we plan on doing as well as suggestions from the community. Before starting to work on an issue, be sure you read through the rest of this page.
-
-## Issue Labels
-
-We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:
-
-1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`.
-1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#types-of-issues).
-1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest:
-
-    1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible.
-    1. **Documentation** - documentation issues are a type of bug in that they actively affect current users. As such, we want to address documentation issues as quickly as possible.
-    1. **Features** - new functionality that will aid users in the future.
-    1. **Enhancements** - requested improvements for existing functionality.
-    1. **Other** - anything else.
-
-    Some issues have had monetary rewards attached to them. Those are labeled `bounty`. Bounties are assigned via [BountySource](https://www.bountysource.com/teams/eslint/issues).
-
-## Starting Work
-
-If you're going to work on an issue, please add a comment to that issue saying so and indicating when you think you will complete it. It will help us to avoid duplication of effort. Some examples of good comments are:
-
-* "I'll take a look at this over the weekend."
-* "I'm going to do this, give me two weeks."
-* "Working on this" (as in, I'm working on it right now)
-
-If an issue has already been claimed by someone, please be respectful of that person's desire to complete the work and don't work on it unless you verify that they are no longer interested.
-
-If you find you can't finish the work, then simply add a comment letting people know, for example:
-
-* "Sorry, it looks like I don't have time to do this."
-* "I thought I knew enough to fix this, but it turns out I don't."
-
-No one will blame you for backing out of an issue if you are unable to complete it. We just want to keep the process moving along as efficiently as possible.
diff --git a/eslint/docs/developer-guide/development-environment.md b/eslint/docs/developer-guide/development-environment.md
deleted file mode 100644 (file)
index 4828476..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# Development Environment
-
-ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.
-
-## Step 1: Install Node.js
-
-Go to <https://nodejs.org/> to download and install the latest stable version for your operating system.
-
-Most of the installers already come with [npm](https://www.npmjs.com/) but if for some reason npm doesn't work on your system, you can install it manually using the instructions on the site.
-
-## Step 2: Fork and checkout your own ESLint repository
-
-Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) for forking and cloning.
-
-Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
-
-```sh
-$ cd eslint
-$ npm install
-```
-
-You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded.
-
-## Step 3: Add the upstream source
-
-The *upstream source* is the main ESLint repository where active development happens. While you won't have push access to upstream, you will have pull access, allowing you to pull in the latest code whenever you want.
-
-To add the upstream source for ESLint, run the following in your repository:
-
-```sh
-git remote add upstream git@github.com:eslint/eslint.git
-```
-
-Now, the remote `upstream` points to the upstream source.
-
-## Step 4: Install the Yeoman Generator
-
-[Yeoman](http://yeoman.io) is a scaffold generator that ESLint uses to help streamline development of new rules. If you don't already have Yeoman installed, you can install it via npm:
-
-    npm install -g yo
-
-Then, you can install the ESLint Yeoman generator:
-
-    npm install -g generator-eslint
-
-Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it.
-
-## Step 5: Run the tests
-
-Running the tests is the best way to ensure you have correctly set up your development environment. Make sure you're in the `eslint` directory and run:
-
-```sh
-npm test
-```
-
-The testing takes a few minutes to complete. If any tests fail, that likely means one or more parts of the environment setup didn't complete correctly. The upstream tests always pass.
-
-## Reference Information
-
-### Workflow
-
-Once you have your development environment installed, you can make and submit changes to the ESLint source files. Doing this successfully requires careful adherence to our [pull-request submission workflow](contributing/pull-requests.md).
-
-### Build Scripts
-
-ESLint has several build scripts that help with various parts of development.
-
-#### npm test
-
-The primary script to use is `npm test`, which does several things:
-
-1. Lints all JavaScript (including tests) and JSON
-1. Runs all tests on Node.js
-1. Checks code coverage targets
-1. Generates `build/eslint.js` for use in a browser
-1. Runs a subset of tests in PhantomJS
-
-Be sure to run this after making changes and before sending a pull request with your changes.
-
-**Note:** The full code coverage report is output into `/coverage`.
-
-#### npm run lint
-
-Runs just the JavaScript and JSON linting on the repository.
-
-#### npm run webpack
-
-Generates `build/eslint.js`, a version of ESLint for use in the browser.
diff --git a/eslint/docs/developer-guide/nodejs-api.md b/eslint/docs/developer-guide/nodejs-api.md
deleted file mode 100644 (file)
index ca07415..0000000
+++ /dev/null
@@ -1,917 +0,0 @@
-# Node.js API
-
-While ESLint is designed to be run on the command line, it's possible to use ESLint programmatically through the Node.js API. The purpose of the Node.js API is to allow plugin and tool authors to use the ESLint functionality directly, without going through the command line interface.
-
-**Note:** Use undocumented parts of the API at your own risk. Only those parts that are specifically mentioned in this document are approved for use and will remain stable and reliable. Anything left undocumented is unstable and may change or be removed at any point.
-
-## Table of Contents
-
-* [ESLint]
-    * [constructor()][eslint-constructor]
-    * [lintFiles()][eslint-lintfiles]
-    * [lintText()][eslint-linttext]
-    * [getRulesMetaForResults()][eslint-getrulesmetaforresults]
-    * [calculateConfigForFile()][eslint-calculateconfigforfile]
-    * [isPathIgnored()][eslint-ispathignored]
-    * [loadFormatter()][eslint-loadformatter]
-    * [static version][eslint-version]
-    * [static outputFixes()][eslint-outputfixes]
-    * [static getErrorResults()][eslint-geterrorresults]
-    * [LintResult type][lintresult]
-    * [LintMessage type][lintmessage]
-    * [EditInfo type][editinfo]
-    * [Formatter type][formatter]
-* [SourceCode](#sourcecode)
-    * [splitLines()](#sourcecodesplitlines)
-* [Linter](#linter)
-    * [verify()](#linterverify)
-    * [verifyAndFix()](#linterverifyandfix)
-    * [defineRule()](#linterdefinerule)
-    * [defineRules()](#linterdefinerules)
-    * [getRules()](#lintergetrules)
-    * [defineParser()](#linterdefineparser)
-    * [version](#linterversionlinterversion)
-* [RuleTester](#ruletester)
-    * [Customizing RuleTester](#customizing-ruletester)
-
----
-
-## ESLint class
-
-The `ESLint` class is the primary class to use in Node.js applications.
-
-This class depends on the Node.js `fs` module and the file system, so you cannot use it in browsers. If you want to lint code on browsers, use the [Linter](#linter) class instead.
-
-Here's a simple example of using the `ESLint` class:
-
-```js
-const { ESLint } = require("eslint");
-
-(async function main() {
-  // 1. Create an instance.
-  const eslint = new ESLint();
-
-  // 2. Lint files.
-  const results = await eslint.lintFiles(["lib/**/*.js"]);
-
-  // 3. Format the results.
-  const formatter = await eslint.loadFormatter("stylish");
-  const resultText = formatter.format(results);
-
-  // 4. Output it.
-  console.log(resultText);
-})().catch((error) => {
-  process.exitCode = 1;
-  console.error(error);
-});
-```
-
-And here is an example that autofixes lint problems:
-
-```js
-const { ESLint } = require("eslint");
-
-(async function main() {
-  // 1. Create an instance with the `fix` option.
-  const eslint = new ESLint({ fix: true });
-
-  // 2. Lint files. This doesn't modify target files.
-  const results = await eslint.lintFiles(["lib/**/*.js"]);
-
-  // 3. Modify the files with the fixed code.
-  await ESLint.outputFixes(results);
-
-  // 4. Format the results.
-  const formatter = await eslint.loadFormatter("stylish");
-  const resultText = formatter.format(results);
-
-  // 5. Output it.
-  console.log(resultText);
-})().catch((error) => {
-  process.exitCode = 1;
-  console.error(error);
-});
-```
-
-### ◆ new ESLint(options)
-
-```js
-const eslint = new ESLint(options);
-```
-
-Create a new `ESLint` instance.
-
-#### Parameters
-
-The `ESLint` constructor takes an `options` object. If you omit the `options` object then it uses default values for all options. The `options` object has the following properties.
-
-##### File Enumeration
-
-* `options.cwd` (`string`)<br>
-  Default is `process.cwd()`. The working directory. This must be an absolute path.
-* `options.errorOnUnmatchedPattern` (`boolean`)<br>
-  Default is `true`. Unless set to `false`, the [`eslint.lintFiles()`][eslint-lintfiles] method will throw an error when no target files are found.
-* `options.extensions` (`string[] | null`)<br>
-  Default is `null`. If you pass directory paths to the [`eslint.lintFiles()`][eslint-lintfiles] method, ESLint checks the files in those directories that have the given extensions. For example, when passing the `src/` directory and `extensions` is `[".js", ".ts"]`, ESLint will lint `*.js` and `*.ts` files in `src/`. If `extensions` is `null`, ESLint checks `*.js` files and files that match `overrides[].files` patterns in your configuration.<br>**Note:** This option only applies when you pass directory paths to the [`eslint.lintFiles()`][eslint-lintfiles] method. If you pass glob patterns like `lib/**/*`, ESLint will lint all files matching the glob pattern regardless of extension.
-* `options.globInputPaths` (`boolean`)<br>
-  Default is `true`. If `false` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method doesn't interpret glob patterns.
-* `options.ignore` (`boolean`)<br>
-  Default is `true`. If `false` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method doesn't respect `.eslintignore` files or `ignorePatterns` in your configuration.
-* `options.ignorePath` (`string | null`)<br>
-  Default is `null`. The path to a file ESLint uses instead of `$CWD/.eslintignore`. If a path is present and the file doesn't exist, this constructor will throw an error.
-
-##### Linting
-
-* `options.allowInlineConfig` (`boolean`)<br>
-  Default is `true`. If `false` is present, ESLint suppresses directive comments in source code. If this option is `false`, it overrides the `noInlineConfig` setting in your configurations.
-* `options.baseConfig` (`ConfigData | null`)<br>
-  Default is `null`. [Configuration object], extended by all configurations used with this instance. You can use this option to define the default settings that will be used if your configuration files don't configure it.
-* `options.overrideConfig` (`ConfigData | null`)<br>
-  Default is `null`. [Configuration object], overrides all configurations used with this instance. You can use this option to define the settings that will be used even if your configuration files configure it.
-* `options.overrideConfigFile` (`string | null`)<br>
-  Default is `null`. The path to a configuration file, overrides all configurations used with this instance. The `options.overrideConfig` option is applied after this option is applied.
-* `options.plugins` (`Record<string, Plugin> | null`)<br>
-  Default is `null`. The plugin implementations that ESLint uses for the `plugins` setting of your configuration. This is a map-like object. Those keys are plugin IDs and each value is implementation.
-* `options.reportUnusedDisableDirectives` (`"error" | "warn" | "off" | null`)<br>
-  Default is `null`. The severity to report unused eslint-disable directives. If this option is a severity, it overrides the `reportUnusedDisableDirectives` setting in your configurations.
-* `options.resolvePluginsRelativeTo` (`string` | `null`)<br>
-  Default is `null`. The path to a directory where plugins should be resolved from. If `null` is present, ESLint loads plugins from the location of the configuration file that contains the plugin setting. If a path is present, ESLint loads all plugins from there.
-* `options.rulePaths` (`string[]`)<br>
-  Default is `[]`. An array of paths to directories to load custom rules from.
-* `options.useEslintrc` (`boolean`)<br>
-  Default is `true`. If `false` is present, ESLint doesn't load configuration files (`.eslintrc.*` files). Only the configuration of the constructor options is valid.
-
-##### Autofix
-
-* `options.fix` (`boolean | (message: LintMessage) => boolean`)<br>
-  Default is `false`. If `true` is present, the [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods work in autofix mode. If a predicate function is present, the methods pass each lint message to the function, then use only the lint messages for which the function returned `true`.
-* `options.fixTypes` (`("directive" | "problem" | "suggestion" | "layout")[] | null`)<br>
-  Default is `null`. The types of the rules that the [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods use for autofix.
-
-##### Cache-related
-
-* `options.cache` (`boolean`)<br>
-  Default is `false`. If `true` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method caches lint results and uses it if each target file is not changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have to remove the cache file manually. The [`eslint.lintText()`][eslint-linttext] method doesn't use caches even if you pass the `options.filePath` to the method.
-* `options.cacheLocation` (`string`)<br>
-  Default is `.eslintcache`. The [`eslint.lintFiles()`][eslint-lintfiles] method writes caches into this file.
-* `options.cacheStrategy` (`string`)<br>
-  Default is `"metadata"`. Strategy for the cache to use for detecting changed files. Can be either `"metadata"` or `"content"`.
-
-### ◆ eslint.lintFiles(patterns)
-
-```js
-const results = await eslint.lintFiles(patterns);
-```
-
-This method lints the files that match the glob patterns and then returns the results.
-
-#### Parameters
-
-* `patterns` (`string | string[]`)<br>
-  The lint target files. This can contain any of file paths, directory paths, and glob patterns.
-
-#### Return Value
-
-* (`Promise<LintResult[]>`)<br>
-  The promise that will be fulfilled with an array of [LintResult] objects.
-
-### ◆ eslint.lintText(code, options)
-
-```js
-const results = await eslint.lintText(code, options);
-```
-
-This method lints the given source code text and then returns the results.
-
-By default, this method uses the configuration that applies to files in the current working directory (the `cwd` constructor option). If you want to use a different configuration, pass `options.filePath`, and ESLint will load the same configuration that [`eslint.lintFiles()`][eslint-lintfiles] would use for a file at `options.filePath`.
-
-If the `options.filePath` value is configured to be ignored, this method returns an empty array. If the `options.warnIgnored` option is set along with the `options.filePath` option, this method returns a [LintResult] object. In that case, the result may contain a warning that indicates the file was ignored.
-
-#### Parameters
-
-The second parameter `options` is omittable.
-
-* `code` (`string`)<br>
-  The source code text to check.
-* `options.filePath` (`string`)<br>
-  Optional. The path to the file of the source code text. If omitted, the `result.filePath` becomes the string `"<text>"`.
-* `options.warnIgnored` (`boolean`)<br>
-  Optional. If `true` is present and the `options.filePath` is a file ESLint should ignore, this method returns a lint result contains a warning message.
-
-#### Return Value
-
-* (`Promise<LintResult[]>`)<br>
-  The promise that will be fulfilled with an array of [LintResult] objects. This is an array (despite there being only one lint result) in order to keep the interfaces between this and the [`eslint.lintFiles()`][eslint-lintfiles] method similar.
-
-### ◆ eslint.getRulesMetaForResults(results)
-
-```js
-const results = await eslint.lintFiles(patterns);
-const rulesMeta = eslint.getRulesMetaForResults(results);
-```
-
-This method returns an object containing meta information for each rule that triggered a lint error in the given `results`.
-
-#### Parameters
-
-* `results` (`LintResult[]`)<br>
-  An array of [LintResult] objects returned from a call to `ESLint#lintFiles()` or `ESLint#lintText()`.
-
-#### Return Value
-
-* (`Object`)<br>
-  An object whose property names are the rule IDs from the `results` and whose property values are the rule's meta information (if available).
-
-### ◆ eslint.calculateConfigForFile(filePath)
-
-```js
-const config = await eslint.calculateConfigForFile(filePath);
-```
-
-This method calculates the configuration for a given file, which can be useful for debugging purposes.
-
-* It resolves and merges `extends` and `overrides` settings into the top level configuration.
-* It resolves the `parser` setting to absolute paths.
-* It normalizes the `plugins` setting to align short names. (e.g., `eslint-plugin-foo` → `foo`)
-* It adds the `processor` setting if a legacy file extension processor is matched.
-* It doesn't interpret the `env` setting to the `globals` and `parserOptions` settings, so the result object contains the `env` setting as is.
-
-#### Parameters
-
-* `filePath` (`string`)<br>
-  The path to the file whose configuration you would like to calculate. Directory paths are forbidden because ESLint cannot handle the `overrides` setting.
-
-#### Return Value
-
-* (`Promise<Object>`)<br>
-  The promise that will be fulfilled with a configuration object.
-
-### ◆ eslint.isPathIgnored(filePath)
-
-```js
-const isPathIgnored = await eslint.isPathIgnored(filePath);
-```
-
-This method checks if a given file is ignored by your configuration.
-
-#### Parameters
-
-* `filePath` (`string`)<br>
-  The path to the file you want to check.
-
-#### Return Value
-
-* (`Promise<boolean>`)<br>
-  The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then it will return `true`.
-
-### ◆ eslint.loadFormatter(nameOrPath)
-
-```js
-const formatter = await eslint.loadFormatter(nameOrPath);
-```
-
-This method loads a formatter. Formatters convert lint results to a human- or machine-readable string.
-
-#### Parameters
-
-* `nameOrPath` (`string | undefined`)<br>
-  The path to the file you want to check. The following values are allowed:
-    * `undefined`. In this case, loads the `"stylish"` built-in formatter.
-    * A name of [built-in formatters][builtin-formatters].
-    * A name of [third-party formatters][thirdparty-formatters]. For examples:
-        * `"foo"` will load `eslint-formatter-foo`.
-        * `"@foo"` will load `@foo/eslint-formatter`.
-        * `"@foo/bar"` will load `@foo/eslint-formatter-bar`.
-    * A path to the file that defines a formatter. The path must contain one or more path separators (`/`) in order to distinguish if it's a path or not. For example, start with `./`.
-
-#### Return Value
-
-* (`Promise<Formatter>`)<br>
-  The promise that will be fulfilled with a [Formatter] object.
-
-### ◆ ESLint.version
-
-```js
-const version = ESLint.version;
-```
-
-The version string of ESLint. E.g. `"7.0.0"`.
-
-This is a static property.
-
-### ◆ ESLint.outputFixes(results)
-
-```js
-await ESLint.outputFixes(results);
-```
-
-This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified files don't exist, this method does nothing.
-
-This is a static method.
-
-#### Parameters
-
-* `results` (`LintResult[]`)<br>
-  The [LintResult] objects to write.
-
-#### Return Value
-
-* (`Promise<void>`)<br>
-  The promise that will be fulfilled after all files are written.
-
-### ◆ ESLint.getErrorResults(results)
-
-```js
-const filteredResults = ESLint.getErrorResults(results);
-```
-
-This method copies the given results and removes warnings. The returned value contains only errors.
-
-This is a static method.
-
-#### Parameters
-
-* `results` (`LintResult[]`)<br>
-  The [LintResult] objects to filter.
-
-#### Return Value
-
-* (`LintResult[]`)<br>
-  The filtered [LintResult] objects.
-
-### ◆ LintResult type
-
-The `LintResult` value is the information of the linting result of each file. The [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods return it. It has the following properties:
-
-* `filePath` (`string`)<br>
-  The absolute path to the file of this result. This is the string `"<text>"` if the file path is unknown (when you didn't pass the `options.filePath` option to the [`eslint.lintText()`][eslint-linttext] method).
-* `messages` (`LintMessage[]`)<br>
-  The array of [LintMessage] objects.
-* `fixableErrorCount` (`number`)<br>
-  The number of errors that can be fixed automatically by the `fix` constructor option.
-* `fixableWarningCount` (`number`)<br>
-  The number of warnings that can be fixed automatically by the `fix` constructor option.
-* `errorCount` (`number`)<br>
-  The number of errors. This includes fixable errors and fatal errors.
-* `fatalErrorCount` (`number`)<br>
-  The number of fatal errors.
-* `warningCount` (`number`)<br>
-  The number of warnings. This includes fixable warnings.
-* `output` (`string | undefined`)<br>
-  The modified source code text. This property is undefined if any fixable messages didn't exist.
-* `source` (`string | undefined`)<br>
-  The original source code text. This property is undefined if any messages didn't exist or the `output` property exists.
-* `usedDeprecatedRules` (`{ ruleId: string; replacedBy: string[] }[]`)<br>
-  The information about the deprecated rules that were used to check this file.
-
-### ◆ LintMessage type
-
-The `LintMessage` value is the information of each linting error. The `messages` property of the [LintResult] type contains it. It has the following properties:
-
-* `ruleId` (`string` | `null`)<br>
-  The rule name that generates this lint message. If this message is generated by the ESLint core rather than rules, this is `null`.
-* `severity` (`1 | 2`)<br>
-  The severity of this message. `1` means warning and `2` means error.
-* `fatal` (`boolean | undefined`)<br>
-  `true` if this is a fatal error unrelated to a rule, like a parsing error.
-* `message` (`string`)<br>
-  The error message.
-* `line` (`number | undefined`)<br>
-  The 1-based line number of the begin point of this message.
-* `column` (`number | undefined`)<br>
-  The 1-based column number of the begin point of this message.
-* `endLine` (`number | undefined`)<br>
-  The 1-based line number of the end point of this message. This property is undefined if this message is not a range.
-* `endColumn` (`number | undefined`)<br>
-  The 1-based column number of the end point of this message. This property is undefined if this message is not a range.
-* `fix` (`EditInfo | undefined`)<br>
-  The [EditInfo] object of autofix. This property is undefined if this message is not fixable.
-* `suggestions` (`{ desc: string; fix: EditInfo }[] | undefined`)<br>
-  The list of suggestions. Each suggestion is the pair of a description and an [EditInfo] object to fix code. API users such as editor integrations can choose one of them to fix the problem of this message. This property is undefined if this message doesn't have any suggestions.
-
-### ◆ EditInfo type
-
-The `EditInfo` value is information to edit text. The `fix` and `suggestions` properties of [LintMessage] type contain it. It has following properties:
-
-* `range` (`[number, number]`)<br>
-  The pair of 0-based indices in source code text to remove.
-* `text` (`string`)<br>
-  The text to add.
-
-This edit information means replacing the range of the `range` property by the `text` property value. It's like `sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1])`. Therefore, it's an add if the `range[0]` and `range[1]` property values are the same value, and it's removal if the `text` property value is empty string.
-
-### ◆ Formatter type
-
-The `Formatter` value is the object to convert the [LintResult] objects to text. The [eslint.loadFormatter()][eslint-loadformatter] method returns it. It has the following method:
-
-* `format` (`(results: LintResult[]) => string | Promise<string>`)<br>
-  The method to convert the [LintResult] objects to text.
-
----
-
-## SourceCode
-
-The `SourceCode` type represents the parsed source code that ESLint executes on. It's used internally in ESLint and is also available so that already-parsed code can be used. You can create a new instance of `SourceCode` by passing in the text string representing the code and an abstract syntax tree (AST) in [ESTree](https://github.com/estree/estree) format (including location information, range information, comments, and tokens):
-
-```js
-const SourceCode = require("eslint").SourceCode;
-
-const code = new SourceCode("var foo = bar;", ast);
-```
-
-The `SourceCode` constructor throws an error if the AST is missing any of the required information.
-
-The `SourceCode` constructor strips Unicode BOM.
-Please note the AST also should be parsed from stripped text.
-
-```js
-const SourceCode = require("eslint").SourceCode;
-
-const code = new SourceCode("\uFEFFvar foo = bar;", ast);
-
-assert(code.hasBOM === true);
-assert(code.text === "var foo = bar;");
-```
-
-### SourceCode#splitLines()
-
-This is a static function on `SourceCode` that is used to split the source code text into an array of lines.
-
-```js
-const SourceCode = require("eslint").SourceCode;
-
-const code = "var a = 1;\nvar b = 2;"
-
-// split code into an array
-const codeLines = SourceCode.splitLines(code);
-
-/*
-    Value of codeLines will be
-    [
-        "var a = 1;",
-        "var b = 2;"
-    ]
- */
-```
-
----
-
-## Linter
-
-The `Linter` object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it simply parses and reports on the code. In particular, the `Linter` object does not process configuration objects or files. Unless you are working in the browser, you probably want to use the [ESLint class](#eslint-class) class instead.
-
-The `Linter` is a constructor, and you can create a new instance by passing in the options you want to use. The available options are:
-
-* `cwd` - Path to a directory that should be considered as the current working directory. It is accessible to rules by calling `context.getCwd()` (see [The Context Object](./working-with-rules.md#the-context-object)). If `cwd` is `undefined`, it will be normalized to `process.cwd()` if the global `process` object is defined (for example, in the Node.js runtime) , or `undefined` otherwise.
-
-For example:
-
-```js
-const Linter = require("eslint").Linter;
-const linter1 = new Linter({ cwd: 'path/to/project' });
-const linter2 = new Linter();
-```
-
-In this example, rules run on `linter1` will get `path/to/project` when calling `context.getCwd()`.
-Those run on `linter2` will get `process.cwd()` if the global `process` object is defined or `undefined` otherwise (e.g. on the browser <https://eslint.org/demo>).
-
-### Linter#verify
-
-The most important method on `Linter` is `verify()`, which initiates linting of the given text. This method accepts three arguments:
-
-* `code` - the source code to lint (a string or instance of `SourceCode`).
-* `config` - a configuration object that has been processed and normalized by `ESLint` using eslintrc files and/or other configuration arguments.
-    * **Note**: If you want to lint text and have your configuration be read and processed, use [`ESLint#lintFiles()`][eslint-lintfiles] or [`ESLint#lintText()`][eslint-linttext] instead.
-* `options` - (optional) Additional options for this run.
-    * `filename` - (optional) the filename to associate with the source code.
-    * `preprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins.md#processors-in-plugins) documentation describes as the `preprocess` method.
-    * `postprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins.md#processors-in-plugins) documentation describes as the `postprocess` method.
-    * `filterCodeBlock` - (optional) A function that decides which code blocks the linter should adopt. The function receives two arguments. The first argument is the virtual filename of a code block. The second argument is the text of the code block. If the function returned `true` then the linter adopts the code block. If the function was omitted, the linter adopts only `*.js` code blocks. If you provided a `filterCodeBlock` function, it overrides this default behavior, so the linter doesn't adopt `*.js` code blocks automatically.
-    * `disableFixes` - (optional) when set to `true`, the linter doesn't make either the `fix` or `suggestions` property of the lint result.
-    * `allowInlineConfig` - (optional) set to `false` to disable inline comments from changing ESLint rules.
-    * `reportUnusedDisableDirectives` - (optional) when set to `true`, adds reported errors for unused `eslint-disable` directives when no problems would be reported in the disabled area anyway.
-
-If the third argument is a string, it is interpreted as the `filename`.
-
-You can call `verify()` like this:
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-const messages = linter.verify("var foo;", {
-    rules: {
-        semi: 2
-    }
-}, { filename: "foo.js" });
-
-// or using SourceCode
-
-const Linter = require("eslint").Linter,
-    linter = new Linter(),
-    SourceCode = require("eslint").SourceCode;
-
-const code = new SourceCode("var foo = bar;", ast);
-
-const messages = linter.verify(code, {
-    rules: {
-        semi: 2
-    }
-}, { filename: "foo.js" });
-```
-
-The `verify()` method returns an array of objects containing information about the linting warnings and errors. Here's an example:
-
-```js
-{
-    fatal: false,
-    ruleId: "semi",
-    severity: 2,
-    line: 1,
-    column: 23,
-    message: "Expected a semicolon.",
-    fix: {
-        range: [1, 15],
-        text: ";"
-    }
-}
-```
-
-The information available for each linting message is:
-
-* `column` - the column on which the error occurred.
-* `fatal` - usually omitted, but will be set to true if there's a parsing error (not related to a rule).
-* `line` - the line on which the error occurred.
-* `message` - the message that should be output.
-* `nodeType` - the node or token type that was reported with the problem.
-* `ruleId` - the ID of the rule that triggered the messages (or null if `fatal` is true).
-* `severity` - either 1 or 2, depending on your configuration.
-* `endColumn` - the end column of the range on which the error occurred (this property is omitted if it's not range).
-* `endLine` - the end line of the range on which the error occurred (this property is omitted if it's not range).
-* `fix` - an object describing the fix for the problem (this property is omitted if no fix is available).
-* `suggestions` - an array of objects describing possible lint fixes for editors to programmatically enable (see details in the [Working with Rules docs](./working-with-rules.md#providing-suggestions)).
-
-Linting message objects have a deprecated `source` property. This property **will be removed** from linting messages in an upcoming breaking release. If you depend on this property, you should now use the `SourceCode` instance provided by the linter.
-
-You can also get an instance of the `SourceCode` object used inside of `linter` by using the `getSourceCode()` method:
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-const messages = linter.verify("var foo = bar;", {
-    rules: {
-        semi: 2
-    }
-}, { filename: "foo.js" });
-
-const code = linter.getSourceCode();
-
-console.log(code.text);     // "var foo = bar;"
-```
-
-In this way, you can retrieve the text and AST used for the last run of `linter.verify()`.
-
-### Linter#verifyAndFix()
-
-This method is similar to verify except that it also runs autofixing logic, similar to the `--fix` flag on the command line. The result object will contain the autofixed code, along with any remaining linting messages for the code that were not autofixed.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-const messages = linter.verifyAndFix("var foo", {
-    rules: {
-        semi: 2
-    }
-});
-```
-
-Output object from this method:
-
-```js
-{
-    fixed: true,
-    output: "var foo;",
-    messages: []
-}
-```
-
-The information available is:
-
-* `fixed` - True, if the code was fixed.
-* `output` - Fixed code text (might be the same as input if no fixes were applied).
-* `messages` - Collection of all messages for the given code (It has the same information as explained above under `verify` block).
-
-### Linter#defineRule
-
-Each `Linter` instance holds a map of rule names to loaded rule objects. By default, all ESLint core rules are loaded. If you want to use `Linter` with custom rules, you should use the `defineRule` method to register your rules by ID.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-linter.defineRule("my-custom-rule", {
-    // (an ESLint rule)
-
-    create(context) {
-        // ...
-    }
-});
-
-const results = linter.verify("// some source text", { rules: { "my-custom-rule": "error" } });
-```
-
-### Linter#defineRules
-
-This is a convenience method similar to `Linter#defineRule`, except that it allows you to define many rules at once using an object.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-linter.defineRules({
-    "my-custom-rule": { /* an ESLint rule */ create() {} },
-    "another-custom-rule": { /* an ESLint rule */ create() {} }
-});
-
-const results = linter.verify("// some source text", {
-    rules: {
-        "my-custom-rule": "error",
-        "another-custom-rule": "warn"
-    }
-});
-```
-
-### Linter#getRules
-
-This method returns a map of all loaded rules.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-linter.getRules();
-
-/*
-Map {
-  'accessor-pairs' => { meta: { docs: [Object], schema: [Array] }, create: [Function: create] },
-  'array-bracket-newline' => { meta: { docs: [Object], schema: [Array] }, create: [Function: create] },
-  ...
-}
-*/
-```
-
-### Linter#defineParser
-
-Each instance of `Linter` holds a map of custom parsers. If you want to define a parser programmatically, you can add this function
-with the name of the parser as first argument and the [parser object](/docs/developer-guide/working-with-custom-parsers.md) as second argument. The default `"espree"` parser will already be loaded for every `Linter` instance.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-linter.defineParser("my-custom-parser", {
-    parse(code, options) {
-        // ...
-    }
-});
-
-const results = linter.verify("// some source text", { parser: "my-custom-parser" });
-```
-
-### Linter#version/Linter.version
-
-Each instance of `Linter` has a `version` property containing the semantic version number of ESLint that the `Linter` instance is from.
-
-```js
-const Linter = require("eslint").Linter;
-const linter = new Linter();
-
-linter.version; // => '4.5.0'
-```
-
-There is also a `Linter.version` property that you can read without instantiating `Linter`:
-
-```js
-const Linter = require("eslint").Linter;
-
-Linter.version; // => '4.5.0'
-```
-
----
-
-## RuleTester
-
-`eslint.RuleTester` is a utility to write tests for ESLint rules. It is used internally for the bundled rules that come with ESLint, and it can also be used by plugins.
-
-Example usage:
-
-```js
-"use strict";
-
-const rule = require("../../../lib/rules/my-rule"),
-    RuleTester = require("eslint").RuleTester;
-
-const ruleTester = new RuleTester();
-
-ruleTester.run("my-rule", rule, {
-    valid: [
-        {
-            code: "var foo = true",
-            options: [{ allowFoo: true }]
-        }
-    ],
-
-    invalid: [
-        {
-            code: "var invalidVariable = true",
-            errors: [{ message: "Unexpected invalid variable." }]
-        },
-        {
-            code: "var invalidVariable = true",
-            errors: [{ message: /^Unexpected.+variable/ }]
-        }
-    ]
-});
-```
-
-The `RuleTester` constructor accepts an optional object argument, which can be used to specify defaults for your test cases. For example, if all of your test cases use ES2015, you can set it as a default:
-
-```js
-const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015 } });
-```
-
-The `RuleTester#run()` method is used to run the tests. It should be passed the following arguments:
-
-* The name of the rule (string)
-* The rule object itself (see ["working with rules"](./working-with-rules))
-* An object containing `valid` and `invalid` properties, each of which is an array containing test cases.
-
-A test case is an object with the following properties:
-
-* `name` (string, optional): The name to use for the test case, to make it easier to find
-* `code` (string, required): The source code that the rule should be run on
-* `options` (array, optional): The options passed to the rule. The rule severity should not be included in this list.
-* `filename` (string, optional): The filename for the given case (useful for rules that make assertions about filenames).
-* `only` (boolean, optional): Run this case exclusively for debugging in supported test frameworks.
-
-In addition to the properties above, invalid test cases can also have the following properties:
-
-* `errors` (number or array, required): Asserts some properties of the errors that the rule is expected to produce when run on this code. If this is a number, asserts the number of errors produced. Otherwise, this should be a list of objects, each containing information about a single reported error. The following properties can be used for an error (all are optional):
-    * `message` (string/regexp): The message for the error
-    * `messageId` (string): The Id for the error. See [testing errors with messageId](#testing-errors-with-messageid) for details
-    * `data` (object): Placeholder data which can be used in combination with `messageId`
-    * `type` (string): The type of the reported AST node
-    * `line` (number): The 1-based line number of the reported location
-    * `column` (number): The 1-based column number of the reported location
-    * `endLine` (number): The 1-based line number of the end of the reported location
-    * `endColumn` (number): The 1-based column number of the end of the reported location
-    * `suggestions` (array): An array of objects with suggestion details to check. See [Testing Suggestions](#testing-suggestions) for details
-
-    If a string is provided as an error instead of an object, the string is used to assert the `message` of the error.
-* `output` (string, required if the rule fixes code): Asserts the output that will be produced when using this rule for a single pass of autofixing (e.g. with the `--fix` command line flag). If this is `null`, asserts that none of the reported problems suggest autofixes.
-
-Any additional properties of a test case will be passed directly to the linter as config options. For example, a test case can have a `parserOptions` property to configure parser behavior:
-
-```js
-{
-    code: "let foo;",
-    parserOptions: { ecmaVersion: 2015 }
-}
-```
-
-If a valid test case only uses the `code` property, it can optionally be provided as a string containing the code, rather than an object with a `code` key.
-
-### Testing errors with `messageId`
-
-If the rule under test uses `messageId`s, you can use `messageId` property in a test case to assert reported error's `messageId` instead of its `message`.
-
-```js
-{
-    code: "let foo;",
-    errors: [{ messageId: "unexpected" }]
-}
-```
-
-For messages with placeholders, a test case can also use `data` property to additionally assert reported error's `message`.
-
-```js
-{
-    code: "let foo;",
-    errors: [{ messageId: "unexpected", data: { name: "foo" } }]
-}
-```
-
-Please note that `data` in a test case does not assert `data` passed to `context.report`. Instead, it is used to form the expected message text which is then compared with the received `message`.
-
-### Testing Suggestions
-
-Suggestions can be tested by defining a `suggestions` key on an errors object. The options to check for the suggestions are the following (all are optional):
-
-* `desc` (string): The suggestion `desc` value
-* `messageId` (string): The suggestion `messageId` value for suggestions that use `messageId`s
-* `data` (object): Placeholder data which can be used in combination with `messageId`
-* `output` (string): A code string representing the result of applying the suggestion fix to the input code
-
-Example:
-
-```js
-ruleTester.run("my-rule-for-no-foo", rule, {
-    valid: [],
-    invalid: [{
-        code: "var foo;",
-        errors: [{
-            suggestions: [{
-                desc: "Rename identifier 'foo' to 'bar'",
-                output: "var bar;"
-            }]
-        }]
-    }]
-})
-```
-
-`messageId` and `data` properties in suggestion test objects work the same way as in error test objects. See [testing errors with messageId](#testing-errors-with-messageid) for details.
-
-```js
-ruleTester.run("my-rule-for-no-foo", rule, {
-    valid: [],
-    invalid: [{
-        code: "var foo;",
-        errors: [{
-            suggestions: [{
-                messageId: "renameFoo",
-                data: { newName: "bar" },
-                output: "var bar;"
-            }]
-        }]
-    }]
-})
-```
-
-### Customizing RuleTester
-
-`RuleTester` depends on two functions to run tests: `describe` and `it`. These functions can come from various places:
-
-1. If `RuleTester.describe` and `RuleTester.it` have been set to function values, `RuleTester` will use `RuleTester.describe` and `RuleTester.it` to run tests. You can use this to customize the behavior of `RuleTester` to match a test framework that you're using.
-
-    If `RuleTester.itOnly` has been set to a function value, `RuleTester` will call `RuleTester.itOnly` instead of `RuleTester.it` to run cases with `only: true`. If `RuleTester.itOnly` is not set but `RuleTester.it` has an `only` function property, `RuleTester` will fall back to `RuleTester.it.only`.
-
-2. Otherwise, if `describe` and `it` are present as globals, `RuleTester` will use `global.describe` and `global.it` to run tests and `global.it.only` to run cases with `only: true`. This allows `RuleTester` to work when using frameworks like [Mocha](https://mochajs.org/) without any additional configuration.
-3. Otherwise, `RuleTester#run` will simply execute all of the tests in sequence, and will throw an error if one of them fails. This means you can simply execute a test file that calls `RuleTester.run` using `Node.js`, without needing a testing framework.
-
-`RuleTester#run` calls the `describe` function with two arguments: a string describing the rule, and a callback function. The callback calls the `it` function with a string describing the test case, and a test function. The test function will return successfully if the test passes, and throw an error if the test fails. The signature for `only` is the same as `it`. `RuleTester` calls either `it` or `only` for every case even when some cases have `only: true`, and the test framework is responsible for implementing test case exclusivity. (Note that this is the standard behavior for test suites when using frameworks like [Mocha](https://mochajs.org/); this information is only relevant if you plan to customize `RuleTester.describe`, `RuleTester.it`, or `RuleTester.itOnly`.)
-
-Example of customizing `RuleTester`:
-
-```js
-"use strict";
-
-const RuleTester = require("eslint").RuleTester,
-    test = require("my-test-runner"),
-    myRule = require("../../../lib/rules/my-rule");
-
-RuleTester.describe = function(text, method) {
-    RuleTester.it.title = text;
-    return method.call(this);
-};
-
-RuleTester.it = function(text, method) {
-    test(RuleTester.it.title + ": " + text, method);
-};
-
-// then use RuleTester as documented
-
-const ruleTester = new RuleTester();
-
-ruleTester.run("my-rule", myRule, {
-    valid: [
-        // valid test cases
-    ],
-    invalid: [
-        // invalid test cases
-    ]
-})
-```
-
----
-
-[configuration object]: ../user-guide/configuring
-[builtin-formatters]: https://eslint.org/docs/user-guide/formatters/
-[thirdparty-formatters]: https://www.npmjs.com/search?q=eslintformatter
-[eslint]: #eslint-class
-[eslint-constructor]: #-new-eslintoptions
-[eslint-lintfiles]: #-eslintlintfilespatterns
-[eslint-linttext]: #-eslintlinttextcode-options
-[eslint-getrulesmetaforresults]: #-eslintgetrulesmetaforresultsresults
-[eslint-calculateconfigforfile]: #-eslintcalculateconfigforfilefilepath
-[eslint-ispathignored]: #-eslintispathignoredfilepath
-[eslint-loadformatter]: #-eslintloadformatternameorpath
-[eslint-version]: #-eslintversion
-[eslint-outputfixes]: #-eslintoutputfixesresults
-[eslint-geterrorresults]: #-eslintgeterrorresultsresults
-[lintresult]: #-lintresult-type
-[lintmessage]: #-lintmessage-type
-[editinfo]: #-editinfo-type
-[formatter]: #-formatter-type
-[linter]: #linter
diff --git a/eslint/docs/developer-guide/scope-manager-interface.md b/eslint/docs/developer-guide/scope-manager-interface.md
deleted file mode 100644 (file)
index 2762f74..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-# ScopeManager
-
-This document was written based on the implementation of [eslint-scope](https://github.com/eslint/eslint-scope), a fork of [escope](https://github.com/estools/escope), and deprecates some members ESLint is not using.
-
-----
-
-## ScopeManager interface
-
-`ScopeManager` object has all variable scopes.
-
-### Fields
-
-#### scopes
-
-* **Type:** `Scope[]`
-* **Description:** All scopes.
-
-#### globalScope
-
-* **Type:** `Scope`
-* **Description:** The root scope.
-
-### Methods
-
-#### acquire(node, inner = false)
-
-* **Parameters:**
-    * `node` (`ASTNode`) ... An AST node to get their scope.
-    * `inner` (`boolean`) ... If the node has multiple scope, this returns the outermost scope normally. If `inner` is `true` then this returns the innermost scope. Default is `false`.
-* **Return type:** `Scope | null`
-* **Description:** Get the scope of a given AST node. The gotten scope's `block` property is the node. This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`.
-
-#### getDeclaredVariables(node)
-
-* **Parameters:**
-    * `node` (`ASTNode`) ... An AST node to get their variables.
-* **Return type:** `Variable[]`
-* **Description:** Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. If the node does not define any variable, this returns an empty array.
-
-### Deprecated members
-
-Those members are defined but not used in ESLint.
-
-#### isModule()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this program is module.
-
-#### isImpliedStrict()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this program is strict mode implicitly. I.e., `options.impliedStrict === true`.
-
-#### isStrictModeSupported()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this program supports strict mode. I.e., `options.ecmaVersion >= 5`.
-
-#### acquireAll(node)
-
-* **Parameters:**
-    * `node` (`ASTNode`) ... An AST node to get their scope.
-* **Return type:** `Scope[] | null`
-* **Description:** Get the scopes of a given AST node. The gotten scopes' `block` property is the node. If the node does not have their scope, this returns `null`.
-
-----
-
-## Scope interface
-
-`Scope` object has all variables and references in the scope.
-
-### Fields
-
-#### type
-
-* **Type:** `string`
-* **Description:** The type of this scope. This is one of `"block"`, `"catch"`, `"class"`, `"class-field-initializer"`, `"class-static-block"`, `"for"`, `"function"`, `"function-expression-name"`, `"global"`, `"module"`, `"switch"`, `"with"`.
-
-#### isStrict
-
-* **Type:** `boolean`
-* **Description:** `true` if this scope is strict mode.
-
-#### upper
-
-* **Type:** `Scope | null`
-* **Description:** The parent scope. If this is the global scope then this property is `null`.
-
-#### childScopes
-
-* **Type:** `Scope[]`
-* **Description:** The array of child scopes. This does not include grandchild scopes.
-
-#### variableScope
-
-* **Type:** `Scope`
-* **Description:** The nearest ancestor whose `type` is one of `"class-field-initializer"`, `"class-static-block"`, `"function"`, `"global"`, or `"module"`. For the aforementioned scopes this is a self-reference.
-
-> This represents the lowest enclosing function or top-level scope. Class field initializers and class static blocks are implicit functions. Historically, this was the scope which hosts variables that are defined by `var` declarations, and thus the name `variableScope`.
-
-#### block
-
-* **Type:** `ASTNode`
-* **Description:** The AST node which created this scope.
-
-#### variables
-
-* **Type:** `Variable[]`
-* **Description:** The array of all variables which are defined on this scope. This does not include variables which are defined in child scopes.
-
-#### set
-
-* **Type:** `Map<string, Variable>`
-* **Description:** The map from variable names to variable objects.
-
-> I hope to rename `set` field or replace by a method.
-
-#### references
-
-* **Type:** `Reference[]`
-* **Description:** The array of all references on this scope. This does not include references in child scopes.
-
-#### through
-
-* **Type:** `Reference[]`
-* **Description:** The array of references which could not be resolved in this scope.
-
-#### functionExpressionScope
-
-* **Type:** `boolean`
-* **Description:** `true` if this scope is `"function-expression-name"` scope.
-
-> I hope to deprecate `functionExpressionScope` field as replacing by `scope.type === "function-expression-name"`.
-
-### Deprecated members
-
-Those members are defined but not used in ESLint.
-
-#### taints
-
-* **Type:** `Map<string, boolean>`
-* **Description:** The map from variable names to `tainted` flag.
-
-#### dynamic
-
-* **Type:** `boolean`
-* **Description:** `true` if this scope is dynamic. I.e., the type of this scope is `"global"` or `"with"`.
-
-#### directCallToEvalScope
-
-* **Type:** `boolean`
-* **Description:** `true` if this scope contains `eval()` invocations.
-
-#### thisFound
-
-* **Type:** `boolean`
-* **Description:** `true` if this scope contains `this`.
-
-#### resolve(node)
-
-* **Parameters:**
-    * `node` (`ASTNode`) ... An AST node to get their reference object. The type of the node must be `"Identifier"`.
-* **Return type:** `Reference | null`
-* **Description:** Returns `this.references.find(r => r.identifier === node)`.
-
-#### isStatic()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** Returns `!this.dynamic`.
-
-#### isArgumentsMaterialized()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this is a `"function"` scope which has used `arguments` variable.
-
-#### isThisMaterialized()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** Returns `this.thisFound`.
-
-#### isUsedName(name)
-
-* **Parameters:**
-    * `name` (`string`) ... The name to check.
-* **Return type:** `boolean`
-* **Description:** `true` if a given name is used in variable names or reference names.
-
-----
-
-## Variable interface
-
-`Variable` object is variable's information.
-
-### Fields
-
-#### name
-
-* **Type:** `string`
-* **Description:** The name of this variable.
-
-#### identifiers
-
-* **Type:** `ASTNode[]`
-* **Description:** The array of `Identifier` nodes which define this variable. If this variable is redeclared, this array includes two or more nodes.
-
-> I hope to deprecate `identifiers` field as replacing by `defs[].name` field.
-
-#### references
-
-* **Type:** `Reference[]`
-* **Description:** The array of the references of this variable.
-
-#### defs
-
-* **Type:** `Definition[]`
-* **Description:** The array of the definitions of this variable.
-
-### Deprecated members
-
-Those members are defined but not used in ESLint.
-
-#### tainted
-
-* **Type:** `boolean`
-* **Description:** The `tainted` flag. (always `false`)
-
-#### stack
-
-* **Type:** `boolean`
-* **Description:** The `stack` flag. (I'm not sure what this means.)
-
-----
-
-## Reference interface
-
-`Reference` object is reference's information.
-
-### Fields
-
-#### identifier
-
-* **Type:** `ASTNode`
-* **Description:** The `Identifier` node of this reference.
-
-#### from
-
-* **Type:** `Scope`
-* **Description:** The `Scope` object that this reference is on.
-
-#### resolved
-
-* **Type:** `Variable | null`
-* **Description:** The `Variable` object that this reference refers. If such variable was not defined, this is `null`.
-
-#### writeExpr
-
-* **Type:** `ASTNode | null`
-* **Description:** The ASTNode object which is right-hand side.
-
-#### init
-
-* **Type:** `boolean`
-* **Description:** `true` if this writing reference is a variable initializer or a default value.
-
-### Methods
-
-#### isWrite()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is writing.
-
-#### isRead()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is reading.
-
-#### isWriteOnly()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is writing but not reading.
-
-#### isReadOnly()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is reading but not writing.
-
-#### isReadWrite()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is reading and writing.
-
-### Deprecated members
-
-Those members are defined but not used in ESLint.
-
-#### tainted
-
-* **Type:** `boolean`
-* **Description:** The `tainted` flag. (always `false`)
-
-#### flag
-
-* **Type:** `number`
-* **Description:** `1` is reading, `2` is writing, `3` is reading/writing.
-
-#### partial
-
-* **Type:** `boolean`
-* **Description:** The `partial` flag.
-
-#### isStatic()
-
-* **Parameters:**
-* **Return type:** `boolean`
-* **Description:** `true` if this reference is resolved statically.
-
-----
-
-## Definition interface
-
-`Definition` object is variable definition's information.
-
-### Fields
-
-#### type
-
-* **Type:** `string`
-* **Description:** The type of this definition. One of `"CatchClause"`, `"ClassName"`, `"FunctionName"`, `"ImplicitGlobalVariable"`, `"ImportBinding"`, `"Parameter"`, and `"Variable"`.
-
-#### name
-
-* **Type:** `ASTNode`
-* **Description:** The `Identifier` node of this definition.
-
-#### node
-
-* **Type:** `ASTNode`
-* **Description:** The enclosing node of the name.
-
-| type                       | node |
-|:---------------------------|:-----|
-| `"CatchClause"`            | `CatchClause`
-| `"ClassName"`              | `ClassDeclaration` or `ClassExpression`
-| `"FunctionName"`           | `FunctionDeclaration` or `FunctionExpression`
-| `"ImplicitGlobalVariable"` | `Program`
-| `"ImportBinding"`          | `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`
-| `"Parameter"`              | `FunctionDeclaration`, `FunctionExpression`, or `ArrowFunctionExpression`
-| `"Variable"`               | `VariableDeclarator`
-
-#### parent
-
-* **Type:** `ASTNode | undefined | null`
-* **Description:** The enclosing statement node of the name.
-
-| type                       | parent |
-|:---------------------------|:-------|
-| `"CatchClause"`            | `null`
-| `"ClassName"`              | `null`
-| `"FunctionName"`           | `null`
-| `"ImplicitGlobalVariable"` | `null`
-| `"ImportBinding"`          | `ImportDeclaration`
-| `"Parameter"`              | `null`
-| `"Variable"`               | `VariableDeclaration`
-
-### Deprecated members
-
-Those members are defined but not used in ESLint.
-
-#### index
-
-* **Type:** `number | undefined | null`
-* **Description:** The index in the declaration statement.
-
-#### kind
-
-* **Type:** `string | undefined | null`
-* **Description:** The kind of the declaration statement.
diff --git a/eslint/docs/developer-guide/selectors.md b/eslint/docs/developer-guide/selectors.md
deleted file mode 100644 (file)
index 78bb260..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-# Selectors
-
-Some rules and APIs allow the use of selectors to query an AST. This page is intended to:
-
-1. Explain what selectors are
-1. Describe the syntax for creating selectors
-1. Describe what selectors can be used for
-
-## What is a selector?
-
-A selector is a string that can be used to match nodes in an Abstract Syntax Tree (AST). This is useful for describing a particular syntax pattern in your code.
-
-The syntax for AST selectors is similar to the syntax for [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors). If you've used CSS selectors before, the syntax for AST selectors should be easy to understand.
-
-The simplest selector is just a node type. A node type selector will match all nodes with the given type. For example, consider the following program:
-
-```js
-var foo = 1;
-bar.baz();
-```
-
-The selector "`Identifier`" will match all `Identifier` nodes in the program. In this case, the selector will match the nodes for `foo`, `bar`, and `baz`.
-
-Selectors are not limited to matching against single node types. For example, the selector `VariableDeclarator > Identifier` will match all `Identifier` nodes that have a `VariableDeclarator` as a direct parent. In the program above, this will match the node for `foo`, but not the nodes for `bar` and `baz`.
-
-## What syntax can selectors have?
-
-The following selectors are supported:
-
-* AST node type: `ForStatement`
-* wildcard (matches all nodes): `*`
-* attribute existence: `[attr]`
-* attribute value: `[attr="foo"]` or `[attr=123]`
-* attribute regex: `[attr=/foo.*/]` <sub>(with some [known issues](#known-issues))</sub>
-* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]`
-* nested attribute: `[attr.level2="foo"]`
-* field: `FunctionDeclaration > Identifier.id`
-* First or last child: `:first-child` or `:last-child`
-* nth-child (no ax+b support): `:nth-child(2)`
-* nth-last-child (no ax+b support): `:nth-last-child(1)`
-* descendant: `FunctionExpression ReturnStatement`
-* child: `UnaryExpression > Literal`
-* following sibling: `VariableDeclaration ~ VariableDeclaration`
-* adjacent sibling: `ArrayExpression > Literal + SpreadElement`
-* negation: `:not(ForStatement)`
-* matches-any: `:matches([attr] > :first-child, :last-child)`
-* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern`
-
-This syntax is very powerful, and can be used to precisely select many syntactic patterns in your code.
-
-<sup>The examples in this section were adapted from the [esquery](https://github.com/estools/esquery) documentation.</sup>
-
-## What can selectors be used for?
-
-If you're writing custom ESLint rules, you might be interested in using selectors to examine specific parts of the AST. If you're configuring ESLint for your codebase, you might be interested in restricting particular syntax patterns with selectors.
-
-### Listening for selectors in rules
-
-When writing a custom ESLint rule, you can listen for nodes that match a particular selector as the AST is traversed.
-
-```js
-module.exports = {
-  create(context) {
-    // ...
-
-    return {
-
-      // This listener will be called for all IfStatement nodes with blocks.
-      "IfStatement > BlockStatement": function(blockStatementNode) {
-        // ...your logic here
-      },
-
-      // This listener will be called for all function declarations with more than 3 parameters.
-      "FunctionDeclaration[params.length>3]": function(functionDeclarationNode) {
-        // ...your logic here
-      }
-    };
-  }
-};
-```
-
-Adding `:exit` to the end of a selector will cause the listener to be called when the matching nodes are exited during traversal, rather than when they are entered.
-
-If two or more selectors match the same node, their listeners will be called in order of increasing specificity. The specificity of an AST selector is similar to the specificity of a CSS selector:
-
-* When comparing two selectors, the selector that contains more class selectors, attribute selectors, and pseudo-class selectors (excluding `:not()`) has higher specificity.
-* If the class/attribute/pseudo-class count is tied, the selector that contains more node type selectors has higher specificity.
-
-If multiple selectors have equal specificity, their listeners will be called in alphabetical order for that node.
-
-### Restricting syntax with selectors
-
-With the [no-restricted-syntax](/docs/rules/no-restricted-syntax.md) rule, you can restrict the usage of particular syntax in your code. For example, you can use the following configuration to disallow using `if` statements that do not have block statements as their body:
-
-```json
-{
-  "rules": {
-    "no-restricted-syntax": ["error", "IfStatement > :not(BlockStatement).consequent"]
-  }
-}
-```
-
-...or equivalently, you can use this configuration:
-
-```json
-{
-  "rules": {
-    "no-restricted-syntax": ["error", "IfStatement[consequent.type!='BlockStatement']"]
-  }
-}
-```
-
-As another example, you can disallow calls to `require()`:
-
-```json
-{
-  "rules": {
-    "no-restricted-syntax": ["error", "CallExpression[callee.name='require']"]
-  }
-}
-```
-
-Or you can enforce that calls to `setTimeout` always have two arguments:
-
-```json
-{
-  "rules": {
-    "no-restricted-syntax": ["error", "CallExpression[callee.name='setTimeout'][arguments.length!=2]"]
-  }
-}
-```
-
-Using selectors in the `no-restricted-syntax` rule can give you a lot of control over problematic patterns in your codebase, without needing to write custom rules to detect each pattern.
-
-### Known issues
-
-Due to a [bug](https://github.com/estools/esquery/issues/68) in [esquery](https://github.com/estools/esquery), regular expressions that contain a forward-slash character `/` aren't properly parsed, so `[value=/some\/path/]` will be a syntax error. As a [workaround](https://github.com/estools/esquery/issues/68), you can replace the `/` character with its unicode counterpart, like so: `[value=/some\\u002Fpath/]`.
diff --git a/eslint/docs/developer-guide/shareable-configs.md b/eslint/docs/developer-guide/shareable-configs.md
deleted file mode 100644 (file)
index 15032d9..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-# Shareable Configs
-
-The configuration that you have in your `.eslintrc` file is an important part of your project, and as such, you may want to share it with other projects or people. Shareable configs allow you to publish your configuration settings on [npm](https://www.npmjs.com/) and have others download and use it in their ESLint projects.
-
-## Creating a Shareable Config
-
-Shareable configs are simply npm packages that export a configuration object. To start, [create a Node.js module](https://docs.npmjs.com/getting-started/creating-node-modules) like you normally would. Make sure the module name begins with `eslint-config-`, such as `eslint-config-myconfig`.
-
-npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported, by naming or prefixing the module with `@scope/eslint-config`, such as `@scope/eslint-config` or `@scope/eslint-config-myconfig`.
-
-Create a new `index.js` file and export an object containing your settings:
-
-```js
-module.exports = {
-
-    globals: {
-        MyGlobal: true
-    },
-
-    rules: {
-        semi: [2, "always"]
-    }
-
-};
-```
-
-Since `index.js` is just JavaScript, you can optionally read these settings from a file or generate them dynamically.
-
-## Publishing a Shareable Config
-
-Once your shareable config is ready, you can [publish to npm](https://docs.npmjs.com/getting-started/publishing-npm-packages) to share with others. We recommend using the `eslint` and `eslintconfig` keywords so others can easily find your module.
-
-You should declare your dependency on ESLint in `package.json` using the [peerDependencies](https://docs.npmjs.com/files/package.json#peerdependencies) field. The recommended way to declare a dependency for future proof compatibility is with the ">=" range syntax, using the lowest required ESLint version. For example:
-
-```json
-{
-    "peerDependencies": {
-        "eslint": ">= 3"
-    }
-}
-```
-
-If your shareable config depends on a plugin, you should also specify it as a `peerDependency` (plugins will be loaded relative to the end user's project, so the end user is required to install the plugins they need). However, if your shareable config depends on a third-party parser or another shareable config, you can specify these packages as `dependencies`.
-
-You can also test your shareable config on your computer before publishing by linking your module globally. Type:
-
-```bash
-npm link
-```
-
-Then, in your project that wants to use your shareable config, type:
-
-```bash
-npm link eslint-config-myconfig
-```
-
-Be sure to replace `eslint-config-myconfig` with the actual name of your module.
-
-## Using a Shareable Config
-
-Shareable configs are designed to work with the `extends` feature of `.eslintrc` files. Instead of using a file path for the value of `extends`, use your module name. For example:
-
-```json
-{
-    "extends": "eslint-config-myconfig"
-}
-```
-
-You can also omit the `eslint-config-` and it will be automatically assumed by ESLint:
-
-```json
-{
-    "extends": "myconfig"
-}
-```
-
-### npm scoped modules
-
-npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported in a number of ways.
-
-By using the module name:
-
-```json
-{
-    "extends": "@scope/eslint-config"
-}
-```
-
-You can also omit the `eslint-config` and it will be automatically assumed by ESLint:
-
-```json
-{
-    "extends": "@scope"
-}
-```
-
-The module name can also be customized, just note that when using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config-` prefix. Doing so would result in package naming conflicts, and thus in resolution errors in most of cases. For example a package named `@scope/eslint-config-myconfig` vs `@scope/myconfig`, since both are valid scoped package names, the configuration should be specified as:
-
-```json
-{
-    "extends": "@scope/eslint-config-myconfig"
-}
-```
-
-You can override settings from the shareable config by adding them directly into your `.eslintrc` file.
-
-## Sharing Multiple Configs
-
-It's possible to share multiple configs in the same npm package. You can specify a default config for the package by following the directions in the first section. You can specify additional configs by simply adding a new file to your npm package and then referencing it from your ESLint config.
-
-As an example, you can create a file called `my-special-config.js` in the root of your npm package and export a config, such as:
-
-```js
-module.exports = {
-    rules: {
-        quotes: [2, "double"]
-    }
-};
-```
-
-Then, assuming you're using the package name `eslint-config-myconfig`, you can access the additional config via:
-
-```json
-{
-    "extends": "myconfig/my-special-config"
-}
-```
-
-When using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config` namespace. Doing so would result in resolution errors as explained above. Assuming the package name is `@scope/eslint-config`, the additional config can be accessed as:
-
-```json
-{
-    "extends": "@scope/eslint-config/my-special-config"
-}
-```
-
-Note that you can leave off the `.js` from the filename. In this way, you can add as many additional configs to your package as you'd like.
-
-**Important:** We strongly recommend always including a default config for your plugin to avoid errors.
-
-## Local Config File Resolution
-
-If you need to make multiple configs that can extend from each other and live in different directories, you can create a single shareable config that handles this scenario.
-
-As an example, let's assume you're using the package name `eslint-config-myconfig` and your package looks something like this:
-
-```text
-myconfig
-├── index.js
-└─┬ lib
-  ├── defaults.js
-  ├── dev.js
-  ├── ci.js
-  └─┬ ci
-    ├── frontend.js
-    ├── backend.js
-    └── common.js
-```
-
-In your `index.js` you can do something like this:
-
-```js
-module.exports = require('./lib/ci.js');
-```
-
-Now inside your package you have `/lib/defaults.js`, which contains:
-
-```js
-module.exports = {
-    rules: {
-        'no-console': 1
-    }
-};
-```
-
-Inside your `/lib/ci.js` you have
-
-```js
-module.exports = require('./ci/backend');
-```
-
-Inside your `/lib/ci/common.js`
-
-```js
-module.exports = {
-    rules: {
-        'no-alert': 2
-    },
-    extends: 'myconfig/lib/defaults'
-};
-```
-
-Despite being in an entirely different directory, you'll see that all `extends` must use the full package path to the config file you wish to extend.
-
-Now inside your `/lib/ci/backend.js`
-
-```js
-module.exports = {
-    rules: {
-        'no-console': 1
-    },
-    extends: 'myconfig/lib/ci/common'
-};
-```
-
-In the last file, you'll once again see that to properly resolve your config, you'll need include the full package path.
-
-## Further Reading
-
-* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
diff --git a/eslint/docs/developer-guide/source-code.md b/eslint/docs/developer-guide/source-code.md
deleted file mode 100644 (file)
index a6b7fa5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# Source Code
-
-ESLint is hosted at [GitHub](https://github.com/eslint/eslint) and uses [Git](https://git-scm.com/) for source control. In order to obtain the source code, you must first install Git on your system. Instructions for installing and setting up Git can be found at [https://help.github.com/articles/set-up-git/](https://help.github.com/articles/set-up-git/).
-
-If you simply want to create a local copy of the source to play with, you can clone the main repository using this command:
-
-    git clone git://github.com/eslint/eslint.git
-
-If you're planning on contributing to ESLint, then it's a good idea to fork the repository. You can find instructions for forking a repository at [https://help.github.com/articles/fork-a-repo/](https://help.github.com/articles/fork-a-repo/). After forking the ESLint repository, you'll want to create a local copy of your fork.
-
-## Start Developing
-
-Before you can get started developing, you'll need to have a couple of things installed:
-
-* [Node.JS](https://nodejs.org)
-* [npm](https://www.npmjs.com/)
-
-Once you have a local copy and have Node.JS and npm installed, you'll need to install the ESLint dependencies:
-
-    cd eslint
-    npm install
-
-Now when you run `eslint`, it will be running your local copy and showing your changes.
-
-**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies.
-
-## Directory structure
-
-The ESLint directory and file structure is as follows:
-
-* `bin` - executable files that are available when ESLint is installed
-* `conf` - default configuration information
-* `docs` - documentation for the project
-* `lib` - contains the source code
-    * `formatters` - all source files defining formatters
-    * `rules` - all source files defining rules
-* `tests` - the main unit test folder
-    * `lib` - tests for the source code
-        * `formatters` - tests for the formatters
-        * `rules` - tests for the rules
diff --git a/eslint/docs/developer-guide/unit-tests.md b/eslint/docs/developer-guide/unit-tests.md
deleted file mode 100644 (file)
index 46d77b5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# Unit Tests
-
-Most parts of ESLint have unit tests associated with them. Unit tests are written using [Mocha](https://mochajs.org/) and are required when making contributions to ESLint. You'll find all of the unit tests in the `tests` directory.
-
-When you first get the source code, you need to run `npm install` once initially to set ESLint for development. Once you've done that, you can run the tests via:
-
-    npm test
-
-This automatically starts Mocha and runs all tests in the `tests` directory. You need only add yours and it will automatically be picked up when running tests.
-
-## Running Individual Tests
-
-If you want to quickly run just one test file, you can do so by running Mocha directly and passing in the filename. For example:
-
-    npm run test:cli tests/lib/rules/no-wrap-func.js
-
-If you want to run just one or a subset of `RuleTester` test cases, add `only: true` to each test case or wrap the test case in `RuleTester.only(...)` to add it automatically:
-
-```js
-ruleTester.run("my-rule", myRule, {
-    valid: [
-        RuleTester.only("const valid = 42;"),
-        // Other valid cases
-    ],
-    invalid: [
-        {
-            code: "const invalid = 42;",
-            only: true,
-        },
-        // Other invalid cases
-    ]
-})
-```
-
-Running individual tests is useful when you're working on a specific bug and iterating on the solution. You should be sure to run `npm test` before submitting a pull request. `npm test` uses Mocha's `--forbid-only` option to prevent `only` tests from passing full test runs.
-
-## More Control on Unit Testing
-
-`npm run test:cli` is an alias of the Mocha cli in `./node_modules/.bin/mocha`. [Options](https://mochajs.org/#command-line-usage) are available to be provided to help to better control the test to run.
diff --git a/eslint/docs/developer-guide/working-with-custom-formatters.md b/eslint/docs/developer-guide/working-with-custom-formatters.md
deleted file mode 100644 (file)
index 54db663..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-# Working with Custom Formatters
-
-While ESLint has some built-in formatters available to format the linting results, it's also possible to create and distribute your own custom formatters. You can include custom formatters in your project directly or create an npm package to distribute them separately.
-
-Each formatter is just a function that receives a `results` object and returns a string. For example, the following is how the `json` built-in formatter is implemented:
-
-```js
-//my-awesome-formatter.js
-module.exports = function(results, context) {
-    return JSON.stringify(results, null, 2);
-};
-```
-
-Formatter can also be an async function (from ESLint v8.4.0), the following shows a simple example:
-
-```js
-//my-awesome-formatter.js
-module.exports = async function(results) {
-    const formatted = await asyncTask();
-    return formatted;
-};
-```
-
-To run ESLint with this formatter, you can use the `-f` (or `--format`) command line flag:
-
-```bash
-eslint -f ./my-awesome-formatter.js src/
-```
-
-In order to use a local file as a custom formatter, you must begin the filename with a dot (such as `./my-awesome-formatter.js` or `../formatters/my-awesome-formatter.js`).
-
-## Packaging the Custom Formatter
-
-Custom formatters can also be distributed through npm packages. To do so, create an npm package with a name in the format of `eslint-formatter-*`, where `*` is the name of your formatter (such as `eslint-formatter-awesome`). Projects should then install the package and can use the custom formatter with the `-f` (or `--format`) flag like this:
-
-```bash
-eslint -f awesome src/
-```
-
-Because ESLint knows to look for packages beginning with `eslint-formatter-` when the specified formatter doesn't begin with a dot, there is no need to type `eslint-formatter-` when using a packaged custom formatter.
-
-Tips for `package.json`:
-
-* The `main` entry should be the JavaScript file implementing your custom formatter.
-* Add these `keywords` to help users find your formatter:
-    * `"eslint"`
-    * `"eslint-formatter"`
-    * `"eslintformatter"`
-
-See all [formatters on npm](https://www.npmjs.com/search?q=eslint-formatter);
-
-## The `results` Argument
-
-The `results` object passed into a formatter is an array of objects containing the lint results for individual files. Here's some example output:
-
-```js
-[
-    {
-        filePath: "/path/to/a/file.js",
-        messages: [
-            {
-                ruleId: "curly",
-                severity: 2,
-                message: "Expected { after 'if' condition.",
-                line: 2,
-                column: 1,
-                nodeType: "IfStatement"
-            },
-            {
-                ruleId: "no-process-exit",
-                severity: 2,
-                message: "Don't use process.exit(); throw an error instead.",
-                line: 3,
-                column: 1,
-                nodeType: "CallExpression"
-            }
-        ],
-        errorCount: 2,
-        warningCount: 0,
-        fixableErrorCount: 0,
-        fixableWarningCount: 0,
-        source:
-            "var err = doStuff();\nif (err) console.log('failed tests: ' + err);\nprocess.exit(1);\n"
-    },
-    {
-        filePath: "/path/to/Gruntfile.js",
-        messages: [],
-        errorCount: 0,
-        warningCount: 0,
-        fixableErrorCount: 0,
-        fixableWarningCount: 0
-    }
-]
-```
-
-### The `result` Object
-
-<!-- This section is copied from the "Node.js API" page. Changes to this section should
-also be manually applied to that page. -->
-
-Each object in the `results` array is a `result` object. Each `result` object contains the path of the file that was linted and information about linting issues that were encountered. Here are the properties available on each `result` object:
-
-*   **filePath**: The absolute path to the file that was linted.
-*   **messages**: An array of `message` objects. See below for more info about messages.
-*   **errorCount**: The number of errors for the given file.
-*   **warningCount**: The number of warnings for the given file.
-*   **source**: The source code for the given file. This property is omitted if this file has no errors/warnings or if the `output` property is present.
-*   **output**: The source code for the given file with as many fixes applied as possible. This property is omitted if no fix is available.
-
-### The `message` Object
-
-Each `message` object contains information about the ESLint rule that was triggered by some source code. The properties available on each `message` object are:
-
-*   **ruleId**: the ID of the rule that produced the error or warning.
-*   **severity**: the severity of the failure, `1` for warnings and `2` for errors.
-*   **message**: the human readable description of the error.
-*   **line**: the line where the issue is located.
-*   **column**: the column where the issue is located.
-*   **nodeType**: the type of the node in the [AST](https://github.com/estree/estree/blob/master/spec.md#node-objects)
-
-## The `context` Argument
-
-The formatter function receives an object as the second argument. The object has two properties:
-
-* `cwd` ... The current working directory. This value comes from the `cwd` constructor option of the [ESLint](nodejs-api.md#-new-eslintoptions) class.
-* `rulesMeta` ... The `meta` property values of rules. See the [Working with Rules](working-with-rules.md) page for more information about rules.
-
-For example, here's what the object would look like if one rule, `no-extra-semi`, had been run:
-
-```js
-{
-    cwd: "/path/to/cwd",
-    rulesMeta: {
-        "no-extra-semi": {
-            type: "suggestion",
-            docs: {
-                description: "disallow unnecessary semicolons",
-                recommended: true,
-                url: "https://eslint.org/docs/rules/no-extra-semi"
-            },
-            fixable: "code",
-            schema: [],
-            messages: {
-                unexpected: "Unnecessary semicolon."
-            }
-        }
-    }
-}
-```
-
-**Note:** if a linting is executed by deprecated `CLIEngine` class, the `context` argument may be a different value because it is up to the API users. Please check whether the `context` argument is an expected value or not if you want to support legacy environments.
-
-## Examples
-
-### Summary formatter
-
-A formatter that only cares about the total count of errors and warnings will look like this:
-
-```javascript
-module.exports = function(results, context) {
-    // accumulate the errors and warnings
-    var summary = results.reduce(
-        function(seq, current) {
-            seq.errors += current.errorCount;
-            seq.warnings += current.warningCount;
-            return seq;
-        },
-        { errors: 0, warnings: 0 }
-    );
-
-    if (summary.errors > 0 || summary.warnings > 0) {
-        return (
-            "Errors: " +
-            summary.errors +
-            ", Warnings: " +
-            summary.warnings +
-            "\n"
-        );
-    }
-
-    return "";
-};
-```
-
-Running `eslint` with the previous custom formatter,
-
-```bash
-eslint -f ./my-awesome-formatter.js src/
-```
-
-Will produce the following output:
-
-```bash
-Errors: 2, Warnings: 4
-```
-
-### Detailed formatter
-
-A more complex report will look something like this:
-
-```javascript
-module.exports = function(results, context) {
-    var results = results || [];
-
-    var summary = results.reduce(
-        function(seq, current) {
-            current.messages.forEach(function(msg) {
-                var logMessage = {
-                    filePath: current.filePath,
-                    ruleId: msg.ruleId,
-                    ruleUrl: context.rulesMeta[msg.ruleId].docs.url,
-                    message: msg.message,
-                    line: msg.line,
-                    column: msg.column
-                };
-
-                if (msg.severity === 1) {
-                    logMessage.type = "warning";
-                    seq.warnings.push(logMessage);
-                }
-                if (msg.severity === 2) {
-                    logMessage.type = "error";
-                    seq.errors.push(logMessage);
-                }
-            });
-            return seq;
-        },
-        {
-            errors: [],
-            warnings: []
-        }
-    );
-
-    if (summary.errors.length > 0 || summary.warnings.length > 0) {
-        var lines = summary.errors
-            .concat(summary.warnings)
-            .map(function(msg) {
-                return (
-                    "\n" +
-                    msg.type +
-                    " " +
-                    msg.ruleId + (msg.ruleUrl ? " (" + msg.ruleUrl + ")" : "") +
-                    "\n  " +
-                    msg.filePath +
-                    ":" +
-                    msg.line +
-                    ":" +
-                    msg.column
-                );
-            })
-            .join("\n");
-
-        return lines + "\n";
-    }
-};
-```
-
-So running `eslint` with this custom formatter:
-
-```bash
-eslint -f ./my-awesome-formatter.js src/
-```
-
-The output will be
-
-```bash
-error space-infix-ops (https://eslint.org/docs/rules/space-infix-ops)
-  src/configs/bundler.js:6:8
-error semi (https://eslint.org/docs/rules/semi)
-  src/configs/bundler.js:6:10
-warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
-  src/configs/bundler.js:5:6
-warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
-  src/configs/bundler.js:6:6
-warning no-shadow (https://eslint.org/docs/rules/no-shadow)
-  src/configs/bundler.js:65:32
-warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
-  src/configs/clean.js:3:6
-```
-
-## Passing Arguments to Formatters
-
-While custom formatter do not receive arguments in addition to the results object, it is possible to pass additional data into formatters.
-
-## Using Environment Variables
-
-Custom formatters have access to environment variables and so can change their behavior based on environment variable data. Here's an example that uses a `AF_SKIP_WARNINGS` environment variable to determine whether or not to show warnings in the results:
-
-```js
-module.exports = function(results) {
-    var skipWarnings = process.env.AF_SKIP_WARNINGS === "true"; //af stands for awesome-formatter
-
-    var results = results || [];
-    var summary = results.reduce(
-        function(seq, current) {
-            current.messages.forEach(function(msg) {
-                var logMessage = {
-                    filePath: current.filePath,
-                    ruleId: msg.ruleId,
-                    message: msg.message,
-                    line: msg.line,
-                    column: msg.column
-                };
-
-                if (msg.severity === 1) {
-                    logMessage.type = "warning";
-                    seq.warnings.push(logMessage);
-                }
-                if (msg.severity === 2) {
-                    logMessage.type = "error";
-                    seq.errors.push(logMessage);
-                }
-            });
-            return seq;
-        },
-        {
-            errors: [],
-            warnings: []
-        }
-    );
-
-    if (summary.errors.length > 0 || summary.warnings.length > 0) {
-        var warnings = !skipWarnings ? summary.warnings : []; // skip the warnings in that case
-
-        var lines = summary.errors
-            .concat(warnings)
-            .map(function(msg) {
-                return (
-                    "\n" +
-                    msg.type +
-                    " " +
-                    msg.ruleId +
-                    "\n  " +
-                    msg.filePath +
-                    ":" +
-                    msg.line +
-                    ":" +
-                    msg.column
-                );
-            })
-            .join("\n");
-
-        return lines + "\n";
-    }
-};
-```
-
-You would run ESLint with this custom formatter and an environment variable set like this:
-
-```bash
-AF_SKIP_WARNINGS=true eslint -f ./my-awesome-formatter.js src/
-```
-
-The output would be:
-
-```bash
-error space-infix-ops
-  src/configs/bundler.js:6:8
-
-error semi
-  src/configs/bundler.js:6:10
-```
-
-### Complex Argument Passing
-
-If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](https://eslint.org/docs/user-guide/formatters/) and pipe the output to a second program. For example:
-
-```bash
-eslint -f json src/ | your-program-that-reads-JSON --option
-```
-
-In this example, the `your-program-that-reads-json` program can accept the raw JSON of ESLint results and process it before outputting its own format of the results. You can pass as many command line arguments to that program as are necessary to customize the output.
-
-## Note: Formatting for Terminals
-
-Modern terminals like [iTerm2](https://www.iterm2.com/) or [Guake](http://guake-project.org/) expect a specific results format to automatically open filenames when they are clicked. Most terminals support this format for that purpose:
-
-```bash
-file:line:column
-```
diff --git a/eslint/docs/developer-guide/working-with-custom-parsers.md b/eslint/docs/developer-guide/working-with-custom-parsers.md
deleted file mode 100644 (file)
index 6387b84..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Working with Custom Parsers
-
-If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and optional properties `services`, `scopeManager`, and `visitorKeys`.
-
-* `ast` should contain the AST.
-* `services` can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`. Default is an empty object.
-* `scopeManager` can be a [ScopeManager](./scope-manager-interface.md) object. Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. Default is the `ScopeManager` object which is created by [eslint-scope](https://github.com/eslint/eslint-scope).
-    * Support for `scopeManager` was added in ESLint v4.14.0. ESLint versions which support `scopeManager` will provide an `eslintScopeManager: true` property in `parserOptions`, which can be used for feature detection.
-* `visitorKeys` can be an object to customize AST traversal. The keys of the object are the type of AST nodes. Each value is an array of the property names which should be traversed. Default is [KEYS of `eslint-visitor-keys`](https://github.com/eslint/eslint-visitor-keys#evkkeys).
-    * Support for `visitorKeys` was added in ESLint v4.14.0. ESLint versions which support `visitorKeys` will provide an `eslintVisitorKeys: true` property in `parserOptions`, which can be used for feature detection.
-
-You can find an ESLint parser project [here](https://github.com/typescript-eslint/typescript-eslint).
-
-```json
-{
-    "parser": "./path/to/awesome-custom-parser.js"
-}
-```
-
-```javascript
-var espree = require("espree");
-// awesome-custom-parser.js
-exports.parseForESLint = function(code, options) {
-    return {
-        ast: espree.parse(code, options),
-        services: {
-            foo: function() {
-                console.log("foo");
-            }
-        },
-        scopeManager: null,
-        visitorKeys: null
-    };
-};
-
-```
-
-## The AST specification
-
-The AST that custom parsers should create is based on [ESTree](https://github.com/estree/estree). The AST requires some additional properties about detail information of the source code.
-
-### All nodes:
-
-All nodes must have `range` property.
-
-* `range` (`number[]`) is an array of two numbers. Both numbers are a 0-based index which is the position in the array of source code characters. The first is the start position of the node, the second is the end position of the node. `code.slice(node.range[0], node.range[1])` must be the text of the node. This range does not include spaces/parentheses which are around the node.
-* `loc` (`SourceLocation`) must not be `null`. [The `loc` property is defined as nullable by ESTree](https://github.com/estree/estree/blob/25834f7247d44d3156030f8e8a2d07644d771fdb/es5.md#node-objects), but ESLint requires this property. On the other hand, `SourceLocation#source` property can be `undefined`. ESLint does not use the `SourceLocation#source` property.
-
-The `parent` property of all nodes must be rewritable. ESLint sets each node's `parent` property to its parent node while traversing, before any rules have access to the AST.
-
-### The `Program` node:
-
-The `Program` node must have `tokens` and `comments` properties. Both properties are an array of the below Token interface.
-
-```ts
-interface Token {
-    type: string;
-    loc: SourceLocation;
-    range: [number, number]; // See "All nodes:" section for details of `range` property.
-    value: string;
-}
-```
-
-* `tokens` (`Token[]`) is the array of tokens which affect the behavior of programs. Arbitrary spaces can exist between tokens, so rules check the `Token#range` to detect spaces between tokens. This must be sorted by `Token#range[0]`.
-* `comments` (`Token[]`) is the array of comment tokens. This must be sorted by `Token#range[0]`.
-
-The range indexes of all tokens and comments must not overlap with the range of other tokens and comments.
-
-### The `Literal` node:
-
-The `Literal` node must have `raw` property.
-
-* `raw` (`string`) is the source code of this literal. This is the same as `code.slice(node.range[0], node.range[1])`.
diff --git a/eslint/docs/developer-guide/working-with-plugins.md b/eslint/docs/developer-guide/working-with-plugins.md
deleted file mode 100644 (file)
index bea4702..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-# Working with Plugins
-
-Each plugin is an npm module with a name in the format of `eslint-plugin-<plugin-name>`, such as `eslint-plugin-jquery`. You can also use scoped packages in the format of `@<scope>/eslint-plugin-<plugin-name>` such as `@jquery/eslint-plugin-jquery` or even `@<scope>/eslint-plugin` such as `@jquery/eslint-plugin`.
-
-## Create a Plugin
-
-The easiest way to start creating a plugin is to use the [Yeoman generator](https://www.npmjs.com/package/generator-eslint). The generator will guide you through setting up the skeleton of a plugin.
-
-### Rules in Plugins
-
-Plugins can expose additional rules for use in ESLint. To do so, the plugin must export a `rules` object containing a key-value mapping of rule ID to rule. The rule ID does not have to follow any naming convention (so it can just be `dollar-sign`, for instance).
-
-```js
-module.exports = {
-    rules: {
-        "dollar-sign": {
-            create: function (context) {
-                // rule implementation ...
-            }
-        }
-    }
-};
-```
-
-To use the rule in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the rule name. So if this plugin were named `eslint-plugin-myplugin`, then in your configuration you'd refer to the rule by the name `myplugin/dollar-sign`. Example: `"rules": {"myplugin/dollar-sign": 2}`.
-
-### Environments in Plugins
-
-Plugins can expose additional environments for use in ESLint. To do so, the plugin must export an `environments` object. The keys of the `environments` object are the names of the different environments provided and the values are the environment settings. For example:
-
-```js
-module.exports = {
-    environments: {
-        jquery: {
-            globals: {
-                $: false
-            }
-        }
-    }
-};
-```
-
-There's a `jquery` environment defined in this plugin. To use the environment in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the environment name. So if this plugin were named `eslint-plugin-myplugin`, then you would set the environment in your configuration to be `"myplugin/jquery"`.
-
-Plugin environments can define the following objects:
-
-1. `globals` - acts the same `globals` in a configuration file. The keys are the names of the globals and the values are `true` to allow the global to be overwritten and `false` to disallow.
-1. `parserOptions` - acts the same as `parserOptions` in a configuration file.
-
-### Processors in Plugins
-
-You can also create plugins that would tell ESLint how to process files other than JavaScript. In order to create a processor, the object that is exported from your module has to conform to the following interface:
-
-```js
-module.exports = {
-    processors: {
-        "processor-name": {
-            // takes text of the file and filename
-            preprocess: function(text, filename) {
-                // here, you can strip out any non-JS content
-                // and split into multiple strings to lint
-
-                return [ // return an array of code blocks to lint
-                    { text: code1, filename: "0.js" },
-                    { text: code2, filename: "1.js" },
-                ];
-            },
-
-            // takes a Message[][] and filename
-            postprocess: function(messages, filename) {
-                // `messages` argument contains two-dimensional array of Message objects
-                // where each top-level array item contains array of lint messages related
-                // to the text that was returned in array from preprocess() method
-
-                // you need to return a one-dimensional array of the messages you want to keep
-                return [].concat(...messages);
-            },
-
-            supportsAutofix: true // (optional, defaults to false)
-        }
-    }
-};
-```
-
-**The `preprocess` method** takes the file contents and filename as arguments, and returns an array of code blocks to lint. The code blocks will be linted separately but still be registered to the filename.
-
-A code block has two properties `text` and `filename`; the `text` property is the content of the block and the `filename` property is the name of the block. Name of the block can be anything, but should include the file extension, that would tell the linter how to process the current block. The linter will check [`--ext` CLI option](../user-guide/command-line-interface.md#--ext) to see if the current block should be linted, and resolve `overrides` configs to check how to process the current block.
-
-It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.
-
-**The `postprocess` method** takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the locations of all errors to correspond to locations in the original, unprocessed code, and aggregate them into a single flat array and return it.
-
-Reported problems have the following location information:
-
-```typescript
-{
-    line: number,
-    column: number,
-
-    endLine?: number,
-    endColumn?: number
-}
-```
-
-By default, ESLint will not perform autofixes when a processor is used, even when the `--fix` flag is enabled on the command line. To allow ESLint to autofix code when using your processor, you should take the following additional steps:
-
-1. Update the `postprocess` method to additionally transform the `fix` property of reported problems. All autofixable problems will have a `fix` property, which is an object with the following schema:
-
-    ```js
-    {
-        range: [number, number],
-        text: string
-    }
-    ```
-
-    The `range` property contains two indexes in the code, referring to the start and end location of a contiguous section of text that will be replaced. The `text` property refers to the text that will replace the given range.
-
-    In the initial list of problems, the `fix` property will refer to a fix in the processed JavaScript. The `postprocess` method should transform the object to refer to a fix in the original, unprocessed file.
-
-2. Add a `supportsAutofix: true` property to the processor.
-
-You can have both rules and processors in a single plugin. You can also have multiple processors in one plugin.
-To support multiple extensions, add each one to the `processors` element and point them to the same object.
-
-#### Specifying Processor in Config Files
-
-To use a processor, add its ID to a `processor` section in the config file. Processor ID is a concatenated string of plugin name and processor name with a slash as a separator. This can also be added to a `overrides` section of the config, to specify which processors should handle which files.
-
-For example:
-
-```yml
-plugins:
-  - a-plugin
-overrides:
-  - files: "*.md"
-    processor: a-plugin/markdown
-```
-
-See [Specifying Processor](../user-guide/configuring/plugins.md#specifying-processor) for details.
-
-#### File Extension-named Processor
-
-If a processor name starts with `.`, ESLint handles the processor as a **file extension-named processor** especially and applies the processor to the kind of files automatically. People don't need to specify the file extension-named processors in their config files.
-
-For example:
-
-```js
-module.exports = {
-    processors: {
-        // This processor will be applied to `*.md` files automatically.
-        // Also, people can use this processor as "plugin-id/.md" explicitly.
-        ".md": {
-            preprocess(text, filename) { /* ... */ },
-            postprocess(messageLists, filename) { /* ... */ }
-        }
-    }
-}
-```
-
-### Configs in Plugins
-
-You can bundle configurations inside a plugin by specifying them under the `configs` key. This can be useful when you want to provide not just code style, but also some custom rules to support it. Multiple configurations are supported per plugin. Note that it is not possible to specify a default configuration for a given plugin and that users must specify in their configuration file when they want to use one.
-
-```js
-// eslint-plugin-myPlugin
-
-module.exports = {
-    configs: {
-        myConfig: {
-            plugins: ["myPlugin"],
-            env: ["browser"],
-            rules: {
-                semi: "error",
-                "myPlugin/my-rule": "error",
-                "eslint-plugin-myPlugin/another-rule": "error"
-            }
-        },
-        myOtherConfig: {
-            plugins: ["myPlugin"],
-            env: ["node"],
-            rules: {
-                "myPlugin/my-rule": "off",
-                "eslint-plugin-myPlugin/another-rule": "off",
-                "eslint-plugin-myPlugin/yet-another-rule": "error"
-            }
-        }
-    }
-};
-```
-
-If the example plugin above were called `eslint-plugin-myPlugin`, the `myConfig` and `myOtherConfig` configurations would then be usable by extending off of `"plugin:myPlugin/myConfig"` and `"plugin:myPlugin/myOtherConfig"`, respectively.
-
-```json
-{
-    "extends": ["plugin:myPlugin/myConfig"]
-}
-
-```
-
-**Note:** Please note that configuration will not enable any of the plugin's rules by default, and instead should be treated as a standalone config. This means that you must specify your plugin name in the `plugins` array as well as any rules you want to enable that are part of the plugin. Any plugin rules must be prefixed with the short or long plugin name. See [Configuring Plugins](../user-guide/configuring/plugins.md#configuring-plugins) for more information.
-
-### Peer Dependency
-
-To make clear that the plugin requires ESLint to work correctly you have to declare ESLint as a `peerDependency` in your `package.json`.
-The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDependency` points to ESLint `0.8.0` or later.
-
-```json
-{
-    "peerDependencies": {
-        "eslint": ">=0.8.0"
-    }
-}
-```
-
-### Testing
-
-ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api.md#ruletester) utility to make it easy to test the rules of your plugin.
-
-### Linting
-
-ESLint plugins should be linted too! It's suggested to lint your plugin with the `recommended` configurations of:
-
-* [eslint](https://www.npmjs.com/package/eslint)
-* [eslint-plugin-eslint-plugin](https://www.npmjs.com/package/eslint-plugin-eslint-plugin)
-* [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node)
-
-## Share Plugins
-
-In order to make your plugin available to the community you have to publish it on npm.
-
-Recommended keywords:
-
-* `eslint`
-* `eslintplugin`
-
-Add these keywords into your `package.json` file to make it easy for others to find.
-
-## Further Reading
-
-* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
diff --git a/eslint/docs/developer-guide/working-with-rules-deprecated.md b/eslint/docs/developer-guide/working-with-rules-deprecated.md
deleted file mode 100644 (file)
index 63d7bb2..0000000
+++ /dev/null
@@ -1,577 +0,0 @@
-# Working with Rules (Deprecated)
-
-**Note:** This page covers the deprecated rule format for ESLint <= 2.13.1. [This is the most recent rule format](./working-with-rules.md).
-
-Each rule in ESLint has two files named with its identifier (for example, `no-extra-semi`).
-
-* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
-* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
-
-**Important:** If you submit a **core** rule to the ESLint repository, you **must** follow some conventions explained below.
-
-Here is the basic format of the source file for a rule:
-
-```js
-/**
- * @fileoverview Rule to disallow unnecessary semicolons
- * @author Nicholas C. Zakas
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-    return {
-        // callback functions
-    };
-};
-
-module.exports.schema = []; // no options
-```
-
-## Rule Basics
-
-`schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring/rules.md#configuring-rules)
-
-`create` (function) returns an object with methods that ESLint calls to "visit" nodes while traversing the abstract syntax tree (AST as defined by [ESTree](https://github.com/estree/estree)) of JavaScript code:
-
-* if a key is a node type, ESLint calls that **visitor** function while going **down** the tree
-* if a key is a node type plus `:exit`, ESLint calls that **visitor** function while going **up** the tree
-* if a key is an event name, ESLint calls that **handler** function for [code path analysis](./code-path-analysis.md)
-
-A rule can use the current node and its surrounding tree to report or fix problems.
-
-Here are methods for the [array-callback-return](../rules/array-callback-return.md) rule:
-
-```js
-function checkLastSegment (node) {
-    // report problem for function if last code path segment is reachable
-}
-
-module.exports = function(context) {
-    // declare the state of the rule
-    return {
-        ReturnStatement: function(node) {
-            // at a ReturnStatement node while going down
-        },
-        // at a function expression node while going up:
-        "FunctionExpression:exit": checkLastSegment,
-        "ArrowFunctionExpression:exit": checkLastSegment,
-        onCodePathStart: function (codePath, node) {
-            // at the start of analyzing a code path
-        },
-        onCodePathEnd: function(codePath, node) {
-            // at the end of analyzing a code path
-        }
-    };
-};
-```
-
-## The Context Object
-
-The `context` object contains additional functionality that is helpful for rules to do their jobs. As the name implies, the `context` object contains information that is relevant to the context of the rule. The `context` object has the following properties:
-
-* `parserOptions` - the parser options configured for this run (more details [here](../user-guide/configuring/language-options.md#specifying-parser-options)).
-* `id` - the rule ID.
-* `options` - an array of rule options.
-* `settings` - the `settings` from configuration.
-* `parserPath` - the full path to the `parser` from configuration.
-
-Additionally, the `context` object has the following methods:
-
-* `getAncestors()` - returns an array of ancestor nodes based on the current traversal.
-* `getDeclaredVariables(node)` - returns the declared variables on the given node.
-* `getFilename()` - returns the filename associated with the source.
-* `getScope()` - returns the current scope.
-* `getSourceCode()` - returns a `SourceCode` object that you can use to work with the source that was passed to ESLint
-* `markVariableAsUsed(name)` - marks the named variable in scope as used. This affects the [no-unused-vars](../rules/no-unused-vars.md) rule.
-* `report(descriptor)` - reports a problem in the code.
-
-**Deprecated:** The following methods on the `context` object are deprecated. Please use the corresponding methods on `SourceCode` instead:
-
-* `getAllComments()` - returns an array of all comments in the source. Use `sourceCode.getAllComments()` instead.
-* `getComments(node)` - returns the leading and trailing comments arrays for the given node. Use `sourceCode.getComments(node)` instead.
-* `getFirstToken(node)` - returns the first token representing the given node. Use `sourceCode.getFirstToken(node)` instead.
-* `getFirstTokens(node, count)` - returns the first `count` tokens representing the given node. Use `sourceCode.getFirstTokens(node, count)` instead.
-* `getJSDocComment(node)` - returns the JSDoc comment for a given node or `null` if there is none. Use `sourceCode.getJSDocComment(node)` instead.
-* `getLastToken(node)` - returns the last token representing the given node.  Use `sourceCode.getLastToken(node)` instead.
-* `getLastTokens(node, count)` - returns the last `count` tokens representing the given node. Use `sourceCode.getLastTokens(node, count)` instead.
-* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index. Use `sourceCode.getNodeByRangeIndex(index)` instead.
-* `getSource(node)` - returns the source code for the given node. Omit `node` to get the whole source. Use `sourceCode.getText(node)` instead.
-* `getSourceLines()` - returns the entire source code split into an array of string lines. Use `sourceCode.lines` instead.
-* `getTokenAfter(nodeOrToken)` - returns the first token after the given node or token. Use `sourceCode.getTokenAfter(nodeOrToken)` instead.
-* `getTokenBefore(nodeOrToken)` - returns the first token before the given node or token. Use `sourceCode.getTokenBefore(nodeOrToken)` instead.
-* `getTokenByRangeStart(index)` - returns the token whose range starts at the given index in the source. Use `sourceCode.getTokenByRangeStart(index)` instead.
-* `getTokens(node)` - returns all tokens for the given node. Use `sourceCode.getTokens(node)` instead.
-* `getTokensAfter(nodeOrToken, count)` - returns `count` tokens after the given node or token. Use `sourceCode.getTokensAfter(nodeOrToken, count)` instead.
-* `getTokensBefore(nodeOrToken, count)` - returns `count` tokens before the given node or token. Use `sourceCode.getTokensBefore(nodeOrToken, count)` instead.
-* `getTokensBetween(node1, node2)` - returns the tokens between two nodes. Use `sourceCode.getTokensBetween(node1, node2)` instead.
-* `report(node, [location], message)` - reports a problem in the code.
-
-### context.report()
-
-The main method you'll use is `context.report()`, which publishes a warning or error (depending on the configuration being used). This method accepts a single argument, which is an object containing the following properties:
-
-* `message` - the problem message.
-* `node` - (optional)  the AST node related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
-* `loc` - (optional) an object specifying the location of the problem. If both `loc` and `node` are specified, then the location is used from `loc` instead of `node`.
-    * `line` - the 1-based line number at which the problem occurred.
-    * `column` - the 0-based column number at which the problem occurred.
-* `data` - (optional) placeholder data for `message`.
-* `fix` - (optional) a function that applies a fix to resolve the problem.
-
-Note that at least one of `node` or `loc` is required.
-
-The simplest example is to use just `node` and `message`:
-
-```js
-context.report({
-    node: node,
-    message: "Unexpected identifier"
-});
-```
-
-The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
-
-You can also use placeholders in the message and provide `data`:
-
-```js
-{% raw %}
-context.report({
-    node: node,
-    message: "Unexpected identifier: {{ identifier }}",
-    data: {
-        identifier: node.name
-    }
-});
-{% endraw %}
-```
-
-Note that leading and trailing whitespace is optional in message parameters.
-
-The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
-
-### Applying Fixes
-
-If you'd like ESLint to attempt to fix the problem you're reporting, you can do so by specifying the `fix` function when using `context.report()`. The `fix` function receives a single argument, a `fixer` object, that you can use to apply a fix. For example:
-
-```js
-context.report({
-    node: node,
-    message: "Missing semicolon".
-    fix: function(fixer) {
-        return fixer.insertTextAfter(node, ";");
-    }
-});
-```
-
-Here, the `fix()` function is used to insert a semicolon after the node. Note that the fix is not immediately applied and may not be applied at all if there are conflicts with other fixes. If the fix cannot be applied, then the problem message is reported as usual; if the fix can be applied, then the problem message is not reported.
-
-The `fixer` object has the following methods:
-
-* `insertTextAfter(nodeOrToken, text)` - inserts text after the given node or token
-* `insertTextAfterRange(range, text)` - inserts text after the given range
-* `insertTextBefore(nodeOrToken, text)` - inserts text before the given node or token
-* `insertTextBeforeRange(range, text)` - inserts text before the given range
-* `remove(nodeOrToken)` - removes the given node or token
-* `removeRange(range)` - removes text in the given range
-* `replaceText(nodeOrToken, text)` - replaces the text in the given node or token
-* `replaceTextRange(range, text)` - replaces the text in the given range
-
-Best practices for fixes:
-
-1. Make fixes that are as small as possible. Anything more than a single character is risky and could prevent other, simpler fixes from being made.
-1. Only make one fix per message. This is enforced because you must return the result of the fixer operation from `fix()`.
-1. Fixes should not introduce clashes with other rules. You can accidentally introduce a new problem that won't be reported until ESLint is run again. Another good reason to make as small a fix as possible.
-
-### context.options
-
-Some rules require options in order to function correctly. These options appear in configuration (`.eslintrc`, command line, or in comments). For example:
-
-```json
-{
-    "quotes": [2, "double"]
-}
-```
-
-The `quotes` rule in this example has one option, `"double"` (the `2` is the error level). You can retrieve the options for a rule by using `context.options`, which is an array containing every configured option for the rule. In this case, `context.options[0]` would contain `"double"`:
-
-```js
-module.exports = function(context) {
-
-    var isDouble = (context.options[0] === "double");
-
-    // ...
-}
-```
-
-Since `context.options` is just an array, you can use it to determine how many options have been passed as well as retrieving the actual options themselves. Keep in mind that the error level is not part of `context.options`, as the error level cannot be known or modified from inside a rule.
-
-When using options, make sure that your rule has some logic defaults in case the options are not provided.
-
-### context.getSourceCode()
-
-The `SourceCode` object is the main object for getting more information about the source code being linted. You can retrieve the `SourceCode` object at any time by using the `getSourceCode()` method:
-
-```js
-module.exports = function(context) {
-
-    var sourceCode = context.getSourceCode();
-
-    // ...
-}
-```
-
-Once you have an instance of `SourceCode`, you can use the methods on it to work with the code:
-
-* `getAllComments()` - returns an array of all comments in the source.
-* `getComments(node)` - returns the leading and trailing comments arrays for the given node.
-* `getFirstToken(node)` - returns the first token representing the given node.
-* `getFirstTokens(node, count)` - returns the first `count` tokens representing the given node.
-* `getJSDocComment(node)` - returns the JSDoc comment for a given node or `null` if there is none.
-* `getLastToken(node)` - returns the last token representing the given node.
-* `getLastTokens(node, count)` - returns the last `count` tokens representing the given node.
-* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index.
-* `isSpaceBetweenTokens(first, second)` - returns true if there is a whitespace character between the two tokens.
-* `getText(node)` - returns the source code for the given node. Omit `node` to get the whole source.
-* `getTokenAfter(nodeOrToken)` - returns the first token after the given node or token.
-* `getTokenBefore(nodeOrToken)` - returns the first token before the given node or token.
-* `getTokenByRangeStart(index)` - returns the token whose range starts at the given index in the source.
-* `getTokens(node)` - returns all tokens for the given node.
-* `getTokensAfter(nodeOrToken, count)` - returns `count` tokens after the given node or token.
-* `getTokensBefore(nodeOrToken, count)` - returns `count` tokens before the given node or token.
-* `getTokensBetween(node1, node2)` - returns the tokens between two nodes.
-
-There are also some properties you can access:
-
-* `hasBOM` - the flag to indicate whether or not the source code has Unicode BOM.
-* `text` - the full text of the code being linted. Unicode BOM has been stripped from this text.
-* `ast` - the `Program` node of the AST for the code being linted.
-* `lines` - an array of lines, split according to the specification's definition of line breaks.
-
-You should use a `SourceCode` object whenever you need to get more information about the code being linted.
-
-### Options Schemas
-
-Rules may export a `schema` property, which is a [JSON schema](http://json-schema.org/) format description of a rule's options which will be used by ESLint to validate configuration options and prevent invalid or unexpected inputs before they are passed to the rule in `context.options`.
-
-There are two formats for a rule's exported `schema`. The first is a full JSON Schema object describing all possible options the rule accepts, including the rule's error level as the first argument and any optional arguments thereafter.
-
-However, to simplify schema creation, rules may also export an array of schemas for each optional positional argument, and ESLint will automatically validate the required error level first. For example, the `yoda` rule accepts a primary mode argument, as well as an extra options object with named properties.
-
-```js
-// "yoda": [2, "never", { "exceptRange": true }]
-module.exports.schema = [
-    {
-        "enum": ["always", "never"]
-    },
-    {
-        "type": "object",
-        "properties": {
-            "exceptRange": {
-                "type": "boolean"
-            }
-        },
-        "additionalProperties": false
-    }
-];
-```
-
-In the preceding example, the error level is assumed to be the first argument. It is followed by the first optional argument, a string which may be either `"always"` or `"never"`. The final optional argument is an object, which may have a Boolean property named `exceptRange`.
-
-To learn more about JSON Schema, we recommend looking at some [examples](http://json-schema.org/examples.html) to start, and also reading [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/) (a free ebook).
-
-### Getting the Source
-
-If your rule needs to get the actual JavaScript source to work with, then use the `sourceCode.getText()` method. This method works as follows:
-
-```js
-
-// get all source
-var source = sourceCode.getText();
-
-// get source for just this AST node
-var nodeSource = sourceCode.getText(node);
-
-// get source for AST node plus previous two characters
-var nodeSourceWithPrev = sourceCode.getText(node, 2);
-
-// get source for AST node plus following two characters
-var nodeSourceWithFollowing = sourceCode.getText(node, 0, 2);
-```
-
-In this way, you can look for patterns in the JavaScript text itself when the AST isn't providing the appropriate data (such as location of commas, semicolons, parentheses, etc.).
-
-### Accessing comments
-
-If you need to access comments for a specific node you can use `sourceCode.getComments(node)`:
-
-```js
-// the "comments" variable has a "leading" and "trailing" property containing
-// its leading and trailing comments, respectively
-var comments = sourceCode.getComments(node);
-```
-
-Keep in mind that comments are technically not a part of the AST and are only attached to it on demand, i.e. when you call `getComments()`.
-
-**Note:** One of the libraries adds AST node properties for comments - do not use these properties. Always use `sourceCode.getComments()` as this is the only guaranteed API for accessing comments (we will likely change how comments are handled later).
-
-### Accessing Code Paths
-
-ESLint analyzes code paths while traversing AST.
-You can access that code path objects with five events related to code paths.
-
-[details here](./code-path-analysis.md)
-
-## Rule Unit Tests
-
-Each rule must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if your rule source file is `lib/rules/foo.js` then your test file should be `tests/lib/rules/foo.js`.
-
-For your rule, be sure to test:
-
-1. All instances that should be flagged as warnings.
-1. At least one pattern that should **not** be flagged as a warning.
-
-The basic pattern for a rule unit test file is:
-
-```js
-/**
- * @fileoverview Tests for no-with rule.
- * @author Nicholas C. Zakas
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-var rule = require("../../../lib/rules/no-with"),
-    RuleTester = require("../../../lib/testers/rule-tester");
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-var ruleTester = new RuleTester();
-ruleTester.run("no-with", rule, {
-    valid: [
-        "foo.bar()"
-    ],
-    invalid: [
-        {
-            code: "with(foo) { bar() }",
-            errors: [{ message: "Unexpected use of 'with' statement.", type: "WithStatement"}]
-        }
-    ]
-});
-```
-
-Be sure to replace the value of `"no-with"` with your rule's ID. There are plenty of examples in the `tests/lib/rules/` directory.
-
-### Valid Code
-
-Each valid case can be either a string or an object. The object form is used when you need to specify additional global variables or arguments for the rule. For example, the following defines `window` as a global variable for code that should not trigger the rule being tested:
-
-```js
-valid: [
-    {
-        code: "window.alert()",
-        globals: [ "window" ]
-    }
-]
-```
-
-You can also pass options to the rule (if it accepts them). These arguments are equivalent to how people can configure rules in their `.eslintrc` file. For example:
-
-```js
-valid: [
-    {
-        code: "var msg = 'Hello';",
-        options: [ "single" ]
-    }
-]
-```
-
-The `options` property must be an array of options. This gets passed through to `context.options` in the rule.
-
-### Invalid Code
-
-Each invalid case must be an object containing the code to test and at least one message that is produced by the rule. The `errors` key specifies an array of objects, each containing a message (your rule may trigger multiple messages for the same code). You should also specify the type of AST node you expect to receive back using the `type` key. The AST node should represent the actual spot in the code where there is a problem. For example:
-
-```js
-invalid: [
-    {
-        code: "function doSomething() { var f; if (true) { var build = true; } f = build; }",
-        errors: [
-            { message: "build used outside of binding context.", type: "Identifier" }
-        ]
-    }
-]
-```
-
-In this case, the message is specific to the variable being used and the AST node type is `Identifier`.
-
-Similar to the valid cases, you can also specify `options` to be passed to the rule:
-
-```js
-invalid: [
-    {
-        code: "function doSomething() { var f; if (true) { var build = true; } f = build; }",
-        options: [ "double" ],
-        errors: [
-            { message: "build used outside of binding context.", type: "Identifier" }
-        ]
-    }
-]
-```
-
-For simpler cases where the only thing that really matters is the error message, you can also specify any `errors` as strings. You can also have some strings and some objects, if you like.
-
-```js
-invalid: [
-    {
-        code: "'single quotes'",
-        options: ["double"],
-        errors: ["Strings must use doublequote."]
-    }
-]
-```
-
-### Specifying Parser Options
-
-Some tests require that a certain parser configuration must be used. This can be specified in test specifications via the `parserOptions` setting.
-
-For example, to set `ecmaVersion` to 6 (in order to use constructs like `for ... of`):
-
-```js
-valid: [
-    {
-        code: "for (x of a) doSomething();",
-        parserOptions: { ecmaVersion: 6 }
-    }
-]
-```
-
-If you are working with ES6 modules:
-
-```js
-valid: [
-    {
-        code: "export default function () {};",
-        parserOptions: { ecmaVersion: 6, sourceType: "module" }
-    }
-]
-```
-
-For non-version specific features such as JSX:
-
-```js
-valid: [
-    {
-        code: "var foo = <div>{bar}</div>",
-        parserOptions: { ecmaFeatures: { jsx: true } }
-    }
-]
-```
-
-The options available and the expected syntax for `parserOptions` is the same as those used in [configuration](../user-guide/configuring/language-options.md#specifying-parser-options).
-
-### Write Several Tests
-
-Provide as many unit tests as possible. Your pull request will never be turned down for having too many tests submitted with it!
-
-## Performance Testing
-
-To keep the linting process efficient and unobtrusive, it is useful to verify the performance impact of new rules or modifications to existing rules.
-
-### Overall Performance
-
-The `npm run perf` command gives a high-level overview of ESLint running time with default rules (`eslint:recommended`) enabled.
-
-```bash
-$ git checkout main
-Switched to branch 'main'
-
-$ npm run perf
-CPU Speed is 2200 with multiplier 7500000
-Performance Run #1:  1394.689313ms
-Performance Run #2:  1423.295351ms
-Performance Run #3:  1385.09515ms
-Performance Run #4:  1382.406982ms
-Performance Run #5:  1409.68566ms
-Performance budget ok:  1394.689313ms (limit: 3409.090909090909ms)
-
-$ git checkout my-rule-branch
-Switched to branch 'my-rule-branch'
-
-$ npm run perf
-CPU Speed is 2200 with multiplier 7500000
-Performance Run #1:  1443.736547ms
-Performance Run #2:  1419.193291ms
-Performance Run #3:  1436.018228ms
-Performance Run #4:  1473.605485ms
-Performance Run #5:  1457.455283ms
-Performance budget ok:  1443.736547ms (limit: 3409.090909090909ms)
-```
-
-### Per-rule Performance
-
-ESLint has a built-in method to track performance of individual rules. Setting the `TIMING` environment variable will trigger the display, upon linting completion, of the ten longest-running rules, along with their individual running time and relative performance impact as a percentage of total rule processing time.
-
-```bash
-$ TIMING=1 eslint lib
-Rule                    | Time (ms) | Relative
-:-----------------------|----------:|--------:
-no-multi-spaces         |    52.472 |     6.1%
-camelcase               |    48.684 |     5.7%
-no-irregular-whitespace |    43.847 |     5.1%
-valid-jsdoc             |    40.346 |     4.7%
-handle-callback-err     |    39.153 |     4.6%
-space-infix-ops         |    35.444 |     4.1%
-no-undefined            |    25.693 |     3.0%
-no-shadow               |    22.759 |     2.7%
-no-empty-class          |    21.976 |     2.6%
-semi                    |    19.359 |     2.3%
-```
-
-To test one rule explicitly, combine the `--no-eslintrc`, and `--rule` options:
-
-```bash
-$ TIMING=1 eslint --no-eslintrc --rule "quotes: [2, 'double']" lib
-Rule   | Time (ms) | Relative
-:------|----------:|--------:
-quotes |    18.066 |   100.0%
-```
-
-## Rule Naming Conventions
-
-The rule naming conventions for ESLint are fairly simple:
-
-* If your rule is disallowing something, prefix it with `no-` such as `no-eval` for disallowing `eval()` and `no-debugger` for disallowing `debugger`.
-* If your rule is enforcing the inclusion of something, use a short name without a special prefix.
-* Keep your rule names as short as possible, use abbreviations where appropriate, and no more than four words.
-* Use dashes between words.
-
-## Rule Acceptance Criteria
-
-Because rules are highly personal (and therefore very contentious), accepted rules should:
-
-* Not be library-specific.
-* Demonstrate a possible issue that can be resolved by rewriting the code.
-* Be general enough so as to apply for a large number of developers.
-* Not be the opposite of an existing rule.
-* Not overlap with an existing rule.
-
-## Runtime Rules
-
-The thing that makes ESLint different from other linters is the ability to define custom rules at runtime. This is perfect for rules that are specific to your project or company and wouldn't make sense for ESLint to ship with. With runtime rules, you don't have to wait for the next version of ESLint or be disappointed that your rule isn't general enough to apply to the larger JavaScript community, just write your rules and include them at runtime.
-
-Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps:
-
-1. Place all of your runtime rules in the same directory (i.e., `eslint_rules`).
-2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `1` or `2` in the configuration file.
-3. Run the [command line interface](../user-guide/command-line-interface.md) using the `--rulesdir` option to specify the location of your runtime rules.
diff --git a/eslint/docs/developer-guide/working-with-rules.md b/eslint/docs/developer-guide/working-with-rules.md
deleted file mode 100644 (file)
index 697b7ed..0000000
+++ /dev/null
@@ -1,770 +0,0 @@
-# Working with Rules
-
-**Note:** This page covers the most recent rule format for ESLint >= 3.0.0. There is also a [deprecated rule format](./working-with-rules-deprecated.md).
-
-Each rule in ESLint has three files named with its identifier (for example, `no-extra-semi`).
-
-* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
-* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
-* in the `docs/rules` directory: a Markdown documentation file (for example, `no-extra-semi.md`)
-
-**Important:** If you submit a **core** rule to the ESLint repository, you **must** follow some conventions explained below.
-
-Here is the basic format of the source file for a rule:
-
-```js
-/**
- * @fileoverview Rule to disallow unnecessary semicolons
- * @author Nicholas C. Zakas
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-/** @type {import('eslint').Rule.RuleModule} */
-module.exports = {
-    meta: {
-        type: "suggestion",
-
-        docs: {
-            description: "disallow unnecessary semicolons",
-            category: "Possible Errors",
-            recommended: true,
-            url: "https://eslint.org/docs/rules/no-extra-semi"
-        },
-        fixable: "code",
-        schema: [] // no options
-    },
-    create: function(context) {
-        return {
-            // callback functions
-        };
-    }
-};
-```
-
-## Rule Basics
-
-The source file for a rule exports an object with the following properties.
-
-`meta` (object) contains metadata for the rule:
-
-* `type` (string) indicates the type of rule, which is one of `"problem"`, `"suggestion"`, or `"layout"`:
-    * `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
-    * `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn't changed.
-    * `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren't specified in the AST.
-
-* `docs` (object) is required for core rules of ESLint:
-
-    * `description` (string) provides the short description of the rule in the [rules index](../rules/)
-    * `category` (string) specifies the heading under which the rule is listed in the [rules index](../rules/)
-    * `recommended` (boolean) is whether the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring/configuration-files.md#extending-configuration-files) enables the rule
-    * `url` (string) specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations)
-
-    In a custom rule or plugin, you can omit `docs` or include any properties that you need in it.
-
-* `fixable` (string) is either `"code"` or `"whitespace"` if the `--fix` option on the [command line](../user-guide/command-line-interface.md#--fix) automatically fixes problems reported by the rule
-
-    **Important:** the `fixable` property is mandatory for fixable rules. If this property isn't specified, ESLint will throw an error whenever the rule attempts to produce a fix. Omit the `fixable` property if the rule is not fixable.
-
-* `hasSuggestions` (boolean) specifies whether rules can return suggestions (defaults to `false` if omitted)
-
-     **Important:** the `hasSuggestions` property is mandatory for rules that provide suggestions. If this property isn't set to `true`, ESLint will throw an error whenever the rule attempts to produce a suggestion. Omit the `hasSuggestions` property if the rule does not provide suggestions.
-
-* `schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring/rules.md#configuring-rules)
-
-* `deprecated` (boolean) indicates whether the rule has been deprecated.  You may omit the `deprecated` property if the rule has not been deprecated.
-
-* `replacedBy` (array) in the case of a deprecated rule, specifies replacement rule(s)
-
-`create` (function) returns an object with methods that ESLint calls to "visit" nodes while traversing the abstract syntax tree (AST as defined by [ESTree](https://github.com/estree/estree)) of JavaScript code:
-
-* if a key is a node type or a [selector](./selectors.md), ESLint calls that **visitor** function while going **down** the tree
-* if a key is a node type or a [selector](./selectors.md) plus `:exit`, ESLint calls that **visitor** function while going **up** the tree
-* if a key is an event name, ESLint calls that **handler** function for [code path analysis](./code-path-analysis.md)
-
-A rule can use the current node and its surrounding tree to report or fix problems.
-
-Here are methods for the [array-callback-return](../rules/array-callback-return.md) rule:
-
-```js
-function checkLastSegment (node) {
-    // report problem for function if last code path segment is reachable
-}
-
-module.exports = {
-    meta: { ... },
-    create: function(context) {
-        // declare the state of the rule
-        return {
-            ReturnStatement: function(node) {
-                // at a ReturnStatement node while going down
-            },
-            // at a function expression node while going up:
-            "FunctionExpression:exit": checkLastSegment,
-            "ArrowFunctionExpression:exit": checkLastSegment,
-            onCodePathStart: function (codePath, node) {
-                // at the start of analyzing a code path
-            },
-            onCodePathEnd: function(codePath, node) {
-                // at the end of analyzing a code path
-            }
-        };
-    }
-};
-```
-
-## The Context Object
-
-The `context` object contains additional functionality that is helpful for rules to do their jobs. As the name implies, the `context` object contains information that is relevant to the context of the rule. The `context` object has the following properties:
-
-* `parserOptions` - the parser options configured for this run (more details [here](../user-guide/configuring/language-options.md#specifying-parser-options)).
-* `id` - the rule ID.
-* `options` - an array of the [configured options](/docs/user-guide/configuring/rules.md#configuring-rules) for this rule. This array does not include the rule severity. For more information, see [here](#contextoptions).
-* `settings` - the [shared settings](/docs/user-guide/configuring/configuration-files.md#adding-shared-settings) from configuration.
-* `parserPath` - the name of the `parser` from configuration.
-* `parserServices` - an object containing parser-provided services for rules. The default parser does not provide any services. However, if a rule is intended to be used with a custom parser, it could use `parserServices` to access anything provided by that parser. (For example, a TypeScript parser could provide the ability to get the computed type of a given node.)
-
-Additionally, the `context` object has the following methods:
-
-* `getAncestors()` - returns an array of the ancestors of the currently-traversed node, starting at the root of the AST and continuing through the direct parent of the current node. This array does not include the currently-traversed node itself.
-* `getCwd()` - returns the `cwd` passed to [Linter](./nodejs-api.md#linter). It is a path to a directory that should be considered as the current working directory.
-* `getDeclaredVariables(node)` - returns a list of [variables](./scope-manager-interface.md#variable-interface) declared by the given node. This information can be used to track references to variables.
-    * If the node is a `VariableDeclaration`, all variables declared in the declaration are returned.
-    * If the node is a `VariableDeclarator`, all variables declared in the declarator are returned.
-    * If the node is a `FunctionDeclaration` or `FunctionExpression`, the variable for the function name is returned, in addition to variables for the function parameters.
-    * If the node is an `ArrowFunctionExpression`, variables for the parameters are returned.
-    * If the node is a `ClassDeclaration` or a `ClassExpression`, the variable for the class name is returned.
-    * If the node is a `CatchClause`, the variable for the exception is returned.
-    * If the node is an `ImportDeclaration`, variables for all of its specifiers are returned.
-    * If the node is an `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`, the declared variable is returned.
-    * Otherwise, if the node does not declare any variables, an empty array is returned.
-* `getFilename()` - returns the filename associated with the source.
-* `getPhysicalFilename()` - when linting a file, it returns the full path of the file on disk without any code block information. When linting text, it returns the value passed to `—stdin-filename` or `<text>` if not specified.
-* `getScope()` - returns the [scope](./scope-manager-interface.md#scope-interface) of the currently-traversed node. This information can be used to track references to variables.
-* `getSourceCode()` - returns a [`SourceCode`](#contextgetsourcecode) object that you can use to work with the source that was passed to ESLint.
-* `markVariableAsUsed(name)` - marks a variable with the given name in the current scope as used. This affects the [no-unused-vars](../rules/no-unused-vars.md) rule. Returns `true` if a variable with the given name was found and marked as used, otherwise `false`.
-* `report(descriptor)` - reports a problem in the code (see the [dedicated section](#contextreport)).
-
-**Note:** Earlier versions of ESLint supported additional methods on the `context` object. Those methods were removed in the new format and should not be relied upon.
-
-### context.getScope()
-
-This method returns the scope which has the following types:
-
-| AST Node Type             | Scope Type |
-|:--------------------------|:-----------|
-| `Program`                 | `global`   |
-| `FunctionDeclaration`     | `function` |
-| `FunctionExpression`      | `function` |
-| `ArrowFunctionExpression` | `function` |
-| `ClassDeclaration`        | `class`    |
-| `ClassExpression`         | `class`    |
-| `BlockStatement` ※1      | `block`    |
-| `SwitchStatement` ※1     | `switch`   |
-| `ForStatement` ※2        | `for`      |
-| `ForInStatement` ※2      | `for`      |
-| `ForOfStatement` ※2      | `for`      |
-| `WithStatement`           | `with`     |
-| `CatchClause`             | `catch`    |
-| others                    | ※3        |
-
-**※1** Only if the configured parser provided the block-scope feature. The default parser provides the block-scope feature if `parserOptions.ecmaVersion` is not less than `6`.<br>
-**※2** Only if the `for` statement defines the iteration variable as a block-scoped variable (E.g., `for (let i = 0;;) {}`).<br>
-**※3** The scope of the closest ancestor node which has own scope. If the closest ancestor node has multiple scopes then it chooses the innermost scope (E.g., the `Program` node has a `global` scope and a `module` scope if `Program#sourceType` is `"module"`. The innermost scope is the `module` scope.).
-
-The returned value is a [`Scope` object](scope-manager-interface.md) defined by the `eslint-scope` package. The `Variable` objects of global variables have some additional properties.
-
-* `variable.writeable` (`boolean | undefined`) ... If `true`, this global variable can be assigned arbitrary value. If `false`, this global variable is read-only.
-* `variable.eslintExplicitGlobal` (`boolean | undefined`) ... If `true`, this global variable was defined by a `/* globals */` directive comment in the source code file.
-* `variable.eslintExplicitGlobalComments` (`Comment[] | undefined`) ... The array of `/* globals */` directive comments which defined this global variable in the source code file. This property is `undefined` if there are no `/* globals */` directive comments.
-* `variable.eslintImplicitGlobalSetting` (`"readonly" | "writable" | undefined`) ... The configured value in config files. This can be different from `variable.writeable` if there are `/* globals */` directive comments.
-
-### context.report()
-
-The main method you'll use is `context.report()`, which publishes a warning or error (depending on the configuration being used). This method accepts a single argument, which is an object containing the following properties:
-
-* `message` - the problem message.
-* `node` - (optional)  the AST node related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
-* `loc` - (optional) an object specifying the location of the problem. If both `loc` and `node` are specified, then the location is used from `loc` instead of `node`.
-    * `start` - An object of the start location.
-        * `line` - the 1-based line number at which the problem occurred.
-        * `column` - the 0-based column number at which the problem occurred.
-    * `end` - An object of the end location.
-        * `line` - the 1-based line number at which the problem occurred.
-        * `column` - the 0-based column number at which the problem occurred.
-* `data` - (optional) [placeholder](#using-message-placeholders) data for `message`.
-* `fix` - (optional) a function that applies a [fix](#applying-fixes) to resolve the problem.
-
-Note that at least one of `node` or `loc` is required.
-
-The simplest example is to use just `node` and `message`:
-
-```js
-context.report({
-    node: node,
-    message: "Unexpected identifier"
-});
-```
-
-The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
-
-### Using message placeholders
-
-You can also use placeholders in the message and provide `data`:
-
-```js
-{% raw %}
-context.report({
-    node: node,
-    message: "Unexpected identifier: {{ identifier }}",
-    data: {
-        identifier: node.name
-    }
-});
-{% endraw %}
-```
-
-Note that leading and trailing whitespace is optional in message parameters.
-
-The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
-
-### `messageId`s
-
-Instead of typing out messages in both the `context.report()` call and your tests, you can use `messageId`s instead.
-
-This allows you to avoid retyping error messages. It also prevents errors reported in different sections of your rule from having out-of-date messages.
-
-```js
-{% raw %}
-// in your rule
-module.exports = {
-    meta: {
-        messages: {
-            avoidName: "Avoid using variables named '{{ name }}'"
-        }
-    },
-    create(context) {
-        return {
-            Identifier(node) {
-                if (node.name === "foo") {
-                    context.report({
-                        node,
-                        messageId: "avoidName",
-                        data: {
-                            name: "foo",
-                        }
-                    });
-                }
-            }
-        };
-    }
-};
-
-// in the file to lint:
-
-var foo = 2;
-//  ^ error: Avoid using variables named 'foo'
-
-// In your tests:
-var rule = require("../../../lib/rules/my-rule");
-var RuleTester = require("eslint").RuleTester;
-
-var ruleTester = new RuleTester();
-ruleTester.run("my-rule", rule, {
-    valid: ["bar", "baz"],
-    invalid: [
-        {
-            code: "foo",
-            errors: [
-                {
-                    messageId: "avoidName"
-                }
-            ]
-        }
-    ]
-});
-{% endraw %}
-```
-
-### Applying Fixes
-
-If you'd like ESLint to attempt to fix the problem you're reporting, you can do so by specifying the `fix` function when using `context.report()`. The `fix` function receives a single argument, a `fixer` object, that you can use to apply a fix. For example:
-
-```js
-context.report({
-    node: node,
-    message: "Missing semicolon",
-    fix: function(fixer) {
-        return fixer.insertTextAfter(node, ";");
-    }
-});
-```
-
-Here, the `fix()` function is used to insert a semicolon after the node. Note that a fix is not immediately applied, and may not be applied at all if there are conflicts with other fixes. After applying fixes, ESLint will run all of the enabled rules again on the fixed code, potentially applying more fixes. This process will repeat up to 10 times, or until no more fixable problems are found. Afterwards, any remaining problems will be reported as usual.
-
-**Important:** The `meta.fixable` property is mandatory for fixable rules. ESLint will throw an error if a rule that implements `fix` functions does not [export](#rule-basics) the `meta.fixable` property.
-
-The `fixer` object has the following methods:
-
-* `insertTextAfter(nodeOrToken, text)` - inserts text after the given node or token
-* `insertTextAfterRange(range, text)` - inserts text after the given range
-* `insertTextBefore(nodeOrToken, text)` - inserts text before the given node or token
-* `insertTextBeforeRange(range, text)` - inserts text before the given range
-* `remove(nodeOrToken)` - removes the given node or token
-* `removeRange(range)` - removes text in the given range
-* `replaceText(nodeOrToken, text)` - replaces the text in the given node or token
-* `replaceTextRange(range, text)` - replaces the text in the given range
-
-A range is a two-item array containing character indices inside of the source code. The first item is the start of the range (inclusive) and the second item is the end of the range (exclusive). Every node and token has a `range` property to identify the source code range they represent.
-
-The above methods return a `fixing` object.
-The `fix()` function can return the following values:
-
-* A `fixing` object.
-* An array which includes `fixing` objects.
-* An iterable object which enumerates `fixing` objects. Especially, the `fix()` function can be a generator.
-
-If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not be overlapped.
-
-Best practices for fixes:
-
-1. Avoid any fixes that could change the runtime behavior of code and cause it to stop working.
-1. Make fixes as small as possible. Fixes that are unnecessarily large could conflict with other fixes, and prevent them from being applied.
-1. Only make one fix per message. This is enforced because you must return the result of the fixer operation from `fix()`.
-1. Since all rules are run again after the initial round of fixes is applied, it's not necessary for a rule to check whether the code style of a fix will cause errors to be reported by another rule.
-    * For example, suppose a fixer would like to surround an object key with quotes, but it's not sure whether the user would prefer single or double quotes.
-
-        ```js
-        ({ foo : 1 })
-
-        // should get fixed to either
-
-        ({ 'foo': 1 })
-
-        // or
-
-        ({ "foo": 1 })
-        ```
-
-    * This fixer can just select a quote type arbitrarily. If it guesses wrong, the resulting code will be automatically reported and fixed by the [`quotes`](/docs/rules/quotes.md) rule.
-
-Note: Making fixes as small as possible is a best practice, but in some cases it may be correct to extend the range of the fix in order to intentionally prevent other rules from making fixes in a surrounding range in the same pass. For instance, if replacement text declares a new variable, it can be useful to prevent other changes in the scope of the variable as they might cause name collisions.
-
-The following example replaces `node` and also ensures that no other fixes will be applied in the range of `node.parent` in the same pass:
-
-```js
-context.report({
-    node,
-    message,
-    *fix(fixer) {
-        yield fixer.replaceText(node, replacementText);
-
-        // extend range of the fix to the range of `node.parent`
-        yield fixer.insertTextBefore(node.parent, "");
-        yield fixer.insertTextAfter(node.parent, "");
-    }
-});
-```
-
-### Providing Suggestions
-
-In some cases fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent (see the best practices for [applying fixes](#applying-fixes) listed above). In these cases, there is an alternative `suggest` option on `context.report()` that allows other tools, such as editors, to expose helpers for users to manually apply a suggestion.
-
-In order to provide suggestions, use the `suggest` key in the report argument with an array of suggestion objects. The suggestion objects represent individual suggestions that could be applied and require either a `desc` key string that describes what applying the suggestion would do or a `messageId` key (see [below](#suggestion-messageids)), and a `fix` key that is a function defining the suggestion result. This `fix` function follows the same API as regular fixes (described above in [applying fixes](#applying-fixes)).
-
-```js
-{% raw %}
-context.report({
-    node: node,
-    message: "Unnecessary escape character: \\{{character}}.",
-    data: { character },
-    suggest: [
-        {
-            desc: "Remove the `\\`. This maintains the current functionality.",
-            fix: function(fixer) {
-                return fixer.removeRange(range);
-            }
-        },
-        {
-            desc: "Replace the `\\` with `\\\\` to include the actual backslash character.",
-            fix: function(fixer) {
-                return fixer.insertTextBeforeRange(range, "\\");
-            }
-        }
-    ]
-});
-{% endraw %}
-```
-
-**Important:** The `meta.hasSuggestions` property is mandatory for rules that provide suggestions. ESLint will throw an error if a rule attempts to produce a suggestion but does not [export](#rule-basics) this property.
-
-Note: Suggestions will be applied as a stand-alone change, without triggering multipass fixes. Each suggestion should focus on a singular change in the code and should not try to conform to user defined styles. For example, if a suggestion is adding a new statement into the codebase, it should not try to match correct indentation, or conform to user preferences on presence/absence of semicolons. All of those things can be corrected by multipass autofix when the user triggers it.
-
-Best practices for suggestions:
-
-1. Don't try to do too much and suggest large refactors that could introduce a lot of breaking changes.
-1. As noted above, don't try to conform to user-defined styles.
-
-Suggestions are intended to provide fixes. ESLint will automatically remove the whole suggestion from the linting output if the suggestion's `fix` function returned `null` or an empty array/sequence.
-
-#### Suggestion `messageId`s
-
-Instead of using a `desc` key for suggestions a `messageId` can be used instead. This works the same way as `messageId`s for the overall error (see [messageIds](#messageids)). Here is an example of how to use it in a rule:
-
-```js
-{% raw %}
-module.exports = {
-    meta: {
-        messages: {
-            unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
-            removeEscape: "Remove the `\\`. This maintains the current functionality.",
-            escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character."
-        },
-        hasSuggestions: true
-    },
-    create: function(context) {
-        // ...
-        context.report({
-            node: node,
-            messageId: 'unnecessaryEscape',
-            data: { character },
-            suggest: [
-                {
-                    messageId: "removeEscape",
-                    fix: function(fixer) {
-                        return fixer.removeRange(range);
-                    }
-                },
-                {
-                    messageId: "escapeBackslash",
-                    fix: function(fixer) {
-                        return fixer.insertTextBeforeRange(range, "\\");
-                    }
-                }
-            ]
-        });
-    }
-};
-{% endraw %}
-```
-
-#### Placeholders in suggestion messages
-
-You can also use placeholders in the suggestion message. This works the same way as placeholders for the overall error (see [using message placeholders](#using-message-placeholders)).
-
-Please note that you have to provide `data` on the suggestion's object. Suggestion messages cannot use properties from the overall error's `data`.
-
-```js
-{% raw %}
-module.exports = {
-    meta: {
-        messages: {
-            unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
-            removeEscape: "Remove `\\` before {{character}}.",
-        },
-        hasSuggestions: true
-    },
-    create: function(context) {
-        // ...
-        context.report({
-            node: node,
-            messageId: "unnecessaryEscape",
-            data: { character }, // data for the unnecessaryEscape overall message
-            suggest: [
-                {
-                    messageId: "removeEscape",
-                    data: { character }, // data for the removeEscape suggestion message
-                    fix: function(fixer) {
-                        return fixer.removeRange(range);
-                    }
-                }
-            ]
-        });
-    }
-};
-{% endraw %}
-```
-
-### context.options
-
-Some rules require options in order to function correctly. These options appear in configuration (`.eslintrc`, command line, or in comments). For example:
-
-```json
-{
-    "quotes": ["error", "double"]
-}
-```
-
-The `quotes` rule in this example has one option, `"double"` (the `error` is the error level). You can retrieve the options for a rule by using `context.options`, which is an array containing every configured option for the rule. In this case, `context.options[0]` would contain `"double"`:
-
-```js
-module.exports = {
-    create: function(context) {
-        var isDouble = (context.options[0] === "double");
-
-        // ...
-    }
-};
-```
-
-Since `context.options` is just an array, you can use it to determine how many options have been passed as well as retrieving the actual options themselves. Keep in mind that the error level is not part of `context.options`, as the error level cannot be known or modified from inside a rule.
-
-When using options, make sure that your rule has some logical defaults in case the options are not provided.
-
-### context.getSourceCode()
-
-The `SourceCode` object is the main object for getting more information about the source code being linted. You can retrieve the `SourceCode` object at any time by using the `getSourceCode()` method:
-
-```js
-module.exports = {
-    create: function(context) {
-        var sourceCode = context.getSourceCode();
-
-        // ...
-    }
-};
-```
-
-Once you have an instance of `SourceCode`, you can use the following methods on it to work with the code:
-
-* `getText(node)` - returns the source code for the given node. Omit `node` to get the whole source.
-* `getAllComments()` - returns an array of all comments in the source.
-* `getCommentsBefore(nodeOrToken)` - returns an array of comment tokens that occur directly before the given node or token.
-* `getCommentsAfter(nodeOrToken)` - returns an array of comment tokens that occur directly after the given node or token.
-* `getCommentsInside(node)` - returns an array of all comment tokens inside a given node.
-* `getJSDocComment(node)` - returns the JSDoc comment for a given node or `null` if there is none.
-* `isSpaceBetween(nodeOrToken, nodeOrToken)` - returns true if there is a whitespace character between the two tokens or, if given a node, the last token of the first node and the first token of the second node.
-* `getFirstToken(node, skipOptions)` - returns the first token representing the given node.
-* `getFirstTokens(node, countOptions)` - returns the first `count` tokens representing the given node.
-* `getLastToken(node, skipOptions)` - returns the last token representing the given node.
-* `getLastTokens(node, countOptions)` - returns the last `count` tokens representing the given node.
-* `getTokenAfter(nodeOrToken, skipOptions)` - returns the first token after the given node or token.
-* `getTokensAfter(nodeOrToken, countOptions)` - returns `count` tokens after the given node or token.
-* `getTokenBefore(nodeOrToken, skipOptions)` - returns the first token before the given node or token.
-* `getTokensBefore(nodeOrToken, countOptions)` - returns `count` tokens before the given node or token.
-* `getFirstTokenBetween(nodeOrToken1, nodeOrToken2, skipOptions)` - returns the first token between two nodes or tokens.
-* `getFirstTokensBetween(nodeOrToken1, nodeOrToken2, countOptions)` - returns the first `count` tokens between two nodes or tokens.
-* `getLastTokenBetween(nodeOrToken1, nodeOrToken2, skipOptions)` - returns the last token between two nodes or tokens.
-* `getLastTokensBetween(nodeOrToken1, nodeOrToken2, countOptions)` - returns the last `count` tokens between two nodes or tokens.
-* `getTokens(node)` - returns all tokens for the given node.
-* `getTokensBetween(nodeOrToken1, nodeOrToken2)` - returns all tokens between two nodes.
-* `getTokenByRangeStart(index, rangeOptions)` - returns the token whose range starts at the given index in the source.
-* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index.
-* `getLocFromIndex(index)` - returns an object with `line` and `column` properties, corresponding to the location of the given source index. `line` is 1-based and `column` is 0-based.
-* `getIndexFromLoc(loc)` - returns the index of a given location in the source code, where `loc` is an object with a 1-based `line` key and a 0-based `column` key.
-* `commentsExistBetween(nodeOrToken1, nodeOrToken2)` - returns `true` if comments exist between two nodes.
-
-`skipOptions` is an object which has 3 properties; `skip`, `includeComments`, and `filter`. Default is `{skip: 0, includeComments: false, filter: null}`.
-
-* `skip` is a positive integer, the number of skipping tokens. If `filter` option is given at the same time, it doesn't count filtered tokens as skipped.
-* `includeComments` is a boolean value, the flag to include comment tokens into the result.
-* `filter` is a function which gets a token as the first argument, if the function returns `false` then the result excludes the token.
-
-`countOptions` is an object which has 3 properties; `count`, `includeComments`, and `filter`. Default is `{count: 0, includeComments: false, filter: null}`.
-
-* `count` is a positive integer, the maximum number of returning tokens.
-* `includeComments` is a boolean value, the flag to include comment tokens into the result.
-* `filter` is a function which gets a token as the first argument, if the function returns `false` then the result excludes the token.
-
-`rangeOptions` is an object which has 1 property: `includeComments`.
-
-* `includeComments` is a boolean value, the flag to include comment tokens into the result.
-
-There are also some properties you can access:
-
-* `hasBOM` - the flag to indicate whether or not the source code has Unicode BOM.
-* `text` - the full text of the code being linted. Unicode BOM has been stripped from this text.
-* `ast` - the `Program` node of the AST for the code being linted.
-* `scopeManager` - the [ScopeManager](./scope-manager-interface.md#scopemanager-interface) object of the code.
-* `visitorKeys` - the visitor keys to traverse this AST.
-* `lines` - an array of lines, split according to the specification's definition of line breaks.
-
-You should use a `SourceCode` object whenever you need to get more information about the code being linted.
-
-#### Deprecated
-
-Please note that the following methods have been deprecated and will be removed in a future version of ESLint:
-
-* `getComments()` - replaced by `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()`
-* `getTokenOrCommentBefore()` - replaced by `getTokenBefore()` with the `{ includeComments: true }` option
-* `getTokenOrCommentAfter()` - replaced by `getTokenAfter()` with the `{ includeComments: true }` option
-* `isSpaceBetweenTokens()` - replaced by `isSpaceBetween()`
-
-### Options Schemas
-
-Rules may export a `schema` property, which is a [JSON schema](https://json-schema.org/) format description of a rule's options which will be used by ESLint to validate configuration options and prevent invalid or unexpected inputs before they are passed to the rule in `context.options`.
-
-There are two formats for a rule's exported `schema`. The first is a full JSON Schema object describing all possible options the rule accepts, including the rule's error level as the first argument and any optional arguments thereafter.
-
-However, to simplify schema creation, rules may also export an array of schemas for each optional positional argument, and ESLint will automatically validate the required error level first. For example, the `yoda` rule accepts a primary mode argument, as well as an extra options object with named properties.
-
-```js
-// "yoda": [2, "never", { "exceptRange": true }]
-module.exports = {
-    meta: {
-        schema: [
-            {
-                "enum": ["always", "never"]
-            },
-            {
-                "type": "object",
-                "properties": {
-                    "exceptRange": {
-                        "type": "boolean"
-                    }
-                },
-                "additionalProperties": false
-            }
-        ]
-    },
-};
-```
-
-In the preceding example, the error level is assumed to be the first argument. It is followed by the first optional argument, a string which may be either `"always"` or `"never"`. The final optional argument is an object, which may have a Boolean property named `exceptRange`.
-
-To learn more about JSON Schema, we recommend looking at some examples in [website](https://json-schema.org/learn/) to start, and also reading [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/) (a free ebook).
-
-**Note:** Currently you need to use full JSON Schema object rather than array in case your schema has references ($ref), because in case of array format ESLint transforms this array into a single schema without updating references that makes them incorrect (they are ignored).
-
-### Getting the Source
-
-If your rule needs to get the actual JavaScript source to work with, then use the `sourceCode.getText()` method. This method works as follows:
-
-```js
-
-// get all source
-var source = sourceCode.getText();
-
-// get source for just this AST node
-var nodeSource = sourceCode.getText(node);
-
-// get source for AST node plus previous two characters
-var nodeSourceWithPrev = sourceCode.getText(node, 2);
-
-// get source for AST node plus following two characters
-var nodeSourceWithFollowing = sourceCode.getText(node, 0, 2);
-```
-
-In this way, you can look for patterns in the JavaScript text itself when the AST isn't providing the appropriate data (such as location of commas, semicolons, parentheses, etc.).
-
-### Accessing Comments
-
-While comments are not technically part of the AST, ESLint provides a few ways for rules to access them:
-
-#### sourceCode.getAllComments()
-
-This method returns an array of all the comments found in the program. This is useful for rules that need to check all comments regardless of location.
-
-#### sourceCode.getCommentsBefore(), sourceCode.getCommentsAfter(), and sourceCode.getCommentsInside()
-
-These methods return an array of comments that appear directly before, directly after, and inside nodes, respectively. They are useful for rules that need to check comments in relation to a given node or token.
-
-Keep in mind that the results of this method are calculated on demand.
-
-#### Token traversal methods
-
-Finally, comments can be accessed through many of `sourceCode`'s methods using the `includeComments` option.
-
-### Accessing Shebangs
-
-Shebangs are represented by tokens of type `"Shebang"`. They are treated as comments and can be accessed by the methods outlined above.
-
-### Accessing Code Paths
-
-ESLint analyzes code paths while traversing AST.
-You can access that code path objects with five events related to code paths.
-
-[details here](./code-path-analysis.md)
-
-## Rule Unit Tests
-
-Each bundled rule for ESLint core must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if the rule source file is `lib/rules/foo.js` then the test file should be `tests/lib/rules/foo.js`.
-
-ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api.md#ruletester) utility to make it easy to write tests for rules.
-
-## Performance Testing
-
-To keep the linting process efficient and unobtrusive, it is useful to verify the performance impact of new rules or modifications to existing rules.
-
-### Overall Performance
-
-When developing in the ESLint core repository, the `npm run perf` command gives a high-level overview of ESLint running time with all core rules enabled.
-
-```bash
-$ git checkout main
-Switched to branch 'main'
-
-$ npm run perf
-CPU Speed is 2200 with multiplier 7500000
-Performance Run #1:  1394.689313ms
-Performance Run #2:  1423.295351ms
-Performance Run #3:  1385.09515ms
-Performance Run #4:  1382.406982ms
-Performance Run #5:  1409.68566ms
-Performance budget ok:  1394.689313ms (limit: 3409.090909090909ms)
-
-$ git checkout my-rule-branch
-Switched to branch 'my-rule-branch'
-
-$ npm run perf
-CPU Speed is 2200 with multiplier 7500000
-Performance Run #1:  1443.736547ms
-Performance Run #2:  1419.193291ms
-Performance Run #3:  1436.018228ms
-Performance Run #4:  1473.605485ms
-Performance Run #5:  1457.455283ms
-Performance budget ok:  1443.736547ms (limit: 3409.090909090909ms)
-```
-
-### Per-rule Performance
-
-ESLint has a built-in method to track performance of individual rules. Setting the `TIMING` environment variable will trigger the display, upon linting completion, of the ten longest-running rules, along with their individual running time and relative performance impact as a percentage of total rule processing time.
-
-```bash
-$ TIMING=1 eslint lib
-Rule                    | Time (ms) | Relative
-:-----------------------|----------:|--------:
-no-multi-spaces         |    52.472 |     6.1%
-camelcase               |    48.684 |     5.7%
-no-irregular-whitespace |    43.847 |     5.1%
-valid-jsdoc             |    40.346 |     4.7%
-handle-callback-err     |    39.153 |     4.6%
-space-infix-ops         |    35.444 |     4.1%
-no-undefined            |    25.693 |     3.0%
-no-shadow               |    22.759 |     2.7%
-no-empty-class          |    21.976 |     2.6%
-semi                    |    19.359 |     2.3%
-```
-
-To test one rule explicitly, combine the `--no-eslintrc`, and `--rule` options:
-
-```bash
-$ TIMING=1 eslint --no-eslintrc --rule "quotes: [2, 'double']" lib
-Rule   | Time (ms) | Relative
-:------|----------:|--------:
-quotes |    18.066 |   100.0%
-```
-
-To see a longer list of results (more than 10), set the environment variable to another value such as `TIMING=50` or `TIMING=all`.
-
-## Rule Naming Conventions
-
-The rule naming conventions for ESLint are fairly simple:
-
-* If your rule is disallowing something, prefix it with `no-` such as `no-eval` for disallowing `eval()` and `no-debugger` for disallowing `debugger`.
-* If your rule is enforcing the inclusion of something, use a short name without a special prefix.
-* Use dashes between words.
-
-## Runtime Rules
-
-The thing that makes ESLint different from other linters is the ability to define custom rules at runtime. This is perfect for rules that are specific to your project or company and wouldn't make sense for ESLint to ship with. With runtime rules, you don't have to wait for the next version of ESLint or be disappointed that your rule isn't general enough to apply to the larger JavaScript community, just write your rules and include them at runtime.
-
-Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps:
-
-1. Place all of your runtime rules in the same directory (e.g., `eslint_rules`).
-2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `"warn"` or `"error"` in the configuration file.
-3. Run the [command line interface](../user-guide/command-line-interface.md) using the `--rulesdir` option to specify the location of your runtime rules.
diff --git a/eslint/docs/maintainer-guide/README.md b/eslint/docs/maintainer-guide/README.md
deleted file mode 100644 (file)
index 941ad55..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Maintainer Guide
-
-This guide is intended for those who work as part of the ESLint project team.
-
-## [Managing Issues](issues.md)
-
-Describes how to deal with issues when they're opened, when interacting with users, and how to close them effectively.
-
-## [Reviewing Pull Requests](pullrequests.md)
-
-Describes how to review incoming pull requests.
-
-## [Managing Releases](releases.md)
-
-Describes how to do an ESLint project release.
-
-## [Governance](governance.md)
-
-Describes the governance policy for ESLint, including the rights and privileges of individuals inside the project.
-
-## [Working Groups](working-groups.md)
-
-Describes how working groups are created and how they function within the ESLint project.
diff --git a/eslint/docs/maintainer-guide/governance.md b/eslint/docs/maintainer-guide/governance.md
deleted file mode 100644 (file)
index 2c75411..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-# Governance
-
-ESLint is an open source project that depends on contributions from the community. Anyone may contribute to the project at any time by submitting code, participating in discussions, making suggestions, or any other contribution they see fit. This document describes how various types of contributors work within the ESLint project.
-
-## Roles and Responsibilities
-
-### Users
-
-Users are community members who have a need for the project. Anyone can be a User; there are no special requirements. Common User contributions include evangelizing the project (e.g., display a link on a website and raise awareness through word-of-mouth), informing developers of strengths and weaknesses from a new user perspective, or providing moral support (a "thank you" goes a long way).
-
-Users who continue to engage with the project and its community will often become more and more involved. Such Users may find themselves becoming Contributors, as described in the next section.
-
-### Contributors
-
-Contributors are community members who contribute in concrete ways to the project, most often in the form of code and/or documentation. Anyone can become a Contributor, and contributions can take many forms. There is no expectation of commitment to the project, no specific skill requirements, and no selection process.
-
-Contributors have read-only access to source code and so submit changes via pull requests. Contributor pull requests have their contribution reviewed and merged by a TSC member. TSC members and Committers work with Contributors to review their code and prepare it for merging.
-
-As Contributors gain experience and familiarity with the project, their profile within, and commitment to, the community will increase. At some stage, they may find themselves being nominated for committership by an existing Committer.
-
-### Committers
-
-Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../developer-guide/contributing).
-
-Committers:
-
-* Are expected to work on public branches of the source repository and submit pull requests from that branch to the master branch.
-* Are expected to delete their public branches when they are no longer necessary.
-* Must submit pull requests for all changes.
-* Have their work reviewed by TSC members before acceptance into the repository.
-* May label and close issues (see [Managing Issues](issues.html))
-* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
-
-To become a Committer:
-
-* One must have shown a willingness and ability to participate in the project as a team player. Typically, a potential Committer will need to show that they have an understanding of and alignment with the project, its objectives, and its strategy.
-* Committers are expected to be respectful of every community member and to work collaboratively in the spirit of inclusion.
-* Have submitted a minimum of 10 qualifying pull requests. What's a qualifying pull request? One that carries significant technical weight and requires little effort to accept because it's well documented and tested.
-
-New Committers can be nominated by any existing Committer. Once they have been nominated, there will be a vote by the TSC members.
-
-It is important to recognize that committership is a privilege, not a right. That privilege must be earned and once earned it can be removed by the TSC members by a standard TSC motion. However, under normal circumstances committership exists for as long as the Committer wishes to continue engaging with the project.
-
-A Committer who shows an above-average level of contribution to the project, particularly with respect to its strategic direction and long-term health, may be nominated to become a reviewer, described below.
-
-#### Process for Adding Committers
-
-1. Send email congratulating the new committer and confirming that they would like to accept. This should also outline the responsibilities of a committer with a link to the maintainer guide.
-1. Add the GitHub user to the "ESLint Team" team
-1. Add committer email to the ESLint team mailing list
-1. Invite to Discord team channel
-1. Tweet congratulations to the new committer from the ESLint Twitter account
-
-### Reviewers
-
-Reviewers are community members who have contributed a significant amount of time to the project through triaging of issues, fixing bugs, implementing enhancements/features, and are trusted community leaders.
-
-Reviewers may perform all of the duties of Committers, and also:
-
-* May merge external pull requests for accepted issues upon reviewing and approving the changes.
-* May merge their own pull requests once they have collected the feedback they deem necessary. (No pull request should be merged without at least one Committer/Reviewer/TSC member comment stating they've looked at the code.)
-
-To become a Reviewer:
-
-* Work in a helpful and collaborative way with the community.
-* Have given good feedback on others' submissions and displayed an overall understanding of the code quality standards for the project.
-* Commit to being a part of the community for the long-term.
-* Have submitted a minimum of 50 qualifying pull requests.
-
-A Committer is invited to become a Reviewer by existing Reviewers and TSC members. A nomination will result in discussion and then a decision by the TSC.
-
-#### Process for Adding Reviewers
-
-1. Add the GitHub user to the "ESLint Reviewers" GitHub team
-1. Tweet congratulations to the new Reviewer from the ESLint Twitter account
-
-### Technical Steering Committee (TSC)
-
-The ESLint project is jointly governed by a Technical Steering Committee (TSC) which is responsible for high-level guidance of the project.
-
-The TSC has final authority over this project including:
-
-* Technical direction
-* Project governance and process (including this policy)
-* Contribution policy
-* GitHub repository hosting
-
-TSC seats are not time-limited. The size of the TSC can not be larger than five members. This size ensures adequate coverage of important areas of expertise balanced with the ability to make decisions efficiently.
-
-The TSC may add additional members to the TSC by a standard TSC motion.
-
-A TSC member may be removed from the TSC by voluntary resignation, by a standard TSC motion, or by missing four consecutive TSC meetings. In all cases, the TSC member will revert to Reviewer status unless they prefer Alumni status.
-
-Changes to TSC membership should be posted in the agenda, and may be suggested as any other agenda item (see "TSC Meetings" below).
-
-No more than 1/3 of the TSC members may be affiliated with the same employer. If removal or resignation of a TSC member, or a change of employment by a TSC member, creates a situation where more than 1/3 of the TSC membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more TSC members affiliated with the over-represented employer(s).
-
-TSC members have additional responsibilities over and above those of a Reviewer. These responsibilities ensure the smooth running of the project. TSC members are expected to review code contributions, approve changes to this document, manage the copyrights within the project outputs, and attend regular TSC meetings.
-
-TSC members may perform all of the duties of Reviewers, and also:
-
-* May release new versions of all ESLint projects.
-* May participate in TSC meetings.
-* May propose budget items.
-* May propose new ESLint projects.
-
-There is no specific set of requirements or qualifications for TSC members beyond those that are expected of Reviewers.
-
-A Reviewer is invited to become a TSC member by existing TSC members. A nomination will result in discussion and then a decision by the TSC.
-
-#### Process for Adding TSC Members
-
-1. Add the GitHub user to the "ESLint TSC" GitHub team
-1. Set the GitHub user to be have the "Owner" role for the ESLint organization
-1. Send a welcome email with a link to the [maintainer guide](./) and the [npm 2FA guide](./npm-2fa).
-1. Invite to the Discord TSC channel
-1. Make the TSC member an admin on the ESLint team mailing list
-1. Add the TSC member to the recurring TSC meeting event on Google Calendar
-1. Add the TSC member as an admin to ESLint Twitter Account on Tweetdeck
-1. Add the TSC member to the ESLint TSC mailing list as an "Owner"
-1. Tweet congratulations to the new TSC member from the ESLint Twitter account
-
-#### TSC Meetings
-
-The TSC meets every other week in the TSC Meeting [Discord](https://eslint.org/chat) channel. The meeting is run by a designated moderator approved by the TSC.
-
-Items are added to the TSC agenda which are considered contentious or
-are modifications of governance, contribution policy, TSC membership,
-or release process.
-
-The intention of the agenda is not to approve or review all patches.
-That should happen continuously on GitHub and be handled by the larger
-group of Committers.
-
-Any community member, Committer, or Reviewer can ask that something be added to
-the next meeting's agenda by logging a GitHub Issue. Anyone can add the item to the agenda by adding
-the "tsc agenda" tag to the issue.
-
-Prior to each TSC meeting, the moderator will share the Agenda with
-members of the TSC. TSC members can add any items they like to the
-agenda at the beginning of each meeting. The moderator and the TSC
-cannot veto or remove items.
-
-No binding votes on TSC agenda items can take place without a quorum of
-TSC members present in the meeting. Quorum is achieved when more than
-half of the TSC members (minus non-attending members) are present.
-
-The TSC may invite persons or representatives from certain projects to
-participate in a non-voting capacity.
-
-The moderator is responsible for summarizing the discussion of each
-agenda item and sending it as a pull request after the meeting.
-
-## Consensus Seeking Process
-
-The TSC follows a
-[Consensus Seeking](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
-decision making model.
-
-When an agenda item has appeared to reach a consensus, the moderator
-will ask "Does anyone object?" as a final call for dissent from the
-consensus.
-
-If an agenda item cannot reach a consensus, a TSC member can call for
-either a closing vote or a vote to table the issue to the next
-meeting. The call for a vote must be approved by a majority of the TSC
-or else the discussion will continue. Simple majority wins.
-
-----
-
-This work is a derivative of [YUI Contributor Model](https://github.com/yui/yui3/wiki/Contributor-Model) and the [Node.js Project Governance Model](https://github.com/nodejs/node/blob/master/GOVERNANCE.md).
-
-This work is licensed under a [Creative Commons Attribution-ShareAlike 2.0 UK: England & Wales License](https://creativecommons.org/licenses/by-sa/2.0/uk/).
diff --git a/eslint/docs/maintainer-guide/issues.md b/eslint/docs/maintainer-guide/issues.md
deleted file mode 100644 (file)
index 2624a4b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-# Managing Issues
-
-New issues are filed frequently, and how we respond to those issues directly affects the success of the project. Being part of the project team means helping to triage and address issues as they come in so the project can continue to run smoothly.
-
-## Things to Keep in Mind
-
-1. **Be nice.** Even if the people are being rude or aggressive on an issue, as a project team member you must be the mature one in the conversation. Do your best to work with everyone no matter their style. Remember, poor wording choice can also be a sign of someone who doesn't know English very well, so be sure to consider that when trying to determine the tone of someone's message. Being rude, even when someone is being rude to you, reflects poorly on the team and the project as a whole.
-1. **Be inquisitive.** Ask questions on the issue whenever something isn't clear. Don't assume you understand what's being reported if there are details missing. Whenever you are unsure, it's best to ask for more information.
-1. **Not all requests are equal.** It's unlikely we'll be able to accommodate every request, so don't be afraid to say that something doesn't fit into the scope of the project or isn't practical. It's better to give such feedback if that's the case.
-1. **Close when appropriate.** Don't be afraid to close issues that you don't think will be done, or when it's become clear from the conversation that there's no further work to do. Issues can always be reopened if they are closed incorrectly, so feel free to close issues when appropriate. Just be sure to leave a comment explaining why the issue is being closed (if not closed by a commit).
-
-## Types of Issues
-
-There are four primary issue categories:
-
-1. **Bug** - something isn't working the way it's expected to work.
-1. **Enhancement** - a change to something that already exists. For instance, adding a new option to an existing rule or a bug in a rule where fixing it will result in the rule reporting more problems (in this case, use both "Bug" and "Enhancement").
-1. **Feature** - adding something that doesn't already exist. For example, adding a new rule, new formatter, or new command line flag.
-1. **Question** - an inquiry about how something works that won't result in a code change. We'd prefer if people use the mailing list or chatroom for questions, but sometimes they'll open an issue.
-
-The first goal when evaluating an issue is to determine which category the issue falls into.
-
-## Triaging Process
-
-All of ESLint's issues, across all GitHub repositories, are managed on our [Triage Project](https://github.com/orgs/eslint/projects/2). Please use the Triage project instead of the issues list when reviewing issues to determine what to work on. The Triage project has several columns:
-
-* **Needs Triage** - issues that have not yet been reviewed by anyone
-* **Triaging** - issues that someone has reviewed but has not been able to fully triage yet
-* **Ready for Dev Team** - issues that have been triaged and have all of the information necessary for the dev team to take a look
-* **Evaluating** - the dev team is evaluating these issues to determine whether to move forward or not
-* **Feedback Needed** - a team member is requesting more input from the rest of the team before proceeding
-* **Waiting for RFC** - the next step in the process is for an RFC to be written
-* **RFC Opened** - an RFC is opened to address these issues
-* **Blocked** - the issue can't move forward due to some dependency
-* **Ready to Implement** - these issues have all of the details necessary to start implementation
-* **PR Opened** - there is an open pull request for each of these issues
-* **Completed** - the issue has been closed (either via pull request merge or by the team manually closing the issue)
-
-We make every attempt to automate movement between as many columns as we can, but sometimes moving issues needs to be done manually.
-
-### When an Issue is Opened
-
-When an issue is opened, it is automatically added to the "Needs Triage" column in the Triage project. These issues need to be evaluated to determine next steps. Anyone on the support team or dev team can follow these steps to properly triage issues.
-
-**Note:** If an issue is in the "Triaging" column, that means someone is already triaging it and you should let them finish. There's no need to comment on issues in the "Triaging" column unless someone asks for help.
-
-The steps for triaging an issue are:
-
-1. Move the issue from "Needs Triage" to "Triaging" in the Triage project
-1. Check: Has all of the information in the issue template been provided?
-    * **No:** If information is missing from the issue template, or you can't tell what is being requested, please ask the author to provide the missing information:
-        * Add the "needs info" label to the issue so we know that this issue is stalled due to lack of information.
-        * Don't move on to other steps until the necessary information has been provided.
-        * If the issue author hasn't provided the necessary information after 7 days, please close the issue. The bot will add a comment stating that the issue was closed because there was information missing.
-    * **Yes:**
-        * If the issue is actually a question (rather than something the dev team needs to change), please [convert it to a discussion](https://docs.github.com/en/free-pro-team@latest/discussions/managing-discussions-for-your-community/moderating-discussions#converting-an-issue-to-a-discussion). You can continue the conversation as a discussion.
-        * If the issue is reporting a bug, try to reproduce the issue following the instructions in the issue. If you can reproduce the bug, please add the "repro:yes" label. (The bot will automatically remove the "repro:needed" label.) If you can't reproduce the bug, ask the author for more information about their environment or to clarify reproduction steps.
-        * If the issue is reporting something that works as intended, please add the "works as intended" label and close the issue.
-        * For all issues, please add labels describing the part of ESLint affected:
-            * "3rd party plugin" - related to third-party functionality (plugins, parsers, rules, etc.)
-            * "build" - related to commands run during a build (testing, linting, release scripts, etc.)
-            * "cli" - related to command line input or output, or to `CLIEngine`
-            * "core" - related to internal APIs
-            * "documentation" - related to content on eslint.org
-            * "infrastructure" - related to resources needed for builds or deployment (VMs, CI tools, bots, etc.)
-            * "rule" - related to core rules
-        * If you can't properly triage the issue, move the issue back to the "Needs Triage" column in the Triage project so someone else can triage it
-        * If you have triaged the issue, move the issue to the "Ready for Dev Team" column in the Triage project
-
-## Evaluation Process
-
-When an issue has been moved to the "Ready for Dev Team" column, any dev team member can pick up the issue to start evaluating it.
-
-1. Move the issue into the "Evaluating" column.
-1. Next steps:
-    * **Bugs:** if you can verify the bug, add the "accepted" label and ask if they would like to submit a pull request.
-    * **New Rules:** if you are willing to champion the rule (meaning you believe it should be included in ESLint core and you will take ownership of the process for including it), add a comment saying you will champion the issue, assign the issue to yourself, and follow the [guidelines](#championing-issues) below.
-    * **Rule Changes:** if you are willing to champion the change and it would not be a breaking change (requiring a major version increment), add a comment saying that you will champion the issue, assign the issue to yourself, and follow the [guidelines](#championing-issues) below.
-    * **Breaking Changes:** if you suspect or can verify that a change would be breaking, label it as "Breaking".
-    * **Duplicates:** if you can verify the issue is a duplicate, add a comment mentioning the duplicate issue (such as, "Duplicate of #1234") and close the issue.
-1. Regardless of the above, always leave a comment. Don't just add labels, engage with the person who opened the issue by asking a question (request more information if necessary) or stating your opinion of the issue. If it's a verified bug, ask if the user would like to submit a pull request.
-1. If the issue can't be implemented because it needs an external dependency to be updated or needs to wait for another issue to be resolved, move the issue to the "Blocked" column.
-1. If the issue has been accepted and an RFC is required as the next step, move the issue to the "Waiting for RFC" column and comment on the issue that an RFC is needed.
-
-**Note:** "Good first issue" issues are intended to help new contributors feel welcome and empowered to make a contribution to ESLint. To ensure that new contributors are given a chance to work on these issues, issues labeled "good first issue" must be open for 30 days *from the day the issue was labeled* before a team member is permitted to work on them.
-
-## Accepting Issues
-
-Issues may be labeled as "accepted" when the issue is:
-
-* A bug that you've been able to reproduce and verify (i.e. you're sure it's a bug)
-* A new rule or rule change that you're championing and [consensus](#consensus) has been reached for its inclusion in the project
-
-The "accepted" label will be added to other issues by a TSC member if it's appropriate for the roadmap.
-
-When an issue is accepted and implementation can begin, it should be moved to the "Ready to Implement" column.
-
-## Championing Issues
-
-New rules and rule changes require a champion. As champion, it's your job to:
-
-* Gain [consensus](#consensus) from the ESLint team on inclusion
-* Guide the rule creation process until it's complete (so only champion a rule that you have time to implement or help another contributor implement)
-
-Once consensus has been reached on inclusion, add the "accepted" and, optionally, "help wanted" and "good first issue" labels, as necessary.
-
-## Consensus
-
-Consensus is reached on issues when there are at least three team members who believe the change is a good idea and no one who believes the change is a bad idea. In order to indicate your support for an issue, leave a +1 reaction (thumbs up) on the original issue description in addition to any comments you might have.
-
-## When to Send to TSC
-
-If consensus cannot be reached on an issue, or an issue's progress has been stalled and it's not clear if the issue should be closed, then you can refer the issue to the TSC for resolution. To do so, add the "tsc agenda" label to the issue and add a comment including the following information:
-
-1. A one-paragraph summary of the discussion to this point.
-2. The question you would like the TSC to answer.
-
-The issue will be discussed at the next TSC meeting and the resolution will be posted back to the issue.
-
-## Evaluating Core Features and Enhancements (TSC members only)
-
-In addition to the above, changes to the core (including CLI changes) that would result in a minor or major version release must be approved by the TSC by standard TSC motion. Add the label "tsc agenda" to the issue and it will be discussed at the next TSC meeting. In general, requests should meet the following criteria to be considered:
-
-1. The feature or enhancement is in scope for the project and should be added to the roadmap
-1. Someone is committed to including the change within the next year
-1. There is reasonable certainty about who will do the work
-
-When a suggestion is too ambitious or would take too much time to complete, it's better not to accept the proposal. Stick to small, incremental changes and lay out a roadmap of where you'd like the project to go eventually. Don't let the project get bogged down in big features that will take a long time to complete.
-
-**Breaking Changes:** Be on the lookout for changes that would be breaking. Issues that represent breaking changes should be labeled as "breaking".
-
-## When to Close an Issue
-
-All team members are allowed to close issues depending on how the issue has been resolved.
-
-Team members may close an issue **immediately** if:
-
-1. The issue is a duplicate of an existing issue.
-1. The issue is just a question and has been answered.
-
-Team members may close an issue where the consensus is to not accept the issue after a waiting period (to ensure that other team members have a chance to review the issue before it is closed):
-
-* Wait **2 days** if the issue was opened Monday through Friday.
-* Wait **3 days** if the issue was opened on Saturday or Sunday.
-
-In an effort to keep the issues backlog manageable, team members may also close an issue if the following conditions are met:
-
-* **Unaccepted**: Close after it has been open for 21 days, as these issues do not have enough support to move forward.
-* **Accepted**: Close after 90 days if no one from the team or the community is willing to step forward and own the work to complete to it.
-* **Help wanted:** Close after 90 days if it has not been completed.
diff --git a/eslint/docs/maintainer-guide/pullrequests.md b/eslint/docs/maintainer-guide/pullrequests.md
deleted file mode 100644 (file)
index 2d3b13b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-# Reviewing Pull Requests
-
-Pull requests are submitted frequently and represent our best opportunity to interact with the community. As such, it's important that pull requests are well-reviewed before being merged and that interactions on pull requests are positive.
-
-## Who Can Review Pull Requests?
-
-Anyone, both team members and the public, may leave comments on pull requests.
-
-## Reviewing a Pull Request
-
-When a pull request is opened, the bot will check the following:
-
-1. Has the submitter signed a CLA?
-1. Is the commit message summary in the correct format?
-1. Is the commit summary too long?
-
-The bot will add a comment specifying the problems that it finds. You do not need to look at the pull request any further until those problems have been addressed (there's no need to comment on the pull request to ask the submitter to do what the bot asked - that's why we have the bot!).
-
-Once the bot checks have been satisfied, you check the following:
-
-1. Double-check that the commit message tag ("Fix:", "New:", etc.) is correct based on the issue (or, if no issue is referenced, based on the stated problem).
-1. If the pull request makes a change to core, ensure that an issue exists and the pull request references the issue in the commit message.
-1. Does the code follow our conventions (including header comments, JSDoc comments, etc.)? If not, please leave that feedback and reference the conventions document.
-1. For code changes:
-    * Are there tests that verify the change? If not, please ask for them.
-    * Is documentation needed for the change? If yes, please let the submitter know.
-1. Are there any automated testing errors? If yes, please ask the submitter to check on them.
-1. If you've reviewed the pull request and there are no outstanding issues, leave a comment "LGTM" to indicate your approval. If you would like someone else to verify the change, comment "LGTM but would like someone else to verify."
-
-**Note:** If you are a team member and you've left a comment on the pull request, please follow up to verify that your comments have been addressed.
-
-## Who Can Merge a Pull Request
-
-TSC members and committers may merge pull requests, depending on the contents of the pull request.
-
-Committers may merge a pull request if it is a non-breaking change and is:
-
-1. A documentation change
-1. A bug fix (for either rules or core)
-1. A dependency upgrade
-1. Related to the build tool
-1. A chore
-
-In addition, committers may merge any non-breaking pull request if it has been approved by at least one TSC member.
-
-TSC members may merge all pull requests, including those that committers may merge.
-
-## When to Merge a Pull Request
-
-We use the "Merge" button to merge requests into the repository. Before merging a pull request, verify that:
-
-1. All comments have been addressed
-1. Any team members who made comments have verified that their concerns were addressed
-1. All automated tests are passing (never merge a pull request with failing tests)
-
-Be sure to say thank you to the submitter before merging, especially if they put a lot of work into the pull request.
-
-Team members may merge a pull request immediately if it:
-
-1. Makes a small documentation change
-1. Is a chore
-1. Fixes a block of other work on the repository (build-related, test-related, dependency-related, etc.)
-1. Is an important fix to get into a patch release
-
-Otherwise, team members should observe a waiting period before merging a pull request:
-
-* Wait **2 days** if the pull request was opened Monday through Friday.
-* Wait **3 days** if the pull request was opened on Saturday or Sunday.
-
-The waiting period ensures that other team members have a chance to review the pull request before it is merged.
-
-If the pull request was created from a branch on the `eslint/eslint` repository (as opposed to a fork), delete the branch after merging the pull request. (GitHub will display a "Delete branch" button after the pull request is merged.)
-
-**Note:** You should not merge your own pull request unless you're received feedback from at least one other team member.
-
-## When to Close a Pull Request
-
-There are several times when it's appropriate to close a pull request without merging:
-
-1. The pull request addresses an issue that is already fixed
-1. The pull request hasn't been updated in 30 days
-1. The pull request submitter isn't willing to follow project guidelines.
-
-In any of these cases, please be sure to leave a comment stating why the pull request is being closed.
-
-### Example Closing Comments
-
-If a pull request hasn't been updated in 30 days:
-
-> Closing because there hasn't been activity for 30 days. If you're still interested in submitting this code, please feel free to resubmit.
-
-If a pull request submitter isn't willing to follow project guidelines.
-
-> Unfortunately, we can't accept pull requests that don't follow our guidelines. I'm going to close this pull request now, but if you'd like to resubmit following our guidelines, we'll be happy to review.
diff --git a/eslint/docs/maintainer-guide/releases.md b/eslint/docs/maintainer-guide/releases.md
deleted file mode 100644 (file)
index d406475..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# Managing Releases
-
-Releases are when a project formally publishes a new version so the community can use it. There are two types of releases:
-
-* Regular releases that follow [semantic versioning](https://semver.org/) and are considered production-ready.
-* Prereleases that are not considered production-ready and are intended to give the community a preview of upcoming changes.
-
-## Release Team
-
-A two-person release team is assigned to each scheduled release. This two-person team is responsible for:
-
-1. The scheduled release on Friday
-1. Monitoring issues over the weekend
-1. Determining if a patch release is necessary on Monday
-1. Publishing the patch release (if necessary)
-
-The two-person team should seek input from the whole team on the Monday following a release to double-check if a patch release is necessary.
-
-At least one member of the release team needs to have access to [eslint's two-factor authentication for npm](./npm-2fa) in order to do a release.
-
-## Release Communication
-
-Each scheduled release should be associated with a release issue ([example](https://github.com/eslint/eslint/issues/8138)). The release issue is the source of information for the team about the status of a release. Be sure the release issue has the "release" label so that it's easy to find.
-
-## Process
-
-On the day of a scheduled release, the release team should follow these steps:
-
-1. Review open pull requests to see if any should be merged. In general, you can merge pull requests that:
-    * Have been open at least two days and have been reviewed (these are just waiting for merge).
-    * Important pull requests (as determined by the team). You should stop and have people review before merging if they haven't been already.
-    * Documentation changes.
-    * Small bugfixes written by a team member.
-1. Log into Jenkins and schedule a build for the "ESLint Release" job.
-1. Watch the console output of the build on Jenkins. At some point, the build will pause and a link will be produced with an input field for a six-digit 2FA code.
-1. Enter the current six-digit 2FA code from your authenticator app.
-1. Continue the build and wait for it to finish.
-1. Update the release blog post with a "Highlights" section, including new rules and anything else that's important.
-1. Make a release announcement in the public chatroom.
-1. Make a release announcement on Twitter.
-1. Make a release announcement on the release issue. Document any problems that occurred during the release, and remind the team not to merge anything other than documentation changes and bugfixes. Leave the release issue open.
-1. Add the `patch release pending` label to the release issue. (When this label is present, `eslint-github-bot` will create a pending status check on non-semver-patch pull requests, to ensure that they aren't accidentally merged while a patch release is pending.)
-
-On the Monday following the scheduled release, the release team needs to determine if a patch release is necessary. A patch release is considered necessary if any of the following occurred since the scheduled release:
-
-* A regression bug is causing people's lint builds to fail when it previously passed.
-* Any bug that is causing a lot of problems for users (frequently happens due to new functionality).
-
-The patch release decision should be made as early on Monday as possible. If a patch release is necessary, then follow the same steps as the scheduled release process.
-
-In rare cases, a second patch release might be necessary if the release is known to have a severe regression that hasn't been fixed by Monday. If this occurs, the release team should announce the situation on the release issue, and leave the issue open until all patch releases are complete. However, it's usually better to fix bugs for the next release cycle rather than doing a second patch release.
-
-After the patch release has been published (or no patch release is necessary), close the release issue and inform the team that they can start merging in semver-minor changes again.
-
-## Emergency Releases
-
-In general, we try not to do emergency releases (an emergency release is unplanned and isn't the regularly scheduled release or the anticipated patch release). Even if there is a regression, it's best to wait the weekend to see if any other problems arise so a patch release can fix as many issues as possible.
-
-The only real exception is if ESLint is completely unusable by most of the current users. For instance, we once pushed a release that errored for everyone because it was missing some core files. In that case, an emergency release is appropriate.
diff --git a/eslint/docs/maintainer-guide/working-groups.md b/eslint/docs/maintainer-guide/working-groups.md
deleted file mode 100644 (file)
index d6d22fb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Working Groups
-
-The ESLint TSC may form working groups to focus on a specific area of the project.
-
-## Creating a Working Group
-
-Working groups are created by sending an email to the team mailing list. Each working group:
-
-1. Must have a GitHub team under the "ESLint Team" top-level GitHub team. (The GitHub team name should end with "WG" to distinguish it from other types of teams.)
-1. Must have at least one TSC member.
-1. May have any number of Committers and Reviewers.
-1. Must have at least two members.
-
-Active working groups are listed on the [team page](https://eslint.org/team).
-
-## How Working Groups Work
-
-Each working group is responsible for its own inner working. Working groups can decide how large or small they should be (so long as there is at least two members), when and who to add or remove from the working group, and how to accomplish their objectives.
-
-Working groups may be temporary or permanent.
-
-If working groups intend to make a significant change to the ESLint project, the proposal must still be approved by the TSC.
diff --git a/eslint/docs/package.json b/eslint/docs/package.json
new file mode 100644 (file)
index 0000000..788af86
--- /dev/null
@@ -0,0 +1,48 @@
+{
+    "name": "docs-eslint",
+    "private": true,
+    "version": "8.23.1",
+    "description": "",
+    "main": "index.js",
+    "keywords": [],
+    "author": "",
+    "license": "ISC",
+    "files": [],
+    "scripts": {
+        "images": "imagemin '_site/assets/images' --out-dir='_site/assets/images'",
+        "watch:sass": "sass --watch --poll src/assets/scss:src/assets/css",
+        "watch:eleventy": "eleventy --serve --port=2023",
+        "build:sass": "sass --style=compressed src/assets/scss:src/assets/css --no-source-map",
+        "build:eleventy": "npx @11ty/eleventy",
+        "start": "npm-run-all build:sass --parallel watch:*",
+        "build": "npm-run-all build:sass build:eleventy images"
+    },
+    "devDependencies": {
+        "@11ty/eleventy": "^1.0.1",
+        "@11ty/eleventy-img": "^1.0.0",
+        "@11ty/eleventy-navigation": "^0.3.2",
+        "@11ty/eleventy-plugin-rss": "^1.1.1",
+        "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
+        "@types/markdown-it": "^12.2.3",
+        "algoliasearch": "^4.12.1",
+        "dom-parser": "^0.1.6",
+        "eleventy-plugin-nesting-toc": "^1.3.0",
+        "eleventy-plugin-page-assets": "^0.3.0",
+        "eleventy-plugin-reading-time": "^0.0.1",
+        "github-slugger": "^1.4.0",
+        "imagemin": "^8.0.1",
+        "imagemin-cli": "^7.0.0",
+        "js-yaml": "^3.14.1",
+        "luxon": "^2.4.0",
+        "markdown-it": "^12.2.0",
+        "markdown-it-anchor": "^8.1.2",
+        "markdown-it-container": "^3.0.0",
+        "netlify-cli": "^10.3.1",
+        "npm-run-all": "^4.1.5",
+        "rimraf": "^3.0.2",
+        "sass": "^1.52.1"
+    },
+    "engines": {
+        "node": ">=14.0.0"
+    }
+}
diff --git a/eslint/docs/rules/accessor-pairs.md b/eslint/docs/rules/accessor-pairs.md
deleted file mode 100644 (file)
index 22cf28a..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-# Enforces getter/setter pairs in objects and classes (accessor-pairs)
-
-It's a common mistake in JavaScript to create an object with just a setter for a property but never have a corresponding getter defined for it. Without a getter, you cannot read the property, so it ends up not being used.
-
-Here are some examples:
-
-```js
-// Bad
-var o = {
-    set a(value) {
-        this.val = value;
-    }
-};
-
-// Good
-var o = {
-    set a(value) {
-        this.val = value;
-    },
-    get a() {
-        return this.val;
-    }
-};
-
-```
-
-This rule warns if setters are defined without getters. Using an option `getWithoutSet`, it will warn if you have a getter without a setter also.
-
-## Rule Details
-
-This rule enforces a style where it requires to have a getter for every property which has a setter defined.
-
-By activating the option `getWithoutSet` it enforces the presence of a setter for every property which has a getter defined.
-
-This rule always checks object literals and property descriptors. By default, it also checks class declarations and class expressions.
-
-## Options
-
-* `setWithoutGet` set to `true` will warn for setters without getters (Default `true`).
-* `getWithoutSet` set to `true` will warn for getters without setters (Default `false`).
-* `enforceForClassMembers` set to `true` additionally applies this rule to class getters/setters (Default `true`). Set `enforceForClassMembers` to `false` if you want this rule to ignore class declarations and class expressions.
-
-### setWithoutGet
-
-Examples of **incorrect** code for the default `{ "setWithoutGet": true }` option:
-
-```js
-/*eslint accessor-pairs: "error"*/
-
-var o = {
-    set a(value) {
-        this.val = value;
-    }
-};
-
-var o = {d: 1};
-Object.defineProperty(o, 'c', {
-    set: function(value) {
-        this.val = value;
-    }
-});
-```
-
-Examples of **correct** code for the default `{ "setWithoutGet": true }` option:
-
-```js
-/*eslint accessor-pairs: "error"*/
-
-var o = {
-    set a(value) {
-        this.val = value;
-    },
-    get a() {
-        return this.val;
-    }
-};
-
-var o = {d: 1};
-Object.defineProperty(o, 'c', {
-    set: function(value) {
-        this.val = value;
-    },
-    get: function() {
-        return this.val;
-    }
-});
-
-```
-
-### getWithoutSet
-
-Examples of **incorrect** code for the `{ "getWithoutSet": true }` option:
-
-```js
-/*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/
-
-var o = {
-    set a(value) {
-        this.val = value;
-    }
-};
-
-var o = {
-    get a() {
-        return this.val;
-    }
-};
-
-var o = {d: 1};
-Object.defineProperty(o, 'c', {
-    set: function(value) {
-        this.val = value;
-    }
-});
-
-var o = {d: 1};
-Object.defineProperty(o, 'c', {
-    get: function() {
-        return this.val;
-    }
-});
-```
-
-Examples of **correct** code for the `{ "getWithoutSet": true }` option:
-
-```js
-/*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/
-var o = {
-    set a(value) {
-        this.val = value;
-    },
-    get a() {
-        return this.val;
-    }
-};
-
-var o = {d: 1};
-Object.defineProperty(o, 'c', {
-    set: function(value) {
-        this.val = value;
-    },
-    get: function() {
-        return this.val;
-    }
-});
-
-```
-
-### enforceForClassMembers
-
-When `enforceForClassMembers` is set to `true` (default):
-
-* `"getWithoutSet": true` will also warn for getters without setters in classes.
-* `"setWithoutGet": true` will also warn for setters without getters in classes.
-
-Examples of **incorrect** code for `{ "getWithoutSet": true, "enforceForClassMembers": true }`:
-
-```js
-/*eslint accessor-pairs: ["error", { "getWithoutSet": true, "enforceForClassMembers": true }]*/
-
-class Foo {
-    get a() {
-        return this.val;
-    }
-}
-
-class Bar {
-    static get a() {
-        return this.val;
-    }
-}
-
-const Baz = class {
-    get a() {
-        return this.val;
-    }
-    static set a(value) {
-        this.val = value;
-    }
-}
-```
-
-Examples of **incorrect** code for `{ "setWithoutGet": true, "enforceForClassMembers": true }`:
-
-```js
-/*eslint accessor-pairs: ["error", { "setWithoutGet": true, "enforceForClassMembers": true }]*/
-
-class Foo {
-    set a(value) {
-        this.val = value;
-    }
-}
-
-const Bar = class {
-    static set a(value) {
-        this.val = value;
-    }
-}
-```
-
-When `enforceForClassMembers` is set to `false`, this rule ignores classes.
-
-Examples of **correct** code for `{ "getWithoutSet": true, "setWithoutGet": true, "enforceForClassMembers": false }`:
-
-```js
-/*eslint accessor-pairs: ["error", {
-    "getWithoutSet": true, "setWithoutGet": true, "enforceForClassMembers": false
-}]*/
-
-class Foo {
-    get a() {
-        return this.val;
-    }
-}
-
-class Bar {
-    static set a(value) {
-        this.val = value;
-    }
-}
-
-const Baz = class {
-    static get a() {
-        return this.val;
-    }
-}
-
-const Quux = class {
-    set a(value) {
-        this.val = value;
-    }
-}
-```
-
-## Known Limitations
-
-Due to the limits of static analysis, this rule does not account for possible side effects and in certain cases
-might not report a missing pair for a getter/setter that has a computed key, like in the following example:
-
-```js
-/*eslint accessor-pairs: "error"*/
-
-var a = 1;
-
-// no warnings
-var o = {
-    get [a++]() {
-        return this.val;
-    },
-    set [a++](value) {
-        this.val = value;
-    }
-};
-```
-
-Also, this rule does not disallow duplicate keys in object literals and class definitions, and in certain cases with duplicate keys
-might not report a missing pair for a getter/setter, like in the following example:
-
-```js
-/*eslint accessor-pairs: "error"*/
-
-// no warnings
-var o = {
-    get a() {
-        return this.val;
-    },
-    a: 1,
-    set a(value) {
-        this.val = value;
-    }
-};
-```
-
-The code above creates an object with just a setter for the property `"a"`.
-
-See [no-dupe-keys](no-dupe-keys.md) if you also want to disallow duplicate keys in object literals.
-
-See [no-dupe-class-members](no-dupe-class-members.md) if you also want to disallow duplicate names in class definitions.
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the simultaneous presence of setters and getters on objects.
-
-## Further Reading
-
-* [Object Setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)
-* [Object Getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)
-* [Working with Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)
diff --git a/eslint/docs/rules/array-bracket-newline.md b/eslint/docs/rules/array-bracket-newline.md
deleted file mode 100644 (file)
index bb990c7..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-# enforce line breaks after opening and before closing array brackets (array-bracket-newline)
-
-A number of style guides require or disallow line breaks inside of array brackets.
-
-## Rule Details
-
-This rule enforces line breaks after opening and before closing array brackets.
-
-## Options
-
-This rule has either a string option:
-
-* `"always"` requires line breaks inside brackets
-* `"never"` disallows line breaks inside brackets
-* `"consistent"` requires consistent usage of linebreaks for each pair of brackets. It reports an error if one bracket in the pair has a linebreak inside it and the other bracket does not.
-
-Or an object option (Requires line breaks if any of properties is satisfied. Otherwise, disallows line breaks):
-
-* `"multiline": true` (default) requires line breaks if there are line breaks inside elements or between elements. If this is false, this condition is disabled.
-* `"minItems": null` (default) requires line breaks if the number of elements is at least the given integer. If this is 0, this condition will act the same as the option `"always"`. If this is `null` (the default), this condition is disabled.
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "always"]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1,
-    2];
-var e = [function foo() {
-    dosomething();
-}];
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "always"]*/
-
-var a = [
-];
-var b = [
-    1
-];
-var c = [
-    1, 2
-];
-var d = [
-    1,
-    2
-];
-var e = [
-    function foo() {
-        dosomething();
-    }
-];
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "never"]*/
-
-var a = [
-];
-var b = [
-    1
-];
-var c = [
-    1, 2
-];
-var d = [
-    1,
-    2
-];
-var e = [
-    function foo() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "never"]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1,
-    2];
-var e = [function foo() {
-    dosomething();
-}];
-```
-
-### consistent
-
-Examples of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "consistent"]*/
-
-var a = [1
-];
-var b = [
-    1];
-var c = [function foo() {
-    dosomething();
-}
-]
-var d = [
-    function foo() {
-        dosomething();
-    }]
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint array-bracket-newline: ["error", "consistent"]*/
-
-var a = [];
-var b = [
-];
-var c = [1];
-var d = [
-    1
-];
-var e = [function foo() {
-    dosomething();
-}];
-var f = [
-    function foo() {
-        dosomething();
-    }
-];
-```
-
-### multiline
-
-Examples of **incorrect** code for this rule with the default `{ "multiline": true }` option:
-
-```js
-/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
-
-var a = [
-];
-var b = [
-    1
-];
-var c = [
-    1, 2
-];
-var d = [1,
-    2];
-var e = [function foo() {
-    dosomething();
-}];
-```
-
-Examples of **correct** code for this rule with the default `{ "multiline": true }` option:
-
-```js
-/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [
-    1,
-    2
-];
-var e = [
-    function foo() {
-        dosomething();
-    }
-];
-```
-
-### minItems
-
-Examples of **incorrect** code for this rule with the `{ "minItems": 2 }` option:
-
-```js
-/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
-
-var a = [
-];
-var b = [
-    1
-];
-var c = [1, 2];
-var d = [1,
-    2];
-var e = [
-  function foo() {
-    dosomething();
-  }
-];
-```
-
-Examples of **correct** code for this rule with the `{ "minItems": 2 }` option:
-
-```js
-/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
-
-var a = [];
-var b = [1];
-var c = [
-    1, 2
-];
-var d = [
-    1,
-    2
-];
-var e = [function foo() {
-    dosomething();
-}];
-```
-
-### multiline and minItems
-
-Examples of **incorrect** code for this rule with the `{ "multiline": true, "minItems": 2 }` options:
-
-```js
-/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
-
-var a = [
-];
-var b = [
-    1
-];
-var c = [1, 2];
-var d = [1,
-    2];
-var e = [function foo() {
-    dosomething();
-}];
-```
-
-Examples of **correct** code for this rule with the `{ "multiline": true, "minItems": 2 }` options:
-
-```js
-/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
-
-var a = [];
-var b = [1];
-var c = [
-    1, 2
-];
-var d = [
-    1,
-    2
-];
-var e = [
-    function foo() {
-        dosomething();
-    }
-];
-```
-
-## When Not To Use It
-
-If you don't want to enforce line breaks after opening and before closing array brackets, don't enable this rule.
-
-## Compatibility
-
-* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
diff --git a/eslint/docs/rules/array-bracket-spacing.md b/eslint/docs/rules/array-bracket-spacing.md
deleted file mode 100644 (file)
index a8c745f..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-# Disallow or enforce spaces inside of brackets (array-bracket-spacing)
-
-A number of style guides require or disallow spaces between array brackets and other tokens. This rule
-applies to both array literals and destructuring assignments (ECMAScript 6).
-
-```js
-/*eslint-env es6*/
-
-var arr = [ 'foo', 'bar' ];
-var [ x, y ] = z;
-
-var arr = ['foo', 'bar'];
-var [x,y] = z;
-```
-
-## Rule Details
-
-This rule enforces consistent spacing inside array brackets.
-
-## Options
-
-This rule has a string option:
-
-* `"never"` (default) disallows spaces inside array brackets
-* `"always"` requires one or more spaces or newlines inside array brackets
-
-This rule has an object option for exceptions to the `"never"` option:
-
-* `"singleValue": true` requires one or more spaces or newlines inside brackets of array literals that contain a single element
-* `"objectsInArrays": true` requires one or more spaces or newlines between brackets of array literals and braces of their object literal elements `[ {` or `} ]`
-* `"arraysInArrays": true` requires one or more spaces or newlines between brackets of array literals and brackets of their array literal elements `[ [` or `] ]`
-
-This rule has an object option for exceptions to the `"always"` option:
-
-* `"singleValue": false` disallows spaces inside brackets of array literals that contain a single element
-* `"objectsInArrays": false` disallows spaces between brackets of array literals and braces of their object literal elements `[{` or `}]`
-* `"arraysInArrays": false` disallows spaces between brackets of array literals and brackets of their array literal elements `[[` or `]]`
-
-This rule has built-in exceptions:
-
-* `"never"` (and also the exceptions to the `"always"` option) allows newlines inside array brackets, because this is a common pattern
-* `"always"` does not require spaces or newlines in empty array literals `[]`
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint array-bracket-spacing: ["error", "never"]*/
-/*eslint-env es6*/
-
-var arr = [ 'foo', 'bar' ];
-var arr = ['foo', 'bar' ];
-var arr = [ ['foo'], 'bar'];
-var arr = [[ 'foo' ], 'bar'];
-var arr = [ 'foo',
-  'bar'
-];
-var [ x, y ] = z;
-var [ x,y ] = z;
-var [ x, ...y ] = z;
-var [ ,,x, ] = z;
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint array-bracket-spacing: ["error", "never"]*/
-/*eslint-env es6*/
-
-var arr = [];
-var arr = ['foo', 'bar', 'baz'];
-var arr = [['foo'], 'bar', 'baz'];
-var arr = [
-  'foo',
-  'bar',
-  'baz'
-];
-var arr = ['foo',
-  'bar'
-];
-var arr = [
-  'foo',
-  'bar'];
-
-var [x, y] = z;
-var [x,y] = z;
-var [x, ...y] = z;
-var [,,x,] = z;
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always"]*/
-/*eslint-env es6*/
-
-var arr = ['foo', 'bar'];
-var arr = ['foo', 'bar' ];
-var arr = [ ['foo'], 'bar' ];
-var arr = ['foo',
-  'bar'
-];
-var arr = [
-  'foo',
-  'bar'];
-
-var [x, y] = z;
-var [x,y] = z;
-var [x, ...y] = z;
-var [,,x,] = z;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always"]*/
-/*eslint-env es6*/
-
-var arr = [];
-var arr = [ 'foo', 'bar', 'baz' ];
-var arr = [ [ 'foo' ], 'bar', 'baz' ];
-var arr = [ 'foo',
-  'bar'
-];
-var arr = [
-  'foo',
-  'bar' ];
-var arr = [
-  'foo',
-  'bar',
-  'baz'
-];
-
-var [ x, y ] = z;
-var [ x,y ] = z;
-var [ x, ...y ] = z;
-var [ ,,x, ] = z;
-```
-
-### singleValue
-
-Examples of **incorrect** code for this rule with the `"always", { "singleValue": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "singleValue": false }]*/
-
-var foo = [ 'foo' ];
-var foo = [ 'foo'];
-var foo = ['foo' ];
-var foo = [ 1 ];
-var foo = [ 1];
-var foo = [1 ];
-var foo = [ [ 1, 2 ] ];
-var foo = [ { 'foo': 'bar' } ];
-```
-
-Examples of **correct** code for this rule with the `"always", { "singleValue": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "singleValue": false }]*/
-
-var foo = ['foo'];
-var foo = [1];
-var foo = [[ 1, 1 ]];
-var foo = [{ 'foo': 'bar' }];
-```
-
-### objectsInArrays
-
-Examples of **incorrect** code for this rule with the `"always", { "objectsInArrays": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "objectsInArrays": false }]*/
-
-var arr = [ { 'foo': 'bar' } ];
-var arr = [ {
-  'foo': 'bar'
-} ]
-```
-
-Examples of **correct** code for this rule with the `"always", { "objectsInArrays": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "objectsInArrays": false }]*/
-
-var arr = [{ 'foo': 'bar' }];
-var arr = [{
-  'foo': 'bar'
-}];
-```
-
-### arraysInArrays
-
-Examples of **incorrect** code for this rule with the `"always", { "arraysInArrays": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "arraysInArrays": false }]*/
-
-var arr = [ [ 1, 2 ], 2, 3, 4 ];
-var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];
-```
-
-Examples of **correct** code for this rule with the `"always", { "arraysInArrays": false }` options:
-
-```js
-/*eslint array-bracket-spacing: ["error", "always", { "arraysInArrays": false }]*/
-
-var arr = [[ 1, 2 ], 2, 3, 4 ];
-var arr = [[ 1, 2 ], 2, [ 3, 4 ]];
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing between array brackets.
-
-## Related Rules
-
-* [space-in-parens](space-in-parens.md)
-* [object-curly-spacing](object-curly-spacing.md)
-* [computed-property-spacing](computed-property-spacing.md)
diff --git a/eslint/docs/rules/array-callback-return.md b/eslint/docs/rules/array-callback-return.md
deleted file mode 100644 (file)
index 568e014..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-# Enforces return statements in callbacks of array's methods (array-callback-return)
-
-`Array` has several methods for filtering, mapping, and folding.
-If we forget to write `return` statement in a callback of those, it's probably a mistake. If you don't want to use a return or don't need the returned results, consider using [.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) instead.
-
-```js
-// example: convert ['a', 'b', 'c'] --> {a: 0, b: 1, c: 2}
-var indexMap = myArray.reduce(function(memo, item, index) {
-  memo[item] = index;
-}, {}); // Error: cannot set property 'b' of undefined
-```
-
-## Rule Details
-
-This rule enforces usage of `return` statement in callbacks of array's methods.
-Additionally, it may also enforce the `forEach` array method callback to __not__ return a value by using the `checkForEach` option.
-
-This rule finds callback functions of the following methods, then checks usage of `return` statement.
-
-* [`Array.from`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.from)
-* [`Array.prototype.every`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.every)
-* [`Array.prototype.filter`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.filter)
-* [`Array.prototype.find`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.find)
-* [`Array.prototype.findIndex`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.findindex)
-* [`Array.prototype.flatMap`](https://www.ecma-international.org/ecma-262/10.0/#sec-array.prototype.flatmap)
-* [`Array.prototype.forEach`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.foreach) (optional, based on `checkForEach` parameter)
-* [`Array.prototype.map`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.map)
-* [`Array.prototype.reduce`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.reduce)
-* [`Array.prototype.reduceRight`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.reduceright)
-* [`Array.prototype.some`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.some)
-* [`Array.prototype.sort`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.sort)
-* And above of typed arrays.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint array-callback-return: "error"*/
-
-var indexMap = myArray.reduce(function(memo, item, index) {
-    memo[item] = index;
-}, {});
-
-var foo = Array.from(nodes, function(node) {
-    if (node.tagName === "DIV") {
-        return true;
-    }
-});
-
-var bar = foo.filter(function(x) {
-    if (x) {
-        return true;
-    } else {
-        return;
-    }
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint array-callback-return: "error"*/
-
-var indexMap = myArray.reduce(function(memo, item, index) {
-    memo[item] = index;
-    return memo;
-}, {});
-
-var foo = Array.from(nodes, function(node) {
-    if (node.tagName === "DIV") {
-        return true;
-    }
-    return false;
-});
-
-var bar = foo.map(node => node.getAttribute("id"));
-```
-
-## Options
-
-This rule accepts a configuration object with two options:
-
-* `"allowImplicit": false` (default) When set to `true`, allows callbacks of methods that require a return value to implicitly return `undefined` with a `return` statement containing no expression.
-* `"checkForEach": false` (default) When set to `true`, rule will also report `forEach` callbacks that return a value.
-
-### allowImplicit
-
-Examples of **correct** code for the `{ "allowImplicit": true }` option:
-
-```js
-/*eslint array-callback-return: ["error", { allowImplicit: true }]*/
-var undefAllTheThings = myArray.map(function(item) {
-    return;
-});
-```
-
-### checkForEach
-
-Examples of **incorrect** code for the `{ "checkForEach": true }` option:
-
-```js
-/*eslint array-callback-return: ["error", { checkForEach: true }]*/
-
-myArray.forEach(function(item) {
-    return handleItem(item)
-});
-
-myArray.forEach(function(item) {
-    if (item < 0) {
-        return x;
-    }
-    handleItem(item);
-});
-
-myArray.forEach(item => handleItem(item));
-
-myArray.forEach(item => {
-    return handleItem(item);
-});
-```
-
-Examples of **correct** code for the `{ "checkForEach": true }` option:
-
-```js
-/*eslint array-callback-return: ["error", { checkForEach: true }]*/
-
-myArray.forEach(function(item) {
-    handleItem(item)
-});
-
-myArray.forEach(function(item) {
-    if (item < 0) {
-        return;
-    }
-    handleItem(item);
-});
-
-myArray.forEach(function(item) {
-    handleItem(item);
-    return;
-});
-
-myArray.forEach(item => {
-    handleItem(item);
-});
-```
-
-## Known Limitations
-
-This rule checks callback functions of methods with the given names, *even if* the object which has the method is *not* an array.
-
-## When Not To Use It
-
-If you don't want to warn about usage of `return` statement in callbacks of array's methods, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/array-element-newline.md b/eslint/docs/rules/array-element-newline.md
deleted file mode 100644 (file)
index cee739d..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-# enforce line breaks between array elements (array-element-newline)
-
-A number of style guides require or disallow line breaks between array elements.
-
-## Rule Details
-
-This rule enforces line breaks between array elements.
-
-## Options
-
-This rule has either a string option:
-
-* `"always"` (default) requires line breaks between array elements
-* `"never"` disallows line breaks between array elements
-* `"consistent"` requires consistent usage of linebreaks between array elements
-
-Or an object option (Requires line breaks if any of properties is satisfied. Otherwise, disallows line breaks):
-
-* `"multiline": <boolean>` requires line breaks if there are line breaks inside elements. If this is false, this condition is disabled.
-* `"minItems": <number>` requires line breaks if the number of elements is at least the given integer. If this is 0, this condition will act the same as the option `"always"`. If this is `null` (the default), this condition is disabled.
-
-Alternatively, different configurations can be specified for array expressions and array patterns:
-
-```json
-{
-    "array-element-newline": ["error", {
-        "ArrayExpression": "consistent",
-        "ArrayPattern": { "minItems": 3 },
-    }]
-}
-```
-
-* `"ArrayExpression"` configuration for array expressions (if unspecified, this rule will not apply to array expressions)
-* `"ArrayPattern"` configuration for array patterns of destructuring assignments (if unspecified, this rule will not apply to array patterns)
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint array-element-newline: ["error", "always"]*/
-
-var c = [1, 2];
-var d = [1, 2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint array-element-newline: ["error", "always"]*/
-
-var a = [];
-var b = [1];
-var c = [1,
-    2];
-var d = [1,
-    2,
-    3];
-var e = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint array-element-newline: ["error", "never"]*/
-
-var c = [
-    1,
-    2
-];
-var d = [
-    1,
-    2,
-    3
-];
-var e = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint array-element-newline: ["error", "never"]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1, 2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-```
-
-### consistent
-
-Examples of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint array-element-newline: ["error", "consistent"]*/
-
-var a = [
-    1, 2,
-    3
-];
-var b = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    },
-    function baz() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint array-element-newline: ["error", "consistent"]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1, 2, 3];
-var e = [
-    1,
-    2
-];
-var f = [
-    1,
-    2,
-    3
-];
-var g = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }, function baz() {
-        dosomething();
-    }
-];
-var h = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    },
-    function baz() {
-        dosomething();
-    }
-];
-```
-
-### multiline
-
-Examples of **incorrect** code for this rule with the `{ "multiline": true }` option:
-
-```js
-/*eslint array-element-newline: ["error", { "multiline": true }]*/
-
-var d = [1,
-    2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `{ "multiline": true }` option:
-
-```js
-/*eslint array-element-newline: ["error", { "multiline": true }]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1, 2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-```
-
-### minItems
-
-Examples of **incorrect** code for this rule with the `{ "minItems": 3 }` option:
-
-```js
-/*eslint array-element-newline: ["error", { "minItems": 3 }]*/
-
-var c = [1,
-    2];
-var d = [1, 2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `{ "minItems": 3 }` option:
-
-```js
-/*eslint array-element-newline: ["error", { "minItems": 3 }]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1,
-    2,
-    3];
-var e = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-```
-
-### multiline and minItems
-
-Examples of **incorrect** code for this rule with the `{ "multiline": true, "minItems": 3 }` options:
-
-```js
-/*eslint array-element-newline: ["error", { "multiline": true, "minItems": 3 }]*/
-
-var c = [1,
-2];
-var d = [1, 2, 3];
-var e = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-```
-
-Examples of **correct** code for this rule with the `{ "multiline": true, "minItems": 3 }` options:
-
-```js
-/*eslint array-element-newline: ["error", { "multiline": true, "minItems": 3 }]*/
-
-var a = [];
-var b = [1];
-var c = [1, 2];
-var d = [1,
-    2,
-    3];
-var e = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-```
-
-### ArrayExpression and ArrayPattern
-
-Examples of **incorrect** code for this rule with the `{ "ArrayExpression": "always", "ArrayPattern": "never" }` options:
-
-```js
-/*eslint array-element-newline: ["error", { "ArrayExpression": "always", "ArrayPattern": "never" }]*/
-
-var a = [1, 2];
-var b = [1, 2, 3];
-var c = [
-    function foo() {
-        dosomething();
-    }, function bar() {
-        dosomething();
-    }
-];
-
-var [d,
-    e] = arr;
-var [f,
-    g,
-    h] = arr;
-var [i = function foo() {
-  dosomething()
-},
-j = function bar() {
-  dosomething()
-}] = arr
-```
-
-Examples of **correct** code for this rule with the `{ "ArrayExpression": "always", "ArrayPattern": "never" }` options:
-
-```js
-/*eslint array-element-newline: ["error", { "ArrayExpression": "always", "ArrayPattern": "never" }]*/
-
-var a = [1,
-    2];
-var b = [1,
-    2,
-    3];
-var c = [
-    function foo() {
-        dosomething();
-    },
-    function bar() {
-        dosomething();
-    }
-];
-
-var [d, e] = arr
-var [f, g, h] = arr
-var [i = function foo() {
-    dosomething()
-}, j = function bar() {
-    dosomething()
-}] = arr
-```
-
-## When Not To Use It
-
-If you don't want to enforce linebreaks between array elements, don't enable this rule.
-
-## Compatibility
-
-* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [array-bracket-newline](array-bracket-newline.md)
-* [object-property-newline](object-property-newline.md)
-* [object-curly-spacing](object-curly-spacing.md)
-* [object-curly-newline](object-curly-newline.md)
-* [max-statements-per-line](max-statements-per-line.md)
-* [block-spacing](block-spacing.md)
-* [brace-style](brace-style.md)
diff --git a/eslint/docs/rules/arrow-body-style.md b/eslint/docs/rules/arrow-body-style.md
deleted file mode 100644 (file)
index 31c0cfe..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-# Require braces in arrow function body (arrow-body-style)
-
-Arrow functions have two syntactic forms for their function bodies.  They may be defined with a *block* body (denoted by curly braces) `() => { ... }` or with a single expression `() => ...`, whose value is implicitly returned.
-
-## Rule Details
-
-This rule can enforce or disallow the use of braces around arrow function body.
-
-## Options
-
-The rule takes one or two options. The first is a string, which can be:
-
-* `"always"` enforces braces around the function body
-* `"as-needed"` enforces no braces where they can be omitted (default)
-* `"never"` enforces no braces around the function body (constrains arrow functions to the role of returning an expression)
-
-The second one is an object for more fine-grained configuration when the first option is `"as-needed"`. Currently, the only available option is `requireReturnForObjectLiteral`, a boolean property. It's `false` by default. If set to `true`, it requires braces and an explicit return for object literals.
-
-```json
-"arrow-body-style": ["error", "always"]
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint arrow-body-style: ["error", "always"]*/
-/*eslint-env es6*/
-let foo = () => 0;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-let foo = () => {
-    return 0;
-};
-let foo = (retv, name) => {
-    retv[name] = true;
-    return retv;
-};
-```
-
-### as-needed
-
-Examples of **incorrect** code for this rule with the default `"as-needed"` option:
-
-```js
-/*eslint arrow-body-style: ["error", "as-needed"]*/
-/*eslint-env es6*/
-
-let foo = () => {
-    return 0;
-};
-let foo = () => {
-    return {
-       bar: {
-            foo: 1,
-            bar: 2,
-        }
-    };
-};
-```
-
-Examples of **correct** code for this rule with the default `"as-needed"` option:
-
-```js
-/*eslint arrow-body-style: ["error", "as-needed"]*/
-/*eslint-env es6*/
-
-let foo = () => 0;
-let foo = (retv, name) => {
-    retv[name] = true;
-    return retv;
-};
-let foo = () => ({
-    bar: {
-        foo: 1,
-        bar: 2,
-    }
-});
-let foo = () => { bar(); };
-let foo = () => {};
-let foo = () => { /* do nothing */ };
-let foo = () => {
-    // do nothing.
-};
-let foo = () => ({ bar: 0 });
-```
-
-#### requireReturnForObjectLiteral
-
-> This option is only applicable when used in conjunction with the `"as-needed"` option.
-
-Examples of **incorrect** code for this rule with the `{ "requireReturnForObjectLiteral": true }` option:
-
-```js
-/*eslint arrow-body-style: ["error", "as-needed", { "requireReturnForObjectLiteral": true }]*/
-/*eslint-env es6*/
-let foo = () => ({});
-let foo = () => ({ bar: 0 });
-```
-
-Examples of **correct** code for this rule with the `{ "requireReturnForObjectLiteral": true }` option:
-
-```js
-/*eslint arrow-body-style: ["error", "as-needed", { "requireReturnForObjectLiteral": true }]*/
-/*eslint-env es6*/
-
-let foo = () => {};
-let foo = () => { return { bar: 0 }; };
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint arrow-body-style: ["error", "never"]*/
-/*eslint-env es6*/
-
-let foo = () => {
-    return 0;
-};
-let foo = (retv, name) => {
-    retv[name] = true;
-    return retv;
-};
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint arrow-body-style: ["error", "never"]*/
-/*eslint-env es6*/
-
-let foo = () => 0;
-let foo = () => ({ foo: 0 });
-```
diff --git a/eslint/docs/rules/arrow-parens.md b/eslint/docs/rules/arrow-parens.md
deleted file mode 100644 (file)
index 8a133cd..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-# Require parens in arrow function arguments (arrow-parens)
-
-Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must
-be wrapped in parentheses. This rule enforces the consistent use of parentheses in arrow functions.
-
-## Rule Details
-
-This rule enforces parentheses around arrow function parameters regardless of arity. For example:
-
-```js
-/*eslint-env es6*/
-
-// Bad
-a => {}
-
-// Good
-(a) => {}
-```
-
-Following this style will help you find arrow functions (`=>`) which may be mistakenly included in a condition
-when a comparison such as `>=` was the intent.
-
-```js
-/*eslint-env es6*/
-
-// Bad
-if (a => 2) {
-}
-
-// Good
-if (a >= 2) {
-}
-```
-
-The rule can also be configured to discourage the use of parens when they are not required:
-
-```js
-/*eslint-env es6*/
-
-// Bad
-(a) => {}
-
-// Good
-a => {}
-```
-
-## Options
-
-This rule has a string option and an object one.
-
-String options are:
-
-* `"always"` (default) requires parens around arguments in all cases.
-* `"as-needed"` enforces no parens where they can be omitted.
-
-Object properties for variants of the `"as-needed"` option:
-
-* `"requireForBlockBody": true` modifies the as-needed rule in order to require parens if the function body is in an instructions block (surrounded by braces).
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint arrow-parens: ["error", "always"]*/
-/*eslint-env es6*/
-
-a => {};
-a => a;
-a => {'\n'};
-a.then(foo => {});
-a.then(foo => a);
-a(foo => { if (true) {} });
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint arrow-parens: ["error", "always"]*/
-/*eslint-env es6*/
-
-() => {};
-(a) => {};
-(a) => a;
-(a) => {'\n'}
-a.then((foo) => {});
-a.then((foo) => { if (true) {} });
-```
-
-#### If Statements
-
-One of the benefits of this option is that it prevents the incorrect use of arrow functions in conditionals:
-
-```js
-/*eslint-env es6*/
-
-var a = 1;
-var b = 2;
-// ...
-if (a => b) {
- console.log('bigger');
-} else {
- console.log('smaller');
-}
-// outputs 'bigger', not smaller as expected
-```
-
-The contents of the `if` statement is an arrow function, not a comparison.
-
-If the arrow function is intentional, it should be wrapped in parens to remove ambiguity.
-
-```js
-/*eslint-env es6*/
-
-var a = 1;
-var b = 0;
-// ...
-if ((a) => b) {
- console.log('truthy value returned');
-} else {
- console.log('falsey value returned');
-}
-// outputs 'truthy value returned'
-```
-
-The following is another example of this behavior:
-
-```js
-/*eslint-env es6*/
-
-var a = 1, b = 2, c = 3, d = 4;
-var f = a => b ? c: d;
-// f = ?
-```
-
-`f` is an arrow function which takes `a` as an argument and returns the result of `b ? c: d`.
-
-This should be rewritten like so:
-
-```js
-/*eslint-env es6*/
-
-var a = 1, b = 2, c = 3, d = 4;
-var f = (a) => b ? c: d;
-```
-
-### as-needed
-
-Examples of **incorrect** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint arrow-parens: ["error", "as-needed"]*/
-/*eslint-env es6*/
-
-(a) => {};
-(a) => a;
-(a) => {'\n'};
-a.then((foo) => {});
-a.then((foo) => a);
-a((foo) => { if (true) {} });
-const f = /** @type {number} */(a) => a + a;
-const g = /* comment */ (a) => a + a;
-const h = (a) /* comment */ => a + a;
-```
-
-Examples of **correct** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint arrow-parens: ["error", "as-needed"]*/
-/*eslint-env es6*/
-
-() => {};
-a => {};
-a => a;
-a => {'\n'};
-a.then(foo => {});
-a.then(foo => { if (true) {} });
-(a, b, c) => a;
-(a = 10) => a;
-([a, b]) => a;
-({a, b}) => a;
-const f = (/** @type {number} */a) => a + a;
-const g = (/* comment */ a) => a + a;
-const h = (a /* comment */) => a + a;
-```
-
-### requireForBlockBody
-
-Examples of **incorrect** code for the `{ "requireForBlockBody": true }` option:
-
-```js
-/*eslint arrow-parens: [2, "as-needed", { "requireForBlockBody": true }]*/
-/*eslint-env es6*/
-
-(a) => a;
-a => {};
-a => {'\n'};
-a.map((x) => x * x);
-a.map(x => {
-  return x * x;
-});
-a.then(foo => {});
-```
-
-Examples of **correct** code for the `{ "requireForBlockBody": true }` option:
-
-```js
-/*eslint arrow-parens: [2, "as-needed", { "requireForBlockBody": true }]*/
-/*eslint-env es6*/
-
-(a) => {};
-(a) => {'\n'};
-a => ({});
-() => {};
-a => a;
-a.then((foo) => {});
-a.then((foo) => { if (true) {} });
-a((foo) => { if (true) {} });
-(a, b, c) => a;
-(a = 10) => a;
-([a, b]) => a;
-({a, b}) => a;
-```
-
-## Further Reading
-
-* The `"as-needed", { "requireForBlockBody": true }` rule is directly inspired by the Airbnb
- [JS Style Guide](https://github.com/airbnb/javascript#arrows--one-arg-parens).
diff --git a/eslint/docs/rules/arrow-spacing.md b/eslint/docs/rules/arrow-spacing.md
deleted file mode 100644 (file)
index d0cea1b..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-# Require space before/after arrow function's arrow (arrow-spacing)
-
-This rule normalize style of spacing before/after an arrow function's arrow(`=>`).
-
-```js
-/*eslint-env es6*/
-
-// { "before": true, "after": true }
-(a) => {}
-
-// { "before": false, "after": false }
-(a)=>{}
-```
-
-## Rule Details
-
-This rule takes an object argument with `before` and `after` properties, each with a Boolean value.
-
-The default configuration is `{ "before": true, "after": true }`.
-
-`true` means there should be **one or more spaces** and `false` means **no spaces**.
-
-Examples of **incorrect** code for this rule with the default `{ "before": true, "after": true }` option:
-
-```js
-/*eslint arrow-spacing: "error"*/
-/*eslint-env es6*/
-
-()=> {};
-() =>{};
-(a)=> {};
-(a) =>{};
-a =>a;
-a=> a;
-()=> {'\n'};
-() =>{'\n'};
-```
-
-Examples of **correct** code for this rule with the default `{ "before": true, "after": true }` option:
-
-```js
-/*eslint arrow-spacing: "error"*/
-/*eslint-env es6*/
-
-() => {};
-(a) => {};
-a => a;
-() => {'\n'};
-```
-
-Examples of **incorrect** code for this rule with the `{ "before": false, "after": false }` option:
-
-```js
-/*eslint arrow-spacing: ["error", { "before": false, "after": false }]*/
-/*eslint-env es6*/
-
-() =>{};
-(a) => {};
-()=> {'\n'};
-```
-
-Examples of **correct** code for this rule with the `{ "before": false, "after": false }` option:
-
-```js
-/*eslint arrow-spacing: ["error", { "before": false, "after": false }]*/
-/*eslint-env es6*/
-
-()=>{};
-(a)=>{};
-()=>{'\n'};
-```
-
-Examples of **incorrect** code for this rule with the `{ "before": false, "after": true }` option:
-
-```js
-/*eslint arrow-spacing: ["error", { "before": false, "after": true }]*/
-/*eslint-env es6*/
-
-() =>{};
-(a) => {};
-()=>{'\n'};
-```
-
-Examples of **correct** code for this rule with the `{ "before": false, "after": true }` option:
-
-```js
-/*eslint arrow-spacing: ["error", { "before": false, "after": true }]*/
-/*eslint-env es6*/
-
-()=> {};
-(a)=> {};
-()=> {'\n'};
-```
diff --git a/eslint/docs/rules/block-scoped-var.md b/eslint/docs/rules/block-scoped-var.md
deleted file mode 100644 (file)
index 9c308fe..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# Treat var as Block Scoped (block-scoped-var)
-
-The `block-scoped-var` rule generates warnings when variables are used outside of the block in which they were defined. This emulates C-style block scope.
-
-## Rule Details
-
-This rule aims to reduce the usage of variables outside of their binding context and emulate traditional block scope from other languages. This is to help newcomers to the language avoid difficult bugs with variable hoisting.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint block-scoped-var: "error"*/
-
-function doIf() {
-    if (true) {
-        var build = true;
-    }
-
-    console.log(build);
-}
-
-function doIfElse() {
-    if (true) {
-        var build = true;
-    } else {
-        var build = false;
-    }
-}
-
-function doTryCatch() {
-    try {
-        var build = 1;
-    } catch (e) {
-        var f = build;
-    }
-}
-
-function doFor() {
-    for (var x = 1; x < 10; x++) {
-        var y = f(x);
-    }
-    console.log(y);
-}
-
-class C {
-    static {
-        if (something) {
-            var build = true;
-        }
-        build = false;
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint block-scoped-var: "error"*/
-
-function doIf() {
-    var build;
-
-    if (true) {
-        build = true;
-    }
-
-    console.log(build);
-}
-
-function doIfElse() {
-    var build;
-
-    if (true) {
-        build = true;
-    } else {
-        build = false;
-    }
-}
-
-function doTryCatch() {
-    var build;
-    var f;
-
-    try {
-        build = 1;
-    } catch (e) {
-        f = build;
-    }
-}
-
-function doFor() {
-    for (var x = 1; x < 10; x++) {
-        var y = f(x);
-        console.log(y);
-    }
-}
-
-class C {
-    static {
-        var build = false;
-        if (something) {
-            build = true;
-        }
-    }
-}
-```
-
-## Further Reading
-
-* [JavaScript Scoping and Hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html)
-* [var Hoisting](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting)
diff --git a/eslint/docs/rules/block-spacing.md b/eslint/docs/rules/block-spacing.md
deleted file mode 100644 (file)
index 04c7aeb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-# Disallow or enforce spaces inside of blocks after opening block and before closing block (block-spacing)
-
-## Rule Details
-
-This rule enforces consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) requires one or more spaces
-* `"never"` disallows spaces
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint block-spacing: "error"*/
-
-function foo() {return true;}
-if (foo) { bar = 0;}
-function baz() {let i = 0;
-    return i;
-}
-
-class C {
-    static {this.bar = 0;}
-}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint block-spacing: "error"*/
-
-function foo() { return true; }
-if (foo) { bar = 0; }
-
-class C {
-    static { this.bar = 0; }
-}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint block-spacing: ["error", "never"]*/
-
-function foo() { return true; }
-if (foo) { bar = 0;}
-
-class C {
-    static { this.bar = 0; }
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint block-spacing: ["error", "never"]*/
-
-function foo() {return true;}
-if (foo) {bar = 0;}
-
-class C {
-    static {this.bar = 0;}
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.
diff --git a/eslint/docs/rules/brace-style.md b/eslint/docs/rules/brace-style.md
deleted file mode 100644 (file)
index c22c790..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-# Require Brace Style (brace-style)
-
-Brace style is closely related to [indent style](https://en.wikipedia.org/wiki/Indent_style) in programming and describes the placement of braces relative to their control statement and body. There are probably a dozen, if not more, brace styles in the world.
-
-The *one true brace style* is one of the most common brace styles in JavaScript, in which the opening brace of a block is placed on the same line as its corresponding statement or declaration. For example:
-
-```js
-if (foo) {
-  bar();
-} else {
-  baz();
-}
-```
-
-One common variant of one true brace style is called Stroustrup, in which the `else` statements in an `if-else` construct, as well as `catch` and `finally`, must be on its own line after the preceding closing brace. For example:
-
-```js
-if (foo) {
-  bar();
-}
-else {
-  baz();
-}
-```
-
-Another style is called [Allman](https://en.wikipedia.org/wiki/Indent_style#Allman_style), in which all the braces are expected to be on their own lines without any extra indentation. For example:
-
-```js
-if (foo)
-{
-  bar();
-}
-else
-{
-  baz();
-}
-```
-
-While no style is considered better than the other, most developers agree that having a consistent style throughout a project is important for its long-term maintainability.
-
-## Rule Details
-
-This rule enforces consistent brace style for blocks.
-
-## Options
-
-This rule has a string option:
-
-* `"1tbs"` (default) enforces one true brace style
-* `"stroustrup"` enforces Stroustrup style
-* `"allman"` enforces Allman style
-
-This rule has an object option for an exception:
-
-* `"allowSingleLine": true` (default `false`) allows the opening and closing braces for a block to be on the *same* line
-
-### 1tbs
-
-Examples of **incorrect** code for this rule with the default `"1tbs"` option:
-
-```js
-/*eslint brace-style: "error"*/
-
-function foo()
-{
-  return true;
-}
-
-if (foo)
-{
-  bar();
-}
-
-try
-{
-  somethingRisky();
-} catch(e)
-{
-  handleError();
-}
-
-if (foo) {
-  bar();
-}
-else {
-  baz();
-}
-
-class C
-{
-    static
-    {
-        foo();
-    }
-}
-```
-
-Examples of **correct** code for this rule with the default `"1tbs"` option:
-
-```js
-/*eslint brace-style: "error"*/
-
-function foo() {
-  return true;
-}
-
-if (foo) {
-  bar();
-}
-
-if (foo) {
-  bar();
-} else {
-  baz();
-}
-
-try {
-  somethingRisky();
-} catch(e) {
-  handleError();
-}
-
-class C {
-    static {
-        foo();
-    }
-}
-
-// when there are no braces, there are no problems
-if (foo) bar();
-else if (baz) boom();
-```
-
-Examples of **correct** code for this rule with the `"1tbs", { "allowSingleLine": true }` options:
-
-```js
-/*eslint brace-style: ["error", "1tbs", { "allowSingleLine": true }]*/
-
-function nop() { return; }
-
-if (foo) { bar(); }
-
-if (foo) { bar(); } else { baz(); }
-
-try { somethingRisky(); } catch(e) { handleError(); }
-
-if (foo) { baz(); } else {
-  boom();
-}
-
-if (foo) { baz(); } else if (bar) {
-  boom();
-}
-
-if (foo) { baz(); } else
-if (bar) {
-  boom();
-}
-
-if (foo) { baz(); } else if (bar) {
-  boom();
-}
-
-try { somethingRisky(); } catch(e) {
-  handleError();
-}
-
-class C {
-    static { foo(); }
-}
-
-class D { static { foo(); } }
-```
-
-### stroustrup
-
-Examples of **incorrect** code for this rule with the `"stroustrup"` option:
-
-```js
-/*eslint brace-style: ["error", "stroustrup"]*/
-
-function foo()
-{
-  return true;
-}
-
-if (foo)
-{
-  bar();
-}
-
-try
-{
-  somethingRisky();
-} catch(e)
-{
-  handleError();
-}
-
-class C
-{
-    static
-    {
-        foo();
-    }
-}
-
-if (foo) {
-  bar();
-} else {
-  baz();
-}
-```
-
-Examples of **correct** code for this rule with the `"stroustrup"` option:
-
-```js
-/*eslint brace-style: ["error", "stroustrup"]*/
-
-function foo() {
-  return true;
-}
-
-if (foo) {
-  bar();
-}
-
-if (foo) {
-  bar();
-}
-else {
-  baz();
-}
-
-try {
-  somethingRisky();
-}
-catch(e) {
-  handleError();
-}
-
-class C {
-    static {
-        foo();
-    }
-}
-
-// when there are no braces, there are no problems
-if (foo) bar();
-else if (baz) boom();
-```
-
-Examples of **correct** code for this rule with the `"stroustrup", { "allowSingleLine": true }` options:
-
-```js
-/*eslint brace-style: ["error", "stroustrup", { "allowSingleLine": true }]*/
-
-function nop() { return; }
-
-if (foo) { bar(); }
-
-if (foo) { bar(); }
-else { baz(); }
-
-try { somethingRisky(); }
-catch(e) { handleError(); }
-
-class C {
-    static { foo(); }
-}
-
-class D { static { foo(); } }
-```
-
-### allman
-
-Examples of **incorrect** code for this rule with the `"allman"` option:
-
-```js
-/*eslint brace-style: ["error", "allman"]*/
-
-function foo() {
-  return true;
-}
-
-if (foo)
-{
-  bar(); }
-
-try
-{
-  somethingRisky();
-} catch(e)
-{
-  handleError();
-}
-
-class C {
-    static {
-        foo();
-    }
-}
-
-if (foo) {
-  bar();
-} else {
-  baz();
-}
-```
-
-Examples of **correct** code for this rule with the `"allman"` option:
-
-```js
-/*eslint brace-style: ["error", "allman"]*/
-
-function foo()
-{
-  return true;
-}
-
-if (foo)
-{
-  bar();
-}
-
-if (foo)
-{
-  bar();
-}
-else
-{
-  baz();
-}
-
-try
-{
-  somethingRisky();
-}
-catch(e)
-{
-  handleError();
-}
-
-class C
-{
-    static
-    {
-        foo();
-    }
-}
-
-// when there are no braces, there are no problems
-if (foo) bar();
-else if (baz) boom();
-```
-
-Examples of **correct** code for this rule with the `"allman", { "allowSingleLine": true }` options:
-
-```js
-/*eslint brace-style: ["error", "allman", { "allowSingleLine": true }]*/
-
-function nop() { return; }
-
-if (foo) { bar(); }
-
-if (foo) { bar(); }
-else { baz(); }
-
-try { somethingRisky(); }
-catch(e) { handleError(); }
-
-class C
-{
-    static { foo(); }
-
-    static
-    { foo(); }
-}
-
-class D { static { foo(); } }
-```
-
-## When Not To Use It
-
-If you don't want to enforce a particular brace style, don't enable this rule.
-
-## Further Reading
-
-* [Indent style](https://en.wikipedia.org/wiki/Indent_style)
diff --git a/eslint/docs/rules/callback-return.md b/eslint/docs/rules/callback-return.md
deleted file mode 100644 (file)
index c4e7277..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-# Enforce Return After Callback (callback-return)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-The callback pattern is at the heart of most I/O and event-driven programming
- in JavaScript.
-
-```js
-function doSomething(err, callback) {
-    if (err) {
-        return callback(err);
-    }
-    callback();
-}
-```
-
-To prevent calling the callback multiple times it is important to `return` anytime the callback is triggered outside
- of the main function body. Neglecting this technique often leads to issues where you do something more than once.
- For example, in the case of an HTTP request, you may try to send HTTP headers more than once leading Node.js to `throw`
- a `Can't render headers after they are sent to the client.` error.
-
-## Rule Details
-
-This rule is aimed at ensuring that callbacks used outside of the main function block are always part-of or immediately
-preceding a `return` statement. This rule decides what is a callback based on the name of the function being called.
-
-## Options
-
-The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are `callback`, `cb`, `next`.
-
-### Default callback names
-
-Examples of **incorrect** code for this rule with the default `["callback", "cb", "next"]` option:
-
-```js
-/*eslint callback-return: "error"*/
-
-function foo(err, callback) {
-    if (err) {
-        callback(err);
-    }
-    callback();
-}
-```
-
-Examples of **correct** code for this rule with the default `["callback", "cb", "next"]` option:
-
-```js
-/*eslint callback-return: "error"*/
-
-function foo(err, callback) {
-    if (err) {
-        return callback(err);
-    }
-    callback();
-}
-```
-
-### Supplied callback names
-
-Examples of **incorrect** code for this rule with the option `["done", "send.error", "send.success"]`:
-
-```js
-/*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
-
-function foo(err, done) {
-    if (err) {
-        done(err);
-    }
-    done();
-}
-
-function bar(err, send) {
-    if (err) {
-        send.error(err);
-    }
-    send.success();
-}
-```
-
-Examples of **correct** code for this rule with the option `["done", "send.error", "send.success"]`:
-
-```js
-/*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
-
-function foo(err, done) {
-    if (err) {
-        return done(err);
-    }
-    done();
-}
-
-function bar(err, send) {
-    if (err) {
-        return send.error(err);
-    }
-    send.success();
-}
-```
-
-## Known Limitations
-
-Because it is difficult to understand the meaning of a program through static analysis, this rule has limitations:
-
-* *false negatives* when this rule reports correct code, but the program calls the callback more than one time (which is incorrect behavior)
-* *false positives* when this rule reports incorrect code, but the program calls the callback only one time (which is correct behavior)
-
-### Passing the callback by reference
-
-The static analysis of this rule does not detect that the program calls the callback if it is an argument of a function (for example,  `setTimeout`).
-
-Example of a *false negative* when this rule reports correct code:
-
-```js
-/*eslint callback-return: "error"*/
-
-function foo(err, callback) {
-    if (err) {
-        setTimeout(callback, 0); // this is bad, but WILL NOT warn
-    }
-    callback();
-}
-```
-
-### Triggering the callback within a nested function
-
-The static analysis of this rule does not detect that the program calls the callback from within a nested function or an immediately-invoked function expression (IIFE).
-
-Example of a *false negative* when this rule reports correct code:
-
-```js
-/*eslint callback-return: "error"*/
-
-function foo(err, callback) {
-    if (err) {
-        process.nextTick(function() {
-            return callback(); // this is bad, but WILL NOT warn
-        });
-    }
-    callback();
-}
-```
-
-### If/else statements
-
-The static analysis of this rule does not detect that the program calls the callback only one time in each branch of an `if` statement.
-
-Example of a *false positive* when this rule reports incorrect code:
-
-```js
-/*eslint callback-return: "error"*/
-
-function foo(err, callback) {
-    if (err) {
-        callback(err); // this is fine, but WILL warn
-    } else {
-        callback();    // this is fine, but WILL warn
-    }
-}
-```
-
-## When Not To Use It
-
-There are some cases where you might want to call a callback function more than once. In those cases this rule
- may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and
- not include that in the list of callbacks that trigger warnings.
-
-## Further Reading
-
-* [The Art Of Node: Callbacks](https://github.com/maxogden/art-of-node#callbacks)
-* [Nodejitsu: What are the error conventions?](https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/)
-
-## Related Rules
-
-* [handle-callback-err](handle-callback-err.md)
diff --git a/eslint/docs/rules/camelcase.md b/eslint/docs/rules/camelcase.md
deleted file mode 100644 (file)
index 164dfab..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-# Require CamelCase (camelcase)
-
-When it comes to naming variables, style guides generally fall into one of two camps: camelcase (`variableName`) and underscores (`variable_name`). This rule focuses on using the camelcase approach. If your style guide calls for camelCasing your variable names, then this rule is for you!
-
-## Rule Details
-
-This rule looks for any underscores (`_`) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 `import` statements, this rule only targets the name of the variable that will be imported into the local module scope.
-
-## Options
-
-This rule has an object option:
-
-* `"properties": "always"` (default) enforces camelcase style for property names
-* `"properties": "never"` does not check property names
-* `"ignoreDestructuring": false` (default) enforces camelcase style for destructured identifiers
-* `"ignoreDestructuring": true` does not check destructured identifiers (but still checks any use of those identifiers later in the code)
-* `"ignoreImports": false` (default) enforces camelcase style for ES2015 imports
-* `"ignoreImports": true` does not check ES2015 imports (but still checks any use of the imports later in the code except function arguments)
-* `"ignoreGlobals": false` (default) enforces camelcase style for global variables
-* `"ignoreGlobals": true` does not enforce camelcase style for global variables
-* `allow` (`string[]`) list of properties to accept. Accept regex.
-
-### properties: "always"
-
-Examples of **incorrect** code for this rule with the default `{ "properties": "always" }` option:
-
-```js
-/*eslint camelcase: "error"*/
-
-import { no_camelcased } from "external-module"
-
-var my_favorite_color = "#112C85";
-
-function do_something() {
-    // ...
-}
-
-obj.do_something = function() {
-    // ...
-};
-
-function foo({ no_camelcased }) {
-    // ...
-};
-
-function foo({ isCamelcased: no_camelcased }) {
-    // ...
-}
-
-function foo({ no_camelcased = 'default value' }) {
-    // ...
-};
-
-var obj = {
-    my_pref: 1
-};
-
-var { category_id = 1 } = query;
-
-var { foo: no_camelcased } = bar;
-
-var { foo: bar_baz = 1 } = quz;
-```
-
-Examples of **correct** code for this rule with the default `{ "properties": "always" }` option:
-
-```js
-/*eslint camelcase: "error"*/
-
-import { no_camelcased as camelCased } from "external-module";
-
-var myFavoriteColor   = "#112C85";
-var _myFavoriteColor  = "#112C85";
-var myFavoriteColor_  = "#112C85";
-var MY_FAVORITE_COLOR = "#112C85";
-var foo = bar.baz_boom;
-var foo = { qux: bar.baz_boom };
-
-obj.do_something();
-do_something();
-new do_something();
-
-var { category_id: category } = query;
-
-function foo({ isCamelCased }) {
-    // ...
-};
-
-function foo({ isCamelCased: isAlsoCamelCased }) {
-    // ...
-}
-
-function foo({ isCamelCased = 'default value' }) {
-    // ...
-};
-
-var { categoryId = 1 } = query;
-
-var { foo: isCamelCased } = bar;
-
-var { foo: isCamelCased = 1 } = quz;
-
-```
-
-### properties: "never"
-
-Examples of **correct** code for this rule with the `{ "properties": "never" }` option:
-
-```js
-/*eslint camelcase: ["error", {properties: "never"}]*/
-
-var obj = {
-    my_pref: 1
-};
-```
-
-### ignoreDestructuring: false
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreDestructuring": false }` option:
-
-```js
-/*eslint camelcase: "error"*/
-
-var { category_id } = query;
-
-var { category_id = 1 } = query;
-
-var { category_id: category_id } = query;
-
-var { category_id: category_alias } = query;
-
-var { category_id: categoryId, ...other_props } = query;
-```
-
-### ignoreDestructuring: true
-
-Examples of **incorrect** code for this rule with the `{ "ignoreDestructuring": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
-
-var { category_id: category_alias } = query;
-
-var { category_id, ...other_props } = query;
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreDestructuring": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
-
-var { category_id } = query;
-
-var { category_id = 1 } = query;
-
-var { category_id: category_id } = query;
-```
-
-Please note that this option applies only to identifiers inside destructuring patterns. It doesn't additionally allow any particular use of the created variables later in the code apart from the use that is already allowed by default or by other options.
-
-Examples of additional **incorrect** code for this rule with the `{ "ignoreDestructuring": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
-
-var { some_property } = obj; // allowed by {ignoreDestructuring: true}
-var foo = some_property + 1; // error, ignoreDestructuring does not apply to this statement
-```
-
-A common use case for this option is to avoid useless renaming when the identifier is not intended to be used later in the code.
-
-Examples of additional **correct** code for this rule with the `{ "ignoreDestructuring": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
-
-var { some_property, ...rest } = obj;
-// do something with 'rest', nothing with 'some_property'
-```
-
-Another common use case for this option is in combination with `{ "properties": "never" }`, when the identifier is intended to be used only as a property shorthand.
-
-Examples of additional **correct** code for this rule with the `{ "properties": "never", "ignoreDestructuring": true }` options:
-
-```js
-/*eslint camelcase: ["error", {"properties": "never", ignoreDestructuring: true}]*/
-
-var { some_property } = obj;
-doSomething({ some_property });
-```
-
-### ignoreImports: false
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreImports": false }` option:
-
-```js
-/*eslint camelcase: "error"*/
-
-import { snake_cased } from 'mod';
-```
-
-### ignoreImports: true
-
-Examples of **incorrect** code for this rule with the `{ "ignoreImports": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreImports: true}]*/
-
-import default_import from 'mod';
-
-import * as namespaced_import from 'mod';
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreImports": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreImports: true}]*/
-
-import { snake_cased } from 'mod';
-```
-
-### ignoreGlobals: false
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreGlobals": false }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreGlobals: false}]*/
-/* global no_camelcased */
-
-const foo = no_camelcased;
-```
-
-### ignoreGlobals: true
-
-Examples of **correct** code for this rule with the `{ "ignoreGlobals": true }` option:
-
-```js
-/*eslint camelcase: ["error", {ignoreGlobals: true}]*/
-/* global no_camelcased */
-
-const foo = no_camelcased;
-```
-
-## allow
-
-Examples of **correct** code for this rule with the `allow` option:
-
-```js
-/*eslint camelcase: ["error", {allow: ["UNSAFE_componentWillMount"]}]*/
-
-function UNSAFE_componentWillMount() {
-    // ...
-}
-```
-
-```js
-/*eslint camelcase: ["error", {allow: ["^UNSAFE_"]}]*/
-
-function UNSAFE_componentWillMount() {
-    // ...
-}
-
-function UNSAFE_componentWillMount() {
-    // ...
-}
-```
-
-## When Not To Use It
-
-If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off.
diff --git a/eslint/docs/rules/capitalized-comments.md b/eslint/docs/rules/capitalized-comments.md
deleted file mode 100644 (file)
index ec3253b..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-# enforce or disallow capitalization of the first letter of a comment (capitalized-comments)
-
-Comments are useful for leaving information for future developers. In order for that information to be useful and not distracting, it is sometimes desirable for comments to follow a particular style. One element of comment formatting styles is whether the first word of a comment should be capitalized or lowercase.
-
-In general, no comment style is any more or less valid than any others, but many developers would agree that a consistent style can improve a project's maintainability.
-
-## Rule Details
-
-This rule aims to enforce a consistent style of comments across your codebase, specifically by either requiring or disallowing a capitalized letter as the first word character in a comment. This rule will not issue warnings when non-cased letters are used.
-
-By default, this rule will require a non-lowercase letter at the beginning of comments.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint capitalized-comments: ["error"] */
-
-// lowercase comment
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-
-// Capitalized comment
-
-// 1. Non-letter at beginning of comment
-
-// 丈 Non-Latin character at beginning of comment
-
-/* eslint semi:off */
-/* eslint-env node */
-/* eslint-disable */
-/* eslint-enable */
-/* istanbul ignore next */
-/* jscs:enable */
-/* jshint asi:true */
-/* global foo */
-/* globals foo */
-/* exported myVar */
-// eslint-disable-line
-// eslint-disable-next-line
-// https://github.com
-
-```
-
-### Options
-
-This rule has two options: a string value `"always"` or `"never"` which determines whether capitalization of the first word of a comment should be required or forbidden, and optionally an object containing more configuration parameters for the rule.
-
-Here are the supported object options:
-
-* `ignorePattern`: A string representing a regular expression pattern of words that should be ignored by this rule. If the first word of a comment matches the pattern, this rule will not report that comment.
-    * Note that the following words are always ignored by this rule: `["jscs", "jshint", "eslint", "istanbul", "global", "globals", "exported"]`.
-* `ignoreInlineComments`: If this is `true`, the rule will not report on comments in the middle of code. By default, this is `false`.
-* `ignoreConsecutiveComments`: If this is `true`, the rule will not report on a comment which violates the rule, as long as the comment immediately follows another comment. By default, this is `false`.
-
-Here is an example configuration:
-
-```json
-{
-    "capitalized-comments": [
-        "error",
-        "always",
-        {
-            "ignorePattern": "pragma|ignored",
-            "ignoreInlineComments": true
-        }
-    ]
-}
-```
-
-#### `"always"`
-
-Using the `"always"` option means that this rule will report any comments which start with a lowercase letter. This is the default configuration for this rule.
-
-Note that configuration comments and comments which start with URLs are never reported.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint capitalized-comments: ["error", "always"] */
-
-// lowercase comment
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint capitalized-comments: ["error", "always"] */
-
-// Capitalized comment
-
-// 1. Non-letter at beginning of comment
-
-// 丈 Non-Latin character at beginning of comment
-
-/* eslint semi:off */
-/* eslint-env node */
-/* eslint-disable */
-/* eslint-enable */
-/* istanbul ignore next */
-/* jscs:enable */
-/* jshint asi:true */
-/* global foo */
-/* globals foo */
-/* exported myVar */
-// eslint-disable-line
-// eslint-disable-next-line
-// https://github.com
-
-```
-
-#### `"never"`
-
-Using the `"never"` option means that this rule will report any comments which start with an uppercase letter.
-
-Examples of **incorrect** code with the `"never"` option:
-
-```js
-/* eslint capitalized-comments: ["error", "never"] */
-
-// Capitalized comment
-
-```
-
-Examples of **correct** code with the `"never"` option:
-
-```js
-/* eslint capitalized-comments: ["error", "never"] */
-
-// lowercase comment
-
-// 1. Non-letter at beginning of comment
-
-// 丈 Non-Latin character at beginning of comment
-
-```
-
-#### `ignorePattern`
-
-The `ignorePattern` object takes a string value, which is used as a regular expression applied to the first word of a comment.
-
-Examples of **correct** code with the `"ignorePattern"` option set to `"pragma"`:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "ignorePattern": "pragma" }] */
-
-function foo() {
-    /* pragma wrap(true) */
-}
-
-```
-
-#### `ignoreInlineComments`
-
-Setting the `ignoreInlineComments` option to `true` means that comments in the middle of code (with a token on the same line as the beginning of the comment, and another token on the same line as the end of the comment) will not be reported by this rule.
-
-Examples of **correct** code with the `"ignoreInlineComments"` option set to `true`:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "ignoreInlineComments": true }] */
-
-function foo(/* ignored */ a) {
-}
-
-```
-
-#### `ignoreConsecutiveComments`
-
-If the `ignoreConsecutiveComments` option is set to `true`, then comments which otherwise violate the rule will not be reported as long as they immediately follow another comment. This can be applied more than once.
-
-Examples of **correct** code with `ignoreConsecutiveComments` set to `true`:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "ignoreConsecutiveComments": true }] */
-
-// This comment is valid since it has the correct capitalization.
-// this comment is ignored since it follows another comment,
-// and this one as well because it follows yet another comment.
-
-/* Here is a block comment which has the correct capitalization, */
-/* but this one is ignored due to being consecutive; */
-/*
- * in fact, even if any of these are multi-line, that is fine too.
- */
-```
-
-Examples of **incorrect** code with `ignoreConsecutiveComments` set to `true`:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "ignoreConsecutiveComments": true }] */
-
-// this comment is invalid, but only on this line.
-// this comment does NOT get reported, since it is a consecutive comment.
-```
-
-### Using Different Options for Line and Block Comments
-
-If you wish to have a different configuration for line comments and block comments, you can do so by using two different object configurations (note that the capitalization option will be enforced consistently for line and block comments):
-
-```json
-{
-    "capitalized-comments": [
-        "error",
-        "always",
-        {
-            "line": {
-                "ignorePattern": "pragma|ignored",
-            },
-            "block": {
-                "ignoreInlineComments": true,
-                "ignorePattern": "ignored"
-            }
-        }
-    ]
-}
-```
-
-Examples of **incorrect** code with different line and block comment configuration:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "block": { "ignorePattern": "blockignore" } }] */
-
-// capitalized line comment, this is incorrect, blockignore does not help here
-/* lowercased block comment, this is incorrect too */
-
-```
-
-Examples of **correct** code with different line and block comment configuration:
-
-```js
-/* eslint capitalized-comments: ["error", "always", { "block": { "ignorePattern": "blockignore" } }] */
-
-// Uppercase line comment, this is correct
-/* blockignore lowercase block comment, this is correct due to ignorePattern */
-
-```
-
-## When Not To Use It
-
-This rule can be disabled if you do not care about the grammatical style of comments in your codebase.
-
-## Compatibility
-
-* **JSCS**: [requireCapitalizedComments](https://jscs-dev.github.io/rule/requireCapitalizedComments)
-* **JSCS**: [disallowCapitalizedComments](https://jscs-dev.github.io/rule/disallowCapitalizedComments)
diff --git a/eslint/docs/rules/class-methods-use-this.md b/eslint/docs/rules/class-methods-use-this.md
deleted file mode 100644 (file)
index 7e25b06..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-# Enforce that class methods utilize `this` (class-methods-use-this)
-
-If a class method does not use `this`, it can *sometimes* be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (`MyClass.callStaticMethod()`)
-
-It's possible to have a class method which doesn't use `this`, such as:
-
-```js
-class A {
-    constructor() {
-        this.a = "hi";
-    }
-
-    print() {
-        console.log(this.a);
-    }
-
-    sayHi() {
-        console.log("hi");
-    }
-}
-
-let a = new A();
-a.sayHi(); // => "hi"
-```
-
-In the example above, the `sayHi` method doesn't use `this`, so we can make it a static method:
-
-```js
-class A {
-    constructor() {
-        this.a = "hi";
-    }
-
-    print() {
-        console.log(this.a);
-    }
-
-    static sayHi() {
-        console.log("hi");
-    }
-}
-
-A.sayHi(); // => "hi"
-```
-
-Also note in the above examples that if you switch a method to a static method, *instances* of the class that call the static method (`let a = new A(); a.sayHi();`) have to be updated to being a static call (`A.sayHi();`) instead of having the instance of the *class* call the method
-
-## Rule Details
-
-This rule is aimed to flag class methods that do not use `this`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint class-methods-use-this: "error"*/
-/*eslint-env es6*/
-
-class A {
-    foo() {
-        console.log("Hello World");     /*error Expected 'this' to be used by class method 'foo'.*/
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint class-methods-use-this: "error"*/
-/*eslint-env es6*/
-class A {
-    foo() {
-        this.bar = "Hello World"; // OK, this is used
-    }
-}
-
-class A {
-    constructor() {
-        // OK. constructor is exempt
-    }
-}
-
-class A {
-    static foo() {
-        // OK. static methods aren't expected to use this.
-    }
-
-    static {
-        // OK. static blocks are exempt.
-    }
-}
-```
-
-## Options
-
-This rule has two options:
-
-* `"exceptMethods"` allows specified method names to be ignored with this rule.
-* `"enforceForClassFields"` enforces that functions used as instance field initializers utilize `this`. (default: `true`)
-
-### exceptMethods
-
-```js
-"class-methods-use-this": [<enabled>, { "exceptMethods": [<...exceptions>] }]
-```
-
-The `exceptMethods` option allows you to pass an array of method names for which you would like to ignore warnings. For example, you might have a spec from an external library that requires you to overwrite a method as a regular function (and not as a static method) and does not use `this` inside the function body. In this case, you can add that method to ignore in the warnings.
-
-Examples of **incorrect** code for this rule when used without exceptMethods:
-
-```js
-/*eslint class-methods-use-this: "error"*/
-
-class A {
-    foo() {
-    }
-}
-```
-
-Examples of **correct** code for this rule when used with exceptMethods:
-
-```js
-/*eslint class-methods-use-this: ["error", { "exceptMethods": ["foo", "#bar"] }] */
-
-class A {
-    foo() {
-    }
-    #bar() {
-    }
-}
-```
-
-## enforceForClassFields
-
-```js
-"class-methods-use-this": [<enabled>, { "enforceForClassFields": true | false }]
-```
-
-The `enforceForClassFields` option enforces that arrow functions and function expressions used as instance field initializers utilize `this`. (default: `true`)
-
-Examples of **incorrect** code for this rule with the `{ "enforceForClassFields": true }` option (default):
-
-```js
-/*eslint class-methods-use-this: ["error", { "enforceForClassFields": true }] */
-
-class A {
-    foo = () => {}
-}
-```
-
-Examples of **correct** code for this rule with the `{ "enforceForClassFields": true }` option (default):
-
-```js
-/*eslint class-methods-use-this: ["error", { "enforceForClassFields": true }] */
-
-class A {
-    foo = () => {this;}
-}
-```
-
-Examples of **correct** code for this rule with the `{ "enforceForClassFields": false }` option:
-
-```js
-/*eslint class-methods-use-this: ["error", { "enforceForClassFields": false }] */
-
-class A {
-    foo = () => {}
-}
-```
-
-## Further Reading
-
-* [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
-* [Static Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static)
diff --git a/eslint/docs/rules/comma-dangle.md b/eslint/docs/rules/comma-dangle.md
deleted file mode 100644 (file)
index ef92342..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-# require or disallow trailing commas (comma-dangle)
-
-Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec. However, IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.
-
-```js
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-```
-
-Trailing commas simplify adding and removing items to objects and arrays, since only the lines you are modifying must be touched.
-Another argument in favor of trailing commas is that it improves the clarity of diffs when an item is added or removed from an object or array:
-
-Less clear:
-
-```diff
- var foo = {
--    bar: "baz",
--    qux: "quux"
-+    bar: "baz"
- };
-```
-
-More clear:
-
-```diff
- var foo = {
-     bar: "baz",
--    qux: "quux",
- };
-```
-
-## Rule Details
-
-This rule enforces consistent use of trailing commas in object and array literals.
-
-## Options
-
-This rule has a string option or an object option:
-
-```json
-{
-    "comma-dangle": ["error", "never"],
-    // or
-    "comma-dangle": ["error", {
-        "arrays": "never",
-        "objects": "never",
-        "imports": "never",
-        "exports": "never",
-        "functions": "never"
-    }]
-}
-```
-
-* `"never"` (default) disallows trailing commas
-* `"always"` requires trailing commas
-* `"always-multiline"` requires trailing commas when the last element or property is in a *different* line than the closing `]` or `}` and disallows trailing commas when the last element or property is on the *same* line as the closing `]` or `}`
-* `"only-multiline"` allows (but does not require) trailing commas when the last element or property is in a *different* line than the closing `]` or `}` and disallows trailing commas when the last element or property is on the *same* line as the closing `]` or `}`
-
-You can also use an object option to configure this rule for each type of syntax.
-Each of the following options can be set to `"never"`, `"always"`, `"always-multiline"`, `"only-multiline"`, or `"ignore"`.
-The default for each option is `"never"` unless otherwise specified.
-
-* `arrays` is for array literals and array patterns of destructuring. (e.g. `let [a,] = [1,];`)
-* `objects` is for object literals and object patterns of destructuring. (e.g. `let {a,} = {a: 1};`)
-* `imports` is for import declarations of ES Modules. (e.g. `import {a,} from "foo";`)
-* `exports` is for export declarations of ES Modules. (e.g. `export {a,};`)
-* `functions` is for function declarations and function calls. (e.g. `(function(a,){ })(b,);`)
-    * `functions` should only be enabled when linting ECMAScript 2017 or higher.
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint comma-dangle: ["error", "never"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-
-var arr = [1,2,];
-
-foo({
-  bar: "baz",
-  qux: "quux",
-});
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint comma-dangle: ["error", "never"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux"
-};
-
-var arr = [1,2];
-
-foo({
-  bar: "baz",
-  qux: "quux"
-});
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint comma-dangle: ["error", "always"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux"
-};
-
-var arr = [1,2];
-
-foo({
-  bar: "baz",
-  qux: "quux"
-});
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint comma-dangle: ["error", "always"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-
-var arr = [1,2,];
-
-foo({
-  bar: "baz",
-  qux: "quux",
-});
-```
-
-### always-multiline
-
-Examples of **incorrect** code for this rule with the `"always-multiline"` option:
-
-```js
-/*eslint comma-dangle: ["error", "always-multiline"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux"
-};
-
-var foo = { bar: "baz", qux: "quux", };
-
-var arr = [1,2,];
-
-var arr = [1,
-    2,];
-
-var arr = [
-    1,
-    2
-];
-
-foo({
-  bar: "baz",
-  qux: "quux"
-});
-```
-
-Examples of **correct** code for this rule with the `"always-multiline"` option:
-
-```js
-/*eslint comma-dangle: ["error", "always-multiline"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-
-var foo = {bar: "baz", qux: "quux"};
-var arr = [1,2];
-
-var arr = [1,
-    2];
-
-var arr = [
-    1,
-    2,
-];
-
-foo({
-  bar: "baz",
-  qux: "quux",
-});
-```
-
-### only-multiline
-
-Examples of **incorrect** code for this rule with the `"only-multiline"` option:
-
-```js
-/*eslint comma-dangle: ["error", "only-multiline"]*/
-
-var foo = { bar: "baz", qux: "quux", };
-
-var arr = [1,2,];
-
-var arr = [1,
-    2,];
-
-```
-
-Examples of **correct** code for this rule with the `"only-multiline"` option:
-
-```js
-/*eslint comma-dangle: ["error", "only-multiline"]*/
-
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-
-var foo = {
-    bar: "baz",
-    qux: "quux"
-};
-
-var foo = {bar: "baz", qux: "quux"};
-var arr = [1,2];
-
-var arr = [1,
-    2];
-
-var arr = [
-    1,
-    2,
-];
-
-var arr = [
-    1,
-    2
-];
-
-foo({
-  bar: "baz",
-  qux: "quux",
-});
-
-foo({
-  bar: "baz",
-  qux: "quux"
-});
-```
-
-### functions
-
-Examples of **incorrect** code for this rule with the `{"functions": "never"}` option:
-
-```js
-/*eslint comma-dangle: ["error", {"functions": "never"}]*/
-
-function foo(a, b,) {
-}
-
-foo(a, b,);
-new foo(a, b,);
-```
-
-Examples of **correct** code for this rule with the `{"functions": "never"}` option:
-
-```js
-/*eslint comma-dangle: ["error", {"functions": "never"}]*/
-
-function foo(a, b) {
-}
-
-foo(a, b);
-new foo(a, b);
-```
-
-Examples of **incorrect** code for this rule with the `{"functions": "always"}` option:
-
-```js
-/*eslint comma-dangle: ["error", {"functions": "always"}]*/
-
-function foo(a, b) {
-}
-
-foo(a, b);
-new foo(a, b);
-```
-
-Examples of **correct** code for this rule with the `{"functions": "always"}` option:
-
-```js
-/*eslint comma-dangle: ["error", {"functions": "always"}]*/
-
-function foo(a, b,) {
-}
-
-foo(a, b,);
-new foo(a, b,);
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with dangling commas.
diff --git a/eslint/docs/rules/comma-spacing.md b/eslint/docs/rules/comma-spacing.md
deleted file mode 100644 (file)
index 3160f86..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# Enforces spacing around commas (comma-spacing)
-
-Spacing around commas improves readability of a list of items. Although most of the style guidelines for languages prescribe adding a space after a comma and not before it, it is subjective to the preferences of a project.
-
-```js
-var foo = 1, bar = 2;
-var foo = 1 ,bar = 2;
-```
-
-## Rule Details
-
-This rule enforces consistent spacing before and after commas in variable declarations, array literals, object literals, function parameters, and sequences.
-
-This rule does not apply in an `ArrayExpression` or `ArrayPattern` in either of the following cases:
-
-* adjacent null elements
-* an initial null element, to avoid conflicts with the [`array-bracket-spacing`](array-bracket-spacing.md) rule
-
-## Options
-
-This rule has an object option:
-
-* `"before": false` (default) disallows spaces before commas
-* `"before": true` requires one or more spaces before commas
-* `"after": true` (default) requires one or more spaces after commas
-* `"after": false` disallows spaces after commas
-
-### after
-
-Examples of **incorrect** code for this rule with the default `{ "before": false, "after": true }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
-
-var foo = 1 ,bar = 2;
-var arr = [1 , 2];
-var obj = {"foo": "bar" ,"baz": "qur"};
-foo(a ,b);
-new Foo(a ,b);
-function foo(a ,b){}
-a ,b
-```
-
-Examples of **correct** code for this rule with the default `{ "before": false, "after": true }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
-
-var foo = 1, bar = 2
-    , baz = 3;
-var arr = [1, 2];
-var arr = [1,, 3]
-var obj = {"foo": "bar", "baz": "qur"};
-foo(a, b);
-new Foo(a, b);
-function foo(a, b){}
-a, b
-```
-
-Example of **correct** code for this rule with initial null element for the default `{ "before": false, "after": true }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
-/*eslint array-bracket-spacing: ["error", "always"]*/
-
-var arr = [ , 2, 3 ]
-```
-
-### before
-
-Examples of **incorrect** code for this rule with the `{ "before": true, "after": false }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": true, "after": false }]*/
-
-var foo = 1, bar = 2;
-var arr = [1 , 2];
-var obj = {"foo": "bar", "baz": "qur"};
-new Foo(a,b);
-function foo(a,b){}
-a, b
-```
-
-Examples of **correct** code for this rule with the `{ "before": true, "after": false }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": true, "after": false }]*/
-
-var foo = 1 ,bar = 2 ,
-    baz = true;
-var arr = [1 ,2];
-var arr = [1 ,,3]
-var obj = {"foo": "bar" ,"baz": "qur"};
-foo(a ,b);
-new Foo(a ,b);
-function foo(a ,b){}
-a ,b
-```
-
-Examples of **correct** code for this rule with initial null element for the `{ "before": true, "after": false }` options:
-
-```js
-/*eslint comma-spacing: ["error", { "before": true, "after": false }]*/
-/*eslint array-bracket-spacing: ["error", "never"]*/
-
-var arr = [,2 ,3]
-```
-
-## When Not To Use It
-
-If your project will not be following a consistent comma-spacing pattern, turn this rule off.
-
-## Further Reading
-
-* [JavaScript](http://javascript.crockford.com/code.html)
-* [Dojo Style Guide](https://dojotoolkit.org/reference-guide/1.9/developer/styleguide.html)
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [comma-style](comma-style.md)
-* [space-in-brackets](space-in-brackets.md) (deprecated)
-* [space-in-parens](space-in-parens.md)
-* [space-infix-ops](space-infix-ops.md)
-* [space-after-keywords](space-after-keywords.md)
-* [space-unary-ops](space-unary-ops.md)
-* [space-return-throw-case](space-return-throw-case.md)
diff --git a/eslint/docs/rules/comma-style.md b/eslint/docs/rules/comma-style.md
deleted file mode 100644 (file)
index f71e310..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-# Comma style (comma-style)
-
-The Comma Style rule enforces styles for comma-separated lists. There are two comma styles primarily used in JavaScript:
-
-* The standard style, in which commas are placed at the end of the current line
-* Comma First style, in which commas are placed at the start of the next line
-
-One of the justifications for using Comma First style is that it can help track missing and trailing commas. These are problematic because missing commas in variable declarations can lead to the leakage of global variables and trailing commas can lead to errors in older versions of IE.
-
-## Rule Details
-
-This rule enforce consistent comma style in array literals, object literals, and variable declarations.
-
-This rule does not apply in either of the following cases:
-
-* comma preceded and followed by linebreak (lone comma)
-* single-line array literals, object literals, and variable declarations
-
-## Options
-
-This rule has a string option:
-
-* `"last"` (default) requires a comma after and on the same line as an array element, object property, or variable declaration
-* `"first"` requires a comma before and on the same line as an array element, object property, or variable declaration
-
-This rule also accepts an additional `exceptions` object:
-
-* `"exceptions"` has properties whose names correspond to node types in the abstract syntax tree (AST) of JavaScript code:
-
-    * `"ArrayExpression": true` ignores comma style in array literals
-    * `"ArrayPattern": true` ignores comma style in array patterns of destructuring
-    * `"ArrowFunctionExpression": true` ignores comma style in the parameters of arrow function expressions
-    * `"CallExpression": true` ignores comma style in the arguments of function calls
-    * `"FunctionDeclaration": true` ignores comma style in the parameters of function declarations
-    * `"FunctionExpression": true` ignores comma style in the parameters of function expressions
-    * `"ImportDeclaration": true` ignores comma style in the specifiers of import declarations
-    * `"ObjectExpression": true` ignores comma style in object literals
-    * `"ObjectPattern": true` ignores comma style in object patterns of destructuring
-    * `"VariableDeclaration": true` ignores comma style in variable declarations
-    * `"NewExpression": true` ignores comma style in the parameters of constructor expressions
-
-A way to determine the node types as defined by [ESTree](https://github.com/estree/estree) is to use [AST Explorer](https://astexplorer.net/) with the espree parser.
-
-### last
-
-Examples of **incorrect** code for this rule with the default `"last"` option:
-
-```js
-/*eslint comma-style: ["error", "last"]*/
-
-var foo = 1
-,
-bar = 2;
-
-var foo = 1
-  , bar = 2;
-
-var foo = ["apples"
-           , "oranges"];
-
-function bar() {
-    return {
-        "a": 1
-        ,"b:": 2
-    };
-}
-```
-
-Examples of **correct** code for this rule with the default `"last"` option:
-
-```js
-/*eslint comma-style: ["error", "last"]*/
-
-var foo = 1, bar = 2;
-
-var foo = 1,
-    bar = 2;
-
-var foo = ["apples",
-           "oranges"];
-
-function bar() {
-    return {
-        "a": 1,
-        "b:": 2
-    };
-}
-```
-
-### first
-
-Examples of **incorrect** code for this rule with the `"first"` option:
-
-```js
-/*eslint comma-style: ["error", "first"]*/
-
-var foo = 1,
-    bar = 2;
-
-var foo = ["apples",
-           "oranges"];
-
-function bar() {
-    return {
-        "a": 1,
-        "b:": 2
-    };
-}
-```
-
-Examples of **correct** code for this rule with the `"first"` option:
-
-```js
-/*eslint comma-style: ["error", "first"]*/
-
-var foo = 1, bar = 2;
-
-var foo = 1
-    ,bar = 2;
-
-var foo = ["apples"
-          ,"oranges"];
-
-function bar() {
-    return {
-        "a": 1
-        ,"b:": 2
-    };
-}
-```
-
-### exceptions
-
-An example use case is to enforce comma style *only* in var statements.
-
-Examples of **incorrect** code for this rule with sample `"first", { "exceptions": { … } }` options:
-
-```js
-/*eslint comma-style: ["error", "first", { "exceptions": { "ArrayExpression": true, "ObjectExpression": true } }]*/
-
-var o = {},
-    a = [];
-```
-
-Examples of **correct** code for this rule with sample `"first", { "exceptions": { … } }` options:
-
-```js
-/*eslint comma-style: ["error", "first", { "exceptions": { "ArrayExpression": true, "ObjectExpression": true } }]*/
-
-var o = {fst:1,
-         snd: [1,
-               2]}
-  , a = [];
-```
-
-## When Not To Use It
-
-This rule can safely be turned off if your project does not care about enforcing a consistent comma style.
-
-## Further Reading
-
-For more information on the Comma First style:
-
-* [A better coding convention for lists and object literals in JavaScript by isaacs](https://gist.github.com/isaacs/357981)
-* [npm coding style guideline](https://docs.npmjs.com/misc/coding-style)
-
-## Related Rules
-
-* [operator-linebreak](operator-linebreak.md)
diff --git a/eslint/docs/rules/complexity.md b/eslint/docs/rules/complexity.md
deleted file mode 100644 (file)
index 7955d1a..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-# Limit Cyclomatic Complexity (complexity)
-
-Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.
-
-```js
-function a(x) {
-    if (true) {
-        return x; // 1st path
-    } else if (false) {
-        return x+1; // 2nd path
-    } else {
-        return 4; // 3rd path
-    }
-}
-```
-
-## Rule Details
-
-This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is `20`).
-
-Examples of **incorrect** code for a maximum of 2:
-
-```js
-/*eslint complexity: ["error", 2]*/
-
-function a(x) {
-    if (true) {
-        return x;
-    } else if (false) {
-        return x+1;
-    } else {
-        return 4; // 3rd path
-    }
-}
-
-function b() {
-    foo ||= 1;
-    bar &&= 1;
-}
-```
-
-Examples of **correct** code for a maximum of 2:
-
-```js
-/*eslint complexity: ["error", 2]*/
-
-function a(x) {
-    if (true) {
-        return x;
-    } else {
-        return 4;
-    }
-}
-
-function b() {
-    foo ||= 1;
-}
-```
-
-Class field initializers and class static blocks are implicit functions. Therefore, their complexity is calculated separately for each initializer and each static block, and it doesn't contribute to the complexity of the enclosing code.
-
-Examples of additional **incorrect** code for a maximum of 2:
-
-```js
-/*eslint complexity: ["error", 2]*/
-
-class C {
-    x = a || b || c; // this initializer has complexity = 3
-}
-
-class D { // this static block has complexity = 3
-    static {
-        if (foo) {
-            bar = baz || qux;
-        }
-    }
-}
-```
-
-Examples of additional **correct** code for a maximum of 2:
-
-```js
-/*eslint complexity: ["error", 2]*/
-
-function foo() { // this function has complexity = 1
-    class C {
-        x = a + b; // this initializer has complexity = 1
-        y = c || d; // this initializer has complexity = 2
-        z = e && f; // this initializer has complexity = 2
-
-        static p = g || h; // this initializer has complexity = 2
-        static q = i ? j : k; // this initializer has complexity = 2
-
-        static { // this static block has complexity = 2
-            if (foo) {
-                baz = bar;
-            }
-        }
-
-        static { // this static block has complexity = 2
-            qux = baz || quux;
-        }
-    }
-}
-```
-
-## Options
-
-Optionally, you may specify a `max` object property:
-
-```json
-"complexity": ["error", 2]
-```
-
-is equivalent to
-
-```json
-"complexity": ["error", { "max": 2 }]
-```
-
-**Deprecated:** the object property `maximum` is deprecated. Please use the property `max` instead.
-
-## When Not To Use It
-
-If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.
-
-## Further Reading
-
-* [Cyclomatic Complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity)
-* [Complexity Analysis of JavaScript Code](https://ariya.io/2012/12/complexity-analysis-of-javascript-code)
-* [More about Complexity in JavaScript](https://craftsmanshipforsoftware.com/2015/05/25/complexity-for-javascript/)
-* [About Complexity](https://web.archive.org/web/20160808115119/http://jscomplexity.org/complexity)
-* [Discussion about Complexity in ESLint and more links](https://github.com/eslint/eslint/issues/4808#issuecomment-167795140)
-
-## Related Rules
-
-* [max-depth](max-depth.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/computed-property-spacing.md b/eslint/docs/rules/computed-property-spacing.md
deleted file mode 100644 (file)
index 3fdd70c..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-# Disallow or enforce spaces inside of computed properties (computed-property-spacing)
-
-While formatting preferences are very personal, a number of style guides require
-or disallow spaces between computed properties in the following situations:
-
-```js
-/*eslint-env es6*/
-
-var obj = { prop: "value" };
-var a = "prop";
-var x = obj[a]; // computed property in object member expression
-
-var a = "prop";
-var obj = {
-  [a]: "value" // computed property key in object literal (ECMAScript 6)
-};
-```
-
-## Rule Details
-
-This rule enforces consistent spacing inside computed property brackets.
-
-It either requires or disallows spaces between the brackets and the values inside of them.
-This rule does not apply to brackets that are separated from the adjacent value by a newline.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"never"` (default) disallows spaces inside computed property brackets
-* `"always"` requires one or more spaces inside computed property brackets
-
-Object option:
-
-* `"enforceForClassMembers": true` (default) additionally applies this rule to class members.
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint computed-property-spacing: ["error", "never"]*/
-/*eslint-env es6*/
-
-obj[foo ]
-obj[ 'foo']
-var x = {[ b ]: a}
-obj[foo[ bar ]]
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint computed-property-spacing: ["error", "never"]*/
-/*eslint-env es6*/
-
-obj[foo]
-obj['foo']
-var x = {[b]: a}
-obj[foo[bar]]
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint computed-property-spacing: ["error", "always"]*/
-/*eslint-env es6*/
-
-obj[foo]
-var x = {[b]: a}
-obj[ foo]
-obj['foo' ]
-obj[foo[ bar ]]
-var x = {[ b]: a}
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint computed-property-spacing: ["error", "always"]*/
-/*eslint-env es6*/
-
-obj[ foo ]
-obj[ 'foo' ]
-var x = {[ b ]: a}
-obj[ foo[ bar ] ]
-```
-
-#### enforceForClassMembers
-
-With `enforceForClassMembers` set to `true` (default), the rule also disallows/enforces spaces inside of computed keys of class methods, getters and setters.
-
-Examples of **incorrect** code for this rule with `"never"` and `{ "enforceForClassMembers": true }` (default):
-
-```js
-/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": true }]*/
-/*eslint-env es6*/
-
-class Foo {
-  [a ]() {}
-  get [b ]() {}
-  set [b ](value) {}
-}
-
-const Bar = class {
-  [ a](){}
-  static [ b]() {}
-  static get [ c ]() {}
-  static set [ c ](value) {}
-}
-```
-
-Examples of **correct** code for this rule with `"never"` and `{ "enforceForClassMembers": true }` (default):
-
-```js
-/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": true }]*/
-/*eslint-env es6*/
-
-class Foo {
-  [a]() {}
-  get [b]() {}
-  set [b](value) {}
-}
-
-const Bar = class {
-  [a](){}
-  static [b]() {}
-  static get [c]() {}
-  static set [c](value) {}
-}
-```
-
-Examples of **correct** code for this rule with `"never"` and `{ "enforceForClassMembers": false }`:
-
-```js
-/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": false }]*/
-/*eslint-env es6*/
-
-class Foo {
-  [a ]() {}
-  get [b ]() {}
-  set [b ](value) {}
-}
-
-const Bar = class {
-  [ a](){}
-  static [ b]() {}
-  static get [ c ]() {}
-  static set [ c ](value) {}
-}
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of computed properties.
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [comma-spacing](comma-spacing.md)
-* [space-in-parens](space-in-parens.md)
diff --git a/eslint/docs/rules/consistent-return.md b/eslint/docs/rules/consistent-return.md
deleted file mode 100644 (file)
index bf4b470..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-# require `return` statements to either always or never specify values (consistent-return)
-
-Unlike statically-typed languages which enforce that a function returns a specified type of value, JavaScript allows different code paths in a function to return different types of values.
-
-A confusing aspect of JavaScript is that a function returns `undefined` if any of the following are true:
-
-* it does not execute a `return` statement before it exits
-* it executes `return` which does not specify a value explicitly
-* it executes `return undefined`
-* it executes `return void` followed by an expression (for example, a function call)
-* it executes `return` followed by any other expression which evaluates to `undefined`
-
-If any code paths in a function return a value explicitly but some code path do not return a value explicitly, it might be a typing mistake, especially in a large function. In the following example:
-
-* a code path through the function returns a Boolean value `true`
-* another code path does not return a value explicitly, therefore returns `undefined` implicitly
-
-```js
-function doSomething(condition) {
-    if (condition) {
-        return true;
-    } else {
-        return;
-    }
-}
-```
-
-## Rule Details
-
-This rule requires `return` statements to either always or never specify values. This rule ignores function definitions where the name begins with an uppercase letter, because constructors (when invoked with the `new` operator) return the instantiated object implicitly if they do not return another object explicitly.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint consistent-return: "error"*/
-
-function doSomething(condition) {
-    if (condition) {
-        return true;
-    } else {
-        return;
-    }
-}
-
-function doSomething(condition) {
-    if (condition) {
-        return true;
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint consistent-return: "error"*/
-
-function doSomething(condition) {
-    if (condition) {
-        return true;
-    } else {
-        return false;
-    }
-}
-
-function Foo() {
-    if (!(this instanceof Foo)) {
-        return new Foo();
-    }
-
-    this.a = 0;
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `"treatUndefinedAsUnspecified": false` (default) always either specify values or return `undefined` implicitly only.
-* `"treatUndefinedAsUnspecified": true` always either specify values or return `undefined` explicitly or implicitly.
-
-### treatUndefinedAsUnspecified
-
-Examples of **incorrect** code for this rule with the default `{ "treatUndefinedAsUnspecified": false }` option:
-
-```js
-/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": false }]*/
-
-function foo(callback) {
-    if (callback) {
-        return void callback();
-    }
-    // no return statement
-}
-
-function bar(condition) {
-    if (condition) {
-        return undefined;
-    }
-    // no return statement
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "treatUndefinedAsUnspecified": true }` option:
-
-```js
-/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
-
-function foo(callback) {
-    if (callback) {
-        return void callback();
-    }
-    return true;
-}
-
-function bar(condition) {
-    if (condition) {
-        return undefined;
-    }
-    return true;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "treatUndefinedAsUnspecified": true }` option:
-
-```js
-/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
-
-function foo(callback) {
-    if (callback) {
-        return void callback();
-    }
-    // no return statement
-}
-
-function bar(condition) {
-    if (condition) {
-        return undefined;
-    }
-    // no return statement
-}
-```
-
-## When Not To Use It
-
-If you want to allow functions to have different `return` behavior depending on code branching, then it is safe to disable this rule.
diff --git a/eslint/docs/rules/consistent-this.md b/eslint/docs/rules/consistent-this.md
deleted file mode 100644 (file)
index 3921232..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# Require Consistent This (consistent-this)
-
-It is often necessary to capture the current execution context in order to make it available subsequently. A prominent example of this are jQuery callbacks:
-
-```js
-var that = this;
-jQuery('li').click(function (event) {
-    // here, "this" is the HTMLElement where the click event occurred
-    that.setFoo(42);
-});
-```
-
-There are many commonly used aliases for `this` such as `that`, `self` or `me`. It is desirable to ensure that whichever alias the team agrees upon is used consistently throughout the application.
-
-## Rule Details
-
-This rule enforces two things about variables with the designated alias names for `this`:
-
-* If a variable with a designated name is declared, it *must* be either initialized (in the declaration) or assigned (in the same scope as the declaration) the value `this`.
-* If a variable is initialized or assigned the value `this`, the name of the variable *must* be a designated alias.
-
-## Options
-
-This rule has one or more string options:
-
-* designated alias names for `this` (default `"that"`)
-
-Examples of **incorrect** code for this rule with the default `"that"` option:
-
-```js
-/*eslint consistent-this: ["error", "that"]*/
-
-var that = 42;
-
-var self = this;
-
-that = 42;
-
-self = this;
-```
-
-Examples of **correct** code for this rule with the default `"that"` option:
-
-```js
-/*eslint consistent-this: ["error", "that"]*/
-
-var that = this;
-
-var self = 42;
-
-var self;
-
-that = this;
-
-foo.bar = this;
-```
-
-Examples of **incorrect** code for this rule with the default `"that"` option, if the variable is not initialized:
-
-```js
-/*eslint consistent-this: ["error", "that"]*/
-
-var that;
-function f() {
-    that = this;
-}
-```
-
-Examples of **correct** code for this rule with the default `"that"` option, if the variable is not initialized:
-
-```js
-/*eslint consistent-this: ["error", "that"]*/
-
-var that;
-that = this;
-
-var foo, that;
-foo = 42;
-that = this;
-```
-
-## When Not To Use It
-
-If you need to capture nested context, `consistent-this` is going to be problematic. Code of that nature is usually difficult to read and maintain and you should consider refactoring it.
diff --git a/eslint/docs/rules/constructor-super.md b/eslint/docs/rules/constructor-super.md
deleted file mode 100644 (file)
index bf43888..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-# Verify calls of `super()` in constructors (constructor-super)
-
-Constructors of derived classes must call `super()`.
-Constructors of non derived classes must not call `super()`.
-If this is not observed, the JavaScript engine will raise a runtime error.
-
-This rule checks whether or not there is a valid `super()` call.
-
-## Rule Details
-
-This rule is aimed to flag invalid/missing `super()` calls.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint constructor-super: "error"*/
-/*eslint-env es6*/
-
-class A {
-    constructor() {
-        super();  // This is a SyntaxError.
-    }
-}
-
-class A extends B {
-    constructor() { }  // Would throw a ReferenceError.
-}
-
-// Classes which inherits from a non constructor are always problems.
-class A extends null {
-    constructor() {
-        super();  // Would throw a TypeError.
-    }
-}
-
-class A extends null {
-    constructor() { }  // Would throw a ReferenceError.
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint constructor-super: "error"*/
-/*eslint-env es6*/
-
-class A {
-    constructor() { }
-}
-
-class A extends B {
-    constructor() {
-        super();
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about invalid/missing `super()` callings in constructors, you can safely disable this rule.
diff --git a/eslint/docs/rules/curly.md b/eslint/docs/rules/curly.md
deleted file mode 100644 (file)
index aecbca5..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-# Require Following Curly Brace Conventions (curly)
-
-JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to _never_ omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity. So the following:
-
-```js
-if (foo) foo++;
-```
-
-Can be rewritten as:
-
-```js
-if (foo) {
-    foo++;
-}
-```
-
-There are, however, some who prefer to only use braces when there is more than one statement to be executed.
-
-## Rule Details
-
-This rule is aimed at preventing bugs and increasing code clarity by ensuring that block statements are wrapped in curly braces. It will warn when it encounters blocks that omit curly braces.
-
-## Options
-
-### all
-
-Examples of **incorrect** code for the default `"all"` option:
-
-```js
-/*eslint curly: "error"*/
-
-if (foo) foo++;
-
-while (bar)
-    baz();
-
-if (foo) {
-    baz();
-} else qux();
-```
-
-Examples of **correct** code for the default `"all"` option:
-
-```js
-/*eslint curly: "error"*/
-
-if (foo) {
-    foo++;
-}
-
-while (bar) {
-    baz();
-}
-
-if (foo) {
-    baz();
-} else {
-    qux();
-}
-```
-
-### multi
-
-By default, this rule warns whenever `if`, `else`, `for`, `while`, or `do` are used without block statements as their body. However, you can specify that block statements should be used only when there are multiple statements in the block and warn when there is only one statement in the block.
-
-Examples of **incorrect** code for the `"multi"` option:
-
-```js
-/*eslint curly: ["error", "multi"]*/
-
-if (foo) {
-    foo++;
-}
-
-if (foo) bar();
-else {
-    foo++;
-}
-
-while (true) {
-    doSomething();
-}
-
-for (var i=0; i < items.length; i++) {
-    doSomething();
-}
-```
-
-Examples of **correct** code for the `"multi"` option:
-
-```js
-/*eslint curly: ["error", "multi"]*/
-
-if (foo) foo++;
-
-else foo();
-
-while (true) {
-    doSomething();
-    doSomethingElse();
-}
-```
-
-### multi-line
-
-Alternatively, you can relax the rule to allow brace-less single-line `if`, `else if`, `else`, `for`, `while`, or `do`, while still enforcing the use of curly braces for other instances.
-
-Examples of **incorrect** code for the `"multi-line"` option:
-
-```js
-/*eslint curly: ["error", "multi-line"]*/
-
-if (foo)
-  doSomething();
-else
-  doSomethingElse();
-
-if (foo) foo(
-  bar,
-  baz);
-```
-
-Examples of **correct** code for the `"multi-line"` option:
-
-```js
-/*eslint curly: ["error", "multi-line"]*/
-
-if (foo) foo++; else doSomething();
-
-if (foo) foo++;
-else if (bar) baz()
-else doSomething();
-
-do something();
-while (foo);
-
-while (foo
-  && bar) baz();
-
-if (foo) {
-    foo++;
-}
-
-if (foo) { foo++; }
-
-while (true) {
-    doSomething();
-    doSomethingElse();
-}
-```
-
-### multi-or-nest
-
-You can use another configuration that forces brace-less `if`, `else if`, `else`, `for`, `while`, or `do` if their body contains only one single-line statement. And forces braces in all other cases.
-
-Examples of **incorrect** code for the `"multi-or-nest"` option:
-
-```js
-/*eslint curly: ["error", "multi-or-nest"]*/
-
-if (!foo)
-    foo = {
-        bar: baz,
-        qux: foo
-    };
-
-while (true)
-  if(foo)
-      doSomething();
-  else
-      doSomethingElse();
-
-if (foo) {
-    foo++;
-}
-
-while (true) {
-    doSomething();
-}
-
-for (var i = 0; foo; i++) {
-    doSomething();
-}
-```
-
-Examples of **correct** code for the `"multi-or-nest"` option:
-
-```js
-/*eslint curly: ["error", "multi-or-nest"]*/
-
-if (!foo) {
-    foo = {
-        bar: baz,
-        qux: foo
-    };
-}
-
-while (true) {
-  if(foo)
-      doSomething();
-  else
-      doSomethingElse();
-}
-
-if (foo)
-    foo++;
-
-while (true)
-    doSomething();
-
-for (var i = 0; foo; i++)
-    doSomething();
-```
-
-For single-line statements preceded by a comment, braces are allowed but not required.
-
-Examples of additional **correct** code for the `"multi-or-nest"` option:
-
-```js
-/*eslint curly: ["error", "multi-or-nest"]*/
-
-if (foo)
-    // some comment
-    bar();
-
-if (foo) {
-    // some comment
-    bar();
-}
-```
-
-### consistent
-
-When using any of the `multi*` options, you can add an option to enforce all bodies of a `if`,
-`else if` and `else` chain to be with or without braces.
-
-Examples of **incorrect** code for the `"multi", "consistent"` options:
-
-```js
-/*eslint curly: ["error", "multi", "consistent"]*/
-
-if (foo) {
-    bar();
-    baz();
-} else
-    buz();
-
-if (foo)
-    bar();
-else if (faa)
-    bor();
-else {
-    other();
-    things();
-}
-
-if (true)
-    foo();
-else {
-    baz();
-}
-
-if (foo) {
-    foo++;
-}
-```
-
-Examples of **correct** code for the `"multi", "consistent"` options:
-
-```js
-/*eslint curly: ["error", "multi", "consistent"]*/
-
-if (foo) {
-    bar();
-    baz();
-} else {
-    buz();
-}
-
-if (foo) {
-    bar();
-} else if (faa) {
-    bor();
-} else {
-    other();
-    things();
-}
-
-if (true)
-    foo();
-else
-    baz();
-
-if (foo)
-    foo++;
-
-```
-
-## When Not To Use It
-
-If you have no strict conventions about when to use block statements and when not to, you can safely disable this rule.
diff --git a/eslint/docs/rules/default-case-last.md b/eslint/docs/rules/default-case-last.md
deleted file mode 100644 (file)
index c9eedbe..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-# Enforce default clauses in switch statements to be last (default-case-last)
-
-A `switch` statement can optionally have a `default` clause.
-
-If present, it's usually the last clause, but it doesn't need to be. It is also allowed to put the `default` clause before all `case` clauses, or anywhere between. The behavior is mostly the same as if it was the last clause. The `default` block will be still executed only if there is no match in the `case` clauses (including those defined after the `default`), but there is also the ability to "fall through" from the `default` clause to the following clause in the list. However, such flow is not common and it would be confusing to the readers.
-
-Even if there is no "fall through" logic, it's still unexpected to see the `default` clause before or between the `case` clauses. By convention, it is expected to be the last clause.
-
-If a `switch` statement should have a `default` clause, it's considered a best practice to define it as the last clause.
-
-## Rule Details
-
-This rule enforces `default` clauses in `switch` statements to be last.
-
-It applies only to `switch` statements that already have a `default` clause.
-
-This rule does not enforce the existence of `default` clauses. See [default-case](default-case.md) if you also want to enforce the existence of `default` clauses in `switch` statements.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint default-case-last: "error"*/
-
-switch (foo) {
-    default:
-        bar();
-        break;
-    case "a":
-        baz();
-        break;
-}
-
-switch (foo) {
-    case 1:
-        bar();
-        break;
-    default:
-        baz();
-        break;
-    case 2:
-        quux();
-        break;
-}
-
-switch (foo) {
-    case "x":
-        bar();
-        break;
-    default:
-    case "y":
-        baz();
-        break;
-}
-
-switch (foo) {
-    default:
-        break;
-    case -1:
-        bar();
-        break;
-}
-
-switch (foo) {
-  default:
-    doSomethingIfNotZero();
-  case 0:
-    doSomethingAnyway();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint default-case-last: "error"*/
-
-switch (foo) {
-    case "a":
-        baz();
-        break;
-    default:
-        bar();
-        break;
-}
-
-switch (foo) {
-    case 1:
-        bar();
-        break;
-    case 2:
-        quux();
-        break;
-    default:
-        baz();
-        break;
-}
-
-switch (foo) {
-    case "x":
-        bar();
-        break;
-    case "y":
-    default:
-        baz();
-        break;
-}
-
-switch (foo) {
-    case -1:
-        bar();
-        break;
-}
-
-if (foo !== 0) {
-    doSomethingIfNotZero();
-}
-doSomethingAnyway();
-```
-
-## Further Reading
-
-* [MDN switch statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch)
-
-## Related Rules
-
-* [default-case](default-case.md)
diff --git a/eslint/docs/rules/default-case.md b/eslint/docs/rules/default-case.md
deleted file mode 100644 (file)
index ba13407..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# Require Default Case in Switch Statements (default-case)
-
-Some code conventions require that all `switch` statements have a `default` case, even if the default case is empty, such as:
-
-```js
-switch (foo) {
-    case 1:
-        doSomething();
-        break;
-
-    case 2:
-        doSomething();
-        break;
-
-    default:
-        // do nothing
-}
-```
-
-The thinking is that it's better to always explicitly state what the default behavior should be so that it's clear whether or not the developer forgot to include the default behavior by mistake.
-
-Other code conventions allow you to skip the `default` case so long as there is a comment indicating the omission is intentional, such as:
-
-```js
-switch (foo) {
-    case 1:
-        doSomething();
-        break;
-
-    case 2:
-        doSomething();
-        break;
-
-    // no default
-}
-```
-
-Once again, the intent here is to show that the developer intended for there to be no default behavior.
-
-## Rule Details
-
-This rule aims to require `default` case in `switch` statements. You may optionally include a `// no default` after the last `case` if there is no `default` case. The comment may be in any desired case, such as `// No Default`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint default-case: "error"*/
-
-switch (a) {
-    case 1:
-        /* code */
-        break;
-}
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint default-case: "error"*/
-
-switch (a) {
-    case 1:
-        /* code */
-        break;
-
-    default:
-        /* code */
-        break;
-}
-
-
-switch (a) {
-    case 1:
-        /* code */
-        break;
-
-    // no default
-}
-
-switch (a) {
-    case 1:
-        /* code */
-        break;
-
-    // No Default
-}
-```
-
-## Options
-
-This rule accepts a single options argument:
-
-* Set the `commentPattern` option to a regular expression string to change the default `/^no default$/i` comment test pattern
-
-### commentPattern
-
-Examples of **correct** code for the `{ "commentPattern": "^skip\\sdefault" }` option:
-
-```js
-/*eslint default-case: ["error", { "commentPattern": "^skip\\sdefault" }]*/
-
-switch(a) {
-    case 1:
-        /* code */
-        break;
-
-    // skip default
-}
-
-switch(a) {
-    case 1:
-        /* code */
-        break;
-
-    // skip default case
-}
-```
-
-## When Not To Use It
-
-If you don't want to enforce a `default` case for `switch` statements, you can safely disable this rule.
-
-## Related Rules
-
-* [no-fallthrough](no-fallthrough.md)
diff --git a/eslint/docs/rules/default-param-last.md b/eslint/docs/rules/default-param-last.md
deleted file mode 100644 (file)
index 97bba70..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# enforce default parameters to be last (default-param-last)
-
-Putting default parameter at last allows function calls to omit optional tail arguments.
-
-```js
-// Correct: optional argument can be omitted
-function createUser(id, isAdmin = false) {}
-createUser("tabby")
-
-// Incorrect: optional argument can **not** be omitted
-function createUser(isAdmin = false, id) {}
-createUser(undefined, "tabby")
-```
-
-## Rule Details
-
-This rule enforces default parameters to be the last of parameters.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint default-param-last: ["error"] */
-
-function f(a = 0, b) {}
-
-function f(a, b = 0, c) {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint default-param-last: ["error"] */
-
-function f(a, b = 0) {}
-```
diff --git a/eslint/docs/rules/dot-location.md b/eslint/docs/rules/dot-location.md
deleted file mode 100644 (file)
index 82f0d94..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# Enforce newline before and after dot (dot-location)
-
-JavaScript allows you to place newlines before or after a dot in a member expression.
-
-Consistency in placing a newline before or after the dot can greatly increase readability.
-
-```js
-var a = universe.
-        galaxy;
-
-var b = universe
-       .galaxy;
-```
-
-## Rule Details
-
-This rule aims to enforce newline consistency in member expressions. This rule prevents the use of mixed newlines around the dot in a member expression.
-
-## Options
-
-The rule takes one option, a string:
-
-* If it is `"object"` (default), the dot in a member expression should be on the same line as the object portion.
-* If it is `"property"`, the dot in a member expression should be on the same line as the property portion.
-
-### object
-
-The default `"object"` option requires the dot to be on the same line as the object.
-
-Examples of **incorrect** code for the default `"object"` option:
-
-```js
-/*eslint dot-location: ["error", "object"]*/
-
-var foo = object
-.property;
-```
-
-Examples of **correct** code for the default `"object"` option:
-
-```js
-/*eslint dot-location: ["error", "object"]*/
-
-var foo = object.
-property;
-
-var bar = (
-    object
-).
-property;
-
-var baz = object.property;
-```
-
-### property
-
-The `"property"` option requires the dot to be on the same line as the property.
-
-Examples of **incorrect** code for the `"property"` option:
-
-```js
-/*eslint dot-location: ["error", "property"]*/
-
-var foo = object.
-property;
-```
-
-Examples of **correct** code for the `"property"` option:
-
-```js
-/*eslint dot-location: ["error", "property"]*/
-
-var foo = object
-.property;
-var bar = object.property;
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of newlines before or after dots in member expressions.
-
-## Related Rules
-
-* [newline-after-var](newline-after-var.md)
-* [dot-notation](dot-notation.md)
diff --git a/eslint/docs/rules/dot-notation.md b/eslint/docs/rules/dot-notation.md
deleted file mode 100644 (file)
index 26c7775..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-# Require Dot Notation (dot-notation)
-
-In JavaScript, one can access properties using the dot notation (`foo.bar`) or square-bracket notation (`foo["bar"]`). However, the dot notation is often preferred because it is easier to read, less verbose, and works better with aggressive JavaScript minimizers.
-
-```js
-foo["bar"];
-```
-
-## Rule Details
-
-This rule is aimed at maintaining code consistency and improving code readability by encouraging use of the dot notation style whenever possible. As such, it will warn when it encounters an unnecessary use of square-bracket notation.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint dot-notation: "error"*/
-
-var x = foo["bar"];
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint dot-notation: "error"*/
-
-var x = foo.bar;
-
-var x = foo[bar];    // Property name is a variable, square-bracket notation required
-```
-
-## Options
-
-This rule accepts a single options argument:
-
-* Set the `allowKeywords` option to `false` (default is `true`) to follow ECMAScript version 3 compatible style, avoiding dot notation for reserved word properties.
-* Set the `allowPattern` option to a regular expression string to allow bracket notation for property names that match a pattern (by default, no pattern is tested).
-
-### allowKeywords
-
-Examples of **correct** code for the `{ "allowKeywords": false }` option:
-
-```js
-/*eslint dot-notation: ["error", { "allowKeywords": false }]*/
-
-var foo = { "class": "CS 101" }
-var x = foo["class"]; // Property name is a reserved word, square-bracket notation required
-```
-
-Examples of additional **correct** code for the `{ "allowKeywords": false }` option:
-
-```js
-/*eslint dot-notation: ["error", { "allowKeywords": false }]*/
-
-class C {
-    #in;
-    foo() {
-        this.#in; // Dot notation is required for private identifiers
-    }
-}
-```
-
-### allowPattern
-
-For example, when preparing data to be sent to an external API, it is often required to use property names that include underscores.  If the `camelcase` rule is in effect, these [snake case](https://en.wikipedia.org/wiki/Snake_case) properties would not be allowed.  By providing an `allowPattern` to the `dot-notation` rule, these snake case properties can be accessed with bracket notation.
-
-Examples of **correct** code for the sample `{ "allowPattern": "^[a-z]+(_[a-z]+)+$" }` option:
-
-```js
-/*eslint camelcase: "error"*/
-/*eslint dot-notation: ["error", { "allowPattern": "^[a-z]+(_[a-z]+)+$" }]*/
-
-var data = {};
-data.foo_bar = 42;
-
-var data = {};
-data["fooBar"] = 42;
-
-var data = {};
-data["foo_bar"] = 42; // no warning
-```
diff --git a/eslint/docs/rules/eol-last.md b/eslint/docs/rules/eol-last.md
deleted file mode 100644 (file)
index ce6203b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# require or disallow newline at the end of files (eol-last)
-
-Trailing newlines in non-empty files are a common UNIX idiom. Benefits of
-trailing newlines include the ability to concatenate or append to files as well
-as output files to the terminal without interfering with shell prompts.
-
-## Rule Details
-
-This rule enforces at least one newline (or absence thereof) at the end
-of non-empty files.
-
-Prior to v0.16.0 this rule also enforced that there was only a single line at
-the end of the file. If you still want this behavior, consider enabling
-[no-multiple-empty-lines](no-multiple-empty-lines.md) with `maxEOF` and/or
-[no-trailing-spaces](no-trailing-spaces.md).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint eol-last: ["error", "always"]*/
-
-function doSmth() {
-  var foo = 2;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint eol-last: ["error", "always"]*/
-
-function doSmth() {
-  var foo = 2;
-}\n
-```
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) enforces that files end with a newline (LF)
-* `"never"` enforces that files do not end with a newline
-* `"unix"` (deprecated) is identical to "always"
-* `"windows"` (deprecated) is identical to "always", but will use a CRLF character when autofixing
-
-**Deprecated:** The options `"unix"` and `"windows"` are deprecated. If you need to enforce a specific linebreak style, use this rule in conjunction with `linebreak-style`.
diff --git a/eslint/docs/rules/eqeqeq.md b/eslint/docs/rules/eqeqeq.md
deleted file mode 100644 (file)
index 4849f99..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-# Require === and !== (eqeqeq)
-
-It is considered good practice to use the type-safe equality operators `===` and `!==` instead of their regular counterparts `==` and `!=`.
-
-The reason for this is that `==` and `!=` do type coercion which follows the rather obscure [Abstract Equality Comparison Algorithm](https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3).
-For instance, the following statements are all considered `true`:
-
-* `[] == false`
-* `[] == ![]`
-* `3 == "03"`
-
-If one of those occurs in an innocent-looking statement such as `a == b` the actual problem is very difficult to spot.
-
-## Rule Details
-
-This rule is aimed at eliminating the type-unsafe equality operators.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint eqeqeq: "error"*/
-
-if (x == 42) { }
-
-if ("" == text) { }
-
-if (obj.getStuff() != undefined) { }
-```
-
-The `--fix` option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a `typeof` expression, or if both operands are literals with the same type.
-
-## Options
-
-### always
-
-The `"always"` option (default) enforces the use of `===` and `!==` in every situation (except when you opt-in to more specific handling of `null` [see below]).
-
-Examples of **incorrect** code for the `"always"` option:
-
-```js
-/*eslint eqeqeq: ["error", "always"]*/
-
-a == b
-foo == true
-bananas != 1
-value == undefined
-typeof foo == 'undefined'
-'hello' != 'world'
-0 == 0
-true == true
-foo == null
-
-```
-
-Examples of **correct** code for the `"always"` option:
-
-```js
-/*eslint eqeqeq: ["error", "always"]*/
-
-a === b
-foo === true
-bananas !== 1
-value === undefined
-typeof foo === 'undefined'
-'hello' !== 'world'
-0 === 0
-true === true
-foo === null
-
-```
-
-This rule optionally takes a second argument, which should be an object with the following supported properties:
-
-* `"null"`: Customize how this rule treats `null` literals. Possible values:
-    * `always` (default) - Always use === or !==.
-    * `never` - Never use === or !== with `null`.
-    * `ignore` - Do not apply this rule to `null`.
-
-### smart
-
-The `"smart"` option enforces the use of `===` and `!==` except for these cases:
-
-* Comparing two literal values
-* Evaluating the value of `typeof`
-* Comparing against `null`
-
-Examples of **incorrect** code for the `"smart"` option:
-
-```js
-/*eslint eqeqeq: ["error", "smart"]*/
-
-// comparing two variables requires ===
-a == b
-
-// only one side is a literal
-foo == true
-bananas != 1
-
-// comparing to undefined requires ===
-value == undefined
-```
-
-Examples of **correct** code for the `"smart"` option:
-
-```js
-/*eslint eqeqeq: ["error", "smart"]*/
-
-typeof foo == 'undefined'
-'hello' != 'world'
-0 == 0
-true == true
-foo == null
-```
-
-### allow-null
-
-**Deprecated:** Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell ESLint to always enforce strict equality except when comparing with the `null` literal.
-
-```js
-["error", "always", {"null": "ignore"}]
-```
-
-## When Not To Use It
-
-If you don't want to enforce a style for using equality operators, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/for-direction.md b/eslint/docs/rules/for-direction.md
deleted file mode 100644 (file)
index be24f7f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Enforce "for" loop update clause moving the counter in the right direction. (for-direction)
-
-## Rule Details
-
-A `for` loop with a stop condition that can never be reached, such as one with a counter that moves in the wrong direction, will run infinitely. While there are occasions when an infinite loop is intended, the convention is to construct such loops as `while` loops. More typically, an infinite for loop is a bug.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint for-direction: "error"*/
-for (var i = 0; i < 10; i--) {
-}
-
-for (var i = 10; i >= 0; i++) {
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint for-direction: "error"*/
-for (var i = 0; i < 10; i++) {
-}
-```
diff --git a/eslint/docs/rules/func-call-spacing.md b/eslint/docs/rules/func-call-spacing.md
deleted file mode 100644 (file)
index 0982915..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-# require or disallow spacing between function identifiers and their invocations (func-call-spacing)
-
-When calling a function, developers may insert optional whitespace between the function's name and the parentheses that invoke it. The following pairs of function calls are equivalent:
-
-```js
-alert('Hello');
-alert ('Hello');
-
-console.log(42);
-console.log (42);
-
-new Date();
-new Date ();
-```
-
-## Rule Details
-
-This rule requires or disallows spaces between the function name and the opening parenthesis that calls it.
-
-## options
-
-This rule has a string option:
-
-- `"never"` (default) disallows space between the function name and the opening parenthesis.
-- `"always"` requires space between the function name and the opening parenthesis.
-
-Further, in `"always"` mode, a second object option is available that contains a single boolean `allowNewlines` property.
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint func-call-spacing: ["error", "never"]*/
-
-fn ();
-
-fn
-();
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint func-call-spacing: ["error", "never"]*/
-
-fn();
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint func-call-spacing: ["error", "always"]*/
-
-fn();
-
-fn
-();
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint func-call-spacing: ["error", "always"]*/
-
-fn ();
-```
-
-#### allowNewlines
-
-By default, `"always"` does not allow newlines. To permit newlines when in `"always"` mode, set the `allowNewlines` option to `true`. Newlines are never required.
-
-Examples of **incorrect** code for this rule with `allowNewlines` option enabled:
-
-```js
-/*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
-
-fn();
-```
-
-Examples of **correct** code for this rule with the `allowNewlines` option enabled:
-
-```js
-/*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
-
-fn (); // Newlines are never required.
-
-fn
-();
-```
-
-## When Not To Use It
-
-This rule can safely be turned off if your project does not care about enforcing a consistent style for spacing within function calls.
-
-## Related Rules
-
-- [no-spaced-func](no-spaced-func.md) (deprecated)
-
-## Compatibility
-
-- **JSCS**: [disallowSpacesInCallExpression](https://jscs-dev.github.io/rule/disallowSpacesInCallExpression)
-- **JSCS**: [requireSpacesInCallExpression](https://jscs-dev.github.io/rule/requireSpacesInCallExpression)
diff --git a/eslint/docs/rules/func-name-matching.md b/eslint/docs/rules/func-name-matching.md
deleted file mode 100644 (file)
index 39ee411..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-# require function names to match the name of the variable or property to which they are assigned (func-name-matching)
-
-## Rule Details
-
-This rule requires function names to match the name of the variable or property to which they are assigned. The rule will ignore property assignments where the property name is a literal that is not a valid identifier in the ECMAScript version specified in your configuration (default ES5).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint func-name-matching: "error"*/
-
-var foo = function bar() {};
-foo = function bar() {};
-obj.foo = function bar() {};
-obj['foo'] = function bar() {};
-var obj = {foo: function bar() {}};
-({['foo']: function bar() {}});
-
-class C {
-    foo = function bar() {};
-}
-```
-
-```js
-/*eslint func-name-matching: ["error", "never"] */
-
-var foo = function foo() {};
-foo = function foo() {};
-obj.foo = function foo() {};
-obj['foo'] = function foo() {};
-var obj = {foo: function foo() {}};
-({['foo']: function foo() {}});
-
-class C {
-    foo = function foo() {};
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint func-name-matching: "error"*/
-/*eslint func-name-matching: ["error", "always"]*/ // these are equivalent
-/*eslint-env es6*/
-
-var foo = function foo() {};
-var foo = function() {};
-var foo = () => {};
-foo = function foo() {};
-
-obj.foo = function foo() {};
-obj['foo'] = function foo() {};
-obj['foo//bar'] = function foo() {};
-obj[foo] = function bar() {};
-
-var obj = {foo: function foo() {}};
-var obj = {[foo]: function bar() {}};
-var obj = {'foo//bar': function foo() {}};
-var obj = {foo: function() {}};
-
-obj['x' + 2] = function bar(){};
-var [ bar ] = [ function bar(){} ];
-({[foo]: function bar() {}})
-
-class C {
-    foo = function foo() {};
-    baz = function() {};
-}
-
-// private names are ignored
-class D {
-    #foo = function foo() {};
-    #bar = function foo() {};
-    baz() {
-        this.#foo = function foo() {};
-        this.#foo = function bar() {};
-    }
-}
-
-module.exports = function foo(name) {};
-module['exports'] = function foo(name) {};
-```
-
-```js
-/*eslint func-name-matching: ["error", "never"] */
-/*eslint-env es6*/
-
-var foo = function bar() {};
-var foo = function() {};
-var foo = () => {};
-foo = function bar() {};
-
-obj.foo = function bar() {};
-obj['foo'] = function bar() {};
-obj['foo//bar'] = function foo() {};
-obj[foo] = function foo() {};
-
-var obj = {foo: function bar() {}};
-var obj = {[foo]: function foo() {}};
-var obj = {'foo//bar': function foo() {}};
-var obj = {foo: function() {}};
-
-obj['x' + 2] = function bar(){};
-var [ bar ] = [ function bar(){} ];
-({[foo]: function bar() {}})
-
-class C {
-    foo = function bar() {};
-    baz = function() {};
-}
-
-// private names are ignored
-class D {
-    #foo = function foo() {};
-    #bar = function foo() {};
-    baz() {
-        this.#foo = function foo() {};
-        this.#foo = function bar() {};
-    }
-}
-
-module.exports = function foo(name) {};
-module['exports'] = function foo(name) {};
-```
-
-## Options
-
-This rule takes an optional string of "always" or "never" (when omitted, it defaults to "always"), and an optional options object with two properties `considerPropertyDescriptor` and `includeCommonJSModuleExports`.
-
-### considerPropertyDescriptor
-
-A boolean value that defaults to `false`. If `considerPropertyDescriptor` is set to true, the check will take into account the use of `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty`.
-
-Examples of **correct** code for the `{ considerPropertyDescriptor: true }` option:
-
-```js
-/*eslint func-name-matching: ["error", { "considerPropertyDescriptor": true }]*/
-/*eslint func-name-matching: ["error", "always", { "considerPropertyDescriptor": true }]*/ // these are equivalent
-var obj = {};
-Object.create(obj, {foo:{value: function foo() {}}});
-Object.defineProperty(obj, 'bar', {value: function bar() {}});
-Object.defineProperties(obj, {baz:{value: function baz() {} }});
-Reflect.defineProperty(obj, 'foo', {value: function foo() {}});
-```
-
-Examples of **incorrect** code for the `{ considerPropertyDescriptor: true }` option:
-
-```js
-/*eslint func-name-matching: ["error", { "considerPropertyDescriptor": true }]*/
-/*eslint func-name-matching: ["error", "always", { "considerPropertyDescriptor": true }]*/ // these are equivalent
-var obj = {};
-Object.create(obj, {foo:{value: function bar() {}}});
-Object.defineProperty(obj, 'bar', {value: function baz() {}});
-Object.defineProperties(obj, {baz:{value: function foo() {} }});
-Reflect.defineProperty(obj, 'foo', {value: function value() {}});
-```
-
-### includeCommonJSModuleExports
-
-A boolean value that defaults to `false`. If `includeCommonJSModuleExports` is set to true, `module.exports` and `module["exports"]` will be checked by this rule.
-
-Examples of **incorrect** code for the `{ includeCommonJSModuleExports: true }` option:
-
-```js
-/*eslint func-name-matching: ["error", { "includeCommonJSModuleExports": true }]*/
-/*eslint func-name-matching: ["error", "always", { "includeCommonJSModuleExports": true }]*/ // these are equivalent
-
-module.exports = function foo(name) {};
-module['exports'] = function foo(name) {};
-```
-
-## When Not To Use It
-
-Do not use this rule if you want to allow named functions to have different names from the variable or property to which they are assigned.
-
-## Compatibility
-
-* **JSCS**: [requireMatchingFunctionName](https://jscs-dev.github.io/rule/requireMatchingFunctionName)
diff --git a/eslint/docs/rules/func-names.md b/eslint/docs/rules/func-names.md
deleted file mode 100644 (file)
index ea1ba61..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-# Require or disallow named `function` expressions (func-names)
-
-A pattern that's becoming more common is to give function expressions names to aid in debugging. For example:
-
-```js
-Foo.prototype.bar = function bar() {};
-```
-
-Adding the second `bar` in the above example is optional.  If you leave off the function name then when the function throws an exception you are likely to get something similar to `anonymous function` in the stack trace.  If you provide the optional name for a function expression then you will get the name of the function expression in the stack trace.
-
-## Rule Details
-
-This rule can enforce or disallow the use of named function expressions.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) requires function expressions to have a name
-* `"as-needed"` requires function expressions to have a name, if the name isn't assigned automatically per the ECMAScript specification.
-* `"never"` disallows named function expressions, except in recursive functions, where a name is needed
-
-This rule has an object option:
-
-* `"generators": "always" | "as-needed" | "never"`
-    * `"always"` require named generators
-    * `"as-needed"` require named generators if the name isn't assigned automatically per the ECMAScript specification.
-    * `"never"` disallow named generators where possible.
-
-When a value for `generators` is not provided the behavior for generator functions falls back to the base option.
-
-Please note that `"always"` and `"as-needed"` require function expressions and function declarations in `export default` declarations to have a name.
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint func-names: ["error", "always"]*/
-
-Foo.prototype.bar = function() {};
-
-const cat = {
-  meow: function() {}
-}
-
-(function() {
-    // ...
-}())
-
-export default function() {}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint func-names: ["error", "always"]*/
-
-Foo.prototype.bar = function bar() {};
-
-const cat = {
-  meow() {}
-}
-
-(function bar() {
-    // ...
-}())
-
-export default function foo() {}
-```
-
-### as-needed
-
-ECMAScript 6 introduced a `name` property on all functions. The value of `name` is determined by evaluating the code around the function to see if a name can be inferred. For example, a function assigned to a variable will automatically have a `name` property equal to the name of the variable. The value of `name` is then used in stack traces for easier debugging.
-
-Examples of **incorrect** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint func-names: ["error", "as-needed"]*/
-
-Foo.prototype.bar = function() {};
-
-(function() {
-    // ...
-}())
-
-export default function() {}
-```
-
-Examples of **correct** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint func-names: ["error", "as-needed"]*/
-
-var bar = function() {};
-
-const cat = {
-  meow: function() {}
-}
-
-class C {
-    #bar = function() {};
-    baz = function() {};
-}
-
-quux ??= function() {};
-
-(function bar() {
-    // ...
-}())
-
-export default function foo() {}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint func-names: ["error", "never"]*/
-
-Foo.prototype.bar = function bar() {};
-
-(function bar() {
-    // ...
-}())
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint func-names: ["error", "never"]*/
-
-Foo.prototype.bar = function() {};
-
-(function() {
-    // ...
-}())
-```
-
-### generators
-
-Examples of **incorrect** code for this rule with the `"always", { "generators": "as-needed" }` options:
-
-```js
-/*eslint func-names: ["error", "always", { "generators": "as-needed" }]*/
-
-(function*() {
-    // ...
-}())
-```
-
-Examples of **correct** code for this rule with the `"always", { "generators": "as-needed" }` options:
-
-```js
-/*eslint func-names: ["error", "always", { "generators": "as-needed" }]*/
-
-var foo = function*() {};
-```
-
-Examples of **incorrect** code for this rule with the `"always", { "generators": "never" }` options:
-
-```js
-/*eslint func-names: ["error", "always", { "generators": "never" }]*/
-
-var foo = bar(function *baz() {});
-```
-
-Examples of **correct** code for this rule with the `"always", { "generators": "never" }` options:
-
-```js
-/*eslint func-names: ["error", "always", { "generators": "never" }]*/
-
-var foo = bar(function *() {});
-```
-
-Examples of **incorrect** code for this rule with the `"as-needed", { "generators": "never" }` options:
-
-```js
-/*eslint func-names: ["error", "as-needed", { "generators": "never" }]*/
-
-var foo = bar(function *baz() {});
-```
-
-Examples of **correct** code for this rule with the `"as-needed", { "generators": "never" }` options:
-
-```js
-/*eslint func-names: ["error", "as-needed", { "generators": "never" }]*/
-
-var foo = bar(function *() {});
-```
-
-Examples of **incorrect** code for this rule with the `"never", { "generators": "always" }` options:
-
-```js
-/*eslint func-names: ["error", "never", { "generators": "always" }]*/
-
-var foo = bar(function *() {});
-```
-
-Examples of **correct** code for this rule with the `"never", { "generators": "always" }` options:
-
-```js
-/*eslint func-names: ["error", "never", { "generators": "always" }]*/
-
-var foo = bar(function *baz() {});
-```
-
-## Further Reading
-
-* [Functions Explained](http://markdaggett.com/blog/2013/02/15/functions-explained/)
-* [Function Names in ES6](http://2ality.com/2015/09/function-names-es6.html)
-
-## Compatibility
-
-* **JSCS**: [requireAnonymousFunctions](https://jscs-dev.github.io/rule/requireAnonymousFunctions)
-* **JSCS**: [disallowAnonymousFunctions](https://jscs-dev.github.io/rule/disallowAnonymousFunctions)
diff --git a/eslint/docs/rules/func-style.md b/eslint/docs/rules/func-style.md
deleted file mode 100644 (file)
index c197403..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-# enforce the consistent use of either `function` declarations or expressions (func-style)
-
-There are two ways of defining functions in JavaScript: `function` declarations and `function` expressions. Declarations contain the `function` keyword first, followed by a name and then its arguments and the function body, for example:
-
-```js
-function doSomething() {
-    // ...
-}
-```
-
-Equivalent function expressions begin with the `var` keyword, followed by a name and then the function itself, such as:
-
-```js
-var doSomething = function() {
-    // ...
-};
-```
-
-The primary difference between `function` declarations and `function expressions` is that declarations are *hoisted* to the top of the scope in which they are defined, which allows you to write code that uses the function before its declaration. For example:
-
-```js
-doSomething();
-
-function doSomething() {
-    // ...
-}
-```
-
-Although this code might seem like an error, it actually works fine because JavaScript engines hoist the `function` declarations to the top of the scope. That means this code is treated as if the declaration came before the invocation.
-
-For `function` expressions, you must define the function before it is used, otherwise it causes an error. Example:
-
-```js
-doSomething();  // error!
-
-var doSomething = function() {
-    // ...
-};
-```
-
-In this case, `doSomething()` is undefined at the time of invocation and so causes a runtime error.
-
-Due to these different behaviors, it is common to have guidelines as to which style of function should be used. There is really no correct or incorrect choice here, it is just a preference.
-
-## Rule Details
-
-This rule enforces a particular type of `function` style throughout a JavaScript file, either declarations or expressions. You can specify which you prefer in the configuration.
-
-## Options
-
-This rule has a string option:
-
-* `"expression"` (default) requires the use of function expressions instead of function declarations
-* `"declaration"` requires the use of function declarations instead of function expressions
-
-This rule has an object option for an exception:
-
-* `"allowArrowFunctions"`: `true` (default `false`) allows the use of arrow functions. This option applies only when the string option is set to `"declaration"` (arrow functions are always allowed when the string option is set to `"expression"`, regardless of this option)
-
-### expression
-
-Examples of **incorrect** code for this rule with the default `"expression"` option:
-
-```js
-/*eslint func-style: ["error", "expression"]*/
-
-function foo() {
-    // ...
-}
-```
-
-Examples of **correct** code for this rule with the default `"expression"` option:
-
-```js
-/*eslint func-style: ["error", "expression"]*/
-
-var foo = function() {
-    // ...
-};
-
-var foo = () => {};
-
-// allowed as allowArrowFunctions : false is applied only for declaration
-```
-
-### declaration
-
-Examples of **incorrect** code for this rule with the `"declaration"` option:
-
-```js
-/*eslint func-style: ["error", "declaration"]*/
-
-var foo = function() {
-    // ...
-};
-
-var foo = () => {};
-```
-
-Examples of **correct** code for this rule with the `"declaration"` option:
-
-```js
-/*eslint func-style: ["error", "declaration"]*/
-
-function foo() {
-    // ...
-}
-
-// Methods (functions assigned to objects) are not checked by this rule
-SomeObject.foo = function() {
-    // ...
-};
-```
-
-### allowArrowFunctions
-
-Examples of additional **correct** code for this rule with the `"declaration", { "allowArrowFunctions": true }` options:
-
-```js
-/*eslint func-style: ["error", "declaration", { "allowArrowFunctions": true }]*/
-
-var foo = () => {};
-```
-
-## When Not To Use It
-
-If you want to allow developers to each decide how they want to write functions on their own, then you can disable this rule.
-
-## Further Reading
-
-* [JavaScript Scoping and Hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html)
diff --git a/eslint/docs/rules/function-call-argument-newline.md b/eslint/docs/rules/function-call-argument-newline.md
deleted file mode 100644 (file)
index abe0d49..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-# enforce line breaks between arguments of a function call (function-call-argument-newline)
-
-A number of style guides require or disallow line breaks between arguments of a function call.
-
-## Rule Details
-
-This rule enforces line breaks between arguments of a function call.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) requires line breaks between arguments
-* `"never"` disallows line breaks between arguments
-* `"consistent"` requires consistent usage of line breaks between arguments
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "always"]*/
-
-foo("one", "two", "three");
-
-bar("one", "two", {
-    one: 1,
-    two: 2
-});
-
-baz("one", "two", (x) => {
-    console.log(x);
-});
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "always"]*/
-
-foo(
-    "one",
-    "two",
-    "three"
-);
-
-bar(
-    "one",
-    "two",
-    { one: 1, two: 2 }
-);
-// or
-bar(
-    "one",
-    "two",
-    {
-        one: 1,
-        two: 2
-    }
-);
-
-baz(
-    "one",
-    "two",
-    (x) => {
-        console.log(x);
-    }
-);
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "never"]*/
-
-foo(
-    "one",
-    "two", "three"
-);
-
-bar(
-    "one",
-    "two", {
-        one: 1,
-        two: 2
-    }
-);
-
-baz(
-    "one",
-    "two", (x) => {
-        console.log(x);
-    }
-);
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "never"]*/
-
-foo("one", "two", "three");
-// or
-foo(
-    "one", "two", "three"
-);
-
-bar("one", "two", { one: 1, two: 2 });
-// or
-bar("one", "two", {
-    one: 1,
-    two: 2
-});
-
-baz("one", "two", (x) => {
-    console.log(x);
-});
-```
-
-### consistent
-
-Examples of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "consistent"]*/
-
-foo("one", "two",
-    "three");
-//or
-foo("one",
-    "two", "three");
-
-bar("one", "two",
-    { one: 1, two: 2}
-);
-
-baz("one", "two",
-    (x) => { console.log(x); }
-);
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint function-call-argument-newline: ["error", "consistent"]*/
-
-foo("one", "two", "three");
-// or
-foo(
-    "one",
-    "two",
-    "three"
-);
-
-bar("one", "two", {
-    one: 1,
-    two: 2
-});
-// or
-bar(
-    "one",
-    "two",
-    { one: 1, two: 2 }
-);
-// or
-bar(
-    "one",
-    "two",
-    {
-        one: 1,
-        two: 2
-    }
-);
-
-baz("one", "two", (x) => {
-    console.log(x);
-});
-// or
-baz(
-    "one",
-    "two",
-    (x) => {
-        console.log(x);
-    }
-);
-```
-
-## When Not To Use It
-
-If you don't want to enforce line breaks between arguments, don't enable this rule.
-
-## Related Rules
-
-* [function-paren-newline](function-paren-newline.md)
-* [func-call-spacing](func-call-spacing.md)
-* [object-property-newline](object-property-newline.md)
-* [array-element-newline](array-element-newline.md)
diff --git a/eslint/docs/rules/function-paren-newline.md b/eslint/docs/rules/function-paren-newline.md
deleted file mode 100644 (file)
index ab86680..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-# enforce consistent line breaks inside function parentheses (function-paren-newline)
-
-Many style guides require or disallow newlines inside of function parentheses.
-
-## Rule Details
-
-This rule enforces consistent line breaks inside parentheses of function parameters or arguments.
-
-### Options
-
-This rule has a single option, which can either be a string or an object.
-
-* `"always"` requires line breaks inside all function parentheses.
-* `"never"` disallows line breaks inside all function parentheses.
-* `"multiline"` (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
-* `"multiline-arguments"` works like `multiline` but allows linebreaks inside function parentheses if there is only one parameter/argument.
-* `"consistent"` requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
-* `{ "minItems": value }` requires linebreaks inside function parentheses if the number of parameters/arguments is at least `value`. Otherwise, it disallows linebreaks.
-
-Example configurations:
-
-```json
-{
-  "rules": {
-    "function-paren-newline": ["error", "never"]
-  }
-}
-```
-
-```json
-{
-  "rules": {
-    "function-paren-newline": ["error", { "minItems": 3 }]
-  }
-}
-```
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "always"] */
-
-function foo(bar, baz) {}
-
-var foo = function(bar, baz) {};
-
-var foo = (bar, baz) => {};
-
-foo(bar, baz);
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "always"] */
-
-function foo(
-  bar,
-  baz
-) {}
-
-var foo = function(
-  bar, baz
-) {};
-
-var foo = (
-  bar,
-  baz
-) => {};
-
-foo(
-  bar,
-  baz
-);
-```
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "never"] */
-
-function foo(
-  bar,
-  baz
-) {}
-
-var foo = function(
-  bar, baz
-) {};
-
-var foo = (
-  bar,
-  baz
-) => {};
-
-foo(
-  bar,
-  baz
-);
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "never"] */
-
-function foo(bar, baz) {}
-
-function foo(bar,
-             baz) {}
-
-var foo = function(bar, baz) {};
-
-var foo = (bar, baz) => {};
-
-foo(bar, baz);
-
-foo(bar,
-  baz);
-```
-
-Examples of **incorrect** code for this rule with the default `"multiline"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "multiline"] */
-
-function foo(bar,
-  baz
-) {}
-
-var foo = function(
-  bar, baz
-) {};
-
-var foo = (
-  bar,
-  baz) => {};
-
-foo(bar,
-  baz);
-
-foo(
-  function() {
-    return baz;
-  }
-);
-```
-
-Examples of **correct** code for this rule with the default `"multiline"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "multiline"] */
-
-function foo(bar, baz) {}
-
-var foo = function(
-  bar,
-  baz
-) {};
-
-var foo = (bar, baz) => {};
-
-foo(bar, baz, qux);
-
-foo(
-  bar,
-  baz,
-  qux
-);
-
-foo(function() {
-  return baz;
-});
-```
-
-Examples of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "consistent"] */
-
-function foo(bar,
-  baz
-) {}
-
-var foo = function(bar,
-  baz
-) {};
-
-var foo = (
-  bar,
-  baz) => {};
-
-foo(
-  bar,
-  baz);
-
-foo(
-  function() {
-    return baz;
-  });
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "consistent"] */
-
-function foo(bar,
-  baz) {}
-
-var foo = function(bar, baz) {};
-
-var foo = (
-  bar,
-  baz
-) => {};
-
-foo(
-  bar, baz
-);
-
-foo(
-  function() {
-    return baz;
-  }
-);
-```
-
-Examples of **incorrect** code for this rule with the `"multiline-arguments"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "multiline-arguments"] */
-
-function foo(bar,
-  baz
-) {}
-
-var foo = function(bar,
-  baz
-) {};
-
-var foo = (
-  bar,
-  baz) => {};
-
-foo(
-  bar,
-  baz);
-
-foo(
-  bar, qux,
-  baz
-);
-```
-
-Examples of **correct** code for this rule with the consistent `"multiline-arguments"` option:
-
-```js
-/* eslint function-paren-newline: ["error", "multiline-arguments"] */
-
-function foo(
-  bar,
-  baz
-) {}
-
-var foo = function(bar, baz) {};
-
-var foo = (
-  bar
-) => {};
-
-foo(
-  function() {
-    return baz;
-  }
-);
-```
-
-Examples of **incorrect** code for this rule with the `{ "minItems": 3 }` option:
-
-```js
-/* eslint function-paren-newline: ["error", { "minItems": 3 }] */
-
-function foo(
-  bar,
-  baz
-) {}
-
-function foo(bar, baz, qux) {}
-
-var foo = function(
-  bar, baz
-) {};
-
-var foo = (bar,
-  baz) => {};
-
-foo(bar,
-  baz);
-```
-
-Examples of **correct** code for this rule with the `{ "minItems": 3 }` option:
-
-```js
-/* eslint function-paren-newline: ["error", { "minItems": 3 }] */
-
-function foo(bar, baz) {}
-
-var foo = function(
-  bar,
-  baz,
-  qux
-) {};
-
-var foo = (
-  bar, baz, qux
-) => {};
-
-foo(bar, baz);
-
-foo(
-  bar, baz, qux
-);
-```
-
-## When Not To Use It
-
-If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule.
diff --git a/eslint/docs/rules/generator-star-spacing.md b/eslint/docs/rules/generator-star-spacing.md
deleted file mode 100644 (file)
index 00a9ada..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-# Enforce spacing around the * in generator functions (generator-star-spacing)
-
-Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
-These special functions are indicated by placing an `*` after the `function` keyword.
-
-Here is an example of a generator function:
-
-```js
-/*eslint-env es6*/
-
-function* generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-This is also valid:
-
-```js
-/*eslint-env es6*/
-
-function *generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-This is valid as well:
-
-```js
-/*eslint-env es6*/
-
-function * generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-To keep a sense of consistency when using generators this rule enforces a single position for the `*`.
-
-## Rule Details
-
-This rule aims to enforce spacing around the `*` of generator functions.
-
-## Options
-
-The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
-
-* `before` enforces spacing between the `*` and the `function` keyword.
-  If it is `true`, a space is required, otherwise spaces are disallowed.
-
-  In object literal shorthand methods, spacing before the `*` is not checked, as they lack a `function` keyword.
-
-* `after` enforces spacing between the `*` and the function name (or the opening parenthesis for anonymous generator functions).
-  If it is `true`, a space is required, otherwise spaces are disallowed.
-
-The default is `{"before": true, "after": false}`.
-
-An example configuration:
-
-```json
-"generator-star-spacing": ["error", {"before": true, "after": false}]
-```
-
-And the option has shorthand as a string keyword:
-
-* `{"before": true, "after": false}` → `"before"`
-* `{"before": false, "after": true}` → `"after"`
-* `{"before": true, "after": true}` → `"both"`
-* `{"before": false, "after": false}` → `"neither"`
-
-An example of shorthand configuration:
-
-```json
-"generator-star-spacing": ["error", "after"]
-```
-
-Additionally, this rule allows further configurability via overrides per function type.
-
-* `named` provides overrides for named functions
-* `anonymous` provides overrides for anonymous functions
-* `method` provides overrides for class methods or property function shorthand
-
-An example of a configuration with overrides:
-
-```json
-"generator-star-spacing": ["error", {
-    "before": false,
-    "after": true,
-    "anonymous": "neither",
-    "method": {"before": true, "after": true}
-}]
-```
-
-In the example configuration above, the top level "before" and "after" options define the default behavior of
-the rule, while the "anonymous" and "method" options override the default behavior.
-Overrides can be either an object with "before" and "after", or a shorthand string as above.
-
-## Examples
-
-### before
-
-Examples of **correct** code for this rule with the `"before"` option:
-
-```js
-/*eslint generator-star-spacing: ["error", {"before": true, "after": false}]*/
-/*eslint-env es6*/
-
-function *generator() {}
-
-var anonymous = function *() {};
-
-var shorthand = { *generator() {} };
-```
-
-### after
-
-Examples of **correct** code for this rule with the `"after"` option:
-
-```js
-/*eslint generator-star-spacing: ["error", {"before": false, "after": true}]*/
-/*eslint-env es6*/
-
-function* generator() {}
-
-var anonymous = function* () {};
-
-var shorthand = { * generator() {} };
-```
-
-### both
-
-Examples of **correct** code for this rule with the `"both"` option:
-
-```js
-/*eslint generator-star-spacing: ["error", {"before": true, "after": true}]*/
-/*eslint-env es6*/
-
-function * generator() {}
-
-var anonymous = function * () {};
-
-var shorthand = { * generator() {} };
-```
-
-### neither
-
-Examples of **correct** code for this rule with the `"neither"` option:
-
-```js
-/*eslint generator-star-spacing: ["error", {"before": false, "after": false}]*/
-/*eslint-env es6*/
-
-function*generator() {}
-
-var anonymous = function*() {};
-
-var shorthand = { *generator() {} };
-```
-
-Examples of **incorrect** code for this rule with overrides present:
-
-```js
-/*eslint generator-star-spacing: ["error", {
-    "before": false,
-    "after": true,
-    "anonymous": "neither",
-    "method": {"before": true, "after": true}
-}]*/
-/*eslint-env es6*/
-
-function * generator() {}
-
-var anonymous = function* () {};
-
-var shorthand = { *generator() {} };
-
-class Class { static* method() {} }
-```
-
-Examples of **correct** code for this rule with overrides present:
-
-```js
-/*eslint generator-star-spacing: ["error", {
-    "before": false,
-    "after": true,
-    "anonymous": "neither",
-    "method": {"before": true, "after": true}
-}]*/
-/*eslint-env es6*/
-
-function* generator() {}
-
-var anonymous = function*() {};
-
-var shorthand = { * generator() {} };
-
-class Class { static * method() {} }
-```
-
-## When Not To Use It
-
-If your project will not be using generators or you are not concerned with spacing consistency, you do not need this rule.
-
-## Further Reading
-
-* [Understanding ES6: Generators](https://leanpub.com/understandinges6/read/#leanpub-auto-generators)
diff --git a/eslint/docs/rules/generator-star.md b/eslint/docs/rules/generator-star.md
deleted file mode 100644 (file)
index f344cc4..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# generator-star: enforce consistent spacing around the asterisk in generator functions
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [generator-star-spacing](generator-star-spacing.md) rule.
-
-Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
-These special functions are indicated by placing an `*` after the `function` keyword.
-
-Here is an example of a generator function:
-
-```js
-/*eslint-env es6*/
-
-function* generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-This is also valid:
-
-```js
-/*eslint-env es6*/
-
-function *generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-This is valid as well:
-
-```js
-/*eslint-env es6*/
-
-function * generator() {
-    yield "44";
-    yield "55";
-}
-```
-
-To keep a sense of consistency when using generators this rule enforces a single position for the `*`.
-
-## Rule Details
-
-This rule enforces that the `*` is either placed next to the `function` keyword or the name of the function. The single
-option for this rule is a string specifying the placement of the asterisk. For this option you may pass
-`"start"`, `"middle"` or `"end"`. The default is `"end"`.
-
-You can set the style in configuration like this:
-
-```json
-"generator-star": ["error", "start"]
-```
-
-When using `"start"` this placement will be enforced:
-
-```js
-/*eslint-env es6*/
-
-function* generator() {
-}
-```
-
-When using `"middle"` this placement will be enforced:
-
-```js
-/*eslint-env es6*/
-
-function * generator() {
-}
-```
-
-When using `"end"` this placement will be enforced:
-
-```js
-/*eslint-env es6*/
-
-function *generator() {
-}
-```
-
-When using the expression syntax `"start"` will be enforced here:
-
-```js
-/*eslint-env es6*/
-
-var generator = function* () {
-}
-```
-
-When using the expression syntax `"middle"` will be enforced here:
-
-```js
-/*eslint-env es6*/
-
-var generator = function * () {
-}
-```
-
-When using the expression syntax `"end"` will be enforced here:
-
-```js
-/*eslint-env es6*/
-
-var generator = function *() {
-}
-```
-
-When using the expression syntax this is valid for both `"start"` and `"end"`:
-
-```js
-/*eslint-env es6*/
-
-var generator = function*() {
-}
-```
-
-The shortened object literal syntax for generators is not affected by this rule.
-
-## When Not To Use It
-
-If your project will not be using generators you do not need this rule.
-
-## Further Reading
-
-* [Understanding ES6: Generators](https://leanpub.com/understandinges6/read/#leanpub-auto-generators)
diff --git a/eslint/docs/rules/getter-return.md b/eslint/docs/rules/getter-return.md
deleted file mode 100644 (file)
index 631de80..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# Enforces that a return statement is present in property getters (getter-return)
-
-The get syntax binds an object property to a function that will be called when that property is looked up. It was first introduced in ECMAScript 5:
-
-```js
-var p = {
-    get name(){
-        return "nicholas";
-    }
-};
-
-Object.defineProperty(p, "age", {
-    get: function (){
-        return 17;
-    }
-});
-```
-
-Note that every `getter` is expected to return a value.
-
-## Rule Details
-
-This rule enforces that a return statement is present in property getters.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint getter-return: "error"*/
-
-p = {
-    get name(){
-        // no returns.
-    }
-};
-
-Object.defineProperty(p, "age", {
-    get: function (){
-        // no returns.
-    }
-});
-
-class P{
-    get name(){
-        // no returns.
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint getter-return: "error"*/
-
-p = {
-    get name(){
-        return "nicholas";
-    }
-};
-
-Object.defineProperty(p, "age", {
-    get: function (){
-        return 18;
-    }
-});
-
-class P{
-    get name(){
-        return "nicholas";
-    }
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `"allowImplicit": false` (default) disallows implicitly returning `undefined` with a `return` statement.
-
-Examples of **correct** code for the `{ "allowImplicit": true }` option:
-
-```js
-/*eslint getter-return: ["error", { allowImplicit: true }]*/
-p = {
-    get name(){
-        return; // return undefined implicitly.
-    }
-};
-```
-
-## When Not To Use It
-
-If your project will not be using ES5 property getters you do not need this rule.
-
-## Further Reading
-
-* [MDN: Functions getter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)
-* [Understanding ES6: Accessor Properties](https://leanpub.com/understandinges6/read/#leanpub-auto-accessor-properties)
diff --git a/eslint/docs/rules/global-require.md b/eslint/docs/rules/global-require.md
deleted file mode 100644 (file)
index a81d5a3..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-# Enforce require() on the top-level module scope (global-require)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In Node.js, module dependencies are included using the `require()` function, such as:
-
-```js
-var fs = require("fs");
-```
-
-While `require()` may be called anywhere in code, some style guides prescribe that it should be called only in the top level of a module to make it easier to identify dependencies. For instance, it's arguably harder to identify dependencies when they are deeply nested inside of functions and other statements:
-
-```js
-function foo() {
-
-    if (condition) {
-        var fs = require("fs");
-    }
-}
-```
-
-Since `require()` does a synchronous load, it can cause performance problems when used in other locations.
-
-Further, ES6 modules mandate that `import` and `export` statements can only occur in the top level of the module's body.
-
-## Rule Details
-
-This rule requires all calls to `require()` to be at the top level of the module, similar to ES6 `import` and `export` statements, which also can occur only at the top level.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint global-require: "error"*/
-/*eslint-env es6*/
-
-// calling require() inside of a function is not allowed
-function readFile(filename, callback) {
-    var fs = require('fs');
-    fs.readFile(filename, callback)
-}
-
-// conditional requires like this are also not allowed
-if (DEBUG) { require('debug'); }
-
-// a require() in a switch statement is also flagged
-switch(x) { case '1': require('1'); break; }
-
-// you may not require() inside an arrow function body
-var getModule = (name) => require(name);
-
-// you may not require() inside of a function body as well
-function getModule(name) { return require(name); }
-
-// you may not require() inside of a try/catch block
-try {
-    require(unsafeModule);
-} catch(e) {
-    console.log(e);
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint global-require: "error"*/
-
-// all these variations of require() are ok
-require('x');
-var y = require('y');
-var z;
-z = require('z').initialize();
-
-// requiring a module and using it in a function is ok
-var fs = require('fs');
-function readFile(filename, callback) {
-    fs.readFile(filename, callback)
-}
-
-// you can use a ternary to determine which module to require
-var logger = DEBUG ? require('dev-logger') : require('logger');
-
-// if you want you can require() at the end of your module
-function doSomethingA() {}
-function doSomethingB() {}
-var x = require("x"),
-    z = require("z");
-```
-
-## When Not To Use It
-
-If you have a module that must be initialized with information that comes from the file-system or if a module is only used in very rare situations and will cause significant overhead to load it may make sense to disable the rule. If you need to `require()` an optional dependency inside of a `try`/`catch`, you can disable this rule for just that dependency using the `// eslint-disable-line global-require` comment.
diff --git a/eslint/docs/rules/global-strict.md b/eslint/docs/rules/global-strict.md
deleted file mode 100644 (file)
index 5fbba7b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# global-strict: require or disallow strict mode directives in the global scope
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [strict](strict.md) rule. The `"global"` option in the new rule is most similar to the removed rule.
-
-Strict mode is enabled by using the following pragma in your code:
-
-```js
-"use strict";
-```
-
-When used globally, as in this example, the strict mode pragma applies to all code within a single file. This can be dangerous if you concatenate scripts together before serving them to a browser. For instance, if you have a file running in strict mode and you concatenate that file with jQuery, the strict mode now also applies to jQuery and may cause errors.
-
-However, if you're using Node.js, you may want to turn strict mode on globally. Files are typically not concatenated together in Node.js projects and therefore the risk of applying strict mode accidentally is minimal. Further, since every file in Node.js has its own scope, global strict mode only effects the single file in which it is placed.
-
-## Rule Details
-
-This rule requires or disallows global strict mode invoked by a `"use strict"` pragma in the global scope.
-
-The following pattern is under strict mode globally and is considered valid with the `"always"` option and a warning with the `"never"` option.
-
-```js
-"use strict";
-
-function foo() {
-    return true;
-}
-```
-
-The following patterns apply strict mode only to functions so are valid with the `"never"` option but are problems with the `"always"` option.
-
-```js
-function foo() {
-    "use strict";
-
-    return true;
-}
-
-(function() {
-    "use strict";
-
-    // other code
-}());
-```
-
-## Options
-
-```json
-"global-strict": ["error", "always"]
-```
-
-Requires that every file have a top-level `"use strict"` statement.
-
-```json
-"global-strict": ["error", "never"]
-```
-
-Warns whenever `"use strict"` is used in the global scope such that it could contaminate concatenated files.
-
-## When Not To Use It
-
-When a project may use non-strict-mode code side by side with strict-mode code and the files are not concatenated, the decision to use global strict mode can be made on an individual basis, rendering this rule unnecessary.
diff --git a/eslint/docs/rules/grouped-accessor-pairs.md b/eslint/docs/rules/grouped-accessor-pairs.md
deleted file mode 100644 (file)
index 60848d1..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-# Require grouped accessor pairs in object literals and classes (grouped-accessor-pairs)
-
-A getter and setter for the same property don't necessarily have to be defined adjacent to each other.
-
-For example, the following statements would create the same object:
-
-```js
-var o = {
-    get a() {
-        return this.val;
-    },
-    set a(value) {
-        this.val = value;
-    },
-    b: 1
-};
-
-var o = {
-    get a() {
-        return this.val;
-    },
-    b: 1,
-    set a(value) {
-        this.val = value;
-    }
-};
-```
-
-While it is allowed to define the pair for a getter or a setter anywhere in an object or class definition, it's considered a best practice to group accessor functions for the same property.
-
-In other words, if a property has a getter and a setter, the setter should be defined right after the getter, or vice versa.
-
-## Rule Details
-
-This rule requires grouped definitions of accessor functions for the same property in object literals, class declarations and class expressions.
-
-Optionally, this rule can also enforce consistent order (`getBeforeSet` or `setBeforeGet`).
-
-This rule does not enforce the existence of the pair for a getter or a setter. See [accessor-pairs](accessor-pairs.md) if you also want to enforce getter/setter pairs.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint grouped-accessor-pairs: "error"*/
-
-var foo = {
-    get a() {
-        return this.val;
-    },
-    b: 1,
-    set a(value) {
-        this.val = value;
-    }
-};
-
-var bar = {
-    set b(value) {
-        this.val = value;
-    },
-    a: 1,
-    get b() {
-        return this.val;
-    }
-}
-
-class Foo {
-    set a(value) {
-        this.val = value;
-    }
-    b(){}
-    get a() {
-        return this.val;
-    }
-}
-
-const Bar = class {
-    static get a() {
-        return this.val;
-    }
-    b(){}
-    static set a(value) {
-        this.val = value;
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint grouped-accessor-pairs: "error"*/
-
-var foo = {
-    get a() {
-        return this.val;
-    },
-    set a(value) {
-        this.val = value;
-    },
-    b: 1
-};
-
-var bar = {
-    set b(value) {
-        this.val = value;
-    },
-    get b() {
-        return this.val;
-    },
-    a: 1
-}
-
-class Foo {
-    set a(value) {
-        this.val = value;
-    }
-    get a() {
-        return this.val;
-    }
-    b(){}
-}
-
-const Bar = class {
-    static get a() {
-        return this.val;
-    }
-    static set a(value) {
-        this.val = value;
-    }
-    b(){}
-}
-```
-
-## Options
-
-This rule has a string option:
-
-* `"anyOrder"` (default) does not enforce order.
-* `"getBeforeSet"` if a property has both getter and setter, requires the getter to be defined before the setter.
-* `"setBeforeGet"` if a property has both getter and setter, requires the setter to be defined before the getter.
-
-### getBeforeSet
-
-Examples of **incorrect** code for this rule with the `"getBeforeSet"` option:
-
-```js
-/*eslint grouped-accessor-pairs: ["error", "getBeforeSet"]*/
-
-var foo = {
-    set a(value) {
-        this.val = value;
-    },
-    get a() {
-        return this.val;
-    }
-};
-
-class Foo {
-    set a(value) {
-        this.val = value;
-    }
-    get a() {
-        return this.val;
-    }
-}
-
-const Bar = class {
-    static set a(value) {
-        this.val = value;
-    }
-    static get a() {
-        return this.val;
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `"getBeforeSet"` option:
-
-```js
-/*eslint grouped-accessor-pairs: ["error", "getBeforeSet"]*/
-
-var foo = {
-    get a() {
-        return this.val;
-    },
-    set a(value) {
-        this.val = value;
-    }
-};
-
-class Foo {
-    get a() {
-        return this.val;
-    }
-    set a(value) {
-        this.val = value;
-    }
-}
-
-const Bar = class {
-    static get a() {
-        return this.val;
-    }
-    static set a(value) {
-        this.val = value;
-    }
-}
-```
-
-### setBeforeGet
-
-Examples of **incorrect** code for this rule with the `"setBeforeGet"` option:
-
-```js
-/*eslint grouped-accessor-pairs: ["error", "setBeforeGet"]*/
-
-var foo = {
-    get a() {
-        return this.val;
-    },
-    set a(value) {
-        this.val = value;
-    }
-};
-
-class Foo {
-    get a() {
-        return this.val;
-    }
-    set a(value) {
-        this.val = value;
-    }
-}
-
-const Bar = class {
-    static get a() {
-        return this.val;
-    }
-    static set a(value) {
-        this.val = value;
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `"setBeforeGet"` option:
-
-```js
-/*eslint grouped-accessor-pairs: ["error", "setBeforeGet"]*/
-
-var foo = {
-    set a(value) {
-        this.val = value;
-    },
-    get a() {
-        return this.val;
-    }
-};
-
-class Foo {
-    set a(value) {
-        this.val = value;
-    }
-    get a() {
-        return this.val;
-    }
-}
-
-const Bar = class {
-    static set a(value) {
-        this.val = value;
-    }
-    static get a() {
-        return this.val;
-    }
-}
-```
-
-## Known Limitations
-
-Due to the limits of static analysis, this rule does not account for possible side effects and in certain cases
-might require or miss to require grouping or order for getters/setters that have a computed key, like in the following example:
-
-```js
-/*eslint grouped-accessor-pairs: "error"*/
-
-var a = 1;
-
-// false warning (false positive)
-var foo = {
-    get [a++]() {
-        return this.val;
-    },
-    b: 1,
-    set [a++](value) {
-        this.val = value;
-    }
-};
-
-// missed warning (false negative)
-var bar = {
-    get [++a]() {
-        return this.val;
-    },
-    b: 1,
-    set [a](value) {
-        this.val = value;
-    }
-};
-```
-
-Also, this rule does not report any warnings for properties that have duplicate getters or setters.
-
-See [no-dupe-keys](no-dupe-keys.md) if you also want to disallow duplicate keys in object literals.
-
-See [no-dupe-class-members](no-dupe-class-members.md) if you also want to disallow duplicate names in class definitions.
-
-## Further Reading
-
-* [Object Setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)
-* [Object Getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)
-* [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
-
-## Related Rules
-
-* [accessor-pairs](accessor-pairs.md)
-* [no-dupe-keys](no-dupe-keys.md)
-* [no-dupe-class-members](no-dupe-class-members.md)
diff --git a/eslint/docs/rules/guard-for-in.md b/eslint/docs/rules/guard-for-in.md
deleted file mode 100644 (file)
index 28dc163..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Require Guarding for-in (guard-for-in)
-
-Looping over objects with a `for in` loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.
-
-```js
-for (key in foo) {
-    doSomething(key);
-}
-```
-
-Note that simply checking `foo.hasOwnProperty(key)` is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).
-
-## Rule Details
-
-This rule is aimed at preventing unexpected behavior that could arise from using a `for in` loop without filtering the results in the loop. As such, it will warn when `for in` loops do not filter their results with an `if` statement.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint guard-for-in: "error"*/
-
-for (key in foo) {
-    doSomething(key);
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint guard-for-in: "error"*/
-
-for (key in foo) {
-    if (Object.prototype.hasOwnProperty.call(foo, key)) {
-        doSomething(key);
-    }
-}
-
-for (key in foo) {
-    if ({}.hasOwnProperty.call(foo, key)) {
-        doSomething(key);
-    }
-}
-```
-
-## Related Rules
-
-* [no-prototype-builtins](no-prototype-builtins.md)
-
-## Further Reading
-
-* [Exploring JavaScript for-in loops](https://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/)
-* [The pitfalls of using objects as maps in JavaScript](http://2ality.com/2012/01/objects-as-maps.html)
diff --git a/eslint/docs/rules/handle-callback-err.md b/eslint/docs/rules/handle-callback-err.md
deleted file mode 100644 (file)
index dad537e..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-# Enforce Callback Error Handling (handle-callback-err)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In Node.js, a common pattern for dealing with asynchronous behavior is called the callback pattern.
-This pattern expects an `Error` object or `null` as the first argument of the callback.
-Forgetting to handle these errors can lead to some really strange behavior in your application.
-
-```js
-function loadData (err, data) {
-    doSomething(); // forgot to handle error
-}
-```
-
-## Rule Details
-
-This rule expects that when you're using the callback pattern in Node.js you'll handle the error.
-
-## Options
-
-The rule takes a single string option: the name of the error parameter. The default is `"err"`.
-
-Examples of **incorrect** code for this rule with the default `"err"` parameter name:
-
-```js
-/*eslint handle-callback-err: "error"*/
-
-function loadData (err, data) {
-    doSomething();
-}
-
-```
-
-Examples of **correct** code for this rule with the default `"err"` parameter name:
-
-```js
-/*eslint handle-callback-err: "error"*/
-
-function loadData (err, data) {
-    if (err) {
-        console.log(err.stack);
-    }
-    doSomething();
-}
-
-function generateError (err) {
-    if (err) {}
-}
-```
-
-Examples of **correct** code for this rule with a sample `"error"` parameter name:
-
-```js
-/*eslint handle-callback-err: ["error", "error"]*/
-
-function loadData (error, data) {
-    if (error) {
-       console.log(error.stack);
-    }
-    doSomething();
-}
-```
-
-### regular expression
-
-Sometimes (especially in big projects) the name of the error variable is not consistent across the project,
-so you need a more flexible configuration to ensure that the rule reports all unhandled errors.
-
-If the configured name of the error variable begins with a `^` it is considered to be a regexp pattern.
-
-* If the option is `"^(err|error|anySpecificError)$"`, the rule reports unhandled errors where the parameter name can be `err`, `error` or `anySpecificError`.
-* If the option is `"^.+Error$"`, the rule reports unhandled errors where the parameter name ends with `Error` (for example, `connectionError` or `validationError` will match).
-* If the option is `"^.*(e|E)rr"`, the rule reports unhandled errors where the parameter name matches any string that contains `err` or `Err` (for example, `err`, `error`, `anyError`, `some_err` will match).
-
-## When Not To Use It
-
-There are cases where it may be safe for your application to ignore errors, however only ignore errors if you are
-confident that some other form of monitoring will help you catch the problem.
-
-## Further Reading
-
-* [The Art Of Node: Callbacks](https://github.com/maxogden/art-of-node#callbacks)
-* [Nodejitsu: What are the error conventions?](https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/)
diff --git a/eslint/docs/rules/id-blacklist.md b/eslint/docs/rules/id-blacklist.md
deleted file mode 100644 (file)
index 87a7d95..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# disallow specified identifiers (id-blacklist)
-
-This rule was **deprecated** in ESLint v7.5.0 and replaced by the [id-denylist](id-denylist.md) rule.
diff --git a/eslint/docs/rules/id-denylist.md b/eslint/docs/rules/id-denylist.md
deleted file mode 100644 (file)
index 071a34f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-# disallow specified identifiers (id-denylist)
-
-> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
-
-Generic names can lead to hard-to-decipher code. This rule allows you to specify a deny list of disallowed identifier names to avoid this practice.
-
-## Rule Details
-
-This rule disallows specified identifiers in assignments and `function` definitions.
-
-This rule will catch disallowed identifiers that are:
-
-- variable declarations
-- function declarations
-- object properties assigned to during object creation
-- class fields
-- class methods
-
-It will not catch disallowed identifiers that are:
-
-- function calls (so you can still use functions you do not have control over)
-- object properties (so you can still use objects you do not have control over)
-
-## Options
-
-The rule takes one or more strings as options: the names of restricted identifiers.
-
-For example, to restrict the use of common generic identifiers:
-
-```json
-{
-    "id-denylist": ["error", "data", "err", "e", "cb", "callback"]
-}
-```
-
-Examples of **incorrect** code for this rule with sample `"data", "callback"` restricted identifiers:
-
-```js
-/*eslint id-denylist: ["error", "data", "callback"] */
-
-var data = {...};
-
-function callback() {
-    // ...
-}
-
-element.callback = function() {
-    // ...
-};
-
-var itemSet = {
-    data: [...]
-};
-
-class Foo {
-    data = [];
-}
-
-class Foo {
-    #data = [];
-}
-
-class Foo {
-    callback( {);
-}
-
-class Foo {
-    #callback( {);
-}
-```
-
-Examples of **correct** code for this rule with sample `"data", "callback"` restricted identifiers:
-
-```js
-/*eslint id-denylist: ["error", "data", "callback"] */
-
-var encodingOptions = {...};
-
-function processFileResult() {
-    // ...
-}
-
-element.successHandler = function() {
-    // ...
-};
-
-var itemSet = {
-    entities: [...]
-};
-
-callback(); // all function calls are ignored
-
-foo.callback(); // all function calls are ignored
-
-foo.data; // all property names that are not assignments are ignored
-
-class Foo {
-    items = [];
-}
-
-class Foo {
-    #items = [];
-}
-
-class Foo {
-    method( {);
-}
-
-class Foo {
-    #method( {);
-}
-```
-
-## When Not To Use It
-
-You can turn this rule off if you do not want to restrict the use of certain identifiers.
diff --git a/eslint/docs/rules/id-length.md b/eslint/docs/rules/id-length.md
deleted file mode 100644 (file)
index d8b1b45..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-# enforce minimum and maximum identifier lengths (id-length)
-
-Very short identifier names like `e`, `x`, `_t` or very long ones like `hashGeneratorResultOutputContainerObject` can make code harder to read and potentially less maintainable. To prevent this, one may enforce a minimum and/or maximum identifier length.
-
-```js
-var x = 5; // too short; difficult to understand its purpose without context
-```
-
-## Rule Details
-
-This rule enforces a minimum and/or maximum identifier length convention.
-
-## Options
-
-Examples of **incorrect** code for this rule with the default options:
-
-```js
-/*eslint id-length: "error"*/     // default is minimum 2-chars ({ "min": 2 })
-/*eslint-env es6*/
-
-var x = 5;
-obj.e = document.body;
-var foo = function (e) { };
-try {
-    dangerousStuff();
-} catch (e) {
-    // ignore as many do
-}
-var myObj = { a: 1 };
-(a) => { a * a };
-class x { }
-class Foo { x() {} }
-class Foo { #x() {} }
-class Foo { x = 1 }
-class Foo { #x = 1 }
-function foo(...x) { }
-function foo([x]) { }
-var [x] = arr;
-var { prop: [x]} = {};
-function foo({x}) { }
-var { x } = {};
-var { prop: a} = {};
-({ prop: obj.x } = {});
-```
-
-Examples of **correct** code for this rule with the default options:
-
-```js
-/*eslint id-length: "error"*/     // default is minimum 2-chars ({ "min": 2 })
-/*eslint-env es6*/
-
-var num = 5;
-function _f() { return 42; }
-function _func() { return 42; }
-obj.el = document.body;
-var foo = function (evt) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (error) {
-    // ignore as many do
-}
-var myObj = { apple: 1 };
-(num) => { num * num };
-function foo(num = 0) { }
-class MyClass { }
-class Foo { method() {} }
-class Foo { #method() {} }
-class Foo { field = 1 }
-class Foo { #field = 1 }
-function foo(...args) { }
-function foo([longName]) { }
-var { prop } = {};
-var { prop: [longName] } = {};
-var [longName] = arr;
-function foo({ prop }) { }
-function foo({ a: prop }) { }
-var { prop } = {};
-var { a: prop } = {};
-({ prop: obj.longName } = {});
-var data = { "x": 1 };  // excused because of quotes
-data["y"] = 3;  // excused because of calculated property access
-```
-
-This rule has an object option:
-
-* `"min"` (default: 2) enforces a minimum identifier length
-* `"max"` (default: Infinity) enforces a maximum identifier length
-* `"properties": always` (default) enforces identifier length convention for property names
-* `"properties": never` ignores identifier length convention for property names
-* `"exceptions"` allows an array of specified identifier names
-* `"exceptionPatterns"` array of strings representing regular expression patterns, allows identifiers that match any of the patterns.
-
-### min
-
-Examples of **incorrect** code for this rule with the `{ "min": 4 }` option:
-
-```js
-/*eslint id-length: ["error", { "min": 4 }]*/
-/*eslint-env es6*/
-
-var val = 5;
-obj.e = document.body;
-function foo (e) { };
-try {
-    dangerousStuff();
-} catch (e) {
-    // ignore as many do
-}
-var myObj = { a: 1 };
-(val) => { val * val };
-class x { }
-class Foo { x() {} }
-function foo(...x) { }
-var { x } = {};
-var { prop: a} = {};
-var [x] = arr;
-var { prop: [x]} = {};
-({ prop: obj.x } = {});
-```
-
-Examples of **correct** code for this rule with the `{ "min": 4 }` option:
-
-```js
-/*eslint id-length: ["error", { "min": 4 }]*/
-/*eslint-env es6*/
-
-var value = 5;
-function func() { return 42; }
-obj.element = document.body;
-var foobar = function (event) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (error) {
-    // ignore as many do
-}
-var myObj = { apple: 1 };
-(value) => { value * value };
-function foobar(value = 0) { }
-class MyClass { }
-class Foobar { method() {} }
-function foobar(...args) { }
-var { prop } = {};
-var [longName] = foo;
-var { a: [prop] } = {};
-var { a: longName } = {};
-({ prop: obj.name } = {});
-var data = { "x": 1 };  // excused because of quotes
-data["y"] = 3;  // excused because of calculated property access
-```
-
-### max
-
-Examples of **incorrect** code for this rule with the `{ "max": 10 }` option:
-
-```js
-/*eslint id-length: ["error", { "max": 10 }]*/
-/*eslint-env es6*/
-
-var reallyLongVarName = 5;
-function reallyLongFuncName() { return 42; }
-obj.reallyLongPropName = document.body;
-var foo = function (reallyLongArgName) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (reallyLongErrorName) {
-    // ignore as many do
-}
-(reallyLongArgName) => { return !reallyLongArgName; };
-var [reallyLongFirstElementName] = arr;
-```
-
-Examples of **correct** code for this rule with the `{ "max": 10 }` option:
-
-```js
-/*eslint id-length: ["error", { "max": 10 }]*/
-/*eslint-env es6*/
-
-var varName = 5;
-function funcName() { return 42; }
-obj.propName = document.body;
-var foo = function (arg) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (error) {
-    // ignore as many do
-}
-(arg) => { return !arg; };
-var [first] = arr;
-```
-
-### properties
-
-Examples of **correct** code for this rule with the `{ "properties": "never" }` option:
-
-```js
-/*eslint id-length: ["error", { "properties": "never" }]*/
-/*eslint-env es6*/
-
-var myObj = { a: 1 };
-({ a: obj.x.y.z } = {});
-({ prop: obj.i } = {});
-```
-
-### exceptions
-
-Examples of additional **correct** code for this rule with the `{ "exceptions": ["x"] }` option:
-
-```js
-/*eslint id-length: ["error", { "exceptions": ["x"] }]*/
-/*eslint-env es6*/
-
-var x = 5;
-function x() { return 42; }
-obj.x = document.body;
-var foo = function (x) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (x) {
-    // ignore as many do
-}
-(x) => { return x * x; };
-var [x] = arr;
-const { x } = foo;
-const { a: x } = foo;
-```
-
-### exceptionPatterns
-
-Examples of additional **correct** code for this rule with the `{ "exceptionPatterns": ["E|S", "[x-z]"] }` option:
-
-```js
-/*eslint id-length: ["error", { "exceptionPatterns": ["E|S", "[x-z]"] }]*/
-/*eslint-env es6*/
-
-var E = 5;
-function S() { return 42; }
-obj.x = document.body;
-var foo = function (x) { /* do stuff */ };
-try {
-    dangerousStuff();
-} catch (x) {
-    // ignore as many do
-}
-(y) => {return  y * y};
-var [E] = arr;
-const { y } = foo;
-const { a: z } = foo;
-```
-
-## Related Rules
-
-* [max-len](max-len.md)
-* [new-cap](new-cap.md)
-* [func-names](func-names.md)
-* [camelcase](camelcase.md)
diff --git a/eslint/docs/rules/id-match.md b/eslint/docs/rules/id-match.md
deleted file mode 100644 (file)
index 5bb2a1d..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-# require identifiers to match a specified regular expression (id-match)
-
-> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
-
-Naming things consistently in a project is an often underestimated aspect of code creation.
-When done correctly, it can save your team hours of unnecessary head scratching and misdirections.
-This rule allows you to precisely define and enforce the variables and function names on your team should use.
-No more limiting yourself to camelCase, snake_case, PascalCase or oHungarianNotation. Id-match has all your needs covered!
-
-## Rule Details
-
-This rule requires identifiers in assignments and `function` definitions to match a specified regular expression.
-
-## Options
-
-This rule has a string option for the specified regular expression.
-
-For example, to enforce a camelcase naming convention:
-
-```json
-{
-    "id-match": ["error", "^[a-z]+([A-Z][a-z]+)*$"]
-}
-```
-
-Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option:
-
-```js
-/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/
-
-var my_favorite_color = "#112C85";
-var _myFavoriteColor  = "#112C85";
-var myFavoriteColor_  = "#112C85";
-var MY_FAVORITE_COLOR = "#112C85";
-function do_something() {
-    // ...
-}
-
-obj.do_something = function() {
-    // ...
-};
-
-class My_Class {}
-
-class myClass {
-    do_something() {}
-}
-
-class myClass {
-    #do_something() {}
-}
-```
-
-Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option:
-
-```js
-/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/
-
-var myFavoriteColor   = "#112C85";
-var foo = bar.baz_boom;
-var foo = { qux: bar.baz_boom };
-do_something();
-var obj = {
-    my_pref: 1
-};
-
-class myClass {}
-
-class myClass {
-    doSomething() {}
-}
-
-class myClass {
-    #doSomething() {}
-}
-```
-
-This rule has an object option:
-
-* `"properties": false` (default) does not check object properties
-* `"properties": true` requires object literal properties and member expression assignment properties to match the specified regular expression
-* `"classFields": false` (default) does not class field names
-* `"classFields": true` requires class field names to match the specified regular expression
-* `"onlyDeclarations": false` (default) requires all variable names to match the specified regular expression
-* `"onlyDeclarations": true` requires only `var`, `function`, and `class` declarations to match the specified regular expression
-* `"ignoreDestructuring": false` (default) enforces `id-match` for destructured identifiers
-* `"ignoreDestructuring": true` does not check destructured identifiers
-
-### properties
-
-Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "properties": true }` options:
-
-```js
-/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$", { "properties": true }]*/
-
-var obj = {
-    my_pref: 1
-};
-```
-
-### classFields
-
-Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "classFields": true }` options:
-
-```js
-/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$", { "properties": true }]*/
-
-class myClass {
-    my_pref = 1;
-}
-
-class myClass {
-    #my_pref = 1;
-}
-```
-
-### onlyDeclarations
-
-Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "onlyDeclarations": true }` options:
-
-```js
-/*eslint id-match: [2, "^[a-z]+([A-Z][a-z]+)*$", { "onlyDeclarations": true }]*/
-
-do_something(__dirname);
-```
-
-### ignoreDestructuring: false
-
-Examples of **incorrect** code for this rule with the default `"^[^_]+$", { "ignoreDestructuring": false }` option:
-
-```js
-/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": false }]*/
-
-var { category_id } = query;
-
-var { category_id = 1 } = query;
-
-var { category_id: category_id } = query;
-
-var { category_id: category_alias } = query;
-
-var { category_id: categoryId, ...other_props } = query;
-```
-
-### ignoreDestructuring: true
-
-Examples of **incorrect** code for this rule with the `"^[^_]+$", { "ignoreDestructuring": true }` option:
-
-```js
-/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": true }]*/
-
-var { category_id: category_alias } = query;
-
-var { category_id, ...other_props } = query;
-```
-
-Examples of **correct** code for this rule with the `"^[^_]+$", { "ignoreDestructuring": true }` option:
-
-```js
-/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": true }]*/
-
-var { category_id } = query;
-
-var { category_id = 1 } = query;
-
-var { category_id: category_id } = query;
-```
-
-## When Not To Use It
-
-If you don't want to enforce any particular naming convention for all identifiers, or your naming convention is too complex to be enforced by configuring this rule, then you should not enable this rule.
diff --git a/eslint/docs/rules/implicit-arrow-linebreak.md b/eslint/docs/rules/implicit-arrow-linebreak.md
deleted file mode 100644 (file)
index a1a2355..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-# Enforce the location of arrow function bodies with implicit returns (implicit-arrow-linebreak)
-
-An arrow function body can contain an implicit return as an expression instead of a block body. It can be useful to enforce a consistent location for the implicitly returned expression.
-
-## Rule Details
-
-This rule aims to enforce a consistent location for an arrow function containing an implicit return.
-
-See Also:
-
-- [`brace-style`](https://eslint.org/docs/rules/brace-style) which enforces this behavior for arrow functions with block bodies.
-
-### Options
-
-This rule accepts a string option:
-
-- `"beside"` (default) disallows a newline before an arrow function body.
-- `"below"` requires a newline before an arrow function body.
-
-Examples of **incorrect** code for this rule with the default `"beside"` option:
-
-```js
-/* eslint implicit-arrow-linebreak: ["error", "beside"] */
-
-(foo) =>
-  bar;
-
-(foo) =>
-  (bar);
-
-(foo) =>
-  bar =>
-    baz;
-
-(foo) =>
-(
-  bar()
-);
-```
-
-Examples of **correct** code for this rule with the default `"beside"` option:
-
-```js
-/* eslint implicit-arrow-linebreak: ["error", "beside"] */
-
-(foo) => bar;
-
-(foo) => (bar);
-
-(foo) => bar => baz;
-
-(foo) => (
-  bar()
-);
-
-// functions with block bodies allowed with this rule using any style
-// to enforce a consistent location for this case, see the rule: `brace-style`
-(foo) => {
-  return bar();
-}
-
-(foo) =>
-{
-  return bar();
-}
-```
-
-Examples of **incorrect** code for this rule with the `"below"` option:
-
-```js
-/* eslint implicit-arrow-linebreak: ["error", "below"] */
-
-(foo) => bar;
-
-(foo) => (bar);
-
-(foo) => bar => baz;
-```
-
-Examples of **correct** code for this rule with the `"below"` option:
-
-```js
-/* eslint implicit-arrow-linebreak: ["error", "below"] */
-
-
-(foo) =>
-  bar;
-
-(foo) =>
-  (bar);
-
-(foo) =>
-  bar =>
-    baz;
-```
-
-## When Not To Use It
-
-If you're not concerned about consistent locations of implicitly returned arrow function expressions, you should not turn on this rule.
-
-You can also disable this rule if you are using the `"always"` option for the [`arrow-body-style`](https://eslint.org/docs/rules/arrow-body-style), since this will disable the use of implicit returns in arrow functions.
diff --git a/eslint/docs/rules/indent-legacy.md b/eslint/docs/rules/indent-legacy.md
deleted file mode 100644 (file)
index 2711ccc..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-# enforce consistent indentation (indent-legacy)
-
-This rule was **deprecated** in ESLint v4.0.0.
-
-ESLint 4.0.0 introduced a rewrite of the [`indent`](/docs/rules/indent) rule, which now reports more errors than it did in previous versions. To ease the process of migrating to 4.0.0, the `indent-legacy` rule was introduced as a snapshot of the `indent` rule from ESLint 3.x. If your build is failing after the upgrade to 4.0.0, you can disable `indent` and enable `indent-legacy` as a quick fix. Eventually, you should switch back to the `indent` rule to get bugfixes and improvements in future versions.
-
----
-
-There are several common guidelines which require specific indentation of nested blocks and statements, like:
-
-```js
-function hello(indentSize, type) {
-    if (indentSize === 4 && type !== 'tab') {
-        console.log('Each next indentation will increase on 4 spaces');
-    }
-}
-```
-
-These are the most common scenarios recommended in different style guides:
-
-* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix
-* Tabs: jQuery
-* Four spaces: Crockford
-
-## Rule Details
-
-This rule enforces a consistent indentation style. The default style is `4 spaces`.
-
-## Options
-
-This rule has a mixed option:
-
-For example, for 2-space indentation:
-
-```json
-{
-    "indent": ["error", 2]
-}
-```
-
-Or for tabbed indentation:
-
-```json
-{
-    "indent": ["error", "tab"]
-}
-```
-
-Examples of **incorrect** code for this rule with the default options:
-
-```js
-/*eslint indent: "error"*/
-
-if (a) {
-  b=c;
-  function foo(d) {
-    e=f;
-  }
-}
-```
-
-Examples of **correct** code for this rule with the default options:
-
-```js
-/*eslint indent: "error"*/
-
-if (a) {
-    b=c;
-    function foo(d) {
-        e=f;
-    }
-}
-```
-
-This rule has an object option:
-
-* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements
-* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations.
-* `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs.
-* `"MemberExpression"` (off by default) enforces indentation level for multi-line property chains (except in variable declarations and assignments)
-* `"FunctionDeclaration"` takes an object to define rules for function declarations.
-    * `parameters` (off by default) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the declaration must be aligned with the first parameter.
-    * `body` (default: 1) enforces indentation level for the body of a function declaration.
-* `"FunctionExpression"` takes an object to define rules for function expressions.
-    * `parameters` (off by default) enforces indentation level for parameters in a function expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the expression must be aligned with the first parameter.
-    * `body` (default: 1) enforces indentation level for the body of a function expression.
-* `"CallExpression"` takes an object to define rules for function call expressions.
-    * `arguments` (off by default) enforces indentation level for arguments in a call expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all arguments of the expression must be aligned with the first argument.
-* `"ArrayExpression"` (default: 1) enforces indentation level for elements in arrays. It can also be set to the string `"first"`, indicating that all the elements in the array should be aligned with the first element.
-* `"ObjectExpression"` (default: 1) enforces indentation level for properties in objects. It can be set to the string `"first"`, indicating that all properties in the object should be aligned with the first property.
-
-Level of indentation denotes the multiple of the indent specified. Example:
-
-* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.
-* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.
-* Indent of 2 spaces with `VariableDeclarator` set to `{"var": 2, "let": 2, "const": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.
-* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.
-* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.
-* Indent of 2 spaces with `SwitchCase` set to `1` will indent `case` clauses with 2 spaces with respect to `switch` statements.
-* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.
-* Indent of tab with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.
-* Indent of 2 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
-* Indent of 2 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 2 spaces.
-* Indent of 2 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 4 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 4 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 8 spaces.
-
-### tab
-
-Examples of **incorrect** code for this rule with the `"tab"` option:
-
-```js
-/*eslint indent: ["error", "tab"]*/
-
-if (a) {
-     b=c;
-function foo(d) {
-           e=f;
- }
-}
-```
-
-Examples of **correct** code for this rule with the `"tab"` option:
-
-```js
-/*eslint indent: ["error", "tab"]*/
-
-if (a) {
-/*tab*/b=c;
-/*tab*/function foo(d) {
-/*tab*//*tab*/e=f;
-/*tab*/}
-}
-```
-
-### SwitchCase
-
-Examples of **incorrect** code for this rule with the `2, { "SwitchCase": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
-
-switch(a){
-case "a":
-    break;
-case "b":
-    break;
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "SwitchCase": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
-
-switch(a){
-  case "a":
-    break;
-  case "b":
-    break;
-}
-```
-
-### VariableDeclarator
-
-Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-    b = 2,
-    c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
-/*eslint-env es6*/
-
-var a,
-  b,
-  c;
-let a,
-  b,
-  c;
-const a = 1,
-  b = 2,
-  c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 2 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 2 }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-    b = 2,
-    c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-      b = 2,
-      c = 3;
-```
-
-### outerIIFEBody
-
-Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
-
-```js
-/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
-
-(function() {
-
-  function foo(x) {
-    return x + 1;
-  }
-
-})();
-
-
-if(y) {
-console.log('foo');
-}
-```
-
-Examples of **correct** code for this rule with the options `2, {"outerIIFEBody": 0}`:
-
-```js
-/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
-
-(function() {
-
-function foo(x) {
-  return x + 1;
-}
-
-})();
-
-
-if(y) {
-   console.log('foo');
-}
-```
-
-### MemberExpression
-
-Examples of **incorrect** code for this rule with the `2, { "MemberExpression": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
-
-foo
-.bar
-.baz()
-```
-
-Examples of **correct** code for this rule with the `2, { "MemberExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
-
-foo
-  .bar
-  .baz();
-
-// Any indentation is permitted in variable declarations and assignments.
-var bip = aardvark.badger
-                  .coyote;
-```
-
-### FunctionDeclaration
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
-
-function foo(bar,
-  baz,
-  qux) {
-    qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
-
-function foo(bar,
-    baz,
-    qux) {
-  qux();
-}
-```
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
-
-function foo(bar, baz,
-  qux, boop) {
-  qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
-
-function foo(bar, baz,
-             qux, boop) {
-  qux();
-}
-```
-
-### FunctionExpression
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
-
-var foo = function(bar,
-  baz,
-  qux) {
-    qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
-
-var foo = function(bar,
-    baz,
-    qux) {
-  qux();
-}
-```
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
-
-var foo = function(bar, baz,
-  qux, boop) {
-  qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
-
-var foo = function(bar, baz,
-                   qux, boop) {
-  qux();
-}
-```
-
-### CallExpression
-
-Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
-
-foo(bar,
-    baz,
-      qux
-);
-```
-
-Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
-
-foo(bar,
-  baz,
-  qux
-);
-```
-
-Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
-
-foo(bar, baz,
-  baz, boop, beep);
-```
-
-Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
-
-foo(bar, baz,
-    baz, boop, beep);
-```
-
-### ArrayExpression
-
-Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
-
-var foo = [
-    bar,
-baz,
-      qux
-];
-```
-
-Examples of **correct** code for this rule with the `2, { "ArrayExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
-
-var foo = [
-  bar,
-  baz,
-  qux
-];
-```
-
-Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
-
-var foo = [bar,
-  baz,
-  qux
-];
-```
-
-Examples of **correct** code for this rule with the `2, { "ArrayExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
-
-var foo = [bar,
-           baz,
-           qux
-];
-```
-
-### ObjectExpression
-
-Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
-
-var foo = {
-    bar: 1,
-baz: 2,
-      qux: 3
-};
-```
-
-Examples of **correct** code for this rule with the `2, { "ObjectExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
-
-var foo = {
-  bar: 1,
-  baz: 2,
-  qux: 3
-};
-```
-
-Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
-
-var foo = { bar: 1,
-  baz: 2 };
-```
-
-Examples of **correct** code for this rule with the `2, { "ObjectExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
-
-var foo = { bar: 1,
-            baz: 2 };
-```
-
-## Compatibility
-
-* **JSHint**: `indent`
-* **JSCS**: [validateIndentation](https://jscs-dev.github.io/rule/validateIndentation)
diff --git a/eslint/docs/rules/indent.md b/eslint/docs/rules/indent.md
deleted file mode 100644 (file)
index bd4e86e..0000000
+++ /dev/null
@@ -1,848 +0,0 @@
-# enforce consistent indentation (indent)
-
-There are several common guidelines which require specific indentation of nested blocks and statements, like:
-
-```js
-function hello(indentSize, type) {
-    if (indentSize === 4 && type !== 'tab') {
-        console.log('Each next indentation will increase on 4 spaces');
-    }
-}
-```
-
-These are the most common scenarios recommended in different style guides:
-
-* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix
-* Tabs: jQuery
-* Four spaces: Crockford
-
-## Rule Details
-
-This rule enforces a consistent indentation style. The default style is `4 spaces`.
-
-## Options
-
-This rule has a mixed option:
-
-For example, for 2-space indentation:
-
-```json
-{
-    "indent": ["error", 2]
-}
-```
-
-Or for tabbed indentation:
-
-```json
-{
-    "indent": ["error", "tab"]
-}
-```
-
-Examples of **incorrect** code for this rule with the default options:
-
-```js
-/*eslint indent: "error"*/
-
-if (a) {
-  b=c;
-  function foo(d) {
-    e=f;
-  }
-}
-```
-
-Examples of **correct** code for this rule with the default options:
-
-```js
-/*eslint indent: "error"*/
-
-if (a) {
-    b=c;
-    function foo(d) {
-        e=f;
-    }
-}
-```
-
-This rule has an object option:
-
-* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](/docs/developer-guide/selectors.md). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern.
-* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements
-* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations. It can also be `"first"`, indicating all the declarators should be aligned with the first declarator.
-* `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs. This can also be set to `"off"` to disable checking for file-level IIFEs.
-* `"MemberExpression"` (default: 1) enforces indentation level for multi-line property chains. This can also be set to `"off"` to disable checking for MemberExpression indentation.
-* `"FunctionDeclaration"` takes an object to define rules for function declarations.
-    * `parameters` (default: 1) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the declaration must be aligned with the first parameter. This can also be set to `"off"` to disable checking for FunctionDeclaration parameters.
-    * `body` (default: 1) enforces indentation level for the body of a function declaration.
-* `"FunctionExpression"` takes an object to define rules for function expressions.
-    * `parameters` (default: 1) enforces indentation level for parameters in a function expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the expression must be aligned with the first parameter. This can also be set to `"off"` to disable checking for FunctionExpression parameters.
-    * `body` (default: 1) enforces indentation level for the body of a function expression.
-* `"StaticBlock"` takes an object to define rules for class static blocks.
-    * `body` (default: 1) enforces indentation level for the body of a class static block.
-* `"CallExpression"` takes an object to define rules for function call expressions.
-    * `arguments` (default: 1) enforces indentation level for arguments in a call expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all arguments of the expression must be aligned with the first argument. This can also be set to `"off"` to disable checking for CallExpression arguments.
-* `"ArrayExpression"` (default: 1) enforces indentation level for elements in arrays. It can also be set to the string `"first"`, indicating that all the elements in the array should be aligned with the first element. This can also be set to `"off"` to disable checking for array elements.
-* `"ObjectExpression"` (default: 1) enforces indentation level for properties in objects. It can be set to the string `"first"`, indicating that all properties in the object should be aligned with the first property. This can also be set to `"off"` to disable checking for object properties.
-* `"ImportDeclaration"` (default: 1) enforces indentation level for import statements. It can be set to the string `"first"`, indicating that all imported members from a module should be aligned with the first member in the list. This can also be set to `"off"` to disable checking for imported module members.
-* `"flatTernaryExpressions": true` (`false` by default) requires no indentation for ternary expressions which are nested in other ternary expressions.
-* `"offsetTernaryExpressions": true` (`false` by default) requires indentation for values of ternary expressions.
-* `"ignoreComments"` (default: false) can be used when comments do not need to be aligned with nodes on the previous or next line.
-
-Level of indentation denotes the multiple of the indent specified. Example:
-
-* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.
-* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.
-* Indent of 2 spaces with `VariableDeclarator` set to `{"var": 2, "let": 2, "const": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.
-* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.
-* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.
-* Indent of 2 spaces with `SwitchCase` set to `1` will indent `case` clauses with 2 spaces with respect to `switch` statements.
-* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.
-* Indent of tab with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.
-* Indent of 2 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
-* Indent of 2 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 2 spaces.
-* Indent of 2 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 4 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 4 spaces.
-* Indent of 4 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 8 spaces.
-
-### tab
-
-Examples of **incorrect** code for this rule with the `"tab"` option:
-
-```js
-/*eslint indent: ["error", "tab"]*/
-
-if (a) {
-     b=c;
-function foo(d) {
-           e=f;
- }
-}
-```
-
-Examples of **correct** code for this rule with the `"tab"` option:
-
-```js
-/*eslint indent: ["error", "tab"]*/
-
-if (a) {
-/*tab*/b=c;
-/*tab*/function foo(d) {
-/*tab*//*tab*/e=f;
-/*tab*/}
-}
-```
-
-### ignoredNodes
-
-The following configuration ignores the indentation of `ConditionalExpression` ("ternary expression") nodes:
-
-Examples of **correct** code for this rule with the `4, { "ignoredNodes": ["ConditionalExpression"] }` option:
-
-```js
-/*eslint indent: ["error", 4, { "ignoredNodes": ["ConditionalExpression"] }]*/
-
-var a = foo
-      ? bar
-      : baz;
-
-var a = foo
-                ? bar
-: baz;
-```
-
-The following configuration ignores indentation in the body of IIFEs.
-
-Examples of **correct** code for this rule with the `4, { "ignoredNodes": ["CallExpression > FunctionExpression.callee > BlockStatement.body"] }` option:
-
-```js
-/*eslint indent: ["error", 4, { "ignoredNodes": ["CallExpression > FunctionExpression.callee > BlockStatement.body"] }]*/
-
-(function() {
-
-foo();
-bar();
-
-})
-```
-
-All AST node types can be found at [ESTree](https://github.com/estree/estree) specification. You can use [AST Explorer](https://astexplorer.net/) with the espree parser to examine AST tree of a code snippet.
-
-### SwitchCase
-
-Examples of **incorrect** code for this rule with the `2, { "SwitchCase": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
-
-switch(a){
-case "a":
-    break;
-case "b":
-    break;
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "SwitchCase": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
-
-switch(a){
-  case "a":
-    break;
-  case "b":
-    break;
-}
-```
-
-### VariableDeclarator
-
-Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-    b = 2,
-    c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
-/*eslint-env es6*/
-
-var a,
-  b,
-  c;
-let a,
-  b,
-  c;
-const a = 1,
-  b = 2,
-  c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 2 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": 2 }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-    b = 2,
-    c = 3;
-```
-
-Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": "first" }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": "first" }]*/
-/*eslint-env es6*/
-
-var a,
-  b,
-  c;
-let a,
-  b,
-  c;
-const a = 1,
-  b = 2,
-  c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": "first" }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": "first" }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-      b = 2,
-      c = 3;
-```
-
-Examples of **correct** code for this rule with the `2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }` options:
-
-```js
-/*eslint indent: ["error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }]*/
-/*eslint-env es6*/
-
-var a,
-    b,
-    c;
-let a,
-    b,
-    c;
-const a = 1,
-      b = 2,
-      c = 3;
-```
-
-### outerIIFEBody
-
-Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
-
-```js
-/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
-
-(function() {
-
-  function foo(x) {
-    return x + 1;
-  }
-
-})();
-
-
-if (y) {
-console.log('foo');
-}
-```
-
-Examples of **correct** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
-
-```js
-/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
-
-(function() {
-
-function foo(x) {
-  return x + 1;
-}
-
-})();
-
-
-if (y) {
-   console.log('foo');
-}
-```
-
-Examples of **correct** code for this rule with the options `2, { "outerIIFEBody":  "off" }`:
-
-```js
-/*eslint indent: ["error", 2, { "outerIIFEBody": "off" }]*/
-
-(function() {
-
-function foo(x) {
-  return x + 1;
-}
-
-})();
-
-(function() {
-
-  function foo(x) {
-    return x + 1;
-  }
-
-})();
-
-if (y) {
-  console.log('foo');
-}
-```
-
-### MemberExpression
-
-Examples of **incorrect** code for this rule with the `2, { "MemberExpression": 1 }` options:
-
-```js
-/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
-
-foo
-.bar
-.baz()
-```
-
-Examples of **correct** code for this rule with the `2, { "MemberExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
-
-foo
-  .bar
-  .baz();
-```
-
-### FunctionDeclaration
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
-
-function foo(bar,
-  baz,
-  qux) {
-    qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
-
-function foo(bar,
-    baz,
-    qux) {
-  qux();
-}
-```
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
-
-function foo(bar, baz,
-  qux, boop) {
-  qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
-
-function foo(bar, baz,
-             qux, boop) {
-  qux();
-}
-```
-
-### FunctionExpression
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
-
-var foo = function(bar,
-  baz,
-  qux) {
-    qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
-
-var foo = function(bar,
-    baz,
-    qux) {
-  qux();
-}
-```
-
-Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
-
-var foo = function(bar, baz,
-  qux, boop) {
-  qux();
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
-
-var foo = function(bar, baz,
-                   qux, boop) {
-  qux();
-}
-```
-
-### StaticBlock
-
-Examples of **incorrect** code for this rule with the `2, { "StaticBlock": {"body": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "StaticBlock": {"body": 1} }]*/
-
-class C {
-  static {
-      foo();
-  }
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "StaticBlock": {"body": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "StaticBlock": {"body": 1} }]*/
-
-class C {
-  static {
-    foo();
-  }
-}
-```
-
-Examples of **incorrect** code for this rule with the `2, { "StaticBlock": {"body": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "StaticBlock": {"body": 2} }]*/
-
-class C {
-  static {
-    foo();
-  }
-}
-```
-
-Examples of **correct** code for this rule with the `2, { "StaticBlock": {"body": 2} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "StaticBlock": {"body": 2} }]*/
-
-class C {
-  static {
-      foo();
-  }
-}
-```
-
-### CallExpression
-
-Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
-
-foo(bar,
-    baz,
-      qux
-);
-```
-
-Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
-
-```js
-/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
-
-foo(bar,
-  baz,
-  qux
-);
-```
-
-Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
-
-foo(bar, baz,
-  baz, boop, beep);
-```
-
-Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
-
-```js
-/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
-
-foo(bar, baz,
-    baz, boop, beep);
-```
-
-### ArrayExpression
-
-Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
-
-var foo = [
-    bar,
-baz,
-      qux
-];
-```
-
-Examples of **correct** code for this rule with the `2, { "ArrayExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
-
-var foo = [
-  bar,
-  baz,
-  qux
-];
-```
-
-Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
-
-var foo = [bar,
-  baz,
-  qux
-];
-```
-
-Examples of **correct** code for this rule with the `2, { "ArrayExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
-
-var foo = [bar,
-           baz,
-           qux
-];
-```
-
-### ObjectExpression
-
-Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
-
-var foo = {
-    bar: 1,
-baz: 2,
-      qux: 3
-};
-```
-
-Examples of **correct** code for this rule with the `2, { "ObjectExpression": 1 }` option:
-
-```js
-/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
-
-var foo = {
-  bar: 1,
-  baz: 2,
-  qux: 3
-};
-```
-
-Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
-
-var foo = { bar: 1,
-  baz: 2 };
-```
-
-Examples of **correct** code for this rule with the `2, { "ObjectExpression": "first" }` option:
-
-```js
-/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
-
-var foo = { bar: 1,
-            baz: 2 };
-```
-
-### ImportDeclaration
-
-Examples of **correct** code for this rule with the `4, { "ImportDeclaration": 1 }` option (the default):
-
-```js
-/*eslint indent: ["error", 4, { "ImportDeclaration": 1 }]*/
-
-import { foo,
-    bar,
-    baz,
-} from 'qux';
-
-import {
-    foo,
-    bar,
-    baz,
-} from 'qux';
-```
-
-Examples of **incorrect** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
-
-```js
-/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
-
-import { foo,
-    bar,
-    baz,
-} from 'qux';
-```
-
-Examples of **correct** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
-
-```js
-/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
-
-import { foo,
-         bar,
-         baz,
-} from 'qux';
-```
-
-### flatTernaryExpressions
-
-Examples of **incorrect** code for this rule with the default `4, { "flatTernaryExpressions": false }` option:
-
-```js
-/*eslint indent: ["error", 4, { "flatTernaryExpressions": false }]*/
-
-var a =
-    foo ? bar :
-    baz ? qux :
-    boop;
-```
-
-Examples of **correct** code for this rule with the default `4, { "flatTernaryExpressions": false }` option:
-
-```js
-/*eslint indent: ["error", 4, { "flatTernaryExpressions": false }]*/
-
-var a =
-    foo ? bar :
-        baz ? qux :
-            boop;
-```
-
-Examples of **incorrect** code for this rule with the `4, { "flatTernaryExpressions": true }` option:
-
-```js
-/*eslint indent: ["error", 4, { "flatTernaryExpressions": true }]*/
-
-var a =
-    foo ? bar :
-        baz ? qux :
-            boop;
-```
-
-Examples of **correct** code for this rule with the `4, { "flatTernaryExpressions": true }` option:
-
-```js
-/*eslint indent: ["error", 4, { "flatTernaryExpressions": true }]*/
-
-var a =
-    foo ? bar :
-    baz ? qux :
-    boop;
-```
-
-### offsetTernaryExpressions
-
-Examples of **incorrect** code for this rule with the default `2, { "offsetTernaryExpressions": false }` option:
-
-```js
-/*eslint indent: ["error", 2, { "offsetTernaryExpressions": false }]*/
-
-condition
-  ? () => {
-      return true
-    }
-  : () => {
-      false
-    }
-```
-
-Examples of **correct** code for this rule with the default `2, { "offsetTernaryExpressions": false }` option:
-
-```js
-/*eslint indent: ["error", 2, { "offsetTernaryExpressions": false }]*/
-
-condition
-  ? () => {
-    return true
-  }
-  : condition2
-    ? () => {
-      return true
-    }
-    : () => {
-      return false
-    }
-```
-
-Examples of **incorrect** code for this rule with the `2, { "offsetTernaryExpressions": true }` option:
-
-```js
-/*eslint indent: ["error", 2, { "offsetTernaryExpressions": true }]*/
-
-condition
-  ? () => {
-    return true
-  }
-  : condition2
-    ? () => {
-      return true
-    }
-    : () => {
-      return false
-    }
-```
-
-Examples of **correct** code for this rule with the `2, { "offsetTernaryExpressions": true }` option:
-
-```js
-/*eslint indent: ["error", 2, { "offsetTernaryExpressions": true }]*/
-
-condition
-  ? () => {
-      return true
-    }
-  : condition2
-    ? () => {
-        return true
-      }
-    : () => {
-        return false
-      }
-```
-
-### ignoreComments
-
-Examples of additional **correct** code for this rule with the `4, { "ignoreComments": true }` option:
-
-```js
-/*eslint indent: ["error", 4, { "ignoreComments": true }] */
-
-if (foo) {
-    doSomething();
-
-// comment intentionally de-indented
-    doSomethingElse();
-}
-```
-
-## Compatibility
-
-* **JSHint**: `indent`
-* **JSCS**: [validateIndentation](https://jscs-dev.github.io/rule/validateIndentation)
diff --git a/eslint/docs/rules/init-declarations.md b/eslint/docs/rules/init-declarations.md
deleted file mode 100644 (file)
index 97c831a..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-# require or disallow initialization in variable declarations (init-declarations)
-
-In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, `foo` is initialized during declaration, while `bar` is initialized later.
-
-```js
-var foo = 1;
-var bar;
-
-if (foo) {
-    bar = 1;
-} else {
-    bar = 2;
-}
-```
-
-## Rule Details
-
-This rule is aimed at enforcing or eliminating variable initializations during declaration. For example, in the following code, `foo` is initialized during declaration, while `bar` is not.
-
-```js
-var foo = 1;
-var bar;
-
-bar = 2;
-```
-
-This rule aims to bring consistency to variable initializations and declarations.
-
-## Options
-
-The rule takes two options:
-
-1. A string which must be either `"always"` (the default), to enforce initialization at declaration, or `"never"` to disallow initialization during declaration. This rule applies to `var`, `let`, and `const` variables, however `"never"` is ignored for `const` variables, as unassigned `const`s generate a parse error.
-2. An object that further controls the behavior of this rule. Currently, the only available parameter is `ignoreForLoopInit`, which indicates if initialization at declaration is allowed in `for` loops when `"never"` is set, since it is a very typical use case.
-
-You can configure the rule as follows:
-
-Variables must be initialized at declaration (default)
-
-```json
-{
-    "init-declarations": ["error", "always"],
-}
-```
-
-Variables must not be initialized at declaration
-
-```json
-{
-    "init-declarations": ["error", "never"]
-}
-```
-
-Variables must not be initialized at declaration, except in for loops, where it is allowed
-
-```json
-{
-    "init-declarations": ["error", "never", { "ignoreForLoopInit": true }]
-}
-```
-
-### always
-
-Examples of **incorrect** code for the default `"always"` option:
-
-```js
-/*eslint init-declarations: ["error", "always"]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar;
-    let baz;
-}
-```
-
-Examples of **correct** code for the default `"always"` option:
-
-```js
-/*eslint init-declarations: ["error", "always"]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar = 1;
-    let baz = 2;
-    const qux = 3;
-}
-```
-
-### never
-
-Examples of **incorrect** code for the `"never"` option:
-
-```js
-/*eslint init-declarations: ["error", "never"]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar = 1;
-    let baz = 2;
-
-    for (var i = 0; i < 1; i++) {}
-}
-```
-
-Examples of **correct** code for the `"never"` option:
-
-```js
-/*eslint init-declarations: ["error", "never"]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar;
-    let baz;
-    const buzz = 1;
-}
-```
-
-The `"never"` option ignores `const` variable initializations.
-
-### ignoreForLoopInit
-
-Examples of **correct** code for the `"never", { "ignoreForLoopInit": true }` options:
-
-```js
-/*eslint init-declarations: ["error", "never", { "ignoreForLoopInit": true }]*/
-for (var i = 0; i < 1; i++) {}
-```
-
-## When Not To Use It
-
-When you are indifferent as to how your variables are initialized.
diff --git a/eslint/docs/rules/jsx-quotes.md b/eslint/docs/rules/jsx-quotes.md
deleted file mode 100644 (file)
index ba0b876..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# enforce the consistent use of either double or single quotes in JSX attributes (jsx-quotes)
-
-JSX attribute values can contain string literals, which are delimited with single or double quotes.
-
-```xml
-<a b='c' />
-<a b="c" />
-```
-
-Unlike string literals in JavaScript, string literals within JSX attributes can’t contain escaped quotes.
-If you want to have e.g. a double quote within a JSX attribute value, you have to use single quotes as string delimiter.
-
-```xml
-<a b="'" />
-<a b='"' />
-```
-
-## Rule Details
-
-This rule enforces the consistent use of either double or single quotes in JSX attributes.
-
-## Options
-
-This rule has a string option:
-
-* `"prefer-double"` (default) enforces the use of double quotes for all JSX attribute values that don't contain a double quote.
-* `"prefer-single"` enforces the use of single quotes for all JSX attribute values that don’t contain a single quote.
-
-### prefer-double
-
-Examples of **incorrect** code for this rule with the default `"prefer-double"` option:
-
-```xml
-/*eslint jsx-quotes: ["error", "prefer-double"]*/
-
-<a b='c' />
-```
-
-Examples of **correct** code for this rule with the default `"prefer-double"` option:
-
-```xml
-/*eslint jsx-quotes: ["error", "prefer-double"]*/
-
-<a b="c" />
-<a b='"' />
-```
-
-### prefer-single
-
-Examples of **incorrect** code for this rule with the `"prefer-single"` option:
-
-```xml
-/*eslint jsx-quotes: ["error", "prefer-single"]*/
-
-<a b="c" />
-```
-
-Examples of **correct** code for this rule with the `"prefer-single"` option:
-
-```xml
-/*eslint jsx-quotes: ["error", "prefer-single"]*/
-
-<a b='c' />
-<a b="'" />
-```
-
-## When Not To Use It
-
-You can turn this rule off if you don’t use JSX or if you aren’t concerned with a consistent usage of quotes within JSX attributes.
-
-## Related Rules
-
-* [quotes](quotes.md)
diff --git a/eslint/docs/rules/key-spacing.md b/eslint/docs/rules/key-spacing.md
deleted file mode 100644 (file)
index c94b11f..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-# enforce consistent spacing between keys and values in object literal properties (key-spacing)
-
-This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal.
-
-## Rule Details
-
-This rule enforces consistent spacing between keys and values in object literal properties. In the case of long lines, it is acceptable to add a new line wherever whitespace is allowed.
-
-## Options
-
-This rule has an object option:
-
-* `"beforeColon": false (default) | true`
-    * `false`: disallows spaces between the key and the colon in object literals.
-    * `true`: requires at least one space between the key and the colon in object literals.
-* `"afterColon": true (default) | false`
-    * `true`: requires at least one space between the colon and the value in object literals.
-    * `false`: disallows spaces between the colon and the value in object literals.
-* `"mode": "strict" (default) | "minimum"`
-    * `"strict"`: enforces exactly one space before or after colons in object literals.
-    * `"minimum"`: enforces one or more spaces before or after colons in object literals.
-* `"align": "value" | "colon"`
-    * `"value"`: enforces horizontal alignment of values in object literals.
-    * `"colon"` enforces horizontal alignment of both colons and values in object literals.
-* `"align"` with an object value allows for fine-grained spacing when values are being aligned in object literals.
-* `"singleLine"` specifies a spacing style for single-line object literals.
-* `"multiLine"` specifies a spacing style for multi-line object literals.
-
-Please note that you can either use the top-level options or the grouped options (`singleLine` and `multiLine`) but not both.
-
-### beforeColon
-
-Examples of **incorrect** code for this rule with the default `{ "beforeColon": false }` option:
-
-```js
-/*eslint key-spacing: ["error", { "beforeColon": false }]*/
-
-var obj = { "foo" : 42 };
-```
-
-Examples of **correct** code for this rule with the default `{ "beforeColon": false }` option:
-
-```js
-/*eslint key-spacing: ["error", { "beforeColon": false }]*/
-
-var obj = { "foo": 42 };
-```
-
-Examples of **incorrect** code for this rule with the `{ "beforeColon": true }` option:
-
-```js
-/*eslint key-spacing: ["error", { "beforeColon": true }]*/
-
-var obj = { "foo": 42 };
-```
-
-Examples of **correct** code for this rule with the `{ "beforeColon": true }` option:
-
-```js
-/*eslint key-spacing: ["error", { "beforeColon": true }]*/
-
-var obj = { "foo" : 42 };
-```
-
-### afterColon
-
-Examples of **incorrect** code for this rule with the default `{ "afterColon": true }` option:
-
-```js
-/*eslint key-spacing: ["error", { "afterColon": true }]*/
-
-var obj = { "foo":42 };
-```
-
-Examples of **correct** code for this rule with the default `{ "afterColon": true }` option:
-
-```js
-/*eslint key-spacing: ["error", { "afterColon": true }]*/
-
-var obj = { "foo": 42 };
-```
-
-Examples of **incorrect** code for this rule with the `{ "afterColon": false }` option:
-
-```js
-/*eslint key-spacing: ["error", { "afterColon": false }]*/
-
-var obj = { "foo": 42 };
-```
-
-Examples of **correct** code for this rule with the `{ "afterColon": false }` option:
-
-```js
-/*eslint key-spacing: ["error", { "afterColon": false }]*/
-
-var obj = { "foo":42 };
-```
-
-### mode
-
-Examples of **incorrect** code for this rule with the default `{ "mode": "strict" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "mode": "strict" }]*/
-
-call({
-    foobar: 42,
-    bat:    2 * 2
-});
-```
-
-Examples of **correct** code for this rule with the default `{ "mode": "strict" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "mode": "strict" }]*/
-
-call({
-    foobar: 42,
-    bat: 2 * 2
-});
-```
-
-Examples of **correct** code for this rule with the `{ "mode": "minimum" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "mode": "minimum" }]*/
-
-call({
-    foobar: 42,
-    bat:    2 * 2
-});
-```
-
-### align
-
-Examples of **incorrect** code for this rule with the `{ "align": "value" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "align": "value" }]*/
-
-var obj = {
-    a: value,
-    bcde:  42,
-    fg :   foo()
-};
-```
-
-Examples of **correct** code for this rule with the `{ "align": "value" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "align": "value" }]*/
-
-var obj = {
-    a:    value,
-    bcde: 42,
-
-    fg: foo(),
-    h:  function() {
-        return this.a;
-    },
-    ijkl: 'Non-consecutive lines form a new group'
-};
-
-var obj = { a: "foo", longPropertyName: "bar" };
-```
-
-Examples of **incorrect** code for this rule with the `{ "align": "colon" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "align": "colon" }]*/
-
-call({
-    foobar: 42,
-    bat:    2 * 2
-});
-```
-
-Examples of **correct** code for this rule with the `{ "align": "colon" }` option:
-
-```js
-/*eslint key-spacing: ["error", { "align": "colon" }]*/
-
-call({
-    foobar: 42,
-    bat   : 2 * 2
-});
-```
-
-### align
-
-The `align` option can take additional configuration through the `beforeColon`, `afterColon`, `mode`, and `on` options.
-
-If `align` is defined as an object, but not all of the parameters are provided, undefined parameters will default to the following:
-
-```js
-// Defaults
-align: {
-    "beforeColon": false,
-    "afterColon": true,
-    "on": "colon",
-    "mode": "strict"
-}
-```
-
-Examples of **correct** code for this rule with sample `{ "align": { } }` options:
-
-```js
-/*eslint key-spacing: ["error", {
-    "align": {
-        "beforeColon": true,
-        "afterColon": true,
-        "on": "colon"
-    }
-}]*/
-
-var obj = {
-    "one"   : 1,
-    "seven" : 7
-}
-```
-
-```js
-/*eslint key-spacing: ["error", {
-    "align": {
-        "beforeColon": false,
-        "afterColon": false,
-        "on": "value"
-    }
-}]*/
-
-var obj = {
-    "one":  1,
-    "seven":7
-}
-```
-
-### align and multiLine
-
-The `multiLine` and `align` options can differ, which allows for fine-tuned control over the `key-spacing` of your files.  `align` will **not** inherit from `multiLine` if `align` is configured as an object.
-
-`multiLine` is used any time  an object literal spans multiple lines.  The `align` configuration is used when there is a group of properties in the same object. For example:
-
-```javascript
-var myObj = {
-  key1: 1, // uses multiLine
-
-  key2: 2, // uses align (when defined)
-  key3: 3, // uses align (when defined)
-
-  key4: 4 // uses multiLine
-}
-
-```
-
-Examples of **incorrect** code for this rule with sample `{ "align": { }, "multiLine": { } }` options:
-
-```js
-/*eslint key-spacing: ["error", {
-    "multiLine": {
-        "beforeColon": false,
-        "afterColon":true
-    },
-    "align": {
-        "beforeColon": true,
-        "afterColon": true,
-        "on": "colon"
-    }
-}]*/
-
-var obj = {
-    "myObjectFunction": function() {
-        // Do something
-    },
-    "one"             : 1,
-    "seven"           : 7
-}
-```
-
-Examples of **correct** code for this rule with sample `{ "align": { }, "multiLine": { } }` options:
-
-```js
-/*eslint key-spacing: ["error", {
-    "multiLine": {
-        "beforeColon": false,
-        "afterColon": true
-
-    },
-    "align": {
-        "beforeColon": true,
-        "afterColon": true,
-        "on": "colon"
-    }
-}]*/
-
-var obj = {
-    "myObjectFunction": function() {
-        // Do something
-        //
-    }, // These are two separate groups, so no alignment between `myObjectFuction` and `one`
-    "one"   : 1,
-    "seven" : 7 // `one` and `seven` are in their own group, and therefore aligned
-}
-```
-
-### singleLine and multiLine
-
-Examples of **correct** code for this rule with sample `{ "singleLine": { }, "multiLine": { } }` options:
-
-```js
-/*eslint "key-spacing": [2, {
-    "singleLine": {
-        "beforeColon": false,
-        "afterColon": true
-    },
-    "multiLine": {
-        "beforeColon": true,
-        "afterColon": true,
-        "align": "colon"
-    }
-}]*/
-var obj = { one: 1, "two": 2, three: 3 };
-var obj2 = {
-    "two" : 2,
-    three : 3
-};
-```
-
-## When Not To Use It
-
-If you have another convention for property spacing that might not be consistent with the available options, or if you want to permit multiple styles concurrently you can safely disable this rule.
diff --git a/eslint/docs/rules/keyword-spacing.md b/eslint/docs/rules/keyword-spacing.md
deleted file mode 100644 (file)
index 8ca6739..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-# enforce consistent spacing before and after keywords (keyword-spacing)
-
-Keywords are syntax elements of JavaScript, such as `try` and `if`.
-These keywords have special meaning to the language and so often appear in a different color in code editors.
-As an important part of the language, style guides often refer to the spacing that should be used around keywords.
-For example, you might have a style guide that says keywords should be always surrounded by spaces, which would mean `if-else` statements must look like this:
-
-```js
-if (foo) {
-    // ...
-} else {
-    // ...
-}
-```
-
-Of course, you could also have a style guide that disallows spaces around keywords.
-
-However, if you want to enforce the style of spacing between the `function` keyword and the following opening parenthesis, please refer to [space-before-function-paren](space-before-function-paren.md).
-
-## Rule Details
-
-This rule enforces consistent spacing around keywords and keyword-like tokens: `as` (in module declarations), `async` (of async functions), `await` (of await expressions), `break`, `case`, `catch`, `class`, `const`, `continue`, `debugger`, `default`, `delete`, `do`, `else`, `export`, `extends`, `finally`, `for`, `from` (in module declarations), `function`, `get` (of getters), `if`, `import`, `in` (in for-in statements), `let`, `new`, `of` (in for-of statements), `return`, `set` (of setters), `static`, `super`, `switch`, `this`, `throw`, `try`, `typeof`, `var`, `void`, `while`, `with`, and `yield`. This rule is designed carefully not to conflict with other spacing rules: it does not apply to spacing where other rules report problems.
-
-## Options
-
-This rule has an object option:
-
-* `"before": true` (default) requires at least one space before keywords
-* `"before": false` disallows spaces before keywords
-* `"after": true` (default) requires at least one space after keywords
-* `"after": false` disallows spaces after keywords
-* `"overrides"` allows overriding spacing style for specified keywords
-
-### before
-
-Examples of **incorrect** code for this rule with the default `{ "before": true }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "before": true }]*/
-
-if (foo) {
-    //...
-}else if (bar) {
-    //...
-}else {
-    //...
-}
-```
-
-Examples of **correct** code for this rule with the default `{ "before": true }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "before": true }]*/
-/*eslint-env es6*/
-
-if (foo) {
-    //...
-} else if (bar) {
-    //...
-} else {
-    //...
-}
-
-// Avoid conflict with `array-bracket-spacing`
-let a = [this];
-let b = [function() {}];
-
-// Avoid conflict with `arrow-spacing`
-let a = ()=> this.foo;
-
-// Avoid conflict with `block-spacing`
-{function foo() {}}
-
-// Avoid conflict with `comma-spacing`
-let a = [100,this.foo, this.bar];
-
-// Avoid conflict with `computed-property-spacing`
-obj[this.foo] = 0;
-
-// Avoid conflict with `generator-star-spacing`
-function *foo() {}
-
-// Avoid conflict with `key-spacing`
-let obj = {
-    foo:function() {}
-};
-
-// Avoid conflict with `object-curly-spacing`
-let obj = {foo: this};
-
-// Avoid conflict with `semi-spacing`
-let a = this;function foo() {}
-
-// Avoid conflict with `space-in-parens`
-(function () {})();
-
-// Avoid conflict with `space-infix-ops`
-if ("foo"in {foo: 0}) {}
-if (10+this.foo<= this.bar) {}
-
-// Avoid conflict with `jsx-curly-spacing`
-let a = <A foo={this.foo} bar={function(){}} />
-```
-
-Examples of **incorrect** code for this rule with the `{ "before": false }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "before": false }]*/
-
-if (foo) {
-    //...
-} else if (bar) {
-    //...
-} else {
-    //...
-}
-```
-
-Examples of **correct** code for this rule with the `{ "before": false }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "before": false }]*/
-
-if (foo) {
-    //...
-}else if (bar) {
-    //...
-}else {
-    //...
-}
-```
-
-### after
-
-Examples of **incorrect** code for this rule with the default `{ "after": true }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "after": true }]*/
-
-if(foo) {
-    //...
-} else if(bar) {
-    //...
-} else{
-    //...
-}
-```
-
-Examples of **correct** code for this rule with the default `{ "after": true }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "after": true }]*/
-
-if (foo) {
-    //...
-} else if (bar) {
-    //...
-} else {
-    //...
-}
-
-// Avoid conflict with `array-bracket-spacing`
-let a = [this];
-
-// Avoid conflict with `arrow-spacing`
-let a = ()=> this.foo;
-
-// Avoid conflict with `comma-spacing`
-let a = [100, this.foo, this.bar];
-
-// Avoid conflict with `computed-property-spacing`
-obj[this.foo] = 0;
-
-// Avoid conflict with `generator-star-spacing`
-function* foo() {}
-
-// Avoid conflict with `key-spacing`
-let obj = {
-    foo:function() {}
-};
-
-// Avoid conflict with `func-call-spacing`
-class A {
-    constructor() {
-        super();
-    }
-}
-
-// Avoid conflict with `object-curly-spacing`
-let obj = {foo: this};
-
-// Avoid conflict with `semi-spacing`
-let a = this;function foo() {}
-
-// Avoid conflict with `space-before-function-paren`
-function() {}
-
-// Avoid conflict with `space-infix-ops`
-if ("foo"in{foo: 0}) {}
-if (10+this.foo<= this.bar) {}
-
-// Avoid conflict with `space-unary-ops`
-function* foo(a) {
-    return yield+a;
-}
-
-// Avoid conflict with `yield-star-spacing`
-function* foo(a) {
-    return yield* a;
-}
-
-// Avoid conflict with `jsx-curly-spacing`
-let a = <A foo={this.foo} bar={function(){}} />
-```
-
-Examples of **incorrect** code for this rule with the `{ "after": false }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "after": false }]*/
-
-if (foo) {
-    //...
-} else if (bar) {
-    //...
-} else {
-    //...
-}
-```
-
-Examples of **correct** code for this rule with the `{ "after": false }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "after": false }]*/
-
-if(foo) {
-    //...
-} else if(bar) {
-    //...
-} else{
-    //...
-}
-```
-
-### overrides
-
-Examples of **correct** code for this rule with the `{ "overrides": { "if": { "after": false }, "for": { "after": false }, "while": { "after": false }, "static": { "after": false } } }` option:
-
-```js
-/*eslint keyword-spacing: ["error", { "overrides": {
-  "if": { "after": false },
-  "for": { "after": false },
-  "while": { "after": false },
-  "static": { "after": false }
-} }]*/
-
-if(foo) {
-    //...
-} else if(bar) {
-    //...
-} else {
-    //...
-}
-
-for(;;);
-
-while(true) {
-    //...
-}
-
-class C {
-    static{
-        //...
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to enforce consistency on keyword spacing, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/line-comment-position.md b/eslint/docs/rules/line-comment-position.md
deleted file mode 100644 (file)
index 2e0eef8..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-# enforce position of line comments (line-comment-position)
-
-Line comments can be positioned above or beside code. This rule helps teams maintain a consistent style.
-
-```js
-// above comment
-var foo = "bar";  // beside comment
-```
-
-## Rule Details
-
-This rule enforces consistent position of line comments. Block comments are not affected by this rule. By default, this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`, `falls through`.
-
-## Options
-
-This rule takes one argument, which can be a string or an object. The string settings are the same as those of the `position` property (explained below). The object option has the following properties:
-
-### position
-
-The `position` option has two settings:
-
-* `above` (default) enforces line comments only above code, in its own line.
-* `beside` enforces line comments only at the end of code lines.
-
-#### position: above
-
-Examples of **correct** code for the `{ "position": "above" }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "position": "above" }]*/
-// valid comment
-1 + 1;
-```
-
-Examples of **incorrect** code for the `{ "position": "above" }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "position": "above" }]*/
-1 + 1; // invalid comment
-```
-
-#### position: beside
-
-Examples of **correct** code for the `{ "position": "beside" }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "position": "beside" }]*/
-1 + 1; // valid comment
-```
-
-Examples of **incorrect** code for the `{ "position": "beside" }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "position": "beside" }]*/
-// invalid comment
-1 + 1;
-```
-
-### ignorePattern
-
-By default this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`, `falls through`. An alternative regular expression can be provided.
-
-Examples of **correct** code for the `ignorePattern` option:
-
-```js
-/*eslint line-comment-position: ["error", { "ignorePattern": "pragma" }]*/
-1 + 1; // pragma valid comment
-```
-
-Examples of **incorrect** code for the `ignorePattern` option:
-
-```js
-/*eslint line-comment-position: ["error", { "ignorePattern": "pragma" }]*/
-1 + 1; // invalid comment
-```
-
-### applyDefaultIgnorePatterns
-
-Default ignore patterns are applied even when `ignorePattern` is provided. If you want to omit default patterns, set this option to `false`.
-
-Examples of **correct** code for the `{ "applyDefaultIgnorePatterns": false }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "ignorePattern": "pragma", "applyDefaultIgnorePatterns": false }]*/
-1 + 1; // pragma valid comment
-```
-
-Examples of **incorrect** code for the `{ "applyDefaultIgnorePatterns": false }` option:
-
-```js
-/*eslint line-comment-position: ["error", { "ignorePattern": "pragma", "applyDefaultIgnorePatterns": false }]*/
-1 + 1; // falls through
-```
-
-**Deprecated:** the object property `applyDefaultPatterns` is deprecated. Please use the property `applyDefaultIgnorePatterns` instead.
-
-## When Not To Use It
-
-If you aren't concerned about having different line comment styles, then you can turn off this rule.
-
-## Compatibility
-
-**JSCS**: [validateCommentPosition](https://jscs-dev.github.io/rule/validateCommentPosition)
diff --git a/eslint/docs/rules/linebreak-style.md b/eslint/docs/rules/linebreak-style.md
deleted file mode 100644 (file)
index a4eb620..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# enforce consistent linebreak style (linebreak-style)
-
-When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that
-different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
-
-The linebreaks (new lines) used in windows operating system are usually _carriage returns_ (CR) followed by a _line feed_ (LF) making it a _carriage return line feed_ (CRLF)
-whereas Linux and Unix use a simple _line feed_ (LF). The corresponding _control sequences_ are `"\n"` (for LF) and `"\r\n"` for (CRLF).
-
-Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
-
-## Rule Details
-
-This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
-
-### Options
-
-This rule has a string option:
-
-* `"unix"` (default) enforces the usage of Unix line endings: `\n` for LF.
-* `"windows"` enforces the usage of Windows line endings: `\r\n` for CRLF.
-
-### unix
-
-Examples of **incorrect** code for this rule with the default `"unix"` option:
-
-```js
-/*eslint linebreak-style: ["error", "unix"]*/
-
-var a = 'a'; // \r\n
-
-```
-
-Examples of **correct** code for this rule with the default `"unix"` option:
-
-```js
-/*eslint linebreak-style: ["error", "unix"]*/
-
-var a = 'a', // \n
-    b = 'b'; // \n
-// \n
-function foo(params) { // \n
-    // do stuff \n
-}// \n
-```
-
-### windows
-
-Examples of **incorrect** code for this rule with the `"windows"` option:
-
-```js
-/*eslint linebreak-style: ["error", "windows"]*/
-
-var a = 'a'; // \n
-```
-
-Examples of **correct** code for this rule with the `"windows"` option:
-
-```js
-/*eslint linebreak-style: ["error", "windows"]*/
-
-var a = 'a', // \r\n
-    b = 'b'; // \r\n
-// \r\n
-function foo(params) { // \r\n
-    // do stuff \r\n
-} // \r\n
-```
-
-## Using this rule with version control systems
-
-Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
-
-For example, the default behavior of [git](https://git-scm.com/) on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the `linebreak-style` rule to report errors if configured with the `"unix"` setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your [`.gitattributes` file](https://git-scm.com/docs/gitattributes) to prevent git from converting linebreaks in `.js` files:
-
-```pt
-*.js text eol=lf
-```
-
-## When Not To Use It
-
-If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
-
-## Compatibility
-
-* **JSCS**: [validateLineBreaks](https://jscs-dev.github.io/rule/validateLineBreaks)
diff --git a/eslint/docs/rules/lines-around-comment.md b/eslint/docs/rules/lines-around-comment.md
deleted file mode 100644 (file)
index b13d525..0000000
+++ /dev/null
@@ -1,576 +0,0 @@
-# require empty lines around comments (lines-around-comment)
-
-Many style guides require empty lines before or after comments. The primary goal
-of these rules is to make the comments easier to read and improve readability of the code.
-
-## Rule Details
-
-This rule requires empty lines before and/or after comments. It can be enabled separately for both block (`/*`) and line (`//`) comments. This rule does not apply to comments that appear on the same line as code and does not require empty lines at the beginning or end of a file.
-
-## Options
-
-This rule has an object option:
-
-* `"beforeBlockComment": true` (default) requires an empty line before block comments
-* `"afterBlockComment": true` requires an empty line after block comments
-* `"beforeLineComment": true` requires an empty line before line comments
-* `"afterLineComment": true` requires an empty line after line comments
-* `"allowBlockStart": true` allows comments to appear at the start of block statements, function bodies, classes, and class static blocks
-* `"allowBlockEnd": true` allows comments to appear at the end of block statements, function bodies, classes, and class static blocks
-* `"allowObjectStart": true` allows comments to appear at the start of object literals
-* `"allowObjectEnd": true` allows comments to appear at the end of object literals
-* `"allowArrayStart": true` allows comments to appear at the start of array literals
-* `"allowArrayEnd": true` allows comments to appear at the end of array literals
-* `"allowClassStart": true` allows comments to appear at the start of classes
-* `"allowClassEnd": true` allows comments to appear at the end of classes
-* `"applyDefaultIgnorePatterns"` enables or disables the default comment patterns to be ignored by the rule
-* `"ignorePattern"` custom patterns to be ignored by the rule
-
-### beforeBlockComment
-
-Examples of **incorrect** code for this rule with the default `{ "beforeBlockComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true }]*/
-
-var night = "long";
-/* what a great and wonderful day */
-var day = "great"
-```
-
-Examples of **correct** code for this rule with the default `{ "beforeBlockComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true }]*/
-
-var night = "long";
-
-/* what a great and wonderful day */
-var day = "great"
-```
-
-### afterBlockComment
-
-Examples of **incorrect** code for this rule with the `{ "afterBlockComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true }]*/
-
-var night = "long";
-
-/* what a great and wonderful day */
-var day = "great"
-```
-
-Examples of **correct** code for this rule with the `{ "afterBlockComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true }]*/
-
-var night = "long";
-
-/* what a great and wonderful day */
-
-var day = "great"
-```
-
-### beforeLineComment
-
-Examples of **incorrect** code for this rule with the `{ "beforeLineComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true }]*/
-
-var night = "long";
-// what a great and wonderful day
-var day = "great"
-```
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true }]*/
-
-var night = "long";
-
-// what a great and wonderful day
-var day = "great"
-```
-
-### afterLineComment
-
-Examples of **incorrect** code for this rule with the `{ "afterLineComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true }]*/
-
-var night = "long";
-// what a great and wonderful day
-var day = "great"
-```
-
-Examples of **correct** code for this rule with the `{ "afterLineComment": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true }]*/
-
-var night = "long";
-// what a great and wonderful day
-
-var day = "great"
-```
-
-### allowBlockStart
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowBlockStart": true }` options:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowBlockStart": true }]*/
-
-function foo(){
-    // what a great and wonderful day
-    var day = "great"
-    return day;
-}
-
-if (bar) {
-    // what a great and wonderful day
-    foo();
-}
-
-class C {
-    // what a great and wonderful day
-
-    method() {
-        // what a great and wonderful day
-        foo();
-    }
-
-    static {
-        // what a great and wonderful day
-        foo();
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowBlockStart": true }` options:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowBlockStart": true }]*/
-
-function foo(){
-    /* what a great and wonderful day */
-    var day = "great"
-    return day;
-}
-
-if (bar) {
-    /* what a great and wonderful day */
-    foo();
-}
-
-class C {
-    /* what a great and wonderful day */
-
-    method() {
-        /* what a great and wonderful day */
-        foo();
-    }
-
-    static {
-        /* what a great and wonderful day */
-        foo();
-    }
-}
-```
-
-### allowBlockEnd
-
-Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowBlockEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowBlockEnd": true }]*/
-
-function foo(){
-    var day = "great"
-    return day;
-    // what a great and wonderful day
-}
-
-if (bar) {
-    foo();
-    // what a great and wonderful day
-}
-
-class C {
-
-    method() {
-        foo();
-        // what a great and wonderful day
-    }
-
-    static {
-        foo();
-        // what a great and wonderful day
-    }
-
-    // what a great and wonderful day
-}
-```
-
-Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowBlockEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowBlockEnd": true }]*/
-
-function foo(){
-    var day = "great"
-    return day;
-
-    /* what a great and wonderful day */
-}
-
-if (bar) {
-    foo();
-
-    /* what a great and wonderful day */
-}
-
-class C {
-
-    method() {
-        foo();
-
-        /* what a great and wonderful day */
-    }
-
-    static {
-        foo();
-
-        /* what a great and wonderful day */
-    }
-
-    /* what a great and wonderful day */
-}
-```
-
-### allowClassStart
-
-Examples of **incorrect** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": false }]*/
-
-class foo {
-    // what a great and wonderful day
-    day() {}
-};
-```
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": false }]*/
-
-class foo {
-
-    // what a great and wonderful day
-    day() {}
-};
-```
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": true }]*/
-
-class foo {
-    // what a great and wonderful day
-    day() {}
-};
-```
-
-Examples of **incorrect** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": false }]*/
-
-class foo {
-    /* what a great and wonderful day */
-    day() {}
-};
-```
-
-Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": false }]*/
-
-class foo {
-
-    /* what a great and wonderful day */
-    day() {}
-};
-```
-
-Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": true }]*/
-
-class foo {
-    /* what a great and wonderful day */
-    day() {}
-};
-```
-
-### allowClassEnd
-
-Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowClassEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowClassEnd": true }]*/
-
-class foo {
-    day() {}
-    // what a great and wonderful day
-};
-```
-
-Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowClassEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowClassEnd": true }]*/
-
-class foo {
-    day() {}
-
-    /* what a great and wonderful day */
-};
-```
-
-### allowObjectStart
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowObjectStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowObjectStart": true }]*/
-
-var foo = {
-    // what a great and wonderful day
-    day: "great"
-};
-
-const {
-    // what a great and wonderful day
-    foo: someDay
-} = {foo: "great"};
-
-const {
-    // what a great and wonderful day
-    day
-} = {day: "great"};
-```
-
-Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowObjectStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowObjectStart": true }]*/
-
-var foo = {
-    /* what a great and wonderful day */
-    day: "great"
-};
-
-const {
-    /* what a great and wonderful day */
-    foo: someDay
-} = {foo: "great"};
-
-const {
-    /* what a great and wonderful day */
-    day
-} = {day: "great"};
-```
-
-### allowObjectEnd
-
-Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowObjectEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowObjectEnd": true }]*/
-
-var foo = {
-    day: "great"
-    // what a great and wonderful day
-};
-
-const {
-    foo: someDay
-    // what a great and wonderful day
-} = {foo: "great"};
-
-const {
-    day
-    // what a great and wonderful day
-} = {day: "great"};
-```
-
-Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowObjectEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowObjectEnd": true }]*/
-
-var foo = {
-    day: "great"
-
-    /* what a great and wonderful day */
-};
-
-const {
-    foo: someDay
-
-    /* what a great and wonderful day */
-} = {foo: "great"};
-
-const {
-    day
-
-    /* what a great and wonderful day */
-} = {day: "great"};
-```
-
-### allowArrayStart
-
-Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowArrayStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowArrayStart": true }]*/
-
-var day = [
-    // what a great and wonderful day
-    "great",
-    "wonderful"
-];
-
-const [
-    // what a great and wonderful day
-    someDay
-] = ["great", "not great"];
-```
-
-Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowArrayStart": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowArrayStart": true }]*/
-
-var day = [
-    /* what a great and wonderful day */
-    "great",
-    "wonderful"
-];
-
-const [
-    /* what a great and wonderful day */
-    someDay
-] = ["great", "not great"];
-```
-
-### allowArrayEnd
-
-Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowArrayEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowArrayEnd": true }]*/
-
-var day = [
-    "great",
-    "wonderful"
-    // what a great and wonderful day
-];
-
-const [
-    someDay
-    // what a great and wonderful day
-] = ["great", "not great"];
-```
-
-Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowArrayEnd": true }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowArrayEnd": true }]*/
-
-var day = [
-    "great",
-    "wonderful"
-
-    /* what a great and wonderful day */
-];
-
-const [
-    someDay
-
-    /* what a great and wonderful day */
-] = ["great", "not great"];
-```
-
-### ignorePattern
-
-By default this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`. To ignore more comments in addition to the defaults, set the `ignorePattern` option to a string pattern that will be passed to the [`RegExp` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp).
-
-Examples of **correct** code for the `ignorePattern` option:
-
-```js
-/*eslint lines-around-comment: ["error"]*/
-
-foo();
-/* eslint mentioned in this comment */,
-bar();
-
-
-/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma" }] */
-
-foo();
-/* a valid comment using pragma in it */
-```
-
-Examples of **incorrect** code for the `ignorePattern` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma" }] */
-
-1 + 1;
-/* something else */
-```
-
-### applyDefaultIgnorePatterns
-
-Default ignore patterns are applied even when `ignorePattern` is provided. If you want to omit default patterns, set this option to `false`.
-
-Examples of **correct** code for the `{ "applyDefaultIgnorePatterns": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma", applyDefaultIgnorePatterns: false }] */
-
-foo();
-/* a valid comment using pragma in it */
-```
-
-Examples of **incorrect** code for the `{ "applyDefaultIgnorePatterns": false }` option:
-
-```js
-/*eslint lines-around-comment: ["error", { "applyDefaultIgnorePatterns": false }] */
-
-foo();
-/* eslint mentioned in comment */
-
-```
-
-## When Not To Use It
-
-Many people enjoy a terser code style and don't mind comments bumping up against code. If you fall into that category this rule is not for you.
-
-## Related Rules
-
-* [space-before-blocks](space-before-blocks.md)
-* [spaced-comment](spaced-comment.md)
diff --git a/eslint/docs/rules/lines-around-directive.md b/eslint/docs/rules/lines-around-directive.md
deleted file mode 100644 (file)
index 6aa9f1d..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-# require or disallow newlines around directives (lines-around-directive)
-
-This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements.md) rule.
-
-Directives are used in JavaScript to indicate to the execution environment that a script would like to opt into a feature such as `"strict mode"`. Directives are grouped together in a [directive prologue](https://www.ecma-international.org/ecma-262/7.0/#directive-prologue) at the top of either a file or function block and are applied to the scope in which they occur.
-
-```js
-// Strict mode is invoked for the entire script
-"use strict";
-
-var foo;
-
-function bar() {
-  var baz;
-}
-```
-
-```js
-var foo;
-
-function bar() {
-  // Strict mode is only invoked within this function
-  "use strict";
-
-  var baz;
-}
-```
-
-## Rule Details
-
-This rule requires or disallows blank newlines around directive prologues. This rule does not enforce any conventions about blank newlines between the individual directives. In addition, it does not require blank newlines before directive prologues unless they are preceded by a comment. Please use the [padded-blocks](padded-blocks.md) rule if this is a style you would like to enforce.
-
-## Options
-
-This rule has one option. It can either be a string or an object:
-
-* `"always"` (default) enforces blank newlines around directives.
-* `"never"` disallows blank newlines around directives.
-
-or
-
-```js
-{
-  "before": "always" or "never"
-  "after": "always" or "never",
-}
-```
-
-### always
-
-This is the default option.
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/* eslint lines-around-directive: ["error", "always"] */
-
-/* Top of file */
-"use strict";
-var foo;
-
-/* Top of file */
-// comment
-"use strict";
-"use asm";
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-  var bar;
-}
-
-function foo() {
-  // comment
-  "use strict";
-  var bar;
-}
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/* eslint lines-around-directive: ["error", "always"] */
-
-/* Top of file */
-"use strict";
-
-var foo;
-
-/* Top of file */
-// comment
-
-"use strict";
-"use asm";
-
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-
-  var bar;
-}
-
-function foo() {
-  // comment
-
-  "use strict";
-
-  var bar;
-}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/* eslint lines-around-directive: ["error", "never"] */
-
-/* Top of file */
-
-"use strict";
-
-var foo;
-
-
-/* Top of file */
-// comment
-
-"use strict";
-"use asm";
-
-var foo;
-
-
-function foo() {
-  "use strict";
-  "use asm";
-
-  var bar;
-}
-
-
-function foo() {
-  // comment
-
-  "use strict";
-
-  var bar;
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/* eslint lines-around-directive: ["error", "never"] */
-
-/* Top of file */
-"use strict";
-var foo;
-
-/* Top of file */
-// comment
-"use strict";
-"use asm";
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-  var bar;
-}
-
-function foo() {
-  // comment
-  "use strict";
-  var bar;
-}
-```
-
-### before & after
-
-Examples of **incorrect** code for this rule with the `{ "before": "never", "after": "always" }` option:
-
-```js
-/* eslint lines-around-directive: ["error", { "before": "never", "after": "always" }] */
-
-/* Top of file */
-
-"use strict";
-var foo;
-
-/* Top of file */
-// comment
-
-"use strict";
-"use asm";
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-  var bar;
-}
-
-function foo() {
-  // comment
-
-  "use strict";
-  var bar;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "before": "never", "after": "always" }`  option:
-
-```js
-/* eslint lines-around-directive: ["error", { "before": "never", "after": "always" }] */
-
-/* Top of file */
-"use strict";
-
-var foo;
-
-/* Top of file */
-// comment
-"use strict";
-"use asm";
-
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-
-  var bar;
-}
-
-function foo() {
-  // comment
-  "use strict";
-
-  var bar;
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "before": "always", "after": "never" }` option:
-
-```js
-/* eslint lines-around-directive: ["error", { "before": "always", "after": "never" }] */
-
-/* Top of file */
-"use strict";
-
-var foo;
-
-/* Top of file */
-// comment
-"use strict";
-"use asm";
-
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-
-  var bar;
-}
-
-function foo() {
-  // comment
-  "use strict";
-
-  var bar;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "before": "always", "after": "never" }` option:
-
-```js
-/* eslint lines-around-directive: ["error", { "before": "always", "after": "never" }] */
-
-/* Top of file */
-"use strict";
-var foo;
-
-/* Top of file */
-// comment
-
-"use strict";
-"use asm";
-var foo;
-
-function foo() {
-  "use strict";
-  "use asm";
-  var bar;
-}
-
-function foo() {
-  // comment
-
-  "use strict";
-  var bar;
-}
-```
-
-## When Not To Use It
-
-You can safely disable this rule if you do not have any strict conventions about whether or not directive prologues should have blank newlines before or after them.
-
-## Related Rules
-
-* [lines-around-comment](lines-around-comment.md)
-* [padded-blocks](padded-blocks.md)
-
-## Compatibility
-
-* **JSCS**: [requirePaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterUseStrict)
-* **JSCS**: [disallowPaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterUseStrict)
diff --git a/eslint/docs/rules/lines-between-class-members.md b/eslint/docs/rules/lines-between-class-members.md
deleted file mode 100644 (file)
index 27084c2..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-# require or disallow an empty line between class members (lines-between-class-members)
-
-This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member, since that is already taken care of by padded-blocks.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint lines-between-class-members: ["error", "always"]*/
-class MyClass {
-  x;
-  foo() {
-    //...
-  }
-  bar() {
-    //...
-  }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint lines-between-class-members: ["error", "always"]*/
-class MyClass {
-  x;
-
-  foo() {
-    //...
-  }
-
-  bar() {
-    //...
-  }
-}
-```
-
-Examples of additional **correct** code for this rule:
-
-```js
-/* eslint lines-between-class-members: ["error", "always"]*/
-class MyClass {
-  x = 1
-
-  ;in = 2
-}
-```
-
-### Options
-
-This rule has a string option and an object option.
-
-String option:
-
-* `"always"`(default) require an empty line after class members
-* `"never"` disallows an empty line after class members
-
-Object option:
-
-* `"exceptAfterSingleLine": false`(default) **do not** skip checking empty lines after single-line class members
-* `"exceptAfterSingleLine": true` skip checking empty lines after single-line class members
-
-Examples of **incorrect** code for this rule with the string option:
-
-```js
-/* eslint lines-between-class-members: ["error", "always"]*/
-class Foo{
-  x;
-  bar(){}
-  baz(){}
-}
-
-/* eslint lines-between-class-members: ["error", "never"]*/
-class Foo{
-  x;
-
-  bar(){}
-
-  baz(){}
-}
-```
-
-Examples of **correct** code for this rule with the string option:
-
-```js
-/* eslint lines-between-class-members: ["error", "always"]*/
-class Foo{
-  x;
-
-  bar(){}
-
-  baz(){}
-}
-
-/* eslint lines-between-class-members: ["error", "never"]*/
-class Foo{
-  x;
-  bar(){}
-  baz(){}
-}
-```
-
-Examples of **correct** code for this rule with the object option:
-
-```js
-/* eslint lines-between-class-members: ["error", "always", { "exceptAfterSingleLine": true }]*/
-class Foo{
-  x; // single line class member
-  bar(){} // single line class member
-  baz(){
-    // multi line class member
-  }
-
-  qux(){}
-}
-```
-
-## When Not To Use It
-
-If you don't want to enforce empty lines between class members, you can disable this rule.
-
-## Related Rules
-
-* [padded-blocks](padded-blocks.md)
-* [padding-line-between-statements](padding-line-between-statements.md)
-
-## Compatibility
-
-* [requirePaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterBlocks)
-* [disallowPaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterBlocks)
diff --git a/eslint/docs/rules/max-classes-per-file.md b/eslint/docs/rules/max-classes-per-file.md
deleted file mode 100644 (file)
index 70f3348..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# enforce a maximum number of classes per file (max-classes-per-file)
-
-Files containing multiple classes can often result in a less navigable
-and poorly structured codebase. Best practice is to keep each file
-limited to a single responsibility.
-
-## Rule Details
-
-This rule enforces that each file may contain only a particular number
-of classes and no more.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint max-classes-per-file: "error"*/
-
-class Foo {}
-class Bar {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint max-classes-per-file: "error"*/
-
-class Foo {}
-```
-
-## Options
-
-This rule may be configured with either an object or a number.
-
-If the option is an object, it may contain one or both of:
-
--   `ignoreExpressions`: a boolean option (defaulted to `false`) to ignore class expressions.
--   `max`: a numeric option (defaulted to 1) to specify the maximum number of classes.
-
-For example:
-
-```json
-{
-    "max-classes-per-file": ["error", 1]
-}
-```
-
-```json
-{
-    "max-classes-per-file": [
-        "error",
-        { "ignoreExpressions": true, "max": 2 }
-    ]
-}
-```
-
-Examples of **correct** code for this rule with the `max` option set to `2`:
-
-```js
-/* eslint max-classes-per-file: ["error", 2] */
-
-class Foo {}
-class Bar {}
-```
-
-Examples of **correct** code for this rule with the `ignoreExpressions` option set to `true`:
-
-```js
-/* eslint max-classes-per-file: ["error", { ignoreExpressions: true }] */
-
-class VisitorFactory {
-    forDescriptor(descriptor) {
-        return class {
-            visit(node) {
-                return `Visiting ${descriptor}.`;
-            }
-        };
-    }
-}
-```
diff --git a/eslint/docs/rules/max-depth.md b/eslint/docs/rules/max-depth.md
deleted file mode 100644 (file)
index ae8121e..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-# enforce a maximum depth that blocks can be nested (max-depth)
-
-Many developers consider code difficult to read if blocks are nested beyond a certain depth.
-
-## Rule Details
-
-This rule enforces a maximum depth that blocks can be nested to reduce code complexity.
-
-## Options
-
-This rule has a number or object option:
-
-* `"max"` (default `4`) enforces a maximum depth that blocks can be nested
-
-**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
-
-### max
-
-Examples of **incorrect** code for this rule with the default `{ "max": 4 }` option:
-
-```js
-/*eslint max-depth: ["error", 4]*/
-
-function foo() {
-    for (;;) { // Nested 1 deep
-        while (true) { // Nested 2 deep
-            if (true) { // Nested 3 deep
-                if (true) { // Nested 4 deep
-                    if (true) { // Nested 5 deep
-                    }
-                }
-            }
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with the default `{ "max": 4 }` option:
-
-```js
-/*eslint max-depth: ["error", 4]*/
-
-function foo() {
-    for (;;) { // Nested 1 deep
-        while (true) { // Nested 2 deep
-            if (true) { // Nested 3 deep
-                if (true) { // Nested 4 deep
-                }
-            }
-        }
-    }
-}
-```
-
-Note that class static blocks do not count as nested blocks, and that the depth in them is calculated separately from the enclosing context.
-
-Examples of **incorrect** code for this rule with `{ "max": 2 }` option:
-
-```js
-/*eslint max-depth: ["error", 2]*/
-
-function foo() {
-    if (true) { // Nested 1 deep
-        class C {
-            static {
-                if (true) { // Nested 1 deep
-                    if (true) { // Nested 2 deep
-                        if (true) { // Nested 3 deep
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with `{ "max": 2 }` option:
-
-```js
-/*eslint max-depth: ["error", 2]*/
-
-function foo() {
-    if (true) { // Nested 1 deep
-        class C {
-            static {
-                if (true) { // Nested 1 deep
-                    if (true) { // Nested 2 deep
-                    }
-                }
-            }
-        }
-    }
-}
-```
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/max-len.md b/eslint/docs/rules/max-len.md
deleted file mode 100644 (file)
index 7aa755a..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-# enforce a maximum line length (max-len)
-
-Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).
-
-```js
-var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long
-```
-
-## Rule Details
-
-This rule enforces a maximum line length to increase code readability and maintainability. The length of a line is defined as the number of Unicode characters in the line.
-
-## Options
-
-This rule has a number or object option:
-
-* `"code"` (default `80`) enforces a maximum line length
-* `"tabWidth"` (default `4`) specifies the character width for tab characters
-* `"comments"` enforces a maximum line length for comments; defaults to value of `code`
-* `"ignorePattern"` ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
-* `"ignoreComments": true` ignores all trailing comments and comments on their own line
-* `"ignoreTrailingComments": true` ignores only trailing comments
-* `"ignoreUrls": true` ignores lines that contain a URL
-* `"ignoreStrings": true` ignores lines that contain a double-quoted or single-quoted string
-* `"ignoreTemplateLiterals": true` ignores lines that contain a template literal
-* `"ignoreRegExpLiterals": true` ignores lines that contain a RegExp literal
-
-### code
-
-Examples of **incorrect** code for this rule with the default `{ "code": 80 }` option:
-
-```js
-/*eslint max-len: ["error", { "code": 80 }]*/
-
-var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };
-```
-
-Examples of **correct** code for this rule with the default `{ "code": 80 }` option:
-
-```js
-/*eslint max-len: ["error", { "code": 80 }]*/
-
-var foo = {
-  "bar": "This is a bar.",
-  "baz": { "qux": "This is a qux" },
-  "easier": "to read"
-};
-```
-
-### tabWidth
-
-Examples of **incorrect** code for this rule with the default `{ "tabWidth": 4 }` option:
-
-```js
-/*eslint max-len: ["error", { "code": 80, "tabWidth": 4 }]*/
-
-\t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };
-```
-
-Examples of **correct** code for this rule with the default `{ "tabWidth": 4 }` option:
-
-```js
-/*eslint max-len: ["error", { "code": 80, "tabWidth": 4 }]*/
-
-\t  \t  var foo = {
-\t  \t  \t  \t  "bar": "This is a bar.",
-\t  \t  \t  \t  "baz": { "qux": "This is a qux" }
-\t  \t  };
-```
-
-### comments
-
-Examples of **incorrect** code for this rule with the `{ "comments": 65 }` option:
-
-```js
-/*eslint max-len: ["error", { "comments": 65 }]*/
-
-/**
- * This is a comment that violates the maximum line length we have specified
-**/
-```
-
-### ignoreComments
-
-Examples of **correct** code for this rule with the `{ "ignoreComments": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreComments": true }]*/
-
-/**
- * This is a really really really really really really really really really long comment
-**/
-```
-
-### ignoreTrailingComments
-
-Examples of **correct** code for this rule with the `{ "ignoreTrailingComments": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
-
-var foo = 'bar'; // This is a really really really really really really really long comment
-```
-
-### ignoreUrls
-
-Examples of **correct** code for this rule with the `{ "ignoreUrls": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreUrls": true }]*/
-
-var url = 'https://www.example.com/really/really/really/really/really/really/really/long';
-```
-
-### ignoreStrings
-
-Examples of **correct** code for this rule with the `{ "ignoreStrings": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreStrings": true }]*/
-
-var longString = 'this is a really really really really really long string!';
-```
-
-### ignoreTemplateLiterals
-
-Examples of **correct** code for this rule with the `{ "ignoreTemplateLiterals": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreTemplateLiterals": true }]*/
-
-var longTemplateLiteral = `this is a really really really really really long template literal!`;
-```
-
-### ignoreRegExpLiterals
-
-Examples of **correct** code for this rule with the `{ "ignoreRegExpLiterals": true }` option:
-
-```js
-/*eslint max-len: ["error", { "ignoreRegExpLiterals": true }]*/
-
-var longRegExpLiteral = /this is a really really really really really long regular expression!/;
-```
-
-### ignorePattern
-
-Examples of **correct** code for this rule with the `ignorePattern` option:
-
-```js
-/*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(" }]*/
-
-var dep = require('really/really/really/really/really/really/really/really/long/module');
-```
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/max-lines-per-function.md b/eslint/docs/rules/max-lines-per-function.md
deleted file mode 100644 (file)
index f2af93b..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-# enforce a maximum function length (max-lines-per-function)
-
-Some people consider large functions a code smell. Large functions tend to do a lot of things and can make it hard following what's going on. Many coding style guides dictate a limit of the number of lines that a function can comprise of. This rule can help enforce that style.
-
-## Rule Details
-
-This rule enforces a maximum number of lines per function, in order to aid in maintainability and reduce complexity.
-
-## Why not use `max-statements` or other complexity measurement rules instead?
-
-Nested long method chains like the below example are often broken onto separate lines for readability:
-
-```js
-function() {
-    return m("div", [
-        m("table", {className: "table table-striped latest-data"}, [
-            m("tbody",
-                data.map(function(db) {
-                    return m("tr", {key: db.dbname}, [
-                        m("td", {className: "dbname"}, db.dbname),
-                        m("td", {className: "query-count"},  [
-                            m("span", {className: db.lastSample.countClassName}, db.lastSample.nbQueries)
-                        ])
-                    ])
-                })
-            )
-        ])
-    ])
-}
-```
-
-* `max-statements` will only report this as 1 statement, despite being 16 lines of code.
-* `complexity` will only report a complexity of 1
-* `max-nested-callbacks` will only report 1
-* `max-depth` will report a depth of 0
-
-## Options
-
-This rule has the following options that can be specified using an object:
-
-* `"max"` (default `50`) enforces a maximum number of lines in a function.
-
-* `"skipBlankLines"` (default `false`) ignore lines made up purely of whitespace.
-
-* `"skipComments"` (default `false`) ignore lines containing just comments.
-
-* `"IIFEs"` (default `false`) include any code included in IIFEs.
-
-Alternatively, you may specify a single integer for the `max` option:
-
-```json
-"max-lines-per-function": ["error", 20]
-```
-
-is equivalent to
-
-```json
-"max-lines-per-function": ["error", { "max": 20 }]
-```
-
-### code
-
-Examples of **incorrect** code for this rule with a max value of `2`:
-
-```js
-/*eslint max-lines-per-function: ["error", 2]*/
-function foo() {
-    var x = 0;
-}
-```
-
-```js
-/*eslint max-lines-per-function: ["error", 2]*/
-function foo() {
-    // a comment
-    var x = 0;
-}
-```
-
-```js
-/*eslint max-lines-per-function: ["error", 2]*/
-function foo() {
-    // a comment followed by a blank line
-
-    var x = 0;
-}
-```
-
-Examples of **correct** code for this rule with a max value of `3`:
-
-```js
-/*eslint max-lines-per-function: ["error", 3]*/
-function foo() {
-    var x = 0;
-}
-```
-
-```js
-/*eslint max-lines-per-function: ["error", 3]*/
-function foo() {
-    // a comment
-    var x = 0;
-}
-```
-
-```js
-/*eslint max-lines-per-function: ["error", 3]*/
-function foo() {
-    // a comment followed by a blank line
-
-    var x = 0;
-}
-```
-
-### skipBlankLines
-
-Examples of **incorrect** code for this rule with the `{ "skipBlankLines": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 2, "skipBlankLines": true}]*/
-function foo() {
-
-    var x = 0;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 3, "skipBlankLines": true}]*/
-function foo() {
-
-    var x = 0;
-}
-```
-
-### skipComments
-
-Examples of **incorrect** code for this rule with the `{ "skipComments": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 2, "skipComments": true}]*/
-function foo() {
-    // a comment
-    var x = 0;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "skipComments": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 3, "skipComments": true}]*/
-function foo() {
-    // a comment
-    var x = 0;
-}
-```
-
-### IIFEs
-
-Examples of **incorrect** code for this rule with the `{ "IIFEs": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 2, "IIFEs": true}]*/
-(function(){
-    var x = 0;
-}());
-
-(() => {
-    var x = 0;
-})();
-```
-
-Examples of **correct** code for this rule with the `{ "IIFEs": true }` option:
-
-```js
-/*eslint max-lines-per-function: ["error", {"max": 3, "IIFEs": true}]*/
-(function(){
-    var x = 0;
-}());
-
-(() => {
-    var x = 0;
-})();
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the number of lines in your functions.
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-lines](max-lines.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
-* [max-statements-per-line](max-statements-per-line.md)
diff --git a/eslint/docs/rules/max-lines.md b/eslint/docs/rules/max-lines.md
deleted file mode 100644 (file)
index 74b9aad..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# enforce a maximum file length (max-lines)
-
-Some people consider large files a code smell. Large files tend to do a lot of things and can make it hard following what's going. While there is not an objective maximum number of lines considered acceptable in a file, most people would agree it should not be in the thousands. Recommendations usually range from 100 to 500 lines.
-
-## Rule Details
-
-This rule enforces a maximum number of lines per file, in order to aid in maintainability and reduce complexity.
-
-Please note that most editors show an additional empty line at the end if the file ends with a line break. This rule does not count that extra line.
-
-## Options
-
-This rule has a number or object option:
-
-* `"max"` (default `300`) enforces a maximum number of lines in a file
-
-* `"skipBlankLines": true` ignore lines made up purely of whitespace.
-
-* `"skipComments": true` ignore lines containing just comments
-
-### max
-
-Examples of **incorrect** code for this rule with a max value of `2`:
-
-```js
-/*eslint max-lines: ["error", 2]*/
-var a,
-    b,
-    c;
-```
-
-```js
-/*eslint max-lines: ["error", 2]*/
-
-var a,
-    b,c;
-```
-
-```js
-/*eslint max-lines: ["error", 2]*/
-// a comment
-var a,
-    b,c;
-```
-
-Examples of **correct** code for this rule with a max value of `2`:
-
-```js
-/*eslint max-lines: ["error", 2]*/
-var a,
-    b, c;
-```
-
-```js
-/*eslint max-lines: ["error", 2]*/
-
-var a, b, c;
-```
-
-```js
-/*eslint max-lines: ["error", 2]*/
-// a comment
-var a, b, c;
-```
-
-### skipBlankLines
-
-Examples of **incorrect** code for this rule with the `{ "skipBlankLines": true }` option:
-
-```js
-/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
-
-var a,
-    b,
-    c;
-```
-
-Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
-
-```js
-/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
-
-var a,
-    b, c;
-```
-
-### skipComments
-
-Examples of **incorrect** code for this rule with the `{ "skipComments": true }` option:
-
-```js
-/*eslint max-lines: ["error", {"max": 2, "skipComments": true}]*/
-// a comment
-var a,
-    b,
-    c;
-```
-
-Examples of **correct** code for this rule with the `{ "skipComments": true }` option:
-
-```js
-/*eslint max-lines: ["error", {"max": 2, "skipComments": true}]*/
-// a comment
-var a,
-    b, c;
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the number of lines in your files.
-
-## Further reading
-
-* [Software Module size and file size](https://web.archive.org/web/20160725154648/http://www.mind2b.com/component/content/article/24-software-module-size-and-file-size)
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
-
-## Compatibility
-
-* **JSCS**: [maximumNumberOfLines](https://jscs-dev.github.io/rule/maximumNumberOfLines)
diff --git a/eslint/docs/rules/max-nested-callbacks.md b/eslint/docs/rules/max-nested-callbacks.md
deleted file mode 100644 (file)
index 24e4b90..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# enforce a maximum depth that callbacks can be nested (max-nested-callbacks)
-
-Many JavaScript libraries use the callback pattern to manage asynchronous operations. A program of any complexity will most likely need to manage several asynchronous operations at various levels of concurrency. A common pitfall that is easy to fall into is nesting callbacks, which makes code more difficult to read the deeper the callbacks are nested.
-
-```js
-foo(function () {
-    bar(function () {
-        baz(function() {
-            qux(function () {
-
-            });
-        });
-    });
-});
-```
-
-## Rule Details
-
-This rule enforces a maximum depth that callbacks can be nested to increase code clarity.
-
-## Options
-
-This rule has a number or object option:
-
-* `"max"` (default `10`) enforces a maximum depth that callbacks can be nested
-
-**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
-
-### max
-
-Examples of **incorrect** code for this rule with the `{ "max": 3 }` option:
-
-```js
-/*eslint max-nested-callbacks: ["error", 3]*/
-
-foo1(function() {
-    foo2(function() {
-        foo3(function() {
-            foo4(function() {
-                // Do something
-            });
-        });
-    });
-});
-```
-
-Examples of **correct** code for this rule with the `{ "max": 3 }` option:
-
-```js
-/*eslint max-nested-callbacks: ["error", 3]*/
-
-foo1(handleFoo1);
-
-function handleFoo1() {
-    foo2(handleFoo2);
-}
-
-function handleFoo2() {
-    foo3(handleFoo3);
-}
-
-function handleFoo3() {
-    foo4(handleFoo4);
-}
-
-function handleFoo4() {
-    foo5();
-}
-```
-
-## Further Reading
-
-* [Control flow in Node.js](http://book.mixu.net/node/ch7.html)
-* [Control Flow in Node](https://howtonode.org/control-flow)
-* [Control Flow in Node Part II](https://howtonode.org/control-flow-part-ii)
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/max-params.md b/eslint/docs/rules/max-params.md
deleted file mode 100644 (file)
index 050d2a3..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# enforce a maximum number of parameters in function definitions (max-params)
-
-Functions that take numerous parameters can be difficult to read and write because it requires the memorization of what each parameter is, its type, and the order they should appear in. As a result, many coders adhere to a convention that caps the number of parameters a function can take.
-
-```js
-function foo (bar, baz, qux, qxx) { // four parameters, may be too many
-    doSomething();
-}
-```
-
-## Rule Details
-
-This rule enforces a maximum number of parameters allowed in function definitions.
-
-## Options
-
-This rule has a number or object option:
-
-* `"max"` (default `3`) enforces a maximum number of parameters in function definitions
-
-**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
-
-### max
-
-Examples of **incorrect** code for this rule with the default `{ "max": 3 }` option:
-
-```js
-/*eslint max-params: ["error", 3]*/
-/*eslint-env es6*/
-
-function foo (bar, baz, qux, qxx) {
-    doSomething();
-}
-
-let foo = (bar, baz, qux, qxx) => {
-    doSomething();
-};
-```
-
-Examples of **correct** code for this rule with the default `{ "max": 3 }` option:
-
-```js
-/*eslint max-params: ["error", 3]*/
-/*eslint-env es6*/
-
-function foo (bar, baz, qux) {
-    doSomething();
-}
-
-let foo = (bar, baz, qux) => {
-    doSomething();
-};
-```
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/max-statements-per-line.md b/eslint/docs/rules/max-statements-per-line.md
deleted file mode 100644 (file)
index e8462b6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-# enforce a maximum number of statements allowed per line (max-statements-per-line)
-
-A line of code containing too many statements can be difficult to read. Code is generally read from the top down, especially when scanning, so limiting the number of statements allowed on a single line can be very beneficial for readability and maintainability.
-
-```js
-function foo () { var bar; if (condition) { bar = 1; } else { bar = 2; } return true; } // too many statements
-```
-
-## Rule Details
-
-This rule enforces a maximum number of statements allowed per line.
-
-## Options
-
-### max
-
-The "max" object property is optional (default: 1).
-
-Examples of **incorrect** code for this rule with the default `{ "max": 1 }` option:
-
-```js
-/*eslint max-statements-per-line: ["error", { "max": 1 }]*/
-
-var bar; var baz;
-if (condition) { bar = 1; }
-for (var i = 0; i < length; ++i) { bar = 1; }
-switch (discriminant) { default: break; }
-function foo() { bar = 1; }
-var foo = function foo() { bar = 1; };
-(function foo() { bar = 1; })();
-```
-
-Examples of **correct** code for this rule with the default `{ "max": 1 }` option:
-
-```js
-/*eslint max-statements-per-line: ["error", { "max": 1 }]*/
-
-var bar, baz;
-if (condition) bar = 1;
-for (var i = 0; i < length; ++i);
-switch (discriminant) { default: }
-function foo() { }
-var foo = function foo() { };
-(function foo() { })();
-```
-
-Examples of **incorrect** code for this rule with the `{ "max": 2 }` option:
-
-```js
-/*eslint max-statements-per-line: ["error", { "max": 2 }]*/
-
-var bar; var baz; var qux;
-if (condition) { bar = 1; } else { baz = 2; }
-for (var i = 0; i < length; ++i) { bar = 1; baz = 2; }
-switch (discriminant) { case 'test': break; default: break; }
-function foo() { bar = 1; baz = 2; }
-var foo = function foo() { bar = 1; };
-(function foo() { bar = 1; baz = 2; })();
-```
-
-Examples of **correct** code for this rule with the `{ "max": 2 }` option:
-
-```js
-/*eslint max-statements-per-line: ["error", { "max": 2 }]*/
-
-var bar; var baz;
-if (condition) bar = 1; if (condition) baz = 2;
-for (var i = 0; i < length; ++i) { bar = 1; }
-switch (discriminant) { default: break; }
-function foo() { bar = 1; }
-var foo = function foo() { bar = 1; };
-(function foo() { var bar = 1; })();
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the number of statements on each line.
-
-## Related Rules
-
-* [max-depth](max-depth.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
-* [max-statements](max-statements.md)
diff --git a/eslint/docs/rules/max-statements.md b/eslint/docs/rules/max-statements.md
deleted file mode 100644 (file)
index c2a6733..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-# enforce a maximum number of statements allowed in function blocks (max-statements)
-
-The `max-statements` rule allows you to specify the maximum number of statements allowed in a function.
-
-```js
-function foo() {
-  var bar = 1; // one statement
-  var baz = 2; // two statements
-  var qux = 3; // three statements
-}
-```
-
-## Rule Details
-
-This rule enforces a maximum number of statements allowed in function blocks.
-
-## Options
-
-This rule has a number or object option:
-
-* `"max"` (default `10`) enforces a maximum number of statements allows in function blocks
-
-**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
-
-This rule has an object option:
-
-* `"ignoreTopLevelFunctions": true` ignores top-level functions
-
-### max
-
-Examples of **incorrect** code for this rule with the default `{ "max": 10 }` option:
-
-```js
-/*eslint max-statements: ["error", 10]*/
-/*eslint-env es6*/
-
-function foo() {
-  var foo1 = 1;
-  var foo2 = 2;
-  var foo3 = 3;
-  var foo4 = 4;
-  var foo5 = 5;
-  var foo6 = 6;
-  var foo7 = 7;
-  var foo8 = 8;
-  var foo9 = 9;
-  var foo10 = 10;
-
-  var foo11 = 11; // Too many.
-}
-
-let foo = () => {
-  var foo1 = 1;
-  var foo2 = 2;
-  var foo3 = 3;
-  var foo4 = 4;
-  var foo5 = 5;
-  var foo6 = 6;
-  var foo7 = 7;
-  var foo8 = 8;
-  var foo9 = 9;
-  var foo10 = 10;
-
-  var foo11 = 11; // Too many.
-};
-```
-
-Examples of **correct** code for this rule with the default `{ "max": 10 }` option:
-
-```js
-/*eslint max-statements: ["error", 10]*/
-/*eslint-env es6*/
-
-function foo() {
-  var foo1 = 1;
-  var foo2 = 2;
-  var foo3 = 3;
-  var foo4 = 4;
-  var foo5 = 5;
-  var foo6 = 6;
-  var foo7 = 7;
-  var foo8 = 8;
-  var foo9 = 9;
-  var foo10 = 10;
-  return function () {
-
-    // The number of statements in the inner function does not count toward the
-    // statement maximum.
-
-    return 42;
-  };
-}
-
-let foo = () => {
-  var foo1 = 1;
-  var foo2 = 2;
-  var foo3 = 3;
-  var foo4 = 4;
-  var foo5 = 5;
-  var foo6 = 6;
-  var foo7 = 7;
-  var foo8 = 8;
-  var foo9 = 9;
-  var foo10 = 10;
-  return function () {
-
-    // The number of statements in the inner function does not count toward the
-    // statement maximum.
-
-    return 42;
-  };
-}
-```
-
-Note that this rule does not apply to class static blocks, and that statements in class static blocks do not count as statements in the enclosing function.
-
-Examples of **correct** code for this rule with `{ "max": 2 }` option:
-
-```js
-/*eslint max-statements: ["error", 2]*/
-
-function foo() {
-    let one;
-    let two = class {
-        static {
-            let three;
-            let four;
-            let five;
-            if (six) {
-                let seven;
-                let eight;
-                let nine;
-            }
-        }
-    };
-}
-```
-
-### ignoreTopLevelFunctions
-
-Examples of additional **correct** code for this rule with the `{ "max": 10 }, { "ignoreTopLevelFunctions": true }` options:
-
-```js
-/*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
-
-function foo() {
-  var foo1 = 1;
-  var foo2 = 2;
-  var foo3 = 3;
-  var foo4 = 4;
-  var foo5 = 5;
-  var foo6 = 6;
-  var foo7 = 7;
-  var foo8 = 8;
-  var foo9 = 9;
-  var foo10 = 10;
-  var foo11 = 11;
-}
-```
-
-## Related Rules
-
-* [complexity](complexity.md)
-* [max-depth](max-depth.md)
-* [max-len](max-len.md)
-* [max-lines](max-lines.md)
-* [max-lines-per-function](max-lines-per-function.md)
-* [max-nested-callbacks](max-nested-callbacks.md)
-* [max-params](max-params.md)
diff --git a/eslint/docs/rules/multiline-comment-style.md b/eslint/docs/rules/multiline-comment-style.md
deleted file mode 100644 (file)
index 32beddd..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-# enforce a particular style for multiline comments (multiline-comment-style)
-
-Many style guides require a particular style for comments that span multiple lines. For example, some style guides prefer the use of a single block comment for multiline comments, whereas other style guides prefer consecutive line comments.
-
-## Rule Details
-
-This rule aims to enforce a particular style for multiline comments.
-
-### Options
-
-This rule has a string option, which can have one of the following values:
-
-* `"starred-block"` (default): Disallows consecutive line comments in favor of block comments. Additionally, requires block comments to have an aligned `*` character before each line.
-* `"bare-block"`: Disallows consecutive line comments in favor of block comments, and disallows block comments from having a `"*"` character before each line.
-* `"separate-lines"`: Disallows block comments in favor of consecutive line comments
-
-The rule always ignores directive comments such as `/* eslint-disable */`. Additionally, unless the mode is `"starred-block"`, the rule ignores JSDoc comments.
-
-Examples of **incorrect** code for this rule with the default `"starred-block"` option:
-
-```js
-
-/* eslint multiline-comment-style: ["error", "starred-block"] */
-
-// this line
-// calls foo()
-foo();
-
-/* this line
-calls foo() */
-foo();
-
-/* this comment
- * is missing a newline after /*
- */
-
-/*
- * this comment
- * is missing a newline at the end */
-
-/*
-* the star in this line should have a space before it
- */
-
-/*
- * the star on the following line should have a space before it
-*/
-
-```
-
-Examples of **correct** code for this rule with the default `"starred-block"` option:
-
-```js
-/* eslint multiline-comment-style: ["error", "starred-block"] */
-
-/*
- * this line
- * calls foo()
- */
-foo();
-
-// single-line comment
-```
-
-Examples of **incorrect** code for this rule with the `"bare-block"` option:
-
-```js
-/* eslint multiline-comment-style: ["error", "bare-block"] */
-
-// this line
-// calls foo()
-foo();
-
-/*
- * this line
- * calls foo()
- */
-foo();
-```
-
-Examples of **correct** code for this rule with the `"bare-block"` option:
-
-```js
-/* eslint multiline-comment-style: ["error", "bare-block"] */
-
-/* this line
-   calls foo() */
-foo();
-```
-
-Examples of **incorrect** code for this rule with the `"separate-lines"` option:
-
-```js
-
-/* eslint multiline-comment-style: ["error", "separate-lines"] */
-
-/* This line
-calls foo() */
-foo();
-
-/*
- * This line
- * calls foo()
- */
-foo();
-
-```
-
-Examples of **correct** code for this rule with the `"separate-lines"` option:
-
-```js
-/* eslint multiline-comment-style: ["error", "separate-lines"] */
-
-// This line
-// calls foo()
-foo();
-
-
-```
-
-## When Not To Use It
-
-If you don't want to enforce a particular style for multiline comments, you can disable the rule.
diff --git a/eslint/docs/rules/multiline-ternary.md b/eslint/docs/rules/multiline-ternary.md
deleted file mode 100644 (file)
index 0c38bf7..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-# Enforce or disallow newlines between operands of ternary expressions (multiline-ternary)
-
-JavaScript allows operands of ternary expressions to be separated by newlines, which can improve the readability of your program.
-
-For example:
-
-```js
-var foo = bar > baz ? value1 : value2;
-```
-
-The above can be rewritten as the following to improve readability and more clearly delineate the operands:
-
-```js
-var foo = bar > baz ?
-    value1 :
-    value2;
-```
-
-## Rule Details
-
-This rule enforces or disallows newlines between operands of a ternary expression.
-Note: The location of the operators is not enforced by this rule. Please see the [operator-linebreak](operator-linebreak.md) rule if you are interested in enforcing the location of the operators themselves.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) enforces newlines between the operands of a ternary expression.
-* `"always-multiline"` enforces newlines between the operands of a ternary expression if the expression spans multiple lines.
-* `"never"` disallows newlines between the operands of a ternary expression.
-
-### always
-
-This is the default option.
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "always"]*/
-
-foo > bar ? value1 : value2;
-
-foo > bar ? value :
-    value2;
-
-foo > bar ?
-    value : value2;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "always"]*/
-
-foo > bar ?
-    value1 :
-    value2;
-
-foo > bar ?
-    (baz > qux ?
-        value1 :
-        value2) :
-    value3;
-```
-
-### always-multiline
-
-Examples of **incorrect** code for this rule with the `"always-multiline"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "always-multiline"]*/
-
-foo > bar ? value1 :
-    value2;
-
-foo > bar ?
-    value1 : value2;
-
-foo > bar &&
-    bar > baz ? value1 : value2;
-```
-
-Examples of **correct** code for this rule with the `"always-multiline"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "always-multiline"]*/
-
-foo > bar ? value1 : value2;
-
-foo > bar ?
-    value1 :
-    value2;
-
-foo > bar ?
-    (baz > qux ? value1 : value2) :
-    value3;
-
-foo > bar ?
-    (baz > qux ?
-        value1 :
-        value2) :
-    value3;
-
-foo > bar &&
-    bar > baz ?
-        value1 :
-        value2;
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "never"]*/
-
-foo > bar ? value :
-    value2;
-
-foo > bar ?
-    value : value2;
-
-foo >
-    bar ?
-    value1 :
-    value2;
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint multiline-ternary: ["error", "never"]*/
-
-foo > bar ? value1 : value2;
-
-foo > bar ? (baz > qux ? value1 : value2) : value3;
-
-foo > bar ? (
-    baz > qux ? value1 : value2
-) : value3;
-```
-
-## When Not To Use It
-
-You can safely disable this rule if you do not have any strict conventions about whether the operands of a ternary expression should be separated by newlines.
-
-## Related Rules
-
-* [operator-linebreak](operator-linebreak.md)
-
-## Compatibility
-
-* **JSCS**: [requireMultiLineTernary](https://jscs-dev.github.io/rule/requireMultiLineTernary)
diff --git a/eslint/docs/rules/new-cap.md b/eslint/docs/rules/new-cap.md
deleted file mode 100644 (file)
index ef8c615..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-# require constructor names to begin with a capital letter (new-cap)
-
-The `new` operator in JavaScript creates a new instance of a particular type of object. That type of object is represented by a constructor function. Since constructor functions are just regular functions, the only defining characteristic is that `new` is being used as part of the call. Native JavaScript functions begin with an uppercase letter to distinguish those functions that are to be used as constructors from functions that are not. Many style guides recommend following this pattern to more easily determine which functions are to be used as constructors.
-
-```js
-var friend = new Person();
-```
-
-## Rule Details
-
-This rule requires constructor names to begin with a capital letter. Certain built-in identifiers are exempt from this rule. These identifiers are:
-
-* `Array`
-* `Boolean`
-* `Date`
-* `Error`
-* `Function`
-* `Number`
-* `Object`
-* `RegExp`
-* `String`
-* `Symbol`
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint new-cap: "error"*/
-
-function foo(arg) {
-    return Boolean(arg);
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `"newIsCap": true` (default) requires all `new` operators to be called with uppercase-started functions.
-* `"newIsCap": false` allows `new` operators to be called with lowercase-started or uppercase-started functions.
-* `"capIsNew": true` (default) requires all uppercase-started functions to be called with `new` operators.
-* `"capIsNew": false` allows uppercase-started functions to be called without `new` operators.
-* `"newIsCapExceptions"` allows specified lowercase-started function names to be called with the `new` operator.
-* `"newIsCapExceptionPattern"` allows any lowercase-started function names that match the specified regex pattern to be called with the `new` operator.
-* `"capIsNewExceptions"` allows specified uppercase-started function names to be called without the `new` operator.
-* `"capIsNewExceptionPattern"` allows any uppercase-started function names that match the specified regex pattern to be called without the `new` operator.
-* `"properties": true` (default) enables checks on object properties
-* `"properties": false` disables checks on object properties
-
-### newIsCap
-
-Examples of **incorrect** code for this rule with the default `{ "newIsCap": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCap": true }]*/
-
-var friend = new person();
-```
-
-Examples of **correct** code for this rule with the default `{ "newIsCap": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCap": true }]*/
-
-var friend = new Person();
-```
-
-Examples of **correct** code for this rule with the `{ "newIsCap": false }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCap": false }]*/
-
-var friend = new person();
-```
-
-### capIsNew
-
-Examples of **incorrect** code for this rule with the default `{ "capIsNew": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNew": true }]*/
-
-var colleague = Person();
-```
-
-Examples of **correct** code for this rule with the default `{ "capIsNew": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNew": true }]*/
-
-var colleague = new Person();
-```
-
-Examples of **correct** code for this rule with the `{ "capIsNew": false }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNew": false }]*/
-
-var colleague = Person();
-```
-
-### newIsCapExceptions
-
-Examples of additional **correct** code for this rule with the `{ "newIsCapExceptions": ["events"] }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCapExceptions": ["events"] }]*/
-
-var events = require('events');
-
-var emitter = new events();
-```
-
-### newIsCapExceptionPattern
-
-Examples of additional **correct** code for this rule with the `{ "newIsCapExceptionPattern": "^person\\.." }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCapExceptionPattern": "^person\\.." }]*/
-
-var friend = new person.acquaintance();
-
-var bestFriend = new person.friend();
-```
-
-Examples of additional **correct** code for this rule with the `{ "newIsCapExceptionPattern": "\\.bar$" }` option:
-
-```js
-/*eslint new-cap: ["error", { "newIsCapExceptionPattern": "\\.bar$" }]*/
-
-var friend = new person.bar();
-```
-
-### capIsNewExceptions
-
-Examples of additional **correct** code for this rule with the `{ "capIsNewExceptions": ["Person"] }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNewExceptions": ["Person"] }]*/
-
-function foo(arg) {
-    return Person(arg);
-}
-```
-
-### capIsNewExceptionPattern
-
-Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "^person\\.." }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "^person\\.." }]*/
-
-var friend = person.Acquaintance();
-var bestFriend = person.Friend();
-```
-
-Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "\\.Bar$" }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "\\.Bar$" }]*/
-
-foo.Bar();
-```
-
-Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "^Foo" }` option:
-
-```js
-/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "^Foo" }]*/
-
-var x = Foo(42);
-
-var y = Foobar(42);
-
-var z = Foo.Bar(42);
-```
-
-### properties
-
-Examples of **incorrect** code for this rule with the default `{ "properties": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "properties": true }]*/
-
-var friend = new person.acquaintance();
-```
-
-Examples of **correct** code for this rule with the default `{ "properties": true }` option:
-
-```js
-/*eslint new-cap: ["error", { "properties": true }]*/
-
-var friend = new person.Acquaintance();
-```
-
-Examples of **correct** code for this rule with the `{ "properties": false }` option:
-
-```js
-/*eslint new-cap: ["error", { "properties": false }]*/
-
-var friend = new person.acquaintance();
-```
-
-## When Not To Use It
-
-If you have conventions that don't require an uppercase letter for constructors, or don't require capitalized functions be only used as constructors, turn this rule off.
diff --git a/eslint/docs/rules/new-parens.md b/eslint/docs/rules/new-parens.md
deleted file mode 100644 (file)
index 0b2a49b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# require parentheses when invoking a constructor with no arguments (new-parens)
-
-JavaScript allows the omission of parentheses when invoking a function via the `new` keyword and the constructor has no arguments. However, some coders believe that omitting the parentheses is inconsistent with the rest of the language and thus makes code less clear.
-
-```js
-var person = new Person;
-```
-
-## Rule Details
-
-This rule can enforce or disallow parentheses when invoking a constructor with no arguments using the `new` keyword.
-
-## Options
-
-This rule takes one option.
-
-- `"always"` enforces parenthesis after a new constructor with no arguments (default)
-- `"never"` enforces no parenthesis after a new constructor with no arguments
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint new-parens: "error"*/
-
-var person = new Person;
-var person = new (Person);
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint new-parens: "error"*/
-
-var person = new Person();
-var person = new (Person)();
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint new-parens: ["error", "never"]*/
-
-var person = new Person();
-var person = new (Person)();
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint new-parens: ["error", "never"]*/
-
-var person = new Person;
-var person = (new Person);
-var person = new Person("Name");
-```
diff --git a/eslint/docs/rules/newline-after-var.md b/eslint/docs/rules/newline-after-var.md
deleted file mode 100644 (file)
index 43ec9ba..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-# require or disallow an empty line after variable declarations (newline-after-var)
-
-This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements.md) rule.
-
-As of today there is no consistency in separating variable declarations from the rest of the code. Some developers leave an empty line between var statements and the rest of the code like:
-
-```js
-var foo;
-
-// do something with foo
-```
-
-Whereas others don't leave any empty newlines at all.
-
-```js
-var foo;
-// do something with foo
-```
-
-The problem is when these developers work together in a project. This rule enforces a coding style where empty newlines are allowed or disallowed after `var`, `let`, or `const` statements. It helps the code to look consistent across the entire project.
-
-## Rule Details
-
-This rule enforces a coding style where empty lines are required or disallowed after `var`, `let`, or `const` statements to achieve a consistent coding style across the project.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` (default) requires an empty line after `var`, `let`, or `const`
-
-  Comments on a line directly after var statements are treated like additional var statements.
-
-* `"never"` disallows empty lines after `var`, `let`, or `const`
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint newline-after-var: ["error", "always"]*/
-/*eslint-env es6*/
-
-var greet = "hello,",
-    name = "world";
-console.log(greet, name);
-
-let greet = "hello,",
-    name = "world";
-console.log(greet, name);
-
-var greet = "hello,";
-const NAME = "world";
-console.log(greet, NAME);
-
-var greet = "hello,";
-var name = "world";
-// var name = require("world");
-console.log(greet, name);
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint newline-after-var: ["error", "always"]*/
-/*eslint-env es6*/
-
-var greet = "hello,",
-    name = "world";
-
-console.log(greet, name);
-
-let greet = "hello,",
-    name = "world";
-
-console.log(greet, name);
-
-var greet = "hello,";
-const NAME = "world";
-
-console.log(greet, NAME);
-
-var greet = "hello,";
-var name = "world";
-// var name = require("world");
-
-console.log(greet, name);
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint newline-after-var: ["error", "never"]*/
-/*eslint-env es6*/
-
-var greet = "hello,",
-    name = "world";
-
-console.log(greet, name);
-
-let greet = "hello,",
-    name = "world";
-
-console.log(greet, name);
-
-var greet = "hello,";
-const NAME = "world";
-
-console.log(greet, NAME);
-
-var greet = "hello,";
-var name = "world";
-// var name = require("world");
-
-console.log(greet, name);
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint newline-after-var: ["error", "never"]*/
-/*eslint-env es6*/
-
-var greet = "hello,",
-    name = "world";
-console.log(greet, name);
-
-let greet = "hello,",
-    name = "world";
-console.log(greet, name);
-
-var greet = "hello,";
-const NAME = "world";
-console.log(greet, NAME);
-
-var greet = "hello,";
-var name = "world";
-// var name = require("world");
-console.log(greet, name);
-```
diff --git a/eslint/docs/rules/newline-before-return.md b/eslint/docs/rules/newline-before-return.md
deleted file mode 100644 (file)
index 6709534..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-# require an empty line before `return` statements (newline-before-return)
-
-This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements.md) rule.
-
-There is no hard and fast rule about whether empty lines should precede `return` statements in JavaScript. However, clearly delineating where a function is returning can greatly increase the readability and clarity of the code. For example:
-
-```js
-function foo(bar) {
-  var baz = 'baz';
-  if (!bar) {
-    bar = baz;
-    return bar;
-  }
-  return bar;
-}
-```
-
-Adding newlines visibly separates the return statements from the previous lines, making it clear where the function exits and what value it returns:
-
-```js
-function foo(bar) {
-  var baz = 'baz';
-
-  if (!bar) {
-    bar = baz;
-
-    return bar;
-  }
-
-  return bar;
-}
-```
-
-## Rule Details
-
-This rule requires an empty line before `return` statements to increase code clarity, except when the `return` is alone inside a statement group (such as an if statement). In the latter case, the `return` statement does not need to be delineated by virtue of it being alone. Comments are ignored and do not count as empty lines.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint newline-before-return: "error"*/
-
-function foo(bar) {
-    if (!bar) {
-        return;
-    }
-    return bar;
-}
-
-function foo(bar) {
-    if (!bar) {
-        return;
-    }
-    /* multi-line
-    comment */
-    return bar;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint newline-before-return: "error"*/
-
-function foo() {
-    return;
-}
-
-function foo() {
-
-    return;
-}
-
-function foo(bar) {
-    if (!bar) return;
-}
-
-function foo(bar) {
-    if (!bar) { return };
-}
-
-function foo(bar) {
-    if (!bar) {
-        return;
-    }
-}
-
-function foo(bar) {
-    if (!bar) {
-        return;
-    }
-
-    return bar;
-}
-
-function foo(bar) {
-    if (!bar) {
-
-        return;
-    }
-}
-
-function foo() {
-
-    // comment
-    return;
-}
-```
-
-## When Not To Use It
-
-You can safely disable this rule if you do not have any strict conventions about whitespace before `return` statements.
-
-## Related Rules
-
-* [newline-after-var](newline-after-var.md)
diff --git a/eslint/docs/rules/newline-per-chained-call.md b/eslint/docs/rules/newline-per-chained-call.md
deleted file mode 100644 (file)
index c4227c0..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-# require a newline after each call in a method chain (newline-per-chained-call)
-
-Chained method calls on a single line without line breaks are harder to read, so some developers place a newline character after each method call in the chain to make it more readable and easy to maintain.
-
-Let's look at the following perfectly valid (but single line) code.
-
-```js
-d3.select("body").selectAll("p").data([4, 8, 15, 16, 23, 42 ]).enter().append("p").text(function(d) { return "I'm number " + d + "!"; });
-```
-
-However, with appropriate new lines, it becomes easy to read and understand. Look at the same code written below with line breaks after each call.
-
-```js
-d3
-    .select("body")
-    .selectAll("p")
-    .data([
-        4,
-        8,
-        15,
-        16,
-        23,
-        42
-    ])
-    .enter()
-    .append("p")
-    .text(function (d) {
-        return "I'm number " + d + "!";
-    });
-```
-
-Another argument in favor of this style is that it improves the clarity of diffs when something in the method chain is changed:
-
-Less clear:
-
-```diff
--d3.select("body").selectAll("p").style("color", "white");
-+d3.select("body").selectAll("p").style("color", "blue");
-```
-
-More clear:
-
-```diff
-d3
-    .select("body")
-    .selectAll("p")
--    .style("color", "white");
-+    .style("color", "blue");
-```
-
-## Rule Details
-
-This rule requires a newline after each call in a method chain or deep member access. Computed property accesses such as `instance[something]` are excluded.
-
-## Options
-
-This rule has an object option:
-
-* `"ignoreChainWithDepth"` (default: `2`) allows chains up to a specified depth.
-
-### ignoreChainWithDepth
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreChainWithDepth": 2 }` option:
-
-```js
-/*eslint newline-per-chained-call: ["error", { "ignoreChainWithDepth": 2 }]*/
-
-_.chain({}).map(foo).filter(bar).value();
-
-// Or
-_.chain({}).map(foo).filter(bar);
-
-// Or
-_
-  .chain({}).map(foo)
-  .filter(bar);
-
-// Or
-obj.method().method2().method3();
-```
-
-Examples of **correct** code for this rule with the default `{ "ignoreChainWithDepth": 2 }` option:
-
-```js
-/*eslint newline-per-chained-call: ["error", { "ignoreChainWithDepth": 2 }]*/
-
-_
-  .chain({})
-  .map(foo)
-  .filter(bar)
-  .value();
-
-// Or
-_
-  .chain({})
-  .map(foo)
-  .filter(bar);
-
-// Or
-_.chain({})
-  .map(foo)
-  .filter(bar);
-
-// Or
-obj
-  .prop
-  .method().prop;
-
-// Or
-obj
-  .prop.method()
-  .method2()
-  .method3().prop;
-```
-
-## When Not To Use It
-
-If you have conflicting rules or when you are fine with chained calls on one line, you can safely turn this rule off.
diff --git a/eslint/docs/rules/no-alert.md b/eslint/docs/rules/no-alert.md
deleted file mode 100644 (file)
index 6b7e664..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Disallow Use of Alert (no-alert)
-
-JavaScript's `alert`, `confirm`, and `prompt` functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, `alert` is often used while debugging code, which should be removed before deployment to production.
-
-```js
-alert("here!");
-```
-
-## Rule Details
-
-This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters `alert`, `prompt`, and `confirm` function calls which are not shadowed.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-alert: "error"*/
-
-alert("here!");
-
-confirm("Are you sure?");
-
-prompt("What's your name?", "John Doe");
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-alert: "error"*/
-
-customAlert("Something happened!");
-
-customConfirm("Are you sure?");
-
-customPrompt("Who are you?");
-
-function foo() {
-    var alert = myCustomLib.customAlert;
-    alert();
-}
-```
-
-## Related Rules
-
-* [no-console](no-console.md)
-* [no-debugger](no-debugger.md)
diff --git a/eslint/docs/rules/no-array-constructor.md b/eslint/docs/rules/no-array-constructor.md
deleted file mode 100644 (file)
index 22fbde6..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# disallow `Array` constructors (no-array-constructor)
-
-Use of the `Array` constructor to construct a new array is generally
-discouraged in favor of array literal notation because of the single-argument
-pitfall and because the `Array` global may be redefined. The exception is when
-the Array constructor is used to intentionally create sparse arrays of a
-specified size by giving the constructor a single numeric argument.
-
-## Rule Details
-
-This rule disallows `Array` constructors.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-array-constructor: "error"*/
-
-Array(0, 1, 2)
-
-new Array(0, 1, 2)
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-array-constructor: "error"*/
-
-Array(500)
-
-new Array(someOtherArray.length)
-
-[0, 1, 2]
-```
-
-## When Not To Use It
-
-This rule enforces a nearly universal stylistic concern. That being said, this
-rule may be disabled if the constructor style is preferred.
-
-## Related Rules
-
-* [no-new-object](no-new-object.md)
-* [no-new-wrappers](no-new-wrappers.md)
diff --git a/eslint/docs/rules/no-arrow-condition.md b/eslint/docs/rules/no-arrow-condition.md
deleted file mode 100644 (file)
index faa5566..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# no-arrow-condition: disallow arrow functions where test conditions are expected
-
-(removed) This rule was **removed** in ESLint v2.0 and **replaced** by a combination of the [no-confusing-arrow](no-confusing-arrow.md) and [no-constant-condition](no-constant-condition.md) rules.
-
-Arrow functions (`=>`) are similar in syntax to some comparison operators (`>`, `<`, `<=`, and `>=`). This rule warns against using the arrow function syntax in places where a condition is expected. Even if the arguments of the arrow function are wrapped with parens, this rule still warns about it.
-
-Here's an example where the usage of `=>` is most likely a typo:
-
-```js
-// This is probably a typo
-if (a => 1) {}
-// And should instead be
-if (a >= 1) {}
-```
-
-There are also cases where the usage of `=>` can be ambiguous and should be rewritten to more clearly show the author's intent:
-
-```js
-// The intent is not clear
-var x = a => 1 ? 2 : 3
-// Did the author mean this
-var x = function (a) { return a >= 1 ? 2 : 3 }
-// Or this
-var x = a <= 1 ? 2 : 3
-```
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-arrow-condition: "error"*/
-/*eslint-env es6*/
-
-if (a => 1) {}
-while (a => 1) {}
-for (var a = 1; a => 10; a++) {}
-a => 1 ? 2 : 3
-(a => 1) ? 2 : 3
-var x = a => 1 ? 2 : 3
-var x = (a) => 1 ? 2 : 3
-```
-
-## Related Rules
-
-* [arrow-parens](arrow-parens.md)
-* [no-confusing-arrow](no-confusing-arrow.md)
-* [no-constant-condition](no-constant-condition.md)
diff --git a/eslint/docs/rules/no-async-promise-executor.md b/eslint/docs/rules/no-async-promise-executor.md
deleted file mode 100644 (file)
index 58655b7..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# disallow using an async function as a Promise executor (no-async-promise-executor)
-
-The `new Promise` constructor accepts an *executor* function as an argument, which has `resolve` and `reject` parameters that can be used to control the state of the created Promise. For example:
-
-```js
-const result = new Promise(function executor(resolve, reject) {
-  readFile('foo.txt', function(err, result) {
-    if (err) {
-      reject(err);
-    } else {
-      resolve(result);
-    }
-  });
-});
-```
-
-The executor function can also be an `async function`. However, this is usually a mistake, for a few reasons:
-
-* If an async executor function throws an error, the error will be lost and won't cause the newly-constructed `Promise` to reject. This could make it difficult to debug and handle some errors.
-* If a Promise executor function is using `await`, this is usually a sign that it is not actually necessary to use the `new Promise` constructor, or the scope of the `new Promise` constructor can be reduced.
-
-## Rule Details
-
-This rule aims to disallow async Promise executor functions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-const foo = new Promise(async (resolve, reject) => {
-  readFile('foo.txt', function(err, result) {
-    if (err) {
-      reject(err);
-    } else {
-      resolve(result);
-    }
-  });
-});
-
-const result = new Promise(async (resolve, reject) => {
-  resolve(await foo);
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-const foo = new Promise((resolve, reject) => {
-  readFile('foo.txt', function(err, result) {
-    if (err) {
-      reject(err);
-    } else {
-      resolve(result);
-    }
-  });
-});
-
-const result = Promise.resolve(foo);
-```
-
-## When Not To Use It
-
-If your codebase doesn't support async function syntax, there's no need to enable this rule.
diff --git a/eslint/docs/rules/no-await-in-loop.md b/eslint/docs/rules/no-await-in-loop.md
deleted file mode 100644 (file)
index eebf142..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# Disallow `await` inside of loops (no-await-in-loop)
-
-Performing an operation on each element of an iterable is a common task. However, performing an
-`await` as part of each operation is an indication that the program is not taking full advantage of
-the parallelization benefits of `async`/`await`.
-
-Usually, the code should be refactored to create all the promises at once, then get access to the
-results using `Promise.all()`. Otherwise, each successive operation will not start until the
-previous one has completed.
-
-Concretely, the following function should be refactored as shown:
-
-```js
-async function foo(things) {
-  const results = [];
-  for (const thing of things) {
-    // Bad: each loop iteration is delayed until the entire asynchronous operation completes
-    results.push(await bar(thing));
-  }
-  return baz(results);
-}
-```
-
-```js
-async function foo(things) {
-  const results = [];
-  for (const thing of things) {
-    // Good: all asynchronous operations are immediately started.
-    results.push(bar(thing));
-  }
-  // Now that all the asynchronous operations are running, here we wait until they all complete.
-  return baz(await Promise.all(results));
-}
-```
-
-## Rule Details
-
-This rule disallows the use of `await` within loop bodies.
-
-## Examples
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-await-in-loop: "error"*/
-
-async function foo(things) {
-  const results = [];
-  for (const thing of things) {
-    // Good: all asynchronous operations are immediately started.
-    results.push(bar(thing));
-  }
-  // Now that all the asynchronous operations are running, here we wait until they all complete.
-  return baz(await Promise.all(results));
-}
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-await-in-loop: "error"*/
-
-async function foo(things) {
-  const results = [];
-  for (const thing of things) {
-    // Bad: each loop iteration is delayed until the entire asynchronous operation completes
-    results.push(await bar(thing));
-  }
-  return baz(results);
-}
-```
-
-## When Not To Use It
-
-In many cases the iterations of a loop are not actually independent of each-other. For example, the
-output of one iteration might be used as the input to another. Or, loops may be used to retry
-asynchronous operations that were unsuccessful. Or, loops may be used to prevent your code from sending
-an excessive amount of requests in parallel. In such cases it makes sense to use `await` within a
-loop and it is recommended to disable the rule via a standard ESLint disable comment.
diff --git a/eslint/docs/rules/no-bitwise.md b/eslint/docs/rules/no-bitwise.md
deleted file mode 100644 (file)
index 252f0cf..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-# disallow bitwise operators (no-bitwise)
-
-The use of bitwise operators in JavaScript is very rare and often `&` or `|` is simply a mistyped `&&` or `||`, which will lead to unexpected behavior.
-
-```js
-var x = y | z;
-```
-
-## Rule Details
-
-This rule disallows bitwise operators.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-bitwise: "error"*/
-
-var x = y | z;
-
-var x = y & z;
-
-var x = y ^ z;
-
-var x = ~ z;
-
-var x = y << z;
-
-var x = y >> z;
-
-var x = y >>> z;
-
-x |= y;
-
-x &= y;
-
-x ^= y;
-
-x <<= y;
-
-x >>= y;
-
-x >>>= y;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-bitwise: "error"*/
-
-var x = y || z;
-
-var x = y && z;
-
-var x = y > z;
-
-var x = y < z;
-
-x += y;
-```
-
-## Options
-
-This rule has an object option:
-
-* `"allow"`: Allows a list of bitwise operators to be used as exceptions.
-* `"int32Hint"`: Allows the use of bitwise OR in `|0` pattern for type casting.
-
-### allow
-
-Examples of **correct** code for this rule with the `{ "allow": ["~"] }` option:
-
-```js
-/*eslint no-bitwise: ["error", { "allow": ["~"] }] */
-
-~[1,2,3].indexOf(1) === -1;
-```
-
-### int32Hint
-
-Examples of **correct** code for this rule with the `{ "int32Hint": true }` option:
-
-```js
-/*eslint no-bitwise: ["error", { "int32Hint": true }] */
-
-var b = a|0;
-```
diff --git a/eslint/docs/rules/no-buffer-constructor.md b/eslint/docs/rules/no-buffer-constructor.md
deleted file mode 100644 (file)
index 9902a71..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# disallow use of the Buffer() constructor (no-buffer-constructor)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In Node.js, the behavior of the `Buffer` constructor is different depending on the type of its argument. Passing an argument from user input to `Buffer()` without validating its type can lead to security vulnerabilities such as remote memory disclosure and denial of service. As a result, the `Buffer` constructor has been deprecated and should not be used. Use the producer methods `Buffer.from`, `Buffer.alloc`, and `Buffer.allocUnsafe` instead.
-
-## Rule Details
-
-This rule disallows calling and constructing the `Buffer()` constructor.
-
-Examples of **incorrect** code for this rule:
-
-```js
-new Buffer(5);
-new Buffer([1, 2, 3]);
-
-Buffer(5);
-Buffer([1, 2, 3]);
-
-new Buffer(res.body.amount);
-new Buffer(res.body.values);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-Buffer.alloc(5);
-Buffer.allocUnsafe(5);
-Buffer.from([1, 2, 3]);
-
-Buffer.alloc(res.body.amount);
-Buffer.from(res.body.values);
-```
-
-## When Not To Use It
-
-If you don't use Node.js, or you still need to support versions of Node.js that lack methods like `Buffer.from`, then you should not enable this rule.
-
-## Further Reading
-
-* [Buffer API documentation](https://nodejs.org/api/buffer.html)
-* [Let's fix Node.js Buffer API](https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md)
-* [Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
diff --git a/eslint/docs/rules/no-caller.md b/eslint/docs/rules/no-caller.md
deleted file mode 100644 (file)
index f5688df..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# Disallow Use of caller/callee (no-caller)
-
-The use of `arguments.caller` and `arguments.callee` make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.
-
-```js
-function foo() {
-    var callee = arguments.callee;
-}
-```
-
-## Rule Details
-
-This rule is aimed at discouraging the use of deprecated and sub-optimal code by disallowing the use of `arguments.caller` and `arguments.callee`. As such, it will warn when `arguments.caller` and `arguments.callee` are used.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-caller: "error"*/
-
-function foo(n) {
-    if (n <= 0) {
-        return;
-    }
-
-    arguments.callee(n - 1);
-}
-
-[1,2,3,4,5].map(function(n) {
-    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-caller: "error"*/
-
-function foo(n) {
-    if (n <= 0) {
-        return;
-    }
-
-    foo(n - 1);
-}
-
-[1,2,3,4,5].map(function factorial(n) {
-    return !(n > 1) ? 1 : factorial(n - 1) * n;
-});
-```
diff --git a/eslint/docs/rules/no-case-declarations.md b/eslint/docs/rules/no-case-declarations.md
deleted file mode 100644 (file)
index 3652c74..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-# Disallow lexical declarations in case/default clauses (no-case-declarations)
-
-This rule disallows lexical declarations (`let`, `const`, `function` and `class`)
-in `case`/`default` clauses. The reason is that the lexical declaration is visible
-in the entire switch block but it only gets initialized when it is assigned, which
-will only happen if the case where it is defined is reached.
-
-To ensure that the lexical declaration only applies to the current case clause
-wrap your clauses in blocks.
-
-## Rule Details
-
-This rule aims to prevent access to uninitialized lexical bindings as well as accessing hoisted functions across case clauses.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-case-declarations: "error"*/
-/*eslint-env es6*/
-
-switch (foo) {
-    case 1:
-        let x = 1;
-        break;
-    case 2:
-        const y = 2;
-        break;
-    case 3:
-        function f() {}
-        break;
-    default:
-        class C {}
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-case-declarations: "error"*/
-/*eslint-env es6*/
-
-// Declarations outside switch-statements are valid
-const a = 0;
-
-switch (foo) {
-    // The following case clauses are wrapped into blocks using brackets
-    case 1: {
-        let x = 1;
-        break;
-    }
-    case 2: {
-        const y = 2;
-        break;
-    }
-    case 3: {
-        function f() {}
-        break;
-    }
-    case 4:
-        // Declarations using var without brackets are valid due to function-scope hoisting
-        var z = 4;
-        break;
-    default: {
-        class C {}
-    }
-}
-```
-
-## When Not To Use It
-
-If you depend on fall through behavior and want access to bindings introduced in the case block.
-
-## Related Rules
-
-* [no-fallthrough](no-fallthrough.md)
diff --git a/eslint/docs/rules/no-catch-shadow.md b/eslint/docs/rules/no-catch-shadow.md
deleted file mode 100644 (file)
index cd57ac8..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Disallow Shadowing of Variables Inside of catch (no-catch-shadow)
-
-This rule was **deprecated** in ESLint v5.1.0.
-
-In IE 8 and earlier, the catch clause parameter can overwrite the value of a variable in the outer scope, if that variable has the same name as the catch clause parameter.
-
-```js
-var err = "x";
-
-try {
-    throw "problem";
-} catch (err) {
-
-}
-
-console.log(err)    // err is 'problem', not 'x'
-```
-
-## Rule Details
-
-This rule is aimed at preventing unexpected behavior in your program that may arise from a bug in IE 8 and earlier, in which the catch clause parameter can leak into outer scopes. This rule will warn whenever it encounters a catch clause parameter that has the same name as a variable in an outer scope.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-catch-shadow: "error"*/
-
-var err = "x";
-
-try {
-    throw "problem";
-} catch (err) {
-
-}
-
-function err() {
-    // ...
-};
-
-try {
-    throw "problem";
-} catch (err) {
-
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-catch-shadow: "error"*/
-
-var err = "x";
-
-try {
-    throw "problem";
-} catch (e) {
-
-}
-
-function err() {
-    // ...
-};
-
-try {
-    throw "problem";
-} catch (e) {
-
-}
-```
-
-## When Not To Use It
-
-If you do not need to support IE 8 and earlier, you should turn this rule off.
diff --git a/eslint/docs/rules/no-class-assign.md b/eslint/docs/rules/no-class-assign.md
deleted file mode 100644 (file)
index 62c8a71..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-# Disallow modifying variables of class declarations (no-class-assign)
-
-`ClassDeclaration` creates a variable, and we can modify the variable.
-
-```js
-/*eslint-env es6*/
-
-class A { }
-A = 0;
-```
-
-But the modification is a mistake in most cases.
-
-## Rule Details
-
-This rule is aimed to flag modifying variables of class declarations.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-class A { }
-A = 0;
-```
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-A = 0;
-class A { }
-```
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-class A {
-    b() {
-        A = 0;
-    }
-}
-```
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-let A = class A {
-    b() {
-        A = 0;
-        // `let A` is shadowed by the class name.
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-let A = class A { }
-A = 0; // A is a variable.
-```
-
-```js
-/*eslint no-class-assign: "error"*/
-/*eslint-env es6*/
-
-let A = class {
-    b() {
-        A = 0; // A is a variable.
-    }
-}
-```
-
-```js
-/*eslint no-class-assign: 2*/
-/*eslint-env es6*/
-
-class A {
-    b(A) {
-        A = 0; // A is a parameter.
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about modifying variables of class declarations, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-comma-dangle.md b/eslint/docs/rules/no-comma-dangle.md
deleted file mode 100644 (file)
index d8396ba..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# no-comma-dangle: disallow trailing commas in object and array literals
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [comma-dangle](comma-dangle.md) rule.
-
-Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec, however IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.
-
-```js
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-```
-
-## Rule Details
-
-This rule is aimed at detecting trailing commas in object literals. As such, it will warn whenever it encounters a trailing comma in an object literal.
-
-Examples of **incorrect** code for this rule:
-
-```js
-var foo = {
-    bar: "baz",
-    qux: "quux",
-};
-
-var arr = [1,2,];
-
-foo({
-  bar: "baz",
-  qux: "quux",
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-var foo = {
-    bar: "baz",
-    qux: "quux"
-};
-
-var arr = [1,2];
-
-foo({
-  bar: "baz",
-  qux: "quux"
-});
-```
-
-## When Not To Use It
-
-If your code will not be run in IE8 or below (a Node.js application, for example) and you'd prefer to allow trailing commas, turn this rule off.
diff --git a/eslint/docs/rules/no-compare-neg-zero.md b/eslint/docs/rules/no-compare-neg-zero.md
deleted file mode 100644 (file)
index cfbe545..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# disallow comparing against -0 (no-compare-neg-zero)
-
-## Rule Details
-
-The rule should warn against code that tries to compare against -0, since that will not work as intended. That is, code like x === -0 will pass for both +0 and -0. The author probably intended Object.is(x, -0).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint no-compare-neg-zero: "error" */
-
-if (x === -0) {
-    // doSomething()...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint no-compare-neg-zero: "error" */
-
-if (x === 0) {
-    // doSomething()...
-}
-```
-
-```js
-/* eslint no-compare-neg-zero: "error" */
-
-if (Object.is(x, -0)) {
-    // doSomething()...
-}
-```
diff --git a/eslint/docs/rules/no-cond-assign.md b/eslint/docs/rules/no-cond-assign.md
deleted file mode 100644 (file)
index f1738fa..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# disallow assignment operators in conditional statements (no-cond-assign)
-
-In conditional statements, it is very easy to mistype a comparison operator (such as `==`) as an assignment operator (such as `=`). For example:
-
-```js
-// Check the user's job title
-if (user.jobTitle = "manager") {
-    // user.jobTitle is now incorrect
-}
-```
-
-There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.
-
-## Rule Details
-
-This rule disallows ambiguous assignment operators in test conditions of `if`, `for`, `while`, and `do...while` statements.
-
-## Options
-
-This rule has a string option:
-
-* `"except-parens"` (default) allows assignments in test conditions *only if* they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a `while` or `do...while` loop)
-* `"always"` disallows all assignments in test conditions
-
-### except-parens
-
-Examples of **incorrect** code for this rule with the default `"except-parens"` option:
-
-```js
-/*eslint no-cond-assign: "error"*/
-
-// Unintentional assignment
-var x;
-if (x = 0) {
-    var b = 1;
-}
-
-// Practical example that is similar to an error
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while (someNode = someNode.parentNode);
-}
-```
-
-Examples of **correct** code for this rule with the default `"except-parens"` option:
-
-```js
-/*eslint no-cond-assign: "error"*/
-
-// Assignment replaced by comparison
-var x;
-if (x === 0) {
-    var b = 1;
-}
-
-// Practical example that wraps the assignment in parentheses
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while ((someNode = someNode.parentNode));
-}
-
-// Practical example that wraps the assignment and tests for 'null'
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while ((someNode = someNode.parentNode) !== null);
-}
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint no-cond-assign: ["error", "always"]*/
-
-// Unintentional assignment
-var x;
-if (x = 0) {
-    var b = 1;
-}
-
-// Practical example that is similar to an error
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while (someNode = someNode.parentNode);
-}
-
-// Practical example that wraps the assignment in parentheses
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while ((someNode = someNode.parentNode));
-}
-
-// Practical example that wraps the assignment and tests for 'null'
-function setHeight(someNode) {
-    "use strict";
-    do {
-        someNode.height = "100px";
-    } while ((someNode = someNode.parentNode) !== null);
-}
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint no-cond-assign: ["error", "always"]*/
-
-// Assignment replaced by comparison
-var x;
-if (x === 0) {
-    var b = 1;
-}
-```
-
-## Related Rules
-
-* [no-extra-parens](no-extra-parens.md)
diff --git a/eslint/docs/rules/no-confusing-arrow.md b/eslint/docs/rules/no-confusing-arrow.md
deleted file mode 100644 (file)
index dccf11e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-# Disallow arrow functions where they could be confused with comparisons (no-confusing-arrow)
-
-Arrow functions (`=>`) are similar in syntax to some comparison operators (`>`, `<`, `<=`, and `>=`). This rule warns against using the arrow function syntax in places where it could be confused with a comparison operator.
-
-Here's an example where the usage of `=>` could be confusing:
-
-```js
-// The intent is not clear
-var x = a => 1 ? 2 : 3;
-// Did the author mean this
-var x = function (a) { return 1 ? 2 : 3 };
-// Or this
-var x = a <= 1 ? 2 : 3;
-```
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-confusing-arrow: "error"*/
-/*eslint-env es6*/
-
-var x = a => 1 ? 2 : 3;
-var x = (a) => 1 ? 2 : 3;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-confusing-arrow: "error"*/
-/*eslint-env es6*/
-
-var x = a => (1 ? 2 : 3);
-var x = (a) => (1 ? 2 : 3);
-var x = a => { return 1 ? 2 : 3; };
-var x = (a) => { return 1 ? 2 : 3; };
-```
-
-## Options
-
-This rule accepts a single options argument with the following defaults:
-
-```json
-{
-    "rules": {
-        "no-confusing-arrow": ["error", {"allowParens": true}]
-    }
-}
-```
-
-`allowParens` is a boolean setting that can be `true`(default) or `false`:
-
-1. `true` relaxes the rule and accepts parenthesis as a valid "confusion-preventing" syntax.
-2. `false` warns even if the expression is wrapped in parenthesis
-
-Examples of **incorrect** code for this rule with the `{"allowParens": false}` option:
-
-```js
-/*eslint no-confusing-arrow: ["error", {"allowParens": false}]*/
-/*eslint-env es6*/
-var x = a => (1 ? 2 : 3);
-var x = (a) => (1 ? 2 : 3);
-```
-
-## Related Rules
-
-* [no-constant-condition](no-constant-condition.md)
-* [arrow-parens](arrow-parens.md)
diff --git a/eslint/docs/rules/no-console.md b/eslint/docs/rules/no-console.md
deleted file mode 100644 (file)
index b1e4e60..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# disallow the use of `console` (no-console)
-
-In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on `console`. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using `console` should be stripped before being pushed to production.
-
-```js
-console.log("Made it here.");
-console.error("That shouldn't have happened.");
-```
-
-## Rule Details
-
-This rule disallows calls or assignments to methods of the `console` object.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint no-console: "error" */
-
-console.log("Log a debug level message.");
-console.warn("Log a warn level message.");
-console.error("Log an error level message.");
-console.log = foo();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint no-console: "error" */
-
-// custom console
-Console.log("Hello world!");
-```
-
-## Options
-
-This rule has an object option for exceptions:
-
-* `"allow"` has an array of strings which are allowed methods of the `console` object
-
-Examples of additional **correct** code for this rule with a sample `{ "allow": ["warn", "error"] }` option:
-
-```js
-/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
-
-console.warn("Log a warn level message.");
-console.error("Log an error level message.");
-```
-
-## When Not To Use It
-
-If you're using Node.js, however, `console` is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.
-
-Another case where you might not use this rule is if you want to enforce console calls and not console overwrites. For example:
-
-```js
-/* eslint no-console: ["error", { allow: ["warn"] }] */
-console.error = function (message) {
-  throw new Error(message);
-};
-```
-
-With the `no-console` rule in the above example, ESLint will report an error. For the above example, you can disable the rule:
-
-```js
-// eslint-disable-next-line no-console
-console.error = function (message) {
-  throw new Error(message);
-};
-
-// or
-
-console.error = function (message) {  // eslint-disable-line no-console
-  throw new Error(message);
-};
-```
-
-However, you might not want to manually add `eslint-disable-next-line` or `eslint-disable-line`. You can achieve the effect of only receiving errors for console calls with the `no-restricted-syntax` rule:
-
-```json
-{
-    "rules": {
-        "no-console": "off",
-        "no-restricted-syntax": [
-            "error",
-            {
-                "selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
-                "message": "Unexpected property on console object was called"
-            }
-        ]
-    }
-}
-```
-
-## Related Rules
-
-* [no-alert](no-alert.md)
-* [no-debugger](no-debugger.md)
diff --git a/eslint/docs/rules/no-const-assign.md b/eslint/docs/rules/no-const-assign.md
deleted file mode 100644 (file)
index 3969767..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# Disallow modifying variables that are declared using `const` (no-const-assign)
-
-We cannot modify variables that are declared using `const` keyword.
-It will raise a runtime error.
-
-Under non ES2015 environment, it might be ignored merely.
-
-## Rule Details
-
-This rule is aimed to flag modifying variables that are declared using `const` keyword.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-const a = 0;
-a = 1;
-```
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-const a = 0;
-a += 1;
-```
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-const a = 0;
-++a;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-const a = 0;
-console.log(a);
-```
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-for (const a in [1, 2, 3]) { // `a` is re-defined (not modified) on each loop step.
-    console.log(a);
-}
-```
-
-```js
-/*eslint no-const-assign: "error"*/
-/*eslint-env es6*/
-
-for (const a of [1, 2, 3]) { // `a` is re-defined (not modified) on each loop step.
-    console.log(a);
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about modifying variables that are declared using `const` keyword, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-constant-condition.md b/eslint/docs/rules/no-constant-condition.md
deleted file mode 100644 (file)
index 8de5e69..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-# disallow constant expressions in conditions (no-constant-condition)
-
-A constant expression (for example, a literal) as a test condition might be a typo or development trigger for a specific behavior. For example, the following code looks as if it is not ready for production.
-
-```js
-if (false) {
-    doSomethingUnfinished();
-}
-```
-
-## Rule Details
-
-This rule disallows constant expressions in the test condition of:
-
-* `if`, `for`, `while`, or `do...while` statement
-* `?:` ternary expression
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-constant-condition: "error"*/
-
-if (false) {
-    doSomethingUnfinished();
-}
-
-if (void x) {
-    doSomethingUnfinished();
-}
-
-if (x &&= false) {
-    doSomethingNever();
-}
-
-if (class {}) {
-    doSomethingAlways();
-}
-
-if (new Boolean(x)) {
-    doSomethingAlways();
-}
-
-if (x ||= true) {
-    doSomethingAlways();
-}
-
-for (;-2;) {
-    doSomethingForever();
-}
-
-while (typeof x) {
-    doSomethingForever();
-}
-
-do {
-    doSomethingForever();
-} while (x = -1);
-
-var result = 0 ? a : b;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-constant-condition: "error"*/
-
-if (x === 0) {
-    doSomething();
-}
-
-for (;;) {
-    doSomethingForever();
-}
-
-while (typeof x === "undefined") {
-    doSomething();
-}
-
-do {
-    doSomething();
-} while (x);
-
-var result = x !== 0 ? a : b;
-```
-
-## Options
-
-### checkLoops
-
-Set to `true` by default. Setting this option to `false` allows constant expressions in loops.
-
-Examples of **correct** code for when `checkLoops` is `false`:
-
-```js
-/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
-
-while (true) {
-    doSomething();
-    if (condition()) {
-        break;
-    }
-};
-
-for (;true;) {
-    doSomething();
-    if (condition()) {
-        break;
-    }
-};
-
-do {
-    doSomething();
-    if (condition()) {
-        break;
-    }
-} while (true)
-```
diff --git a/eslint/docs/rules/no-constructor-return.md b/eslint/docs/rules/no-constructor-return.md
deleted file mode 100644 (file)
index 284b757..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# Disallow returning value in constructor (no-constructor-return)
-
-In JavaScript, returning a value in the constructor of a class may be a mistake. Forbidding this pattern prevents mistakes resulting from unfamiliarity with the language or a copy-paste error.
-
-## Rule Details
-
-This rule disallows return statements in the constructor of a class. Note that returning nothing with flow control is allowed.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-constructor-return: "error"*/
-
-class A {
-    constructor(a) {
-        this.a = a;
-        return a;
-    }
-}
-
-class B {
-    constructor(f) {
-        if (!f) {
-            return 'falsy';
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-constructor-return: "error"*/
-
-class C {
-    constructor(c) {
-        this.c = c;
-    }
-}
-
-class D {
-    constructor(f) {
-        if (!f) {
-            return;  // Flow control.
-        }
-
-        f();
-    }
-}
-```
diff --git a/eslint/docs/rules/no-continue.md b/eslint/docs/rules/no-continue.md
deleted file mode 100644 (file)
index 37c1188..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# disallow `continue` statements (no-continue)
-
-The `continue` statement terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. When used incorrectly it makes code less testable, less readable and less maintainable. Structured control flow statements such as `if` should be used instead.
-
-```js
-var sum = 0,
-    i;
-
-for(i = 0; i < 10; i++) {
-    if(i >= 5) {
-        continue;
-    }
-
-    a += i;
-}
-```
-
-## Rule Details
-
-This rule disallows `continue` statements.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-continue: "error"*/
-
-var sum = 0,
-    i;
-
-for(i = 0; i < 10; i++) {
-    if(i >= 5) {
-        continue;
-    }
-
-    a += i;
-}
-```
-
-```js
-/*eslint no-continue: "error"*/
-
-var sum = 0,
-    i;
-
-labeledLoop: for(i = 0; i < 10; i++) {
-    if(i >= 5) {
-        continue labeledLoop;
-    }
-
-    a += i;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-continue: "error"*/
-
-var sum = 0,
-    i;
-
-for(i = 0; i < 10; i++) {
-    if(i < 5) {
-       a += i;
-    }
-}
-```
-
-## Compatibility
-
-* **JSLint**: `continue`
diff --git a/eslint/docs/rules/no-control-regex.md b/eslint/docs/rules/no-control-regex.md
deleted file mode 100644 (file)
index 01a55fb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# disallow control characters in regular expressions (no-control-regex)
-
-Control characters are special, invisible characters in the ASCII range 0-31. These characters are rarely used in JavaScript strings so a regular expression containing these characters is most likely a mistake.
-
-## Rule Details
-
-This rule disallows control characters in regular expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-control-regex: "error"*/
-
-var pattern1 = /\x1f/;
-var pattern2 = new RegExp("\x1f");
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-control-regex: "error"*/
-
-var pattern1 = /\x20/;
-var pattern2 = new RegExp("\x20");
-```
-
-## When Not To Use It
-
-If you need to use control character pattern matching, then you should turn this rule off.
-
-## Related Rules
-
-* [no-div-regex](no-div-regex.md)
-* [no-regex-spaces](no-regex-spaces.md)
diff --git a/eslint/docs/rules/no-debugger.md b/eslint/docs/rules/no-debugger.md
deleted file mode 100644 (file)
index f8220bd..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# disallow the use of `debugger` (no-debugger)
-
-The `debugger` statement is used to tell the executing JavaScript environment to stop execution and start up a debugger at the current point in the code. This has fallen out of favor as a good practice with the advent of modern debugging and development tools. Production code should definitely not contain `debugger`, as it will cause the browser to stop executing code and open an appropriate debugger.
-
-## Rule Details
-
-This rule disallows `debugger` statements.
-
-Example of **incorrect** code for this rule:
-
-```js
-/*eslint no-debugger: "error"*/
-
-function isTruthy(x) {
-    debugger;
-    return Boolean(x);
-}
-```
-
-Example of **correct** code for this rule:
-
-```js
-/*eslint no-debugger: "error"*/
-
-function isTruthy(x) {
-    return Boolean(x); // set a breakpoint at this line
-}
-```
-
-## When Not To Use It
-
-If your code is still very much in development and don't want to worry about stripping `debugger` statements, then turn this rule off. You'll generally want to turn it back on when testing code prior to deployment.
-
-## Further Reading
-
-* [Debugger](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger)
-
-## Related Rules
-
-* [no-alert](no-alert.md)
-* [no-console](no-console.md)
diff --git a/eslint/docs/rules/no-delete-var.md b/eslint/docs/rules/no-delete-var.md
deleted file mode 100644 (file)
index ab90d11..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# disallow deleting variables (no-delete-var)
-
-The purpose of the `delete` operator is to remove a property from an object. Using the `delete` operator on a variable might lead to unexpected behavior.
-
-## Rule Details
-
-This rule disallows the use of the `delete` operator on variables.
-
-If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-delete-var: "error"*/
-
-var x;
-delete x;
-```
diff --git a/eslint/docs/rules/no-div-regex.md b/eslint/docs/rules/no-div-regex.md
deleted file mode 100644 (file)
index 211525b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# Disallow Regular Expressions That Look Like Division (no-div-regex)
-
-Require regex literals to escape division operators.
-
-```js
-function bar() { return /=foo/; }
-```
-
-## Rule Details
-
-This is used to disambiguate the division operator to not confuse users.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-div-regex: "error"*/
-
-function bar() { return /=foo/; }
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-div-regex: "error"*/
-
-function bar() { return /[=]foo/; }
-```
-
-## Related Rules
-
-* [no-control-regex](no-control-regex.md)
-* [no-regex-spaces](no-regex-spaces.md)
diff --git a/eslint/docs/rules/no-dupe-args.md b/eslint/docs/rules/no-dupe-args.md
deleted file mode 100644 (file)
index 80a3d85..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# disallow duplicate arguments in `function` definitions (no-dupe-args)
-
-If more than one parameter has the same name in a function definition, the last occurrence "shadows" the preceding occurrences. A duplicated name might be a typing error.
-
-## Rule Details
-
-This rule disallows duplicate parameter names in function declarations or expressions. It does not apply to arrow functions or class methods, because the parser reports the error.
-
-If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-dupe-args: "error"*/
-
-function foo(a, b, a) {
-    console.log("value of the second a:", a);
-}
-
-var bar = function (a, b, a) {
-    console.log("value of the second a:", a);
-};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-dupe-args: "error"*/
-
-function foo(a, b, c) {
-    console.log(a, b, c);
-}
-
-var bar = function (a, b, c) {
-    console.log(a, b, c);
-};
-```
diff --git a/eslint/docs/rules/no-dupe-class-members.md b/eslint/docs/rules/no-dupe-class-members.md
deleted file mode 100644 (file)
index 48b22e8..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-# Disallow duplicate name in class members (no-dupe-class-members)
-
-If there are declarations of the same name in class members, the last declaration overwrites other declarations silently.
-It can cause unexpected behaviors.
-
-```js
-/*eslint-env es6*/
-
-class Foo {
-  bar() { console.log("hello"); }
-  bar() { console.log("goodbye"); }
-}
-
-var foo = new Foo();
-foo.bar(); // goodbye
-```
-
-## Rule Details
-
-This rule is aimed to flag the use of duplicate names in class members.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-dupe-class-members: "error"*/
-
-class Foo {
-  bar() { }
-  bar() { }
-}
-
-class Foo {
-  bar() { }
-  get bar() { }
-}
-
-class Foo {
-  bar;
-  bar;
-}
-
-class Foo {
-  bar;
-  bar() { }
-}
-
-class Foo {
-  static bar() { }
-  static bar() { }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-dupe-class-members: "error"*/
-
-class Foo {
-  bar() { }
-  qux() { }
-}
-
-class Foo {
-  get bar() { }
-  set bar(value) { }
-}
-
-class Foo {
-  bar;
-  qux;
-}
-
-class Foo {
-  bar;
-  qux() { }
-}
-
-class Foo {
-  static bar() { }
-  bar() { }
-}
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-In ES2015 (ES6) or later, if you don't want to be notified about duplicate names in class members, you can safely disable this rule.
-
-It's also safe to disable this rule when using TypeScript because TypeScript's compiler already checks for duplicate function implementations.
diff --git a/eslint/docs/rules/no-dupe-else-if.md b/eslint/docs/rules/no-dupe-else-if.md
deleted file mode 100644 (file)
index 8b91c83..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-# Disallow duplicate conditions in `if-else-if` chains (no-dupe-else-if)
-
-`if-else-if` chains are commonly used when there is a need to execute only one branch (or at most one branch) out of several possible branches, based on certain conditions.
-
-```js
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (c) {
-    baz();
-}
-```
-
-Two identical test conditions in the same chain are almost always a mistake in the code. Unless there are side effects in the expressions, a duplicate will evaluate to the same `true` or `false` value as the identical expression earlier in the chain, meaning that its branch can never execute.
-
-```js
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (b) {
-    baz();
-}
-```
-
-In the above example, `baz()` can never execute. Obviously, `baz()` could be executed only when `b` evaluates to `true`, but in that case `bar()` would be executed instead, since it's earlier in the chain.
-
-## Rule Details
-
-This rule disallows duplicate conditions in the same `if-else-if` chain.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-dupe-else-if: "error"*/
-
-if (isSomething(x)) {
-    foo();
-} else if (isSomething(x)) {
-    bar();
-}
-
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (c && d) {
-    baz();
-} else if (c && d) {
-    quux();
-} else {
-    quuux();
-}
-
-if (n === 1) {
-    foo();
-} else if (n === 2) {
-    bar();
-} else if (n === 3) {
-    baz();
-} else if (n === 2) {
-    quux();
-} else if (n === 5) {
-    quuux();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-dupe-else-if: "error"*/
-
-if (isSomething(x)) {
-    foo();
-} else if (isSomethingElse(x)) {
-    bar();
-}
-
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (c && d) {
-    baz();
-} else if (c && e) {
-    quux();
-} else {
-    quuux();
-}
-
-if (n === 1) {
-    foo();
-} else if (n === 2) {
-    bar();
-} else if (n === 3) {
-    baz();
-} else if (n === 4) {
-    quux();
-} else if (n === 5) {
-    quuux();
-}
-```
-
-This rule can also detect some cases where the conditions are not identical, but the branch can never execute due to the logic of `||` and `&&` operators.
-
-Examples of additional **incorrect** code for this rule:
-
-```js
-/*eslint no-dupe-else-if: "error"*/
-
-if (a || b) {
-    foo();
-} else if (a) {
-    bar();
-}
-
-if (a) {
-    foo();
-} else if (b) {
-    bar();
-} else if (a || b) {
-    baz();
-}
-
-if (a) {
-    foo();
-} else if (a && b) {
-    bar();
-}
-
-if (a && b) {
-    foo();
-} else if (a && b && c) {
-    bar();
-}
-
-if (a || b) {
-    foo();
-} else if (b && c) {
-    bar();
-}
-
-if (a) {
-    foo();
-} else if (b && c) {
-    bar();
-} else if (d && (c && e && b || a)) {
-    baz();
-}
-```
-
-Please note that this rule does not compare conditions from the chain with conditions inside statements, and will not warn in the cases such as follows:
-
-```js
-if (a) {
-    if (a) {
-        foo();
-    }
-}
-
-if (a) {
-    foo();
-} else {
-    if (a) {
-        bar();
-    }
-}
-```
-
-## When Not To Use It
-
-In rare cases where you really need identical test conditions in the same chain, which necessarily means that the expressions in the chain are causing and relying on side effects, you will have to turn this rule off.
-
-## Related Rules
-
-* [no-duplicate-case](no-duplicate-case.md)
-* [no-lonely-if](no-lonely-if.md)
diff --git a/eslint/docs/rules/no-dupe-keys.md b/eslint/docs/rules/no-dupe-keys.md
deleted file mode 100644 (file)
index 0d892ef..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# disallow duplicate keys in object literals (no-dupe-keys)
-
-Multiple properties with the same key in object literals can cause unexpected behavior in your application.
-
-```js
-var foo = {
-    bar: "baz",
-    bar: "qux"
-};
-```
-
-## Rule Details
-
-This rule disallows duplicate keys in object literals.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-dupe-keys: "error"*/
-
-var foo = {
-    bar: "baz",
-    bar: "qux"
-};
-
-var foo = {
-    "bar": "baz",
-    bar: "qux"
-};
-
-var foo = {
-    0x1: "baz",
-    1: "qux"
-};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-dupe-keys: "error"*/
-
-var foo = {
-    bar: "baz",
-    quxx: "qux"
-};
-```
diff --git a/eslint/docs/rules/no-duplicate-case.md b/eslint/docs/rules/no-duplicate-case.md
deleted file mode 100644 (file)
index c728bdf..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-# Rule to disallow a duplicate case label (no-duplicate-case)
-
-If a `switch` statement has duplicate test expressions in `case` clauses, it is likely that a programmer copied a `case` clause but forgot to change the test expression.
-
-## Rule Details
-
-This rule disallows duplicate test expressions in `case` clauses of `switch` statements.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-duplicate-case: "error"*/
-
-var a = 1,
-    one = 1;
-
-switch (a) {
-    case 1:
-        break;
-    case 2:
-        break;
-    case 1:         // duplicate test expression
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case one:
-        break;
-    case 2:
-        break;
-    case one:         // duplicate test expression
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case "1":
-        break;
-    case "2":
-        break;
-    case "1":         // duplicate test expression
-        break;
-    default:
-        break;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-duplicate-case: "error"*/
-
-var a = 1,
-    one = 1;
-
-switch (a) {
-    case 1:
-        break;
-    case 2:
-        break;
-    case 3:
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case one:
-        break;
-    case 2:
-        break;
-    case 3:
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case "1":
-        break;
-    case "2":
-        break;
-    case "3":
-        break;
-    default:
-        break;
-}
-```
diff --git a/eslint/docs/rules/no-duplicate-imports.md b/eslint/docs/rules/no-duplicate-imports.md
deleted file mode 100644 (file)
index 437d2c3..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# Disallow duplicate imports (no-duplicate-imports)
-
-Using a single `import` statement per module will make the code clearer because you can see everything being imported from that module on one line.
-
-In the following example the `module` import on line 1 is repeated on line 3. These can be combined to make the list of imports more succinct.
-
-```js
-import { merge } from 'module';
-import something from 'another-module';
-import { find } from 'module';
-```
-
-## Rule Details
-
-This rule requires that all imports from a single module that can be merged exist in a single `import` statement.
-
-Example of **incorrect** code for this rule:
-
-```js
-/*eslint no-duplicate-imports: "error"*/
-
-import { merge } from 'module';
-import something from 'another-module';
-import { find } from 'module';
-```
-
-Example of **correct** code for this rule:
-
-```js
-/*eslint no-duplicate-imports: "error"*/
-
-import { merge, find } from 'module';
-import something from 'another-module';
-```
-
-Example of **correct** code for this rule:
-
-```js
-/*eslint no-duplicate-imports: "error"*/
-
-// not mergeable
-import { merge } from 'module';
-import * as something from 'module';
-```
-
-## Options
-
-This rule takes one optional argument, an object with a single key, `includeExports` which is a `boolean`. It defaults to `false`.
-
-If re-exporting from an imported module, you should add the imports to the `import`-statement, and export that directly, not use `export ... from`.
-
-Example of **incorrect** code for this rule with the `{ "includeExports": true }` option:
-
-```js
-/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
-
-import { merge } from 'module';
-
-export { find } from 'module';
-```
-
-Example of **correct** code for this rule with the `{ "includeExports": true }` option:
-
-```js
-/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
-
-import { merge, find } from 'module';
-
-export { find };
-```
-
-Example of **correct** code for this rule with the `{ "includeExports": true }` option:
-
-```js
-/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
-
-import { merge, find } from 'module';
-
-// cannot be merged with the above import
-export * as something from 'module';
-
-// cannot be written differently
-export * from 'module';
-```
diff --git a/eslint/docs/rules/no-else-return.md b/eslint/docs/rules/no-else-return.md
deleted file mode 100644 (file)
index 2f3f83d..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# Disallow return before else (no-else-return)
-
-If an `if` block contains a `return` statement, the `else` block becomes unnecessary. Its contents can be placed outside of the block.
-
-```js
-function foo() {
-    if (x) {
-        return y;
-    } else {
-        return z;
-    }
-}
-```
-
-## Rule Details
-
-This rule is aimed at highlighting an unnecessary block of code following an `if` containing a return statement. As such, it will warn when it encounters an `else` following a chain of `if`s, all of them containing a `return` statement.
-
-## Options
-
-This rule has an object option:
-
-* `allowElseIf: true` (default) allows `else if` blocks after a return
-* `allowElseIf: false` disallows `else if` blocks after a return
-
-### `allowElseIf: true`
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-else-return: "error"*/
-
-function foo() {
-    if (x) {
-        return y;
-    } else {
-        return z;
-    }
-}
-
-function foo() {
-    if (x) {
-        return y;
-    } else if (z) {
-        return w;
-    } else {
-        return t;
-    }
-}
-
-function foo() {
-    if (x) {
-        return y;
-    } else {
-        var t = "foo";
-    }
-
-    return t;
-}
-
-function foo() {
-    if (error) {
-        return 'It failed';
-    } else {
-        if (loading) {
-            return "It's still loading";
-        }
-    }
-}
-
-// Two warnings for nested occurrences
-function foo() {
-    if (x) {
-        if (y) {
-            return y;
-        } else {
-            return x;
-        }
-    } else {
-        return z;
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-else-return: "error"*/
-
-function foo() {
-    if (x) {
-        return y;
-    }
-
-    return z;
-}
-
-function foo() {
-    if (x) {
-        return y;
-    } else if (z) {
-        var t = "foo";
-    } else {
-        return w;
-    }
-}
-
-function foo() {
-    if (x) {
-        if (z) {
-            return y;
-        }
-    } else {
-        return z;
-    }
-}
-
-function foo() {
-    if (error) {
-        return 'It failed';
-    } else if (loading) {
-        return "It's still loading";
-    }
-}
-```
-
-### `allowElseIf: false`
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-else-return: ["error", {allowElseIf: false}]*/
-
-function foo() {
-    if (error) {
-        return 'It failed';
-    } else if (loading) {
-        return "It's still loading";
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-else-return: ["error", {allowElseIf: false}]*/
-
-function foo() {
-    if (error) {
-        return 'It failed';
-    }
-
-    if (loading) {
-        return "It's still loading";
-    }
-}
-```
diff --git a/eslint/docs/rules/no-empty-character-class.md b/eslint/docs/rules/no-empty-character-class.md
deleted file mode 100644 (file)
index c587e9d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# disallow empty character classes in regular expressions (no-empty-character-class)
-
-Because empty character classes in regular expressions do not match anything, they might be typing mistakes.
-
-```js
-var foo = /^abc[]/;
-```
-
-## Rule Details
-
-This rule disallows empty character classes in regular expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-empty-character-class: "error"*/
-
-/^abc[]/.test("abcdefg"); // false
-"abcdefg".match(/^abc[]/); // null
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-empty-character-class: "error"*/
-
-/^abc/.test("abcdefg"); // true
-"abcdefg".match(/^abc/); // ["abc"]
-
-/^abc[a-z]/.test("abcdefg"); // true
-"abcdefg".match(/^abc[a-z]/); // ["abcd"]
-```
-
-## Known Limitations
-
-This rule does not report empty character classes in the string argument of calls to the `RegExp` constructor.
-
-Example of a *false negative* when this rule reports correct code:
-
-```js
-/*eslint no-empty-character-class: "error"*/
-
-var abcNeverMatches = new RegExp("^abc[]");
-```
diff --git a/eslint/docs/rules/no-empty-class.md b/eslint/docs/rules/no-empty-class.md
deleted file mode 100644 (file)
index 6ed0267..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# no-empty-class: disallow empty character classes in regular expressions
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [no-empty-character-class](no-empty-character-class.md) rule.
-
-Empty character classes in regular expressions do not match anything and can result in code that may not work as intended.
-
-```js
-var foo = /^abc[]/;
-```
-
-## Rule Details
-
-This rule is aimed at highlighting possible typos and unexpected behavior in regular expressions which may arise from the use of empty character classes.
-
-Examples of **incorrect** code for this rule:
-
-```js
-var foo = /^abc[]/;
-
-/^abc[]/.test(foo);
-
-bar.match(/^abc[]/);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-var foo = /^abc/;
-
-var foo = /^abc[a-z]/;
-
-var bar = new RegExp("^abc[]");
-```
diff --git a/eslint/docs/rules/no-empty-function.md b/eslint/docs/rules/no-empty-function.md
deleted file mode 100644 (file)
index 1911031..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-# Disallow empty functions (no-empty-function)
-
-Empty functions can reduce readability because readers need to guess whether it's intentional or not.
-So writing a clear comment for empty functions is a good practice.
-
-```js
-function foo() {
-    // do nothing.
-}
-```
-
-Especially, the empty block of arrow functions might be confusing developers.
-It's very similar to an empty object literal.
-
-```js
-list.map(() => {});   // This is a block, would return undefined.
-list.map(() => ({})); // This is an empty object.
-```
-
-## Rule Details
-
-This rule is aimed at eliminating empty functions.
-A function will not be considered a problem if it contains a comment.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-empty-function: "error"*/
-/*eslint-env es6*/
-
-function foo() {}
-
-var foo = function() {};
-
-var foo = () => {};
-
-function* foo() {}
-
-var foo = function*() {};
-
-var obj = {
-    foo: function() {},
-
-    foo: function*() {},
-
-    foo() {},
-
-    *foo() {},
-
-    get foo() {},
-
-    set foo(value) {}
-};
-
-class A {
-    constructor() {}
-
-    foo() {}
-
-    *foo() {}
-
-    get foo() {}
-
-    set foo(value) {}
-
-    static foo() {}
-
-    static *foo() {}
-
-    static get foo() {}
-
-    static set foo(value) {}
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-empty-function: "error"*/
-/*eslint-env es6*/
-
-function foo() {
-    // do nothing.
-}
-
-var foo = function() {
-    // any clear comments.
-};
-
-var foo = () => {
-    bar();
-};
-
-function* foo() {
-    // do nothing.
-}
-
-var foo = function*() {
-    // do nothing.
-};
-
-var obj = {
-    foo: function() {
-        // do nothing.
-    },
-
-    foo: function*() {
-        // do nothing.
-    },
-
-    foo() {
-        // do nothing.
-    },
-
-    *foo() {
-        // do nothing.
-    },
-
-    get foo() {
-        // do nothing.
-    },
-
-    set foo(value) {
-        // do nothing.
-    }
-};
-
-class A {
-    constructor() {
-        // do nothing.
-    }
-
-    foo() {
-        // do nothing.
-    }
-
-    *foo() {
-        // do nothing.
-    }
-
-    get foo() {
-        // do nothing.
-    }
-
-    set foo(value) {
-        // do nothing.
-    }
-
-    static foo() {
-        // do nothing.
-    }
-
-    static *foo() {
-        // do nothing.
-    }
-
-    static get foo() {
-        // do nothing.
-    }
-
-    static set foo(value) {
-        // do nothing.
-    }
-}
-```
-
-## Options
-
-This rule has an option to allow specific kinds of functions to be empty.
-
-* `allow` (`string[]`) - A list of kind to allow empty functions. List items are some of the following strings. An empty array (`[]`) by default.
-    * `"functions"` - Normal functions.
-    * `"arrowFunctions"` - Arrow functions.
-    * `"generatorFunctions"` - Generator functions.
-    * `"methods"` - Class methods and method shorthands of object literals.
-    * `"generatorMethods"` - Class methods and method shorthands of object literals with generator.
-    * `"getters"` - Getters.
-    * `"setters"` - Setters.
-    * `"constructors"` - Class constructors.
-    * `"asyncFunctions"` - Async functions.
-    * `"asyncMethods"` - Async class methods and method shorthands of object literals.
-
-### allow: functions
-
-Examples of **correct** code for the `{ "allow": ["functions"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["functions"] }]*/
-
-function foo() {}
-
-var foo = function() {};
-
-var obj = {
-    foo: function() {}
-};
-```
-
-### allow: arrowFunctions
-
-Examples of **correct** code for the `{ "allow": ["arrowFunctions"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["arrowFunctions"] }]*/
-/*eslint-env es6*/
-
-var foo = () => {};
-```
-
-### allow: generatorFunctions
-
-Examples of **correct** code for the `{ "allow": ["generatorFunctions"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["generatorFunctions"] }]*/
-/*eslint-env es6*/
-
-function* foo() {}
-
-var foo = function*() {};
-
-var obj = {
-    foo: function*() {}
-};
-```
-
-### allow: methods
-
-Examples of **correct** code for the `{ "allow": ["methods"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["methods"] }]*/
-/*eslint-env es6*/
-
-var obj = {
-    foo() {}
-};
-
-class A {
-    foo() {}
-    static foo() {}
-}
-```
-
-### allow: generatorMethods
-
-Examples of **correct** code for the `{ "allow": ["generatorMethods"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["generatorMethods"] }]*/
-/*eslint-env es6*/
-
-var obj = {
-    *foo() {}
-};
-
-class A {
-    *foo() {}
-    static *foo() {}
-}
-```
-
-### allow: getters
-
-Examples of **correct** code for the `{ "allow": ["getters"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["getters"] }]*/
-/*eslint-env es6*/
-
-var obj = {
-    get foo() {}
-};
-
-class A {
-    get foo() {}
-    static get foo() {}
-}
-```
-
-### allow: setters
-
-Examples of **correct** code for the `{ "allow": ["setters"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["setters"] }]*/
-/*eslint-env es6*/
-
-var obj = {
-    set foo(value) {}
-};
-
-class A {
-    set foo(value) {}
-    static set foo(value) {}
-}
-```
-
-### allow: constructors
-
-Examples of **correct** code for the `{ "allow": ["constructors"] }` option:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["constructors"] }]*/
-/*eslint-env es6*/
-
-class A {
-    constructor() {}
-}
-```
-
-### allow: asyncFunctions
-
-Examples of **correct** code for the `{ "allow": ["asyncFunctions"] }` options:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["asyncFunctions"] }]*/
-/*eslint-env es2017*/
-
-async function a(){}
-```
-
-### allow: asyncMethods
-
-Examples of **correct** code for the `{ "allow": ["asyncMethods"] }` options:
-
-```js
-/*eslint no-empty-function: ["error", { "allow": ["asyncMethods"] }]*/
-/*eslint-env es2017*/
-
-var obj = {
-    async foo() {}
-};
-
-class A {
-    async foo() {}
-    static async foo() {}
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about empty functions, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-empty](./no-empty.md)
diff --git a/eslint/docs/rules/no-empty-label.md b/eslint/docs/rules/no-empty-label.md
deleted file mode 100644 (file)
index b887c87..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# no-empty-label: disallow labels for anything other than loops and switches
-
-(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [no-labels](no-labels.md) rule.
-
-Labeled statements are only used in conjunction with labeled break and continue statements. ECMAScript has no goto statement.
-
-## Rule Details
-
-This error occurs when a label is used to mark a statement that is not an iteration or switch
-
-Example of **incorrect** code for this rule:
-
-```js
-/*eslint no-empty-label: "error"*/
-
-labeled:
-var x = 10;
-```
-
-Example of **correct** code for this rule:
-
-```js
-/*eslint no-empty-label: "error"*/
-
-labeled:
-for (var i=10; i; i--) {
-    // ...
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of labels, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-labels](./no-labels.md)
-* [no-label-var](./no-label-var.md)
-* [no-unused-labels](./no-unused-labels.md)
diff --git a/eslint/docs/rules/no-empty-pattern.md b/eslint/docs/rules/no-empty-pattern.md
deleted file mode 100644 (file)
index 9459915..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# Disallow empty destructuring patterns (no-empty-pattern)
-
-When using destructuring, it's possible to create a pattern that has no effect. This happens when empty curly braces are used to the right of an embedded object destructuring pattern, such as:
-
-```js
-// doesn't create any variables
-var {a: {}} = foo;
-```
-
-In this code, no new variables are created because `a` is just a location helper while the `{}` is expected to contain the variables to create, such as:
-
-```js
-// creates variable b
-var {a: { b }} = foo;
-```
-
-In many cases, the empty object pattern is a mistake where the author intended to use a default value instead, such as:
-
-```js
-// creates variable a
-var {a = {}} = foo;
-```
-
-The difference between these two patterns is subtle, especially because the problematic empty pattern looks just like an object literal.
-
-## Rule Details
-
-This rule aims to flag any empty patterns in destructured objects and arrays, and as such, will report a problem whenever one is encountered.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-empty-pattern: "error"*/
-
-var {} = foo;
-var [] = foo;
-var {a: {}} = foo;
-var {a: []} = foo;
-function foo({}) {}
-function foo([]) {}
-function foo({a: {}}) {}
-function foo({a: []}) {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-empty-pattern: "error"*/
-
-var {a = {}} = foo;
-var {a = []} = foo;
-function foo({a = {}}) {}
-function foo({a = []}) {}
-```
diff --git a/eslint/docs/rules/no-empty.md b/eslint/docs/rules/no-empty.md
deleted file mode 100644 (file)
index a088708..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# disallow empty block statements (no-empty)
-
-Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.
-
-## Rule Details
-
-This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty `catch` or `finally` block of a `try` statement to indicate that execution should continue regardless of errors).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-empty: "error"*/
-
-if (foo) {
-}
-
-while (foo) {
-}
-
-switch(foo) {
-}
-
-try {
-    doSomething();
-} catch(ex) {
-
-} finally {
-
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-empty: "error"*/
-
-if (foo) {
-    // empty
-}
-
-while (foo) {
-    /* empty */
-}
-
-try {
-    doSomething();
-} catch (ex) {
-    // continue regardless of error
-}
-
-try {
-    doSomething();
-} finally {
-    /* continue regardless of error */
-}
-```
-
-## Options
-
-This rule has an object option for exceptions:
-
-* `"allowEmptyCatch": true` allows empty `catch` clauses (that is, which do not contain a comment)
-
-### allowEmptyCatch
-
-Examples of additional **correct** code for this rule with the `{ "allowEmptyCatch": true }` option:
-
-```js
-/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
-try {
-    doSomething();
-} catch (ex) {}
-
-try {
-    doSomething();
-}
-catch (ex) {}
-finally {
-    /* continue regardless of error */
-}
-```
-
-## When Not To Use It
-
-If you intentionally use empty block statements then you can disable this rule.
-
-## Related Rules
-
-* [no-empty-function](./no-empty-function.md)
diff --git a/eslint/docs/rules/no-eq-null.md b/eslint/docs/rules/no-eq-null.md
deleted file mode 100644 (file)
index 7b0f5df..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# Disallow Null Comparisons (no-eq-null)
-
-Comparing to `null` without a type-checking operator (`==` or `!=`), can have unintended results as the comparison will evaluate to true when comparing to not just a `null`, but also an `undefined` value.
-
-```js
-if (foo == null) {
-  bar();
-}
-```
-
-## Rule Details
-
-The `no-eq-null` rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to `null` only match `null`, and not also `undefined`. As such it will flag comparisons to null when using `==` and `!=`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-eq-null: "error"*/
-
-if (foo == null) {
-  bar();
-}
-
-while (qux != null) {
-  baz();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-eq-null: "error"*/
-
-if (foo === null) {
-  bar();
-}
-
-while (qux !== null) {
-  baz();
-}
-```
-
-## Compatibility
-
-* **JSHint**: This rule corresponds to `eqnull` rule of JSHint.
-
-## When Not To Use It
-
-If you want to enforce type-checking operations in general, use the more powerful [eqeqeq](./eqeqeq) instead.
diff --git a/eslint/docs/rules/no-eval.md b/eslint/docs/rules/no-eval.md
deleted file mode 100644 (file)
index 4a2a3b7..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-# Disallow eval() (no-eval)
-
-JavaScript's `eval()` function is potentially dangerous and is often misused. Using `eval()` on untrusted code can open a program up to several different injection attacks. The use of `eval()` in most contexts can be substituted for a better, alternative approach to a problem.
-
-```js
-var obj = { x: "foo" },
-    key = "x",
-    value = eval("obj." + key);
-```
-
-## Rule Details
-
-This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the `eval()` function. As such, it will warn whenever the `eval()` function is used.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-eval: "error"*/
-
-var obj = { x: "foo" },
-    key = "x",
-    value = eval("obj." + key);
-
-(0, eval)("var a = 0");
-
-var foo = eval;
-foo("var a = 0");
-
-// This `this` is the global object.
-this.eval("var a = 0");
-```
-
-Example of additional **incorrect** code for this rule when `browser` environment is set to `true`:
-
-```js
-/*eslint no-eval: "error"*/
-/*eslint-env browser*/
-
-window.eval("var a = 0");
-```
-
-Example of additional **incorrect** code for this rule when `node` environment is set to `true`:
-
-```js
-/*eslint no-eval: "error"*/
-/*eslint-env node*/
-
-global.eval("var a = 0");
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-eval: "error"*/
-/*eslint-env es6*/
-
-var obj = { x: "foo" },
-    key = "x",
-    value = obj[key];
-
-class A {
-    foo() {
-        // This is a user-defined method.
-        this.eval("var a = 0");
-    }
-
-    eval() {
-    }
-
-    static {
-        // This is a user-defined static method.
-        this.eval("var a = 0");
-    }
-
-    static eval() {
-    }
-}
-```
-
-## Options
-
-This rule has an option to allow indirect calls to `eval`.
-Indirect calls to `eval` are less dangerous than direct calls to `eval` because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct `eval`.
-
-```js
-{
-    "no-eval": ["error", {"allowIndirect": true}] // default is false
-}
-```
-
-Example of **incorrect** code for this rule with the `{"allowIndirect": true}` option:
-
-```js
-/*eslint no-eval: "error"*/
-
-var obj = { x: "foo" },
-    key = "x",
-    value = eval("obj." + key);
-```
-
-Examples of **correct** code for this rule with the `{"allowIndirect": true}` option:
-
-```js
-/*eslint no-eval: "error"*/
-
-(0, eval)("var a = 0");
-
-var foo = eval;
-foo("var a = 0");
-
-this.eval("var a = 0");
-```
-
-```js
-/*eslint no-eval: "error"*/
-/*eslint-env browser*/
-
-window.eval("var a = 0");
-```
-
-```js
-/*eslint no-eval: "error"*/
-/*eslint-env node*/
-
-global.eval("var a = 0");
-```
-
-## Known Limitations
-
-* This rule is warning every `eval()` even if the `eval` is not global's.
-  This behavior is in order to detect calls of direct `eval`. Such as:
-
-  ```js
-  module.exports = function(eval) {
-      // If the value of this `eval` is built-in `eval` function, this is a
-      // call of direct `eval`.
-      eval("var a = 0");
-  };
-  ```
-
-* This rule cannot catch renaming the global object. Such as:
-
-  ```js
-  var foo = window;
-  foo.eval("var a = 0");
-  ```
-
-## Further Reading
-
-* [Eval is Evil, Part One](https://blogs.msdn.com/b/ericlippert/archive/2003/11/01/53329.aspx)
-* [How evil is eval](https://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/)
-
-## Related Rules
-
-* [no-implied-eval](no-implied-eval.md)
diff --git a/eslint/docs/rules/no-ex-assign.md b/eslint/docs/rules/no-ex-assign.md
deleted file mode 100644 (file)
index 11745da..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# disallow reassigning exceptions in `catch` clauses (no-ex-assign)
-
-If a `catch` clause in a `try` statement accidentally (or purposely) assigns another value to the exception parameter, it impossible to refer to the error from that point on.
-Since there is no `arguments` object to offer alternative access to this data, assignment of the parameter is absolutely destructive.
-
-## Rule Details
-
-This rule disallows reassigning exceptions in `catch` clauses.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-ex-assign: "error"*/
-
-try {
-    // code
-} catch (e) {
-    e = 10;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-ex-assign: "error"*/
-
-try {
-    // code
-} catch (e) {
-    var foo = 10;
-}
-```
-
-## Further Reading
-
-* [The "catch" with try...catch](https://bocoup.com/blog/the-catch-with-try-catch) by Ben Alman explains how the exception identifier can leak into the outer scope in IE 6-8
diff --git a/eslint/docs/rules/no-extend-native.md b/eslint/docs/rules/no-extend-native.md
deleted file mode 100644 (file)
index c3ccaeb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-# Disallow Extending of Native Objects (no-extend-native)
-
-In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.
-
-For example here we are overriding a builtin method that will then affect all Objects, even other builtins.
-
-```js
-// seems harmless
-Object.prototype.extra = 55;
-
-// loop through some userIds
-var users = {
-    "123": "Stan",
-    "456": "David"
-};
-
-// not what you'd expect
-for (var id in users) {
-    console.log(id); // "123", "456", "extra"
-}
-```
-
-A common suggestion to avoid this problem would be to wrap the inside of the `for` loop with `users.hasOwnProperty(id)`. However, if this rule is strictly enforced throughout your codebase you won't need to take that step.
-
-## Rule Details
-
-Disallows directly modifying the prototype of builtin objects.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-extend-native: "error"*/
-
-Object.prototype.a = "a";
-Object.defineProperty(Array.prototype, "times", { value: 999 });
-```
-
-## Options
-
-This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which extensions will be allowed.
-
-### exceptions
-
-Examples of **correct** code for the sample `{ "exceptions": ["Object"] }` option:
-
-```js
-/*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
-
-Object.prototype.a = "a";
-```
-
-## Known Limitations
-
-This rule *does not* report any of the following less obvious approaches to modify the prototype of builtin objects:
-
-```js
-var x = Object;
-x.prototype.thing = a;
-
-eval("Array.prototype.forEach = 'muhahaha'");
-
-with(Array) {
-    prototype.thing = 'thing';
-};
-
-window.Function.prototype.bind = 'tight';
-```
-
-## When Not To Use It
-
-You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might `Function.prototype.bind` or `Array.prototype.forEach` in a future-friendly way.
-
-## Related Rules
-
-* [no-global-assign](no-global-assign.md)
diff --git a/eslint/docs/rules/no-extra-bind.md b/eslint/docs/rules/no-extra-bind.md
deleted file mode 100644 (file)
index 6d6bf13..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-# Disallow unnecessary function binding (no-extra-bind)
-
-The `bind()` method is used to create functions with specific `this` values and, optionally, binds arguments to specific values. When used to specify the value of `this`, it's important that the function actually uses `this` in its function body. For example:
-
-```js
-var boundGetName = (function getName() {
-    return this.name;
-}).bind({ name: "ESLint" });
-
-console.log(boundGetName());      // "ESLint"
-```
-
-This code is an example of a good use of `bind()` for setting the value of `this`.
-
-Sometimes during the course of code maintenance, the `this` value is removed from the function body. In that case, you can end up with a call to `bind()` that doesn't accomplish anything:
-
-```js
-// useless bind
-var boundGetName = (function getName() {
-    return "ESLint";
-}).bind({ name: "ESLint" });
-
-console.log(boundGetName());      // "ESLint"
-```
-
-In this code, the reference to `this` has been removed but `bind()` is still used. In this case, the `bind()` is unnecessary overhead (and a performance hit) and can be safely removed.
-
-## Rule Details
-
-This rule is aimed at avoiding the unnecessary use of `bind()` and as such will warn whenever an immediately-invoked function expression (IIFE) is using `bind()` and doesn't have an appropriate `this` value. This rule won't flag usage of `bind()` that includes function argument binding.
-
-**Note:** Arrow functions can never have their `this` value set using `bind()`. This rule flags all uses of `bind()` with arrow functions as a problem
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-extra-bind: "error"*/
-/*eslint-env es6*/
-
-var x = function () {
-    foo();
-}.bind(bar);
-
-var x = (() => {
-    foo();
-}).bind(bar);
-
-var x = (() => {
-    this.foo();
-}).bind(bar);
-
-var x = function () {
-    (function () {
-      this.foo();
-    }());
-}.bind(bar);
-
-var x = function () {
-    function foo() {
-      this.bar();
-    }
-}.bind(baz);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-extra-bind: "error"*/
-
-var x = function () {
-    this.foo();
-}.bind(bar);
-
-var x = function (a) {
-    return a + 1;
-}.bind(foo, bar);
-```
-
-## When Not To Use It
-
-If you are not concerned about unnecessary calls to `bind()`, you can safely disable this rule.
-
-## Further Reading
-
-* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
-* [Understanding JavaScript's Function.prototype.bind](https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/)
diff --git a/eslint/docs/rules/no-extra-boolean-cast.md b/eslint/docs/rules/no-extra-boolean-cast.md
deleted file mode 100644 (file)
index 5c7d200..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-# disallow unnecessary boolean casts (no-extra-boolean-cast)
-
-In contexts such as an `if` statement's test where the result of the expression will already be coerced to a Boolean, casting to a Boolean via double negation (`!!`) or a `Boolean` call is unnecessary. For example, these `if` statements are equivalent:
-
-```js
-if (!!foo) {
-    // ...
-}
-
-if (Boolean(foo)) {
-    // ...
-}
-
-if (foo) {
-    // ...
-}
-```
-
-## Rule Details
-
-This rule disallows unnecessary boolean casts.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-extra-boolean-cast: "error"*/
-
-var foo = !!!bar;
-
-var foo = !!bar ? baz : bat;
-
-var foo = Boolean(!!bar);
-
-var foo = new Boolean(!!bar);
-
-if (!!foo) {
-    // ...
-}
-
-if (Boolean(foo)) {
-    // ...
-}
-
-while (!!foo) {
-    // ...
-}
-
-do {
-    // ...
-} while (Boolean(foo));
-
-for (; !!foo; ) {
-    // ...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-extra-boolean-cast: "error"*/
-
-var foo = !!bar;
-var foo = Boolean(bar);
-
-function foo() {
-    return !!bar;
-}
-
-var foo = bar ? !!baz : !!bat;
-```
-
-## Options
-
-This rule has an object option:
-
-* `"enforceForLogicalOperands"` when set to `true`, in addition to checking default contexts, checks whether the extra boolean cast is contained within a logical expression. Default is `false`, meaning that this rule by default does not warn about extra booleans cast inside logical expression.
-
-### enforceForLogicalOperands
-
-Examples of **incorrect** code for this rule with `"enforceForLogicalOperands"` option set to `true`:
-
-```js
-/*eslint no-extra-boolean-cast: ["error", {"enforceForLogicalOperands": true}]*/
-
-if (!!foo || bar) {
-    //...
-}
-
-while (!!foo && bar) {
-    //...
-}
-
-if ((!!foo || bar) && baz) {
-    //...
-}
-
-foo && Boolean(bar) ? baz : bat
-
-var foo = new Boolean(!!bar || baz)
-```
-
-Examples of **correct** code for this rule with `"enforceForLogicalOperands"` option set to `true`:
-
-```js
-/*eslint no-extra-boolean-cast: ["error", {"enforceForLogicalOperands": true}]*/
-
-if (foo || bar) {
-    //...
-}
-
-while (foo && bar) {
-    //...
-}
-
-if ((foo || bar) && baz) {
-    //...
-}
-
-foo && bar ? baz : bat
-
-var foo = new Boolean(bar || baz)
-
-var foo = !!bar || baz;
-```
diff --git a/eslint/docs/rules/no-extra-label.md b/eslint/docs/rules/no-extra-label.md
deleted file mode 100644 (file)
index 5c7c114..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-# Disallow Unnecessary Labels (no-extra-label)
-
-If a loop contains no nested loops or switches, labeling the loop is unnecessary.
-
-```js
-A: while (a) {
-    break A;
-}
-```
-
-You can achieve the same result by removing the label and using `break` or `continue` without a label.
-Probably those labels would confuse developers because they expect labels to jump to further.
-
-## Rule Details
-
-This rule is aimed at eliminating unnecessary labels.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-extra-label: "error"*/
-
-A: while (a) {
-    break A;
-}
-
-B: for (let i = 0; i < 10; ++i) {
-    break B;
-}
-
-C: switch (a) {
-    case 0:
-        break C;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-extra-label: "error"*/
-
-while (a) {
-    break;
-}
-
-for (let i = 0; i < 10; ++i) {
-    break;
-}
-
-switch (a) {
-    case 0:
-        break;
-}
-
-A: {
-    break A;
-}
-
-B: while (a) {
-    while (b) {
-        break B;
-    }
-}
-
-C: switch (a) {
-    case 0:
-        while (b) {
-            break C;
-        }
-        break;
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of labels, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-labels](./no-labels.md)
-* [no-label-var](./no-label-var.md)
-* [no-unused-labels](./no-unused-labels.md)
diff --git a/eslint/docs/rules/no-extra-parens.md b/eslint/docs/rules/no-extra-parens.md
deleted file mode 100644 (file)
index b521dcb..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-# disallow unnecessary parentheses (no-extra-parens)
-
-This rule restricts the use of parentheses to only where they are necessary.
-
-## Rule Details
-
-This rule always ignores extra parentheses around the following:
-
-* RegExp literals such as `(/abc/).test(var)` to avoid conflicts with the [wrap-regex](wrap-regex.md) rule
-* immediately-invoked function expressions (also known as IIFEs) such as `var x = (function () {})();` and `var x = (function () {}());` to avoid conflicts with the [wrap-iife](wrap-iife.md) rule
-* arrow function arguments to avoid conflicts with the [arrow-parens](arrow-parens.md) rule
-
-## Options
-
-This rule has a string option:
-
-* `"all"` (default) disallows unnecessary parentheses around *any* expression
-* `"functions"` disallows unnecessary parentheses *only* around function expressions
-
-This rule has an object option for exceptions to the `"all"` option:
-
-* `"conditionalAssign": false` allows extra parentheses around assignments in conditional test expressions
-* `"returnAssign": false` allows extra parentheses around assignments in `return` statements
-* `"nestedBinaryExpressions": false` allows extra parentheses in nested binary expressions
-* `"ignoreJSX": "none|all|multi-line|single-line"` allows extra parentheses around no/all/multi-line/single-line JSX components. Defaults to `none`.
-* `"enforceForArrowConditionals": false` allows extra parentheses around ternary expressions which are the body of an arrow function
-* `"enforceForSequenceExpressions": false` allows extra parentheses around sequence expressions
-* `"enforceForNewInMemberExpressions": false` allows extra parentheses around `new` expressions in member expressions
-* `"enforceForFunctionPrototypeMethods": false` allows extra parentheses around immediate `.call` and `.apply` method calls on function expressions and around function expressions in the same context.
-
-### all
-
-Examples of **incorrect** code for this rule with the default `"all"` option:
-
-```js
-/* eslint no-extra-parens: "error" */
-
-a = (b * c);
-
-(a * b) + c;
-
-for (a in (b, c));
-
-for (a in (b));
-
-for (a of (b));
-
-typeof (a);
-
-(function(){} ? a() : b());
-
-class A {
-    [(x)] = 1;
-}
-
-class B {
-    x = (y + z);
-}
-```
-
-Examples of **correct** code for this rule with the default `"all"` option:
-
-```js
-/* eslint no-extra-parens: "error" */
-
-(0).toString();
-
-(Object.prototype.toString.call());
-
-({}.toString.call());
-
-(function(){}) ? a() : b();
-
-(/^a$/).test(x);
-
-for (a of (b, c));
-
-for (a of b);
-
-for (a in b, c);
-
-for (a in b);
-
-class A {
-    [x] = 1;
-}
-
-class B {
-    x = y + z;
-}
-```
-
-### conditionalAssign
-
-Examples of **correct** code for this rule with the `"all"` and `{ "conditionalAssign": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "conditionalAssign": false }] */
-
-while ((foo = bar())) {}
-
-if ((foo = bar())) {}
-
-do; while ((foo = bar()))
-
-for (;(a = b););
-```
-
-### returnAssign
-
-Examples of **correct** code for this rule with the `"all"` and `{ "returnAssign": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "returnAssign": false }] */
-
-function a(b) {
-  return (b = 1);
-}
-
-function a(b) {
-  return b ? (c = d) : (c = e);
-}
-
-b => (b = 1);
-
-b => b ? (c = d) : (c = e);
-```
-
-### nestedBinaryExpressions
-
-Examples of **correct** code for this rule with the `"all"` and `{ "nestedBinaryExpressions": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "nestedBinaryExpressions": false }] */
-
-x = a || (b && c);
-x = a + (b * c);
-x = (a * b) / c;
-```
-
-### ignoreJSX
-
-Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "all" }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "all" }] */
-const Component = (<div />)
-const Component = (
-    <div
-        prop={true}
-    />
-)
-```
-
-Examples of **incorrect** code for this rule with the `all` and `{ "ignoreJSX": "multi-line" }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "multi-line" }] */
-const Component = (<div />)
-const Component = (<div><p /></div>)
-```
-
-Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "multi-line" }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "multi-line" }] */
-const Component = (
-    <div>
-        <p />
-    </div>
-)
-const Component = (
-    <div
-        prop={true}
-    />
-)
-```
-
-Examples of **incorrect** code for this rule with the `all` and `{ "ignoreJSX": "single-line" }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "single-line" }] */
-const Component = (
-    <div>
-        <p />
-    </div>
-)
-const Component = (
-    <div
-        prop={true}
-    />
-)
-```
-
-Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "single-line" }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "single-line" }] */
-const Component = (<div />)
-const Component = (<div><p /></div>)
-```
-
-### enforceForArrowConditionals
-
-Examples of **correct** code for this rule with the `"all"` and `{ "enforceForArrowConditionals": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "enforceForArrowConditionals": false }] */
-
-const b = a => 1 ? 2 : 3;
-const d = c => (1 ? 2 : 3);
-```
-
-### enforceForSequenceExpressions
-
-Examples of **correct** code for this rule with the `"all"` and `{ "enforceForSequenceExpressions": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "enforceForSequenceExpressions": false }] */
-
-(a, b);
-
-if ((val = foo(), val < 10)) {}
-
-while ((val = foo(), val < 10));
-```
-
-### enforceForNewInMemberExpressions
-
-Examples of **correct** code for this rule with the `"all"` and `{ "enforceForNewInMemberExpressions": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "enforceForNewInMemberExpressions": false }] */
-
-const foo = (new Bar()).baz;
-
-const quux = (new Bar())[baz];
-
-(new Bar()).doSomething();
-```
-
-### enforceForFunctionPrototypeMethods
-
-Examples of **correct** code for this rule with the `"all"` and `{ "enforceForFunctionPrototypeMethods": false }` options:
-
-```js
-/* eslint no-extra-parens: ["error", "all", { "enforceForFunctionPrototypeMethods": false }] */
-
-const foo = (function () {}).call();
-
-const bar = (function () {}).apply();
-
-const baz = (function () {}.call());
-
-const quux = (function () {}.apply());
-```
-
-### functions
-
-Examples of **incorrect** code for this rule with the `"functions"` option:
-
-```js
-/* eslint no-extra-parens: ["error", "functions"] */
-
-((function foo() {}))();
-
-var y = (function () {return 1;});
-```
-
-Examples of **correct** code for this rule with the `"functions"` option:
-
-```js
-/* eslint no-extra-parens: ["error", "functions"] */
-
-(0).toString();
-
-(Object.prototype.toString.call());
-
-({}.toString.call());
-
-(function(){} ? a() : b());
-
-(/^a$/).test(x);
-
-a = (b * c);
-
-(a * b) + c;
-
-typeof (a);
-```
-
-## Further Reading
-
-* [MDN: Operator Precedence](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
-
-## Related Rules
-
-* [arrow-parens](arrow-parens.md)
-* [no-cond-assign](no-cond-assign.md)
-* [no-return-assign](no-return-assign.md)
diff --git a/eslint/docs/rules/no-extra-semi.md b/eslint/docs/rules/no-extra-semi.md
deleted file mode 100644 (file)
index a33a493..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# disallow unnecessary semicolons (no-extra-semi)
-
-Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.
-
-## Rule Details
-
-This rule disallows unnecessary semicolons.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-extra-semi: "error"*/
-
-var x = 5;;
-
-function foo() {
-    // code
-};
-
-class C {
-    field;;
-
-    method() {
-        // code
-    };
-
-    static {
-        // code
-    };
-};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-extra-semi: "error"*/
-
-var x = 5;
-
-function foo() {
-    // code
-}
-
-var bar = function() {
-    // code
-};
-
-class C {
-    field;
-
-    method() {
-        // code
-    }
-
-    static {
-        // code
-    }
-}
-```
-
-## When Not To Use It
-
-If you intentionally use extra semicolons then you can disable this rule.
-
-## Related Rules
-
-* [semi](semi.md)
-* [semi-spacing](semi-spacing.md)
diff --git a/eslint/docs/rules/no-extra-strict.md b/eslint/docs/rules/no-extra-strict.md
deleted file mode 100644 (file)
index a350f77..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# no-extra-strict: disallow strict mode directives when already in strict mode
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [strict](strict.md) rule. The `"global"` or `"function"` options in the new rule are similar to the removed rule.
-
-The `"use strict";` directive applies to the scope in which it appears and all inner scopes contained within that scope. Therefore, using the `"use strict";` directive in one of these inner scopes is unnecessary.
-
-```js
-"use strict";
-
-(function () {
-    "use strict";
-    var foo = true;
-}());
-```
-
-## Rule Details
-
-This rule is aimed at preventing unnecessary `"use strict";` directives. As such, it will warn when it encounters a `"use strict";` directive when already in strict mode.
-
-Example of **incorrect** code for this rule:
-
-```js
-"use strict";
-
-(function () {
-    "use strict";
-    var foo = true;
-}());
-```
-
-Examples of **correct** code for this rule:
-
-```js
-"use strict";
-
-(function () {
-    var foo = true;
-}());
-```
-
-```js
-(function () {
-    "use strict";
-    var foo = true;
-}());
-```
-
-## Further Reading
-
-* [The ECMAScript 5 Annotated Specification - Strict Mode](https://es5.github.io/#C)
diff --git a/eslint/docs/rules/no-fallthrough.md b/eslint/docs/rules/no-fallthrough.md
deleted file mode 100644 (file)
index 81b428c..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-# Disallow Case Statement Fallthrough (no-fallthrough)
-
-The `switch` statement in JavaScript is one of the more error-prone constructs of the language thanks in part to the ability to "fall through" from one `case` to the next. For example:
-
-```js
-switch(foo) {
-    case 1:
-        doSomething();
-
-    case 2:
-        doSomethingElse();
-}
-```
-
-In this example, if `foo` is `1`, then execution will flow through both cases, as the first falls through to the second. You can prevent this by using `break`, as in this example:
-
-```js
-switch(foo) {
-    case 1:
-        doSomething();
-        break;
-
-    case 2:
-        doSomethingElse();
-}
-```
-
-That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the `/falls?\s?through/i` regular expression:
-
-```js
-switch(foo) {
-    case 1:
-        doSomething();
-        // falls through
-
-    case 2:
-        doSomethingElse();
-}
-
-switch(foo) {
-    case 1:
-        doSomething();
-        // fall through
-
-    case 2:
-        doSomethingElse();
-}
-
-switch(foo) {
-    case 1:
-        doSomething();
-        // fallsthrough
-
-    case 2:
-        doSomethingElse();
-}
-
-switch(foo) {
-    case 1: {
-        doSomething();
-        // falls through
-    }
-
-    case 2: {
-        doSomethingElse();
-    }
-}
-```
-
-In this example, there is no confusion as to the expected behavior. It is clear that the first case is meant to fall through to the second case.
-
-## Rule Details
-
-This rule is aimed at eliminating unintentional fallthrough of one case to the other. As such, it flags any fallthrough scenarios that are not marked by a comment.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-fallthrough: "error"*/
-
-switch(foo) {
-    case 1:
-        doSomething();
-
-    case 2:
-        doSomething();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-fallthrough: "error"*/
-
-switch(foo) {
-    case 1:
-        doSomething();
-        break;
-
-    case 2:
-        doSomething();
-}
-
-function bar(foo) {
-    switch(foo) {
-        case 1:
-            doSomething();
-            return;
-
-        case 2:
-            doSomething();
-    }
-}
-
-switch(foo) {
-    case 1:
-        doSomething();
-        throw new Error("Boo!");
-
-    case 2:
-        doSomething();
-}
-
-switch(foo) {
-    case 1:
-    case 2:
-        doSomething();
-}
-
-switch(foo) {
-    case 1:
-        doSomething();
-        // falls through
-
-    case 2:
-        doSomething();
-}
-
-switch(foo) {
-    case 1: {
-        doSomething();
-        // falls through
-    }
-
-    case 2: {
-        doSomethingElse();
-    }
-}
-```
-
-Note that the last `case` statement in these examples does not cause a warning because there is nothing to fall through into.
-
-## Options
-
-This rule accepts a single options argument:
-
-* Set the `commentPattern` option to a regular expression string to change the test for intentional fallthrough comment
-
-### commentPattern
-
-Examples of **correct** code for the `{ "commentPattern": "break[\\s\\w]*omitted" }` option:
-
-```js
-/*eslint no-fallthrough: ["error", { "commentPattern": "break[\\s\\w]*omitted" }]*/
-
-switch(foo) {
-    case 1:
-        doSomething();
-        // break omitted
-
-    case 2:
-        doSomething();
-}
-
-switch(foo) {
-    case 1:
-        doSomething();
-        // caution: break is omitted intentionally
-
-    default:
-        doSomething();
-}
-```
-
-## When Not To Use It
-
-If you don't want to enforce that each `case` statement should end with a `throw`, `return`, `break`, or comment, then you can safely turn this rule off.
-
-## Related Rules
-
-* [default-case](default-case.md)
diff --git a/eslint/docs/rules/no-floating-decimal.md b/eslint/docs/rules/no-floating-decimal.md
deleted file mode 100644 (file)
index 880bc07..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# Disallow Floating Decimals (no-floating-decimal)
-
-Float values in JavaScript contain a decimal point, and there is no requirement that the decimal point be preceded or followed by a number. For example, the following are all valid JavaScript numbers:
-
-```js
-var num = .5;
-var num = 2.;
-var num = -.7;
-```
-
-Although not a syntax error, this format for numbers can make it difficult to distinguish between true decimal numbers and the dot operator. For this reason, some recommend that you should always include a number before and after a decimal point to make it clear the intent is to create a decimal number.
-
-## Rule Details
-
-This rule is aimed at eliminating floating decimal points and will warn whenever a numeric value has a decimal point but is missing a number either before or after it.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-floating-decimal: "error"*/
-
-var num = .5;
-var num = 2.;
-var num = -.7;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-floating-decimal: "error"*/
-
-var num = 0.5;
-var num = 2.0;
-var num = -0.7;
-```
-
-## When Not To Use It
-
-If you aren't concerned about misinterpreting floating decimal point values, then you can safely turn this rule off.
-
-## Compatibility
-
-* **JSHint**: W008, W047
diff --git a/eslint/docs/rules/no-func-assign.md b/eslint/docs/rules/no-func-assign.md
deleted file mode 100644 (file)
index e35b0ed..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# disallow reassigning `function` declarations (no-func-assign)
-
-JavaScript functions can be written as a FunctionDeclaration `function foo() { ... }` or as a FunctionExpression `var foo = function() { ... };`. While a JavaScript interpreter might tolerate it, overwriting/reassigning a function written as a FunctionDeclaration is often indicative of a mistake or issue.
-
-```js
-function foo() {}
-foo = bar;
-```
-
-## Rule Details
-
-This rule disallows reassigning `function` declarations.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-func-assign: "error"*/
-
-function foo() {}
-foo = bar;
-
-function foo() {
-    foo = bar;
-}
-
-var a = function hello() {
-  hello = 123;
-};
-```
-
-Examples of **incorrect** code for this rule, unlike the corresponding rule in JSHint:
-
-```js
-/*eslint no-func-assign: "error"*/
-
-foo = bar;
-function foo() {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-func-assign: "error"*/
-
-var foo = function () {}
-foo = bar;
-
-function foo(foo) { // `foo` is shadowed.
-    foo = bar;
-}
-
-function foo() {
-    var foo = bar;  // `foo` is shadowed.
-}
-```
diff --git a/eslint/docs/rules/no-global-assign.md b/eslint/docs/rules/no-global-assign.md
deleted file mode 100644 (file)
index b3718d1..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# Disallow assignment to native objects or read-only global variables (no-global-assign)
-
-JavaScript environments contain a number of built-in global variables, such as `window` in browsers and `process` in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:
-
-```js
-window = {};
-```
-
-While examples such as `window` are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.
-
-## Rule Details
-
-This rule disallows modifications to read-only global variables.
-
-ESLint has the capability to configure global variables as read-only.
-
-* [Specifying Environments](../user-guide/configuring#specifying-environments)
-* [Specifying Globals](../user-guide/configuring#specifying-globals)
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-global-assign: "error"*/
-
-Object = null
-undefined = 1
-```
-
-```js
-/*eslint no-global-assign: "error"*/
-/*eslint-env browser*/
-
-window = {}
-length = 1
-top = 1
-```
-
-```js
-/*eslint no-global-assign: "error"*/
-/*global a:readonly*/
-
-a = 1
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-global-assign: "error"*/
-
-a = 1
-var b = 1
-b = 2
-```
-
-```js
-/*eslint no-global-assign: "error"*/
-/*eslint-env browser*/
-
-onload = function() {}
-```
-
-```js
-/*eslint no-global-assign: "error"*/
-/*global a:writable*/
-
-a = 1
-```
-
-## Options
-
-This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which reassignments will be allowed:
-
-```json
-{
-    "rules": {
-        "no-global-assign": ["error", {"exceptions": ["Object"]}]
-    }
-}
-```
-
-## When Not To Use It
-
-If you are trying to override one of the native objects.
-
-## Related Rules
-
-* [no-extend-native](no-extend-native.md)
-* [no-redeclare](no-redeclare.md)
-* [no-shadow](no-shadow.md)
diff --git a/eslint/docs/rules/no-implicit-coercion.md b/eslint/docs/rules/no-implicit-coercion.md
deleted file mode 100644 (file)
index 8ccee33..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-# Disallow the type conversion with shorter notations. (no-implicit-coercion)
-
-In JavaScript, there are a lot of different ways to convert value types.
-Some of them might be hard to read and understand.
-
-Such as:
-
-```js
-var b = !!foo;
-var b = ~foo.indexOf(".");
-var n = +foo;
-var n = 1 * foo;
-var s = "" + foo;
-foo += ``;
-```
-
-Those can be replaced with the following code:
-
-```js
-var b = Boolean(foo);
-var b = foo.indexOf(".") !== -1;
-var n = Number(foo);
-var n = Number(foo);
-var s = String(foo);
-foo = String(foo);
-```
-
-## Rule Details
-
-This rule is aimed to flag shorter notations for the type conversion, then suggest a more self-explanatory notation.
-
-## Options
-
-This rule has three main options and one override option to allow some coercions as required.
-
--   `"boolean"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `boolean` type.
--   `"number"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `number` type.
--   `"string"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `string` type.
--   `"disallowTemplateShorthand"` (`false` by default) - When this is `true`, this rule warns `string` type conversions using `${expression}` form.
--   `"allow"` (`empty` by default) - Each entry in this array can be one of `~`, `!!`, `+` or `*` that are to be allowed.
-
-Note that operator `+` in `allow` list would allow `+foo` (number coercion) as well as `"" + foo` (string coercion).
-
-### boolean
-
-Examples of **incorrect** code for the default `{ "boolean": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var b = !!foo;
-var b = ~foo.indexOf(".");
-// bitwise not is incorrect only with `indexOf`/`lastIndexOf` method calling.
-```
-
-Examples of **correct** code for the default `{ "boolean": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var b = Boolean(foo);
-var b = foo.indexOf(".") !== -1;
-
-var n = ~foo; // This is a just bitwise not.
-```
-
-### number
-
-Examples of **incorrect** code for the default `{ "number": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var n = +foo;
-var n = 1 * foo;
-```
-
-Examples of **correct** code for the default `{ "number": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var n = Number(foo);
-var n = parseFloat(foo);
-var n = parseInt(foo, 10);
-```
-
-### string
-
-Examples of **incorrect** code for the default `{ "string": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var s = "" + foo;
-var s = `` + foo;
-foo += "";
-foo += ``;
-```
-
-Examples of **correct** code for the default `{ "string": true }` option:
-
-```js
-/*eslint no-implicit-coercion: "error"*/
-
-var s = String(foo);
-foo = String(foo);
-```
-
-### disallowTemplateShorthand
-
-This option is **not** affected by the `string` option.
-
-Examples of **incorrect** code for the `{ "disallowTemplateShorthand": true }` option:
-
-```js
-/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": true }]*/
-
-var s = `${foo}`;
-```
-
-Examples of **correct** code for the `{ "disallowTemplateShorthand": true }` option:
-
-```js
-/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": true }]*/
-
-var s = String(foo);
-
-var s = `a${foo}`;
-
-var s = `${foo}b`;
-
-var s = `${foo}${bar}`;
-
-var s = tag`${foo}`;
-```
-
-Examples of **correct** code for the default `{ "disallowTemplateShorthand": false }` option:
-
-```js
-/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": false }]*/
-
-var s = `${foo}`;
-```
-
-### allow
-
-Using `allow` list, we can override and allow specific operators.
-
-Examples of **correct** code for the sample `{ "allow": ["!!", "~"] }` option:
-
-```js
-/*eslint no-implicit-coercion: [2, { "allow": ["!!", "~"] } ]*/
-
-var b = !!foo;
-var b = ~foo.indexOf(".");
-```
-
-## When Not To Use It
-
-If you don't want to be notified about shorter notations for the type conversion, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-implicit-globals.md b/eslint/docs/rules/no-implicit-globals.md
deleted file mode 100644 (file)
index 479d958..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-# Disallow declarations in the global scope (no-implicit-globals)
-
-It is the best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script.
-
-Global variables created from a script can produce name collisions with global variables created from another script, which will
-usually lead to runtime errors or unexpected behavior.
-
-This rule disallows the following:
-
-* Declarations that create one or more variables in the global scope.
-* Global variable leaks.
-* Redeclarations of read-only global variables and assignments to read-only global variables.
-
-There is an explicit way to create a global variable when needed, by assigning to a property of the global object.
-
-This rule is mostly useful for browser scripts. Top-level declarations in ES modules and CommonJS modules create module-scoped
-variables. ES modules also have implicit `strict` mode, which prevents global variable leaks.
-
-By default, this rule does not check `const`, `let` and `class` declarations.
-
-This rule has an object option with one option:
-
-* Set `"lexicalBindings"` to `true` if you want this rule to check `const`, `let` and `class` declarations as well.
-
-## Rule Details
-
-### `var` and `function` declarations
-
-When working with browser scripts, developers often forget that variable and function declarations at the top-level scope become global variables on the `window` object. As opposed to modules which have their own scope. Globals should be explicitly assigned to `window` or `self` if that is the intent. Otherwise variables intended to be local to the script should be wrapped in an IIFE.
-
-This rule disallows `var` and `function` declarations at the top-level script scope. This does not apply to ES and CommonJS modules since they have a module scope.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-implicit-globals: "error"*/
-
-var foo = 1;
-
-function bar() {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-implicit-globals: "error"*/
-
-// explicitly set on window
-window.foo = 1;
-window.bar = function() {};
-
-// intended to be scope to this file
-(function() {
-  var foo = 1;
-
-  function bar() {}
-})();
-```
-
-Examples of **correct** code for this rule with `"parserOptions": { "sourceType": "module" }` in the ESLint configuration:
-
-```js
-/*eslint no-implicit-globals: "error"*/
-
-// foo and bar are local to module
-var foo = 1;
-function bar() {}
-```
-
-### Global variable leaks
-
-When the code is not in `strict` mode, an assignment to an undeclared variable creates
-a new global variable. This will happen even if the code is in a function.
-
-This does not apply to ES modules since the module code is implicitly in `strict` mode.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-implicit-globals: "error"*/
-
-foo = 1;
-
-Bar.prototype.baz = function () {
-    a = 1; // Intended to be this.a = 1;
-};
-```
-
-### Read-only global variables
-
-This rule also disallows redeclarations of read-only global variables and assignments to read-only global variables.
-
-A read-only global variable can be a built-in ES global (e.g. `Array`), an environment specific global
-(e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file
-or in a `/*global */` comment.
-
-* [Specifying Environments](../user-guide/configuring#specifying-environments)
-* [Specifying Globals](../user-guide/configuring#specifying-globals)
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-implicit-globals: "error"*/
-
-/*global foo:readonly*/
-
-foo = 1;
-
-Array = [];
-var Object;
-```
-
-### `const`, `let` and `class` declarations
-
-Lexical declarations `const` and `let`, as well as `class` declarations, create variables that are block-scoped.
-
-However, when declared in the top-level of a browser script these variables are not 'script-scoped'.
-They are actually created in the global scope and could produce name collisions with
-`var`, `const` and `let` variables and `function` and `class` declarations from other scripts.
-This does not apply to ES and CommonJS  modules.
-
-If the variable is intended to be local to the script, wrap the code with a block or with an immediately-invoked function expression (IIFE).
-
-Examples of **correct** code for this rule with `"lexicalBindings"` option set to `false` (default):
-
-```js
-/*eslint no-implicit-globals: ["error", {"lexicalBindings": false}]*/
-
-const foo = 1;
-
-let baz;
-
-class Bar {}
-```
-
-Examples of **incorrect** code for this rule with `"lexicalBindings"` option set to `true`:
-
-```js
-/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
-
-const foo = 1;
-
-let baz;
-
-class Bar {}
-```
-
-Examples of **correct** code for this rule with `"lexicalBindings"` option set to `true`:
-
-```js
-/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
-
-{
-    const foo = 1;
-    let baz;
-    class Bar {}
-}
-
-(function() {
-    const foo = 1;
-    let baz;
-    class Bar {}
-}());
-```
-
-If you intend to create a global `const` or `let` variable or a global `class` declaration, to be used from other scripts,
-be aware that there are certain differences when compared to the traditional methods, which are `var` declarations and assigning to a property of the global `window` object:
-
-* Lexically declared variables cannot be conditionally created. A script cannot check for the existence of
-a variable and then create a new one. `var` variables are also always created, but redeclarations do not
-cause runtime exceptions.
-* Lexically declared variables do not create properties on the global object, which is what a consuming script might expect.
-* Lexically declared variables are shadowing properties of the global object, which might produce errors if a
-consuming script is using both the variable and the property.
-* Lexically declared variables can produce a permanent Temporal Dead Zone (TDZ) if the initialization throws an exception.
-Even the `typeof` check is not safe from TDZ reference exceptions.
-
-Examples of **incorrect** code for this rule with `"lexicalBindings"` option set to `true`:
-
-```js
-/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
-
-const MyGlobalFunction = (function() {
-    const a = 1;
-    let b = 2;
-    return function() {
-        return a + b;
-    }
-}());
-```
-
-Examples of **correct** code for this rule with `"lexicalBindings"` option set to `true`:
-
-```js
-/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
-
-window.MyGlobalFunction = (function() {
-    const a = 1;
-    let b = 2;
-    return function() {
-        return a + b;
-    }
-}());
-```
-
-## When Not To Use It
-
-In the case of a browser script, if you want to be able to explicitly declare variables and functions in the global scope,
-and your code is in strict mode or you don't want this rule to warn you about undeclared variables,
-and you also don't want this rule to warn you about read-only globals, you can disable this rule.
-
-In the case of a CommonJS module, if your code is in strict mode or you don't want this rule to warn you about undeclared variables,
-and you also don't want this rule to warn you about the read-only globals, you can disable this rule.
-
-In the case of an ES module, if you don't want this rule to warn you about the read-only globals you can disable this rule.
-
-## Further Reading
-
-* [Immediately-Invoked Function Expression (IIFE)](http://benalman.com/news/2010/11/immediately-invoked-function-expression/)
-* [ReferenceError: assignment to undeclared variable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var)
-* [Temporal Dead Zone](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone)
-
-## Related Rules
-
-* [no-undef](no-undef.md)
-* [no-global-assign](no-global-assign.md)
diff --git a/eslint/docs/rules/no-implied-eval.md b/eslint/docs/rules/no-implied-eval.md
deleted file mode 100644 (file)
index cbf7c67..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# Disallow Implied eval() (no-implied-eval)
-
-It's considered a good practice to avoid using `eval()` in JavaScript. There are security and performance implications involved with doing so, which is why many linters (including ESLint) recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.
-
-The first is using `setTimeout()`, `setInterval()` or `execScript()` (Internet Explorer only), all of which can accept a string of JavaScript code as their first argument. For example:
-
-```js
-setTimeout("alert('Hi!');", 100);
-```
-
-This is considered an implied `eval()` because a string of JavaScript code is
- passed in to be interpreted. The same can be done with `setInterval()` and `execScript()`. Both interpret the JavaScript code in  the global scope. For  both `setTimeout()` and `setInterval()`, the first argument can also be a function, and that is considered safer and is more performant:
-
-```js
-setTimeout(function() {
-    alert("Hi!");
-}, 100);
-```
-
-The best practice is to always use a function for the first argument of `setTimeout()` and `setInterval()` (and avoid `execScript()`).
-
-## Rule Details
-
-This rule aims to eliminate implied `eval()` through the use of `setTimeout()`, `setInterval()` or `execScript()`. As such, it will warn when either function is used with a string as the first argument.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-implied-eval: "error"*/
-
-setTimeout("alert('Hi!');", 100);
-
-setInterval("alert('Hi!');", 100);
-
-execScript("alert('Hi!')");
-
-window.setTimeout("count = 5", 10);
-
-window.setInterval("foo = bar", 10);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-implied-eval: "error"*/
-
-setTimeout(function() {
-    alert("Hi!");
-}, 100);
-
-setInterval(function() {
-    alert("Hi!");
-}, 100);
-```
-
-## When Not To Use It
-
-If you want to allow `setTimeout()` and `setInterval()` with string arguments, then you can safely disable this rule.
-
-## Related Rules
-
-* [no-eval](no-eval.md)
diff --git a/eslint/docs/rules/no-import-assign.md b/eslint/docs/rules/no-import-assign.md
deleted file mode 100644 (file)
index 49595cd..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# disallow assigning to imported bindings (no-import-assign)
-
-The updates of imported bindings by ES Modules cause runtime errors.
-
-## Rule Details
-
-This rule warns the assignments, increments, and decrements of imported bindings.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-import-assign: "error"*/
-
-import mod, { named } from "./mod.mjs"
-import * as mod_ns from "./mod.mjs"
-
-mod = 1          // ERROR: 'mod' is readonly.
-named = 2        // ERROR: 'named' is readonly.
-mod_ns.named = 3 // ERROR: The members of 'mod_ns' are readonly.
-mod_ns = {}      // ERROR: 'mod_ns' is readonly.
-// Can't extend 'mod_ns'
-Object.assign(mod_ns, { foo: "foo" }) // ERROR: The members of 'mod_ns' are readonly.
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-import-assign: "error"*/
-
-import mod, { named } from "./mod.mjs"
-import * as mod_ns from "./mod.mjs"
-
-mod.prop = 1
-named.prop = 2
-mod_ns.named.prop = 3
-
-// Known Limitation
-function test(obj) {
-    obj.named = 4 // Not errored because 'obj' is not namespace objects.
-}
-test(mod_ns) // Not errored because it doesn't know that 'test' updates the member of the argument.
-```
-
-## When Not To Use It
-
-If you don't want to be notified about modifying imported bindings, you can disable this rule.
diff --git a/eslint/docs/rules/no-inline-comments.md b/eslint/docs/rules/no-inline-comments.md
deleted file mode 100644 (file)
index 237b248..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# disallow inline comments after code (no-inline-comments)
-
-Some style guides disallow comments on the same line as code. Code can become difficult to read if comments immediately follow the code on the same line.
-On the other hand, it is sometimes faster and more obvious to put comments immediately following code.
-
-## Rule Details
-
-This rule disallows comments on the same line as code.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-inline-comments: "error"*/
-
-var a = 1; // declaring a to 1
-
-function getRandomNumber(){
-    return 4; // chosen by fair dice roll.
-              // guaranteed to be random.
-}
-
-/* A block comment before code */ var b = 2;
-
-var c = 3; /* A block comment after code */
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-inline-comments: "error"*/
-
-// This is a comment above a line of code
-var foo = 5;
-
-var bar = 5;
-//This is a comment below a line of code
-```
-
-### JSX exception
-
-Comments inside the curly braces in JSX are allowed to be on the same line as the braces, but only if they are not on the same line with other code, and the braces do not enclose an actual expression.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-inline-comments: "error"*/
-
-var foo = <div>{ /* On the same line with other code */ }<h1>Some heading</h1></div>;
-
-var bar = (
-    <div>
-    {   // These braces are not just for the comment, so it can't be on the same line
-        baz
-    }
-    </div>
-);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-inline-comments: "error"*/
-
-var foo = (
-    <div>
-      {/* These braces are just for this comment and there is nothing else on this line */}
-      <h1>Some heading</h1>
-    </div>
-)
-
-var bar = (
-    <div>
-    {
-        // There is nothing else on this line
-        baz
-    }
-    </div>
-);
-
-var quux = (
-    <div>
-      {/*
-        Multiline
-        comment
-      */}
-      <h1>Some heading</h1>
-    </div>
-)
-```
-
-## Options
-
-### ignorePattern
-
-To make this rule ignore specific comments, set the `ignorePattern` option to a string pattern that will be passed to the [`RegExp` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp).
-
-Examples of **correct** code for the `ignorePattern` option:
-
-```js
-/*eslint no-inline-comments: ["error", { "ignorePattern": "webpackChunkName:\\s.+" }]*/
-
-import(/* webpackChunkName: "my-chunk-name" */ './locale/en');
-```
-
-Examples of **incorrect** code for the `ignorePattern` option:
-
-```js
-/*eslint no-inline-comments: ["error", { "ignorePattern": "something" }] */
-
-var foo = 4; // other thing
-```
diff --git a/eslint/docs/rules/no-inner-declarations.md b/eslint/docs/rules/no-inner-declarations.md
deleted file mode 100644 (file)
index 7c64e9d..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-# disallow variable or `function` declarations in nested blocks (no-inner-declarations)
-
-In JavaScript, prior to ES6, a function declaration is only allowed in the first level of a program or the body of another function, though parsers sometimes [erroneously accept them elsewhere](https://code.google.com/p/esprima/issues/detail?id=422). This only applies to function declarations; named or anonymous function expressions can occur anywhere an expression is permitted.
-
-```js
-// Good
-function doSomething() { }
-
-// Bad
-if (test) {
-    function doSomethingElse () { }
-}
-
-function anotherThing() {
-    var fn;
-
-    if (test) {
-
-        // Good
-        fn = function expression() { };
-
-        // Bad
-        function declaration() { }
-    }
-}
-```
-
-A variable declaration is permitted anywhere a statement can go, even nested deeply inside other blocks. This is often undesirable due to variable hoisting, and moving declarations to the root of the program or function body can increase clarity. Note that [block bindings](https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings) (`let`, `const`) are not hoisted and therefore they are not affected by this rule.
-
-```js
-/*eslint-env es6*/
-
-// Good
-var foo = 42;
-
-// Good
-if (foo) {
-    let bar1;
-}
-
-// Bad
-while (test) {
-    var bar2;
-}
-
-function doSomething() {
-    // Good
-    var baz = true;
-
-    // Bad
-    if (baz) {
-        var quux;
-    }
-}
-```
-
-## Rule Details
-
-This rule requires that function declarations and, optionally, variable declarations be in the root of a program, or in the root of the body of a function, or in the root of the body of a class static block.
-
-## Options
-
-This rule has a string option:
-
-* `"functions"` (default) disallows `function` declarations in nested blocks
-* `"both"` disallows `function` and `var` declarations in nested blocks
-
-### functions
-
-Examples of **incorrect** code for this rule with the default `"functions"` option:
-
-```js
-/*eslint no-inner-declarations: "error"*/
-
-if (test) {
-    function doSomething() { }
-}
-
-function doSomethingElse() {
-    if (test) {
-        function doAnotherThing() { }
-    }
-}
-
-if (foo) function f(){}
-
-class C {
-    static {
-        if (test) {
-            function doSomething() { }
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with the default `"functions"` option:
-
-```js
-/*eslint no-inner-declarations: "error"*/
-
-function doSomething() { }
-
-function doSomethingElse() {
-    function doAnotherThing() { }
-}
-
-class C {
-    static {
-        function doSomething() { }
-    }
-}
-
-if (test) {
-    asyncCall(id, function (err, data) { });
-}
-
-var fn;
-if (test) {
-    fn = function fnExpression() { };
-}
-
-if (foo) var a;
-```
-
-### both
-
-Examples of **incorrect** code for this rule with the `"both"` option:
-
-```js
-/*eslint no-inner-declarations: ["error", "both"]*/
-
-if (test) {
-    var foo = 42;
-}
-
-function doAnotherThing() {
-    if (test) {
-        var bar = 81;
-    }
-}
-
-if (foo) var a;
-
-if (foo) function f(){}
-
-class C {
-    static {
-        if (test) {
-            var something;
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `"both"` option:
-
-```js
-/*eslint no-inner-declarations: ["error", "both"]*/
-
-var bar = 42;
-
-if (test) {
-    let baz = 43;
-}
-
-function doAnotherThing() {
-    var baz = 81;
-}
-
-class C {
-    static {
-        var something;
-    }
-}
-```
-
-## When Not To Use It
-
-The function declaration portion rule will be rendered obsolete when [block-scoped functions](https://bugzilla.mozilla.org/show_bug.cgi?id=585536) land in ES6, but until then, it should be left on to enforce valid constructions. Disable checking variable declarations when using [block-scoped-var](block-scoped-var.md) or if declaring variables in nested blocks is acceptable despite hoisting.
diff --git a/eslint/docs/rules/no-invalid-regexp.md b/eslint/docs/rules/no-invalid-regexp.md
deleted file mode 100644 (file)
index 478cbee..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# disallow invalid regular expression strings in `RegExp` constructors (no-invalid-regexp)
-
-An invalid pattern in a regular expression literal is a `SyntaxError` when the code is parsed, but an invalid string in `RegExp` constructors throws a `SyntaxError` only when the code is executed.
-
-## Rule Details
-
-This rule disallows invalid regular expression strings in `RegExp` constructors.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-invalid-regexp: "error"*/
-
-RegExp('[')
-
-RegExp('.', 'z')
-
-new RegExp('\\')
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-invalid-regexp: "error"*/
-
-RegExp('.')
-
-new RegExp
-
-this.RegExp('[')
-```
-
-Please note that this rule validates regular expressions per the latest ECMAScript specification, regardless of your parser settings.
-
-If you want to allow additional constructor flags for any reason, you can specify them using the `allowConstructorFlags` option. These flags will then be ignored by the rule.
-
-## Options
-
-This rule has an object option for exceptions:
-
-* `"allowConstructorFlags"` is an array of flags
-
-### allowConstructorFlags
-
-Examples of **correct** code for this rule with the `{ "allowConstructorFlags": ["a", "z"] }` option:
-
-```js
-/*eslint no-invalid-regexp: ["error", { "allowConstructorFlags": ["a", "z"] }]*/
-
-new RegExp('.', 'a')
-
-new RegExp('.', 'az')
-```
-
-## Further Reading
-
-* [Annotated ES5 §7.8.5 - Regular Expression Literals](https://es5.github.io/#x7.8.5)
diff --git a/eslint/docs/rules/no-invalid-this.md b/eslint/docs/rules/no-invalid-this.md
deleted file mode 100644 (file)
index f2f17d4..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-# Disallow `this` keywords outside of classes or class-like objects. (no-invalid-this)
-
-Under the strict mode, `this` keywords outside of classes or class-like objects might be `undefined` and raise a `TypeError`.
-
-## Rule Details
-
-This rule aims to flag usage of `this` keywords outside of classes or class-like objects.
-
-Basically, this rule checks whether or not a function containing `this` keyword is a constructor or a method.
-
-This rule judges from following conditions whether or not the function is a constructor:
-
-* The name of the function starts with uppercase.
-* The function is assigned to a variable which starts with an uppercase letter.
-* The function is a constructor of ES2015 Classes.
-
-This rule judges from following conditions whether or not the function is a method:
-
-* The function is on an object literal.
-* The function is assigned to a property.
-* The function is a method/getter/setter of ES2015 Classes.
-
-And this rule allows `this` keywords in functions below:
-
-* The `call/apply/bind` method of the function is called directly.
-* The function is a callback of array methods (such as `.forEach()`) if `thisArg` is given.
-* The function has `@this` tag in its JSDoc comment.
-
-And this rule always allows `this` keywords in the following contexts:
-
-* In class field initializers.
-* In class static blocks.
-
-Otherwise are considered problems.
-
-This rule applies **only** in strict mode.
-With `"parserOptions": { "sourceType": "module" }` in the ESLint configuration, your code is in strict mode even without a `"use strict"` directive.
-
-Examples of **incorrect** code for this rule in strict mode:
-
-```js
-/*eslint no-invalid-this: "error"*/
-/*eslint-env es6*/
-
-"use strict";
-
-this.a = 0;
-baz(() => this);
-
-(function() {
-    this.a = 0;
-    baz(() => this);
-})();
-
-function foo() {
-    this.a = 0;
-    baz(() => this);
-}
-
-var foo = function() {
-    this.a = 0;
-    baz(() => this);
-};
-
-foo(function() {
-    this.a = 0;
-    baz(() => this);
-});
-
-obj.foo = () => {
-    // `this` of arrow functions is the outer scope's.
-    this.a = 0;
-};
-
-var obj = {
-    aaa: function() {
-        return function foo() {
-            // There is in a method `aaa`, but `foo` is not a method.
-            this.a = 0;
-            baz(() => this);
-        };
-    }
-};
-
-foo.forEach(function() {
-    this.a = 0;
-    baz(() => this);
-});
-```
-
-Examples of **correct** code for this rule in strict mode:
-
-```js
-/*eslint no-invalid-this: "error"*/
-/*eslint-env es6*/
-
-"use strict";
-
-function Foo() {
-    // OK, this is in a legacy style constructor.
-    this.a = 0;
-    baz(() => this);
-}
-
-class Foo {
-    constructor() {
-        // OK, this is in a constructor.
-        this.a = 0;
-        baz(() => this);
-    }
-}
-
-var obj = {
-    foo: function foo() {
-        // OK, this is in a method (this function is on object literal).
-        this.a = 0;
-    }
-};
-
-var obj = {
-    foo() {
-        // OK, this is in a method (this function is on object literal).
-        this.a = 0;
-    }
-};
-
-var obj = {
-    get foo() {
-        // OK, this is in a method (this function is on object literal).
-        return this.a;
-    }
-};
-
-var obj = Object.create(null, {
-    foo: {value: function foo() {
-        // OK, this is in a method (this function is on object literal).
-        this.a = 0;
-    }}
-});
-
-Object.defineProperty(obj, "foo", {
-    value: function foo() {
-        // OK, this is in a method (this function is on object literal).
-        this.a = 0;
-    }
-});
-
-Object.defineProperties(obj, {
-    foo: {value: function foo() {
-        // OK, this is in a method (this function is on object literal).
-        this.a = 0;
-    }}
-});
-
-function Foo() {
-    this.foo = function foo() {
-        // OK, this is in a method (this function assigns to a property).
-        this.a = 0;
-        baz(() => this);
-    };
-}
-
-obj.foo = function foo() {
-    // OK, this is in a method (this function assigns to a property).
-    this.a = 0;
-};
-
-Foo.prototype.foo = function foo() {
-    // OK, this is in a method (this function assigns to a property).
-    this.a = 0;
-};
-
-class Foo {
-
-    // OK, this is in a class field initializer.
-    a = this.b;
-
-    // OK, static initializers also have valid this.
-    static a = this.b;
-
-    foo() {
-        // OK, this is in a method.
-        this.a = 0;
-        baz(() => this);
-    }
-
-    static foo() {
-        // OK, this is in a method (static methods also have valid this).
-        this.a = 0;
-        baz(() => this);
-    }
-
-    static {
-        // OK, static blocks also have valid this.
-        this.a = 0;
-        baz(() => this);
-    }
-}
-
-var foo = (function foo() {
-    // OK, the `bind` method of this function is called directly.
-    this.a = 0;
-}).bind(obj);
-
-foo.forEach(function() {
-    // OK, `thisArg` of `.forEach()` is given.
-    this.a = 0;
-    baz(() => this);
-}, thisArg);
-
-/** @this Foo */
-function foo() {
-    // OK, this function has a `@this` tag in its JSDoc comment.
-    this.a = 0;
-}
-```
-
-## Options
-
-This rule has an object option, with one option:
-
-* `"capIsConstructor": false` (default `true`) disables the assumption that a function which name starts with an uppercase is a constructor.
-
-### capIsConstructor
-
-By default, this rule always allows the use of `this` in functions which name starts with an uppercase and anonymous functions that are assigned to a variable which name starts with an uppercase, assuming that those functions are used as constructor functions.
-
-Set `"capIsConstructor"` to `false` if you want those functions to be treated as 'regular' functions.
-
-Examples of **incorrect** code for this rule with `"capIsConstructor"` option set to `false`:
-
-```js
-/*eslint no-invalid-this: ["error", { "capIsConstructor": false }]*/
-
-"use strict";
-
-function Foo() {
-    this.a = 0;
-}
-
-var bar = function Foo() {
-    this.a = 0;
-}
-
-var Bar = function() {
-    this.a = 0;
-};
-
-Baz = function() {
-    this.a = 0;
-};
-```
-
-Examples of **correct** code for this rule with `"capIsConstructor"` option set to `false`:
-
-```js
-/*eslint no-invalid-this: ["error", { "capIsConstructor": false }]*/
-
-"use strict";
-
-obj.Foo = function Foo() {
-    // OK, this is in a method.
-    this.a = 0;
-};
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of `this` keyword outside of classes or class-like objects, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-irregular-whitespace.md b/eslint/docs/rules/no-irregular-whitespace.md
deleted file mode 100644 (file)
index a24de70..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-# disallow irregular whitespace (no-irregular-whitespace)
-
-Invalid or irregular whitespace causes issues with ECMAScript 5 parsers and also makes code harder to debug in a similar nature to mixed tabs and spaces.
-
-Various whitespace characters can be inputted by programmers by mistake for example from copying or keyboard shortcuts. Pressing Alt + Space on macOS adds in a non breaking space character for example.
-
-A simple fix for this problem could be to rewrite the offending line from scratch. This might also be a problem introduced by the text editor: if rewriting the line does not fix it, try using a different editor.
-
-Known issues these spaces cause:
-
-* Zero Width Space
-    * Is NOT considered a separator for tokens and is often parsed as an `Unexpected token ILLEGAL`
-    * Is NOT shown in modern browsers making code repository software expected to resolve the visualization
-* Line Separator
-    * Is NOT a valid character within JSON which would cause parse errors
-
-## Rule Details
-
-This rule is aimed at catching invalid whitespace that is not a normal tab and space. Some of these characters may cause issues in modern browsers and others will be a debugging issue to spot.
-
-This rule disallows the following characters except where the options allow:
-
-    \u000B - Line Tabulation (\v) - <VT>
-    \u000C - Form Feed (\f) - <FF>
-    \u00A0 - No-Break Space - <NBSP>
-    \u0085 - Next Line
-    \u1680 - Ogham Space Mark
-    \u180E - Mongolian Vowel Separator - <MVS>
-    \ufeff - Zero Width No-Break Space - <BOM>
-    \u2000 - En Quad
-    \u2001 - Em Quad
-    \u2002 - En Space - <ENSP>
-    \u2003 - Em Space - <EMSP>
-    \u2004 - Tree-Per-Em
-    \u2005 - Four-Per-Em
-    \u2006 - Six-Per-Em
-    \u2007 - Figure Space
-    \u2008 - Punctuation Space - <PUNCSP>
-    \u2009 - Thin Space
-    \u200A - Hair Space
-    \u200B - Zero Width Space - <ZWSP>
-    \u2028 - Line Separator
-    \u2029 - Paragraph Separator
-    \u202F - Narrow No-Break Space
-    \u205f - Medium Mathematical Space
-    \u3000 - Ideographic Space
-
-## Options
-
-This rule has an object option for exceptions:
-
-* `"skipStrings": true` (default) allows any whitespace characters in string literals
-* `"skipComments": true` allows any whitespace characters in comments
-* `"skipRegExps": true` allows any whitespace characters in regular expression literals
-* `"skipTemplates": true` allows any whitespace characters in template literals
-
-### skipStrings
-
-Examples of **incorrect** code for this rule with the default `{ "skipStrings": true }` option:
-
-```js
-/*eslint no-irregular-whitespace: "error"*/
-
-function thing() /*<NBSP>*/{
-    return 'test';
-}
-
-function thing( /*<NBSP>*/){
-    return 'test';
-}
-
-function thing /*<NBSP>*/(){
-    return 'test';
-}
-
-function thing᠎/*<MVS>*/(){
-    return 'test';
-}
-
-function thing() {
-    return 'test'; /*<ENSP>*/
-}
-
-function thing() {
-    return 'test'; /*<NBSP>*/
-}
-
-function thing() {
-    // Description <NBSP>: some descriptive text
-}
-
-/*
-Description <NBSP>: some descriptive text
-*/
-
-function thing() {
-    return / <NBSP>regexp/;
-}
-
-/*eslint-env es6*/
-function thing() {
-    return `template <NBSP>string`;
-}
-```
-
-Examples of **correct** code for this rule with the default `{ "skipStrings": true }` option:
-
-```js
-/*eslint no-irregular-whitespace: "error"*/
-
-function thing() {
-    return ' <NBSP>thing';
-}
-
-function thing() {
-    return '​<ZWSP>thing';
-}
-
-function thing() {
-    return 'th <NBSP>ing';
-}
-```
-
-### skipComments
-
-Examples of additional **correct** code for this rule with the `{ "skipComments": true }` option:
-
-```js
-/*eslint no-irregular-whitespace: ["error", { "skipComments": true }]*/
-
-function thing() {
-    // Description <NBSP>: some descriptive text
-}
-
-/*
-Description <NBSP>: some descriptive text
-*/
-```
-
-### skipRegExps
-
-Examples of additional **correct** code for this rule with the `{ "skipRegExps": true }` option:
-
-```js
-/*eslint no-irregular-whitespace: ["error", { "skipRegExps": true }]*/
-
-function thing() {
-    return / <NBSP>regexp/;
-}
-```
-
-### skipTemplates
-
-Examples of additional **correct** code for this rule with the `{ "skipTemplates": true }` option:
-
-```js
-/*eslint no-irregular-whitespace: ["error", { "skipTemplates": true }]*/
-/*eslint-env es6*/
-
-function thing() {
-    return `template <NBSP>string`;
-}
-```
-
-## When Not To Use It
-
-If you decide that you wish to use whitespace other than tabs and spaces outside of strings in your application.
-
-## Further Reading
-
-* [ECMA whitespace](https://es5.github.io/#x7.2)
-* [JSON whitespace issues](http://timelessrepo.com/json-isnt-a-javascript-subset)
diff --git a/eslint/docs/rules/no-iterator.md b/eslint/docs/rules/no-iterator.md
deleted file mode 100644 (file)
index 95b42a9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# Disallow Iterator (no-iterator)
-
-The `__iterator__` property was a SpiderMonkey extension to JavaScript that could be used to create custom iterators that are compatible with JavaScript's `for in` and `for each` constructs. However, this property is now obsolete, so it should not be used. Here's an example of how this used to work:
-
-```js
-Foo.prototype.__iterator__ = function() {
-    return new FooIterator(this);
-}
-```
-
-You should use ECMAScript 6 iterators and generators instead.
-
-## Rule Details
-
-This rule is aimed at preventing errors that may arise from using the `__iterator__` property, which is not implemented in several browsers. As such, it will warn whenever it encounters the `__iterator__` property.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-iterator: "error"*/
-
-Foo.prototype.__iterator__ = function() {
-    return new FooIterator(this);
-};
-
-foo.__iterator__ = function () {};
-
-foo["__iterator__"] = function () {};
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-iterator: "error"*/
-
-var __iterator__ = foo; // Not using the `__iterator__` property.
-```
-
-## Further Reading
-
-* [MDN - Iterators and Generators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators)
-* [ECMAScript 6 compatibility table - Iterators](https://kangax.github.io/es5-compat-table/es6/#Iterators)
-* [Deprecated and Obsolete Features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#Object_methods)
diff --git a/eslint/docs/rules/no-label-var.md b/eslint/docs/rules/no-label-var.md
deleted file mode 100644 (file)
index 9541dea..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Disallow Labels That Are Variables Names (no-label-var)
-
-## Rule Details
-
-This rule aims to create clearer code by disallowing the bad practice of creating a label that shares a name with a variable that is in scope.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-label-var: "error"*/
-
-var x = foo;
-function bar() {
-x:
-  for (;;) {
-    break x;
-  }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-label-var: "error"*/
-
-// The variable that has the same name as the label is not in scope.
-
-function foo() {
-  var q = t;
-}
-
-function bar() {
-q:
-  for(;;) {
-    break q;
-  }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of labels, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-extra-label](./no-extra-label.md)
-* [no-labels](./no-labels.md)
-* [no-unused-labels](./no-unused-labels.md)
diff --git a/eslint/docs/rules/no-labels.md b/eslint/docs/rules/no-labels.md
deleted file mode 100644 (file)
index ea46ef0..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-# Disallow Labeled Statements (no-labels)
-
-Labeled statements in JavaScript are used in conjunction with `break` and `continue` to control flow around multiple loops. For example:
-
-```js
-outer:
-    while (true) {
-
-        while (true) {
-            break outer;
-        }
-    }
-```
-
-The `break outer` statement ensures that this code will not result in an infinite loop because control is returned to the next statement after the `outer` label was applied. If this statement was changed to be just `break`, control would flow back to the outer `while` statement and an infinite loop would result.
-
-While convenient in some cases, labels tend to be used only rarely and are frowned upon by some as a remedial form of flow control that is more error prone and harder to understand.
-
-## Rule Details
-
-This rule aims to eliminate the use of labeled statements in JavaScript. It will warn whenever a labeled statement is encountered and whenever `break` or `continue` are used with a label.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-labels: "error"*/
-
-label:
-    while(true) {
-        // ...
-    }
-
-label:
-    while(true) {
-        break label;
-    }
-
-label:
-    while(true) {
-        continue label;
-    }
-
-label:
-    switch (a) {
-    case 0:
-        break label;
-    }
-
-label:
-    {
-        break label;
-    }
-
-label:
-    if (a) {
-        break label;
-    }
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-labels: "error"*/
-
-var f = {
-    label: "foo"
-};
-
-while (true) {
-    break;
-}
-
-while (true) {
-    continue;
-}
-```
-
-## Options
-
-The options allow labels with loop or switch statements:
-
-* `"allowLoop"` (`boolean`, default is `false`) - If this option was set `true`, this rule ignores labels which are sticking to loop statements.
-* `"allowSwitch"` (`boolean`, default is `false`) - If this option was set `true`, this rule ignores labels which are sticking to switch statements.
-
-Actually labeled statements in JavaScript can be used with other than loop and switch statements.
-However, this way is ultra rare, not well-known, so this would be confusing developers.
-
-### allowLoop
-
-Examples of **correct** code for the `{ "allowLoop": true }` option:
-
-```js
-/*eslint no-labels: ["error", { "allowLoop": true }]*/
-
-label:
-    while (true) {
-        break label;
-    }
-```
-
-### allowSwitch
-
-Examples of **correct** code for the `{ "allowSwitch": true }` option:
-
-```js
-/*eslint no-labels: ["error", { "allowSwitch": true }]*/
-
-label:
-    switch (a) {
-        case 0:
-            break label;
-    }
-```
-
-## When Not To Use It
-
-If you need to use labeled statements everywhere, then you can safely disable this rule.
-
-## Related Rules
-
-* [no-extra-label](./no-extra-label.md)
-* [no-label-var](./no-label-var.md)
-* [no-unused-labels](./no-unused-labels.md)
diff --git a/eslint/docs/rules/no-lone-blocks.md b/eslint/docs/rules/no-lone-blocks.md
deleted file mode 100644 (file)
index 49fdda6..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-# Disallow Unnecessary Nested Blocks (no-lone-blocks)
-
-In JavaScript, prior to ES6, standalone code blocks delimited by curly braces do not create a new scope and have no use. For example, these curly braces do nothing to `foo`:
-
-```js
-{
-    var foo = bar();
-}
-```
-
-In ES6, code blocks may create a new scope if a block-level binding (`let` and `const`), a class declaration or a function declaration (in strict mode) are present. A block is not considered redundant in these cases.
-
-## Rule Details
-
-This rule aims to eliminate unnecessary and potentially confusing blocks at the top level of a script or within other blocks.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-lone-blocks: "error"*/
-
-{}
-
-if (foo) {
-    bar();
-    {
-        baz();
-    }
-}
-
-function bar() {
-    {
-        baz();
-    }
-}
-
-{
-    function foo() {}
-}
-
-{
-    aLabel: {
-    }
-}
-
-class C {
-    static {
-        {
-            foo();
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with ES6 environment:
-
-```js
-/*eslint no-lone-blocks: "error"*/
-/*eslint-env es6*/
-
-while (foo) {
-    bar();
-}
-
-if (foo) {
-    if (bar) {
-        baz();
-    }
-}
-
-function bar() {
-    baz();
-}
-
-{
-    let x = 1;
-}
-
-{
-    const y = 1;
-}
-
-{
-    class Foo {}
-}
-
-aLabel: {
-}
-
-class C {
-    static {
-        lbl: {
-            if (something) {
-                break lbl;
-            }
-
-            foo();
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule with ES6 environment and strict mode via `"parserOptions": { "sourceType": "module" }` in the ESLint configuration or `"use strict"` directive in the code:
-
-```js
-/*eslint no-lone-blocks: "error"*/
-/*eslint-env es6*/
-
-"use strict";
-
-{
-    function foo() {}
-}
-```
diff --git a/eslint/docs/rules/no-lonely-if.md b/eslint/docs/rules/no-lonely-if.md
deleted file mode 100644 (file)
index 4dab7ef..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# disallow `if` statements as the only statement in `else` blocks (no-lonely-if)
-
-If an `if` statement is the only statement in the `else` block, it is often clearer to use an `else if` form.
-
-```js
-if (foo) {
-    // ...
-} else {
-    if (bar) {
-        // ...
-    }
-}
-```
-
-should be rewritten as
-
-```js
-if (foo) {
-    // ...
-} else if (bar) {
-    // ...
-}
-```
-
-## Rule Details
-
-This rule disallows `if` statements as the only statement in `else` blocks.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-lonely-if: "error"*/
-
-if (condition) {
-    // ...
-} else {
-    if (anotherCondition) {
-        // ...
-    }
-}
-
-if (condition) {
-    // ...
-} else {
-    if (anotherCondition) {
-        // ...
-    } else {
-        // ...
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-lonely-if: "error"*/
-
-if (condition) {
-    // ...
-} else if (anotherCondition) {
-    // ...
-}
-
-if (condition) {
-    // ...
-} else if (anotherCondition) {
-    // ...
-} else {
-    // ...
-}
-
-if (condition) {
-    // ...
-} else {
-    if (anotherCondition) {
-        // ...
-    }
-    doSomething();
-}
-```
-
-## When Not To Use It
-
-Disable this rule if the code is clearer without requiring the `else if` form.
diff --git a/eslint/docs/rules/no-loop-func.md b/eslint/docs/rules/no-loop-func.md
deleted file mode 100644 (file)
index f39b868..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# Disallow Functions in Loops (no-loop-func)
-
-Writing functions within loops tends to result in errors due to the way the function creates a closure around the loop. For example:
-
-```js
-for (var i = 0; i < 10; i++) {
-    funcs[i] = function() {
-        return i;
-    };
-}
-```
-
-In this case, you would expect each function created within the loop to return a different number. In reality, each function returns 10, because that was the last value of `i` in the scope.
-
-`let` or `const` mitigate this problem.
-
-```js
-/*eslint-env es6*/
-
-for (let i = 0; i < 10; i++) {
-    funcs[i] = function() {
-        return i;
-    };
-}
-```
-
-In this case, each function created within the loop returns a different number as expected.
-
-## Rule Details
-
-This error is raised to highlight a piece of code that may not work as you expect it to and could also indicate a misunderstanding of how the language works. Your code may run without any problems if you do not fix this error, but in some situations it could behave unexpectedly.
-
-This rule disallows any function within a loop that contains unsafe references (e.g. to modified variables from the outer scope).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-loop-func: "error"*/
-/*eslint-env es6*/
-
-for (var i=10; i; i--) {
-    (function() { return i; })();
-}
-
-while(i) {
-    var a = function() { return i; };
-    a();
-}
-
-do {
-    function a() { return i; };
-    a();
-} while (i);
-
-let foo = 0;
-for (let i = 0; i < 10; ++i) {
-    //Bad, `foo` is not in the loop-block's scope and `foo` is modified in/after the loop
-    setTimeout(() => console.log(foo));
-    foo += 1;
-}
-
-for (let i = 0; i < 10; ++i) {
-    //Bad, `foo` is not in the loop-block's scope and `foo` is modified in/after the loop
-    setTimeout(() => console.log(foo));
-}
-foo = 100;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-loop-func: "error"*/
-/*eslint-env es6*/
-
-var a = function() {};
-
-for (var i=10; i; i--) {
-    a();
-}
-
-for (var i=10; i; i--) {
-    var a = function() {}; // OK, no references to variables in the outer scopes.
-    a();
-}
-
-for (let i=10; i; i--) {
-    var a = function() { return i; }; // OK, all references are referring to block scoped variables in the loop.
-    a();
-}
-
-var foo = 100;
-for (let i=10; i; i--) {
-    var a = function() { return foo; }; // OK, all references are referring to never modified variables.
-    a();
-}
-//... no modifications of foo after this loop ...
-```
diff --git a/eslint/docs/rules/no-loss-of-precision.md b/eslint/docs/rules/no-loss-of-precision.md
deleted file mode 100644 (file)
index 62d0659..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Disallow Number Literals That Lose Precision (no-loss-of-precision)
-
-This rule would disallow the use of number literals that immediately lose precision at runtime when converted to a JS `Number` due to 64-bit floating-point rounding.
-
-## Rule Details
-
-In JS, `Number`s are stored as double-precision floating-point numbers according to the [IEEE 754 standard](https://en.wikipedia.org/wiki/IEEE_754). Because of this, numbers can only retain accuracy up to a certain amount of digits. If the programmer enters additional digits, those digits will be lost in the conversion to the `Number` type and will result in unexpected behavior.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-loss-of-precision: "error"*/
-
-const x = 9007199254740993
-const x = 5123000000000000000000000000001
-const x = 1230000000000000000000000.0
-const x = .1230000000000000000000000
-const x = 0X20000000000001
-const x = 0X2_000000000_0001;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-loss-of-precision: "error"*/
-
-const x = 12345
-const x = 123.456
-const x = 123e34
-const x = 12300000000000000000000000
-const x = 0x1FFFFFFFFFFFFF
-const x = 9007199254740991
-const x = 9007_1992547409_91
-```
diff --git a/eslint/docs/rules/no-magic-numbers.md b/eslint/docs/rules/no-magic-numbers.md
deleted file mode 100644 (file)
index dfe21d8..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-# Disallow Magic Numbers (no-magic-numbers)
-
-'Magic numbers' are numbers that occur multiple times in code without an explicit meaning.
-They should preferably be replaced by named constants.
-
-```js
-var now = Date.now(),
-    inOneHour = now + (60 * 60 * 1000);
-```
-
-## Rule Details
-
-The `no-magic-numbers` rule aims to make code more readable and refactoring easier by ensuring that special numbers
-are declared as constants to make their meaning explicit.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-magic-numbers: "error"*/
-
-var dutyFreePrice = 100,
-    finalPrice = dutyFreePrice + (dutyFreePrice * 0.25);
-```
-
-```js
-/*eslint no-magic-numbers: "error"*/
-
-var data = ['foo', 'bar', 'baz'];
-
-var dataLast = data[2];
-```
-
-```js
-/*eslint no-magic-numbers: "error"*/
-
-var SECONDS;
-
-SECONDS = 60;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-magic-numbers: "error"*/
-
-var TAX = 0.25;
-
-var dutyFreePrice = 100,
-    finalPrice = dutyFreePrice + (dutyFreePrice * TAX);
-```
-
-## Options
-
-### ignore
-
-An array of numbers to ignore. It's set to `[]` by default.
-If provided, it must be an `Array`.
-
-The array can contain values of `number` and `string` types.
-If it's a string, the text must be parsed as `bigint` literal (e.g., `"100n"`).
-
-Examples of **correct** code for the sample `{ "ignore": [1] }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignore": [1] }]*/
-
-var data = ['foo', 'bar', 'baz'];
-var dataLast = data.length && data[data.length - 1];
-```
-
-Examples of **correct** code for the sample `{ "ignore": ["1n"] }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignore": ["1n"] }]*/
-
-foo(1n);
-```
-
-### ignoreArrayIndexes
-
-A boolean to specify if numbers used in the context of array indexes (e.g., `data[2]`) are considered okay. `false` by default.
-
-This option allows only valid array indexes: numbers that will be coerced to one of `"0"`, `"1"`, `"2"` ... `"4294967294"`.
-
-Arrays are objects, so they can have property names such as `"-1"` or `"2.5"`. However, those are just "normal" object properties that don't represent array elements. They don't influence the array's `length`, and they are ignored by array methods like `.map` or `.forEach`.
-
-Additionally, since the maximum [array length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) is 2<sup>32</sup> - 1, all values above 2<sup>32</sup> - 2 also represent just normal property names and are thus not considered to be array indexes.
-
-Examples of **correct** code for the `{ "ignoreArrayIndexes": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignoreArrayIndexes": true }]*/
-
-var item = data[2];
-
-data[100] = a;
-
-f(data[0]);
-
-a = data[-0]; // same as data[0], -0 will be coerced to "0"
-
-a = data[0xAB];
-
-a = data[5.6e1];
-
-a = data[10n]; // same as data[10], 10n will be coerced to "10"
-
-a = data[4294967294]; // max array index
-```
-
-Examples of **incorrect** code for the `{ "ignoreArrayIndexes": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignoreArrayIndexes": true }]*/
-
-f(2); // not used as array index
-
-a = data[-1];
-
-a = data[2.5];
-
-a = data[5.67e1];
-
-a = data[-10n];
-
-a = data[4294967295]; // above the max array index
-
-a = data[1e500]; // same as data["Infinity"]
-```
-
-### ignoreDefaultValues
-
-A boolean to specify if numbers used in default value assignments are considered okay. `false` by default.
-
-Examples of **correct** code for the `{ "ignoreDefaultValues": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignoreDefaultValues": true }]*/
-
-const { tax = 0.25 } = accountancy;
-
-function mapParallel(concurrency = 3) { /***/ }
-```
-
-```js
-/*eslint no-magic-numbers: ["error", { "ignoreDefaultValues": true }]*/
-
-let head;
-[head = 100] = []
-```
-
-### enforceConst
-
-A boolean to specify if we should check for the const keyword in variable declaration of numbers. `false` by default.
-
-Examples of **incorrect** code for the `{ "enforceConst": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "enforceConst": true }]*/
-
-var TAX = 0.25;
-
-var dutyFreePrice = 100,
-    finalPrice = dutyFreePrice + (dutyFreePrice * TAX);
-```
-
-### detectObjects
-
-A boolean to specify if we should detect numbers when setting object properties for example. `false` by default.
-
-Examples of **incorrect** code for the `{ "detectObjects": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "detectObjects": true }]*/
-
-var magic = {
-  tax: 0.25
-};
-
-var dutyFreePrice = 100,
-    finalPrice = dutyFreePrice + (dutyFreePrice * magic.tax);
-```
-
-Examples of **correct** code for the `{ "detectObjects": true }` option:
-
-```js
-/*eslint no-magic-numbers: ["error", { "detectObjects": true }]*/
-
-var TAX = 0.25;
-
-var magic = {
-  tax: TAX
-};
-
-var dutyFreePrice = 100,
-    finalPrice = dutyFreePrice + (dutyFreePrice * magic.tax);
-```
diff --git a/eslint/docs/rules/no-misleading-character-class.md b/eslint/docs/rules/no-misleading-character-class.md
deleted file mode 100644 (file)
index f6ef2fb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Disallow characters which are made with multiple code points in character class syntax (no-misleading-character-class)
-
-Unicode includes the characters which are made with multiple code points.
-RegExp character class syntax (`/[abc]/`) cannot handle characters which are made by multiple code points as a character; those characters will be dissolved to each code point. For example, `❇️` is made by `❇` (`U+2747`) and VARIATION SELECTOR-16 (`U+FE0F`). If this character is in RegExp character class, it will match to either `❇` (`U+2747`) or VARIATION SELECTOR-16 (`U+FE0F`) rather than `❇️`.
-
-This rule reports the regular expressions which include multiple code point characters in character class syntax. This rule considers the following characters as multiple code point characters.
-
-**A character with combining characters:**
-
-The combining characters are characters which belong to one of `Mc`, `Me`, and `Mn` [Unicode general categories](http://www.unicode.org/L2/L1999/UnicodeData.html#General%20Category).
-
-```js
-/^[Á]$/u.test("Á") //→ false
-/^[❇️]$/u.test("❇️") //→ false
-```
-
-**A character with Emoji modifiers:**
-
-```js
-/^[👶🏻]$/u.test("👶🏻") //→ false
-/^[👶🏽]$/u.test("👶🏽") //→ false
-```
-
-**A pair of regional indicator symbols:**
-
-```js
-/^[🇯🇵]$/u.test("🇯🇵") //→ false
-```
-
-**Characters that ZWJ joins:**
-
-```js
-/^[👨‍👩‍👦]$/u.test("👨‍👩‍👦") //→ false
-```
-
-**A surrogate pair without Unicode flag:**
-
-```js
-/^[👍]$/.test("👍") //→ false
-
-// Surrogate pair is OK if with u flag.
-/^[👍]$/u.test("👍") //→ true
-```
-
-## Rule Details
-
-This rule reports the regular expressions which include multiple code point characters in character class syntax.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-misleading-character-class: error */
-
-/^[Á]$/u
-/^[❇️]$/u
-/^[👶🏻]$/u
-/^[🇯🇵]$/u
-/^[👨‍👩‍👦]$/u
-/^[👍]$/
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-misleading-character-class: error */
-
-/^[abc]$/
-/^[👍]$/u
-```
-
-## When Not To Use It
-
-You can turn this rule off if you don't want to check RegExp character class syntax for multiple code point characters.
diff --git a/eslint/docs/rules/no-mixed-operators.md b/eslint/docs/rules/no-mixed-operators.md
deleted file mode 100644 (file)
index 1dca581..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-# Disallow mixes of different operators (no-mixed-operators)
-
-Enclosing complex expressions by parentheses clarifies the developer's intention, which makes the code more readable.
-This rule warns when different operators are used consecutively without parentheses in an expression.
-
-```js
-var foo = a && b || c || d;    /*BAD: Unexpected mix of '&&' and '||'.*/
-var foo = a && b ? c : d;      /*BAD: Unexpected mix of '&&' and '?:'.*/
-var foo = (a && b) ? c : d;    /*GOOD*/
-var foo = (a && b) || c || d;  /*GOOD*/
-var foo = a && (b || c || d);  /*GOOD*/
-```
-
-**Note:**
-It is expected for this rule to emit one error for each mixed operator in a pair. As a result, for each two consecutive mixed operators used, a distinct error will be displayed, pointing to where the specific operator that breaks the rule is used:
-
-```js
-var foo = a && b || c || d;
-```
-
-will generate
-
-```sh
-1:13  Unexpected mix of '&&' and '||'. (no-mixed-operators)
-1:18  Unexpected mix of '&&' and '||'. (no-mixed-operators)
-```
-
-```js
-var foo = a && b ? c : d;
-```
-
-will generate
-
-```sh
-1:13  Unexpected mix of '&&' and '?:'. (no-mixed-operators)
-1:18  Unexpected mix of '&&' and '?:'. (no-mixed-operators)
-```
-
-## Rule Details
-
-This rule checks `BinaryExpression`, `LogicalExpression` and `ConditionalExpression`.
-
-This rule may conflict with [no-extra-parens](no-extra-parens.md) rule.
-If you use both this and [no-extra-parens](no-extra-parens.md) rule together, you need to use the `nestedBinaryExpressions` option of [no-extra-parens](no-extra-parens.md) rule.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-mixed-operators: "error"*/
-
-var foo = a && b < 0 || c > 0 || d + 1 === 0;
-var foo = a + b * c;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-mixed-operators: "error"*/
-
-var foo = a || b || c;
-var foo = a && b && c;
-var foo = (a && b < 0) || c > 0 || d + 1 === 0;
-var foo = a && (b < 0 || c > 0 || d + 1 === 0);
-var foo = a + (b * c);
-var foo = (a + b) * c;
-```
-
-## Options
-
-```json
-{
-    "no-mixed-operators": [
-        "error",
-        {
-            "groups": [
-                ["+", "-", "*", "/", "%", "**"],
-                ["&", "|", "^", "~", "<<", ">>", ">>>"],
-                ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
-                ["&&", "||"],
-                ["in", "instanceof"]
-            ],
-            "allowSamePrecedence": true
-        }
-    ]
-}
-```
-
-This rule has 2 options.
-
-* `groups` (`string[][]`) - specifies operator groups to be checked. The `groups` option is a list of groups, and a group is a list of binary operators. Default operator groups are defined as arithmetic, bitwise, comparison, logical, and relational operators. Note: Ternary operator(?:) can be part of any group and by default is allowed to be mixed with other operators.
-
-* `allowSamePrecedence` (`boolean`) - specifies whether to allow mixed operators if they are of equal precedence. Default is `true`.
-
-### groups
-
-The following operators can be used in `groups` option:
-
-* Arithmetic Operators: `"+"`, `"-"`, `"*"`, `"/"`, `"%"`, `"**"`
-* Bitwise Operators: `"&"`, `"|"`, `"^"`, `"~"`, `"<<"`, `">>"`, `">>>"`
-* Comparison Operators: `"=="`, `"!="`, `"==="`, `"!=="`, `">"`, `">="`, `"<"`, `"<="`
-* Logical Operators: `"&&"`, `"||"`
-* Coalesce Operator: `"??"`
-* Relational Operators: `"in"`, `"instanceof"`
-* Ternary Operator: `?:`
-
-Now, consider the following group configuration: `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}`.
-There are 2 groups specified in this configuration: bitwise operators and logical operators.
-This rule checks if the operators belong to the same group only.
-In this case, this rule checks if bitwise operators and logical operators are mixed, but ignores all other operators.
-
-Examples of **incorrect** code for this rule with `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}` option:
-
-```js
-/*eslint no-mixed-operators: ["error", {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}]*/
-
-var foo = a && b < 0 || c > 0 || d + 1 === 0;
-var foo = a & b | c;
-```
-
-```js
-/*eslint no-mixed-operators: ["error", {"groups": [["&&", "||", "?:"]]}]*/
-
-var foo = a || b ? c : d;
-
-var bar = a ? b || c : d;
-
-var baz = a ? b : c || d;
-```
-
-Examples of **correct** code for this rule with `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}` option:
-
-```js
-/*eslint no-mixed-operators: ["error", {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}]*/
-
-var foo = a || b > 0 || c + 1 === 0;
-var foo = a && b > 0 && c + 1 === 0;
-var foo = (a && b < 0) || c > 0 || d + 1 === 0;
-var foo = a && (b < 0 ||  c > 0 || d + 1 === 0);
-var foo = (a & b) | c;
-var foo = a & (b | c);
-var foo = a + b * c;
-var foo = a + (b * c);
-var foo = (a + b) * c;
-```
-
-```js
-/*eslint no-mixed-operators: ["error", {"groups": [["&&", "||", "?:"]]}]*/
-
-var foo = (a || b) ? c : d;
-var foo = a || (b ? c : d);
-
-var bar = a ? (b || c) : d;
-
-var baz = a ? b : (c || d);
-var baz = (a ? b : c) || d;
-```
-
-### allowSamePrecedence
-
-Examples of **correct** code for this rule with `{"allowSamePrecedence": true}` option:
-
-```js
-/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": true}]*/
-
-// + and - have the same precedence.
-var foo = a + b - c;
-```
-
-Examples of **incorrect** code for this rule with `{"allowSamePrecedence": false}` option:
-
-```js
-/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
-
-// + and - have the same precedence.
-var foo = a + b - c;
-```
-
-Examples of **correct** code for this rule with `{"allowSamePrecedence": false}` option:
-
-```js
-/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
-
-// + and - have the same precedence.
-var foo = (a + b) - c;
-```
-
-## When Not To Use It
-
-If you don't want to be notified about mixed operators, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-extra-parens](no-extra-parens.md)
diff --git a/eslint/docs/rules/no-mixed-requires.md b/eslint/docs/rules/no-mixed-requires.md
deleted file mode 100644 (file)
index c697d04..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# disallow `require` calls to be mixed with regular variable declarations (no-mixed-requires)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In the Node.js community it is often customary to separate initializations with calls to `require` modules from other variable declarations, sometimes also grouping them by the type of module. This rule helps you enforce this convention.
-
-## Rule Details
-
-When this rule is enabled, each `var` statement must satisfy the following conditions:
-
-* either none or all variable declarations must be require declarations (default)
-* all require declarations must be of the same type (grouping)
-
-This rule distinguishes between six kinds of variable declaration types:
-
-* `core`: declaration of a required [core module][1]
-* `file`: declaration of a required [file module][2]
-* `module`: declaration of a required module from the [node_modules folder][3]
-* `computed`: declaration of a required module whose type could not be determined (either because it is computed or because require was called without an argument)
-* `uninitialized`: a declaration that is not initialized
-* `other`: any other kind of declaration
-
-In this document, the first four types are summed up under the term *require declaration*.
-
-```js
-var fs = require('fs'),        // "core"     \
-    async = require('async'),  // "module"   |- these are "require declaration"s
-    foo = require('./foo'),    // "file"     |
-    bar = require(getName()),  // "computed" /
-    baz = 42,                  // "other"
-    bam;                       // "uninitialized"
-```
-
-## Options
-
-This rule can have an object literal option whose two properties have `false` values by default.
-
-Configuring this rule with one boolean option `true` is deprecated.
-
-Examples of **incorrect** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
-
-```js
-/*eslint no-mixed-requires: "error"*/
-
-var fs = require('fs'),
-    i = 0;
-
-var async = require('async'),
-    debug = require('diagnostics').someFunction('my-module'),
-    eslint = require('eslint');
-```
-
-Examples of **correct** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
-
-```js
-/*eslint no-mixed-requires: "error"*/
-
-// only require declarations (grouping off)
-var eventEmitter = require('events').EventEmitter,
-    myUtils = require('./utils'),
-    util = require('util'),
-    bar = require(getBarModuleName());
-
-// only non-require declarations
-var foo = 42,
-    bar = 'baz';
-
-// always valid regardless of grouping because all declarations are of the same type
-var foo = require('foo' + VERSION),
-    bar = require(getBarModuleName()),
-    baz = require();
-```
-
-### grouping
-
-Examples of **incorrect** code for this rule with the `{ "grouping": true }` option:
-
-```js
-/*eslint no-mixed-requires: ["error", { "grouping": true }]*/
-
-// invalid because of mixed types "core" and "module"
-var fs = require('fs'),
-    async = require('async');
-
-// invalid because of mixed types "file" and "unknown"
-var foo = require('foo'),
-    bar = require(getBarModuleName());
-```
-
-### allowCall
-
-Examples of **incorrect** code for this rule with the `{ "allowCall": true }` option:
-
-```js
-/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
-
-var async = require('async'),
-    debug = require('diagnostics').someFunction('my-module'), /* allowCall doesn't allow calling any function */
-    eslint = require('eslint');
-```
-
-Examples of **correct** code for this rule with the `{ "allowCall": true }` option:
-
-```js
-/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
-
-var async = require('async'),
-    debug = require('diagnostics')('my-module'),
-    eslint = require('eslint');
-```
-
-## Known Limitations
-
-* The implementation is not aware of any local functions with the name `require` that may shadow Node.js' global `require`.
-
-* Internally, the list of core modules is retrieved via `require("repl")._builtinLibs`. If you use different versions of Node.js for ESLint and your application, the list of core modules for each version may be different.
-  The above mentioned `_builtinLibs` property became available in 0.8, for earlier versions a hardcoded list of module names is used as a fallback. If your version of Node.js is older than 0.6 that list may be inaccurate.
-
-## When Not To Use It
-
-If you use a pattern such as [UMD][4] where the `require`d modules are not loaded in variable declarations, this rule will obviously do nothing for you.
-
-[1]: https://nodejs.org/api/modules.html#modules_core_modules
-[2]: https://nodejs.org/api/modules.html#modules_file_modules
-[3]: https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
-[4]: https://github.com/umdjs/umd
diff --git a/eslint/docs/rules/no-mixed-spaces-and-tabs.md b/eslint/docs/rules/no-mixed-spaces-and-tabs.md
deleted file mode 100644 (file)
index 9f156bb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# disallow mixed spaces and tabs for indentation (no-mixed-spaces-and-tabs)
-
-Most code conventions require either tabs or spaces be used for indentation. As such, it's usually an error if a single line of code is indented with both tabs and spaces.
-
-## Rule Details
-
-This rule disallows mixed spaces and tabs for indentation.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-mixed-spaces-and-tabs: "error"*/
-
-function add(x, y) {
-// --->..return x + y;
-
-      return x + y;
-}
-
-function main() {
-// --->var x = 5,
-// --->....y = 7;
-
-    var x = 5,
-        y = 7;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-mixed-spaces-and-tabs: "error"*/
-
-function add(x, y) {
-// --->return x + y;
-    return x + y;
-}
-```
-
-## Options
-
-This rule has a string option.
-
-* `"smart-tabs"` allows mixed tabs and spaces when the spaces are used for alignment.
-
-### smart-tabs
-
-Examples of **correct** code for this rule with the `"smart-tabs"` option:
-
-```js
-/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
-
-function main() {
-// --->var x = 5,
-// --->....y = 7;
-
-    var x = 5,
-        y = 7;
-}
-```
-
-## Further Reading
-
-* [Smart Tabs](https://www.emacswiki.org/emacs/SmartTabs)
diff --git a/eslint/docs/rules/no-multi-assign.md b/eslint/docs/rules/no-multi-assign.md
deleted file mode 100644 (file)
index 14721da..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-# Disallow Use of Chained Assignment Expressions (no-multi-assign)
-
-Chaining the assignment of variables can lead to unexpected results and be difficult to read.
-
-```js
-(function() {
-    const foo = bar = 0; // Did you mean `foo = bar == 0`?
-    bar = 1;             // This will not fail since `bar` is not constant.
-})();
-console.log(bar);        // This will output 1 since `bar` is not scoped.
-```
-
-## Rule Details
-
-This rule disallows using multiple assignments within a single statement.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-multi-assign: "error"*/
-
-var a = b = c = 5;
-
-const foo = bar = "baz";
-
-let a =
-    b =
-    c;
-
-class Foo {
-    a = b = 10;
-}
-
-a = b = "quux";
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-multi-assign: "error"*/
-
-var a = 5;
-var b = 5;
-var c = 5;
-
-const foo = "baz";
-const bar = "baz";
-
-let a = c;
-let b = c;
-
-class Foo {
-    a = 10;
-    b = 10;
-}
-
-a = "quux";
-b = "quux";
-```
-
-## Options
-
-This rule has an object option:
-
-* `"ignoreNonDeclaration"`: When set to `true`, the rule allows chains that don't include initializing a variable in a declaration or initializing a class field. Default is `false`.
-
-### ignoreNonDeclaration
-
-Examples of **correct** code for the `{ "ignoreNonDeclaration": true }` option:
-
-```js
-/*eslint no-multi-assign: ["error", { "ignoreNonDeclaration": true }]*/
-
-let a;
-let b;
-a = b = "baz";
-
-const x = {};
-const y = {};
-x.one = y.one = 1;
-```
-
-Examples of **incorrect** code for the `{ "ignoreNonDeclaration": true }` option:
-
-```js
-/*eslint no-multi-assign: ["error", { "ignoreNonDeclaration": true }]*/
-
-let a = b = "baz";
-
-const foo = bar = 1;
-
-class Foo {
-    a = b = 10;
-}
-```
-
-## Related Rules
-
-* [max-statements-per-line](max-statements-per-line.md)
diff --git a/eslint/docs/rules/no-multi-spaces.md b/eslint/docs/rules/no-multi-spaces.md
deleted file mode 100644 (file)
index c4b12e9..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-# Disallow multiple spaces (no-multi-spaces)
-
-Multiple spaces in a row that are not used for indentation are typically mistakes. For example:
-
-```js
-
-if(foo  === "bar") {}
-
-```
-
-It's hard to tell, but there are two spaces between `foo` and `===`. Multiple spaces such as this are generally frowned upon in favor of single spaces:
-
-```js
-
-if(foo === "bar") {}
-
-```
-
-## Rule Details
-
-This rule aims to disallow multiple whitespace around logical expressions, conditional expressions, declarations, array elements, object properties, sequences and function parameters.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-multi-spaces: "error"*/
-
-var a =  1;
-
-if(foo   === "bar") {}
-
-a <<  b
-
-var arr = [1,  2];
-
-a ?  b: c
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-multi-spaces: "error"*/
-
-var a = 1;
-
-if(foo === "bar") {}
-
-a << b
-
-var arr = [1, 2];
-
-a ? b: c
-```
-
-## Options
-
-This rule's configuration consists of an object with the following properties:
-
-* `"ignoreEOLComments": true` (defaults to `false`) ignores multiple spaces before comments that occur at the end of lines
-* `"exceptions": { "Property": true }` (`"Property"` is the only node specified by default) specifies nodes to ignore
-
-### ignoreEOLComments
-
-Examples of **incorrect** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
-
-```js
-/*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
-
-var x = 5;      // comment
-var x = 5;      /* multiline
- * comment
- */
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
-
-```js
-/*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
-
-var x = 5; // comment
-var x = 5; /* multiline
- * comment
- */
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreEOLComments": true }` option:
-
-```js
-/*eslint no-multi-spaces: ["error", { ignoreEOLComments: true }]*/
-
-var x = 5; // comment
-var x = 5;      // comment
-var x = 5; /* multiline
- * comment
- */
-var x = 5;      /* multiline
- * comment
- */
-```
-
-### exceptions
-
-To avoid contradictions with other rules that require multiple spaces, this rule has an `exceptions` option to ignore certain nodes.
-
-This option is an object that expects property names to be AST node types as defined by [ESTree](https://github.com/estree/estree). The easiest way to determine the node types for `exceptions` is to use [AST Explorer](https://astexplorer.net/) with the espree parser.
-
-Only the `Property` node type is ignored by default, because for the [key-spacing](key-spacing.md) rule some alignment options require multiple spaces in properties of object literals.
-
-Examples of **correct** code for the default `"exceptions": { "Property": true }` option:
-
-```js
-/*eslint no-multi-spaces: "error"*/
-/*eslint key-spacing: ["error", { align: "value" }]*/
-
-var obj = {
-    first:  "first",
-    second: "second"
-};
-```
-
-Examples of **incorrect** code for the `"exceptions": { "Property": false }` option:
-
-```js
-/*eslint no-multi-spaces: ["error", { exceptions: { "Property": false } }]*/
-/*eslint key-spacing: ["error", { align: "value" }]*/
-
-var obj = {
-    first:  "first",
-    second: "second"
-};
-```
-
-Examples of **correct** code for the `"exceptions": { "BinaryExpression": true }` option:
-
-```js
-/*eslint no-multi-spaces: ["error", { exceptions: { "BinaryExpression": true } }]*/
-
-var a = 1  *  2;
-```
-
-Examples of **correct** code for the `"exceptions": { "VariableDeclarator": true }` option:
-
-```js
-/*eslint no-multi-spaces: ["error", { exceptions: { "VariableDeclarator": true } }]*/
-
-var someVar      = 'foo';
-var someOtherVar = 'barBaz';
-```
-
-Examples of **correct** code for the `"exceptions": { "ImportDeclaration": true }` option:
-
-```js
-/*eslint no-multi-spaces: ["error", { exceptions: { "ImportDeclaration": true } }]*/
-
-import mod          from 'mod';
-import someOtherMod from 'some-other-mod';
-```
-
-## When Not To Use It
-
-If you don't want to check and disallow multiple spaces, then you should turn this rule off.
-
-## Related Rules
-
-* [key-spacing](key-spacing.md)
-* [space-infix-ops](space-infix-ops.md)
-* [space-in-brackets](space-in-brackets.md) (deprecated)
-* [space-in-parens](space-in-parens.md)
-* [space-after-keywords](space-after-keywords.md)
-* [space-unary-ops](space-unary-ops.md)
-* [space-return-throw-case](space-return-throw-case.md)
diff --git a/eslint/docs/rules/no-multi-str.md b/eslint/docs/rules/no-multi-str.md
deleted file mode 100644 (file)
index 2796bc8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Disallow Multiline Strings (no-multi-str)
-
-It's possible to create multiline strings in JavaScript by using a slash before a newline, such as:
-
-```js
-var x = "Line 1 \
-         Line 2";
-```
-
-Some consider this to be a bad practice as it was an undocumented feature of JavaScript that was only formalized later.
-
-## Rule Details
-
-This rule is aimed at preventing the use of multiline strings.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-multi-str: "error"*/
-
-var x = "some very \
-long text";
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-multi-str: "error"*/
-
-var x = "some very long text";
-
-var x = "some very " +
-        "long text";
-```
diff --git a/eslint/docs/rules/no-multiple-empty-lines.md b/eslint/docs/rules/no-multiple-empty-lines.md
deleted file mode 100644 (file)
index 1a04841..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-# disallow multiple empty lines (no-multiple-empty-lines)
-
-Some developers prefer to have multiple blank lines removed, while others feel that it helps improve readability. Whitespace is useful for separating logical sections of code, but excess whitespace takes up more of the screen.
-
-## Rule Details
-
-This rule aims to reduce the scrolling required when reading through your code. It will warn when the maximum amount of empty lines has been exceeded.
-
-## Options
-
-This rule has an object option:
-
--   `"max"` (default: `2`) enforces a maximum number of consecutive empty lines.
--   `"maxEOF"` enforces a maximum number of consecutive empty lines at the end of files.
--   `"maxBOF"` enforces a maximum number of consecutive empty lines at the beginning of files.
-
-### max
-
-Examples of **incorrect** code for this rule with the default `{ "max": 2 }` option:
-
-```js
-/*eslint no-multiple-empty-lines: "error"*/
-
-var foo = 5;
-
-
-
-var bar = 3;
-```
-
-Examples of **correct** code for this rule with the default `{ "max": 2 }` option:
-
-```js
-/*eslint no-multiple-empty-lines: "error"*/
-
-var foo = 5;
-
-
-var bar = 3;
-```
-
-### maxEOF
-
-Examples of **incorrect** code for this rule with the `{ max: 2, maxEOF: 0 }` options:
-
-```js
-/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/
-
-var foo = 5;
-
-
-var bar = 3;
-
-
-```
-
-Examples of **correct** code for this rule with the `{ max: 2, maxEOF: 0 }` options:
-
-```js
-/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/
-
-var foo = 5;
-
-
-var bar = 3;
-```
-
-**Note**: Although this ensures zero empty lines at the EOF, most editors will still show one empty line at the end if the file ends with a line break, as illustrated below. There is no empty line at the end of a file after the last `\n`, although editors may show an additional line. A true additional line would be represented by `\n\n`.
-
-**Incorrect**:
-
-```js
-1    /*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/⏎
-2    ⏎
-3    var foo = 5;⏎
-4    ⏎
-5    ⏎
-6    var bar = 3;⏎
-7    ⏎
-8
-```
-
-**Correct**:
-
-```js
-1    /*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/⏎
-2    ⏎
-3    var foo = 5;⏎
-4    ⏎
-5    ⏎
-6    var bar = 3;⏎
-7
-```
-
-### maxBOF
-
-Examples of **incorrect** code for this rule with the `{ max: 2, maxBOF: 1 }` options:
-
-```js
-/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxBOF": 1 }]*/
-
-
-var foo = 5;
-
-
-var bar = 3;
-```
-
-Examples of **correct** code for this rule with the `{ max: 2, maxBOF: 1 }` options:
-
-```js
-/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxBOF": 1}]*/
-
-var foo = 5;
-
-
-var bar = 3;
-```
-
-## When Not To Use It
-
-If you do not care about extra blank lines, turn this off.
diff --git a/eslint/docs/rules/no-native-reassign.md b/eslint/docs/rules/no-native-reassign.md
deleted file mode 100644 (file)
index bfb511d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-# Disallow Reassignment of Native Objects (no-native-reassign)
-
-This rule was **deprecated** in ESLint v3.3.0 and replaced by the [no-global-assign](no-global-assign.md) rule.
-
-JavaScript environments contain a number of built-in global variables, such as `window` in browsers and `process` in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:
-
-```js
-window = {};
-```
-
-While examples such as `window` are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.
-
-## Rule Details
-
-This rule disallows modifications to read-only global variables.
-
-ESLint has the capability to configure global variables as read-only.
-
-* [Specifying Environments](../user-guide/configuring#specifying-environments)
-* [Specifying Globals](../user-guide/configuring#specifying-globals)
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-native-reassign: "error"*/
-
-Object = null
-undefined = 1
-```
-
-```js
-/*eslint no-native-reassign: "error"*/
-/*eslint-env browser*/
-
-window = {}
-length = 1
-top = 1
-```
-
-```js
-/*eslint no-native-reassign: "error"*/
-/*global a:readonly*/
-
-a = 1
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-native-reassign: "error"*/
-
-a = 1
-var b = 1
-b = 2
-```
-
-```js
-/*eslint no-native-reassign: "error"*/
-/*eslint-env browser*/
-
-onload = function() {}
-```
-
-```js
-/*eslint no-native-reassign: "error"*/
-/*global a:writable*/
-
-a = 1
-```
-
-## Options
-
-This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which reassignments will be allowed:
-
-```json
-{
-    "rules": {
-        "no-native-reassign": ["error", {"exceptions": ["Object"]}]
-    }
-}
-```
-
-## When Not To Use It
-
-If you are trying to override one of the native objects.
-
-## Related Rules
-
-* [no-extend-native](no-extend-native.md)
-* [no-redeclare](no-redeclare.md)
-* [no-shadow](no-shadow.md)
diff --git a/eslint/docs/rules/no-negated-condition.md b/eslint/docs/rules/no-negated-condition.md
deleted file mode 100644 (file)
index 58addae..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# disallow negated conditions (no-negated-condition)
-
-Negated conditions are more difficult to understand. Code can be made more readable by inverting the condition instead.
-
-## Rule Details
-
-This rule disallows negated conditions in either of the following:
-
-* `if` statements which have an `else` branch
-* ternary expressions
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-negated-condition: "error"*/
-
-if (!a) {
-    doSomething();
-} else {
-    doSomethingElse();
-}
-
-if (a != b) {
-    doSomething();
-} else {
-    doSomethingElse();
-}
-
-if (a !== b) {
-    doSomething();
-} else {
-    doSomethingElse();
-}
-
-!a ? c : b
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-negated-condition: "error"*/
-
-if (!a) {
-    doSomething();
-}
-
-if (!a) {
-    doSomething();
-} else if (b) {
-    doSomething();
-}
-
-if (a != b) {
-    doSomething();
-}
-
-a ? b : c
-```
diff --git a/eslint/docs/rules/no-negated-in-lhs.md b/eslint/docs/rules/no-negated-in-lhs.md
deleted file mode 100644 (file)
index dd3d422..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# disallow negating the left operand in `in` expressions (no-negated-in-lhs)
-
-This rule was **deprecated** in ESLint v3.3.0 and replaced by the [no-unsafe-negation](no-unsafe-negation.md) rule.
-
-## Rule Details
-
-Just as developers might type `-a + b` when they mean `-(a + b)` for the negative of a sum, they might type `!key in object` by mistake when they almost certainly mean `!(key in object)` to test that a key is not in an object.
-
-## Rule Details
-
-This rule disallows negating the left operand in `in` expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-negated-in-lhs: "error"*/
-
-if(!key in object) {
-    // operator precedence makes it equivalent to (!key) in object
-    // and type conversion makes it equivalent to (key ? "false" : "true") in object
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-negated-in-lhs: "error"*/
-
-if(!(key in object)) {
-    // key is not in object
-}
-
-if(('' + !key) in object) {
-    // make operator precedence and type conversion explicit
-    // in a rare situation when that is the intended meaning
-}
-```
-
-## When Not To Use It
-
-Never.
diff --git a/eslint/docs/rules/no-nested-ternary.md b/eslint/docs/rules/no-nested-ternary.md
deleted file mode 100644 (file)
index 8c9cb0d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# disallow nested ternary expressions (no-nested-ternary)
-
-Nesting ternary expressions can make code more difficult to understand.
-
-```js
-var foo = bar ? baz : qux === quxx ? bing : bam;
-```
-
-## Rule Details
-
-The `no-nested-ternary` rule disallows nested ternary expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-nested-ternary: "error"*/
-
-var thing = foo ? bar : baz === qux ? quxx : foobar;
-
-foo ? baz === qux ? quxx() : foobar() : bar();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-nested-ternary: "error"*/
-
-var thing = foo ? bar : foobar;
-
-var thing;
-
-if (foo) {
-  thing = bar;
-} else if (baz === qux) {
-  thing = quxx;
-} else {
-  thing = foobar;
-}
-```
-
-## Related Rules
-
-* [no-ternary](no-ternary.md)
-* [no-unneeded-ternary](no-unneeded-ternary.md)
diff --git a/eslint/docs/rules/no-new-func.md b/eslint/docs/rules/no-new-func.md
deleted file mode 100644 (file)
index 7bdfc9e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# Disallow Function Constructor (no-new-func)
-
-It's possible to create functions in JavaScript from strings at runtime using the `Function` constructor, such as:
-
-```js
-var x = new Function("a", "b", "return a + b");
-var x = Function("a", "b", "return a + b");
-var x = Function.call(null, "a", "b", "return a + b");
-var x = Function.apply(null, ["a", "b", "return a + b"]);
-var x = Function.bind(null, "a", "b", "return a + b")();
-```
-
-This is considered by many to be a bad practice due to the difficulty in debugging and reading these types of functions. In addition, Content-Security-Policy (CSP) directives may disallow the use of eval() and similar methods for creating code from strings.
-
-## Rule Details
-
-This error is raised to highlight the use of a bad practice. By passing a string to the Function constructor, you are requiring the engine to parse that string much in the way it has to when you call the `eval` function.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new-func: "error"*/
-
-var x = new Function("a", "b", "return a + b");
-var x = Function("a", "b", "return a + b");
-var x = Function.call(null, "a", "b", "return a + b");
-var x = Function.apply(null, ["a", "b", "return a + b"]);
-var x = Function.bind(null, "a", "b", "return a + b")();
-var f = Function.bind(null, "a", "b", "return a + b"); // assuming that the result of Function.bind(...) will be eventually called.
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new-func: "error"*/
-
-var x = function (a, b) {
-    return a + b;
-};
-```
-
-## When Not To Use It
-
-In more advanced cases where you really need to use the `Function` constructor.
diff --git a/eslint/docs/rules/no-new-object.md b/eslint/docs/rules/no-new-object.md
deleted file mode 100644 (file)
index aef055c..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# disallow `Object` constructors (no-new-object)
-
-The `Object` constructor is used to create new generic objects in JavaScript, such as:
-
-```js
-var myObject = new Object();
-```
-
-However, this is no different from using the more concise object literal syntax:
-
-```js
-var myObject = {};
-```
-
-For this reason, many prefer to always use the object literal syntax and never use the `Object` constructor.
-
-While there are no performance differences between the two approaches, the byte savings and conciseness of the object literal form is what has made it the de facto way of creating new objects.
-
-## Rule Details
-
-This rule disallows `Object` constructors.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new-object: "error"*/
-
-var myObject = new Object();
-
-new Object();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new-object: "error"*/
-
-var myObject = new CustomObject();
-
-var myObject = {};
-
-var Object = function Object() {};
-new Object();
-```
-
-## When Not To Use It
-
-If you wish to allow the use of the `Object` constructor, you can safely turn this rule off.
-
-## Related Rules
-
-* [no-array-constructor](no-array-constructor.md)
-* [no-new-wrappers](no-new-wrappers.md)
diff --git a/eslint/docs/rules/no-new-require.md b/eslint/docs/rules/no-new-require.md
deleted file mode 100644 (file)
index 6cf1242..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Disallow new require (no-new-require)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-The `require` function is used to include modules that exist in separate files, such as:
-
-```js
-var appHeader = require('app-header');
-```
-
-Some modules return a constructor which can potentially lead to code such as:
-
-```js
-var appHeader = new require('app-header');
-```
-
-Unfortunately, this introduces a high potential for confusion since the code author likely meant to write:
-
-```js
-var appHeader = new (require('app-header'));
-```
-
-For this reason, it is usually best to disallow this particular expression.
-
-## Rule Details
-
-This rule aims to eliminate use of the `new require` expression.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new-require: "error"*/
-
-var appHeader = new require('app-header');
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new-require: "error"*/
-
-var AppHeader = require('app-header');
-var appHeader = new AppHeader();
-```
-
-## When Not To Use It
-
-If you are using a custom implementation of `require` and your code will never be used in projects where a standard `require` (CommonJS, Node.js, AMD) is expected, you can safely turn this rule off.
diff --git a/eslint/docs/rules/no-new-symbol.md b/eslint/docs/rules/no-new-symbol.md
deleted file mode 100644 (file)
index 66167cf..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Disallow Symbol Constructor (no-new-symbol)
-
-`Symbol` is not intended to be used with the `new` operator, but to be called as a function.
-
-```js
-var foo = new Symbol("foo");
-```
-
-This throws a `TypeError` exception.
-
-## Rule Details
-
-This rule is aimed at preventing the accidental calling of `Symbol` with the `new` operator.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new-symbol: "error"*/
-/*eslint-env es6*/
-
-var foo = new Symbol('foo');
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new-symbol: "error"*/
-/*eslint-env es6*/
-
-var foo = Symbol('foo');
-
-
-// Ignores shadowed Symbol.
-function bar(Symbol) {
-    const baz = new Symbol("baz");
-}
-
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-## Further Reading
-
-* [Symbol Objects specification](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects)
diff --git a/eslint/docs/rules/no-new-wrappers.md b/eslint/docs/rules/no-new-wrappers.md
deleted file mode 100644 (file)
index 45247e5..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# Disallow Primitive Wrapper Instances (no-new-wrappers)
-
-There are three primitive types in JavaScript that have wrapper objects: string, number, and boolean. These are represented by the constructors `String`, `Number`, and `Boolean`, respectively. The primitive wrapper types are used whenever one of these primitive values is read, providing them with object-like capabilities such as methods. Behind the scenes, an object of the associated wrapper type is created and then destroyed, which is why you can call methods on primitive values, such as:
-
-```js
-var text = "Hello world".substring(2);
-```
-
-Behind the scenes in this example, a `String` object is constructed. The `substring()` method exists on `String.prototype` and so is accessible to the string instance.
-
-It's also possible to manually create a new wrapper instance:
-
-```js
-var stringObject = new String("Hello world");
-var numberObject = new Number(33);
-var booleanObject = new Boolean(false);
-```
-
-Although possible, there aren't any good reasons to use these primitive wrappers as constructors. They tend to confuse other developers more than anything else because they seem like they should act as primitives, but they do not. For example:
-
-```js
-var stringObject = new String("Hello world");
-console.log(typeof stringObject);       // "object"
-
-var text = "Hello world";
-console.log(typeof text);               // "string"
-
-var booleanObject = new Boolean(false);
-if (booleanObject) {    // all objects are truthy!
-    console.log("This executes");
-}
-```
-
-The first problem is that primitive wrapper objects are, in fact, objects. That means `typeof` will return `"object"` instead of `"string"`, `"number"`, or `"boolean"`. The second problem comes with boolean objects. Every object is truthy, that means an instance of `Boolean` always resolves to `true` even when its actual value is `false`.
-
-For these reasons, it's considered a best practice to avoid using primitive wrapper types with `new`.
-
-## Rule Details
-
-This rule aims to eliminate the use of `String`, `Number`, and `Boolean` with the `new` operator. As such, it warns whenever it sees `new String`, `new Number`, or `new Boolean`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new-wrappers: "error"*/
-
-var stringObject = new String("Hello world");
-var numberObject = new Number(33);
-var booleanObject = new Boolean(false);
-
-var stringObject = new String;
-var numberObject = new Number;
-var booleanObject = new Boolean;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new-wrappers: "error"*/
-
-var text = String(someValue);
-var num = Number(someValue);
-
-var object = new MyString();
-```
-
-## When Not To Use It
-
-If you want to allow the use of primitive wrapper objects, then you can safely disable this rule.
-
-## Further Reading
-
-* [Wrapper objects](https://www.inkling.com/read/javascript-definitive-guide-david-flanagan-6th/chapter-3/wrapper-objects)
-
-## Related Rules
-
-* [no-array-constructor](no-array-constructor.md)
-* [no-new-object](no-new-object.md)
diff --git a/eslint/docs/rules/no-new.md b/eslint/docs/rules/no-new.md
deleted file mode 100644 (file)
index 19ae097..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# Disallow new For Side Effects (no-new)
-
-The goal of using `new` with a constructor is typically to create an object of a particular type and store that object in a variable, such as:
-
-```js
-var person = new Person();
-```
-
-It's less common to use `new` and not store the result, such as:
-
-```js
-new Person();
-```
-
-In this case, the created object is thrown away because its reference isn't stored anywhere, and in many cases, this means that the constructor should be replaced with a function that doesn't require `new` to be used.
-
-## Rule Details
-
-This rule is aimed at maintaining consistency and convention by disallowing constructor calls using the `new` keyword that do not assign the resulting object to a variable.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-new: "error"*/
-
-new Thing();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-new: "error"*/
-
-var thing = new Thing();
-
-Thing();
-```
diff --git a/eslint/docs/rules/no-nonoctal-decimal-escape.md b/eslint/docs/rules/no-nonoctal-decimal-escape.md
deleted file mode 100644 (file)
index 930b555..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# Disallow `\8` and `\9` escape sequences in string literals (no-nonoctal-decimal-escape)
-
-Although not being specified in the language until ECMAScript 2021, `\8` and `\9` escape sequences in string literals were allowed in most JavaScript engines, and treated as "useless" escapes:
-
-```js
-"\8" === "8"; // true
-"\9" === "9"; // true
-```
-
-Since ECMAScript 2021, these escape sequences are specified as [non-octal decimal escape sequences](https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence), retaining the same behavior.
-
-Nevertheless, the ECMAScript specification treats `\8` and `\9` in string literals as a legacy feature. This syntax is optional if the ECMAScript host is not a web browser. Browsers still have to support it, but only in non-strict mode.
-
-Regardless of your targeted environment, these escape sequences shouldn't be used when writing new code.
-
-## Rule Details
-
-This rule disallows `\8` and `\9` escape sequences in string literals.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-nonoctal-decimal-escape: "error"*/
-
-"\8";
-
-"\9";
-
-var foo = "w\8less";
-
-var bar = "December 1\9";
-
-var baz = "Don't use \8 and \9 escapes.";
-
-var quux = "\0\8";
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-nonoctal-decimal-escape: "error"*/
-
-"8";
-
-"9";
-
-var foo = "w8less";
-
-var bar = "December 19";
-
-var baz = "Don't use \\8 and \\9 escapes.";
-
-var quux = "\0\u0038";
-```
-
-## Further Reading
-
-* [NonOctalDecimalEscapeSequence](https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence) in ECMAScript specification
-
-## Related Rules
-
-* [no-octal-escape](no-octal-escape.md)
diff --git a/eslint/docs/rules/no-obj-calls.md b/eslint/docs/rules/no-obj-calls.md
deleted file mode 100644 (file)
index 7c8f715..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# disallow calling global object properties as functions (no-obj-calls)
-
-ECMAScript provides several global objects that are intended to be used as-is. Some of these objects look as if they could be constructors due their capitalization (such as `Math` and `JSON`) but will throw an error if you try to execute them as functions.
-
-The [ECMAScript 5 specification](https://es5.github.io/#x15.8) makes it clear that both `Math` and `JSON` cannot be invoked:
-
-> The Math object does not have a `[[Call]]` internal property; it is not possible to invoke the Math object as a function.
-
-The [ECMAScript 2015 specification](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect-object) makes it clear that `Reflect` cannot be invoked:
-
-> The Reflect object also does not have a `[[Call]]` internal method; it is not possible to invoke the Reflect object as a function.
-
-And the [ECMAScript 2017 specification](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-atomics-object) makes it clear that `Atomics` cannot be invoked:
-
-> The Atomics object does not have a `[[Call]]` internal method; it is not possible to invoke the Atomics object as a function.
-
-## Rule Details
-
-This rule disallows calling the `Math`, `JSON`, `Reflect` and `Atomics` objects as functions.
-
-This rule also disallows using these objects as constructors with the `new` operator.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-obj-calls: "error"*/
-/*eslint-env es2017*/
-
-var math = Math();
-
-var newMath = new Math();
-
-var json = JSON();
-
-var newJSON = new JSON();
-
-var reflect = Reflect();
-
-var newReflect = new Reflect();
-
-var atomics = Atomics();
-
-var newAtomics = new Atomics();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-obj-calls: "error"*/
-/*eslint-env es2017*/
-
-function area(r) {
-    return Math.PI * r * r;
-}
-
-var object = JSON.parse("{}");
-
-var value = Reflect.get({ x: 1, y: 2 }, "x");
-
-var first = Atomics.load(foo, 0);
-```
-
-## Further Reading
-
-* [The Math Object](https://es5.github.io/#x15.8)
diff --git a/eslint/docs/rules/no-octal-escape.md b/eslint/docs/rules/no-octal-escape.md
deleted file mode 100644 (file)
index f595217..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# disallow octal escape sequences in string literals (no-octal-escape)
-
-As of the ECMAScript 5 specification, octal escape sequences in string literals are deprecated and should not be used. Unicode escape sequences should be used instead.
-
-```js
-var foo = "Copyright \251";
-```
-
-## Rule Details
-
-This rule disallows octal escape sequences in string literals.
-
-If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-octal-escape: "error"*/
-
-var foo = "Copyright \251";
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-octal-escape: "error"*/
-
-var foo = "Copyright \u00A9";   // unicode
-
-var foo = "Copyright \xA9";     // hexadecimal
-```
diff --git a/eslint/docs/rules/no-octal.md b/eslint/docs/rules/no-octal.md
deleted file mode 100644 (file)
index a84fcce..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# disallow octal literals (no-octal)
-
-Octal literals are numerals that begin with a leading zero, such as:
-
-```js
-var num = 071;      // 57
-```
-
-Because the leading zero which identifies an octal literal has been a source of confusion and error in JavaScript code, ECMAScript 5 deprecates the use of octal numeric literals.
-
-## Rule Details
-
-The rule disallows octal literals.
-
-If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-octal: "error"*/
-
-var num = 071;
-var result = 5 + 07;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-octal: "error"*/
-
-var num  = "071";
-```
-
-## Compatibility
-
-* **JSHint**: W115
diff --git a/eslint/docs/rules/no-param-reassign.md b/eslint/docs/rules/no-param-reassign.md
deleted file mode 100644 (file)
index 29952c3..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-# Disallow Reassignment of Function Parameters (no-param-reassign)
-
-Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the `arguments` object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.
-
-This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.
-
-## Rule Details
-
-This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-param-reassign: "error"*/
-
-function foo(bar) {
-    bar = 13;
-}
-
-function foo(bar) {
-    bar++;
-}
-
-function foo(bar) {
-    for (bar in baz) {}
-}
-
-function foo(bar) {
-    for (bar of baz) {}
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-param-reassign: "error"*/
-
-function foo(bar) {
-    var baz = bar;
-}
-```
-
-## Options
-
-This rule takes one option, an object, with a boolean property `"props"`, and  arrays `"ignorePropertyModificationsFor"` and `"ignorePropertyModificationsForRegex"`. `"props"` is `false` by default. If `"props"` is set to `true`, this rule warns against the modification of parameter properties unless they're included in `"ignorePropertyModificationsFor"` or `"ignorePropertyModificationsForRegex"`, which is an empty array by default.
-
-### props
-
-Examples of **correct** code for the default `{ "props": false }` option:
-
-```js
-/*eslint no-param-reassign: ["error", { "props": false }]*/
-
-function foo(bar) {
-    bar.prop = "value";
-}
-
-function foo(bar) {
-    delete bar.aaa;
-}
-
-function foo(bar) {
-    bar.aaa++;
-}
-
-function foo(bar) {
-    for (bar.aaa in baz) {}
-}
-
-function foo(bar) {
-    for (bar.aaa of baz) {}
-}
-```
-
-Examples of **incorrect** code for the `{ "props": true }` option:
-
-```js
-/*eslint no-param-reassign: ["error", { "props": true }]*/
-
-function foo(bar) {
-    bar.prop = "value";
-}
-
-function foo(bar) {
-    delete bar.aaa;
-}
-
-function foo(bar) {
-    bar.aaa++;
-}
-
-function foo(bar) {
-    for (bar.aaa in baz) {}
-}
-
-function foo(bar) {
-    for (bar.aaa of baz) {}
-}
-```
-
-Examples of **correct** code for the `{ "props": true }` option with `"ignorePropertyModificationsFor"` set:
-
-```js
-/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/
-
-function foo(bar) {
-    bar.prop = "value";
-}
-
-function foo(bar) {
-    delete bar.aaa;
-}
-
-function foo(bar) {
-    bar.aaa++;
-}
-
-function foo(bar) {
-    for (bar.aaa in baz) {}
-}
-
-function foo(bar) {
-    for (bar.aaa of baz) {}
-}
-```
-
-Examples of **correct** code for the `{ "props": true }` option with `"ignorePropertyModificationsForRegex"` set:
-
-```js
-/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsForRegex": ["^bar"] }]*/
-
-function foo(barVar) {
-    barVar.prop = "value";
-}
-
-function foo(barrito) {
-    delete barrito.aaa;
-}
-
-function foo(bar_) {
-    bar_.aaa++;
-}
-
-function foo(barBaz) {
-    for (barBaz.aaa in baz) {}
-}
-
-function foo(barBaz) {
-    for (barBaz.aaa of baz) {}
-}
-```
-
-## When Not To Use It
-
-If you want to allow assignment to function parameters, then you can safely disable this rule.
-
-## Further Reading
-
-* [JavaScript: Don’t Reassign Your Function Arguments](https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/)
diff --git a/eslint/docs/rules/no-path-concat.md b/eslint/docs/rules/no-path-concat.md
deleted file mode 100644 (file)
index fddf27b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Disallow string concatenation when using `__dirname` and `__filename` (no-path-concat)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In Node.js, the `__dirname` and `__filename` global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:
-
-```js
-var fullPath = __dirname + "/foo.js";
-```
-
-However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.
-
-In order to avoid any confusion as to how to create the correct path, Node.js provides the `path` module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:
-
-```js
-var fullPath = path.join(__dirname, "foo.js");
-```
-
-This example doesn't need to include separators as `path.join()` will do it in the most appropriate manner. Alternately, you can use `path.resolve()` to retrieve the fully-qualified path:
-
-```js
-var fullPath = path.resolve(__dirname, "foo.js");
-```
-
-Both `path.join()` and `path.resolve()` are suitable replacements for string concatenation wherever file or directory paths are being created.
-
-## Rule Details
-
-This rule aims to prevent string concatenation of directory paths in Node.js
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-path-concat: "error"*/
-
-var fullPath = __dirname + "/foo.js";
-
-var fullPath = __filename + "/foo.js";
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-path-concat: "error"*/
-
-var fullPath = dirname + "/foo.js";
-```
-
-## When Not To Use It
-
-If you want to allow string concatenation of path names.
diff --git a/eslint/docs/rules/no-plusplus.md b/eslint/docs/rules/no-plusplus.md
deleted file mode 100644 (file)
index e1b1ca3..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# disallow the unary operators `++` and `--` (no-plusplus)
-
-Because the unary `++` and `--` operators are subject to automatic semicolon insertion, differences in whitespace can change semantics of source code.
-
-```js
-var i = 10;
-var j = 20;
-
-i ++
-j
-// i = 11, j = 20
-```
-
-```js
-var i = 10;
-var j = 20;
-
-i
-++
-j
-// i = 10, j = 21
-```
-
-## Rule Details
-
-This rule disallows the unary operators `++` and `--`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-plusplus: "error"*/
-
-var foo = 0;
-foo++;
-
-var bar = 42;
-bar--;
-
-for (i = 0; i < l; i++) {
-    return;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-plusplus: "error"*/
-
-var foo = 0;
-foo += 1;
-
-var bar = 42;
-bar -= 1;
-
-for (i = 0; i < l; i += 1) {
-    return;
-}
-```
-
-## Options
-
-This rule has an object option.
-
-* `"allowForLoopAfterthoughts": true` allows unary operators `++` and `--` in the afterthought (final expression) of a `for` loop.
-
-### allowForLoopAfterthoughts
-
-Examples of **correct** code for this rule with the `{ "allowForLoopAfterthoughts": true }` option:
-
-```js
-/*eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }]*/
-
-for (i = 0; i < l; i++) {
-    doSomething(i);
-}
-
-for (i = l; i >= 0; i--) {
-    doSomething(i);
-}
-
-for (i = 0, j = l; i < l; i++, j--) {
-    doSomething(i, j);
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "allowForLoopAfterthoughts": true }` option:
-
-```js
-/*eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }]*/
-
-for (i = 0; i < l; j = i++) {
-    doSomething(i, j);
-}
-
-for (i = l; i--;) {
-    doSomething(i);
-}
-
-for (i = 0; i < l;) i++;
-```
diff --git a/eslint/docs/rules/no-process-env.md b/eslint/docs/rules/no-process-env.md
deleted file mode 100644 (file)
index 4655e96..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# Disallow process.env (no-process-env)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-The `process.env` object in Node.js is used to store deployment/configuration parameters. Littering it through out a project could lead to maintenance issues as it's another kind of global dependency. As such, it could lead to merge conflicts in a multi-user setup and deployment issues in a multi-server setup. Instead, one of the best practices is to define all those parameters in a single configuration/settings file which could be accessed throughout the project.
-
-## Rule Details
-
-This rule is aimed at discouraging use of `process.env` to avoid global dependencies. As such, it will warn whenever `process.env` is used.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-process-env: "error"*/
-
-if(process.env.NODE_ENV === "development") {
-    //...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-process-env: "error"*/
-
-var config = require("./config");
-
-if(config.env === "development") {
-    //...
-}
-```
-
-## When Not To Use It
-
-If you prefer to use `process.env` throughout your project to retrieve values from environment variables, then you can safely disable this rule.
-
-## Further Reading
-
-* [How to store Node.js deployment settings/configuration files? - Stack Overflow](https://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files)
-* [Storing Node.js application config data - Ben Hall's blog](https://blog.benhall.me.uk/2012/02/storing-application-config-data-in/)
diff --git a/eslint/docs/rules/no-process-exit.md b/eslint/docs/rules/no-process-exit.md
deleted file mode 100644 (file)
index 54f2661..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# Disallow process.exit() (no-process-exit)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-The `process.exit()` method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:
-
-```js
-if (somethingBadHappened) {
-    console.error("Something bad happened!");
-    process.exit(1);
-}
-```
-
-This code could appear in any module and will stop the entire application when `somethingBadHappened` is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:
-
-```js
-if (somethingBadHappened) {
-    throw new Error("Something bad happened!");
-}
-```
-
-By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.
-
-If you are using `process.exit()` only for specifying the exit code, you can set [`process.exitCode`](https://nodejs.org/api/process.html#process_process_exitcode) (introduced in Node.js 0.11.8) instead.
-
-## Rule Details
-
-This rule aims to prevent the use of `process.exit()` in Node.js JavaScript. As such, it warns whenever `process.exit()` is found in code.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-process-exit: "error"*/
-
-process.exit(1);
-process.exit(0);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-process-exit: "error"*/
-
-Process.exit();
-var exit = process.exit;
-```
-
-## When Not To Use It
-
-There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code.
diff --git a/eslint/docs/rules/no-promise-executor-return.md b/eslint/docs/rules/no-promise-executor-return.md
deleted file mode 100644 (file)
index 1adfe37..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-# Disallow returning values from Promise executor functions (no-promise-executor-return)
-
-The `new Promise` constructor accepts a single argument, called an *executor*.
-
-```js
-const myPromise = new Promise(function executor(resolve, reject) {
-    readFile('foo.txt', function(err, result) {
-        if (err) {
-            reject(err);
-        } else {
-            resolve(result);
-        }
-    });
-});
-```
-
-The executor function usually initiates some asynchronous operation. Once it is finished, the executor should call `resolve` with the result, or `reject` if an error occurred.
-
-The return value of the executor is ignored. Returning a value from an executor function is a possible error because the returned value cannot be used and it doesn't affect the promise in any way.
-
-## Rule Details
-
-This rule disallows returning values from Promise executor functions.
-
-Only `return` without a value is allowed, as it's a control flow statement.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-promise-executor-return: "error"*/
-
-new Promise((resolve, reject) => {
-    if (someCondition) {
-        return defaultResult;
-    }
-    getSomething((err, result) => {
-        if (err) {
-            reject(err);
-        } else {
-            resolve(result);
-        }
-    });
-});
-
-new Promise((resolve, reject) => getSomething((err, data) => {
-    if (err) {
-        reject(err);
-    } else {
-        resolve(data);
-    }
-}));
-
-new Promise(() => {
-    return 1;
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-promise-executor-return: "error"*/
-
-new Promise((resolve, reject) => {
-    if (someCondition) {
-        resolve(defaultResult);
-        return;
-    }
-    getSomething((err, result) => {
-        if (err) {
-            reject(err);
-        } else {
-            resolve(result);
-        }
-    });
-});
-
-new Promise((resolve, reject) => {
-    getSomething((err, data) => {
-        if (err) {
-            reject(err);
-        } else {
-            resolve(data);
-        }
-    });
-});
-
-Promise.resolve(1);
-```
-
-## Further Reading
-
-* [MDN Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
-
-## Related Rules
-
-* [no-async-promise-executor](no-async-promise-executor.md)
diff --git a/eslint/docs/rules/no-proto.md b/eslint/docs/rules/no-proto.md
deleted file mode 100644 (file)
index 9543b7e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# Disallow Use of `__proto__` (no-proto)
-
-`__proto__` property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use `Object.getPrototypeOf` and `Object.setPrototypeOf` instead.
-
-## Rule Details
-
-When an object is created with the `new` operator, `__proto__` is set to the original "prototype" property of the object's constructor function. `Object.getPrototypeOf` is the preferred method of getting the object's prototype. To change an object's prototype, use `Object.setPrototypeOf`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-proto: "error"*/
-
-var a = obj.__proto__;
-
-var a = obj["__proto__"];
-
-obj.__proto__ = b;
-
-obj["__proto__"] = b;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-proto: "error"*/
-
-var a = Object.getPrototypeOf(obj);
-
-Object.setPrototypeOf(obj, b);
-
-var c = { __proto__: a };
-```
-
-## When Not To Use It
-
-You might want to turn this rule off if you need to support legacy browsers which implement the
-`__proto__` property but not `Object.getPrototypeOf` or `Object.setPrototypeOf`.
-
-## Further Reading
-
-* [Object.getPrototypeOf](http://ejohn.org/blog/objectgetprototypeof/)
diff --git a/eslint/docs/rules/no-prototype-builtins.md b/eslint/docs/rules/no-prototype-builtins.md
deleted file mode 100644 (file)
index 7132bcb..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# Disallow use of Object.prototypes builtins directly (no-prototype-builtins)
-
-In ECMAScript 5.1, `Object.create` was added, which enables the creation of objects with a specified `[[Prototype]]`. `Object.create(null)` is a common pattern used to create objects that will be used as a Map. This can lead to errors when it is assumed that objects will have properties from `Object.prototype`. This rule prevents calling some `Object.prototype` methods directly from an object.
-
-Additionally, objects can have properties that shadow the builtins on `Object.prototype`, potentially causing unintended behavior or denial-of-service security vulnerabilities. For example, it would be unsafe for a webserver to parse JSON input from a client and call `hasOwnProperty` directly on the resulting object, because a malicious client could send a JSON value like `{"hasOwnProperty": 1}` and cause the server to crash.
-
-To avoid subtle bugs like this, it's better to always call these methods from `Object.prototype`. For example, `foo.hasOwnProperty("bar")` should be replaced with `Object.prototype.hasOwnProperty.call(foo, "bar")`.
-
-## Rule Details
-
-This rule disallows calling some `Object.prototype` methods directly on object instances.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-prototype-builtins: "error"*/
-
-var hasBarProperty = foo.hasOwnProperty("bar");
-
-var isPrototypeOfBar = foo.isPrototypeOf(bar);
-
-var barIsEnumerable = foo.propertyIsEnumerable("bar");
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-prototype-builtins: "error"*/
-
-var hasBarProperty = Object.prototype.hasOwnProperty.call(foo, "bar");
-
-var isPrototypeOfBar = Object.prototype.isPrototypeOf.call(foo, bar);
-
-var barIsEnumerable = {}.propertyIsEnumerable.call(foo, "bar");
-```
-
-## When Not To Use It
-
-You may want to turn this rule off if your code only touches objects with hardcoded keys, and you will never use an object that shadows an `Object.prototype` method or which does not inherit from `Object.prototype`.
diff --git a/eslint/docs/rules/no-redeclare.md b/eslint/docs/rules/no-redeclare.md
deleted file mode 100644 (file)
index bd029eb..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# disallow variable redeclaration (no-redeclare)
-
-In JavaScript, it's possible to redeclare the same variable name using `var`. This can lead to confusion as to where the variable is actually declared and initialized.
-
-## Rule Details
-
-This rule is aimed at eliminating variables that have multiple declarations in the same scope.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-redeclare: "error"*/
-
-var a = 3;
-var a = 10;
-
-class C {
-    foo() {
-        var b = 3;
-        var b = 10;
-    }
-
-    static {
-        var c = 3;
-        var c = 10;
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-redeclare: "error"*/
-
-var a = 3;
-a = 10;
-
-class C {
-    foo() {
-        var b = 3;
-        b = 10;
-    }
-
-    static {
-        var c = 3;
-        c = 10;
-    }
-}
-
-```
-
-## Options
-
-This rule takes one optional argument, an object with a boolean property `"builtinGlobals"`. It defaults to `true`.
-If set to `true`, this rule also checks redeclaration of built-in globals, such as `Object`, `Array`, `Number`...
-
-### builtinGlobals
-
-The `"builtinGlobals"` option will check for redeclaration of built-in globals in global scope.
-
-Examples of **incorrect** code for the `{ "builtinGlobals": true }` option:
-
-```js
-/*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
-
-var Object = 0;
-```
-
-Examples of **incorrect** code for the `{ "builtinGlobals": true }` option and the `browser` environment:
-
-```js
-/*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
-/*eslint-env browser*/
-
-var top = 0;
-```
-
-The `browser` environment has many built-in global variables (for example, `top`). Some of built-in global variables cannot be redeclared.
-
-Note that when using the `node` or `commonjs` environments (or `ecmaFeatures.globalReturn`, if using the default parser), the top scope of a program is not actually the global scope, but rather a "module" scope. When this is the case, declaring a variable named after a builtin global is not a redeclaration, but rather a shadowing of the global variable. In that case, the [`no-shadow`](no-shadow.md) rule with the `"builtinGlobals"` option should be used.
-
-## Related Rules
-
-* [no-shadow](no-shadow.md)
diff --git a/eslint/docs/rules/no-regex-spaces.md b/eslint/docs/rules/no-regex-spaces.md
deleted file mode 100644 (file)
index 63a5174..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# disallow multiple spaces in regular expression literals (no-regex-spaces)
-
-Regular expressions can be very complex and difficult to understand, which is why it's important to keep them as simple as possible in order to avoid mistakes. One of the more error-prone things you can do with a regular expression is to use more than one space, such as:
-
-```js
-var re = /foo   bar/;
-```
-
-In this regular expression, it's very hard to tell how many spaces are intended to be matched. It's better to use only one space and then specify how many spaces are expected, such as:
-
-```js
-var re = /foo {3}bar/;
-```
-
-Now it is very clear that three spaces are expected to be matched.
-
-## Rule Details
-
-This rule disallows multiple spaces in regular expression literals.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-regex-spaces: "error"*/
-
-var re = /foo   bar/;
-var re = new RegExp("foo   bar");
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-regex-spaces: "error"*/
-
-var re = /foo {3}bar/;
-var re = new RegExp("foo {3}bar");
-```
-
-## When Not To Use It
-
-If you want to allow multiple spaces in a regular expression, then you can safely turn this rule off.
-
-## Related Rules
-
-* [no-div-regex](no-div-regex.md)
-* [no-control-regex](no-control-regex.md)
diff --git a/eslint/docs/rules/no-reserved-keys.md b/eslint/docs/rules/no-reserved-keys.md
deleted file mode 100644 (file)
index f1f8e41..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# no-reserved-keys: disallow unquoted reserved words as property names in object literals
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [quote-props](quote-props.md) rule.
-
-ECMAScript 3 described as series of keywords and reserved words, such as `if` and `public`, that are used or intended to be used for a core language feature. The specification also indicated that these keywords and reserved words could not be used as object property names without being enclosed in strings. An error occurs in an ECMAScript 3 environment when you use a keyword or reserved word in an object literal. For example:
-
-```js
-var values = {
-    enum: ["red", "blue", "green"]  // throws an error in ECMAScript 3
-}
-```
-
-In this code, `enum` is used as an object key and will throw an error in an ECMAScript 3 environment (such as Internet Explorer 8).
-
-ECMAScript 5 loosened the restriction such that keywords and reserved words can be used as object keys without causing an error. However, any code that needs to run in ECMAScript 3 still needs to avoid using keywords and reserved words as keys.
-
-## Rule Details
-
-This rule is aimed at eliminating the use of ECMAScript 3 keywords and reserved words as object literal keys. As such, it warns whenever an object key would throw an error in an ECMAScript 3 environment.
-
-Examples of **incorrect** code for this rule:
-
-```js
-var superman = {
-    class: "Superhero",
-    private: "Clark Kent"
-};
-
-var values = {
-    enum: ["red", "blue", "green"]
-};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-var superman = {
-    "class": "Superhero",
-    "private": "Clark Kent"
-};
-
-var values = {
-    "enum": ["red", "blue", "green"]
-};
-```
-
-## When Not To Use It
-
-If your code is only going to be executed in an ECMAScript 5 or higher environment, then you can safely leave this rule off.
-
-## Further Reading
-
-* [Reserved words as property names](https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names)
diff --git a/eslint/docs/rules/no-restricted-exports.md b/eslint/docs/rules/no-restricted-exports.md
deleted file mode 100644 (file)
index 2993857..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# Disallow specified names in exports (no-restricted-exports)
-
-In a project, certain names may be disallowed from being used as exported names for various reasons.
-
-## Rule Details
-
-This rule disallows specified names from being used as exported names.
-
-## Options
-
-By default, this rule doesn't disallow any names. Only the names you specify in the configuration will be disallowed.
-
-This rule has an object option:
-
-* `"restrictedNamedExports"` is an array of strings, where each string is a name to be restricted.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-restricted-exports: ["error", {
-    "restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d"]
-}]*/
-
-export const foo = 1;
-
-export function bar() {}
-
-export class Baz {}
-
-const a = {};
-export { a };
-
-function someFunction() {}
-export { someFunction as b };
-
-export { c } from 'some_module';
-
-export { something as d } from 'some_module';
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-restricted-exports: ["error", {
-    "restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d"]
-}]*/
-
-export const quux = 1;
-
-export function myFunction() {}
-
-export class MyClass {}
-
-const a = {};
-export { a as myObject };
-
-function someFunction() {}
-export { someFunction };
-
-export { c as someName } from 'some_module';
-
-export { something } from 'some_module';
-```
-
-### Default exports
-
-By design, this rule doesn't disallow `export default` declarations. If you configure `"default"` as a restricted name, that restriction will apply only to named export declarations.
-
-Examples of additional **incorrect** code for this rule:
-
-```js
-/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default"] }]*/
-
-function foo() {}
-
-export { foo as default };
-```
-
-```js
-/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default"] }]*/
-
-export { default } from 'some_module';
-```
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default", "foo"] }]*/
-
-export default function foo() {}
-```
-
-## Known Limitations
-
-This rule doesn't inspect the content of source modules in re-export declarations. In particular, if you are re-exporting everything from another module's export, that export may include a restricted name. This rule cannot detect such cases.
-
-```js
-
-//----- some_module.js -----
-export function foo() {}
-
-//----- my_module.js -----
-/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["foo"] }]*/
-
-export * from 'some_module'; // allowed, although this declaration exports "foo" from my_module
-```
diff --git a/eslint/docs/rules/no-restricted-globals.md b/eslint/docs/rules/no-restricted-globals.md
deleted file mode 100644 (file)
index dd3e15b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-# Disallow specific global variables (no-restricted-globals)
-
-Disallowing usage of specific global variables can be useful if you want to allow a set of global
-variables by enabling an environment, but still want to disallow some of those.
-
-For instance, early Internet Explorer versions exposed the current DOM event as a global variable
-`event`, but using this variable has been considered as a bad practice for a long time. Restricting
-this will make sure this variable isn't used in browser code.
-
-## Rule Details
-
-This rule allows you to specify global variable names that you don't want to use in your application.
-
-## Options
-
-This rule takes a list of strings, where each string is a global to be restricted:
-
-```json
-{
-    "rules": {
-        "no-restricted-globals": ["error", "event", "fdescribe"]
-    }
-}
-```
-
-Alternatively, the rule also accepts objects, where the global name and an optional custom message are specified:
-
-```json
-{
-    "rules": {
-        "no-restricted-globals": [
-            "error",
-            {
-                "name": "event",
-                "message": "Use local parameter instead."
-            },
-            {
-                "name": "fdescribe",
-                "message": "Do not commit fdescribe. Use describe instead."
-            }
-        ]
-    }
-}
-```
-
-Examples of **incorrect** code for sample `"event", "fdescribe"` global variable names:
-
-```js
-/*global event, fdescribe*/
-/*eslint no-restricted-globals: ["error", "event", "fdescribe"]*/
-
-function onClick() {
-    console.log(event);
-}
-
-fdescribe("foo", function() {
-});
-```
-
-Examples of **correct** code for a sample `"event"` global variable name:
-
-```js
-/*global event*/
-/*eslint no-restricted-globals: ["error", "event"]*/
-
-import event from "event-module";
-```
-
-```js
-/*global event*/
-/*eslint no-restricted-globals: ["error", "event"]*/
-
-var event = 1;
-```
-
-Examples of **incorrect** code for a sample `"event"` global variable name, along with a custom error message:
-
-```js
-/*global event*/
-/* eslint no-restricted-globals: ["error", { name: "event", message: "Use local parameter instead." }] */
-
-function onClick() {
-    console.log(event);    // Unexpected global variable 'event'. Use local parameter instead.
-}
-```
-
-## Related Rules
-
-* [no-restricted-properties](no-restricted-properties.md)
-* [no-restricted-syntax](no-restricted-syntax.md)
diff --git a/eslint/docs/rules/no-restricted-imports.md b/eslint/docs/rules/no-restricted-imports.md
deleted file mode 100644 (file)
index d8e0610..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-# Disallow specific imports (no-restricted-imports)
-
-Imports are an ES6/ES2015 standard for making the functionality of other modules available in your current module. In CommonJS this is implemented through the `require()` call which makes this ESLint rule roughly equivalent to its CommonJS counterpart `no-restricted-modules`.
-
-Why would you want to restrict imports?
-
-* Some imports might not make sense in a particular environment. For example, Node.js' `fs` module would not make sense in an environment that didn't have a file system.
-
-* Some modules provide similar or identical functionality, think `lodash` and `underscore`. Your project may have standardized on a module. You want to make sure that the other alternatives are not being used as this would unnecessarily bloat the project and provide a higher maintenance cost of two dependencies when one would suffice.
-
-## Rule Details
-
-This rule allows you to specify imports that you don't want to use in your application.
-
-It applies to static imports only, not dynamic ones.
-
-## Options
-
-The syntax to specify restricted imports looks like this:
-
-```json
-"no-restricted-imports": ["error", "import1", "import2"]
-```
-
-or like this:
-
-```json
-"no-restricted-imports": ["error", { "paths": ["import1", "import2"] }]
-```
-
-When using the object form, you can also specify an array of gitignore-style patterns:
-
-```json
-"no-restricted-imports": ["error", {
-    "paths": ["import1", "import2"],
-    "patterns": ["import1/private/*", "import2/*", "!import2/good"]
-}]
-```
-
-You may also specify a custom message for any paths you want to restrict as follows:
-
-```json
-"no-restricted-imports": ["error", {
-    "name": "import-foo",
-    "message": "Please use import-bar instead."
-}, {
-    "name": "import-baz",
-    "message": "Please use import-quux instead."
-}]
-```
-
-or like this:
-
-```json
-"no-restricted-imports": ["error", {
-    "paths": [{
-        "name": "import-foo",
-        "message": "Please use import-bar instead."
-    }, {
-        "name": "import-baz",
-        "message": "Please use import-quux instead."
-    }]
-}]
-```
-
-or like this if you need to restrict only certain imports from a module:
-
-```json
-"no-restricted-imports": ["error", {
-  "paths": [{
-    "name": "import-foo",
-    "importNames": ["Bar"],
-    "message": "Please use Bar from /import-bar/baz/ instead."
-  }]
-}]
-```
-
-or like this if you want to apply a custom message to pattern matches:
-
-```json
-"no-restricted-imports": ["error", {
-    "patterns": [{
-      "group": ["import1/private/*"],
-      "message": "usage of import1 private modules not allowed."
-    }, {
-      "group": ["import2/*", "!import2/good"],
-      "message": "import2 is deprecated, except the modules in import2/good."
-    }]
-}]
-```
-
-The custom message will be appended to the default error message.
-
-To restrict the use of all Node.js core imports (via <https://github.com/nodejs/node/tree/master/lib>):
-
-```json
-    "no-restricted-imports": ["error",
-         "assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","freelist","fs","http","https","module","net","os","path","punycode","querystring","readline","repl","smalloc","stream","string_decoder","sys","timers","tls","tracing","tty","url","util","vm","zlib"
-    ],
-```
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-restricted-imports: ["error", "fs"]*/
-
-import fs from 'fs';
-```
-
-```js
-/*eslint no-restricted-imports: ["error", "fs"]*/
-
-export { fs } from 'fs';
-```
-
-```js
-/*eslint no-restricted-imports: ["error", "fs"]*/
-
-export * from 'fs';
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { "paths": ["cluster"] }]*/
-
-import cluster from 'cluster';
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { "patterns": ["lodash/*"] }]*/
-
-import pick from 'lodash/pick';
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { paths: [{
-    name: "foo",
-    importNames: ["default"],
-    message: "Please use the default import from '/bar/baz/' instead."
-}]}]*/
-
-import DisallowedObject from "foo";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { paths: [{
-    name: "foo",
-    importNames: ["DisallowedObject"],
-    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
-}]}]*/
-
-import { DisallowedObject as AllowedObject } from "foo";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { paths: [{
-    name: "foo",
-    importNames: ["DisallowedObject"],
-    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
-}]}]*/
-
-import * as Foo from "foo";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { patterns: [{
-    group: ["lodash/*"],
-    message: "Please use the default import from 'lodash' instead."
-}]}]*/
-
-import pick from 'lodash/pick';
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-restricted-imports: ["error", "fs"]*/
-
-import crypto from 'crypto';
-export { foo } from "bar";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { "paths": ["fs"], "patterns": ["eslint/*"] }]*/
-
-import crypto from 'crypto';
-import eslint from 'eslint';
-export * from "path";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { paths: [{ name: "foo", importNames: ["DisallowedObject"] }] }]*/
-
-import DisallowedObject from "foo"
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { paths: [{
-    name: "foo",
-    importNames: ["DisallowedObject"],
-    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
-}]}]*/
-
-import { AllowedObject as DisallowedObject } from "foo";
-```
-
-```js
-/*eslint no-restricted-imports: ["error", { patterns: [{
-    group: ["lodash/*"],
-    message: "Please use the default import from 'lodash' instead."
-}]}]*/
-
-import lodash from 'lodash';
-```
-
-## When Not To Use It
-
-Don't use this rule or don't include a module in the list for this rule if you want to be able to import a module in your project without an ESLint error or warning.
diff --git a/eslint/docs/rules/no-restricted-modules.md b/eslint/docs/rules/no-restricted-modules.md
deleted file mode 100644 (file)
index 3bce058..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-# Disallow Node.js modules (no-restricted-modules)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-A module in Node.js is a simple or complex functionality organized in a JavaScript file which can be reused throughout the Node.js
-application. The keyword `require` is used in Node.js/CommonJS to import modules into an application. This way you can have dynamic loading where the loaded module name isn't predefined /static, or where you conditionally load a module only if it's "truly required".
-
-Why would you want to restrict a module?
-
-Disallowing usage of specific Node.js modules can be useful if you want to limit the available methods a developer can use. For example, you can block usage of the `fs` module if you want to disallow file system access.
-
-## Rule Details
-
-This rule allows you to specify modules that you don’t want to use in your application.
-
-## Options
-
-The rule takes one or more strings as options: the names of restricted modules.
-
-```json
-"no-restricted-modules": ["error", "foo-module", "bar-module"]
-```
-
-It can also take an object with lists of `paths` and gitignore-style `patterns` strings.
-
-```json
-"no-restricted-modules": ["error", { "paths": ["foo-module", "bar-module"] }]
-```
-
-```json
-"no-restricted-modules": ["error", {
-    "paths": ["foo-module", "bar-module"],
-    "patterns": ["foo-module/private/*", "bar-module/*","!baz-module/good"]
-}]
-```
-
-You may also specify a custom message for any paths you want to restrict as follows:
-
-```json
-"no-restricted-modules": ["error", {
-  "name": "foo-module",
-  "message": "Please use bar-module instead."
-  }
-]
-```
-
-or like this:
-
-```json
-"no-restricted-modules": ["error",{
-"paths":[{
-  "name": "foo-module",
-  "message": "Please use bar-module instead."
-  }]
-}]
-```
-
-The custom message will be appended to the default error message. Please note that you may not specify custom error messages for restricted patterns as a particular module may match more than one pattern.
-
-To restrict the use of all Node.js core modules (via <https://github.com/nodejs/node/tree/master/lib>):
-
-```json
-{
-    "no-restricted-modules": ["error",
-        "assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","freelist","fs","http","https","module","net","os","path","punycode","querystring","readline","repl","smalloc","stream","string_decoder","sys","timers","tls","tracing","tty","url","util","vm","zlib"
-    ]
-}
-```
-
-## Examples
-
-Examples of **incorrect** code for this rule  with sample `"fs", "cluster", "lodash"` restricted modules:
-
-```js
-/*eslint no-restricted-modules: ["error", "fs", "cluster"]*/
-
-var fs = require('fs');
-var cluster = require('cluster');
-```
-
-```js
-/*eslint no-restricted-modules: ["error", {"paths": ["cluster"] }]*/
-
-var cluster = require('cluster');
-```
-
-```js
-/*eslint no-restricted-modules: ["error", { "patterns": ["lodash/*"] }]*/
-
-var pick = require('lodash/pick');
-```
-
-Examples of **correct** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
-
-```js
-/*eslint no-restricted-modules: ["error", "fs", "cluster"]*/
-
-var crypto = require('crypto');
-```
-
-```js
-/*eslint no-restricted-modules: ["error", {
-    "paths": ["fs", "cluster"],
-    "patterns": ["lodash/*", "!lodash/pick"]
-}]*/
-
-var crypto = require('crypto');
-var pick = require('lodash/pick');
-```
diff --git a/eslint/docs/rules/no-restricted-properties.md b/eslint/docs/rules/no-restricted-properties.md
deleted file mode 100644 (file)
index 468d0b3..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-# disallow certain object properties (no-restricted-properties)
-
-Certain properties on objects may be disallowed in a codebase. This is useful for deprecating an API or restricting usage of a module's methods. For example, you may want to disallow using `describe.only` when using Mocha or telling people to use `Object.assign` instead of `_.extend`.
-
-## Rule Details
-
-This rule looks for accessing a given property key on a given object name, either when reading the property's value or invoking it as a function. You may specify an optional message to indicate an alternative API or a reason for the restriction.
-
-### Options
-
-This rule takes a list of objects, where the object name and property names are specified:
-
-```json
-{
-    "rules": {
-        "no-restricted-properties": [2, {
-            "object": "disallowedObjectName",
-            "property": "disallowedPropertyName"
-        }]
-    }
-}
-```
-
-Multiple object/property values can be disallowed, and you can specify an optional message:
-
-```json
-{
-    "rules": {
-        "no-restricted-properties": [2, {
-            "object": "disallowedObjectName",
-            "property": "disallowedPropertyName"
-        }, {
-            "object": "disallowedObjectName",
-            "property": "anotherDisallowedPropertyName",
-            "message": "Please use allowedObjectName.allowedPropertyName."
-        }]
-    }
-}
-```
-
-If the object name is omitted, the property is disallowed for all objects:
-
-```json
-{
-    "rules": {
-        "no-restricted-properties": [2, {
-            "property": "__defineGetter__",
-            "message": "Please use Object.defineProperty instead."
-        }]
-    }
-}
-```
-
-If the property name is omitted, accessing any property of the given object is disallowed:
-
-```json
-{
-    "rules": {
-        "no-restricted-properties": [2, {
-            "object": "require",
-            "message": "Please call require() directly."
-        }]
-    }
-}
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint no-restricted-properties: [2, {
-    "object": "disallowedObjectName",
-    "property": "disallowedPropertyName"
-}] */
-
-var example = disallowedObjectName.disallowedPropertyName; /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/
-
-disallowedObjectName.disallowedPropertyName(); /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/
-```
-
-```js
-/* eslint no-restricted-properties: [2, {
-    "property": "__defineGetter__"
-}] */
-
-foo.__defineGetter__(bar, baz);
-```
-
-```js
-/* eslint no-restricted-properties: [2, {
-    "object": "require"
-}] */
-
-require.resolve('foo');
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint no-restricted-properties: [2, {
-    "object": "disallowedObjectName",
-    "property": "disallowedPropertyName"
-}] */
-
-var example = disallowedObjectName.somePropertyName;
-
-allowedObjectName.disallowedPropertyName();
-```
-
-```js
-/* eslint no-restricted-properties: [2, {
-    "object": "require"
-}] */
-
-require('foo');
-```
-
-## When Not To Use It
-
-If you don't have any object/property combinations to restrict, you should not use this rule.
-
-## Related Rules
-
-* [no-restricted-globals](no-restricted-globals.md)
-* [no-restricted-syntax](no-restricted-syntax.md)
diff --git a/eslint/docs/rules/no-restricted-syntax.md b/eslint/docs/rules/no-restricted-syntax.md
deleted file mode 100644 (file)
index 0665167..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# disallow specified syntax (no-restricted-syntax)
-
-JavaScript has a lot of language features, and not everyone likes all of them. As a result, some projects choose to disallow the use of certain language features altogether. For instance, you might decide to disallow the use of `try-catch` or `class`, or you might decide to disallow the use of the `in` operator.
-
-Rather than creating separate rules for every language feature you want to turn off, this rule allows you to configure the syntax elements you want to restrict use of. These elements are represented by their [ESTree](https://github.com/estree/estree) node types. For example, a function declaration is represented by `FunctionDeclaration` and the `with` statement is represented by `WithStatement`. You may find the full list of AST node names you can use [on GitHub](https://github.com/eslint/espree/blob/master/lib/ast-node-types.js) and use [AST Explorer](https://astexplorer.net/) with the espree parser to see what type of nodes your code consists of.
-
-You can also specify [AST selectors](../developer-guide/selectors) to restrict, allowing much more precise control over syntax patterns.
-
-## Rule Details
-
-This rule disallows specified (that is, user-defined) syntax.
-
-## Options
-
-This rule takes a list of strings, where each string is an AST selector:
-
-```json
-{
-    "rules": {
-        "no-restricted-syntax": ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"]
-    }
-}
-```
-
-Alternatively, the rule also accepts objects, where the selector and an optional custom message are specified:
-
-```json
-{
-    "rules": {
-        "no-restricted-syntax": [
-            "error",
-            {
-                "selector": "FunctionExpression",
-                "message": "Function expressions are not allowed."
-            },
-            {
-                "selector": "CallExpression[callee.name='setTimeout'][arguments.length!=2]",
-                "message": "setTimeout must always be invoked with two arguments."
-            }
-        ]
-    }
-}
-```
-
-If a custom message is specified with the `message` property, ESLint will use that message when reporting occurrences of the syntax specified in the `selector` property.
-
-The string and object formats can be freely mixed in the configuration as needed.
-
-Examples of **incorrect** code for this rule with the `"FunctionExpression", "WithStatement", BinaryExpression[operator='in']` options:
-
-```js
-/* eslint no-restricted-syntax: ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"] */
-
-with (me) {
-    dontMess();
-}
-
-var doSomething = function () {};
-
-foo in bar;
-```
-
-Examples of **correct** code for this rule with the `"FunctionExpression", "WithStatement", BinaryExpression[operator='in']` options:
-
-```js
-/* eslint no-restricted-syntax: ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"] */
-
-me.dontMess();
-
-function doSomething() {};
-
-foo instanceof bar;
-```
-
-## When Not To Use It
-
-If you don't want to restrict your code from using any JavaScript features or syntax, you should not use this rule.
-
-## Related Rules
-
-* [no-alert](no-alert.md)
-* [no-console](no-console.md)
-* [no-debugger](no-debugger.md)
-* [no-restricted-properties](no-restricted-properties.md)
diff --git a/eslint/docs/rules/no-return-assign.md b/eslint/docs/rules/no-return-assign.md
deleted file mode 100644 (file)
index ed40c27..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-# Disallow Assignment in return Statement (no-return-assign)
-
-One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a `return` statement. For example:
-
-```js
-function doSomething() {
-    return foo = bar + 2;
-}
-```
-
-It is difficult to tell the intent of the `return` statement here. It's possible that the function is meant to return the result of `bar + 2`, but then why is it assigning to `foo`? It's also possible that the intent was to use a comparison operator such as `==` and that this code is an error.
-
-Because of this ambiguity, it's considered a best practice to not use assignment in `return` statements.
-
-## Rule Details
-
-This rule aims to eliminate assignments from `return` statements. As such, it will warn whenever an assignment is found as part of `return`.
-
-## Options
-
-The rule takes one option, a string, which must contain one of the following values:
-
-* `except-parens` (default): Disallow assignments unless they are enclosed in parentheses.
-* `always`: Disallow all assignments.
-
-### except-parens
-
-This is the default option.
-It disallows assignments unless they are enclosed in parentheses.
-
-Examples of **incorrect** code for the default `"except-parens"` option:
-
-```js
-/*eslint no-return-assign: "error"*/
-
-function doSomething() {
-    return foo = bar + 2;
-}
-
-function doSomething() {
-    return foo += 2;
-}
-
-const foo = (a, b) => a = b
-
-const bar = (a, b, c) => (a = b, c == b)
-
-function doSomething() {
-    return foo = bar && foo > 0;
-}
-```
-
-Examples of **correct** code for the default `"except-parens"` option:
-
-```js
-/*eslint no-return-assign: "error"*/
-
-function doSomething() {
-    return foo == bar + 2;
-}
-
-function doSomething() {
-    return foo === bar + 2;
-}
-
-function doSomething() {
-    return (foo = bar + 2);
-}
-
-const foo = (a, b) => (a = b)
-
-const bar = (a, b, c) => ((a = b), c == b)
-
-function doSomething() {
-    return (foo = bar) && foo > 0;
-}
-```
-
-### always
-
-This option disallows all assignments in `return` statements.
-All assignments are treated as problems.
-
-Examples of **incorrect** code for the `"always"` option:
-
-```js
-/*eslint no-return-assign: ["error", "always"]*/
-
-function doSomething() {
-    return foo = bar + 2;
-}
-
-function doSomething() {
-    return foo += 2;
-}
-
-function doSomething() {
-    return (foo = bar + 2);
-}
-```
-
-Examples of **correct** code for the `"always"` option:
-
-```js
-/*eslint no-return-assign: ["error", "always"]*/
-
-function doSomething() {
-    return foo == bar + 2;
-}
-
-function doSomething() {
-    return foo === bar + 2;
-}
-```
-
-## When Not To Use It
-
-If you want to allow the use of assignment operators in a `return` statement, then you can safely disable this rule.
diff --git a/eslint/docs/rules/no-return-await.md b/eslint/docs/rules/no-return-await.md
deleted file mode 100644 (file)
index e3f7be2..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# Disallows unnecessary `return await` (no-return-await)
-
-Using `return await` inside an `async function` keeps the current function in the call stack until the Promise that is being awaited has resolved, at the cost of an extra microtask before resolving the outer Promise. `return await` can also be used in a try/catch statement to catch errors from another function that returns a Promise.
-
-You can avoid the extra microtask by not awaiting the return value, with the trade off of the function no longer being a part of the stack trace if an error is thrown asynchronously from the Promise being returned. This can make debugging more difficult.
-
-## Rule Details
-
-This rule aims to prevent a likely common performance hazard due to a lack of understanding of the semantics of `async function`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-return-await: "error"*/
-
-async function foo() {
-    return await bar();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-return-await: "error"*/
-
-async function foo() {
-    return bar();
-}
-
-async function foo() {
-    await bar();
-    return;
-}
-
-// This is essentially the same as `return await bar();`, but the rule checks only `await` in `return` statements
-async function foo() {
-    const x = await bar();
-    return x;
-}
-
-// In this example the `await` is necessary to be able to catch errors thrown from `bar()`
-async function foo() {
-    try {
-        return await bar();
-    } catch (error) {}
-}
-```
-
-## When Not To Use It
-
-There are a few reasons you might want to turn this rule off:
-
-- If you want to use `await` to denote a value that is a thenable
-- If you do not want the performance benefit of avoiding `return await`
-- If you want the functions to show up in stack traces (useful for debugging purposes)
-
-## Further Reading
-
-[`async function` on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
-
-[`await vs return vs return await` by Jake Archibald](https://jakearchibald.com/2017/await-vs-return-vs-return-await/)
diff --git a/eslint/docs/rules/no-script-url.md b/eslint/docs/rules/no-script-url.md
deleted file mode 100644 (file)
index 5c71eb4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Disallow Script URLs (no-script-url)
-
-Using `javascript:` URLs is considered by some as a form of `eval`. Code passed in `javascript:` URLs has to be parsed and evaluated by the browser in the same way that `eval` is processed.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-script-url: "error"*/
-
-location.href = "javascript:void(0)";
-
-location.href = `javascript:void(0)`;
-```
-
-## Compatibility
-
-* **JSHint**: This rule corresponds to `scripturl` rule of JSHint.
-
-## Further Reading
-
-* [What is the matter with script-targeted URLs?](https://stackoverflow.com/questions/13497971/what-is-the-matter-with-script-targeted-urls)
diff --git a/eslint/docs/rules/no-self-assign.md b/eslint/docs/rules/no-self-assign.md
deleted file mode 100644 (file)
index 2991504..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-# Disallow Self Assignment (no-self-assign)
-
-Self assignments have no effect, so probably those are an error due to incomplete refactoring.
-Those indicate that what you should do is still remaining.
-
-```js
-foo = foo;
-[bar, baz] = [bar, qiz];
-```
-
-## Rule Details
-
-This rule is aimed at eliminating self assignments.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-self-assign: "error"*/
-
-foo = foo;
-
-[a, b] = [a, b];
-
-[a, ...b] = [x, ...b];
-
-({a, b} = {a, x});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-self-assign: "error"*/
-
-foo = bar;
-[a, b] = [b, a];
-
-// This pattern is warned by the `no-use-before-define` rule.
-let foo = foo;
-
-// The default values have an effect.
-[foo = 1] = [foo];
-
-// non-self-assignments with properties.
-obj.a = obj.b;
-obj.a.b = obj.c.b;
-obj.a.b = obj.a.c;
-obj[a] = obj["a"];
-
-// This ignores if there is a function call.
-obj.a().b = obj.a().b;
-a().b = a().b;
-
-// Known limitation: this does not support computed properties except single literal or single identifier.
-obj[a + b] = obj[a + b];
-obj["a" + "b"] = obj["a" + "b"];
-```
-
-## Options
-
-This rule has the option to check properties as well.
-
-```json
-{
-    "no-self-assign": ["error", {"props": true}]
-}
-```
-
-- `props` - if this is `true`, `no-self-assign` rule warns self-assignments of properties. Default is `true`.
-
-### props
-
-Examples of **correct** code with the `{ "props": false }` option:
-
-```js
-/*eslint no-self-assign: ["error", {"props": false}]*/
-
-// self-assignments with properties.
-obj.a = obj.a;
-obj.a.b = obj.a.b;
-obj["a"] = obj["a"];
-obj[a] = obj[a];
-```
-
-## When Not To Use It
-
-If you don't want to notify about self assignments, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/no-self-compare.md b/eslint/docs/rules/no-self-compare.md
deleted file mode 100644 (file)
index a745de4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Disallow Self Compare (no-self-compare)
-
-Comparing a variable against itself is usually an error, either a typo or refactoring error. It is confusing to the reader and may potentially introduce a runtime error.
-
-The only time you would compare a variable against itself is when you are testing for `NaN`. However, it is far more appropriate to use `typeof x === 'number' && isNaN(x)` or the [Number.isNaN ES2015 function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) for that use case rather than leaving the reader of the code to determine the intent of self comparison.
-
-## Rule Details
-
-This error is raised to highlight a potentially confusing and potentially pointless piece of code. There are almost no situations in which you would need to compare something to itself.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-self-compare: "error"*/
-
-var x = 10;
-if (x === x) {
-    x = 20;
-}
-```
diff --git a/eslint/docs/rules/no-sequences.md b/eslint/docs/rules/no-sequences.md
deleted file mode 100644 (file)
index f12c465..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-# Disallow Use of the Comma Operator (no-sequences)
-
-The comma operator includes multiple expressions where only one is expected. It evaluates each operand from left to right and returns the value of the last operand. However, this frequently obscures side effects, and its use is often an accident. Here are some examples of sequences:
-
-```js
-var a = (3, 5); // a = 5
-
-a = b += 5, a + b;
-
-while (a = next(), a && a.length);
-
-(0, eval)("doSomething();");
-```
-
-## Rule Details
-
-This rule forbids the use of the comma operator, with the following exceptions:
-
-* In the initialization or update portions of a `for` statement.
-* By default, if the expression sequence is explicitly wrapped in parentheses. This exception can be removed with the `allowInParentheses` option.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-sequences: "error"*/
-
-foo = doSomething(), val;
-
-0, eval("doSomething();");
-
-do {} while (doSomething(), !!test);
-
-for (; doSomething(), !!test; );
-
-if (doSomething(), !!test);
-
-switch (val = foo(), val) {}
-
-while (val = foo(), val < 42);
-
-with (doSomething(), val) {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-sequences: "error"*/
-
-foo = (doSomething(), val);
-
-(0, eval)("doSomething();");
-
-do {} while ((doSomething(), !!test));
-
-for (i = 0, j = 10; i < j; i++, j--);
-
-if ((doSomething(), !!test));
-
-switch ((val = foo(), val)) {}
-
-while ((val = foo(), val < 42));
-
-with ((doSomething(), val)) {}
-```
-
-### Note about arrow function bodies
-
-If an arrow function body is a statement rather than a block, and that statement contains a sequence, you need to use double parentheses around the statement to indicate that the sequence is intentional.
-
-Examples of **incorrect** code for arrow functions:
-
-```js
-/*eslint no-sequences: "error"*/
-const foo = (val) => (console.log('bar'), val);
-
-const foo = () => ((bar = 123), 10);
-
-const foo = () => { return (bar = 123), 10 }
-```
-
-Examples of **correct** code for arrow functions:
-
-```js
-/*eslint no-sequences: "error"*/
-const foo = (val) => ((console.log('bar'), val));
-
-const foo = () => (((bar = 123), 10));
-
-const foo = () => { return ((bar = 123), 10) }
-```
-
-## Options
-
-This rule takes one option, an object, with the following properties:
-
-* `"allowInParentheses"`: If set to `true` (default), this rule allows expression sequences that are explicitly wrapped in parentheses.
-
-### allowInParentheses
-
-Examples of **incorrect** code for this rule with the `{ "allowInParentheses": false }` option:
-
-```js
-/*eslint no-sequences: ["error", { "allowInParentheses": false }]*/
-
-foo = (doSomething(), val);
-
-(0, eval)("doSomething();");
-
-do {} while ((doSomething(), !!test));
-
-for (; (doSomething(), !!test); );
-
-if ((doSomething(), !!test));
-
-switch ((val = foo(), val)) {}
-
-while ((val = foo(), val < 42));
-
-with ((doSomething(), val)) {}
-
-const foo = (val) => ((console.log('bar'), val));
-```
-
-Examples of **correct** code for this rule with the `{ "allowInParentheses": false }` option:
-
-```js
-/*eslint no-sequences: ["error", { "allowInParentheses": false }]*/
-
-for (i = 0, j = 10; i < j; i++, j--);
-```
-
-## When Not To Use It
-
-Disable this rule if sequence expressions with the comma operator are acceptable.
-Another case is where you might want to report all usages of the comma operator, even in a for loop. You can achieve this using rule `no-restricted-syntax`:
-
-```js
-{
-    "rules": {
-        "no-restricted-syntax": ["error", "SequenceExpression"]
-    }
-}
-```
diff --git a/eslint/docs/rules/no-setter-return.md b/eslint/docs/rules/no-setter-return.md
deleted file mode 100644 (file)
index 5308974..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-# Disallow returning values from setters (no-setter-return)
-
-Setters cannot return values.
-
-While returning a value from a setter does not produce an error, the returned value is being ignored. Therefore, returning a value from a setter is either unnecessary or a possible error, since the returned value cannot be used.
-
-## Rule Details
-
-This rule disallows returning values from setters and reports `return` statements in setter functions.
-
-Only `return` without a value is allowed, as it's a control flow statement.
-
-This rule checks setters in:
-
-* Object literals.
-* Class declarations and class expressions.
-* Property descriptors in `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty` methods of the global objects.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-setter-return: "error"*/
-
-var foo = {
-    set a(value) {
-        this.val = value;
-        return value;
-    }
-};
-
-class Foo {
-    set a(value) {
-        this.val = value * 2;
-        return this.val;
-    }
-}
-
-const Bar = class {
-    static set a(value) {
-        if (value < 0) {
-            this.val = 0;
-            return 0;
-        }
-        this.val = value;
-    }
-};
-
-Object.defineProperty(foo, "bar", {
-    set(value) {
-        if (value < 0) {
-            return false;
-        }
-        this.val = value;
-    }
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-setter-return: "error"*/
-
-var foo = {
-    set a(value) {
-        this.val = value;
-    }
-};
-
-class Foo {
-    set a(value) {
-        this.val = value * 2;
-    }
-}
-
-const Bar = class {
-    static set a(value) {
-        if (value < 0) {
-            this.val = 0;
-            return;
-        }
-        this.val = value;
-    }
-};
-
-Object.defineProperty(foo, "bar", {
-    set(value) {
-        if (value < 0) {
-            throw new Error("Negative value.");
-        }
-        this.val = value;
-    }
-});
-```
-
-## Further Reading
-
-* [MDN setter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)
-
-## Related Rules
-
-* [getter-return](getter-return.md)
diff --git a/eslint/docs/rules/no-shadow-restricted-names.md b/eslint/docs/rules/no-shadow-restricted-names.md
deleted file mode 100644 (file)
index 890353d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# Disallow Shadowing of Restricted Names (no-shadow-restricted-names)
-
-ES5 §15.1.1 Value Properties of the Global Object (`NaN`, `Infinity`, `undefined`) as well as strict mode restricted identifiers `eval` and `arguments` are considered to be restricted names in JavaScript. Defining them to mean something else can have unintended consequences and confuse others reading the code. For example, there's nothing preventing you from writing:
-
-```js
-var undefined = "foo";
-```
-
-Then any code used within the same scope would not get the global `undefined`, but rather the local version with a very different meaning.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-shadow-restricted-names: "error"*/
-
-function NaN(){}
-
-!function(Infinity){};
-
-var undefined = 5;
-
-try {} catch(eval){}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-shadow-restricted-names: "error"*/
-
-var Object;
-
-function f(a, b){}
-
-// Exception: `undefined` may be shadowed if the variable is never assigned a value.
-var undefined;
-```
-
-## Further Reading
-
-* [Annotated ES5 - §15.1.1](https://es5.github.io/#x15.1.1)
-* [Annotated ES5 - Annex C](https://es5.github.io/#C)
-
-## Related Rules
-
-* [no-shadow](no-shadow.md)
diff --git a/eslint/docs/rules/no-shadow.md b/eslint/docs/rules/no-shadow.md
deleted file mode 100644 (file)
index 3bf9783..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-# disallow variable declarations from shadowing variables declared in the outer scope (no-shadow)
-
-Shadowing is the process by which a local variable shares the same name as a variable in its containing scope. For example:
-
-```js
-var a = 3;
-function b() {
-    var a = 10;
-}
-```
-
-In this case, the variable `a` inside of `b()` is shadowing the variable `a` in the global scope. This can cause confusion while reading the code and it's impossible to access the global variable.
-
-## Rule Details
-
-This rule aims to eliminate shadowed variable declarations.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-shadow: "error"*/
-/*eslint-env es6*/
-
-var a = 3;
-function b() {
-    var a = 10;
-}
-
-var b = function () {
-    var a = 10;
-}
-
-function b(a) {
-    a = 10;
-}
-b(a);
-
-if (true) {
-    let a = 5;
-}
-```
-
-## Options
-
-This rule takes one option, an object, with properties `"builtinGlobals"`, `"hoist"` and `"allow"`.
-
-```json
-{
-    "no-shadow": ["error", { "builtinGlobals": false, "hoist": "functions", "allow": [] }]
-}
-```
-
-### builtinGlobals
-
-The `builtinGlobals` option is `false` by default.
-If it is `true`, the rule prevents shadowing of built-in global variables: `Object`, `Array`, `Number`, and so on.
-
-Examples of **incorrect** code for the `{ "builtinGlobals": true }` option:
-
-```js
-/*eslint no-shadow: ["error", { "builtinGlobals": true }]*/
-
-function foo() {
-    var Object = 0;
-}
-```
-
-### hoist
-
-The `hoist` option has three settings:
-
-* `functions` (by default) - reports shadowing before the outer functions are defined.
-* `all` - reports all shadowing before the outer variables/functions are defined.
-* `never` - never report shadowing before the outer variables/functions are defined.
-
-#### hoist: functions
-
-Examples of **incorrect** code for the default `{ "hoist": "functions" }` option:
-
-```js
-/*eslint no-shadow: ["error", { "hoist": "functions" }]*/
-/*eslint-env es6*/
-
-if (true) {
-    let b = 6;
-}
-
-function b() {}
-```
-
-Although `let b` in the `if` statement is before the *function* declaration in the outer scope, it is incorrect.
-
-Examples of **correct** code for the default `{ "hoist": "functions" }` option:
-
-```js
-/*eslint no-shadow: ["error", { "hoist": "functions" }]*/
-/*eslint-env es6*/
-
-if (true) {
-    let a = 3;
-}
-
-let a = 5;
-```
-
-Because `let a` in the `if` statement is before the *variable* declaration in the outer scope, it is correct.
-
-#### hoist: all
-
-Examples of **incorrect** code for the `{ "hoist": "all" }` option:
-
-```js
-/*eslint no-shadow: ["error", { "hoist": "all" }]*/
-/*eslint-env es6*/
-
-if (true) {
-    let a = 3;
-    let b = 6;
-}
-
-let a = 5;
-function b() {}
-```
-
-#### hoist: never
-
-Examples of **correct** code for the `{ "hoist": "never" }` option:
-
-```js
-/*eslint no-shadow: ["error", { "hoist": "never" }]*/
-/*eslint-env es6*/
-
-if (true) {
-    let a = 3;
-    let b = 6;
-}
-
-let a = 5;
-function b() {}
-```
-
-Because `let a` and `let b` in the `if` statement are before the declarations in the outer scope, they are correct.
-
-### allow
-
-The `allow` option is an array of identifier names for which shadowing is allowed. For example, `"resolve"`, `"reject"`, `"done"`, `"cb"`.
-
-Examples of **correct** code for the `{ "allow": ["done"] }` option:
-
-```js
-/*eslint no-shadow: ["error", { "allow": ["done"] }]*/
-/*eslint-env es6*/
-
-import async from 'async';
-
-function foo(done) {
-  async.map([1, 2], function (e, done) {
-    done(null, e * 2)
-  }, done);
-}
-
-foo(function (err, result) {
-  console.log({ err, result });
-});
-```
-
-## Further Reading
-
-* [Variable Shadowing](https://en.wikipedia.org/wiki/Variable_shadowing)
-
-## Related Rules
-
-* [no-shadow-restricted-names](no-shadow-restricted-names.md)
diff --git a/eslint/docs/rules/no-space-before-semi.md b/eslint/docs/rules/no-space-before-semi.md
deleted file mode 100644 (file)
index 2e142dd..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# no-space-before-semi: disallow spaces before semicolons
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [semi-spacing](semi-spacing.md) rule.
-
-JavaScript allows for placing unnecessary spaces between an expression and the closing semicolon.
-
-Space issues can also cause code to look inconsistent and harder to read.
-
-```js
-var thing = function () {
-  var test = 12 ;
-}  ;
-```
-
-## Rule Details
-
-This rule prevents the use of spaces before a semicolon in expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-var foo = "bar" ;
-
-var foo = function() {} ;
-
-var foo = function() {
-} ;
-
-var foo = 1 + 2 ;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-;(function(){}());
-
-var foo = "bar";
-```
-
-## Related Rules
-
-* [semi](semi.md)
-* [no-extra-semi](no-extra-semi.md)
diff --git a/eslint/docs/rules/no-spaced-func.md b/eslint/docs/rules/no-spaced-func.md
deleted file mode 100644 (file)
index d424049..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# disallow spacing between function identifiers and their applications (no-spaced-func)
-
-This rule was **deprecated** in ESLint v3.3.0 and replaced by the [func-call-spacing](func-call-spacing.md) rule.
-
-While it's possible to have whitespace between the name of a function and the parentheses that execute it, such patterns tend to look more like errors.
-
-## Rule Details
-
-This rule disallows spacing between function identifiers and their applications.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-spaced-func: "error"*/
-
-fn ()
-
-fn
-()
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-spaced-func: "error"*/
-
-fn()
-```
diff --git a/eslint/docs/rules/no-sparse-arrays.md b/eslint/docs/rules/no-sparse-arrays.md
deleted file mode 100644 (file)
index 826cfd8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# disallow sparse arrays (no-sparse-arrays)
-
-Sparse arrays contain empty slots, most frequently due to multiple commas being used in an array literal, such as:
-
-```js
-var items = [,,];
-```
-
-While the `items` array in this example has a `length` of 2, there are actually no values in `items[0]` or `items[1]`. The fact that the array literal is valid with only commas inside, coupled with the `length` being set and actual item values not being set, make sparse arrays confusing for many developers. Consider the following:
-
-```js
-var colors = [ "red",, "blue" ];
-```
-
-In this example, the `colors` array has a `length` of 3. But did the developer intend for there to be an empty spot in the middle of the array? Or is it a typo?
-
-The confusion around sparse arrays defined in this manner is enough that it's recommended to avoid using them unless you are certain that they are useful in your code.
-
-## Rule Details
-
-This rule disallows sparse array literals which have "holes" where commas are not preceded by elements. It does not apply to a trailing comma following the last element.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-sparse-arrays: "error"*/
-
-var items = [,];
-var colors = [ "red",, "blue" ];
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-sparse-arrays: "error"*/
-
-var items = [];
-var items = new Array(23);
-
-// trailing comma (after the last element) is not a problem
-var colors = [ "red", "blue", ];
-```
-
-## When Not To Use It
-
-If you want to use sparse arrays, then it is safe to disable this rule.
-
-## Further Reading
-
-* [Inconsistent array literals](https://www.nczonline.net/blog/2007/09/09/inconsistent-array-literals/)
diff --git a/eslint/docs/rules/no-sync.md b/eslint/docs/rules/no-sync.md
deleted file mode 100644 (file)
index 949df6d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# Disallow Synchronous Methods (no-sync)
-
-This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
-
-In Node.js, most I/O is done through asynchronous methods. However, there are often synchronous versions of the asynchronous methods. For example, `fs.exists()` and `fs.existsSync()`. In some contexts, using synchronous operations is okay (if, as with ESLint, you are writing a command line utility). However, in other contexts the use of synchronous operations is considered a bad practice that should be avoided. For example, if you are running a high-travel web server on Node.js, you should consider carefully if you want to allow any synchronous operations that could lock up the server.
-
-## Rule Details
-
-This rule is aimed at preventing synchronous methods from being called in Node.js. It looks specifically for the method suffix "`Sync`" (as is the convention with Node.js operations).
-
-## Options
-
-This rule has an optional object option `{ allowAtRootLevel: <boolean> }`, which determines whether synchronous methods should be allowed at the top level of a file, outside of any functions. This option defaults to `false`.
-
-Examples of **incorrect** code for this rule with the default `{ allowAtRootLevel: false }` option:
-
-```js
-/*eslint no-sync: "error"*/
-
-fs.existsSync(somePath);
-
-function foo() {
-  var contents = fs.readFileSync(somePath).toString();
-}
-```
-
-Examples of **correct** code for this rule with the default `{ allowAtRootLevel: false }` option:
-
-```js
-/*eslint no-sync: "error"*/
-
-obj.sync();
-
-async(function() {
-    // ...
-});
-```
-
-Examples of **incorrect** code for this rule with the `{ allowAtRootLevel: true }` option
-
-```js
-/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
-
-function foo() {
-  var contents = fs.readFileSync(somePath).toString();
-}
-
-var bar = baz => fs.readFileSync(qux);
-```
-
-Examples of **correct** code for this rule with the `{ allowAtRootLevel: true }` option
-
-```js
-/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
-
-fs.readFileSync(somePath).toString();
-```
-
-## When Not To Use It
-
-If you want to allow synchronous operations in your script, do not enable this rule.
diff --git a/eslint/docs/rules/no-tabs.md b/eslint/docs/rules/no-tabs.md
deleted file mode 100644 (file)
index 4e02d9a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# disallow all tabs (no-tabs)
-
-Some style guides don't allow the use of tab characters at all, including within comments.
-
-## Rule Details
-
-This rule looks for tabs anywhere inside a file: code, comments or anything else.
-
-Examples of **incorrect** code for this rule:
-
-```js
-var a \t= 2;
-
-/**
-* \t\t it's a test function
-*/
-function test(){}
-
-var x = 1; // \t test
-```
-
-Examples of **correct** code for this rule:
-
-```js
-var a = 2;
-
-/**
-* it's a test function
-*/
-function test(){}
-
-var x = 1; // test
-```
-
-### Options
-
-This rule has an optional object option with the following properties:
-
-* `allowIndentationTabs` (default: false): If this is set to true, then the rule will not report tabs used for indentation.
-
-#### allowIndentationTabs
-
-Examples of **correct** code for this rule with the `allowIndentationTabs: true` option:
-
-```js
-/* eslint no-tabs: ["error", { allowIndentationTabs: true }] */
-
-function test() {
-\tdoSomething();
-}
-
-\t// comment with leading indentation tab
-```
-
-## When Not To Use It
-
-If you have established a standard where having tabs is fine, then you can disable this rule.
-
-## Compatibility
-
-* **JSCS**: [disallowTabs](https://jscs-dev.github.io/rule/disallowTabs)
diff --git a/eslint/docs/rules/no-template-curly-in-string.md b/eslint/docs/rules/no-template-curly-in-string.md
deleted file mode 100644 (file)
index 68a237d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# Disallow template literal placeholder syntax in regular strings (no-template-curly-in-string)
-
-ECMAScript 6 allows programmers to create strings containing variable or expressions using template literals, instead of string concatenation, by writing expressions like `${variable}` between two backtick quotes (\`). It can be easy to use the wrong quotes when wanting to use template literals, by writing `"${variable}"`, and end up with the literal value `"${variable}"` instead of a string containing the value of the injected expressions.
-
-## Rule Details
-
-This rule aims to warn when a regular string contains what looks like a template literal placeholder. It will warn when it finds a string containing the template literal placeholder (`${something}`) that uses either `"` or `'` for the quotes.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-template-curly-in-string: "error"*/
-"Hello ${name}!";
-'Hello ${name}!';
-"Time: ${12 * 60 * 60 * 1000}";
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-template-curly-in-string: "error"*/
-`Hello ${name}!`;
-`Time: ${12 * 60 * 60 * 1000}`;
-
-templateFunction`Hello ${name}`;
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
diff --git a/eslint/docs/rules/no-ternary.md b/eslint/docs/rules/no-ternary.md
deleted file mode 100644 (file)
index 3c95f82..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# disallow ternary operators (no-ternary)
-
-The ternary operator is used to conditionally assign a value to a variable. Some believe that the use of ternary operators leads to unclear code.
-
-```js
-var foo = isBar ? baz : qux;
-```
-
-## Rule Details
-
-This rule disallows ternary operators.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-ternary: "error"*/
-
-var foo = isBar ? baz : qux;
-
-function quux() {
-  return foo ? bar() : baz();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-ternary: "error"*/
-
-var foo;
-
-if (isBar) {
-    foo = baz;
-} else {
-    foo = qux;
-}
-
-function quux() {
-    if (foo) {
-        return bar();
-    } else {
-        return baz();
-    }
-}
-```
-
-## Related Rules
-
-* [no-nested-ternary](no-nested-ternary.md)
-* [no-unneeded-ternary](no-unneeded-ternary.md)
diff --git a/eslint/docs/rules/no-this-before-super.md b/eslint/docs/rules/no-this-before-super.md
deleted file mode 100644 (file)
index 53223b7..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-# Disallow use of `this`/`super` before calling `super()` in constructors. (no-this-before-super)
-
-In the constructor of derived classes, if `this`/`super` are used before `super()` calls, it raises a reference error.
-
-This rule checks `this`/`super` keywords in constructors, then reports those that are before `super()`.
-
-## Rule Details
-
-This rule is aimed to flag `this`/`super` keywords before `super()` callings.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-this-before-super: "error"*/
-/*eslint-env es6*/
-
-class A extends B {
-    constructor() {
-        this.a = 0;
-        super();
-    }
-}
-
-class A extends B {
-    constructor() {
-        this.foo();
-        super();
-    }
-}
-
-class A extends B {
-    constructor() {
-        super.foo();
-        super();
-    }
-}
-
-class A extends B {
-    constructor() {
-        super(this.foo());
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-this-before-super: "error"*/
-/*eslint-env es6*/
-
-class A {
-    constructor() {
-        this.a = 0; // OK, this class doesn't have an `extends` clause.
-    }
-}
-
-class A extends B {
-    constructor() {
-        super();
-        this.a = 0; // OK, this is after `super()`.
-    }
-}
-
-class A extends B {
-    foo() {
-        this.a = 0; // OK. this is not in a constructor.
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about using `this`/`super` before `super()` in constructors, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-throw-literal.md b/eslint/docs/rules/no-throw-literal.md
deleted file mode 100644 (file)
index ecb19ed..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# Restrict what can be thrown as an exception (no-throw-literal)
-
-It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions.
-The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated.
-
-This rule restricts what can be thrown as an exception.  When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an `Error` object.
-
-## Rule Details
-
-This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-throw-literal: "error"*/
-/*eslint-env es6*/
-
-throw "error";
-
-throw 0;
-
-throw undefined;
-
-throw null;
-
-var err = new Error();
-throw "an " + err;
-// err is recast to a string literal
-
-var err = new Error();
-throw `${err}`
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-throw-literal: "error"*/
-
-throw new Error();
-
-throw new Error("error");
-
-var e = new Error("error");
-throw e;
-
-try {
-    throw new Error("error");
-} catch (e) {
-    throw e;
-}
-```
-
-## Known Limitations
-
-Due to the limits of static analysis, this rule cannot guarantee that you will only throw `Error` objects.
-
-Examples of **correct** code for this rule, but which do not throw an `Error` object:
-
-```js
-/*eslint no-throw-literal: "error"*/
-
-var err = "error";
-throw err;
-
-function foo(bar) {
-    console.log(bar);
-}
-throw foo("error");
-
-throw new String("error");
-
-var foo = {
-    bar: "error"
-};
-throw foo.bar;
-```
diff --git a/eslint/docs/rules/no-trailing-spaces.md b/eslint/docs/rules/no-trailing-spaces.md
deleted file mode 100644 (file)
index e0724b7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# disallow trailing whitespace at the end of lines (no-trailing-spaces)
-
-Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before check-in.
-
-## Rule Details
-
-This rule disallows trailing whitespace (spaces, tabs, and other Unicode whitespace characters) at the end of lines.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-trailing-spaces: "error"*/
-
-var foo = 0;//•••••
-var baz = 5;//••
-//•••••
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-trailing-spaces: "error"*/
-
-var foo = 0;
-var baz = 5;
-```
-
-## Options
-
-This rule has an object option:
-
-* `"skipBlankLines": false` (default) disallows trailing whitespace on empty lines
-* `"skipBlankLines": true` allows trailing whitespace on empty lines
-* `"ignoreComments": false` (default) disallows trailing whitespace in comment blocks
-* `"ignoreComments": true` allows trailing whitespace in comment blocks
-
-### skipBlankLines
-
-Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
-
-```js
-/*eslint no-trailing-spaces: ["error", { "skipBlankLines": true }]*/
-
-var foo = 0;
-var baz = 5;
-//•••••
-```
-
-### ignoreComments
-
-Examples of **correct** code for this rule with the `{ "ignoreComments": true }` option:
-
-```js
-/*eslint no-trailing-spaces: ["error", { "ignoreComments": true }]*/
-
-//foo•
-//•••••
-/**
- *•baz
- *••
- *•bar
- */
-```
diff --git a/eslint/docs/rules/no-undef-init.md b/eslint/docs/rules/no-undef-init.md
deleted file mode 100644 (file)
index 10bde77..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-# Disallow Initializing to undefined (no-undef-init)
-
-In JavaScript, a variable that is declared and not initialized to any value automatically gets the value of `undefined`. For example:
-
-```js
-var foo;
-
-console.log(foo === undefined);     // true
-```
-
-It's therefore unnecessary to initialize a variable to `undefined`, such as:
-
-```js
-var foo = undefined;
-```
-
-It's considered a best practice to avoid initializing variables to `undefined`.
-
-## Rule Details
-
-This rule aims to eliminate `var` and `let` variable declarations that initialize to `undefined`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-undef-init: "error"*/
-
-var foo = undefined;
-let bar = undefined;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-undef-init: "error"*/
-
-var foo;
-let bar;
-```
-
-Please note that this rule does not check `const` declarations, destructuring patterns, function parameters, and class fields.
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-undef-init: "error"*/
-
-const foo = undefined;
-
-let { bar = undefined } = baz;
-
-[quux = undefined] = quuux;
-
-(foo = undefined) => {};
-
-class Foo {
-    bar = undefined;
-}
-```
-
-## When Not To Use It
-
-There is one situation where initializing to `undefined` behaves differently than omitting the initialization, and that's when a `var` declaration occurs inside of a loop. For example:
-
-Example of **incorrect** code for this rule:
-
-```js
-for (i = 0; i < 10; i++) {
-    var x = undefined;
-    console.log(x);
-    x = i;
-}
-```
-
-In this case, the `var x` is hoisted out of the loop, effectively creating:
-
-```js
-var x;
-
-for (i = 0; i < 10; i++) {
-    x = undefined;
-    console.log(x);
-    x = i;
-}
-```
-
-If you were to remove the initialization, then the behavior of the loop changes:
-
-```js
-for (i = 0; i < 10; i++) {
-    var x;
-    console.log(x);
-    x = i;
-}
-```
-
-This code is equivalent to:
-
-```js
-var x;
-
-for (i = 0; i < 10; i++) {
-    console.log(x);
-    x = i;
-}
-```
-
-This produces a different outcome than defining `var x = undefined` in the loop, as `x` is no longer reset to `undefined` each time through the loop.
-
-If you're using such an initialization inside of a loop, then you should disable this rule.
-
-Example of **correct** code for this rule, because it is disabled on a specific line:
-
-```js
-/*eslint no-undef-init: "error"*/
-
-for (i = 0; i < 10; i++) {
-    var x = undefined; // eslint-disable-line no-undef-init
-    console.log(x);
-    x = i;
-}
-```
-
-## Related Rules
-
-* [no-undefined](no-undefined.md)
-* [no-void](no-void.md)
diff --git a/eslint/docs/rules/no-undef.md b/eslint/docs/rules/no-undef.md
deleted file mode 100644 (file)
index a7de805..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# Disallow Undeclared Variables (no-undef)
-
-This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the `var` keyword in a `for` loop initializer).
-
-## Rule Details
-
-Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](https://eslint.org/docs/user-guide/configuring#specifying-globals). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-undef: "error"*/
-
-var foo = someFunction();
-var bar = a + 1;
-```
-
-Examples of **correct** code for this rule with `global` declaration:
-
-```js
-/*global someFunction, a*/
-/*eslint no-undef: "error"*/
-
-var foo = someFunction();
-var bar = a + 1;
-```
-
-Note that this rule does not disallow assignments to read-only global variables.
-See [no-global-assign](no-global-assign.md) if you also want to disallow those assignments.
-
-This rule also does not disallow redeclarations of global variables.
-See [no-redeclare](no-redeclare.md) if you also want to disallow those redeclarations.
-
-## Options
-
-* `typeof` set to true will warn for variables used inside typeof check (Default false).
-
-### typeof
-
-Examples of **correct** code for the default `{ "typeof": false }` option:
-
-```js
-/*eslint no-undef: "error"*/
-
-if (typeof UndefinedIdentifier === "undefined") {
-    // do something ...
-}
-```
-
-You can use this option if you want to prevent `typeof` check on a variable which has not been declared.
-
-Examples of **incorrect** code for the `{ "typeof": true }` option:
-
-```js
-/*eslint no-undef: ["error", { "typeof": true }] */
-
-if(typeof a === "string"){}
-```
-
-Examples of **correct** code for the `{ "typeof": true }` option with `global` declaration:
-
-```js
-/*global a*/
-/*eslint no-undef: ["error", { "typeof": true }] */
-
-if(typeof a === "string"){}
-```
-
-## Environments
-
-For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in [Specifying Environments](../user-guide/configuring/language-options.md#specifying-environments).  A few examples are given below.
-
-### browser
-
-Examples of **correct** code for this rule with `browser` environment:
-
-```js
-/*eslint no-undef: "error"*/
-/*eslint-env browser*/
-
-setTimeout(function() {
-    alert("Hello");
-});
-```
-
-### Node.js
-
-Examples of **correct** code for this rule with `node` environment:
-
-```js
-/*eslint no-undef: "error"*/
-/*eslint-env node*/
-
-var fs = require("fs");
-module.exports = function() {
-    console.log(fs);
-};
-```
-
-## When Not To Use It
-
-If explicit declaration of global variables is not to your taste.
-
-## Compatibility
-
-This rule provides compatibility with treatment of global variables in [JSHint](http://jshint.com/) and [JSLint](http://www.jslint.com).
-
-## Related Rules
-
-* [no-global-assign](no-global-assign.md)
-* [no-redeclare](no-redeclare.md)
diff --git a/eslint/docs/rules/no-undefined.md b/eslint/docs/rules/no-undefined.md
deleted file mode 100644 (file)
index 0e67c21..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# Disallow Use of `undefined` Variable (no-undefined)
-
-The `undefined` variable in JavaScript is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of `undefined`. While ECMAScript 5 disallows overwriting `undefined`, it's still possible to shadow `undefined`, such as:
-
-```js
-function doSomething(data) {
-    var undefined = "hi";
-
-    // doesn't do what you think it does
-    if (data === undefined) {
-        // ...
-    }
-
-}
-```
-
-Because `undefined` can be overwritten or shadowed, reading `undefined` can give an unexpected value. (This is not the case for `null`, which is a keyword that always produces the same value.) To guard against this, you can avoid all uses of `undefined`, which is what some style guides recommend and what this rule enforces. Those style guides then also recommend:
-
-* Variables that should be `undefined` are simply left uninitialized. (All uninitialized variables automatically get the value of `undefined` in JavaScript.)
-* Checking if a value is `undefined` should be done with `typeof`.
-* Using the `void` operator to generate the value of `undefined` if necessary.
-
-As an alternative, you can use the [no-global-assign](no-global-assign.md) and [no-shadow-restricted-names](no-shadow-restricted-names.md) rules to prevent `undefined` from being shadowed or assigned a different value. This ensures that `undefined` will always hold its original, expected value.
-
-## Rule Details
-
-This rule aims to eliminate the use of `undefined`, and as such, generates a warning whenever it is used.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-undefined: "error"*/
-
-var foo = undefined;
-
-var undefined = "foo";
-
-if (foo === undefined) {
-    // ...
-}
-
-function foo(undefined) {
-    // ...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-undefined: "error"*/
-
-var foo = void 0;
-
-var Undefined = "foo";
-
-if (typeof foo === "undefined") {
-    // ...
-}
-
-global.undefined = "foo";
-```
-
-## When Not To Use It
-
-If you want to allow the use of `undefined` in your code, then you can safely turn this rule off.
-
-## Further Reading
-
-* [undefined - JavaScript \| MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)
-* [Understanding JavaScript’s ‘undefined’ \| JavaScript, JavaScript...](https://javascriptweblog.wordpress.com/2010/08/16/understanding-undefined-and-preventing-referenceerrors/)
-* [ECMA262 edition 5.1 &sect;15.1.1.3: undefined](https://es5.github.io/#x15.1.1.3)
-
-## Related Rules
-
-* [no-undef-init](no-undef-init.md)
-* [no-void](no-void.md)
-* [no-shadow-restricted-names](no-shadow-restricted-names.md)
-* [no-global-assign](no-global-assign.md)
diff --git a/eslint/docs/rules/no-underscore-dangle.md b/eslint/docs/rules/no-underscore-dangle.md
deleted file mode 100644 (file)
index ded4281..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-# disallow dangling underscores in identifiers (no-underscore-dangle)
-
-As far as naming conventions for identifiers go, dangling underscores may be the most polarizing in JavaScript. Dangling underscores are underscores at either the beginning or end of an identifier, such as:
-
-```js
-var _foo;
-```
-
-There is actually a long history of using dangling underscores to indicate "private" members of objects in JavaScript (though JavaScript doesn't have truly private members, this convention served as a warning). This began with SpiderMonkey adding nonstandard methods such as `__defineGetter__()`. The intent with the underscores was to make it obvious that this method was special in some way. Since that time, using a single underscore prefix has become popular as a way to indicate "private" members of objects.
-
-Whether or not you choose to allow dangling underscores in identifiers is purely a convention and has no effect on performance, readability, or complexity. It's purely a preference.
-
-## Rule Details
-
-This rule disallows dangling underscores in identifiers.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-underscore-dangle: "error"*/
-
-var foo_;
-var __proto__ = {};
-foo._bar();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-underscore-dangle: "error"*/
-
-var _ = require('underscore');
-var obj = _.contains(items, item);
-obj.__proto__ = {};
-var file = __filename;
-function foo(_bar) {};
-const foo = { onClick(_bar) {} };
-const foo = (_bar) => {};
-```
-
-## Options
-
-This rule has an object option:
-
--  `"allow"` allows specified identifiers to have dangling underscores
--  `"allowAfterThis": false` (default) disallows dangling underscores in members of the `this` object
--  `"allowAfterSuper": false` (default) disallows dangling underscores in members of the `super` object
--  `"allowAfterThisConstructor": false` (default) disallows dangling underscores in members of the `this.constructor` object
--  `"enforceInMethodNames": false` (default) allows dangling underscores in method names
--  `"allowFunctionParams": true` (default) allows dangling underscores in function parameter names
-
-### allow
-
-Examples of additional **correct** code for this rule with the `{ "allow": ["foo_", "_bar"] }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "allow": ["foo_", "_bar"] }]*/
-
-var foo_;
-foo._bar();
-```
-
-### allowAfterThis
-
-Examples of **correct** code for this rule with the `{ "allowAfterThis": true }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "allowAfterThis": true }]*/
-
-var a = this.foo_;
-this._bar();
-```
-
-### allowAfterSuper
-
-Examples of **correct** code for this rule with the `{ "allowAfterSuper": true }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "allowAfterSuper": true }]*/
-
-var a = super.foo_;
-super._bar();
-```
-
-### allowAfterThisConstructor
-
-Examples of **correct** code for this rule with the `{ "allowAfterThisConstructor": true }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "allowAfterThisConstructor": true }]*/
-
-var a = this.constructor.foo_;
-this.constructor._bar();
-```
-
-### enforceInMethodNames
-
-Examples of **incorrect** code for this rule with the `{ "enforceInMethodNames": true }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "enforceInMethodNames": true }]*/
-
-class Foo {
-  _bar() {}
-}
-
-class Foo {
-  bar_() {}
-}
-
-const o = {
-  _bar() {}
-};
-
-const o = {
-  bar_() = {}
-};
-```
-
-### allowFunctionParams
-
-Examples of **incorrect** code for this rule with the `{ "allowFunctionParams": false }` option:
-
-```js
-/*eslint no-underscore-dangle: ["error", { "allowFunctionParams": false }]*/
-
-function foo (_bar) {}
-function foo (_bar = 0) {}
-function foo (..._bar) {}
-
-const foo = function onClick (_bar) {}
-const foo = function onClick (_bar = 0) {}
-const foo = function onClick (..._bar) {}
-
-const foo = (_bar) => {};
-const foo = (_bar = 0) => {};
-const foo = (..._bar) => {};
-```
-
-## When Not To Use It
-
-If you want to allow dangling underscores in identifiers, then you can safely turn this rule off.
diff --git a/eslint/docs/rules/no-unexpected-multiline.md b/eslint/docs/rules/no-unexpected-multiline.md
deleted file mode 100644 (file)
index a328f83..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# disallow confusing multiline expressions (no-unexpected-multiline)
-
-Semicolons are usually optional in JavaScript, because of automatic semicolon insertion (ASI). You can require or disallow semicolons with the [semi](./semi.md) rule.
-
-The rules for ASI are relatively straightforward: As once described by Isaac Schlueter, a newline character always ends a statement, just like a semicolon, **except** where one of the following is true:
-
-* The statement has an unclosed paren, array literal, or object literal or ends in some other way that is not a valid way to end a statement. (For instance, ending with `.` or `,`.)
-* The line is `--` or `++` (in which case it will decrement/increment the next token.)
-* It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{`
-* The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other binary operator that can only be found between two tokens in a single expression.
-
-In the exceptions where a newline does **not** end a statement, a typing mistake to omit a semicolon causes two unrelated consecutive lines to be interpreted as one expression. Especially for a coding style without semicolons, readers might overlook the mistake. Although syntactically correct, the code might throw exceptions when it is executed.
-
-## Rule Details
-
-This rule disallows confusing multiline expressions where a newline looks like it is ending a statement, but is not.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unexpected-multiline: "error"*/
-
-var foo = bar
-(1 || 2).baz();
-
-var hello = 'world'
-[1, 2, 3].forEach(addNumber);
-
-let x = function() {}
-`hello`
-
-let x = function() {}
-x
-`hello`
-
-let x = foo
-/regex/g.test(bar)
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unexpected-multiline: "error"*/
-
-var foo = bar;
-(1 || 2).baz();
-
-var foo = bar
-;(1 || 2).baz()
-
-var hello = 'world';
-[1, 2, 3].forEach(addNumber);
-
-var hello = 'world'
-void [1, 2, 3].forEach(addNumber);
-
-let x = function() {};
-`hello`
-
-let tag = function() {}
-tag `hello`
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are confident that you will not accidentally introduce code like this.
-
-Note that the patterns considered problems are **not** flagged by the [semi](semi.md) rule.
-
-## Related Rules
-
-* [func-call-spacing](func-call-spacing.md)
-* [semi](semi.md)
-* [space-unary-ops](space-unary-ops.md)
diff --git a/eslint/docs/rules/no-unmodified-loop-condition.md b/eslint/docs/rules/no-unmodified-loop-condition.md
deleted file mode 100644 (file)
index 7d9bcee..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-# Disallow unmodified conditions of loops (no-unmodified-loop-condition)
-
-Variables in a loop condition often are modified in the loop.
-If not, it's possibly a mistake.
-
-```js
-while (node) {
-    doSomething(node);
-}
-```
-
-```js
-while (node) {
-    doSomething(node);
-    node = node.parent;
-}
-```
-
-## Rule Details
-
-This rule finds references which are inside of loop conditions, then checks the
-variables of those references are modified in the loop.
-
-If a reference is inside of a binary expression or a ternary expression, this rule checks the result of
-the expression instead.
-If a reference is inside of a dynamic expression (e.g. `CallExpression`,
-`YieldExpression`, ...), this rule ignores it.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unmodified-loop-condition: "error"*/
-
-var node = something;
-
-while (node) {
-    doSomething(node);
-}
-node = other;
-
-for (var j = 0; j < items.length; ++i) {
-    doSomething(items[j]);
-}
-
-while (node !== root) {
-    doSomething(node);
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unmodified-loop-condition: "error"*/
-
-while (node) {
-    doSomething(node);
-    node = node.parent;
-}
-
-for (var j = 0; j < items.length; ++j) {
-    doSomething(items[j]);
-}
-
-// OK, the result of this binary expression is changed in this loop.
-while (node !== root) {
-    doSomething(node);
-    node = node.parent;
-}
-
-// OK, the result of this ternary expression is changed in this loop.
-while (node ? A : B) {
-    doSomething(node);
-    node = node.parent;
-}
-
-// A property might be a getter which has side effect...
-// Or "doSomething" can modify "obj.foo".
-while (obj.foo) {
-    doSomething(obj);
-}
-
-// A function call can return various values.
-while (check(obj)) {
-    doSomething(obj);
-}
-```
-
-## When Not To Use It
-
-If you don't want to notified about references inside of loop conditions, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/no-unneeded-ternary.md b/eslint/docs/rules/no-unneeded-ternary.md
deleted file mode 100644 (file)
index e5d4e80..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-# disallow ternary operators when simpler alternatives exist (no-unneeded-ternary)
-
-It's a common mistake in JavaScript to use a conditional expression to select between two Boolean values instead of using ! to convert the test to a Boolean.
-Here are some examples:
-
-```js
-// Bad
-var isYes = answer === 1 ? true : false;
-
-// Good
-var isYes = answer === 1;
-
-
-// Bad
-var isNo = answer === 1 ? false : true;
-
-// Good
-var isNo = answer !== 1;
-```
-
-Another common mistake is using a single variable as both the conditional test and the consequent. In such cases, the logical `OR` can be used to provide the same functionality.
-Here is an example:
-
-```js
-// Bad
-foo(bar ? bar : 1);
-
-// Good
-foo(bar || 1);
-```
-
-## Rule Details
-
-This rule disallow ternary operators when simpler alternatives exist.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unneeded-ternary: "error"*/
-
-var a = x === 2 ? true : false;
-
-var a = x ? true : false;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unneeded-ternary: "error"*/
-
-var a = x === 2 ? "Yes" : "No";
-
-var a = x !== false;
-
-var a = x ? "Yes" : "No";
-
-var a = x ? y : x;
-
-f(x ? x : 1); // default assignment - would be disallowed if defaultAssignment option set to false. See option details below.
-```
-
-## Options
-
-This rule has an object option:
-
-* `"defaultAssignment": true` (default) allows the conditional expression as a default assignment pattern
-* `"defaultAssignment": false` disallows the conditional expression as a default assignment pattern
-
-### defaultAssignment
-
-When set to `true`, which it is by default, The defaultAssignment option allows expressions of the form `x ? x : expr` (where `x` is any identifier and `expr` is any expression).
-
-Examples of additional **incorrect** code for this rule with the `{ "defaultAssignment": false }` option:
-
-```js
-/*eslint no-unneeded-ternary: ["error", { "defaultAssignment": false }]*/
-
-var a = x ? x : 1;
-
-f(x ? x : 1);
-```
-
-Note that `defaultAssignment: false` still allows expressions of the form `x ? expr : x` (where the identifier is on the right hand side of the ternary).
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with unnecessary complexity in conditional expressions.
-
-## Related Rules
-
-* [no-ternary](no-ternary.md)
-* [no-nested-ternary](no-nested-ternary.md)
diff --git a/eslint/docs/rules/no-unreachable-loop.md b/eslint/docs/rules/no-unreachable-loop.md
deleted file mode 100644 (file)
index c58b97f..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-# Disallow loops with a body that allows only one iteration (no-unreachable-loop)
-
-A loop that can never reach the second iteration is a possible error in the code.
-
-```js
-for (let i = 0; i < arr.length; i++) {
-    if (arr[i].name === myName) {
-        doSomething(arr[i]);
-        // break was supposed to be here
-    }
-    break;
-}
-```
-
-In rare cases where only one iteration (or at most one iteration) is intended behavior, the code should be refactored to use `if` conditionals instead of `while`, `do-while` and `for` loops. It's considered a best practice to avoid using loop constructs for such cases.
-
-## Rule Details
-
-This rule aims to detect and disallow loops that can have at most one iteration, by performing static code path analysis on loop bodies.
-
-In particular, this rule will disallow a loop with a body that exits the loop in all code paths. If all code paths in the loop's body will end with either a `break`, `return` or a `throw` statement, the second iteration of such loop is certainly unreachable, regardless of the loop's condition.
-
-This rule checks `while`, `do-while`, `for`, `for-in` and `for-of` loops. You can optionally disable checks for each of these constructs.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unreachable-loop: "error"*/
-
-while (foo) {
-    doSomething(foo);
-    foo = foo.parent;
-    break;
-}
-
-function verifyList(head) {
-    let item = head;
-    do {
-        if (verify(item)) {
-            return true;
-        } else {
-            return false;
-        }
-    } while (item);
-}
-
-function findSomething(arr) {
-    for (var i = 0; i < arr.length; i++) {
-        if (isSomething(arr[i])) {
-            return arr[i];
-        } else {
-            throw new Error("Doesn't exist.");
-        }
-    }
-}
-
-for (key in obj) {
-    if (key.startsWith("_")) {
-        break;
-    }
-    firstKey = key;
-    firstValue = obj[key];
-    break;
-}
-
-for (foo of bar) {
-    if (foo.id === id) {
-        doSomething(foo);
-    }
-    break;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unreachable-loop: "error"*/
-
-while (foo) {
-    doSomething(foo);
-    foo = foo.parent;
-}
-
-function verifyList(head) {
-    let item = head;
-    do {
-        if (verify(item)) {
-            item = item.next;
-        } else {
-            return false;
-        }
-    } while (item);
-
-    return true;
-}
-
-function findSomething(arr) {
-    for (var i = 0; i < arr.length; i++) {
-        if (isSomething(arr[i])) {
-            return arr[i];
-        }
-    }
-    throw new Error("Doesn't exist.");
-}
-
-for (key in obj) {
-    if (key.startsWith("_")) {
-        continue;
-    }
-    firstKey = key;
-    firstValue = obj[key];
-    break;
-}
-
-for (foo of bar) {
-    if (foo.id === id) {
-        doSomething(foo);
-        break;
-    }
-}
-```
-
-Please note that this rule is not designed to check loop conditions, and will not warn in cases such as the following examples.
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-unreachable-loop: "error"*/
-
-do {
-    doSomething();
-} while (false)
-
-for (let i = 0; i < 1; i++) {
-    doSomething(i);
-}
-
-for (const a of [1]) {
-    doSomething(a);
-}
-```
-
-## Options
-
-This rule has an object option, with one option:
-
-* `"ignore"` - an optional array of loop types that will be ignored by this rule.
-
-## ignore
-
-You can specify up to 5 different elements in the `"ignore"` array:
-
-* `"WhileStatement"` - to ignore all `while` loops.
-* `"DoWhileStatement"` - to ignore all `do-while` loops.
-* `"ForStatement"` - to ignore all `for` loops (does not apply to `for-in` and `for-of` loops).
-* `"ForInStatement"` - to ignore all `for-in` loops.
-* `"ForOfStatement"` - to ignore all `for-of` loops.
-
-Examples of **correct** code for this rule with the `"ignore"` option:
-
-```js
-/*eslint no-unreachable-loop: ["error", { "ignore": ["ForInStatement", "ForOfStatement"] }]*/
-
-for (var key in obj) {
-  hasEnumerableProperties = true;
-  break;
-}
-
-for (const a of b) break;
-```
-
-## Known Limitations
-
-Static code path analysis, in general, does not evaluate conditions. Due to this fact, this rule might miss reporting cases such as the following:
-
-```js
-for (let i = 0; i < 10; i++) {
-    doSomething(i);
-    if (true) {
-        break;
-    }
-}
-```
-
-## Related Rules
-
-* [no-unreachable](no-unreachable.md)
-* [no-constant-condition](no-constant-condition.md)
-* [no-unmodified-loop-condition](no-unmodified-loop-condition.md)
-* [for-direction](for-direction.md)
diff --git a/eslint/docs/rules/no-unreachable.md b/eslint/docs/rules/no-unreachable.md
deleted file mode 100644 (file)
index 2fe8a69..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-# disallow unreachable code after `return`, `throw`, `continue`, and `break` statements (no-unreachable)
-
-Because the `return`, `throw`, `break`, and `continue` statements unconditionally exit a block of code, any statements after them cannot be executed. Unreachable statements are usually a mistake.
-
-```js
-function fn() {
-    x = 1;
-    return x;
-    x = 3; // this will never execute
-}
-```
-
-Another kind of mistake is defining instance fields in a subclass whose constructor doesn't call `super()`. Instance fields of a subclass are only added to the instance after `super()`. If there are no `super()` calls, their definitions are never applied and therefore are unreachable code.
-
-```js
-class C extends B {
-    #x; // this will never be added to instances
-
-    constructor() {
-        return {};
-    }
-}
-```
-
-## Rule Details
-
-This rule disallows unreachable code after `return`, `throw`, `continue`, and `break` statements. This rule also flags definitions of instance fields in subclasses whose constructors don't have `super()` calls.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unreachable: "error"*/
-
-function foo() {
-    return true;
-    console.log("done");
-}
-
-function bar() {
-    throw new Error("Oops!");
-    console.log("done");
-}
-
-while(value) {
-    break;
-    console.log("done");
-}
-
-throw new Error("Oops!");
-console.log("done");
-
-function baz() {
-    if (Math.random() < 0.5) {
-        return;
-    } else {
-        throw new Error();
-    }
-    console.log("done");
-}
-
-for (;;) {}
-console.log("done");
-```
-
-Examples of **correct** code for this rule, because of JavaScript function and variable hoisting:
-
-```js
-/*eslint no-unreachable: "error"*/
-
-function foo() {
-    return bar();
-    function bar() {
-        return 1;
-    }
-}
-
-function bar() {
-    return x;
-    var x;
-}
-
-switch (foo) {
-    case 1:
-        break;
-        var x;
-}
-```
-
-Examples of additional **incorrect** code for this rule:
-
-```js
-/*eslint no-unreachable: "error"*/
-
-class C extends B {
-    #x; // unreachable
-    #y = 1; // unreachable
-    a; // unreachable
-    b = 1; // unreachable
-
-    constructor() {
-        return {};
-    }
-}
-```
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-unreachable: "error"*/
-
-class D extends B {
-    #x;
-    #y = 1;
-    a;
-    b = 1;
-
-    constructor() {
-        super();
-    }
-}
-
-class E extends B {
-    #x;
-    #y = 1;
-    a;
-    b = 1;
-
-    // implicit constructor always calls `super()`
-}
-
-class F extends B {
-    static #x;
-    static #y = 1;
-    static a;
-    static b = 1;
-
-    constructor() {
-        return {};
-    }
-}
-```
diff --git a/eslint/docs/rules/no-unsafe-finally.md b/eslint/docs/rules/no-unsafe-finally.md
deleted file mode 100644 (file)
index fb3bb1e..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-# disallow control flow statements in `finally` blocks (no-unsafe-finally)
-
-JavaScript suspends the control flow statements of `try` and `catch` blocks until the execution of `finally` block finishes. So, when `return`, `throw`, `break`, or `continue` is used in `finally`, control flow statements inside `try` and `catch` are overwritten, which is considered as unexpected behavior. Such as:
-
-```js
-// We expect this function to return 1;
-(() => {
-    try {
-        return 1; // 1 is returned but suspended until finally block ends
-    } catch(err) {
-        return 2;
-    } finally {
-        return 3; // 3 is returned before 1, which we did not expect
-    }
-})();
-
-// > 3
-```
-
-```js
-// We expect this function to throw an error, then return
-(() => {
-    try {
-        throw new Error("Try"); // error is thrown but suspended until finally block ends
-    } finally {
-        return 3; // 3 is returned before the error is thrown, which we did not expect
-    }
-})();
-
-// > 3
-```
-
-```js
-// We expect this function to throw Try(...) error from the catch block
-(() => {
-    try {
-        throw new Error("Try")
-    } catch(err) {
-        throw err; // The error thrown from try block is caught and rethrown
-    } finally {
-        throw new Error("Finally"); // Finally(...) is thrown, which we did not expect
-    }
-})();
-
-// > Uncaught Error: Finally(...)
-```
-
-```js
-// We expect this function to return 0 from try block.
-(() => {
-  label: try {
-    return 0; // 0 is returned but suspended until finally block ends
-  } finally {
-    break label; // It breaks out the try-finally block, before 0 is returned.
-  }
-  return 1;
-})();
-
-// > 1
-```
-
-## Rule Details
-
-This rule disallows `return`, `throw`, `break`, and `continue` statements inside `finally` blocks. It allows indirect usages, such as in `function` or `class` definitions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unsafe-finally: "error"*/
-let foo = function() {
-    try {
-        return 1;
-    } catch(err) {
-        return 2;
-    } finally {
-        return 3;
-    }
-};
-```
-
-```js
-/*eslint no-unsafe-finally: "error"*/
-let foo = function() {
-    try {
-        return 1;
-    } catch(err) {
-        return 2;
-    } finally {
-        throw new Error;
-    }
-};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unsafe-finally: "error"*/
-let foo = function() {
-    try {
-        return 1;
-    } catch(err) {
-        return 2;
-    } finally {
-        console.log("hola!");
-    }
-};
-```
-
-```js
-/*eslint no-unsafe-finally: "error"*/
-let foo = function() {
-    try {
-        return 1;
-    } catch(err) {
-        return 2;
-    } finally {
-        let a = function() {
-            return "hola!";
-        }
-    }
-};
-```
-
-```js
-/*eslint no-unsafe-finally: "error"*/
-let foo = function(a) {
-    try {
-        return 1;
-    } catch(err) {
-        return 2;
-    } finally {
-        switch(a) {
-            case 1: {
-                console.log("hola!")
-                break;
-            }
-        }
-    }
-};
-```
-
-## When Not To Use It
-
-If you want to allow control flow operations in `finally` blocks, you can turn this rule off.
diff --git a/eslint/docs/rules/no-unsafe-negation.md b/eslint/docs/rules/no-unsafe-negation.md
deleted file mode 100644 (file)
index 38bb9b0..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# disallow negating the left operand of relational operators (no-unsafe-negation)
-
-Just as developers might type `-a + b` when they mean `-(a + b)` for the negative of a sum, they might type `!key in object` by mistake when they almost certainly mean `!(key in object)` to test that a key is not in an object. `!obj instanceof Ctor` is similar.
-
-## Rule Details
-
-This rule disallows negating the left operand of the following relational operators:
-
-- [`in` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in).
-- [`instanceof` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unsafe-negation: "error"*/
-
-if (!key in object) {
-    // operator precedence makes it equivalent to (!key) in object
-    // and type conversion makes it equivalent to (key ? "false" : "true") in object
-}
-
-if (!obj instanceof Ctor) {
-    // operator precedence makes it equivalent to (!obj) instanceof Ctor
-    // and it equivalent to always false since boolean values are not objects.
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unsafe-negation: "error"*/
-
-if (!(key in object)) {
-    // key is not in object
-}
-
-if (!(obj instanceof Ctor)) {
-    // obj is not an instance of Ctor
-}
-```
-
-### Exception
-
-For rare situations when negating the left operand is intended, this rule allows an exception.
-If the whole negation is explicitly wrapped in parentheses, the rule will not report a problem.
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unsafe-negation: "error"*/
-
-if ((!foo) in object) {
-    // allowed, because the negation is explicitly wrapped in parentheses
-    // it is equivalent to (foo ? "false" : "true") in object
-    // this is allowed as an exception for rare situations when that is the intended meaning
-}
-
-if(("" + !foo) in object) {
-    // you can also make the intention more explicit, with type conversion
-}
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unsafe-negation: "error"*/
-
-if (!(foo) in object) {
-    // this is not an allowed exception
-}
-```
-
-## Options
-
-This rule has an object option:
-
-- `"enforceForOrderingRelations": false` (default) allows negation of the left-hand side of ordering relational operators (`<`, `>`, `<=`, `>=`)
-- `"enforceForOrderingRelations": true` disallows negation of the left-hand side of ordering relational operators
-
-### enforceForOrderingRelations
-
-With this option set to `true` the rule is additionally enforced for:
-
-- `<` operator.
-- `>` operator.
-- `<=` operator.
-- `>=` operator.
-
-The purpose is to avoid expressions such as `! a < b` (which is equivalent to `(a ? 0 : 1) < b`) when what is really intended is `!(a < b)`.
-
-Examples of additional **incorrect** code for this rule with the `{ "enforceForOrderingRelations": true }` option:
-
-```js
-/*eslint no-unsafe-negation: ["error", { "enforceForOrderingRelations": true }]*/
-
-if (! a < b) {}
-
-while (! a > b) {}
-
-foo = ! a <= b;
-
-foo = ! a >= b;
-```
-
-## When Not To Use It
-
-If you don't want to notify unsafe logical negations, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/no-unsafe-optional-chaining.md b/eslint/docs/rules/no-unsafe-optional-chaining.md
deleted file mode 100644 (file)
index 49fa415..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-# disallow use of optional chaining in contexts where the `undefined` value is not allowed (no-unsafe-optional-chaining)
-
-The optional chaining (`?.`) expression can short-circuit with a return value of `undefined`. Therefore, treating an evaluated optional chaining expression as a function, object, number, etc., can cause TypeError or unexpected results. For example:
-
-```js
-var obj = undefined;
-
-1 in obj?.foo;  // TypeError
-with (obj?.foo);  // TypeError
-for (bar of obj?.foo);  // TypeError
-bar instanceof obj?.foo;  // TypeError
-const { bar } = obj?.foo;  // TypeError
-```
-
-Also, parentheses limit the scope of short-circuiting in chains. For example:
-
-```js
-var obj = undefined;
-
-(obj?.foo)(); // TypeError
-(obj?.foo).bar; // TypeError
-```
-
-## Rule Details
-
-This rule aims to detect some cases where the use of optional chaining doesn't prevent runtime errors. In particular, it flags optional chaining expressions in positions where short-circuiting to `undefined` causes throwing a TypeError afterward.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unsafe-optional-chaining: "error"*/
-
-(obj?.foo)();
-
-(obj?.foo).bar;
-
-(foo?.()).bar;
-
-(foo?.()).bar();
-
-(obj?.foo ?? obj?.bar)();
-
-(foo || obj?.foo)();
-
-(obj?.foo && foo)();
-
-(foo ? obj?.foo : bar)();
-
-(foo, obj?.bar).baz;
-
-(obj?.foo)`template`;
-
-new (obj?.foo)();
-
-[...obj?.foo];
-
-bar(...obj?.foo);
-
-1 in obj?.foo;
-
-bar instanceof obj?.foo;
-
-for (bar of obj?.foo);
-
-const { bar } = obj?.foo;
-
-[{ bar } = obj?.foo] = [];
-
-with (obj?.foo);
-
-class A extends obj?.foo {}
-
-var a = class A extends obj?.foo {};
-
-async function foo () {
-    const { bar } = await obj?.foo;
-   (await obj?.foo)();
-   (await obj?.foo).bar;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unsafe-optional-chaining: "error"*/
-
-(obj?.foo)?.();
-
-obj?.foo();
-
-(obj?.foo ?? bar)();
-
-obj?.foo.bar;
-
-obj.foo?.bar;
-
-foo?.()?.bar;
-
-(obj?.foo ?? bar)`template`;
-
-new (obj?.foo ?? bar)();
-
-var baz = {...obj?.foo};
-
-const { bar } = obj?.foo || baz;
-
-async function foo () {
-  const { bar } = await obj?.foo || baz;
-   (await obj?.foo)?.();
-   (await obj?.foo)?.bar;
-}
-```
-
-## Options
-
-This rule has an object option:
-
-- `disallowArithmeticOperators`: Disallow arithmetic operations on optional chaining expressions (Default `false`). If this is `true`, this rule warns arithmetic operations on optional chaining expressions, which possibly result in `NaN`.
-
-### disallowArithmeticOperators
-
-With this option set to `true` the rule is enforced for:
-
-- Unary operators: `-`, `+`
-- Arithmetic operators: `+`, `-`, `/`, `*`, `%`, `**`
-- Assignment operators: `+=`, `-=`, `/=`, `*=`, `%=`, `**=`
-
-Examples of additional **incorrect** code for this rule with the `{ "disallowArithmeticOperators": true }` option:
-
-```js
-/*eslint no-unsafe-optional-chaining: ["error", { "disallowArithmeticOperators": true }]*/
-
-+obj?.foo;
--obj?.foo;
-
-obj?.foo + bar;
-obj?.foo - bar;
-obj?.foo / bar;
-obj?.foo * bar;
-obj?.foo % bar;
-obj?.foo ** bar;
-
-baz += obj?.foo;
-baz -= obj?.foo;
-baz /= obj?.foo;
-baz *= obj?.foo;
-baz %= obj?.foo;
-baz **= obj?.foo;
-
-async function foo () {
-  +await obj?.foo;
-  await obj?.foo + bar;
-  baz += await obj?.foo;
-}
-```
diff --git a/eslint/docs/rules/no-unused-expressions.md b/eslint/docs/rules/no-unused-expressions.md
deleted file mode 100644 (file)
index 89cfb33..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-# Disallow Unused Expressions (no-unused-expressions)
-
-An unused expression which has no effect on the state of the program indicates a logic error.
-
-For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. Sometimes, such unused expressions may be eliminated by some build tools in production environment, which possibly breaks application logic.
-
-## Rule Details
-
-This rule aims to eliminate unused expressions which have no effect on the state of the program.
-
-This rule does not apply to function calls or constructor calls with the `new` operator, because they could have *side effects* on the state of the program.
-
-```js
-var i = 0;
-function increment() { i += 1; }
-increment(); // return value is unused, but i changed as a side effect
-
-var nThings = 0;
-function Thing() { nThings += 1; }
-new Thing(); // constructed object is unused, but nThings changed as a side effect
-```
-
-This rule does not apply to directives (which are in the form of literal string expressions such as `"use strict";` at the beginning of a script, module, or function).
-
-Sequence expressions (those using a comma, such as `a = 1, b = 2`) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.
-
-## Options
-
-This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:
-
-* `allowShortCircuit` set to `true` will allow you to use short circuit evaluations in your expressions (Default: `false`).
-* `allowTernary` set to `true` will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: `false`).
-* `allowTaggedTemplates` set to `true` will enable you to use tagged template literals in your expressions (Default: `false`).
-* `enforceForJSX` set to `true` will flag unused JSX element expressions (Default: `false`).
-
-These options allow unused expressions *only if all* of the code paths either directly change the state (for example, assignment statement) or could have *side effects* (for example, function call).
-
-Examples of **incorrect** code for the default `{ "allowShortCircuit": false, "allowTernary": false }` options:
-
-```js
-/*eslint no-unused-expressions: "error"*/
-
-0
-
-if(0) 0
-
-{0}
-
-f(0), {}
-
-a && b()
-
-a, b()
-
-c = a, b;
-
-a() && function namedFunctionInExpressionContext () {f();}
-
-(function anIncompleteIIFE () {});
-
-injectGlobal`body{ color: red; }`
-
-```
-
-Examples of **correct** code for the default `{ "allowShortCircuit": false, "allowTernary": false }` options:
-
-```js
-/*eslint no-unused-expressions: "error"*/
-
-{} // In this context, this is a block statement, not an object literal
-
-{myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
-
-function namedFunctionDeclaration () {}
-
-(function aGenuineIIFE () {}());
-
-f()
-
-a = 0
-
-new C
-
-delete a.b
-
-void a
-```
-
-Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.
-
-Examples of **correct** code for this rule in regard to directives:
-
-```js
-/*eslint no-unused-expressions: "error"*/
-
-"use strict";
-"use asm"
-"use stricter";
-"use babel"
-"any other strings like this in the directive prologue";
-"this is still the directive prologue";
-
-function foo() {
-    "bar";
-}
-
-class Foo {
-    someMethod() {
-        "use strict";
-    }
-}
-```
-
-Examples of **incorrect** code for this rule in regard to directives:
-
-```js
-/*eslint no-unused-expressions: "error"*/
-
-doSomething();
-"use strict"; // this isn't in a directive prologue, because there is a non-directive statement before it
-
-function foo() {
-    "bar" + 1;
-}
-
-class Foo {
-    static {
-        "use strict"; // class static blocks do not have directive prologues
-    }
-}
-```
-
-### allowShortCircuit
-
-Examples of **incorrect** code for the `{ "allowShortCircuit": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
-
-a || b
-```
-
-Examples of **correct** code for the `{ "allowShortCircuit": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
-
-a && b()
-a() || (b = c)
-```
-
-### allowTernary
-
-Examples of **incorrect** code for the `{ "allowTernary": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
-
-a ? b : 0
-a ? b : c()
-```
-
-Examples of **correct** code for the `{ "allowTernary": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
-
-a ? b() : c()
-a ? (b = c) : d()
-```
-
-### allowShortCircuit and allowTernary
-
-Examples of **correct** code for the `{ "allowShortCircuit": true, "allowTernary": true }` options:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
-
-a ? b() || (c = d) : e()
-```
-
-### allowTaggedTemplates
-
-Examples of **incorrect** code for the `{ "allowTaggedTemplates": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
-
-`some untagged template string`;
-```
-
-Examples of **correct** code for the `{ "allowTaggedTemplates": true }` option:
-
-```js
-/*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
-
-tag`some tagged template string`;
-```
-
-### enforceForJSX
-
-JSX is most-commonly used in the React ecosystem, where it is compiled to `React.createElement` expressions. Though free from side-effects, these calls are not automatically flagged by the `no-unused-expression` rule. If you're using React, or any other side-effect-free JSX pragma, this option can be enabled to flag these expressions.
-
-Examples of **incorrect** code for the `{ "enforceForJSX": true }` option:
-
-```jsx
-/*eslint no-unused-expressions: ["error", { "enforceForJSX": true }]*/
-
-<MyComponent />;
-
-<></>;
-```
-
-Examples of **correct** code for the `{ "enforceForJSX": true }` option:
-
-```jsx
-/*eslint no-unused-expressions: ["error", { "enforceForJSX": true }]*/
-
-var myComponentPartial = <MyComponent />;
-
-var myFragment = <></>;
-```
diff --git a/eslint/docs/rules/no-unused-labels.md b/eslint/docs/rules/no-unused-labels.md
deleted file mode 100644 (file)
index 97b21ba..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# Disallow Unused Labels (no-unused-labels)
-
-Labels that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring.
-
-```js
-OUTER_LOOP:
-for (const student of students) {
-    if (checkScores(student.scores)) {
-        continue;
-    }
-    doSomething(student);
-}
-```
-
-In this case, probably removing `OUTER_LOOP:` had been forgotten.
-Such labels take up space in the code and can lead to confusion by readers.
-
-## Rule Details
-
-This rule is aimed at eliminating unused labels.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unused-labels: "error"*/
-
-A: var foo = 0;
-
-B: {
-    foo();
-}
-
-C:
-for (let i = 0; i < 10; ++i) {
-    foo();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unused-labels: "error"*/
-
-A: {
-    if (foo()) {
-        break A;
-    }
-    bar();
-}
-
-B:
-for (let i = 0; i < 10; ++i) {
-    if (foo()) {
-        break B;
-    }
-    bar();
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unused labels, then it's safe to disable this rule.
-
-## Related Rules
-
-* [no-extra-label](./no-extra-label.md)
-* [no-labels](./no-labels.md)
-* [no-label-var](./no-label-var.md)
diff --git a/eslint/docs/rules/no-unused-private-class-members.md b/eslint/docs/rules/no-unused-private-class-members.md
deleted file mode 100644 (file)
index 2eb9f4b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# Disallow Unused Private Class Members (no-unused-private-class-members)
-
-Private class members that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such class members take up space in the code and can lead to confusion by readers.
-
-## Rule Details
-
-This rule reports unused private class members.
-
-* A private field or method is considered to be unused if its value is never read.
-* A private accessor is considered to be unused if it is never accessed (read or write).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unused-private-class-members: "error"*/
-
-class Foo {
-    #unusedMember = 5;
-}
-
-class Foo {
-    #usedOnlyInWrite = 5;
-    method() {
-        this.#usedOnlyInWrite = 42;
-    }
-}
-
-class Foo {
-    #usedOnlyToUpdateItself = 5;
-    method() {
-        this.#usedOnlyToUpdateItself++;
-    }
-}
-
-class Foo {
-    #unusedMethod() {}
-}
-
-class Foo {
-    get #unusedAccessor() {}
-    set #unusedAccessor(value) {}
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unused-private-class-members: "error"*/
-
-class Foo {
-    #usedMember = 42;
-    method() {
-        return this.#usedMember;
-    }
-}
-
-class Foo {
-    #usedMethod() {
-        return 42;
-    }
-    anotherMethod() {
-        return this.#usedMethod();
-    }
-}
-
-class Foo {
-    get #usedAccessor() {}
-    set #usedAccessor(value) {}
-    
-    method() {
-        this.#usedAccessor = 42;
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unused private class members, you can safely turn this rule off.
diff --git a/eslint/docs/rules/no-unused-vars.md b/eslint/docs/rules/no-unused-vars.md
deleted file mode 100644 (file)
index 24eb337..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-# Disallow Unused Variables (no-unused-vars)
-
-Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers.
-
-## Rule Details
-
-This rule is aimed at eliminating unused variables, functions, and function parameters.
-
-A variable `foo` is considered to be used if any of the following are true:
-
-* It is called (`foo()`) or constructed (`new foo()`)
-* It is read (`var bar = foo`)
-* It is passed into a function as an argument (`doSomething(foo)`)
-* It is read inside of a function that is passed to another function (`doSomething(function() { foo(); })`)
-
-A variable is *not* considered to be used if it is only ever declared (`var foo = 5`) or assigned to (`foo = 7`).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-unused-vars: "error"*/
-/*global some_unused_var*/
-
-// It checks variables you have defined as global
-some_unused_var = 42;
-
-var x;
-
-// Write-only variables are not considered as used.
-var y = 10;
-y = 5;
-
-// A read for a modification of itself is not considered as used.
-var z = 0;
-z = z + 1;
-
-// By default, unused arguments cause warnings.
-(function(foo) {
-    return 5;
-})();
-
-// Unused recursive functions also cause warnings.
-function fact(n) {
-    if (n < 2) return 1;
-    return n * fact(n - 1);
-}
-
-// When a function definition destructures an array, unused entries from the array also cause warnings.
-function getY([x, y]) {
-    return y;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-unused-vars: "error"*/
-
-var x = 10;
-alert(x);
-
-// foo is considered used here
-myFunc(function foo() {
-    // ...
-}.bind(this));
-
-(function(foo) {
-    return foo;
-})();
-
-var myFunc;
-myFunc = setTimeout(function() {
-    // myFunc is considered used
-    myFunc();
-}, 50);
-
-// Only the second argument from the destructured array is used.
-function getY([, y]) {
-    return y;
-}
-```
-
-### exported
-
-In environments outside of CommonJS or ECMAScript modules, you may use `var` to create a global variable that may be used by other scripts. You can use the `/* exported variableName */` comment block to indicate that this variable is being exported and therefore should not be considered unused.
-
-Note that `/* exported */` has no effect for any of the following:
-
-* when the environment is `node` or `commonjs`
-* when `parserOptions.sourceType` is `module`
-* when `ecmaFeatures.globalReturn` is `true`
-
-The line comment `// exported variableName` will not work as `exported` is not line-specific.
-
-Examples of **correct** code for `/* exported variableName */` operation:
-
-```js
-/* exported global_var */
-
-var global_var = 42;
-```
-
-## Options
-
-This rule takes one argument which can be a string or an object. The string settings are the same as those of the `vars` property (explained below).
-
-By default this rule is enabled with `all` option for variables and `after-used` for arguments.
-
-```json
-{
-    "rules": {
-        "no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
-    }
-}
-```
-
-### vars
-
-The `vars` option has two settings:
-
-* `all` checks all variables for usage, including those in the global scope. This is the default setting.
-* `local` checks only that locally-declared variables are used but will allow global variables to be unused.
-
-#### vars: local
-
-Examples of **correct** code for the `{ "vars": "local" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "vars": "local" }]*/
-/*global some_unused_var */
-
-some_unused_var = 42;
-```
-
-### varsIgnorePattern
-
-The `varsIgnorePattern` option specifies exceptions not to check for usage: variables whose names match a regexp pattern. For example, variables whose names contain `ignored` or `Ignored`.
-
-Examples of **correct** code for the `{ "varsIgnorePattern": "[iI]gnored" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "[iI]gnored" }]*/
-
-var firstVarIgnored = 1;
-var secondVar = 2;
-console.log(secondVar);
-```
-
-### args
-
-The `args` option has three settings:
-
-* `after-used` - unused positional arguments that occur before the last used argument will not be checked, but all named arguments and all positional arguments after the last used argument will be checked.
-* `all` - all named arguments must be used.
-* `none` - do not check arguments.
-
-#### args: after-used
-
-Examples of **incorrect** code for the default `{ "args": "after-used" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "args": "after-used" }]*/
-
-// 2 errors, for the parameters after the last used parameter (bar)
-// "baz" is defined but never used
-// "qux" is defined but never used
-(function(foo, bar, baz, qux) {
-    return bar;
-})();
-```
-
-Examples of **correct** code for the default `{ "args": "after-used" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", {"args": "after-used"}]*/
-
-(function(foo, bar, baz, qux) {
-    return qux;
-})();
-```
-
-#### args: all
-
-Examples of **incorrect** code for the `{ "args": "all" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "args": "all" }]*/
-
-// 2 errors
-// "foo" is defined but never used
-// "baz" is defined but never used
-(function(foo, bar, baz) {
-    return bar;
-})();
-```
-
-#### args: none
-
-Examples of **correct** code for the `{ "args": "none" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "args": "none" }]*/
-
-(function(foo, bar, baz) {
-    return bar;
-})();
-```
-
-### ignoreRestSiblings
-
-The `ignoreRestSiblings` option is a boolean (default: `false`). Using a [Rest Property](https://github.com/tc39/proposal-object-rest-spread) it is possible to "omit" properties from an object, but by default the sibling properties are marked as "unused". With this option enabled the rest property's siblings are ignored.
-
-Examples of **correct** code for the `{ "ignoreRestSiblings": true }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
-// 'foo' and 'bar' were ignored because they have a rest property sibling.
-var { foo, ...coords } = data;
-
-var bar;
-({ bar, ...coords } = data);
-```
-
-### argsIgnorePattern
-
-The `argsIgnorePattern` option specifies exceptions not to check for usage: arguments whose names match a regexp pattern. For example, variables whose names begin with an underscore.
-
-Examples of **correct** code for the `{ "argsIgnorePattern": "^_" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
-
-function foo(x, _y) {
-    return x + 1;
-}
-foo();
-```
-
-### caughtErrors
-
-The `caughtErrors` option is used for `catch` block arguments validation.
-
-It has two settings:
-
-* `none` - do not check error objects. This is the default setting.
-* `all` - all named arguments must be used.
-
-#### caughtErrors: none
-
-Not specifying this rule is equivalent of assigning it to `none`.
-
-Examples of **correct** code for the `{ "caughtErrors": "none" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "caughtErrors": "none" }]*/
-
-try {
-    //...
-} catch (err) {
-    console.error("errors");
-}
-```
-
-#### caughtErrors: all
-
-Examples of **incorrect** code for the `{ "caughtErrors": "all" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "caughtErrors": "all" }]*/
-
-// 1 error
-// "err" is defined but never used
-try {
-    //...
-} catch (err) {
-    console.error("errors");
-}
-```
-
-### caughtErrorsIgnorePattern
-
-The `caughtErrorsIgnorePattern` option specifies exceptions not to check for usage: catch arguments whose names match a regexp pattern. For example, variables whose names begin with a string 'ignore'.
-
-Examples of **correct** code for the `{ "caughtErrorsIgnorePattern": "^ignore" }` option:
-
-```js
-/*eslint no-unused-vars: ["error", { "caughtErrorsIgnorePattern": "^ignore" }]*/
-
-try {
-    //...
-} catch (ignoreErr) {
-    console.error("errors");
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unused variables or function arguments, you can safely turn this rule off.
diff --git a/eslint/docs/rules/no-use-before-define.md b/eslint/docs/rules/no-use-before-define.md
deleted file mode 100644 (file)
index 8af260e..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-# Disallow Early Use (no-use-before-define)
-
-In JavaScript, prior to ES6, variable and function declarations are hoisted to the top of a scope, so it's possible to use identifiers before their formal declarations in code. This can be confusing and some believe it is best to always declare variables and functions before using them.
-
-In ES6, block-level bindings (`let` and `const`) introduce a "temporal dead zone" where a `ReferenceError` will be thrown with any attempt to access the variable before its declaration.
-
-## Rule Details
-
-This rule will warn when it encounters a reference to an identifier that has not yet been declared.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-use-before-define: "error"*/
-
-alert(a);
-var a = 10;
-
-f();
-function f() {}
-
-function g() {
-    return b;
-}
-var b = 1;
-
-{
-    alert(c);
-    let c = 1;
-}
-
-{
-    class C extends C {}
-}
-
-{
-    class C {
-        static x = "foo";
-        [C.x]() {}
-    }
-}
-
-{
-    const C = class {
-        static x = C;
-    }
-}
-
-{
-    const C = class {
-        static {
-            C.x = "foo";
-        }
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-use-before-define: "error"*/
-
-var a;
-a = 10;
-alert(a);
-
-function f() {}
-f(1);
-
-var b = 1;
-function g() {
-    return b;
-}
-
-{
-    let c;
-    c++;
-}
-
-{
-    class C {
-        static x = C;
-    }
-}
-
-{
-    const C = class C {
-        static x = C;
-    }
-}
-
-{
-    const C = class {
-        x = C;
-    }
-}
-
-{
-    const C = class C {
-        static {
-            C.x = "foo";
-        }
-    }
-}
-```
-
-## Options
-
-```json
-{
-    "no-use-before-define": ["error", { "functions": true, "classes": true, "variables": true }]
-}
-```
-
-* `functions` (`boolean`) -
-  The flag which shows whether or not this rule checks function declarations.
-  If this is `true`, this rule warns every reference to a function before the function declaration.
-  Otherwise, ignores those references.
-  Function declarations are hoisted, so it's safe.
-  Default is `true`.
-* `classes` (`boolean`) -
-  The flag which shows whether or not this rule checks class declarations of upper scopes.
-  If this is `true`, this rule warns every reference to a class before the class declaration.
-  Otherwise, ignores those references if the declaration is in upper function scopes.
-  Class declarations are not hoisted, so it might be danger.
-  Default is `true`.
-* `variables` (`boolean`) -
-  This flag determines whether or not the rule checks variable declarations in upper scopes.
-  If this is `true`, the rule warns every reference to a variable before the variable declaration.
-  Otherwise, the rule ignores a reference if the declaration is in an upper scope, while still reporting the reference if it's in the same scope as the declaration.
-  Default is `true`.
-
-This rule accepts `"nofunc"` string as an option.
-`"nofunc"` is the same as `{ "functions": false, "classes": true, "variables": true }`.
-
-### functions
-
-Examples of **correct** code for the `{ "functions": false }` option:
-
-```js
-/*eslint no-use-before-define: ["error", { "functions": false }]*/
-
-f();
-function f() {}
-```
-
-This option allows references to function declarations. For function expressions and arrow functions, please see the [`variables`](#variables) option.
-
-### classes
-
-Examples of **incorrect** code for the `{ "classes": false }` option:
-
-```js
-/*eslint no-use-before-define: ["error", { "classes": false }]*/
-
-new A();
-class A {
-}
-
-{
-    class C extends C {}
-}
-
-{
-    class C extends D {}
-    class D {}
-}
-
-{
-    class C {
-        static x = "foo";
-        [C.x]() {}
-    }
-}
-
-{
-    class C {
-        static {
-            new D();
-        }
-    }
-    class D {}
-}
-```
-
-Examples of **correct** code for the `{ "classes": false }` option:
-
-```js
-/*eslint no-use-before-define: ["error", { "classes": false }]*/
-
-function foo() {
-    return new A();
-}
-
-class A {
-}
-```
-
-### variables
-
-Examples of **incorrect** code for the `{ "variables": false }` option:
-
-```js
-/*eslint no-use-before-define: ["error", { "variables": false }]*/
-
-console.log(foo);
-var foo = 1;
-
-f();
-const f = () => {};
-
-g();
-const g = function() {};
-
-{
-    const C = class {
-        static x = C;
-    }
-}
-
-{
-    const C = class {
-        static x = foo;
-    }
-    const foo = 1;
-}
-
-{
-    class C {
-        static {
-            this.x = foo;
-        }
-    }
-    const foo = 1;
-}
-```
-
-Examples of **correct** code for the `{ "variables": false }` option:
-
-```js
-/*eslint no-use-before-define: ["error", { "variables": false }]*/
-
-function baz() {
-    console.log(foo);
-}
-var foo = 1;
-
-const a = () => f();
-function b() { return f(); }
-const c = function() { return f(); }
-const f = () => {};
-
-const e = function() { return g(); }
-const g = function() {}
-
-{
-    const C = class {
-        x = foo;
-    }
-    const foo = 1;
-}
-```
diff --git a/eslint/docs/rules/no-useless-backreference.md b/eslint/docs/rules/no-useless-backreference.md
deleted file mode 100644 (file)
index d2360b3..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-# Disallow useless backreferences in regular expressions (no-useless-backreference)
-
-In JavaScript regular expressions, it's syntactically valid to define a backreference to a group that belongs to another alternative part of the pattern, a backreference to a group that appears after the backreference, a backreference to a group that contains that backreference, or a backreference to a group that is inside a negative lookaround. However, by the specification, in any of these cases the backreference always ends up matching only zero-length (the empty string), regardless of the context in which the backreference and the group appear.
-
-Backreferences that always successfully match zero-length and cannot match anything else are useless. They are basically ignored and can be removed without changing the behavior of the regular expression.
-
-```js
-var regex = /^(?:(a)|\1b)$/;
-
-regex.test("a"); // true
-regex.test("b"); // true!
-regex.test("ab"); // false
-
-var equivalentRegex = /^(?:(a)|b)$/;
-
-equivalentRegex.test("a"); // true
-equivalentRegex.test("b"); // true
-equivalentRegex.test("ab"); // false
-```
-
-Useless backreference is a possible error in the code. It usually indicates that the regular expression does not work as intended.
-
-## Rule Details
-
-This rule aims to detect and disallow the following backreferences in regular expression:
-
-* Backreference to a group that is in another alternative, e.g., `/(a)|\1b/`. In such constructed regular expression, the backreference is expected to match what's been captured in, at that point, a non-participating group.
-* Backreference to a group that appears later in the pattern, e.g., `/\1(a)/`. The group hasn't captured anything yet, and ECMAScript doesn't support forward references. Inside lookbehinds, which match backward, the opposite applies and this rule disallows backreference to a group that appears before in the same lookbehind, e.g., `/(?<=(a)\1)b/`.
-* Backreference to a group from within the same group, e.g., `/(\1)/`. Similar to the previous, the group hasn't captured anything yet, and ECMAScript doesn't support nested references.
-* Backreference to a group that is in a negative lookaround, if the backreference isn't in the same negative lookaround, e.g., `/a(?!(b)).\1/`. A negative lookaround (lookahead or lookbehind) succeeds only if its pattern cannot match, meaning that the group has failed.
-
-By the ECMAScript specification, all backreferences listed above are valid, always succeed to match zero-length, and cannot match anything else. Consequently, they don't produce parsing or runtime errors, but also don't affect the behavior of their regular expressions. They are syntactically valid but useless.
-
-This might be surprising to developers coming from other languages where some of these backreferences can be used in a meaningful way.
-
-```js
-// in some other languages, this pattern would successfully match "aab"
-
-/^(?:(a)(?=a)|\1b)+$/.test("aab"); // false
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-backreference: "error"*/
-
-/^(?:(a)|\1b)$/; // reference to (a) into another alternative
-
-/^(?:(a)|b(?:c|\1))$/; // reference to (a) into another alternative
-
-/^(?:a|b(?:(c)|\1))$/; // reference to (c) into another alternative
-
-/\1(a)/; // forward reference to (a)
-
-RegExp('(a)\\2(b)'); // forward reference to (b)
-
-/(?:a)(b)\2(c)/; // forward reference to (c)
-
-/\k<foo>(?<foo>a)/; // forward reference to (?<foo>a)
-
-/(?<=(a)\1)b/; // backward reference to (a) from within the same lookbehind
-
-/(?<!(a)\1)b/; // backward reference to (a) from within the same lookbehind
-
-new RegExp('(\\1)'); // nested reference to (\1)
-
-/^((a)\1)$/; // nested reference to ((a)\1)
-
-/a(?<foo>(.)b\1)/; // nested reference to (?<foo>(.)b\1)
-
-/a(?!(b)).\1/; // reference to (b) into a negative lookahead
-
-/(?<!(a))b\1/; // reference to (a) into a negative lookbehind
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-backreference: "error"*/
-
-/^(?:(a)|(b)\2)$/; // reference to (b)
-
-/(a)\1/; // reference to (a)
-
-RegExp('(a)\\1(b)'); // reference to (a)
-
-/(a)(b)\2(c)/; // reference to (b)
-
-/(?<foo>a)\k<foo>/; // reference to (?<foo>a)
-
-/(?<=\1(a))b/; // reference to (a), correctly before the group as they're in the same lookbehind
-
-/(?<=(a))b\1/; // reference to (a), correctly after the group as the backreference isn't in the lookbehind
-
-new RegExp('(.)\\1'); // reference to (.)
-
-/^(?:(a)\1)$/; // reference to (a)
-
-/^((a)\2)$/; // reference to (a)
-
-/a(?<foo>(.)b\2)/; // reference to (.)
-
-/a(?!(b|c)\1)./; // reference to (b|c), correct as it's from within the same negative lookahead
-
-/(?<!\1(a))b/; // reference to (a), correct as it's from within the same negative lookbehind
-```
-
-Please note that this rule does not aim to detect and disallow a potentially erroneous use of backreference syntax in regular expressions, like the use in character classes or an attempt to reference a group that doesn't exist. Depending on the context, a `\1`...`\9` sequence that is not a syntactically valid backreference may produce syntax error, or be parsed as something else (e.g., as a legacy octal escape sequence).
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-useless-backreference: "error"*/
-
-// comments describe behavior in a browser
-
-/^[\1](a)$/.test("\x01a"); // true. In a character class, \1 is treated as an octal escape sequence.
-/^\1$/.test("\x01"); // true. Since the group 1 doesn't exist, \1 is treated as an octal escape sequence.
-/^(a)\1\2$/.test("aa\x02"); // true. In this case, \1 is a backreference, \2 is an octal escape sequence.
-```
-
-## Further Reading
-
-* [MDN: Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
-
-## Related Rules
-
-* [no-control-regex](no-control-regex.md)
-* [no-empty-character-class](no-empty-character-class.md)
-* [no-invalid-regexp](no-invalid-regexp.md)
diff --git a/eslint/docs/rules/no-useless-call.md b/eslint/docs/rules/no-useless-call.md
deleted file mode 100644 (file)
index 196cc6d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Disallow unnecessary `.call()` and `.apply()`. (no-useless-call)
-
-The function invocation can be written by `Function.prototype.call()` and `Function.prototype.apply()`.
-But `Function.prototype.call()` and `Function.prototype.apply()` are slower than the normal function invocation.
-
-## Rule Details
-
-This rule is aimed to flag usage of `Function.prototype.call()` and `Function.prototype.apply()` that can be replaced with the normal function invocation.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-call: "error"*/
-
-// These are same as `foo(1, 2, 3);`
-foo.call(undefined, 1, 2, 3);
-foo.apply(undefined, [1, 2, 3]);
-foo.call(null, 1, 2, 3);
-foo.apply(null, [1, 2, 3]);
-
-// These are same as `obj.foo(1, 2, 3);`
-obj.foo.call(obj, 1, 2, 3);
-obj.foo.apply(obj, [1, 2, 3]);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-call: "error"*/
-
-// The `this` binding is different.
-foo.call(obj, 1, 2, 3);
-foo.apply(obj, [1, 2, 3]);
-obj.foo.call(null, 1, 2, 3);
-obj.foo.apply(null, [1, 2, 3]);
-obj.foo.call(otherObj, 1, 2, 3);
-obj.foo.apply(otherObj, [1, 2, 3]);
-
-// The argument list is variadic.
-// Those are warned by the `prefer-spread` rule.
-foo.apply(undefined, args);
-foo.apply(null, args);
-obj.foo.apply(obj, args);
-```
-
-## Known Limitations
-
-This rule compares code statically to check whether or not `thisArg` is changed.
-So if the code about `thisArg` is a dynamic expression, this rule cannot judge correctly.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-call: "error"*/
-
-a[i++].foo.call(a[i++], 1, 2, 3);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-call: "error"*/
-
-a[++i].foo.call(a[i], 1, 2, 3);
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary `.call()` and `.apply()`, you can safely disable this rule.
-
-## Related Rules
-
-* [prefer-spread](prefer-spread.md)
diff --git a/eslint/docs/rules/no-useless-catch.md b/eslint/docs/rules/no-useless-catch.md
deleted file mode 100644 (file)
index 0562063..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# Disallow unnecessary catch clauses (no-useless-catch)
-
-A `catch` clause that only rethrows the original error is redundant, and has no effect on the runtime behavior of the program. These redundant clauses can be a source of confusion and code bloat, so it's better to disallow these unnecessary `catch` clauses.
-
-## Rule Details
-
-This rule reports `catch` clauses that only `throw` the caught error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-catch: "error"*/
-
-try {
-  doSomethingThatMightThrow();
-} catch (e) {
-  throw e;
-}
-
-try {
-  doSomethingThatMightThrow();
-} catch (e) {
-  throw e;
-} finally {
-  cleanUp();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-catch: "error"*/
-
-try {
-  doSomethingThatMightThrow();
-} catch (e) {
-  doSomethingBeforeRethrow();
-  throw e;
-}
-
-try {
-  doSomethingThatMightThrow();
-} catch (e) {
-  handleError(e);
-}
-
-try {
-  doSomethingThatMightThrow();
-} finally {
-  cleanUp();
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary catch clauses, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-useless-computed-key.md b/eslint/docs/rules/no-useless-computed-key.md
deleted file mode 100644 (file)
index 2d3ddb3..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# Disallow unnecessary computed property keys in objects and classes (no-useless-computed-key)
-
-It's unnecessary to use computed properties with literals such as:
-
-```js
-var foo = {["a"]: "b"};
-```
-
-The code can be rewritten as:
-
-```js
-var foo = {"a": "b"};
-```
-
-## Rule Details
-
-This rule disallows unnecessary usage of computed property keys.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-computed-key: "error"*/
-
-var a = { ['0']: 0 };
-var a = { ['0+1,234']: 0 };
-var a = { [0]: 0 };
-var a = { ['x']: 0 };
-var a = { ['x']() {} };
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-computed-key: "error"*/
-
-var c = { 'a': 0 };
-var c = { 0: 0 };
-var a = { x() {} };
-var c = { a: 0 };
-var c = { '0+1,234': 0 };
-```
-
-Examples of additional **correct** code for this rule:
-
-```js
-/*eslint no-useless-computed-key: "error"*/
-
-var c = {
-    "__proto__": foo, // defines object's prototype
-
-    ["__proto__"]: bar // defines a property named "__proto__"
-};
-```
-
-## Options
-
-This rule has an object option:
-
-* `enforceForClassMembers` set to `true` additionally applies this rule to class members (Default `false`).
-
-### enforceForClassMembers
-
-By default, this rule does not check class declarations and class expressions,
-as the default value for `enforceForClassMembers` is `false`.
-
-When `enforceForClassMembers` is set to `true`, the rule will also disallow unnecessary computed keys inside of class fields, class methods, class getters, and class setters.
-
-Examples of **incorrect** code for this rule with the `{ "enforceForClassMembers": true }` option:
-
-```js
-/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
-
-class Foo {
-    ["foo"] = "bar";
-
-    [0]() {}
-    ['a']() {}
-    get ['b']() {}
-    set ['c'](value) {}
-
-    static ["foo"] = "bar";
-
-    static ['a']() {}
-}
-```
-
-Examples of **correct** code for this rule with the `{ "enforceForClassMembers": true }` option:
-
-```js
-/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
-
-class Foo {
-    "foo" = "bar";
-
-    0() {}
-    'a'() {}
-    get 'b'() {}
-    set 'c'(value) {}
-
-    static "foo" = "bar";
-
-    static 'a'() {}
-}
-```
-
-Examples of additional **correct** code for this rule with the `{ "enforceForClassMembers": true }` option:
-
-```js
-/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
-
-class Foo {
-    ["constructor"]; // instance field named "constructor"
-
-    "constructor"() {} // the constructor of this class
-
-    ["constructor"]() {} // method named "constructor"
-
-    static ["constructor"]; // static field named "constructor"
-
-    static ["prototype"]; // runtime error, it would be a parsing error without `[]`
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary computed property keys, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-useless-concat.md b/eslint/docs/rules/no-useless-concat.md
deleted file mode 100644 (file)
index 5dc5f1f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# Disallow unnecessary concatenation of strings (no-useless-concat)
-
-It's unnecessary to concatenate two strings together, such as:
-
-```js
-var foo = "a" + "b";
-```
-
-This code is likely the result of refactoring where a variable was removed from the concatenation (such as `"a" + b + "b"`). In such a case, the concatenation isn't important and the code can be rewritten as:
-
-```js
-var foo = "ab";
-```
-
-## Rule Details
-
-This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-concat: "error"*/
-/*eslint-env es6*/
-
-var a = `some` + `string`;
-
-// these are the same as "10"
-var a = '1' + '0';
-var a = '1' + `0`;
-var a = `1` + '0';
-var a = `1` + `0`;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-concat: "error"*/
-
-// when a non string is included
-var c = a + b;
-var c = '1' + a;
-var a = 1 + '1';
-var c = 1 - 2;
-// when the string concatenation is multiline
-var c = "foo" +
-    "bar";
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-useless-constructor.md b/eslint/docs/rules/no-useless-constructor.md
deleted file mode 100644 (file)
index cdfe505..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# Disallow unnecessary constructor (no-useless-constructor)
-
-ES2015 provides a default class constructor if one is not specified. As such, it is unnecessary to provide an empty constructor or one that simply delegates into its parent class, as in the following examples:
-
-```js
-class A {
-    constructor () {
-    }
-}
-
-class B extends A {
-    constructor (value) {
-      super(value);
-    }
-}
-```
-
-## Rule Details
-
-This rule flags class constructors that can be safely removed without changing how the class works.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-constructor: "error"*/
-/*eslint-env es6*/
-
-class A {
-    constructor () {
-    }
-}
-
-class B extends A {
-    constructor (...args) {
-      super(...args);
-    }
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-constructor: "error"*/
-
-class A { }
-
-class A {
-    constructor () {
-        doSomething();
-    }
-}
-
-class B extends A {
-    constructor() {
-        super('foo');
-    }
-}
-
-class B extends A {
-    constructor() {
-        super();
-        doSomething();
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary constructors, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-useless-escape.md b/eslint/docs/rules/no-useless-escape.md
deleted file mode 100644 (file)
index 6088c5c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# Disallow unnecessary escape usage (no-useless-escape)
-
-Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect, as demonstrated in the following example:
-
-```js
-let foo = "hol\a"; // > foo = "hola"
-let bar = `${foo}\!`; // > bar = "hola!"
-let baz = /\:/ // same functionality with /:/
-```
-
-## Rule Details
-
-This rule flags escapes that can be safely removed without changing behavior.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-useless-escape: "error"*/
-
-"\'";
-'\"';
-"\#";
-"\e";
-`\"`;
-`\"${foo}\"`;
-`\#{foo}`;
-/\!/;
-/\@/;
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-useless-escape: "error"*/
-
-"\"";
-'\'';
-"\x12";
-"\u00a9";
-"\371";
-"xs\u2111";
-`\``;
-`\${${foo}}`;
-`$\{${foo}}`;
-/\\/g;
-/\t/g;
-/\w\$\*\^\./;
-
-```
-
-## When Not To Use It
-
-If you don't want to be notified about unnecessary escapes, you can safely disable this rule.
diff --git a/eslint/docs/rules/no-useless-rename.md b/eslint/docs/rules/no-useless-rename.md
deleted file mode 100644 (file)
index ea38e84..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-# Disallow renaming import, export, and destructured assignments to the same name (no-useless-rename)
-
-ES2015 allows for the renaming of references in import and export statements as well as destructuring assignments. This gives programmers a concise syntax for performing these operations while renaming these references:
-
-```js
-import { foo as bar } from "baz";
-export { foo as bar };
-let { foo: bar } = baz;
-```
-
-With this syntax, it is possible to rename a reference to the same name. This is a completely redundant operation, as this is the same as not renaming at all. For example, this:
-
-```js
-import { foo as foo } from "bar";
-export { foo as foo };
-let { foo: foo } = bar;
-```
-
-is the same as:
-
-```js
-import { foo } from "bar";
-export { foo };
-let { foo } = bar;
-```
-
-## Rule Details
-
-This rule disallows the renaming of import, export, and destructured assignments to the same name.
-
-See Also:
-
-- [`object-shorthand`](https://eslint.org/docs/rules/object-shorthand) which can enforce this behavior for properties in object literals.
-
-## Options
-
-This rule allows for more fine-grained control with the following options:
-
-- `ignoreImport`: When set to `true`, this rule does not check imports
-- `ignoreExport`: When set to `true`, this rule does not check exports
-- `ignoreDestructuring`: When set to `true`, this rule does not check destructuring assignments
-
-By default, all options are set to `false`:
-
-```json
-"no-useless-rename": ["error", {
-    "ignoreDestructuring": false,
-    "ignoreImport": false,
-    "ignoreExport": false
-}]
-```
-
-Examples of **incorrect** code for this rule by default:
-
-```js
-/*eslint no-useless-rename: "error"*/
-
-import { foo as foo } from "bar";
-export { foo as foo };
-export { foo as foo } from "bar";
-let { foo: foo } = bar;
-let { 'foo': foo } = bar;
-function foo({ bar: bar }) {}
-({ foo: foo }) => {}
-```
-
-Examples of **correct** code for this rule by default:
-
-```js
-/*eslint no-useless-rename: "error"*/
-
-import * as foo from "foo";
-import { foo } from "bar";
-import { foo as bar } from "baz";
-
-export { foo };
-export { foo as bar };
-export { foo as bar } from "foo";
-
-let { foo } = bar;
-let { foo: bar } = baz;
-let { [foo]: foo } = bar;
-
-function foo({ bar }) {}
-function foo({ bar: baz }) {}
-
-({ foo }) => {}
-({ foo: bar }) => {}
-```
-
-Examples of **correct** code for this rule with `{ ignoreImport: true }`:
-
-```js
-/*eslint no-useless-rename: ["error", { ignoreImport: true }]*/
-
-import { foo as foo } from "bar";
-```
-
-Examples of **correct** code for this rule with `{ ignoreExport: true }`:
-
-```js
-/*eslint no-useless-rename: ["error", { ignoreExport: true }]*/
-
-export { foo as foo };
-export { foo as foo } from "bar";
-```
-
-Examples of **correct** code for this rule with `{ ignoreDestructuring: true }`:
-
-```js
-/*eslint no-useless-rename: ["error", { ignoreDestructuring: true }]*/
-
-let { foo: foo } = bar;
-function foo({ bar: bar }) {}
-({ foo: foo }) => {}
-```
-
-## When Not To Use It
-
-You can safely disable this rule if you do not care about redundantly renaming import, export, and destructuring assignments.
-
-## Compatibility
-
-- **JSCS**: [disallowIdenticalDestructuringNames](https://jscs-dev.github.io/rule/disallowIdenticalDestructuringNames)
diff --git a/eslint/docs/rules/no-useless-return.md b/eslint/docs/rules/no-useless-return.md
deleted file mode 100644 (file)
index 4e8de68..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-# Disallow redundant return statements (no-useless-return)
-
-A `return;` statement with nothing after it is redundant, and has no effect on the runtime behavior of a function. This can be confusing, so it's better to disallow these redundant statements.
-
-## Rule Details
-
-This rule aims to report redundant `return` statements.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint no-useless-return: "error" */
-
-function foo() { return; }
-
-function foo() {
-  doSomething();
-  return;
-}
-
-function foo() {
-  if (condition) {
-    bar();
-    return;
-  } else {
-    baz();
-  }
-}
-
-function foo() {
-  switch (bar) {
-    case 1:
-      doSomething();
-    default:
-      doSomethingElse();
-      return;
-  }
-}
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint no-useless-return: "error" */
-
-function foo() { return 5; }
-
-function foo() {
-  return doSomething();
-}
-
-function foo() {
-  if (condition) {
-    bar();
-    return;
-  } else {
-    baz();
-  }
-  qux();
-}
-
-function foo() {
-  switch (bar) {
-    case 1:
-      doSomething();
-      return;
-    default:
-      doSomethingElse();
-  }
-}
-
-function foo() {
-  for (const foo of bar) {
-    return;
-  }
-}
-
-```
-
-## When Not To Use It
-
-If you don't care about disallowing redundant return statements, you can turn off this rule.
diff --git a/eslint/docs/rules/no-var.md b/eslint/docs/rules/no-var.md
deleted file mode 100644 (file)
index 83950c3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# require `let` or `const` instead of `var` (no-var)
-
-ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the `let`
-and `const` keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes
-such as:
-
-```js
-var count = people.length;
-var enoughFood = count > sandwiches.length;
-
-if (enoughFood) {
-    var count = sandwiches.length; // accidentally overriding the count variable
-    console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
-}
-
-// our count variable is no longer accurate
-console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");
-```
-
-## Rule Details
-
-This rule is aimed at discouraging the use of `var` and encouraging the use of `const` or `let` instead.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-var: "error"*/
-
-var x = "y";
-var CONFIG = {};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-var: "error"*/
-/*eslint-env es6*/
-
-let x = "y";
-const CONFIG = {};
-```
-
-## When Not To Use It
-
-In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their
-codebase may not want to apply this rule if the cost of migrating from `var` to `let` is too costly.
diff --git a/eslint/docs/rules/no-void.md b/eslint/docs/rules/no-void.md
deleted file mode 100644 (file)
index 3f78376..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# Disallow use of the void operator. (no-void)
-
-The `void` operator takes an operand and returns `undefined`: `void expression` will evaluate `expression` and return `undefined`. It can be used to ignore any side effects `expression` may produce:
-
-The common case of using `void` operator is to get a "pure" `undefined` value as prior to ES5 the `undefined` variable was mutable:
-
-```js
-// will always return undefined
-(function(){
-    return void 0;
-})();
-
-// will return 1 in ES3 and undefined in ES5+
-(function(){
-    undefined = 1;
-    return undefined;
-})();
-
-// will throw TypeError in ES5+
-(function(){
-    'use strict';
-    undefined = 1;
-})();
-```
-
-Another common case is to minify code as `void 0` is shorter than `undefined`:
-
-```js
-foo = void 0;
-foo = undefined;
-```
-
-When used with IIFE (immediately-invoked function expression), `void` can be used to force the function keyword to be treated as an expression instead of a declaration:
-
-```js
-var foo = 1;
-void function(){ foo = 1; }() // will assign foo a value of 1
-+function(){ foo = 1; }() // same as above
-```
-
-```js
-function(){ foo = 1; }() // will throw SyntaxError
-```
-
-Some code styles prohibit `void` operator, marking it as non-obvious and hard to read.
-
-## Rule Details
-
-This rule aims to eliminate use of void operator.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-void: "error"*/
-
-void foo
-void someFunction();
-
-var foo = void bar();
-function baz() {
-    return void 0;
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `allowAsStatement` set to `true` allows the void operator to be used as a statement (Default `false`).
-
-### allowAsStatement
-
-When `allowAsStatement` is set to true, the rule will not error on cases that the void operator is used as a statement, i.e. when it's not used in an expression position, like in a variable assignment or a function return.
-
-Examples of **incorrect** code for `{ "allowAsStatement": true }`:
-
-```js
-/*eslint no-void: ["error", { "allowAsStatement": true }]*/
-
-var foo = void bar();
-function baz() {
-    return void 0;
-}
-```
-
-Examples of **correct** code for `{ "allowAsStatement": true }`:
-
-```js
-/*eslint no-void: ["error", { "allowAsStatement": true }]*/
-
-void foo;
-void someFunction();
-```
-
-## When Not To Use It
-
-If you intentionally use the `void` operator then you can disable this rule.
-
-## Further Reading
-
-* [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void)
-* [Bad Parts: Appendix B - JavaScript: The Good Parts by Douglas Crockford](https://oreilly.com/javascript/excerpts/javascript-good-parts/bad-parts.html)
-
-## Related Rules
-
-* [no-undef-init](no-undef-init.md)
-* [no-undefined](no-undefined.md)
diff --git a/eslint/docs/rules/no-warning-comments.md b/eslint/docs/rules/no-warning-comments.md
deleted file mode 100644 (file)
index 4836560..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# Disallow Warning Comments (no-warning-comments)
-
-Developers often add comments to code which is not complete or needs review. Most likely you want to fix or review the code, and then remove the comment, before you consider the code to be production ready.
-
-```js
-// TODO: do something
-// FIXME: this is not a good idea
-```
-
-## Rule Details
-
-This rule reports comments that include any of the predefined terms specified in its configuration.
-
-## Options
-
-This rule has an options object literal:
-
-* `"terms"`: optional array of terms to match. Defaults to `["todo", "fixme", "xxx"]`. Terms are matched case-insensitive and as whole words: `fix` would match `FIX` but not `fixing`. Terms can consist of multiple words: `really bad idea`.
-* `"location"`: optional string that configures where in your comments to check for matches. Defaults to `"start"`. The other value is match `anywhere` in comments.
-
-Example of **incorrect** code for the default `{ "terms": ["todo", "fixme", "xxx"], "location": "start" }` options:
-
-```js
-/*eslint no-warning-comments: "error"*/
-
-function callback(err, results) {
-  if (err) {
-    console.error(err);
-    return;
-  }
-  // TODO
-}
-```
-
-Example of **correct** code for the default `{ "terms": ["todo", "fixme", "xxx"], "location": "start" }` options:
-
-```js
-/*eslint no-warning-comments: "error"*/
-
-function callback(err, results) {
-  if (err) {
-    console.error(err);
-    return;
-  }
-  // NOT READY FOR PRIME TIME
-  // but too bad, it is not a predefined warning term
-}
-```
-
-### terms and location
-
-Examples of **incorrect** code for the `{ "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }` options:
-
-```js
-/*eslint no-warning-comments: ["error", { "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }]*/
-
-// TODO: this
-// todo: this too
-// Even this: TODO
-/* /*
- * The same goes for this TODO comment
- * Or a fixme
- * as well as any other term
- */
-```
-
-Examples of **correct** code for the `{ "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }` options:
-
-```js
-/*eslint no-warning-comments: ["error", { "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }]*/
-
-// This is to do
-// even not any other    term
-// any other terminal
-/*
- * The same goes for block comments
- * with any other interesting term
- * or fix me this
- */
-```
-
-## When Not To Use It
-
-* If you have a large code base that was not developed with a policy to not use such warning terms, you might get hundreds of warnings / errors which might be counter-productive if you can't fix all of them (e.g. if you don't get the time to do it) as you might overlook other warnings / errors or get used to many of them and don't pay attention on it anymore.
-* Same reason as the point above: You shouldn't configure terms that are used very often (e.g. central parts of the native language used in your comments).
diff --git a/eslint/docs/rules/no-whitespace-before-property.md b/eslint/docs/rules/no-whitespace-before-property.md
deleted file mode 100644 (file)
index 70ecc14..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# disallow whitespace before properties (no-whitespace-before-property)
-
-JavaScript allows whitespace between objects and their properties. However, inconsistent spacing can make code harder to read and can lead to errors.
-
-```js
-foo. bar .baz . quz
-```
-
-## Rule Details
-
-This rule disallows whitespace around the dot or before the opening bracket before properties of objects if they are on the same line. This rule allows whitespace when the object and property are on separate lines, as it is common to add newlines to longer chains of properties:
-
-```js
-foo
-  .bar()
-  .baz()
-  .qux()
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-whitespace-before-property: "error"*/
-
-foo [bar]
-
-foo. bar
-
-foo .bar
-
-foo. bar. baz
-
-foo. bar()
-  .baz()
-
-foo
-  .bar(). baz()
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-whitespace-before-property: "error"*/
-
-foo.bar
-
-foo[bar]
-
-foo[ bar ]
-
-foo.bar.baz
-
-foo
-  .bar().baz()
-
-foo
-  .bar()
-  .baz()
-
-foo.
-  bar().
-  baz()
-```
-
-## When Not To Use It
-
-Turn this rule off if you do not care about allowing whitespace around the dot or before the opening bracket before properties of objects if they are on the same line.
diff --git a/eslint/docs/rules/no-with.md b/eslint/docs/rules/no-with.md
deleted file mode 100644 (file)
index 979c58b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# disallow `with` statements (no-with)
-
-The `with` statement is potentially problematic because it adds members of an object to the current scope, making it impossible to tell what a variable inside the block actually refers to.
-
-## Rule Details
-
-This rule disallows `with` statements.
-
-If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint no-with: "error"*/
-
-with (point) {
-    r = Math.sqrt(x * x + y * y); // is r a member of point?
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint no-with: "error"*/
-/*eslint-env es6*/
-
-const r = ({x, y}) => Math.sqrt(x * x + y * y);
-```
-
-## When Not To Use It
-
-If you intentionally use `with` statements then you can disable this rule.
-
-## Further Reading
-
-* [with Statement Considered Harmful](https://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/)
diff --git a/eslint/docs/rules/no-wrap-func.md b/eslint/docs/rules/no-wrap-func.md
deleted file mode 100644 (file)
index 5193d79..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# no-wrap-func: disallow unnecessary parentheses around function expressions
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [no-extra-parens](no-extra-parens.md) rule. The `"functions"` option in the new rule is equivalent to the removed rule.
-
-Although it's possible to wrap functions in parentheses, this can be confusing when the code also contains immediately-invoked function expressions (IIFEs) since parentheses are often used to make this distinction. For example:
-
-```js
-var foo = (function() {
-    // IIFE
-}());
-
-var bar = (function() {
-    // not an IIFE
-});
-```
-
-## Rule Details
-
-This rule will raise a warning when it encounters a function expression wrapped in parentheses with no following invoking parentheses.
-
-Example of **incorrect** code for this rule:
-
-```js
-var a = (function() {/*...*/});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-var a = function() {/*...*/};
-
-(function() {/*...*/})();
-```
diff --git a/eslint/docs/rules/nonblock-statement-body-position.md b/eslint/docs/rules/nonblock-statement-body-position.md
deleted file mode 100644 (file)
index c2de17d..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-# enforce the location of single-line statements (nonblock-statement-body-position)
-
-When writing `if`, `else`, `while`, `do-while`, and `for` statements, the body can be a single statement instead of a block. It can be useful to enforce a consistent location for these single statements.
-
-For example, some developers avoid writing code like this:
-
-```js
-if (foo)
-  bar();
-```
-
-If another developer attempts to add `baz();` to the `if` statement, they might mistakenly change the code to
-
-```js
-if (foo)
-  bar();
-  baz(); // this line is not in the `if` statement!
-```
-
-To avoid this issue, one might require all single-line `if` statements to appear directly after the conditional, without a linebreak:
-
-```js
-if (foo) bar();
-```
-
-## Rule Details
-
-This rule aims to enforce a consistent location for single-line statements.
-
-Note that this rule does not enforce the usage of single-line statements in general. If you would like to disallow single-line statements, use the [`curly`](/docs/rules/curly.md) rule instead.
-
-### Options
-
-This rule accepts a string option:
-
-* `"beside"` (default) disallows a newline before a single-line statement.
-* `"below"` requires a newline before a single-line statement.
-* `"any"` does not enforce the position of a single-line statement.
-
-Additionally, the rule accepts an optional object option with an `"overrides"` key. This can be used to specify a location for particular statements that override the default. For example:
-
-* `"beside", { "overrides": { "while": "below" } }` requires all single-line statements to appear on the same line as their parent, unless the parent is a `while` statement, in which case the single-line statement must not be on the same line.
-* `"below", { "overrides": { "do": "any" } }` disallows all single-line statements from appearing on the same line as their parent, unless the parent is a `do-while` statement, in which case the position of the single-line statement is not enforced.
-
-Examples of **incorrect** code for this rule with the default `"beside"` option:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "beside"] */
-
-if (foo)
-  bar();
-else
-  baz();
-
-while (foo)
-  bar();
-
-for (let i = 1; i < foo; i++)
-  bar();
-
-do
-  bar();
-while (foo)
-
-```
-
-Examples of **correct** code for this rule with the default `"beside"` option:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "beside"] */
-
-if (foo) bar();
-else baz();
-
-while (foo) bar();
-
-for (let i = 1; i < foo; i++) bar();
-
-do bar(); while (foo)
-
-if (foo) { // block statements are always allowed with this rule
-  bar();
-} else {
-  baz();
-}
-```
-
-Examples of **incorrect** code for this rule with the `"below"` option:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "below"] */
-
-if (foo) bar();
-else baz();
-
-while (foo) bar();
-
-for (let i = 1; i < foo; i++) bar();
-
-do bar(); while (foo)
-```
-
-Examples of **correct** code for this rule with the `"below"` option:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "below"] */
-
-if (foo)
-  bar();
-else
-  baz();
-
-while (foo)
-  bar();
-
-for (let i = 1; i < foo; i++)
-  bar();
-
-do
-  bar();
-while (foo)
-
-if (foo) {
-  // Although the second `if` statement is on the same line as the `else`, this is a very common
-  // pattern, so it's not checked by this rule.
-} else if (bar) {
-}
-```
-
-Examples of **incorrect** code for this rule with the `"beside", { "overrides": { "while": "below" } }` rule:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "beside", { "overrides": { "while": "below" } }] */
-
-if (foo)
-  bar();
-
-while (foo) bar();
-```
-
-Examples of **correct** code for this rule with the `"beside", { "overrides": { "while": "below" } }` rule:
-
-```js
-/* eslint nonblock-statement-body-position: ["error", "beside", { "overrides": { "while": "below" } }] */
-
-if (foo) bar();
-
-while (foo)
-  bar();
-```
-
-## When Not To Use It
-
-If you're not concerned about consistent locations of single-line statements, you should not turn on this rule. You can also disable this rule if you're using the `"all"` option for the [`curly`](/docs/rules/curly.md) rule, because this will disallow single-line statements entirely.
-
-## Further Reading
-
-* JSCS: [requireNewlineBeforeSingleStatementsInIf](https://jscs-dev.github.io/rule/requireNewlineBeforeSingleStatementsInIf)
diff --git a/eslint/docs/rules/object-curly-newline.md b/eslint/docs/rules/object-curly-newline.md
deleted file mode 100644 (file)
index cc98b42..0000000
+++ /dev/null
@@ -1,548 +0,0 @@
-# enforce consistent line breaks after opening and before closing braces (object-curly-newline)
-
-A number of style guides require or disallow line breaks inside of object braces and other tokens.
-
-## Rule Details
-
-This rule requires or disallows a line break between `{` and its following token, and between `}` and its preceding token of object literals or destructuring assignments.
-
-## Options
-
-This rule has either a string option:
-
-* `"always"` requires line breaks after opening and before closing braces
-* `"never"` disallows line breaks after opening and before closing braces
-
-Or an object option:
-
-* `"multiline": true` requires line breaks if there are line breaks inside properties or between properties. Otherwise, it disallows line breaks.
-* `"minProperties"` requires line breaks if the number of properties is at least the given integer. By default, an error will also be reported if an object contains linebreaks and has fewer properties than the given integer. However, the second behavior is disabled if the `consistent` option is set to `true`
-* `"consistent": true` (default) requires that either both curly braces, or neither, directly enclose newlines. Note that enabling this option will also change the behavior of the `minProperties` option. (See `minProperties` above for more information)
-
-You can specify different options for object literals, destructuring assignments, and named imports and exports:
-
-```json
-{
-    "object-curly-newline": ["error", {
-        "ObjectExpression": "always",
-        "ObjectPattern": { "multiline": true },
-        "ImportDeclaration": "never",
-        "ExportDeclaration": { "multiline": true, "minProperties": 3 }
-    }]
-}
-```
-
-* `"ObjectExpression"` configuration for object literals
-* `"ObjectPattern"` configuration for object patterns of destructuring assignments
-* `"ImportDeclaration"` configuration for named imports
-* `"ExportDeclaration"` configuration for named exports
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint object-curly-newline: ["error", "always"]*/
-/*eslint-env es6*/
-
-let a = {};
-let b = {foo: 1};
-let c = {foo: 1, bar: 2};
-let d = {foo: 1,
-    bar: 2};
-let e = {foo() {
-    dosomething();
-}};
-
-let {} = obj;
-let {f} = obj;
-let {g, h} = obj;
-let {i,
-    j} = obj;
-let {k = function() {
-    dosomething();
-}} = obj;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint object-curly-newline: ["error", "always"]*/
-/*eslint-env es6*/
-
-let a = {
-};
-let b = {
-    foo: 1
-};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {
-} = obj;
-let {
-    f
-} = obj;
-let {
-    g, h
-} = obj;
-let {
-    i,
-    j
-} = obj;
-let {
-    k = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint object-curly-newline: ["error", "never"]*/
-/*eslint-env es6*/
-
-let a = {
-};
-let b = {
-    foo: 1
-};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {
-} = obj;
-let {
-    f
-} = obj;
-let {
-    g, h
-} = obj;
-let {
-    i,
-    j
-} = obj;
-let {
-    k = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint object-curly-newline: ["error", "never"]*/
-/*eslint-env es6*/
-
-let a = {};
-let b = {foo: 1};
-let c = {foo: 1, bar: 2};
-let d = {foo: 1,
-    bar: 2};
-let e = {foo: function() {
-    dosomething();
-}};
-
-let {} = obj;
-let {f} = obj;
-let {g, h} = obj;
-let {i,
-    j} = obj;
-let {k = function() {
-    dosomething();
-}} = obj;
-```
-
-### multiline
-
-Examples of **incorrect** code for this rule with the `{ "multiline": true }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "multiline": true }]*/
-/*eslint-env es6*/
-
-let a = {
-};
-let b = {
-    foo: 1
-};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {foo: 1,
-    bar: 2};
-let e = {foo: function() {
-    dosomething();
-}};
-
-let {
-} = obj;
-let {
-    f
-} = obj;
-let {
-    g, h
-} = obj;
-let {i,
-    j} = obj;
-let {k = function() {
-    dosomething();
-}} = obj;
-```
-
-Examples of **correct** code for this rule with the `{ "multiline": true }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "multiline": true }]*/
-/*eslint-env es6*/
-
-let a = {};
-let b = {foo: 1};
-let c = {foo: 1, bar: 2};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {} = obj;
-let {f} = obj;
-let {g, h} = obj;
-let {
-    i,
-    j
-} = obj;
-let {
-    k = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-### minProperties
-
-Examples of **incorrect** code for this rule with the `{ "minProperties": 2 }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "minProperties": 2 }]*/
-/*eslint-env es6*/
-
-let a = {
-};
-let b = {
-    foo: 1
-};
-let c = {foo: 1, bar: 2};
-let d = {foo: 1,
-    bar: 2};
-let e = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {
-} = obj;
-let {
-    f
-} = obj;
-let {g, h} = obj;
-let {i,
-    j} = obj;
-let {
-    k = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-Examples of **correct** code for this rule with the `{ "minProperties": 2 }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "minProperties": 2 }]*/
-/*eslint-env es6*/
-
-let a = {};
-let b = {foo: 1};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {foo: function() {
-    dosomething();
-}};
-
-let {} = obj;
-let {f} = obj;
-let {
-    g, h
-} = obj;
-let {
-    i,
-    j
-} = obj;
-let {k = function() {
-    dosomething();
-}} = obj;
-```
-
-### consistent
-
-Examples of **incorrect** code for this rule with the default `{ "consistent": true }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "consistent": true }]*/
-/*eslint-env es6*/
-
-let a = {foo: 1
-};
-let b = {
-    foo: 1};
-let c = {foo: 1, bar: 2
-};
-let d = {
-    foo: 1, bar: 2};
-let e = {foo: function() {
-    dosomething();
-    }
-};
-let f = {
-    foo: function() {
-    dosomething();}};
-
-let {g
-} = obj;
-let {
-    h} = obj;
-let {i, j
-} = obj;
-let {k, l
-} = obj;
-let {
-    m, n} = obj;
-let {
-    o, p} = obj;
-let {q = function() {
-    dosomething();
-    }
-} = obj;
-let {
-    r = function() {
-        dosomething();
-    }} = obj;
-```
-
-Examples of **correct** code for this rule with the default `{ "consistent": true }` option:
-
-```js
-/*eslint object-curly-newline: ["error", { "consistent": true }]*/
-/*eslint-env es6*/
-
-
-let empty1 = {};
-let empty2 = {
-};
-let a = {foo: 1};
-let b = {
-    foo: 1
-};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {foo: function() {dosomething();}};
-let f = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {} = obj;
-let {
-} = obj;
-let {g} = obj;
-let {
-    h
-} = obj;
-let {i, j} = obj;
-let {
-    k, l
-} = obj;
-let {m,
-    n} = obj;
-let {
-    o,
-    p
-} = obj;
-let {q = function() {dosomething();}} = obj;
-let {
-    r = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-### ObjectExpression and ObjectPattern
-
-Examples of **incorrect** code for this rule with the `{ "ObjectExpression": "always", "ObjectPattern": "never" }` options:
-
-```js
-/*eslint object-curly-newline: ["error", { "ObjectExpression": "always", "ObjectPattern": "never" }]*/
-/*eslint-env es6*/
-
-let a = {};
-let b = {foo: 1};
-let c = {foo: 1, bar: 2};
-let d = {foo: 1,
-    bar: 2};
-let e = {foo: function() {
-    dosomething();
-}};
-
-let {
-} = obj;
-let {
-    f
-} = obj;
-let {
-    g, h
-} = obj;
-let {
-    i,
-    j
-} = obj;
-let {
-    k = function() {
-        dosomething();
-    }
-} = obj;
-```
-
-Examples of **correct** code for this rule with the `{ "ObjectExpression": "always", "ObjectPattern": "never" }` options:
-
-```js
-/*eslint object-curly-newline: ["error", { "ObjectExpression": "always", "ObjectPattern": "never" }]*/
-/*eslint-env es6*/
-
-let a = {
-};
-let b = {
-    foo: 1
-};
-let c = {
-    foo: 1, bar: 2
-};
-let d = {
-    foo: 1,
-    bar: 2
-};
-let e = {
-    foo: function() {
-        dosomething();
-    }
-};
-
-let {} = obj;
-let {f} = obj;
-let {g, h} = obj;
-let {i,
-    j} = obj;
-let {k = function() {
-    dosomething();
-}} = obj;
-```
-
-### ImportDeclaration and ExportDeclaration
-
-Examples of **incorrect** code for this rule with the `{ "ImportDeclaration": "always", "ExportDeclaration": "never" }` options:
-
-```js
-/*eslint object-curly-newline: ["error", { "ImportDeclaration": "always", "ExportDeclaration": "never" }]*/
-/*eslint-env es6*/
-
-import {foo, bar} from 'foo-bar';
-import {foo as f, bar} from 'foo-bar';
-import {foo,
-    bar} from 'foo-bar';
-
-export {
-   foo,
-   bar
-};
-export {
-   foo as f,
-   bar
-} from 'foo-bar';
-```
-
-Examples of **correct** code for this rule with the `{ "ImportDeclaration": "always", "ExportDeclaration": "never" }` options:
-
-```js
-/*eslint object-curly-newline: ["error", { "ImportDeclaration": "always", "ExportDeclaration": "never" }]*/
-/*eslint-env es6*/
-
-import {
-    foo,
-    bar
-} from 'foo-bar';
-import {
-    foo, bar
-} from 'foo-bar';
-import {
-    foo as f,
-    bar
-} from 'foo-bar';
-
-export { foo, bar } from 'foo-bar';
-export { foo as f, bar } from 'foo-bar';
-```
-
-## Compatibility
-
-* **JSCS**: [requirePaddingNewLinesInObjects](https://jscs-dev.github.io/rule/requirePaddingNewLinesInObjects)
-* **JSCS**: [disallowPaddingNewLinesInObjects](https://jscs-dev.github.io/rule/disallowPaddingNewLinesInObjects)
-
-## When Not To Use It
-
-If you don't want to enforce consistent line breaks after opening and before closing braces, then it's safe to disable this rule.
-
-## Related Rules
-
-* [comma-spacing](comma-spacing.md)
-* [key-spacing](key-spacing.md)
-* [object-curly-spacing](object-curly-spacing.md)
-* [object-property-newline](object-property-newline.md)
diff --git a/eslint/docs/rules/object-curly-spacing.md b/eslint/docs/rules/object-curly-spacing.md
deleted file mode 100644 (file)
index e7b054c..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-# enforce consistent spacing inside braces (object-curly-spacing)
-
-While formatting preferences are very personal, a number of style guides require
-or disallow spaces between curly braces in the following situations:
-
-```js
-// simple object literals
-var obj = { foo: "bar" };
-
-// nested object literals
-var obj = { foo: { zoo: "bar" } };
-
-// destructuring assignment (EcmaScript 6)
-var { x, y } = y;
-
-// import/export declarations (EcmaScript 6)
-import { foo } from "bar";
-export { foo };
-```
-
-## Rule Details
-
-This rule enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"never"` (default) disallows spacing inside of braces
-* `"always"` requires spacing inside of braces (except `{}`)
-
-Object option:
-
-* `"arraysInObjects": true` requires spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to `never`)
-* `"arraysInObjects": false` disallows spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to `always`)
-* `"objectsInObjects": true` requires spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to `never`)
-* `"objectsInObjects": false` disallows spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to `always`)
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint object-curly-spacing: ["error", "never"]*/
-
-var obj = { 'foo': 'bar' };
-var obj = {'foo': 'bar' };
-var obj = { baz: {'foo': 'qux'}, bar};
-var obj = {baz: { 'foo': 'qux'}, bar};
-var {x } = y;
-import { foo } from 'bar';
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint object-curly-spacing: ["error", "never"]*/
-
-var obj = {'foo': 'bar'};
-var obj = {'foo': {'bar': 'baz'}, 'qux': 'quxx'};
-var obj = {
-  'foo': 'bar'
-};
-var obj = {'foo': 'bar'
-};
-var obj = {
-  'foo':'bar'};
-var obj = {};
-var {x} = y;
-import {foo} from 'bar';
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint object-curly-spacing: ["error", "always"]*/
-
-var obj = {'foo': 'bar'};
-var obj = {'foo': 'bar' };
-var obj = { baz: {'foo': 'qux'}, bar};
-var obj = {baz: { 'foo': 'qux' }, bar};
-var obj = {'foo': 'bar'
-};
-var obj = {
-  'foo':'bar'};
-var {x} = y;
-import {foo } from 'bar';
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint object-curly-spacing: ["error", "always"]*/
-
-var obj = {};
-var obj = { 'foo': 'bar' };
-var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
-var obj = {
-  'foo': 'bar'
-};
-var { x } = y;
-import { foo } from 'bar';
-```
-
-#### arraysInObjects
-
-Examples of additional **correct** code for this rule with the `"never", { "arraysInObjects": true }` options:
-
-```js
-/*eslint object-curly-spacing: ["error", "never", { "arraysInObjects": true }]*/
-
-var obj = {"foo": [ 1, 2 ] };
-var obj = {"foo": [ "baz", "bar" ] };
-```
-
-Examples of additional **correct** code for this rule with the `"always", { "arraysInObjects": false }` options:
-
-```js
-/*eslint object-curly-spacing: ["error", "always", { "arraysInObjects": false }]*/
-
-var obj = { "foo": [ 1, 2 ]};
-var obj = { "foo": [ "baz", "bar" ]};
-```
-
-#### objectsInObjects
-
-Examples of additional **correct** code for this rule with the `"never", { "objectsInObjects": true }` options:
-
-```js
-/*eslint object-curly-spacing: ["error", "never", { "objectsInObjects": true }]*/
-
-var obj = {"foo": {"baz": 1, "bar": 2} };
-```
-
-Examples of additional **correct** code for this rule with the `"always", { "objectsInObjects": false }` options:
-
-```js
-/*eslint object-curly-spacing: ["error", "always", { "objectsInObjects": false }]*/
-
-var obj = { "foo": { "baz": 1, "bar": 2 }};
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing between curly braces.
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [comma-spacing](comma-spacing.md)
-* [computed-property-spacing](computed-property-spacing.md)
-* [space-in-parens](space-in-parens.md)
diff --git a/eslint/docs/rules/object-property-newline.md b/eslint/docs/rules/object-property-newline.md
deleted file mode 100644 (file)
index 893e54f..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-# enforce placing object properties on separate lines (object-property-newline)
-
-This rule permits you to restrict the locations of property specifications in object literals. You may prohibit any part of any property specification from appearing on the same line as any part of any other property specification. You may make this prohibition absolute, or, by invoking an object option, you may allow an exception, permitting an object literal to have all parts of all of its property specifications on a single line.
-
-## Rule Details
-
-### Motivations
-
-This rule makes it possible to ensure, as some style guides require, that property specifications appear on separate lines for better readability. For example, you can prohibit all of these:
-
-```js
-const newObject = {a: 1, b: [2, {a: 3, b: 4}]};
-const newObject = {
-    a: 1, b: [2, {a: 3, b: 4}]
-};
-const newObject = {
-    a: 1,
-    b: [2, {a: 3, b: 4}]
-};
-const newObject = {
-    a: 1,
-    b: [
-        2,
-        {a: 3, b: 4}
-    ]
-};
-
-```
-
-Instead of those, you can comply with the rule by writing
-
-```js
-const newObject = {
-    a: 1,
-    b: [2, {
-        a: 3,
-        b: 4
-    }]
-};
-```
-
-or
-
-```js
-const newObject = {
-    a: 1,
-    b: [
-        2,
-        {
-            a: 3,
-            b: 4
-        }
-    ]
-};
-```
-
-Another benefit of this rule is specificity of diffs when a property is changed:
-
-```diff
-// More specific
- var obj = {
-     foo: "foo",
--    bar: "bar",
-+    bar: "bazz",
-     baz: "baz"
- };
-```
-
-```diff
-// Less specific
--var obj = { foo: "foo", bar: "bar", baz: "baz" };
-+var obj = { foo: "foo", bar: "bazz", baz: "baz" };
-```
-
-### Optional Exception
-
-The rule offers one object option, `allowAllPropertiesOnSameLine` (a deprecated synonym is `allowMultiplePropertiesPerLine`). If you set it to `true`, object literals such as the first two above, with all property specifications on the same line, will be permitted, but one like
-
-```js
-const newObject = {
-    a: 'a.m.', b: 'p.m.',
-    c: 'daylight saving time'
-};
-
-```
-
-will be prohibited, because two properties, but not all properties, appear on the same line.
-
-### Notations
-
-This rule applies equally to all property specifications, regardless of notation, including:
-
-- `a: 1` (ES5)
-- `a` (ES2015 shorthand property)
-- ``[`prop${a}`]`` (ES2015 computed property name)
-
-Thus, the rule (without the object option) prohibits both of these:
-
-```js
-const newObject = {
-    a: 1, [
-        process.argv[4]
-    ]: '01'
-};
-const newObject = {
-    a: 1, [process.argv[4]]: '01'
-};
-```
-
-(This behavior differs from that of the JSCS rule cited below, which does not treat the leading `[` of a computed property name as part of that property specification. The JSCS rule prohibits the second of these formats but permits the first.)
-
-### Multiline Properties
-
-The rule prohibits the colocation on any line of at least 1 character of one property specification with at least 1 character of any other property specification. For example, the rule prohibits
-
-```js
-const newObject = {a: [
-    'Officiële website van de Europese Unie',
-    'Официален уебсайт на Европейския съюз'
-], b: 2};
-```
-
-because 1 character of the specification of `a` (i.e. the trailing `]` of its value) is on the same line as the specification of `b`.
-
-The optional exception does not excuse this case, because the entire collection of property specifications spans 4 lines, not 1.
-
-### Inter-property Delimiters
-
-The comma and any whitespace that delimit property specifications are not considered parts of them. Therefore, the rule permits both of these formats:
-
-```js
-const newFunction = multiplier => ({
-    a: 2 * multiplier,
-    b: 4 * multiplier,
-    c: 8 * multiplier
-});
-const newFunction = multiplier => ({
-    a: 2 * multiplier
-    , b: 4 * multiplier
-    , c: 8 * multiplier
-});
-```
-
-(This behavior differs from that of the JSCS rule cited below, which permits the first but prohibits the second format.)
-
-### --fix
-
-If this rule is invoked with the command-line `--fix` option, object literals that violate the rule are generally modified to comply with it. The modification in each case is to move a property specification to the next line whenever there is part or all of a previous property specification on the same line. For example,
-
-```js
-const newObject = {
-    a: 'a.m.', b: 'p.m.',
-    c: 'daylight saving time'
-};
-```
-
-is converted to
-
-```js
-const newObject = {
-    a: 'a.m.',
-b: 'p.m.',
-    c: 'daylight saving time'
-};
-```
-
-The modification does not depend on whether the object option is set to `true`. In other words, ESLint never collects all the property specifications onto a single line, even when the object option would permit that.
-
-ESLint does not correct a violation of this rule if a comment immediately precedes the second or subsequent property specification on a line, since ESLint cannot determine which line to put the comment onto.
-
-As illustrated above, the `--fix` option, applied to this rule, does not comply with other rules, such as `indent`, but, if those other rules are also in effect, the option applies them, too.
-
-## Examples
-
-Examples of **incorrect** code for this rule, with no object option or with `allowAllPropertiesOnSameLine` set to `false`:
-
-```js
-/*eslint object-property-newline: "error"*/
-
-const obj0 = { foo: "foo", bar: "bar", baz: "baz" };
-
-const obj1 = {
-    foo: "foo", bar: "bar", baz: "baz"
-};
-
-const obj2 = {
-    foo: "foo", bar: "bar",
-    baz: "baz"
-};
-
-const obj3 = {
-    [process.argv[3] ? "foo" : "bar"]: 0, baz: [
-        1,
-        2,
-        4,
-        8
-    ]
-};
-
-const a = "antidisestablishmentarianistically";
-const b = "yugoslavyalılaştırabildiklerimizdenmişsiniz";
-const obj4 = {a, b};
-
-const domain = process.argv[4];
-const obj5 = {
-    foo: "foo", [
-    domain.includes(":") ? "complexdomain" : "simpledomain"
-]: true};
-```
-
-Examples of **correct** code for this rule, with no object option or with `allowAllPropertiesOnSameLine` set to `false`:
-
-```js
-/*eslint object-property-newline: "error"*/
-
-const obj1 = {
-    foo: "foo",
-    bar: "bar",
-    baz: "baz"
-};
-
-const obj2 = {
-    foo: "foo"
-    , bar: "bar"
-    , baz: "baz"
-};
-
-const user = process.argv[2];
-const obj3 = {
-    user,
-    [process.argv[3] ? "foo" : "bar"]: 0,
-    baz: [
-        1,
-        2,
-        4,
-        8
-    ]
-};
-```
-
-Examples of additional **correct** code for this rule with the `{ "allowAllPropertiesOnSameLine": true }` option:
-
-```js
-/*eslint object-property-newline: ["error", { "allowAllPropertiesOnSameLine": true }]*/
-
-const obj = { foo: "foo", bar: "bar", baz: "baz" };
-
-const obj2 = {
-    foo: "foo", bar: "bar", baz: "baz"
-};
-const user = process.argv[2];
-const obj3 = {
-    user, [process.argv[3] ? "foo" : "bar"]: 0, baz: [1, 2, 4, 8]
-};
-```
-
-## When Not To Use It
-
-You can turn this rule off if you want to decide, case-by-case, whether to place property specifications on separate lines.
-
-## Compatibility
-
-- **JSCS**: This rule provides partial compatibility with [requireObjectKeysOnNewLine](https://jscs-dev.github.io/rule/requireObjectKeysOnNewLine).
-
-## Related Rules
-
-- [brace-style](brace-style.md)
-- [comma-dangle](comma-dangle.md)
-- [key-spacing](key-spacing.md)
-- [object-curly-spacing](object-curly-spacing.md)
diff --git a/eslint/docs/rules/object-shorthand.md b/eslint/docs/rules/object-shorthand.md
deleted file mode 100644 (file)
index fee0e62..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-# Require Object Literal Shorthand Syntax (object-shorthand)
-
-ECMAScript 6 provides a concise form for defining object literal methods and properties. This
-syntax can make defining complex object literals much cleaner.
-
-Here are a few common examples using the ES5 syntax:
-
-```js
-// properties
-var foo = {
-    x: x,
-    y: y,
-    z: z,
-};
-
-// methods
-var foo = {
-    a: function() {},
-    b: function() {}
-};
-```
-
-Now here are ES6 equivalents:
-
-```js
-/*eslint-env es6*/
-
-// properties
-var foo = {x, y, z};
-
-// methods
-var foo = {
-    a() {},
-    b() {}
-};
-```
-
-## Rule Details
-
-This rule enforces the use of the shorthand syntax. This applies
-to all methods (including generators) defined in object literals and any
-properties defined where the key name matches name of the assigned variable.
-
-Each of the following properties would warn:
-
-```js
-/*eslint object-shorthand: "error"*/
-/*eslint-env es6*/
-
-var foo = {
-    w: function() {},
-    x: function *() {},
-    [y]: function() {},
-    z: z
-};
-```
-
-In that case the expected syntax would have been:
-
-```js
-/*eslint object-shorthand: "error"*/
-/*eslint-env es6*/
-
-var foo = {
-    w() {},
-    *x() {},
-    [y]() {},
-    z
-};
-```
-
-This rule does not flag arrow functions inside of object literals.
-The following will *not* warn:
-
-```js
-/*eslint object-shorthand: "error"*/
-/*eslint-env es6*/
-
-var foo = {
-    x: (y) => y
-};
-```
-
-See Also:
-
-- [`no-useless-rename`](https://eslint.org/docs/rules/no-useless-rename) which disallows renaming import, export, and destructured assignments to the same name.
-
-## Options
-
-The rule takes an option which specifies when it should be applied. It can be set to one of the following values:
-
-- `"always"` (default) expects that the shorthand will be used whenever possible.
-- `"methods"` ensures the method shorthand is used (also applies to generators).
-- `"properties"` ensures the property shorthand is used (where the key and variable name match).
-- `"never"` ensures that no property or method shorthand is used in any object literal.
-- `"consistent"` ensures that either all shorthand or all long-form will be used in an object literal.
-- `"consistent-as-needed"` ensures that either all shorthand or all long-form will be used in an object literal, but ensures all shorthand whenever possible.
-
-You can set the option in configuration like this:
-
-```json
-{
-    "object-shorthand": ["error", "always"]
-}
-```
-
-Additionally, the rule takes an optional object configuration:
-
-- `"avoidQuotes": true` indicates that long-form syntax is preferred whenever the object key is a string literal (default: `false`). Note that this option can only be enabled when the string option is set to `"always"`, `"methods"`, or `"properties"`.
-- `"ignoreConstructors": true` can be used to prevent the rule from reporting errors for constructor functions. (By default, the rule treats constructors the same way as other functions.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`.
-- `"avoidExplicitReturnArrows": true` indicates that methods are preferred over explicit-return arrow functions for function properties. (By default, the rule allows either of these.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`.
-
-### `avoidQuotes`
-
-```json
-{
-    "object-shorthand": ["error", "always", { "avoidQuotes": true }]
-}
-```
-
-Example of **incorrect** code for this rule with the `"always", { "avoidQuotes": true }` option:
-
-```js
-/*eslint object-shorthand: ["error", "always", { "avoidQuotes": true }]*/
-/*eslint-env es6*/
-
-var foo = {
-    "bar-baz"() {}
-};
-```
-
-Example of **correct** code for this rule with the `"always", { "avoidQuotes": true }` option:
-
-```js
-/*eslint object-shorthand: ["error", "always", { "avoidQuotes": true }]*/
-/*eslint-env es6*/
-
-var foo = {
-    "bar-baz": function() {},
-    "qux": qux
-};
-```
-
-### `ignoreConstructors`
-
-```json
-{
-    "object-shorthand": ["error", "always", { "ignoreConstructors": true }]
-}
-```
-
-Example of **correct** code for this rule with the `"always", { "ignoreConstructors": true }` option:
-
-```js
-/*eslint object-shorthand: ["error", "always", { "ignoreConstructors": true }]*/
-/*eslint-env es6*/
-
-var foo = {
-    ConstructorFunction: function() {}
-};
-```
-
-### `avoidExplicitReturnArrows`
-
-```json
-{
-    "object-shorthand": ["error", "always", { "avoidExplicitReturnArrows": true }]
-}
-```
-
-Example of **incorrect** code for this rule with the `"always", { "avoidExplicitReturnArrows": true }` option:
-
-```js
-/*eslint object-shorthand: ["error", "always", { "avoidExplicitReturnArrows": true }]*/
-/*eslint-env es6*/
-
-var foo = {
-  foo: (bar, baz) => {
-    return bar + baz;
-  },
-
-  qux: (foobar) => {
-    return foobar * 2;
-  }
-};
-```
-
-Example of **correct** code for this rule with the `"always", { "avoidExplicitReturnArrows": true }` option:
-
-```js
-/*eslint object-shorthand: ["error", "always", { "avoidExplicitReturnArrows": true }]*/
-/*eslint-env es6*/
-
-var foo = {
-  foo(bar, baz) {
-    return bar + baz;
-  },
-
-  qux: foobar => foobar * 2
-};
-```
-
-Example of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint object-shorthand: [2, "consistent"]*/
-/*eslint-env es6*/
-
-var foo = {
-    a,
-    b: "foo",
-};
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint object-shorthand: [2, "consistent"]*/
-/*eslint-env es6*/
-
-var foo = {
-    a: a,
-    b: "foo"
-};
-
-var bar = {
-    a,
-    b,
-};
-```
-
-Example of **incorrect** code with the `"consistent-as-needed"` option, which is very similar to `"consistent"`:
-
-```js
-/*eslint object-shorthand: [2, "consistent-as-needed"]*/
-/*eslint-env es6*/
-
-var foo = {
-    a: a,
-    b: b,
-};
-```
-
-## When Not To Use It
-
-Anyone not yet in an ES6 environment would not want to apply this rule. Others may find the terseness of the shorthand
-syntax harder to read and may not want to encourage it with this rule.
-
-## Further Reading
-
-[Object initializer - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer)
diff --git a/eslint/docs/rules/one-var-declaration-per-line.md b/eslint/docs/rules/one-var-declaration-per-line.md
deleted file mode 100644 (file)
index 90f67a9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# require or disallow newlines around variable declarations (one-var-declaration-per-line)
-
-Some developers declare multiple var statements on the same line:
-
-```js
-var foo, bar, baz;
-```
-
-Others prefer to declare one var per line.
-
-```js
-var foo,
-    bar,
-    baz;
-```
-
-Keeping to one of these styles across a project's codebase can help with maintaining code consistency.
-
-## Rule Details
-
-This rule enforces a consistent newlines around variable declarations. This rule ignores variable declarations inside `for` loop conditionals.
-
-## Options
-
-This rule has a single string option:
-
-* `"initializations"` (default) enforces a newline around variable initializations
-* `"always"` enforces a newline around variable declarations
-
-### initializations
-
-Examples of **incorrect** code for this rule with the default `"initializations"` option:
-
-```js
-/*eslint one-var-declaration-per-line: ["error", "initializations"]*/
-/*eslint-env es6*/
-
-var a, b, c = 0;
-
-let a,
-    b = 0, c;
-```
-
-Examples of **correct** code for this rule with the default `"initializations"` option:
-
-```js
-/*eslint one-var-declaration-per-line: ["error", "initializations"]*/
-/*eslint-env es6*/
-
-var a, b;
-
-let a,
-    b;
-
-let a,
-    b = 0;
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint one-var-declaration-per-line: ["error", "always"]*/
-/*eslint-env es6*/
-
-var a, b;
-
-let a, b = 0;
-
-const a = 0, b = 0;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint one-var-declaration-per-line: ["error", "always"]*/
-/*eslint-env es6*/
-
-var a,
-    b;
-
-let a,
-    b = 0;
-```
-
-## Related Rules
-
-* [one-var](one-var.md)
diff --git a/eslint/docs/rules/one-var.md b/eslint/docs/rules/one-var.md
deleted file mode 100644 (file)
index df7ee1f..0000000
+++ /dev/null
@@ -1,613 +0,0 @@
-# enforce variables to be declared either together or separately in functions (one-var)
-
-Variables can be declared at any point in JavaScript code using `var`, `let`, or `const`. There are many styles and preferences related to the declaration of variables, and one of those is deciding on how many variable declarations should be allowed in a single function.
-
-There are two schools of thought in this regard:
-
-1. There should be just one variable declaration for all variables in the function. That declaration typically appears at the top of the function.
-1. You should use one variable declaration for each variable you want to define.
-
-For instance:
-
-```js
-// one variable declaration per function
-function foo() {
-    var bar, baz;
-}
-
-// multiple variable declarations per function
-function foo() {
-    var bar;
-    var baz;
-}
-```
-
-The single-declaration school of thought is based in pre-ECMAScript 6 behaviors, where there was no such thing as block scope, only function scope. Since all `var` statements are hoisted to the top of the function anyway, some believe that declaring all variables in a single declaration at the top of the function removes confusion around scoping rules.
-
-## Rule Details
-
-This rule enforces variables to be declared either together or separately per function ( for `var`) or block (for `let` and `const`) scope.
-
-## Options
-
-This rule has one option, which can be a string option or an object option.
-
-String option:
-
-* `"always"` (default) requires one variable declaration per scope
-* `"never"` requires multiple variable declarations per scope
-* `"consecutive"` allows multiple variable declarations per scope but requires consecutive variable declarations to be combined into a single declaration
-
-Object option:
-
-* `"var": "always"` requires one `var` declaration per function
-* `"var": "never"` requires multiple `var` declarations per function
-* `"var": "consecutive"` requires consecutive `var` declarations to be a single declaration
-* `"let": "always"` requires one `let` declaration per block
-* `"let": "never"` requires multiple `let` declarations per block
-* `"let": "consecutive"` requires consecutive `let` declarations to be a single declaration
-* `"const": "always"` requires one `const` declaration per block
-* `"const": "never"` requires multiple `const` declarations per block
-* `"const": "consecutive"` requires consecutive `const` declarations to be a single declaration
-* `"separateRequires": true` enforces `requires` to be separate from declarations
-
-Alternate object option:
-
-* `"initialized": "always"` requires one variable declaration for initialized variables per scope
-* `"initialized": "never"` requires multiple variable declarations for initialized variables per scope
-* `"initialized": "consecutive"` requires consecutive variable declarations for initialized variables to be a single declaration
-* `"uninitialized": "always"` requires one variable declaration for uninitialized variables per scope
-* `"uninitialized": "never"` requires multiple variable declarations for uninitialized variables per scope
-* `"uninitialized": "consecutive"` requires consecutive variable declarations for uninitialized variables to be a single declaration
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint one-var: ["error", "always"]*/
-
-function foo() {
-    var bar;
-    var baz;
-    let qux;
-    let norf;
-}
-
-function foo(){
-    const bar = false;
-    const baz = true;
-    let qux;
-    let norf;
-}
-
-function foo() {
-    var bar;
-
-    if (baz) {
-        var qux = true;
-    }
-}
-
-class C {
-    static {
-        var foo;
-        var bar;
-    }
-
-    static {
-        var foo;
-        if (bar) {
-            var baz = true;
-        }
-    }
-
-    static {
-        let foo;
-        let bar;
-    }
-}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint one-var: ["error", "always"]*/
-
-function foo() {
-    var bar,
-        baz;
-    let qux,
-        norf;
-}
-
-function foo(){
-    const bar = true,
-        baz = false;
-    let qux,
-        norf;
-}
-
-function foo() {
-    var bar,
-        qux;
-
-    if (baz) {
-        qux = true;
-    }
-}
-
-function foo(){
-    let bar;
-
-    if (baz) {
-        let qux;
-    }
-}
-
-class C {
-    static {
-        var foo, bar;
-    }
-
-    static {
-        var foo, baz;
-        if (bar) {
-            baz = true;
-        }
-    }
-
-    static {
-        let foo, bar;
-    }
-
-    static {
-        let foo;
-        if (bar) {
-            let baz;
-        }
-    }
-}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint one-var: ["error", "never"]*/
-
-function foo() {
-    var bar,
-        baz;
-    const bar = true,
-        baz = false;
-}
-
-function foo() {
-    var bar,
-        qux;
-
-    if (baz) {
-        qux = true;
-    }
-}
-
-function foo(){
-    let bar = true,
-        baz = false;
-}
-
-class C {
-    static {
-        var foo, bar;
-        let baz, qux;
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint one-var: ["error", "never"]*/
-
-function foo() {
-    var bar;
-    var baz;
-}
-
-function foo() {
-    var bar;
-
-    if (baz) {
-        var qux = true;
-    }
-}
-
-function foo() {
-    let bar;
-
-    if (baz) {
-        let qux = true;
-    }
-}
-
-class C {
-    static {
-        var foo;
-        var bar;
-        let baz;
-        let qux;
-    }
-}
-```
-
-### consecutive
-
-Examples of **incorrect** code for this rule with the `"consecutive"` option:
-
-```js
-/*eslint one-var: ["error", "consecutive"]*/
-
-function foo() {
-    var bar;
-    var baz;
-}
-
-function foo(){
-    var bar = 1;
-    var baz = 2;
-
-    qux();
-
-    var qux = 3;
-    var quux;
-}
-
-class C {
-    static {
-        var foo;
-        var bar;
-        let baz;
-        let qux;
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `"consecutive"` option:
-
-```js
-/*eslint one-var: ["error", "consecutive"]*/
-
-function foo() {
-    var bar,
-        baz;
-}
-
-function foo(){
-    var bar = 1,
-        baz = 2;
-
-    qux();
-
-    var qux = 3,
-        quux;
-}
-
-class C {
-    static {
-        var foo, bar;
-        let baz, qux;
-        doSomething();
-        let quux;
-        var quuux;
-    }
-}
-```
-
-### var, let, and const
-
-Examples of **incorrect** code for this rule with the `{ var: "always", let: "never", const: "never" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "always", let: "never", const: "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar;
-    var baz;
-    let qux,
-        norf;
-}
-
-function foo() {
-    const bar = 1,
-          baz = 2;
-    let qux,
-        norf;
-}
-```
-
-Examples of **correct** code for this rule with the `{ var: "always", let: "never", const: "never" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "always", let: "never", const: "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar,
-        baz;
-    let qux;
-    let norf;
-}
-
-function foo() {
-    const bar = 1;
-    const baz = 2;
-    let qux;
-    let norf;
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ var: "never" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar,
-        baz;
-}
-```
-
-Examples of **correct** code for this rule with the `{ var: "never" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var bar,
-        baz;
-    const bar = 1; // `const` and `let` declarations are ignored if they are not specified
-    const baz = 2;
-    let qux;
-    let norf;
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ separateRequires: true }` option:
-
-```js
-/*eslint one-var: ["error", { separateRequires: true, var: "always" }]*/
-/*eslint-env node*/
-
-var foo = require("foo"),
-    bar = "bar";
-```
-
-Examples of **correct** code for this rule with the `{ separateRequires: true }` option:
-
-```js
-/*eslint one-var: ["error", { separateRequires: true, var: "always" }]*/
-/*eslint-env node*/
-
-var foo = require("foo");
-var bar = "bar";
-```
-
-```js
-var foo = require("foo"),
-    bar = require("bar");
-```
-
-Examples of **incorrect** code for this rule with the `{ var: "never", let: "consecutive", const: "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "never", let: "consecutive", const: "consecutive" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    let a,
-        b;
-    let c;
-
-    var d,
-        e;
-}
-
-function foo() {
-    const a = 1,
-        b = 2;
-    const c = 3;
-
-    var d,
-        e;
-}
-```
-
-Examples of **correct** code for this rule with the `{ var: "never", let: "consecutive", const: "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "never", let: "consecutive", const: "consecutive" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    let a,
-        b;
-
-    var d;
-    var e;
-
-    let f;
-}
-
-function foo() {
-    const a = 1,
-          b = 2;
-
-    var c;
-    var d;
-
-    const e = 3;
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ var: "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "consecutive" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var a;
-    var b;
-}
-```
-
-Examples of **correct** code for this rule with the `{ var: "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { var: "consecutive" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var a,
-        b;
-    const c = 1; // `const` and `let` declarations are ignored if they are not specified
-    const d = 2;
-    let e;
-    let f;
-}
-```
-
-### initialized and uninitialized
-
-Examples of **incorrect** code for this rule with the `{ "initialized": "always", "uninitialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "always", "uninitialized": "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var a, b, c;
-    var foo = true;
-    var bar = false;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "initialized": "always", "uninitialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "always", "uninitialized": "never" }]*/
-
-function foo() {
-    var a;
-    var b;
-    var c;
-    var foo = true,
-        bar = false;
-}
-
-for (let z of foo) {
-    doSomething(z);
-}
-
-let z;
-for (z of foo) {
-    doSomething(z);
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "initialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "never" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    var foo = true,
-        bar = false;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "initialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "never" }]*/
-
-function foo() {
-    var foo = true;
-    var bar = false;
-    var a, b, c; // Uninitialized variables are ignored
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "initialized": "consecutive", "uninitialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "consecutive", "uninitialized": "never" }]*/
-
-function foo() {
-    var a = 1;
-    var b = 2;
-    var c,
-        d;
-    var e = 3;
-    var f = 4;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "initialized": "consecutive", "uninitialized": "never" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "consecutive", "uninitialized": "never" }]*/
-
-function foo() {
-    var a = 1,
-        b = 2;
-    var c;
-    var d;
-    var e = 3,
-        f = 4;
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "initialized": "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "consecutive" }]*/
-
-function foo() {
-    var a = 1;
-    var b = 2;
-
-    foo();
-
-    var c = 3;
-    var d = 4;
-}
-```
-
-Examples of **correct** code for this rule with the `{ "initialized": "consecutive" }` option:
-
-```js
-/*eslint one-var: ["error", { "initialized": "consecutive" }]*/
-
-function foo() {
-    var a = 1,
-        b = 2;
-
-    foo();
-
-    var c = 3,
-        d = 4;
-}
-```
-
-## Compatibility
-
-* **JSHint**: This rule maps to the `onevar` JSHint rule, but allows `let` and `const` to be configured separately.
-* **JSCS**: This rule roughly maps to [disallowMultipleVarDecl](https://jscs-dev.github.io/rule/disallowMultipleVarDecl).
-* **JSCS**: This rule option `separateRequires` roughly maps to [requireMultipleVarDecl](https://jscs-dev.github.io/rule/requireMultipleVarDecl).
diff --git a/eslint/docs/rules/operator-assignment.md b/eslint/docs/rules/operator-assignment.md
deleted file mode 100644 (file)
index b926462..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# require or disallow assignment operator shorthand where possible (operator-assignment)
-
-JavaScript provides shorthand operators that combine variable assignment and some simple mathematical operations. For example, `x = x + 4` can be shortened to `x += 4`. The supported shorthand forms are as follows:
-
-```text
- Shorthand | Separate
------------|------------
- x += y    | x = x + y
- x -= y    | x = x - y
- x *= y    | x = x * y
- x /= y    | x = x / y
- x %= y    | x = x % y
- x **= y   | x = x ** y
- x <<= y   | x = x << y
- x >>= y   | x = x >> y
- x >>>= y  | x = x >>> y
- x &= y    | x = x & y
- x ^= y    | x = x ^ y
- x |= y    | x = x | y
-```
-
-## Rule Details
-
-This rule requires or disallows assignment operator shorthand where possible.
-
-The rule applies to the operators listed in the above table. It does not report the logical assignment operators `&&=`, `||=`, and `??=` because their short-circuiting behavior is different from the other assignment operators.
-
-## Options
-
-This rule has a single string option:
-
-* `"always"` (default)  requires assignment operator shorthand where possible
-* `"never"` disallows assignment operator shorthand
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint operator-assignment: ["error", "always"]*/
-
-x = x + y;
-x = y * x;
-x[0] = x[0] / y;
-x.y = x.y << z;
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint operator-assignment: ["error", "always"]*/
-
-x = y;
-x += y;
-x = y * z;
-x = (x * y) * z;
-x[0] /= y;
-x[foo()] = x[foo()] % 2;
-x = y + x; // `+` is not always commutative (e.g. x = "abc")
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint operator-assignment: ["error", "never"]*/
-
-x *= y;
-x ^= (y + z) / foo();
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint operator-assignment: ["error", "never"]*/
-
-x = x + y;
-x.y = x.y / a.b;
-```
-
-## When Not To Use It
-
-Use of operator assignment shorthand is a stylistic choice. Leaving this rule turned off would allow developers to choose which style is more readable on a case-by-case basis.
diff --git a/eslint/docs/rules/operator-linebreak.md b/eslint/docs/rules/operator-linebreak.md
deleted file mode 100644 (file)
index 6ae484e..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-# enforce consistent linebreak style for operators (operator-linebreak)
-
-When a statement is too long to fit on a single line, line breaks are generally inserted next to the operators separating expressions. The first style coming to mind would be to place the operator at the end of the line, following the English punctuation rules.
-
-```js
-var fullHeight = borderTop +
-                 innerHeight +
-                 borderBottom;
-```
-
-Some developers find that placing operators at the beginning of the line makes the code more readable.
-
-```js
-var fullHeight = borderTop
-               + innerHeight
-               + borderBottom;
-```
-
-## Rule Details
-
-This rule enforces a consistent linebreak style for operators.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"after"` requires linebreaks to be placed after the operator
-* `"before"` requires linebreaks to be placed before the operator
-* `"none"` disallows linebreaks on either side of the operator
-
-Object option:
-
-* `"overrides"` overrides the global setting for specified operators
-
-The default configuration is `"after", { "overrides": { "?": "before", ":": "before" } }`
-
-### after
-
-Examples of **incorrect** code for this rule with the `"after"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after"]*/
-
-foo = 1
-+
-2;
-
-foo = 1
-    + 2;
-
-foo
-    = 5;
-
-if (someCondition
-    || otherCondition) {
-}
-
-answer = everything
-  ? 42
-  : foo;
-
-class Foo {
-    a
-        = 1;
-    [b]
-        = 2;
-    [c
-    ]
-        = 3;
-}
-```
-
-Examples of **correct** code for this rule with the `"after"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after"]*/
-
-foo = 1 + 2;
-
-foo = 1 +
-      2;
-
-foo =
-    5;
-
-if (someCondition ||
-    otherCondition) {
-}
-
-answer = everything ?
-  42 :
-  foo;
-
-class Foo {
-    a =
-        1;
-    [b] =
-        2;
-    [c
-    ] =
-        3;
-    d = 4;
-}
-```
-
-### before
-
-Examples of **incorrect** code for this rule with the `"before"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "before"]*/
-
-foo = 1 +
-      2;
-
-foo =
-    5;
-
-if (someCondition ||
-    otherCondition) {
-}
-
-answer = everything ?
-  42 :
-  foo;
-
-class Foo {
-    a =
-        1;
-    [b] =
-        2;
-    [c
-    ] =
-        3;
-}
-```
-
-Examples of **correct** code for this rule with the `"before"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "before"]*/
-
-foo = 1 + 2;
-
-foo = 1
-    + 2;
-
-foo
-    = 5;
-
-if (someCondition
-    || otherCondition) {
-}
-
-answer = everything
-  ? 42
-  : foo;
-
-class Foo {
-    a
-        = 1;
-    [b]
-        = 2;
-    [c
-    ]
-        = 3;
-    d = 4;
-}
-```
-
-### none
-
-Examples of **incorrect** code for this rule with the `"none"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "none"]*/
-
-foo = 1 +
-      2;
-
-foo = 1
-    + 2;
-
-if (someCondition ||
-    otherCondition) {
-}
-
-if (someCondition
-    || otherCondition) {
-}
-
-answer = everything
-  ? 42
-  : foo;
-
-answer = everything ?
-  42 :
-  foo;
-
-class Foo {
-    a =
-        1;
-    [b] =
-        2;
-    [c
-    ] =
-        3;
-    d
-        = 4;
-    [e]
-        = 5;
-    [f
-    ]
-        = 6;
-}
-```
-
-Examples of **correct** code for this rule with the `"none"` option:
-
-```js
-/*eslint operator-linebreak: ["error", "none"]*/
-
-foo = 1 + 2;
-
-foo = 5;
-
-if (someCondition || otherCondition) {
-}
-
-answer = everything ? 42 : foo;
-
-class Foo {
-    a = 1;
-    [b] = 2;
-    [c
-    ] = 3;
-    d = 4;
-    [e] = 5;
-    [f
-    ] = 6;
-}
-```
-
-### overrides
-
-Examples of additional **incorrect** code for this rule with the `{ "overrides": { "+=": "before" } }` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after", { "overrides": { "+=": "before" } }]*/
-
-var thing = 'thing';
-thing +=
-  's';
-```
-
-Examples of additional **correct** code for this rule with the `{ "overrides": { "+=": "before" } }` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after", { "overrides": { "+=": "before" } }]*/
-
-var thing = 'thing';
-thing
-  += 's';
-```
-
-Examples of additional **correct** code for this rule with the `{ "overrides": { "?": "ignore", ":": "ignore" } }` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]*/
-
-answer = everything ?
-  42
-  : foo;
-
-answer = everything
-  ?
-  42
-  :
-  foo;
-```
-
-Examples of **incorrect** code for this rule with the default `"after", { "overrides": { "?": "before", ":": "before" } }` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "before", ":": "before" } }]*/
-
-foo = 1
-+
-2;
-
-foo = 1
-    + 2;
-
-foo
-    = 5;
-
-if (someCondition
-    || otherCondition) {
-}
-
-answer = everything ?
-  42 :
-  foo;
-```
-
-Examples of **correct** code for this rule with the default `"after", { "overrides": { "?": "before", ":": "before" } }` option:
-
-```js
-/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "before", ":": "before" } }]*/
-
-foo = 1 + 2;
-
-foo = 1 +
-      2;
-
-foo =
-    5;
-
-if (someCondition ||
-    otherCondition) {
-}
-
-answer = everything
-  ? 42
-  : foo;
-```
-
-## When Not To Use It
-
-If your project will not be using a common operator line break style, turn this rule off.
-
-## Related Rules
-
-* [comma-style](comma-style.md)
diff --git a/eslint/docs/rules/padded-blocks.md b/eslint/docs/rules/padded-blocks.md
deleted file mode 100644 (file)
index 85c0a8b..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-# require or disallow padding within blocks (padded-blocks)
-
-Some style guides require block statements to start and end with blank lines. The goal is
-to improve readability by visually separating the block content and the surrounding code.
-
-```js
-if (a) {
-
-    b();
-
-}
-```
-
-Since it's good to have a consistent code style, you should either always write
-padded blocks or never do it.
-
-## Rule Details
-
-This rule enforces consistent empty line padding within blocks.
-
-## Options
-
-This rule has two options, the first one can be a string option or an object option.
-The second one is an object option, it can allow exceptions.
-
-### First option
-
-String option:
-
-* `"always"` (default) requires empty lines at the beginning and ending of block statements, function bodies, class static blocks, classes, and `switch` statements.
-* `"never"` disallows empty lines at the beginning and ending of block statements, function bodies, class static blocks, classes, and `switch` statements.
-
-Object option:
-
-* `"blocks"` require or disallow padding within block statements, function bodies, and class static blocks
-* `"classes"` require or disallow padding within classes
-* `"switches"` require or disallow padding within `switch` statements
-
-### Second option
-
-* `"allowSingleLineBlocks": true` allows single-line blocks
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint padded-blocks: ["error", "always"]*/
-
-if (a) {
-    b();
-}
-
-if (a) { b(); }
-
-if (a)
-{
-    b();
-}
-
-if (a) {
-    b();
-
-}
-
-if (a) {
-    // comment
-    b();
-
-}
-
-class C {
-    static {
-        a();
-    }
-}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint padded-blocks: ["error", "always"]*/
-
-if (a) {
-
-    b();
-
-}
-
-if (a)
-{
-
-    b();
-
-}
-
-if (a) {
-
-    // comment
-    b();
-
-}
-
-class C {
-
-    static {
-
-        a();
-
-    }
-
-}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint padded-blocks: ["error", "never"]*/
-
-if (a) {
-
-    b();
-
-}
-
-if (a)
-{
-
-    b();
-
-}
-
-if (a) {
-
-    b();
-}
-
-if (a) {
-    b();
-
-}
-
-class C {
-
-    static {
-
-        a();
-
-    }
-
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint padded-blocks: ["error", "never"]*/
-
-if (a) {
-    b();
-}
-
-if (a)
-{
-    b();
-}
-
-class C {
-    static {
-        a();
-    }
-}
-```
-
-### blocks
-
-Examples of **incorrect** code for this rule with the `{ "blocks": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "blocks": "always" }]*/
-
-if (a) {
-    b();
-}
-
-if (a) { b(); }
-
-if (a)
-{
-    b();
-}
-
-if (a) {
-
-    b();
-}
-
-if (a) {
-    b();
-
-}
-
-if (a) {
-    // comment
-    b();
-
-}
-
-class C {
-
-    static {
-        a();
-    }
-
-}
-```
-
-Examples of **correct** code for this rule with the `{ "blocks": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "blocks": "always" }]*/
-
-if (a) {
-
-    b();
-
-}
-
-if (a)
-{
-
-    b();
-
-}
-
-if (a) {
-
-    // comment
-    b();
-
-}
-
-class C {
-
-    static {
-
-        a();
-
-    }
-
-}
-
-class D {
-    static {
-
-        a();
-
-    }
-
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "blocks": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "blocks": "never" }]*/
-
-if (a) {
-
-    b();
-
-}
-
-if (a)
-{
-
-    b();
-
-}
-
-if (a) {
-
-    b();
-}
-
-if (a) {
-    b();
-
-}
-
-class C {
-    static {
-
-        a();
-
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `{ "blocks": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "blocks": "never" }]*/
-
-if (a) {
-    b();
-}
-
-if (a)
-{
-    b();
-}
-
-class C {
-    static {
-        a();
-    }
-}
-
-class D {
-
-    static {
-        a();
-    }
-
-}
-```
-
-### classes
-
-Examples of **incorrect** code for this rule with the `{ "classes": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "classes": "always" }]*/
-
-class  A {
-    constructor(){
-    }
-}
-```
-
-Examples of **correct** code for this rule with the `{ "classes": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "classes": "always" }]*/
-
-class  A {
-
-    constructor(){
-    }
-
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "classes": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "classes": "never" }]*/
-
-class  A {
-
-    constructor(){
-    }
-
-}
-```
-
-Examples of **correct** code for this rule with the `{ "classes": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "classes": "never" }]*/
-
-class  A {
-    constructor(){
-    }
-}
-```
-
-### switches
-
-Examples of **incorrect** code for this rule with the `{ "switches": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "switches": "always" }]*/
-
-switch (a) {
-    case 0: foo();
-}
-```
-
-Examples of **correct** code for this rule with the `{ "switches": "always" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "switches": "always" }]*/
-
-switch (a) {
-
-    case 0: foo();
-
-}
-
-if (a) {
-    b();
-}
-```
-
-Examples of **incorrect** code for this rule with the `{ "switches": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "switches": "never" }]*/
-
-switch (a) {
-
-    case 0: foo();
-
-}
-```
-
-Examples of **correct** code for this rule with the `{ "switches": "never" }` option:
-
-```js
-/*eslint padded-blocks: ["error", { "switches": "never" }]*/
-
-switch (a) {
-    case 0: foo();
-}
-
-if (a) {
-
-    b();
-
-}
-```
-
-### always + allowSingleLineBlocks
-
-Examples of **incorrect** code for this rule with the `"always", {"allowSingleLineBlocks": true}` options:
-
-```js
-/*eslint padded-blocks: ["error", "always", { allowSingleLineBlocks: true }]*/
-
-if (a) {
-    b();
-}
-
-if (a) {
-
-    b();
-}
-
-if (a) {
-    b();
-
-}
-```
-
-Examples of **correct** code for this rule with the `"always", {"allowSingleLineBlocks": true}` options:
-
-```js
-/*eslint padded-blocks: ["error", "always", { allowSingleLineBlocks: true }]*/
-
-if (a) { b(); }
-
-if (a) {
-
-    b();
-
-}
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of padding within blocks.
-
-## Related Rules
-
-* [lines-between-class-members](lines-between-class-members.md)
-* [padding-line-between-statements](padding-line-between-statements.md)
diff --git a/eslint/docs/rules/padding-line-between-statements.md b/eslint/docs/rules/padding-line-between-statements.md
deleted file mode 100644 (file)
index 065c7d9..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-# Require or disallow padding lines between statements (padding-line-between-statements)
-
-This rule requires or disallows blank lines between the given 2 kinds of statements.
-Properly blank lines help developers to understand the code.
-
-For example, the following configuration requires a blank line between a variable declaration and a `return` statement.
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: "var", next: "return" }
-]*/
-
-function foo() {
-    var a = 1;
-
-    return a;
-}
-```
-
-## Rule Details
-
-This rule does nothing if no configurations are provided.
-
-A configuration is an object which has 3 properties; `blankLine`, `prev` and `next`. For example, `{ blankLine: "always", prev: "var", next: "return" }` means "one or more blank lines are required between a variable declaration and a `return` statement."
-You can supply any number of configurations. If a statement pair matches multiple configurations, the last matched configuration will be used.
-
-```json
-{
-    "padding-line-between-statements": [
-        "error",
-        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
-        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
-        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
-        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
-        ...
-    ]
-}
-```
-
-- `LINEBREAK_TYPE` is one of the following.
-    - `"any"` just ignores the statement pair.
-    - `"never"` disallows blank lines.
-    - `"always"` requires one or more blank lines. Note it does not count lines that comments exist as blank lines.
-
-- `STATEMENT_TYPE` is one of the following, or an array of the following.
-    - `"*"` is wildcard. This matches any statements.
-    - `"block"` is lonely blocks.
-    - `"block-like"` is block like statements. This matches statements that the last token is the closing brace of blocks; e.g. `{ }`, `if (a) { }`, and `while (a) { }`. Also matches immediately invoked function expression statements.
-    - `"break"` is `break` statements.
-    - `"case"` is `case` clauses in `switch` statements.
-    - `"cjs-export"` is `export` statements of CommonJS; e.g. `module.exports = 0`, `module.exports.foo = 1`, and `exports.foo = 2`. This is a special case of assignment.
-    - `"cjs-import"` is `import` statements of CommonJS; e.g. `const foo = require("foo")`. This is a special case of variable declarations.
-    - `"class"` is `class` declarations.
-    - `"const"` is `const` variable declarations, both single-line and multiline.
-    - `"continue"` is `continue` statements.
-    - `"debugger"` is `debugger` statements.
-    - `"default"` is `default` clauses in `switch` statements.
-    - `"directive"` is directive prologues. This matches directives; e.g. `"use strict"`.
-    - `"do"` is `do-while` statements. This matches all statements that the first token is `do` keyword.
-    - `"empty"` is empty statements.
-    - `"export"` is `export` declarations.
-    - `"expression"` is expression statements.
-    - `"for"` is `for` loop families. This matches all statements that the first token is `for` keyword.
-    - `"function"` is function declarations.
-    - `"if"` is `if` statements.
-    - `"iife"` is immediately invoked function expression statements. This matches calls on a function expression, optionally prefixed with a unary operator.
-    - `"import"` is `import` declarations.
-    - `"let"` is `let` variable declarations, both single-line and multiline.
-    - `"multiline-block-like"` is block like statements. This is the same as `block-like` type, but only if the block is multiline.
-    - `"multiline-const"` is multiline `const` variable declarations.
-    - `"multiline-expression"` is expression statements. This is the same as `expression` type, but only if the statement is multiline.
-    - `"multiline-let"` is multiline `let` variable declarations.
-    - `"multiline-var"` is multiline `var` variable declarations.
-    - `"return"` is `return` statements.
-    - `"singleline-const"` is single-line `const` variable declarations.
-    - `"singleline-let"` is single-line `let` variable declarations.
-    - `"singleline-var"` is single-line `var` variable declarations.
-    - `"switch"` is `switch` statements.
-    - `"throw"` is `throw` statements.
-    - `"try"` is `try` statements.
-    - `"var"` is `var` variable declarations, both single-line and multiline.
-    - `"while"` is `while` loop statements.
-    - `"with"` is `with` statements.
-
-## Examples
-
-This configuration would require blank lines before all `return` statements, like the [newline-before-return] rule.
-
-Examples of **incorrect** code for the `[{ blankLine: "always", prev: "*", next: "return" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: "*", next: "return" }
-]*/
-
-function foo() {
-    bar();
-    return;
-}
-```
-
-Examples of **correct** code for the `[{ blankLine: "always", prev: "*", next: "return" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: "*", next: "return" }
-]*/
-
-function foo() {
-    bar();
-
-    return;
-}
-
-function foo() {
-    return;
-}
-```
-
-----
-
-This configuration would require blank lines after every sequence of variable declarations, like the [newline-after-var] rule.
-
-Examples of **incorrect** code for the `[{ blankLine: "always", prev: ["const", "let", "var"], next: "*"}, { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]}]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: ["const", "let", "var"], next: "*"},
-    { blankLine: "any",    prev: ["const", "let", "var"], next: ["const", "let", "var"]}
-]*/
-
-function foo() {
-    var a = 0;
-    bar();
-}
-
-function foo() {
-    let a = 0;
-    bar();
-}
-
-function foo() {
-    const a = 0;
-    bar();
-}
-
-class C {
-    static {
-        let a = 0;
-        bar();
-    }
-}
-```
-
-Examples of **correct** code for the `[{ blankLine: "always", prev: ["const", "let", "var"], next: "*"}, { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]}]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: ["const", "let", "var"], next: "*"},
-    { blankLine: "any",    prev: ["const", "let", "var"], next: ["const", "let", "var"]}
-]*/
-
-function foo() {
-    var a = 0;
-    var b = 0;
-
-    bar();
-}
-
-function foo() {
-    let a = 0;
-    const b = 0;
-
-    bar();
-}
-
-function foo() {
-    const a = 0;
-    const b = 0;
-
-    bar();
-}
-
-class C {
-    static {
-        let a = 0;
-        let b = 0;
-
-        bar();
-    }
-}
-```
-
-----
-
-This configuration would require blank lines after all directive prologues, like the [lines-around-directive] rule.
-
-Examples of **incorrect** code for the `[{ blankLine: "always", prev: "directive", next: "*" }, { blankLine: "any", prev: "directive", next: "directive" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: "directive", next: "*" },
-    { blankLine: "any",    prev: "directive", next: "directive" }
-]*/
-
-"use strict";
-foo();
-```
-
-Examples of **correct** code for the `[{ blankLine: "always", prev: "directive", next: "*" }, { blankLine: "any", prev: "directive", next: "directive" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: "directive", next: "*" },
-    { blankLine: "any",    prev: "directive", next: "directive" }
-]*/
-
-"use strict";
-"use asm";
-
-foo();
-```
-
-----
-
-This configuration would require blank lines between clauses in `switch` statements.
-
-Examples of **incorrect** code for the `[{ blankLine: "always", prev: ["case", "default"], next: "*" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: ["case", "default"], next: "*" }
-]*/
-
-switch (foo) {
-    case 1:
-        bar();
-        break;
-    case 2:
-    case 3:
-        baz();
-        break;
-    default:
-        quux();
-}
-```
-
-Examples of **correct** code for the `[{ blankLine: "always", prev: ["case", "default"], next: "*" }]` configuration:
-
-```js
-/*eslint padding-line-between-statements: [
-    "error",
-    { blankLine: "always", prev: ["case", "default"], next: "*" }
-]*/
-
-switch (foo) {
-    case 1:
-        bar();
-        break;
-
-    case 2:
-
-    case 3:
-        baz();
-        break;
-
-    default:
-        quux();
-}
-```
-
-## Compatibility
-
-- **JSCS:** [requirePaddingNewLineAfterVariableDeclaration]
-- **JSCS:** [requirePaddingNewLinesAfterBlocks]
-- **JSCS:** [disallowPaddingNewLinesAfterBlocks]
-- **JSCS:** [requirePaddingNewLinesAfterUseStrict]
-- **JSCS:** [disallowPaddingNewLinesAfterUseStrict]
-- **JSCS:** [requirePaddingNewLinesBeforeExport]
-- **JSCS:** [disallowPaddingNewLinesBeforeExport]
-- **JSCS:** [requirePaddingNewlinesBeforeKeywords]
-- **JSCS:** [disallowPaddingNewlinesBeforeKeywords]
-
-## When Not To Use It
-
-If you don't want to notify warnings about linebreaks, then it's safe to disable this rule.
-
-[lines-around-directive]: https://eslint.org/docs/rules/lines-around-directive
-[newline-after-var]: https://eslint.org/docs/rules/newline-after-var
-[newline-before-return]: https://eslint.org/docs/rules/newline-before-return
-[requirePaddingNewLineAfterVariableDeclaration]: https://jscs-dev.github.io/rule/requirePaddingNewLineAfterVariableDeclaration
-[requirePaddingNewLinesAfterBlocks]: https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterBlocks
-[disallowPaddingNewLinesAfterBlocks]: https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterBlocks
-[requirePaddingNewLinesAfterUseStrict]: https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterUseStrict
-[disallowPaddingNewLinesAfterUseStrict]: https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterUseStrict
-[requirePaddingNewLinesBeforeExport]: https://jscs-dev.github.io/rule/requirePaddingNewLinesBeforeExport
-[disallowPaddingNewLinesBeforeExport]: https://jscs-dev.github.io/rule/disallowPaddingNewLinesBeforeExport
-[requirePaddingNewlinesBeforeKeywords]: https://jscs-dev.github.io/rule/requirePaddingNewlinesBeforeKeywords
-[disallowPaddingNewlinesBeforeKeywords]: https://jscs-dev.github.io/rule/disallowPaddingNewlinesBeforeKeywords
diff --git a/eslint/docs/rules/prefer-arrow-callback.md b/eslint/docs/rules/prefer-arrow-callback.md
deleted file mode 100644 (file)
index 7b98aa1..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# Require using arrow functions for callbacks (prefer-arrow-callback)
-
-Arrow functions can be an attractive alternative to function expressions for callbacks or function arguments.
-
-For example, arrow functions are automatically bound to their surrounding scope/context. This provides an alternative to the pre-ES6 standard of explicitly binding function expressions to achieve similar behavior.
-
-Additionally, arrow functions are:
-
-- less verbose, and easier to reason about.
-
-- bound lexically regardless of where or when they are invoked.
-
-## Rule Details
-
-This rule locates function expressions used as callbacks or function arguments. An error will be produced for any that could be replaced by an arrow function without changing the result.
-
-The following examples **will** be flagged:
-
-```js
-/* eslint prefer-arrow-callback: "error" */
-
-foo(function(a) { return a; }); // ERROR
-// prefer: foo(a => a)
-
-foo(function() { return this.a; }.bind(this)); // ERROR
-// prefer: foo(() => this.a)
-```
-
-Instances where an arrow function would not produce identical results will be ignored.
-
-The following examples **will not** be flagged:
-
-```js
-/* eslint prefer-arrow-callback: "error" */
-/* eslint-env es6 */
-
-// arrow function callback
-foo(a => a); // OK
-
-// generator as callback
-foo(function*() { yield; }); // OK
-
-// function expression not used as callback or function argument
-var foo = function foo(a) { return a; }; // OK
-
-// unbound function expression callback
-foo(function() { return this.a; }); // OK
-
-// recursive named function callback
-foo(function bar(n) { return n && n + bar(n - 1); }); // OK
-```
-
-## Options
-
-Access further control over this rule's behavior via an options object.
-
-Default: `{ allowNamedFunctions: false, allowUnboundThis: true }`
-
-### allowNamedFunctions
-
-By default `{ "allowNamedFunctions": false }`, this `boolean` option prohibits using named functions as callbacks or function arguments.
-
-Changing this value to `true` will reverse this option's behavior by allowing use of named functions without restriction.
-
-`{ "allowNamedFunctions": true }` **will not** flag the following example:
-
-```js
-/* eslint prefer-arrow-callback: [ "error", { "allowNamedFunctions": true } ] */
-
-foo(function bar() {});
-```
-
-### allowUnboundThis
-
-By default `{ "allowUnboundThis": true }`, this `boolean` option allows function expressions containing `this` to be used as callbacks, as long as the function in question has not been explicitly bound.
-
-When set to `false` this option prohibits the use of function expressions as callbacks or function arguments entirely, without exception.
-
-`{ "allowUnboundThis": false }` **will** flag the following examples:
-
-```js
-/* eslint prefer-arrow-callback: [ "error", { "allowUnboundThis": false } ] */
-/* eslint-env es6 */
-
-foo(function() { this.a; });
-
-foo(function() { (() => this); });
-
-someArray.map(function(item) { return this.doSomething(item); }, someObject);
-```
-
-## When Not To Use It
-
-- In environments that have not yet adopted ES6 language features (ES3/5).
-
-- In ES6+ environments that allow the use of function expressions when describing callbacks or function arguments.
-
-## Further Reading
-
-- [More on ES6 arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)
diff --git a/eslint/docs/rules/prefer-const.md b/eslint/docs/rules/prefer-const.md
deleted file mode 100644 (file)
index 3cdba9e..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-# Suggest using `const` (prefer-const)
-
-If a variable is never reassigned, using the `const` declaration is better.
-
-`const` declaration tells readers, "this variable is never reassigned," reducing cognitive load and improving maintainability.
-
-## Rule Details
-
-This rule is aimed at flagging variables that are declared using `let` keyword, but never reassigned after the initial assignment.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-const: "error"*/
-
-// it's initialized and never reassigned.
-let a = 3;
-console.log(a);
-
-let a;
-a = 0;
-console.log(a);
-
-class C {
-    static {
-        let a;
-        a = 0;
-        console.log(a);
-    }
-}
-
-// `i` is redefined (not reassigned) on each loop step.
-for (let i in [1, 2, 3]) {
-    console.log(i);
-}
-
-// `a` is redefined (not reassigned) on each loop step.
-for (let a of [1, 2, 3]) {
-    console.log(a);
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-const: "error"*/
-
-// using const.
-const a = 0;
-
-// it's never initialized.
-let a;
-console.log(a);
-
-// it's reassigned after initialized.
-let a;
-a = 0;
-a = 1;
-console.log(a);
-
-// it's initialized in a different block from the declaration.
-let a;
-if (true) {
-    a = 0;
-}
-console.log(a);
-
-// it's initialized in a different scope.
-let a;
-class C {
-    #x;
-    static {
-        a = obj => obj.#x;
-    }
-}
-
-// it's initialized at a place that we cannot write a variable declaration.
-let a;
-if (true) a = 0;
-console.log(a);
-
-// `i` gets a new binding each iteration
-for (const i in [1, 2, 3]) {
-  console.log(i);
-}
-
-// `a` gets a new binding each iteration
-for (const a of [1, 2, 3]) {
-  console.log(a);
-}
-
-// `end` is never reassigned, but we cannot separate the declarations without modifying the scope.
-for (let i = 0, end = 10; i < end; ++i) {
-    console.log(a);
-}
-
-// `predicate` is only assigned once but cannot be separately declared as `const`
-let predicate;
-[object.type, predicate] = foo();
-
-// `a` is only assigned once but cannot be separately declared as `const`
-let a;
-const b = {};
-({ a, c: b.c } = func());
-
-// suggest to use `no-var` rule.
-var b = 3;
-console.log(b);
-```
-
-## Options
-
-```json
-{
-    "prefer-const": ["error", {
-        "destructuring": "any",
-        "ignoreReadBeforeAssign": false
-    }]
-}
-```
-
-### destructuring
-
-The kind of the way to address variables in destructuring.
-There are 2 values:
-
-* `"any"` (default) - If any variables in destructuring should be `const`, this rule warns for those variables.
-* `"all"` - If all variables in destructuring should be `const`, this rule warns the variables. Otherwise, ignores them.
-
-Examples of **incorrect** code for the default `{"destructuring": "any"}` option:
-
-```js
-/*eslint prefer-const: "error"*/
-/*eslint-env es6*/
-
-let {a, b} = obj;    /*error 'b' is never reassigned, use 'const' instead.*/
-a = a + 1;
-```
-
-Examples of **correct** code for the default `{"destructuring": "any"}` option:
-
-```js
-/*eslint prefer-const: "error"*/
-/*eslint-env es6*/
-
-// using const.
-const {a: a0, b} = obj;
-const a = a0 + 1;
-
-// all variables are reassigned.
-let {a, b} = obj;
-a = a + 1;
-b = b + 1;
-```
-
-Examples of **incorrect** code for the `{"destructuring": "all"}` option:
-
-```js
-/*eslint prefer-const: ["error", {"destructuring": "all"}]*/
-/*eslint-env es6*/
-
-// all of `a` and `b` should be const, so those are warned.
-let {a, b} = obj;    /*error 'a' is never reassigned, use 'const' instead.
-                             'b' is never reassigned, use 'const' instead.*/
-```
-
-Examples of **correct** code for the `{"destructuring": "all"}` option:
-
-```js
-/*eslint prefer-const: ["error", {"destructuring": "all"}]*/
-/*eslint-env es6*/
-
-// 'b' is never reassigned, but all of `a` and `b` should not be const, so those are ignored.
-let {a, b} = obj;
-a = a + 1;
-```
-
-### ignoreReadBeforeAssign
-
-This is an option to avoid conflicting with `no-use-before-define` rule (without `"nofunc"` option).
-If `true` is specified, this rule will ignore variables that are read between the declaration and the first assignment.
-Default is `false`.
-
-Examples of **correct** code for the `{"ignoreReadBeforeAssign": true}` option:
-
-```js
-/*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": true}]*/
-/*eslint-env es6*/
-
-let timer;
-function initialize() {
-    if (foo()) {
-        clearInterval(timer);
-    }
-}
-timer = setInterval(initialize, 100);
-```
-
-Examples of **correct** code for the default `{"ignoreReadBeforeAssign": false}` option:
-
-```js
-/*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": false}]*/
-/*eslint-env es6*/
-
-const timer = setInterval(initialize, 100);
-function initialize() {
-    if (foo()) {
-        clearInterval(timer);
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to be notified about variables that are never reassigned after initial assignment, you can safely disable this rule.
-
-## Related Rules
-
-* [no-var](no-var.md)
-* [no-use-before-define](no-use-before-define.md)
diff --git a/eslint/docs/rules/prefer-destructuring.md b/eslint/docs/rules/prefer-destructuring.md
deleted file mode 100644 (file)
index b0f887c..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-# Prefer destructuring from arrays and objects (prefer-destructuring)
-
-With JavaScript ES6, a new syntax was added for creating variables from an array index or object property, called [destructuring](#further-reading).  This rule enforces usage of destructuring instead of accessing a property through a member expression.
-
-## Rule Details
-
-### Options
-
-This rule takes two sets of configuration objects. The first object parameter determines what types of destructuring the rule applies to.
-
-The two properties, `array` and `object`, can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.
-
-Alternatively, you can use separate configurations for different assignment types. It accepts 2 other keys instead of `array` and `object`.
-
-One key is `VariableDeclarator` and the other is `AssignmentExpression`, which can be used to control the destructuring requirement for each of those types independently. Each property accepts an object that accepts two properties, `array` and `object`, which can be used to control the destructuring requirement for each of `array` and `object` independently for variable declarations and assignment expressions.  By default, `array` and `object` are set to true for both `VariableDeclarator` and `AssignmentExpression`.
-
-The rule has a second object with a single key, `enforceForRenamedProperties`, which determines whether the `object` destructuring applies to renamed variables.
-
-**Note**: It is not possible to determine if a variable will be referring to an object or an array at runtime. This rule therefore guesses the assignment type by checking whether the key being accessed is an integer. This can lead to the following possibly confusing situations:
-
-- Accessing an object property whose key is an integer will fall under the category `array` destructuring.
-- Accessing an array element through a computed index will fall under the category `object` destructuring.
-
-The `--fix` option on the command line fixes only problems reported in variable declarations, and among them only those that fall under the category `object` destructuring. Furthermore, the name of the declared variable has to be the same as the name used for non-computed member access in the initializer. For example, `var foo = object.foo` can be automatically fixed by this rule. Problems that involve computed member access (e.g., `var foo = object[foo]`) or renamed properties (e.g., `var foo = object.bar`) are not automatically fixed.
-
-Examples of **incorrect** code for this rule:
-
-```javascript
-// With `array` enabled
-var foo = array[0];
-
-// With `object` enabled
-var foo = object.foo;
-var foo = object['foo'];
-```
-
-Examples of **correct** code for this rule:
-
-```javascript
-// With `array` enabled
-var [ foo ] = array;
-var foo = array[someIndex];
-
-// With `object` enabled
-var { foo } = object;
-
-var foo = object.bar;
-
-let foo;
-({ foo } = object);
-```
-
-Examples of **incorrect** code when `enforceForRenamedProperties` is enabled:
-
-```javascript
-var foo = object.bar;
-```
-
-Examples of **correct** code when `enforceForRenamedProperties` is enabled:
-
-```javascript
-var { bar: foo } = object;
-```
-
-Examples of additional **correct** code when `enforceForRenamedProperties` is enabled:
-
-```javascript
-class C {
-    #x;
-    foo() {
-        const bar = this.#x; // private identifiers are not allowed in destructuring
-    }
-}
-```
-
-An example configuration, with the defaults `array` and `object` filled in, looks like this:
-
-```json
-{
-  "rules": {
-    "prefer-destructuring": ["error", {
-      "array": true,
-      "object": true
-    }, {
-      "enforceForRenamedProperties": false
-    }]
-  }
-}
-```
-
-The two properties, `array` and `object`, which can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.
-
-For example, the following configuration enforces only object destructuring, but not array destructuring:
-
-```json
-{
-  "rules": {
-    "prefer-destructuring": ["error", {"object": true, "array": false}]
-  }
-}
-```
-
-An example configuration, with the defaults `VariableDeclarator` and `AssignmentExpression` filled in, looks like this:
-
-```json
-{
-  "rules": {
-    "prefer-destructuring": ["error", {
-      "VariableDeclarator": {
-        "array": false,
-        "object": true
-      },
-      "AssignmentExpression": {
-        "array": true,
-        "object": true
-      }
-    }, {
-      "enforceForRenamedProperties": false
-    }]
-  }
-}
-```
-
-The two properties, `VariableDeclarator` and `AssignmentExpression`, which can be used to turn on or off the destructuring requirement for `array` and `object`. By default, all values are true.
-
-For example, the following configuration enforces object destructuring in variable declarations and enforces array destructuring in assignment expressions.
-
-```json
-{
-  "rules": {
-    "prefer-destructuring": ["error", {
-      "VariableDeclarator": {
-        "array": false,
-        "object": true
-      },
-      "AssignmentExpression": {
-        "array": true,
-        "object": false
-      }
-    }, {
-      "enforceForRenamedProperties": false
-    }]
-  }
-}
-
-```
-
-Examples of **correct** code when object destructuring in `VariableDeclarator` is enforced:
-
-```javascript
-/* eslint prefer-destructuring: ["error", {VariableDeclarator: {object: true}}] */
-var {bar: foo} = object;
-```
-
-Examples of **correct** code when array destructuring in `AssignmentExpression` is enforced:
-
-```javascript
-/* eslint prefer-destructuring: ["error", {AssignmentExpression: {array: true}}] */
-[bar] = array;
-```
-
-## When Not To Use It
-
-If you want to be able to access array indices or object properties directly, you can either configure the rule to your tastes or disable the rule entirely.
-
-Additionally, if you intend to access large array indices directly, like:
-
-```javascript
-var foo = array[100];
-```
-
-Then the `array` part of this rule is not recommended, as destructuring does not match this use case very well.
-
-Or for non-iterable 'array-like' objects:
-
-```javascript
-var $ = require('jquery');
-var foo = $('body')[0];
-var [bar] = $('body'); // fails with a TypeError
-```
-
-## Further Reading
-
-If you want to learn more about destructuring, check out the links below:
-
-- [Destructuring Assignment (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
-- [Destructuring and parameter handling in ECMAScript 6 (2ality blog)](http://2ality.com/2015/01/es6-destructuring.html)
diff --git a/eslint/docs/rules/prefer-exponentiation-operator.md b/eslint/docs/rules/prefer-exponentiation-operator.md
deleted file mode 100644 (file)
index f5f9e47..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# Disallow the use of `Math.pow` in favor of the `**` operator (prefer-exponentiation-operator)
-
-Introduced in ES2016, the infix exponentiation operator `**` is an alternative for the standard `Math.pow` function.
-
-Infix notation is considered to be more readable and thus more preferable than the function notation.
-
-## Rule Details
-
-This rule disallows calls to `Math.pow` and suggests using the `**` operator instead.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-exponentiation-operator: "error"*/
-
-const foo = Math.pow(2, 8);
-
-const bar = Math.pow(a, b);
-
-let baz = Math.pow(a + b, c + d);
-
-let quux = Math.pow(-1, n);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-exponentiation-operator: "error"*/
-
-const foo = 2 ** 8;
-
-const bar = a ** b;
-
-let baz = (a + b) ** (c + d);
-
-let quux = (-1) ** n;
-```
-
-## When Not To Use It
-
-This rule should not be used unless ES2016 is supported in your codebase.
-
-## Further Reading
-
-* [MDN Arithmetic Operators - Exponentiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation)
-* [Issue 5848: Exponentiation operator ** has different results for numbers and variables from 50 upwards](https://bugs.chromium.org/p/v8/issues/detail?id=5848)
diff --git a/eslint/docs/rules/prefer-named-capture-group.md b/eslint/docs/rules/prefer-named-capture-group.md
deleted file mode 100644 (file)
index f48ec80..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# Suggest using named capture group in regular expression (prefer-named-capture-group)
-
-## Rule Details
-
-With the landing of ECMAScript 2018, named capture groups can be used in regular expressions, which can improve their readability.
-This rule is aimed at using named capture groups instead of numbered capture groups in regular expressions:
-
-```js
-const regex = /(?<year>[0-9]{4})/;
-```
-
-Alternatively, if your intention is not to _capture_ the results, but only express the alternative, use a non-capturing group:
-
-```js
-const regex = /(?:cauli|sun)flower/;
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-named-capture-group: "error"*/
-
-const foo = /(ba[rz])/;
-const bar = new RegExp('(ba[rz])');
-const baz = RegExp('(ba[rz])');
-
-foo.exec('bar')[1]; // Retrieve the group result.
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-named-capture-group: "error"*/
-
-const foo = /(?<id>ba[rz])/;
-const bar = new RegExp('(?<id>ba[rz])');
-const baz = RegExp('(?<id>ba[rz])');
-const xyz = /xyz(?:zy|abc)/;
-
-foo.exec('bar').groups.id; // Retrieve the group result.
-```
-
-## When Not To Use It
-
-If you are targeting ECMAScript 2017 and/or older environments, you should not use this rule, because this ECMAScript feature is only supported in ECMAScript 2018 and/or newer environments.
-
-## Related Rules
-
-* [no-invalid-regexp](./no-invalid-regexp.md)
diff --git a/eslint/docs/rules/prefer-numeric-literals.md b/eslint/docs/rules/prefer-numeric-literals.md
deleted file mode 100644 (file)
index bf81e5e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals (prefer-numeric-literals)
-
-The `parseInt()` and `Number.parseInt()` functions can be used to turn binary, octal, and hexadecimal strings into integers. As binary, octal, and hexadecimal literals are supported in ES6, this rule encourages use of those numeric literals instead of `parseInt()` or `Number.parseInt()`.
-
-```js
-0b111110111 === 503;
-0o767 === 503;
-```
-
-## Rule Details
-
-This rule disallows calls to `parseInt()` or `Number.parseInt()` if called with two arguments: a string; and a radix option of 2 (binary), 8 (octal), or 16 (hexadecimal).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-numeric-literals: "error"*/
-
-parseInt("111110111", 2) === 503;
-parseInt(`111110111`, 2) === 503;
-parseInt("767", 8) === 503;
-parseInt("1F7", 16) === 503;
-Number.parseInt("111110111", 2) === 503;
-Number.parseInt("767", 8) === 503;
-Number.parseInt("1F7", 16) === 503;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-numeric-literals: "error"*/
-/*eslint-env es6*/
-
-parseInt(1);
-parseInt(1, 3);
-Number.parseInt(1);
-Number.parseInt(1, 3);
-
-0b111110111 === 503;
-0o767 === 503;
-0x1F7 === 503;
-
-a[parseInt](1,2);
-
-parseInt(foo);
-parseInt(foo, 2);
-Number.parseInt(foo);
-Number.parseInt(foo, 2);
-```
-
-## When Not To Use It
-
-If you want to allow use of `parseInt()` or `Number.parseInt()` for binary, octal, or hexadecimal integers, or if you are not using ES6 (because binary and octal literals are not supported in ES5 and below), you may wish to disable this rule.
-
-## Compatibility
-
-* **JSCS**: [requireNumericLiterals](https://jscs-dev.github.io/rule/requireNumericLiterals)
diff --git a/eslint/docs/rules/prefer-object-spread.md b/eslint/docs/rules/prefer-object-spread.md
deleted file mode 100644 (file)
index 50d721b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# Prefer use of an object spread over `Object.assign` (prefer-object-spread)
-
-When Object.assign is called using an object literal as the first argument, this rule requires using the object spread syntax instead. This rule also warns on cases where an `Object.assign` call is made using a single argument that is an object literal, in this case, the `Object.assign` call is not needed.
-
-Introduced in ES2018, object spread is a declarative alternative which may perform better than the more dynamic, imperative `Object.assign`.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-object-spread: "error"*/
-
-Object.assign({}, foo)
-
-Object.assign({}, {foo: 'bar'})
-
-Object.assign({ foo: 'bar'}, baz)
-
-Object.assign({ foo: 'bar' }, Object.assign({ bar: 'foo' }))
-
-Object.assign({}, { foo, bar, baz })
-
-Object.assign({}, { ...baz })
-
-// Object.assign with a single argument that is an object literal
-Object.assign({});
-
-Object.assign({ foo: bar });
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-object-spread: "error"*/
-
-Object.assign(...foo);
-
-// Any Object.assign call without an object literal as the first argument
-Object.assign(foo, { bar: baz });
-
-Object.assign(foo, Object.assign(bar));
-
-Object.assign(foo, { bar, baz })
-
-Object.assign(foo, { ...baz });
-```
-
-## When Not To Use It
-
-This rule should not be used unless ES2018 is supported in your codebase.
diff --git a/eslint/docs/rules/prefer-promise-reject-errors.md b/eslint/docs/rules/prefer-promise-reject-errors.md
deleted file mode 100644 (file)
index 9740bc9..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# require using Error objects as Promise rejection reasons (prefer-promise-reject-errors)
-
-It is considered good practice to only pass instances of the built-in `Error` object to the `reject()` function for user-defined errors in Promises. `Error` objects automatically store a stack trace, which can be used to debug an error by determining where it came from. If a Promise is rejected with a non-`Error` value, it can be difficult to determine where the rejection occurred.
-
-## Rule Details
-
-This rule aims to ensure that Promises are only rejected with `Error` objects.
-
-## Options
-
-This rule takes one optional object argument:
-
-* `allowEmptyReject: true` (`false` by default) allows calls to `Promise.reject()` with no arguments.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-promise-reject-errors: "error"*/
-
-Promise.reject("something bad happened");
-
-Promise.reject(5);
-
-Promise.reject();
-
-new Promise(function(resolve, reject) {
-  reject("something bad happened");
-});
-
-new Promise(function(resolve, reject) {
-  reject();
-});
-
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-promise-reject-errors: "error"*/
-
-Promise.reject(new Error("something bad happened"));
-
-Promise.reject(new TypeError("something bad happened"));
-
-new Promise(function(resolve, reject) {
-  reject(new Error("something bad happened"));
-});
-
-var foo = getUnknownValue();
-Promise.reject(foo);
-```
-
-Examples of **correct** code for this rule with the `allowEmptyReject: true` option:
-
-```js
-/*eslint prefer-promise-reject-errors: ["error", {"allowEmptyReject": true}]*/
-
-Promise.reject();
-
-new Promise(function(resolve, reject) {
-  reject();
-});
-```
-
-## Known Limitations
-
-Due to the limits of static analysis, this rule cannot guarantee that you will only reject Promises with `Error` objects. While the rule will report cases where it can guarantee that the rejection reason is clearly not an `Error`, it will not report cases where there is uncertainty about whether a given reason is an `Error`. For more information on this caveat, see the [similar limitations](no-throw-literal.md#known-limitations) in the `no-throw-literal` rule.
-
-To avoid conflicts between rules, this rule does not report non-error values used in `throw` statements in async functions, even though these lead to Promise rejections. To lint for these cases, use the [`no-throw-literal`](https://eslint.org/docs/rules/no-throw-literal) rule.
-
-## When Not To Use It
-
-If you're using custom non-error values as Promise rejection reasons, you can turn off this rule.
-
-## Further Reading
-
-* [`no-throw-literal`](https://eslint.org/docs/rules/no-throw-literal)
-* [Warning: a promise was rejected with a non-error](http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error)
diff --git a/eslint/docs/rules/prefer-reflect.md b/eslint/docs/rules/prefer-reflect.md
deleted file mode 100644 (file)
index af0838e..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-# Suggest using Reflect methods where applicable (prefer-reflect)
-
-This rule was **deprecated** in ESLint v3.9.0 and will not be replaced. The original intent of this rule now seems misguided as we have come to understand that `Reflect` methods are not actually intended to replace the `Object` counterparts the rule suggests, but rather exist as low-level primitives to be used with proxies in order to replicate the default behavior of various previously existing functionality.
-
-The ES6 Reflect API comes with a handful of methods which somewhat deprecate methods on old constructors:
-
-* [`Reflect.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.apply) effectively deprecates [`Function.prototype.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.apply) and [`Function.prototype.call`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.call)
-* [`Reflect.deleteProperty`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.deleteproperty) effectively deprecates the [`delete` keyword](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-delete-operator-runtime-semantics-evaluation)
-* [`Reflect.getOwnPropertyDescriptor`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.getownpropertydescriptor) effectively deprecates [`Object.getOwnPropertyDescriptor`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.getownpropertydescriptor)
-* [`Reflect.getPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.getprototypeof) effectively deprecates [`Object.getPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.getprototypeof)
-* [`Reflect.setPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.setprototypeof) effectively deprecates [`Object.setPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof)
-* [`Reflect.preventExtensions`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.preventextensions)  effectively deprecates [`Object.preventExtensions`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.preventextensions)
-
-The prefer-reflect rule will flag usage of any older method, suggesting to instead use the newer Reflect version.
-
-## Rule Details
-
-## Options
-
-### Exceptions
-
-```js
-"prefer-reflect": [<enabled>, { "exceptions": [<...exceptions>] }]
-```
-
-The `exceptions` option allows you to pass an array of methods names you'd like to continue to use in the old style.
-
-For example if you wish to use all Reflect methods, except for `Function.prototype.apply` then your config would look like `prefer-reflect: [2, { "exceptions": ["apply"] }]`.
-
-If you want to use Reflect methods, but keep using the `delete` keyword, then your config would look like `prefer-reflect: [2, { "exceptions": ["delete"] }]`.
-
-These can be combined as much as you like. To make all methods exceptions (thereby rendering this rule useless), use `prefer-reflect: [2, { "exceptions": ["apply", "call", "defineProperty", "getOwnPropertyDescriptor", "getPrototypeOf", "setPrototypeOf", "isExtensible", "getOwnPropertyNames", "preventExtensions", "delete"] }]`
-
-### Reflect.apply
-
-Deprecates `Function.prototype.apply()` and `Function.prototype.call()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-myFunction.apply(undefined, args);
-myFunction.apply(null, args);
-obj.myMethod.apply(obj, args);
-obj.myMethod.apply(other, args);
-
-myFunction.call(undefined, arg);
-myFunction.call(null, arg);
-obj.myMethod.call(obj, arg);
-obj.myMethod.call(other, arg);
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.apply(myFunction, undefined, args);
-Reflect.apply(myFunction, null, args);
-Reflect.apply(obj.myMethod, obj, args);
-Reflect.apply(obj.myMethod, other, args);
-Reflect.apply(myFunction, undefined, [arg]);
-Reflect.apply(myFunction, null, [arg]);
-Reflect.apply(obj.myMethod, obj, [arg]);
-Reflect.apply(obj.myMethod, other, [arg]);
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["apply"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["apply"] }]*/
-
-// in addition to Reflect.apply(...):
-myFunction.apply(undefined, args);
-myFunction.apply(null, args);
-obj.myMethod.apply(obj, args);
-obj.myMethod.apply(other, args);
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["call"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["call"] }]*/
-
-// in addition to Reflect.apply(...):
-myFunction.call(undefined, arg);
-myFunction.call(null, arg);
-obj.myMethod.call(obj, arg);
-obj.myMethod.call(other, arg);
-```
-
-### Reflect.defineProperty
-
-Deprecates `Object.defineProperty()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.defineProperty({}, 'foo', {value: 1})
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.defineProperty({}, 'foo', {value: 1})
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["defineProperty"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["defineProperty"] }]*/
-
-Object.defineProperty({}, 'foo', {value: 1})
-Reflect.defineProperty({}, 'foo', {value: 1})
-```
-
-### Reflect.getOwnPropertyDescriptor
-
-Deprecates `Object.getOwnPropertyDescriptor()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.getOwnPropertyDescriptor({}, 'foo')
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.getOwnPropertyDescriptor({}, 'foo')
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["getOwnPropertyDescriptor"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["getOwnPropertyDescriptor"] }]*/
-
-Object.getOwnPropertyDescriptor({}, 'foo')
-Reflect.getOwnPropertyDescriptor({}, 'foo')
-```
-
-### Reflect.getPrototypeOf
-
-Deprecates `Object.getPrototypeOf()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.getPrototypeOf({}, 'foo')
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.getPrototypeOf({}, 'foo')
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["getPrototypeOf"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["getPrototypeOf"] }]*/
-
-Object.getPrototypeOf({}, 'foo')
-Reflect.getPrototypeOf({}, 'foo')
-```
-
-### Reflect.setPrototypeOf
-
-Deprecates `Object.setPrototypeOf()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.setPrototypeOf({}, Object.prototype)
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.setPrototypeOf({}, Object.prototype)
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["setPrototypeOf"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["setPrototypeOf"] }]*/
-
-Object.setPrototypeOf({}, Object.prototype)
-Reflect.setPrototypeOf({}, Object.prototype)
-```
-
-### Reflect.isExtensible
-
-Deprecates `Object.isExtensible`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.isExtensible({})
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.isExtensible({})
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["isExtensible"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["isExtensible"] }]*/
-
-Object.isExtensible({})
-Reflect.isExtensible({})
-```
-
-### Reflect.getOwnPropertyNames
-
-Deprecates `Object.getOwnPropertyNames()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.getOwnPropertyNames({})
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.getOwnPropertyNames({})
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["getOwnPropertyNames"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["getOwnPropertyNames"] }]*/
-
-Object.getOwnPropertyNames({})
-Reflect.getOwnPropertyNames({})
-```
-
-### Reflect.preventExtensions
-
-Deprecates `Object.preventExtensions()`
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Object.preventExtensions({})
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-Reflect.preventExtensions({})
-```
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["preventExtensions"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["preventExtensions"] }]*/
-
-Object.preventExtensions({})
-Reflect.preventExtensions({})
-```
-
-### Reflect.deleteProperty
-
-Deprecates the `delete` keyword
-
-Examples of **incorrect** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-delete foo.bar; // deleting object property
-```
-
-Examples of **correct** code for this rule when used without exceptions:
-
-```js
-/*eslint prefer-reflect: "error"*/
-
-delete bar; // deleting variable
-Reflect.deleteProperty(foo, 'bar');
-```
-
-Note: For a rule preventing deletion of variables, see [no-delete-var instead](no-delete-var.md)
-
-Examples of **correct** code for this rule with the `{ "exceptions": ["delete"] }` option:
-
-```js
-/*eslint prefer-reflect: ["error", { "exceptions": ["delete"] }]*/
-
-delete bar
-delete foo.bar
-Reflect.deleteProperty(foo, 'bar');
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-In ES2015 (ES6) or later, if you don't want to be notified about places where Reflect could be used, you can safely disable this rule.
-
-## Related Rules
-
-* [no-useless-call](no-useless-call.md)
-* [prefer-spread](prefer-spread.md)
-* [no-delete-var](no-delete-var.md)
diff --git a/eslint/docs/rules/prefer-regex-literals.md b/eslint/docs/rules/prefer-regex-literals.md
deleted file mode 100644 (file)
index 2ba8cac..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# Disallow use of the `RegExp` constructor in favor of regular expression literals (prefer-regex-literals)
-
-There are two ways to create a regular expression:
-
-* Regular expression literals, e.g., `/abc/u`.
-* The `RegExp` constructor function, e.g., `new RegExp("abc", "u")` or `RegExp("abc", "u")`.
-
-The constructor function is particularly useful when you want to dynamically generate the pattern,
-because it takes string arguments.
-
-When using the constructor function with string literals, don't forget that the string escaping rules still apply.
-If you want to put a backslash in the pattern, you need to escape it in the string literal.
-Thus, the following are equivalent:
-
-```js
-new RegExp("^\\d\\.$");
-
-/^\d\.$/;
-
-// matches "0.", "1.", "2." ... "9."
-```
-
-In the above example, the regular expression literal is easier to read and reason about.
-Also, it's a common mistake to omit the extra `\` in the string literal, which would produce a completely different regular expression:
-
-```js
-new RegExp("^\d\.$");
-
-// equivalent to /^d.$/, matches "d1", "d2", "da", "db" ...
-```
-
-When a regular expression is known in advance, it is considered a best practice to avoid the string literal notation on top
-of the regular expression notation, and use regular expression literals instead of the constructor function.
-
-## Rule Details
-
-This rule disallows the use of the `RegExp` constructor function with string literals as its arguments.
-
-This rule also disallows the use of the `RegExp` constructor function with template literals without expressions
-and `String.raw` tagged template literals without expressions.
-
-The rule does not disallow all use of the `RegExp` constructor. It should be still used for
-dynamically generated regular expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-regex-literals: "error"*/
-
-new RegExp("abc");
-
-new RegExp("abc", "u");
-
-RegExp("abc");
-
-RegExp("abc", "u");
-
-new RegExp("\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d");
-
-RegExp(`^\\d\\.$`);
-
-new RegExp(String.raw`^\d\.$`);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-regex-literals: "error"*/
-
-/abc/;
-
-/abc/u;
-
-/\d\d\.\d\d\.\d\d\d\d/;
-
-/^\d\.$/;
-
-// RegExp constructor is allowed for dynamically generated regular expressions
-
-new RegExp(pattern);
-
-RegExp("abc", flags);
-
-new RegExp(prefix + "abc");
-
-RegExp(`${prefix}abc`);
-
-new RegExp(String.raw`^\d\. ${suffix}`);
-```
-
-## Options
-
-This rule has an object option:
-
-* `disallowRedundantWrapping` set to `true` additionally checks for unnecessarily wrapped regex literals (Default `false`).
-
-### `disallowRedundantWrapping`
-
-By default, this rule doesn’t check when a regex literal is unnecessarily wrapped in a `RegExp` constructor call. When the option `disallowRedundantWrapping` is set to `true`, the rule will also disallow such unnecessary patterns.
-
-Examples of `incorrect` code for `{ "disallowRedundantWrapping": true }`
-
-```js
-/*eslint prefer-regex-literals: ["error", {"disallowRedundantWrapping": true}]*/
-
-new RegExp(/abc/);
-
-new RegExp(/abc/, 'u');
-```
-
-Examples of `correct` code for `{ "disallowRedundantWrapping": true }`
-
-```js
-/*eslint prefer-regex-literals: ["error", {"disallowRedundantWrapping": true}]*/
-
-/abc/;
-
-/abc/u;
-
-new RegExp(/abc/, flags);
-```
-
-## Further Reading
-
-* [MDN: Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
-* [MDN: RegExp Constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)
diff --git a/eslint/docs/rules/prefer-rest-params.md b/eslint/docs/rules/prefer-rest-params.md
deleted file mode 100644 (file)
index c67e744..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# Suggest using the rest parameters instead of `arguments` (prefer-rest-params)
-
-There are rest parameters in ES2015.
-We can use that feature for variadic functions instead of the `arguments` variable.
-
-`arguments` does not have methods of `Array.prototype`, so it's a bit of an inconvenience.
-
-## Rule Details
-
-This rule is aimed to flag usage of `arguments` variables.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-rest-params: "error"*/
-
-function foo() {
-    console.log(arguments);
-}
-
-function foo(action) {
-    var args = Array.prototype.slice.call(arguments, 1);
-    action.apply(null, args);
-}
-
-function foo(action) {
-    var args = [].slice.call(arguments, 1);
-    action.apply(null, args);
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-rest-params: "error"*/
-
-function foo(...args) {
-    console.log(args);
-}
-
-function foo(action, ...args) {
-    action.apply(null, args); // or `action(...args)`, related to the `prefer-spread` rule.
-}
-
-// Note: the implicit arguments can be overwritten.
-function foo(arguments) {
-    console.log(arguments); // This is the first argument.
-}
-function foo() {
-    var arguments = 0;
-    console.log(arguments); // This is a local variable.
-}
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-In ES2015 (ES6) or later, if you don't want to be notified about `arguments` variables, then it's safe to disable this rule.
-
-## Related Rules
-
-* [prefer-spread](prefer-spread.md)
diff --git a/eslint/docs/rules/prefer-spread.md b/eslint/docs/rules/prefer-spread.md
deleted file mode 100644 (file)
index 0011560..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# Suggest using spread syntax instead of `.apply()`. (prefer-spread)
-
-Before ES2015, one must use `Function.prototype.apply()` to call variadic functions.
-
-```js
-var args = [1, 2, 3, 4];
-Math.max.apply(Math, args);
-```
-
-In ES2015, one can use spread syntax to call variadic functions.
-
-```js
-/*eslint-env es6*/
-
-var args = [1, 2, 3, 4];
-Math.max(...args);
-```
-
-## Rule Details
-
-This rule is aimed to flag usage of `Function.prototype.apply()` in situations where spread syntax could be used instead.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-spread: "error"*/
-
-foo.apply(undefined, args);
-foo.apply(null, args);
-obj.foo.apply(obj, args);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-spread: "error"*/
-
-// Using spread syntax
-foo(...args);
-obj.foo(...args);
-
-// The `this` binding is different.
-foo.apply(obj, args);
-obj.foo.apply(null, args);
-obj.foo.apply(otherObj, args);
-
-// The argument list is not variadic.
-// Those are warned by the `no-useless-call` rule.
-foo.apply(undefined, [1, 2, 3]);
-foo.apply(null, [1, 2, 3]);
-obj.foo.apply(obj, [1, 2, 3]);
-```
-
-Known limitations:
-
-This rule analyzes code statically to check whether or not the `this` argument is changed. So, if the `this` argument is computed in a dynamic expression, this rule cannot detect a violation.
-
-```js
-/*eslint prefer-spread: "error"*/
-
-// This warns.
-a[i++].foo.apply(a[i++], args);
-
-// This does not warn.
-a[++i].foo.apply(a[i], args);
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-In ES2015 (ES6) or later, if you don't want to be notified about `Function.prototype.apply()` callings, you can safely disable this rule.
-
-## Related Rules
-
-* [no-useless-call](no-useless-call.md)
diff --git a/eslint/docs/rules/prefer-template.md b/eslint/docs/rules/prefer-template.md
deleted file mode 100644 (file)
index 234bd02..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-# Suggest using template literals instead of string concatenation. (prefer-template)
-
-In ES2015 (ES6), we can use template literals instead of string concatenation.
-
-```js
-var str = "Hello, " + name + "!";
-```
-
-```js
-/*eslint-env es6*/
-
-var str = `Hello, ${name}!`;
-```
-
-## Rule Details
-
-This rule is aimed to flag usage of `+` operators with strings.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint prefer-template: "error"*/
-
-var str = "Hello, " + name + "!";
-var str = "Time: " + (12 * 60 * 60 * 1000);
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint prefer-template: "error"*/
-/*eslint-env es6*/
-
-var str = "Hello World!";
-var str = `Hello, ${name}!`;
-var str = `Time: ${12 * 60 * 60 * 1000}`;
-
-// This is reported by `no-useless-concat`.
-var str = "Hello, " + "World!";
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-
-In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.
-
-## Related Rules
-
-* [no-useless-concat](no-useless-concat.md)
-* [quotes](quotes.md)
diff --git a/eslint/docs/rules/quote-props.md b/eslint/docs/rules/quote-props.md
deleted file mode 100644 (file)
index cccb48d..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-# require quotes around object literal property names (quote-props)
-
-Object literal property names can be defined in two ways: using literals or using strings. For example, these two objects are equivalent:
-
-```js
-var object1 = {
-    property: true
-};
-
-var object2 = {
-    "property": true
-};
-```
-
-In many cases, it doesn't matter if you choose to use an identifier instead of a string or vice-versa. Even so, you might decide to enforce a consistent style in your code.
-
-There are, however, some occasions when you must use quotes:
-
-1. If you are using an ECMAScript 3 JavaScript engine (such as IE8) and you want to use a keyword (such as `if`) as a property name. This restriction was removed in ECMAScript 5.
-2. You want to use a non-identifier character in your property name, such as having a property with a space like `"one two"`.
-
-Another example where quotes do matter is when using numeric literals as property keys:
-
-```js
-var object = {
-    1e2: 1,
-    100: 2
-};
-```
-
-This may look alright at first sight, but this code in fact throws a syntax error in ECMAScript 5 strict mode. This happens because `1e2` and `100` are coerced into strings before getting used as the property name. Both `String(1e2)` and `String(100)` happen to be equal to `"100"`, which causes the "Duplicate data property in object literal not allowed in strict mode" error. Issues like that can be tricky to debug, so some prefer to require quotes around all property names.
-
-## Rule Details
-
-This rule requires quotes around object literal property names.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"always"` (default) requires quotes around all object literal property names
-* `"as-needed"` disallows quotes around object literal property names that are not strictly required
-* `"consistent"` enforces a consistent quote style; in a given object, either all of the properties should be quoted, or none of the properties should be quoted
-* `"consistent-as-needed"` requires quotes around all object literal property names if any name strictly requires quotes, otherwise disallows quotes around object property names
-
-Object option:
-
-* `"keywords": true` requires quotes around language keywords used as object property names (only applies when using `as-needed` or `consistent-as-needed`)
-* `"unnecessary": true` (default) disallows quotes around object literal property names that are not strictly required (only applies when using `as-needed`)
-* `"unnecessary": false` allows quotes around object literal property names that are not strictly required (only applies when using `as-needed`)
-* `"numbers": true` requires quotes around numbers used as object property names (only applies when using `as-needed`)
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint quote-props: ["error", "always"]*/
-
-var object = {
-    foo: "bar",
-    baz: 42
-};
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint quote-props: ["error", "always"]*/
-/*eslint-env es6*/
-
-var object1 = {
-    "foo": "bar",
-    "baz": 42,
-    "qux-lorem": true
-};
-
-var object2 = {
-    'foo': 'bar',
-    'baz': 42,
-    'qux-lorem': true
-};
-
-var object3 = {
-    foo() {
-        return;
-    }
-};
-```
-
-### as-needed
-
-Examples of **incorrect** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint quote-props: ["error", "as-needed"]*/
-
-var object = {
-    "a": 0,
-    "0": 0,
-    "true": 0,
-    "null": 0
-};
-```
-
-Examples of **correct** code for this rule with the `"as-needed"` option:
-
-```js
-/*eslint quote-props: ["error", "as-needed"]*/
-/*eslint-env es6*/
-
-var object1 = {
-    "a-b": 0,
-    "0x0": 0,
-    "1e2": 0
-};
-
-var object2 = {
-    foo: 'bar',
-    baz: 42,
-    true: 0,
-    0: 0,
-    'qux-lorem': true
-};
-
-var object3 = {
-    foo() {
-        return;
-    }
-};
-```
-
-### consistent
-
-Examples of **incorrect** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint quote-props: ["error", "consistent"]*/
-
-var object1 = {
-    foo: "bar",
-    "baz": 42,
-    "qux-lorem": true
-};
-
-var object2 = {
-    'foo': 'bar',
-    baz: 42
-};
-```
-
-Examples of **correct** code for this rule with the `"consistent"` option:
-
-```js
-/*eslint quote-props: ["error", "consistent"]*/
-
-var object1 = {
-    "foo": "bar",
-    "baz": 42,
-    "qux-lorem": true
-};
-
-var object2 = {
-    'foo': 'bar',
-    'baz': 42
-};
-
-var object3 = {
-    foo: 'bar',
-    baz: 42
-};
-```
-
-### consistent-as-needed
-
-Examples of **incorrect** code for this rule with the `"consistent-as-needed"` option:
-
-```js
-/*eslint quote-props: ["error", "consistent-as-needed"]*/
-
-var object1 = {
-    foo: "bar",
-    "baz": 42,
-    "qux-lorem": true
-};
-
-var object2 = {
-    'foo': 'bar',
-    'baz': 42
-};
-```
-
-Examples of **correct** code for this rule with the `"consistent-as-needed"` option:
-
-```js
-/*eslint quote-props: ["error", "consistent-as-needed"]*/
-
-var object1 = {
-    "foo": "bar",
-    "baz": 42,
-    "qux-lorem": true
-};
-
-var object2 = {
-    foo: 'bar',
-    baz: 42
-};
-```
-
-### keywords
-
-Examples of additional **incorrect** code for this rule with the `"as-needed", { "keywords": true }` options:
-
-```js
-/*eslint quote-props: ["error", "as-needed", { "keywords": true }]*/
-
-var x = {
-    while: 1,
-    volatile: "foo"
-};
-```
-
-Examples of additional **incorrect** code for this rule with the `"consistent-as-needed", { "keywords": true }` options:
-
-```js
-/*eslint quote-props: ["error", "consistent-as-needed", { "keywords": true }]*/
-
-var x = {
-    "prop": 1,
-    "bar": "foo"
-};
-```
-
-### unnecessary
-
-Examples of additional **correct** code for this rule with the `"as-needed", { "unnecessary": false }` options:
-
-```js
-/*eslint quote-props: ["error", "as-needed", { "keywords": true, "unnecessary": false }]*/
-
-var x = {
-    "while": 1,
-    "foo": "bar"  // Would normally have caused a warning
-};
-```
-
-### numbers
-
-Examples of additional **incorrect** code for this rule with the `"as-needed", { "numbers": true }` options:
-
-```js
-/*eslint quote-props: ["error", "as-needed", { "numbers": true }]*/
-
-var x = {
-    100: 1
-}
-```
-
-## When Not To Use It
-
-If you don't care if property names are consistently wrapped in quotes or not, and you don't target legacy ES3 environments, turn this rule off.
-
-## Further Reading
-
-* [Reserved words as property names](https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names)
-* [Unquoted property names / object keys in JavaScript](https://mathiasbynens.be/notes/javascript-properties)
diff --git a/eslint/docs/rules/quotes.md b/eslint/docs/rules/quotes.md
deleted file mode 100644 (file)
index 25a09fd..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-# enforce the consistent use of either backticks, double, or single quotes (quotes)
-
-JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:
-
-```js
-/*eslint-env es6*/
-
-var double = "double";
-var single = 'single';
-var backtick = `backtick`;    // ES6 only
-```
-
-Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).
-
-Many codebases require strings to be defined in a consistent manner.
-
-## Rule Details
-
-This rule enforces the consistent use of either backticks, double, or single quotes.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"double"` (default) requires the use of double quotes wherever possible
-* `"single"` requires the use of single quotes wherever possible
-* `"backtick"` requires the use of backticks wherever possible
-
-Object option:
-
-* `"avoidEscape": true` allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
-* `"allowTemplateLiterals": true` allows strings to use backticks
-
-**Deprecated**: The object property `avoid-escape` is deprecated; please use the object property `avoidEscape` instead.
-
-### double
-
-Examples of **incorrect** code for this rule with the default `"double"` option:
-
-```js
-/*eslint quotes: ["error", "double"]*/
-
-var single = 'single';
-var unescaped = 'a string containing "double" quotes';
-var backtick = `back\ntick`; // you can use \n in single or double quoted strings
-```
-
-Examples of **correct** code for this rule with the default `"double"` option:
-
-```js
-/*eslint quotes: ["error", "double"]*/
-/*eslint-env es6*/
-
-var double = "double";
-var backtick = `back
-tick`;  // backticks are allowed due to newline
-var backtick = tag`backtick`; // backticks are allowed due to tag
-```
-
-### single
-
-Examples of **incorrect** code for this rule with the `"single"` option:
-
-```js
-/*eslint quotes: ["error", "single"]*/
-
-var double = "double";
-var unescaped = "a string containing 'single' quotes";
-```
-
-Examples of **correct** code for this rule with the `"single"` option:
-
-```js
-/*eslint quotes: ["error", "single"]*/
-/*eslint-env es6*/
-
-var single = 'single';
-var backtick = `back${x}tick`; // backticks are allowed due to substitution
-```
-
-### backticks
-
-Examples of **incorrect** code for this rule with the `"backtick"` option:
-
-```js
-/*eslint quotes: ["error", "backtick"]*/
-
-var single = 'single';
-var double = "double";
-var unescaped = 'a string containing `backticks`';
-```
-
-Examples of **correct** code for this rule with the `"backtick"` option:
-
-```js
-/*eslint quotes: ["error", "backtick"]*/
-/*eslint-env es6*/
-
-var backtick = `backtick`;
-```
-
-### avoidEscape
-
-Examples of additional **correct** code for this rule with the `"double", { "avoidEscape": true }` options:
-
-```js
-/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
-
-var single = 'a string containing "double" quotes';
-```
-
-Examples of additional **correct** code for this rule with the `"single", { "avoidEscape": true }` options:
-
-```js
-/*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
-
-var double = "a string containing 'single' quotes";
-```
-
-Examples of additional **correct** code for this rule with the `"backtick", { "avoidEscape": true }` options:
-
-```js
-/*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
-
-var double = "a string containing `backtick` quotes"
-```
-
-### allowTemplateLiterals
-
-Examples of additional **correct** code for this rule with the `"double", { "allowTemplateLiterals": true }` options:
-
-```js
-/*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
-
-var double = "double";
-var double = `double`;
-```
-
-Examples of additional **correct** code for this rule with the `"single", { "allowTemplateLiterals": true }` options:
-
-```js
-/*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
-
-var single = 'single';
-var single = `single`;
-```
-
-`{ "allowTemplateLiterals": false }` will not disallow the usage of all template literals. If you want to forbid any instance of template literals, use [no-restricted-syntax](https://eslint.org/docs/rules/no-restricted-syntax) and target the `TemplateLiteral` selector.
-
-## When Not To Use It
-
-If you do not need consistency in your string styles, you can safely disable this rule.
diff --git a/eslint/docs/rules/radix.md b/eslint/docs/rules/radix.md
deleted file mode 100644 (file)
index 4453a64..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-# Require Radix Parameter (radix)
-
-When using the `parseInt()` function it is common to omit the second argument, the radix, and let the function try to determine from the first argument what type of number it is. By default, `parseInt()` will autodetect decimal and hexadecimal (via `0x` prefix). Prior to ECMAScript 5, `parseInt()` also autodetected octal literals, which caused problems because many developers assumed a leading `0` would be ignored.
-
-This confusion led to the suggestion that you always use the radix parameter to `parseInt()` to eliminate unintended consequences. So instead of doing this:
-
-```js
-var num = parseInt("071");      // 57
-```
-
-Do this:
-
-```js
-var num = parseInt("071", 10);  // 71
-```
-
-ECMAScript 5 changed the behavior of `parseInt()` so that it no longer autodetects octal literals and instead treats them as decimal literals. However, the differences between hexadecimal and decimal interpretation of the first parameter causes many developers to continue using the radix parameter to ensure the string is interpreted in the intended way.
-
-On the other hand, if the code is targeting only ES5-compliant environments passing the radix `10` may be redundant. In such a case you might want to disallow using such a radix.
-
-## Rule Details
-
-This rule is aimed at preventing the unintended conversion of a string to a number of a different base than intended or at preventing the redundant `10` radix if targeting modern environments only.
-
-## Options
-
-There are two options for this rule:
-
-* `"always"` enforces providing a radix (default)
-* `"as-needed"` disallows providing the `10` radix
-
-### always
-
-Examples of **incorrect** code for the default `"always"` option:
-
-```js
-/*eslint radix: "error"*/
-
-var num = parseInt("071");
-
-var num = parseInt(someValue);
-
-var num = parseInt("071", "abc");
-
-var num = parseInt("071", 37);
-
-var num = parseInt();
-```
-
-Examples of **correct** code for the default `"always"` option:
-
-```js
-/*eslint radix: "error"*/
-
-var num = parseInt("071", 10);
-
-var num = parseInt("071", 8);
-
-var num = parseFloat(someValue);
-```
-
-### as-needed
-
-Examples of **incorrect** code for the `"as-needed"` option:
-
-```js
-/*eslint radix: ["error", "as-needed"]*/
-
-var num = parseInt("071", 10);
-
-var num = parseInt("071", "abc");
-
-var num = parseInt();
-```
-
-Examples of **correct** code for the `"as-needed"` option:
-
-```js
-/*eslint radix: ["error", "as-needed"]*/
-
-var num = parseInt("071");
-
-var num = parseInt("071", 8);
-
-var num = parseFloat(someValue);
-```
-
-## When Not To Use It
-
-If you don't want to enforce either presence or omission of the `10` radix value you can turn this rule off.
-
-## Further Reading
-
-* [parseInt and radix](https://davidwalsh.name/parseint-radix)
diff --git a/eslint/docs/rules/require-atomic-updates.md b/eslint/docs/rules/require-atomic-updates.md
deleted file mode 100644 (file)
index 64fae21..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-# Disallow assignments that can lead to race conditions due to usage of `await` or `yield` (require-atomic-updates)
-
-When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:
-
-```js
-let totalLength = 0;
-
-async function addLengthOfSinglePage(pageNum) {
-  totalLength += await getPageLength(pageNum);
-}
-
-Promise.all([addLengthOfSinglePage(1), addLengthOfSinglePage(2)]).then(() => {
-  console.log('The combined length of both pages is', totalLength);
-});
-```
-
-This code looks like it will sum the results of calling `getPageLength(1)` and `getPageLength(2)`, but in reality the final value of `totalLength` will only be the length of one of the two pages. The bug is in the statement `totalLength += await getPageLength(pageNum);`. This statement first reads an initial value of `totalLength`, then calls `getPageLength(pageNum)` and waits for that Promise to fulfill. Finally, it sets the value of `totalLength` to the sum of `await getPageLength(pageNum)` and the *initial* value of `totalLength`. If the `totalLength` variable is updated in a separate function call during the time that the `getPageLength(pageNum)` Promise is pending, that update will be lost because the new value is overwritten without being read.
-
-One way to fix this issue would be to ensure that `totalLength` is read at the same time as it's updated, like this:
-
-```js
-async function addLengthOfSinglePage(pageNum) {
-  const lengthOfThisPage = await getPageLength(pageNum);
-
-  totalLength += lengthOfThisPage;
-}
-```
-
-Another solution would be to avoid using a mutable variable reference at all:
-
-```js
-Promise.all([getPageLength(1), getPageLength(2)]).then(pageLengths => {
-  const totalLength = pageLengths.reduce((accumulator, length) => accumulator + length, 0);
-
-  console.log('The combined length of both pages is', totalLength);
-});
-```
-
-## Rule Details
-
-This rule aims to report assignments to variables or properties in cases where the assignments may be based on outdated values.
-
-### Variables
-
-This rule reports an assignment to a variable when it detects the following execution flow in a generator or async function:
-
-1. The variable is read.
-2. A `yield` or `await` pauses the function.
-3. After the function is resumed, a value is assigned to the variable from step 1.
-
-The assignment in step 3 is reported because it may be incorrectly resolved because the value of the variable from step 1 may have changed between steps 2 and 3. In particular, if the variable can be accessed from other execution contexts (for example, if it is not a local variable and therefore other functions can change it), the value of the variable may have changed elsewhere while the function was paused in step 2.
-
-Note that the rule does not report the assignment in step 3 in any of the following cases:
-
-* If the variable is read again between steps 2 and 3.
-* If the variable cannot be accessed while the function is paused (for example, if it's a local variable).
-
-Examples of **incorrect** code for this rule:
-
-```js
-/* eslint require-atomic-updates: error */
-
-let result;
-
-async function foo() {
-    result += await something;
-}
-
-async function bar() {
-    result = result + await something;
-}
-
-async function baz() {
-    result = result + doSomething(await somethingElse);
-}
-
-async function qux() {
-    if (!result) {
-        result = await initialize();
-    }
-}
-
-function* generator() {
-    result += yield;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/* eslint require-atomic-updates: error */
-
-let result;
-
-async function foobar() {
-    result = await something + result;
-}
-
-async function baz() {
-    const tmp = doSomething(await somethingElse);
-    result += tmp;
-}
-
-async function qux() {
-    if (!result) {
-        const tmp = await initialize();
-        if (!result) {
-            result = tmp;
-        }
-    }
-}
-
-async function quux() {
-    let localVariable = 0;
-    localVariable += await something;
-}
-
-function* generator() {
-    result = (yield) + result;
-}
-```
-
-### Properties
-
-This rule reports an assignment to a property through a variable when it detects the following execution flow in a generator or async function:
-
-1. The variable or object property is read.
-2. A `yield` or `await` pauses the function.
-3. After the function is resumed, a value is assigned to a property.
-
-This logic is similar to the logic for variables, but stricter because the property in step 3 doesn't have to be the same as the property in step 1. It is assumed that the flow depends on the state of the object as a whole.
-
-Example of **incorrect** code for this rule:
-
-```js
-/* eslint require-atomic-updates: error */
-
-async function foo(obj) {
-    if (!obj.done) {
-        obj.something = await getSomething();
-    }
-}
-```
-
-Example of **correct** code for this rule:
-
-```js
-/* eslint require-atomic-updates: error */
-
-async function foo(obj) {
-    if (!obj.done) {
-        const tmp = await getSomething();
-        if (!obj.done) {
-            obj.something = tmp;
-        }
-    }
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `"allowProperties"`: When set to `true`, the rule does not report assignments to properties. Default is `false`.
-
-### allowProperties
-
-Example of **correct** code for this rule with the `{ "allowProperties": true }` option:
-
-```js
-/* eslint require-atomic-updates: ["error", { "allowProperties": true }] */
-
-async function foo(obj) {
-    if (!obj.done) {
-        obj.something = await getSomething();
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't use async or generator functions, you don't need to enable this rule.
diff --git a/eslint/docs/rules/require-await.md b/eslint/docs/rules/require-await.md
deleted file mode 100644 (file)
index 9c84d43..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-# Disallow async functions which have no `await` expression (require-await)
-
-Asynchronous functions in JavaScript behave differently than other functions in two important ways:
-
-1. The return value is always a `Promise`.
-2. You can use the `await` operator inside of them.
-
-The primary reason to use asynchronous functions is typically to use the `await` operator, such as this:
-
-```js
-async function fetchData(processDataItem) {
-    const response = await fetch(DATA_URL);
-    const data = await response.json();
-
-    return data.map(processDataItem);
-}
-```
-
-Asynchronous functions that don't use `await` might not need to be asynchronous functions and could be the unintentional result of refactoring.
-
-Note: this rule ignores async generator functions. This is because generators yield rather than return a value and async generators might yield all the values of another async generator without ever actually needing to use await.
-
-## Rule Details
-
-This rule warns async functions which have no `await` expression.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint require-await: "error"*/
-
-async function foo() {
-    doSomething();
-}
-
-bar(async () => {
-    doSomething();
-});
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint require-await: "error"*/
-
-async function foo() {
-    await doSomething();
-}
-
-bar(async () => {
-    await doSomething();
-});
-
-function foo() {
-    doSomething();
-}
-
-bar(() => {
-    doSomething();
-});
-
-// Allow empty functions.
-async function noop() {}
-```
-
-## When Not To Use It
-
-Asynchronous functions are designed to work with promises such that throwing an error will cause a promise's rejection handler (such as `catch()`) to be called. For example:
-
-```js
-async function fail() {
-    throw new Error("Failure!");
-}
-
-fail().catch(error => {
-    console.log(error.message);
-});
-```
-
-In this case, the `fail()` function throws an error that is intended to be caught by the `catch()` handler assigned later. Converting the `fail()` function into a synchronous function would require the call to `fail()` to be refactored to use a `try-catch` statement instead of a promise.
-
-If you are throwing an error inside of an asynchronous function for this purpose, then you may want to disable this rule.
-
-## Related Rules
-
-* [require-yield](require-yield.md)
diff --git a/eslint/docs/rules/require-jsdoc.md b/eslint/docs/rules/require-jsdoc.md
deleted file mode 100644 (file)
index 1e31aed..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-# require JSDoc comments (require-jsdoc)
-
-This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
-
-[JSDoc](http://usejsdoc.org) is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:
-
-```js
-/**
- * Adds two numbers together.
- * @param {int} num1 The first number.
- * @param {int} num2 The second number.
- * @returns {int} The sum of the two numbers.
- */
-function sum(num1, num2) {
-    return num1 + num2;
-}
-```
-
-Some style guides require JSDoc comments for all functions as a way of explaining function behavior.
-
-## Rule Details
-
-This rule requires JSDoc comments for specified nodes. Supported nodes:
-
-* `"FunctionDeclaration"`
-* `"ClassDeclaration"`
-* `"MethodDefinition"`
-* `"ArrowFunctionExpression"`
-* `"FunctionExpression"`
-
-## Options
-
-This rule has a single object option:
-
-* `"require"` requires JSDoc comments for the specified nodes
-
-Default option settings are:
-
-```json
-{
-    "require-jsdoc": ["error", {
-        "require": {
-            "FunctionDeclaration": true,
-            "MethodDefinition": false,
-            "ClassDeclaration": false,
-            "ArrowFunctionExpression": false,
-            "FunctionExpression": false
-        }
-    }]
-}
-```
-
-### require
-
-Examples of **incorrect** code for this rule with the `{ "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } }` option:
-
-```js
-/*eslint "require-jsdoc": ["error", {
-    "require": {
-        "FunctionDeclaration": true,
-        "MethodDefinition": true,
-        "ClassDeclaration": true,
-        "ArrowFunctionExpression": true,
-        "FunctionExpression": true
-    }
-}]*/
-
-function foo() {
-    return 10;
-}
-
-var foo = () => {
-    return 10;
-};
-
-class Foo {
-    bar() {
-        return 10;
-    }
-}
-
-var foo = function() {
-    return 10;
-};
-
-var foo = {
-    bar: function() {
-        return 10;
-    },
-
-    baz() {
-        return 10;
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `{ "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } }` option:
-
-```js
-/*eslint "require-jsdoc": ["error", {
-    "require": {
-        "FunctionDeclaration": true,
-        "MethodDefinition": true,
-        "ClassDeclaration": true,
-        "ArrowFunctionExpression": true,
-        "FunctionExpression": true
-    }
-}]*/
-
-/**
- * It returns 10
- */
-function foo() {
-    return 10;
-}
-
-/**
- * It returns test + 10
- * @params {int} test - some number
- * @returns {int} sum of test and 10
- */
-var foo = (test) => {
-    return test + 10;
-}
-
-/**
- * It returns 10
- */
-var foo = () => {
-    return 10;
-}
-
-/**
- * It returns 10
- */
-var foo = function() {
-    return 10;
-}
-
-var array = [1,2,3];
-array.filter(function(item) {
-    return item > 2;
-});
-
-/**
- * A class that can return the number 10
- */
-class Foo {
-    /**
-    * It returns 10
-    */
-    bar() {
-        return 10;
-    }
-}
-
-/**
- * It returns 10
- */
-var foo = function() {
-    return 10;
-};
-
-var foo = {
-    /**
-    * It returns 10
-    */
-    bar: function() {
-        return 10;
-    },
-
-    /**
-    * It returns 10
-    */
-    baz() {
-        return 10;
-    }
-};
-
-setTimeout(() => {}, 10); // since it's an anonymous arrow function
-```
-
-## When Not To Use It
-
-If you do not require JSDoc for your functions, then you can leave this rule off.
-
-## Related Rules
-
-* [valid-jsdoc](valid-jsdoc.md)
diff --git a/eslint/docs/rules/require-unicode-regexp.md b/eslint/docs/rules/require-unicode-regexp.md
deleted file mode 100644 (file)
index 3077d4d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# Enforce the use of `u` flag on RegExp (require-unicode-regexp)
-
-RegExp `u` flag has two effects:
-
-1. **Make the regular expression handling UTF-16 surrogate pairs correctly.**
-
-    Especially, character range syntax gets the correct behavior.
-
-    ```js
-    /^[👍]$/.test("👍") //→ false
-    /^[👍]$/u.test("👍") //→ true
-    ```
-
-2. **Make the regular expression throwing syntax errors early as disabling [Annex B extensions](https://www.ecma-international.org/ecma-262/6.0/#sec-regular-expressions-patterns).**
-
-    Because of historical reason, JavaScript regular expressions are tolerant of syntax errors. For example, `/\w{1, 2/` is a syntax error, but JavaScript doesn't throw the error. It matches strings such as `"a{1, 2"` instead. Such a recovering logic is defined in Annex B.
-
-    The `u` flag disables the recovering logic Annex B defined. As a result, you can find errors early. This is similar to [the strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode).
-
-Therefore, the `u` flag lets us work better with regular expressions.
-
-## Rule Details
-
-This rule aims to enforce the use of `u` flag on regular expressions.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint require-unicode-regexp: error */
-
-const a = /aaa/
-const b = /bbb/gi
-const c = new RegExp("ccc")
-const d = new RegExp("ddd", "gi")
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint require-unicode-regexp: error */
-
-const a = /aaa/u
-const b = /bbb/giu
-const c = new RegExp("ccc", "u")
-const d = new RegExp("ddd", "giu")
-
-// This rule ignores RegExp calls if the flags could not be evaluated to a static value.
-function f(flags) {
-    return new RegExp("eee", flags)
-}
-```
-
-## When Not To Use It
-
-If you don't want to notify regular expressions with no `u` flag, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/require-yield.md b/eslint/docs/rules/require-yield.md
deleted file mode 100644 (file)
index 22c262b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Disallow generator functions that do not have `yield` (require-yield)
-
-## Rule Details
-
-This rule generates warnings for generator functions that do not have the `yield` keyword.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint require-yield: "error"*/
-/*eslint-env es6*/
-
-function* foo() {
-  return 10;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint require-yield: "error"*/
-/*eslint-env es6*/
-
-function* foo() {
-  yield 5;
-  return 10;
-}
-
-function foo() {
-  return 10;
-}
-
-// This rule does not warn on empty generator functions.
-function* foo() { }
-```
-
-## When Not To Use It
-
-If you don't want to notify generator functions that have no `yield` expression, then it's safe to disable this rule.
-
-## Related Rules
-
-* [require-await](require-await.md)
diff --git a/eslint/docs/rules/rest-spread-spacing.md b/eslint/docs/rules/rest-spread-spacing.md
deleted file mode 100644 (file)
index d8d6063..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-# Enforce spacing between rest and spread operators and their expressions (rest-spread-spacing)
-
-ES2015 introduced the rest and spread operators, which expand an iterable structure into its individual parts. Some examples of their usage are as follows:
-
-```js
-let numArr = [1, 2, 3];
-function add(a, b, c) {
-    return a + b + c;
-}
-add(...numArr); // -> 6
-
-let arr1 = [1, 2, 3];
-let arr2 = [4, 5, 6];
-arr1.push(...arr2); // -> [1, 2, 3, 4, 5, 6]
-
-let [a, b, ...arr] = [1, 2, 3, 4, 5];
-a; // -> 1
-b // -> 2
-arr; // ->  [3, 4, 5]
-
-function numArgs(...args) {
-  return args.length;
-}
-numArgs(a, b, c); // -> 3
-```
-
-In addition to the above, there is currently a proposal to add object rest and spread properties to the spec. They can be used as follows:
-
-```js
-
-let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
-x; // -> 1
-y; // -> 2
-z; // -> { a: 3, b: 4 }
-
-let n = { x, y, ...z };
-n; // -> { x: 1, y: 2, a: 3, b: 4 }
-```
-
-As with other operators, whitespace is allowed between the rest or spread operator and the expression it is operating on, which can lead to inconsistent spacing within a codebase.
-
-## Rule Details
-
-This rule aims to enforce consistent spacing between rest and spread operators and their expressions. The rule also supports object rest and spread properties in ES2018:
-
-```json
-{
-    "parserOptions": {
-        "ecmaVersion": 2018
-    }
-}
-```
-
-Please read the user guide's section on [configuring parser options](/docs/user-guide/configuring#specifying-parser-options) to learn more.
-
-## Options
-
-This rule takes one option: a string with the value of `"never"` or `"always"`. The default value is `"never"`.
-
-### "never"
-
-When using the default `"never"` option, whitespace is not allowed between spread operators and their expressions.
-
-```json
-rest-spread-spacing: ["error"]
-```
-
-or
-
-```json
-rest-spread-spacing: ["error", "never"]
-```
-
-Examples of **incorrect** code for this rule with `"never"`:
-
-```js
-/*eslint rest-spread-spacing: ["error", "never"]*/
-
-fn(... args)
-[... arr, 4, 5, 6]
-let [a, b, ... arr] = [1, 2, 3, 4, 5];
-function fn(... args) { console.log(args); }
-let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
-let n = { x, y, ... z };
-```
-
-Examples of **correct** code for this rule with `"never"`:
-
-```js
-/*eslint rest-spread-spacing: ["error", "never"]*/
-
-fn(...args)
-[...arr, 4, 5, 6]
-let [a, b, ...arr] = [1, 2, 3, 4, 5];
-function fn(...args) { console.log(args); }
-let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
-let n = { x, y, ...z };
-```
-
-### "always"
-
-When using the `"always"` option, whitespace is required between spread operators and their expressions.
-
-```json
-rest-spread-spacing: ["error", "always"]
-```
-
-Examples of **incorrect** code for this rule with `"always"`:
-
-```js
-/*eslint rest-spread-spacing:["error", "always"]*/
-
-fn(...args)
-[...arr, 4, 5, 6]
-let [a, b, ...arr] = [1, 2, 3, 4, 5];
-function fn(...args) { console.log(args); }
-let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
-let n = { x, y, ...z };
-```
-
-Examples of **correct** code for this rule with `"always"`:
-
-```js
-/*eslint rest-spread-spacing: ["error", "always"]*/
-
-fn(... args)
-[... arr, 4, 5, 6]
-let [a, b, ... arr] = [1, 2, 3, 4, 5];
-function fn(... args) { console.log(args); }
-let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
-let n = { x, y, ... z };
-```
-
-## When Not To Use It
-
-You can safely disable this rule if you do not care about enforcing consistent spacing between spread operators and their expressions.
-
-## Further Reading
-
-* [Object Rest/Spread Properties for ECMAScript](https://github.com/tc39/proposal-object-rest-spread)
diff --git a/eslint/docs/rules/semi-spacing.md b/eslint/docs/rules/semi-spacing.md
deleted file mode 100644 (file)
index 4db5e18..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-# Enforce spacing before and after semicolons (semi-spacing)
-
-JavaScript allows you to place unnecessary spaces before or after a semicolon.
-
-Disallowing or enforcing space around a semicolon can improve the readability of your program.
-
-```js
-var a = "b" ;
-
-var c = "d";var e = "f";
-```
-
-## Rule Details
-
-This rule aims to enforce spacing around a semicolon. This rule prevents the use of spaces before a semicolon in expressions.
-
-This rule doesn't check spacing in the following cases:
-
-* The spacing after the semicolon if it is the first token in the line.
-
-* The spacing before the semicolon if it is after an opening parenthesis (`(` or `{`), or the spacing after the semicolon if it is before a closing parenthesis (`)` or `}`). That spacing is checked by `space-in-parens` or `block-spacing`.
-
-* The spacing around the semicolon in a for loop with an empty condition (`for(;;)`).
-
-## Options
-
-The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
-If `before` is `true`, space is enforced before semicolons and if it's `false`, space is disallowed before semicolons.
-If `after` is `true`, space is enforced after semicolons and if it's `false`, space is disallowed after semicolons.
-The `after` option will be only applied if a semicolon is not at the end of line.
-
-The default is `{"before": false, "after": true}`.
-
-```json
-    "semi-spacing": ["error", {"before": false, "after": true}]
-```
-
-### `{"before": false, "after": true}`
-
-This is the default option. It enforces spacing after semicolons and disallows spacing before semicolons.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint semi-spacing: "error"*/
-
-var foo ;
-var foo;var bar;
-throw new Error("error") ;
-while (a) { break ; }
-for (i = 0 ; i < 10 ; i++) {}
-for (i = 0;i < 10;i++) {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint semi-spacing: "error"*/
-
-var foo;
-var foo; var bar;
-throw new Error("error");
-while (a) { break; }
-for (i = 0; i < 10; i++) {}
-for (;;) {}
-if (true) {;}
-;foo();
-```
-
-### `{"before": true, "after": false}`
-
-This option enforces spacing before semicolons and disallows spacing after semicolons.
-
-Examples of **incorrect** code for this rule with the `{"before": true, "after": false}` option:
-
-```js
-/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
-
-var foo;
-var foo ; var bar;
-throw new Error("error");
-while (a) { break; }
-for (i = 0;i < 10;i++) {}
-for (i = 0; i < 10; i++) {}
-```
-
-Examples of **correct** code for this rule with the `{"before": true, "after": false}` option:
-
-```js
-/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
-
-var foo ;
-var foo ;var bar ;
-throw new Error("error") ;
-while (a) {break ;}
-for (i = 0 ;i < 10 ;i++) {}
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing before or after semicolons.
-
-## Related Rules
-
-* [semi](semi.md)
-* [no-extra-semi](no-extra-semi.md)
-* [comma-spacing](comma-spacing.md)
-* [block-spacing](block-spacing.md)
-* [space-in-parens](space-in-parens.md)
diff --git a/eslint/docs/rules/semi-style.md b/eslint/docs/rules/semi-style.md
deleted file mode 100644 (file)
index 368bb53..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-# Enforce location of semicolons (semi-style)
-
-Generally, semicolons are at the end of lines. However, in semicolon-less style, semicolons are at the beginning of lines. This rule enforces that semicolons are at the configured location.
-
-## Rule Details
-
-This rule reports line terminators around semicolons.
-
-This rule has an option.
-
-```json
-{
-    "semi-style": ["error", "last"],
-}
-```
-
-- `"last"` (Default) enforces that semicolons are at the end of statements.
-- `"first"` enforces that semicolons are at the beginning of statements. Semicolons of `for` loop heads (`for(a;b;c){}`) should be at the end of lines even if you use this option.
-
-Examples of **incorrect** code for this rule with `"last"` option:
-
-```js
-/*eslint semi-style: ["error", "last"]*/
-
-foo()
-;[1, 2, 3].forEach(bar)
-
-for (
-    var i = 0
-    ; i < 10
-    ; ++i
-) {
-    foo()
-}
-
-class C {
-    static {
-        foo()
-        ;bar()
-    }
-}
-```
-
-Examples of **correct** code for this rule with `"last"` option:
-
-```js
-/*eslint semi-style: ["error", "last"]*/
-
-foo();
-[1, 2, 3].forEach(bar)
-
-for (
-    var i = 0;
-    i < 10;
-    ++i
-) {
-    foo()
-}
-
-class C {
-    static {
-        foo();
-        bar()
-    }
-}
-```
-
-Examples of **incorrect** code for this rule with `"first"` option:
-
-```js
-/*eslint semi-style: ["error", "first"]*/
-
-foo();
-[1, 2, 3].forEach(bar)
-
-for (
-    var i = 0
-    ; i < 10
-    ; ++i
-) {
-    foo()
-}
-
-class C {
-    static {
-        foo();
-        bar()
-    }
-}
-```
-
-Examples of **correct** code for this rule with `"first"` option:
-
-```js
-/*eslint semi-style: ["error", "first"]*/
-
-foo()
-;[1, 2, 3].forEach(bar)
-
-for (
-    var i = 0;
-    i < 10;
-    ++i
-) {
-    foo()
-}
-
-class C {
-    static {
-        foo()
-        ;bar()
-    }
-}
-```
-
-## When Not To Use It
-
-If you don't want to notify the location of semicolons, then it's safe to disable this rule.
-
-## Related rules
-
-- [no-extra-semi](./no-extra-semi.md)
-- [semi](./semi.md)
-- [semi-spacing](./semi-spacing.md)
diff --git a/eslint/docs/rules/semi.md b/eslint/docs/rules/semi.md
deleted file mode 100644 (file)
index cb8e6dd..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-# require or disallow semicolons instead of ASI (semi)
-
-JavaScript doesn't require semicolons at the end of each statement. In many cases, the JavaScript engine can determine that a semicolon should be in a certain spot and will automatically add it. This feature is known as **automatic semicolon insertion (ASI)** and is considered one of the more controversial features of JavaScript. For example, the following lines are both valid:
-
-```js
-var name = "ESLint"
-var website = "eslint.org";
-```
-
-On the first line, the JavaScript engine will automatically insert a semicolon, so this is not considered a syntax error. The JavaScript engine still knows how to interpret the line and knows that the line end indicates the end of the statement.
-
-In the debate over ASI, there are generally two schools of thought. The first is that we should treat ASI as if it didn't exist and always include semicolons manually. The rationale is that it's easier to always include semicolons than to try to remember when they are or are not required, and thus decreases the possibility of introducing an error.
-
-However, the ASI mechanism can sometimes be tricky to people who are using semicolons. For example, consider this code:
-
-```js
-return
-{
-    name: "ESLint"
-};
-```
-
-This may look like a `return` statement that returns an object literal, however, the JavaScript engine will interpret this code as:
-
-```js
-return;
-{
-    name: "ESLint";
-}
-```
-
-Effectively, a semicolon is inserted after the `return` statement, causing the code below it (a labeled literal inside a block) to be unreachable. This rule and the [no-unreachable](no-unreachable.md) rule will protect your code from such cases.
-
-On the other side of the argument are those who say that since semicolons are inserted automatically, they are optional and do not need to be inserted manually. However, the ASI mechanism can also be tricky to people who don't use semicolons. For example, consider this code:
-
-```js
-var globalCounter = { }
-
-(function () {
-    var n = 0
-    globalCounter.increment = function () {
-        return ++n
-    }
-})()
-```
-
-In this example, a semicolon will not be inserted after the first line, causing a run-time error (because an empty object is called as if it's a function). The [no-unexpected-multiline](no-unexpected-multiline.md) rule can protect your code from such cases.
-
-Although ASI allows for more freedom over your coding style, it can also make your code behave in an unexpected way, whether you use semicolons or not. Therefore, it is best to know when ASI takes place and when it does not, and have ESLint protect your code from these potentially unexpected cases. In short, as once described by Isaac Schlueter, a `\n` character always ends a statement (just like a semicolon) unless one of the following is true:
-
-1. The statement has an unclosed paren, array literal, or object literal or ends in some other way that is not a valid way to end a statement. (For instance, ending with `.` or `,`.)
-1. The line is `--` or `++` (in which case it will decrement/increment the next token.)
-1. It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{`
-1. The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other binary operator that can only be found between two tokens in a single expression.
-
-## Rule Details
-
-This rule enforces consistent use of semicolons.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"always"` (default) requires semicolons at the end of statements
-* `"never"` disallows semicolons as the end of statements (except to disambiguate statements beginning with `[`, `(`, `/`, `+`, or `-`)
-
-Object option (when `"always"`):
-
-* `"omitLastInOneLineBlock": true` ignores the last semicolon in a block in which its braces (and therefore the content of the block) are in the same line
-
-Object option (when `"never"`):
-
-* `"beforeStatementContinuationChars": "any"` (default) ignores semicolons (or lacking semicolon) at the end of statements if the next line starts with `[`, `(`, `/`, `+`, or `-`.
-* `"beforeStatementContinuationChars": "always"` requires semicolons at the end of statements if the next line starts with `[`, `(`, `/`, `+`, or `-`.
-* `"beforeStatementContinuationChars": "never"` disallows semicolons as the end of statements if it doesn't make ASI hazard even if the next line starts with `[`, `(`, `/`, `+`, or `-`.
-
-**Note:** `beforeStatementContinuationChars` does not apply to class fields because class fields are not statements.
-
-### always
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint semi: ["error", "always"]*/
-
-var name = "ESLint"
-
-object.method = function() {
-    // ...
-}
-
-class Foo {
-    bar = 1
-}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint semi: "error"*/
-
-var name = "ESLint";
-
-object.method = function() {
-    // ...
-};
-
-class Foo {
-    bar = 1;
-}
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint semi: ["error", "never"]*/
-
-var name = "ESLint";
-
-object.method = function() {
-    // ...
-};
-
-class Foo {
-    bar = 1;
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint semi: ["error", "never"]*/
-
-var name = "ESLint"
-
-object.method = function() {
-    // ...
-}
-
-var name = "ESLint"
-
-;(function() {
-    // ...
-})()
-
-import a from "a"
-(function() {
-    // ...
-})()
-
-import b from "b"
-;(function() {
-    // ...
-})()
-
-class Foo {
-    bar = 1
-}
-```
-
-#### omitLastInOneLineBlock
-
-Examples of additional **correct** code for this rule with the `"always", { "omitLastInOneLineBlock": true }` options:
-
-```js
-/*eslint semi: ["error", "always", { "omitLastInOneLineBlock": true}] */
-
-if (foo) { bar() }
-
-if (foo) { bar(); baz() }
-
-function f() { bar(); baz() }
-
-class C {
-    foo() { bar(); baz() }
-
-    static { bar(); baz() }
-}
-```
-
-#### beforeStatementContinuationChars
-
-Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "always" }` options:
-
-```js
-/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "always"}] */
-import a from "a"
-
-(function() {
-    // ...
-})()
-```
-
-Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "never" }` options:
-
-```js
-/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "never"}] */
-import a from "a"
-
-;(function() {
-    // ...
-})()
-```
-
-## When Not To Use It
-
-If you do not want to enforce semicolon usage (or omission) in any particular way, then you can turn this rule off.
-
-## Further Reading
-
-* [An Open Letter to JavaScript Leaders Regarding Semicolons](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding)
-* [JavaScript Semicolon Insertion](http://inimino.org/~inimino/blog/javascript_semicolons)
-
-## Related Rules
-
-* [no-extra-semi](no-extra-semi.md)
-* [no-unexpected-multiline](no-unexpected-multiline.md)
-* [semi-spacing](semi-spacing.md)
diff --git a/eslint/docs/rules/sort-imports.md b/eslint/docs/rules/sort-imports.md
deleted file mode 100644 (file)
index 08c2cf3..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-# Import Sorting (sort-imports)
-
-The import statement is used to import members (functions, objects or primitives) that have been exported from an external module. Using a specific member syntax:
-
-```js
-// single - Import single member.
-import myMember from "my-module.js";
-
-// multiple - Import multiple members.
-import {foo, bar} from "my-module.js";
-
-// all - Import all members, where myModule contains all the exported bindings.
-import * as myModule from "my-module.js";
-```
-
-The import statement can also import a module without exported bindings. Used when the module does not export anything, but runs it own code or changes the global context object.
-
-```js
-// none - Import module without exported bindings.
-import "my-module.js"
-```
-
-When declaring multiple imports, a sorted list of import declarations make it easier for developers to read the code and find necessary imports later. This rule is purely a matter of style.
-
-## Rule Details
-
-This rule checks all import declarations and verifies that all imports are first sorted by the used member syntax and then alphabetically by the first member or alias name.
-
-The `--fix` option on the command line automatically fixes some problems reported by this rule: multiple members on a single line are automatically sorted (e.g. `import { b, a } from 'foo.js'` is corrected to `import { a, b } from 'foo.js'`), but multiple lines are not reordered.
-
-## Options
-
-This rule accepts an object with its properties as
-
-* `ignoreCase` (default: `false`)
-* `ignoreDeclarationSort` (default: `false`)
-* `ignoreMemberSort` (default: `false`)
-* `memberSyntaxSortOrder` (default: `["none", "all", "multiple", "single"]`); all 4 items must be present in the array, but you can change the order:
-    * `none` = import module without exported bindings.
-    * `all` = import all members provided by exported bindings.
-    * `multiple` = import multiple members.
-    * `single` = import single member.
-* `allowSeparatedGroups` (default: `false`)
-
-Default option settings are:
-
-```json
-{
-    "sort-imports": ["error", {
-        "ignoreCase": false,
-        "ignoreDeclarationSort": false,
-        "ignoreMemberSort": false,
-        "memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
-        "allowSeparatedGroups": false
-    }]
-}
-```
-
-## Examples
-
-### Default settings
-
-Examples of **correct** code for this rule when using default options:
-
-```js
-/*eslint sort-imports: "error"*/
-import 'module-without-export.js';
-import * as bar from 'bar.js';
-import * as foo from 'foo.js';
-import {alpha, beta} from 'alpha.js';
-import {delta, gamma} from 'delta.js';
-import a from 'baz.js';
-import b from 'qux.js';
-
-/*eslint sort-imports: "error"*/
-import a from 'foo.js';
-import b from 'bar.js';
-import c from 'baz.js';
-
-/*eslint sort-imports: "error"*/
-import 'foo.js'
-import * as bar from 'bar.js';
-import {a, b} from 'baz.js';
-import c from 'qux.js';
-
-/*eslint sort-imports: "error"*/
-import {a, b, c} from 'foo.js'
-```
-
-Examples of **incorrect** code for this rule when using default options:
-
-```js
-/*eslint sort-imports: "error"*/
-import b from 'foo.js';
-import a from 'bar.js';
-
-/*eslint sort-imports: "error"*/
-import a from 'foo.js';
-import A from 'bar.js';
-
-/*eslint sort-imports: "error"*/
-import {b, c} from 'foo.js';
-import {a, b} from 'bar.js';
-
-/*eslint sort-imports: "error"*/
-import a from 'foo.js';
-import {b, c} from 'bar.js';
-
-/*eslint sort-imports: "error"*/
-import a from 'foo.js';
-import * as b from 'bar.js';
-
-/*eslint sort-imports: "error"*/
-import {b, a, c} from 'foo.js'
-```
-
-### `ignoreCase`
-
-When `true` the rule ignores the case-sensitivity of the imports local name.
-
-Examples of **incorrect** code for this rule with the `{ "ignoreCase": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreCase": true }]*/
-
-import B from 'foo.js';
-import a from 'bar.js';
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreCase": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreCase": true }]*/
-
-import a from 'foo.js';
-import B from 'bar.js';
-import c from 'baz.js';
-```
-
-Default is `false`.
-
-### `ignoreDeclarationSort`
-
-Ignores the sorting of import declaration statements.
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreDeclarationSort": false }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreDeclarationSort": false }]*/
-import b from 'foo.js'
-import a from 'bar.js'
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreDeclarationSort": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
-import a from 'foo.js'
-import b from 'bar.js'
-```
-
-```js
-/*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
-import b from 'foo.js'
-import a from 'bar.js'
-```
-
-Default is `false`.
-
-### `ignoreMemberSort`
-
-Ignores the member sorting within a `multiple` member import declaration.
-
-Examples of **incorrect** code for this rule with the default `{ "ignoreMemberSort": false }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreMemberSort": false }]*/
-import {b, a, c} from 'foo.js'
-```
-
-Examples of **correct** code for this rule with the `{ "ignoreMemberSort": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "ignoreMemberSort": true }]*/
-import {b, a, c} from 'foo.js'
-```
-
-Default is `false`.
-
-### `memberSyntaxSortOrder`
-
-There are four different styles and the default member syntax sort order is:
-
-* `none` - import module without exported bindings.
-* `all` - import all members provided by exported bindings.
-* `multiple` - import multiple members.
-* `single` - import single member.
-
-All four options must be specified in the array, but you can customize their order.
-
-Examples of **incorrect** code for this rule with the default `{ "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] }` option:
-
-```js
-/*eslint sort-imports: "error"*/
-import a from 'foo.js';
-import * as b from 'bar.js';
-```
-
-Examples of **correct** code for this rule with the `{ "memberSyntaxSortOrder": ['single', 'all', 'multiple', 'none'] }` option:
-
-```js
-/*eslint sort-imports: ["error", { "memberSyntaxSortOrder": ['single', 'all', 'multiple', 'none'] }]*/
-
-import a from 'foo.js';
-import * as b from 'bar.js';
-```
-
-Examples of **correct** code for this rule with the `{ "memberSyntaxSortOrder": ['all', 'single', 'multiple', 'none'] }` option:
-
-```js
-/*eslint sort-imports: ["error", { "memberSyntaxSortOrder": ['all', 'single', 'multiple', 'none'] }]*/
-
-import * as foo from 'foo.js';
-import z from 'zoo.js';
-import {a, b} from 'foo.js';
-```
-
-Default is `["none", "all", "multiple", "single"]`.
-
-### `allowSeparatedGroups`
-
-When `true` the rule checks the sorting of import declaration statements only for those that appear on consecutive lines.
-
-In other words, a blank line or a comment line or line with any other statement after an import declaration statement will reset the sorting of import declaration statements.
-
-Examples of **incorrect** code for this rule with the `{ "allowSeparatedGroups": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
-
-import b from 'foo.js';
-import c from 'bar.js';
-import a from 'baz.js';
-```
-
-Examples of **correct** code for this rule with the `{ "allowSeparatedGroups": true }` option:
-
-```js
-/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
-
-import b from 'foo.js';
-import c from 'bar.js';
-
-import a from 'baz.js';
-```
-
-```js
-/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
-
-import b from 'foo.js';
-import c from 'bar.js';
-// comment
-import a from 'baz.js';
-```
-
-```js
-/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
-
-import b from 'foo.js';
-import c from 'bar.js';
-quux();
-import a from 'baz.js';
-```
-
-Default is `false`.
-
-## When Not To Use It
-
-This rule is a formatting preference and not following it won't negatively affect the quality of your code. If alphabetizing imports isn't a part of your coding standards, then you can leave this rule disabled.
-
-## Related Rules
-
-* [sort-keys](sort-keys.md)
-* [sort-vars](sort-vars.md)
diff --git a/eslint/docs/rules/sort-keys.md b/eslint/docs/rules/sort-keys.md
deleted file mode 100644 (file)
index 937a7da..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-# require object keys to be sorted (sort-keys)
-
-When declaring multiple properties, some developers prefer to sort property names alphabetically to more easily find and/or diff necessary properties at a later time. Others feel that it adds complexity and becomes burden to maintain.
-
-## Rule Details
-
-This rule checks all property definitions of object expressions and verifies that all variables are sorted alphabetically.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint sort-keys: "error"*/
-/*eslint-env es6*/
-
-let obj = {a: 1, c: 3, b: 2};
-let obj = {a: 1, "c": 3, b: 2};
-
-// Case-sensitive by default.
-let obj = {a: 1, b: 2, C: 3};
-
-// Non-natural order by default.
-let obj = {1: a, 2: c, 10: b};
-
-// This rule checks computed properties which have a simple name as well.
-// Simple names are names which are expressed by an Identifier node or a Literal node.
-const S = Symbol("s")
-let obj = {a: 1, ["c"]: 3, b: 2};
-let obj = {a: 1, [S]: 3, b: 2};
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint sort-keys: "error"*/
-/*eslint-env es6*/
-
-let obj = {a: 1, b: 2, c: 3};
-let obj = {a: 1, "b": 2, c: 3};
-
-// Case-sensitive by default.
-let obj = {C: 3, a: 1, b: 2};
-
-// Non-natural order by default.
-let obj = {1: a, 10: b, 2: c};
-
-// This rule checks computed properties which have a simple name as well.
-let obj = {a: 1, ["b"]: 2, c: 3};
-let obj = {a: 1, [b]: 2, c: 3};
-
-// This rule ignores computed properties which have a non-simple name.
-let obj = {a: 1, [c + d]: 3, b: 2};
-let obj = {a: 1, ["c" + "d"]: 3, b: 2};
-let obj = {a: 1, [`${c}`]: 3, b: 2};
-let obj = {a: 1, [tag`c`]: 3, b: 2};
-
-// This rule does not report unsorted properties that are separated by a spread property.
-let obj = {b: 1, ...c, a: 2};
-```
-
-## Options
-
-```json
-{
-    "sort-keys": ["error", "asc", {"caseSensitive": true, "natural": false, "minKeys": 2}]
-}
-```
-
-The 1st option is `"asc"` or `"desc"`.
-
-* `"asc"` (default) - enforce properties to be in ascending order.
-* `"desc"` - enforce properties to be in descending order.
-
-The 2nd option is an object which has 3 properties.
-
-* `caseSensitive` - if `true`, enforce properties to be in case-sensitive order. Default is `true`.
-* `minKeys` - Specifies the minimum number of keys that an object should have in order for the object's unsorted keys to produce an error. Default is `2`, which means by default all objects with unsorted keys will result in lint errors.
-* `natural` - if `true`, enforce properties to be in natural order. Default is `false`. Natural Order compares strings containing combination of letters and numbers in the way a human being would sort. It basically sorts numerically, instead of sorting alphabetically. So the number 10 comes after the number 3 in Natural Sorting.
-
-Example for a list:
-
-With `natural` as true, the ordering would be
-1
-3
-6
-8
-10
-
-With `natural` as false, the ordering would be
-1
-10
-3
-6
-8
-
-### desc
-
-Examples of **incorrect** code for the `"desc"` option:
-
-```js
-/*eslint sort-keys: ["error", "desc"]*/
-/*eslint-env es6*/
-
-let obj = {b: 2, c: 3, a: 1};
-let obj = {"b": 2, c: 3, a: 1};
-
-// Case-sensitive by default.
-let obj = {C: 1, b: 3, a: 2};
-
-// Non-natural order by default.
-let obj = {10: b, 2: c, 1: a};
-```
-
-Examples of **correct** code for the `"desc"` option:
-
-```js
-/*eslint sort-keys: ["error", "desc"]*/
-/*eslint-env es6*/
-
-let obj = {c: 3, b: 2, a: 1};
-let obj = {c: 3, "b": 2, a: 1};
-
-// Case-sensitive by default.
-let obj = {b: 3, a: 2, C: 1};
-
-// Non-natural order by default.
-let obj = {2: c, 10: b, 1: a};
-```
-
-### insensitive
-
-Examples of **incorrect** code for the `{caseSensitive: false}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {caseSensitive: false}]*/
-/*eslint-env es6*/
-
-let obj = {a: 1, c: 3, C: 4, b: 2};
-let obj = {a: 1, C: 3, c: 4, b: 2};
-```
-
-Examples of **correct** code for the `{caseSensitive: false}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {caseSensitive: false}]*/
-/*eslint-env es6*/
-
-let obj = {a: 1, b: 2, c: 3, C: 4};
-let obj = {a: 1, b: 2, C: 3, c: 4};
-```
-
-### natural
-
-Examples of **incorrect** code for the `{natural: true}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {natural: true}]*/
-/*eslint-env es6*/
-
-let obj = {1: a, 10: c, 2: b};
-```
-
-Examples of **correct** code for the `{natural: true}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {natural: true}]*/
-/*eslint-env es6*/
-
-let obj = {1: a, 2: b, 10: c};
-```
-
-### minKeys
-
-Examples of **incorrect** code for the `{minKeys: 4}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {minKeys: 4}]*/
-/*eslint-env es6*/
-
-// 4 keys
-let obj = {
-    b: 2,
-    a: 1, // not sorted correctly (should be 1st key)
-    c: 3,
-    d: 4,
-};
-
-// 5 keys
-let obj = {
-    2: 'a',
-    1: 'b', // not sorted correctly (should be 1st key)
-    3: 'c',
-    4: 'd',
-    5: 'e',
-};
-```
-
-Examples of **correct** code for the `{minKeys: 4}` option:
-
-```js
-/*eslint sort-keys: ["error", "asc", {minKeys: 4}]*//
-/*eslint-env es6*/
-
-// 3 keys
-let obj = {
-    b: 2,
-    a: 1,
-    c: 3,
-};
-
-// 2 keys
-let obj = {
-    2: 'b',
-    1: 'a',
-};
-```
-
-## When Not To Use It
-
-If you don't want to notify about properties' order, then it's safe to disable this rule.
-
-## Related Rules
-
-* [sort-imports](sort-imports.md)
-* [sort-vars](sort-vars.md)
-
-## Compatibility
-
-* **JSCS:** [validateOrderInObjectKeys](https://jscs-dev.github.io/rule/validateOrderInObjectKeys)
diff --git a/eslint/docs/rules/sort-vars.md b/eslint/docs/rules/sort-vars.md
deleted file mode 100644 (file)
index 8a201f3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# Variable Sorting (sort-vars)
-
-When declaring multiple variables within the same block, some developers prefer to sort variable names alphabetically to be able to find necessary variable easier at the later time. Others feel that it adds complexity and becomes burden to maintain.
-
-## Rule Details
-
-This rule checks all variable declaration blocks and verifies that all variables are sorted alphabetically.
-The default configuration of the rule is case-sensitive.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint sort-vars: "error"*/
-
-var b, a;
-
-var a, B, c;
-
-var a, A;
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint sort-vars: "error"*/
-
-var a, b, c, d;
-
-var _a = 10;
-var _b = 20;
-
-var A, a;
-
-var B, a, c;
-```
-
-Alphabetical list is maintained starting from the first variable and excluding any that are considered problems. So the following code will produce two problems:
-
-```js
-/*eslint sort-vars: "error"*/
-
-var c, d, a, b;
-```
-
-But this one, will only produce one:
-
-```js
-/*eslint sort-vars: "error"*/
-
-var c, d, a, e;
-```
-
-## Options
-
-This rule has an object option:
-
-* `"ignoreCase": true` (default `false`) ignores the case-sensitivity of the variables order
-
-### ignoreCase
-
-Examples of **correct** code for this rule with the `{ "ignoreCase": true }` option:
-
-```js
-/*eslint sort-vars: ["error", { "ignoreCase": true }]*/
-
-var a, A;
-
-var a, B, c;
-```
-
-## When Not To Use It
-
-This rule is a formatting preference and not following it won't negatively affect the quality of your code. If you alphabetizing variables isn't a part of your coding standards, then you can leave this rule off.
-
-## Related Rules
-
-* [sort-keys](sort-keys.md)
-* [sort-imports](sort-imports.md)
diff --git a/eslint/docs/rules/space-after-function-name.md b/eslint/docs/rules/space-after-function-name.md
deleted file mode 100644 (file)
index 6cceaab..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# space-after-function-name: enforce consistent spacing after name in function definitions
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [space-before-function-paren](space-before-function-paren.md) rule.
-
-Whitespace between a function name and its parameter list is optional.
-
-```js
-function withoutSpace(x) {
-    // ...
-}
-
-function withSpace (x) {
-    // ...
-}
-```
-
-Some style guides may require a consistent spacing for function names.
-
-## Rule Details
-
-This rule aims to enforce a consistent spacing after function names. It takes one argument. If it is `"always"` then all function names must be followed by at least one space. If `"never"` then there should be no spaces between the name and the parameter list. The default is `"never"`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-function foo (x) {
-    // ...
-}
-
-var x = function named (x) {};
-
-// When ["error", "always"]
-function bar(x) {
-    // ...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-function foo(x) {
-    // ...
-}
-
-var x = function named(x) {};
-
-// When ["error", "always"]
-function bar (x) {
-    // ...
-}
-```
diff --git a/eslint/docs/rules/space-after-keywords.md b/eslint/docs/rules/space-after-keywords.md
deleted file mode 100644 (file)
index 7f6182b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# space-after-keywords: enforce consistent spacing after keywords
-
-(removed) This rule was **removed** in ESLint v2.0 and replaced by the [keyword-spacing](keyword-spacing.md) rule.
-
-(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
-
-Some style guides will require or disallow spaces following the certain keywords.
-
-```js
-if (condition) {
-    doSomething();
-} else {
-    doSomethingElse();
-}
-
-if(condition) {
-    doSomething();
-}else{
-    doSomethingElse();
-}
-```
-
-## Rule Details
-
-This rule will enforce consistency of spacing after the keywords `if`, `else`, `for`, `while`, `do`, `switch`, `try`, `catch`, `finally`, and `with`.
-
-This rule takes one argument. If it is `"always"` then the keywords must be followed by at least one space. If `"never"`
-then there should be no spaces following. The default is `"always"`.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint space-after-keywords: "error"*/
-
-if(a) {}
-
-if (a) {} else{}
-
-do{} while (a);
-```
-
-```js
-/*eslint space-after-keywords: ["error", "never"]*/
-
-if (a) {}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint space-after-keywords: "error"*/
-
-if (a) {}
-
-if (a) {} else {}
-```
-
-```js
-/*eslint space-after-keywords: ["error", "never"]*/
-
-if(a) {}
-```
diff --git a/eslint/docs/rules/space-before-blocks.md b/eslint/docs/rules/space-before-blocks.md
deleted file mode 100644 (file)
index 35a4c16..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-# Require Or Disallow Space Before Blocks (space-before-blocks)
-
-Consistency is an important part of any style guide.
-While it is a personal preference where to put the opening brace of blocks,
-it should be consistent across a whole project.
-Having an inconsistent style distracts the reader from seeing the important parts of the code.
-
-## Rule Details
-
-This rule will enforce consistency of spacing before blocks. It is only applied on blocks that don’t begin on a new line.
-
-* This rule ignores spacing which is between `=>` and a block. The spacing is handled by the `arrow-spacing` rule.
-* This rule ignores spacing which is between a keyword and a block. The spacing is handled by the `keyword-spacing` rule.
-* This rule ignores spacing which is between `:` of a switch case and a block. The spacing is handled by the `switch-colon-spacing` rule.
-
-## Options
-
-This rule takes one argument. If it is `"always"` then blocks must always have at least one preceding space. If `"never"`
-then all blocks should never have any preceding space. If different spacing is desired for function
-blocks, keyword blocks and classes, an optional configuration object can be passed as the rule argument to
-configure the cases separately. If any value in the configuration object is `"off"`, then neither style will be enforced for blocks of that kind.
-
-( e.g. `{ "functions": "never", "keywords": "always", "classes": "always" }` )
-
-The default is `"always"`.
-
-### "always"
-
-Examples of **incorrect** code for this rule with the "always" option:
-
-```js
-/*eslint space-before-blocks: "error"*/
-
-if (a){
-    b();
-}
-
-function a(){}
-
-for (;;){
-    b();
-}
-
-try {} catch(a){}
-
-class Foo{
-  constructor(){}
-}
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint space-before-blocks: "error"*/
-
-if (a) {
-    b();
-}
-
-if (a) {
-    b();
-} else{ /*no error. this is checked by `keyword-spacing` rule.*/
-    c();
-}
-
-class C {
-    static{} /*no error. this is checked by `keyword-spacing` rule.*/
-}
-
-function a() {}
-
-for (;;) {
-    b();
-}
-
-try {} catch(a) {}
-```
-
-### "never"
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-blocks: ["error", "never"]*/
-
-if (a) {
-    b();
-}
-
-function a() {}
-
-for (;;) {
-    b();
-}
-
-try {} catch(a) {}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-blocks: ["error", "never"]*/
-
-if (a){
-    b();
-}
-
-function a(){}
-
-for (;;){
-    b();
-}
-
-try{} catch(a){}
-
-class Foo{
-  constructor(){}
-}
-```
-
-Examples of **incorrect** code for this rule when configured `{ "functions": "never", "keywords": "always", "classes": "never" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "always", "classes": "never" }]*/
-/*eslint-env es6*/
-
-function a() {}
-
-try {} catch(a){}
-
-class Foo{
-  constructor() {}
-}
-```
-
-Examples of **correct** code for this rule when configured `{ "functions": "never", "keywords": "always", "classes": "never" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "always", "classes": "never" }]*/
-/*eslint-env es6*/
-
-for (;;) {
-  // ...
-}
-
-describe(function(){
-  // ...
-});
-
-class Foo{
-  constructor(){}
-}
-```
-
-Examples of **incorrect** code for this rule when configured `{ "functions": "always", "keywords": "never", "classes": "never" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "always", "keywords": "never", "classes": "never" }]*/
-/*eslint-env es6*/
-
-function a(){}
-
-try {} catch(a) {}
-
-class Foo {
-  constructor(){}
-}
-```
-
-Examples of **correct** code for this rule when configured `{ "functions": "always", "keywords": "never", "classes": "never" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "always", "keywords": "never", "classes": "never" }]*/
-/*eslint-env es6*/
-
-if (a){
-  b();
-}
-
-var a = function() {}
-
-class Foo{
-  constructor() {}
-}
-```
-
-Examples of **incorrect** code for this rule when configured `{ "functions": "never", "keywords": "never", "classes": "always" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "never", "classes": "always" }]*/
-/*eslint-env es6*/
-
-class Foo{
-  constructor(){}
-}
-```
-
-Examples of **correct** code for this rule when configured `{ "functions": "never", "keywords": "never", "classes": "always" }`:
-
-```js
-/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "never", "classes": "always" }]*/
-/*eslint-env es6*/
-
-class Foo {
-  constructor(){}
-}
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing before blocks.
-
-## Related Rules
-
-* [keyword-spacing](keyword-spacing.md)
-* [arrow-spacing](arrow-spacing.md)
-* [switch-colon-spacing](switch-colon-spacing.md)
-* [brace-style](brace-style.md)
diff --git a/eslint/docs/rules/space-before-function-paren.md b/eslint/docs/rules/space-before-function-paren.md
deleted file mode 100644 (file)
index c9d0c39..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-# Require or disallow a space before function parenthesis (space-before-function-paren)
-
-When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example:
-
-```js
-function withoutSpace(x) {
-    // ...
-}
-
-function withSpace (x) {
-    // ...
-}
-
-var anonymousWithoutSpace = function() {};
-
-var anonymousWithSpace = function () {};
-```
-
-Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required.
-
-## Rule Details
-
-This rule aims to enforce consistent spacing before function parentheses and as such, will warn whenever whitespace doesn't match the preferences specified.
-
-## Options
-
-This rule has a string option or an object option:
-
-```js
-{
-    "space-before-function-paren": ["error", "always"],
-    // or
-    "space-before-function-paren": ["error", {
-        "anonymous": "always",
-        "named": "always",
-        "asyncArrow": "always"
-    }],
-}
-```
-
-* `always` (default) requires a space followed by the `(` of arguments.
-* `never` disallows any space followed by the `(` of arguments.
-
-The string option does not check async arrow function expressions for backward compatibility.
-
-You can also use a separate option for each type of function.
-Each of the following options can be set to `"always"`, `"never"`, or `"ignore"`. The default is `"always"`.
-
-* `anonymous` is for anonymous function expressions (e.g. `function () {}`).
-* `named` is for named function expressions (e.g. `function foo () {}`).
-* `asyncArrow` is for async arrow function expressions (e.g. `async () => {}`).
-
-### "always"
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint space-before-function-paren: "error"*/
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-var bar = function foo() {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-
-var foo = async() => 1
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint space-before-function-paren: "error"*/
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-var bar = function foo () {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-
-var foo = async () => 1
-```
-
-### "never"
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-function-paren: ["error", "never"]*/
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-var bar = function foo () {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-
-var foo = async () => 1
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-function-paren: ["error", "never"]*/
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-var bar = function foo() {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-
-var foo = async() => 1
-```
-
-### `{"anonymous": "always", "named": "never", "asyncArrow": "always"}`
-
-Examples of **incorrect** code for this rule with the `{"anonymous": "always", "named": "never", "asyncArrow": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}]*/
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-
-var foo = async(a) => await a
-```
-
-Examples of **correct** code for this rule with the `{"anonymous": "always", "named": "never", "asyncArrow": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}]*/
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-
-var foo = async (a) => await a
-```
-
-### `{"anonymous": "never", "named": "always"}`
-
-Examples of **incorrect** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", { "anonymous": "never", "named": "always" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", { "anonymous": "never", "named": "always" }]*/
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-### `{"anonymous": "ignore", "named": "always"}`
-
-Examples of **incorrect** code for this rule with the `{"anonymous": "ignore", "named": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", { "anonymous": "ignore", "named": "always" }]*/
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `{"anonymous": "ignore", "named": "always"}` option:
-
-```js
-/*eslint space-before-function-paren: ["error", { "anonymous": "ignore", "named": "always" }]*/
-/*eslint-env es6*/
-
-var bar = function() {
-    // ...
-};
-
-var bar = function () {
-    // ...
-};
-
-function foo () {
-    // ...
-}
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing before function parenthesis.
-
-## Related Rules
-
-* [space-after-keywords](space-after-keywords.md)
-* [space-return-throw-case](space-return-throw-case.md)
diff --git a/eslint/docs/rules/space-before-function-parentheses.md b/eslint/docs/rules/space-before-function-parentheses.md
deleted file mode 100644 (file)
index 3856c22..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-# space-before-function-parentheses: enforce consistent spacing before opening parenthesis in function definitions
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [space-before-function-paren](space-before-function-paren.md) rule. The name of the rule changed from "parentheses" to "paren" for consistency with the names of other rules.
-
-When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example:
-
-```js
-function withoutSpace(x) {
-    // ...
-}
-
-function withSpace (x) {
-    // ...
-}
-
-var anonymousWithoutSpace = function() {};
-
-var anonymousWithSpace = function () {};
-```
-
-Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required.
-
-## Rule Details
-
-This rule aims to enforce consistent spacing before function parentheses and as such, will warn whenever whitespace doesn't match the preferences specified.
-
-This rule takes one argument. If it is `"always"`, which is the default option, all named functions and anonymous functions must have space before function parentheses. If `"never"` then all named functions and anonymous functions must not have space before function parentheses. If you want different spacing for named and anonymous functions you can pass a configuration object as the rule argument to configure those separately (e. g. `{"anonymous": "always", "named": "never"}`).
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-var bar = function foo() {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-var bar = function foo () {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-var bar = function foo () {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-var bar = function foo() {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **incorrect** code for this rule with the `{"anonymous": "always", "named": "never"}` option:
-
-```js
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `{"anonymous": "always", "named": "never"}` option:
-
-```js
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **incorrect** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
-
-```js
-/*eslint-env es6*/
-
-function foo() {
-    // ...
-}
-
-var bar = function () {
-    // ...
-};
-
-class Foo {
-    constructor() {
-        // ...
-    }
-}
-
-var foo = {
-    bar() {
-        // ...
-    }
-};
-```
-
-Examples of **correct** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
-
-```js
-/*eslint-env es6*/
-
-function foo () {
-    // ...
-}
-
-var bar = function() {
-    // ...
-};
-
-class Foo {
-    constructor () {
-        // ...
-    }
-}
-
-var foo = {
-    bar () {
-        // ...
-    }
-};
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing before function parenthesis.
-
-## Related Rules
-
-* [space-after-keywords](space-after-keywords.md)
-* [space-return-throw-case](space-return-throw-case.md)
diff --git a/eslint/docs/rules/space-before-keywords.md b/eslint/docs/rules/space-before-keywords.md
deleted file mode 100644 (file)
index 077c9a3..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-# space-before-keywords: enforce consistent spacing before keywords
-
-(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing.md) rule.
-
-(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
-
-Keywords are syntax elements of JavaScript, such as `function` and `if`. These identifiers have special meaning to the language and so often appear in a different color in code editors. As an important part of the language, style guides often refer to the spacing that should be used around keywords. For example, you might have a style guide that says keywords should be always be preceded by spaces, which would mean `if-else` statements must look like this:
-
-```js
-if (foo) {
-    // ...
-} else {
-    // ...
-}
-```
-
-Of course, you could also have a style guide that disallows spaces before keywords.
-
-## Rule Details
-
-This rule will enforce consistency of spacing before the keywords `if`, `else`, `for`,
-`while`, `do`, `switch`, `throw`, `try`, `catch`, `finally`, `with`, `break`, `continue`,
-`return`, `function`, `yield`, `class` and variable declarations (`let`, `const`, `var`)
-and label statements.
-
-This rule takes one argument: `"always"` or `"never"`. If `"always"` then the keywords
-must be preceded by at least one space. If `"never"` then no spaces will be allowed before
-the keywords `else`, `while` (do...while), `finally` and `catch`. The default value is `"always"`.
-
-This rule will allow keywords to be preceded by an opening curly brace (`{`). If you wish to alter
-this behavior, consider using the [block-spacing](block-spacing.md) rule.
-
-Examples of **incorrect** code for this rule with the default `"always"` option:
-
-```js
-/*eslint space-before-keywords: ["error", "always"]*/
-/*eslint-env es6*/
-
-if (foo) {
-    // ...
-}else {}
-
-const foo = 'bar';let baz = 'qux';
-
-var foo =function bar () {}
-
-function bar() {
-    if (foo) {return; }
-}
-```
-
-Examples of **correct** code for this rule with the default `"always"` option:
-
-```js
-/*eslint space-before-keywords: ["error", "always"]*/
-/*eslint-env es6*/
-
-if (foo) {
-    // ...
-} else {}
-
-(function() {})()
-
-<Foo onClick={function bar() {}} />
-
-for (let foo of ['bar', 'baz', 'qux']) {}
-```
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-keywords: ["error", "never"]*/
-
-if (foo) {
-    // ...
-} else {}
-
-do {
-
-}
-while (foo)
-
-try {} finally {}
-
-try {} catch(e) {}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint space-before-keywords: ["error", "never"]*/
-
-if (foo) {
-    // ...
-}else {}
-
-do {}while (foo)
-
-try {}finally {}
-
-try{}catch(e) {}
-```
-
-## When Not To Use It
-
-If you do not wish to enforce consistency on keyword spacing.
-
-## Related Rules
-
-* [space-after-keywords](space-after-keywords.md)
-* [block-spacing](block-spacing.md)
-* [space-return-throw-case](space-return-throw-case.md)
-* [space-unary-ops](space-unary-ops.md)
-* [space-infix-ops](space-infix-ops.md)
diff --git a/eslint/docs/rules/space-in-brackets.md b/eslint/docs/rules/space-in-brackets.md
deleted file mode 100644 (file)
index 330609a..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-# space-in-brackets: enforce consistent spacing inside braces of object literals and brackets of array literals
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [object-curly-spacing](object-curly-spacing.md) and [array-bracket-spacing](array-bracket-spacing.md) rules.
-
-While formatting preferences are very personal, a number of style guides require or disallow spaces between brackets:
-
-```js
-var obj = { foo: 'bar' };
-var arr = [ 'foo', 'bar' ];
-foo[ 'bar' ];
-
-var obj = {foo: 'bar'};
-var arr = ['foo', 'bar'];
-foo['bar'];
-```
-
-## Rule Details
-
-This rule aims to maintain consistency around the spacing inside of square brackets, either by disallowing spaces inside of brackets between the brackets and other tokens or enforcing spaces. Brackets that are separated from the adjacent value by a new line are excepted from this rule, as this is a common pattern.  Object literals that are used as the first or last element in an array are also ignored.
-
-## Options
-
-There are two options for this rule:
-
-* `"always"` enforces a space inside of object and array literals
-* `"never"` enforces zero spaces inside of object and array literals (default)
-
-Depending on your coding conventions, you can choose either option by specifying it in your configuration:
-
-```json
-"space-in-brackets": ["error", "always"]
-```
-
-### "never"
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint-env es6*/
-
-foo[ 'bar' ];
-foo['bar' ];
-
-var arr = [ 'foo', 'bar' ];
-var arr = ['foo', 'bar' ];
-var arr = [ ['foo'], 'bar'];
-var arr = [[ 'foo' ], 'bar'];
-var arr = ['foo',
-  'bar'
-];
-
-var obj = { 'foo': 'bar' };
-var obj = {'foo': 'bar' };
-var obj = { baz: {'foo': 'qux'}, bar};
-var obj = {baz: { 'foo': 'qux' }, bar};
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-// When options are ["error", "never"]
-
-foo['bar'];
-foo[
-  'bar'
-];
-foo[
-  'bar'];
-
-var arr = [];
-var arr = ['foo', 'bar', 'baz'];
-var arr = [['foo'], 'bar', 'baz'];
-var arr = [
-  'foo',
-  'bar',
-  'baz'
-];
-
-var arr = [
-  'foo',
-  'bar'];
-
-var obj = {'foo': 'bar'};
-
-var obj = {'foo': {'bar': 'baz'}, 'qux': 'quxx'};
-
-var obj = {
-  'foo': 'bar'
-};
-var obj = {'foo': 'bar'
-};
-var obj = {
-  'foo':'bar'};
-
-var obj = {};
-```
-
-### "always"
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint-env es6*/
-
-foo['bar'];
-foo['bar' ];
-foo[ 'bar'];
-
-var arr = ['foo', 'bar'];
-var arr = ['foo', 'bar' ];
-var arr = [ ['foo'], 'bar' ];
-var arr = ['foo',
-  'bar'
-];
-
-var arr = [
-  'foo',
-  'bar'];
-
-var obj = {'foo': 'bar'};
-var obj = {'foo': 'bar' };
-var obj = { baz: {'foo': 'qux'}, bar};
-var obj = {baz: { 'foo': 'qux' }, bar};
-var obj = {'foo': 'bar'
-};
-
-var obj = {
-  'foo':'bar'};
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-foo[ 'bar' ];
-foo[
-  'bar'
-];
-
-var arr = [];
-var arr = [ 'foo', 'bar', 'baz' ];
-var arr = [ [ 'foo' ], 'bar', 'baz' ];
-
-var arr = [
-  'foo',
-  'bar',
-  'baz'
-];
-
-var obj = {};
-var obj = { 'foo': 'bar' };
-var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
-var obj = {
-  'foo': 'bar'
-};
-```
-
-Note that `"always"` has a special case where `{}` and `[]` are not considered problems.
-
-### Exceptions
-
-An object literal may be used as a third array item to specify spacing exceptions. These exceptions work in the context of the first option. That is, if `"always"` is set to enforce spacing and an exception is set to `false`, it will disallow spacing for cases matching the exception. Likewise, if `"never"` is set to disallow spacing and an exception is set to `true`, it will enforce spacing for cases matching the exception.
-
-You can add exceptions like so:
-
-In case of `"always"` option, set an exception to `false` to enable it:
-
-```json
-"space-in-brackets": ["error", "always", {
-  "singleValue": false,
-  "objectsInArrays": false,
-  "arraysInArrays": false,
-  "arraysInObjects": false,
-  "objectsInObjects": false,
-  "propertyName": false
-}]
-```
-
-In case of `"never"` option, set an exception to `true` to enable it:
-
-```json
-"space-in-brackets": ["error", "never", {
-  "singleValue": true,
-  "objectsInArrays": true,
-  "arraysInArrays": true,
-  "arraysInObjects": true,
-  "objectsInObjects": true,
-  "propertyName": true
-}]
-```
-
-The following exceptions are available:
-
-* `singleValue` sets the spacing of a single value inside of square brackets of an array.
-* `objectsInArrays` sets the spacings between the curly braces and square brackets of object literals that are the first or last element in an array.
-* `arraysInArrays` sets the spacing between the square brackets of array literals that are the first or last element in an array.
-* `arraysInObjects` sets the spacing between the square bracket and the curly brace of an array literal that is the last element in an object.
-* `objectsInObjects` sets the spacing between the curly brace of an object literal that is the last element in an object and the curly brace of the containing object.
-* `propertyName` sets the spacing in square brackets of computed member expressions.
-
-In each of the following examples, the `"always"` option is assumed.
-
-Examples of **incorrect** code for this rule when `"singleValue"` is set to `false`:
-
-```js
-var foo = [ 'foo' ];
-var foo = [ 'foo'];
-var foo = ['foo' ];
-var foo = [ 1 ];
-var foo = [ 1];
-var foo = [1 ];
-var foo = [ [ 1, 2 ] ];
-var foo = [ { 'foo': 'bar' } ];
-```
-
-Examples of **correct** code for this rule when `"singleValue"` is set to `false`:
-
-```js
-var foo = ['foo'];
-var foo = [1];
-var foo = [[ 1, 1 ]];
-var foo = [{ 'foo': 'bar' }];
-```
-
-Examples of **incorrect** code when `"objectsInArrays"` is set to `false`:
-
-```js
-var arr = [ { 'foo': 'bar' } ];
-var arr = [ {
-  'foo': 'bar'
-} ]
-```
-
-Examples of **correct** code when `"objectsInArrays"` is set to `false`:
-
-```js
-var arr = [{ 'foo': 'bar' }];
-var arr = [{
-  'foo': 'bar'
-}];
-```
-
-Examples of **incorrect** code when `"arraysInArrays"` is set to `false`:
-
-```js
-var arr = [ [ 1, 2 ], 2, 3, 4 ];
-var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];
-```
-
-Examples of **correct** code when `"arraysInArrays"` is set to `false`:
-
-```js
-var arr = [[ 1, 2 ], 2, 3, 4 ];
-var arr = [[ 1, 2 ], 2, [ 3, 4 ]];
-```
-
-Examples of **incorrect** code when `"arraysInObjects"` is set to `false`:
-
-```js
-var obj = { "foo": [ 1, 2 ] };
-var obj = { "foo": [ "baz", "bar" ] };
-```
-
-Examples of **correct** code when `"arraysInObjects"` is set to `false`:
-
-```js
-var obj = { "foo": [ 1, 2 ]};
-var obj = { "foo": [ "baz", "bar" ]};
-```
-
-Examples of **incorrect** code when `"objectsInObjects"` is set to `false`:
-
-```js
-var obj = { "foo": { "baz": 1, "bar": 2 } };
-var obj = { "foo": [ "baz", "bar" ], "qux": { "baz": 1, "bar": 2 } };
-```
-
-Examples of **correct** code when `"objectsInObjects"` is set to `false`:
-
-```js
-var obj = { "foo": { "baz": 1, "bar": 2 }};
-var obj = { "foo": [ "baz", "bar" ], "qux": { "baz": 1, "bar": 2 }};
-```
-
-Examples of **incorrect** code when `"propertyName"` is set to `false`:
-
-```js
-var foo = obj[ 1 ];
-var foo = obj[ bar ];
-```
-
-Examples of **correct** code when `"propertyName"` is set to `false`:
-
-```js
-var foo = obj[bar];
-var foo = obj[0, 1];
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing between brackets.
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [object-curly-spacing](object-curly-spacing.md)
-* [space-in-parens](space-in-parens.md)
-* [computed-property-spacing](computed-property-spacing.md)
diff --git a/eslint/docs/rules/space-in-parens.md b/eslint/docs/rules/space-in-parens.md
deleted file mode 100644 (file)
index 3397036..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-# Disallow or enforce spaces inside of parentheses (space-in-parens)
-
-Some style guides require or disallow spaces inside of parentheses:
-
-```js
-foo( 'bar' );
-var x = ( 1 + 2 ) * 3;
-
-foo('bar');
-var x = (1 + 2) * 3;
-```
-
-## Rule Details
-
-This rule will enforce consistent spacing directly inside of parentheses, by disallowing or requiring one or more spaces to the right of `(` and to the left of `)`.
-
-As long as you do not explicitly disallow empty parentheses using the `"empty"` exception , `()` will be allowed.
-
-## Options
-
-There are two options for this rule:
-
-* `"never"` (default) enforces zero spaces inside of parentheses
-* `"always"` enforces a space inside of parentheses
-
-Depending on your coding conventions, you can choose either option by specifying it in your configuration:
-
-```json
-"space-in-parens": ["error", "always"]
-```
-
-### "never"
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint space-in-parens: ["error", "never"]*/
-
-foo( );
-
-foo( 'bar');
-foo('bar' );
-foo( 'bar' );
-
-foo( /* bar */ );
-
-var foo = ( 1 + 2 ) * 3;
-( function () { return 'bar'; }() );
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint space-in-parens: ["error", "never"]*/
-
-foo();
-
-foo('bar');
-
-foo(/* bar */);
-
-var foo = (1 + 2) * 3;
-(function () { return 'bar'; }());
-```
-
-### "always"
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint space-in-parens: ["error", "always"]*/
-
-foo( 'bar');
-foo('bar' );
-foo('bar');
-
-foo(/* bar */);
-
-var foo = (1 + 2) * 3;
-(function () { return 'bar'; }());
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint space-in-parens: ["error", "always"]*/
-
-foo();
-foo( );
-
-foo( 'bar' );
-
-foo( /* bar */ );
-
-var foo = ( 1 + 2 ) * 3;
-( function () { return 'bar'; }() );
-```
-
-### Exceptions
-
-An object literal may be used as a third array item to specify exceptions, with the key `"exceptions"` and an array as the value. These exceptions work in the context of the first option. That is, if `"always"` is set to enforce spacing, then any "exception" will *disallow* spacing. Conversely, if `"never"` is set to disallow spacing, then any "exception" will *enforce* spacing.
-
-Note that this rule only enforces spacing within parentheses; it does not check spacing within curly or square brackets, but will enforce or disallow spacing of those brackets if and only if they are adjacent to an opening or closing parenthesis.
-
-The following exceptions are available: `["{}", "[]", "()", "empty"]`.
-
-### Empty Exception
-
-Empty parens exception and behavior:
-
-* `always` allows for both `()` and `( )`
-* `never` (default) requires `()`
-* `always` excepting `empty` requires `()`
-* `never` excepting `empty` requires `( )` (empty parens without a space is here forbidden)
-
-### Examples
-
-Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["{}"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["{}"] }]*/
-
-foo({bar: 'baz'});
-foo(1, {bar: 'baz'});
-```
-
-Examples of **correct** code for this rule with the `"never", { "exceptions": ["{}"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["{}"] }]*/
-
-foo( {bar: 'baz'} );
-foo(1, {bar: 'baz'} );
-```
-
-Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["{}"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}"] }]*/
-
-foo( {bar: 'baz'} );
-foo( 1, {bar: 'baz'} );
-```
-
-Examples of **correct** code for this rule with the `"always", { "exceptions": ["{}"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}"] }]*/
-
-foo({bar: 'baz'});
-foo( 1, {bar: 'baz'});
-```
-
-Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["[]"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["[]"] }]*/
-
-foo([bar, baz]);
-foo([bar, baz], 1);
-```
-
-Examples of **correct** code for this rule with the `"never", { "exceptions": ["[]"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["[]"] }]*/
-
-foo( [bar, baz] );
-foo( [bar, baz], 1);
-```
-
-Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["[]"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["[]"] }]*/
-
-foo( [bar, baz] );
-foo( [bar, baz], 1 );
-```
-
-Examples of **correct** code for this rule with the `"always", { "exceptions": ["[]"] }` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["[]"] }]*/
-
-foo([bar, baz]);
-foo([bar, baz], 1 );
-```
-
-Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["()"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["()"] }]*/
-
-foo((1 + 2));
-foo((1 + 2), 1);
-foo(bar());
-```
-
-Examples of **correct** code for this rule with the `"never", { "exceptions": ["()"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["()"] }]*/
-
-foo( (1 + 2) );
-foo( (1 + 2), 1);
-foo(bar() );
-```
-
-Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["()"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["()"] }]*/
-
-foo( ( 1 + 2 ) );
-foo( ( 1 + 2 ), 1 );
-```
-
-Examples of **correct** code for this rule with the `"always", { "exceptions": ["()"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["()"] }]*/
-
-foo(( 1 + 2 ));
-foo(( 1 + 2 ), 1 );
-```
-
-The `"empty"` exception concerns empty parentheses, and works the same way as the other exceptions, inverting the first option.
-
-Example of **incorrect** code for this rule with the `"never", { "exceptions": ["empty"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["empty"] }]*/
-
-foo();
-```
-
-Example of **correct** code for this rule with the `"never", { "exceptions": ["empty"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "never", { "exceptions": ["empty"] }]*/
-
-foo( );
-```
-
-Example of **incorrect** code for this rule with the `"always", { "exceptions": ["empty"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["empty"] }]*/
-
-foo( );
-```
-
-Example of **correct** code for this rule with the `"always", { "exceptions": ["empty"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["empty"] }]*/
-
-foo();
-```
-
-You can include multiple entries in the `"exceptions"` array.
-
-Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["{}", "[]"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}", "[]"] }]*/
-
-bar( {bar:'baz'} );
-baz( 1, [1,2] );
-foo( {bar: 'baz'}, [1, 2] );
-```
-
-Examples of **correct** code for this rule with the `"always", { "exceptions": ["{}", "[]"] }]` option:
-
-```js
-/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}", "[]"] }]*/
-
-bar({bar:'baz'});
-baz( 1, [1,2]);
-foo({bar: 'baz'}, [1, 2]);
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing between parentheses.
-
-## Related Rules
-
-* [array-bracket-spacing](array-bracket-spacing.md)
-* [object-curly-spacing](object-curly-spacing.md)
-* [computed-property-spacing](computed-property-spacing.md)
diff --git a/eslint/docs/rules/space-infix-ops.md b/eslint/docs/rules/space-infix-ops.md
deleted file mode 100644 (file)
index 6a00e50..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# require spacing around infix operators (space-infix-ops)
-
-While formatting preferences are very personal, a number of style guides require spaces around operators, such as:
-
-```js
-var sum = 1 + 2;
-```
-
-The proponents of these extra spaces believe it make the code easier to read and can more easily highlight potential errors, such as:
-
-```js
-var sum = i+++2;
-```
-
-While this is valid JavaScript syntax, it is hard to determine what the author intended.
-
-## Rule Details
-
-This rule is aimed at ensuring there are spaces around infix operators.
-
-## Options
-
-This rule accepts a single options argument with the following defaults:
-
-```json
-"space-infix-ops": ["error", { "int32Hint": false }]
-```
-
-### `int32Hint`
-
-Set the `int32Hint` option to `true` (default is `false`) to allow write `a|0` without space.
-
-```js
-var foo = bar|0; // `foo` is forced to be signed 32 bit integer
-```
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint space-infix-ops: "error"*/
-/*eslint-env es6*/
-
-a+b
-
-a+ b
-
-a +b
-
-a?b:c
-
-const a={b:1};
-
-var {a=0}=bar;
-
-function foo(a=0) { }
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint space-infix-ops: "error"*/
-/*eslint-env es6*/
-
-a + b
-
-a       + b
-
-a ? b : c
-
-const a = {b:1};
-
-var {a = 0} = bar;
-
-function foo(a = 0) { }
-```
-
-## When Not To Use It
-
-You can turn this rule off if you are not concerned with the consistency of spacing around infix operators.
diff --git a/eslint/docs/rules/space-return-throw-case.md b/eslint/docs/rules/space-return-throw-case.md
deleted file mode 100644 (file)
index ff55f7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# space-return-throw-case: require spaces after `return`, `throw`, and `case` keywords
-
-(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing.md) rule.
-
-(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
-
-Require spaces following `return`, `throw`, and `case`.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint space-return-throw-case: "error"*/
-
-throw{a:0}
-
-function f(){ return-a; }
-
-switch(a){ case'a': break; }
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint space-return-throw-case: "error"*/
-
-throw {a: 0};
-
-function f(){ return -a; }
-
-switch(a){ case 'a': break; }
-```
diff --git a/eslint/docs/rules/space-unary-ops.md b/eslint/docs/rules/space-unary-ops.md
deleted file mode 100644 (file)
index 676a921..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-# Require or disallow spaces before/after unary operators (space-unary-ops)
-
-Some style guides require or disallow spaces before or after unary operators. This is mainly a stylistic issue, however, some JavaScript expressions can be written without spacing which makes it harder to read and maintain.
-
-## Rule Details
-
-This rule enforces consistency regarding the spaces after `words` unary operators and after/before `nonwords` unary operators.
-
-For `words` operators, this rule only applies when a space is not syntactically required. For instance, `delete obj.foo` requires the space and will not be considered by this rule. The equivalent `delete(obj.foo)` has an optional space (`delete (obj.foo)`), therefore this rule will apply to it.
-
-Examples of unary `words` operators:
-
-```js
-// new
-var joe = new Person();
-
-// delete
-var obj = {
-    foo: 'bar'
-};
-delete obj.foo;
-
-// typeof
-typeof {} // object
-
-// void
-void 0 // undefined
-```
-
-Examples of unary `nonwords` operators:
-
-```js
-if ([1,2,3].indexOf(1) !== -1) {};
-foo = --foo;
-bar = bar++;
-baz = !foo;
-qux = !!baz;
-```
-
-## Options
-
-This rule has three options:
-
-* `words` - applies to unary word operators such as: `new`, `delete`, `typeof`, `void`, `yield`
-* `nonwords` - applies to unary operators such as: `-`, `+`, `--`, `++`, `!`, `!!`
-* `overrides` - specifies overwriting usage of spacing for each
-  operator, word or non word. This is empty by default, but can be used
-  to enforce or disallow spacing around operators. For example:
-
-```js
-    "space-unary-ops": [
-        2, {
-          "words": true,
-          "nonwords": false,
-          "overrides": {
-            "new": false,
-            "++": true
-          }
-    }]
-```
-
-In this case, spacing will be disallowed after a `new` operator and required before/after a `++` operator.
-
-Examples of **incorrect** code for this rule with the default `{"words": true, "nonwords": false}` option:
-
-```js
-/*eslint space-unary-ops: "error"*/
-
-typeof!foo;
-
-void{foo:0};
-
-new[foo][0];
-
-delete(foo.bar);
-
-++ foo;
-
-foo --;
-
-- foo;
-
-+ "3";
-```
-
-```js
-/*eslint space-unary-ops: "error"*/
-/*eslint-env es6*/
-
-function *foo() {
-    yield(0)
-}
-```
-
-```js
-/*eslint space-unary-ops: "error"*/
-
-async function foo() {
-    await(bar);
-}
-```
-
-Examples of **correct** code for this rule with the `{"words": true, "nonwords": false}` option:
-
-```js
-/*eslint space-unary-ops: "error"*/
-
-// Word unary operator "typeof" is followed by a whitespace.
-typeof !foo;
-
-// Word unary operator "void" is followed by a whitespace.
-void {foo:0};
-
-// Word unary operator "new" is followed by a whitespace.
-new [foo][0];
-
-// Word unary operator "delete" is followed by a whitespace.
-delete (foo.bar);
-
-// Unary operator "++" is not followed by whitespace.
-++foo;
-
-// Unary operator "--" is not preceded by whitespace.
-foo--;
-
-// Unary operator "-" is not followed by whitespace.
--foo;
-
-// Unary operator "+" is not followed by whitespace.
-+"3";
-```
-
-```js
-/*eslint space-unary-ops: "error"*/
-/*eslint-env es6*/
-
-function *foo() {
-    yield (0)
-}
-```
-
-```js
-/*eslint space-unary-ops: "error"*/
-
-async function foo() {
-    await (bar);
-}
-```
diff --git a/eslint/docs/rules/space-unary-word-ops.md b/eslint/docs/rules/space-unary-word-ops.md
deleted file mode 100644 (file)
index a155866..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# space-unary-word-ops: require spaces after unary word operators
-
-(removed) This rule was **removed** in ESLint v0.10.0 and **replaced** by the [space-unary-ops](space-unary-ops.md) rule.
-
-Require spaces following unary word operators.
-
-## Rule Details
-
-Examples of **incorrect** code for this rule:
-
-```js
-typeof!a
-```
-
-```js
-void{a:0}
-```
-
-```js
-new[a][0]
-```
-
-```js
-delete(a.b)
-```
-
-Examples of **correct** code for this rule:
-
-```js
-delete a.b
-```
-
-```js
-new C
-```
-
-```js
-void 0
-```
diff --git a/eslint/docs/rules/spaced-comment.md b/eslint/docs/rules/spaced-comment.md
deleted file mode 100644 (file)
index 66f8f70..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-# Requires or disallows a whitespace (space or tab) beginning a comment (spaced-comment)
-
-Some style guides require or disallow a whitespace immediately after the initial `//` or `/*` of a comment.
-Whitespace after the `//` or `/*` makes it easier to read text in comments.
-On the other hand, commenting out code is easier without having to put a whitespace right after the `//` or `/*`.
-
-## Rule Details
-
-This rule will enforce consistency of spacing after the start of a comment `//` or `/*`. It also provides several
-exceptions for various documentation styles.
-
-## Options
-
-The rule takes two options.
-
-* The first is a string which be either `"always"` or `"never"`. The default is `"always"`.
-
-    * If `"always"` then the `//` or `/*` must be followed by at least one whitespace.
-
-    * If `"never"` then there should be no whitespace following.
-
-* This rule can also take a 2nd option, an object with any of the following keys: `"exceptions"` and `"markers"`.
-
-    * The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule. The rule will not warn when the pattern starts from the beginning of the comment and repeats until the end of the line or `*/` if the comment is a single line comment.
-    Please note that exceptions are ignored if the first argument is `"never"`.
-
-    ```js
-    "spaced-comment": ["error", "always", { "exceptions": ["-", "+"] }]
-    ```
-
-    * The `"markers"` value is an array of string patterns which are considered markers for docblock-style comments,
-    such as an additional `/`, used to denote documentation read by doxygen, vsdoc, etc. which must have additional characters.
-    The `"markers"` array will apply regardless of the value of the first argument, e.g. `"always"` or `"never"`.
-
-    ```js
-    "spaced-comment": ["error", "always", { "markers": ["/"] }]
-    ```
-
-The difference between a marker and an exception is that a marker only appears at the beginning of the comment whereas
-exceptions can occur anywhere in the comment string.
-
-You can also define separate exceptions and markers for block and line comments. The `"block"` object can have an additional key `"balanced"`, a boolean that specifies if inline block comments should have balanced spacing. The default value is `false`.
-
-* If `"balanced": true` and `"always"` then the `/*` must be followed by at least one whitespace, and the `*/` must be preceded by at least one whitespace.
-
-* If `"balanced": true` and `"never"` then there should be no whitespace following `/*` or preceding `*/`.
-
-* If `"balanced": false` then balanced whitespace is not enforced.
-
-```json
-"spaced-comment": ["error", "always", {
-    "line": {
-        "markers": ["/"],
-        "exceptions": ["-", "+"]
-    },
-    "block": {
-        "markers": ["!"],
-        "exceptions": ["*"],
-        "balanced": true
-    }
-}]
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint spaced-comment: ["error", "always"]*/
-
-//This is a comment with no whitespace at the beginning
-
-/*This is a comment with no whitespace at the beginning */
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "block": { "balanced": true } }] */
-/* This is a comment with whitespace at the beginning but not the end*/
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/* eslint spaced-comment: ["error", "always"] */
-
-// This is a comment with a whitespace at the beginning
-
-/* This is a comment with a whitespace at the beginning */
-
-/*
- * This is a comment with a whitespace at the beginning
- */
-
-/*
-This comment has a newline
-*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always"] */
-
-/**
-* I am jsdoc
-*/
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint spaced-comment: ["error", "never"]*/
-
-// This is a comment with a whitespace at the beginning
-
-/* This is a comment with a whitespace at the beginning */
-
-/* \nThis is a comment with a whitespace at the beginning */
-```
-
-```js
-/*eslint spaced-comment: ["error", "never", { "block": { "balanced": true } }]*/
-/*This is a comment with whitespace at the end */
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint spaced-comment: ["error", "never"]*/
-
-/*This is a comment with no whitespace at the beginning */
-```
-
-```js
-/*eslint spaced-comment: ["error", "never"]*/
-
-/**
-* I am jsdoc
-*/
-```
-
-### exceptions
-
-Examples of **incorrect** code for this rule with the `"always"` option combined with `"exceptions"`:
-
-```js
-/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-"] } }] */
-
-//--------------
-// Comment block
-//--------------
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */
-
-//------++++++++
-// Comment block
-//------++++++++
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */
-
-/*------++++++++*/
-/* Comment block */
-/*------++++++++*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-+"] } }] */
-
-/*-+-+-+-+-+-+-+*/
-// Comment block
-/*-+-+-+-+-+-+-+*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */
-
-/******** COMMENT *******/
-```
-
-Examples of **correct** code for this rule with the `"always"` option combined with `"exceptions"`:
-
-```js
-/* eslint spaced-comment: ["error", "always", { "exceptions": ["-"] }] */
-
-//--------------
-// Comment block
-//--------------
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-"] } }] */
-
-//--------------
-// Comment block
-//--------------
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "exceptions": ["*"] }] */
-
-/****************
- * Comment block
- ****************/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "exceptions": ["-+"] }] */
-
-//-+-+-+-+-+-+-+
-// Comment block
-//-+-+-+-+-+-+-+
-
-/*-+-+-+-+-+-+-+*/
-// Comment block
-/*-+-+-+-+-+-+-+*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-+"] } }] */
-
-/*-+-+-+-+-+-+-+*/
-// Comment block
-/*-+-+-+-+-+-+-+*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */
-
-/***************/
-
-/********
-COMMENT
-*******/
-```
-
-### markers
-
-Examples of **incorrect** code for this rule with the `"always"` option combined with `"markers"`:
-
-```js
-/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */
-
-///This is a comment with a marker but without whitespace
-```
-
-```js
-/*eslint spaced-comment: ["error", "always", { "block": { "markers": ["!"], "balanced": true } }]*/
-/*! This is a comment with a marker but without whitespace at the end*/
-```
-
-```js
-/*eslint spaced-comment: ["error", "never", { "block": { "markers": ["!"], "balanced": true } }]*/
-/*!This is a comment with a marker but with whitespace at the end */
-```
-
-Examples of **correct** code for this rule with the `"always"` option combined with `"markers"`:
-
-```js
-/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */
-
-/// This is a comment with a marker
-```
-
-```js
-/*eslint spaced-comment: ["error", "never", { "markers": ["!<"] }]*/
-
-//!<This is a line comment with a marker
-
-/*!<this is a block comment with a marker
-subsequent lines are ignored
-*/
-```
-
-```js
-/* eslint spaced-comment: ["error", "always", { "markers": ["global"] }] */
-
-/*global ABC*/
-```
-
-## Related Rules
-
-* [spaced-line-comment](spaced-line-comment.md)
diff --git a/eslint/docs/rules/spaced-line-comment.md b/eslint/docs/rules/spaced-line-comment.md
deleted file mode 100644 (file)
index aaaa27a..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# spaced-line-comment: enforce consistent spacing after `//` in line comments
-
-(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [spaced-comment](spaced-comment.md) rule.
-
-Some style guides require or disallow a whitespace immediately after the initial `//` of a line comment.
-Whitespace after the `//` makes it easier to read text in comments.
-On the other hand, commenting out code is easier without having to put a whitespace right after the `//`.
-
-## Rule Details
-
-This rule will enforce consistency of spacing after the start of a line comment `//`.
-
-This rule takes two arguments. If the first is `"always"` then the `//` must be followed by at least once whitespace.
-If `"never"` then there should be no whitespace following.
-The default is `"always"`.
-
-The second argument is an object with one key, `"exceptions"`.
-The value is an array of string patterns which are considered exceptions to the rule.
-It is important to note that the exceptions are ignored if the first argument is `"never"`.
-Exceptions cannot be mixed.
-
-Examples of **incorrect** code for this rule:
-
-```js
-// When ["never"]
-// This is a comment with a whitespace at the beginning
-```
-
-```js
-//When ["always"]
-//This is a comment with no whitespace at the beginning
-var foo = 5;
-```
-
-```js
-// When ["always",{"exceptions":["-","+"]}]
-//------++++++++
-// Comment block
-//------++++++++
-```
-
-Examples of **correct** code for this rule:
-
-```js
-// When ["always"]
-// This is a comment with a whitespace at the beginning
-var foo = 5;
-```
-
-```js
-//When ["never"]
-//This is a comment with no whitespace at the beginning
-var foo = 5;
-```
-
-```js
-// When ["always",{"exceptions":["-"]}]
-//--------------
-// Comment block
-//--------------
-```
-
-```js
-// When ["always",{"exceptions":["-+"]}]
-//-+-+-+-+-+-+-+
-// Comment block
-//-+-+-+-+-+-+-+
-```
-
-## Related Rules
-
-* [spaced-comment](spaced-comment.md)
diff --git a/eslint/docs/rules/strict.md b/eslint/docs/rules/strict.md
deleted file mode 100644 (file)
index 97285af..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-# require or disallow strict mode directives (strict)
-
-A strict mode directive is a `"use strict"` literal at the beginning of a script or function body. It enables strict mode semantics.
-
-When a directive occurs in global scope, strict mode applies to the entire script:
-
-```js
-"use strict";
-
-// strict mode
-
-function foo() {
-    // strict mode
-}
-```
-
-When a directive occurs at the beginning of a function body, strict mode applies only to that function, including all contained functions:
-
-```js
-function foo() {
-    "use strict";
-    // strict mode
-}
-
-function foo2() {
-    // not strict mode
-};
-
-(function() {
-    "use strict";
-    function bar() {
-        // strict mode
-    }
-}());
-```
-
-In the **CommonJS** module system, a hidden function wraps each module and limits the scope of a "global" strict mode directive.
-
-In **ECMAScript** modules, which always have strict mode semantics, the directives are unnecessary.
-
-## Rule Details
-
-This rule requires or disallows strict mode directives.
-
-This rule disallows strict mode directives, no matter which option is specified, if ESLint configuration specifies either of the following as [parser options](/docs/user-guide/configuring/language-options.md#specifying-parser-options):
-
-* `"sourceType": "module"` that is, files are **ECMAScript** modules
-* `"impliedStrict": true` property in the `ecmaFeatures` object
-
-This rule disallows strict mode directives, no matter which option is specified, in functions with non-simple parameter lists (for example, parameter lists with default parameter values) because that is a syntax error in **ECMAScript 2016** and later. See the examples of the [function](#function) option.
-
-This rule does not apply to class static blocks, no matter which option is specified, because class static blocks do not have directives. Therefore, a `"use strict"` statement in a class static block is not a directive, and will be reported by the [no-unused-expressions](no-unused-expressions.md) rule.
-
-The `--fix` option on the command line does not insert new `"use strict"` statements, but only removes unneeded statements.
-
-## Options
-
-This rule has a string option:
-
-* `"safe"` (default) corresponds either of the following options:
-    * `"global"` if ESLint considers a file to be a **CommonJS** module
-    * `"function"` otherwise
-* `"global"` requires one strict mode directive in the global scope (and disallows any other strict mode directives)
-* `"function"` requires one strict mode directive in each top-level function declaration or expression (and disallows any other strict mode directives)
-* `"never"` disallows strict mode directives
-
-### safe
-
-The `"safe"` option corresponds to the `"global"` option if ESLint considers a file to be a **Node.js** or **CommonJS** module because the configuration specifies either of the following:
-
-* `node` or `commonjs` [environments](/docs/user-guide/configuring/language-options.md#specifying-environments)
-* `"globalReturn": true` property in the `ecmaFeatures` object of [parser options](/docs/user-guide/configuring/language-options.md#specifying-parser-options)
-
-Otherwise the `"safe"` option corresponds to the `"function"` option. Note that if `"globalReturn": false` is explicitly specified in the configuration, the `"safe"` option will correspond to the `"function"` option regardless of the specified environment.
-
-### global
-
-Examples of **incorrect** code for this rule with the `"global"` option:
-
-```js
-/*eslint strict: ["error", "global"]*/
-
-function foo() {
-}
-```
-
-```js
-/*eslint strict: ["error", "global"]*/
-
-function foo() {
-    "use strict";
-}
-```
-
-```js
-/*eslint strict: ["error", "global"]*/
-
-"use strict";
-
-function foo() {
-    "use strict";
-}
-```
-
-Examples of **correct** code for this rule with the `"global"` option:
-
-```js
-/*eslint strict: ["error", "global"]*/
-
-"use strict";
-
-function foo() {
-}
-```
-
-### function
-
-This option ensures that all function bodies are strict mode code, while global code is not. Particularly if a build step concatenates multiple scripts, a strict mode directive in global code of one script could unintentionally enable strict mode in another script that was not intended to be strict code.
-
-Examples of **incorrect** code for this rule with the `"function"` option:
-
-```js
-/*eslint strict: ["error", "function"]*/
-
-"use strict";
-
-function foo() {
-}
-```
-
-```js
-/*eslint strict: ["error", "function"]*/
-
-function foo() {
-}
-
-(function() {
-    function bar() {
-        "use strict";
-    }
-}());
-```
-
-```js
-/*eslint strict: ["error", "function"]*/
-/*eslint-env es6*/
-
-// Illegal "use strict" directive in function with non-simple parameter list.
-// This is a syntax error since ES2016.
-function foo(a = 1) {
-    "use strict";
-}
-
-// We cannot write "use strict" directive in this function.
-// So we have to wrap this function with a function with "use strict" directive.
-function foo(a = 1) {
-}
-```
-
-Examples of **correct** code for this rule with the `"function"` option:
-
-```js
-/*eslint strict: ["error", "function"]*/
-
-function foo() {
-    "use strict";
-}
-
-(function() {
-    "use strict";
-
-    function bar() {
-    }
-
-    function baz(a = 1) {
-    }
-}());
-
-var foo = (function() {
-    "use strict";
-
-    return function foo(a = 1) {
-    };
-}());
-```
-
-### never
-
-Examples of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint strict: ["error", "never"]*/
-
-"use strict";
-
-function foo() {
-}
-```
-
-```js
-/*eslint strict: ["error", "never"]*/
-
-function foo() {
-    "use strict";
-}
-```
-
-Examples of **correct** code for this rule with the `"never"` option:
-
-```js
-/*eslint strict: ["error", "never"]*/
-
-function foo() {
-}
-```
-
-### earlier default (removed)
-
-(removed) The default option (that is, no string option specified) for this rule was **removed** in ESLint v1.0. The `"function"` option is most similar to the removed option.
-
-This option ensures that all functions are executed in strict mode. A strict mode directive must be present in global code or in every top-level function declaration or expression. It does not concern itself with unnecessary strict mode directives in nested functions that are already strict, nor with multiple strict mode directives at the same level.
-
-Examples of **incorrect** code for this rule with the earlier default option which has been removed:
-
-```js
-// "strict": "error"
-
-function foo() {
-}
-```
-
-```js
-// "strict": "error"
-
-(function() {
-    function bar() {
-        "use strict";
-    }
-}());
-```
-
-Examples of **correct** code for this rule with the earlier default option which has been removed:
-
-```js
-// "strict": "error"
-
-"use strict";
-
-function foo() {
-}
-```
-
-```js
-// "strict": "error"
-
-function foo() {
-    "use strict";
-}
-```
-
-```js
-// "strict": "error"
-
-(function() {
-    "use strict";
-    function bar() {
-        "use strict";
-    }
-}());
-```
-
-## When Not To Use It
-
-In a codebase that has both strict and non-strict code, either turn this rule off, or [selectively disable it](/docs/user-guide/configuring/rules.md#disabling-rules) where necessary. For example, functions referencing `arguments.callee` are invalid in strict mode. A [full list of strict mode differences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode#Differences_from_non-strict_to_strict) is available on MDN.
diff --git a/eslint/docs/rules/switch-colon-spacing.md b/eslint/docs/rules/switch-colon-spacing.md
deleted file mode 100644 (file)
index b9872c2..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# Enforce spacing around colons of switch statements (switch-colon-spacing)
-
-Spacing around colons improves readability of `case`/`default` clauses.
-
-## Rule Details
-
-This rule controls spacing around colons of `case` and `default` clauses in `switch` statements.
-This rule does the check only if the consecutive tokens exist on the same line.
-
-This rule has 2 options that are boolean value.
-
-```json
-{
-    "switch-colon-spacing": ["error", {"after": true, "before": false}]
-}
-```
-
-- `"after": true` (Default) requires one or more spaces after colons.
-- `"after": false` disallows spaces after colons.
-- `"before": true` requires one or more spaces before colons.
-- `"before": false` (Default) disallows before colons.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint switch-colon-spacing: "error"*/
-
-switch (a) {
-    case 0 :break;
-    default :foo();
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint switch-colon-spacing: "error"*/
-
-switch (a) {
-    case 0: foo(); break;
-    case 1:
-        bar();
-        break;
-    default:
-        baz();
-        break;
-}
-```
-
-Examples of **incorrect** code for this rule with `{"after": false, "before": true}` option:
-
-```js
-/*eslint switch-colon-spacing: ["error", {"after": false, "before": true}]*/
-
-switch (a) {
-    case 0: break;
-    default: foo();
-}
-```
-
-Examples of **correct** code for this rule with `{"after": false, "before": true}` option:
-
-```js
-/*eslint switch-colon-spacing: ["error", {"after": false, "before": true}]*/
-
-switch (a) {
-    case 0 :foo(); break;
-    case 1 :
-        bar();
-        break;
-    default :
-        baz();
-        break;
-}
-```
-
-## When Not To Use It
-
-If you don't want to notify spacing around colons of switch statements, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/symbol-description.md b/eslint/docs/rules/symbol-description.md
deleted file mode 100644 (file)
index 7743867..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# require symbol description (symbol-description)
-
-The `Symbol` function may have an optional description:
-
-```js
-var foo = Symbol("some description");
-
-var someString = "some description";
-var bar = Symbol(someString);
-```
-
-Using `description` promotes easier debugging: when a symbol is logged the description is used:
-
-```js
-var foo = Symbol("some description");
-
-> console.log(foo);
-// Symbol(some description)
-```
-
-It may facilitate identifying symbols when one is observed during debugging.
-
-## Rule Details
-
-This rules requires a description when creating symbols.
-
-## Examples
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint symbol-description: "error"*/
-/*eslint-env es6*/
-
-var foo = Symbol();
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint symbol-description: "error"*/
-/*eslint-env es6*/
-
-var foo = Symbol("some description");
-
-var someString = "some description";
-var bar = Symbol(someString);
-```
-
-## When Not To Use It
-
-This rule should not be used in ES3/5 environments.
-In addition, this rule can be safely turned off if you don't want to enforce presence of `description` when creating Symbols.
-
-## Further Reading
-
-* [Symbol Objects specification: Symbol description](https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description)
diff --git a/eslint/docs/rules/template-curly-spacing.md b/eslint/docs/rules/template-curly-spacing.md
deleted file mode 100644 (file)
index f7e0714..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-# Enforce Usage of Spacing in Template Strings (template-curly-spacing)
-
-We can embed expressions in template strings with using a pair of `${` and `}`.
-
-This rule can force usage of spacing _within_ the curly brace pair according to style guides.
-
-```js
-let hello = `hello, ${people.name}!`;
-```
-
-## Rule Details
-
-This rule aims to maintain consistency around the spacing inside of template literals.
-
-## Options
-
-```json
-{
-    "template-curly-spacing": ["error", "never"]
-}
-```
-
-This rule has one option which has either `"never"` or `"always"` as value.
-
-* `"never"` (by default) - Disallows spaces inside of the curly brace pair.
-* `"always"` - Requires one or more spaces inside of the curly brace pair.
-
-## Examples
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint template-curly-spacing: "error"*/
-
-`hello, ${ people.name}!`;
-`hello, ${people.name }!`;
-
-`hello, ${ people.name }!`;
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint template-curly-spacing: "error"*/
-
-`hello, ${people.name}!`;
-
-`hello, ${
-    people.name
-}!`;
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint template-curly-spacing: ["error", "always"]*/
-
-`hello, ${ people.name}!`;
-`hello, ${people.name }!`;
-
-`hello, ${people.name}!`;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint template-curly-spacing: ["error", "always"]*/
-
-`hello, ${ people.name }!`;
-
-`hello, ${
-    people.name
-}!`;
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of spacing inside of template strings, then it's safe to disable this rule.
diff --git a/eslint/docs/rules/template-tag-spacing.md b/eslint/docs/rules/template-tag-spacing.md
deleted file mode 100644 (file)
index 58cd166..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-# Require or disallow spacing between template tags and their literals (template-tag-spacing)
-
-With ES6, it's possible to create functions called [tagged template literals](#further-reading) where the function parameters consist of a template literal's strings and expressions.
-
-When using tagged template literals, it's possible to insert whitespace between the tag function and the template literal. Since this whitespace is optional, the following lines are equivalent:
-
-```js
-let hello = func`Hello world`;
-let hello = func `Hello world`;
-```
-
-## Rule Details
-
-This rule aims to maintain consistency around the spacing between template tag functions and their template literals.
-
-## Options
-
-```json
-{
-    "template-tag-spacing": ["error", "never"]
-}
-```
-
-This rule has one option whose value can be set to `"never"` or `"always"`
-
-* `"never"` (default) - Disallows spaces between a tag function and its template literal.
-* `"always"` - Requires one or more spaces between a tag function and its template literal.
-
-## Examples
-
-### never
-
-Examples of **incorrect** code for this rule with the default `"never"` option:
-
-```js
-/*eslint template-tag-spacing: "error"*/
-
-func `Hello world`;
-```
-
-Examples of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint template-tag-spacing: "error"*/
-
-func`Hello world`;
-```
-
-### always
-
-Examples of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint template-tag-spacing: ["error", "always"]*/
-
-func`Hello world`;
-```
-
-Examples of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint template-tag-spacing: ["error", "always"]*/
-
-func `Hello world`;
-```
-
-## When Not To Use It
-
-If you don't want to be notified about usage of spacing between tag functions and their template literals, then it's safe to disable this rule.
-
-## Further Reading
-
-If you want to learn more about tagged template literals, check out the links below:
-
-* [Template literals (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals)
-* [Examples of using tagged template literals (Exploring ES6)](http://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals)
diff --git a/eslint/docs/rules/unicode-bom.md b/eslint/docs/rules/unicode-bom.md
deleted file mode 100644 (file)
index bb99252..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# Require or disallow the Unicode Byte Order Mark (BOM) (unicode-bom)
-
-The Unicode Byte Order Mark (BOM) is used to specify whether code units are big
-endian or little endian. That is, whether the most significant or least
-significant bytes come first. UTF-8 does not require a BOM because byte ordering
-does not matter when characters are a single byte. Since UTF-8 is the dominant
-encoding of the web, we make `"never"` the default option.
-
-## Rule Details
-
-If the `"always"` option is used, this rule requires that files always begin
-with the Unicode BOM character U+FEFF. If `"never"` is used, files must never
-begin with U+FEFF.
-
-## Options
-
-This rule has a string option:
-
-* `"always"` files must begin with the Unicode BOM
-* `"never"` (default) files must not begin with the Unicode BOM
-
-### always
-
-Example of **correct** code for this rule with the `"always"` option:
-
-```js
-/*eslint unicode-bom: ["error", "always"]*/
-
-U+FEFF
-var abc;
-```
-
-Example of **incorrect** code for this rule with the `"always"` option:
-
-```js
-/*eslint unicode-bom: ["error", "always"]*/
-
-var abc;
-```
-
-### never
-
-Example of **correct** code for this rule with the default `"never"` option:
-
-```js
-/*eslint unicode-bom: ["error", "never"]*/
-
-var abc;
-```
-
-Example of **incorrect** code for this rule with the `"never"` option:
-
-```js
-/*eslint unicode-bom: ["error", "never"]*/
-
-U+FEFF
-var abc;
-```
-
-## When Not To Use It
-
-If you use some UTF-16 or UTF-32 files and you want to allow a file to
-optionally begin with a Unicode BOM, you should turn this rule off.
diff --git a/eslint/docs/rules/use-isnan.md b/eslint/docs/rules/use-isnan.md
deleted file mode 100644 (file)
index 67c83c9..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-# require calls to `isNaN()` when checking for `NaN` (use-isnan)
-
-In JavaScript, `NaN` is a special value of the `Number` type. It's used to represent any of the "not-a-number" values represented by the double-precision 64-bit format as specified by the IEEE Standard for Binary Floating-Point Arithmetic.
-
-Because `NaN` is unique in JavaScript by not being equal to anything, including itself, the results of comparisons to `NaN` are confusing:
-
-* `NaN === NaN` or `NaN == NaN` evaluate to false
-* `NaN !== NaN` or `NaN != NaN` evaluate to true
-
-Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is `NaN`.
-
-## Rule Details
-
-This rule disallows comparisons to 'NaN'.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint use-isnan: "error"*/
-
-if (foo == NaN) {
-    // ...
-}
-
-if (foo != NaN) {
-    // ...
-}
-
-if (foo == Number.NaN) {
-    // ...
-}
-
-if (foo != Number.NaN) {
-    // ...
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint use-isnan: "error"*/
-
-if (isNaN(foo)) {
-    // ...
-}
-
-if (!isNaN(foo)) {
-    // ...
-}
-```
-
-## Options
-
-This rule has an object option, with two options:
-
-* `"enforceForSwitchCase": true` (default) additionally disallows `case NaN` and `switch(NaN)` in `switch` statements.
-* `"enforceForIndexOf": true` additionally disallows the use of `indexOf` and `lastIndexOf` methods with `NaN`. Default is `false`, meaning that this rule by default does not warn about `indexOf(NaN)` or `lastIndexOf(NaN)` method calls.
-
-### enforceForSwitchCase
-
-The `switch` statement internally uses the `===` comparison to match the expression's value to a case clause.
-Therefore, it can never match `case NaN`. Also, `switch(NaN)` can never match a case clause.
-
-Examples of **incorrect** code for this rule with `"enforceForSwitchCase"` option set to `true` (default):
-
-```js
-/*eslint use-isnan: ["error", {"enforceForSwitchCase": true}]*/
-
-switch (foo) {
-    case NaN:
-        bar();
-        break;
-    case 1:
-        baz();
-        break;
-    // ...
-}
-
-switch (NaN) {
-    case a:
-        bar();
-        break;
-    case b:
-        baz();
-        break;
-    // ...
-}
-
-switch (foo) {
-    case Number.NaN:
-        bar();
-        break;
-    case 1:
-        baz();
-        break;
-    // ...
-}
-
-switch (Number.NaN) {
-    case a:
-        bar();
-        break;
-    case b:
-        baz();
-        break;
-    // ...
-}
-```
-
-Examples of **correct** code for this rule with `"enforceForSwitchCase"` option set to `true` (default):
-
-```js
-/*eslint use-isnan: ["error", {"enforceForSwitchCase": true}]*/
-
-if (Number.isNaN(foo)) {
-    bar();
-} else {
-    switch (foo) {
-        case 1:
-            baz();
-            break;
-        // ...
-    }
-}
-
-if (Number.isNaN(a)) {
-    bar();
-} else if (Number.isNaN(b)) {
-    baz();
-} // ...
-```
-
-Examples of **correct** code for this rule with `"enforceForSwitchCase"` option set to `false`:
-
-```js
-/*eslint use-isnan: ["error", {"enforceForSwitchCase": false}]*/
-
-switch (foo) {
-    case NaN:
-        bar();
-        break;
-    case 1:
-        baz();
-        break;
-    // ...
-}
-
-switch (NaN) {
-    case a:
-        bar();
-        break;
-    case b:
-        baz();
-        break;
-    // ...
-}
-
-switch (foo) {
-    case Number.NaN:
-        bar();
-        break;
-    case 1:
-        baz();
-        break;
-    // ...
-}
-
-switch (Number.NaN) {
-    case a:
-        bar();
-        break;
-    case b:
-        baz();
-        break;
-    // ...
-}
-```
-
-### enforceForIndexOf
-
-The following methods internally use the `===` comparison to match the given value with an array element:
-
-* [`Array.prototype.indexOf`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.indexof)
-* [`Array.prototype.lastIndexOf`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.lastindexof)
-
-Therefore, for any array `foo`, `foo.indexOf(NaN)` and `foo.lastIndexOf(NaN)` will always return `-1`.
-
-Set `"enforceForIndexOf"` to `true` if you want this rule to report `indexOf(NaN)` and `lastIndexOf(NaN)` method calls.
-
-Examples of **incorrect** code for this rule with `"enforceForIndexOf"` option set to `true`:
-
-```js
-/*eslint use-isnan: ["error", {"enforceForIndexOf": true}]*/
-
-var hasNaN = myArray.indexOf(NaN) >= 0;
-
-var firstIndex = myArray.indexOf(NaN);
-
-var lastIndex = myArray.lastIndexOf(NaN);
-```
-
-Examples of **correct** code for this rule with `"enforceForIndexOf"` option set to `true`:
-
-```js
-/*eslint use-isnan: ["error", {"enforceForIndexOf": true}]*/
-
-function myIsNaN(val) {
-    return typeof val === "number" && isNaN(val);
-}
-
-function indexOfNaN(arr) {
-    for (var i = 0; i < arr.length; i++) {
-        if (myIsNaN(arr[i])) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-function lastIndexOfNaN(arr) {
-    for (var i = arr.length - 1; i >= 0; i--) {
-        if (myIsNaN(arr[i])) {
-            return i;
-        }
-    }
-    return -1;
-}
-
-var hasNaN = myArray.some(myIsNaN);
-
-var hasNaN = indexOfNaN(myArray) >= 0;
-
-var firstIndex = indexOfNaN(myArray);
-
-var lastIndex = lastIndexOfNaN(myArray);
-
-// ES2015
-var hasNaN = myArray.some(Number.isNaN);
-
-// ES2015
-var firstIndex = myArray.findIndex(Number.isNaN);
-
-// ES2016
-var hasNaN = myArray.includes(NaN);
-```
-
-#### Known Limitations
-
-This option checks methods with the given names, *even if* the object which has the method is *not* an array.
diff --git a/eslint/docs/rules/valid-jsdoc.md b/eslint/docs/rules/valid-jsdoc.md
deleted file mode 100644 (file)
index 2d50382..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-# enforce valid JSDoc comments (valid-jsdoc)
-
-This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
-
-[JSDoc](http://usejsdoc.org) generates application programming interface (API) documentation from specially-formatted comments in JavaScript code. For example, this is a JSDoc comment for a function:
-
-```js
-/**
- * Add two numbers.
- * @param {number} num1 The first number.
- * @param {number} num2 The second number.
- * @returns {number} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-```
-
-If comments are invalid because of typing mistakes, then documentation will be incomplete.
-
-If comments are inconsistent because they are not updated when function definitions are modified, then readers might become confused.
-
-## Rule Details
-
-This rule enforces valid and consistent JSDoc comments. It reports any of the following problems:
-
-* missing parameter tag: `@arg`, `@argument`, or `@param`
-* inconsistent order of parameter names in a comment compared to the function or method
-* missing return tag: `@return` or `@returns`
-* missing parameter or return type
-* missing parameter or return description
-* syntax error
-
-This rule does not report missing JSDoc comments for classes, functions, or methods.
-
-**Note:** This rule does not support all of the Google Closure documentation tool's use cases. As such, some code such as `(/**number*/ n => n * 2);` will be flagged as missing appropriate function JSDoc comments even though `/**number*/` is intended to be a type hint and not a documentation block for the function. We don't recommend using this rule if you use type hints in this way.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint valid-jsdoc: "error"*/
-
-// expected @param tag for parameter num1 but found num instead
-// missing @param tag for parameter num2
-// missing return type
-/**
- * Add two numbers.
- * @param {number} num The first number.
- * @returns The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-
-// missing brace
-// missing @returns tag
-/**
- * @param {string name Whom to greet.
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-
-// missing parameter type for num1
-// missing parameter description for num2
-/**
- * Represents a sum.
- * @constructor
- * @param num1 The first number.
- * @param {number} num2
- */
-function sum(num1, num2) {
-    this.num1 = num1;
-    this.num2 = num2;
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint valid-jsdoc: "error"*/
-/*eslint-env es6*/
-
-/**
- * Add two numbers.
- * @param {number} num1 The first number.
- * @param {number} num2 The second number.
- * @returns {number} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-
-// default options allow missing function description
-// return type `void` means the function has no `return` statement
-/**
- * @param {string} name Whom to greet.
- * @returns {void}
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-
-// @constructor tag allows missing @returns tag
-/**
- * Represents a sum.
- * @constructor
- * @param {number} num1 The first number.
- * @param {number} num2 The second number.
- */
-function sum(num1, num2) {
-    this.num1 = num1;
-    this.num2 = num2;
-}
-
-// class constructor allows missing @returns tag
-/**
- * Represents a sum.
- */
-class Sum {
-    /**
-     * @param {number} num1 The first number.
-     * @param {number} num2 The second number.
-     */
-    constructor(num1, num2) {
-        this.num1 = num1;
-        this.num2 = num2;
-    }
-}
-
-// @abstract tag allows @returns tag without `return` statement
-class Widget {
-    /**
-    * When the state changes, does it affect the rendered appearance?
-    * @abstract
-    * @param {Object} state The new state of the widget.
-    * @returns {boolean} Is current appearance inconsistent with new state?
-    */
-    mustRender (state) {
-        throw new Error("Widget subclass did not implement mustRender");
-    }
-}
-
-// @override tag allows missing @param and @returns tags
-class WonderfulWidget extends Widget {
-    /**
-     * @override
-     */
-    mustRender (state) {
-        return state !== this.state; // shallow comparison
-    }
-}
-```
-
-## Options
-
-This rule has an object option:
-
-* `"prefer"` enforces consistent documentation tags specified by an object whose properties mean instead of key use value (for example, `"return": "returns"` means instead of `@return` use `@returns`)
-* `"preferType"` enforces consistent type strings specified by an object whose properties mean instead of key use value (for example, `"object": "Object"` means instead of `object` use `Object`)
-* `"requireReturn"` requires a return tag:
-    * `true` (default) **even if** the function or method does not have a `return` statement (this option value does not apply to constructors)
-    * `false` **if and only if** the function or method has a `return` statement or returns a value e.g. `async` function (this option value does apply to constructors)
-* `"requireReturnType": false` allows missing type in return tags
-* `"matchDescription"` specifies (as a string) a regular expression to match the description in each JSDoc comment (for example, `".+"` requires a description; this option does not apply to descriptions in parameter or return tags)
-* `"requireParamDescription": false` allows missing description in parameter tags
-* `"requireReturnDescription": false` allows missing description in return tags
-* `"requireParamType": false` allows missing type in parameter tags
-
-### prefer
-
-Examples of additional **incorrect** code for this rule with sample `"prefer": { "arg": "param", "argument": "param", "class": "constructor", "return": "returns", "virtual": "abstract" }` options:
-
-```js
-/*eslint valid-jsdoc: ["error", { "prefer": { "arg": "param", "argument": "param", "class": "constructor", "return": "returns", "virtual": "abstract" } }]*/
-/*eslint-env es6*/
-
-/**
- * Add two numbers.
- * @arg {int} num1 The first number.
- * @arg {int} num2 The second number.
- * @return {int} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-
-/**
- * Represents a sum.
- * @class
- * @argument {number} num1 The first number.
- * @argument {number} num2 The second number.
- */
-function sum(num1, num2) {
-    this.num1 = num1;
-    this.num2 = num2;
-}
-
-class Widget {
-    /**
-     * When the state changes, does it affect the rendered appearance?
-     * @virtual
-     * @argument {Object} state The new state of the widget.
-     * @return {boolean} Is current appearance inconsistent with new state?
-     */
-    mustRender (state) {
-        throw new Error("Widget subclass did not implement mustRender");
-    }
-}
-```
-
-### preferType
-
-Examples of additional **incorrect** code for this rule with sample `"preferType": { "Boolean": "boolean", "Number": "number", "object": "Object", "String": "string" }` options:
-
-```js
-/*eslint valid-jsdoc: ["error", { "preferType": { "Boolean": "boolean", "Number": "number", "object": "Object", "String": "string" } }]*/
-/*eslint-env es6*/
-
-/**
- * Add two numbers.
- * @param {Number} num1 The first number.
- * @param {Number} num2 The second number.
- * @returns {Number} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-
-/**
- * Output a greeting as a side effect.
- * @param {String} name Whom to greet.
- * @returns {void}
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-
-class Widget {
-    /**
-     * When the state changes, does it affect the rendered appearance?
-     * @abstract
-     * @param {object} state The new state of the widget.
-     * @returns {Boolean} Is current appearance inconsistent with new state?
-     */
-    mustRender (state) {
-        throw new Error("Widget subclass did not implement mustRender");
-    }
-}
-```
-
-### requireReturn
-
-Examples of additional **incorrect** code for this rule with the `"requireReturn": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireReturn": false }]*/
-
-// unexpected @returns tag because function has no `return` statement
-/**
- * @param {string} name Whom to greet.
- * @returns {string} The greeting.
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-
-// add @abstract tag to allow @returns tag without `return` statement
-class Widget {
-    /**
-     * When the state changes, does it affect the rendered appearance?
-     * @param {Object} state The new state of the widget.
-     * @returns {boolean} Is current appearance inconsistent with new state?
-     */
-    mustRender (state) {
-        throw new Error("Widget subclass did not implement mustRender");
-    }
-}
-```
-
-Example of additional **correct** code for this rule with the `"requireReturn": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireReturn": false }]*/
-
-/**
- * @param {string} name Whom to greet.
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-```
-
-### requireReturnType
-
-Example of additional **correct** code for this rule with the `"requireReturnType": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireReturnType": false }]*/
-
-/**
- * Add two numbers.
- * @param {number} num1 The first number.
- * @param {number} num2 The second number.
- * @returns The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-```
-
-### requireParamType
-
-Example of additional **correct** code for this rule with the `"requireParamType": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireParamType": false }]*/
-
-/**
- * Add two numbers.
- * @param num1 The first number.
- * @param num2 The second number.
- * @returns {number} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-```
-
-### matchDescription
-
-Example of additional **incorrect** code for this rule with a sample `"matchDescription": ".+"` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "matchDescription": ".+" }]*/
-
-// missing function description
-/**
- * @param {string} name Whom to greet.
- * @returns {void}
- */
-function greet(name) {
-    console.log("Hello " + name);
-}
-```
-
-### requireParamDescription
-
-Example of additional **correct** code for this rule with the `"requireParamDescription": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireParamDescription": false }]*/
-
-/**
- * Add two numbers.
- * @param {int} num1
- * @param {int} num2
- * @returns {int} The sum of the two numbers.
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-```
-
-### requireReturnDescription
-
-Example of additional **correct** code for this rule with the `"requireReturnDescription": false` option:
-
-```js
-/*eslint valid-jsdoc: ["error", { "requireReturnDescription": false }]*/
-
-/**
- * Add two numbers.
- * @param {number} num1 The first number.
- * @param {number} num2 The second number.
- * @returns {number}
- */
-function add(num1, num2) {
-    return num1 + num2;
-}
-```
-
-## When Not To Use It
-
-If you aren't using JSDoc, then you can safely turn this rule off.
-
-## Further Reading
-
-* [JSDoc](http://usejsdoc.org)
-
-## Related Rules
-
-* [require-jsdoc](require-jsdoc.md)
diff --git a/eslint/docs/rules/valid-typeof.md b/eslint/docs/rules/valid-typeof.md
deleted file mode 100644 (file)
index 825e3bf..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# enforce comparing `typeof` expressions against valid strings (valid-typeof)
-
-For a vast majority of use cases, the result of the `typeof` operator is one of the following string literals: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, `"function"`, `"symbol"`, and `"bigint"`. It is usually a typing mistake to compare the result of a `typeof` operator to other string literals.
-
-## Rule Details
-
-This rule enforces comparing `typeof` expressions to valid string literals.
-
-## Options
-
-This rule has an object option:
-
-* `"requireStringLiterals": true` requires `typeof` expressions to only be compared to string literals or other `typeof` expressions, and disallows comparisons to any other value.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint valid-typeof: "error"*/
-
-typeof foo === "strnig"
-typeof foo == "undefimed"
-typeof bar != "nunber"
-typeof bar !== "fucntion"
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint valid-typeof: "error"*/
-
-typeof foo === "string"
-typeof bar == "undefined"
-typeof foo === baz
-typeof bar === typeof qux
-```
-
-Examples of **incorrect** code with the `{ "requireStringLiterals": true }` option:
-
-```js
-/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/
-
-typeof foo === undefined
-typeof bar == Object
-typeof baz === "strnig"
-typeof qux === "some invalid type"
-typeof baz === anotherVariable
-typeof foo == 5
-```
-
-Examples of **correct** code with the `{ "requireStringLiterals": true }` option:
-
-```js
-/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/
-
-typeof foo === "undefined"
-typeof bar == "object"
-typeof baz === "string"
-typeof bar === typeof qux
-```
-
-## When Not To Use It
-
-You may want to turn this rule off if you will be using the `typeof` operator on host objects.
-
-## Further Reading
-
-* [MDN: `typeof` documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof)
diff --git a/eslint/docs/rules/vars-on-top.md b/eslint/docs/rules/vars-on-top.md
deleted file mode 100644 (file)
index c8ce81e..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-# Require Variable Declarations to be at the top of their scope (vars-on-top)
-
-The `vars-on-top` rule generates warnings when variable declarations are not used serially at the top of a function scope or the top of a program.
-By default variable declarations are always moved (“hoisted”) invisibly to the top of their containing scope by the JavaScript interpreter.
-This rule forces the programmer to represent that behavior by manually moving the variable declaration to the top of its containing scope.
-
-## Rule Details
-
-This rule aims to keep all variable declarations in the leading series of statements.
-Allowing multiple declarations helps promote maintainability and is thus allowed.
-
-Examples of **incorrect** code for this rule:
-
-```js
-/*eslint vars-on-top: "error"*/
-
-// Variable declaration in a nested block, and a variable declaration after other statements:
-function doSomething() {
-    if (true) {
-        var first = true;
-    }
-    var second;
-}
-
-// Variable declaration in for initializer:
-function doSomething() {
-    for (var i=0; i<10; i++) {}
-}
-```
-
-```js
-/*eslint vars-on-top: "error"*/
-
-// Variable declaration after other statements:
-f();
-var a;
-```
-
-```js
-/*eslint vars-on-top: "error"*/
-
-// Variables in class static blocks should be at the top of the static blocks.
-
-class C {
-
-    // Variable declaration in a nested block:
-    static {
-        if (something) {
-            var a = true;
-        }
-    }
-
-    // Variable declaration after other statements:
-    static {
-        f();
-        var a;
-    }
-
-}
-```
-
-Examples of **correct** code for this rule:
-
-```js
-/*eslint vars-on-top: "error"*/
-
-function doSomething() {
-    var first;
-    var second; //multiple declarations are allowed at the top
-    if (true) {
-        first = true;
-    }
-}
-
-function doSomething() {
-    var i;
-    for (i=0; i<10; i++) {}
-}
-```
-
-```js
-/*eslint vars-on-top: "error"*/
-
-var a;
-f();
-```
-
-```js
-/*eslint vars-on-top: "error"*/
-
-class C {
-
-    static {
-        var a;
-        if (something) {
-            a = true;
-        }
-    }
-
-    static {
-        var a;
-        f();
-    }
-
-}
-```
-
-```js
-/*eslint vars-on-top: "error"*/
-
-// Directives may precede variable declarations.
-"use strict";
-var a;
-f();
-
-// Comments can describe variables.
-function doSomething() {
-    // this is the first var.
-    var first;
-    // this is the second var.
-    var second
-}
-```
-
-## Further Reading
-
-* [JavaScript Scoping and Hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html)
-* [var Hoisting](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting)
-* [A criticism of the Single Var Pattern in JavaScript, and a simple alternative](http://danielhough.co.uk/blog/single-var-pattern-rant/)
-* [Multiple var statements in JavaScript, not superfluous](http://benalman.com/news/2012/05/multiple-var-statements-javascript/)
diff --git a/eslint/docs/rules/wrap-iife.md b/eslint/docs/rules/wrap-iife.md
deleted file mode 100644 (file)
index 28653ab..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-# Require IIFEs to be Wrapped (wrap-iife)
-
-You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.
-
-```js
-// function expression could be unwrapped
-var x = function () { return { y: 1 };}();
-
-// function declaration must be wrapped
-function () { /* side effects */ }(); // SyntaxError
-```
-
-## Rule Details
-
-This rule requires all immediately-invoked function expressions to be wrapped in parentheses.
-
-## Options
-
-This rule has two options, a string option and an object option.
-
-String option:
-
-* `"outside"` enforces always wrapping the *call* expression. The default is `"outside"`.
-* `"inside"` enforces always wrapping the *function* expression.
-* `"any"` enforces always wrapping, but allows either style.
-
-Object option:
-
-* `"functionPrototypeMethods": true` additionally enforces wrapping function expressions invoked using `.call` and `.apply`. The default is `false`.
-
-### outside
-
-Examples of **incorrect** code for the default `"outside"` option:
-
-```js
-/*eslint wrap-iife: ["error", "outside"]*/
-
-var x = function () { return { y: 1 };}(); // unwrapped
-var x = (function () { return { y: 1 };})(); // wrapped function expression
-```
-
-Examples of **correct** code for the default `"outside"` option:
-
-```js
-/*eslint wrap-iife: ["error", "outside"]*/
-
-var x = (function () { return { y: 1 };}()); // wrapped call expression
-```
-
-### inside
-
-Examples of **incorrect** code for the `"inside"` option:
-
-```js
-/*eslint wrap-iife: ["error", "inside"]*/
-
-var x = function () { return { y: 1 };}(); // unwrapped
-var x = (function () { return { y: 1 };}()); // wrapped call expression
-```
-
-Examples of **correct** code for the `"inside"` option:
-
-```js
-/*eslint wrap-iife: ["error", "inside"]*/
-
-var x = (function () { return { y: 1 };})(); // wrapped function expression
-```
-
-### any
-
-Examples of **incorrect** code for the `"any"` option:
-
-```js
-/*eslint wrap-iife: ["error", "any"]*/
-
-var x = function () { return { y: 1 };}(); // unwrapped
-```
-
-Examples of **correct** code for the `"any"` option:
-
-```js
-/*eslint wrap-iife: ["error", "any"]*/
-
-var x = (function () { return { y: 1 };}()); // wrapped call expression
-var x = (function () { return { y: 1 };})(); // wrapped function expression
-```
-
-### functionPrototypeMethods
-
-Examples of **incorrect** code for this rule with the `"inside", { "functionPrototypeMethods": true }` options:
-
-```js
-/* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
-
-var x = function(){ foo(); }()
-var x = (function(){ foo(); }())
-var x = function(){ foo(); }.call(bar)
-var x = (function(){ foo(); }.call(bar))
-```
-
-Examples of **correct** code for this rule with the `"inside", { "functionPrototypeMethods": true }` options:
-
-```js
-/* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
-
-var x = (function(){ foo(); })()
-var x = (function(){ foo(); }).call(bar)
-```
diff --git a/eslint/docs/rules/wrap-regex.md b/eslint/docs/rules/wrap-regex.md
deleted file mode 100644 (file)
index df8003f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Require Regex Literals to be Wrapped (wrap-regex)
-
-When a regular expression is used in certain situations, it can end up looking like a division operator. For example:
-
-```js
-function a() {
-    return /foo/.test("bar");
-}
-```
-
-## Rule Details
-
-This is used to disambiguate the slash operator and facilitates more readable code.
-
-Example of **incorrect** code for this rule:
-
-```js
-/*eslint wrap-regex: "error"*/
-
-function a() {
-    return /foo/.test("bar");
-}
-```
-
-Example of **correct** code for this rule:
-
-```js
-/*eslint wrap-regex: "error"*/
-
-function a() {
-    return (/foo/).test("bar");
-}
-```
diff --git a/eslint/docs/rules/yield-star-spacing.md b/eslint/docs/rules/yield-star-spacing.md
deleted file mode 100644 (file)
index f8c27e6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-# Enforce spacing around the `*` in `yield*` expressions (yield-star-spacing)
-
-## Rule Details
-
-This rule enforces spacing around the `*` in `yield*` expressions.
-
-## Options
-
-The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
-
-* `before` enforces spacing between the `yield` and the `*`.
-  If `true`, a space is required, otherwise spaces are disallowed.
-
-* `after` enforces spacing between the `*` and the argument.
-  If it is `true`, a space is required, otherwise spaces are disallowed.
-
-The default is `{"before": false, "after": true}`.
-
-```json
-"yield-star-spacing": ["error", {"before": true, "after": false}]
-```
-
-The option also has a string shorthand:
-
-* `{"before": false, "after": true}` → `"after"`
-* `{"before": true, "after": false}` → `"before"`
-* `{"before": true, "after": true}` → `"both"`
-* `{"before": false, "after": false}` → `"neither"`
-
-```json
-"yield-star-spacing": ["error", "after"]
-```
-
-## Examples
-
-### after
-
-Examples of **correct** code for this rule with the default `"after"` option:
-
-```js
-/*eslint yield-star-spacing: ["error", "after"]*/
-/*eslint-env es6*/
-
-function* generator() {
-  yield* other();
-}
-```
-
-### before
-
-Examples of **correct** code for this rule with the `"before"` option:
-
-```js
-/*eslint yield-star-spacing: ["error", "before"]*/
-/*eslint-env es6*/
-
-function *generator() {
-  yield *other();
-}
-```
-
-### both
-
-Examples of **correct** code for this rule with the `"both"` option:
-
-```js
-/*eslint yield-star-spacing: ["error", "both"]*/
-/*eslint-env es6*/
-
-function * generator() {
-  yield * other();
-}
-```
-
-### neither
-
-Examples of **correct** code for this rule with the `"neither"` option:
-
-```js
-/*eslint yield-star-spacing: ["error", "neither"]*/
-/*eslint-env es6*/
-
-function*generator() {
-  yield*other();
-}
-```
-
-## When Not To Use It
-
-If your project will not be using generators or you are not concerned with spacing consistency, you do not need this rule.
-
-## Further Reading
-
-* [Understanding ES6: Generators](https://leanpub.com/understandinges6/read/#leanpub-auto-generators)
diff --git a/eslint/docs/rules/yoda.md b/eslint/docs/rules/yoda.md
deleted file mode 100644 (file)
index 9a23a55..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-# Require or disallow Yoda Conditions (yoda)
-
-Yoda conditions are so named because the literal value of the condition comes first while the variable comes second. For example, the following is a Yoda condition:
-
-```js
-if ("red" === color) {
-    // ...
-}
-```
-
-This is called a Yoda condition because it reads as, "if red equals the color", similar to the way the Star Wars character Yoda speaks. Compare to the other way of arranging the operands:
-
-```js
-if (color === "red") {
-    // ...
-}
-```
-
-This typically reads, "if the color equals red", which is arguably a more natural way to describe the comparison.
-
-Proponents of Yoda conditions highlight that it is impossible to mistakenly use `=` instead of `==` because you cannot assign to a literal value. Doing so will cause a syntax error and you will be informed of the mistake early on. This practice was therefore very common in early programming where tools were not yet available.
-
-Opponents of Yoda conditions point out that tooling has made us better programmers because tools will catch the mistaken use of `=` instead of `==` (ESLint will catch this for you). Therefore, they argue, the utility of the pattern doesn't outweigh the readability hit the code takes while using Yoda conditions.
-
-## Rule Details
-
-This rule aims to enforce consistent style of conditions which compare a variable to a literal value.
-
-## Options
-
-This rule can take a string option:
-
-* If it is the default `"never"`, then comparisons must never be Yoda conditions.
-* If it is `"always"`, then the literal value must always come first.
-
-The default `"never"` option can have exception options in an object literal:
-
-* If the `"exceptRange"` property is `true`, the rule *allows* yoda conditions in range comparisons which are wrapped directly in parentheses, including the parentheses of an `if` or `while` condition. The default value is `false`. A *range* comparison tests whether a variable is inside or outside the range between two literal values.
-* If the `"onlyEquality"` property is `true`, the rule reports yoda conditions *only* for the equality operators `==` and `===`. The default value is `false`.
-
-The `onlyEquality` option allows a superset of the exceptions which `exceptRange` allows, thus both options are not useful together.
-
-### never
-
-Examples of **incorrect** code for the default `"never"` option:
-
-```js
-/*eslint yoda: "error"*/
-
-if ("red" === color) {
-    // ...
-}
-
-if (`red` === color) {
-    // ...
-}
-
-if (`red` === `${color}`) {
-    // ...
-}
-
-if (true == flag) {
-    // ...
-}
-
-if (5 > count) {
-    // ...
-}
-
-if (-1 < str.indexOf(substr)) {
-    // ...
-}
-
-if (0 <= x && x < 1) {
-    // ...
-}
-```
-
-Examples of **correct** code for the default `"never"` option:
-
-```js
-/*eslint yoda: "error"*/
-
-if (5 & value) {
-    // ...
-}
-
-if (value === "red") {
-    // ...
-}
-
-if (value === `red`) {
-    // ...
-}
-
-if (`${value}` === `red`) {
-
-}
-```
-
-### exceptRange
-
-Examples of **correct** code for the `"never", { "exceptRange": true }` options:
-
-```js
-/*eslint yoda: ["error", "never", { "exceptRange": true }]*/
-
-function isReddish(color) {
-    return (color.hue < 60 || 300 < color.hue);
-}
-
-if (x < -1 || 1 < x) {
-    // ...
-}
-
-if (count < 10 && (0 <= rand && rand < 1)) {
-    // ...
-}
-
-if (`blue` < x && x < `green`) {
-    // ...
-}
-
-function howLong(arr) {
-    return (0 <= arr.length && arr.length < 10) ? "short" : "long";
-}
-```
-
-### onlyEquality
-
-Examples of **correct** code for the `"never", { "onlyEquality": true }` options:
-
-```js
-/*eslint yoda: ["error", "never", { "onlyEquality": true }]*/
-
-if (x < -1 || 9 < x) {
-}
-
-if (x !== 'foo' && 'bar' != x) {
-}
-
-if (x !== `foo` && `bar` != x) {
-}
-```
-
-### always
-
-Examples of **incorrect** code for the `"always"` option:
-
-```js
-/*eslint yoda: ["error", "always"]*/
-
-if (color == "blue") {
-    // ...
-}
-
-if (color == `blue`) {
-    // ...
-}
-```
-
-Examples of **correct** code for the `"always"` option:
-
-```js
-/*eslint yoda: ["error", "always"]*/
-
-if ("blue" == value) {
-    // ...
-}
-
-if (`blue` == value) {
-    // ...
-}
-
-if (`blue` == `${value}`) {
-    // ...
-}
-
-if (-1 < str.indexOf(substr)) {
-    // ...
-}
-```
-
-## Further Reading
-
-* [Yoda Conditions](https://en.wikipedia.org/wiki/Yoda_conditions)
-* [Yoda Notation and Safe Switching](http://thomas.tuerke.net/on/design/?with=1249091668#msg1146181680)
diff --git a/eslint/docs/src/_data/config.json b/eslint/docs/src/_data/config.json
new file mode 100644 (file)
index 0000000..4acb482
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "lang": "en",
+    "version": "7.26.0"
+}
diff --git a/eslint/docs/src/_data/eslintVersion.js b/eslint/docs/src/_data/eslintVersion.js
new file mode 100644 (file)
index 0000000..2496427
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * @fileoverview Data file for package information
+ * @author Nicholas C. Zakas
+ */
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const fs = require("fs");
+const path = require("path");
+
+//-----------------------------------------------------------------------------
+// Initialization
+//-----------------------------------------------------------------------------
+
+const pkgPath = path.resolve(__dirname, "../../package.json");
+const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
+const { ESLINT_VERSION } = process.env;
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+/*
+ * Because we want to differentiate between the development branch and the
+ * most recent release, we need a way to override the version. The
+ * ESLINT_VERSION environment variable allows us to set this to override
+ * the value displayed on the website. The most common case is we will set
+ * this equal to "HEAD" for the version that is currently in development on
+ * GitHub. Otherwise, we will use the version from package.json.
+ */
+
+module.exports = ESLINT_VERSION ?? pkg.version;
diff --git a/eslint/docs/src/_data/further_reading_links.json b/eslint/docs/src/_data/further_reading_links.json
new file mode 100644 (file)
index 0000000..dc81f7f
--- /dev/null
@@ -0,0 +1,702 @@
+{
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "setter - JavaScript | MDN",
+        "description": "The set syntax binds an object property to a function to be called when there is an attempt to set that property."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "getter - JavaScript | MDN",
+        "description": "The get syntax binds an object property to a function that will be called when that property is looked up."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Working with objects - JavaScript | MDN",
+        "description": "JavaScript is designed on a simple object-based paradigm. An object is a collection of properties, and a property is an association between a name (or key) and a value. A property’s value can be a function, in which case the property is known as a method. In addition to objects that are predefined i…"
+    },
+    "https://github.com/airbnb/javascript#arrows--one-arg-parens": {
+        "domain": "github.com",
+        "url": "https://github.com/airbnb/javascript#arrows--one-arg-parens",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "GitHub - airbnb/javascript: JavaScript Style Guide",
+        "description": "JavaScript Style Guide. Contribute to airbnb/javascript development by creating an account on GitHub."
+    },
+    "https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html": {
+        "domain": "www.adequatelygood.com",
+        "url": "https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html",
+        "logo": "https://www.adequatelygood.com/favicon.ico",
+        "title": "JavaScript Scoping and Hoisting",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "var - JavaScript | MDN",
+        "description": "The var statement declares a function-scoped or globally-scoped variable, optionally initializing it to a value."
+    },
+    "https://en.wikipedia.org/wiki/Indent_style": {
+        "domain": "en.wikipedia.org",
+        "url": "https://en.wikipedia.org/wiki/Indent_style",
+        "logo": "https://en.wikipedia.org/static/apple-touch/wikipedia.png",
+        "title": "Indentation style - Wikipedia",
+        "description": null
+    },
+    "https://github.com/maxogden/art-of-node#callbacks": {
+        "domain": "github.com",
+        "url": "https://github.com/maxogden/art-of-node#callbacks",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "GitHub - maxogden/art-of-node: a short introduction to node.js",
+        "description": ":snowflake: a short introduction to node.js. Contribute to maxogden/art-of-node development by creating an account on GitHub."
+    },
+    "https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/",
+        "logo": "https://archive.org/favicon.ico",
+        "title": "What are the error conventions? - docs.nodejitsu.com",
+        "description": "docs.nodejitsu.com is a growing collection of how-to articles for node.js, written by the community and curated by Nodejitsu and friends. These articles range from basic to advanced, and provide relevant code samples and insights into the design and philosophy of node itself."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Classes - JavaScript | MDN",
+        "description": "Classes are a template for creating objects. They encapsulate data with code to work on that data. Classes in JS are built on prototypes but also have some syntax and semantics that are not shared with ES5 class-like semantics."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "static - JavaScript | MDN",
+        "description": "The static keyword defines a static method or property for a class, or a class static initialization block (see the link for more information about this usage). Neither static methods nor static properties can be called on instances of the class. Instead, they’re called on the class itself."
+    },
+    "https://www.crockford.com/code.html": {
+        "domain": "www.crockford.com",
+        "url": "https://www.crockford.com/code.html",
+        "logo": "https://www.crockford.com/favicon.png",
+        "title": "Code Conventions for the JavaScript Programming Language",
+        "description": null
+    },
+    "https://dojotoolkit.org/reference-guide/1.9/developer/styleguide.html": {
+        "domain": "dojotoolkit.org",
+        "url": "https://dojotoolkit.org/reference-guide/1.9/developer/styleguide.html",
+        "logo": "https://dojotoolkit.org/images/favicons/apple-touch-icon-152x152.png",
+        "title": "Dojo Style Guide — The Dojo Toolkit - Reference Guide",
+        "description": null
+    },
+    "https://gist.github.com/isaacs/357981": {
+        "domain": "gist.github.com",
+        "url": "https://gist.github.com/isaacs/357981",
+        "logo": "https://gist.github.com/fluidicon.png",
+        "title": "A better coding convention for lists and object literals in JavaScript",
+        "description": "A better coding convention for lists and object literals in JavaScript - comma-first-var.js"
+    },
+    "https://en.wikipedia.org/wiki/Cyclomatic_complexity": {
+        "domain": "en.wikipedia.org",
+        "url": "https://en.wikipedia.org/wiki/Cyclomatic_complexity",
+        "logo": "https://en.wikipedia.org/static/apple-touch/wikipedia.png",
+        "title": "Cyclomatic complexity - Wikipedia",
+        "description": null
+    },
+    "https://ariya.io/2012/12/complexity-analysis-of-javascript-code": {
+        "domain": "ariya.io",
+        "url": "https://ariya.io/2012/12/complexity-analysis-of-javascript-code",
+        "logo": "https://ariya.io/favicon.ico",
+        "title": "Complexity Analysis of JavaScript Code",
+        "description": "Nobody likes to read complex code, especially if it’s someone’s else code. A preventive approach to block any complex code entering the application is by watching its complexity carefully."
+    },
+    "https://craftsmanshipforsoftware.com/2015/05/25/complexity-for-javascript/": {
+        "domain": "craftsmanshipforsoftware.com",
+        "url": "https://craftsmanshipforsoftware.com/2015/05/25/complexity-for-javascript/",
+        "logo": "https://s0.wp.com/i/webclip.png",
+        "title": "Complexity for JavaScript",
+        "description": "The control of complexity control presents the core problem of software development. The huge variety of decisions a developer faces on a day-to-day basis cry for methods of controlling and contain…"
+    },
+    "https://web.archive.org/web/20160808115119/http://jscomplexity.org/complexity": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20160808115119/http://jscomplexity.org/complexity",
+        "logo": "https://archive.org/favicon.ico",
+        "title": "About complexity | JSComplexity.org",
+        "description": "A discussion of software complexity metrics and how they are calculated."
+    },
+    "https://github.com/eslint/eslint/issues/4808#issuecomment-167795140": {
+        "domain": "github.com",
+        "url": "https://github.com/eslint/eslint/issues/4808#issuecomment-167795140",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "Complexity has no default · Issue #4808 · eslint/eslint",
+        "description": "Enabling the complexity rule with only a severity has no effect. We have tried to give sane defaults to all rules, and I think this should be no exception. I don&#39;t know what a good number would..."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "switch - JavaScript | MDN",
+        "description": "The switch statement evaluates an expression, matching the expression’s value to a case clause, and executes statements associated with that case, as well as statements in cases that follow the matching case."
+    },
+    "https://web.archive.org/web/20201112040809/http://markdaggett.com/blog/2013/02/15/functions-explained/": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20201112040809/http://markdaggett.com/blog/2013/02/15/functions-explained/",
+        "logo": "https://web.archive.org/web/20201112040809im_/http://markdaggett.com/favicon.ico",
+        "title": "Functions Explained - Mark Daggett’s Blog",
+        "description": "A Deep Dive into JavaScript Functions\nBased on my readership I have to assume most of you are familiar with JavaScript already. Therefore, it may …"
+    },
+    "https://2ality.com/2015/09/function-names-es6.html": {
+        "domain": "2ality.com",
+        "url": "https://2ality.com/2015/09/function-names-es6.html",
+        "logo": "https://2ality.com/img/favicon.png",
+        "title": "The names of functions in ES6",
+        "description": null
+    },
+    "https://leanpub.com/understandinges6/read/#leanpub-auto-generators": {
+        "domain": "leanpub.com",
+        "url": "https://leanpub.com/understandinges6/read/#leanpub-auto-generators",
+        "logo": "https://leanpub.com/understandinges6/read/favicons/mstile-310x310.png",
+        "title": "Read Understanding ECMAScript 6 | Leanpub",
+        "description": null
+    },
+    "https://leanpub.com/understandinges6/read/#leanpub-auto-accessor-properties": {
+        "domain": "leanpub.com",
+        "url": "https://leanpub.com/understandinges6/read/#leanpub-auto-accessor-properties",
+        "logo": "https://leanpub.com/understandinges6/read/favicons/mstile-310x310.png",
+        "title": "Read Understanding ECMAScript 6 | Leanpub",
+        "description": null
+    },
+    "https://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/": {
+        "domain": "javascriptweblog.wordpress.com",
+        "url": "https://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/",
+        "logo": "https://s1.wp.com/i/favicon.ico",
+        "title": "Exploring JavaScript for-in loops",
+        "description": "The for-in loop is the only cross-browser technique for iterating the properties of generic objects. There’s a bunch of literature about the dangers of using for-in to iterate arrays and when…"
+    },
+    "https://2ality.com/2012/01/objects-as-maps.html": {
+        "domain": "2ality.com",
+        "url": "https://2ality.com/2012/01/objects-as-maps.html",
+        "logo": "https://2ality.com/img/favicon.png",
+        "title": "The pitfalls of using objects as maps in JavaScript",
+        "description": null
+    },
+    "https://web.archive.org/web/20160725154648/http://www.mind2b.com/component/content/article/24-software-module-size-and-file-size": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20160725154648/http://www.mind2b.com/component/content/article/24-software-module-size-and-file-size",
+        "logo": "https://archive.org/favicon.ico",
+        "title": "Software Module size and file size",
+        "description": null
+    },
+    "http://book.mixu.net/node/ch7.html": {
+        "domain": "book.mixu.net",
+        "url": "http://book.mixu.net/node/ch7.html",
+        "logo": null,
+        "title": "7. Control flow - Mixu’s Node book",
+        "description": null
+    },
+    "https://web.archive.org/web/20220104141150/https://howtonode.org/control-flow": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20220104141150/https://howtonode.org/control-flow",
+        "logo": "https://web.archive.org/web/20220104141150im_/https://howtonode.org/favicon.ico",
+        "title": "Control Flow in Node - How To Node - NodeJS",
+        "description": "Learn the zen of coding in NodeJS."
+    },
+    "https://web.archive.org/web/20220127215850/https://howtonode.org/control-flow-part-ii": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20220127215850/https://howtonode.org/control-flow-part-ii",
+        "logo": "https://web.archive.org/web/20220127215850im_/https://howtonode.org/favicon.ico",
+        "title": "Control Flow in Node Part II - How To Node - NodeJS",
+        "description": "Learn the zen of coding in NodeJS."
+    },
+    "https://nodejs.org/api/buffer.html": {
+        "domain": "nodejs.org",
+        "url": "https://nodejs.org/api/buffer.html",
+        "logo": "https://nodejs.org/favicon.ico",
+        "title": "Buffer | Node.js v18.2.0 Documentation",
+        "description": null
+    },
+    "https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md": {
+        "domain": "github.com",
+        "url": "https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "notes/Lets-fix-Buffer-API.md at master · ChALkeR/notes",
+        "description": "Some public notes. Contribute to ChALkeR/notes development by creating an account on GitHub."
+    },
+    "https://github.com/nodejs/node/issues/4660": {
+        "domain": "github.com",
+        "url": "https://github.com/nodejs/node/issues/4660",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "Buffer(number) is unsafe · Issue #4660 · nodejs/node",
+        "description": "tl;dr This issue proposes: Change new Buffer(number) to return safe, zeroed-out memory Create a new API for creating uninitialized Buffers, Buffer.alloc(number) Update: Jan 15, 2016 Upon further co..."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "debugger - JavaScript | MDN",
+        "description": "The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is available, this statement has no effect."
+    },
+    "https://ericlippert.com/2003/11/01/eval-is-evil-part-one/": {
+        "domain": "ericlippert.com",
+        "url": "https://ericlippert.com/2003/11/01/eval-is-evil-part-one/",
+        "logo": "https://s1.wp.com/i/favicon.ico",
+        "title": "Eval is evil, part one",
+        "description": "The eval method — which takes a string containing JScript code, compiles it and runs it — is probably the most powerful and most misused method in JScript. There are a few scenarios in …"
+    },
+    "https://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/": {
+        "domain": "javascriptweblog.wordpress.com",
+        "url": "https://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/",
+        "logo": "https://s1.wp.com/i/favicon.ico",
+        "title": "How evil is eval?",
+        "description": "“eval is Evil: The eval function is the most misused feature of JavaScript. Avoid it” Douglas Crockford in JavaScript: The Good Parts I like The Good Parts. It’s essential reading…"
+    },
+    "https://bocoup.com/blog/the-catch-with-try-catch": {
+        "domain": "bocoup.com",
+        "url": "https://bocoup.com/blog/the-catch-with-try-catch",
+        "logo": "https://static3.bocoup.com/assets/2015/10/06163533/favicon.png",
+        "title": "The",
+        "description": "I’ve recently been working on an update to JavaScript Debug, which has me doing a lot of cross-browser testing, and I noticed a few “interesting quirks” with try…catch in Internet Explorer 6-8 that I couldn’t find documented anywhere."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Function.prototype.bind() - JavaScript | MDN",
+        "description": "The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called."
+    },
+    "https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/": {
+        "domain": "www.smashingmagazine.com",
+        "url": "https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/",
+        "logo": "https://www.smashingmagazine.com/images/favicon/apple-touch-icon.png",
+        "title": "Understanding JavaScript Bind () — Smashing Magazine",
+        "description": "Function binding is probably your least concern when beginning with JavaScript, but when you realize that you need a solution to the problem of how to keep the context of “this” within another function, then you might not realize that what you actually need is Function.prototype.bind()."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Operator precedence - JavaScript | MDN",
+        "description": "Operator precedence determines how operators are parsed concerning each other. Operators with higher precedence become the operands of operators with lower precedence."
+    },
+    "https://es5.github.io/#C": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#C",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://benalman.com/news/2010/11/immediately-invoked-function-expression/": {
+        "domain": "benalman.com",
+        "url": "https://benalman.com/news/2010/11/immediately-invoked-function-expression/",
+        "logo": "https://benalman.com/favicon.ico",
+        "title": "Ben Alman » Immediately-Invoked Function Expression (IIFE)",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "ReferenceError: assignment to undeclared variable “x” - JavaScript | MDN",
+        "description": "The JavaScript strict mode-only exception “Assignment to undeclared variable” occurs when the value has been assigned to an undeclared variable."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "let - JavaScript | MDN",
+        "description": "The let statement declares a block-scoped local variable, optionally initializing it to a value."
+    },
+    "https://es5.github.io/#x7.8.5": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#x7.8.5",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://es5.github.io/#x7.2": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#x7.2",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://web.archive.org/web/20200414142829/http://timelessrepo.com/json-isnt-a-javascript-subset": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20200414142829/http://timelessrepo.com/json-isnt-a-javascript-subset",
+        "logo": "https://archive.org/favicon.ico",
+        "title": "JSON: The JavaScript subset that isn’t - Timeless",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Iterators and generators - JavaScript | MDN",
+        "description": "Iterators and Generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops."
+    },
+    "https://kangax.github.io/es5-compat-table/es6/#Iterators": {
+        "domain": "kangax.github.io",
+        "url": "https://kangax.github.io/es5-compat-table/es6/#Iterators",
+        "logo": "https://github.io/favicon.ico",
+        "title": null,
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#Object_methods": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#Object_methods",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Deprecated and obsolete features - JavaScript | MDN",
+        "description": "This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable)."
+    },
+    "https://www.emacswiki.org/emacs/SmartTabs": {
+        "domain": "www.emacswiki.org",
+        "url": "https://www.emacswiki.org/emacs/SmartTabs",
+        "logo": "https://www.emacswiki.org/favicon.ico",
+        "title": "EmacsWiki: Smart Tabs",
+        "description": null
+    },
+    "https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects": {
+        "domain": "www.ecma-international.org",
+        "url": "https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects",
+        "logo": "https://www.ecma-international.org/ecma-262/6.0/favicon.ico",
+        "title": "ECMAScript 2015 Language Specification – ECMA-262 6th Edition",
+        "description": null
+    },
+    "https://www.inkling.com/read/javascript-definitive-guide-david-flanagan-6th/chapter-3/wrapper-objects": {
+        "domain": "www.inkling.com",
+        "url": "https://www.inkling.com/read/javascript-definitive-guide-david-flanagan-6th/chapter-3/wrapper-objects",
+        "logo": "https://inklingstatic.a.ssl.fastly.net/static_assets/20220214.223700z.8c5796a9.docker/images/favicon.ico",
+        "title": "Unsupported Browser",
+        "description": null
+    },
+    "https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence": {
+        "domain": "tc39.es",
+        "url": "https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence",
+        "logo": "https://tc39.es/ecma262/img/favicon.ico",
+        "title": "ECMAScript® 2023 Language Specification",
+        "description": null
+    },
+    "https://es5.github.io/#x15.8": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#x15.8",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/": {
+        "domain": "spin.atomicobject.com",
+        "url": "https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/",
+        "logo": "https://spin.atomicobject.com/wp-content/themes/spin/images/favicon.ico",
+        "title": "JavaScript: Don’t Reassign Your Function Arguments",
+        "description": "The point of this post is to raise awareness that reassigning the value of an argument variable mutates the arguments object."
+    },
+    "https://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files": {
+        "domain": "stackoverflow.com",
+        "url": "https://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files",
+        "logo": "https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a",
+        "title": "How to store Node.js deployment settings/configuration files?",
+        "description": "I have been working on a few Node apps, and I’ve been looking for a good pattern of storing deployment-related settings. In the Django world (where I come from), the common practise would be to hav..."
+    },
+    "https://blog.benhall.me.uk/2012/02/storing-application-config-data-in/": {
+        "domain": "blog.benhall.me.uk",
+        "url": "https://blog.benhall.me.uk/2012/02/storing-application-config-data-in/",
+        "logo": null,
+        "title": "Storing Node.js application config data – Ben Hall’s Blog",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Promise - JavaScript | MDN",
+        "description": "The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value."
+    },
+    "https://johnresig.com/blog/objectgetprototypeof/": {
+        "domain": "johnresig.com",
+        "url": "https://johnresig.com/blog/objectgetprototypeof/",
+        "logo": "https://johnresig.com/wp-content/uploads/2017/04/cropped-jeresig-2016.1024-270x270.jpg",
+        "title": "John Resig - Object.getPrototypeOf",
+        "description": null
+    },
+    "https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names": {
+        "domain": "kangax.github.io",
+        "url": "https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names",
+        "logo": "https://kangax.github.io/compat-table/favicon.ico",
+        "title": "ECMAScript 5 compatibility table",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "async function - JavaScript | MDN",
+        "description": "An async function is a function declared with the async keyword, and the await keyword is permitted within it. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains."
+    },
+    "https://jakearchibald.com/2017/await-vs-return-vs-return-await/": {
+        "domain": "jakearchibald.com",
+        "url": "https://jakearchibald.com/2017/await-vs-return-vs-return-await/",
+        "logo": "https://jakearchibald.com/c/favicon-67801369.png",
+        "title": "await vs return vs return await",
+        "description": null
+    },
+    "https://stackoverflow.com/questions/13497971/what-is-the-matter-with-script-targeted-urls": {
+        "domain": "stackoverflow.com",
+        "url": "https://stackoverflow.com/questions/13497971/what-is-the-matter-with-script-targeted-urls",
+        "logo": "https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a",
+        "title": "What is the matter with script-targeted URLs?",
+        "description": "I’m using JSHint, and it got the following error: Script URL. Which I noticed that happened because on this particular line there is a string containing a javascript:... URL. I know that JSHint"
+    },
+    "https://es5.github.io/#x15.1.1": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#x15.1.1",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://en.wikipedia.org/wiki/Variable_shadowing": {
+        "domain": "en.wikipedia.org",
+        "url": "https://en.wikipedia.org/wiki/Variable_shadowing",
+        "logo": "https://en.wikipedia.org/static/apple-touch/wikipedia.png",
+        "title": "Variable shadowing - Wikipedia",
+        "description": null
+    },
+    "https://www.nczonline.net/blog/2007/09/09/inconsistent-array-literals/": {
+        "domain": "www.nczonline.net",
+        "url": "https://www.nczonline.net/blog/2007/09/09/inconsistent-array-literals/",
+        "logo": "https://www.nczonline.net/images/favicon.png",
+        "title": "Inconsistent array literals",
+        "description": "Back at the Rich Web Experience, I helped lead a “birds of a feather” group discussion on JavaScript. In that discussion, someone called me a JavaScript expert. I quickly explained that I don’t..."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "undefined - JavaScript | MDN",
+        "description": "The global undefined property represents the primitive value undefined. It is one of JavaScript’s primitive types."
+    },
+    "https://javascriptweblog.wordpress.com/2010/08/16/understanding-undefined-and-preventing-referenceerrors/": {
+        "domain": "javascriptweblog.wordpress.com",
+        "url": "https://javascriptweblog.wordpress.com/2010/08/16/understanding-undefined-and-preventing-referenceerrors/",
+        "logo": "https://s1.wp.com/i/favicon.ico",
+        "title": "Understanding JavaScript’s ‘undefined’",
+        "description": "Compared to other languages, JavaScript’s concept of undefined is a little confusing. In particular, trying to understand ReferenceErrors (“x is not defined”) and how best to code…"
+    },
+    "https://es5.github.io/#x15.1.1.3": {
+        "domain": "es5.github.io",
+        "url": "https://es5.github.io/#x15.1.1.3",
+        "logo": "https://es5.github.io/favicon.ico",
+        "title": "Annotated ES5",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Regular expressions - JavaScript | MDN",
+        "description": "Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the exec() and test() methods of RegExp, and with the match(), matchAll(), replace(), replaceAll(), search(), and split() methods of S…"
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "void operator - JavaScript | MDN",
+        "description": "The void operator evaluates the given expression and then returns undefined."
+    },
+    "https://oreilly.com/javascript/excerpts/javascript-good-parts/bad-parts.html": {
+        "domain": "oreilly.com",
+        "url": "https://oreilly.com/javascript/excerpts/javascript-good-parts/bad-parts.html",
+        "logo": "https://www.oreilly.com/favicon.ico",
+        "title": "O’Reilly Media - Technology and Business Training",
+        "description": "Gain technology and business knowledge and hone your skills with learning resources created and curated by O’Reilly’s experts: live online training, video, books, our platform has content from 200+ of the world’s best publishers."
+    },
+    "https://web.archive.org/web/20200717110117/https://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20200717110117/https://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/",
+        "logo": "https://web.archive.org/web/20200717110117im_/https://yuiblog.com/favicon.ico",
+        "title": "with Statement Considered Harmful",
+        "description": null
+    },
+    "https://jscs-dev.github.io/rule/requireNewlineBeforeSingleStatementsInIf": {
+        "domain": "jscs-dev.github.io",
+        "url": "https://jscs-dev.github.io/rule/requireNewlineBeforeSingleStatementsInIf",
+        "logo": "https://jscs-dev.github.io/favicon.ico",
+        "title": "JSCS",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Object initializer - JavaScript | MDN",
+        "description": "Objects can be initialized using new Object(), Object.create(), or using the literal notation (initializer notation). An object initializer is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({})."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Arrow function expressions - JavaScript | MDN",
+        "description": "An arrow function expression is a compact alternative to a traditional function expression, but is limited and can’t be used in all situations."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Destructuring assignment - JavaScript | MDN",
+        "description": "The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables."
+    },
+    "https://2ality.com/2015/01/es6-destructuring.html": {
+        "domain": "2ality.com",
+        "url": "https://2ality.com/2015/01/es6-destructuring.html",
+        "logo": "https://2ality.com/img/favicon.png",
+        "title": "Destructuring and parameter handling in ECMAScript 6",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Expressions and operators - JavaScript | MDN",
+        "description": "This chapter documents all the JavaScript language operators, expressions and keywords."
+    },
+    "https://bugs.chromium.org/p/v8/issues/detail?id=5848": {
+        "domain": "bugs.chromium.org",
+        "url": "https://bugs.chromium.org/p/v8/issues/detail?id=5848",
+        "logo": "https://bugs.chromium.org/static/images/monorail.ico",
+        "title": "5848 - v8 - V8 JavaScript Engine - Monorail",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Object.hasOwn() - JavaScript | MDN",
+        "description": "The Object.hasOwn() static method returns true if the specified object has the indicated property as its own property. If the property is inherited, or does not exist, the method returns false."
+    },
+    "http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error": {
+        "domain": "bluebirdjs.com",
+        "url": "http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error",
+        "logo": "//bluebirdjs.com/img/favicon.png",
+        "title": "Warning Explanations | bluebird",
+        "description": "Bluebird is a fully featured JavaScript promises library with unmatched performance."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "RegExp - JavaScript | MDN",
+        "description": "The RegExp object is used for matching text with a pattern."
+    },
+    "https://mathiasbynens.be/notes/javascript-properties": {
+        "domain": "mathiasbynens.be",
+        "url": "https://mathiasbynens.be/notes/javascript-properties",
+        "logo": "https://mathiasbynens.be/favicon.ico",
+        "title": "Unquoted property names / object keys in JavaScript · Mathias Bynens",
+        "description": null
+    },
+    "https://davidwalsh.name/parseint-radix": {
+        "domain": "davidwalsh.name",
+        "url": "https://davidwalsh.name/parseint-radix",
+        "logo": "https://davidwalsh.name/wp-content/themes/punky/images/favicon-144.png",
+        "title": "parseInt Radix",
+        "description": "The radix is important if you’re need to guarantee accuracy with variable input (basic number, binary, etc.). For best results, always use a radix of 10!"
+    },
+    "https://github.com/tc39/proposal-object-rest-spread": {
+        "domain": "github.com",
+        "url": "https://github.com/tc39/proposal-object-rest-spread",
+        "logo": "https://github.com/fluidicon.png",
+        "title": "GitHub - tc39/proposal-object-rest-spread: Rest/Spread Properties for ECMAScript",
+        "description": "Rest/Spread Properties for ECMAScript. Contribute to tc39/proposal-object-rest-spread development by creating an account on GitHub."
+    },
+    "https://blog.izs.me/2010/12/an-open-letter-to-javascript-leaders-regarding/": {
+        "domain": "blog.izs.me",
+        "url": "https://blog.izs.me/2010/12/an-open-letter-to-javascript-leaders-regarding/",
+        "logo": "https://blog.izs.me/favicon.ico",
+        "title": "An Open Letter to JavaScript Leaders Regarding Semicolons",
+        "description": "Writing and Stuff from Isaac Z. Schlueter"
+    },
+    "https://web.archive.org/web/20200420230322/http://inimino.org/~inimino/blog/javascript_semicolons": {
+        "domain": "web.archive.org",
+        "url": "https://web.archive.org/web/20200420230322/http://inimino.org/~inimino/blog/javascript_semicolons",
+        "logo": "https://archive.org/favicon.ico",
+        "title": "JavaScript Semicolon Insertion",
+        "description": null
+    },
+    "https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description": {
+        "domain": "www.ecma-international.org",
+        "url": "https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description",
+        "logo": "https://www.ecma-international.org/ecma-262/6.0/favicon.ico",
+        "title": "ECMAScript 2015 Language Specification – ECMA-262 6th Edition",
+        "description": null
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Template literals (Template strings) - JavaScript | MDN",
+        "description": "Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, for string interpolation with embedded expressions, and for special constructs called tagged templates."
+    },
+    "https://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals": {
+        "domain": "exploringjs.com",
+        "url": "https://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals",
+        "logo": "https://exploringjs.com/es6/images/favicon-128.png",
+        "title": "8. Template literals",
+        "description": null
+    },
+    "https://jsdoc.app": {
+        "domain": "jsdoc.app",
+        "url": "https://jsdoc.app",
+        "logo": null,
+        "title": "Use JSDoc: Index",
+        "description": "Official documentation for JSDoc 3."
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "typeof - JavaScript | MDN",
+        "description": "The typeof operator returns a string indicating the type of the unevaluated operand."
+    },
+    "https://danhough.com/blog/single-var-pattern-rant/": {
+        "domain": "danhough.com",
+        "url": "https://danhough.com/blog/single-var-pattern-rant/",
+        "logo": "https://danhough.com/img/meta/apple-touch-icon-152x152.png",
+        "title": "A criticism of the Single Var Pattern in JavaScript, and a simple alternative — Dan Hough",
+        "description": "Dan Hough is a software developer & consultant, a writer and public speaker."
+    },
+    "https://benalman.com/news/2012/05/multiple-var-statements-javascript/": {
+        "domain": "benalman.com",
+        "url": "https://benalman.com/news/2012/05/multiple-var-statements-javascript/",
+        "logo": "https://benalman.com/favicon.ico",
+        "title": "Ben Alman » Multiple var statements in JavaScript, not superfluous",
+        "description": null
+    },
+    "https://en.wikipedia.org/wiki/Yoda_conditions": {
+        "domain": "en.wikipedia.org",
+        "url": "https://en.wikipedia.org/wiki/Yoda_conditions",
+        "logo": "https://en.wikipedia.org/static/apple-touch/wikipedia.png",
+        "title": "Yoda conditions - Wikipedia",
+        "description": null
+    },
+    "http://thomas.tuerke.net/on/design/?with=1249091668#msg1146181680": {
+        "domain": "thomas.tuerke.net",
+        "url": "http://thomas.tuerke.net/on/design/?with=1249091668#msg1146181680",
+        "logo": "//thomas.tuerke.net/images/tmtlogo.ico",
+        "title": "Coding in Style",
+        "description": "Thomas M. Tuerke topical weblog"
+    },
+    "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation": {
+        "domain": "developer.mozilla.org",
+        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation",
+        "logo": "https://developer.mozilla.org/favicon-48x48.cbbd161b.png",
+        "title": "Exponentiation (**) - JavaScript | MDN",
+        "description": "The exponentiation operator (**) returns the result of raising the first operand to the power of the second operand. It is equivalent to Math.pow, except it also accepts BigInts as operands."
+    },
+    "https://eslint.org/blog/2022/07/interesting-bugs-caught-by-no-constant-binary-expression/": {
+        "domain": "eslint.org",
+        "url": "https://eslint.org/blog/2022/07/interesting-bugs-caught-by-no-constant-binary-expression/",
+        "logo": "https://eslint.org/apple-touch-icon.png",
+        "title": "Interesting bugs caught by no-constant-binary-expression - ESLint - Pluggable JavaScript Linter",
+        "description": "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease."
+    }
+}
\ No newline at end of file
diff --git a/eslint/docs/src/_data/helpers.js b/eslint/docs/src/_data/helpers.js
new file mode 100644 (file)
index 0000000..a7c4ef6
--- /dev/null
@@ -0,0 +1,31 @@
+module.exports = {
+    /**
+     * Returns some attributes based on whether the link is active or
+     * a parent of an active item
+     *
+     * @param {String} itemUrl is the link in question
+     * @param {String} pageUrl is the page context
+     * @returns {String} is the attributes or empty
+     */
+    getLinkActiveState: function(itemUrl, pageUrl) {
+        let response = '';
+
+        if (itemUrl === pageUrl) {
+            response = ' aria-current="page" ';
+        }
+
+        if (itemUrl.length > 1 && pageUrl.indexOf(itemUrl) === 0) {
+            response += ' data-current="true" ';
+        }
+
+        return response;
+    },
+    excludeThis: function(arr, pageUrl) {
+        var newArray = [];
+        arr.forEach(item => {
+            if(item.url !== pageUrl) newArray.push(item);
+        });
+        return newArray;
+    }
+
+};
diff --git a/eslint/docs/src/_data/languages.json b/eslint/docs/src/_data/languages.json
new file mode 100644 (file)
index 0000000..529a9e3
--- /dev/null
@@ -0,0 +1,27 @@
+{
+    "items": [{
+            "flag": "🇺🇸",
+            "code": "en",
+            "name": "English (US)",
+            "url": "https://eslint.org"
+        },
+        {
+            "flag": "🇯🇵",
+            "code": "jp",
+            "name": "Japanese - 日本語",
+            "url": "https://jp.eslint.org"
+        },
+        {
+            "flag": "🇫🇷",
+            "code": "fr",
+            "name": "Français",
+            "url": "https://fr.eslint.org"
+        },
+        {
+            "flag": "🇨🇳",
+            "code": "cn",
+            "name": "Chinese - 中文",
+            "url": "https://cn.eslint.org"
+        }
+    ]
+}
diff --git a/eslint/docs/src/_data/links.json b/eslint/docs/src/_data/links.json
new file mode 100644 (file)
index 0000000..d9b2973
--- /dev/null
@@ -0,0 +1,22 @@
+{
+    "github": "https://github.com/eslint/eslint",
+    "twitter": "https://twitter.com/geteslint",
+    "chat": "https://eslint.org/chat",
+    "group": "https://groups.google.com/group/eslint",
+
+    "blog": "/blog",
+    "docs": "/docs/latest/",
+    "playground": "/play",
+    "getStarted": "/docs/latest/user-guide/getting-started",
+    "sponsors": "/sponsors",
+    "branding": "/branding",
+    "store": "https://eslint.threadless.com",
+    "team": "/team",
+
+    "configuring": "https://eslint.org/docs/user-guide/configuring/",
+    "fixProblems": "https://eslint.org/docs/user-guide/command-line-interface#fixing-problems",
+
+    "donate": "/donate",
+    "openCollective": "https://opencollective.com/eslint",
+    "githubSponsors": "https://github.com/sponsors/eslint"
+}
diff --git a/eslint/docs/src/_data/navigation.json b/eslint/docs/src/_data/navigation.json
new file mode 100644 (file)
index 0000000..bc83166
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "items": [
+    {
+      "text": "Team",
+      "url": "https://eslint.org/team/"
+    },
+    {
+      "text": "Blog",
+      "url": "https://eslint.org/blog/"
+    },
+    {
+      "text": "Docs",
+      "url": "https://eslint.org/docs/"
+    },
+    {
+      "text": "Store",
+      "url": "https://eslint.threadless.com"
+    },
+    {
+      "text": "Playground",
+      "url": "https://eslint.org/play"
+    }
+  ]
+}
diff --git a/eslint/docs/src/_data/rule_versions.json b/eslint/docs/src/_data/rule_versions.json
new file mode 100644 (file)
index 0000000..98463d4
--- /dev/null
@@ -0,0 +1,329 @@
+{
+    "added": {
+        "accessor-pairs": "0.22.0",
+        "array-bracket-newline": "4.0.0-alpha.1",
+        "array-bracket-spacing": "0.24.0",
+        "array-callback-return": "2.0.0-alpha-1",
+        "array-element-newline": "4.0.0-rc.0",
+        "arrow-body-style": "1.8.0",
+        "arrow-parens": "1.0.0-rc-1",
+        "arrow-spacing": "1.0.0-rc-1",
+        "block-scoped-var": "0.1.0",
+        "block-spacing": "1.2.0",
+        "brace-style": "0.0.7",
+        "callback-return": "1.0.0-rc-1",
+        "camelcase": "0.0.2",
+        "capitalized-comments": "3.11.0",
+        "class-methods-use-this": "3.4.0",
+        "comma-dangle": "0.16.0",
+        "comma-spacing": "0.9.0",
+        "comma-style": "0.9.0",
+        "complexity": "0.0.9",
+        "computed-property-spacing": "0.23.0",
+        "consistent-return": "0.4.0",
+        "consistent-this": "0.0.9",
+        "constructor-super": "0.24.0",
+        "curly": "0.0.2",
+        "default-case-last": "7.0.0-alpha.0",
+        "default-case": "0.6.0",
+        "default-param-last": "6.4.0",
+        "dot-location": "0.21.0",
+        "dot-notation": "0.0.7",
+        "eol-last": "0.7.1",
+        "eqeqeq": "0.0.2",
+        "for-direction": "4.0.0-beta.0",
+        "func-call-spacing": "3.3.0",
+        "func-name-matching": "3.8.0",
+        "func-names": "0.4.0",
+        "func-style": "0.2.0",
+        "function-call-argument-newline": "6.2.0",
+        "function-paren-newline": "4.6.0",
+        "generator-star-spacing": "0.17.0",
+        "generator-star": "0.12.0",
+        "getter-return": "4.2.0",
+        "global-require": "1.4.0",
+        "global-strict": "0.8.0",
+        "grouped-accessor-pairs": "6.7.0",
+        "guard-for-in": "0.0.6",
+        "handle-callback-err": "0.4.5",
+        "id-blacklist": "2.0.0-beta.2",
+        "id-denylist": "7.4.0",
+        "id-length": "1.0.0",
+        "id-match": "1.0.0",
+        "implicit-arrow-linebreak": "4.12.0",
+        "indent-legacy": "4.0.0-alpha.0",
+        "indent": "0.14.0",
+        "init-declarations": "1.0.0-rc-1",
+        "jsx-quotes": "1.4.0",
+        "key-spacing": "0.9.0",
+        "keyword-spacing": "2.0.0-beta.1",
+        "line-comment-position": "3.5.0",
+        "linebreak-style": "0.21.0",
+        "lines-around-comment": "0.22.0",
+        "lines-around-directive": "3.5.0",
+        "lines-between-class-members": "4.9.0",
+        "max-classes-per-file": "5.0.0-alpha.3",
+        "max-depth": "0.0.9",
+        "max-len": "0.0.9",
+        "max-lines-per-function": "5.0.0",
+        "max-lines": "2.12.0",
+        "max-nested-callbacks": "0.2.0",
+        "max-params": "0.0.9",
+        "max-statements-per-line": "2.5.0",
+        "max-statements": "0.0.9",
+        "multiline-comment-style": "4.10.0",
+        "multiline-ternary": "3.1.0",
+        "new-cap": "0.0.3-0",
+        "new-parens": "0.0.6",
+        "newline-after-var": "0.18.0",
+        "newline-before-return": "2.3.0",
+        "newline-per-chained-call": "2.0.0-rc.0",
+        "no-alert": "0.0.5",
+        "no-array-constructor": "0.4.0",
+        "no-arrow-condition": "1.8.0",
+        "no-async-promise-executor": "5.3.0",
+        "no-await-in-loop": "3.12.0",
+        "no-bitwise": "0.0.2",
+        "no-buffer-constructor": "4.0.0-alpha.0",
+        "no-caller": "0.0.6",
+        "no-case-declarations": "1.9.0",
+        "no-catch-shadow": "0.0.9",
+        "no-class-assign": "1.0.0-rc-1",
+        "no-comma-dangle": "0.0.9",
+        "no-compare-neg-zero": "3.17.0",
+        "no-cond-assign": "0.0.9",
+        "no-confusing-arrow": "2.0.0-alpha-2",
+        "no-console": "0.0.2",
+        "no-const-assign": "1.0.0-rc-1",
+        "no-constant-binary-expression": "8.14.0",
+        "no-constant-condition": "0.4.1",
+        "no-constructor-return": "6.7.0",
+        "no-continue": "0.19.0",
+        "no-control-regex": "0.1.0",
+        "no-debugger": "0.0.2",
+        "no-delete-var": "0.0.9",
+        "no-div-regex": "0.1.0",
+        "no-dupe-args": "0.16.0",
+        "no-dupe-class-members": "1.2.0",
+        "no-dupe-else-if": "6.7.0",
+        "no-dupe-keys": "0.0.9",
+        "no-duplicate-case": "0.17.0",
+        "no-duplicate-imports": "2.5.0",
+        "no-else-return": "0.0.9",
+        "no-empty-character-class": "0.22.0",
+        "no-empty-class": "0.0.9",
+        "no-empty-function": "2.0.0",
+        "no-empty-label": "0.0.9",
+        "no-empty-pattern": "1.7.0",
+        "no-empty": "0.0.2",
+        "no-eq-null": "0.0.9",
+        "no-eval": "0.0.2",
+        "no-ex-assign": "0.0.9",
+        "no-extend-native": "0.1.4",
+        "no-extra-bind": "0.8.0",
+        "no-extra-boolean-cast": "0.4.0",
+        "no-extra-label": "2.0.0-rc.0",
+        "no-extra-parens": "0.1.4",
+        "no-extra-semi": "0.0.9",
+        "no-extra-strict": "0.3.0",
+        "no-fallthrough": "0.0.7",
+        "no-floating-decimal": "0.0.6",
+        "no-func-assign": "0.0.9",
+        "no-global-assign": "3.3.0",
+        "no-implicit-coercion": "1.0.0-rc-2",
+        "no-implicit-globals": "2.0.0-alpha-1",
+        "no-implied-eval": "0.0.7",
+        "no-import-assign": "6.4.0",
+        "no-inline-comments": "0.10.0",
+        "no-inner-declarations": "0.6.0",
+        "no-invalid-regexp": "0.1.4",
+        "no-invalid-this": "1.0.0-rc-2",
+        "no-irregular-whitespace": "0.9.0",
+        "no-iterator": "0.0.9",
+        "no-label-var": "0.0.9",
+        "no-labels": "0.4.0",
+        "no-lone-blocks": "0.4.0",
+        "no-lonely-if": "0.6.0",
+        "no-loop-func": "0.0.9",
+        "no-loss-of-precision": "7.1.0",
+        "no-magic-numbers": "1.7.0",
+        "no-misleading-character-class": "5.3.0",
+        "no-mixed-operators": "2.12.0",
+        "no-mixed-requires": "0.0.9",
+        "no-mixed-spaces-and-tabs": "0.7.1",
+        "no-multi-assign": "3.14.0",
+        "no-multi-spaces": "0.9.0",
+        "no-multi-str": "0.0.9",
+        "no-multiple-empty-lines": "0.9.0",
+        "no-native-reassign": "0.0.9",
+        "no-negated-condition": "1.6.0",
+        "no-negated-in-lhs": "0.1.2",
+        "no-nested-ternary": "0.2.0",
+        "no-new-func": "0.0.7",
+        "no-new-object": "0.0.9",
+        "no-new-require": "0.6.0",
+        "no-new-symbol": "2.0.0-beta.1",
+        "no-new-wrappers": "0.0.6",
+        "no-new": "0.0.7",
+        "no-nonoctal-decimal-escape": "7.14.0",
+        "no-obj-calls": "0.0.9",
+        "no-octal-escape": "0.0.9",
+        "no-octal": "0.0.6",
+        "no-param-reassign": "0.18.0",
+        "no-path-concat": "0.4.0",
+        "no-plusplus": "0.0.9",
+        "no-process-env": "0.9.0",
+        "no-process-exit": "0.4.0",
+        "no-promise-executor-return": "7.3.0",
+        "no-proto": "0.0.9",
+        "no-prototype-builtins": "2.11.0",
+        "no-redeclare": "0.0.9",
+        "no-regex-spaces": "0.4.0",
+        "no-reserved-keys": "0.8.0",
+        "no-restricted-exports": "7.0.0-alpha.0",
+        "no-restricted-globals": "2.3.0",
+        "no-restricted-imports": "2.0.0-alpha-1",
+        "no-restricted-modules": "0.6.0",
+        "no-restricted-properties": "3.5.0",
+        "no-restricted-syntax": "1.4.0",
+        "no-return-assign": "0.0.9",
+        "no-return-await": "3.10.0",
+        "no-script-url": "0.0.9",
+        "no-self-assign": "2.0.0-rc.0",
+        "no-self-compare": "0.0.9",
+        "no-sequences": "0.5.1",
+        "no-setter-return": "6.7.0",
+        "no-shadow-restricted-names": "0.1.4",
+        "no-shadow": "0.0.9",
+        "no-space-before-semi": "0.4.3",
+        "no-spaced-func": "0.1.2",
+        "no-sparse-arrays": "0.4.0",
+        "no-sync": "0.0.9",
+        "no-tabs": "3.2.0",
+        "no-template-curly-in-string": "3.3.0",
+        "no-ternary": "0.0.9",
+        "no-this-before-super": "0.24.0",
+        "no-throw-literal": "0.15.0",
+        "no-trailing-spaces": "0.7.1",
+        "no-undef-init": "0.0.6",
+        "no-undef": "0.0.9",
+        "no-undefined": "0.7.1",
+        "no-underscore-dangle": "0.0.9",
+        "no-unexpected-multiline": "0.24.0",
+        "no-unmodified-loop-condition": "2.0.0-alpha-2",
+        "no-unneeded-ternary": "0.21.0",
+        "no-unreachable-loop": "7.3.0",
+        "no-unreachable": "0.0.6",
+        "no-unsafe-finally": "2.9.0",
+        "no-unsafe-negation": "3.3.0",
+        "no-unsafe-optional-chaining": "7.15.0",
+        "no-unused-expressions": "0.1.0",
+        "no-unused-labels": "2.0.0-rc.0",
+        "no-unused-private-class-members": "8.1.0",
+        "no-unused-vars": "0.0.9",
+        "no-use-before-define": "0.0.9",
+        "no-useless-backreference": "7.0.0-alpha.0",
+        "no-useless-call": "1.0.0-rc-1",
+        "no-useless-catch": "5.11.0",
+        "no-useless-computed-key": "2.9.0",
+        "no-useless-concat": "1.3.0",
+        "no-useless-constructor": "2.0.0-beta.1",
+        "no-useless-escape": "2.5.0",
+        "no-useless-rename": "2.11.0",
+        "no-useless-return": "3.9.0",
+        "no-var": "0.12.0",
+        "no-void": "0.8.0",
+        "no-warning-comments": "0.4.4",
+        "no-whitespace-before-property": "2.0.0-beta.1",
+        "no-with": "0.0.2",
+        "no-wrap-func": "0.0.9",
+        "nonblock-statement-body-position": "3.17.0",
+        "object-curly-newline": "2.12.0",
+        "object-curly-spacing": "0.22.0",
+        "object-property-newline": "2.10.0",
+        "object-shorthand": "0.20.0",
+        "one-var-declaration-per-line": "2.0.0-beta.3",
+        "one-var": "0.0.9",
+        "operator-assignment": "0.10.0",
+        "operator-linebreak": "0.19.0",
+        "padded-blocks": "0.9.0",
+        "padding-line-between-statements": "4.0.0-beta.0",
+        "prefer-arrow-callback": "1.2.0",
+        "prefer-const": "0.23.0",
+        "prefer-destructuring": "3.13.0",
+        "prefer-exponentiation-operator": "6.7.0",
+        "prefer-named-capture-group": "5.15.0",
+        "prefer-numeric-literals": "3.5.0",
+        "prefer-object-has-own": "8.5.0",
+        "prefer-object-spread": "5.0.0-alpha.3",
+        "prefer-promise-reject-errors": "3.14.0",
+        "prefer-reflect": "1.0.0-rc-2",
+        "prefer-regex-literals": "6.4.0",
+        "prefer-rest-params": "2.0.0-alpha-1",
+        "prefer-spread": "1.0.0-rc-1",
+        "prefer-template": "1.2.0",
+        "quote-props": "0.0.6",
+        "quotes": "0.0.7",
+        "radix": "0.0.7",
+        "require-atomic-updates": "5.3.0",
+        "require-await": "3.11.0",
+        "require-jsdoc": "1.4.0",
+        "require-unicode-regexp": "5.3.0",
+        "require-yield": "1.0.0-rc-1",
+        "rest-spread-spacing": "2.12.0",
+        "semi-spacing": "0.16.0",
+        "semi-style": "4.0.0-beta.0",
+        "semi": "0.0.6",
+        "sort-imports": "2.0.0-beta.1",
+        "sort-keys": "3.3.0",
+        "sort-vars": "0.2.0",
+        "space-after-function-name": "0.11.0",
+        "space-after-keywords": "0.6.0",
+        "space-before-blocks": "0.9.0",
+        "space-before-function-paren": "0.18.0",
+        "space-before-function-parentheses": "0.15.0",
+        "space-before-keywords": "1.4.0",
+        "space-in-brackets": "0.4.1",
+        "space-in-parens": "0.8.0",
+        "space-infix-ops": "0.2.0",
+        "space-return-throw-case": "0.1.4",
+        "space-unary-ops": "0.10.0",
+        "space-unary-word-ops": "0.1.4",
+        "spaced-comment": "0.23.0",
+        "spaced-line-comment": "0.9.0",
+        "strict": "0.1.0",
+        "switch-colon-spacing": "4.0.0-beta.0",
+        "symbol-description": "3.4.0",
+        "template-curly-spacing": "2.0.0-rc.0",
+        "template-tag-spacing": "3.15.0",
+        "unicode-bom": "2.11.0",
+        "use-isnan": "0.0.6",
+        "valid-jsdoc": "0.4.0",
+        "valid-typeof": "0.5.0",
+        "vars-on-top": "0.8.0",
+        "wrap-iife": "0.0.9",
+        "wrap-regex": "0.1.0",
+        "yield-star-spacing": "2.0.0-alpha-1",
+        "yoda": "0.7.1"
+    },
+    "removed": {
+        "generator-star": "1.0.0-rc-1",
+        "global-strict": "1.0.0-rc-1",
+        "no-arrow-condition": "2.0.0-beta.3",
+        "no-comma-dangle": "1.0.0-rc-1",
+        "no-empty-class": "1.0.0-rc-1",
+        "no-empty-label": "2.0.0-rc.0",
+        "no-extra-strict": "1.0.0-rc-1",
+        "no-reserved-keys": "1.0.0",
+        "no-space-before-semi": "1.0.0-rc-1",
+        "no-wrap-func": "1.0.0-rc-1",
+        "space-after-function-name": "1.0.0-rc-1",
+        "space-after-keywords": "2.0.0-beta.3",
+        "space-before-function-parentheses": "1.0.0-rc-1",
+        "space-before-keywords": "2.0.0-beta.3",
+        "space-in-brackets": "1.0.0-rc-1",
+        "space-return-throw-case": "2.0.0-beta.3",
+        "space-unary-word-ops": "0.10.0",
+        "spaced-line-comment": "1.0.0-rc-1"
+    }
+}
\ No newline at end of file
diff --git a/eslint/docs/src/_data/rules.json b/eslint/docs/src/_data/rules.json
new file mode 100644 (file)
index 0000000..81e0500
--- /dev/null
@@ -0,0 +1,2105 @@
+{
+    "types": [
+        {
+            "name": "problem",
+            "displayName": "Possible Problems",
+            "description": "These rules relate to possible logic errors in code:",
+            "rules": [
+                {
+                    "name": "array-callback-return",
+                    "description": "Enforce `return` statements in callbacks of array methods",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "constructor-super",
+                    "description": "Require `super()` calls in constructors",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "for-direction",
+                    "description": "Enforce \"for\" loop update clause moving the counter in the right direction.",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "getter-return",
+                    "description": "Enforce `return` statements in getters",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-async-promise-executor",
+                    "description": "Disallow using an async function as a Promise executor",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-await-in-loop",
+                    "description": "Disallow `await` inside of loops",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-class-assign",
+                    "description": "Disallow reassigning class members",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-compare-neg-zero",
+                    "description": "Disallow comparing against -0",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-cond-assign",
+                    "description": "Disallow assignment operators in conditional expressions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-const-assign",
+                    "description": "Disallow reassigning `const` variables",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-constant-binary-expression",
+                    "description": "Disallow expressions where the operation doesn't affect the value",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-constant-condition",
+                    "description": "Disallow constant expressions in conditions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-constructor-return",
+                    "description": "Disallow returning value from constructor",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-control-regex",
+                    "description": "Disallow control characters in regular expressions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-debugger",
+                    "description": "Disallow the use of `debugger`",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-dupe-args",
+                    "description": "Disallow duplicate arguments in `function` definitions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-dupe-class-members",
+                    "description": "Disallow duplicate class members",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-dupe-else-if",
+                    "description": "Disallow duplicate conditions in if-else-if chains",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-dupe-keys",
+                    "description": "Disallow duplicate keys in object literals",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-duplicate-case",
+                    "description": "Disallow duplicate case labels",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-duplicate-imports",
+                    "description": "Disallow duplicate module imports",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-empty-character-class",
+                    "description": "Disallow empty character classes in regular expressions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-empty-pattern",
+                    "description": "Disallow empty destructuring patterns",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-ex-assign",
+                    "description": "Disallow reassigning exceptions in `catch` clauses",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-fallthrough",
+                    "description": "Disallow fallthrough of `case` statements",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-func-assign",
+                    "description": "Disallow reassigning `function` declarations",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-import-assign",
+                    "description": "Disallow assigning to imported bindings",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-inner-declarations",
+                    "description": "Disallow variable or `function` declarations in nested blocks",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-invalid-regexp",
+                    "description": "Disallow invalid regular expression strings in `RegExp` constructors",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-irregular-whitespace",
+                    "description": "Disallow irregular whitespace",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-loss-of-precision",
+                    "description": "Disallow literal numbers that lose precision",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-misleading-character-class",
+                    "description": "Disallow characters which are made with multiple code points in character class syntax",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "no-new-symbol",
+                    "description": "Disallow `new` operators with the `Symbol` object",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-obj-calls",
+                    "description": "Disallow calling global object properties as functions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-promise-executor-return",
+                    "description": "Disallow returning values from Promise executor functions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-prototype-builtins",
+                    "description": "Disallow calling some `Object.prototype` methods directly on objects",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-self-assign",
+                    "description": "Disallow assignments where both sides are exactly the same",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-self-compare",
+                    "description": "Disallow comparisons where both sides are exactly the same",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-setter-return",
+                    "description": "Disallow returning values from setters",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-sparse-arrays",
+                    "description": "Disallow sparse arrays",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-template-curly-in-string",
+                    "description": "Disallow template literal placeholder syntax in regular strings",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-this-before-super",
+                    "description": "Disallow `this`/`super` before calling `super()` in constructors",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-undef",
+                    "description": "Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unexpected-multiline",
+                    "description": "Disallow confusing multiline expressions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unmodified-loop-condition",
+                    "description": "Disallow unmodified loop conditions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unreachable",
+                    "description": "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unreachable-loop",
+                    "description": "Disallow loops with a body that allows only one iteration",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unsafe-finally",
+                    "description": "Disallow control flow statements in `finally` blocks",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unsafe-negation",
+                    "description": "Disallow negating the left operand of relational operators",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "no-unsafe-optional-chaining",
+                    "description": "Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unused-private-class-members",
+                    "description": "Disallow unused private class members",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unused-vars",
+                    "description": "Disallow unused variables",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-use-before-define",
+                    "description": "Disallow the use of variables before they are defined",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-backreference",
+                    "description": "Disallow useless backreferences in regular expressions",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "require-atomic-updates",
+                    "description": "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "use-isnan",
+                    "description": "Require calls to `isNaN()` when checking for `NaN`",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "valid-typeof",
+                    "description": "Enforce comparing `typeof` expressions against valid strings",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": true
+                }
+            ]
+        },
+        {
+            "name": "suggestion",
+            "displayName": "Suggestions",
+            "description": "These rules suggest alternate ways of doing things:",
+            "rules": [
+                {
+                    "name": "accessor-pairs",
+                    "description": "Enforce getter and setter pairs in objects and classes",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "arrow-body-style",
+                    "description": "Require braces around arrow function bodies",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "block-scoped-var",
+                    "description": "Enforce the use of variables within the scope they are defined",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "camelcase",
+                    "description": "Enforce camelcase naming convention",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "capitalized-comments",
+                    "description": "Enforce or disallow capitalization of the first letter of a comment",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "class-methods-use-this",
+                    "description": "Enforce that class methods utilize `this`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "complexity",
+                    "description": "Enforce a maximum cyclomatic complexity allowed in a program",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "consistent-return",
+                    "description": "Require `return` statements to either always or never specify values",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "consistent-this",
+                    "description": "Enforce consistent naming when capturing the current execution context",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "curly",
+                    "description": "Enforce consistent brace style for all control statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "default-case",
+                    "description": "Require `default` cases in `switch` statements",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "default-case-last",
+                    "description": "Enforce default clauses in switch statements to be last",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "default-param-last",
+                    "description": "Enforce default parameters to be last",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "dot-notation",
+                    "description": "Enforce dot notation whenever possible",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "eqeqeq",
+                    "description": "Require the use of `===` and `!==`",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "func-name-matching",
+                    "description": "Require function names to match the name of the variable or property to which they are assigned",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "func-names",
+                    "description": "Require or disallow named `function` expressions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "func-style",
+                    "description": "Enforce the consistent use of either `function` declarations or expressions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "grouped-accessor-pairs",
+                    "description": "Require grouped accessor pairs in object literals and classes",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "guard-for-in",
+                    "description": "Require `for-in` loops to include an `if` statement",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "id-denylist",
+                    "description": "Disallow specified identifiers",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "id-length",
+                    "description": "Enforce minimum and maximum identifier lengths",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "id-match",
+                    "description": "Require identifiers to match a specified regular expression",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "init-declarations",
+                    "description": "Require or disallow initialization in variable declarations",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-classes-per-file",
+                    "description": "Enforce a maximum number of classes per file",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-depth",
+                    "description": "Enforce a maximum depth that blocks can be nested",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-lines",
+                    "description": "Enforce a maximum number of lines per file",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-lines-per-function",
+                    "description": "Enforce a maximum number of lines of code in a function",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-nested-callbacks",
+                    "description": "Enforce a maximum depth that callbacks can be nested",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-params",
+                    "description": "Enforce a maximum number of parameters in function definitions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-statements",
+                    "description": "Enforce a maximum number of statements allowed in function blocks",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "multiline-comment-style",
+                    "description": "Enforce a particular style for multiline comments",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "new-cap",
+                    "description": "Require constructor names to begin with a capital letter",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-alert",
+                    "description": "Disallow the use of `alert`, `confirm`, and `prompt`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-array-constructor",
+                    "description": "Disallow `Array` constructors",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-bitwise",
+                    "description": "Disallow bitwise operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-caller",
+                    "description": "Disallow the use of `arguments.caller` or `arguments.callee`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-case-declarations",
+                    "description": "Disallow lexical declarations in case clauses",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-confusing-arrow",
+                    "description": "Disallow arrow functions where they could be confused with comparisons",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-console",
+                    "description": "Disallow the use of `console`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-continue",
+                    "description": "Disallow `continue` statements",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-delete-var",
+                    "description": "Disallow deleting variables",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-div-regex",
+                    "description": "Disallow division operators explicitly at the beginning of regular expressions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-else-return",
+                    "description": "Disallow `else` blocks after `return` statements in `if` statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-empty",
+                    "description": "Disallow empty block statements",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-empty-function",
+                    "description": "Disallow empty functions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-eq-null",
+                    "description": "Disallow `null` comparisons without type-checking operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-eval",
+                    "description": "Disallow the use of `eval()`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extend-native",
+                    "description": "Disallow extending native types",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extra-bind",
+                    "description": "Disallow unnecessary calls to `.bind()`",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extra-boolean-cast",
+                    "description": "Disallow unnecessary boolean casts",
+                    "recommended": true,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extra-label",
+                    "description": "Disallow unnecessary labels",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extra-semi",
+                    "description": "Disallow unnecessary semicolons",
+                    "recommended": true,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-floating-decimal",
+                    "description": "Disallow leading or trailing decimal points in numeric literals",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-global-assign",
+                    "description": "Disallow assignments to native objects or read-only global variables",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-implicit-coercion",
+                    "description": "Disallow shorthand type conversions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-implicit-globals",
+                    "description": "Disallow declarations in the global scope",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-implied-eval",
+                    "description": "Disallow the use of `eval()`-like methods",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-inline-comments",
+                    "description": "Disallow inline comments after code",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-invalid-this",
+                    "description": "Disallow use of `this` in contexts where the value of `this` is `undefined`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-iterator",
+                    "description": "Disallow the use of the `__iterator__` property",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-label-var",
+                    "description": "Disallow labels that share a name with a variable",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-labels",
+                    "description": "Disallow labeled statements",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-lone-blocks",
+                    "description": "Disallow unnecessary nested blocks",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-lonely-if",
+                    "description": "Disallow `if` statements as the only statement in `else` blocks",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-loop-func",
+                    "description": "Disallow function declarations that contain unsafe references inside loop statements",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-magic-numbers",
+                    "description": "Disallow magic numbers",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-mixed-operators",
+                    "description": "Disallow mixed binary operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-multi-assign",
+                    "description": "Disallow use of chained assignment expressions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-multi-str",
+                    "description": "Disallow multiline strings",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-negated-condition",
+                    "description": "Disallow negated conditions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-nested-ternary",
+                    "description": "Disallow nested ternary expressions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-new",
+                    "description": "Disallow `new` operators outside of assignments or comparisons",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-new-func",
+                    "description": "Disallow `new` operators with the `Function` object",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-new-object",
+                    "description": "Disallow `Object` constructors",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-new-wrappers",
+                    "description": "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-nonoctal-decimal-escape",
+                    "description": "Disallow `\\8` and `\\9` escape sequences in string literals",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "no-octal",
+                    "description": "Disallow octal literals",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-octal-escape",
+                    "description": "Disallow octal escape sequences in string literals",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-param-reassign",
+                    "description": "Disallow reassigning `function` parameters",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-plusplus",
+                    "description": "Disallow the unary operators `++` and `--`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-proto",
+                    "description": "Disallow the use of the `__proto__` property",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-redeclare",
+                    "description": "Disallow variable redeclaration",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-regex-spaces",
+                    "description": "Disallow multiple spaces in regular expressions",
+                    "recommended": true,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-restricted-exports",
+                    "description": "Disallow specified names in exports",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-restricted-globals",
+                    "description": "Disallow specified global variables",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-restricted-imports",
+                    "description": "Disallow specified modules when loaded by `import`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-restricted-properties",
+                    "description": "Disallow certain properties on certain objects",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-restricted-syntax",
+                    "description": "Disallow specified syntax",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-return-assign",
+                    "description": "Disallow assignment operators in `return` statements",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-return-await",
+                    "description": "Disallow unnecessary `return await`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-script-url",
+                    "description": "Disallow `javascript:` urls",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-sequences",
+                    "description": "Disallow comma operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-shadow",
+                    "description": "Disallow variable declarations from shadowing variables declared in the outer scope",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-shadow-restricted-names",
+                    "description": "Disallow identifiers from shadowing restricted names",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-ternary",
+                    "description": "Disallow ternary operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-throw-literal",
+                    "description": "Disallow throwing literals as exceptions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-undef-init",
+                    "description": "Disallow initializing variables to `undefined`",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-undefined",
+                    "description": "Disallow the use of `undefined` as an identifier",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-underscore-dangle",
+                    "description": "Disallow dangling underscores in identifiers",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unneeded-ternary",
+                    "description": "Disallow ternary operators when simpler alternatives exist",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unused-expressions",
+                    "description": "Disallow unused expressions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-unused-labels",
+                    "description": "Disallow unused labels",
+                    "recommended": true,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-call",
+                    "description": "Disallow unnecessary calls to `.call()` and `.apply()`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-catch",
+                    "description": "Disallow unnecessary `catch` clauses",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-computed-key",
+                    "description": "Disallow unnecessary computed property keys in objects and classes",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-concat",
+                    "description": "Disallow unnecessary concatenation of literals or template literals",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-constructor",
+                    "description": "Disallow unnecessary constructors",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-escape",
+                    "description": "Disallow unnecessary escape characters",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "no-useless-rename",
+                    "description": "Disallow renaming import, export, and destructured assignments to the same name",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-useless-return",
+                    "description": "Disallow redundant return statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-var",
+                    "description": "Require `let` or `const` instead of `var`",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-void",
+                    "description": "Disallow `void` operators",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-warning-comments",
+                    "description": "Disallow specified warning terms in comments",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-with",
+                    "description": "Disallow `with` statements",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "object-shorthand",
+                    "description": "Require or disallow method and property shorthand syntax for object literals",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "one-var",
+                    "description": "Enforce variables to be declared either together or separately in functions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "one-var-declaration-per-line",
+                    "description": "Require or disallow newlines around variable declarations",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "operator-assignment",
+                    "description": "Require or disallow assignment operator shorthand where possible",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-arrow-callback",
+                    "description": "Require using arrow functions for callbacks",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-const",
+                    "description": "Require `const` declarations for variables that are never reassigned after declared",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-destructuring",
+                    "description": "Require destructuring from arrays and/or objects",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-exponentiation-operator",
+                    "description": "Disallow the use of `Math.pow` in favor of the `**` operator",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-named-capture-group",
+                    "description": "Enforce using named capture group in regular expression",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-numeric-literals",
+                    "description": "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-object-has-own",
+                    "description": "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-object-spread",
+                    "description": "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-promise-reject-errors",
+                    "description": "Require using Error objects as Promise rejection reasons",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-regex-literals",
+                    "description": "Disallow use of the `RegExp` constructor in favor of regular expression literals",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "prefer-rest-params",
+                    "description": "Require rest parameters instead of `arguments`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-spread",
+                    "description": "Require spread operators instead of `.apply()`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "prefer-template",
+                    "description": "Require template literals instead of string concatenation",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "quote-props",
+                    "description": "Require quotes around object literal property names",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "radix",
+                    "description": "Enforce the consistent use of the radix argument when using `parseInt()`",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": true
+                },
+                {
+                    "name": "require-await",
+                    "description": "Disallow async functions which have no `await` expression",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "require-unicode-regexp",
+                    "description": "Enforce the use of `u` flag on RegExp",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "require-yield",
+                    "description": "Require generator functions to contain `yield`",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "sort-imports",
+                    "description": "Enforce sorted import declarations within modules",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "sort-keys",
+                    "description": "Require object keys to be sorted",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "sort-vars",
+                    "description": "Require variables within the same declaration block to be sorted",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "spaced-comment",
+                    "description": "Enforce consistent spacing after the `//` or `/*` in a comment",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "strict",
+                    "description": "Require or disallow strict mode directives",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "symbol-description",
+                    "description": "Require symbol descriptions",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "vars-on-top",
+                    "description": "Require `var` declarations be placed at the top of their containing scope",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "yoda",
+                    "description": "Require or disallow \"Yoda\" conditions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                }
+            ]
+        },
+        {
+            "name": "layout",
+            "displayName": "Layout & Formatting",
+            "description": "These rules care about how the code looks rather than how it executes:",
+            "rules": [
+                {
+                    "name": "array-bracket-newline",
+                    "description": "Enforce linebreaks after opening and before closing array brackets",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "array-bracket-spacing",
+                    "description": "Enforce consistent spacing inside array brackets",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "array-element-newline",
+                    "description": "Enforce line breaks after each array element",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "arrow-parens",
+                    "description": "Require parentheses around arrow function arguments",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "arrow-spacing",
+                    "description": "Enforce consistent spacing before and after the arrow in arrow functions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "block-spacing",
+                    "description": "Disallow or enforce spaces inside of blocks after opening block and before closing block",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "brace-style",
+                    "description": "Enforce consistent brace style for blocks",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "comma-dangle",
+                    "description": "Require or disallow trailing commas",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "comma-spacing",
+                    "description": "Enforce consistent spacing before and after commas",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "comma-style",
+                    "description": "Enforce consistent comma style",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "computed-property-spacing",
+                    "description": "Enforce consistent spacing inside computed property brackets",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "dot-location",
+                    "description": "Enforce consistent newlines before and after dots",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "eol-last",
+                    "description": "Require or disallow newline at the end of files",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "func-call-spacing",
+                    "description": "Require or disallow spacing between function identifiers and their invocations",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "function-call-argument-newline",
+                    "description": "Enforce line breaks between arguments of a function call",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "function-paren-newline",
+                    "description": "Enforce consistent line breaks inside function parentheses",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "generator-star-spacing",
+                    "description": "Enforce consistent spacing around `*` operators in generator functions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "implicit-arrow-linebreak",
+                    "description": "Enforce the location of arrow function bodies",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "indent",
+                    "description": "Enforce consistent indentation",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "jsx-quotes",
+                    "description": "Enforce the consistent use of either double or single quotes in JSX attributes",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "key-spacing",
+                    "description": "Enforce consistent spacing between keys and values in object literal properties",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "keyword-spacing",
+                    "description": "Enforce consistent spacing before and after keywords",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "line-comment-position",
+                    "description": "Enforce position of line comments",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "linebreak-style",
+                    "description": "Enforce consistent linebreak style",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "lines-around-comment",
+                    "description": "Require empty lines around comments",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "lines-between-class-members",
+                    "description": "Require or disallow an empty line between class members",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-len",
+                    "description": "Enforce a maximum line length",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "max-statements-per-line",
+                    "description": "Enforce a maximum number of statements allowed per line",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "multiline-ternary",
+                    "description": "Enforce newlines between operands of ternary expressions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "new-parens",
+                    "description": "Enforce or disallow parentheses when invoking a constructor with no arguments",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "newline-per-chained-call",
+                    "description": "Require a newline after each call in a method chain",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-extra-parens",
+                    "description": "Disallow unnecessary parentheses",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-mixed-spaces-and-tabs",
+                    "description": "Disallow mixed spaces and tabs for indentation",
+                    "recommended": true,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-multi-spaces",
+                    "description": "Disallow multiple spaces",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-multiple-empty-lines",
+                    "description": "Disallow multiple empty lines",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-tabs",
+                    "description": "Disallow all tabs",
+                    "recommended": false,
+                    "fixable": false,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-trailing-spaces",
+                    "description": "Disallow trailing whitespace at the end of lines",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "no-whitespace-before-property",
+                    "description": "Disallow whitespace before properties",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "nonblock-statement-body-position",
+                    "description": "Enforce the location of single-line statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "object-curly-newline",
+                    "description": "Enforce consistent line breaks after opening and before closing braces",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "object-curly-spacing",
+                    "description": "Enforce consistent spacing inside braces",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "object-property-newline",
+                    "description": "Enforce placing object properties on separate lines",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "operator-linebreak",
+                    "description": "Enforce consistent linebreak style for operators",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "padded-blocks",
+                    "description": "Require or disallow padding within blocks",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "padding-line-between-statements",
+                    "description": "Require or disallow padding lines between statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "quotes",
+                    "description": "Enforce the consistent use of either backticks, double, or single quotes",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "rest-spread-spacing",
+                    "description": "Enforce spacing between rest and spread operators and their expressions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "semi",
+                    "description": "Require or disallow semicolons instead of ASI",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "semi-spacing",
+                    "description": "Enforce consistent spacing before and after semicolons",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "semi-style",
+                    "description": "Enforce location of semicolons",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "space-before-blocks",
+                    "description": "Enforce consistent spacing before blocks",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "space-before-function-paren",
+                    "description": "Enforce consistent spacing before `function` definition opening parenthesis",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "space-in-parens",
+                    "description": "Enforce consistent spacing inside parentheses",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "space-infix-ops",
+                    "description": "Require spacing around infix operators",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "space-unary-ops",
+                    "description": "Enforce consistent spacing before or after unary operators",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "switch-colon-spacing",
+                    "description": "Enforce spacing around colons of switch statements",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "template-curly-spacing",
+                    "description": "Require or disallow spacing around embedded expressions of template strings",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "template-tag-spacing",
+                    "description": "Require or disallow spacing between template tags and their literals",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "unicode-bom",
+                    "description": "Require or disallow Unicode byte order mark (BOM)",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "wrap-iife",
+                    "description": "Require parentheses around immediate `function` invocations",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "wrap-regex",
+                    "description": "Require parenthesis around regex literals",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                },
+                {
+                    "name": "yield-star-spacing",
+                    "description": "Require or disallow spacing around the `*` in `yield*` expressions",
+                    "recommended": false,
+                    "fixable": true,
+                    "hasSuggestions": false
+                }
+            ]
+        }
+    ],
+    "deprecated": {
+        "name": "Deprecated",
+        "description": "These rules have been deprecated in accordance with the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a>, and replaced by newer rules:",
+        "rules": [
+            {
+                "name": "callback-return",
+                "replacedBy": []
+            },
+            {
+                "name": "global-require",
+                "replacedBy": []
+            },
+            {
+                "name": "handle-callback-err",
+                "replacedBy": []
+            },
+            {
+                "name": "id-blacklist",
+                "replacedBy": [
+                    "id-denylist"
+                ]
+            },
+            {
+                "name": "indent-legacy",
+                "replacedBy": [
+                    "indent"
+                ]
+            },
+            {
+                "name": "lines-around-directive",
+                "replacedBy": [
+                    "padding-line-between-statements"
+                ]
+            },
+            {
+                "name": "newline-after-var",
+                "replacedBy": [
+                    "padding-line-between-statements"
+                ]
+            },
+            {
+                "name": "newline-before-return",
+                "replacedBy": [
+                    "padding-line-between-statements"
+                ]
+            },
+            {
+                "name": "no-buffer-constructor",
+                "replacedBy": []
+            },
+            {
+                "name": "no-catch-shadow",
+                "replacedBy": [
+                    "no-shadow"
+                ]
+            },
+            {
+                "name": "no-mixed-requires",
+                "replacedBy": []
+            },
+            {
+                "name": "no-native-reassign",
+                "replacedBy": [
+                    "no-global-assign"
+                ]
+            },
+            {
+                "name": "no-negated-in-lhs",
+                "replacedBy": [
+                    "no-unsafe-negation"
+                ]
+            },
+            {
+                "name": "no-new-require",
+                "replacedBy": []
+            },
+            {
+                "name": "no-path-concat",
+                "replacedBy": []
+            },
+            {
+                "name": "no-process-env",
+                "replacedBy": []
+            },
+            {
+                "name": "no-process-exit",
+                "replacedBy": []
+            },
+            {
+                "name": "no-restricted-modules",
+                "replacedBy": []
+            },
+            {
+                "name": "no-spaced-func",
+                "replacedBy": [
+                    "func-call-spacing"
+                ]
+            },
+            {
+                "name": "no-sync",
+                "replacedBy": []
+            },
+            {
+                "name": "prefer-reflect",
+                "replacedBy": []
+            },
+            {
+                "name": "require-jsdoc",
+                "replacedBy": []
+            },
+            {
+                "name": "valid-jsdoc",
+                "replacedBy": []
+            }
+        ]
+    },
+    "removed": {
+        "name": "Removed",
+        "description": "These rules from older versions of ESLint (before the <a href=\"/docs/user-guide/rule-deprecation\">deprecation policy</a> existed) have been replaced by newer rules:",
+        "rules": [
+            {
+                "removed": "generator-star",
+                "replacedBy": [
+                    "generator-star-spacing"
+                ]
+            },
+            {
+                "removed": "global-strict",
+                "replacedBy": [
+                    "strict"
+                ]
+            },
+            {
+                "removed": "no-arrow-condition",
+                "replacedBy": [
+                    "no-confusing-arrow",
+                    "no-constant-condition"
+                ]
+            },
+            {
+                "removed": "no-comma-dangle",
+                "replacedBy": [
+                    "comma-dangle"
+                ]
+            },
+            {
+                "removed": "no-empty-class",
+                "replacedBy": [
+                    "no-empty-character-class"
+                ]
+            },
+            {
+                "removed": "no-empty-label",
+                "replacedBy": [
+                    "no-labels"
+                ]
+            },
+            {
+                "removed": "no-extra-strict",
+                "replacedBy": [
+                    "strict"
+                ]
+            },
+            {
+                "removed": "no-reserved-keys",
+                "replacedBy": [
+                    "quote-props"
+                ]
+            },
+            {
+                "removed": "no-space-before-semi",
+                "replacedBy": [
+                    "semi-spacing"
+                ]
+            },
+            {
+                "removed": "no-wrap-func",
+                "replacedBy": [
+                    "no-extra-parens"
+                ]
+            },
+            {
+                "removed": "space-after-function-name",
+                "replacedBy": [
+                    "space-before-function-paren"
+                ]
+            },
+            {
+                "removed": "space-after-keywords",
+                "replacedBy": [
+                    "keyword-spacing"
+                ]
+            },
+            {
+                "removed": "space-before-function-parentheses",
+                "replacedBy": [
+                    "space-before-function-paren"
+                ]
+            },
+            {
+                "removed": "space-before-keywords",
+                "replacedBy": [
+                    "keyword-spacing"
+                ]
+            },
+            {
+                "removed": "space-in-brackets",
+                "replacedBy": [
+                    "object-curly-spacing",
+                    "array-bracket-spacing"
+                ]
+            },
+            {
+                "removed": "space-return-throw-case",
+                "replacedBy": [
+                    "keyword-spacing"
+                ]
+            },
+            {
+                "removed": "space-unary-word-ops",
+                "replacedBy": [
+                    "space-unary-ops"
+                ]
+            },
+            {
+                "removed": "spaced-line-comment",
+                "replacedBy": [
+                    "spaced-comment"
+                ]
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/eslint/docs/src/_data/rules_meta.json b/eslint/docs/src/_data/rules_meta.json
new file mode 100644 (file)
index 0000000..56a9862
--- /dev/null
@@ -0,0 +1,2487 @@
+{
+    "accessor-pairs": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce getter and setter pairs in objects and classes",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/accessor-pairs"
+        }
+    },
+    "array-bracket-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce linebreaks after opening and before closing array brackets",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/array-bracket-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "array-bracket-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing inside array brackets",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/array-bracket-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "array-callback-return": {
+        "type": "problem",
+        "docs": {
+            "description": "Enforce `return` statements in callbacks of array methods",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/array-callback-return"
+        }
+    },
+    "array-element-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce line breaks after each array element",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/array-element-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "arrow-body-style": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require braces around arrow function bodies",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/arrow-body-style"
+        },
+        "fixable": "code"
+    },
+    "arrow-parens": {
+        "type": "layout",
+        "docs": {
+            "description": "Require parentheses around arrow function arguments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/arrow-parens"
+        },
+        "fixable": "code"
+    },
+    "arrow-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before and after the arrow in arrow functions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/arrow-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "block-scoped-var": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce the use of variables within the scope they are defined",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/block-scoped-var"
+        }
+    },
+    "block-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow or enforce spaces inside of blocks after opening block and before closing block",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/block-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "brace-style": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent brace style for blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/brace-style"
+        },
+        "fixable": "whitespace"
+    },
+    "callback-return": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `return` statements after callbacks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/callback-return"
+        }
+    },
+    "camelcase": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce camelcase naming convention",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/camelcase"
+        }
+    },
+    "capitalized-comments": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce or disallow capitalization of the first letter of a comment",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/capitalized-comments"
+        },
+        "fixable": "code"
+    },
+    "class-methods-use-this": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce that class methods utilize `this`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/class-methods-use-this"
+        }
+    },
+    "comma-dangle": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow trailing commas",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/comma-dangle"
+        },
+        "fixable": "code"
+    },
+    "comma-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before and after commas",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/comma-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "comma-style": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent comma style",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/comma-style"
+        },
+        "fixable": "code"
+    },
+    "complexity": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum cyclomatic complexity allowed in a program",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/complexity"
+        }
+    },
+    "computed-property-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing inside computed property brackets",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/computed-property-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "consistent-return": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `return` statements to either always or never specify values",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/consistent-return"
+        }
+    },
+    "consistent-this": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce consistent naming when capturing the current execution context",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/consistent-this"
+        }
+    },
+    "constructor-super": {
+        "type": "problem",
+        "docs": {
+            "description": "Require `super()` calls in constructors",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/constructor-super"
+        }
+    },
+    "curly": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce consistent brace style for all control statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/curly"
+        },
+        "fixable": "code"
+    },
+    "default-case": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `default` cases in `switch` statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/default-case"
+        }
+    },
+    "default-case-last": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce default clauses in switch statements to be last",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/default-case-last"
+        }
+    },
+    "default-param-last": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce default parameters to be last",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/default-param-last"
+        }
+    },
+    "dot-location": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent newlines before and after dots",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/dot-location"
+        },
+        "fixable": "code"
+    },
+    "dot-notation": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce dot notation whenever possible",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/dot-notation"
+        },
+        "fixable": "code"
+    },
+    "eol-last": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow newline at the end of files",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/eol-last"
+        },
+        "fixable": "whitespace"
+    },
+    "eqeqeq": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require the use of `===` and `!==`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/eqeqeq"
+        },
+        "fixable": "code"
+    },
+    "for-direction": {
+        "type": "problem",
+        "docs": {
+            "description": "Enforce \"for\" loop update clause moving the counter in the right direction.",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/for-direction"
+        },
+        "fixable": null
+    },
+    "func-call-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow spacing between function identifiers and their invocations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/func-call-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "func-name-matching": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require function names to match the name of the variable or property to which they are assigned",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/func-name-matching"
+        }
+    },
+    "func-names": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow named `function` expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/func-names"
+        }
+    },
+    "func-style": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce the consistent use of either `function` declarations or expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/func-style"
+        }
+    },
+    "function-call-argument-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce line breaks between arguments of a function call",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/function-call-argument-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "function-paren-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent line breaks inside function parentheses",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/function-paren-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "generator-star-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing around `*` operators in generator functions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/generator-star-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "getter-return": {
+        "type": "problem",
+        "docs": {
+            "description": "Enforce `return` statements in getters",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/getter-return"
+        },
+        "fixable": null
+    },
+    "global-require": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `require()` calls to be placed at top-level module scope",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/global-require"
+        }
+    },
+    "grouped-accessor-pairs": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require grouped accessor pairs in object literals and classes",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/grouped-accessor-pairs"
+        }
+    },
+    "guard-for-in": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `for-in` loops to include an `if` statement",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/guard-for-in"
+        }
+    },
+    "handle-callback-err": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Require error handling in callbacks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/handle-callback-err"
+        }
+    },
+    "id-blacklist": {
+        "deprecated": true,
+        "replacedBy": [
+            "id-denylist"
+        ],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified identifiers",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/id-blacklist"
+        }
+    },
+    "id-denylist": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified identifiers",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/id-denylist"
+        }
+    },
+    "id-length": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce minimum and maximum identifier lengths",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/id-length"
+        }
+    },
+    "id-match": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require identifiers to match a specified regular expression",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/id-match"
+        }
+    },
+    "implicit-arrow-linebreak": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce the location of arrow function bodies",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/implicit-arrow-linebreak"
+        },
+        "fixable": "whitespace"
+    },
+    "indent": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent indentation",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/indent"
+        },
+        "fixable": "whitespace"
+    },
+    "indent-legacy": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent indentation",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/indent-legacy"
+        },
+        "deprecated": true,
+        "replacedBy": [
+            "indent"
+        ],
+        "fixable": "whitespace"
+    },
+    "init-declarations": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow initialization in variable declarations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/init-declarations"
+        }
+    },
+    "jsx-quotes": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce the consistent use of either double or single quotes in JSX attributes",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/jsx-quotes"
+        },
+        "fixable": "whitespace"
+    },
+    "key-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing between keys and values in object literal properties",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/key-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "keyword-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before and after keywords",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/keyword-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "line-comment-position": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce position of line comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/line-comment-position"
+        }
+    },
+    "linebreak-style": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent linebreak style",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/linebreak-style"
+        },
+        "fixable": "whitespace"
+    },
+    "lines-around-comment": {
+        "type": "layout",
+        "docs": {
+            "description": "Require empty lines around comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/lines-around-comment"
+        },
+        "fixable": "whitespace"
+    },
+    "lines-around-directive": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow newlines around directives",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/lines-around-directive"
+        },
+        "fixable": "whitespace",
+        "deprecated": true,
+        "replacedBy": [
+            "padding-line-between-statements"
+        ]
+    },
+    "lines-between-class-members": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow an empty line between class members",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/lines-between-class-members"
+        },
+        "fixable": "whitespace"
+    },
+    "max-classes-per-file": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum number of classes per file",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-classes-per-file"
+        }
+    },
+    "max-depth": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum depth that blocks can be nested",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-depth"
+        }
+    },
+    "max-len": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce a maximum line length",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-len"
+        }
+    },
+    "max-lines": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum number of lines per file",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-lines"
+        }
+    },
+    "max-lines-per-function": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum number of lines of code in a function",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-lines-per-function"
+        }
+    },
+    "max-nested-callbacks": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum depth that callbacks can be nested",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-nested-callbacks"
+        }
+    },
+    "max-params": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum number of parameters in function definitions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-params"
+        }
+    },
+    "max-statements": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a maximum number of statements allowed in function blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-statements"
+        }
+    },
+    "max-statements-per-line": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce a maximum number of statements allowed per line",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/max-statements-per-line"
+        }
+    },
+    "multiline-comment-style": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce a particular style for multiline comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/multiline-comment-style"
+        },
+        "fixable": "whitespace"
+    },
+    "multiline-ternary": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce newlines between operands of ternary expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/multiline-ternary"
+        },
+        "fixable": "whitespace"
+    },
+    "new-cap": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require constructor names to begin with a capital letter",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/new-cap"
+        }
+    },
+    "new-parens": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce or disallow parentheses when invoking a constructor with no arguments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/new-parens"
+        },
+        "fixable": "code"
+    },
+    "newline-after-var": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow an empty line after variable declarations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/newline-after-var"
+        },
+        "fixable": "whitespace",
+        "deprecated": true,
+        "replacedBy": [
+            "padding-line-between-statements"
+        ]
+    },
+    "newline-before-return": {
+        "type": "layout",
+        "docs": {
+            "description": "Require an empty line before `return` statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/newline-before-return"
+        },
+        "fixable": "whitespace",
+        "deprecated": true,
+        "replacedBy": [
+            "padding-line-between-statements"
+        ]
+    },
+    "newline-per-chained-call": {
+        "type": "layout",
+        "docs": {
+            "description": "Require a newline after each call in a method chain",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/newline-per-chained-call"
+        },
+        "fixable": "whitespace"
+    },
+    "no-alert": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `alert`, `confirm`, and `prompt`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-alert"
+        }
+    },
+    "no-array-constructor": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `Array` constructors",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-array-constructor"
+        }
+    },
+    "no-async-promise-executor": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow using an async function as a Promise executor",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-async-promise-executor"
+        },
+        "fixable": null
+    },
+    "no-await-in-loop": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow `await` inside of loops",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-await-in-loop"
+        }
+    },
+    "no-bitwise": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow bitwise operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-bitwise"
+        }
+    },
+    "no-buffer-constructor": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "problem",
+        "docs": {
+            "description": "Disallow use of the `Buffer()` constructor",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-buffer-constructor"
+        }
+    },
+    "no-caller": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `arguments.caller` or `arguments.callee`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-caller"
+        }
+    },
+    "no-case-declarations": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow lexical declarations in case clauses",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-case-declarations"
+        }
+    },
+    "no-catch-shadow": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `catch` clause parameters from shadowing variables in the outer scope",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-catch-shadow"
+        },
+        "replacedBy": [
+            "no-shadow"
+        ],
+        "deprecated": true
+    },
+    "no-class-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow reassigning class members",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-class-assign"
+        }
+    },
+    "no-compare-neg-zero": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow comparing against -0",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-compare-neg-zero"
+        },
+        "fixable": null
+    },
+    "no-cond-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow assignment operators in conditional expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-cond-assign"
+        }
+    },
+    "no-confusing-arrow": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow arrow functions where they could be confused with comparisons",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-confusing-arrow"
+        },
+        "fixable": "code"
+    },
+    "no-console": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `console`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-console"
+        }
+    },
+    "no-const-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow reassigning `const` variables",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-const-assign"
+        }
+    },
+    "no-constant-binary-expression": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow expressions where the operation doesn't affect the value",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-constant-binary-expression"
+        }
+    },
+    "no-constant-condition": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow constant expressions in conditions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-constant-condition"
+        }
+    },
+    "no-constructor-return": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow returning value from constructor",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-constructor-return"
+        },
+        "fixable": null
+    },
+    "no-continue": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `continue` statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-continue"
+        }
+    },
+    "no-control-regex": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow control characters in regular expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-control-regex"
+        }
+    },
+    "no-debugger": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow the use of `debugger`",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-debugger"
+        },
+        "fixable": null
+    },
+    "no-delete-var": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow deleting variables",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-delete-var"
+        }
+    },
+    "no-div-regex": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow division operators explicitly at the beginning of regular expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-div-regex"
+        },
+        "fixable": "code"
+    },
+    "no-dupe-args": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate arguments in `function` definitions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-dupe-args"
+        }
+    },
+    "no-dupe-class-members": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate class members",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-dupe-class-members"
+        }
+    },
+    "no-dupe-else-if": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate conditions in if-else-if chains",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-dupe-else-if"
+        }
+    },
+    "no-dupe-keys": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate keys in object literals",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-dupe-keys"
+        }
+    },
+    "no-duplicate-case": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate case labels",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-duplicate-case"
+        }
+    },
+    "no-duplicate-imports": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow duplicate module imports",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-duplicate-imports"
+        }
+    },
+    "no-else-return": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `else` blocks after `return` statements in `if` statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-else-return"
+        },
+        "fixable": "code"
+    },
+    "no-empty": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow empty block statements",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-empty"
+        }
+    },
+    "no-empty-character-class": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow empty character classes in regular expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-empty-character-class"
+        }
+    },
+    "no-empty-function": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow empty functions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-empty-function"
+        }
+    },
+    "no-empty-pattern": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow empty destructuring patterns",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-empty-pattern"
+        }
+    },
+    "no-eq-null": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `null` comparisons without type-checking operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-eq-null"
+        }
+    },
+    "no-eval": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `eval()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-eval"
+        }
+    },
+    "no-ex-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow reassigning exceptions in `catch` clauses",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-ex-assign"
+        }
+    },
+    "no-extend-native": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow extending native types",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-extend-native"
+        }
+    },
+    "no-extra-bind": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary calls to `.bind()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-extra-bind"
+        },
+        "fixable": "code"
+    },
+    "no-extra-boolean-cast": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary boolean casts",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-extra-boolean-cast"
+        },
+        "fixable": "code"
+    },
+    "no-extra-label": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary labels",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-extra-label"
+        },
+        "fixable": "code"
+    },
+    "no-extra-parens": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow unnecessary parentheses",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-extra-parens"
+        },
+        "fixable": "code"
+    },
+    "no-extra-semi": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary semicolons",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-extra-semi"
+        },
+        "fixable": "code"
+    },
+    "no-fallthrough": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow fallthrough of `case` statements",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-fallthrough"
+        }
+    },
+    "no-floating-decimal": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow leading or trailing decimal points in numeric literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-floating-decimal"
+        },
+        "fixable": "code"
+    },
+    "no-func-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow reassigning `function` declarations",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-func-assign"
+        }
+    },
+    "no-global-assign": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow assignments to native objects or read-only global variables",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-global-assign"
+        }
+    },
+    "no-implicit-coercion": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow shorthand type conversions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-implicit-coercion"
+        },
+        "fixable": "code"
+    },
+    "no-implicit-globals": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow declarations in the global scope",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-implicit-globals"
+        }
+    },
+    "no-implied-eval": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `eval()`-like methods",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-implied-eval"
+        }
+    },
+    "no-import-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow assigning to imported bindings",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-import-assign"
+        }
+    },
+    "no-inline-comments": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow inline comments after code",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-inline-comments"
+        }
+    },
+    "no-inner-declarations": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow variable or `function` declarations in nested blocks",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-inner-declarations"
+        }
+    },
+    "no-invalid-regexp": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow invalid regular expression strings in `RegExp` constructors",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-invalid-regexp"
+        }
+    },
+    "no-invalid-this": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow use of `this` in contexts where the value of `this` is `undefined`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-invalid-this"
+        }
+    },
+    "no-irregular-whitespace": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow irregular whitespace",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-irregular-whitespace"
+        }
+    },
+    "no-iterator": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of the `__iterator__` property",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-iterator"
+        }
+    },
+    "no-label-var": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow labels that share a name with a variable",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-label-var"
+        }
+    },
+    "no-labels": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow labeled statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-labels"
+        }
+    },
+    "no-lone-blocks": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary nested blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-lone-blocks"
+        }
+    },
+    "no-lonely-if": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `if` statements as the only statement in `else` blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-lonely-if"
+        },
+        "fixable": "code"
+    },
+    "no-loop-func": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow function declarations that contain unsafe references inside loop statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-loop-func"
+        }
+    },
+    "no-loss-of-precision": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow literal numbers that lose precision",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-loss-of-precision"
+        }
+    },
+    "no-magic-numbers": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow magic numbers",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-magic-numbers"
+        }
+    },
+    "no-misleading-character-class": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow characters which are made with multiple code points in character class syntax",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-misleading-character-class"
+        },
+        "hasSuggestions": true
+    },
+    "no-mixed-operators": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow mixed binary operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-mixed-operators"
+        }
+    },
+    "no-mixed-requires": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `require` calls to be mixed with regular variable declarations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-mixed-requires"
+        }
+    },
+    "no-mixed-spaces-and-tabs": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow mixed spaces and tabs for indentation",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs"
+        }
+    },
+    "no-multi-assign": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow use of chained assignment expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-multi-assign"
+        }
+    },
+    "no-multi-spaces": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow multiple spaces",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-multi-spaces"
+        },
+        "fixable": "whitespace"
+    },
+    "no-multi-str": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow multiline strings",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-multi-str"
+        }
+    },
+    "no-multiple-empty-lines": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow multiple empty lines",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-multiple-empty-lines"
+        },
+        "fixable": "whitespace"
+    },
+    "no-native-reassign": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow assignments to native objects or read-only global variables",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-native-reassign"
+        },
+        "deprecated": true,
+        "replacedBy": [
+            "no-global-assign"
+        ]
+    },
+    "no-negated-condition": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow negated conditions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-negated-condition"
+        }
+    },
+    "no-negated-in-lhs": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow negating the left operand in `in` expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-negated-in-lhs"
+        },
+        "replacedBy": [
+            "no-unsafe-negation"
+        ],
+        "deprecated": true
+    },
+    "no-nested-ternary": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow nested ternary expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-nested-ternary"
+        }
+    },
+    "no-new": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `new` operators outside of assignments or comparisons",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-new"
+        }
+    },
+    "no-new-func": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `new` operators with the `Function` object",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-new-func"
+        }
+    },
+    "no-new-object": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `Object` constructors",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-new-object"
+        }
+    },
+    "no-new-require": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `new` operators with calls to `require`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-new-require"
+        }
+    },
+    "no-new-symbol": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow `new` operators with the `Symbol` object",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-new-symbol"
+        }
+    },
+    "no-new-wrappers": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-new-wrappers"
+        }
+    },
+    "no-nonoctal-decimal-escape": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `\\8` and `\\9` escape sequences in string literals",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-nonoctal-decimal-escape"
+        },
+        "hasSuggestions": true
+    },
+    "no-obj-calls": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow calling global object properties as functions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-obj-calls"
+        }
+    },
+    "no-octal": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow octal literals",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-octal"
+        }
+    },
+    "no-octal-escape": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow octal escape sequences in string literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-octal-escape"
+        }
+    },
+    "no-param-reassign": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow reassigning `function` parameters",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-param-reassign"
+        }
+    },
+    "no-path-concat": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow string concatenation with `__dirname` and `__filename`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-path-concat"
+        }
+    },
+    "no-plusplus": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the unary operators `++` and `--`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-plusplus"
+        }
+    },
+    "no-process-env": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `process.env`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-process-env"
+        }
+    },
+    "no-process-exit": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `process.exit()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-process-exit"
+        }
+    },
+    "no-promise-executor-return": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow returning values from Promise executor functions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-promise-executor-return"
+        }
+    },
+    "no-proto": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of the `__proto__` property",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-proto"
+        }
+    },
+    "no-prototype-builtins": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow calling some `Object.prototype` methods directly on objects",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-prototype-builtins"
+        }
+    },
+    "no-redeclare": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow variable redeclaration",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-redeclare"
+        }
+    },
+    "no-regex-spaces": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow multiple spaces in regular expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-regex-spaces"
+        },
+        "fixable": "code"
+    },
+    "no-restricted-exports": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified names in exports",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-exports"
+        }
+    },
+    "no-restricted-globals": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified global variables",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-globals"
+        }
+    },
+    "no-restricted-imports": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified modules when loaded by `import`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-imports"
+        }
+    },
+    "no-restricted-modules": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified modules when loaded by `require`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-modules"
+        }
+    },
+    "no-restricted-properties": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow certain properties on certain objects",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-properties"
+        }
+    },
+    "no-restricted-syntax": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified syntax",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-restricted-syntax"
+        }
+    },
+    "no-return-assign": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow assignment operators in `return` statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-return-assign"
+        }
+    },
+    "no-return-await": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary `return await`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-return-await"
+        },
+        "fixable": null
+    },
+    "no-script-url": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `javascript:` urls",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-script-url"
+        }
+    },
+    "no-self-assign": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow assignments where both sides are exactly the same",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-self-assign"
+        }
+    },
+    "no-self-compare": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow comparisons where both sides are exactly the same",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-self-compare"
+        }
+    },
+    "no-sequences": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow comma operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-sequences"
+        }
+    },
+    "no-setter-return": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow returning values from setters",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-setter-return"
+        }
+    },
+    "no-shadow": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow variable declarations from shadowing variables declared in the outer scope",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-shadow"
+        }
+    },
+    "no-shadow-restricted-names": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow identifiers from shadowing restricted names",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-shadow-restricted-names"
+        }
+    },
+    "no-spaced-func": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow spacing between function identifiers and their applications (deprecated)",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-spaced-func"
+        },
+        "deprecated": true,
+        "replacedBy": [
+            "func-call-spacing"
+        ],
+        "fixable": "whitespace"
+    },
+    "no-sparse-arrays": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow sparse arrays",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-sparse-arrays"
+        }
+    },
+    "no-sync": {
+        "deprecated": true,
+        "replacedBy": [],
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow synchronous methods",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-sync"
+        }
+    },
+    "no-tabs": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow all tabs",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-tabs"
+        }
+    },
+    "no-template-curly-in-string": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow template literal placeholder syntax in regular strings",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-template-curly-in-string"
+        }
+    },
+    "no-ternary": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow ternary operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-ternary"
+        }
+    },
+    "no-this-before-super": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow `this`/`super` before calling `super()` in constructors",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-this-before-super"
+        }
+    },
+    "no-throw-literal": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow throwing literals as exceptions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-throw-literal"
+        }
+    },
+    "no-trailing-spaces": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow trailing whitespace at the end of lines",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-trailing-spaces"
+        },
+        "fixable": "whitespace"
+    },
+    "no-undef": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-undef"
+        }
+    },
+    "no-undef-init": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow initializing variables to `undefined`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-undef-init"
+        },
+        "fixable": "code"
+    },
+    "no-undefined": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `undefined` as an identifier",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-undefined"
+        }
+    },
+    "no-underscore-dangle": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow dangling underscores in identifiers",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-underscore-dangle"
+        }
+    },
+    "no-unexpected-multiline": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow confusing multiline expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unexpected-multiline"
+        }
+    },
+    "no-unmodified-loop-condition": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow unmodified loop conditions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-unmodified-loop-condition"
+        }
+    },
+    "no-unneeded-ternary": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow ternary operators when simpler alternatives exist",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-unneeded-ternary"
+        },
+        "fixable": "code"
+    },
+    "no-unreachable": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unreachable"
+        }
+    },
+    "no-unreachable-loop": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow loops with a body that allows only one iteration",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-unreachable-loop"
+        }
+    },
+    "no-unsafe-finally": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow control flow statements in `finally` blocks",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unsafe-finally"
+        }
+    },
+    "no-unsafe-negation": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow negating the left operand of relational operators",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unsafe-negation"
+        },
+        "hasSuggestions": true,
+        "fixable": null
+    },
+    "no-unsafe-optional-chaining": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unsafe-optional-chaining"
+        },
+        "fixable": null
+    },
+    "no-unused-expressions": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unused expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-unused-expressions"
+        }
+    },
+    "no-unused-labels": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unused labels",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unused-labels"
+        },
+        "fixable": "code"
+    },
+    "no-unused-private-class-members": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow unused private class members",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-unused-private-class-members"
+        }
+    },
+    "no-unused-vars": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow unused variables",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-unused-vars"
+        }
+    },
+    "no-use-before-define": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow the use of variables before they are defined",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-use-before-define"
+        }
+    },
+    "no-useless-backreference": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow useless backreferences in regular expressions",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-useless-backreference"
+        }
+    },
+    "no-useless-call": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary calls to `.call()` and `.apply()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-call"
+        }
+    },
+    "no-useless-catch": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary `catch` clauses",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-useless-catch"
+        }
+    },
+    "no-useless-computed-key": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary computed property keys in objects and classes",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-computed-key"
+        },
+        "fixable": "code"
+    },
+    "no-useless-concat": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary concatenation of literals or template literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-concat"
+        }
+    },
+    "no-useless-constructor": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary constructors",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-constructor"
+        }
+    },
+    "no-useless-escape": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow unnecessary escape characters",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-useless-escape"
+        },
+        "hasSuggestions": true
+    },
+    "no-useless-rename": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow renaming import, export, and destructured assignments to the same name",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-rename"
+        },
+        "fixable": "code"
+    },
+    "no-useless-return": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow redundant return statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-useless-return"
+        },
+        "fixable": "code"
+    },
+    "no-var": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `let` or `const` instead of `var`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-var"
+        },
+        "fixable": "code"
+    },
+    "no-void": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `void` operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-void"
+        }
+    },
+    "no-warning-comments": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow specified warning terms in comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-warning-comments"
+        }
+    },
+    "no-whitespace-before-property": {
+        "type": "layout",
+        "docs": {
+            "description": "Disallow whitespace before properties",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/no-whitespace-before-property"
+        },
+        "fixable": "whitespace"
+    },
+    "no-with": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `with` statements",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/no-with"
+        }
+    },
+    "nonblock-statement-body-position": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce the location of single-line statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/nonblock-statement-body-position"
+        },
+        "fixable": "whitespace"
+    },
+    "object-curly-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent line breaks after opening and before closing braces",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/object-curly-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "object-curly-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing inside braces",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/object-curly-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "object-property-newline": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce placing object properties on separate lines",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/object-property-newline"
+        },
+        "fixable": "whitespace"
+    },
+    "object-shorthand": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow method and property shorthand syntax for object literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/object-shorthand"
+        },
+        "fixable": "code"
+    },
+    "one-var": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce variables to be declared either together or separately in functions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/one-var"
+        },
+        "fixable": "code"
+    },
+    "one-var-declaration-per-line": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow newlines around variable declarations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/one-var-declaration-per-line"
+        },
+        "fixable": "whitespace"
+    },
+    "operator-assignment": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow assignment operator shorthand where possible",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/operator-assignment"
+        },
+        "fixable": "code"
+    },
+    "operator-linebreak": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent linebreak style for operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/operator-linebreak"
+        },
+        "fixable": "code"
+    },
+    "padded-blocks": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow padding within blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/padded-blocks"
+        },
+        "fixable": "whitespace"
+    },
+    "padding-line-between-statements": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow padding lines between statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/padding-line-between-statements"
+        },
+        "fixable": "whitespace"
+    },
+    "prefer-arrow-callback": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require using arrow functions for callbacks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-arrow-callback"
+        },
+        "fixable": "code"
+    },
+    "prefer-const": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `const` declarations for variables that are never reassigned after declared",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-const"
+        },
+        "fixable": "code"
+    },
+    "prefer-destructuring": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require destructuring from arrays and/or objects",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-destructuring"
+        },
+        "fixable": "code"
+    },
+    "prefer-exponentiation-operator": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow the use of `Math.pow` in favor of the `**` operator",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-exponentiation-operator"
+        },
+        "fixable": "code"
+    },
+    "prefer-named-capture-group": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce using named capture group in regular expression",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-named-capture-group"
+        }
+    },
+    "prefer-numeric-literals": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-numeric-literals"
+        },
+        "fixable": "code"
+    },
+    "prefer-object-has-own": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-object-has-own"
+        },
+        "fixable": "code"
+    },
+    "prefer-object-spread": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-object-spread"
+        },
+        "fixable": "code"
+    },
+    "prefer-promise-reject-errors": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require using Error objects as Promise rejection reasons",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-promise-reject-errors"
+        },
+        "fixable": null
+    },
+    "prefer-reflect": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `Reflect` methods where applicable",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-reflect"
+        },
+        "deprecated": true,
+        "replacedBy": []
+    },
+    "prefer-regex-literals": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow use of the `RegExp` constructor in favor of regular expression literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-regex-literals"
+        },
+        "hasSuggestions": true
+    },
+    "prefer-rest-params": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require rest parameters instead of `arguments`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-rest-params"
+        }
+    },
+    "prefer-spread": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require spread operators instead of `.apply()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-spread"
+        },
+        "fixable": null
+    },
+    "prefer-template": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require template literals instead of string concatenation",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/prefer-template"
+        },
+        "fixable": "code"
+    },
+    "quote-props": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require quotes around object literal property names",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/quote-props"
+        },
+        "fixable": "code"
+    },
+    "quotes": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce the consistent use of either backticks, double, or single quotes",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/quotes"
+        },
+        "fixable": "code"
+    },
+    "radix": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce the consistent use of the radix argument when using `parseInt()`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/radix"
+        },
+        "hasSuggestions": true
+    },
+    "require-atomic-updates": {
+        "type": "problem",
+        "docs": {
+            "description": "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/require-atomic-updates"
+        },
+        "fixable": null
+    },
+    "require-await": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Disallow async functions which have no `await` expression",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/require-await"
+        }
+    },
+    "require-jsdoc": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require JSDoc comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/require-jsdoc"
+        },
+        "deprecated": true,
+        "replacedBy": []
+    },
+    "require-unicode-regexp": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce the use of `u` flag on RegExp",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/require-unicode-regexp"
+        }
+    },
+    "require-yield": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require generator functions to contain `yield`",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/require-yield"
+        }
+    },
+    "rest-spread-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce spacing between rest and spread operators and their expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/rest-spread-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "semi": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow semicolons instead of ASI",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/semi"
+        },
+        "fixable": "code"
+    },
+    "semi-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before and after semicolons",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/semi-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "semi-style": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce location of semicolons",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/semi-style"
+        },
+        "fixable": "whitespace"
+    },
+    "sort-imports": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce sorted import declarations within modules",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/sort-imports"
+        },
+        "fixable": "code"
+    },
+    "sort-keys": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require object keys to be sorted",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/sort-keys"
+        }
+    },
+    "sort-vars": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require variables within the same declaration block to be sorted",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/sort-vars"
+        },
+        "fixable": "code"
+    },
+    "space-before-blocks": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before blocks",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/space-before-blocks"
+        },
+        "fixable": "whitespace"
+    },
+    "space-before-function-paren": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before `function` definition opening parenthesis",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/space-before-function-paren"
+        },
+        "fixable": "whitespace"
+    },
+    "space-in-parens": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing inside parentheses",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/space-in-parens"
+        },
+        "fixable": "whitespace"
+    },
+    "space-infix-ops": {
+        "type": "layout",
+        "docs": {
+            "description": "Require spacing around infix operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/space-infix-ops"
+        },
+        "fixable": "whitespace"
+    },
+    "space-unary-ops": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce consistent spacing before or after unary operators",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/space-unary-ops"
+        },
+        "fixable": "whitespace"
+    },
+    "spaced-comment": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce consistent spacing after the `//` or `/*` in a comment",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/spaced-comment"
+        },
+        "fixable": "whitespace"
+    },
+    "strict": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow strict mode directives",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/strict"
+        },
+        "fixable": "code"
+    },
+    "switch-colon-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Enforce spacing around colons of switch statements",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/switch-colon-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "symbol-description": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require symbol descriptions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/symbol-description"
+        },
+        "fixable": null
+    },
+    "template-curly-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow spacing around embedded expressions of template strings",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/template-curly-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "template-tag-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow spacing between template tags and their literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/template-tag-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "unicode-bom": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow Unicode byte order mark (BOM)",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/unicode-bom"
+        },
+        "fixable": "whitespace"
+    },
+    "use-isnan": {
+        "type": "problem",
+        "docs": {
+            "description": "Require calls to `isNaN()` when checking for `NaN`",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/use-isnan"
+        }
+    },
+    "valid-jsdoc": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Enforce valid JSDoc comments",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/valid-jsdoc"
+        },
+        "fixable": "code",
+        "deprecated": true,
+        "replacedBy": []
+    },
+    "valid-typeof": {
+        "type": "problem",
+        "docs": {
+            "description": "Enforce comparing `typeof` expressions against valid strings",
+            "recommended": true,
+            "url": "https://eslint.org/docs/rules/valid-typeof"
+        },
+        "hasSuggestions": true
+    },
+    "vars-on-top": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require `var` declarations be placed at the top of their containing scope",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/vars-on-top"
+        }
+    },
+    "wrap-iife": {
+        "type": "layout",
+        "docs": {
+            "description": "Require parentheses around immediate `function` invocations",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/wrap-iife"
+        },
+        "fixable": "code"
+    },
+    "wrap-regex": {
+        "type": "layout",
+        "docs": {
+            "description": "Require parenthesis around regex literals",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/wrap-regex"
+        },
+        "fixable": "code"
+    },
+    "yield-star-spacing": {
+        "type": "layout",
+        "docs": {
+            "description": "Require or disallow spacing around the `*` in `yield*` expressions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/yield-star-spacing"
+        },
+        "fixable": "whitespace"
+    },
+    "yoda": {
+        "type": "suggestion",
+        "docs": {
+            "description": "Require or disallow \"Yoda\" conditions",
+            "recommended": false,
+            "url": "https://eslint.org/docs/rules/yoda"
+        },
+        "fixable": "code"
+    }
+}
\ No newline at end of file
diff --git a/eslint/docs/src/_data/site.js b/eslint/docs/src/_data/site.js
new file mode 100644 (file)
index 0000000..d079269
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+ * @fileoverview Convenience helper for site data.
+ * @author Nicholas C. Zakas
+ */
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const path = require("path");
+const fs = require("fs");
+const yaml = require("js-yaml");
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+module.exports = function(eleventy) {
+   
+    const siteName = eleventy.site_name;
+    const siteDataFile = path.resolve(__dirname, `sites/${siteName}.yml`);
+
+    fs.statSync(siteDataFile);
+
+    return yaml.load(fs.readFileSync(siteDataFile));
+}
diff --git a/eslint/docs/src/_data/sites/en.yml b/eslint/docs/src/_data/sites/en.yml
new file mode 100644 (file)
index 0000000..43e112f
--- /dev/null
@@ -0,0 +1,117 @@
+#------------------------------------------------------------------------------
+# English Site Details
+# The documentation site that is hosted at eslint.org/docs
+# Author: Nicholas C. Zakas
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# Global Settings
+#------------------------------------------------------------------------------
+
+language:
+  code: en
+  flag: 🇺🇸
+  name: English (US)
+locale: en-US
+hostname: eslint.org
+
+#------------------------------------------------------------------------------
+# Analytics
+#------------------------------------------------------------------------------
+
+google_analytics:
+  code: "G-7DGPHY308T"
+
+#------------------------------------------------------------------------------
+# Ads
+#------------------------------------------------------------------------------
+
+carbon_ads:
+  serve: CESDV2QM
+  placement: eslintorg
+
+#------------------------------------------------------------------------------
+# Shared
+#------------------------------------------------------------------------------
+
+shared:
+  get_started: Get Started
+  become_a_sponsor: Become a Sponsor
+  eslint_logo_alt: ESLint logo
+  description: >
+    A pluggable and configurable linter tool for identifying and reporting on
+    patterns in JavaScript. Maintain your code quality with ease.
+  title_format: PAGE_TITLE - ESLint - Pluggable JavaScript Linter
+  skip_to_content: Skip to main content
+  donate: Donate
+
+#------------------------------------------------------------------------------
+# Navigation
+#------------------------------------------------------------------------------
+
+navigation:
+- text: Team
+  link: team
+- text: Blog
+  link: blog
+- text: Docs
+  link: docs
+- text: Store
+  link: store
+  target: _blank
+- text: Playground
+  link: playground
+
+#------------------------------------------------------------------------------
+# Footer
+#------------------------------------------------------------------------------
+
+footer:
+  title: Ready to fix your JavaScript code?
+  description: Install from npm or start donating today.
+  secondary: Secondary
+  social_icons:
+    title: Social Media
+    twitter: Twitter
+    chat: Discord
+    mailing_list: Google Group
+    github: GitHub
+  theme_switcher:
+    title: Theme Switcher
+    light: Light
+    dark: Dark
+  language_switcher:
+    title: Language Switcher
+    description: Selecting a language will take you to the ESLint website in that language.
+    change_language: Change Language
+    language: Language
+  copyright: >
+    &copy; OpenJS Foundation and ESLint contributors, <a href="https://www.openjsf.org">www.openjsf.org</a>
+  links:
+    open_jsf: The OpenJS Foundation
+    terms: Terms of Use
+    privacy: Privacy Policy
+    bylaws: OpenJS Foundation Bylaws
+    trademark: Trademark Policy
+    trademark_list: Trademark List
+    cookies: Cookie Policy
+
+#------------------------------------------------------------------------------
+# 404 Page
+#------------------------------------------------------------------------------
+
+404_page:
+  title: 404 error
+  subtitle: Page not found
+  description: Sorry, the page you are looking for doesn't exist or has been moved.
+  actions:
+    back_to_home: Back to homepage
+    browse_docs: Browse the docs
+
+#------------------------------------------------------------------------------
+# Edit link
+#------------------------------------------------------------------------------
+
+edit_link:
+  start_with: https://github.com/eslint/eslint/edit/main/docs/
+  text: Edit this page
diff --git a/eslint/docs/src/_data/versions.json b/eslint/docs/src/_data/versions.json
new file mode 100644 (file)
index 0000000..6e585d6
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "items": [
+    ]
+}
diff --git a/eslint/docs/src/_includes/components/_component.njk b/eslint/docs/src/_includes/components/_component.njk
new file mode 100644 (file)
index 0000000..f36f898
--- /dev/null
@@ -0,0 +1,3 @@
+{% macro component(name, params) %}
+    {% include './' + name + '.macro.html' ignore missing %}
+{% endmacro %}
diff --git a/eslint/docs/src/_includes/components/alert.macro.html b/eslint/docs/src/_includes/components/alert.macro.html
new file mode 100644 (file)
index 0000000..91e3a94
--- /dev/null
@@ -0,0 +1,38 @@
+{%- macro warning(params) -%}
+<aside role="note" class="alert alert--warning">
+    <svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
+        <path d="M9.49999 6.66667V10M9.49999 13.3333H9.50832M17.8333 10C17.8333 14.6024 14.1024 18.3333 9.49999 18.3333C4.89762 18.3333 1.16666 14.6024 1.16666 10C1.16666 5.39763 4.89762 1.66667 9.49999 1.66667C14.1024 1.66667 17.8333 5.39763 17.8333 10Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+    </svg>
+    <div class="alert__content">
+        <span class="alert__type">Warning</span>
+        <div class="alert__text">{{ params.text }}</div>
+        <a href="{{ params.url }}" class="alert__learn-more">Learn more</a>
+    </div>
+</aside>
+{%- endmacro -%}
+
+{%- macro important(params) -%}
+<aside role="note" class="alert alert--important">
+    <svg class="alert__icon" aria-hidden="true" focusable="false" width="21" height="18" viewBox="0 0 21 18" fill="none">
+        <path d="M10.4998 6.66666V9.99999M10.4998 13.3333H10.5081M9.0748 2.38333L2.01647 14.1667C1.87094 14.4187 1.79394 14.7044 1.79313 14.9954C1.79231 15.2864 1.86771 15.5726 2.01183 15.8254C2.15594 16.0783 2.36374 16.2889 2.61456 16.4365C2.86538 16.5841 3.15047 16.6635 3.44147 16.6667H17.5581C17.8491 16.6635 18.1342 16.5841 18.385 16.4365C18.6359 16.2889 18.8437 16.0783 18.9878 15.8254C19.1319 15.5726 19.2073 15.2864 19.2065 14.9954C19.2057 14.7044 19.1287 14.4187 18.9831 14.1667L11.9248 2.38333C11.7762 2.13841 11.5671 1.93593 11.3175 1.7954C11.0679 1.65487 10.7862 1.58104 10.4998 1.58104C10.2134 1.58104 9.93175 1.65487 9.68214 1.7954C9.43254 1.93593 9.22336 2.13841 9.0748 2.38333Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+    </svg>
+    <div class="alert__content">
+        <span class="alert__type">Important</span>
+        <div class="alert__text">{{ params.text }}</div>
+        <a href="{{ params.url }}" class="alert__learn-more">Learn more</a>
+    </div>
+</aside>
+{%- endmacro -%}
+
+{%- macro tip(params) -%}
+<aside role="note" class="alert alert--tip">
+    <svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
+        <path d="M17.8333 9.23333V10C17.8323 11.797 17.2504 13.5456 16.1744 14.9849C15.0985 16.4241 13.5861 17.4771 11.8628 17.9866C10.1395 18.4961 8.29771 18.4349 6.61205 17.8122C4.92639 17.1894 3.4872 16.0384 2.50912 14.5309C1.53105 13.0234 1.06648 11.2401 1.18472 9.44693C1.30296 7.6538 1.99766 5.94694 3.16522 4.58089C4.33278 3.21485 5.91064 2.26282 7.66348 1.86679C9.41632 1.47076 11.2502 1.65195 12.8917 2.38333M17.8333 3.33333L9.49999 11.675L6.99999 9.175" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+    </svg>
+    <div class="alert__content">
+        <span class="alert__type">Tip</span>
+        <div class="alert__text">{{ params.text }}</div>
+        <a href="{{ params.url }}" class="alert__learn-more">Learn more</a>
+    </div>
+</aside>
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/button.macro.html b/eslint/docs/src/_includes/components/button.macro.html
new file mode 100644 (file)
index 0000000..1881d95
--- /dev/null
@@ -0,0 +1,26 @@
+{%- macro button(behavior="link", params) -%}
+    {%- if params.behavior == "action" -%}
+    <button type="button" class="c-btn
+                {% if params.type == 'primary' %} c-btn--primary {%- endif -%}
+                {% if params.type == 'secondary' %} c-btn--secondary {%- endif -%}
+                {% if params.type == 'ghost' %} c-btn--ghost {%- endif -%}">
+        {%- if params.text -%}
+            {{ params.text }}
+        {%- else -%}
+            This is a button button
+        {%- endif -%}
+    </button>
+    {%- else -%}
+    <a href="{{ params.url }}"
+        class="c-btn
+                {% if params.type == 'primary' %} c-btn--primary {%- endif -%}
+                {% if params.type == 'secondary' %} c-btn--secondary {%- endif -%}
+                {% if params.type == 'ghost' %} c-btn--ghost {%- endif -%}">
+        {%- if params.text -%}
+            {{ params.text }}
+        {%- else -%}
+            This is a link styled like a button
+        {%- endif -%}
+    </a>
+    {%- endif -%}
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/code-tabs.html b/eslint/docs/src/_includes/components/code-tabs.html
new file mode 100644 (file)
index 0000000..8f1524b
--- /dev/null
@@ -0,0 +1,21 @@
+<div class="c-tabs" data-tabs>
+    <div class="c-tabs__tablist" data-tablist hidden>
+        <button class="c-tabs__tab" data-tab>npm</button>
+        <button class="c-tabs__tab" data-tab>yarn</button>
+    </div>
+    <div class="c-tabs__tabpanel" data-tabpanel>
+        <h3 class="h6 c-tabs__tabpanel__title">npm</h3>
+
+```shell
+    npm install --save-dev
+```
+
+    </div>
+    <div class="c-tabs__tabpanel" data-tabpanel>
+        <h3 class="h6 c-tabs__tabpanel__title">yarn</h3>
+
+```shell
+yarn install
+```
+    </div>
+</div>
diff --git a/eslint/docs/src/_includes/components/docs-index.html b/eslint/docs/src/_includes/components/docs-index.html
new file mode 100644 (file)
index 0000000..0cdbe74
--- /dev/null
@@ -0,0 +1,29 @@
+{% set navPages = collections.docs | eleventyNavigation %}
+{% macro renderNavListItem(entry) -%}
+<li class="docs-index__item" {% if entry.children.length %}data-has-children {% endif %}>
+    <a href="{{ entry.url | url | prettyURL }}" {% if entry.url == page.url %} aria-current="true" {% endif %}>{{ entry.title }}</a>
+    {%- if entry.children.length -%}
+    <ul data-child-list>
+        {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
+    </ul>
+    {%- endif -%}
+</li>
+{%- endmacro %}
+
+<nav class="docs-index" id="docs-index">
+    <button class="docs-index-toggle" id="js-docs-index-toggle" hidden>
+        Index
+        <svg width="20" height="20" viewBox="20 20 60 60" aria-hidden="true" focusable="false">
+            <path id="ham-top" d="M30,37 L70,37 Z" stroke="currentColor"></path>
+            <path id="ham-middle" d="M30,50 L70,50 Z" stroke="currentColor"></path>
+            <path id="ham-bottom" d="M30,63 L70,63 Z" stroke="currentColor"></path>
+        </svg>
+    </button>
+    <div class="docs__index__panel" id="js-docs-index-panel">
+        {% include 'components/search.html' %}
+
+        <ul class="docs-index__list" id="js-docs-list">
+            {%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
+        </ul>
+    </div>
+</nav>
diff --git a/eslint/docs/src/_includes/components/docs-toc.html b/eslint/docs/src/_includes/components/docs-toc.html
new file mode 100644 (file)
index 0000000..c4f4a4a
--- /dev/null
@@ -0,0 +1,8 @@
+<nav class="docs-toc c-toc" aria-labelledby="js-toc-label">
+    {%- if all_content | toc | safe | length -%}
+    <h2 class="c-toc__label" id="js-toc-label">Table of Contents</h2>
+    <div class="c-toc__panel" id="js-toc-panel">
+        {{ all_content | toc | safe }}
+    </div>
+    {%- endif -%}
+</nav>
diff --git a/eslint/docs/src/_includes/components/hero.macro.html b/eslint/docs/src/_includes/components/hero.macro.html
new file mode 100644 (file)
index 0000000..3ff0c9c
--- /dev/null
@@ -0,0 +1,29 @@
+{%- macro hero(params) -%}
+<div class="section hero">
+    <div class="content-container grid">
+        <div class="span-1-7 content-container">
+            {%- if params.post -%}
+                <p class="post__meta">Published {{ params.post.date }} under <a href="/blog/category/{{ params.post.categoryURL }}">{{ params.post.category  }}</a></p>
+            {%- endif -%}
+            <h1 class="section-title">{{ params.title }}</h1>
+            <p class="section-supporting-text">
+                {{ params.supporting_text | safe }}
+            </p>
+            {% if params.buttons %}
+            <div class="eslint-actions">
+                {% if params.buttons.primary %}
+                    <a href="{{ params.buttons.primary.primaryURL }}" class="c-btn c-btn--primary">{{ params.buttons.primary.primaryText }}</a>
+                {% endif %}
+                {% if params.buttons.secondary %}
+                    <a href="{{ params.buttons.secondary.secondaryURL }}" class="c-btn c-btn--secondary">{{ params.buttons.secondary.secondaryText }}</a>
+                {% endif %}
+            </div>
+
+            {% endif %}
+        </div>
+        <div class="span-10-12 hero-ad">
+            {% include "partials/carbon-ad.html" %}
+        </div>
+    </div>
+</div>
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/language-switcher.html b/eslint/docs/src/_includes/components/language-switcher.html
new file mode 100644 (file)
index 0000000..aef1c2a
--- /dev/null
@@ -0,0 +1,24 @@
+<div class="language-switcher">
+    <a href="/languages/" class="switcher-fallback">{{ site.footer.language_switcher.change_language }}</a>
+    <div hidden role="region" class="switcher switcher--language" aria-labelledby="language-switcher-label"
+        id="language-switcher">
+        <span id="language-switcher-label" hidden>{{ site.footer.language_switcher.title }}</span>
+        <div class="infobox visually-hidden" id="language-infobox">
+            {{ site.footer.language_switcher.description }}
+        </div>
+        <label class="switcher__label" for="language-select">
+            <span class="label__text">
+                {{ site.footer.language_switcher.language }}
+            </span>
+        </label>
+        <select name="language selector" id="language-select" aria-describedby="language-infobox"
+            class="c-custom-select switcher__select">
+            {% for key, other_site in sites %}
+            <option value="{{ other_site.language.code }}" data-url="https://{{ other_site.hostname }}" {% if
+                site.language.code==other_site.language.code %} selected {% endif %}>
+                {{ other_site.language.flag }} {{ other_site.language.name }}
+            </option>
+            {% endfor %}
+        </select>
+    </div>
+</div>
diff --git a/eslint/docs/src/_includes/components/logo.html b/eslint/docs/src/_includes/components/logo.html
new file mode 100644 (file)
index 0000000..1b874fe
--- /dev/null
@@ -0,0 +1,21 @@
+<div class="logo">
+    <style>
+        [data-theme="dark"] .logo-component {
+            fill: #fff;
+        }
+
+        [data-theme="dark"] #logo-center {
+            opacity: 60%;
+        }
+    </style>
+    <svg class="brand-logo" width="203" height="58" viewBox="0 0 203 58" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="ESLint logo">
+        <path d="M46.5572 21.1093L34.0167 13.8691C33.7029 13.6879 33.3161 13.6879 33.0023 13.8691L20.4616 21.1093C20.148 21.2905 19.9543 21.6253 19.9543 21.9878V36.4681C19.9543 36.8304 20.148 37.1654 20.4616 37.347L33.0023 44.5871C33.3161 44.7684 33.7029 44.7684 34.0167 44.5871L46.5572 37.347C46.871 37.1657 47.0644 36.8306 47.0644 36.4681V21.9878C47.0641 21.6253 46.8707 21.2905 46.5572 21.1093Z" fill="#8080F2" id="logo-center" class="logo-component" />
+        <path d="M0.904381 27.7046L15.8878 1.63772C16.4321 0.695223 17.4375 0 18.5258 0H48.4931C49.5817 0 50.5873 0.695223 51.1316 1.63772L66.115 27.6471C66.6593 28.5899 66.6593 29.7796 66.115 30.7224L51.1316 56.5756C50.5873 57.5181 49.5817 58 48.4931 58H18.526C17.4377 58 16.4321 57.5326 15.8881 56.5899L0.90464 30.6944C0.359854 29.7522 0.359854 28.6471 0.904381 27.7046ZM13.3115 40.2393C13.3115 40.6225 13.5422 40.977 13.8744 41.1689L32.96 52.1803C33.2919 52.3719 33.7078 52.3719 34.0397 52.1803L53.1401 41.1689C53.4721 40.977 53.7043 40.6228 53.7043 40.2393V18.2161C53.7043 17.8327 53.4754 17.4785 53.1432 17.2866L34.0584 6.27513C33.7264 6.08327 33.3111 6.08327 32.9792 6.27513L13.8775 17.2866C13.5453 17.4785 13.3115 17.8327 13.3115 18.2161V40.2393V40.2393Z" fill="#4B32C3" class="logo-component" />
+        <path d="M86.6971 43.7102V14.2899H105.442V18.871H91.7826V26.6044H104.265V31.1855H91.7826V39.129H105.652V43.7102H86.6971Z" fill="#101828" class="logo-component" />
+        <path d="M118.919 44.2986C116.678 44.2986 114.688 43.9063 112.951 43.1218C111.242 42.3092 109.897 41.1464 108.916 39.6334C107.936 38.1203 107.445 36.271 107.445 34.0855V32.9928H112.447V34.0855C112.447 36.0189 113.035 37.4619 114.212 38.4145C115.389 39.3672 116.958 39.8435 118.919 39.8435C120.909 39.8435 122.408 39.4372 123.416 38.6247C124.425 37.8121 124.929 36.7614 124.929 35.4725C124.929 34.6039 124.691 33.9034 124.215 33.371C123.739 32.8107 123.038 32.3623 122.113 32.0261C121.217 31.6899 120.124 31.3677 118.835 31.0594L117.574 30.8073C115.641 30.359 113.96 29.7986 112.531 29.1261C111.13 28.4256 110.051 27.529 109.295 26.4363C108.538 25.3435 108.16 23.9145 108.16 22.1493C108.16 20.3841 108.58 18.871 109.421 17.6102C110.261 16.3493 111.452 15.3826 112.993 14.7102C114.534 14.0377 116.341 13.7015 118.415 13.7015C120.488 13.7015 122.338 14.0517 123.963 14.7522C125.588 15.4527 126.863 16.5034 127.787 17.9044C128.74 19.3053 129.216 21.0566 129.216 23.158V24.545H124.215V23.158C124.215 21.9532 123.977 20.9865 123.5 20.258C123.024 19.5295 122.352 18.9971 121.483 18.6609C120.614 18.3247 119.592 18.1566 118.415 18.1566C116.678 18.1566 115.361 18.4928 114.464 19.1652C113.568 19.8377 113.119 20.7904 113.119 22.0232C113.119 22.8078 113.315 23.4802 113.708 24.0406C114.128 24.573 114.73 25.0213 115.515 25.3855C116.327 25.7218 117.336 26.016 118.541 26.2681L119.802 26.5623C121.819 27.0107 123.584 27.5851 125.098 28.2855C126.611 28.958 127.787 29.8546 128.628 30.9754C129.497 32.0962 129.931 33.5532 129.931 35.3464C129.931 37.1116 129.469 38.6667 128.544 40.0116C127.647 41.3566 126.372 42.4073 124.719 43.1638C123.094 43.9203 121.161 44.2986 118.919 44.2986Z" fill="#101828" class="logo-component" />
+        <path d="M133.1 43.7102V14.2899H138.185V39.129H151.971V43.7102H133.1Z" fill="#101828" class="logo-component" />
+        <path d="M154.827 43.7102V22.9479H159.661V43.7102H154.827ZM157.223 20.3C156.354 20.3 155.598 20.0198 154.954 19.4595C154.337 18.871 154.029 18.1005 154.029 17.1479C154.029 16.1952 154.337 15.4387 154.954 14.8783C155.598 14.2899 156.354 13.9957 157.223 13.9957C158.148 13.9957 158.904 14.2899 159.493 14.8783C160.109 15.4387 160.417 16.1952 160.417 17.1479C160.417 18.1005 160.109 18.871 159.493 19.4595C158.904 20.0198 158.148 20.3 157.223 20.3Z" fill="#101828" class="logo-component" />
+        <path d="M164.525 43.7102V22.9479H169.275V25.8479H169.989C170.353 25.0633 171.012 24.3208 171.964 23.6203C172.917 22.9198 174.36 22.5696 176.293 22.5696C177.891 22.5696 179.305 22.9338 180.538 23.6623C181.771 24.3909 182.724 25.3995 183.396 26.6884C184.097 27.9773 184.447 29.5044 184.447 31.2696V43.7102H179.614V31.6479C179.614 29.9667 179.193 28.7198 178.353 27.9073C177.54 27.0667 176.377 26.6464 174.864 26.6464C173.155 26.6464 171.81 27.2208 170.83 28.3696C169.849 29.4904 169.359 31.1015 169.359 33.2029V43.7102H164.525Z" fill="#101828" class="logo-component" />
+        <path d="M196.449 43.7102C195.104 43.7102 194.025 43.3179 193.213 42.5334C192.428 41.7208 192.036 40.6281 192.036 39.2551V26.9406H186.614V22.9479H192.036V16.2652H196.869V22.9479H202.837V26.9406H196.869V38.4566C196.869 39.2971 197.262 39.7174 198.046 39.7174H202.207V43.7102H196.449Z" fill="#101828" class="logo-component" />
+    </svg>
+</div>
diff --git a/eslint/docs/src/_includes/components/nav-search.html b/eslint/docs/src/_includes/components/nav-search.html
new file mode 100644 (file)
index 0000000..531e819
--- /dev/null
@@ -0,0 +1,11 @@
+<div role="region" aria-labelledby="nav-search-label" class="search">
+    <label for="search" class="label--block">
+        <span class="label__text" id="nav-search-label">Search</span>
+        <div class="search__input-wrapper">
+            <svg class="search__icon" width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true" focusable="false">
+                <path d="M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+            </svg>
+            <input type="search" id="nav-search" class="search__input">
+        </div>
+    </label>
+</div>
diff --git a/eslint/docs/src/_includes/components/nav-version-switcher.html b/eslint/docs/src/_includes/components/nav-version-switcher.html
new file mode 100644 (file)
index 0000000..f4e0f5f
--- /dev/null
@@ -0,0 +1,25 @@
+<!-- only displayed in mobile; be sure to update version-switcher.html too -->
+<div class="version-switcher">
+    <a href="{{ '/versions/' | url }}" class="switcher-fallback">Versions</a>
+
+    <div hidden role="region" class="switcher switcher--version" aria-labelledby="nav-version-switcher-label" id="nav-version-switcher">
+        <span id="nav-version-switcher-label" hidden>Version Switcher</span>
+        <div class="infobox visually-hidden" id="nav-version-infobox">
+            Selecting a version will take you to the chosen version of the ESLint docs.
+        </div>
+
+        <label class="switcher__label label--block" for="version-select">
+            <span class="label__text">Version</span>
+        </label>
+        <select name="version selector" id="nav-version-select" aria-describedby="nav-version-infobox" class="c-custom-select switcher__select auto-switcher">
+            <option value="HEAD" data-url="/docs/head/" {% if GIT_BRANCH !="latest" %}selected{% endif %}>HEAD</option>
+            <option value="{{ eslintVersion }}" data-url="/docs/latest/" {% if GIT_BRANCH=="latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
+            {% for version in versions.items %}
+            <option value="{{ version.number }}"
+                    data-url="{{ version.url }}">
+                v{{ version.number }}
+            </option>
+            {% endfor %}
+        </select>
+    </div>
+</div>
diff --git a/eslint/docs/src/_includes/components/navigation.html b/eslint/docs/src/_includes/components/navigation.html
new file mode 100644 (file)
index 0000000..56cd65f
--- /dev/null
@@ -0,0 +1,26 @@
+<nav class="docs-site-nav" aria-label="Main">
+    <div class="flexer">
+        <a href="{{ links.donate }}" class="c-btn c-btn--primary donate-link">{{ site.shared.donate}}</a>
+        <button class="docs-site-nav-toggle" aria-label="Menu" id="nav-toggle" hidden>
+            <svg width="20" height="20" viewBox="20 20 60 60">
+                <path id="ham-top"    d="M30,37 L70,37 Z" stroke="currentColor"></path>
+                <path id="ham-middle" d="M30,50 L70,50 Z" stroke="currentColor"></path>
+                <path id="ham-bottom" d="M30,63 L70,63 Z" stroke="currentColor"></path>
+            </svg>
+        </button>
+    </div>
+    <div class="docs-nav-panel" id="nav-panel">
+        <ul id="nav-list">
+            {% for item in site.navigation %}
+            <li>
+                {% set itemLink = links[item.link] %}
+                <a href="{{ itemLink }}" {% if "/docs" in itemLink %}aria-current="true"{% endif %} {% if item.target
+                    %}target="_blank" {% endif %}>{{ item.text }}</a>
+            </li>
+            {% endfor %}
+        </ul>
+        <div class="mobile-only">
+            {% include 'components/nav-version-switcher.html' %}
+        </div>
+    </div>
+</nav>
diff --git a/eslint/docs/src/_includes/components/related-rules.macro.html b/eslint/docs/src/_includes/components/related-rules.macro.html
new file mode 100644 (file)
index 0000000..913872a
--- /dev/null
@@ -0,0 +1,14 @@
+{%- macro related_rules(params) -%}
+<ul class="related-rules__list" role="list">
+    {%- for item in params.rules -%}
+    <li class="related-rules__list__item">
+        <a href="/rules/{{ item.name }}">
+            <span>{{ item.name }}</span>
+            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true" focusable="false">
+                <path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
+            </svg>
+        </a>
+    </li>
+    {%- endfor -%}
+</ul>
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/rule-categories.macro.html b/eslint/docs/src/_includes/components/rule-categories.macro.html
new file mode 100644 (file)
index 0000000..d8531c2
--- /dev/null
@@ -0,0 +1,56 @@
+
+{%- macro ruleCategories(params) -%}
+<div class="{% if params.index %}rule-categories{% endif %}" aria-label="Rule Categories">
+    {%- if params.recommended == true -%}
+    <div class="rule-category">
+        <span class="rule-category__icon">✅ <span class="visually-hidden">Recommended</span></span>
+        <p class="rule-category__description">
+            The <code>"extends": "eslint:recommended"</code> property in a <a href="../user-guide/configuring/configuration-files#extending-configuration-files">configuration file</a> enables this rule
+        </p>
+    </div>
+    {%- endif -%}
+    {%- if params.fixable -%}
+    <div class="rule-category">
+        <span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
+        <p class="rule-category__description">
+            Some problems reported by this rule are automatically fixable by the <code>--fix</code> <a href="../user-guide/command-line-interface#--fix">command line</a> option
+        </p>
+    </div>
+    {%- endif -%}
+    {%- if params.hasSuggestions == true -%}
+    <div class="rule-category">
+        <span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
+        <p class="rule-category__description">
+            Some problems reported by this rule are manually fixable by editor <a href="../developer-guide/working-with-rules#providing-suggestions">suggestions</a>
+        </p>
+    </div>
+    {%- endif -%}
+</div>
+{%- endmacro -%}
+
+{%- macro recommended() -%}
+<div class="rule-category">
+    <span class="rule-category__icon">✅ <span class="visually-hidden">Recommended</span></span>
+    <p class="rule-category__description">
+        if the <code>"extends": "eslint:recommended"</code> property in a configuration file enables the rule.
+    </p>
+</div>
+{%- endmacro -%}
+
+{%- macro fixable() -%}
+<div class="rule-category">
+    <span class="rule-category__icon">🛠 <span class="visually-hidden">Fixable</span></span>
+    <p class="rule-category__description">
+        if some problems reported by the rule are automatically fixable by the <code>--fix</code> command line option
+    </p>
+</div>
+{%- endmacro -%}
+
+{%- macro hasSuggestions() -%}
+<div class="rule-category">
+    <span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
+    <p class="rule-category__description">
+        if some problems reported by the rule are manually fixable by editor suggestions
+    </p>
+</div>
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/rule-list.macro.html b/eslint/docs/src/_includes/components/rule-list.macro.html
new file mode 100644 (file)
index 0000000..670a0a7
--- /dev/null
@@ -0,0 +1,3 @@
+{%- macro ruleList(params) -%}
+    {% for rule in params.rules %}<a href="{{ ['/rules/', rule] | join | url }}" class="rule-list-item"><code>{{ rule }}</code></a>{% endfor %}
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/rule.macro.html b/eslint/docs/src/_includes/components/rule.macro.html
new file mode 100644 (file)
index 0000000..693be22
--- /dev/null
@@ -0,0 +1,51 @@
+{% from 'components/rule-list.macro.html' import ruleList %}
+
+{%- macro rule(params) -%}
+<article class="rule {% if params.deprecated == true %}rule--deprecated{% endif %} {% if params.removed == true %}rule--removed{% endif %}">
+    <div class="rule__content">
+        {%- if params.deprecated == true -%}
+        <p class="rule__name">
+            {{ params.name }}
+            <span class="rule__status">deprecated</span>
+        </p>
+        {%- if params.replacedBy|length -%}
+        <p class="rule__description">Replaced by {{ ruleList({ rules: params.replacedBy }) }}</p>
+        {%- else -%}<p class="rule__description">{{ params.description }}</p>
+        {%- endif -%}
+        {%- elseif params.removed == true -%}
+        <p class="rule__name">
+            {{ params.name }}
+            <span class="rule__status">removed</span>
+        </p>
+        {%- if params.replacedBy -%}
+        <p class="rule__description">Replaced by {{ ruleList({ rules: params.replacedBy }) }}</p>
+        {%- else -%}<p class="rule__description">{{ params.description }}</p>
+        {%- endif -%}
+        {%- else -%}
+        <a href="{{ ['/rules/', params.name] | join | url }}" class="rule__name">{{ params.name }}</a>
+        <p class="rule__description">{{ params.description }}</p>
+        {%- endif -%}
+    </div>
+    <div class="rule__categories">
+        <span class="visually-hidden">Categories:</span>
+        {%- if (params.deprecated) or (params.removed) -%}
+            <p class="rule__categories__type">
+                <svg width="24" height="24" viewBox="12 12 20 20" fill="none" aria-hidden="true" focusable="false" style="position: relative; right: -1px;">
+                    <path d="M28.5 16L16.5 28M16.5 16L28.5 28" stroke="#F63D68" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
+                </svg>
+            </p>
+            {%- else -%}
+            <p class="rule__categories__type" {% if params.categories.recommended == false %}aria-hidden="true" {%- endif -%}>
+            ✅ <span class="visually-hidden">Extends</span>
+        </p>
+        {%- endif -%}
+
+        <p class="rule__categories__type" {% if params.categories.fixable == false %}aria-hidden="true" {%- endif -%}>
+            🛠 <span class="visually-hidden">Fix</span>
+        </p>
+        <p class="rule__categories__type" {% if params.categories.hasSuggestions == false %}aria-hidden="true" {%- endif -%}>
+            💡 <span class="visually-hidden">Suggestions</span>
+        </p>
+    </div>
+</article>
+{%- endmacro -%}
diff --git a/eslint/docs/src/_includes/components/search.html b/eslint/docs/src/_includes/components/search.html
new file mode 100644 (file)
index 0000000..3363858
--- /dev/null
@@ -0,0 +1,22 @@
+<div role="region" aria-labelledby="search-label" class="search">
+    <label for="search" class="label--block">
+        <span class="label__text" id="search-label">Search</span>
+    </label>
+    <div class="search__input-wrapper">
+        <svg class="search__icon" width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true" focusable="false">
+            <path d="M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
+        </svg>
+        <p class="visually-hidden" id="search-hint">Results will be shown and updated as you type.</p>
+        <div class="search__inner-input-wrapper">
+            <input type="search" id="search" class="search__input" autocomplete="off" aria-describedby="search-hint" pattern="\S+">
+            <button class="search__clear-btn" id="search__clear-btn" hidden>
+                <span class="visually-hidden">Clear search</span>
+                <svg width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false">
+                    <path d="M9 3L3 9M3 3L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
+                </svg>
+            </button>
+        </div>
+    </div>
+    <div id="search-results-announcement" class="visually-hidden" aria-live="polite" aria-atomic="true"></div>
+    <div id="search-results" class="search-results"></div>
+</div>
diff --git a/eslint/docs/src/_includes/components/social-icons.html b/eslint/docs/src/_includes/components/social-icons.html
new file mode 100644 (file)
index 0000000..b75b75f
--- /dev/null
@@ -0,0 +1,57 @@
+<nav aria-labelledby="eslint-social-label" class="eslint-social-icons">
+    <h2 id="eslint-social-label" hidden>{{ site.footer.social_icons.title }}</h2>
+    <ul role="list">
+        <li>
+            <a href="{{ links.twitter }}" target="_blank">
+                <svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
+                    aria-label="{{ site.footer.social_icons.twitter }}">
+                    <path
+                        d="M24 4.70918C23.1 5.10918 22.2 5.40918 21.2 5.50918C22.2 4.90918 23 3.90918 23.4 2.80918C22.4 3.40918 21.4 3.80918 20.3 4.00918C19.4 3.00918 18.1 2.40918 16.7 2.40918C14 2.40918 11.8 4.60918 11.8 7.30918C11.8 7.70918 11.8 8.10918 11.9 8.40918C7.7 8.20918 4.1 6.20918 1.7 3.20918C1.2 4.00918 1 4.80918 1 5.70918C1 7.40918 1.9 8.90918 3.2 9.80918C2.4 9.80918 1.6 9.60918 1 9.20918C1 9.20918 1 9.20918 1 9.30918C1 11.7092 2.7 13.7092 4.9 14.1092C4.5 14.2092 4.1 14.3092 3.6 14.3092C3.3 14.3092 3 14.3092 2.7 14.2092C3.3 16.2092 5.1 17.6092 7.3 17.6092C5.6 18.9092 3.5 19.7092 1.2 19.7092C0.8 19.7092 0.4 19.7092 0 19.6092C2.2 21.0092 4.8 21.8092 7.5 21.8092C16.6 21.8092 21.5 14.3092 21.5 7.80918C21.5 7.60918 21.5 7.40918 21.5 7.20918C22.5 6.50918 23.3 5.60918 24 4.70918Z"
+                        fill="currentColor" />
+                </svg>
+            </a>
+        </li>
+        <li>
+            <a href="{{ links.group }}" target="_blank">
+                <svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
+                    aria-label="{{ site.footer.social_icons.mailing_list }}">
+                    <path
+                        d="M23.5072 9.92762H12.0522V14.8366H18.5442C17.5072 18.1096 14.9442 19.2006 12.0002 19.2006C10.8597 19.202 9.73567 18.9283 8.7235 18.4026C7.71133 17.877 6.84089 17.1149 6.18603 16.1812C5.53116 15.2474 5.11119 14.1695 4.96174 13.0388C4.8123 11.9081 4.93779 10.758 5.32758 9.68619C5.71736 8.61435 6.35993 7.65234 7.20078 6.88179C8.04162 6.11123 9.05593 5.55486 10.1576 5.25989C11.2594 4.96491 12.416 4.94004 13.5293 5.18736C14.6427 5.43469 15.68 5.94693 16.5532 6.68062L20.1202 3.28062C18.6835 1.95814 16.9458 1.00625 15.0578 0.507551C13.1698 0.0088549 11.1887 -0.0215774 9.28633 0.418895C7.38395 0.859367 5.61779 1.75744 4.14115 3.03516C2.6645 4.31289 1.52197 5.93167 0.812711 7.75102C0.103454 9.57037 -0.151101 11.5353 0.0711364 13.4753C0.293374 15.4154 0.98569 17.2718 2.088 18.8837C3.19032 20.4955 4.66932 21.814 6.39666 22.7247C8.124 23.6354 10.0475 24.1108 12.0002 24.1096C18.6172 24.1096 24.6002 19.7456 23.5072 9.92762Z"
+                        fill="currentColor" />
+                </svg>
+            </a>
+        </li>
+        <li>
+            <a href="{{ links.github }}" target="_blank">
+                <svg width="25" height="24" viewBox="0 0 25 24" class="c-icon" role="img"
+                    aria-label="{{ site.footer.social_icons.github }}">
+                    <path fill-rule="evenodd" clip-rule="evenodd"
+                        d="M12.5 0.147461C5.9 0.147461 0.5 5.54746 0.5 12.1475C0.5 17.4475 3.9 21.9475 8.7 23.5475C9.3 23.6475 9.5 23.2475 9.5 22.9475C9.5 22.6475 9.5 21.9475 9.5 20.9475C6.2 21.6475 5.5 19.3475 5.5 19.3475C5 17.9475 4.2 17.5475 4.2 17.5475C3 16.8475 4.2 16.8475 4.2 16.8475C5.4 16.9475 6 18.0475 6 18.0475C7.1 19.8475 8.8 19.3475 9.5 19.0475C9.6 18.2475 9.9 17.7475 10.3 17.4475C7.6 17.1475 4.8 16.1475 4.8 11.5475C4.8 10.2475 5.3 9.14746 6 8.34746C6 7.94746 5.5 6.74746 6.2 5.14746C6.2 5.14746 7.2 4.84746 9.5 6.34746C10.5 6.04746 11.5 5.94746 12.5 5.94746C13.5 5.94746 14.5 6.04746 15.5 6.34746C17.8 4.74746 18.8 5.14746 18.8 5.14746C19.5 6.84746 19 8.04746 18.9 8.34746C19.7 9.14746 20.1 10.2475 20.1 11.5475C20.1 16.1475 17.3 17.1475 14.6 17.4475C15 17.8475 15.4 18.5475 15.4 19.6475C15.4 21.2475 15.4 22.5475 15.4 22.9475C15.4 23.2475 15.6 23.6475 16.2 23.5475C21 21.9475 24.4 17.4475 24.4 12.1475C24.5 5.54746 19.1 0.147461 12.5 0.147461Z"
+                        fill="currentColor" />
+                </svg>
+            </a>
+        </li>
+        <li>
+            <a href="{{ links.chat }}" target="_blank">
+                <svg width="24" height="25" viewBox="0 0 24 25" class="c-icon" role="img"
+                    aria-label="{{ site.footer.social_icons.chat }}">
+                    <g clip-path="url(#clip0_256:2722)">
+                        <path
+                            d="M9.32792 10.1776C8.99458 10.2065 8.68419 10.3594 8.45805 10.606C8.2319 10.8526 8.10645 11.175 8.10645 11.5096C8.10645 11.8442 8.2319 12.1667 8.45805 12.4133C8.68419 12.6599 8.99458 12.8127 9.32792 12.8416C9.4958 12.8347 9.66066 12.7947 9.81307 12.724C9.96548 12.6533 10.1025 12.5532 10.2161 12.4295C10.3298 12.3057 10.418 12.1608 10.4756 12.003C10.5332 11.8451 10.5592 11.6775 10.5519 11.5096C10.5601 11.3416 10.5348 11.1735 10.4776 11.0153C10.4203 10.857 10.3322 10.7117 10.2183 10.5878C10.1044 10.4639 9.9671 10.3639 9.81425 10.2934C9.66141 10.223 9.4961 10.1837 9.32792 10.1776V10.1776ZM13.7079 10.1776C13.4396 10.1549 13.1707 10.2137 12.9364 10.3463C12.702 10.4789 12.5132 10.6792 12.3946 10.9209C12.276 11.1627 12.2332 11.4346 12.2717 11.7011C12.3102 11.9676 12.4283 12.2162 12.6105 12.4145C12.7926 12.6128 13.0305 12.7514 13.2927 12.8123C13.555 12.8731 13.8296 12.8534 14.0805 12.7556C14.3314 12.6578 14.5469 12.4865 14.6988 12.2642C14.8507 12.0419 14.932 11.7789 14.9319 11.5096C14.9392 11.3418 14.9132 11.1741 14.8556 11.0163C14.798 10.8585 14.7098 10.7135 14.5961 10.5898C14.4825 10.4661 14.3455 10.366 14.1931 10.2953C14.0407 10.2246 13.8758 10.1846 13.7079 10.1776V10.1776Z"
+                            fill="currentColor" />
+                        <path
+                            d="M19.54 0.109619H3.46001C3.13617 0.110406 2.81565 0.174971 2.51677 0.299626C2.21788 0.424282 1.94647 0.606588 1.71804 0.836134C1.4896 1.06568 1.30862 1.33797 1.18542 1.63746C1.06222 1.93695 0.999218 2.25778 1.00001 2.58162V18.8096C0.999218 19.1335 1.06222 19.4543 1.18542 19.7538C1.30862 20.0533 1.4896 20.3256 1.71804 20.5551C1.94647 20.7846 2.21788 20.967 2.51677 21.0916C2.81565 21.2163 3.13617 21.2808 3.46001 21.2816H17.068L16.432 19.0616L17.968 20.4896L19.42 21.8296L22 24.1096V2.58162C22.0008 2.25778 21.9378 1.93695 21.8146 1.63746C21.6914 1.33797 21.5104 1.06568 21.282 0.836134C21.0535 0.606588 20.7821 0.424282 20.4832 0.299626C20.1844 0.174971 19.8638 0.110406 19.54 0.109619V0.109619ZM14.908 15.7816C14.908 15.7816 14.476 15.2656 14.116 14.8096C14.9858 14.6048 15.7552 14.099 16.288 13.3816C15.8562 13.669 15.3933 13.9065 14.908 14.0896C14.3498 14.3279 13.7659 14.501 13.168 14.6056C12.1403 14.7948 11.0863 14.7908 10.06 14.5936C9.45887 14.4755 8.86976 14.3028 8.30001 14.0776C7.81882 13.8938 7.35992 13.6563 6.93201 13.3696C7.44554 14.072 8.18835 14.5728 9.03201 14.7856C8.67201 15.2416 8.23201 15.7856 8.23201 15.7856C7.51919 15.8048 6.81258 15.6485 6.17437 15.3304C5.53616 15.0123 4.9859 14.5423 4.57201 13.9616C4.61037 11.5275 5.20124 9.13395 6.30001 6.96162C7.26643 6.2026 8.44466 5.76234 9.67201 5.70162L9.79201 5.84562C8.63452 6.13043 7.55416 6.66719 6.62801 7.41762C6.62801 7.41762 6.89201 7.27362 7.33601 7.06962C8.19835 6.67451 9.11767 6.41802 10.06 6.30962C10.1259 6.29594 10.1928 6.28791 10.26 6.28562C11.0641 6.18084 11.8779 6.17279 12.684 6.26162C13.9533 6.40712 15.1817 6.79985 16.3 7.41762C15.4231 6.70382 14.4047 6.18437 13.312 5.89362L13.48 5.70162C14.7074 5.76234 15.8856 6.2026 16.852 6.96162C17.9508 9.13395 18.5416 11.5275 18.58 13.9616C18.1624 14.541 17.6096 15.0097 16.9697 15.3269C16.3297 15.6441 15.622 15.8002 14.908 15.7816V15.7816Z"
+                            fill="currentColor" />
+                    </g>
+                    <defs>
+                        <clipPath id="clip0_256:2722">
+                            <rect width="24" height="24" fill="white" transform="translate(0 0.109619)" />
+                        </clipPath>
+                    </defs>
+                </svg>
+
+            </a>
+        </li>
+
+    </ul>
+</nav>
diff --git a/eslint/docs/src/_includes/components/theme-switcher.html b/eslint/docs/src/_includes/components/theme-switcher.html
new file mode 100644 (file)
index 0000000..69924d9
--- /dev/null
@@ -0,0 +1,28 @@
+<div role="region" class="theme-switcher" aria-labelledby="theme-switcher-label" id="js-theme-switcher" hidden>
+    <h2 class="theme-switcher-label visually-hidden" id="theme-switcher-label">{{ site.footer.theme_switcher.title }}
+    </h2>
+    <div class="theme-switcher__buttons">
+        <button class="theme-switcher__button js-toggle-button" id="light-theme-toggle" data-theme="light">
+            <svg class="theme-switcher__icon" focusable="false" width="22" height="22" viewBox="0 0 100 100"
+                aria-hidden="true" focusable="false">
+                <g transform="translate(0,-952.36218)">
+                    <path
+                        d="m 50,955.36218 c 1.6568,0 3,1.3431 3,3 l 0,16 c 0,1.6569 -1.3432,3 -3,3 -1.6569,0 -3,-1.3431 -3,-3 l 0,-16 c 0,-1.6569 1.3431,-3 3,-3 z m 31.125,12.875 c 0.76777,0 1.50798,0.3205 2.09375,0.9062 1.17159,1.1717 1.17157,3.0472 0,4.2188 l -11.3125,11.3125 c -1.17157,1.1716 -3.04714,1.1716 -4.21875,0 -1.17153,-1.1715 -1.17158,-3.0472 0,-4.2187 L 79,969.14338 c 0.58579,-0.5857 1.35723,-0.9062 2.125,-0.9062 z m -62.25,0 c 0.76777,0 1.53921,0.3205 2.125,0.9062 l 11.3125,11.3126 c 1.17158,1.1715 1.17153,3.0472 0,4.2187 -1.17161,1.1716 -3.04718,1.1716 -4.21875,0 l -11.3125,-11.3125 c -1.17157,-1.1716 -1.17159,-3.0471 0,-4.2188 0.58577,-0.5857 1.32598,-0.9062 2.09375,-0.9062 z M 50,983.36218 c 10.45786,0 19,8.5422 19,19.00002 0,10.4579 -8.54214,19 -19,19 -10.45784,0 -19,-8.5421 -19,-19 0,-10.45792 8.54216,-19.00002 19,-19.00002 z m 0,6 c -7.21516,0 -13,5.7848 -13,13.00002 0,7.2152 5.78484,13 13,13 7.21518,0 13,-5.7848 13,-13 0,-7.21522 -5.78482,-13.00002 -13,-13.00002 z m 44,10 c 1.65686,0 2.99999,1.34322 3,3.00002 -1e-5,1.6569 -1.34315,3 -3,3 l -16,0 c -1.65685,0 -3,-1.3431 -3,-3 0,-1.6568 1.34316,-3.00002 3,-3.00002 l 16,0 z m -72,0 c 1.65684,0 3,1.34322 3,3.00002 0,1.6569 -1.34315,3 -3,3 l -16,0 c -1.65685,0 -2.99999,-1.3431 -3,-3 1e-5,-1.6568 1.34314,-3.00002 3,-3.00002 l 16,0 z m 47.8125,19.81252 c 0.76777,0 1.50797,0.2892 2.09375,0.875 l 11.3125,11.3125 c 1.17158,1.1716 1.17152,3.0472 0,4.2188 -1.1716,1.1715 -3.04718,1.1715 -4.21875,0 l -11.3125,-11.3126 c -1.17157,-1.1715 -1.1716,-3.0471 0,-4.2187 0.58577,-0.5858 1.35723,-0.875 2.125,-0.875 z m -39.625,0 c 0.76777,0 1.53923,0.2892 2.125,0.875 1.1716,1.1716 1.17157,3.0472 0,4.2187 L 21,1035.581 c -1.17157,1.1715 -3.04715,1.1715 -4.21875,0 -1.17152,-1.1716 -1.17158,-3.0472 0,-4.2188 l 11.3125,-11.3125 c 0.58578,-0.5858 1.32598,-0.875 2.09375,-0.875 z M 50,1027.3622 c 1.6568,0 3,1.3431 3,3 l 0,16 c 0,1.6569 -1.3432,3 -3,3 -1.6569,0 -3,-1.3431 -3,-3 l 0,-16 c 0,-1.6569 1.3431,-3 3,-3 z"
+                        fill="currentColor" fill-opacity="1" stroke="none"></path>
+                </g>
+            </svg>
+            <span>{{ site.footer.theme_switcher.light }}</span>
+        </button>
+        <button class="theme-switcher__button js-toggle-button" id="dark-theme-toggle" data-theme="dark">
+            <svg class="theme-switcher__icon" focusable="false" width="22" height="22" viewBox="0 0 100 100"
+                aria-hidden="true" focusable="false">
+                <g transform="translate(0,-952.36218)">
+                    <path
+                        d="m 35.377874,961.36325 a 3.0003,3.0003 0 0 0 -0.9063,0.1875 c -16.1759,5.9947 -25.4686997,21.7109 -25.4686997,39.59375 0,23.2769 18.9104997,42.2187 42.1873997,42.2187 17.8829,0 33.6304,-9.324 39.625,-25.5 a 3.0003,3.0003 0 0 0 -3.9374,-3.8125 c -4.0936,1.6462 -8.5949,2.5 -13.3438,2.5 -19.5969,0 -37.7188,-18.15315 -37.7188,-37.74995 0,-4.7489 0.8226,-9.2504 2.4688,-13.3437 a 3.0003,3.0003 0 0 0 -2.9062,-4.0938 z m -4.6563,8.7188 c -0.5822,2.8241 -0.9063,5.7363 -0.9063,8.7187 0,23.21085 20.5079,43.74995 43.7188,43.74995 2.9824,0 5.8946,-0.3553 8.7188,-0.9375 -6.2657,10.0487 -17.6431,15.75 -31.0626,15.75 -20.0342,0 -36.1874,-16.1844 -36.1874,-36.2187 0,-13.42105 5.6679,-24.79725 15.7187,-31.06245 z"
+                        fill="currentColor" fill-opacity="1" stroke="none"></path>
+                </g>
+            </svg>
+            <span>{{ site.footer.theme_switcher.dark }}</span>
+        </button>
+    </div>
+</div>
diff --git a/eslint/docs/src/_includes/components/version-switcher.html b/eslint/docs/src/_includes/components/version-switcher.html
new file mode 100644 (file)
index 0000000..ce29efd
--- /dev/null
@@ -0,0 +1,25 @@
+<!-- only displayed on desktop; be sure to update nav-version-switcher.html too -->
+<div class="version-switcher">
+    <a href="{{ '/versions/' | url }}" class="switcher-fallback">Versions</a>
+
+    <div hidden role="region" class="switcher switcher--version" aria-labelledby="version-switcher-label" id="version-switcher">
+        <span id="version-switcher-label" hidden>Version Switcher</span>
+        <div class="infobox visually-hidden" id="version-infobox">
+            Selecting a version will take you to the chosen version of the ESLint docs.
+        </div>
+
+        <label class="switcher__label label--block" for="version-select">
+            <span class="label__text">Version</span>
+        </label>
+        <select name="version selector" id="version-select" aria-describedby="version-infobox" class="c-custom-select switcher__select auto-switcher">
+            <option value="HEAD" data-url="/docs/head/"  {% if GIT_BRANCH != "latest" %}selected{% endif %}>HEAD</option>
+            <option value="{{ eslintVersion }}" data-url="/docs/latest/"  {% if GIT_BRANCH == "latest" %}selected{% endif %}>v{{ eslintVersion }}</option>
+            {% for version in versions.items %}
+            <option value="{{ version.number }}"
+                    data-url="{{ version.url }}">
+                v{{ version.number }}
+            </option>
+            {% endfor %}
+        </select>
+    </div>
+</div>
diff --git a/eslint/docs/src/_includes/layouts/base.html b/eslint/docs/src/_includes/layouts/base.html
new file mode 100644 (file)
index 0000000..db69d33
--- /dev/null
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<html lang="{{ config.lang }}" class="no-js">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    {% if NOINDEX %}
+    <meta name="robots" content="noindex">
+    {% endif %}
+    {% if title %}
+        {% set page_title = title %}
+    {% else %}
+        {% set page_title = site[hook].title %}
+    {% endif %}
+
+    {% set page_title = site.shared.title_format | replace("PAGE_TITLE", page_title) %}
+    {% set cover_image = ["https://", site.hostname, "/icon-512.png" ] | join %}
+    {% set cover_image_alt = site.shared.eslint_logo_alt %}
+    {% set page_desc = site.shared.description %}
+    {% set relative_page_url = page.url | url | prettyURL %}
+    {% set page_url = ["https://", site.hostname, relative_page_url ] | join %}
+
+    <!-- SEO -->
+    <title>{{ page_title }}</title>
+    <meta name="description" content="{{ page_desc }}">
+    <link rel="canonical" href="{{ page_url }}">
+    
+    <!-- https://github.com/eslint/eslint/issues/15844 -->
+    <base href="{{ relative_page_url }}">
+
+    <!-- favicon -->
+    <link rel="icon" href="/favicon.ico" sizes="any"><!-- 32×32 -->
+    <link rel="icon" href="/icon.svg" type="image/svg+xml">
+    <link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
+    <link rel="manifest" href="/manifest.webmanifest">
+
+    <!-- social sharing previews. Make sure every page template has title, desc, and cover url -->
+    <!-- Open graph -->
+    <meta property="og:title" content="{{ page_title }}">
+    <meta property="og:description" content="{{ page_desc }}">
+    <meta property="og:image" content="{{ cover_image }}" />
+    <meta property="og:image:alt" content="{{ cover_image_alt }}">
+    <meta property="og:locale" content="{{ site.locale | replace("-", "_" ) }}">
+    <meta property="og:type" content="website">
+    <meta property="og:url" content="{{ page_url }}">
+    <!-- Twitter -->
+    <meta name="twitter:title" content="{{ page_title }}">
+    <meta name="twitter:card" content="summary_large_image">
+    <meta name="twitter:site" content="@geteslint">
+    <meta name="twitter:description" content="{{ page_desc }}">
+    <meta name="twitter:image" content="{{ cover_image }}">
+    <meta name="twitter:creator" content="@geteslint">
+
+
+    <script type="module">
+        // This is a capable browser, let's improve the UI further!
+        document.documentElement.classList.add("enhanced");
+        document.documentElement.classList.remove('no-js');
+    </script>
+
+    <link rel="preload" href="{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
+    <link rel="preload" href="{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
+    <link rel="preload" href="{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}" as="font" type="font/woff2" crossorigin>
+    <link rel="preload" href="{{ '/assets/fonts/Consolas.woff' | url }}" as="font" type="font/woff" crossorigin>
+    <link rel="preconnect" href="https://www.googletagmanager.com/">
+
+    <script>
+         (function () {
+                var theme = window.localStorage.getItem("theme");
+                if (theme) document.documentElement.setAttribute('data-theme', theme)
+                else if (window.matchMedia('(prefers-color-scheme: dark)').matches)
+                    document.documentElement.setAttribute('data-theme', 'dark');
+                else document.documentElement.setAttribute('data-theme', 'light');
+            })();
+    </script>
+
+
+    <style>
+    
+        /* Overrides for funky punctuators */
+        @font-face {
+            font-family: "Mono Punctuators";
+            src: url("{{ '/assets/fonts/Consolas.woff' | url }}") format("woff");
+            font-weight: 400;
+            unicode-range: U+40, U+7B, U+7D, U+28, U+29;
+            font-display: swap;
+        }
+        
+        /* Space Grotesk for headings */
+        @font-face {
+            font-family: "Space Grotesk";
+            src: url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.woff2' | url }}") format("woff2"),
+            url("{{ '/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff' | url }}") format("woff");
+            font-weight: 500;
+            font-display: swap;
+        }
+
+        /* Inter for body text */
+
+        @font-face {
+            font-family: "Inter";
+            src: url("{{ '/assets/fonts/Inter-Regular-subset.woff2' | url }}") format("woff2"),
+            url("{{ '/assets/fonts/Inter-Regular-subset.zopfli.woff' | url }}") format("woff");
+            font-weight: 400;
+            font-display: swap;
+        }
+
+        /* Space Mono for code snippets */
+
+        @font-face {
+            font-family: "Space Mono";
+            src: url("{{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}") format("woff2"),
+            url("{{ '/assets/fonts/SpaceMono-Regular-subset.zopfli.woff' | url }}") format("woff");
+            font-weight: 400;
+            font-display: swap;
+        }
+    </style>
+    <script>
+        if ("fonts" in document) {
+            var InterSemiBold = new FontFace("Inter", "url({{ '/assets/fonts/Inter-SemiBold-subset.woff2' | url }}) format('woff2'), url({{ '/assets/fonts/Inter-SemiBold-subset.zopfli.woff' | url }}) format('woff')", {
+                weight: "500",
+                style: "normal"
+            });
+
+            Promise.all([InterSemiBold.load()]).then(function(fonts) {
+                fonts.forEach(function(font) {
+                    document.fonts.add(font);
+                });
+            });
+        }
+    </script>
+    <script src="{{ '/assets/js/themes.js' | url }}"></script>
+    <script type="module" src="{{ '/assets/js/search.js' | url }}"></script>
+    <link rel="stylesheet" type="text/css" href="{{ '/assets/css/styles.css' | url }}">
+    <link rel="stylesheet" href="{{ '/assets/css/print.css' | url }}" media="print">
+    <script src="https://unpkg.com/anchor-js@4.3.1/anchor.min.js"></script>
+</head>
+
+<body class="{{ hook }} docs">
+    <a href="#main" class="c-btn c-btn--primary" id="skip-link">Skip to main content</a>
+
+    {{ content | safe }}
+
+    <script src="{{ '/assets/js/css-vars-ponyfill@2.js' | url }}"></script>
+    <script src="{{ '/assets/js/focus-visible.js' | url }}"></script>
+    <script src="{{ '/assets/js/main.js' | url }}"></script>
+    <script src="{{ '/assets/js/tabs.js' | url }}"></script>
+    {% include 'partials/analytics.html' %}
+
+    {%- if hook == "component-library" -%}
+    <script src="{{ '/assets/js/components-index.js' | url }}"></script>
+    {%- endif -%}
+
+
+</body>
+
+</html>
diff --git a/eslint/docs/src/_includes/layouts/components.html b/eslint/docs/src/_includes/layouts/components.html
new file mode 100644 (file)
index 0000000..0e28f26
--- /dev/null
@@ -0,0 +1,46 @@
+---
+layout: base.html
+hook: "component-library"
+---
+
+{% include "partials/docs-header.html" %}
+
+{% from 'components/hero.macro.html' import hero %}
+
+{{ hero({
+        title: "ESLint Docs Components",
+        supporting_text: "Components used across this site."
+    })
+}}
+
+<div class="content-container grid">
+    <div class="span-1-3">
+        <nav class="index">
+            <button class="index__toggle" aria-label="Components" id="js-index-toggle" hidden>
+                Components
+                <svg width="20" height="20" viewBox="20 20 60 60">
+                    <path id="ham-top" d="M30,37 L70,37 Z" stroke="currentColor"></path>
+                    <path id="ham-middle" d="M30,50 L70,50 Z" stroke="currentColor"></path>
+                    <path id="ham-bottom" d="M30,63 L70,63 Z" stroke="currentColor"></path>
+                </svg>
+            </button>
+            <ul class="index__list" id="js-index-list">
+                {% for item in collections.library %}
+                <li class="index__item">
+                    <a href="{{ item.url | url | prettyURL }}" {{ helpers.getLinkActiveState(item.url,
+                    page.url) | safe }}>{{ item.data.title }}</a>
+                </li>
+                {% endfor %}
+            </ul>
+        </nav>
+    </div>
+
+    <div class="span-4-12">
+        <main id="main" tabindex="-1" class="components-main">
+            <h1>{{ title }}</h1>
+            {{ content | safe }}
+        </main>
+    </div>
+</div>
+
+{% include "partials/site-footer.html" %}
diff --git a/eslint/docs/src/_includes/layouts/doc.html b/eslint/docs/src/_includes/layouts/doc.html
new file mode 100644 (file)
index 0000000..70888cd
--- /dev/null
@@ -0,0 +1,107 @@
+---
+layout: base.html
+---
+
+{% include "partials/docs-header.html" %}
+{% from 'components/rule-categories.macro.html' import ruleCategories %}
+
+<div class="docs-wrapper">
+    <div class="docs-nav">
+        <div class="desktop-only">
+            {% include 'components/version-switcher.html' %}
+        </div>
+            {% include 'components/docs-index.html' %}
+    </div>
+
+    {# Add in various sections to content so TOC is accurate #}
+    {% set all_content = content %}
+    {% set rule_meta = rules_meta[title] %}
+    {% set added_version = rule_versions.added[title] %}
+    {% set removed_version = rule_versions.removed[title] %}
+
+    {% if related_rules %}
+        {% set related_rules_content %}
+            <h2 id="related-rules">Related Rules</h2>
+            {% related_rules related_rules %}
+        {% endset %}
+
+        {% set all_content = [all_content, related_rules_content] | join %}
+    {% endif %}
+
+    {% if added_version %}
+        {% set version_content %}
+            <h2 id="version">Version</h2>
+            <p>This rule was introduced in ESLint v{{added_version}}{% if removed_version%}
+                 and removed in v{{removed_version}}{% endif %}.</p>
+        {% endset %}
+
+        {% set all_content = [all_content, version_content] | join %}
+    {% endif %}
+
+    {% if further_reading %}
+        {% set further_reading_content %}
+            <h2 id="further-reading">Further Reading</h2>
+            {% for url in further_reading %}
+                {% link url %}
+            {% endfor %}
+        {% endset %}
+
+        {% set all_content = [all_content, further_reading_content] | join %}
+    {% endif %}
+        
+    {% if rule_meta %}
+        {% set resources_content %}
+            <h2 id="resources">Resources</h2>
+            <ul>
+                <li><a href="https://github.com/eslint/eslint/blob/main/lib/rules/{{ title }}.js">Rule source</a></li>
+                <li><a href="https://github.com/eslint/eslint/blob/main/tests/lib/rules/{{ title }}.js">Tests source</a></li>
+            </ul>
+        {% endset %}
+        {% set all_content = [all_content, resources_content] | join %}
+    {% endif %}
+
+    <div class="docs-content">
+        <main id="main" tabindex="-1" class="docs-main">
+            <div class="docs-main__content">
+                <h1>{{ title }}</h1>
+                {% if rule_meta %}
+                    {%set id = true if (rule_meta.docs.recommended or rule_meta.fixable or rule_meta.hasSuggestions) else false %}
+                    <p>{{ rule_meta.docs.description | markdown | safe }}</p>
+                    {{ ruleCategories({
+                    index: id,
+                    recommended: rule_meta.docs.recommended,
+                    fixable: rule_meta.fixable,
+                    hasSuggestions: rule_meta.hasSuggestions
+                    }) }}
+                {% endif %}
+
+                {% include 'components/docs-toc.html' %}
+                
+                {{ all_content | safe }}
+            </div>
+
+            <div class="docs-edit-link">
+                <a href="
+                {% if edit_link %}
+                    {{ edit_link }}
+                {% else %}
+                    {{ site.edit_link.start_with }}{{ page.inputPath }}
+                {% endif %}
+                "
+                class="c-btn c-btn--secondary">{{ site.edit_link.text }}</a>
+            </div>
+        </main>
+
+        <div class="docs-aside">
+            <div class="docs-aside__content">
+                <aside class="docs-ad">
+                    {%- include 'partials/carbon-ad.html' -%}
+                </aside>
+                {% include 'components/docs-toc.html' %}
+            </div>
+            {% include "partials/docs-footer.html" %}
+        </div>
+    </div>
+</div>
+
+<script src="{{ '/assets/js/tabs.js' | url }}"></script>
diff --git a/eslint/docs/src/_includes/layouts/main.html b/eslint/docs/src/_includes/layouts/main.html
new file mode 100644 (file)
index 0000000..ed38d9c
--- /dev/null
@@ -0,0 +1,12 @@
+---
+layout: base.html
+---
+
+{% include "partials/docs-header.html" %}
+
+
+<main id="main" tabindex="-1">
+    {{ content | safe }}
+</main>
+
+{% include "partials/site-footer.html" %}
diff --git a/eslint/docs/src/_includes/partials/analytics.html b/eslint/docs/src/_includes/partials/analytics.html
new file mode 100644 (file)
index 0000000..a8a927e
--- /dev/null
@@ -0,0 +1,24 @@
+<!--<br>-->
+{% if site.google_analytics.code %}
+<!-- Global site tag (gtag.js) - Google Analytics -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-7DGPHY308T"></script>
+<script>
+    window.dataLayer = window.dataLayer || [];
+    function gtag() { dataLayer.push(arguments); }
+    gtag('js', new Date());
+
+    gtag('config', '{{ site.google_analytics.code }}');
+
+    // track clicks to "Donate"
+    document.querySelectorAll("a.donate-link").forEach(
+        el => el.addEventListener("click",
+            () => gtag("event", "donate_click"))
+    );
+
+    // track clicks on sponsor logos
+    document.querySelectorAll("a.sponsor-link").forEach(
+        el => el.addEventListener("click",
+            () => gtag("event", "sponsor_click", el.href || ""))
+    );
+</script>
+{% endif %}
diff --git a/eslint/docs/src/_includes/partials/carbon-ad.html b/eslint/docs/src/_includes/partials/carbon-ad.html
new file mode 100644 (file)
index 0000000..c79eba5
--- /dev/null
@@ -0,0 +1,13 @@
+<!--<br>-->
+{% if site.carbon_ads.serve %}
+<script id="eslint-sponsor">
+  if ( window.innerWidth > 800 ) {
+    var s = document.createElement("script");
+        s.type = "text/javascript";
+        s.src = "//cdn.carbonads.com/carbon.js?serve={{ site.carbon_ads.serve }}&placement={{ site.carbon_ads.placement}}";
+        s.id = "_carbonads_js";
+    document.getElementById("eslint-sponsor").after(s);
+    document.getElementById("eslint-sponsor").remove();
+  }
+</script>
+{% endif %}
diff --git a/eslint/docs/src/_includes/partials/docs-footer.html b/eslint/docs/src/_includes/partials/docs-footer.html
new file mode 100644 (file)
index 0000000..54791ea
--- /dev/null
@@ -0,0 +1,14 @@
+<footer class="docs-footer">
+    <div class="docs-socials-and-legal">
+        <div class="docs-social-icons">
+            {% include 'components/social-icons.html' %}
+        </div>
+        <div class="docs-copyright">
+            {{ site.footer.copyright | safe }}
+        </div>
+    </div>
+    <div class="docs-switchers">
+        {% include 'components/theme-switcher.html' %}
+        {% include 'components/language-switcher.html' %}
+    </div>
+</footer>
diff --git a/eslint/docs/src/_includes/partials/docs-header.html b/eslint/docs/src/_includes/partials/docs-header.html
new file mode 100644 (file)
index 0000000..f7abc75
--- /dev/null
@@ -0,0 +1,8 @@
+<header class="site-header">
+    <div class="docs-wrapper">
+        <a href="https://eslint.org" aria-label="ESLint Homepage" class="logo-link">
+            {% include "components/logo.html" %}
+        </a>
+        {% include "components/navigation.html" %}
+    </div>
+</header>
diff --git a/eslint/docs/src/_includes/partials/docs-left-sidebar.html b/eslint/docs/src/_includes/partials/docs-left-sidebar.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eslint/docs/src/_includes/partials/languages-list.html b/eslint/docs/src/_includes/partials/languages-list.html
new file mode 100644 (file)
index 0000000..5d22b8a
--- /dev/null
@@ -0,0 +1,5 @@
+<ul class="languages-list">
+    {%- for language in languages.items -%}
+    <li lang="{{ language.code }}"><a href="{{ language.url }}" {% if config.lang == language.code %} aria-current="true" {% endif %}><span class="flag">{{ language.flag }}</span> {{ language.name }}</a></li>
+    {%- endfor -%}
+</ul>
diff --git a/eslint/docs/src/_includes/partials/site-footer.html b/eslint/docs/src/_includes/partials/site-footer.html
new file mode 100644 (file)
index 0000000..0247187
--- /dev/null
@@ -0,0 +1,24 @@
+<footer class="site-footer">
+    <div class="content-container divider footer-middle">
+        {% include 'components/social-icons.html' %}
+        {% include 'components/theme-switcher.html' %}
+        {% include 'components/language-switcher.html' %}
+    </div>
+    <div class="content-container footer-legal-section">
+        <div class="copyright">
+            <p>Copyright <a href="https://openjsf.org">OpenJS Foundation</a> and ESLint contributors. All rights reserved. The <a href="https://openjsf.org">OpenJS Foundation</a> has registered trademarks and uses trademarks.  For a list of trademarks of the <a href="https://openjsf.org">OpenJS Foundation</a>, please see our <a href="https://trademark-policy.openjsf.org">Trademark Policy</a> and <a href="https://trademark-list.openjsf.org">Trademark List</a>.  Trademarks and logos not indicated on the <a href="https://trademark-list.openjsf.org">list of OpenJS Foundation trademarks</a> are trademarks&trade; or registered&reg; trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.</p>
+        </div>
+        <nav aria-labelledby="footer-legal-links-label" class="footer-legal-links">
+            <h2 id="footer-legal-links-label" hidden>Secondary</h2>
+            <ul>
+                <li><a href="https://openjsf.org/">The OpenJS Foundation</a></li>
+                <li><a href="https://terms-of-use.openjsf.org/">Terms of Use</a></li>
+                <li><a href="https://privacy-policy.openjsf.org/">Privacy Policy</a></li>
+                <li><a href="https://bylaws.openjsf.org/">OpenJS Foundation Bylaws</a></li>
+                <li><a href="https://trademark-policy.openjsf.org/">Trademark Policy</a></li>
+                <li><a href="https://trademark-list.openjsf.org/">Trademark List</a></li>
+                <li><a href="https://www.linuxfoundation.org/cookies/">Cookie Policy</a></li>
+            </ul>
+        </nav>
+    </div>
+</footer>
diff --git a/eslint/docs/src/_includes/partials/versions-list.html b/eslint/docs/src/_includes/partials/versions-list.html
new file mode 100644 (file)
index 0000000..2e2fb2f
--- /dev/null
@@ -0,0 +1,7 @@
+<ul class="versions-list">
+    <li><a href="/docs/head/" {% if GIT_BRANCH != "latest" %} data-current="true" {% endif %}>HEAD</a></li>
+    <li><a href="/docs/latest/" {% if GIT_BRANCH == "latest" %} data-current="true" {% endif %}>v{{ eslintVersion }}</a></li>
+    {%- for version in versions.items -%}
+    <li><a href="{{ version.url }}">v{{ version.number }}</a></li>
+    {%- endfor -%}
+</ul>
diff --git a/eslint/docs/src/about/index.md b/eslint/docs/src/about/index.md
new file mode 100644 (file)
index 0000000..2ced3af
--- /dev/null
@@ -0,0 +1,42 @@
+---
+title: About
+layout: doc
+
+---
+
+ESLint is an open source JavaScript linting utility originally created by Nicholas C. Zakas in June 2013. Code [linting][] is a type of static analysis that is frequently used to find problematic patterns or code that doesn't adhere to certain style guidelines. There are code linters for most programming languages, and compilers sometimes incorporate linting into the compilation process.
+
+JavaScript, being a dynamic and loosely-typed language, is especially prone to developer error. Without the benefit of a compilation process, JavaScript code is typically executed in order to find syntax or other errors. Linting tools like ESLint allow developers to discover problems with their JavaScript code without executing it.
+
+The primary reason ESLint was created was to allow developers to create their own linting rules. ESLint is designed to have all rules completely pluggable. The default rules are written just like any plugin rules would be. They can all follow the same pattern, both for the rules themselves as well as tests. While ESLint will ship with some built-in rules to make it useful from the start, you'll be able to dynamically load rules at any point in time.
+
+ESLint is written using Node.js to provide a fast runtime environment and easy installation via [npm][].
+
+[linting]: https://en.wikipedia.org/wiki/Lint_(software)
+[npm]: https://npmjs.org/
+
+## Philosophy
+
+Everything is pluggable:
+
+* Rule API is used both by bundled and custom rules
+* Formatter API is used both by bundled and custom formatters
+* Additional rules and formatters can be specified at runtime
+* Rules and formatters don't have to be bundled to be used
+
+Every rule:
+
+* Is standalone
+* Can be turned off or on (nothing can be deemed "too important to turn off")
+* Can be set to a warning or error individually
+
+Additionally:
+
+* Rules are "agenda free" - ESLint does not promote any particular coding style
+* Any bundled rules are generalizable
+
+The project:
+
+* Values documentation and clear communication
+* Is as transparent as possible
+* Believes in the importance of testing
diff --git a/eslint/docs/src/assets/fonts/Consolas.woff b/eslint/docs/src/assets/fonts/Consolas.woff
new file mode 100644 (file)
index 0000000..c4db8dd
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Consolas.woff differ
diff --git a/eslint/docs/src/assets/fonts/Inter-Regular-subset.woff2 b/eslint/docs/src/assets/fonts/Inter-Regular-subset.woff2
new file mode 100644 (file)
index 0000000..de0e601
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter-Regular-subset.woff2 differ
diff --git a/eslint/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff b/eslint/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff
new file mode 100644 (file)
index 0000000..dd5418f
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff differ
diff --git a/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 b/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.woff2
new file mode 100644 (file)
index 0000000..1fee6c7
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 differ
diff --git a/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff b/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff
new file mode 100644 (file)
index 0000000..619bca1
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff differ
diff --git a/eslint/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf b/eslint/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf
new file mode 100644 (file)
index 0000000..32a7999
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/OFL.txt b/eslint/docs/src/assets/fonts/Inter/OFL.txt
new file mode 100644 (file)
index 0000000..ce049ad
--- /dev/null
@@ -0,0 +1,93 @@
+Copyright (c) 2016-2019 The Inter Project Authors (me@rsms.me)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/eslint/docs/src/assets/fonts/Inter/README.txt b/eslint/docs/src/assets/fonts/Inter/README.txt
new file mode 100644 (file)
index 0000000..9f35f6c
--- /dev/null
@@ -0,0 +1,72 @@
+Inter Variable Font
+===================
+
+This download contains Inter as both a variable font and static fonts.
+
+Inter is a variable font with these axes:
+  slnt
+  wght
+
+This means all the styles are contained in a single file:
+  Inter-VariableFont_slnt,wght.ttf
+
+If your app fully supports variable fonts, you can now pick intermediate styles
+that aren’t available as static fonts. Not all apps support variable fonts, and
+in those cases you can use the static font files for Inter:
+  static/Inter-Thin.ttf
+  static/Inter-ExtraLight.ttf
+  static/Inter-Light.ttf
+  static/Inter-Regular.ttf
+  static/Inter-Medium.ttf
+  static/Inter-SemiBold.ttf
+  static/Inter-Bold.ttf
+  static/Inter-ExtraBold.ttf
+  static/Inter-Black.ttf
+
+Get started
+-----------
+
+1. Install the font files you want to use
+
+2. Use your app's font picker to view the font family and all the
+available styles
+
+Learn more about variable fonts
+-------------------------------
+
+  https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
+  https://variablefonts.typenetwork.com
+  https://medium.com/variable-fonts
+
+In desktop apps
+
+  https://theblog.adobe.com/can-variable-fonts-illustrator-cc
+  https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
+
+Online
+
+  https://developers.google.com/fonts/docs/getting_started
+  https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
+  https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
+
+Installing fonts
+
+  MacOS: https://support.apple.com/en-us/HT201749
+  Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
+  Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
+
+Android Apps
+
+  https://developers.google.com/fonts/docs/android
+  https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
+
+License
+-------
+Please read the full license text (OFL.txt) to understand the permissions,
+restrictions and requirements for usage, redistribution, and modification.
+
+You can use them freely in your products & projects - print or digital,
+commercial or otherwise.
+
+This isn't legal advice, please consider consulting a lawyer and see the full
+license for all details.
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Black.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Black.ttf
new file mode 100644 (file)
index 0000000..5653757
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Black.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf
new file mode 100644 (file)
index 0000000..e98b84c
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf
new file mode 100644 (file)
index 0000000..7f16a0f
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf
new file mode 100644 (file)
index 0000000..69426a3
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Light.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Light.ttf
new file mode 100644 (file)
index 0000000..a5f0736
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Light.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf
new file mode 100644 (file)
index 0000000..721147d
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf
new file mode 100644 (file)
index 0000000..71c56ff
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf
new file mode 100644 (file)
index 0000000..96fd6a1
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf
new file mode 100644 (file)
index 0000000..97c3b86
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf
new file mode 100644 (file)
index 0000000..ddb2792
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf b/eslint/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf
new file mode 100644 (file)
index 0000000..76be625
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf differ
diff --git a/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 b/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2
new file mode 100644 (file)
index 0000000..0d2e131
Binary files /dev/null and b/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 differ
diff --git a/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff b/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff
new file mode 100644 (file)
index 0000000..8f8bb5e
Binary files /dev/null and b/eslint/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff differ
diff --git a/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 b/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2
new file mode 100644 (file)
index 0000000..e7d5877
Binary files /dev/null and b/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 differ
diff --git a/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff b/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff
new file mode 100644 (file)
index 0000000..31832cf
Binary files /dev/null and b/eslint/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/OFL.txt b/eslint/docs/src/assets/fonts/Space_Grotesk/OFL.txt
new file mode 100644 (file)
index 0000000..f831dbc
--- /dev/null
@@ -0,0 +1,93 @@
+Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/README.txt b/eslint/docs/src/assets/fonts/Space_Grotesk/README.txt
new file mode 100644 (file)
index 0000000..a576174
--- /dev/null
@@ -0,0 +1,67 @@
+Space Grotesk Variable Font
+===========================
+
+This download contains Space Grotesk as both a variable font and static fonts.
+
+Space Grotesk is a variable font with this axis:
+  wght
+
+This means all the styles are contained in a single file:
+  SpaceGrotesk-VariableFont_wght.ttf
+
+If your app fully supports variable fonts, you can now pick intermediate styles
+that aren’t available as static fonts. Not all apps support variable fonts, and
+in those cases you can use the static font files for Space Grotesk:
+  static/SpaceGrotesk-Light.ttf
+  static/SpaceGrotesk-Regular.ttf
+  static/SpaceGrotesk-Medium.ttf
+  static/SpaceGrotesk-SemiBold.ttf
+  static/SpaceGrotesk-Bold.ttf
+
+Get started
+-----------
+
+1. Install the font files you want to use
+
+2. Use your app's font picker to view the font family and all the
+available styles
+
+Learn more about variable fonts
+-------------------------------
+
+  https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
+  https://variablefonts.typenetwork.com
+  https://medium.com/variable-fonts
+
+In desktop apps
+
+  https://theblog.adobe.com/can-variable-fonts-illustrator-cc
+  https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
+
+Online
+
+  https://developers.google.com/fonts/docs/getting_started
+  https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
+  https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
+
+Installing fonts
+
+  MacOS: https://support.apple.com/en-us/HT201749
+  Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
+  Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
+
+Android Apps
+
+  https://developers.google.com/fonts/docs/android
+  https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
+
+License
+-------
+Please read the full license text (OFL.txt) to understand the permissions,
+restrictions and requirements for usage, redistribution, and modification.
+
+You can use them freely in your products & projects - print or digital,
+commercial or otherwise.
+
+This isn't legal advice, please consider consulting a lawyer and see the full
+license for all details.
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf
new file mode 100644 (file)
index 0000000..1e79375
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf
new file mode 100644 (file)
index 0000000..869a60f
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf
new file mode 100644 (file)
index 0000000..76a195f
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf
new file mode 100644 (file)
index 0000000..721d8ae
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf
new file mode 100644 (file)
index 0000000..667905f
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf
new file mode 100644 (file)
index 0000000..792fe1b
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf
new file mode 100644 (file)
index 0000000..2171d9d
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/OFL.txt b/eslint/docs/src/assets/fonts/Space_Mono/OFL.txt
new file mode 100644 (file)
index 0000000..5bb7346
--- /dev/null
@@ -0,0 +1,93 @@
+Copyright 2016 Google Inc. All Rights Reserved.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf
new file mode 100644 (file)
index 0000000..18b8aea
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf
new file mode 100644 (file)
index 0000000..51fcc39
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf
new file mode 100644 (file)
index 0000000..119c545
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf
new file mode 100644 (file)
index 0000000..5cf5957
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf differ
diff --git a/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf
new file mode 100644 (file)
index 0000000..3374aca
Binary files /dev/null and b/eslint/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf differ
diff --git a/eslint/docs/src/assets/images/404.png b/eslint/docs/src/assets/images/404.png
new file mode 100644 (file)
index 0000000..347d160
Binary files /dev/null and b/eslint/docs/src/assets/images/404.png differ
diff --git a/eslint/docs/src/assets/images/architecture/dependency.svg b/eslint/docs/src/assets/images/architecture/dependency.svg
new file mode 100644 (file)
index 0000000..1609b53
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="522" preserveAspectRatio="none" style="width:439px;height:522px" width="439"><defs><filter height="300%" id="a" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2"/><feColorMatrix in="blurOut" result="blurOut2" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4" dy="4" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3"/></filter></defs><path fill="#FFF" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M271 24v.07l8-.208 8 .202 8 .07 8-.372 8 .238-.025-.008 1.29 4.425 1.413 4.463 1.5 4.491 1.202 4.398 1.62 4.528v.553l9.5-1.183 9.5.432 9.5.63 9.5-.518 9.5.154 9.5-.068h-.032l.21 10.784.061 10.784.347 10.783.085 10.784.008 10.784L375 111v.255l-10.4.209-10.4.238-10.4-1.423-10.4 1.4-10.4-.975-10.4.83-10.4-1.029-10.4.427-10.4.81L271 111h-.049l.154-9.667.234-9.666.077-9.667-.42-9.667.291-9.666-.86-9.667.857-9.667.264-9.666L271 24z"/><path d="M271 46.297v.28l9.4-.833 9.4.81 9.4.276 9.4-1.484 9.4.95" fill="#FFF" style="stroke:#000;stroke-width:1.5"/><text font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="24" x="280" y="38.995">bin</text><path fill="#FFF" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M22 135v.07l6.8-.208 6.8.202 6.8.07 6.8-.372L56 135l-.025-.008 1.29 4.425 1.413 4.464 1.5 4.49 1.202 4.397 1.62 4.529v.554l10.114-1.184 10.115.432 10.114.63 10.114-.518 10.114.154 10.115-.1 10.114.21 10.114.061 10.115.347 10.114.085 10.114.008 10.114-.424 10.115.209 10.114.238 10.114-1.423 10.115 1.4 10.114-.976 10.114.83 10.114-1.028 10.115.426 10.114.81 10.114-.79 10.115.154 10.114.234 10.114.077 10.114-.42 10.115.291 10.114-.86 10.114.857 10.115.264 10.114-.104 10.114.169 10.114-1.096 10.115-.17 10.114.653h-.621l.562 10.077-.137 10.077.877 10.078-.856 10.077-.168 10.077.571 10.077-.895 10.078.148 10.077 1.168 10.077-.213 10.077.299 10.077-1.057 10.078.641 10.077.271 10.077-1.062 10.077.376 10.078.222 10.077.526 10.077-.656 10.077.467 10.077-1.017 10.078-.123 10.077 1.18 10.077-1.22 10.077 1.226 10.078-.302 10.077-.475 10.077-.086 10.077.813 10.078-.758 10.077.89 10.077-1.144 10.077 1.17 10.078-.133 10.077L417 510v.245l-9.875-.198-9.875.68-9.875-.113-9.875-.445-9.875.1-9.875-.4-9.875.847-9.875-.561-9.875.018-9.875-.781-9.875.203-9.875.936-9.875-.101-9.875-.473-9.875-.28-9.875.104-9.875-.467-9.875 1.1-9.875.326-9.875-.214-9.875.169-9.875-.832-9.875.224-9.875-.475-9.875.672-9.875-.037-9.875.305-9.875-.782-9.875.096-9.875.577-9.875.124-9.875-1.08-9.875.32-9.875.342-9.875-.76-9.875.964-9.875-.095-9.875-.359-9.875.243L22 510h.729l-1.042-9.868.628-9.869-.03-9.868-.17-9.869.026-9.868-.027-9.869-.738-9.868.223-9.868-.06-9.869.525-9.868.024-9.869.074-9.868-.453-9.868.224-9.869-.053-9.868.697-9.869-.15-9.868-.912-9.869.412-9.868-.504-9.868.865-9.869.32-9.868-.063-9.869-.98-9.868.899-9.869-1.207-9.868.943-9.868-.5-9.869.397-9.868.143-9.869.232-9.868-1.192-9.869 1.195-9.868-.297-9.868.177-9.869.393-9.868-.742-9.869L22 135z"/><path d="M22 157.297v.093l8.2-.277 8.2.27 8.2.091 8.2-.494 8.2.317" fill="#FFF" style="stroke:#000;stroke-width:1.5"/><text font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="18" x="31" y="149.995">lib</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M287 59v.21l10.286-.624 10.285.607 10.286.207 10.286-1.113 10.286.635 10.285-.348L359 59h-.128l.105 7.26-.207 7.259.415 7.26-.395 7.258.21 7.26v-.198l-10.286.63-10.285-.518-10.286.154-10.286-.1-10.286.21-10.285.061-10.286-.24h.195l.029-7.259.002-7.259-.141-7.26.07-7.259L287 59z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="52" x="297" y="81.995">eslint.js</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M258.5 170v.21l9.8-.624 9.8.607 9.8.207 9.8-1.113 9.8.713h-.026l-.116 7.26.014 7.259.105 7.26-.207 7.258.23 7.26v.554l-9.8-1.184-9.8.432-9.8.63-9.8-.518-9.8.086h.023l-.034-7.26.07-7.259.02-7.26.116-7.259L258.5 170z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="29" x="268.5" y="192.995">cli.js</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M130.5 170v.21l9.167-.624 9.166.607 9.167.207 9.167-1.113 9.166.635 9.167.078h-.142l.014 7.26.105 7.259-.208 7.26.416 7.258-.185 7.26v-.63l-9.167.432-9.166.63-9.167-.518-9.167.154-9.166-.1-9.167.032h.06l.02-7.26.115-7.259.029-7.26.002-7.259L130.5 170z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="35" x="140.5" y="192.995">api.js</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M343 170v.07l8-.208 8 .202 8 .07 8-.372 8 .238h-.026l-.116 7.26.014 7.259.105 7.26-.207 7.258.23 7.26v.184l-8-.394-8 .144-8 .21-8-.173-8 .029h.023l-.034-7.26.07-7.259.02-7.26.116-7.259L343 170z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="20" x="353" y="192.995">init</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M239.5 266v.21l9.667-.624 9.666.607 9.667.207 9.667-1.113 9.666.635 9.667-.349 9.667.043 9.666.316 9.667.068h-.23l.415 7.26-.395 7.259.144 7.26.21 7.259-.144 7.259v-.086l-9.667.154-9.666-.1-9.667.21-9.667.061-9.666.347-9.667.085-9.667.008-9.666-.425-9.667-.254h.155l.08-7.26-.475-7.259.466-7.26-.325-7.259.099-7.259z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="67" x="249.5" y="288.995">cli-engine</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M178 362v.21l10.8-.624 10.8.607 10.8.207 10.8-1.113L232 362h-.026l-.116 7.26.014 7.259.105 7.26-.208 7.259.231 7.259v.553l-10.8-1.183-10.8.432-10.8.63-10.8-.518-10.8.086h.023l-.034-7.26.07-7.259.02-7.26.116-7.259L178 362z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="34" x="188" y="384.995">linter</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M94 458v.21l9.818-.624 9.818.607 9.819.207 9.818-1.113 9.818.635 9.818-.349 9.818.043 9.819.316 9.818-.623 9.818 1.245L202 458h-.21l.144 7.26.21 7.259-.173 7.26.052 7.259-.023 7.259v-.032l-9.818.21-9.818.061-9.819.347-9.818.085-9.818.008-9.818-.425-9.818.21-9.819.238-9.818-1.423-9.818 1.4-9.818-.68h-.099l.277-7.258-.343-7.26.142-7.26.27-7.259L94 458z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="88" x="104" y="480.995">source-code</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M75 266v.21l10.222-.624 10.222.607 10.223.207 10.222-1.113 10.222.635 10.222-.349 10.223.043 10.222.316L167 266h-.23l.415 7.26-.395 7.259.144 7.26.21 7.259-.144 7.259v-.086l-10.222.154-10.222-.1-10.223.21-10.222.061-10.222.347-10.222.085-10.223.008-10.222-.425L75 302.297h.154l.08-7.26-.474-7.259.466-7.26-.325-7.259L75 266z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="72" x="85" y="288.995">rule-tester</text><path fill="#F8F8F8" filter="url(#a)" style="stroke:#000;stroke-width:1.5" d="M292 458v.21l10.8-.624 10.8.607 10.8.207 10.8-1.113L346 458h-.026l-.116 7.26.014 7.259.105 7.26-.207 7.259.23 7.259v.553l-10.8-1.183-10.8.432-10.8.63-10.8-.518-10.8.086h.023l-.034-7.26.07-7.259.02-7.26.116-7.259L292 458z"/><text font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="34" x="302" y="480.995">rules</text><path d="M283 206.241h.28l-.832 10.843.81 10.844.275 10.843-1.484 10.844.951 10.843" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m283 265.868.064.029.61-1.885.985-1.718.863-1.772.46-1.95 1.018-1.704-.018-.018-.883.717-.79.81-.725.875-.947.653-.637.963.13.13-1.079-1.079-.698-.698-.651-.651-.922-.922-.78-.78.02.01.77 1.786.864 1.828.819 1.808.905 1.847.622 1.721z"/><path d="m164.598 206.218.088.032.676 2.49 1.192 2.679 1.023 2.617.473 2.417 1.235 2.693-.032-.01.878 2.935 1.043 2.991 1.158 3.032.763 2.895 1.316 3.086.235.075.512 3.03 1.197 3.247 1.28 3.274.796 3.119 1.05 3.2.029.009.86 3.184.995 3.221.93 3.203 1.052 3.238L184 266l.29.072.595 2.389.409 2.342.682 2.41.695 2.414.288 2.313-.312-.07 1.16 2.585.133 2.352.914 2.53.108 2.346.77 2.497-.03-.007.867 2.536.17 2.39.583 2.476.616 2.483.368 2.43.181.036.29 2.394.6 2.454.099 2.357.847 2.503.35 2.405.24.043.768 4.572.888 4.592.335 4.495.74 4.566 1.1 4.63-.273-.043.87 3.94.564 3.89 1.01 3.962.248 3.84.701 3.912" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m202.609 361.988.067.019.323-1.955.718-1.845.59-1.88.165-1.998.753-1.836-.021-.015-.766.84-.66.92-.588.972-.839.787-.486 1.047.11.148-1.145-.99-.825-.555-.785-.503-1.013-.811-.893-.65.019.013 1.03 1.643 1.12 1.698 1.075 1.672 1.157 1.723.894 1.556z"/><path d="m180.637 206.023.168.224 7.876 5.633 8.863 6.946 8.541 6.519 7.484 5.112 8.885 6.977 8.097 5.927 8.41 6.344 8.628 6.635 8.431 6.371" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m260.109 265.786.061.034-1.14-1.822-.78-1.623-.898-1.688-1.282-1.901-.75-1.606-.026-.004.044 1.104.172 1.123.263 1.134-.047 1.091.387 1.153.026.183-1.176-.233-1.1.302-1.09.366-1.145-.012-1.116.187.005.022 1.912.41 1.935.51 1.924.463 1.945.555 1.876.252z"/><path d="m151.214 206.241.26.103-4.36 8.803-2.83 9.405-3.33 9.21-4.966 8.564-2.796 9.419-3.489 9.146" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m127.743 265.868.05.05 1.257-1.53 1.546-1.238 1.452-1.333 1.143-1.646 1.57-1.213-.01-.023-1.084.344-1.031.465-.996.548-1.12.26-.946.663.17.074-.814-1.195-.319-.98-.259-.953-.61-1.107-.425-1.026.023.001.052 1.967.155 1.97.105 1.97.2 1.973-.109 1.959z"/><path d="m130.322 201.197.044.082-2.034.774-1.775 1.256-1.86 1.1-2.136.581-1.753 1.298-.018-.03-2.094 1.06-2.005 1.208-1.944 1.313-2.155.954-1.859 1.457.136.205-2.352.927-1.954 1.526-1.907 1.599-2.188 1.174-2.04 1.397.019.024-2.068 1.502-1.985 1.613-2.025 1.559-1.948 1.66-2.198 1.33.197.225-1.953 1.71-2.08 1.567-1.893 1.778-1.886 1.789-2.16 1.473-.231-.222-1.355 2.309-2.115 1.578-1.537 2.133-2.133 1.562-1.645 2.03-.024-.018-1.3 2.267-1.863 1.831-1.531 2.088-1.504 2.11-1.704 1.955.16.094-1.462 2.119-1.19 2.28-1.63 2.02-.974 2.406L57 266l.226.09-1.067 2.544-.954 2.588-1.477 2.38-1.094 2.532-.755 2.668-.27-.061-.35 2.67-.654 2.6-.215 2.7-.965 2.53-.52 2.63-.151-.011.05 2.669-.6 2.62-.138 2.654.314 2.69-.49 2.627.193.011.283 2.676-.319 2.642.435 2.684.27 2.675-.111 2.653-.207-.036.63 2.698.564 2.686.696 2.71.178 2.619.468 2.67.198.055.308 2.53.69 2.638 1.249 2.795.22 2.506 1.05 2.739.213.08.857 2.57.785 2.546.947 2.605 1.32 2.746.793 2.547-.121-.056 1.544 2.733.722 2.355 1.657 2.785 1.13 2.542.989 2.478.096.051 1.27 2.457 1.614 2.642 1.303 2.475 1.174 2.404 1.282 2.463.101.063 1.322 2.32 1.795 2.608 1.26 2.282 1.48 2.416 1.408 2.373-.224-.152 1.635 2.359 1.906 2.542 1.523 2.283 1.387 2.19 1.577 2.32-.116-.085 1.647 2.214 1.444 2.064 2.004 2.478 1.726 2.272 1.346 1.993.183.145 1.68 2.095 1.333 1.819 1.7 2.11 1.456 1.918 1.757 2.155.096.082 1.583 1.881 1.7 1.98 1.329 1.668 1.628 1.92 1.64 1.93.148.132 1.572 1.755 1.172 1.4 1.637 1.813 1.645 1.82 1.481 1.674-.198-.185 1.741 1.82 1.398 1.499 1.311 1.419 1.508 1.601 1.382 1.484" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m130.215 457.947.066.024-.873-1.921-.488-1.78-.613-1.826-1.026-1.977-.454-1.768h-.026l-.135 1.129-.003 1.132.087 1.132-.226 1.128.212 1.135.003.185-1.137-.413-1.13.126-1.127.192-1.134-.19-1.13.01.008.021 1.814.705 1.853.802 1.835.755 1.87.843 1.754.556z"/><path d="m364.479 206.028.093.003-.218 1.941.329 1.959.15 1.952-.435 1.935.376 1.96h-.035l-.18 2.236-.006 2.238.115 2.24-.301 2.235.282 2.241.245.015-.673 2.414.043 2.458.13 2.463-.377 2.432-.11 2.449.03.003-.357 2.57-.219 2.585-.284 2.578-.16 2.593-.57 2.543.293.058-.51 2.623-.7 2.587-.423 2.641-.41 2.643-.821 2.564-.308-.09-.16 2.766-1.172 2.47-.402 2.695-1.196 2.464-.545 2.654-.029-.012-.706 2.62-1.362 2.345-.976 2.507-.943 2.521-1.177 2.423.159.094-1.52 2.195-1.25 2.356-1.688 2.095-1.032 2.484L344 302l.188.155-2.17 2.563-2.075 2.639-2.51 2.282-2.192 2.544-1.91 2.777-.189-.202-2.301 2.499-2.514 2.271-2.205 2.601-2.732 2.038-2.419 2.373-.092-.122-2.565 2.255-2.957 1.734-2.679 2.104-2.405 2.465-2.892 1.822.103.164-2.801 1.91-3.121 1.4-2.72 2.04-2.808 1.9-3.011 1.576-.099-.185-2.855 1.704-2.887 1.643-2.824 1.762-3.07 1.299-2.932 1.557.085.187-3.09.914-2.926 1.276-2.685 1.802-3.128.832-2.77 1.615.083.21-2.83.98-2.858.91-2.794 1.07-2.647 1.44-2.856.916-.043-.125-2.435 1.27-2.733.417-2.394 1.388-2.585.841-2.636.694" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m232.067 371.819.008.07 1.935.007 1.98.415 1.966.282 1.918-.155 1.984.45-.012-.023-1.06-.622-.998-.505-.958-.425-1.1-.703-.9-.314.163.085.168-1.187.647-.94.704-.909.365-1.084.544-.993.015.017-1.493 1.285-1.424 1.363-1.457 1.325-1.394 1.397-1.601 1.164z"/><path d="m348.327 206.241.213.182-7.382 7.39-6.132 8.455-6.54 8.107-7.878 6.968-6.103 8.48-7.103 7.628-6.316 8.298" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m297.58 265.868.03.063 1.686-1.04 1.864-.67 1.805-.79 1.615-1.186 1.88-.638-.003-.026-1.137-.025-1.126.105-1.12.195-1.144-.116-1.11.32.185.015-.484-1.16.053-1.115.118-1.111-.263-1.142-.062-1.125.022.006-.59 1.88-.49 1.91-.538 1.894-.446 1.922-.745 1.834z"/><path d="m363.642 206.316.093.001-.22 3.917.329 3.924.15 3.922-.437 3.913.375 3.926h-.034l-.162 2.314.012 2.314.134 2.315-.284 2.314.3 2.316.247.004-.57 2.468.15 2.48.236 2.482-.274 2.473-.005 2.478h.03l-.134 2.583.003 2.588-.063 2.584.064 2.59-.35 2.575.298.016-.143 2.636-.334 2.625-.054 2.641-.04 2.642-.458 2.618-.32-.026.408 2.683-.644 2.597.156 2.661-.668 2.596.007 2.65-.03-.004.07 2.613-.638 2.534-.22 2.58-.185 2.585L360 302l.183.026-.476 2.05-.163 2.094-.67 2.023.086 2.129-.416 2.058.24.038-.378 2.096-.26 2.114-.815 2.026-.407 2.09-.047 2.148-.272-.048-.125 2.161-.43 2.107.014 2.185-.746 2.052-.293 2.13-.15-.028-.153 2.169-.793 2.047-.338 2.134.108 2.218-.686 2.067.19.04-.75 4.237-1.338 4.114-.6 4.268-.762 4.235-1.136 4.156-.204-.047-.782 4.13-.848 4.113-.717 4.144-1.228 4.026-.943 4.091.2.05-1.407 3.775-1.021 3.87-.459 4.01-1.494 3.753-.66 3.96.22.058-1.08 3.552-1.155 3.532-.987 3.576-.602 3.679-1.147 3.534-.128-.036-.51 3.306-1.381 3.062-.39 3.34-.949 3.182-1.099 3.142.105.03-.875 2.699-.5 2.807-.84 2.709-.98 2.667-.863 2.702" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m324.406 457.54.053.046 1.123-1.632 1.435-1.365 1.333-1.451 1-1.738 1.461-1.341-.012-.023-1.05.435-.99.551-.945.63-1.094.356-.885.74.162.088-.885-1.183-.411-.926-.354-.896-.69-1.077-.512-.982.022.003.22 1.95.321 1.962.272 1.956.367 1.969.059 1.928z"/><path d="m268.694 302.241.216.179-7.221 7.398-5.957 8.447-6.368 8.105-7.722 6.983-5.928 8.47-6.938 7.633-6.142 8.293" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m219.216 361.868.031.063 1.673-1.061 1.855-.693 1.796-.812 1.6-1.207 1.87-.661-.002-.026-1.137-.01-1.125.118-1.117.21-1.146-.103-1.105.335.184.017-.498-1.163.04-1.114.103-1.107-.276-1.142-.076-1.124.022.006-.566 1.887-.467 1.915-.514 1.902-.423 1.927-.722 1.843z"/><path d="m136.407 302.241.209.187 6.465 7.375 7.69 8.47 7.292 8.112 5.98 6.941 7.718 8.494 6.739 7.62 7.51 8.309" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m189.691 361.868.067.021-.801-1.939-.41-1.813-.537-1.854-.956-1.989-.377-1.802-.025-.002-.18 1.123-.05 1.13.042 1.136-.27 1.118.166 1.142.01.185-1.152-.458-1.121.08-1.118.147-1.14-.236-1.127-.035.009.02 1.782.78 1.825.873 1.804.827 1.843.915 1.716.631z"/><path d="m225.645 398.023.178.216 7.08 5.633 8.127 6.9 7.785 6.488 6.666 5.13 8.15 6.93 7.314 5.916 7.647 6.32 7.878 6.599 7.668 6.345" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m298.124 457.786.063.032-1.067-1.856-.699-1.671-.818-1.732-1.212-1.928-.667-1.656-.026-.002-.007 1.115.122 1.127.213 1.136-.098 1.107.338 1.148.017.184-1.163-.285-1.113.252-1.106.318-1.142-.064-1.124.137.006.022 1.889.495 1.917.596 1.903.547 1.928.639 1.846.34z"/><path d="m194.545 398.241.24.145-6.279 8.749-4.874 9.6-5.33 9.322-6.836 8.41-4.842 9.62-5.478 9.234" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m158.388 457.868.04.058 1.499-1.295 1.733-.958 1.656-1.068 1.406-1.429 1.754-.928-.007-.025-1.126.156-1.096.283-1.074.37-1.148.068-1.044.493.18.044-.653-1.193-.13-1.064-.064-1.05-.437-1.14-.242-1.091.023.003-.283 1.95-.18 1.962-.229 1.957-.135 1.968-.443 1.93z"/><path d="m316.75 95.031.263.096-4.448 9.704-2.905 10.27-3.408 10.084-5.06 9.479-2.87 10.282-4.103 9.83-3.132 10.186" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m289.338 169.729.05.049 1.222-1.56 1.517-1.272 1.42-1.367 1.105-1.672 1.542-1.249-.01-.023-1.076.37-1.021.488-.983.57-1.113.288-.93.684.167.078-.833-1.193-.345-.966-.285-.938-.632-1.1-.45-1.014.024.001.097 1.964.2 1.97.152 1.967.246 1.972-.064 1.953z"/><path d="m329.25 95.031.263.096 2.885 9.704 4.426 10.27 3.925 10.084 2.273 9.479 4.461 10.282 3.23 9.83 4.2 10.186" fill="none" style="stroke:#383838;stroke-width:1;stroke-dasharray:7,7"/><path fill="#383838" style="stroke:#383838;stroke-width:1" d="m356.662 169.729.07.005-.077-1.98.333-1.952.2-1.96-.24-1.99.368-1.95-.023-.011-.581.978-.462 1.032-.38 1.071-.664.94-.267 1.123.078.168-1.193-.834-.966-.344-.938-.285-1.1-.632-1.014-.45.016.016 1.348 1.391 1.421 1.463 1.386 1.428 1.454 1.495 1.231 1.278z"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg
new file mode 100644 (file)
index 0000000..f81d361
--- /dev/null
@@ -0,0 +1 @@
+<svg width="167pt" height="422pt" viewBox="0 0 167 422" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="74" cy="-405" r="9" class="node" transform="translate(4 418)"/><g class="node"><path fill="#fff" stroke="#fff" d="M127.479 58.398H28.521l-12 12v17.204l12 12h98.958l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M28.521 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m98.958 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M127.479 58.398H28.521m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h98.958m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="74" y="-343.2" font-family="Times,serif" font-size="14" transform="translate(4 418)">Program</text><text text-anchor="middle" x="74" y="-326.4" font-family="Times,serif" font-size="14" transform="translate(4 418)">DoWhileStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M78 22.106V48.06"/><path d="m81.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 418)"><circle cx="74" cy="-13" r="9"/><circle fill="none" cx="74" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M133.147 135.599H22.853l-12 12v118.802l12 12h110.294l12-12V147.599l-12-12z"/><path fill="#fff" stroke="#fff" d="M22.853 135.599c-6 0-12 6-12 12m0 118.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-118.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M133.147 135.599H22.853m0 0c-6 0-12 6-12 12m0 0v118.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V147.599m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="74" y="-265.6" font-family="Times,serif" font-size="14" transform="translate(4 418)">BlockStatement</text><text text-anchor="middle" x="74" y="-248.8" font-family="Times,serif" font-size="14" transform="translate(4 418)">ExpressionStatement</text><text text-anchor="middle" x="74" y="-232" font-family="Times,serif" font-size="14" transform="translate(4 418)">CallExpression</text><text text-anchor="middle" x="74" y="-215.2" font-family="Times,serif" font-size="14" transform="translate(4 418)">Identifier (foo)</text><text text-anchor="middle" x="74" y="-198.4" font-family="Times,serif" font-size="14" transform="translate(4 418)">ExpressionStatement</text><text text-anchor="middle" x="74" y="-181.6" font-family="Times,serif" font-size="14" transform="translate(4 418)">CallExpression</text><text text-anchor="middle" x="74" y="-164.8" font-family="Times,serif" font-size="14" transform="translate(4 418)">Identifier (bar)</text><text text-anchor="middle" x="74" y="-148" font-family="Times,serif" font-size="14" transform="translate(4 418)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M78 99.687v25.858"/><path d="m81.5 125.632-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M145.337 185.005C155.84 188.293 163 195.625 163 207c0 7.643-3.232 13.46-8.539 17.452"/><path d="m155.849 227.671-10.512 1.324 7.392-7.591 3.12 6.267z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M140.144 314.398H15.856l-12 12v17.204l12 12h124.288l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.856 314.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m124.288 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M140.144 314.398H15.856m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h124.288m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="74" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 418)">DoWhileStatement:exit</text><text text-anchor="middle" x="74" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 418)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="M78 278.368v25.821"/><path d="m81.5 304.274-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M78 355.668v25.812"/><path d="m81.5 381.651-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-forinstatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-forinstatement.svg
new file mode 100644 (file)
index 0000000..a6bc754
--- /dev/null
@@ -0,0 +1 @@
+<svg width="185pt" height="538pt" viewBox="0 0 185 538" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="114" cy="-521" r="9" class="node" transform="translate(4 534)"/><g class="node"><path fill="#fff" stroke="#fff" d="M157.319 58.398H78.681l-12 12v17.204l12 12h78.638l12-12V70.398l-12-12zm-78.639 0c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12"/><path fill="#fff" stroke="#fff" d="M157.319 99.602c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M157.319 58.398H78.681m-.001 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h78.639m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-459.2" font-family="Times,serif" font-size="14" transform="translate(4 534)">Program</text><text text-anchor="middle" x="114" y="-442.4" font-family="Times,serif" font-size="14" transform="translate(4 534)">ForInStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 22.106V48.06"/><path d="m121.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 534)"><circle cx="114" cy="-13" r="9"/><circle fill="none" cx="114" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M155.097 136H80.903l-12 12v12l12 12h74.194l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M80.903 136c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m74.194 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M155.097 136H80.903m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h74.194m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-375.8" font-family="Times,serif" font-size="14" transform="translate(4 534)">Identifier (obj)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 99.948v25.416"/><path d="m121.5 125.561-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M123.617 207.599H18.383l-12 12v34.802l12 12h105.234l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M18.383 207.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M123.617 207.599H18.383m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-309.6" font-family="Times,serif" font-size="14" transform="translate(4 534)">VariableDeclaration</text><text text-anchor="middle" x="67" y="-292.8" font-family="Times,serif" font-size="14" transform="translate(4 534)">VariableDeclarator</text><text text-anchor="middle" x="67" y="-276" font-family="Times,serif" font-size="14" transform="translate(4 534)">Identifier (key)</text></g><g class="edge" stroke="#000"><path fill="none" d="m108.033 172.178-15.499 26.71"/><path d="m95.472 200.799-8.046 6.892 1.992-10.406 6.054 3.514z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M169.484 430.398H66.516l-12 12v17.204l12 12h102.968l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M66.516 430.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m102.968 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M169.484 430.398H66.516m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h102.968m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 534)">ForInStatement:exit</text><text text-anchor="middle" x="114" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 534)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="M128.891 172.427C134.533 182.434 140.88 195.469 144 208c19.973 80.229 22.566 105.671 3 186-2.283 9.374-6.431 18.931-10.889 27.433"/><path d="m139.155 423.16-7.93 7.026 1.818-10.437 6.112 3.411z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 302H15.853l-12 12v68l12 12h110.294l12-12v-68l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 302c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 302H15.853m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-68m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-215.4" font-family="Times,serif" font-size="14" transform="translate(4 534)">BlockStatement</text><text text-anchor="middle" x="67" y="-198.6" font-family="Times,serif" font-size="14" transform="translate(4 534)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-181.8" font-family="Times,serif" font-size="14" transform="translate(4 534)">CallExpression</text><text text-anchor="middle" x="67" y="-165" font-family="Times,serif" font-size="14" transform="translate(4 534)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-148.2" font-family="Times,serif" font-size="14" transform="translate(4 534)">Identifier (key)</text></g><g class="edge" stroke="#000"><path fill="none" d="M64.994 266.354c-.48 7.798-.728 16.532-.743 25.295"/><path d="m67.753 291.866-3.413 10.03-3.587-9.969 7-.061z"/></g><g class="edge" stroke="#000"><path fill="none" d="M77.66 301.896c.163-8.46.104-17.23-.178-25.464"/><path d="m73.982 276.508 3.024-10.154 3.968 9.823-6.992.331z"/></g><g class="edge" stroke="#000"><path fill="none" d="m92.026 394.183 12.419 26.689"/><path d="m107.718 419.608 1.045 10.543-7.392-7.59 6.347-2.953z"/></g><g class="edge" stroke="#000"><path fill="none" d="M118 471.668v25.812"/><path d="m121.5 497.651-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg b/eslint/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg
new file mode 100644 (file)
index 0000000..4d334ca
--- /dev/null
@@ -0,0 +1 @@
+<svg width="160pt" height="288" viewBox="0 0 160 216" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="67" cy="-199" r="9" class="node" transform="translate(4 212)"/><g class="node"><path fill="#fff" stroke="#fff" d="M104.573 58.398H37.427l-12 12v17.204l12 12h67.146l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M37.427 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m67.146 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M104.573 58.398H37.427m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h67.146m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-137.2" font-family="Times,serif" font-size="14" transform="translate(4 212)">Program</text><text text-anchor="middle" x="67" y="-120.4" font-family="Times,serif" font-size="14" transform="translate(4 212)">ForStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M71 22.106V48.06"/><path d="m74.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 136.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 136.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 136.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-59" font-family="Times,serif" font-size="14" transform="translate(4 212)">BlockStatement</text><text text-anchor="middle" x="67" y="-42.2" font-family="Times,serif" font-size="14" transform="translate(4 212)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-25.4" font-family="Times,serif" font-size="14" transform="translate(4 212)">CallExpression</text><text text-anchor="middle" x="67" y="-8.6" font-family="Times,serif" font-size="14" transform="translate(4 212)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M71 99.723v26.297"/><path d="m74.5 126.035-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M138.337 157.848C148.84 160.262 156 165.647 156 174c0 5.482-3.084 9.685-8.172 12.61"/><path d="m148.93 189.934-10.593.218 8.145-6.776 2.448 6.558z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-forstatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-forstatement.svg
new file mode 100644 (file)
index 0000000..aa0ccf0
--- /dev/null
@@ -0,0 +1 @@
+<svg width="350pt" height="646pt" viewBox="0 0 350 646" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="174" cy="-629" r="9" class="node" transform="translate(4 642)"/><g class="node"><path fill="#fff" stroke="#fff" d="M230.617 58.7H125.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M125.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M230.617 58.7H125.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="174" y="-566.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">Program</text><text text-anchor="middle" x="174" y="-550" font-family="Times,serif" font-size="14" transform="translate(4 642)">ForStatement</text><text text-anchor="middle" x="174" y="-533.2" font-family="Times,serif" font-size="14" transform="translate(4 642)">VariableDeclaration</text><text text-anchor="middle" x="174" y="-516.4" font-family="Times,serif" font-size="14" transform="translate(4 642)">VariableDeclarator</text><text text-anchor="middle" x="174" y="-499.6" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (i)</text><text text-anchor="middle" x="174" y="-482.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M178 22.02v26.167"/><path d="m181.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 642)"><circle cx="58" cy="-13" r="9"/><circle fill="none" cx="58" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M224.233 203.599h-92.466l-12 12v34.802l12 12h92.466l12-12v-34.802l-12-12zm-92.466 0c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12"/><path fill="#fff" stroke="#fff" d="M224.233 262.401c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M224.233 203.599h-92.466m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="174" y="-421.6" font-family="Times,serif" font-size="14" transform="translate(4 642)">BinaryExpression</text><text text-anchor="middle" x="174" y="-404.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (i)</text><text text-anchor="middle" x="174" y="-388" font-family="Times,serif" font-size="14" transform="translate(4 642)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M178 167.476v25.952"/><path d="m181.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M233.147 298.7H122.853l-12 12v84.6l12 12h110.294l12-12v-84.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M122.853 298.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M233.147 298.7H122.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-84.6m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="174" y="-326.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">BlockStatement</text><text text-anchor="middle" x="174" y="-310" font-family="Times,serif" font-size="14" transform="translate(4 642)">ExpressionStatement</text><text text-anchor="middle" x="174" y="-293.2" font-family="Times,serif" font-size="14" transform="translate(4 642)">CallExpression</text><text text-anchor="middle" x="174" y="-276.4" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (foo)</text><text text-anchor="middle" x="174" y="-259.6" font-family="Times,serif" font-size="14" transform="translate(4 642)">IfStatement</text><text text-anchor="middle" x="174" y="-242.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (b)</text></g><g class="edge" stroke="#000"><path fill="none" d="M178 262.264v26.278"/><path d="m181.5 288.546-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M108.239 538.398H15.761l-12 12v17.204l12 12h92.478l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.761 538.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m92.478 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M108.239 538.398H15.761m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h92.478m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="58" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 642)">ForStatement:exit</text><text text-anchor="middle" x="58" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 642)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="M137.184 262.461C124.713 272.608 111.737 284.819 102 298c-41.888 56.703-47.94 76.919-62 146-5.141 25.26-4.797 32.672 0 58 1.704 8.999 4.822 18.404 8.185 26.88"/><path d="m51.508 527.751.668 10.573-7.116-7.849 6.448-2.724z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M142.572 452.398H61.428l-12 12v17.204l12 12h81.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M61.428 452.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m81.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M142.572 452.398H61.428m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h81.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="98" y="-173.2" font-family="Times,serif" font-size="14" transform="translate(4 642)">BlockStatement</text><text text-anchor="middle" x="98" y="-156.4" font-family="Times,serif" font-size="14" transform="translate(4 642)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="m143.558 407.476-23.304 36.182"/><path d="m123.046 445.787-8.357 6.512 2.472-10.302 5.885 3.79z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M295.147 443.599H184.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M184.853 443.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M295.147 443.599H184.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="236" y="-181.6" font-family="Times,serif" font-size="14" transform="translate(4 642)">ExpressionStatement</text><text text-anchor="middle" x="236" y="-164.8" font-family="Times,serif" font-size="14" transform="translate(4 642)">CallExpression</text><text text-anchor="middle" x="236" y="-148" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m206.098 407.476 14.215 27.054"/><path d="m223.498 433.068 1.553 10.48-7.75-7.224 6.197-3.256z"/></g><g class="edge" stroke="#000"><path fill="none" d="M92.52 493.907c-4.98 10.461-11.18 23.478-16.687 35.044"/><path d="m78.87 530.712-7.459 7.524 1.14-10.533 6.32 3.009z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M333.977 538.398h-93.954l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M240.023 538.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M333.977 538.398h-93.954m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="283" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 642)">UpdateExpression</text><text text-anchor="middle" x="283" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 642)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="m255.912 502.439 15.197 27.161"/><path d="m274.167 527.896 1.828 10.436-7.937-7.018 6.109-3.418z"/></g><g class="edge" stroke="#000"><path fill="none" d="M300.225 538.186C306.324 527.868 312.891 514.765 316 502c6.1-25.046 5.141-32.74 0-58-14.06-69.081-20.112-89.297-62-146-7.683-10.4-17.383-20.197-27.26-28.853"/><path d="m224.202 271.585-5.386-9.124 9.9 3.774-4.514 5.35z"/></g><g class="edge" stroke="#000"><path fill="none" d="M62 579.668v25.812"/><path d="m65.5 605.651-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-hello-world.svg b/eslint/docs/src/assets/images/code-path-analysis/example-hello-world.svg
new file mode 100644 (file)
index 0000000..fc28d1f
--- /dev/null
@@ -0,0 +1 @@
+<svg width="146pt" height="250pt" viewBox="0 0 146 250" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="69" cy="-233" r="9" class="node" transform="translate(4 246)"/><g class="node"><path fill="#fff" stroke="#fff" d="M130.042 58.399H15.958l-12 12v101.202l12 12h114.084l12-12V70.399l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.958 58.399c-6 0-12 6-12 12m0 101.201c0 6 6 12 12 12m114.084 0c6 0 12-6 12-12m0-101.201c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M130.042 58.399H15.958m0 0c-6 0-12 6-12 12m0 0v101.202m0-.001c0 6 6 12 12 12m0 0h114.084m0 0c6 0 12-6 12-12m0 0V70.4m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="69" y="-171.2" font-family="Times,serif" font-size="14" transform="translate(4 246)">Program</text><text text-anchor="middle" x="69" y="-154.4" font-family="Times,serif" font-size="14" transform="translate(4 246)">ExpressionStatement</text><text text-anchor="middle" x="69" y="-137.6" font-family="Times,serif" font-size="14" transform="translate(4 246)">CallExpression</text><text text-anchor="middle" x="69" y="-120.8" font-family="Times,serif" font-size="14" transform="translate(4 246)">MemberExpression</text><text text-anchor="middle" x="69" y="-104" font-family="Times,serif" font-size="14" transform="translate(4 246)">Identifier (console)</text><text text-anchor="middle" x="69" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 246)">Identifier (log)</text><text text-anchor="middle" x="69" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 246)">Literal (Hello world!)</text></g><g class="edge" stroke="#000"><path fill="none" d="M73 22.318V48.14"/><path d="m76.5 48.325-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 246)"><circle cx="69" cy="-13" r="9"/><circle fill="none" cx="69" cy="-13" r="13"/></g><g class="edge" stroke="#000"><path fill="none" d="M73 183.752v25.814"/><path d="m76.5 209.705-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg b/eslint/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg
new file mode 100644 (file)
index 0000000..0944c3b
--- /dev/null
@@ -0,0 +1 @@
+<svg width="371pt" height="562pt" viewBox="0 0 371 562" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="114" cy="-545" r="9" class="node" transform="translate(4 558)"/><g class="node"><path fill="#fff" stroke="#fff" d="M149.339 57.599H86.661l-12 12v34.802l12 12h62.678l12-12V69.599l-12-12z"/><path fill="#fff" stroke="#fff" d="M86.661 57.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M149.339 57.599H86.661m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0V69.599m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-483.6" font-family="Times,serif" font-size="14" transform="translate(4 558)">Program</text><text text-anchor="middle" x="114" y="-466.8" font-family="Times,serif" font-size="14" transform="translate(4 558)">IfStatement</text><text text-anchor="middle" x="114" y="-450" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 22.259v25.126"/><path d="m121.5 47.676-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 558)"><circle cx="181" cy="-13" r="9"/><circle fill="none" cx="181" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 342.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 342.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 342.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 558)">BlockStatement</text><text text-anchor="middle" x="67" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">CallExpression</text><text text-anchor="middle" x="67" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M111.798 116.456C105.706 145.052 96.415 190.438 90 230c-5.526 34.079-10.418 72.759-13.854 102.168"/><path d="m79.617 332.627-4.624 9.533-2.33-10.335 6.954.802z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M197.429 152.398h-62.858l-12 12v17.204l12 12h62.858l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M134.571 152.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m62.858 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M197.429 152.398h-62.858m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h62.858m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-389.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">IfStatement</text><text text-anchor="middle" x="162" y="-372.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (b)</text></g><g class="edge" stroke="#000"><path fill="none" d="m134.251 116.439 15.52 27.161"/><path d="m152.839 141.913 1.922 10.419-8-6.946 6.078-3.473z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M226.147 454.398h-82.294l-12 12v17.204l12 12h82.294l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M143.853 454.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.294 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M226.147 454.398h-82.294m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.294m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="181" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">IfStatement:exit</text><text text-anchor="middle" x="181" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="m116.056 417.756 36.853 30.065"/><path d="m155.37 445.311 5.536 9.034-9.961-3.61 4.425-5.424z"/></g><g class="edge" stroke="#000"><path fill="none" d="M185 495.668v25.812"/><path d="m188.5 521.651-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 230.3H110.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 230.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 230.3H110.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-311" font-family="Times,serif" font-size="14" transform="translate(4 558)">BlockStatement</text><text text-anchor="middle" x="162" y="-294.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-277.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">CallExpression</text><text text-anchor="middle" x="162" y="-260.6" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="M166 193.723v26.297"/><path d="m169.5 220.035-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M326.339 247.398h-62.678l-12 12v17.204l12 12h62.678l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M263.661 247.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M326.339 247.398h-62.678m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="291" y="-294.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">IfStatement</text><text text-anchor="middle" x="291" y="-277.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (c)</text></g><g class="edge" stroke="#000"><path fill="none" d="m193.358 193.723 66.024 47.599"/><path d="m261.617 238.618 6.065 8.688-10.159-3.009 4.094-5.679z"/></g><g class="edge" stroke="#000"><path fill="none" d="m169.397 305.65 12.853 138.677"/><path d="m185.744 444.107-2.562 10.28-4.408-9.634 6.97-.646z"/></g><g class="edge" stroke="#000"><path fill="none" d="M270.084 288.608C254.495 302.092 235.136 321.258 223 342c-18.795 32.122-28.797 74.136-33.741 102.043"/><path d="m192.697 444.707-5.093 9.291-1.813-10.439 6.906 1.148z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M354.147 342.3H243.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M243.853 342.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M354.147 342.3H243.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="295" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 558)">BlockStatement</text><text text-anchor="middle" x="295" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 558)">ExpressionStatement</text><text text-anchor="middle" x="295" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 558)">CallExpression</text><text text-anchor="middle" x="295" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 558)">Identifier (hoge)</text></g><g class="edge" stroke="#000"><path fill="none" d="m295.715 288.666 1.571 43.187"/><path d="m300.795 332.041-3.135 10.12-3.861-9.866 6.996-.254z"/></g><g class="edge" stroke="#000"><path fill="none" d="m253.944 417.756-36.853 30.065"/><path d="m219.055 450.735-9.961 3.61 5.536-9.034 4.425 5.424z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-ifstatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-ifstatement.svg
new file mode 100644 (file)
index 0000000..b83c67b
--- /dev/null
@@ -0,0 +1 @@
+<svg width="392" height="496" viewBox="0 0 294 372" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="143" cy="-355" r="9" class="node" transform="translate(4 368)"/><g class="node"><path fill="#fff" stroke="#fff" d="M178.339 57.599h-62.678l-12 12v34.802l12 12h62.678l12-12V69.599l-12-12z"/><path fill="#fff" stroke="#fff" d="M115.661 57.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M178.339 57.599h-62.678m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0V69.599m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="143" y="-293.6" font-family="Times,serif" font-size="14" transform="translate(4 368)">Program</text><text text-anchor="middle" x="143" y="-276.8" font-family="Times,serif" font-size="14" transform="translate(4 368)">IfStatement</text><text text-anchor="middle" x="143" y="-260" font-family="Times,serif" font-size="14" transform="translate(4 368)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M147 22.259v25.126"/><path d="m150.5 47.676-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 368)"><circle cx="143" cy="-13" r="9"/><circle fill="none" cx="143" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 152.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 152.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 152.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 368)">BlockStatement</text><text text-anchor="middle" x="67" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 368)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 368)">CallExpression</text><text text-anchor="middle" x="67" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 368)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="m125.628 116.403-20.757 27.584"/><path d="m107.554 146.243-8.81 5.886 3.216-10.095 5.594 4.209z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M278.147 152.3H167.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M167.853 152.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M278.147 152.3H167.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="219" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 368)">BlockStatement</text><text text-anchor="middle" x="219" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 368)">ExpressionStatement</text><text text-anchor="middle" x="219" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 368)">CallExpression</text><text text-anchor="middle" x="219" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 368)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m168.372 116.403 20.757 27.584"/><path d="m192.04 142.034 3.216 10.095-8.81-5.886 5.594-4.209z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M188.147 264.398h-82.294l-12 12v17.204l12 12h82.294l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M105.853 264.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.294 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M188.147 264.398h-82.294m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.294m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="143" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 368)">IfStatement:exit</text><text text-anchor="middle" x="143" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 368)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="m101.037 227.756 23.451 28.697"/><path d="m127.32 254.387 3.618 9.958-9.039-5.529 5.421-4.429z"/></g><g class="edge" stroke="#000"><path fill="none" d="M147 305.668v25.812"/><path d="m150.5 331.651-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="m192.963 227.756-23.451 28.697"/><path d="m172.101 258.816-9.039 5.529 3.618-9.958 5.421 4.429z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg b/eslint/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg
new file mode 100644 (file)
index 0000000..5d6d739
--- /dev/null
@@ -0,0 +1 @@
+<svg width="347pt" height="802pt" viewBox="0 0 347 802" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="121" cy="-785" r="9" class="node" transform="translate(4 798)"/><g class="node"><path fill="#fff" stroke="#fff" d="M168.156 58H81.844l-12 12v68l12 12h86.312l12-12V70l-12-12z"/><path fill="#fff" stroke="#fff" d="M81.844 58c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m86.312 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M168.156 58H81.844m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h86.312m0 0c6 0 12-6 12-12m0 0V70m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="121" y="-723.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Program</text><text text-anchor="middle" x="121" y="-706.6" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchStatement</text><text text-anchor="middle" x="121" y="-689.8" font-family="Times,serif" font-size="14" transform="translate(4 798)">Identifier (a)</text><text text-anchor="middle" x="121" y="-673" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchCase</text><text text-anchor="middle" x="121" y="-656.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M125 22.213v25.49"/><path d="m128.5 47.881-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 798)"><circle cx="162" cy="-13" r="9"/><circle fill="none" cx="162" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 264.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 264.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 264.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-517" font-family="Times,serif" font-size="14" transform="translate(4 798)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-500.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">CallExpression</text><text text-anchor="middle" x="67" y="-483.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-466.6" font-family="Times,serif" font-size="14" transform="translate(4 798)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M112.476 150.459 83.82 254.467"/><path d="m87.14 255.595-6.03 8.711-.719-10.57 6.749 1.859z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M195.072 186.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M136.928 186.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M195.072 186.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-595.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchCase</text><text text-anchor="middle" x="162" y="-578.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Literal (1)</text></g><g class="edge" stroke="#000"><path fill="none" d="m143.341 150.183 10.835 26.689"/><path d="m157.424 175.569.519 10.582-7.005-7.949 6.486-2.633z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.321 694.398H110.679l-12 12v17.204l12 12h110.642l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.679 694.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m110.642 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.321 694.398H110.679m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h110.642m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchStatement:exit</text><text text-anchor="middle" x="162" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="M69.96 339.873C69.488 388.054 71.683 474.685 90 546c13.193 51.361 41.133 106.594 59.212 139.184"/><path d="m152.402 683.716 1.852 10.432-7.953-7 6.101-3.432z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 375.599H110.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 375.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 375.599H110.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-405.6" font-family="Times,serif" font-size="14" transform="translate(4 798)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-388.8" font-family="Times,serif" font-size="14" transform="translate(4 798)">CallExpression</text><text text-anchor="middle" x="162" y="-372" font-family="Times,serif" font-size="14" transform="translate(4 798)">Identifier (bar)</text></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 470.3H110.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 470.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 470.3H110.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-311" font-family="Times,serif" font-size="14" transform="translate(4 798)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-294.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">CallExpression</text><text text-anchor="middle" x="162" y="-277.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Identifier (hoge)</text><text text-anchor="middle" x="162" y="-260.6" font-family="Times,serif" font-size="14" transform="translate(4 798)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M166 434.403v25.592"/><path d="m169.5 460.129-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M166 545.65v138.677"/><path d="m169.5 684.387-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M331.147 582.3H220.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M220.853 582.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M331.147 582.3H220.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="272" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 798)">ExpressionStatement</text><text text-anchor="middle" x="272" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">CallExpression</text><text text-anchor="middle" x="272" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Identifier (fuga)</text><text text-anchor="middle" x="272" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 798)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="m232.525 657.756-35.56 30.065"/><path d="m199.145 690.561-9.897 3.784 5.377-9.13 4.52 5.346z"/></g><g class="edge" stroke="#000"><path fill="none" d="M166 735.668v25.812"/><path d="m169.5 761.651-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M166 227.872v137.454"/><path d="m169.5 365.576-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M264.072 281.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M205.928 281.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M264.072 281.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="231" y="-500.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchCase</text><text text-anchor="middle" x="231" y="-483.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Literal (2)</text></g><g class="edge" stroke="#000"><path fill="none" d="m180.633 227.723 33.661 45.369"/><path d="m217.24 271.189 3.148 10.117-8.769-5.946 5.621-4.171z"/></g><g class="edge" stroke="#000"><path fill="none" d="m221.368 322.954-30.177 44.172"/><path d="m193.882 369.392-8.531 6.283 2.751-10.232 5.78 3.949z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M321.072 384.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M262.928 384.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M321.072 384.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="288" y="-397.2" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchCase</text><text text-anchor="middle" x="288" y="-380.4" font-family="Times,serif" font-size="14" transform="translate(4 798)">Literal (3)</text></g><g class="edge" stroke="#000"><path fill="none" d="m246.261 322.954 29.523 52.312"/><path d="m278.895 373.658 1.867 10.429-7.963-6.989 6.096-3.44z"/></g><g class="edge" stroke="#000"><path fill="none" d="m267.407 425.714-47.656 38.2"/><path d="m221.69 466.845-9.992 3.524 5.614-8.986 4.378 5.462z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M321.072 490h-58.144l-12 12v12l12 12h58.144l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M262.928 490c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M321.072 490h-58.144m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="288" y="-285.8" font-family="Times,serif" font-size="14" transform="translate(4 798)">SwitchCase</text></g><g class="edge" stroke="#000"><path fill="none" d="M292 425.954v53.445"/><path d="m295.5 479.777-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="m289.5 526.187-6.716 46.173"/><path d="m286.231 572.98-4.903 9.392-2.024-10.4 6.927 1.008z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-switchstatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-switchstatement.svg
new file mode 100644 (file)
index 0000000..e43e5e1
--- /dev/null
@@ -0,0 +1 @@
+<svg width="337pt" height="920" viewBox="0 0 337 690" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="121" cy="-673" r="9" class="node" transform="translate(4 686)"/><g class="node"><path fill="#fff" stroke="#fff" d="M168.156 58H81.844l-12 12v68l12 12h86.312l12-12V70l-12-12z"/><path fill="#fff" stroke="#fff" d="M81.844 58c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m86.312 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M168.156 58H81.844m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h86.312m0 0c6 0 12-6 12-12m0 0V70m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="121" y="-611.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Program</text><text text-anchor="middle" x="121" y="-594.6" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchStatement</text><text text-anchor="middle" x="121" y="-577.8" font-family="Times,serif" font-size="14" transform="translate(4 686)">Identifier (a)</text><text text-anchor="middle" x="121" y="-561" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchCase</text><text text-anchor="middle" x="121" y="-544.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M125 22.213v25.49"/><path d="m128.5 47.881-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 686)"><circle cx="170" cy="-13" r="9"/><circle fill="none" cx="170" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 264.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 264.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 264.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-405" font-family="Times,serif" font-size="14" transform="translate(4 686)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-388.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">CallExpression</text><text text-anchor="middle" x="67" y="-371.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-354.6" font-family="Times,serif" font-size="14" transform="translate(4 686)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M112.476 150.459 83.82 254.467"/><path d="m87.14 255.595-6.03 8.711-.719-10.57 6.749 1.859z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M195.072 186.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M136.928 186.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M195.072 186.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-483.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchCase</text><text text-anchor="middle" x="162" y="-466.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Literal (1)</text></g><g class="edge" stroke="#000"><path fill="none" d="m143.341 150.183 10.835 26.689"/><path d="m157.424 175.569.519 10.582-7.005-7.949 6.486-2.633z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M229.321 582.398H118.679l-12 12v17.204l12 12h110.642l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M118.679 582.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m110.642 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M229.321 582.398H118.679m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h110.642m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="170" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchStatement:exit</text><text text-anchor="middle" x="170" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="M66.364 339.973C61.915 390.184 60.565 481.104 98 546c6.985 12.109 17.753 22.366 29.007 30.661"/><path d="m129.004 573.787 6.236 8.565-10.216-2.807 3.98-5.758z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 375.599H110.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 375.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 375.599H110.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-293.6" font-family="Times,serif" font-size="14" transform="translate(4 686)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-276.8" font-family="Times,serif" font-size="14" transform="translate(4 686)">CallExpression</text><text text-anchor="middle" x="162" y="-260" font-family="Times,serif" font-size="14" transform="translate(4 686)">Identifier (bar)</text></g><g class="node"><path fill="#fff" stroke="#fff" d="M229.147 470.3H118.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M118.853 470.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M229.147 470.3H118.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="170" y="-199" font-family="Times,serif" font-size="14" transform="translate(4 686)">ExpressionStatement</text><text text-anchor="middle" x="170" y="-182.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">CallExpression</text><text text-anchor="middle" x="170" y="-165.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Identifier (hoge)</text><text text-anchor="middle" x="170" y="-148.6" font-family="Times,serif" font-size="14" transform="translate(4 686)">BreakStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="m168.25 434.403 2.027 25.592"/><path d="m173.779 459.884-2.699 10.245-4.279-9.692 6.978-.553z"/></g><g class="edge" stroke="#000"><path fill="none" d="M174 545.756v26.472"/><path d="m177.5 572.345-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M174 623.668v25.812"/><path d="m177.5 649.651-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M166 227.872v137.454"/><path d="m169.5 365.576-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M264.072 281.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M205.928 281.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M264.072 281.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="231" y="-388.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchCase</text><text text-anchor="middle" x="231" y="-371.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Literal (2)</text></g><g class="edge" stroke="#000"><path fill="none" d="m180.633 227.723 33.661 45.369"/><path d="m217.24 271.189 3.148 10.117-8.769-5.946 5.621-4.171z"/></g><g class="edge" stroke="#000"><path fill="none" d="m221.368 322.954-30.177 44.172"/><path d="m193.882 369.392-8.531 6.283 2.751-10.232 5.78 3.949z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M321.072 384.398h-58.144l-12 12v17.204l12 12h58.144l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M262.928 384.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m58.144 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M321.072 384.398h-58.144m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h58.144m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="288" y="-285.2" font-family="Times,serif" font-size="14" transform="translate(4 686)">SwitchCase</text><text text-anchor="middle" x="288" y="-268.4" font-family="Times,serif" font-size="14" transform="translate(4 686)">Literal (3)</text></g><g class="edge" stroke="#000"><path fill="none" d="m246.261 322.954 29.523 52.312"/><path d="m278.895 373.658 1.867 10.429-7.963-6.989 6.096-3.44z"/></g><g class="edge" stroke="#000"><path fill="none" d="m268.968 425.714-43.996 37.658"/><path d="m226.909 466.32-9.873 3.844 5.322-9.162 4.551 5.318z"/></g><g class="edge" stroke="#000"><path fill="none" d="M290.047 425.817C286.381 454.613 276.302 508.656 250 546c-8.278 11.753-19.805 22.026-31.383 30.454"/><path d="m220.439 579.449-10.216 2.81 6.234-8.567 3.982 5.757z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg b/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg
new file mode 100644 (file)
index 0000000..60ec1cd
--- /dev/null
@@ -0,0 +1 @@
+<svg width="316" height="652pt" viewBox="0 0 237 652" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="114" cy="-635" r="9" class="node" transform="translate(4 648)"/><g class="node"><path fill="#fff" stroke="#fff" d="M173.147 58.7H62.853l-12 12v84.6l12 12h110.294l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M62.853 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M173.147 58.7H62.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-572.8" font-family="Times,serif" font-size="14" transform="translate(4 648)">Program</text><text text-anchor="middle" x="114" y="-556" font-family="Times,serif" font-size="14" transform="translate(4 648)">TryStatement</text><text text-anchor="middle" x="114" y="-539.2" font-family="Times,serif" font-size="14" transform="translate(4 648)">BlockStatement</text><text text-anchor="middle" x="114" y="-522.4" font-family="Times,serif" font-size="14" transform="translate(4 648)">ExpressionStatement</text><text text-anchor="middle" x="114" y="-505.6" font-family="Times,serif" font-size="14" transform="translate(4 648)">CallExpression</text><text text-anchor="middle" x="114" y="-488.8" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 22.02v26.167"/><path d="m121.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 648)"><circle cx="114" cy="-13" r="9"/><circle fill="none" cx="114" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 203.599H110.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 203.599H110.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-427.6" font-family="Times,serif" font-size="14" transform="translate(4 648)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-410.8" font-family="Times,serif" font-size="14" transform="translate(4 648)">CallExpression</text><text text-anchor="middle" x="162" y="-394" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m139.753 167.476 10.893 26.78"/><path d="m153.9 192.967.526 10.581-7.01-7.944 6.484-2.637z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298.399H15.853l-12 12v101.202l12 12h110.294l12-12V310.399l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298.399c-6 0-12 6-12 12m0 101.202c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-101.202c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298.399H15.853m0 0c-6 0-12 6-12 12m0 0v101.202m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V310.399m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-333.2" font-family="Times,serif" font-size="14" transform="translate(4 648)">CatchClause</text><text text-anchor="middle" x="67" y="-316.4" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (err)</text><text text-anchor="middle" x="67" y="-299.6" font-family="Times,serif" font-size="14" transform="translate(4 648)">BlockStatement</text><text text-anchor="middle" x="67" y="-282.8" font-family="Times,serif" font-size="14" transform="translate(4 648)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-266" font-family="Times,serif" font-size="14" transform="translate(4 648)">CallExpression</text><text text-anchor="middle" x="67" y="-249.2" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (hoge)</text><text text-anchor="middle" x="67" y="-232.4" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (err)</text></g><g class="edge" stroke="#000"><path fill="none" d="M99.664 167.356C96.044 179.307 92.575 192 90 204c-5.838 27.202-10.04 57.486-12.983 84.079"/><path d="m80.492 288.505-4.541 9.572-2.42-10.315 6.961.743z"/></g><g class="edge" stroke="#000"><path fill="none" d="m144.68 262.277-20.949 27.784"/><path d="m126.308 292.457-8.815 5.878 3.226-10.092 5.589 4.214z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M173.147 460.399H62.853l-12 12v101.202l12 12h110.294l12-12V472.399l-12-12z"/><path fill="#fff" stroke="#fff" d="M62.853 460.399c-6 0-12 6-12 12m0 101.201c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-101.201c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M173.147 460.399H62.853m0 0c-6 0-12 6-12 12m0 0v101.202m0-.001c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V472.4m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-171.2" font-family="Times,serif" font-size="14" transform="translate(4 648)">BlockStatement</text><text text-anchor="middle" x="114" y="-154.4" font-family="Times,serif" font-size="14" transform="translate(4 648)">ExpressionStatement</text><text text-anchor="middle" x="114" y="-137.6" font-family="Times,serif" font-size="14" transform="translate(4 648)">CallExpression</text><text text-anchor="middle" x="114" y="-120.8" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (fuga)</text><text text-anchor="middle" x="114" y="-104" font-family="Times,serif" font-size="14" transform="translate(4 648)">ExpressionStatement</text><text text-anchor="middle" x="114" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 648)">CallExpression</text><text text-anchor="middle" x="114" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 648)">Identifier (last)</text></g><g class="edge" stroke="#000"><path fill="none" d="M164.835 262.25c-1.917 37.325-6.7 104.984-17.835 161.75-1.687 8.602-3.804 17.534-6.12 26.349"/><path d="m144.195 451.496-6.004 8.73-.75-10.568 6.754 1.838z"/></g><g class="edge" stroke="#000"><path fill="none" d="m89.171 423.86 7.878 26.818"/><path d="m100.416 449.723-.54 10.581-6.176-8.608 6.716-1.973z"/></g><g class="edge" stroke="#000"><path fill="none" d="M118 585.752v25.814"/><path d="m121.5 611.705-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg b/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg
new file mode 100644 (file)
index 0000000..a2a0c8a
--- /dev/null
@@ -0,0 +1 @@
+<svg width="323pt" height="680pt" viewBox="0 0 323 680" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="248" cy="-663" r="9" class="node" transform="translate(4 676)"/><g class="node"><path fill="#fff" stroke="#fff" d="M307.147 58.7H196.853l-12 12v84.6l12 12h110.294l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M196.853 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M307.147 58.7H196.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="248" y="-600.8" font-family="Times,serif" font-size="14" transform="translate(4 676)">Program</text><text text-anchor="middle" x="248" y="-584" font-family="Times,serif" font-size="14" transform="translate(4 676)">TryStatement</text><text text-anchor="middle" x="248" y="-567.2" font-family="Times,serif" font-size="14" transform="translate(4 676)">BlockStatement</text><text text-anchor="middle" x="248" y="-550.4" font-family="Times,serif" font-size="14" transform="translate(4 676)">ExpressionStatement</text><text text-anchor="middle" x="248" y="-533.6" font-family="Times,serif" font-size="14" transform="translate(4 676)">CallExpression</text><text text-anchor="middle" x="248" y="-516.8" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M252 22.02v26.167"/><path d="m255.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 676)"><circle cx="142" cy="-13" r="9"/><circle fill="none" cx="142" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M242.339 204.398h-62.678l-12 12v17.204l12 12h62.678l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M179.661 204.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M242.339 204.398h-62.678m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="207" y="-455.2" font-family="Times,serif" font-size="14" transform="translate(4 676)">IfStatement</text><text text-anchor="middle" x="207" y="-438.4" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="m232.101 167.389-10.214 27.403"/><path d="m225.164 196.02-6.772 8.147.213-10.592 6.559 2.445z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M254.147 394.399H143.853l-12 12v101.202l12 12h110.294l12-12V406.399l-12-12z"/><path fill="#fff" stroke="#fff" d="M143.853 394.399c-6 0-12 6-12 12m0 101.202c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-101.202c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M254.147 394.399H143.853m0 0c-6 0-12 6-12 12m0 0v101.202m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V406.399m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="195" y="-265.2" font-family="Times,serif" font-size="14" transform="translate(4 676)">CatchClause</text><text text-anchor="middle" x="195" y="-248.4" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (err)</text><text text-anchor="middle" x="195" y="-231.6" font-family="Times,serif" font-size="14" transform="translate(4 676)">BlockStatement</text><text text-anchor="middle" x="195" y="-214.8" font-family="Times,serif" font-size="14" transform="translate(4 676)">ExpressionStatement</text><text text-anchor="middle" x="195" y="-198" font-family="Times,serif" font-size="14" transform="translate(4 676)">CallExpression</text><text text-anchor="middle" x="195" y="-181.2" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (hoge)</text><text text-anchor="middle" x="195" y="-164.4" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (err)</text></g><g class="edge" stroke="#000"><path fill="none" d="M269.496 167.376C283.169 217.839 296.566 295 275 358c-3.242 9.472-7.815 18.737-13.126 27.556"/><path d="m264.672 387.677-8.334 6.542 2.436-10.311 5.898 3.769z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M254.329 282.3h-86.658l-12 12v51.4l12 12h86.658l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M167.671 282.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m86.658 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M254.329 282.3h-86.658m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h86.658m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="207" y="-377" font-family="Times,serif" font-size="14" transform="translate(4 676)">BlockStatement</text><text text-anchor="middle" x="207" y="-360.2" font-family="Times,serif" font-size="14" transform="translate(4 676)">ThrowStatement</text><text text-anchor="middle" x="207" y="-343.4" font-family="Times,serif" font-size="14" transform="translate(4 676)">NewExpression</text><text text-anchor="middle" x="207" y="-326.6" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (Error)</text></g><g class="edge" stroke="#000"><path fill="none" d="M211 245.723v26.297"/><path d="m214.5 272.035-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 290.599H15.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 290.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 290.599H15.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-368.6" font-family="Times,serif" font-size="14" transform="translate(4 676)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-351.8" font-family="Times,serif" font-size="14" transform="translate(4 676)">CallExpression</text><text text-anchor="middle" x="67" y="-335" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m181.31 245.723-59.265 39.368"/><path d="m123.93 288.041-10.266 2.618 6.393-8.449 3.873 5.831z"/></g><g class="edge" stroke="#000"><path fill="none" d="m207.721 357.889-2.323 26.129"/><path d="m208.863 384.578-4.372 9.651-2.601-10.271 6.973.62z"/></g><g class="edge" stroke="#000"><path fill="none" d="m97.833 349.3 35.718 37.671"/><path d="m136.227 384.707 4.34 9.665-9.42-4.849 5.08-4.816z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M201.147 555.599H90.853l-12 12v34.802l12 12h110.294l12-12V567.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M90.853 555.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M201.147 555.599H90.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V567.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="142" y="-103.6" font-family="Times,serif" font-size="14" transform="translate(4 676)">ExpressionStatement</text><text text-anchor="middle" x="142" y="-86.8" font-family="Times,serif" font-size="14" transform="translate(4 676)">CallExpression</text><text text-anchor="middle" x="142" y="-70" font-family="Times,serif" font-size="14" transform="translate(4 676)">Identifier (last)</text></g><g class="edge" stroke="#000"><path fill="none" d="M77.536 349.236C86.703 388.013 104.357 459.795 123 520c2.611 8.431 5.658 17.395 8.664 25.861"/><path d="m135.044 544.917.101 10.594-6.686-8.219 6.585-2.375z"/></g><g class="edge" stroke="#000"><path fill="none" d="m172.966 519.893-11.128 26.455"/><path d="m164.974 547.92-7.104 7.861.651-10.575 6.453 2.714z"/></g><g class="edge" stroke="#000"><path fill="none" d="M146 614.3v25.642"/><path d="m149.5 639.973-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg b/eslint/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg
new file mode 100644 (file)
index 0000000..68c7801
--- /dev/null
@@ -0,0 +1 @@
+<svg width="392" height="490pt" viewBox="0 0 294 490" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="171" cy="-473" r="9" class="node" transform="translate(4 486)"/><g class="node"><path fill="#fff" stroke="#fff" d="M230.147 58.7H119.853l-12 12v84.6l12 12h110.294l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M119.853 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M230.147 58.7H119.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="171" y="-410.8" font-family="Times,serif" font-size="14" transform="translate(4 486)">Program</text><text text-anchor="middle" x="171" y="-394" font-family="Times,serif" font-size="14" transform="translate(4 486)">TryStatement</text><text text-anchor="middle" x="171" y="-377.2" font-family="Times,serif" font-size="14" transform="translate(4 486)">BlockStatement</text><text text-anchor="middle" x="171" y="-360.4" font-family="Times,serif" font-size="14" transform="translate(4 486)">ExpressionStatement</text><text text-anchor="middle" x="171" y="-343.6" font-family="Times,serif" font-size="14" transform="translate(4 486)">CallExpression</text><text text-anchor="middle" x="171" y="-326.8" font-family="Times,serif" font-size="14" transform="translate(4 486)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M175 22.02v26.167"/><path d="m178.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 486)"><circle cx="67" cy="-13" r="9"/><circle fill="none" cx="67" cy="-13" r="13"/></g><g class="node" transform="translate(4 486)"><circle fill="#fff" stroke="#000" cx="219" cy="-13" r="11"/><text text-anchor="middle" x="219" y="-8.8" font-family="Times,serif" font-size="14">✘</text></g><g class="node"><path fill="#fff" stroke="#fff" d="M183.147 203.599H72.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M72.853 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M183.147 203.599H72.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="124" y="-265.6" font-family="Times,serif" font-size="14" transform="translate(4 486)">ExpressionStatement</text><text text-anchor="middle" x="124" y="-248.8" font-family="Times,serif" font-size="14" transform="translate(4 486)">CallExpression</text><text text-anchor="middle" x="124" y="-232" font-family="Times,serif" font-size="14" transform="translate(4 486)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m153.7 167.476-10.666 26.78"/><path d="m146.284 195.553-6.952 7.995.449-10.585 6.503 2.59z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M278.147 323.3H167.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M167.853 323.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M278.147 323.3H167.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="219" y="-146" font-family="Times,serif" font-size="14" transform="translate(4 486)">BlockStatement</text><text text-anchor="middle" x="219" y="-129.2" font-family="Times,serif" font-size="14" transform="translate(4 486)">ExpressionStatement</text><text text-anchor="middle" x="219" y="-112.4" font-family="Times,serif" font-size="14" transform="translate(4 486)">CallExpression</text><text text-anchor="middle" x="219" y="-95.6" font-family="Times,serif" font-size="14" transform="translate(4 486)">Identifier (fuga)</text></g><g class="edge" stroke="#000"><path fill="none" d="M194.026 167.319c3.746 11.952 7.33 24.656 9.974 36.681 7.95 36.15 12.809 77.796 15.622 108.96"/><path d="m223.124 312.84-2.625 10.264-4.349-9.661 6.974-.603z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298.399H15.853l-12 12v101.202l12 12h110.294l12-12V310.399l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298.399c-6 0-12 6-12 12m0 101.201c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-101.201c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298.399H15.853m0 0c-6 0-12 6-12 12m0 0v101.202m0-.001c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V310.4m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-171.2" font-family="Times,serif" font-size="14" transform="translate(4 486)">BlockStatement</text><text text-anchor="middle" x="67" y="-154.4" font-family="Times,serif" font-size="14" transform="translate(4 486)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-137.6" font-family="Times,serif" font-size="14" transform="translate(4 486)">CallExpression</text><text text-anchor="middle" x="67" y="-120.8" font-family="Times,serif" font-size="14" transform="translate(4 486)">Identifier (fuga)</text><text text-anchor="middle" x="67" y="-104" font-family="Times,serif" font-size="14" transform="translate(4 486)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-87.2" font-family="Times,serif" font-size="14" transform="translate(4 486)">CallExpression</text><text text-anchor="middle" x="67" y="-70.4" font-family="Times,serif" font-size="14" transform="translate(4 486)">Identifier (last)</text></g><g class="edge" stroke="#000"><path fill="none" d="m115.208 262.277-12.17 26.902"/><path d="m106.207 290.667-7.311 7.668.933-10.554 6.378 2.886z"/></g><g class="edge" stroke="#000"><path fill="none" d="m149.32 262.277 39.59 52.509"/><path d="m192.029 313.109 3.226 10.092-8.815-5.878 5.589-4.214z"/></g><g class="edge" stroke="#000"><path fill="none" d="M71 423.752v25.814"/><path d="m74.5 449.705-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M223 398.628v53.191"/><path d="m226.5 451.913-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg b/eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg
new file mode 100644 (file)
index 0000000..53bb946
--- /dev/null
@@ -0,0 +1 @@
+<svg width="360" height="328pt" viewBox="0 0 270 328" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="125" cy="-311" r="9" class="node" transform="translate(4 324)"/><g class="node"><path fill="#fff" stroke="#fff" d="M182.307 58.7H75.693l-12 12v84.6l12 12h106.614l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M75.693 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m106.614 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M182.307 58.7H75.693m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h106.614m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="125" y="-248.8" font-family="Times,serif" font-size="14" transform="translate(4 324)">FunctionDeclaration</text><text text-anchor="middle" x="125" y="-232" font-family="Times,serif" font-size="14" transform="translate(4 324)">Identifier (foo)</text><text text-anchor="middle" x="125" y="-215.2" font-family="Times,serif" font-size="14" transform="translate(4 324)">Identifier (a)</text><text text-anchor="middle" x="125" y="-198.4" font-family="Times,serif" font-size="14" transform="translate(4 324)">BlockStatement</text><text text-anchor="middle" x="125" y="-181.6" font-family="Times,serif" font-size="14" transform="translate(4 324)">IfStatement</text><text text-anchor="middle" x="125" y="-164.8" font-family="Times,serif" font-size="14" transform="translate(4 324)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M129 22.02v26.167"/><path d="m132.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 324)"><circle cx="125" cy="-13" r="9"/><circle fill="none" cx="125" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M102.068 212.398H15.932l-12 12v17.204l12 12h86.136l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.932 212.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m86.136 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M102.068 212.398H15.932m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h86.136m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="55" y="-95.2" font-family="Times,serif" font-size="14" transform="translate(4 324)">BlockStatement</text><text text-anchor="middle" x="55" y="-78.4" font-family="Times,serif" font-size="14" transform="translate(4 324)">ReturnStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="m97.277 167.476-21.464 36.182"/><path d="m78.8 205.484-8.113 6.815 2.092-10.386 6.02 3.571z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M254.147 203.599H143.853l-12 12v34.802l12 12h110.294l12-12V215.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M143.853 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M254.147 203.599H143.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V215.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="195" y="-103.6" font-family="Times,serif" font-size="14" transform="translate(4 324)">ExpressionStatement</text><text text-anchor="middle" x="195" y="-86.8" font-family="Times,serif" font-size="14" transform="translate(4 324)">CallExpression</text><text text-anchor="middle" x="195" y="-70" font-family="Times,serif" font-size="14" transform="translate(4 324)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m160.723 167.476 16.212 27.329"/><path d="m180.03 193.162 2.092 10.386-8.112-6.815 6.02-3.571z"/></g><g class="edge" stroke="#000"><path fill="none" d="m77.392 253.968 36.042 39.132"/><path d="m116.278 291.02 4.2 9.727-9.349-4.984 5.149-4.742z"/></g><g class="edge" stroke="#000"><path fill="none" d="m172.935 262.3-28.634 31.087"/><path d="m146.676 295.976-9.35 4.984 4.201-9.727 5.149 4.743z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg b/eslint/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg
new file mode 100644 (file)
index 0000000..4d3fe12
--- /dev/null
@@ -0,0 +1 @@
+<svg width="142pt" height="312" viewBox="0 0 142 234" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="67" cy="-217" r="9" class="node" transform="translate(4 230)"/><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 58.7H15.853l-12 12v84.6l12 12h110.294l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 58.7H15.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-154.8" font-family="Times,serif" font-size="14" transform="translate(4 230)">Program</text><text text-anchor="middle" x="67" y="-138" font-family="Times,serif" font-size="14" transform="translate(4 230)">FunctionDeclaration</text><text text-anchor="middle" x="67" y="-121.2" font-family="Times,serif" font-size="14" transform="translate(4 230)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-104.4" font-family="Times,serif" font-size="14" transform="translate(4 230)">CallExpression</text><text text-anchor="middle" x="67" y="-87.6" font-family="Times,serif" font-size="14" transform="translate(4 230)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-70.8" font-family="Times,serif" font-size="14" transform="translate(4 230)">Literal (false)</text></g><g class="edge" stroke="#000"><path fill="none" d="M71 22.02v26.167"/><path d="m74.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 230)"><circle cx="67" cy="-13" r="9"/><circle fill="none" cx="67" cy="-13" r="13"/></g><g class="edge" stroke="#000"><path fill="none" d="M71 167.39v26.352"/><path d="m74.5 193.81-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/example-whilestatement.svg b/eslint/docs/src/assets/images/code-path-analysis/example-whilestatement.svg
new file mode 100644 (file)
index 0000000..f039443
--- /dev/null
@@ -0,0 +1 @@
+<svg width="544" height="416pt" viewBox="0 0 408 416" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="193" cy="-399" r="9" class="node" transform="translate(4 412)"/><g class="node"><path fill="#fff" stroke="#fff" d="M238.149 58.398h-82.298l-12 12v17.204l12 12h82.298l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M155.851 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.298 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M238.149 58.398h-82.298m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.298m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="193" y="-337.2" font-family="Times,serif" font-size="14" transform="translate(4 412)">Program</text><text text-anchor="middle" x="193" y="-320.4" font-family="Times,serif" font-size="14" transform="translate(4 412)">WhileStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M197 22.106V48.06"/><path d="m200.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 412)"><circle cx="335" cy="-29" r="9"/><circle fill="none" cx="335" cy="-29" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M228.339 136h-62.678l-12 12v12l12 12h62.678l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M165.661 136c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M228.339 136h-62.678m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="193" y="-253.8" font-family="Times,serif" font-size="14" transform="translate(4 412)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M197 99.948v25.416"/><path d="m200.5 125.561-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M205.147 208.7H94.853l-12 12v84.6l12 12h110.294l12-12v-84.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M94.853 208.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M205.147 208.7H94.853m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-84.6m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="146" y="-186.8" font-family="Times,serif" font-size="14" transform="translate(4 412)">BlockStatement</text><text text-anchor="middle" x="146" y="-170" font-family="Times,serif" font-size="14" transform="translate(4 412)">ExpressionStatement</text><text text-anchor="middle" x="146" y="-153.2" font-family="Times,serif" font-size="14" transform="translate(4 412)">CallExpression</text><text text-anchor="middle" x="146" y="-136.4" font-family="Times,serif" font-size="14" transform="translate(4 412)">Identifier (foo)</text><text text-anchor="middle" x="146" y="-119.6" font-family="Times,serif" font-size="14" transform="translate(4 412)">IfStatement</text><text text-anchor="middle" x="146" y="-102.8" font-family="Times,serif" font-size="14" transform="translate(4 412)">Identifier (b)</text></g><g class="edge" stroke="#000"><path fill="none" d="m189.449 172.191-11.832 26.937"/><path d="m180.817 200.546-7.227 7.748.818-10.563 6.409 2.815z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M392.314 242.398H285.686l-12 12v17.204l12 12h106.628l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M285.686 242.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m106.628 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M392.314 242.398H285.686m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h106.628m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="335" y="-153.2" font-family="Times,serif" font-size="14" transform="translate(4 412)">WhileStatement:exit</text><text text-anchor="middle" x="335" y="-136.4" font-family="Times,serif" font-size="14" transform="translate(4 412)">Program:exit</text></g><g class="edge" stroke="#000"><path fill="none" d="m219.815 172.191 84.857 63.942"/><path d="m306.987 233.495 5.88 8.813-10.093-3.222 4.213-5.591z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M114.49 362.398H15.51l-12 12v17.204l12 12h98.98l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.51 362.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m98.98 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M114.49 362.398H15.51m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h98.98m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="61" y="-33.2" font-family="Times,serif" font-size="14" transform="translate(4 412)">BlockStatement</text><text text-anchor="middle" x="61" y="-16.4" font-family="Times,serif" font-size="14" transform="translate(4 412)">ContinueStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="m111.479 317.476-26.298 36.508"/><path d="m87.876 356.23-8.685 6.07 3.005-10.16 5.68 4.09z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M286.147 353.599H175.853l-12 12V400.4l12 12h110.294l12-12v-34.8l-12-12z"/><path fill="#fff" stroke="#fff" d="M175.853 353.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M286.147 353.599H175.853m0 0c-6 0-12 6-12 12m0 0V400.4m0 .001c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V365.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="227" y="-41.6" font-family="Times,serif" font-size="14" transform="translate(4 412)">ExpressionStatement</text><text text-anchor="middle" x="227" y="-24.8" font-family="Times,serif" font-size="14" transform="translate(4 412)">CallExpression</text><text text-anchor="middle" x="227" y="-8" font-family="Times,serif" font-size="14" transform="translate(4 412)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m186.708 317.476 18.948 27.603"/><path d="m208.696 343.323 2.774 10.225-8.545-6.263 5.771-3.962z"/></g><g class="edge" stroke="#000"><path fill="none" d="M59.818 362.127C52.005 327.406 41.352 254.931 74 208c16.001-23.001 44.192-36.092 69.552-43.506"/><path d="m142.9 161.045 10.566.787-8.751 5.974-1.815-6.761z"/></g><g class="edge" stroke="#000"><path fill="none" d="M339 283.751v76.008"/><path d="m342.5 359.783-3.5 10-3.5-10h7z"/></g><g class="edge" stroke="#000"><path fill="none" d="M234.184 353.687c3.025-34.93 5.336-95.809-8.184-145.687-2.512-9.268-6.936-18.685-11.583-26.959"/><path d="m211.291 182.633-2.126-10.38 8.134 6.789-6.008 3.591z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/helo.svg b/eslint/docs/src/assets/images/code-path-analysis/helo.svg
new file mode 100644 (file)
index 0000000..cd72a37
--- /dev/null
@@ -0,0 +1 @@
+<svg width="238pt" height="478pt" viewBox="0 0 238 478" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="164" cy="-461" r="9" class="node" transform="translate(4 474)"/><g class="node"><path fill="#fff" stroke="#fff" d="M216.228 58.3h-96.456l-12 12v51.4l12 12h96.456l12-12V70.3l-12-12z"/><path fill="#fff" stroke="#fff" d="M119.772 58.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m96.456 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M216.228 58.3h-96.456m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h96.456m0 0c6 0 12-6 12-12m0 0V70.3m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="164" y="-399" font-family="Times,serif" font-size="14" transform="translate(4 474)">Program</text><text text-anchor="middle" x="164" y="-382.2" font-family="Times,serif" font-size="14" transform="translate(4 474)">IfStatement</text><text text-anchor="middle" x="164" y="-365.4" font-family="Times,serif" font-size="14" transform="translate(4 474)">LogicalExpression</text><text text-anchor="middle" x="164" y="-348.6" font-family="Times,serif" font-size="14" transform="translate(4 474)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M168 22.063v26.089"/><path d="m171.5 48.34-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 474)"><circle cx="162" cy="-13" r="9"/><circle fill="none" cx="162" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M163.429 170h-62.858l-12 12v12l12 12h62.858l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M100.571 170c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m62.858 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M163.429 170h-62.858m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h62.858m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="128" y="-281.8" font-family="Times,serif" font-size="14" transform="translate(4 474)">Identifier (b)</text></g><g class="edge" stroke="#000"><path fill="none" d="m153.357 133.606-10.592 26.482"/><path d="m145.905 161.662-6.964 7.985.464-10.585 6.5 2.6z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M221.147 353.599H110.853l-12 12v34.802l12 12h110.294l12-12V365.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M110.853 353.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M221.147 353.599H110.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V365.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-103.6" font-family="Times,serif" font-size="14" transform="translate(4 474)">ExpressionStatement</text><text text-anchor="middle" x="162" y="-86.8" font-family="Times,serif" font-size="14" transform="translate(4 474)">CallExpression</text><text text-anchor="middle" x="162" y="-70" font-family="Times,serif" font-size="14" transform="translate(4 474)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="M177.704 133.882c2.583 11.485 5.011 24.251 6.296 36.118 6.559 60.558-2.801 131.065-10.293 173.575"/><path d="m177.135 344.286-5.233 9.213-1.654-10.465 6.887 1.252z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 242.3H15.853l-12 12v51.4l12 12h110.294l12-12v-51.4l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 242.3c-6 0-12 6-12 12m0 51.4c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-51.4c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 242.3H15.853m0 0c-6 0-12 6-12 12m0 0v51.4m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-51.4m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-215" font-family="Times,serif" font-size="14" transform="translate(4 474)">BlockStatement</text><text text-anchor="middle" x="67" y="-198.2" font-family="Times,serif" font-size="14" transform="translate(4 474)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-181.4" font-family="Times,serif" font-size="14" transform="translate(4 474)">CallExpression</text><text text-anchor="middle" x="67" y="-164.6" font-family="Times,serif" font-size="14" transform="translate(4 474)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="m120.239 206.353-18.593 27.431"/><path d="m104.363 236.015-8.508 6.314 2.713-10.242 5.795 3.928z"/></g><g class="edge" stroke="#000"><path fill="none" d="M137.482 206.034c3.155 10.318 6.983 23.796 9.518 35.966 7.074 33.962 12.131 73.129 15.24 101.384"/><path d="m165.754 343.33-2.417 10.315-4.543-9.571 6.96-.744z"/></g><g class="edge" stroke="#000"><path fill="none" d="m105.566 317.749 26.698 28.384"/><path d="m135.053 343.99 4.302 9.682-9.401-4.886 5.099-4.796z"/></g><g class="edge" stroke="#000"><path fill="none" d="M166 412.3v25.642"/><path d="m169.5 437.973-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg
new file mode 100644 (file)
index 0000000..727ec12
--- /dev/null
@@ -0,0 +1 @@
+<svg width="136pt" height="344pt" viewBox="0 0 136 344" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="64" cy="-327" r="9" class="node" transform="translate(4 340)"/><g class="node"><path fill="#fff" stroke="#fff" d="M120.617 58.7H15.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M120.617 58.7H15.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="64" y="-264.8" font-family="Times,serif" font-size="14" transform="translate(4 340)">Program</text><text text-anchor="middle" x="64" y="-248" font-family="Times,serif" font-size="14" transform="translate(4 340)">ForStatement</text><text text-anchor="middle" x="64" y="-231.2" font-family="Times,serif" font-size="14" transform="translate(4 340)">VariableDeclaration</text><text text-anchor="middle" x="64" y="-214.4" font-family="Times,serif" font-size="14" transform="translate(4 340)">VariableDeclarator</text><text text-anchor="middle" x="64" y="-197.6" font-family="Times,serif" font-size="14" transform="translate(4 340)">Identifier (i)</text><text text-anchor="middle" x="64" y="-180.8" font-family="Times,serif" font-size="14" transform="translate(4 340)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M68 22.02v26.167"/><path d="m71.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M114.233 203.599H21.767l-12 12v34.802l12 12h92.466l12-12V215.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M21.767 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m92.466 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M114.233 203.599H21.767m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0V215.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="64" y="-119.6" font-family="Times,serif" font-size="14" transform="translate(4 340)">BinaryExpression</text><text text-anchor="middle" x="64" y="-102.8" font-family="Times,serif" font-size="14" transform="translate(4 340)">Identifier (i)</text><text text-anchor="middle" x="64" y="-86" font-family="Times,serif" font-size="14" transform="translate(4 340)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M68 167.476v25.952"/><path d="m71.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M114.977 298.398H21.023l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M21.023 298.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M114.977 298.398H21.023m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="64" y="-25.2" font-family="Times,serif" font-size="14" transform="translate(4 340)">UpdateExpression</text><text text-anchor="middle" x="64" y="-8.4" font-family="Times,serif" font-size="14" transform="translate(4 340)">Identifier (i)</text></g><path fill="none" d="M68 262.439v25.77m3.5.123-3.5 10-3.5-10h7z" class="edge"/></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg
new file mode 100644 (file)
index 0000000..70d762f
--- /dev/null
@@ -0,0 +1 @@
+<svg width="278pt" height="394pt" viewBox="0 0 278 394" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="139" cy="-377" r="9" class="node" transform="translate(4 390)"/><g class="node"><path fill="#fff" stroke="#fff" d="M195.617 58.7H90.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M90.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M195.617 58.7H90.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="139" y="-314.8" font-family="Times,serif" font-size="14" transform="translate(4 390)">Program</text><text text-anchor="middle" x="139" y="-298" font-family="Times,serif" font-size="14" transform="translate(4 390)">ForStatement</text><text text-anchor="middle" x="139" y="-281.2" font-family="Times,serif" font-size="14" transform="translate(4 390)">VariableDeclaration</text><text text-anchor="middle" x="139" y="-264.4" font-family="Times,serif" font-size="14" transform="translate(4 390)">VariableDeclarator</text><text text-anchor="middle" x="139" y="-247.6" font-family="Times,serif" font-size="14" transform="translate(4 390)">Identifier (i)</text><text text-anchor="middle" x="139" y="-230.8" font-family="Times,serif" font-size="14" transform="translate(4 390)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M143 22.02v26.167"/><path d="m146.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M189.233 203.599H96.767l-12 12v34.802l12 12h92.466l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M96.767 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m92.466 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M189.233 203.599H96.767m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="139" y="-169.6" font-family="Times,serif" font-size="14" transform="translate(4 390)">BinaryExpression</text><text text-anchor="middle" x="139" y="-152.8" font-family="Times,serif" font-size="14" transform="translate(4 390)">Identifier (i)</text><text text-anchor="middle" x="139" y="-136" font-family="Times,serif" font-size="14" transform="translate(4 390)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M143 167.476v25.952"/><path d="m146.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298H15.853l-12 12v68l12 12h110.294l12-12v-68l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298H15.853m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-68m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-75.4" font-family="Times,serif" font-size="14" transform="translate(4 390)">BlockStatement</text><text text-anchor="middle" x="67" y="-58.6" font-family="Times,serif" font-size="14" transform="translate(4 390)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-41.8" font-family="Times,serif" font-size="14" transform="translate(4 390)">CallExpression</text><text text-anchor="middle" x="67" y="-25" font-family="Times,serif" font-size="14" transform="translate(4 390)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-8.2" font-family="Times,serif" font-size="14" transform="translate(4 390)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="m124.271 262.354-17.842 27.01"/><path d="m109.226 291.481-8.433 6.415 2.592-10.273 5.841 3.858z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M261.977 323.398h-93.954l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M168.023 323.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M261.977 323.398h-93.954m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="211" y="-50.2" font-family="Times,serif" font-size="14" transform="translate(4 390)">UpdateExpression</text><text text-anchor="middle" x="211" y="-33.4" font-family="Times,serif" font-size="14" transform="translate(4 390)">Identifier (i)</text></g><path fill="none" d="m161.729 262.354 34.698 52.528m3.021-1.776 2.591 10.273-8.432-6.415 5.841-3.858z" class="edge"/></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg
new file mode 100644 (file)
index 0000000..5adea13
--- /dev/null
@@ -0,0 +1 @@
+<svg width="248" height="472pt" viewBox="0 0 186 472" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="114" cy="-455" r="9" class="node" transform="translate(4 468)"/><g class="node"><path fill="#fff" stroke="#fff" d="M170.617 58.7H65.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M65.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M170.617 58.7H65.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-392.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Program</text><text text-anchor="middle" x="114" y="-376" font-family="Times,serif" font-size="14" transform="translate(4 468)">ForStatement</text><text text-anchor="middle" x="114" y="-359.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclaration</text><text text-anchor="middle" x="114" y="-342.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclarator</text><text text-anchor="middle" x="114" y="-325.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="114" y="-308.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 22.02v26.167"/><path d="m121.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M164.233 203.599H71.767l-12 12v34.802l12 12h92.466l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M71.767 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m92.466 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M164.233 203.599H71.767m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-247.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">BinaryExpression</text><text text-anchor="middle" x="114" y="-230.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="114" y="-214" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 167.476v25.952"/><path d="m121.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298H15.853l-12 12v68l12 12h110.294l12-12v-68l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298H15.853m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-68m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">BlockStatement</text><text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">CallExpression</text><text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="m105.774 262.354-11.277 26.153"/><path d="m97.622 290.099-7.174 7.797.746-10.569 6.428 2.772z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M164.977 426.398H71.023l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M71.023 426.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M164.977 426.398H71.023m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">UpdateExpression</text><text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="red"><path fill="none" d="M92.026 390.183c4.216 9.06 8.54 18.35 12.419 26.689"/><path fill="red" d="m107.718 415.608 1.045 10.543-7.392-7.59 6.347-2.953z"/></g><path fill="none" d="M131.225 426.186C137.324 415.867 143.891 402.765 147 390c9.676-39.727 8.633-52.033 0-92-1.909-8.837-5.143-17.92-8.774-26.368m-3.241 1.33-.98-10.55 7.345 7.636-6.365 2.914z" class="edge"/></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg
new file mode 100644 (file)
index 0000000..9938975
--- /dev/null
@@ -0,0 +1 @@
+<svg width="248" height="472pt" viewBox="0 0 186 472" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="114" cy="-455" r="9" class="node" transform="translate(4 468)"/><g class="node"><path fill="#fff" stroke="#fff" d="M170.617 58.7H65.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M65.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M170.617 58.7H65.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-392.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Program</text><text text-anchor="middle" x="114" y="-376" font-family="Times,serif" font-size="14" transform="translate(4 468)">ForStatement</text><text text-anchor="middle" x="114" y="-359.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclaration</text><text text-anchor="middle" x="114" y="-342.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclarator</text><text text-anchor="middle" x="114" y="-325.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="114" y="-308.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 22.02v26.167"/><path d="m121.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M164.233 203.599H71.767l-12 12v34.802l12 12h92.466l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M71.767 203.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m92.466 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M164.233 203.599H71.767m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-247.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">BinaryExpression</text><text text-anchor="middle" x="114" y="-230.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="114" y="-214" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M118 167.476v25.952"/><path d="m121.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298H15.853l-12 12v68l12 12h110.294l12-12v-68l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298H15.853m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-68m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">BlockStatement</text><text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">CallExpression</text><text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="m105.774 262.354-11.277 26.153"/><path d="m97.622 290.099-7.174 7.797.746-10.569 6.428 2.772z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M164.977 426.398H71.023l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M71.023 426.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M164.977 426.398H71.023m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">UpdateExpression</text><text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="M92.026 390.183c4.216 9.06 8.54 18.35 12.419 26.689"/><path d="m107.718 415.608 1.045 10.543-7.392-7.59 6.347-2.953z"/></g><g class="edge" stroke="red"><path fill="none" d="M131.225 426.186C137.324 415.867 143.891 402.765 147 390c9.676-39.727 8.633-52.033 0-92-1.909-8.837-5.143-17.92-8.774-26.368"/><path fill="red" d="m134.985 272.962-.98-10.55 7.345 7.636-6.365 2.914z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg
new file mode 100644 (file)
index 0000000..070decb
--- /dev/null
@@ -0,0 +1 @@
+<svg width="332pt" height="472pt" viewBox="0 0 332 472" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="162" cy="-455" r="9" class="node" transform="translate(4 468)"/><g class="node"><path fill="#fff" stroke="#fff" d="M218.617 58.7H113.383l-12 12v84.6l12 12h105.234l12-12V70.7l-12-12z"/><path fill="#fff" stroke="#fff" d="M113.383 58.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m105.234 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M218.617 58.7H113.383m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h105.234m0 0c6 0 12-6 12-12m0 0V70.7m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-392.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Program</text><text text-anchor="middle" x="162" y="-376" font-family="Times,serif" font-size="14" transform="translate(4 468)">ForStatement</text><text text-anchor="middle" x="162" y="-359.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclaration</text><text text-anchor="middle" x="162" y="-342.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">VariableDeclarator</text><text text-anchor="middle" x="162" y="-325.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="162" y="-308.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (0)</text></g><g class="edge" stroke="#000"><path fill="none" d="M166 22.02v26.167"/><path d="m169.5 48.414-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 468)"><circle cx="257" cy="-21" r="9"/><circle fill="none" cx="257" cy="-21" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M212.233 203.599h-92.466l-12 12v34.802l12 12h92.466l12-12v-34.802l-12-12zm-92.466 0c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m92.466 0c6 0 12-6 12-12"/><path fill="#fff" stroke="#fff" d="M224.233 215.599c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M212.233 203.599h-92.466m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h92.466m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="162" y="-247.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">BinaryExpression</text><text text-anchor="middle" x="162" y="-230.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text><text text-anchor="middle" x="162" y="-214" font-family="Times,serif" font-size="14" transform="translate(4 468)">Literal (10)</text></g><g class="edge" stroke="#000"><path fill="none" d="M166 167.476v25.952"/><path d="m169.5 193.548-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M126.147 298H15.853l-12 12v68l12 12h110.294l12-12v-68l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.853 298c-6 0-12 6-12 12m0 68c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-68c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M126.147 298H15.853m0 0c-6 0-12 6-12 12m0 0v68m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-68m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="67" y="-153.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">BlockStatement</text><text text-anchor="middle" x="67" y="-136.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">ExpressionStatement</text><text text-anchor="middle" x="67" y="-119.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">CallExpression</text><text text-anchor="middle" x="67" y="-103" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (foo)</text><text text-anchor="middle" x="67" y="-86.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="M141.288 262.354 117 290.221"/><path d="m119.52 292.657-9.209 5.239 3.932-9.838 5.277 4.599z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M316.147 314.599H205.853l-12 12v34.802l12 12h110.294l12-12v-34.802l-12-12z"/><path fill="#fff" stroke="#fff" d="M205.853 314.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M316.147 314.599H205.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0v-34.802m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="257" y="-136.6" font-family="Times,serif" font-size="14" transform="translate(4 468)">ExpressionStatement</text><text text-anchor="middle" x="257" y="-119.8" font-family="Times,serif" font-size="14" transform="translate(4 468)">CallExpression</text><text text-anchor="middle" x="257" y="-103" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="m190.712 262.354 38.881 44.611"/><path d="m232.48 304.95 3.932 9.838-9.209-5.239 5.277-4.599z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M164.977 426.398H71.023l-12 12v17.204l12 12h93.954l12-12v-17.204l-12-12z"/><path fill="#fff" stroke="#fff" d="M71.023 426.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m93.954 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M164.977 426.398H71.023m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h93.954m0 0c6 0 12-6 12-12m0 0v-17.204m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="114" y="-25.2" font-family="Times,serif" font-size="14" transform="translate(4 468)">UpdateExpression</text><text text-anchor="middle" x="114" y="-8.4" font-family="Times,serif" font-size="14" transform="translate(4 468)">Identifier (i)</text></g><g class="edge" stroke="#000"><path fill="none" d="M92.026 390.183c4.216 9.06 8.54 18.35 12.419 26.689"/><path d="m107.718 415.608 1.045 10.543-7.392-7.59 6.347-2.953z"/></g><g class="edge" stroke="#000"><path fill="none" d="M130.427 426.266C136.399 415.86 143.091 402.658 147 390c12.006-38.879 16.472-85.404 18.108-117.471"/><path d="m161.624 272.077 3.937-9.837 3.057 10.145-6.994-.308z"/></g><g class="edge" stroke="#000"><path fill="none" d="M261 373.403v50.245"/><path d="m264.5 423.904-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg
new file mode 100644 (file)
index 0000000..7d0c1a0
--- /dev/null
@@ -0,0 +1 @@
+<svg width="152pt" height="322pt" viewBox="0 0 152 322" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="72" cy="-305" r="9" class="node" transform="translate(4 318)"/><g class="node"><path fill="#fff" stroke="#fff" d="M117.149 58.398H34.85l-12 12v17.204l12 12h82.299l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M34.85 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.299 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M117.149 58.398H34.85m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.299m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-243.2" font-family="Times,serif" font-size="14" transform="translate(4 318)">Program</text><text text-anchor="middle" x="72" y="-226.4" font-family="Times,serif" font-size="14" transform="translate(4 318)">WhileStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 22.106V48.06"/><path d="m79.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M107.339 136H44.661l-12 12v12l12 12h62.678l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M44.661 136c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M107.339 136H44.661m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-159.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 99.948v25.416"/><path d="m79.5 125.561-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M136.317 208.7H15.683l-12 12v84.6l12 12h120.634l12-12v-84.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.683 208.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m120.634 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M136.317 208.7H15.683m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h120.634m0 0c6 0 12-6 12-12m0 0v-84.6m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-92.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">BlockStatement</text><text text-anchor="middle" x="72" y="-76" font-family="Times,serif" font-size="14" transform="translate(4 318)">ExpressionStatement</text><text text-anchor="middle" x="72" y="-59.2" font-family="Times,serif" font-size="14" transform="translate(4 318)">AssignmentExpression</text><text text-anchor="middle" x="72" y="-42.4" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (a)</text><text text-anchor="middle" x="72" y="-25.6" font-family="Times,serif" font-size="14" transform="translate(4 318)">CallExpression</text><text text-anchor="middle" x="72" y="-8.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 172.191v26.03"/><path d="m79.5 198.294-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg
new file mode 100644 (file)
index 0000000..d5c31e2
--- /dev/null
@@ -0,0 +1 @@
+<svg width="152pt" height="322pt" viewBox="0 0 152 322" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="72" cy="-305" r="9" class="node" transform="translate(4 318)"/><g class="node"><path fill="#fff" stroke="#fff" d="M117.149 58.398H34.85l-12 12v17.204l12 12h82.299l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M34.85 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.299 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M117.149 58.398H34.85m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.299m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-243.2" font-family="Times,serif" font-size="14" transform="translate(4 318)">Program</text><text text-anchor="middle" x="72" y="-226.4" font-family="Times,serif" font-size="14" transform="translate(4 318)">WhileStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 22.106V48.06"/><path d="m79.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M107.339 136H44.661l-12 12v12l12 12h62.678l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M44.661 136c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M107.339 136H44.661m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-159.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 99.948v25.416"/><path d="m79.5 125.561-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M136.317 208.7H15.683l-12 12v84.6l12 12h120.634l12-12v-84.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.683 208.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m120.634 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M136.317 208.7H15.683m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h120.634m0 0c6 0 12-6 12-12m0 0v-84.6m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-92.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">BlockStatement</text><text text-anchor="middle" x="72" y="-76" font-family="Times,serif" font-size="14" transform="translate(4 318)">ExpressionStatement</text><text text-anchor="middle" x="72" y="-59.2" font-family="Times,serif" font-size="14" transform="translate(4 318)">AssignmentExpression</text><text text-anchor="middle" x="72" y="-42.4" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (a)</text><text text-anchor="middle" x="72" y="-25.6" font-family="Times,serif" font-size="14" transform="translate(4 318)">CallExpression</text><text text-anchor="middle" x="72" y="-8.8" font-family="Times,serif" font-size="14" transform="translate(4 318)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M70.885 172.191c-.805 7.366-1.312 16.471-1.523 26.03"/><path d="m72.861 198.334-3.611 9.96-3.389-10.038 7 .078z"/></g><g class="edge" stroke="red"><path fill="none" d="M82.75 208.294c-.004-9.004-.263-18.001-.776-25.969"/><path fill="red" d="m78.472 182.451 2.643-10.26 4.332 9.669-6.975.591z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg b/eslint/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg
new file mode 100644 (file)
index 0000000..3f4e02c
--- /dev/null
@@ -0,0 +1 @@
+<svg width="305pt" height="512" viewBox="0 0 305 384" xmlns="http://www.w3.org/2000/svg"><g class="graph"><circle stroke="#000" cx="72" cy="-367" r="9" class="node" transform="translate(4 380)"/><g class="node"><path fill="#fff" stroke="#fff" d="M117.149 58.398H34.85l-12 12v17.204l12 12h82.299l12-12V70.398l-12-12z"/><path fill="#fff" stroke="#fff" d="M34.85 58.398c-6 0-12 6-12 12m0 17.204c0 6 6 12 12 12m82.299 0c6 0 12-6 12-12m0-17.204c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M117.149 58.398H34.85m0 0c-6 0-12 6-12 12m0 0v17.204m0 0c0 6 6 12 12 12m0 0h82.299m0 0c6 0 12-6 12-12m0 0V70.398m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-305.2" font-family="Times,serif" font-size="14" transform="translate(4 380)">Program</text><text text-anchor="middle" x="72" y="-288.4" font-family="Times,serif" font-size="14" transform="translate(4 380)">WhileStatement</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 22.106V48.06"/><path d="m79.5 48.158-3.5 10-3.5-10h7z"/></g><g class="node" stroke="#000" transform="translate(4 380)"><circle cx="230" cy="-13" r="9"/><circle fill="none" cx="230" cy="-13" r="13"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M107.339 136H44.661l-12 12v12l12 12h62.678l12-12v-12l-12-12z"/><path fill="#fff" stroke="#fff" d="M44.661 136c-6 0-12 6-12 12m0 12c0 6 6 12 12 12m62.678 0c6 0 12-6 12-12m0-12c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M107.339 136H44.661m0 0c-6 0-12 6-12 12m0 0v12m0 0c0 6 6 12 12 12m0 0h62.678m0 0c6 0 12-6 12-12m0 0v-12m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-221.8" font-family="Times,serif" font-size="14" transform="translate(4 380)">Identifier (a)</text></g><g class="edge" stroke="#000"><path fill="none" d="M76 99.948v25.416"/><path d="m79.5 125.561-3.5 10-3.5-10h7z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M136.317 208.7H15.683l-12 12v84.6l12 12h120.634l12-12v-84.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M15.683 208.7c-6 0-12 6-12 12m0 84.6c0 6 6 12 12 12m120.634 0c6 0 12-6 12-12m0-84.6c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M136.317 208.7H15.683m0 0c-6 0-12 6-12 12m0 0v84.6m0 0c0 6 6 12 12 12m0 0h120.634m0 0c6 0 12-6 12-12m0 0v-84.6m0 0c0-6-6-12-12-12"/><text text-anchor="middle" x="72" y="-154.8" font-family="Times,serif" font-size="14" transform="translate(4 380)">BlockStatement</text><text text-anchor="middle" x="72" y="-138" font-family="Times,serif" font-size="14" transform="translate(4 380)">ExpressionStatement</text><text text-anchor="middle" x="72" y="-121.2" font-family="Times,serif" font-size="14" transform="translate(4 380)">AssignmentExpression</text><text text-anchor="middle" x="72" y="-104.4" font-family="Times,serif" font-size="14" transform="translate(4 380)">Identifier (a)</text><text text-anchor="middle" x="72" y="-87.6" font-family="Times,serif" font-size="14" transform="translate(4 380)">CallExpression</text><text text-anchor="middle" x="72" y="-70.8" font-family="Times,serif" font-size="14" transform="translate(4 380)">Identifier (foo)</text></g><g class="edge" stroke="#000"><path fill="none" d="M70.885 172.191c-.805 7.366-1.312 16.471-1.523 26.03"/><path d="m72.861 198.334-3.611 9.96-3.389-10.038 7 .078z"/></g><g class="node"><path fill="#fff" stroke="#fff" d="M289.147 233.599H178.853l-12 12v34.802l12 12h110.294l12-12V245.6l-12-12z"/><path fill="#fff" stroke="#fff" d="M178.853 233.599c-6 0-12 6-12 12m0 34.802c0 6 6 12 12 12m110.294 0c6 0 12-6 12-12m0-34.802c0-6-6-12-12-12"/><path fill="none" stroke="#000" d="M289.147 233.599H178.853m0 0c-6 0-12 6-12 12m0 0v34.802m0 0c0 6 6 12 12 12m0 0h110.294m0 0c6 0 12-6 12-12m0 0V245.6m0-.001c0-6-6-12-12-12"/><text text-anchor="middle" x="230" y="-129.6" font-family="Times,serif" font-size="14" transform="translate(4 380)">ExpressionStatement</text><text text-anchor="middle" x="230" y="-112.8" font-family="Times,serif" font-size="14" transform="translate(4 380)">CallExpression</text><text text-anchor="middle" x="230" y="-96" font-family="Times,serif" font-size="14" transform="translate(4 380)">Identifier (bar)</text></g><g class="edge" stroke="#000"><path fill="none" d="M102.775 172.211C118.624 182.477 139.053 195.84 157 208c9.409 6.375 19.395 13.276 28.947 19.945"/><path d="m188.021 225.125 6.184 8.602-10.199-2.868 4.015-5.734z"/></g><g class="edge" stroke="#000"><path fill="none" d="M82.75 208.294c-.004-9.004-.263-18.001-.776-25.969"/><path d="m78.472 182.451 2.643-10.26 4.332 9.669-6.975.591z"/></g><g class="edge" stroke="#000"><path fill="none" d="M234 292.413v51.158"/><path d="m237.5 343.98-3.5 10-3.5-10h7z"/></g></g></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/arrow-left.svg b/eslint/docs/src/assets/images/icons/arrow-left.svg
new file mode 100644 (file)
index 0000000..83483a7
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19 12H5m0 0 7 7m-7-7 7-7" stroke="#667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/arrow-right.svg b/eslint/docs/src/assets/images/icons/arrow-right.svg
new file mode 100644 (file)
index 0000000..22bb24f
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 12h14m0 0-7-7m7 7-7 7" stroke="#667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/arrow-top-right.svg b/eslint/docs/src/assets/images/icons/arrow-top-right.svg
new file mode 100644 (file)
index 0000000..58bbed8
--- /dev/null
@@ -0,0 +1 @@
+<svg width="13" height="12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m1.5 11 10-10m0 0h-10m10 0v10" stroke="#101828" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/chevron-down.svg b/eslint/docs/src/assets/images/icons/chevron-down.svg
new file mode 100644 (file)
index 0000000..b09f7f7
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m5 7.61 5 5 5-5" stroke="#667085" stroke-width="1.667" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/copy.svg b/eslint/docs/src/assets/images/icons/copy.svg
new file mode 100644 (file)
index 0000000..24fc6af
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.167 12.5h-.834a1.667 1.667 0 0 1-1.666-1.667v-7.5a1.667 1.667 0 0 1 1.666-1.666h7.5A1.666 1.666 0 0 1 12.5 3.333v.834M9.167 7.5h7.5c.92 0 1.666.746 1.666 1.667v7.5c0 .92-.746 1.666-1.666 1.666h-7.5c-.92 0-1.667-.746-1.667-1.666v-7.5c0-.92.746-1.667 1.667-1.667Z" stroke="#667085" stroke-width="1.667" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/correct.svg b/eslint/docs/src/assets/images/icons/correct.svg
new file mode 100644 (file)
index 0000000..4f58924
--- /dev/null
@@ -0,0 +1 @@
+<svg width="45" height="44" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="1" width="42" height="42" rx="21" fill="#ECFDF3"/><path d="m30.5 16-11 11-5-5" stroke="#12B76A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><rect x="1.5" y="1" width="42" height="42" rx="21" stroke="#fff" stroke-width="2"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/discord.svg b/eslint/docs/src/assets/images/icons/discord.svg
new file mode 100644 (file)
index 0000000..16bae7b
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="25" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)" fill="#98A2B3"><path d="M9.328 10.178a1.337 1.337 0 0 0 0 2.664 1.278 1.278 0 0 0 1.224-1.332 1.272 1.272 0 0 0-1.224-1.332Zm4.38 0a1.337 1.337 0 1 0 1.224 1.332 1.277 1.277 0 0 0-1.224-1.332Z"/><path d="M19.54.11H3.46A2.466 2.466 0 0 0 1 2.582V18.81a2.466 2.466 0 0 0 2.46 2.472h13.608l-.636-2.22 1.536 1.428 1.452 1.34L22 24.11V2.582A2.466 2.466 0 0 0 19.54.11Zm-4.632 15.672s-.432-.516-.792-.972a3.786 3.786 0 0 0 2.172-1.428 6.863 6.863 0 0 1-1.38.708 7.898 7.898 0 0 1-1.74.516 8.406 8.406 0 0 1-3.108-.012 10.086 10.086 0 0 1-1.76-.516 6.847 6.847 0 0 1-1.368-.708 3.732 3.732 0 0 0 2.1 1.416c-.36.456-.8 1-.8 1a4.35 4.35 0 0 1-3.66-1.824 16.07 16.07 0 0 1 1.728-7 5.934 5.934 0 0 1 3.372-1.26l.12.144a8.1 8.1 0 0 0-3.164 1.572s.264-.144.708-.348a9.012 9.012 0 0 1 2.724-.76c.066-.014.133-.022.2-.024a10.153 10.153 0 0 1 2.424-.024A9.782 9.782 0 0 1 16.3 7.418a7.986 7.986 0 0 0-2.988-1.524l.168-.192a5.934 5.934 0 0 1 3.372 1.26 16.07 16.07 0 0 1 1.728 7 4.386 4.386 0 0 1-3.672 1.82Z"/></g><defs><clipPath id="a"><path fill="#fff" transform="translate(0 .11)" d="M0 0h24v24H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/facebook.svg b/eslint/docs/src/assets/images/icons/facebook.svg
new file mode 100644 (file)
index 0000000..194c834
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.093 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.563V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/features-list-icon.svg b/eslint/docs/src/assets/images/icons/features-list-icon.svg
new file mode 100644 (file)
index 0000000..2e576cf
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="24" height="24" rx="12" fill="#F6F6FE"/><path d="M17.334 8 10 15.333 6.667 12" stroke="#4B32C3" stroke-width="1.333" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/github-icon-mono.svg b/eslint/docs/src/assets/images/icons/github-icon-mono.svg
new file mode 100644 (file)
index 0000000..f73b88b
--- /dev/null
@@ -0,0 +1 @@
+<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.25 0C4.611 0 0 4.612 0 10.25a10.24 10.24 0 0 0 7.004 9.737c.512.085.683-.257.683-.513v-1.708c-2.818.598-3.416-1.367-3.416-1.367-.427-1.196-1.11-1.537-1.11-1.537-1.026-.598 0-.598 0-.598 1.024.085 1.537 1.025 1.537 1.025.94 1.537 2.391 1.11 2.99.854.085-.683.34-1.11.682-1.367-2.306-.256-4.697-1.11-4.697-5.039 0-1.11.427-2.05 1.025-2.733 0-.342-.427-1.367.17-2.733 0 0 .855-.257 2.82 1.025.853-.257 1.707-.342 2.561-.342.855 0 1.709.085 2.563.342C14.776 3.929 15.63 4.27 15.63 4.27c.598 1.452.17 2.477.085 2.733.683.683 1.025 1.623 1.025 2.733 0 3.93-2.392 4.783-4.698 5.04.342.341.684.939.684 1.879v2.818c0 .256.17.598.683.513a10.238 10.238 0 0 0 7.004-9.737C20.499 4.611 15.887 0 10.249 0Z" fill="#fff"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/github-img.svg b/eslint/docs/src/assets/images/icons/github-img.svg
new file mode 100644 (file)
index 0000000..51ad25a
--- /dev/null
@@ -0,0 +1 @@
+<svg width="64" height="64" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 .8C14.4.8 0 15.2 0 32.8a31.965 31.965 0 0 0 21.867 30.4c1.6.267 2.133-.8 2.133-1.6v-5.333C15.2 58.133 13.333 52 13.333 52 12 48.267 9.867 47.2 9.867 47.2c-3.2-1.867 0-1.867 0-1.867 3.2.267 4.8 3.2 4.8 3.2C17.6 53.333 22.133 52 24 51.2c.267-2.133 1.067-3.467 2.133-4.267-7.2-.8-14.666-3.466-14.666-15.733 0-3.467 1.333-6.4 3.2-8.533 0-1.067-1.334-4.267.533-8.534 0 0 2.667-.8 8.8 3.2 2.667-.8 5.333-1.066 8-1.066s5.333.266 8 1.066c6.133-4.266 8.8-3.2 8.8-3.2 1.867 4.534.533 7.734.267 8.534 2.133 2.133 3.2 5.066 3.2 8.533 0 12.267-7.467 14.933-14.667 15.733 1.067 1.067 2.133 2.934 2.133 5.867v8.8c0 .8.534 1.867 2.134 1.6a31.965 31.965 0 0 0 21.866-30.4C64 15.2 49.6.8 32 .8Z" fill="#101828"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/github-large.svg b/eslint/docs/src/assets/images/icons/github-large.svg
new file mode 100644 (file)
index 0000000..c540e36
--- /dev/null
@@ -0,0 +1 @@
+<svg width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5.147c-6.6 0-12 5.4-12 12 0 5.3 3.4 9.8 8.2 11.4.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.5-1.4-1.3-1.8-1.3-1.8-1.2-.7 0-.7 0-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2 0-.4-.5-1.6.2-3.2 0 0 1-.3 3.3 1.2 1-.3 2-.4 3-.4s2 .1 3 .4c2.3-1.6 3.3-1.2 3.3-1.2.7 1.7.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.8 5.6-5.5 5.9.4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6 4.8-1.6 8.2-6.1 8.2-11.4.1-6.6-5.3-12-11.9-12Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/github-small.svg b/eslint/docs/src/assets/images/icons/github-small.svg
new file mode 100644 (file)
index 0000000..b410d3a
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 .2c-4.4 0-8 3.6-8 8a7.991 7.991 0 0 0 5.467 7.6c.4.067.533-.2.533-.4v-1.333C3.8 14.533 3.333 13 3.333 13c-.333-.933-.866-1.2-.866-1.2-.8-.467 0-.467 0-.467.8.067 1.2.8 1.2.8C4.4 13.333 5.533 13 6 12.8c.067-.533.267-.867.533-1.067-1.8-.2-3.666-.866-3.666-3.933 0-.867.333-1.6.8-2.133 0-.267-.334-1.067.133-2.134 0 0 .667-.2 2.2.8.667-.2 1.333-.266 2-.266s1.333.066 2 .266c1.533-1.066 2.2-.8 2.2-.8.467 1.134.133 1.934.067 2.134.533.533.8 1.266.8 2.133 0 3.067-1.867 3.733-3.667 3.933.267.267.533.734.533 1.467v2.2c0 .2.134.467.534.4a7.991 7.991 0 0 0 5.466-7.6C16 3.8 12.4.2 8 .2Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/github.svg b/eslint/docs/src/assets/images/icons/github.svg
new file mode 100644 (file)
index 0000000..0f31496
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 10 4.844a9.59 9.59 0 0 1 2.504.337c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.02 10.02 0 0 0 20 10.017C20 4.484 15.522 0 10 0Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/google.svg b/eslint/docs/src/assets/images/icons/google.svg
new file mode 100644 (file)
index 0000000..8b149df
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="25" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M23.507 9.928H12.052v4.909h6.492C17.507 18.11 14.944 19.2 12 19.2a7.09 7.09 0 1 1 4.553-12.52l3.567-3.4A12 12 0 1 0 12 24.11c6.617 0 12.6-4.364 11.507-14.182Z" fill="#98A2B3"/></g><defs><clipPath id="a"><path fill="#fff" transform="translate(0 .11)" d="M0 0h24v24H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/incorrect.svg b/eslint/docs/src/assets/images/icons/incorrect.svg
new file mode 100644 (file)
index 0000000..666811e
--- /dev/null
@@ -0,0 +1 @@
+<svg width="45" height="44" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="1" width="42" height="42" rx="21" fill="#FFF1F3"/><path d="m28.5 16-12 12m0-12 12 12" stroke="#F63D68" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><rect x="1.5" y="1" width="42" height="42" rx="21" stroke="#fff" stroke-width="2"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/languages.svg b/eslint/docs/src/assets/images/icons/languages.svg
new file mode 100644 (file)
index 0000000..2653515
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M31.33 23.48a7.06 7.06 0 0 0-4.79 1.87 1.48 1.48 0 0 0-.94-.35 8.13 8.13 0 0 1-3.11-.59 12.28 12.28 0 0 0 2.48-6.3h.66a1.5 1.5 0 0 0 0-3h-4.29v-2.33a1.5 1.5 0 1 0-3 0v2.34h-4.26a1.5 1.5 0 0 0 0 3h7.84A9 9 0 0 1 20 22.67a9.32 9.32 0 0 1-1.76-2.93 1.5 1.5 0 1 0-2.82 1 12.38 12.38 0 0 0 2.11 3.63 9.28 9.28 0 0 1-3.42.6 1.5 1.5 0 1 0 0 3A11.3 11.3 0 0 0 20 26.54 10.42 10.42 0 0 0 24.71 28a7 7 0 0 0-.51 2.63v1.12H13.77a1.5 1.5 0 0 0-1.14.52 1.47 1.47 0 0 0-.34 1.21c0 .1.19 1.23.53 2.82a1 1 0 0 1-1.57 1C8.1 35 4.74 32.2 3.69 30.23a1.82 1.82 0 0 0-.15-.23 4.07 4.07 0 0 1-.74-2.35V11.52a4.13 4.13 0 0 1 4.13-4.13h25.74a4.13 4.13 0 0 1 4.13 4.13v12Zm29.87 7.13V46.7a4 4 0 0 1-.74 2.35 1.17 1.17 0 0 0-.15.27c-1 2-4.41 4.77-7.56 7.09a1 1 0 0 1-1.57-1c.34-1.6.52-2.73.53-2.83a1.49 1.49 0 0 0-1.48-1.73h-18.9a4.13 4.13 0 0 1-4.13-4.15V30.61a4.13 4.13 0 0 1 4.13-4.13h25.74a4.13 4.13 0 0 1 4.13 4.13Zm-10.42 14-1.73-4.31-3.42-8.56a1.3 1.3 0 0 0-.08-.17l-.06-.1-.09-.12-.09-.1-.1-.09-.13-.1L45 31l-.16-.09a.38.38 0 0 0-.1 0l-.16-.05H44l-.17.05a.38.38 0 0 0-.1 0l-.15.09-.11.05-.12.1-.1.09-.09.1-.1.12s0 .07-.05.1l-.09.17-3.5 8.57-1.73 4.32a1.51 1.51 0 0 0 .84 2 1.55 1.55 0 0 0 .56.11 1.51 1.51 0 0 0 1.39-1l1.34-3.35h4.84L48 45.73a1.49 1.49 0 0 0 1.39 1 1.54 1.54 0 0 0 .55-.11 1.5 1.5 0 0 0 .84-2ZM43 39.38h2.44l-1.22-3Z"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/learn-more-arrow.svg b/eslint/docs/src/assets/images/icons/learn-more-arrow.svg
new file mode 100644 (file)
index 0000000..8aab0b9
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.167 10h11.666m0 0L10 4.167M15.833 10 10 15.833" stroke="#4B32C3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/link.svg b/eslint/docs/src/assets/images/icons/link.svg
new file mode 100644 (file)
index 0000000..6dfe158
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.334 10.833a4.165 4.165 0 0 0 6.283.45l2.5-2.5a4.167 4.167 0 0 0-5.892-5.891L9.792 4.317m1.875 4.85a4.165 4.165 0 0 0-6.284-.45l-2.5 2.5a4.167 4.167 0 0 0 5.892 5.891l1.425-1.425" stroke="#344054" stroke-width="1.67" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/linkedin.svg b/eslint/docs/src/assets/images/icons/linkedin.svg
new file mode 100644 (file)
index 0000000..a7c36f6
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.52 0H1.477C.66 0 0 .645 0 1.441v17.114C0 19.352.66 20 1.477 20H18.52c.816 0 1.48-.648 1.48-1.441V1.44C20 .645 19.336 0 18.52 0ZM5.934 17.043h-2.97V7.496h2.97v9.547ZM4.449 6.195a1.72 1.72 0 1 1-.006-3.439 1.72 1.72 0 0 1 .006 3.44Zm12.594 10.848h-2.965v-4.64c0-1.106-.02-2.532-1.543-2.532-1.543 0-1.777 1.207-1.777 2.453v4.719H7.797V7.496h2.844v1.305h.039c.394-.75 1.363-1.543 2.804-1.543 3.004 0 3.559 1.976 3.559 4.547v5.238Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/menu.svg b/eslint/docs/src/assets/images/icons/menu.svg
new file mode 100644 (file)
index 0000000..d068dbd
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 7h18M1 1h18M1 13h18" stroke="#101828" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/minus-circle.svg b/eslint/docs/src/assets/images/icons/minus-circle.svg
new file mode 100644 (file)
index 0000000..f8e8023
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 12h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" stroke="#98A2B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/npm.svg b/eslint/docs/src/assets/images/icons/npm.svg
new file mode 100644 (file)
index 0000000..c9baf32
--- /dev/null
@@ -0,0 +1 @@
+<svg width="16" height="8" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M0 .889h16v5.333H8v.89H4.444v-.89H0V.89Zm.889 4.444h1.778V2.667h.889v2.666h.888V1.778H.89v3.555Zm4.444-3.555v4.444h1.778v-.889H8.89V1.778H5.333Zm1.778.889H8v1.777h-.889V2.667Zm2.667-.89v3.556h1.778V2.667h.888v2.666h.89V2.667h.888v2.666h.89V1.778H9.777Z" fill="#98A2B3"/></g><defs><clipPath id="a"><path fill="#fff" transform="translate(0 .889)" d="M0 0h16v6.222H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/open-collectione-mono.svg b/eslint/docs/src/assets/images/icons/open-collectione-mono.svg
new file mode 100644 (file)
index 0000000..6604783
--- /dev/null
@@ -0,0 +1 @@
+<svg width="21" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff"><path d="M16.876 9.974c0 1.26-.366 2.467-.993 3.464l2.561 2.572c1.254-1.68 2.039-3.78 2.039-6.037s-.785-4.356-2.039-6.036l-2.561 2.571c.627.998.993 2.153.993 3.465Z"/><path d="M10.501 16.378c-3.502 0-6.377-2.887-6.377-6.404S7 3.57 10.501 3.57c1.307 0 2.456.368 3.45 1.05l2.561-2.572C14.84.788 12.75 0 10.501 0 5.012 0 .518 4.462.518 10.026.518 15.591 5.012 20 10.5 20c2.3 0 4.39-.788 6.063-2.047l-2.56-2.572a6.515 6.515 0 0 1-3.503.998Z"/></g><defs><clipPath id="a"><path fill="#fff" transform="translate(.5)" d="M0 0h20v20H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/opencollective-img.svg b/eslint/docs/src/assets/images/icons/opencollective-img.svg
new file mode 100644 (file)
index 0000000..a3b46dc
--- /dev/null
@@ -0,0 +1 @@
+<svg width="64" height="64" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M52.402 31.916c0 4.03-1.17 7.895-3.178 11.087l8.196 8.23c4.014-5.375 6.523-12.094 6.523-19.318 0-7.224-2.51-13.942-6.523-19.318l-8.196 8.23c2.007 3.192 3.178 6.887 3.178 11.087v.002Z" fill="#B8D3F4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M32.004 52.41c-11.207 0-20.406-9.24-20.406-20.493 0-11.253 9.2-20.493 20.406-20.493 4.182 0 7.86 1.176 11.04 3.36l8.196-8.23C45.887 2.52 39.197 0 32.004 0 14.44 0 .057 14.278.057 32.084.057 49.89 14.44 64 32.004 64c7.36 0 14.05-2.52 19.403-6.55l-8.196-8.23c-3.178 2.016-7.025 3.192-11.207 3.192v-.002Z" fill="#3385FF"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/plus-circle.svg b/eslint/docs/src/assets/images/icons/plus-circle.svg
new file mode 100644 (file)
index 0000000..58533a0
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" stroke="#98A2B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/search.svg b/eslint/docs/src/assets/images/icons/search.svg
new file mode 100644 (file)
index 0000000..6c70237
--- /dev/null
@@ -0,0 +1 @@
+<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m17.5 17.5-3.625-3.625m1.958-4.708a6.667 6.667 0 1 1-13.333 0 6.667 6.667 0 0 1 13.333 0Z" stroke="#667085" stroke-width="1.667" stroke-linecap="round" stroke-linejoin="round"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/icons/twitter.svg b/eslint/docs/src/assets/images/icons/twitter.svg
new file mode 100644 (file)
index 0000000..ffee249
--- /dev/null
@@ -0,0 +1 @@
+<svg width="24" height="25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 4.71c-.9.4-1.8.7-2.8.8 1-.6 1.8-1.6 2.2-2.7-1 .6-2 1-3.1 1.2-.9-1-2.2-1.6-3.6-1.6-2.7 0-4.9 2.2-4.9 4.9 0 .4 0 .8.1 1.1-4.2-.2-7.8-2.2-10.2-5.2-.5.8-.7 1.6-.7 2.5 0 1.7.9 3.2 2.2 4.1-.8 0-1.6-.2-2.2-.6v.1c0 2.4 1.7 4.4 3.9 4.8-.4.1-.8.2-1.3.2-.3 0-.6 0-.9-.1.6 2 2.4 3.4 4.6 3.4-1.7 1.3-3.8 2.1-6.1 2.1-.4 0-.8 0-1.2-.1 2.2 1.4 4.8 2.2 7.5 2.2 9.1 0 14-7.5 14-14v-.6c1-.7 1.8-1.6 2.5-2.5Z" fill="#98A2B3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/images/logo/brand-colors.svg b/eslint/docs/src/assets/images/logo/brand-colors.svg
new file mode 100644 (file)
index 0000000..2c2048d
--- /dev/null
@@ -0,0 +1 @@
+<svg width="52" height="12" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="6" cy="6" r="6" fill="#F2F4F7"/><circle cx="26" cy="6" r="6" fill="#101828"/><circle cx="46" cy="6" r="6" fill="#4B32C3"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/assets/js/components-index.js b/eslint/docs/src/assets/js/components-index.js
new file mode 100644 (file)
index 0000000..9e3bc0f
--- /dev/null
@@ -0,0 +1,35 @@
+(function() {
+    var index_trigger = document.getElementById("js-index-toggle"),
+        index = document.getElementById("js-index-list"),
+        body = document.getElementsByTagName("body")[0],
+        open = false;
+
+    if (matchMedia) {
+        const mq = window.matchMedia("(max-width: 1023px)");
+        mq.addEventListener('change', WidthChange);
+        WidthChange(mq);
+    }
+
+    function WidthChange(mq) {
+        initIndex();
+    }
+
+    function toggleindex(e) {
+        if (!open) {
+            this.setAttribute("aria-expanded", "true");
+            index.setAttribute("data-open", "true");
+            open = true;
+        } else {
+            this.setAttribute("aria-expanded", "false");
+            index.setAttribute("data-open", "false");
+            open = false;
+        }
+    }
+
+    function initIndex() {
+        index_trigger.removeAttribute("hidden");
+        index_trigger.setAttribute("aria-expanded", "false");
+        index.setAttribute("data-open", "false");
+        index_trigger.addEventListener("click", toggleindex, false);
+    }
+})();
diff --git a/eslint/docs/src/assets/js/css-vars-ponyfill@2.js b/eslint/docs/src/assets/js/css-vars-ponyfill@2.js
new file mode 100644 (file)
index 0000000..3285a57
--- /dev/null
@@ -0,0 +1,47 @@
+/*!
+ * css-vars-ponyfill
+ * v2.1.2
+ * https://jhildenbiddle.github.io/css-vars-ponyfill/
+ * (c) 2018-2019 John Hildenbiddle <http://hildenbiddle.com>
+ * MIT license
+ */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).cssVars=t()}(this,function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function t(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},n=Array.isArray(e)?e:[e],o=Array.apply(null,Array(n.length)).map(function(e){return null});function s(){return!("<"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().charAt(0))}function a(e,t){r.onError(e,n[t],t)}function c(e,t){var s=r.onSuccess(e,n[t],t);e=!1===s?"":s||e,o[t]=e,-1===o.indexOf(null)&&r.onComplete(o)}var i=document.createElement("a");n.forEach(function(e,t){if(i.setAttribute("href",e),i.href=String(i.href),Boolean(document.all&&!window.atob)&&i.host.split(":")[0]!==location.host.split(":")[0]){if(i.protocol===location.protocol){var n=new XDomainRequest;n.open("GET",e),n.timeout=0,n.onprogress=Function.prototype,n.ontimeout=Function.prototype,n.onload=function(){s(n.responseText)?c(n.responseText,t):a(n,t)},n.onerror=function(e){a(n,t)},setTimeout(function(){n.send()},0)}else console.warn("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (".concat(e,")")),a(null,t)}else{var o=new XMLHttpRequest;o.open("GET",e),r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType),r.onBeforeSend(o,e,t),o.onreadystatechange=function(){4===o.readyState&&(200===o.status&&s(o.responseText)?c(o.responseText,t):a(o,t))},o.send()}})}function n(e){var t={cssComments:/\/\*[\s\S]+?\*\//g,cssImports:/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g},n={rootElement:e.rootElement||document,include:e.include||'style,link[rel="stylesheet"]',exclude:e.exclude||null,filter:e.filter||null,useCSSOM:e.useCSSOM||!1,onBeforeSend:e.onBeforeSend||Function.prototype,onSuccess:e.onSuccess||Function.prototype,onError:e.onError||Function.prototype,onComplete:e.onComplete||Function.prototype},s=Array.apply(null,n.rootElement.querySelectorAll(n.include)).filter(function(e){return t=e,r=n.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,r);var t,r}),a=Array.apply(null,Array(s.length)).map(function(e){return null});function c(){if(-1===a.indexOf(null)){var e=a.join("");n.onComplete(e,a,s)}}function i(e,t,o,s){var i=n.onSuccess(e,o,s);(function e(t,o,s,a){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];var l=u(t,s,i);l.rules.length?r(l.absoluteUrls,{onBeforeSend:function(e,t,r){n.onBeforeSend(e,o,t)},onSuccess:function(e,t,r){var s=n.onSuccess(e,o,t),a=u(e=!1===s?"":s||e,t,i);return a.rules.forEach(function(t,r){e=e.replace(t,a.absoluteRules[r])}),e},onError:function(r,n,u){c.push({xhr:r,url:n}),i.push(l.rules[u]),e(t,o,s,a,c,i)},onComplete:function(r){r.forEach(function(e,r){t=t.replace(l.rules[r],e)}),e(t,o,s,a,c,i)}}):a(t,c)})(e=void 0!==i&&!1===Boolean(i)?"":i||e,o,s,function(e,r){null===a[t]&&(r.forEach(function(e){return n.onError(e.xhr,o,e.url)}),!n.filter||n.filter.test(e)?a[t]=e:a[t]="",c())})}function u(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s={};return s.rules=(e.replace(t.cssComments,"").match(t.cssImports)||[]).filter(function(e){return-1===n.indexOf(e)}),s.urls=s.rules.map(function(e){return e.replace(t.cssImports,"$1")}),s.absoluteUrls=s.urls.map(function(e){return o(e,r)}),s.absoluteRules=s.rules.map(function(e,t){var n=s.urls[t],a=o(s.absoluteUrls[t],r);return e.replace(n,a)}),s}s.length?s.forEach(function(e,t){var s=e.getAttribute("href"),u=e.getAttribute("rel"),l="LINK"===e.nodeName&&s&&u&&"stylesheet"===u.toLowerCase(),f="STYLE"===e.nodeName;if(l)r(s,{mimeType:"text/css",onBeforeSend:function(t,r,o){n.onBeforeSend(t,e,r)},onSuccess:function(r,n,a){var c=o(s,location.href);i(r,t,e,c)},onError:function(r,o,s){a[t]="",n.onError(r,e,o),c()}});else if(f){var d=e.textContent;n.useCSSOM&&(d=Array.apply(null,e.sheet.cssRules).map(function(e){return e.cssText}).join("")),i(d,t,e,location.href)}else a[t]="",c()}):n.onComplete("",[])}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t,o.href=e,o.href}var s=a;function a(e,t,r){e instanceof RegExp&&(e=c(e,r)),t instanceof RegExp&&(t=c(t,r));var n=i(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function c(e,t){var r=t.match(e);return r?r[0]:null}function i(e,t,r){var n,o,s,a,c,i=r.indexOf(e),u=r.indexOf(t,i+1),l=i;if(i>=0&&u>0){for(n=[],s=r.length;l>=0&&!c;)l==i?(n.push(l),i=r.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((o=n.pop())<s&&(s=o,a=u),u=r.indexOf(t,l+1)),l=i<u&&i>=0?i:u;n.length&&(c=[s,a])}return c}function u(t){var r=e({},{preserveStatic:!0,removeComments:!1},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});function n(e){throw new Error("CSS parse error: ".concat(e))}function o(e){var r=e.exec(t);if(r)return t=t.slice(r[0].length),r}function a(){return o(/^{\s*/)}function c(){return o(/^}/)}function i(){o(/^\s*/)}function u(){if(i(),"/"===t[0]&&"*"===t[1]){for(var e=2;t[e]&&("*"!==t[e]||"/"!==t[e+1]);)e++;if(!t[e])return n("end of comment is missing");var r=t.slice(2,e);return t=t.slice(e+2),{type:"comment",comment:r}}}function l(){for(var e,t=[];e=u();)t.push(e);return r.removeComments?[]:t}function f(){for(i();"}"===t[0];)n("extra closing bracket");var e=o(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(e)return e[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function d(){o(/^([;\s]*)+/);var e=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g,t=o(/^(\*?[-#\/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=t[0].trim(),!o(/^:\s*/))return n("property missing ':'");var r=o(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),s={type:"declaration",property:t.replace(e,""),value:r?r[0].replace(e,"").trim():""};return o(/^[;\s]*/),s}}function p(){if(!a())return n("missing '{'");for(var e,t=l();e=d();)t.push(e),t=t.concat(l());return c()?t:n("missing '}'")}function m(){i();for(var e,t=[];e=o(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),o(/^,\s*/);if(t.length)return{type:"keyframe",values:t,declarations:p()}}function v(){if(i(),"@"===t[0]){var e=function(){var e=o(/^@([-\w]+)?keyframes\s*/);if(e){var t=e[1];if(!(e=o(/^([-\w]+)\s*/)))return n("@keyframes missing name");var r,s=e[1];if(!a())return n("@keyframes missing '{'");for(var i=l();r=m();)i.push(r),i=i.concat(l());return c()?{type:"keyframes",name:s,vendor:t,keyframes:i}:n("@keyframes missing '}'")}}()||function(){var e=o(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:y()}}()||function(){if(o(/^@host\s*/))return{type:"host",rules:y()}}()||function(){var e=o(/^@media([^{]+)*/);if(e)return{type:"media",media:(e[1]||"").trim(),rules:y()}}()||function(){var e=o(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}()||function(){if(o(/^@page */))return{type:"page",selectors:f()||[],declarations:p()}}()||function(){var e=o(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:y()}}()||function(){if(o(/^@font-face\s*/))return{type:"font-face",declarations:p()}}()||function(){var e=o(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}();if(e&&!r.preserveStatic){var s=!1;if(e.declarations)s=e.declarations.some(function(e){return/var\(/.test(e.value)});else s=(e.keyframes||e.rules||[]).some(function(e){return(e.declarations||[]).some(function(e){return/var\(/.test(e.value)})});return s?e:{}}return e}}function h(){if(!r.preserveStatic){var e=s("{","}",t);if(e){var o=/:(?:root|host)(?![.:#(])/.test(e.pre)&&/--\S*\s*:/.test(e.body),a=/var\(/.test(e.body);if(!o&&!a)return t=t.slice(e.end+1),{}}}var c=f()||[],i=r.preserveStatic?p():p().filter(function(e){var t=c.some(function(e){return/:(?:root|host)(?![.:#(])/.test(e)})&&/^--\S/.test(e.property),r=/var\(/.test(e.value);return t||r});return c.length||n("selector missing"),{type:"rule",selectors:c,declarations:i}}function y(e){if(!e&&!a())return n("missing '{'");for(var r,o=l();t.length&&(e||"}"!==t[0])&&(r=v()||h());)r.type&&o.push(r),o=o.concat(l());return e||c()?o:n("missing '}'")}return{type:"stylesheet",stylesheet:{rules:y(!0),errors:[]}}}function l(t){var r=e({},{parseHost:!1,store:{},onWarning:function(){}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=new RegExp(":".concat(r.parseHost?"host":"root","(?![.:#(])"));return"string"==typeof t&&(t=u(t,r)),t.stylesheet.rules.forEach(function(e){"rule"===e.type&&e.selectors.some(function(e){return n.test(e)})&&e.declarations.forEach(function(e,t){var n=e.property,o=e.value;n&&0===n.indexOf("--")&&(r.store[n]=o)})}),r.store}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+o(e.rules)+"}"},"font-face":function(e){return"@font-face{"+o(e.declarations)+"}"},host:function(e){return"@host{"+o(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+o(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+o(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+o(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+o(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+o(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+o(e.rules)+"}"}};function o(e){for(var o="",s=0;s<e.length;s++){var a=e[s];r&&r(a);var c=n[a.type](a);c&&(o+=c,c.length&&a.selectors&&(o+=t))}return o}return o(e.stylesheet.rules)}a.range=i;var d="--",p="var";function m(t){var r=e({},{preserveStatic:!0,preserveVars:!1,variables:{},onWarning:function(){}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return"string"==typeof t&&(t=u(t,r)),function e(t,r){t.rules.forEach(function(n){n.rules?e(n,r):n.keyframes?n.keyframes.forEach(function(e){"keyframe"===e.type&&r(e.declarations,n)}):n.declarations&&r(n.declarations,t)})}(t.stylesheet,function(e,t){for(var n=0;n<e.length;n++){var o=e[n],s=o.type,a=o.property,c=o.value;if("declaration"===s)if(r.preserveVars||!a||0!==a.indexOf(d)){if(-1!==c.indexOf(p+"(")){var i=h(c,r);i!==o.value&&(i=v(i),r.preserveVars?(e.splice(n,0,{type:s,property:a,value:i}),n++):o.value=i)}}else e.splice(n,1),n--}}),f(t)}function v(e){return(e.match(/calc\(([^)]+)\)/g)||[]).forEach(function(t){var r="calc".concat(t.split("calc").join(""));e=e.replace(t,r)}),e}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(-1===e.indexOf("var("))return e;var n=s("(",")",e);return n?"var"===n.pre.slice(-3)?0===n.body.trim().length?(t.onWarning("var() must contain a non-whitespace string"),e):n.pre.slice(0,-3)+function(e){var n=e.split(",")[0].replace(/[\s\n\t]/g,""),o=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],s=Object.prototype.hasOwnProperty.call(t.variables,n)?String(t.variables[n]):void 0,a=s||(o?String(o):void 0),c=r||e;return s||t.onWarning('variable "'.concat(n,'" is undefined')),a&&"undefined"!==a&&a.length>0?h(a,t,c):"var(".concat(c,")")}(n.body)+h(n.post,t):n.pre+"(".concat(h(n.body,t),")")+h(n.post,t):(-1!==e.indexOf("var(")&&t.onWarning('missing closing ")" in the value "'.concat(e,'"')),e)}var y="undefined"!=typeof window,g=y&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),S={group:0,job:0},b={rootElement:y?document:null,shadowDOM:!1,include:"style,link[rel=stylesheet]",exclude:"",variables:{},onlyLegacy:!0,preserveStatic:!0,preserveVars:!1,silent:!1,updateDOM:!0,updateURLs:!0,watch:null,onBeforeSend:function(){},onWarning:function(){},onError:function(){},onSuccess:function(){},onComplete:function(){}},E={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssMediaQueries:/@media[^{]+\{([\s\S]+?})\s*}/g,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVarDeclRules:/(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^}]*})/g,cssVarDecls:/(?:[\s;]*)(-{2}\w[\w-]*)(?:\s*:\s*)([^;]*);/g,cssVarFunc:/var\(\s*--[\w-]/,cssVars:/(?:(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},w={dom:{},job:{},user:{}},C=!1,O=null,A=0,x=null,j=!1;function k(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o="cssVars(): ",s=e({},b,r);function a(e,t,r,n){!s.silent&&window.console&&console.error("".concat(o).concat(e,"\n"),t),s.onError(e,t,r,n)}function c(e){!s.silent&&window.console&&console.warn("".concat(o).concat(e)),s.onWarning(e)}if(y){if(s.watch)return s.watch=b.watch,function(e){function t(e){return"LINK"===e.tagName&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")&&!e.disabled}if(!window.MutationObserver)return;O&&(O.disconnect(),O=null);(O=new MutationObserver(function(r){r.some(function(r){var n,o=!1;return"attributes"===r.type?o=t(r.target):"childList"===r.type&&(n=r.addedNodes,o=Array.apply(null,n).some(function(e){var r=1===e.nodeType&&e.hasAttribute("data-cssvars"),n=function(e){return"STYLE"===e.tagName&&!e.disabled}(e)&&E.cssVars.test(e.textContent);return!r&&(t(e)||n)})||function(t){return Array.apply(null,t).some(function(t){var r=1===t.nodeType,n=r&&"out"===t.getAttribute("data-cssvars"),o=r&&"src"===t.getAttribute("data-cssvars"),s=o;if(o||n){var a=t.getAttribute("data-cssvars-group"),c=e.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));o&&(L(e.rootElement),w.dom={}),c&&c.parentNode.removeChild(c)}return s})}(r.removedNodes)),o})&&k(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0})}(s),void k(s);if(!1===s.watch&&O&&(O.disconnect(),O=null),!s.__benchmark){if(C===s.rootElement)return void function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(x),x=setTimeout(function(){e.__benchmark=null,k(e)},t)}(r);if(s.__benchmark=T(),s.exclude=[O?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',s.exclude].filter(function(e){return e}).join(","),s.variables=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=/^-{2}/;return Object.keys(e).reduce(function(r,n){return r[t.test(n)?n:"--".concat(n.replace(/^-+/,""))]=e[n],r},{})}(s.variables),!O)if(Array.apply(null,s.rootElement.querySelectorAll('[data-cssvars="out"]')).forEach(function(e){var t=e.getAttribute("data-cssvars-group");(t?s.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(t,'"]')):null)||e.parentNode.removeChild(e)}),A){var i=s.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])');i.length<A&&(A=i.length,w.dom={})}}if("loading"!==document.readyState)if(g&&s.onlyLegacy){if(s.updateDOM){var d=s.rootElement.host||(s.rootElement===document?document.documentElement:s.rootElement);Object.keys(s.variables).forEach(function(e){d.style.setProperty(e,s.variables[e])})}}else!j&&(s.shadowDOM||s.rootElement.shadowRoot||s.rootElement.host)?n({rootElement:b.rootElement,include:b.include,exclude:s.exclude,onSuccess:function(e,t,r){return(e=((e=e.replace(E.cssComments,"").replace(E.cssMediaQueries,"")).match(E.cssVarDeclRules)||[]).join(""))||!1},onComplete:function(e,t,r){l(e,{store:w.dom,onWarning:c}),j=!0,k(s)}}):(C=s.rootElement,n({rootElement:s.rootElement,include:s.include,exclude:s.exclude,onBeforeSend:s.onBeforeSend,onError:function(e,t,r){var n=e.responseURL||_(r,location.href),o=e.statusText?"(".concat(e.statusText,")"):"Unspecified Error"+(0===e.status?" (possibly CORS related)":"");a("CSS XHR Error: ".concat(n," ").concat(e.status," ").concat(o),t,e,n)},onSuccess:function(e,t,r){var n=s.onSuccess(e,t,r);return e=void 0!==n&&!1===Boolean(n)?"":n||e,s.updateURLs&&(e=function(e,t){return(e.replace(E.cssComments,"").match(E.cssUrls)||[]).forEach(function(r){var n=r.replace(E.cssUrls,"$1"),o=_(n,t);e=e.replace(r,r.replace(n,o))}),e}(e,r)),e},onComplete:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={},d=s.updateDOM?w.dom:Object.keys(w.job).length?w.job:w.job=JSON.parse(JSON.stringify(w.dom)),p=!1;if(o.forEach(function(e,t){if(E.cssVars.test(n[t]))try{var r=u(n[t],{preserveStatic:s.preserveStatic,removeComments:!0});l(r,{parseHost:Boolean(s.rootElement.host),store:i,onWarning:c}),e.__cssVars={tree:r}}catch(t){a(t.message,e)}}),s.updateDOM&&e(w.user,s.variables),e(i,s.variables),p=Boolean((document.querySelector("[data-cssvars]")||Object.keys(w.dom).length)&&Object.keys(i).some(function(e){return i[e]!==d[e]})),e(d,w.user,i),p)L(s.rootElement),k(s);else{var v=[],h=[],y=!1;if(w.job={},s.updateDOM&&S.job++,o.forEach(function(t){var r=!t.__cssVars;if(t.__cssVars)try{m(t.__cssVars.tree,e({},s,{variables:d,onWarning:c}));var n=f(t.__cssVars.tree);if(s.updateDOM){if(t.getAttribute("data-cssvars")||t.setAttribute("data-cssvars","src"),n.length){var o=t.getAttribute("data-cssvars-group")||++S.group,i=n.replace(/\s/g,""),u=s.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(o,'"]'))||document.createElement("style");y=y||E.cssKeyframes.test(n),u.hasAttribute("data-cssvars")||u.setAttribute("data-cssvars","out"),i===t.textContent.replace(/\s/g,"")?(r=!0,u&&u.parentNode&&(t.removeAttribute("data-cssvars-group"),u.parentNode.removeChild(u))):i!==u.textContent.replace(/\s/g,"")&&([t,u].forEach(function(e){e.setAttribute("data-cssvars-job",S.job),e.setAttribute("data-cssvars-group",o)}),u.textContent=n,v.push(n),h.push(u),u.parentNode||t.parentNode.insertBefore(u,t.nextSibling))}}else t.textContent.replace(/\s/g,"")!==n&&v.push(n)}catch(e){a(e.message,t)}r&&t.setAttribute("data-cssvars","skip"),t.hasAttribute("data-cssvars-job")||t.setAttribute("data-cssvars-job",S.job)}),A=s.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,s.shadowDOM)for(var g,b=[s.rootElement].concat(t(s.rootElement.querySelectorAll("*"))),O=0;g=b[O];++O)if(g.shadowRoot&&g.shadowRoot.querySelector("style")){var x=e({},s,{rootElement:g.shadowRoot});k(x)}s.updateDOM&&y&&M(s.rootElement),C=!1,s.onComplete(v.join(""),h,JSON.parse(JSON.stringify(d)),T()-s.__benchmark)}}}));else document.addEventListener("DOMContentLoaded",function e(t){k(r),document.removeEventListener("DOMContentLoaded",e)})}}function M(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter(function(e){return getComputedStyle(document.body)[e]})[0];if(t){for(var r=e.getElementsByTagName("*"),n=[],o=0,s=r.length;o<s;o++){var a=r[o];"none"!==getComputedStyle(a)[t]&&(a.style[t]+="__CSSVARSPONYFILL-KEYFRAMES__",n.push(a))}document.body.offsetHeight;for(var c=0,i=n.length;c<i;c++){var u=n[c].style;u[t]=u[t].replace("__CSSVARSPONYFILL-KEYFRAMES__","")}}}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t,o.href=e,o.href}function T(){return y&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function L(e){Array.apply(null,e.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]')).forEach(function(e){return e.setAttribute("data-cssvars","")})}return k.reset=function(){for(var e in C=!1,O&&(O.disconnect(),O=null),A=0,x=null,j=!1,w)w[e]={}},k});
+
+
+// Default values
+cssVars({
+    // Targets
+    rootElement: document,
+    shadowDOM: false,
+
+    // Sources
+    include: 'link[rel=stylesheet],style',
+    exclude: '',
+    variables: {},
+
+    // Options
+    onlyLegacy: true,
+    preserveStatic: true,
+    preserveVars: false,
+    silent: false,
+    updateDOM: true,
+    updateURLs: true,
+    watch: false,
+
+    // Callbacks
+    onBeforeSend(xhr, elm, url) {
+        // ...
+    },
+    onWarning(message) {
+        // ...
+    },
+    onError(message, elm, xhr, url) {
+        // ...
+    },
+    onSuccess(cssText, elm, url) {
+        // ...
+    },
+    onComplete(cssText, styleElms, cssVariables, benchmark) {
+        // ...
+    }
+});
diff --git a/eslint/docs/src/assets/js/focus-visible.js b/eslint/docs/src/assets/js/focus-visible.js
new file mode 100644 (file)
index 0000000..c958451
--- /dev/null
@@ -0,0 +1,305 @@
+
+/**
+ * Applies the :focus-visible polyfill at the given scope.
+ * A scope in this case is either the top-level Document or a Shadow Root.
+ *
+ * @param {(Document|ShadowRoot)} scope
+ * @see https://github.com/WICG/focus-visible
+ */
+function applyFocusVisiblePolyfill(scope) {
+  var hadKeyboardEvent = true;
+  var hadFocusVisibleRecently = false;
+  var hadFocusVisibleRecentlyTimeout = null;
+
+  var inputTypesWhitelist = {
+    text: true,
+    search: true,
+    url: true,
+    tel: true,
+    email: true,
+    password: true,
+    number: true,
+    date: true,
+    month: true,
+    week: true,
+    time: true,
+    datetime: true,
+    'datetime-local': true
+  };
+
+  /**
+   * Helper function for legacy browsers and iframes which sometimes focus
+   * elements like document, body, and non-interactive SVG.
+   * @param {Element} el
+   */
+  function isValidFocusTarget(el) {
+    if (
+      el &&
+      el !== document &&
+      el.nodeName !== 'HTML' &&
+      el.nodeName !== 'BODY' &&
+      'classList' in el &&
+      'contains' in el.classList
+    ) {
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Computes whether the given element should automatically trigger the
+   * `focus-visible` class being added, i.e. whether it should always match
+   * `:focus-visible` when focused.
+   * @param {Element} el
+   * @return {boolean}
+   */
+  function focusTriggersKeyboardModality(el) {
+    var type = el.type;
+    var tagName = el.tagName;
+
+    if (tagName === 'INPUT' && inputTypesWhitelist[type] && !el.readOnly) {
+      return true;
+    }
+
+    if (tagName === 'TEXTAREA' && !el.readOnly) {
+      return true;
+    }
+
+    if (el.isContentEditable) {
+      return true;
+    }
+
+    return false;
+  }
+
+  /**
+   * Add the `focus-visible` class to the given element if it was not added by
+   * the author.
+   * @param {Element} el
+   */
+  function addFocusVisibleClass(el) {
+    if (el.classList.contains('focus-visible')) {
+      return;
+    }
+    el.classList.add('focus-visible');
+    el.setAttribute('data-focus-visible-added', '');
+  }
+
+  /**
+   * Remove the `focus-visible` class from the given element if it was not
+   * originally added by the author.
+   * @param {Element} el
+   */
+  function removeFocusVisibleClass(el) {
+    if (!el.hasAttribute('data-focus-visible-added')) {
+      return;
+    }
+    el.classList.remove('focus-visible');
+    el.removeAttribute('data-focus-visible-added');
+  }
+
+  /**
+   * If the most recent user interaction was via the keyboard;
+   * and the key press did not include a meta, alt/option, or control key;
+   * then the modality is keyboard. Otherwise, the modality is not keyboard.
+   * Apply `focus-visible` to any current active element and keep track
+   * of our keyboard modality state with `hadKeyboardEvent`.
+   * @param {KeyboardEvent} e
+   */
+  function onKeyDown(e) {
+    if (e.metaKey || e.altKey || e.ctrlKey) {
+      return;
+    }
+
+    if (isValidFocusTarget(scope.activeElement)) {
+      addFocusVisibleClass(scope.activeElement);
+    }
+
+    hadKeyboardEvent = true;
+  }
+
+  /**
+   * If at any point a user clicks with a pointing device, ensure that we change
+   * the modality away from keyboard.
+   * This avoids the situation where a user presses a key on an already focused
+   * element, and then clicks on a different element, focusing it with a
+   * pointing device, while we still think we're in keyboard modality.
+   * @param {Event} e
+   */
+  function onPointerDown(e) {
+    hadKeyboardEvent = false;
+  }
+
+  /**
+   * On `focus`, add the `focus-visible` class to the target if:
+   * - the target received focus as a result of keyboard navigation, or
+   * - the event target is an element that will likely require interaction
+   *   via the keyboard (e.g. a text box)
+   * @param {Event} e
+   */
+  function onFocus(e) {
+    // Prevent IE from focusing the document or HTML element.
+    if (!isValidFocusTarget(e.target)) {
+      return;
+    }
+
+    if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
+      addFocusVisibleClass(e.target);
+    }
+  }
+
+  /**
+   * On `blur`, remove the `focus-visible` class from the target.
+   * @param {Event} e
+   */
+  function onBlur(e) {
+    if (!isValidFocusTarget(e.target)) {
+      return;
+    }
+
+    if (
+      e.target.classList.contains('focus-visible') ||
+      e.target.hasAttribute('data-focus-visible-added')
+    ) {
+      // To detect a tab/window switch, we look for a blur event followed
+      // rapidly by a visibility change.
+      // If we don't see a visibility change within 100ms, it's probably a
+      // regular focus change.
+      hadFocusVisibleRecently = true;
+      window.clearTimeout(hadFocusVisibleRecentlyTimeout);
+      hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {
+        hadFocusVisibleRecently = false;
+        window.clearTimeout(hadFocusVisibleRecentlyTimeout);
+      }, 100);
+      removeFocusVisibleClass(e.target);
+    }
+  }
+
+  /**
+   * If the user changes tabs, keep track of whether or not the previously
+   * focused element had .focus-visible.
+   * @param {Event} e
+   */
+  function onVisibilityChange(e) {
+    if (document.visibilityState === 'hidden') {
+      // If the tab becomes active again, the browser will handle calling focus
+      // on the element (Safari actually calls it twice).
+      // If this tab change caused a blur on an element with focus-visible,
+      // re-apply the class when the user switches back to the tab.
+      if (hadFocusVisibleRecently) {
+        hadKeyboardEvent = true;
+      }
+      addInitialPointerMoveListeners();
+    }
+  }
+
+  /**
+   * Add a group of listeners to detect usage of any pointing devices.
+   * These listeners will be added when the polyfill first loads, and anytime
+   * the window is blurred, so that they are active when the window regains
+   * focus.
+   */
+  function addInitialPointerMoveListeners() {
+    document.addEventListener('mousemove', onInitialPointerMove);
+    document.addEventListener('mousedown', onInitialPointerMove);
+    document.addEventListener('mouseup', onInitialPointerMove);
+    document.addEventListener('pointermove', onInitialPointerMove);
+    document.addEventListener('pointerdown', onInitialPointerMove);
+    document.addEventListener('pointerup', onInitialPointerMove);
+    document.addEventListener('touchmove', onInitialPointerMove);
+    document.addEventListener('touchstart', onInitialPointerMove);
+    document.addEventListener('touchend', onInitialPointerMove);
+  }
+
+  function removeInitialPointerMoveListeners() {
+    document.removeEventListener('mousemove', onInitialPointerMove);
+    document.removeEventListener('mousedown', onInitialPointerMove);
+    document.removeEventListener('mouseup', onInitialPointerMove);
+    document.removeEventListener('pointermove', onInitialPointerMove);
+    document.removeEventListener('pointerdown', onInitialPointerMove);
+    document.removeEventListener('pointerup', onInitialPointerMove);
+    document.removeEventListener('touchmove', onInitialPointerMove);
+    document.removeEventListener('touchstart', onInitialPointerMove);
+    document.removeEventListener('touchend', onInitialPointerMove);
+  }
+
+  /**
+   * When the polyfill first loads, assume the user is in keyboard modality.
+   * If any event is received from a pointing device (e.g. mouse, pointer,
+   * touch), turn off keyboard modality.
+   * This accounts for situations where focus enters the page from the URL bar.
+   * @param {Event} e
+   */
+  function onInitialPointerMove(e) {
+    // Work around a Safari quirk that fires a mousemove on <html> whenever the
+    // window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
+    if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {
+      return;
+    }
+
+    hadKeyboardEvent = false;
+    removeInitialPointerMoveListeners();
+  }
+
+  // For some kinds of state, we are interested in changes at the global scope
+  // only. For example, global pointer input, global key presses and global
+  // visibility change should affect the state at every scope:
+  document.addEventListener('keydown', onKeyDown, true);
+  document.addEventListener('mousedown', onPointerDown, true);
+  document.addEventListener('pointerdown', onPointerDown, true);
+  document.addEventListener('touchstart', onPointerDown, true);
+  document.addEventListener('visibilitychange', onVisibilityChange, true);
+
+  addInitialPointerMoveListeners();
+
+  // For focus and blur, we specifically care about state changes in the local
+  // scope. This is because focus / blur events that originate from within a
+  // shadow root are not re-dispatched from the host element if it was already
+  // the active element in its own scope:
+  scope.addEventListener('focus', onFocus, true);
+  scope.addEventListener('blur', onBlur, true);
+
+  // We detect that a node is a ShadowRoot by ensuring that it is a
+  // DocumentFragment and also has a host property. This check covers native
+  // implementation and polyfill implementation transparently. If we only cared
+  // about the native implementation, we could just check if the scope was
+  // an instance of a ShadowRoot.
+  if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {
+    // Since a ShadowRoot is a special kind of DocumentFragment, it does not
+    // have a root element to add a class to. So, we add this attribute to the
+    // host element instead:
+    scope.host.setAttribute('data-js-focus-visible', '');
+  } else if (scope.nodeType === Node.DOCUMENT_NODE) {
+    document.documentElement.classList.add('js-focus-visible');
+  }
+}
+
+// It is important to wrap all references to global window and document in
+// these checks to support server-side rendering use cases
+// @see https://github.com/WICG/focus-visible/issues/199
+if (typeof window !== 'undefined' && typeof document !== 'undefined') {
+  // Make the polyfill helper globally available. This can be used as a signal
+  // to interested libraries that wish to coordinate with the polyfill for e.g.,
+  // applying the polyfill to a shadow root:
+  window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
+
+  // Notify interested libraries of the polyfill's presence, in case the
+  // polyfill was loaded lazily:
+  var event;
+
+  try {
+    event = new CustomEvent('focus-visible-polyfill-ready');
+  } catch (error) {
+    // IE11 does not support using CustomEvent as a constructor directly:
+    event = document.createEvent('CustomEvent');
+    event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});
+  }
+
+  window.dispatchEvent(event);
+}
+
+if (typeof document !== 'undefined') {
+  // Apply the polyfill to the global document, so that no JavaScript
+  // coordination is required to use the polyfill in the top-level document:
+  applyFocusVisiblePolyfill(document);
+}
diff --git a/eslint/docs/src/assets/js/inert-polyfill.js b/eslint/docs/src/assets/js/inert-polyfill.js
new file mode 100644 (file)
index 0000000..11ae095
--- /dev/null
@@ -0,0 +1,23 @@
+/* inert polyfill 
+ * source: https://cdn.rawgit.com/GoogleChrome/inert-polyfill/v0.1.0/inert-polyfill.min.js
+ */
+window.addEventListener("load", function () {
+  function h(a, b, c) { if (0 > b) { if (a.previousElementSibling) { for (a = a.previousElementSibling; a.lastElementChild;)a = a.lastElementChild; return a } return a.parentElement } if (a != c && a.firstElementChild) return a.firstElementChild; for (; null != a;) { if (a.nextElementSibling) return a.nextElementSibling; a = a.parentElement } return null } function g(a) { for (; a && a !== document.documentElement;) { if (a.hasAttribute("inert")) return a; a = a.parentElement } return null } (function (a) {
+    var b = document.createElement("style");
+    b.type = "text/css"; b.styleSheet ? b.styleSheet.cssText = a : b.appendChild(document.createTextNode(a)); document.body.appendChild(b)
+  })("/*[inert]*/[inert]{position:relative!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}[inert]::before{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0}"); var c = 0; document.addEventListener("keydown", function (a) { c = 9 === a.keyCode ? a.shiftKey ? -1 : 1 : 0 }); document.addEventListener("mousedown",
+    function () { c = 0 }); document.body.addEventListener("focus", function (a) {
+      var b = a.target, f = g(b); if (f) {
+        if (document.hasFocus() && 0 !== c) {
+          var d = document.activeElement, e = new KeyboardEvent("keydown", { keyCode: 9, which: 9, key: "Tab", code: "Tab", keyIdentifier: "U+0009", shiftKey: !!(0 > c), bubbles: !0 }); Object.defineProperty(e, "keyCode", { value: 9 }); document.activeElement.dispatchEvent(e); if (d != document.activeElement) return; for (d = f; ;) {
+            d = h(d, c, f); if (!d) break; a: {
+              e = b; if (!(0 > d.tabIndex) && (d.focus(), document.activeElement !== e)) {
+                e =
+                  !0; break a
+              } e = !1
+            } if (e) return
+          }
+        } b.blur(); a.preventDefault(); a.stopPropagation()
+      }
+    }, !0); document.addEventListener("click", function (a) { g(a.target) && (a.preventDefault(), a.stopPropagation()) }, !0)
+});
\ No newline at end of file
diff --git a/eslint/docs/src/assets/js/main.js b/eslint/docs/src/assets/js/main.js
new file mode 100644 (file)
index 0000000..28ec0e1
--- /dev/null
@@ -0,0 +1,282 @@
+(function() {
+    var toc_trigger = document.getElementById("js-toc-label"),
+        toc = document.getElementById("js-toc-panel"),
+        body = document.getElementsByTagName("body")[0],
+        open = false;
+
+    if (toc && matchMedia) {
+        const mq = window.matchMedia("(max-width: 1023px)");
+        mq.addEventListener('change', WidthChange);
+        WidthChange(mq);
+    }
+
+    // media query change
+    function WidthChange(mq) {
+        if (mq.matches && toc_trigger) {
+            let text = toc_trigger.innerText;
+            let headingButton = document.createElement("button");
+            headingButton.setAttribute("aria-expanded", "false");
+            headingButton.innerText = text;
+            toc_trigger.innerHTML = "";
+
+            toc_trigger.appendChild(headingButton);
+            headingButton.innerHTML += `<svg class="toc-trigger-icon" width="12" height="8" aria-hidden="true" focusable="false" viewBox="0 0 12 8"><g fill="none"><path fill="currentColor" d="M1.41.59l4.59 4.58 4.59-4.58 1.41 1.41-6 6-6-6z"/><path d="M-6-8h24v24h-24z"/></g></svg>`;
+
+            toc.setAttribute("data-open", "false");
+            toc_trigger.setAttribute("aria-expanded", "false");
+            headingButton.addEventListener("click", toggleTOC, true);
+        } else {
+            toc_trigger.innerHTML = 'Table of Contents';
+            toc.setAttribute("data-open", "true");
+        }
+
+    }
+
+    function toggleTOC(e) {
+        if (!open) {
+            this.setAttribute("aria-expanded", "true");
+            toc.setAttribute("data-open", "true");
+            open = true;
+        } else {
+            this.setAttribute("aria-expanded", "false");
+            toc.setAttribute("data-open", "false");
+            open = false;
+        }
+    }
+})();
+
+(function() {
+    var nav_trigger = document.getElementById("nav-toggle"),
+        nav = document.getElementById("nav-panel"),
+        body = document.getElementsByTagName("body")[0],
+        open = false;
+
+    if (matchMedia) {
+        const mq = window.matchMedia("(max-width: 1023px)");
+        mq.addEventListener('change', WidthChange);
+        WidthChange(mq);
+    }
+
+    // media query change
+    function WidthChange(mq) {
+        if (mq.matches) {
+            nav.setAttribute("data-open", "false");
+            nav_trigger.removeAttribute("hidden");
+            nav_trigger.setAttribute("aria-expanded", "false");
+            nav_trigger.addEventListener("click", togglenav, false);
+        } else {
+            nav.setAttribute("data-open", "true");
+            nav_trigger.setAttribute("hidden", "");
+            nav_trigger.setAttribute("aria-expanded", "true");
+        }
+
+    }
+
+    function togglenav(e) {
+        if (!open) {
+            this.setAttribute("aria-expanded", "true");
+            nav.setAttribute("data-open", "true");
+            open = true;
+        } else {
+            this.setAttribute("aria-expanded", "false");
+            nav.setAttribute("data-open", "false");
+            open = false;
+        }
+    }
+})();
+
+(function() {
+    var index_trigger = document.getElementById("js-docs-index-toggle"),
+        index = document.getElementById("js-docs-index-panel"),
+        body = document.getElementsByTagName("body")[0],
+        open = false;
+
+    if (matchMedia) {
+        const mq = window.matchMedia("(max-width: 1023px)");
+        mq.addEventListener('change', WidthChange);
+        WidthChange(mq);
+    }
+
+    function WidthChange(mq) {
+        initIndex();
+    }
+
+    function toggleindex(e) {
+        if (!open) {
+            this.setAttribute("aria-expanded", "true");
+            index.setAttribute("data-open", "true");
+            open = true;
+        } else {
+            this.setAttribute("aria-expanded", "false");
+            index.setAttribute("data-open", "false");
+            open = false;
+        }
+    }
+
+    function initIndex() {
+        if(index_trigger) {
+
+            index_trigger.removeAttribute("hidden");
+            index_trigger.setAttribute("aria-expanded", "false");
+            index.setAttribute("data-open", "false");
+
+            index.setAttribute("data-open", "false");
+            index_trigger.addEventListener("click", toggleindex, false);
+        }
+    }
+})();
+
+
+
+(function() {
+    var switchers = document.querySelectorAll('.switcher'),
+        fallbacks = document.querySelectorAll('.switcher-fallback');
+
+    if (fallbacks != null) {
+        fallbacks.forEach(el => {
+            el.setAttribute('hidden', '');
+        });
+    }
+
+    if (switchers != null) {
+        switchers.forEach(element => {
+            element.removeAttribute('hidden');
+            const select = element.querySelector('select');
+
+            select.addEventListener('change', function() {
+                var selected = this.options[this.selectedIndex];
+                url = selected.getAttribute('data-url');
+
+                window.location.href = url;
+            })
+        });
+    }
+})();
+
+// add "Open in Playground" button to code blocks
+// (function() {
+//     let blocks = document.querySelectorAll('pre[class*="language-"]');
+//     if (blocks) {
+//         blocks.forEach(function(block) {
+//             let button = document.createElement("a");
+//             button.classList.add('c-btn--playground');
+//             button.classList.add('c-btn');
+//             button.classList.add('c-btn--secondary');
+//             button.setAttribute("href", "#");
+//             button.innerText = "Open in Playground";
+//             block.appendChild(button);
+//         });
+//     }
+// })();
+
+
+
+// add utilities
+var util = {
+    keyCodes: {
+        UP: 38,
+        DOWN: 40,
+        LEFT: 37,
+        RIGHT: 39,
+        HOME: 36,
+        END: 35,
+        ENTER: 13,
+        SPACE: 32,
+        DELETE: 46,
+        TAB: 9,
+    },
+
+    generateID: function(base) {
+        return base + Math.floor(Math.random() * 999);
+    },
+
+    getDirectChildren: function(elm, selector) {
+        return Array.prototype.filter.call(elm.children, function(child) {
+            return child.matches(selector);
+        });
+    },
+};
+
+(function(w, doc, undefined) {
+    var CollapsibleIndexOptions = {
+        allCollapsed: false,
+        icon: '<svg class="index-icon" width="12" height="8" aria-hidden="true" focusable="false" viewBox="0 0 12 8"><g fill="none"><path fill="currentColor" d="M1.41.59l4.59 4.58 4.59-4.58 1.41 1.41-6 6-6-6z"/><path d="M-6-8h24v24h-24z"/></g></svg>',
+    };
+    var CollapsibleIndex = function(inst, options) {
+        var _options = Object.assign(CollapsibleIndexOptions, options);
+        var el = inst;
+        var indexToggles = el.querySelectorAll(".docs-index .docs__index__panel > ul > .docs-index__item[data-has-children] > a"); // only top-most level
+        var indexPanels = el.querySelectorAll(".docs-index .docs__index__panel > ul > .docs-index__item>[data-child-list]"); // the list
+        var accID = util.generateID("c-index-");
+
+        var init = function() {
+            el.classList.add("index-js");
+
+            setupindexToggles(indexToggles);
+            setupindexPanels(indexPanels);
+        };
+
+
+        var setupindexToggles = function(indexToggles) {
+            Array.from(indexToggles).forEach(function(item, index) {
+                var $this = item;
+
+                $this.setAttribute('role', 'button');
+                $this.setAttribute("id", accID + "__item-" + index);
+                $this.innerHTML += _options.icon;
+
+                if (_options.allCollapsed) $this.setAttribute("aria-expanded", "false");
+                else $this.setAttribute("aria-expanded", "true");
+
+                $this.addEventListener("click", function(e) {
+                    e.preventDefault();
+                    togglePanel($this);
+                });
+            });
+        };
+
+        var setupindexPanels = function(indexPanels) {
+            Array.from(indexPanels).forEach(function(item, index) {
+                let $this = item;
+
+                $this.setAttribute("id", accID + "__list-" + index);
+                $this.setAttribute(
+                    "aria-labelledby",
+                    accID + "__item-" + index
+                );
+                if (_options.allCollapsed) $this.setAttribute("aria-hidden", "true");
+                else $this.setAttribute("aria-hidden", "false");
+            });
+        };
+
+        var togglePanel = function(toggleButton) {
+            var thepanel = toggleButton.nextElementSibling;
+
+            if (toggleButton.getAttribute("aria-expanded") == "true") {
+                toggleButton.setAttribute("aria-expanded", "false");
+                thepanel.setAttribute("aria-hidden", "true");
+            } else {
+                toggleButton.setAttribute("aria-expanded", "true");
+                thepanel.setAttribute("aria-hidden", "false");
+            }
+        };
+
+
+        init.call(this);
+        return this;
+    }; // CollapsibleIndex()
+
+    w.CollapsibleIndex = CollapsibleIndex;
+})(window, document);
+
+// init
+var index = document.getElementById('docs-index');
+if (index) {
+    index = new CollapsibleIndex(index, {
+        allCollapsed: false
+    });
+}
+
+document.addEventListener("DOMContentLoaded", () => {
+    anchors.add(".docs-content h2:not(.c-toc__label), .docs-content h3, .docs-content h4");
+});
\ No newline at end of file
diff --git a/eslint/docs/src/assets/js/search.js b/eslint/docs/src/assets/js/search.js
new file mode 100644 (file)
index 0000000..29162c0
--- /dev/null
@@ -0,0 +1,191 @@
+/**
+ * @fileoverview Search functionality
+ * @author Nicholas C. Zakas
+ */
+
+//-----------------------------------------------------------------------------
+// Imports
+//-----------------------------------------------------------------------------
+
+import algoliasearch from "./algoliasearch.js";
+
+//-----------------------------------------------------------------------------
+// Initialization
+//-----------------------------------------------------------------------------
+
+// search
+const client = algoliasearch('L633P0C2IR', 'bb6bbd2940351f3afc18844a6b06a6e8');
+const index = client.initIndex('eslint');
+
+// page
+const resultsElement = document.querySelector('#search-results');
+const resultsLiveRegion = document.querySelector('#search-results-announcement');
+const searchInput = document.querySelector('#search');
+const searchClearBtn = document.querySelector('#search__clear-btn');
+let activeIndex = -1;
+let searchQuery;
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+/**
+ * Executes a search against the Algolia index.
+ * @param {string} query The search query to execute.
+ * @returns {Promise<Array<object>>} The search results.
+ */
+function fetchSearchResults(query) {
+    return index.search(query, {
+        // facetFilters: ["tags:docs"]
+    }).then(({ hits }) => hits);
+}
+
+/**
+ * Removes any current search results from the display.
+ * @returns {void}
+ */
+function clearSearchResults() {
+    while (resultsElement.firstChild) {
+        resultsElement.removeChild(resultsElement.firstChild);
+    }
+    resultsElement.innerHTML = "";
+    searchClearBtn.setAttribute('hidden', '');
+}
+
+/**
+ * Displays the given search results in the page.
+ * @param {Array<object>} results The search results to display.
+ * @returns {void}
+ */
+function displaySearchResults(results) {
+
+    clearSearchResults();
+
+    if (results.length) {
+
+        const list = document.createElement("ul");
+        list.setAttribute('role', 'list');
+        list.classList.add('search-results__list');
+        resultsElement.append(list);
+        resultsElement.setAttribute('data-results', 'true');
+        activeIndex = -1;
+
+        for (const result of results) {
+            const listItem = document.createElement('li');
+            listItem.classList.add('search-results__item');
+            const maxLvl = Math.max(...Object.keys(result._highlightResult.hierarchy).map(k => Number(k.substring(3))));
+            listItem.innerHTML = `
+                <h2 class="search-results__item__title"><a href="${result.url}">${result.hierarchy.lvl0}</a></h2>
+                <p class="search-results__item__context">${typeof result._highlightResult.content !== 'undefined' ? result._highlightResult.content.value : result._highlightResult.hierarchy[`lvl${maxLvl}`].value}</p>
+            `.trim();
+            list.append(listItem);
+        }
+        searchClearBtn.removeAttribute('hidden');
+
+    } else {
+        resultsLiveRegion.innerHTML = "No results found.";
+        resultsElement.innerHTML = "No results found.";
+        resultsElement.setAttribute('data-results', 'false');
+        searchClearBtn.setAttribute('hidden', '');
+    }
+
+}
+
+
+// Check if an element is currently scrollable
+function isScrollable(element) {
+    return element && element.clientHeight < element.scrollHeight;
+}
+
+// Ensure given child element is within the parent's visible scroll area
+function maintainScrollVisibility(activeElement, scrollParent) {
+    const { offsetHeight, offsetTop } = activeElement;
+    const { offsetHeight: parentOffsetHeight, scrollTop } = scrollParent;
+
+    const isAbove = offsetTop < scrollTop;
+    const isBelow = (offsetTop + offsetHeight) > (scrollTop + parentOffsetHeight);
+
+    if (isAbove) {
+        scrollParent.scrollTo(0, offsetTop);
+    }
+    else if (isBelow) {
+        scrollParent.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight);
+    }
+    
+}
+
+
+//-----------------------------------------------------------------------------
+// Event Handlers
+//-----------------------------------------------------------------------------
+
+// listen for input changes
+if(searchInput)
+    searchInput.addEventListener('keyup', function (e) {
+        const query = searchInput.value;
+
+        if(query === searchQuery) return;
+
+        if(query.length) searchClearBtn.removeAttribute('hidden');
+        else searchClearBtn.setAttribute('hidden', '');
+
+        if (query.length > 2) {
+            fetchSearchResults(query)
+                .then(displaySearchResults)
+                .catch(clearSearchResults);
+
+            document.addEventListener('click', function(e) {
+                if(e.target !== resultsElement) clearSearchResults();
+            });
+        } else {
+            clearSearchResults();
+        }
+
+    searchQuery = query
+
+    });
+
+
+if(searchClearBtn)
+    searchClearBtn.addEventListener('click', function(e) {
+        searchInput.value = '';
+        searchInput.focus();
+        clearSearchResults();
+    });
+
+document.addEventListener('keydown', function (e) {
+
+    if (e.key === 'Escape') {
+        e.preventDefault();
+        clearSearchResults();
+        searchInput.focus();
+    }
+
+    if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
+        e.preventDefault();
+        searchInput.focus();
+        document.querySelector('.search').scrollIntoView({ behaviour: "smooth", block: "start" });
+    }
+
+    const searchResults = Array.from(document.querySelectorAll('.search-results__item'));
+    if (!searchResults.length) return;
+
+    switch (e.key) {
+        case "ArrowUp":
+            e.preventDefault();
+            activeIndex = activeIndex - 1 < 0 ? searchResults.length - 1 : activeIndex - 1;
+            break;
+        case "ArrowDown":
+            e.preventDefault();
+            activeIndex = activeIndex + 1 < searchResults.length ? activeIndex + 1 : 0;
+            break;
+    }
+
+    if (activeIndex === -1) return;
+    const activeSearchResult = searchResults[activeIndex];
+    activeSearchResult.querySelector('a').focus();
+    if (isScrollable(resultsElement)) {
+        maintainScrollVisibility(activeSearchResult, resultsElement);
+    }
+});
+    
\ No newline at end of file
diff --git a/eslint/docs/src/assets/js/tabs.js b/eslint/docs/src/assets/js/tabs.js
new file mode 100644 (file)
index 0000000..a221593
--- /dev/null
@@ -0,0 +1,337 @@
+"use strict";
+if (typeof Object.assign != "function") {
+  // Must be writable: true, enumerable: false, configurable: true
+  Object.defineProperty(Object, "assign", {
+    value: function assign(target, varArgs) {
+      // .length of function is 2
+
+      if (target == null) {
+        // TypeError if undefined or null
+        throw new TypeError(
+          "Cannot convert undefined or null to object"
+        );
+      }
+
+      var to = Object(target);
+
+      for (var index = 1; index < arguments.length; index++) {
+        var nextSource = arguments[index];
+
+        if (nextSource != null) {
+          // Skip over if undefined or null
+          for (var nextKey in nextSource) {
+            // Avoid bugs when hasOwnProperty is shadowed
+            if (
+              Object.prototype.hasOwnProperty.call(
+                nextSource,
+                nextKey
+              )
+            ) {
+              to[nextKey] = nextSource[nextKey];
+            }
+          }
+        }
+      }
+      return to;
+    },
+    writable: true,
+    configurable: true
+  });
+}
+// add utilities; borrowed from: https://scottaohara.github.io/a11y_tab_widget/
+var util = {
+  keyCodes: {
+    UP: 38,
+    DOWN: 40,
+    LEFT: 37,
+    RIGHT: 39,
+    HOME: 36,
+    END: 35,
+    ENTER: 13,
+    SPACE: 32,
+    DELETE: 46,
+    TAB: 9
+  },
+
+  generateID: function (base) {
+    return base + Math.floor(Math.random() * 999);
+  },
+
+
+  getUrlHash: function () {
+    return window.location.hash.replace('#', '');
+  },
+
+  /**
+   * Use history.replaceState so clicking through Tabs
+   * does not create dozens of new history entries.
+   * Browser back should navigate to the previous page
+   * regardless of how many Tabs were activated.
+   *
+   * @param {string} hash
+   */
+  setUrlHash: function (hash) {
+    if (history.replaceState) {
+      history.replaceState(null, '', '#' + hash);
+    } else {
+      location.hash = hash;
+    }
+  }
+};
+
+
+
+
+(function (w, doc, undefined) {
+
+  var ARIAaccOptions = {
+    manual: true,
+    open: 0
+  }
+
+  var ARIAtabs = function (inst, options) {
+    var _options = Object.assign(ARIAaccOptions, options);
+    var el = inst;
+    var tablist = el.querySelector("[data-tablist]");
+    var tabs = Array.from(el.querySelectorAll("[data-tab]"));
+    var tabpanels = Array.from(el.querySelectorAll("[data-tabpanel]"));
+    var tabsID = util.generateID('ps__tabs-');
+    var orientation = el.getAttribute('data-tabs-orientation');
+    var currentIndex = _options.open;
+    var selectedTab = currentIndex;
+    var manual = _options.manual;
+
+    el.setAttribute('id', tabsID);
+
+    var init = function () {
+      el.classList.add('js-tabs');
+      tablist.removeAttribute('hidden');
+      setupTabList();
+      setupTabs();
+      setupTabPanels();
+    };
+
+    var setupTabList = function () {
+      tablist.setAttribute("role", "tablist");
+      if (orientation == 'vertical') tablist.setAttribute("aria-orientation", "vertical");
+    }
+
+    var setupTabs = function () {
+
+      tabs.forEach((tab, index) => {
+        tab.setAttribute('role', 'tab');
+        // each tab needs an ID that will be used to label its corresponding panel
+        tab.setAttribute('id', tabsID + '__tab-' + index);
+        tab.setAttribute('data-controls', tabpanels[index].getAttribute('id'));
+
+        // first tab is initially active
+        if (index === currentIndex) {
+          selectTab(tab);
+        //   updateUrlHash();
+        }
+
+        if (tab.getAttribute('data-controls') === util.getUrlHash()) {
+          currentIndex = index;
+          selectedTab = index;
+          selectTab(tab);
+        }
+
+        tab.addEventListener('click', (e) => {
+          e.preventDefault();
+          currentIndex = index;
+          selectedTab = index;
+          focusCurrentTab();
+          selectTab(tab);
+        //   updateUrlHash();
+        }, false);
+
+        tab.addEventListener('keydown', (e) => {
+          tabKeyboardRespond(e, tab);
+        }, false);
+      });
+    }
+
+    var focusCurrentTab = function () {
+      tabs[currentIndex].focus();
+    }
+
+    var updateUrlHash = function () {
+      var active = tabs[selectedTab];
+      util.setUrlHash(active.getAttribute('data-controls'));
+    };
+
+    var selectTab = function (tab) {
+      // unactivate all other tabs
+      tabs.forEach(tab => {
+        tab.setAttribute('aria-selected', 'false');
+        tab.setAttribute('tabindex', '-1');
+      });
+      //activate current tab
+      tab.setAttribute('aria-selected', 'true');
+      tab.setAttribute('tabindex', '0');
+
+      // activate corresponding panel
+      showTabpanel(tab);
+    }
+
+    var setupTabPanels = function () {
+      tabpanels.forEach((tabpanel, index) => {
+        tabpanel.setAttribute('role', 'tabpanel');
+        tabpanel.setAttribute('tabindex', '-1');
+        tabpanel.setAttribute('hidden', '');
+
+        if (index == currentIndex) {
+          tabpanel.removeAttribute('hidden');
+        }
+
+        tabpanel.addEventListener('keydown', (e) => {
+          panelKeyboardRespond(e);
+        }, false);
+
+        tabpanel.addEventListener("blur", () => {
+          tabpanel.setAttribute('tabindex', '-1');
+        }, false);
+      });
+    }
+
+
+    var panelKeyboardRespond = function (e) {
+      var keyCode = e.keyCode || e.which;
+
+      switch (keyCode) {
+        case util.keyCodes.TAB:
+          tabpanels[currentIndex].setAttribute('tabindex', '-1');
+          break;
+
+        default:
+          break;
+      }
+    }
+
+
+    var showTabpanel = function (tab) {
+      tabpanels.forEach((tabpanel, index) => {
+        tabpanel.setAttribute('hidden', '');
+        tabpanel.removeAttribute('tabindex');
+
+        if (index == currentIndex) {
+          tabpanel.removeAttribute('hidden');
+          tabpanel.setAttribute('aria-labelledby', tabs[currentIndex].getAttribute('id'));
+          tabpanel.setAttribute('tabindex', '0');
+        }
+      });
+    }
+
+    var incrementcurrentIndex = function () {
+      if (currentIndex < tabs.length - 1) {
+        return ++currentIndex;
+      }
+      else {
+        currentIndex = 0;
+        return currentIndex;
+      }
+    };
+
+
+    var decrementcurrentIndex = function () {
+      if (currentIndex > 0) {
+        return --currentIndex;
+      }
+      else {
+        currentIndex = tabs.length - 1;
+        return currentIndex;
+      }
+    };
+
+
+
+    var tabKeyboardRespond = function (e, tab) {
+      var firstTab = tabs[0];
+      var lastTab = tabs[tabs.length - 1];
+
+      var keyCode = e.keyCode || e.which;
+
+      switch (keyCode) {
+        case util.keyCodes.UP:
+        case util.keyCodes.LEFT:
+          e.preventDefault();
+          decrementcurrentIndex();
+          focusCurrentTab();
+
+          if (!manual) {
+            selectedTab = currentIndex;
+            selectTab(tabs[selectedTab]);
+            // updateUrlHash();
+          }
+
+          break;
+
+
+        case util.keyCodes.DOWN:
+        case util.keyCodes.RIGHT:
+          e.preventDefault();
+          incrementcurrentIndex();
+          focusCurrentTab();
+
+          if (!manual) {
+            selectedTab = currentIndex;
+            selectTab(tabs[selectedTab]);
+            // updateUrlHash();
+          }
+
+          break;
+
+
+        case util.keyCodes.ENTER:
+        case util.keyCodes.SPACE:
+          e.preventDefault();
+          selectedTab = currentIndex;
+          selectTab(tabs[selectedTab]);
+        //   updateUrlHash();
+
+          break;
+
+
+        case util.keyCodes.TAB:
+          tabpanels[selectedTab].setAttribute('tabindex', '0');
+          currentIndex = selectedTab;
+
+          break;
+
+
+        case util.keyCodes.HOME:
+          e.preventDefault();
+          firstTab.focus();
+        //   updateUrlHash();
+
+          break;
+
+
+        case util.keyCodes.END:
+          e.preventDefault();
+          lastTab.focus();
+        //   updateUrlHash();
+
+          break;
+      }
+
+    }
+
+    init.call(this);
+    return this;
+  }; // ARIAtabs()
+
+  w.ARIAtabs = ARIAtabs;
+
+})(window, document);
+
+
+var tabsInstance = "[data-tabs]";
+var els = document.querySelectorAll(tabsInstance);
+var allTabs = [];
+
+// Generate all tabs instances
+for (var i = 0; i < els.length; i++) {
+  var nTabs = new ARIAtabs(els[i], { manual: true }); // if manual is set to false, the tabs open on focus without needing an ENTER or SPACE press
+  allTabs.push(nTabs);
+}
diff --git a/eslint/docs/src/assets/js/themes.js b/eslint/docs/src/assets/js/themes.js
new file mode 100644 (file)
index 0000000..e6071b2
--- /dev/null
@@ -0,0 +1,48 @@
+/* theme toggle buttons */
+(function() {
+    var enableToggle = function(btn) {
+        btn.setAttribute("aria-pressed", "true");
+    }
+
+    var disableToggle = function(btn) {
+        btn.setAttribute("aria-pressed", "false");
+    }
+
+    document.addEventListener('DOMContentLoaded', function() {
+        var switcher = document.getElementById('js-theme-switcher');
+        switcher.removeAttribute('hidden');
+
+        var light_theme_toggle = document.getElementById('light-theme-toggle'),
+            dark_theme_toggle = document.getElementById('dark-theme-toggle');
+
+        // get any previously-chosen themes
+        var theme = document.documentElement.getAttribute('data-theme');
+
+        if (theme == "light") {
+            enableToggle(light_theme_toggle);
+            disableToggle(dark_theme_toggle);
+        } else if (theme == "dark") {
+            enableToggle(dark_theme_toggle);
+            disableToggle(light_theme_toggle);
+        }
+
+        light_theme_toggle.addEventListener("click", function() {
+            enableToggle(light_theme_toggle);
+            theme = this.getAttribute('data-theme');
+            document.documentElement.setAttribute('data-theme', theme);
+            window.localStorage.setItem("theme", theme);
+
+            disableToggle(dark_theme_toggle);
+        }, false);
+
+        dark_theme_toggle.addEventListener("click", function() {
+            enableToggle(dark_theme_toggle);
+            theme = this.getAttribute('data-theme');
+            document.documentElement.setAttribute('data-theme', theme);
+            window.localStorage.setItem("theme", theme);
+
+            disableToggle(light_theme_toggle);
+        }, false);
+    }, false);
+
+})();
diff --git a/eslint/docs/src/assets/scss/carbon-ads.scss b/eslint/docs/src/assets/scss/carbon-ads.scss
new file mode 100644 (file)
index 0000000..ccf578e
--- /dev/null
@@ -0,0 +1,115 @@
+.hero-ad {
+     @media all and (max-width: 800px) {
+         display: none;
+     }
+}
+
+#carbonads * {
+    margin: initial;
+    padding: initial;
+}
+
+#carbonads {
+    display: inline-block;
+    margin: 2rem 0;
+    padding: .6em;
+    font-size: 1rem;
+    overflow: hidden;
+    border-radius: 4px;
+    background-color: var(--body-background-color);
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
+
+    .docs-main & {
+        margin: 0 0 2rem;
+    }
+
+    @media all and (max-width: 800px) {
+        display: none !important;
+    }
+}
+
+.jumbotron #carbonads {
+    border: solid 1px hsla(250, 20%, 50%, .6);
+    background-color: hsla(0, 0%, 70%, .15);
+}
+
+#carbonads a {
+    font-weight: 500;
+    color: inherit;
+    text-decoration: none;
+}
+
+#carbonads a:hover {
+    text-decoration: none;
+    color: var(--link-color);
+}
+
+.jumbotron #carbonads a {
+    color: #eee;
+}
+
+.jumbotron #carbonads a:hover {
+    color: #ccc;
+}
+
+#carbonads span {
+    display: block;
+    position: relative;
+    overflow: hidden;
+}
+
+#carbonads .carbon-wrap {
+    display: flex;
+    flex-direction: column;
+    max-width: 130px;
+}
+
+#carbonads .carbon-img img {
+    display: block;
+}
+
+#carbonads .carbon-text {
+    margin-top: 10px;
+    line-height: 1rem;
+    font-size: .7em;
+    font-weight: 500;
+    text-align: left;
+}
+
+#carbonads .carbon-poweredby {
+    display: block;
+    margin-top: 10px;
+    font-size: 0.5rem;
+    font-weight: 500;
+    line-height: 1;
+    letter-spacing: .1ch;
+    text-transform: uppercase;
+}
+
+@media only screen and (min-width: 320px) and (max-width: 759px) {
+    #carbonads {
+        margin-top: 0;
+        font-size: 12px;
+    }
+
+    #carbonads .carbon-wrap {
+        display: flex;
+        flex-direction: row;
+        max-width: 330px;
+    }
+
+    #carbonads .carbon-text {
+        margin: 0 0 14px 10px;
+        font-size: 14px;
+        text-align: left;
+    }
+
+    #carbonads .carbon-poweredby {
+        position: absolute;
+        bottom: 0;
+        left: 142px;
+        font-size: 8px;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/alert.scss b/eslint/docs/src/assets/scss/components/alert.scss
new file mode 100644 (file)
index 0000000..ddd5c69
--- /dev/null
@@ -0,0 +1,134 @@
+.alert {
+    position: relative;
+    display: grid;
+    grid-template-columns: auto 1fr;
+    padding: 1rem;
+    gap: .75rem;
+    margin-bottom: 1.5rem;
+    margin-block-end: 1.5rem;
+    align-items: start;
+    font-size: .875rem;
+    border: 1px solid currentColor;
+    border-radius: var(--border-radius);
+
+    &.alert--warning {
+        background-color: var(--color-rose-25);
+        color: var(--color-rose-600);
+
+        [data-theme="dark"] & {
+            color: var(--color-rose-300);
+            background-color: var(--color-rose-900);
+        }
+    }
+
+    &.alert--important {
+        background-color: var(--color-warning-25);
+        color: var(--color-warning-600);
+
+        [data-theme="dark"] & {
+            color: var(--color-warning-300);
+            background-color: var(--color-warning-900);
+        }
+    }
+
+    &.alert--tip {
+        background-color: var(--color-success-25);
+        color: var(--color-success-600);
+
+        [data-theme="dark"] & {
+            color: var(--color-success-300);
+            background-color: var(--color-success-900);
+        }
+    }
+}
+
+
+[data-theme="dark"] {
+    .alert {
+        &.alert--warning {
+            border: 1px solid var(--color-rose-300);
+        }
+
+        &.alert--important {
+            border: 1px solid var(--color-warning-300);
+        }
+
+        &.alert--tip {
+            border: 1px solid var(--color-success-300);
+        }
+    }
+}
+
+.alert__icon {
+    color: inherit;
+    position: relative;
+    top: 2px;
+    offset-block-start: 2px;
+}
+
+.alert__text > p {
+    margin: 0;
+}
+
+.alert__type {
+    display: block;
+    font-weight: 500;
+    margin-bottom: .25rem;
+    margin-block-end: .25rem;
+
+    .alert--warning & {
+        color: var(--color-rose-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-rose-200);
+        }
+    }
+
+    .alert--important & {
+        color: var(--color-warning-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-warning-200);
+        }
+    }
+
+    .alert--tip & {
+        color: var(--color-success-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-success-200);
+        }
+    }
+}
+
+
+.alert__learn-more {
+    display: block;
+    font-weight: 500;
+    margin-top: .75rem;
+    margin-block-start: .75rem;
+
+    .alert--warning & {
+        color: var(--color-rose-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-rose-200);
+        }
+    }
+
+    .alert--important & {
+        color: var(--color-warning-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-warning-200);
+        }
+    }
+
+    .alert--tip & {
+        color: var(--color-success-700);
+
+        [data-theme="dark"] & {
+            color: var(--color-success-200);
+        }
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/buttons.scss b/eslint/docs/src/assets/scss/components/buttons.scss
new file mode 100644 (file)
index 0000000..bbe6451
--- /dev/null
@@ -0,0 +1,79 @@
+button {
+    border: none;
+    background: none;
+    font: inherit;
+    cursor: pointer;
+    line-height: inherit;
+    display: inline-flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.c-btn {
+    background: none;
+    border: none;
+    font: inherit;
+    font-family: var(--text-font);
+    cursor: pointer;
+    line-height: inherit;
+    font-weight: 500;
+    font-size: var(--step-0);
+    display: inline-flex;
+    padding: .75em 1.125em;
+    align-items: center;
+    justify-content: center;
+    border-radius: var(--border-radius);
+
+    transition: background-color .2s linear,
+        border-color .2s linear;
+
+    svg {
+        color: inherit;
+    }
+}
+
+.c-btn--large {
+    font-size: 1.125rem;
+    padding: .88em 1.5em;
+}
+
+.c-btn--block {
+    display: flex;
+    width: 100%;
+}
+
+a.c-btn {
+    text-decoration: none;
+    display: inline-flex;
+    flex-wrap: wrap;
+    gap: .5rem;
+    align-items: center;
+}
+
+.c-btn--primary {
+    background-color: var(--primary-button-background-color);
+    color: var(--primary-button-text-color);
+
+    &:hover {
+        background-color: var(--primary-button-hover-color);
+    }
+}
+
+.c-btn--secondary {
+    background-color: var(--secondary-button-background-color);
+    color: var(--secondary-button-text-color);
+    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
+
+    &:hover {
+        background-color: var(--secondary-button-hover-color);
+    }
+}
+
+.c-btn--ghost {
+    color: var(--body-text-color);
+    border: 1px solid var(--border-color);
+
+    &:hover {
+        border-color: var(--link-color);
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/docs-index.scss b/eslint/docs/src/assets/scss/components/docs-index.scss
new file mode 100644 (file)
index 0000000..b9f0452
--- /dev/null
@@ -0,0 +1,166 @@
+.docs-index .docs-index__list {
+    a {
+        border-radius: var(--border-radius);
+        text-decoration: none;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: .5rem .75rem;
+        margin-left: -.75rem;
+        margin-inline-start: -.75rem;
+        color: var(--headings-color);
+
+        &:hover,
+        &[aria-current="true"] {
+            background-color: var(--docs-lightest-background-color);
+            color: var(--link-color);
+        }
+
+        @media all and (max-width: 1023px) {
+            padding: .5rem 1rem;
+            margin-left: 0;
+            margin-inline-start: 0;
+        }
+    }
+}
+
+.docs-index__item {
+    margin: 0;
+
+    ul ul {
+        padding-left: .75rem;
+    }
+
+    &[data-has-children] {
+        margin-bottom: .5rem;
+    }
+}
+
+.docs-index__list > .docs-index__item {
+    margin-top: 1.5rem;
+    margin-block-start: 1.5rem;
+
+    > a {
+        color: var(--icon-color);
+        text-transform: uppercase;
+        letter-spacing: 1px;
+        font-size: .875rem;
+        font-weight: 500;
+    }
+}
+
+/* Styles for the accordion icon */
+.index-js .index-icon {
+    display: block !important;
+    width: 0.75rem;
+    height: 0.5rem;
+    transform-origin: 50% 50%;
+    transition: all 0.1s linear;
+    color: inherit;
+}
+
+.index-js [aria-expanded="true"] .index-icon {
+    -ms-transform: rotate(180deg);
+    transform: rotate(180deg);
+}
+
+.index-js ul[aria-hidden="true"] {
+    display: none;
+}
+
+.index-js ul[aria-hidden="false"] {
+    display: block;
+}
+
+.docs__index__panel {
+    &[data-open="false"] {
+        display: none;
+
+        @media all and (min-width: 1024px) {
+            display: block;
+        }
+    }
+
+    &[data-open="true"] {
+        display: block;
+
+        @media all and (min-width: 1024px) {
+            display: block;
+        }
+    }
+}
+
+.docs-index-toggle {
+    cursor: pointer;
+    display: flex;
+    width: 100%;
+    padding: .75rem 1.125rem;
+    align-items: center;
+    justify-content: space-between;
+    gap: .5rem;
+    font-weight: 500;
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    background-color: var(--secondary-button-background-color);
+    color: var(--secondary-button-text-color);
+    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
+
+    &:hover {
+        background-color: var(--secondary-button-hover-color);
+    }
+
+    @media all and (min-width: 1024px) {
+        display: none;
+    }
+
+    svg {
+        width: 1.5em;
+        height: 1.5em;
+        color: inherit;
+        fill: none;
+        stroke-width: 4;
+        stroke-linecap: round;
+        stroke-linejoin: round;
+    }
+
+    #ham-top,
+    #ham-middle,
+    #ham-bottom {
+        transition: all .2s linear;
+    }
+
+    #ham-top {
+        transform-origin: 30px 37px;
+    }
+
+    #ham-bottom {
+        transform-origin: 30px 63px;
+    }
+
+    &[aria-expanded="true"] {
+        #ham-middle {
+            opacity: 0;
+        }
+
+        #ham-top {
+
+            transform: rotate(41deg);
+        }
+
+        #ham-bottom {
+            transform: rotate(-41deg);
+        }
+    }
+}
+
+.eslint-actions {
+    display: inline-flex;
+    flex-wrap: wrap;
+    flex-direction: column;
+    width: 100%;
+    gap: 1rem;
+
+    @media all and (min-width: 640px) {
+        flex-direction: row;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/docs-navigation.scss b/eslint/docs/src/assets/scss/components/docs-navigation.scss
new file mode 100644 (file)
index 0000000..1a8ee50
--- /dev/null
@@ -0,0 +1,155 @@
+.docs-site-nav {
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+    grid-column: 1 / -1;
+    grid-row: 1;
+
+    ul {
+        list-style: none;
+        font-size: var(--step-1);
+        margin-top: 1rem;
+        margin-block-start: 1rem;
+        margin-bottom: 2rem;
+        margin-block-end: 2rem;
+
+
+        @media all and (min-width: 1024px) {
+            font-size: var(--step-0);
+            margin-top: 0;
+            margin-block-start: 0;
+            margin-bottom: 0;
+            margin-block-end: 0;
+            align-items: center;
+            display: flex;
+        }
+    }
+
+    .flexer {
+        display: flex;
+        justify-self: flex-end;
+        align-self: flex-end;
+    }
+
+    a:not(.c-btn) {
+        text-decoration: none;
+        color: inherit;
+        transition: color .2s linear;
+        display: block;
+
+        &:hover {
+            color: var(--link-color);
+        }
+    }
+
+    a:not(.c-btn)[aria-current="page"],
+    a:not(.c-btn)[aria-current="true"] {
+        color: var(--link-color);
+        text-decoration: none;
+        font-weight: 500;
+    }
+}
+
+
+.docs-nav-panel {
+    @media all and (min-width: 1024px) {
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+    }
+
+    &[data-open="false"] {
+        display: none;
+    }
+
+    &[data-open="true"] {
+        @media all and (min-width: 1024px) {
+            display: flex;
+            flex-direction: row;
+            justify-content: center;
+        }
+    }
+}
+
+.docs-nav-panel .mobile-only {
+    @media all and (min-width: 1024px) {
+        display: none;
+    }
+}
+
+.docs-site-nav-toggle {
+    cursor: pointer;
+    display: inline-flex;
+    align-items: center;
+    margin-left: .5rem;
+    margin-right: -10px;
+
+    margin-inline-start: .5rem;
+    margin-inline-end: -10px;
+
+
+    svg {
+        width: 40px;
+        height: 40px;
+        color: var(--headings-color);
+        fill: none;
+        stroke-width: 4;
+        stroke-linecap: round;
+        stroke-linejoin: round;
+    }
+
+    #ham-top,
+    #ham-middle,
+    #ham-bottom {
+        transition: all .2s linear;
+    }
+
+    #ham-top {
+        transform-origin: 30px 37px;
+    }
+
+    #ham-bottom {
+        transform-origin: 30px 63px;
+    }
+
+    &[aria-expanded="true"] {
+        #ham-middle {
+            opacity: 0;
+        }
+
+        #ham-top {
+
+            transform: rotate(41deg);
+        }
+
+        #ham-bottom {
+            transform: rotate(-41deg);
+        }
+    }
+}
+
+
+
+@media all and (min-width: 1024px) {
+    .docs-site-nav {
+        flex-direction: row;
+        grid-column: auto;
+        gap: 2rem;
+
+        ul {
+            display: flex;
+            gap: 2rem;
+            font-size: var(--step-0);
+
+            li {
+                margin-bottom: 0;
+                margin-block-end: 0;
+            }
+        }
+
+        .flexer {
+            order: 1;
+        }
+    }
+
+}
diff --git a/eslint/docs/src/assets/scss/components/hero.scss b/eslint/docs/src/assets/scss/components/hero.scss
new file mode 100644 (file)
index 0000000..54c303e
--- /dev/null
@@ -0,0 +1,60 @@
+.hero .grid {
+    @media all and (min-width: 800px) {
+        display: grid;
+        grid-template-columns: 2fr 1fr;
+        grid-gap: 2rem;
+        align-items: center;
+    }
+
+    .span-1-7 {
+        grid-column: 1 / 2;
+    }
+
+    .span-10-12 {
+        grid-column: 2 / 3;
+        justify-self: end;
+    }
+}
+
+.hero {
+    border-bottom: 1px solid var(--divider-color);
+    border-block-end: 1px solid var(--divider-color);
+    background-color: var(--hero-background-color);
+
+    @media all and (min-width: 800px) {
+        // when the ad is displayed
+        min-height: calc(285px + var(--space-xl-4xl));
+    }
+
+    .content-container {
+        padding: var(--space-xl-4xl) 0;
+        margin: 0;
+    }
+
+    >.content-container {
+        margin: 0 auto;
+        padding: 0 calc(1rem + 1vw);
+        padding-bottom: 0;
+        align-items: center;
+    }
+}
+
+.hero--homepage {
+
+    .section-title {
+        margin-bottom: 1.5rem;
+        margin-block-end: 1.5rem;
+    }
+
+    .section-supporting-text {
+        margin: 0;
+        font-size: var(--step-1);
+        text-align: left;
+    }
+
+    .eslint-actions {
+        font-size: var(--step-1);
+        margin-top: 3rem;
+        margin-block-start: 3rem;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/index.scss b/eslint/docs/src/assets/scss/components/index.scss
new file mode 100644 (file)
index 0000000..ea9bd3b
--- /dev/null
@@ -0,0 +1,110 @@
+.index {
+    margin-bottom: 4rem;
+    margin-block-end: 4rem;
+}
+
+.index__item {
+    margin: 0;
+
+    a {
+        display: block;
+        color: inherit;
+        text-decoration: none;
+        padding: .625rem .875rem;
+        font-size: var(--step-0);
+        border-radius: var(--border-radius);
+
+        &:hover {
+            color: var(--link-color);
+        }
+    }
+
+    a[aria-current="page"] {
+        color: var(--link-color);
+        background-color: var(--lightest-background-color);
+        font-weight: 500;
+    }
+}
+
+.index__toggle {
+    cursor: pointer;
+    display: flex;
+    width: 100%;
+    padding: .75rem 1.125rem;
+    align-items: center;
+    justify-content: space-between;
+    gap: .5rem;
+    font-weight: 500;
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    background-color: var(--secondary-button-background-color);
+    color: var(--secondary-button-text-color);
+    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
+
+    &:hover {
+        background-color: var(--secondary-button-hover-color);
+    }
+
+    @media all and (min-width: 1024px) {
+        display: none;
+    }
+
+    svg {
+        width: 1.5em;
+        height: 1.5em;
+        color: inherit;
+        fill: none;
+        stroke-width: 4;
+        stroke-linecap: round;
+        stroke-linejoin: round;
+    }
+
+    #ham-top,
+    #ham-middle,
+    #ham-bottom {
+        transition: all .2s linear;
+    }
+
+    #ham-top {
+        transform-origin: 30px 37px;
+    }
+
+    #ham-bottom {
+        transform-origin: 30px 63px;
+    }
+
+    &[aria-expanded="true"] {
+        #ham-middle {
+            opacity: 0;
+        }
+
+        #ham-top {
+
+            transform: rotate(41deg);
+        }
+
+        #ham-bottom {
+            transform: rotate(-41deg);
+        }
+    }
+}
+
+.index__list {
+    display: block;
+
+    &[data-open="false"] {
+        display: none;
+
+        @media all and (min-width: 1024px) {
+            display: block;
+        }
+    }
+
+    &[data-open="true"] {
+        display: block;
+
+        @media all and (min-width: 1024px) {
+            display: block;
+        }
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/language-switcher.scss b/eslint/docs/src/assets/scss/components/language-switcher.scss
new file mode 100644 (file)
index 0000000..1aa9b2c
--- /dev/null
@@ -0,0 +1,32 @@
+.switcher--language {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-wrap: wrap;
+    gap: .25rem .5rem;
+    position: relative;
+    width: 100%;
+    padding: 0;
+    font-size: inherit;
+
+    @media all and (min-width: 800px) {
+        justify-content: flex-start;
+    }
+}
+
+.switcher--language .label__text {
+    flex: 1 0 10ch;
+}
+
+
+.switcher--language  .switcher__select {
+    flex: 1 0 12rem;
+
+    @media all and (max-width: 800px) {
+        max-width: 250px;
+    }
+}
+
+.language-switcher {
+    display: inline-flex;
+}
diff --git a/eslint/docs/src/assets/scss/components/resources.scss b/eslint/docs/src/assets/scss/components/resources.scss
new file mode 100644 (file)
index 0000000..cf483cd
--- /dev/null
@@ -0,0 +1,71 @@
+.resource {
+    display: flex;
+    border-radius: var(--border-radius);
+    border: 1px solid var(--divider-color);
+    background-color: var(--lightest-background-color);
+    align-items: stretch;
+    overflow: hidden;
+    margin-bottom: .5rem;
+    margin-block-end: .5rem;
+
+    position: relative;
+    transition: all .2s linear;
+
+    &:hover {
+        background-color: var(--lighter-background-color);
+    }
+
+}
+
+.resource__image {
+    flex: 1 0 5.5rem;
+    max-width: 5.5rem;
+    overflow: hidden;
+    padding: .25rem;
+
+    img {
+        display: block;
+        height: 100%;
+        width: 100%;
+        // object-fit: cover;
+        object-fit: contain;
+    }
+}
+
+.resource__content {
+    flex: 4;
+    padding: .75rem;
+    align-self: center;
+}
+
+
+.resource__title { // a
+    text-decoration: none;
+    color: var(--headings-color);
+    font-weight: 500;
+    margin-bottom: .125rem;
+
+    &::after {
+        content: "";
+        position: absolute;
+        left: 0;
+        offset-inline-start: 0;
+        top: 0;
+        block-inline-start: 0;
+        width: 100%;
+        height: 100%;
+    }
+}
+
+.resource__domain,
+.resource__domain a {
+    text-decoration: none;
+    color: var(--body-text-color);
+    font-size: .875rem;
+}
+
+.resource__icon {
+    color: var(--headings-color);
+    margin: 1rem;
+    align-self: center;
+}
diff --git a/eslint/docs/src/assets/scss/components/rules.scss b/eslint/docs/src/assets/scss/components/rules.scss
new file mode 100644 (file)
index 0000000..ec52172
--- /dev/null
@@ -0,0 +1,202 @@
+.rule-categories {
+    display: grid;
+    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+    gap: 0;
+    margin-bottom: 3rem;
+    background-color: var(--lightest-background-color);
+    border: 1px solid var(--divider-color);
+    border-radius: var(--border-radius);
+
+    .rule-category {
+        margin: 0;
+        padding: 1rem;
+        background: none;
+        border: none;
+
+        @media screen and (min-width:768px){
+            &:not(:first-child)::after {
+                content: "";
+                display: block;
+                padding: 1px;
+                border-left: 1px solid var(--divider-color);
+                left: 0px;
+            }
+        }
+
+        @media screen and (min-width:768px) and (max-width:1023px), screen and (min-width:1440px){
+            &:not(:first-child)::after {
+                height: 70%;
+                position: absolute;
+            }
+        }
+
+        @media screen and (min-width:1024px) and (max-width:1439px){
+            &:nth-child(2)::after {
+                height: 70%;
+                position: absolute;
+            }
+        }
+    }
+
+    .rule-category__description {
+        flex: 1 1 45ch;
+    }
+}
+
+.rule-category {
+    font-size: var(--step--1);
+    display: flex;
+    position: relative;
+    flex-wrap: wrap;
+    align-items: flex-start;
+    gap: 1rem;
+    padding: 1rem;
+    margin: 1.5rem 0;
+    border-radius: var(--border-radius);
+    border: 1px solid var(--divider-color);
+    background-color: var(--lightest-background-color);
+
+    p {
+        margin: 0;
+    }
+
+    .rule-category__description {
+        flex: 1 1 30ch;
+    }
+}
+
+.rule {
+    border-radius: var(--border-radius);
+    background-color: var(--lightest-background-color);
+    display: flex;
+    flex-wrap: wrap;
+    align-items: center;
+    gap: 1rem;
+    padding: 1rem;
+    margin: .5rem 0;
+    position: relative;
+
+    p:last-of-type {
+        margin: 0;
+    }
+}
+
+.rule--deprecated,
+.rule--removed {
+    // opacity: .5;
+}
+
+.rule__content {
+    flex: 1 1 35ch;
+}
+
+.rule__name {
+    font-weight: 500;
+    font-size: .875rem;
+    margin-bottom: .25rem;
+    margin-block-end: .25rem;
+}
+
+a.rule__name {
+    text-decoration: none;
+
+    &:hover {
+        text-decoration: underline;
+    }
+
+    &::after {
+        position: absolute;
+        content: "";
+        width: 100%;
+        height: 100%;
+        top: 0;
+        offset-block-start: 0;
+        left: 0;
+        offset-inline-start: 0;
+    }
+}
+
+.rule__description {
+    font-size: var(--step--1);
+}
+
+.rule__categories {
+    font-size: .875rem;
+    display: flex;
+    align-items: center;
+    gap: 1rem;
+    border-radius: var(--border-radius);
+    padding: 2px 4px;
+
+    p {
+        display: inline-flex;
+        margin: 0;
+        align-items: center;
+    }
+
+    [data-theme="dark"] & {
+        background: var(--body-background-color);
+    }
+}
+
+.rule__status {
+    color: var(--color-rose-500);
+    background: var(--color-rose-50);
+    border-radius: var(--border-radius);
+    display: inline-block;
+    font-weight: normal;
+    margin-left: .5rem;
+    margin-inline-start: .5rem;
+    font-size: var(--step--1);
+    padding: 0 .5rem;
+
+    [data-theme="dark"] & {
+        background: var(--body-background-color);
+    }
+}
+
+.rule__categories__type {
+    &[aria-hidden="true"] {
+        opacity: .25;
+    }
+}
+
+/* related rules */
+
+.related-rules__list {
+    display: flex;
+    gap: .5rem;
+    flex-wrap: wrap;
+    justify-content: start;
+}
+
+.related-rules__list__item {
+
+    svg {
+        color: inherit;
+    }
+
+    a {
+        text-decoration: none;
+        color: var(--headings-color);
+        padding: .625rem;
+        display: inline-flex;
+        gap: .5rem;
+        align-items: center;
+        border: 1px solid var(--divider-color);
+        border-radius: var(--border-radius);
+        background-color: var(--lightest-background-color);
+
+        &:hover {
+            color: var(--link-color);
+            background-color: var(--lighter-background-color);
+        }
+    }
+}
+
+a.rule-list-item+a.rule-list-item::before {
+    content: ",";
+    display: inline-block;
+    margin-left: 5px;
+    margin-right: 5px;
+}
diff --git a/eslint/docs/src/assets/scss/components/search.scss b/eslint/docs/src/assets/scss/components/search.scss
new file mode 100644 (file)
index 0000000..ff3b412
--- /dev/null
@@ -0,0 +1,165 @@
+[type="search"]::-webkit-search-cancel-button,
+[type="search"]::-webkit-search-decoration {
+    -webkit-appearance: none;
+    appearance: none;
+}
+
+[type=search]::-ms-clear,
+[type=search]::-ms-reveal {
+    display: none;
+    width: 0;
+    height: 0;
+}
+
+.search {
+    margin: 1rem 0;
+    position: relative;
+}
+
+.search__input-wrapper,
+.search__inner-input-wrapper {
+    position: relative;
+}
+
+.search__clear-btn {
+    color: var(--body-text-color);
+    position: absolute;
+    display: flex;
+    top: 50%;
+    offset-block-start: 50%;
+    transform: translateY(-50%);
+    right: 1.5rem;
+    offset-inline-end: 1.5rem;
+    z-index: 3;
+    padding: 0;
+
+    svg {
+        color: inherit;
+        width: 1rem;
+        height: 1rem;
+        border: 1px solid;
+        border-radius: 50%;
+    }
+}
+
+.search__input {
+    padding-left: 2.5rem;
+    padding-inline-start: 2.5rem;
+    outline-offset: 1px;
+    width: 100%;
+}
+
+.search__icon {
+    color: var(--body-text-color);
+    position: absolute;
+    display: block;
+    top: 50%;
+    offset-block-start: 50%;
+    transform: translateY(-50%);
+    left: .75rem;
+    offset-inline-start: .75rem;
+    z-index: 3;
+}
+
+/* search results */
+.search .search-results {
+    font-size: .875rem;
+    background-color: var(--body-background-color);
+    position: relative;
+    z-index: 10;
+    width: 100%;
+    border-radius: 0 0 var(--border-radius) var(--border-radius);
+    border: 1px solid var(--divider-color);
+    position: rekative;
+    top: .25rem;
+    max-height: 400px;
+    overflow-y: auto;
+
+    @media all and (min-width: 1024px) {
+        box-shadow: var(--shadow-lg);
+        position: absolute;
+        top: calc(100% + .25rem);
+    }
+
+    &[data-results="true"] {
+        padding: 0;
+    }
+    &[data-results="false"] {
+        padding: 1rem;
+    }
+
+    &:empty {
+        display: none;
+    }
+}
+
+.search-results__list {
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.search .search-results__item {
+    margin: 0;
+    padding: .875rem;
+    border-bottom: 1px solid var(--lightest-background-color);
+    border-block-end: 1px solid var(--lightest-background-color);
+    position: relative;
+
+    &:hover {
+        background-color: var(--lightest-background-color);
+    }
+
+    &:focus-within{
+        background-color: var(--lightest-background-color);
+    }
+}
+
+.search .search-results__item__title {
+    font-size: var(--step-0);
+    font-size: .875rem;
+    margin-bottom: 0;
+    font-family: var(--text-font);
+
+
+    a {
+        display: block;
+        text-decoration: none;
+        color: var(--link-color);
+        font: inherit;
+        padding: .25rem .75rem;
+
+        &:hover {
+            background-color: inherit;
+            color: var(--link-color);
+        }
+
+        &::after {
+            position: absolute;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            content: "";
+        }
+    }
+}
+
+.search-results__item__context {
+    margin: 0;
+    font-size: .875rem;
+    padding-left: 1rem;
+}
+
+.algolia-docsearch-suggestion--highlight {
+    background-color: var(--color-brand);
+    color: #fff;
+    display: inline-block;
+    padding: 0 2px;
+    border-radius: 2px;
+
+    [data-theme="dark"] & {
+        background-color: var(--link-color);
+        color: var(--color-neutral-900);
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/social-icons.scss b/eslint/docs/src/assets/scss/components/social-icons.scss
new file mode 100644 (file)
index 0000000..37902a9
--- /dev/null
@@ -0,0 +1,23 @@
+.eslint-social-icons {
+    margin-bottom: -1rem;
+    margin-block-end: -1rem;
+
+    ul {
+        margin: 0;
+        padding: 0;
+        margin-left: -1rem;
+        margin-inline-start: -1rem;
+        display: inline-flex;
+
+        li {
+            margin: 0;
+            display: inline-flex;
+            align-items: center;
+
+            a {
+                display: flex;
+                padding: 1rem .75rem;
+            }
+        }
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/tabs.scss b/eslint/docs/src/assets/scss/components/tabs.scss
new file mode 100644 (file)
index 0000000..f2672a1
--- /dev/null
@@ -0,0 +1,68 @@
+.c-tabs {
+    pre {
+        margin-top: 0;
+        margin-block-start: 0;
+    }
+}
+
+.c-tabs__tablist {
+    .js-tabs & {
+        display: flex;
+        justify-content: start;
+    }
+}
+
+.c-tabs__tab {
+    background: none;
+    border: none;
+    margin: 0;
+    color: inherit;
+    font: inherit;
+    cursor: pointer;
+    line-height: inherit;
+    font-weight: 500;
+    font-size: var(--step-0);
+    display: inline-flex;
+    padding: .75rem 1.125rem;
+    align-items: center;
+    justify-content: center;
+    border-radius: var(--border-radius) var(--border-radius) 0 0;
+
+    transition: background-color .2s linear,
+    border-color .2s linear;
+
+
+
+    &:hover {
+        color: var(--link-color);
+    }
+
+    &[aria-selected="true"] {
+        color: var(--link-color);
+        background-color: var(--lightest-background-color);
+    }
+}
+
+.c-tabs__tabpanel {
+    margin-bottom: 2rem;
+    margin-block-end: 2rem;
+    background-color: var(--lightest-background-color);
+    border-radius: 0 var(--border-radius) var(--border-radius) var(--border-radius);
+
+    .js-tabs & {
+        margin-bottom: 0;
+        margin-block-end: 0;
+    }
+}
+
+
+.c-tabs__tabpanel__title {
+    margin-bottom: 1.5rem;
+    margin-block-end: 1.5rem;
+}
+
+// when the js is enabled, the tabpanels are labelled by their tabs
+// you may choose to hide or keep the headings inside of them visible
+.js-tabs .c-tabs__tabpanel__title {
+    display: none;
+}
diff --git a/eslint/docs/src/assets/scss/components/theme-switcher.scss b/eslint/docs/src/assets/scss/components/theme-switcher.scss
new file mode 100644 (file)
index 0000000..0fa59fe
--- /dev/null
@@ -0,0 +1,84 @@
+.theme-switcher {
+    display: inline-flex;
+    align-items: center;
+    gap: .5rem;
+    position: relative;
+}
+
+.theme-switcher-label.theme-switcher-label {
+    font-size: inherit;
+    color: inherit;
+    font: inherit;
+    font-family: var(--text-font);
+    margin: 0;
+}
+
+.theme-switcher__buttons {
+    display: flex;
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    background-color: var(--body-background-color);
+}
+
+.theme-switcher__button {
+    flex: 0;
+    box-shadow: var(--shadow-xs);
+    padding: .625rem .875rem;
+    display: inline-flex;
+    align-items: center;
+    margin: 0;
+    gap: .25rem;
+    color: inherit;
+
+    &:first-of-type {
+        border-right: .5px solid var(--border-color);
+        border-inline-end: .5px solid var(--border-color);
+    }
+
+    &:last-of-type {
+        border-left: .5px solid var(--border-color);
+        border-inline-start: .5px solid var(--border-color);
+    }
+
+    .theme-switcher__icon {
+        color: var(--icon-color);
+    }
+
+    &:hover {
+        .theme-switcher__icon {
+            color: var(--link-color);
+        }
+    }
+}
+
+.theme-switcher__button[aria-pressed="true"] {
+    color: var(--link-color);
+
+    .theme-switcher__icon {
+        color: var(--link-color);
+    }
+
+    &:hover {
+        .theme-switcher__icon {
+            color: var(--link-color);
+        }
+    }
+}
+
+.theme-switcher__button[aria-pressed="false"] {
+    .theme-switcher__icon {
+        color: var(--icon-color);
+    }
+
+    &:hover {
+        .theme-switcher__icon {
+            color: var(--link-color);
+        }
+    }
+}
+
+.theme-switcher__button:hover {
+    .theme-switcher__icon {
+        color: var(--link-color);
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/toc.scss b/eslint/docs/src/assets/scss/components/toc.scss
new file mode 100644 (file)
index 0000000..d1f47a6
--- /dev/null
@@ -0,0 +1,118 @@
+.docs-toc {
+    margin: 2rem 0;
+}
+
+.docs-toc {
+    .docs-aside & {
+        display: none;
+    }
+
+    @media all and (min-width: 1400px) {
+        display: none;
+    }
+
+    .docs-aside & {
+        @media all and (min-width: 1400px) {
+            display: block;
+        }
+    }
+}
+
+.c-toc {
+    ol {
+        margin: 0;
+
+        li {
+            position: relative;
+            margin-bottom: .25rem;
+            margin-block-end: .25rem;
+            padding-left: 1rem;
+            padding-inline-start: 1rem;
+
+            >ol {
+                margin-top: .25rem;
+            }
+        }
+
+        li::before {
+            content: "└";
+            color: var(--icon-color);
+            position: absolute;
+            left: -.4rem;
+            offset-inline-start: -.4rem;
+        }
+    }
+
+    a {
+        text-decoration: none;
+        color: var(--headings-color);
+
+        &:hover {
+            color: var(--link-color);
+        }
+    }
+}
+
+.c-toc__label.c-toc__label {
+    font-size: var(--step-0);
+    color: var(--body-text-color);
+    font-family: var(--text-font);
+    margin-bottom: .5rem;
+    margin-block-end: .5rem;
+}
+
+.c-toc__label {
+    width: fit-content;
+
+    button {
+        color: var(--link-color);
+        cursor: pointer;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font: inherit;
+        font-size: inherit;
+        font-weight: 500;
+        width: 100%;
+        height: 100%;
+        text-align: left;
+        line-height: 1.5;
+        padding: 0;
+        border-radius: 0;
+        position: relative;
+        transition: outline 0.1s linear;
+
+        svg {
+            flex: none;
+        }
+    }
+}
+
+/* Styles for the accordion icon */
+.toc-trigger-icon {
+    display: block !important; // to override aria-hidden
+    width: 0.75rem;
+    height: 0.5rem;
+    transform-origin: 50% 50%;
+    margin-left: 2rem;
+    margin-inline-start: 2rem;
+    transition: all 0.1s linear;
+    color: var(--color-neutral-400);
+
+    [aria-expanded="true"] & {
+        -ms-transform: rotate(180deg);
+        transform: rotate(180deg);
+    }
+}
+
+
+
+.c-toc__panel {
+    &[data-open="false"] {
+        display: none;
+    }
+
+    &[data-open="true"] {
+        display: block;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/components/version-switcher.scss b/eslint/docs/src/assets/scss/components/version-switcher.scss
new file mode 100644 (file)
index 0000000..606b802
--- /dev/null
@@ -0,0 +1,4 @@
+.version-switcher {
+    margin-bottom: .5rem;
+    margin-block-end: .5rem;
+}
diff --git a/eslint/docs/src/assets/scss/docs-footer.scss b/eslint/docs/src/assets/scss/docs-footer.scss
new file mode 100644 (file)
index 0000000..347afd3
--- /dev/null
@@ -0,0 +1,50 @@
+.docs-footer {
+    display: flex;
+    flex-direction: column;
+    gap: 2rem;
+    justify-content: space-between;
+    align-items: baseline;
+    font-size: .875rem;
+
+    @media all and (max-width: 800px) {
+        padding: 1.5rem 0 4rem;
+        align-items: center;
+    }
+}
+
+.copyright p {
+    margin: 0;
+}
+
+.docs-socials-and-legal {
+    display: flex;
+    flex-direction: column;
+    gap: 1rem;
+
+    @media all and (max-width: 800px) {
+        text-align: center;
+    }
+}
+
+.docs-switchers {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 1.5rem;
+
+    .theme-switcher,
+    .language-switcher {
+        flex: 1 1 240px;
+    }
+
+    .theme-switcher {
+        @media all and (max-width: 800px) {
+            justify-content: center;
+        }
+    }
+
+    .language-switcher {
+        @media all and (max-width: 800px) {
+            justify-content: center;
+        }
+    }
+}
diff --git a/eslint/docs/src/assets/scss/docs-header.scss b/eslint/docs/src/assets/scss/docs-header.scss
new file mode 100644 (file)
index 0000000..6ba51ce
--- /dev/null
@@ -0,0 +1,40 @@
+.site-header {
+    padding: .75rem 0;
+    border-top: 4px solid var(--link-color);
+    border-bottom: 1px solid var(--divider-color);
+    border-block-start: 4px solid var(--link-color);
+    border-block-end: 1px solid var(--divider-color);
+
+    .docs-wrapper {
+        display: grid;
+        align-items: start;
+        padding-top: 0;
+        padding-bottom: 0;
+
+        padding-block-start: 0;
+        padding-block-end: 0;
+
+        @media all and (min-width: 1024px) {
+            justify-content: space-between;
+        }
+    }
+}
+
+.logo-link {
+    display: inline-flex;
+    justify-self: start;
+    flex: none;
+    place-content: center;
+    grid-column: 1 / -1;
+    grid-row: 1;
+    padding: .5rem 0;
+}
+
+.logo svg {
+    display: inline-block;
+    margin-bottom: -4px;
+    margin-block-end: -4px;
+    width: 100%;
+    max-width: 100px;
+    height: auto;
+}
diff --git a/eslint/docs/src/assets/scss/docs.scss b/eslint/docs/src/assets/scss/docs.scss
new file mode 100644 (file)
index 0000000..22cde70
--- /dev/null
@@ -0,0 +1,155 @@
+/* docs layout styles */
+
+html {
+    scroll-behavior: smooth;
+}
+
+.docs {
+    max-width: 1700px;
+    margin: 0 auto;
+}
+
+.docs-aside__content {
+    flex: 1;
+}
+
+.docs-wrapper {
+    padding: 0 var(--space-s-l);
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+
+    @media all and (min-width: 1024px) {
+        display: grid;
+        grid-template-columns: minmax(250px, 1fr) minmax(0, 3.5fr);
+        align-items: stretch;
+    }
+}
+
+.docs-nav {
+    grid-column: 1 / 2;
+    grid-row: 1 / 2;
+    padding-top: var(--space-l-xl);
+    padding-block-start: var(--space-l-xl);
+    font-size: .875rem;
+
+    display: grid;
+    grid-auto-rows: max-content;
+    align-items: start;
+
+    @media all and (min-width: 1024px) {
+        padding: var(--space-l-xl) 0;
+        padding-right: var(--space-s-l);
+        padding-inline-end: var(--space-s-l);
+
+        border-right: 1px solid var(--divider-color);
+        border-inline-end: 1px solid var(--divider-color);
+    }
+}
+
+.docs-content {
+    grid-column: 2 / 3;
+    padding: var(--space-l-xl) 0;
+    flex: 1;
+
+    @media all and (min-width: 800px) {
+        display: grid;
+        grid-template-columns: minmax(0, 4fr) minmax(160px, 1fr);
+        grid-gap: 1rem;
+    }
+
+    @media all and (min-width: 1024px) {
+        padding: 0;
+    }
+
+    @media all and (min-width: 1300px) {
+        grid-gap: 2rem;
+    }
+}
+
+.docs-main {
+    flex: 1 1 68ch;
+
+    @media all and (min-width: 800px) {
+        padding-right: var(--space-s-l);
+        padding-inline-end: var(--space-s-l);
+
+        border-right: 1px solid var(--divider-color);
+        border-inline-end: 1px solid var(--divider-color);
+    }
+
+    @media all and (min-width: 1024px) {
+        padding: var(--space-l-xl) var(--space-l-2xl);
+    }
+}
+
+
+.docs-aside {
+    grid-column: 2 / 3;
+    display: flex;
+    flex-direction: column;
+
+    @media all and (min-width: 800px) {
+        padding: var(--space-l-xl) 0;
+    }
+}
+
+.docs-toc {
+    flex: 1;
+    align-self: center;
+}
+
+.docs-edit-link {
+    border-top: 1px solid var(--divider-color);
+    padding-top: 1.5rem;
+    padding-block-start: 1.5rem;
+    margin: 3rem 0;
+}
+
+div.correct,
+div.incorrect {
+    position: relative;
+
+    &::after {
+        position: absolute;
+        top: -22px;
+        right: -22px;
+        offset-inline-end: -22px;
+        offset-block-start: -22px;
+    }
+}
+
+div.correct {
+    &::after {
+        content: url("data:image/svg+xml,%3Csvg width='45' height='44' viewBox='0 0 45 44' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='1.5' y='1' width='42' height='42' rx='21' fill='%23ECFDF3'/%3E%3Cpath d='M30.5 16L19.5 27L14.5 22' stroke='%2312B76A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='1.5' y='1' width='42' height='42' rx='21' stroke='white' stroke-width='2'/%3E%3C/svg%3E%0A");
+    }
+}
+
+div.incorrect {
+    &::after {
+        content: url("data:image/svg+xml,%3Csvg width='45' height='44' viewBox='0 0 45 44' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='1.5' y='1' width='42' height='42' rx='21' fill='%23FFF1F3'/%3E%3Cpath d='M28.5 16L16.5 28M16.5 16L28.5 28' stroke='%23F63D68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='1.5' y='1' width='42' height='42' rx='21' stroke='white' stroke-width='2'/%3E%3C/svg%3E%0A");
+    }
+}
+
+pre[class*="language-"] {
+    position: relative;
+}
+
+.c-btn.c-btn--playground {
+    position: absolute;
+    font-size: var(--step--1);
+    bottom: .5rem;
+    right: .5rem;
+    offset-block-end: .5rem;
+    offset-inline-end: .5rem;
+
+    @media all and (max-width: 768px) {
+        display: none;
+    }
+}
+
+@media (hover: none) {
+    .anchorjs-link {
+        opacity: 1;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/forms.scss b/eslint/docs/src/assets/scss/forms.scss
new file mode 100644 (file)
index 0000000..e6d830c
--- /dev/null
@@ -0,0 +1,54 @@
+.c-custom-select {
+    -moz-appearance: none;
+    -webkit-appearance: none;
+    appearance: none;
+    box-sizing: border-box;
+    display: block;
+    width: 100%;
+    max-width: 100%;
+    min-width: 0px;
+    padding: .625rem .875rem;
+    padding-right: calc(.875rem * 2.5);
+    padding-inline-end: calc(.875rem * 2.5);
+    font: inherit;
+    color: var(--body-text-color);
+    line-height: 1.3;
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    box-shadow: var(--shadow-xs);
+    background-color: var(--body-background-color);
+    background-image: url("data:image/svg+xml,%3Csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.60938L10 12.6094L15 7.60938' stroke='%23667085' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"), linear-gradient(to bottom, var(--body-background-color) 0%, var(--body-background-color) 100%);
+    background-repeat: no-repeat, repeat;
+    background-position: right .875rem top 50%,
+    0 0;
+    background-size: 1em auto, 100%;
+}
+
+.label__text.label__text {
+    display: flex;
+    font-size: .875rem;
+    align-items: center;
+    gap: .5rem;
+    font-size: .875rem;
+    font-family: var(--text-font);
+    color: inherit;
+    font-weight: 400;
+    line-height: 1.5;
+    margin-bottom: .25rem;
+    margin-block-end: .25rem;
+}
+
+input {
+    border: 1px solid var(--border-color);
+    border-radius: var(--border-radius);
+    padding: .625rem .875rem;
+    font: inherit;
+    font-size: 1rem;
+    display: block;
+    line-height: 1.3;
+    min-width: 0;
+    line-height: 1.3;
+    max-width: 100%;
+    background-color: var(--body-background-color);
+    color: inherit;
+}
diff --git a/eslint/docs/src/assets/scss/foundations.scss b/eslint/docs/src/assets/scss/foundations.scss
new file mode 100644 (file)
index 0000000..27849b3
--- /dev/null
@@ -0,0 +1,444 @@
+::selection {
+    background-color: var(--color-brand);
+    color: #fff;
+}
+
+h1:target,
+h2:target,
+h3:target,
+h4:target,
+h5:target,
+h6:target {
+    background-color: var(--lighter-background-color);
+}
+
+*:focus {
+    outline: none;
+}
+
+*:focus-visible {
+    outline: 2px solid var(--outline-color);
+    outline-offset: 3px;
+}
+
+*.focus-visible {
+    outline: 2px solid var(--outline-color);
+    outline-offset: 3px;
+}
+
+*:focus:not(:focus-visible) {
+    outline: 1px solid transparent;
+    box-shadow: none;
+}
+
+.js-focus-visible *:focus:not(.focus-visible) {
+    outline: 1px solid transparent;
+    box-shadow: none;
+}
+
+input:focus-visible {
+    outline: 2px solid var(--link-color);
+    border-color: var(--border-color);
+}
+
+input:focus {
+    outline: 2px solid transparent;
+    box-shadow: 0 0 0 2px var(--link-color);
+}
+
+
+*,
+*::before,
+*::after {
+    box-sizing: border-box;
+}
+
+html {
+    accent-color: var(--link-color);
+    background-color: var(--body-background-color);
+    height: 100%;
+    font-family: var(--text-font);
+    overflow-x: hidden;
+    caret-color: var(--link-color);
+}
+
+body {
+    position: relative;
+    margin: 0 auto;
+    line-height: 1.5;
+    display: flex;
+    flex-direction: column;
+    min-height: 100%;
+    background-color: var(--body-background-color);
+    color: var(--body-text-color);
+}
+
+#skip-link {
+    position: fixed;
+    top: -30em;
+    left: 0;
+    right: auto;
+    offset-block-start: -30em;
+    offset-inline-start: 0;
+    offset-inline-end: auto;
+
+    z-index: 999;
+    transition: top .1s linear;
+
+    &:focus {
+        outline: 2px solid transparent;
+        top: 2px;
+        offset-block-start: 2px;
+    }
+
+    &:focus-visible {
+        outline: 2px solid transparent;
+        top: 2px;
+        offset-block-start: 2px;
+    }
+}
+
+main {
+    flex: 1;
+
+    &:focus {
+        outline: none;
+    }
+
+    &:target {
+        outline: none;
+    }
+}
+
+hr {
+    border: none;
+    border-top: 1px solid var(--divider-color);
+    border-block-start: 1px solid var(--divider-color);
+    background: none;
+    height: 0;
+    margin: 2rem 0;
+}
+
+.content-container {
+    width: 100%;
+    margin: 0 auto;
+    padding: var(--space-xl-3xl) calc(1rem + 1vw);
+}
+
+
+.section-head {
+    .section-supporting-text {
+        text-align: center;
+        max-width: 768px;
+        margin: 0 auto var(--space-l-2xl);
+    }
+}
+
+.section-foot {
+    margin-top: var(--space-l-2xl);
+    margin-block-start: var(--space-l-2xl);
+
+    .section-supporting-text {
+        text-align: center;
+        font-size: var(--step--1);
+        max-width: 768px;
+        margin: 0 auto;
+    }
+}
+
+.section-title {
+    margin-bottom: 1rem;
+    margin-block-end: 1rem;
+}
+
+.section-supporting-text {
+    font-size: var(--step-1);
+}
+
+
+code,
+pre {
+    font-family: var(--mono-font);
+    font-variant-ligatures: none;
+}
+
+code {
+    color: var(--link-color);
+
+    pre & {
+        color: unset;
+    }
+}
+
+p:empty {
+    display: none;
+    margin: 0;
+}
+
+.c-icon {
+    color: var(--icon-color);
+    flex: none;
+    transition: all .2s linear;
+
+    @media (-ms-high-contrast: active) {
+        color: windowText;
+    }
+
+    @media (forced-colors: active) {
+        color: canvasText;
+    }
+}
+
+table {
+    width: 100%;
+    margin: 2.5rem 0;
+    border-collapse: collapse;
+    border: 1px solid var(--divider-color);
+
+    td {
+        padding: .25rem .5rem;
+        border: 1px solid var(--divider-color);
+    }
+
+    th {
+        background-color: var(--lightest-background-color);
+        padding: .25rem .5rem;
+    }
+}
+
+.c-btn,
+button,
+a {
+    .c-icon:hover {
+        color: var(--link-color);
+    }
+}
+
+
+a {
+    color: var(--link-color);
+    transition: color .1s linear;
+
+    .side-header & {
+        color: inherit;
+        text-decoration: none;
+    }
+}
+
+svg {
+    flex: none;
+    transition: color .1s linear;
+}
+
+p {
+    margin: 0 0 1.5em;
+
+    :matches(nav, .posts-collection) & {
+        margin-bottom: .75em;
+        margin-block-end: .75em;
+    }
+}
+
+p,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+    overflow-wrap: break-word;
+}
+
+
+ul,
+ol {
+    margin-top: 0;
+    margin-block-start: 0;
+
+    li {
+        margin: 0 0 .75em;
+    }
+
+    .person__bio  & {
+        padding-left: 1.5rem;
+        padding-inline-start: 1.5rem;
+    }
+}
+
+.docs-main ul,
+.post-main ul,
+.docs-main ol,
+.post-main ol {
+    margin: 1rem 0;
+}
+
+ul[role="list"] {
+    list-style: none;
+    margin: 0;
+    padding: 0;
+
+    li {
+        margin: 0;
+    }
+}
+
+ol {
+    list-style: decimal;
+
+    li::marker {
+        color: var(--link-color);
+    }
+}
+
+p:empty {
+    margin: 0;
+    display: none;
+}
+
+figure {
+    margin-bottom: 4rem;
+    margin-block-end: 4rem;
+
+    img {
+        margin-bottom: 1rem;
+        margin-block-end: 1rem;
+    }
+
+    figcaption {
+        color: var(--grey);
+    }
+}
+
+img {
+    display: block;
+    position: relative;
+    max-width: 100%;
+    height: auto;
+}
+
+nav {
+    /* rarely do we display bullets for lists in navigation */
+    ol,
+    ul {
+        list-style: none;
+        margin: 0;
+        padding: 0;
+    }
+}
+
+
+.video {
+    width: 90%;
+    max-width: 1400px;
+    margin: 2em auto;
+
+    iframe {
+        aspect-ratio: 16 / 9;
+        width: 100%;
+        height: auto;
+    }
+}
+
+@media (prefers-reduced-motion: no-preference) {
+    *:focus-visible,
+    *.focus-visible {
+        transition: outline-offset .15s linear;
+        outline-offset: 3px;
+    }
+}
+
+
+/* typography */
+body {
+    font-size: var(--step-0);
+    line-height: 1.5;
+}
+
+.eyebrow {
+    color: var(--link-color);
+    font-size: 1rem;
+    font-weight: 500;
+    display: block;
+    margin-bottom: 1.5rem;
+    margin-block-end: 1.5rem;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+    font-family: var(--display-font);
+    color: var(--headings-color);
+    font-weight: 500;
+    margin-top: 0;
+    margin-block-start: 0;
+
+}
+
+h2,
+h3,
+h4,
+h5,
+h6 {
+
+    .docs-main &,
+    .components-main & {
+        margin-top: 3rem;
+        margin-bottom: 1.5rem;
+        margin-block-start: 3rem;
+        margin-block-end: 1.5rem;
+
+        &:first-child {
+            margin-top: 0;
+            margin-block-start: 0;
+        }
+    }
+}
+
+
+small,
+caption,
+cite,
+figcaption {
+    font-size: var(--step--1);
+}
+
+h6,
+.h6 {
+    font-size: var(--step-0);
+}
+
+h5,
+.h5 {
+    font-size: var(--step-0); // 20
+}
+
+h4,
+.h4 {
+    font-size: var(--step-1); // 24
+}
+
+h3,
+.h3 {
+    font-size: var(--step-2);
+    line-height: 1.2;
+}
+
+h2,
+.h2 {
+    font-size: var(--step-3);
+    line-height: 1.2;
+}
+
+h1,
+.h1 {
+    font-size: var(--step-4);
+    line-height: 1.2;
+}
+
+.h0 {
+    font-size: var(--step-6);
+    line-height: 1.2;
+}
diff --git a/eslint/docs/src/assets/scss/languages.scss b/eslint/docs/src/assets/scss/languages.scss
new file mode 100644 (file)
index 0000000..b3872e4
--- /dev/null
@@ -0,0 +1,52 @@
+.languages-list {
+    margin: 0;
+    padding: 0;
+    font-size: var(--step-0);
+
+    li {
+        margin: 0;
+
+        &:last-of-type a {
+            border-bottom: 0;
+        }
+    }
+
+    a {
+        color: inherit;
+        display: block;
+        width: 100%;
+        padding: .75rem .1rem;
+        text-decoration: none;
+        display: flex;
+        align-items: center;
+        border-bottom: 1px solid var(--divider-color);
+        border-block-end: 1px solid var(--divider-color);
+
+        &[aria-current="true"] {
+            font-weight: 500;
+            color: var(--link-color);
+
+            &::after {
+                content: "✔️";
+            }
+        }
+
+        &:hover {
+            color: var(--link-color);
+        }
+    }
+}
+
+.languages-section .flag {
+    font-size: 2em;
+    margin-right: .5rem;
+    margin-inline-end: .5rem;
+}
+
+.languages-section .languages-list {
+    font-size: var(--step-1);
+    border-left: 4px solid var(--tab-border-color);
+    padding-left: 1rem;
+    border-inline-start: 4px solid var(--tab-border-color);
+    padding-inline-start: 1rem;
+}
diff --git a/eslint/docs/src/assets/scss/print.scss b/eslint/docs/src/assets/scss/print.scss
new file mode 100644 (file)
index 0000000..446c585
--- /dev/null
@@ -0,0 +1,207 @@
+*,
+*:before,
+*:after,
+*:first-letter,
+p:first-line,
+div:first-line,
+blockquote:first-line,
+li:first-line {
+    background: transparent !important;
+    color: #000 !important;
+    box-shadow: none !important;
+    text-shadow: none !important;
+}
+
+body {
+    width: 100% !important;
+    margin: 0 !important;
+    padding: 0 !important;
+    line-height: 1.45;
+    font-family: Helvetica, sans-serif;
+    color: #000;
+    background: none;
+    font-size: 14pt;
+}
+
+.grid {
+    display: block;
+}
+
+main,
+.docs-content,
+.docs-wrapper {
+    display: block;
+    width: 100%;
+    max-width: 75ch;
+    margin: 1cm auto;
+}
+
+/* Headings */
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+    page-break-after: avoid;
+}
+
+h1 {
+    font-size: 19pt;
+}
+
+h2 {
+    font-size: 17pt;
+}
+
+h3 {
+    font-size: 15pt;
+}
+
+h4,
+h5,
+h6 {
+    font-size: 14pt;
+}
+
+
+p,
+h2,
+h3 {
+    orphans: 3;
+    widows: 3;
+}
+
+code {
+    font: 12pt Courier, monospace;
+}
+
+blockquote {
+    margin: 1.2em;
+    padding: 1em;
+    font-size: 12pt;
+}
+
+hr {
+    background-color: #ccc;
+}
+
+/* Images */
+img {
+    max-width: 100% !important;
+}
+
+a img {
+    border: none;
+}
+
+/* Links */
+a:link,
+a:visited {
+    background: transparent;
+    font-weight: 700;
+    text-decoration: underline;
+    color: #333;
+}
+
+// a:link[href^="http://"]:after,
+// a[href^="http://"]:visited:after {
+//     content: " ("attr(href) ") ";
+//     font-size: 90%;
+// }
+
+abbr[title]:after {
+    content: " ("attr(title) ")";
+}
+
+/* Don't show linked images  */
+a[href^="http://"] {
+    color: #000;
+}
+
+a[href$=".jpg"]:after,
+a[href$=".jpeg"]:after,
+a[href$=".gif"]:after,
+a[href$=".png"]:after {
+    content: " ("attr(href) ") ";
+    display: none;
+}
+
+/* Don't show links that are fragment identifiers, or use the `javascript:` pseudo protocol .. taken from html5boilerplate */
+a[href^="#"]:after,
+a[href^="javascript:"]:after {
+    content: "";
+}
+
+/* Table */
+table {
+    margin: 1px;
+    text-align: left;
+}
+
+th {
+    border-bottom: 1px solid #333;
+    font-weight: bold;
+}
+
+td {
+    border-bottom: 1px solid #333;
+}
+
+th,
+td {
+    padding: 4px 10px 4px 0;
+}
+
+tfoot {
+    font-style: italic;
+}
+
+caption {
+    background: #fff;
+    margin-bottom: 2em;
+    text-align: left;
+}
+
+thead {
+    display: table-header-group;
+}
+
+img,
+tr {
+    page-break-inside: avoid;
+}
+
+body>*:not(main),
+aside,
+*[class*="sidebar"] {
+    display: none;
+}
+
+button,
+.c-btn.c-btn--playground,
+.docs-edit-link {
+    display: none;
+}
+
+a[href^='http']:not([href*='mywebsite.com'])::after {
+    content: ' ('attr(href) ')';
+}
+
+.resource a::after {
+    display: none;
+}
+
+ul {
+    page-break-inside: avoid;
+}
+
+.docs-toc, .docs-index, .docs-aside, #skip-link{
+    display: none;
+}
+
+@media print {
+    @page {
+        margin: 1cm;
+    }
+}
diff --git a/eslint/docs/src/assets/scss/styles.scss b/eslint/docs/src/assets/scss/styles.scss
new file mode 100644 (file)
index 0000000..e07b280
--- /dev/null
@@ -0,0 +1,37 @@
+
+@import "tokens/themes.scss";
+@import "tokens/spacing.scss";
+@import "tokens/typography.scss";
+@import "tokens/ui.scss";
+
+@import "foundations.scss";
+@import "syntax-highlighter.scss";
+@import "docs-header.scss";
+@import "docs-footer.scss";
+@import "eslint-site-footer.scss";
+@import "eslint-site-header.scss";
+@import "forms.scss";
+@import "docs.scss";
+@import "versions.scss";
+@import "languages.scss";
+
+@import "components/buttons.scss";
+@import "components/docs-navigation.scss";
+@import "components/toc.scss";
+@import "components/search.scss";
+@import "components/alert.scss";
+@import "components/rules.scss";
+@import "components/social-icons.scss";
+@import "components/hero.scss";
+@import "components/theme-switcher.scss";
+@import "components/version-switcher.scss";
+@import "components/language-switcher.scss";
+@import "components/docs-index.scss"; // docs index on the main docs pages
+@import "components/index.scss"; // used in component library
+@import "components/tabs.scss";
+@import "components/index.scss";
+@import "components/resources.scss";
+
+@import "carbon-ads.scss";
+
+@import "utilities.scss";
diff --git a/eslint/docs/src/assets/scss/syntax-highlighter.scss b/eslint/docs/src/assets/scss/syntax-highlighter.scss
new file mode 100644 (file)
index 0000000..b0160f7
--- /dev/null
@@ -0,0 +1,130 @@
+code[class*="language-"],
+pre[class*="language-"] {
+    font-family: var(--mono-font), Consolas,
+        Monaco,
+        'Andale Mono',
+        'Ubuntu Mono',
+        monospace;
+    font-size: 1em;
+    text-align: left;
+    white-space: pre;
+    word-spacing: normal;
+    word-break: normal;
+    word-wrap: normal;
+    line-height: 1.5;
+    font-variant-ligatures: none;
+
+    -moz-tab-size: 4;
+    -o-tab-size: 4;
+    tab-size: 4;
+
+    -webkit-hyphens: none;
+    -moz-hyphens: none;
+    -ms-hyphens: none;
+    hyphens: none;
+}
+
+@media print {
+
+    code[class*="language-"],
+    pre[class*="language-"] {
+        text-shadow: none;
+    }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+    padding: 1.5rem;
+    margin: 1.5rem 0;
+    overflow: auto;
+    background-color: var(--color-neutral-50);
+    border-radius: var(--border-radius);
+
+    background-color: var(--lightest-background-color);
+    color: var(--color-neutral-900);
+
+    [data-theme="dark"] & {
+        color: var(--color-neutral-100);
+    }
+}
+
+:not(pre)>code[class*="language-"],
+pre[class*="language-"] {
+    background-color: var(--lightest-background-color);
+}
+
+/* Inline code */
+:not(pre)>code[class*="language-"] {
+    padding: .1em;
+    border-radius: .3em;
+    white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+    color: #6E7F8E;
+
+    [data-theme="dark"] & {
+        color: #8E9FAE;
+    }
+}
+
+
+.token.namespace {
+    opacity: .7;
+}
+
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+    color: var(--link-color);
+}
+
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+    color: var(--link-color);
+}
+
+.token.important,
+.token.bold {
+    font-weight: bold;
+}
+
+.token.italic {
+    font-style: italic;
+}
+
+.token.entity {
+    cursor: help;
+}
+
+pre {
+    counter-reset: lineNumber;
+}
+
+code .highlight-line { 
+    font-variant-ligatures: none;
+} 
+
+code .highlight-line:before {
+    -webkit-user-select: none;
+    color: var(--icon-color);
+    content: counter(lineNumber);
+    counter-increment: lineNumber;
+    display: inline-block;
+    font-variant-numeric: tabular-nums;
+    margin-right: 1.2em;
+    padding-right: 1.2em;
+    margin-inline-end: 1.2em;
+    padding-inline-end: 1.2em;
+    text-align: right;
+    width: 2.4em;
+}
diff --git a/eslint/docs/src/assets/scss/tokens/spacing.scss b/eslint/docs/src/assets/scss/tokens/spacing.scss
new file mode 100644 (file)
index 0000000..1f5549b
--- /dev/null
@@ -0,0 +1,77 @@
+/* @link https://utopia.fyi/space/calculator?c=320,16,1.125,1023,16,1.25,6,2,&s=0.75|0.5|0.25,1.5|2|3|4|6|8,l-2xl|xl-3xl|xl-4xl|l-3xl|s-l */
+
+:root {
+    --fluid-min-width: 320;
+    --fluid-max-width: 1023;
+
+    --fluid-screen: 100vw;
+    --fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
+}
+
+@media screen and (min-width: 1024px) {
+    :root {
+        --fluid-screen: calc(var(--fluid-max-width) * 1px);
+    }
+}
+
+:root {
+    --fc-3xs-min: (var(--fc-s-min) * 0.25);
+    --fc-3xs-max: (var(--fc-s-max) * 0.25);
+
+    --fc-2xs-min: (var(--fc-s-min) * 0.5);
+    --fc-2xs-max: (var(--fc-s-max) * 0.5);
+
+    --fc-xs-min: (var(--fc-s-min) * 0.75);
+    --fc-xs-max: (var(--fc-s-max) * 0.75);
+
+    --fc-s-min: (var(--f-0-min, 16));
+    --fc-s-max: (var(--f-0-max, 16));
+
+    --fc-m-min: (var(--fc-s-min) * 1.5);
+    --fc-m-max: (var(--fc-s-max) * 1.5);
+
+    --fc-l-min: (var(--fc-s-min) * 2);
+    --fc-l-max: (var(--fc-s-max) * 2);
+
+    --fc-xl-min: (var(--fc-s-min) * 3);
+    --fc-xl-max: (var(--fc-s-max) * 3);
+
+    --fc-2xl-min: (var(--fc-s-min) * 4);
+    --fc-2xl-max: (var(--fc-s-max) * 4);
+
+    --fc-3xl-min: (var(--fc-s-min) * 6);
+    --fc-3xl-max: (var(--fc-s-max) * 6);
+
+    --fc-4xl-min: (var(--fc-s-min) * 8);
+    --fc-4xl-max: (var(--fc-s-max) * 8);
+
+    /* T-shirt sizes */
+    --space-3xs: calc(((var(--fc-3xs-min) / 16) * 1rem) + (var(--fc-3xs-max) - var(--fc-3xs-min)) * var(--fluid-bp));
+    --space-2xs: calc(((var(--fc-2xs-min) / 16) * 1rem) + (var(--fc-2xs-max) - var(--fc-2xs-min)) * var(--fluid-bp));
+    --space-xs: calc(((var(--fc-xs-min) / 16) * 1rem) + (var(--fc-xs-max) - var(--fc-xs-min)) * var(--fluid-bp));
+    --space-s: calc(((var(--fc-s-min) / 16) * 1rem) + (var(--fc-s-max) - var(--fc-s-min)) * var(--fluid-bp));
+    --space-m: calc(((var(--fc-m-min) / 16) * 1rem) + (var(--fc-m-max) - var(--fc-m-min)) * var(--fluid-bp));
+    --space-l: calc(((var(--fc-l-min) / 16) * 1rem) + (var(--fc-l-max) - var(--fc-l-min)) * var(--fluid-bp));
+    --space-xl: calc(((var(--fc-xl-min) / 16) * 1rem) + (var(--fc-xl-max) - var(--fc-xl-min)) * var(--fluid-bp));
+    --space-2xl: calc(((var(--fc-2xl-min) / 16) * 1rem) + (var(--fc-2xl-max) - var(--fc-2xl-min)) * var(--fluid-bp));
+    --space-3xl: calc(((var(--fc-3xl-min) / 16) * 1rem) + (var(--fc-3xl-max) - var(--fc-3xl-min)) * var(--fluid-bp));
+    --space-4xl: calc(((var(--fc-4xl-min) / 16) * 1rem) + (var(--fc-4xl-max) - var(--fc-4xl-min)) * var(--fluid-bp));
+
+    /* One-up pairs */
+    --space-3xs-2xs: calc(((var(--fc-3xs-min) / 16) * 1rem) + (var(--fc-2xs-max) - var(--fc-3xs-min)) * var(--fluid-bp));
+    --space-2xs-xs: calc(((var(--fc-2xs-min) / 16) * 1rem) + (var(--fc-xs-max) - var(--fc-2xs-min)) * var(--fluid-bp));
+    --space-xs-s: calc(((var(--fc-xs-min) / 16) * 1rem) + (var(--fc-s-max) - var(--fc-xs-min)) * var(--fluid-bp));
+    --space-s-m: calc(((var(--fc-s-min) / 16) * 1rem) + (var(--fc-m-max) - var(--fc-s-min)) * var(--fluid-bp));
+    --space-m-l: calc(((var(--fc-m-min) / 16) * 1rem) + (var(--fc-l-max) - var(--fc-m-min)) * var(--fluid-bp));
+    --space-l-xl: calc(((var(--fc-l-min) / 16) * 1rem) + (var(--fc-xl-max) - var(--fc-l-min)) * var(--fluid-bp));
+    --space-xl-2xl: calc(((var(--fc-xl-min) / 16) * 1rem) + (var(--fc-2xl-max) - var(--fc-xl-min)) * var(--fluid-bp));
+    --space-2xl-3xl: calc(((var(--fc-2xl-min) / 16) * 1rem) + (var(--fc-3xl-max) - var(--fc-2xl-min)) * var(--fluid-bp));
+    --space-3xl-4xl: calc(((var(--fc-3xl-min) / 16) * 1rem) + (var(--fc-4xl-max) - var(--fc-3xl-min)) * var(--fluid-bp));
+
+    /* Custom pairs */
+    --space-l-2xl: calc(((var(--fc-l-min) / 16) * 1rem) + (var(--fc-2xl-max) - var(--fc-l-min)) * var(--fluid-bp));
+    --space-xl-3xl: calc(((var(--fc-xl-min) / 16) * 1rem) + (var(--fc-3xl-max) - var(--fc-xl-min)) * var(--fluid-bp));
+    --space-xl-4xl: calc(((var(--fc-xl-min) / 16) * 1rem) + (var(--fc-4xl-max) - var(--fc-xl-min)) * var(--fluid-bp));
+    --space-l-3xl: calc(((var(--fc-l-min) / 16) * 1rem) + (var(--fc-3xl-max) - var(--fc-l-min)) * var(--fluid-bp));
+    --space-s-l: calc(((var(--fc-s-min) / 16) * 1rem) + (var(--fc-l-max) - var(--fc-s-min)) * var(--fluid-bp));
+}
diff --git a/eslint/docs/src/assets/scss/tokens/themes.scss b/eslint/docs/src/assets/scss/tokens/themes.scss
new file mode 100644 (file)
index 0000000..11ced7f
--- /dev/null
@@ -0,0 +1,158 @@
+:root {
+    /* Tier 1 variables */
+    // colors
+    --color-neutral-25: #FCFCFD;
+    --color-neutral-50: #F9FAFB;
+    --color-neutral-100: #F2F4F7;
+    --color-neutral-200: #E4E7EC;
+    --color-neutral-300: #D0D5DD;
+    --color-neutral-400: #98A2B3;
+    --color-neutral-500: #667085;
+    --color-neutral-600: #475467;
+    --color-neutral-700: #344054;
+    --color-neutral-800: #1D2939;
+    --color-neutral-900: #101828;
+
+    --color-primary-25: #FBFBFF;
+    --color-primary-50: #F6F6FE;
+    --color-primary-100: #ECECFD;
+    --color-primary-200: #DEDEFF;
+    --color-primary-300: #CCCCFA;
+    --color-primary-400: #B7B7FF;
+    --color-primary-500: #A0A0F5;
+    --color-primary-600: #8080F2;
+    --color-primary-700: #6358D4;
+    --color-primary-800: #4B32C3;
+    --color-primary-900: #341BAB;
+
+    --color-warning-25: #FFFCF5;
+    --color-warning-50: #FFFAEB;
+    --color-warning-100: #FEF0C7;
+    --color-warning-200: #FEDF89;
+    --color-warning-300: #FEC84B;
+    --color-warning-400: #FDB022;
+    --color-warning-500: #F79009;
+    --color-warning-600: #DC6803;
+    --color-warning-700: #B54708;
+    --color-warning-800: #93370D;
+    --color-warning-900: #7A2E0E;
+
+    --color-success-25: #F6FEF9;
+    --color-success-50: #ECFDF3;
+    --color-success-100: #D1FADF;
+    --color-success-200: #A6F4C5;
+    --color-success-300: #6CE9A6;
+    --color-success-400: #32D583;
+    --color-success-500: #12B76A;
+    --color-success-600: #039855;
+    --color-success-700: #027A48;
+    --color-success-800: #05603A;
+    --color-success-900: #054F31;
+
+    --color-rose-25: #FFF5F6;
+    --color-rose-50: #FFF1F3;
+    --color-rose-100: #FFE4E8;
+    --color-rose-200: #FECDD6;
+    --color-rose-300: #FEA3B4;
+    --color-rose-400: #FD6F8E;
+    --color-rose-500: #F63D68;
+    --color-rose-600: #E31B54;
+    --color-rose-700: #C01048;
+    --color-rose-800: #A11043;
+    --color-rose-900: #89123E;
+
+    /* Tier 2 variables */
+    --primary-button-background-color: var(--color-primary-800);
+    --primary-button-hover-color: var(--color-primary-900);
+    --primary-button-text-color: #fff;
+    --secondary-button-background-color: var(--color-primary-50);
+    --secondary-button-hover-color: var(--color-primary-100);
+    --secondary-button-text-color: var(--color-brand);
+    --ghost-button-background-color: var(--color-primary-50);
+    --ghost-button-text-color: var(--color-brand);
+
+    --color-brand: var(--color-primary-800);
+    --body-background-color: #fff;
+    --body-text-color: var(--color-neutral-500);
+    --headings-color: var(--color-neutral-900);
+
+    --border-color: var(--color-neutral-300);
+    --divider-color: var(--color-neutral-200);
+
+
+    --icon-color: var(--color-neutral-400);
+    --dark-icon-color: var(--color-neutral-500);
+    --link-color: var(--color-primary-800);
+
+    --lighter-background-color: var(--color-neutral-100);
+    --lightest-background-color: var(--color-neutral-50);
+    --docs-lightest-background-color: var(--color-primary-50);
+    --hero-background-color: var(--color-neutral-25);
+    --footer-background-color: var(--color-neutral-25);
+    --outline-color: var(--color-brand);
+}
+
+@media (prefers-color-scheme: dark) {
+    :root {
+        --body-background-color: var(--color-neutral-900);
+        --body-text-color: var(--color-neutral-300);
+        --headings-color: #fff;
+    
+        --divider-color: var(--color-neutral-600);
+        --border-color: var(--color-neutral-500);
+    
+        --icon-color: var(--body-text-color);
+        --dark-icon-color: #fff;
+        --link-color: var(--color-primary-400);
+    
+        --lighter-background-color: var(--color-neutral-800);
+        --lightest-background-color: var(--color-neutral-800);
+        --docs-lightest-background-color: var(--color-neutral-800);
+        --hero-background-color: var(--color-neutral-800);
+        --footer-background-color: var(--color-neutral-800);
+        --outline-color: #fff;
+    }
+}
+
+
+
+html[data-theme="light"] {
+    --body-background-color: #fff;
+    --body-text-color: var(--color-neutral-500);
+    --headings-color: var(--color-neutral-900);
+
+    --border-color: var(--color-neutral-300);
+    --divider-color: var(--color-neutral-200);
+
+
+    --icon-color: var(--color-neutral-400);
+    --dark-icon-color: var(--color-neutral-500);
+    --link-color: var(--color-primary-800);
+
+    --lighter-background-color: var(--color-neutral-100);
+    --lightest-background-color: var(--color-neutral-50);
+    --docs-lightest-background-color: var(--color-primary-50);
+    --hero-background-color: var(--color-neutral-25);
+    --footer-background-color: var(--color-neutral-25);
+    --outline-color: var(--color-brand);
+}
+
+html[data-theme="dark"] {
+    --body-background-color: var(--color-neutral-900);
+    --body-text-color: var(--color-neutral-300);
+    --headings-color: #fff;
+
+    --divider-color: var(--color-neutral-600);
+    --border-color: var(--color-neutral-500);
+
+    --icon-color: var(--body-text-color);
+    --dark-icon-color: #fff;
+    --link-color: var(--color-primary-400);
+
+    --lighter-background-color: var(--color-neutral-800);
+    --lightest-background-color: var(--color-neutral-800);
+    --docs-lightest-background-color: var(--color-neutral-800);
+    --hero-background-color: var(--color-neutral-800);
+    --footer-background-color: var(--color-neutral-800);
+    --outline-color: #fff;
+}
diff --git a/eslint/docs/src/assets/scss/tokens/typography.scss b/eslint/docs/src/assets/scss/tokens/typography.scss
new file mode 100644 (file)
index 0000000..8c178b5
--- /dev/null
@@ -0,0 +1,79 @@
+/* @link https://utopia.fyi/type/calculator?c=320,16,1.125,1280,16,1.25,6,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l */
+
+:root {
+    --fluid-min-width: 320;
+    --fluid-max-width: 1280;
+
+    --fluid-screen: 100vw;
+    --fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
+}
+
+@media screen and (min-width: 1280px) {
+    :root {
+        --fluid-screen: calc(var(--fluid-max-width) * 1px);
+    }
+}
+
+:root {
+    --f--2-min: 12.64;
+    --f--2-max: 10.24;
+    --step--2: calc(((var(--f--2-min) / 16) * 1rem) + (var(--f--2-max) - var(--f--2-min)) * var(--fluid-bp));
+
+    --f--1-min: 14.22;
+    --f--1-max: 12.80;
+    --step--1: calc(((var(--f--1-min) / 16) * 1rem) + (var(--f--1-max) - var(--f--1-min)) * var(--fluid-bp));
+
+    --f-0-min: 16.00;
+    --f-0-max: 16.00;
+    --step-0: calc(((var(--f-0-min) / 16) * 1rem) + (var(--f-0-max) - var(--f-0-min)) * var(--fluid-bp));
+
+    --f-1-min: 18.00;
+    --f-1-max: 20.00;
+    --step-1: calc(((var(--f-1-min) / 16) * 1rem) + (var(--f-1-max) - var(--f-1-min)) * var(--fluid-bp));
+
+    --f-2-min: 20.25;
+    --f-2-max: 25.00;
+    --step-2: calc(((var(--f-2-min) / 16) * 1rem) + (var(--f-2-max) - var(--f-2-min)) * var(--fluid-bp));
+
+    --f-3-min: 22.78;
+    --f-3-max: 31.25;
+    --step-3: calc(((var(--f-3-min) / 16) * 1rem) + (var(--f-3-max) - var(--f-3-min)) * var(--fluid-bp));
+
+    --f-4-min: 25.63;
+    --f-4-max: 39.06;
+    --step-4: calc(((var(--f-4-min) / 16) * 1rem) + (var(--f-4-max) - var(--f-4-min)) * var(--fluid-bp));
+
+    --f-5-min: 28.83;
+    --f-5-max: 48.83;
+    --step-5: calc(((var(--f-5-min) / 16) * 1rem) + (var(--f-5-max) - var(--f-5-min)) * var(--fluid-bp));
+
+    --f-6-min: 32.44;
+    --f-6-max: 61.04;
+    --step-6: calc(((var(--f-6-min) / 16) * 1rem) + (var(--f-6-max) - var(--f-6-min)) * var(--fluid-bp));
+}
+
+:root {
+    --mono-font: "Mono Punctuators", "Space Mono", monospace;
+    --text-font: "Inter",
+            -apple-system,
+            BlinkMacSystemFont,
+            "Segoe UI",
+            Roboto,
+            Helvetica,
+            Arial,
+            sans-serif,
+            "Apple Color Emoji",
+            "Segoe UI Emoji",
+            "Segoe UI Symbol";
+    --display-font: "Space Grotesk",
+            -apple-system,
+            BlinkMacSystemFont,
+            "Segoe UI",
+            Roboto,
+            Helvetica,
+            Arial,
+            sans-serif,
+            "Apple Color Emoji",
+            "Segoe UI Emoji",
+            "Segoe UI Symbol";
+}
diff --git a/eslint/docs/src/assets/scss/tokens/ui.scss b/eslint/docs/src/assets/scss/tokens/ui.scss
new file mode 100644 (file)
index 0000000..08759db
--- /dev/null
@@ -0,0 +1,8 @@
+:root {
+    // elevations
+    --shadow-lg: 0px 12px 16px -4px rgba(16, 24, 40, 0.1),
+                 0px 4px 6px -2px rgba(16, 24, 40, 0.05);
+    --shadow-xs: 0px 1px 2px rgba(16, 24, 40, 0.05);
+
+    --border-radius: .5rem;
+}
diff --git a/eslint/docs/src/assets/scss/utilities.scss b/eslint/docs/src/assets/scss/utilities.scss
new file mode 100644 (file)
index 0000000..ac40064
--- /dev/null
@@ -0,0 +1,174 @@
+.grid {
+    @media all and (min-width: 1024px) {
+        display: grid;
+        grid-template-columns: repeat(12, 1fr);
+        grid-gap: 2rem;
+        align-items: start;
+    }
+}
+
+.visually-hidden {
+    clip: rect(0 0 0 0);
+    clip-path: inset(100%);
+    height: 1px;
+    overflow:
+        hidden;
+    position: absolute;
+    width: 1px;
+    white-space: nowrap;
+}
+
+[hidden] {
+    display: none !important;
+}
+
+.mobile-only {
+    @media all and (min-width: 1024px) {
+        display: none;
+    }
+}
+
+.desktop-only {
+    @media all and (max-width: 1023px) {
+        display: none;
+    }
+}
+
+.text.text {
+    font-size: inherit;
+    color: inherit;
+    font: inherit;
+    font-family: var(--text-font);
+    margin: 0;
+}
+
+.color-brand {
+    color: var(--link-color);
+}
+
+.font-weight-medium {
+    font-weight: 500;
+}
+
+.center-text {
+    text-align: center;
+    grid-column: 1 / -1;
+}
+
+.text-dark {
+    color: var(--headings-color);
+}
+
+.divider {
+    border-bottom: 1px solid var(--divider-color);
+    border-block-end: 1px solid var(--divider-color);
+}
+
+.fs-step--1 {
+    font-size: .875rem;
+}
+
+.fs-step-0 {
+    font-size: var(--step-0);
+}
+
+.fs-step-1 {
+    font-size: var(--step-1);
+}
+
+.fs-step-2 {
+    font-size: var(--step-2);
+}
+
+.fs-step-3 {
+    font-size: var(--step-3);
+}
+
+.fs-step-4 {
+    font-size: var(--step-4);
+}
+
+.fs-step-5 {
+    font-size: var(--step-5);
+}
+
+.fs-step-6 {
+    font-size: var(--step-6);
+}
+
+.grid--center-items {
+    align-items: center;
+}
+
+.span-1-3 {
+    grid-column: 1 / 4;
+}
+
+.span-1-4 {
+    grid-column: 1 / 5;
+}
+
+.span-1-5 {
+    grid-column: 1 / 6;
+}
+
+.span-1-6 {
+    grid-column: 1 / 7;
+}
+
+.span-1-7 {
+    grid-column: 1 / 8;
+}
+
+
+.span-1-12 {
+    grid-column: 1 / -1;
+}
+
+.span-4-12 {
+    grid-column: 4 / 13;
+}
+
+.span-6-12 {
+    grid-column: 6 / 13;
+}
+
+.span-7-12 {
+    grid-column: 7 / 13;
+}
+
+.span-8-12 {
+    grid-column: 8 / 13;
+}
+
+.span-10-12 {
+    grid-column: 10 / 13;
+}
+
+.span-11-12 {
+    grid-column: 11 / 13;
+}
+
+.span-4-9 {
+    grid-column: 4 / 10;
+}
+
+.span-4-11 {
+    grid-column: 4 / 11;
+}
+
+.span-5-12 {
+    grid-column: 5 / 12;
+}
+
+.span-3-10 {
+    grid-column: 3 / 11;
+}
+
+.span-6-7 {
+    grid-column: 6 / 8;
+}
+
+.span-5-8 {
+    grid-column: 5 / 9;
+}
diff --git a/eslint/docs/src/assets/scss/versions.scss b/eslint/docs/src/assets/scss/versions.scss
new file mode 100644 (file)
index 0000000..2a5ba4f
--- /dev/null
@@ -0,0 +1,47 @@
+.versions-list {
+    margin: 0;
+    padding: 0;
+    font-size: var(--step-1);
+
+    li {
+        margin: 0;
+
+        &:last-of-type a {
+            border-bottom: 0;
+            border-block-end: 0;
+        }
+    }
+
+    a {
+        color: var(--link-color);
+        display: block;
+        width: 100%;
+        padding: 1rem .5rem;
+        text-decoration: none;
+        display: flex;
+        align-items: center;
+        border-bottom: 1px solid var(--divider-color);
+        border-block-end: 1px solid var(--divider-color);
+
+        &[data-current="true"] {
+            font-weight: 500;
+            color: var(--link-color);
+
+            &::after {
+                content: "✔️";
+            }
+        }
+
+        &:hover {
+            background-color: var(--lightest-background-color);
+        }
+    }
+}
+
+.versions-section .versions-list {
+    font-size: var(--step-1);
+    border-left: 4px solid var(--tab-border-color);
+    padding-left: 1rem;
+    border-inline-start: 4px solid var(--tab-border-color);
+    padding-inline-start: 1rem;
+}
diff --git a/eslint/docs/src/developer-guide/architecture/index.md b/eslint/docs/src/developer-guide/architecture/index.md
new file mode 100644 (file)
index 0000000..71e4469
--- /dev/null
@@ -0,0 +1,99 @@
+---
+title: Architecture
+layout: doc
+eleventyNavigation:
+    key: architecture
+    parent: developer guide
+    title: Architecture
+    order: 1
+---
+
+<center><img alt="dependency graph" src="../../assets/images/architecture/dependency.svg"></center>
+
+At a high level, there are a few key parts to ESLint:
+
+* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing.
+* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `ESLint`, `RuleTester`, and `SourceCode`.
+* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output.
+* `lib/cli-engine/` - this module is `CLIEngine` class that finds source code files and configuration files then does code verifying with the `Linter` class. This includes the loading logic of configuration files, parsers, plugins, and formatters.
+* `lib/linter/` - this module is the core `Linter` class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
+* `lib/rule-tester/` - this module is `RuleTester` class that is a wrapper around Mocha so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks.
+* `lib/source-code/` - this module is `SourceCode` class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code.
+* `lib/rules/` - this contains built-in rules that verify source code.
+
+## The `cli` object
+
+The `cli` object is the API for the command line interface. Literally, the `bin/eslint.js` file simply passes arguments to the `cli` object and then sets `process.exitCode` to the returned exit code.
+
+The main method is `cli.execute()`, which accepts an array of strings that represent the command line options (as if `process.argv` were passed without the first two arguments). If you want to run ESLint from inside of another program and have it act like the CLI, then `cli` is the object to use.
+
+This object's responsibilities include:
+
+* Interpreting command line arguments
+* Reading from the file system
+* Outputting to the console
+* Outputting to the filesystem
+* Use a formatter
+* Returning the correct exit code
+
+This object may not:
+
+* Call `process.exit()` directly
+* Perform any asynchronous operations
+
+## The `CLIEngine` object
+
+The `CLIEngine` type represents the core functionality of the CLI except that it reads nothing from the command line and doesn't output anything by default. Instead, it accepts many (but not all) of the arguments that are passed into the CLI. It reads both configuration and source files as well as managing the environment that is passed into the `Linter` object.
+
+The main method of the `CLIEngine` is `executeOnFiles()`, which accepts an array of file and directory names to run the linter on.
+
+This object's responsibilities include:
+
+* Managing the execution environment for `Linter`
+* Reading from the file system
+* Reading configuration information from config files (including `.eslintrc` and `package.json`)
+
+This object may not:
+
+* Call `process.exit()` directly
+* Perform any asynchronous operations
+* Output to the console
+* Use formatters
+
+## The `Linter` object
+
+The main method of the `Linter` object is `verify()` and accepts two arguments: the source text to verify and a configuration object (the baked configuration of the given configuration file plus command line options). The method first parses the given text with `espree` (or whatever the configured parser is) and retrieves the AST. The AST is produced with both line/column and range locations which are useful for reporting location of issues and retrieving the source text related to an AST node, respectively.
+
+Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `Linter` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":exit", such as "Identifier:exit" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available.
+
+This object's responsibilities include:
+
+* Inspecting JavaScript code strings
+* Creating an AST for the code
+* Executing rules on the AST
+* Reporting back the results of the execution
+
+This object may not:
+
+* Call `process.exit()` directly
+* Perform any asynchronous operations
+* Use Node.js-specific features
+* Access the file system
+* Call `console.log()` or any other similar method
+
+## Rules
+
+Individual rules are the most specialized part of the ESLint architecture. Rules can do very little, they are simply a set of instructions executed against an AST that is provided. They do get some context information passed in, but the primary responsibility of a rule is to inspect the AST and report warnings.
+
+These objects' responsibilities are:
+
+* Inspect the AST for specific patterns
+* Reporting warnings when certain patterns are found
+
+These objects may not:
+
+* Call `process.exit()` directly
+* Perform any asynchronous operations
+* Use Node.js-specific features
+* Access the file system
+* Call `console.log()` or any other similar method
diff --git a/eslint/docs/src/developer-guide/code-conventions.md b/eslint/docs/src/developer-guide/code-conventions.md
new file mode 100644 (file)
index 0000000..18b7274
--- /dev/null
@@ -0,0 +1,15 @@
+---
+title: Code Conventions
+layout: doc
+---
+
+Code conventions for ESLint are determined by
+[eslint-config-eslint](https://www.npmjs.com/package/eslint-config-eslint).
+
+The rationales for the specific rules in use can be found by looking to the
+project documentation for any given rule. If the rule is one of our own, see
+our own [rule documentation](https://eslint.org/docs/rules/) and otherwise, see
+the documentation of the plugin in which the rule can be found.
+
+If you need to make changes to a `package.json` file, please see the
+[package.json conventions](./package-json-conventions).
diff --git a/eslint/docs/src/developer-guide/code-path-analysis.md b/eslint/docs/src/developer-guide/code-path-analysis.md
new file mode 100644 (file)
index 0000000..5433f27
--- /dev/null
@@ -0,0 +1,552 @@
+---
+title: Code Path Analysis Details
+layout: doc
+
+---
+
+ESLint's rules can use code paths.
+The code path is execution routes of programs.
+It forks/joins at such as `if` statements.
+
+```js
+if (a && b) {
+    foo();
+}
+bar();
+```
+
+![Code Path Example](../assets/images/code-path-analysis/helo.svg)
+
+## Objects
+
+Program is expressed with several code paths.
+A code path is expressed with objects of two kinds: `CodePath` and `CodePathSegment`.
+
+### `CodePath`
+
+`CodePath` expresses whole of one code path.
+This object exists for each function and the global.
+This has references of both the initial segment and the final segments of a code path.
+
+`CodePath` has the following properties:
+
+* `id` (`string`) - A unique string. Respective rules can use `id` to save additional information for each code path.
+* `origin` (`string`) - The reason that the code path was started. May be `"program"`, `"function"`, `"class-field-initializer"`, or `"class-static-block"`.
+* `initialSegment` (`CodePathSegment`) - The initial segment of this code path.
+* `finalSegments` (`CodePathSegment[]`) - The final segments which includes both returned and thrown.
+* `returnedSegments` (`CodePathSegment[]`) - The final segments which includes only returned.
+* `thrownSegments` (`CodePathSegment[]`) - The final segments which includes only thrown.
+* `currentSegments` (`CodePathSegment[]`) - Segments of the current position.
+* `upper` (`CodePath|null`) - The code path of the upper function/global scope.
+* `childCodePaths` (`CodePath[]`) - Code paths of functions this code path contains.
+
+### `CodePathSegment`
+
+`CodePathSegment` is a part of a code path.
+A code path is expressed with plural `CodePathSegment` objects, it's similar to doubly linked list.
+Difference from doubly linked list is what there are forking and merging (the next/prev are plural).
+
+`CodePathSegment` has the following properties:
+
+* `id` (`string`) - A unique string. Respective rules can use `id` to save additional information for each segment.
+* `nextSegments` (`CodePathSegment[]`) - The next segments. If forking, there are two or more. If final, there is nothing.
+* `prevSegments` (`CodePathSegment[]`) - The previous segments. If merging, there are two or more. If initial, there is nothing.
+* `reachable` (`boolean`) - A flag which shows whether or not it's reachable. This becomes `false` when preceded by `return`, `throw`, `break`, or `continue`.
+
+## Events
+
+There are five events related to code paths, and you can define event handlers in rules.
+
+```js
+module.exports = function(context) {
+    return {
+        /**
+         * This is called at the start of analyzing a code path.
+         * In this time, the code path object has only the initial segment.
+         *
+         * @param {CodePath} codePath - The new code path.
+         * @param {ASTNode} node - The current node.
+         * @returns {void}
+         */
+        "onCodePathStart": function(codePath, node) {
+            // do something with codePath
+        },
+
+        /**
+         * This is called at the end of analyzing a code path.
+         * In this time, the code path object is complete.
+         *
+         * @param {CodePath} codePath - The completed code path.
+         * @param {ASTNode} node - The current node.
+         * @returns {void}
+         */
+        "onCodePathEnd": function(codePath, node) {
+            // do something with codePath
+        },
+
+        /**
+         * This is called when a code path segment was created.
+         * It meant the code path is forked or merged.
+         * In this time, the segment has the previous segments and has been
+         * judged reachable or not.
+         *
+         * @param {CodePathSegment} segment - The new code path segment.
+         * @param {ASTNode} node - The current node.
+         * @returns {void}
+         */
+        "onCodePathSegmentStart": function(segment, node) {
+            // do something with segment
+        },
+
+        /**
+         * This is called when a code path segment was left.
+         * In this time, the segment does not have the next segments yet.
+         *
+         * @param {CodePathSegment} segment - The left code path segment.
+         * @param {ASTNode} node - The current node.
+         * @returns {void}
+         */
+        "onCodePathSegmentEnd": function(segment, node) {
+            // do something with segment
+        },
+
+        /**
+         * This is called when a code path segment was looped.
+         * Usually segments have each previous segments when created,
+         * but when looped, a segment is added as a new previous segment into a
+         * existing segment.
+         *
+         * @param {CodePathSegment} fromSegment - A code path segment of source.
+         * @param {CodePathSegment} toSegment - A code path segment of destination.
+         * @param {ASTNode} node - The current node.
+         * @returns {void}
+         */
+        "onCodePathSegmentLoop": function(fromSegment, toSegment, node) {
+            // do something with segment
+        }
+    };
+};
+```
+
+### About `onCodePathSegmentLoop`
+
+This event is always fired when the next segment has existed already.
+That timing is the end of loops mainly.
+
+For Example 1:
+
+```js
+while (a) {
+    a = foo();
+}
+bar();
+```
+
+1. First, the analysis advances to the end of loop.
+
+   ![Loop Event's Example 1](../assets/images/code-path-analysis/loop-event-example-while-1.svg)
+
+2. Second, it creates the looping path.
+   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
+   It fires `onCodePathSegmentLoop` instead.
+
+   ![Loop Event's Example 2](../assets/images/code-path-analysis/loop-event-example-while-2.svg)
+
+3. Last, it advances to the end.
+
+   ![Loop Event's Example 3](../assets/images/code-path-analysis/loop-event-example-while-3.svg)
+
+For example 2:
+
+```js
+for (let i = 0; i < 10; ++i) {
+    foo(i);
+}
+bar();
+```
+
+1. `for` statements are more complex.
+   First, the analysis advances to `ForStatement.update`.
+   The `update` segment is hovered at first.
+
+   ![Loop Event's Example 1](../assets/images/code-path-analysis/loop-event-example-for-1.svg)
+
+2. Second, it advances to `ForStatement.body`.
+   Of course the `body` segment is preceded by the `test` segment.
+   It keeps the `update` segment hovering.
+
+   ![Loop Event's Example 2](../assets/images/code-path-analysis/loop-event-example-for-2.svg)
+
+3. Third, it creates the looping path from `body` segment to `update` segment.
+   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
+   It fires `onCodePathSegmentLoop` instead.
+
+   ![Loop Event's Example 3](../assets/images/code-path-analysis/loop-event-example-for-3.svg)
+
+4. Fourth, also it creates the looping path from `update` segment to `test` segment.
+   At this time, the next segment has existed already, so the `onCodePathSegmentStart` event is not fired.
+   It fires `onCodePathSegmentLoop` instead.
+
+   ![Loop Event's Example 4](../assets/images/code-path-analysis/loop-event-example-for-4.svg)
+
+5. Last, it advances to the end.
+
+   ![Loop Event's Example 5](../assets/images/code-path-analysis/loop-event-example-for-5.svg)
+
+## Usage Examples
+
+### To check whether or not this is reachable
+
+```js
+function isReachable(segment) {
+    return segment.reachable;
+}
+
+module.exports = function(context) {
+    var codePathStack = [];
+
+    return {
+        // Stores CodePath objects.
+        "onCodePathStart": function(codePath) {
+            codePathStack.push(codePath);
+        },
+        "onCodePathEnd": function(codePath) {
+            codePathStack.pop();
+        },
+
+        // Checks reachable or not.
+        "ExpressionStatement": function(node) {
+            var codePath = codePathStack[codePathStack.length - 1];
+
+            // Checks the current code path segments.
+            if (!codePath.currentSegments.some(isReachable)) {
+                context.report({message: "Unreachable!", node: node});
+            }
+        }
+    };
+};
+```
+
+See Also:
+[no-unreachable](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-unreachable.js),
+[no-fallthrough](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-fallthrough.js),
+[consistent-return](https://github.com/eslint/eslint/blob/HEAD/lib/rules/consistent-return.js)
+
+### To check state of a code path
+
+This example is checking whether or not the parameter `cb` is called in every path.
+Instances of `CodePath` and `CodePathSegment` are shared to every rule.
+So a rule must not modify those instances.
+Please use a map of information instead.
+
+```js
+function hasCb(node, context) {
+    if (node.type.indexOf("Function") !== -1) {
+        return context.getDeclaredVariables(node).some(function(v) {
+            return v.type === "Parameter" && v.name === "cb";
+        });
+    }
+    return false;
+}
+
+function isCbCalled(info) {
+    return info.cbCalled;
+}
+
+module.exports = function(context) {
+    var funcInfoStack = [];
+    var segmentInfoMap = Object.create(null);
+
+    return {
+        // Checks `cb`.
+        "onCodePathStart": function(codePath, node) {
+            funcInfoStack.push({
+                codePath: codePath,
+                hasCb: hasCb(node, context)
+            });
+        },
+        "onCodePathEnd": function(codePath, node) {
+            funcInfoStack.pop();
+
+            // Checks `cb` was called in every paths.
+            var cbCalled = codePath.finalSegments.every(function(segment) {
+                var info = segmentInfoMap[segment.id];
+                return info.cbCalled;
+            });
+
+            if (!cbCalled) {
+                context.report({
+                    message: "`cb` should be called in every path.",
+                    node: node
+                });
+            }
+        },
+
+        // Manages state of code paths.
+        "onCodePathSegmentStart": function(segment) {
+            var funcInfo = funcInfoStack[funcInfoStack.length - 1];
+
+            // Ignores if `cb` doesn't exist.
+            if (!funcInfo.hasCb) {
+                return;
+            }
+
+            // Initialize state of this path.
+            var info = segmentInfoMap[segment.id] = {
+                cbCalled: false
+            };
+
+            // If there are the previous paths, merges state.
+            // Checks `cb` was called in every previous path.
+            if (segment.prevSegments.length > 0) {
+                info.cbCalled = segment.prevSegments.every(isCbCalled);
+            }
+        },
+
+        // Checks reachable or not.
+        "CallExpression": function(node) {
+            var funcInfo = funcInfoStack[funcInfoStack.length - 1];
+
+            // Ignores if `cb` doesn't exist.
+            if (!funcInfo.hasCb) {
+                return;
+            }
+
+            // Sets marks that `cb` was called.
+            var callee = node.callee;
+            if (callee.type === "Identifier" && callee.name === "cb") {
+                funcInfo.codePath.currentSegments.forEach(function(segment) {
+                    var info = segmentInfoMap[segment.id];
+                    info.cbCalled = true;
+                });
+            }
+        }
+    };
+};
+```
+
+See Also:
+[constructor-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/constructor-super.js),
+[no-this-before-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-this-before-super.js)
+
+## Code Path Examples
+
+### Hello World
+
+```js
+console.log("Hello world!");
+```
+
+![Hello World](../assets/images/code-path-analysis/example-hello-world.svg)
+
+### `IfStatement`
+
+```js
+if (a) {
+    foo();
+} else {
+    bar();
+}
+```
+
+![`IfStatement`](../assets/images/code-path-analysis/example-ifstatement.svg)
+
+### `IfStatement` (chain)
+
+```js
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (c) {
+    hoge();
+}
+```
+
+![`IfStatement` (chain)](../assets/images/code-path-analysis/example-ifstatement-chain.svg)
+
+### `SwitchStatement`
+
+```js
+switch (a) {
+    case 0:
+        foo();
+        break;
+
+    case 1:
+    case 2:
+        bar();
+        // fallthrough
+
+    case 3:
+        hoge();
+        break;
+}
+```
+
+![`SwitchStatement`](../assets/images/code-path-analysis/example-switchstatement.svg)
+
+### `SwitchStatement` (has `default`)
+
+```js
+switch (a) {
+    case 0:
+        foo();
+        break;
+
+    case 1:
+    case 2:
+        bar();
+        // fallthrough
+
+    case 3:
+        hoge();
+        break;
+
+    default:
+        fuga();
+        break;
+}
+```
+
+![`SwitchStatement` (has `default`)](../assets/images/code-path-analysis/example-switchstatement-has-default.svg)
+
+### `TryStatement` (try-catch)
+
+```js
+try {
+    foo();
+    if (a) {
+        throw new Error();
+    }
+    bar();
+} catch (err) {
+    hoge(err);
+}
+last();
+```
+
+It creates the paths from `try` block to `catch` block at:
+
+* `throw` statements.
+* The first throwable node (e.g. a function call) in the `try` block.
+* The end of the `try` block.
+
+![`TryStatement` (try-catch)](../assets/images/code-path-analysis/example-trystatement-try-catch.svg)
+
+### `TryStatement` (try-finally)
+
+```js
+try {
+    foo();
+    bar();
+} finally {
+    fuga();
+}
+last();
+```
+
+If there is not `catch` block, `finally` block has two current segments.
+At this time, `CodePath.currentSegments.length` is `2`.
+One is the normal path, and another is the leaving path (`throw` or `return`).
+
+![`TryStatement` (try-finally)](../assets/images/code-path-analysis/example-trystatement-try-finally.svg)
+
+### `TryStatement` (try-catch-finally)
+
+```js
+try {
+    foo();
+    bar();
+} catch (err) {
+    hoge(err);
+} finally {
+    fuga();
+}
+last();
+```
+
+![`TryStatement` (try-catch-finally)](../assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg)
+
+### `WhileStatement`
+
+```js
+while (a) {
+    foo();
+    if (b) {
+        continue;
+    }
+    bar();
+}
+```
+
+![`WhileStatement`](../assets/images/code-path-analysis/example-whilestatement.svg)
+
+### `DoWhileStatement`
+
+```js
+do {
+    foo();
+    bar();
+} while (a);
+```
+
+![`DoWhileStatement`](../assets/images/code-path-analysis/example-dowhilestatement.svg)
+
+### `ForStatement`
+
+```js
+for (let i = 0; i < 10; ++i) {
+    foo();
+    if (b) {
+        break;
+    }
+    bar();
+}
+```
+
+![`ForStatement`](../assets/images/code-path-analysis/example-forstatement.svg)
+
+### `ForStatement` (for ever)
+
+```js
+for (;;) {
+    foo();
+}
+bar();
+```
+
+![`ForStatement` (for ever)](../assets/images/code-path-analysis/example-forstatement-for-ever.svg)
+
+### `ForInStatement`
+
+```js
+for (let key in obj) {
+    foo(key);
+}
+```
+
+![`ForInStatement`](../assets/images/code-path-analysis/example-forinstatement.svg)
+
+### When there is a function
+
+```js
+function foo(a) {
+    if (a) {
+        return;
+    }
+    bar();
+}
+
+foo(false);
+```
+
+It creates two code paths.
+
+* The global's
+
+  ![When there is a function](../assets/images/code-path-analysis/example-when-there-is-a-function-g.svg)
+
+* The function's
+
+  ![When there is a function](../assets/images/code-path-analysis/example-when-there-is-a-function-f.svg)
diff --git a/eslint/docs/src/developer-guide/contributing/changes.md b/eslint/docs/src/developer-guide/contributing/changes.md
new file mode 100644 (file)
index 0000000..264d1a9
--- /dev/null
@@ -0,0 +1,21 @@
+---
+title: Change Requests
+layout: doc
+
+---
+
+If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) on GitHub. Be sure to include the following information:
+
+1. The version of ESLint you are using.
+2. The problem you want to solve.
+3. Your take on the correct solution to problem.
+
+If you're requesting a change to a rule, it's helpful to include this information as well:
+
+1. What you did.
+1. What you would like to happen.
+1. What actually happened.
+
+Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues.
+
+**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
diff --git a/eslint/docs/src/developer-guide/contributing/index.md b/eslint/docs/src/developer-guide/contributing/index.md
new file mode 100644 (file)
index 0000000..a5dfce7
--- /dev/null
@@ -0,0 +1,50 @@
+---
+title: Contributing
+layout: doc
+eleventyNavigation:
+    key: contributing
+    parent: developer guide
+    title: Contributing
+    order: 10
+
+---
+
+One of the great things about open source projects is that anyone can contribute in any number of meaningful ways. ESLint couldn't exist without the help of the many contributors it's had since the project began, and we want you to feel like you can contribute and make a difference as well.
+
+This guide is intended for anyone who wants to contribute to an ESLint project. Please read it carefully as it answers a lot of the questions many newcomers have when first working with our projects.
+
+## Read the [Code of Conduct](https://eslint.org/conduct)
+
+ESLint welcomes contributions from everyone and adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct). We kindly request that you read over our code of conduct before contributing.
+
+## [Bug Reporting](reporting-bugs)
+
+Think you found a problem? We'd love to hear about it. This section explains how to submit a bug, the type of information we need to properly verify it, and the overall process.
+
+## Proposing a [New Rule](new-rules)
+
+We get a lot of proposals for new rules in ESLint. This section explains how we determine which rules are accepted and what information you should provide to help us evaluate your proposal.
+
+## Proposing a [Rule Change](rule-changes)
+
+Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals.
+
+## Requesting a [Change](changes)
+
+If you'd like to request a change other than a bug fix or new rule, this section explains that process.
+
+## Reporting a security vulnerability
+
+To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint).
+
+## [Working on Issues](working-on-issues)
+
+Have some extra time and want to contribute? This section talks about the process of working on issues.
+
+## Submitting a [Pull Request](pull-requests)
+
+We're always looking for contributions from the community. This section explains the requirements for pull requests and the process of contributing code.
+
+## Signing the CLA
+
+In order to submit code or documentation to an ESLint project, you will need to electronically sign our Contributor License Agreement. The CLA is the commonly used Apache-style template, and is you giving us permission to use your contribution. You only need to sign the CLA once for any OpenJS Foundation projects that use EasyCLA. You will be asked to sign the CLA in the first pull request you open.
diff --git a/eslint/docs/src/developer-guide/contributing/new-rules.md b/eslint/docs/src/developer-guide/contributing/new-rules.md
new file mode 100644 (file)
index 0000000..f3c859a
--- /dev/null
@@ -0,0 +1,46 @@
+---
+title: New Rules
+layout: doc
+
+---
+
+ESLint is all about rules. For most of the project's lifetime, we've had over 200 rules, and that list continues to grow. However, we can't just accept any proposed rule because all rules need to work cohesively together. As such, we have some guidelines around which rules can be part of the ESLint core and which are better off as custom rules and plugins.
+
+**Note:** As of 2020, we only accept rules related to new ECMAScript features. We prefer that new rules be implemented in plugins.
+
+## Core Rule Guidelines
+
+In general, ESLint core rules must be:
+
+1. **Widely applicable.** The rules we distribute need to be of importance to a large number of developers. Individual preferences for uncommon patterns are not supported.
+1. **Generic.** Rules cannot be so specific that users will have trouble understanding when to use them. A rule is typically too specific if describing what it does requires more than two "and"s (if a and b and c and d, then this rule warns).
+1. **Atomic.** Rules must function completely on their own. Rules are expressly forbidden from knowing about the state or presence of other rules.
+1. **Unique.** No two rules can produce the same warning. Overlapping rules confuse end users and there is an expectation that core ESLint rules do not overlap.
+1. **Library agnostic.** Rules must be based solely on JavaScript runtime environments and not on specific libraries or frameworks. For example, core rules shouldn't only apply if you're using jQuery but we may have some rules that apply only if you're using Node.js (a runtime).
+1. **No conflicts.** No rule must directly conflict with another rule. For example, if we have a rule requiring semicolons, we cannot also have a rule disallowing semicolons (which is why we have one rule, `semi`, that does both).
+
+Even though these are the formal criteria for inclusion, each rule is evaluated on its own basis.
+
+## Proposing a Rule
+
+If you want to propose a new rule, please see how to [create a pull request](/docs/developer-guide/contributing/pull-requests) or submit an issue by filling out a [new rule template](https://github.com/eslint/eslint/issues/new/choose).
+
+We need all of this information in order to determine whether or not the rule is a good core rule candidate.
+
+## Accepting a Rule
+
+In order for a rule to be accepted in the ESLint core, it must:
+
+1. Fulfill all the criteria listed in the "Core Rule Guidelines" section
+1. Have an ESLint team member champion inclusion of the rule
+1. Be related to an ECMAScript feature that has reached stage 4 in the preceding 12 months
+
+Keep in mind that we have over 200 rules, and that is daunting both for end users and the ESLint team (who has to maintain them). As such, any new rules must be deemed of high importance to be considered for inclusion in ESLint.
+
+## Implementation is Your Responsibility
+
+The ESLint team doesn't implement new rules that are suggested by users because we have a limited number of people and need to focus on the overall roadmap. Once a rule is accepted, you are responsible for implementing and documenting the rule. You may, alternately, recruit another person to help you implement the rule. The ESLint team member who championed the rule is your resource to help guide you through the rest of this process.
+
+## Alternative: Creating Your Own Rules
+
+Remember that ESLint is completely pluggable, which means you can create your own rules and distribute them using plugins. We did this on purpose because we don't want to be the gatekeepers for all possible rules. Even if we don't accept a rule into the core, that doesn't mean you can't have the exact rule that you want. See the [working with rules](../working-with-rules) and [working with plugins](../working-with-plugins) documentation for more information.
diff --git a/eslint/docs/src/developer-guide/contributing/pull-requests.md b/eslint/docs/src/developer-guide/contributing/pull-requests.md
new file mode 100644 (file)
index 0000000..2eece34
--- /dev/null
@@ -0,0 +1,194 @@
+---
+title: Pull Requests
+layout: doc
+
+---
+
+If you want to contribute to an ESLint repo, please use a GitHub pull request. This is the fastest way for us to evaluate your code and to merge it into the code base. Please don't file an issue with snippets of code. Doing so means that we need to manually merge the changes in and update any appropriate tests. That decreases the likelihood that your code is going to get included in a timely manner. Please use pull requests.
+
+## Getting Started
+
+If you'd like to work on a pull request and you've never submitted code before, follow these steps:
+
+1. Set up a [development environment](../development-environment).
+1. If you want to implement a breaking change or a change to the core, ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](working-on-issues). Bug fixes, documentation changes, and other pull requests do not require an issue.
+
+After that, you're ready to start working on code.
+
+## Working with Code
+
+The process of submitting a pull request is fairly straightforward and generally follows the same pattern each time:
+
+1. [Create a new branch](#step1)
+2. [Make your changes](#step2)
+3. [Rebase onto upstream](#step3)
+4. [Run the tests](#step4)
+5. [Double check your submission](#step5)
+6. [Push your changes](#step6)
+7. [Submit the pull request](#step7)
+
+Details about each step are found below.
+
+### Step 1: Create a new branch<a name="step1"></a>
+
+The first step to sending a pull request is to create a new branch in your ESLint fork. Give the branch a descriptive name that describes what it is you're fixing, such as:
+
+```shell
+git checkout -b issue1234
+```
+
+You should do all of your development for the issue in this branch.
+
+**Note:** Do not combine fixes for multiple issues into one branch. Use a separate branch for each issue you're working on.
+
+### Step 2: Make your changes<a name="step2"></a>
+
+Make the changes to the code and tests, following the [code conventions](../code-conventions) as you go. Once you have finished, commit the changes to your branch:
+
+```shell
+git add -A
+git commit
+```
+
+All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. Here's an example commit message:
+
+```txt
+tag: Short description of what you did
+
+Longer description here if necessary
+
+Fixes #1234
+```
+
+The first line of the commit message (the summary) must have a specific format. This format is checked by our build tools.
+
+The `tag` is one of the following:
+
+* `fix` - for a bug fix.
+* `feat` - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
+* `fix!` - for a backwards-incompatible bug fix.
+* `feat!` - for a backwards-incompatible enhancement or feature.
+* `docs` - changes to documentation only.
+* `chore` - for changes that aren't user-facing.
+* `build` - changes to build process only.
+* `refactor` - a change that doesn't affect APIs or user experience.
+* `test` - just changes to test files.
+* `ci` - changes to our CI configuration files and scripts.
+* `perf` - a code change that improves performance.
+
+Use the [labels of the issue you are working on](working-on-issues#issue-labels) to determine the best tag.
+
+The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned in the body of the commit message in the format `Fixes #1234`. If the commit doesn't completely fix the issue, then use `Refs #1234` instead of `Fixes #1234`.
+
+Here are some good commit message summary examples:
+
+```txt
+build: Update Travis to only test Node 0.10
+fix: Semi rule incorrectly flagging extra semicolon
+chore: Upgrade Esprima to 1.2, switch to using comment attachment
+```
+
+The commit message format is important because these messages are used to create a changelog for each release. The tag and issue number help to create more consistent and useful changelogs.
+
+### Step 3: Rebase onto upstream<a name="step3"></a>
+
+Before you send the pull request, be sure to rebase onto the upstream source. This ensures your code is running on the latest available code.
+
+```shell
+git fetch upstream
+git rebase upstream/main
+```
+
+### Step 4: Run the tests<a name="step4"></a>
+
+After rebasing, be sure to run all of the tests once again to make sure nothing broke:
+
+```shell
+npm test
+```
+
+If there are any failing tests, update your code until all tests pass.
+
+### Step 5: Double check your submission<a name="step5"></a>
+
+With your code ready to go, this is a good time to double-check your submission to make sure it follows our conventions. Here are the things to check:
+
+* Make sure your commit is formatted correctly.
+* The pull request must have a description. The description should explain what you did and how its effects can be seen.
+* The commit message is properly formatted.
+* The change introduces no functional regression. Be sure to run `npm test` to verify your changes before submitting a pull request.
+* Make separate pull requests for unrelated changes. Large pull requests with multiple unrelated changes may be closed without merging.
+* All changes must be accompanied by tests, even if the feature you're working on previously had no tests.
+* All user-facing changes must be accompanied by appropriate documentation.
+* Follow the [Code Conventions](../code-conventions).
+
+### Step 6: Push your changes<a name="step6"></a>
+
+Next, push your changes to your clone:
+
+```shell
+git push origin issue1234
+```
+
+If you are unable to push because some references are old, do a forced push instead:
+
+```shell
+git push -f origin issue1234
+```
+
+### Step 7: Send the pull request<a name="step7"></a>
+
+Now you're ready to send the pull request. Go to your ESLint fork and then follow the [GitHub documentation](https://help.github.com/articles/creating-a-pull-request) on how to send a pull request.
+
+In order to submit code or documentation to an ESLint project, you’ll be asked to sign our CLA when you send your first pull request. (Read more about the Open JS Foundation CLA process at <https://cla.openjsf.org/>.)
+
+## Following Up
+
+Once your pull request is sent, it's time for the team to review it. As such, please make sure to:
+
+1. Monitor the status of the Travis CI build for your pull request. If it fails, please investigate why. We cannot merge pull requests that fail Travis for any reason.
+1. Respond to comments left on the pull request from team members. Remember, we want to help you land your code, so please be receptive to our feedback.
+1. We may ask you to make changes, rebase, or squash your commits.
+
+### Updating the Commit Message
+
+If your commit message is in the incorrect format, you'll be asked to update it. You can do so via:
+
+```shell
+git commit --amend
+```
+
+This will open up your editor so you can make changes. After that, you'll need to do a forced push to your branch:
+
+```shell
+git push origin issue1234 -f
+```
+
+### Updating the Code
+
+If we ask you to make code changes, there's no need to close the pull request and create a new one. Just go back to the branch on your fork and make your changes. Then, when you're ready, you can add your changes into the branch:
+
+```shell
+git add -A
+git commit
+git push origin issue1234
+```
+
+When updating the code, it's usually better to add additional commits to your branch rather than amending the original commit, because reviewers can easily tell which changes were made in response to a particular review. When we merge pull requests, we will squash all the commits from your branch into a single commit on the `main` branch.
+
+The commit messages in subsequent commits do not need to be in any specific format because these commits do not show up in the changelog.
+
+### Rebasing
+
+If your code is out-of-date, we might ask you to rebase. That means we want you to apply your changes on top of the latest upstream code. Make sure you have set up a [development environment](../development-environment) and then you can rebase using these commands:
+
+```shell
+git fetch upstream
+git rebase upstream/main
+```
+
+You might find that there are merge conflicts when you attempt to rebase. Please [resolve the conflicts](https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/) and then do a forced push to your branch:
+
+```shell
+git push origin issue1234 -f
+```
diff --git a/eslint/docs/src/developer-guide/contributing/reporting-bugs.md b/eslint/docs/src/developer-guide/contributing/reporting-bugs.md
new file mode 100644 (file)
index 0000000..fb6ae0f
--- /dev/null
@@ -0,0 +1,11 @@
+---
+title: Reporting Bugs
+layout: doc
+
+---
+
+If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) or a [pull request](/docs/developer-guide/contributing/pull-requests) on GitHub.
+
+Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues.
+
+**Note:** If you just have a question that won't necessarily result in a change to ESLint, such as asking how something works or how to contribute, please use the [mailing list](https://groups.google.com/group/eslint) or [chat](https://eslint.org/chat) instead of filing an issue.
diff --git a/eslint/docs/src/developer-guide/contributing/rule-changes.md b/eslint/docs/src/developer-guide/contributing/rule-changes.md
new file mode 100644 (file)
index 0000000..b96d668
--- /dev/null
@@ -0,0 +1,25 @@
+---
+title: Rule Changes
+layout: doc
+
+---
+
+Occasionally, a core ESLint rule needs to be changed. This is not necessarily a bug, but rather, an enhancement that makes a rule more configurable. In those situations, we will consider making changes to rules.
+
+## Proposing a Rule Change
+
+To propose a change to an existing rule, [create a pull request](/docs/developer-guide/contributing/pull-requests) or [new issue](https://github.com/eslint/eslint/issues/new/choose) and fill out the template.
+
+We need all of this information in order to determine whether or not the change is a good candidate for inclusion.
+
+## Accepting a Rule Change
+
+In order for a rule change to be accepted into ESLint, it must:
+
+1. Adhere to the [Core Rule Guidelines](new-rules#core-rule-guidelines)
+1. Have an ESLint team member champion the change
+1. Be important enough that rule is deemed incomplete without this change
+
+## Implementation is Your Responsibility
+
+The ESLint team doesn't implement rule changes that are suggested by users because we have a limited number of people and need to focus on the overall roadmap. Once a rule change is accepted, you are responsible for implementing and documenting it. You may, alternately, recruit another person to help you. The ESLint team member who championed the rule is your resource to help guide you through the rest of this process.
diff --git a/eslint/docs/src/developer-guide/contributing/working-on-issues.md b/eslint/docs/src/developer-guide/contributing/working-on-issues.md
new file mode 100644 (file)
index 0000000..75322e2
--- /dev/null
@@ -0,0 +1,40 @@
+---
+title: Working on Issues
+layout: doc
+
+---
+
+Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all of the things we plan on doing as well as suggestions from the community. Before starting to work on an issue, be sure you read through the rest of this page.
+
+## Issue Labels
+
+We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are:
+
+1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`.
+1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](https://eslint.org/docs/maintainer-guide/issues.html#types-of-issues).
+1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest:
+
+    1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible.
+    1. **Documentation** - documentation issues are a type of bug in that they actively affect current users. As such, we want to address documentation issues as quickly as possible.
+    1. **Features** - new functionality that will aid users in the future.
+    1. **Enhancements** - requested improvements for existing functionality.
+    1. **Other** - anything else.
+
+    Some issues have had monetary rewards attached to them. Those are labeled `bounty`. Bounties are assigned via [BountySource](https://www.bountysource.com/teams/eslint/issues).
+
+## Starting Work
+
+If you're going to work on an issue, please add a comment to that issue saying so and indicating when you think you will complete it. It will help us to avoid duplication of effort. Some examples of good comments are:
+
+* "I'll take a look at this over the weekend."
+* "I'm going to do this, give me two weeks."
+* "Working on this" (as in, I'm working on it right now)
+
+If an issue has already been claimed by someone, please be respectful of that person's desire to complete the work and don't work on it unless you verify that they are no longer interested.
+
+If you find you can't finish the work, then simply add a comment letting people know, for example:
+
+* "Sorry, it looks like I don't have time to do this."
+* "I thought I knew enough to fix this, but it turns out I don't."
+
+No one will blame you for backing out of an issue if you are unable to complete it. We just want to keep the process moving along as efficiently as possible.
diff --git a/eslint/docs/src/developer-guide/development-environment.md b/eslint/docs/src/developer-guide/development-environment.md
new file mode 100644 (file)
index 0000000..ad21740
--- /dev/null
@@ -0,0 +1,101 @@
+---
+title: Development Environment
+layout: doc
+eleventyNavigation:
+    key: set up a development environment
+    parent: developer guide
+    title: Set Up a Development Environment
+    order: 2
+
+---
+
+ESLint has a very lightweight development environment that makes updating code fast and easy. This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.
+
+## Step 1: Install Node.js
+
+Go to <https://nodejs.org/> to download and install the latest stable version for your operating system.
+
+Most of the installers already come with [npm](https://www.npmjs.com/) but if for some reason npm doesn't work on your system, you can install it manually using the instructions on the site.
+
+## Step 2: Fork and checkout your own ESLint repository
+
+Go to <https://github.com/eslint/eslint> and click the "Fork" button. Follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) for forking and cloning.
+
+Once you've cloned the repository, run `npm install` to get all the necessary dependencies:
+
+```shell
+cd eslint
+npm install
+```
+
+You must be connected to the Internet for this step to work. You'll see a lot of utilities being downloaded.
+
+## Step 3: Add the upstream source
+
+The *upstream source* is the main ESLint repository where active development happens. While you won't have push access to upstream, you will have pull access, allowing you to pull in the latest code whenever you want.
+
+To add the upstream source for ESLint, run the following in your repository:
+
+```shell
+git remote add upstream git@github.com:eslint/eslint.git
+```
+
+Now, the remote `upstream` points to the upstream source.
+
+## Step 4: Install the Yeoman Generator
+
+[Yeoman](http://yeoman.io) is a scaffold generator that ESLint uses to help streamline development of new rules. If you don't already have Yeoman installed, you can install it via npm:
+
+```shell
+npm install -g yo
+```
+
+Then, you can install the ESLint Yeoman generator:
+
+```shell
+npm install -g generator-eslint
+```
+
+Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it.
+
+## Step 5: Run the tests
+
+Running the tests is the best way to ensure you have correctly set up your development environment. Make sure you're in the `eslint` directory and run:
+
+```shell
+npm test
+```
+
+The testing takes a few minutes to complete. If any tests fail, that likely means one or more parts of the environment setup didn't complete correctly. The upstream tests always pass.
+
+## Reference Information
+
+### Workflow
+
+Once you have your development environment installed, you can make and submit changes to the ESLint source files. Doing this successfully requires careful adherence to our [pull-request submission workflow](contributing/pull-requests).
+
+### Build Scripts
+
+ESLint has several build scripts that help with various parts of development.
+
+#### npm test
+
+The primary script to use is `npm test`, which does several things:
+
+1. Lints all JavaScript (including tests) and JSON
+1. Runs all tests on Node.js
+1. Checks code coverage targets
+1. Generates `build/eslint.js` for use in a browser
+1. Runs a subset of tests in PhantomJS
+
+Be sure to run this after making changes and before sending a pull request with your changes.
+
+**Note:** The full code coverage report is output into `/coverage`.
+
+#### npm run lint
+
+Runs just the JavaScript and JSON linting on the repository.
+
+#### npm run webpack
+
+Generates `build/eslint.js`, a version of ESLint for use in the browser.
diff --git a/eslint/docs/src/developer-guide/index.md b/eslint/docs/src/developer-guide/index.md
new file mode 100644 (file)
index 0000000..a682ac2
--- /dev/null
@@ -0,0 +1,55 @@
+---
+title: Developer Guide
+layout: doc
+eleventyNavigation:
+    key: developer guide 
+    title: Developer Guide 
+    order: 2
+
+---
+
+This guide is intended for those who wish to:
+
+* Contribute code to ESLint
+* Create their own rules for ESLint
+
+In order to work with ESLint as a developer, it's recommended that:
+
+* You know JavaScript, since ESLint is written in JavaScript.
+* You have some familiarity with Node.js, since ESLint runs on it.
+* You're comfortable with command-line programs.
+* You understand unit tests and why they're important.
+
+If that sounds like you, then continue reading to get started.
+
+## Section 1: Get the [Source Code](source-code)
+
+Before you can get started, you'll need to get a copy of the ESLint source code. This section explains how to do that and a little about the source code structure.
+
+## Section 2: Set up a [Development Environment](development-environment)
+
+Developing for ESLint is a bit different than running it on the command line. This section shows you how to set up a development environment and get you ready to write code.
+
+## Section 3: Run the [Unit Tests](unit-tests)
+
+There are a lot of unit tests included with ESLint to make sure that we're keeping on top of code quality. This section explains how to run the unit tests.
+
+## Section 4: [Working with Rules](working-with-rules)
+
+You're finally ready to start working with rules. You may want to fix an existing rule or create a new one. This section explains how to do all of that.
+
+## Section 5: [Working with Plugins](working-with-plugins)
+
+You've developed library-specific rules for ESLint and you want to share them with the community. You can publish an ESLint plugin on npm.
+
+## Section 6: [Working with Custom Parsers](working-with-custom-parsers)
+
+If you aren't going to use the default parser of ESLint, this section explains about using custom parsers.
+
+## Section 7: [Node.js API](nodejs-api)
+
+If you're interested in writing a tool that uses ESLint, then you can use the Node.js API to get programmatic access to functionality.
+
+## Section 8: [Contributing](contributing/)
+
+Once you've made changes that you want to share with the community, the next step is to submit those changes back via a pull request.
diff --git a/eslint/docs/src/developer-guide/nodejs-api.md b/eslint/docs/src/developer-guide/nodejs-api.md
new file mode 100644 (file)
index 0000000..0b8d842
--- /dev/null
@@ -0,0 +1,940 @@
+---
+title: Node.js API
+layout: doc
+eleventyNavigation:
+    key: node.js api
+    parent: developer guide
+    title: Node.js API
+    order: 9
+
+---
+
+While ESLint is designed to be run on the command line, it's possible to use ESLint programmatically through the Node.js API. The purpose of the Node.js API is to allow plugin and tool authors to use the ESLint functionality directly, without going through the command line interface.
+
+**Note:** Use undocumented parts of the API at your own risk. Only those parts that are specifically mentioned in this document are approved for use and will remain stable and reliable. Anything left undocumented is unstable and may change or be removed at any point.
+
+## ESLint class
+
+The `ESLint` class is the primary class to use in Node.js applications.
+
+This class depends on the Node.js `fs` module and the file system, so you cannot use it in browsers. If you want to lint code on browsers, use the [Linter](#linter) class instead.
+
+Here's a simple example of using the `ESLint` class:
+
+```js
+const { ESLint } = require("eslint");
+
+(async function main() {
+  // 1. Create an instance.
+  const eslint = new ESLint();
+
+  // 2. Lint files.
+  const results = await eslint.lintFiles(["lib/**/*.js"]);
+
+  // 3. Format the results.
+  const formatter = await eslint.loadFormatter("stylish");
+  const resultText = formatter.format(results);
+
+  // 4. Output it.
+  console.log(resultText);
+})().catch((error) => {
+  process.exitCode = 1;
+  console.error(error);
+});
+```
+
+And here is an example that autofixes lint problems:
+
+```js
+const { ESLint } = require("eslint");
+
+(async function main() {
+  // 1. Create an instance with the `fix` option.
+  const eslint = new ESLint({ fix: true });
+
+  // 2. Lint files. This doesn't modify target files.
+  const results = await eslint.lintFiles(["lib/**/*.js"]);
+
+  // 3. Modify the files with the fixed code.
+  await ESLint.outputFixes(results);
+
+  // 4. Format the results.
+  const formatter = await eslint.loadFormatter("stylish");
+  const resultText = formatter.format(results);
+
+  // 5. Output it.
+  console.log(resultText);
+})().catch((error) => {
+  process.exitCode = 1;
+  console.error(error);
+});
+```
+
+### ◆ new ESLint(options)
+
+```js
+const eslint = new ESLint(options);
+```
+
+Create a new `ESLint` instance.
+
+#### Parameters
+
+The `ESLint` constructor takes an `options` object. If you omit the `options` object then it uses default values for all options. The `options` object has the following properties.
+
+##### File Enumeration
+
+* `options.cwd` (`string`)<br>
+  Default is `process.cwd()`. The working directory. This must be an absolute path.
+* `options.errorOnUnmatchedPattern` (`boolean`)<br>
+  Default is `true`. Unless set to `false`, the [`eslint.lintFiles()`][eslint-lintfiles] method will throw an error when no target files are found.
+* `options.extensions` (`string[] | null`)<br>
+  Default is `null`. If you pass directory paths to the [`eslint.lintFiles()`][eslint-lintfiles] method, ESLint checks the files in those directories that have the given extensions. For example, when passing the `src/` directory and `extensions` is `[".js", ".ts"]`, ESLint will lint `*.js` and `*.ts` files in `src/`. If `extensions` is `null`, ESLint checks `*.js` files and files that match `overrides[].files` patterns in your configuration.<br>**Note:** This option only applies when you pass directory paths to the [`eslint.lintFiles()`][eslint-lintfiles] method. If you pass glob patterns like `lib/**/*`, ESLint will lint all files matching the glob pattern regardless of extension.
+* `options.globInputPaths` (`boolean`)<br>
+  Default is `true`. If `false` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method doesn't interpret glob patterns.
+* `options.ignore` (`boolean`)<br>
+  Default is `true`. If `false` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method doesn't respect `.eslintignore` files or `ignorePatterns` in your configuration.
+* `options.ignorePath` (`string | null`)<br>
+  Default is `null`. The path to a file ESLint uses instead of `$CWD/.eslintignore`. If a path is present and the file doesn't exist, this constructor will throw an error.
+
+##### Linting
+
+* `options.allowInlineConfig` (`boolean`)<br>
+  Default is `true`. If `false` is present, ESLint suppresses directive comments in source code. If this option is `false`, it overrides the `noInlineConfig` setting in your configurations.
+* `options.baseConfig` (`ConfigData | null`)<br>
+  Default is `null`. [Configuration object], extended by all configurations used with this instance. You can use this option to define the default settings that will be used if your configuration files don't configure it.
+* `options.overrideConfig` (`ConfigData | null`)<br>
+  Default is `null`. [Configuration object], overrides all configurations used with this instance. You can use this option to define the settings that will be used even if your configuration files configure it.
+* `options.overrideConfigFile` (`string | null`)<br>
+  Default is `null`. The path to a configuration file, overrides all configurations used with this instance. The `options.overrideConfig` option is applied after this option is applied.
+* `options.plugins` (`Record<string, Plugin> | null`)<br>
+  Default is `null`. The plugin implementations that ESLint uses for the `plugins` setting of your configuration. This is a map-like object. Those keys are plugin IDs and each value is implementation.
+* `options.reportUnusedDisableDirectives` (`"error" | "warn" | "off" | null`)<br>
+  Default is `null`. The severity to report unused eslint-disable directives. If this option is a severity, it overrides the `reportUnusedDisableDirectives` setting in your configurations.
+* `options.resolvePluginsRelativeTo` (`string` | `null`)<br>
+  Default is `null`. The path to a directory where plugins should be resolved from. If `null` is present, ESLint loads plugins from the location of the configuration file that contains the plugin setting. If a path is present, ESLint loads all plugins from there.
+* `options.rulePaths` (`string[]`)<br>
+  Default is `[]`. An array of paths to directories to load custom rules from.
+* `options.useEslintrc` (`boolean`)<br>
+  Default is `true`. If `false` is present, ESLint doesn't load configuration files (`.eslintrc.*` files). Only the configuration of the constructor options is valid.
+
+##### Autofix
+
+* `options.fix` (`boolean | (message: LintMessage) => boolean`)<br>
+  Default is `false`. If `true` is present, the [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods work in autofix mode. If a predicate function is present, the methods pass each lint message to the function, then use only the lint messages for which the function returned `true`.
+* `options.fixTypes` (`("directive" | "problem" | "suggestion" | "layout")[] | null`)<br>
+  Default is `null`. The types of the rules that the [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods use for autofix.
+
+##### Cache-related
+
+* `options.cache` (`boolean`)<br>
+  Default is `false`. If `true` is present, the [`eslint.lintFiles()`][eslint-lintfiles] method caches lint results and uses it if each target file is not changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have to remove the cache file manually. The [`eslint.lintText()`][eslint-linttext] method doesn't use caches even if you pass the `options.filePath` to the method.
+* `options.cacheLocation` (`string`)<br>
+  Default is `.eslintcache`. The [`eslint.lintFiles()`][eslint-lintfiles] method writes caches into this file.
+* `options.cacheStrategy` (`string`)<br>
+  Default is `"metadata"`. Strategy for the cache to use for detecting changed files. Can be either `"metadata"` or `"content"`.
+
+### ◆ eslint.lintFiles(patterns)
+
+```js
+const results = await eslint.lintFiles(patterns);
+```
+
+This method lints the files that match the glob patterns and then returns the results.
+
+#### Parameters
+
+* `patterns` (`string | string[]`)<br>
+  The lint target files. This can contain any of file paths, directory paths, and glob patterns.
+
+#### Return Value
+
+* (`Promise<LintResult[]>`)<br>
+  The promise that will be fulfilled with an array of [LintResult] objects.
+
+### ◆ eslint.lintText(code, options)
+
+```js
+const results = await eslint.lintText(code, options);
+```
+
+This method lints the given source code text and then returns the results.
+
+By default, this method uses the configuration that applies to files in the current working directory (the `cwd` constructor option). If you want to use a different configuration, pass `options.filePath`, and ESLint will load the same configuration that [`eslint.lintFiles()`][eslint-lintfiles] would use for a file at `options.filePath`.
+
+If the `options.filePath` value is configured to be ignored, this method returns an empty array. If the `options.warnIgnored` option is set along with the `options.filePath` option, this method returns a [LintResult] object. In that case, the result may contain a warning that indicates the file was ignored.
+
+#### Parameters
+
+The second parameter `options` is omittable.
+
+* `code` (`string`)<br>
+  The source code text to check.
+* `options.filePath` (`string`)<br>
+  Optional. The path to the file of the source code text. If omitted, the `result.filePath` becomes the string `"<text>"`.
+* `options.warnIgnored` (`boolean`)<br>
+  Optional. If `true` is present and the `options.filePath` is a file ESLint should ignore, this method returns a lint result contains a warning message.
+
+#### Return Value
+
+* (`Promise<LintResult[]>`)<br>
+  The promise that will be fulfilled with an array of [LintResult] objects. This is an array (despite there being only one lint result) in order to keep the interfaces between this and the [`eslint.lintFiles()`][eslint-lintfiles] method similar.
+
+### ◆ eslint.getRulesMetaForResults(results)
+
+```js
+const results = await eslint.lintFiles(patterns);
+const rulesMeta = eslint.getRulesMetaForResults(results);
+```
+
+This method returns an object containing meta information for each rule that triggered a lint error in the given `results`.
+
+#### Parameters
+
+* `results` (`LintResult[]`)<br>
+  An array of [LintResult] objects returned from a call to `ESLint#lintFiles()` or `ESLint#lintText()`.
+
+#### Return Value
+
+* (`Object`)<br>
+  An object whose property names are the rule IDs from the `results` and whose property values are the rule's meta information (if available).
+
+### ◆ eslint.calculateConfigForFile(filePath)
+
+```js
+const config = await eslint.calculateConfigForFile(filePath);
+```
+
+This method calculates the configuration for a given file, which can be useful for debugging purposes.
+
+* It resolves and merges `extends` and `overrides` settings into the top level configuration.
+* It resolves the `parser` setting to absolute paths.
+* It normalizes the `plugins` setting to align short names. (e.g., `eslint-plugin-foo` → `foo`)
+* It adds the `processor` setting if a legacy file extension processor is matched.
+* It doesn't interpret the `env` setting to the `globals` and `parserOptions` settings, so the result object contains the `env` setting as is.
+
+#### Parameters
+
+* `filePath` (`string`)<br>
+  The path to the file whose configuration you would like to calculate. Directory paths are forbidden because ESLint cannot handle the `overrides` setting.
+
+#### Return Value
+
+* (`Promise<Object>`)<br>
+  The promise that will be fulfilled with a configuration object.
+
+### ◆ eslint.isPathIgnored(filePath)
+
+```js
+const isPathIgnored = await eslint.isPathIgnored(filePath);
+```
+
+This method checks if a given file is ignored by your configuration.
+
+#### Parameters
+
+* `filePath` (`string`)<br>
+  The path to the file you want to check.
+
+#### Return Value
+
+* (`Promise<boolean>`)<br>
+  The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then it will return `true`.
+
+### ◆ eslint.loadFormatter(nameOrPath)
+
+```js
+const formatter = await eslint.loadFormatter(nameOrPath);
+```
+
+This method loads a formatter. Formatters convert lint results to a human- or machine-readable string.
+
+#### Parameters
+
+* `nameOrPath` (`string | undefined`)<br>
+  The path to the file you want to check. The following values are allowed:
+    * `undefined`. In this case, loads the `"stylish"` built-in formatter.
+    * A name of [built-in formatters][builtin-formatters].
+    * A name of [third-party formatters][third-party-formatters]. For examples:
+        * `"foo"` will load `eslint-formatter-foo`.
+        * `"@foo"` will load `@foo/eslint-formatter`.
+        * `"@foo/bar"` will load `@foo/eslint-formatter-bar`.
+    * A path to the file that defines a formatter. The path must contain one or more path separators (`/`) in order to distinguish if it's a path or not. For example, start with `./`.
+
+#### Return Value
+
+* (`Promise<LoadedFormatter>`)<br>
+  The promise that will be fulfilled with a [LoadedFormatter] object.
+
+### ◆ ESLint.version
+
+```js
+const version = ESLint.version;
+```
+
+The version string of ESLint. E.g. `"7.0.0"`.
+
+This is a static property.
+
+### ◆ ESLint.outputFixes(results)
+
+```js
+await ESLint.outputFixes(results);
+```
+
+This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified files don't exist, this method does nothing.
+
+This is a static method.
+
+#### Parameters
+
+* `results` (`LintResult[]`)<br>
+  The [LintResult] objects to write.
+
+#### Return Value
+
+* (`Promise<void>`)<br>
+  The promise that will be fulfilled after all files are written.
+
+### ◆ ESLint.getErrorResults(results)
+
+```js
+const filteredResults = ESLint.getErrorResults(results);
+```
+
+This method copies the given results and removes warnings. The returned value contains only errors.
+
+This is a static method.
+
+#### Parameters
+
+* `results` (`LintResult[]`)<br>
+  The [LintResult] objects to filter.
+
+#### Return Value
+
+* (`LintResult[]`)<br>
+  The filtered [LintResult] objects.
+
+### ◆ LintResult type
+
+The `LintResult` value is the information of the linting result of each file. The [`eslint.lintFiles()`][eslint-lintfiles] and [`eslint.lintText()`][eslint-linttext] methods return it. It has the following properties:
+
+* `filePath` (`string`)<br>
+  The absolute path to the file of this result. This is the string `"<text>"` if the file path is unknown (when you didn't pass the `options.filePath` option to the [`eslint.lintText()`][eslint-linttext] method).
+* `messages` (`LintMessage[]`)<br>
+  The array of [LintMessage] objects.
+* `suppressedMessages` (`SuppressedLintMessage[]`)<br>
+  The array of [SuppressedLintMessage] objects.
+* `fixableErrorCount` (`number`)<br>
+  The number of errors that can be fixed automatically by the `fix` constructor option.
+* `fixableWarningCount` (`number`)<br>
+  The number of warnings that can be fixed automatically by the `fix` constructor option.
+* `errorCount` (`number`)<br>
+  The number of errors. This includes fixable errors and fatal errors.
+* `fatalErrorCount` (`number`)<br>
+  The number of fatal errors.
+* `warningCount` (`number`)<br>
+  The number of warnings. This includes fixable warnings.
+* `output` (`string | undefined`)<br>
+  The modified source code text. This property is undefined if any fixable messages didn't exist.
+* `source` (`string | undefined`)<br>
+  The original source code text. This property is undefined if any messages didn't exist or the `output` property exists.
+* `usedDeprecatedRules` (`{ ruleId: string; replacedBy: string[] }[]`)<br>
+  The information about the deprecated rules that were used to check this file.
+
+### ◆ LintMessage type
+
+The `LintMessage` value is the information of each linting error. The `messages` property of the [LintResult] type contains it. It has the following properties:
+
+* `ruleId` (`string` | `null`)<br>
+  The rule name that generates this lint message. If this message is generated by the ESLint core rather than rules, this is `null`.
+* `severity` (`1 | 2`)<br>
+  The severity of this message. `1` means warning and `2` means error.
+* `fatal` (`boolean | undefined`)<br>
+  `true` if this is a fatal error unrelated to a rule, like a parsing error.
+* `message` (`string`)<br>
+  The error message.
+* `line` (`number | undefined`)<br>
+  The 1-based line number of the begin point of this message.
+* `column` (`number | undefined`)<br>
+  The 1-based column number of the begin point of this message.
+* `endLine` (`number | undefined`)<br>
+  The 1-based line number of the end point of this message. This property is undefined if this message is not a range.
+* `endColumn` (`number | undefined`)<br>
+  The 1-based column number of the end point of this message. This property is undefined if this message is not a range.
+* `fix` (`EditInfo | undefined`)<br>
+  The [EditInfo] object of autofix. This property is undefined if this message is not fixable.
+* `suggestions` (`{ desc: string; fix: EditInfo }[] | undefined`)<br>
+  The list of suggestions. Each suggestion is the pair of a description and an [EditInfo] object to fix code. API users such as editor integrations can choose one of them to fix the problem of this message. This property is undefined if this message doesn't have any suggestions.
+
+### ◆ SuppressedLintMessage type
+
+The `SuppressedLintMessage` value is the information of each suppressed linting error. The `suppressedMessages` property of the [LintResult] type contains it. It has the following properties:
+
+* `ruleId` (`string` | `null`)<br>
+  Same as `ruleId` in [LintMessage] type.
+* `severity` (`1 | 2`)<br>
+  Same as `severity` in [LintMessage] type.
+* `fatal` (`boolean | undefined`)<br>
+  Same as `fatal` in [LintMessage] type.
+* `message` (`string`)<br>
+  Same as `message` in [LintMessage] type.
+* `line` (`number | undefined`)<br>
+  Same as `line` in [LintMessage] type.
+* `column` (`number | undefined`)<br>
+  Same as `column` in [LintMessage] type.
+* `endLine` (`number | undefined`)<br>
+  Same as `endLine` in [LintMessage] type.
+* `endColumn` (`number | undefined`)<br>
+  Same as `endColumn` in [LintMessage] type.
+* `fix` (`EditInfo | undefined`)<br>
+  Same as `fix` in [LintMessage] type.
+* `suggestions` (`{ desc: string; fix: EditInfo }[] | undefined`)<br>
+  Same as `suggestions` in [LintMessage] type.
+* `suppressions` (`{ kind: string; justification: string}[]`)<br>
+  The list of suppressions. Each suppression is the pair of a kind and a justification.
+
+### ◆ EditInfo type
+
+The `EditInfo` value is information to edit text. The `fix` and `suggestions` properties of [LintMessage] type contain it. It has following properties:
+
+* `range` (`[number, number]`)<br>
+  The pair of 0-based indices in source code text to remove.
+* `text` (`string`)<br>
+  The text to add.
+
+This edit information means replacing the range of the `range` property by the `text` property value. It's like `sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1])`. Therefore, it's an add if the `range[0]` and `range[1]` property values are the same value, and it's removal if the `text` property value is empty string.
+
+### ◆ LoadedFormatter type
+
+The `LoadedFormatter` value is the object to convert the [LintResult] objects to text. The [eslint.loadFormatter()][eslint-loadformatter] method returns it. It has the following method:
+
+* `format` (`(results: LintResult[]) => string | Promise<string>`)<br>
+  The method to convert the [LintResult] objects to text.
+
+---
+
+## SourceCode
+
+The `SourceCode` type represents the parsed source code that ESLint executes on. It's used internally in ESLint and is also available so that already-parsed code can be used. You can create a new instance of `SourceCode` by passing in the text string representing the code and an abstract syntax tree (AST) in [ESTree](https://github.com/estree/estree) format (including location information, range information, comments, and tokens):
+
+```js
+const SourceCode = require("eslint").SourceCode;
+
+const code = new SourceCode("var foo = bar;", ast);
+```
+
+The `SourceCode` constructor throws an error if the AST is missing any of the required information.
+
+The `SourceCode` constructor strips Unicode BOM.
+Please note the AST also should be parsed from stripped text.
+
+```js
+const SourceCode = require("eslint").SourceCode;
+
+const code = new SourceCode("\uFEFFvar foo = bar;", ast);
+
+assert(code.hasBOM === true);
+assert(code.text === "var foo = bar;");
+```
+
+### SourceCode#splitLines()
+
+This is a static function on `SourceCode` that is used to split the source code text into an array of lines.
+
+```js
+const SourceCode = require("eslint").SourceCode;
+
+const code = "var a = 1;\nvar b = 2;"
+
+// split code into an array
+const codeLines = SourceCode.splitLines(code);
+
+/*
+    Value of codeLines will be
+    [
+        "var a = 1;",
+        "var b = 2;"
+    ]
+ */
+```
+
+---
+
+## Linter
+
+The `Linter` object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it simply parses and reports on the code. In particular, the `Linter` object does not process configuration objects or files. Unless you are working in the browser, you probably want to use the [ESLint class](#eslint-class) class instead.
+
+The `Linter` is a constructor, and you can create a new instance by passing in the options you want to use. The available options are:
+
+* `cwd` - Path to a directory that should be considered as the current working directory. It is accessible to rules by calling `context.getCwd()` (see [The Context Object](./working-with-rules#the-context-object)). If `cwd` is `undefined`, it will be normalized to `process.cwd()` if the global `process` object is defined (for example, in the Node.js runtime) , or `undefined` otherwise.
+
+For example:
+
+```js
+const Linter = require("eslint").Linter;
+const linter1 = new Linter({ cwd: 'path/to/project' });
+const linter2 = new Linter();
+```
+
+In this example, rules run on `linter1` will get `path/to/project` when calling `context.getCwd()`.
+Those run on `linter2` will get `process.cwd()` if the global `process` object is defined or `undefined` otherwise (e.g. on the browser <https://eslint.org/demo>).
+
+### Linter#verify
+
+The most important method on `Linter` is `verify()`, which initiates linting of the given text. This method accepts three arguments:
+
+* `code` - the source code to lint (a string or instance of `SourceCode`).
+* `config` - a configuration object that has been processed and normalized by `ESLint` using eslintrc files and/or other configuration arguments.
+    * **Note**: If you want to lint text and have your configuration be read and processed, use [`ESLint#lintFiles()`][eslint-lintfiles] or [`ESLint#lintText()`][eslint-linttext] instead.
+* `options` - (optional) Additional options for this run.
+    * `filename` - (optional) the filename to associate with the source code.
+    * `preprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `preprocess` method.
+    * `postprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `postprocess` method.
+    * `filterCodeBlock` - (optional) A function that decides which code blocks the linter should adopt. The function receives two arguments. The first argument is the virtual filename of a code block. The second argument is the text of the code block. If the function returned `true` then the linter adopts the code block. If the function was omitted, the linter adopts only `*.js` code blocks. If you provided a `filterCodeBlock` function, it overrides this default behavior, so the linter doesn't adopt `*.js` code blocks automatically.
+    * `disableFixes` - (optional) when set to `true`, the linter doesn't make either the `fix` or `suggestions` property of the lint result.
+    * `allowInlineConfig` - (optional) set to `false` to disable inline comments from changing ESLint rules.
+    * `reportUnusedDisableDirectives` - (optional) when set to `true`, adds reported errors for unused `eslint-disable` directives when no problems would be reported in the disabled area anyway.
+
+If the third argument is a string, it is interpreted as the `filename`.
+
+You can call `verify()` like this:
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+const messages = linter.verify("var foo;", {
+    rules: {
+        semi: 2
+    }
+}, { filename: "foo.js" });
+
+// or using SourceCode
+
+const Linter = require("eslint").Linter,
+    linter = new Linter(),
+    SourceCode = require("eslint").SourceCode;
+
+const code = new SourceCode("var foo = bar;", ast);
+
+const messages = linter.verify(code, {
+    rules: {
+        semi: 2
+    }
+}, { filename: "foo.js" });
+```
+
+The `verify()` method returns an array of objects containing information about the linting warnings and errors. Here's an example:
+
+```js
+{
+    fatal: false,
+    ruleId: "semi",
+    severity: 2,
+    line: 1,
+    column: 23,
+    message: "Expected a semicolon.",
+    fix: {
+        range: [1, 15],
+        text: ";"
+    }
+}
+```
+
+The information available for each linting message is:
+
+* `column` - the column on which the error occurred.
+* `fatal` - usually omitted, but will be set to true if there's a parsing error (not related to a rule).
+* `line` - the line on which the error occurred.
+* `message` - the message that should be output.
+* `nodeType` - the node or token type that was reported with the problem.
+* `ruleId` - the ID of the rule that triggered the messages (or null if `fatal` is true).
+* `severity` - either 1 or 2, depending on your configuration.
+* `endColumn` - the end column of the range on which the error occurred (this property is omitted if it's not range).
+* `endLine` - the end line of the range on which the error occurred (this property is omitted if it's not range).
+* `fix` - an object describing the fix for the problem (this property is omitted if no fix is available).
+* `suggestions` - an array of objects describing possible lint fixes for editors to programmatically enable (see details in the [Working with Rules docs](./working-with-rules#providing-suggestions)).
+
+You can get the suppressed messages from the previous run by `getSuppressedMessages()` method. If there is not a previous run, `getSuppressedMessage()` will return an empty list.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+const messages = linter.verify("var foo = bar; // eslint-disable-line -- Need to suppress", {
+    rules: {
+        semi: ["error", "never"]
+    }
+}, { filename: "foo.js" });
+const suppressedMessages = linter.getSuppressedMessages();
+
+console.log(suppressedMessages[0].suppressions); // [{ "kind": "directive", "justification": "Need to suppress" }]
+```
+
+Linting message objects have a deprecated `source` property. This property **will be removed** from linting messages in an upcoming breaking release. If you depend on this property, you should now use the `SourceCode` instance provided by the linter.
+
+You can also get an instance of the `SourceCode` object used inside of `linter` by using the `getSourceCode()` method:
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+const messages = linter.verify("var foo = bar;", {
+    rules: {
+        semi: 2
+    }
+}, { filename: "foo.js" });
+
+const code = linter.getSourceCode();
+
+console.log(code.text);     // "var foo = bar;"
+```
+
+In this way, you can retrieve the text and AST used for the last run of `linter.verify()`.
+
+### Linter#verifyAndFix()
+
+This method is similar to verify except that it also runs autofixing logic, similar to the `--fix` flag on the command line. The result object will contain the autofixed code, along with any remaining linting messages for the code that were not autofixed.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+const messages = linter.verifyAndFix("var foo", {
+    rules: {
+        semi: 2
+    }
+});
+```
+
+Output object from this method:
+
+```js
+{
+    fixed: true,
+    output: "var foo;",
+    messages: []
+}
+```
+
+The information available is:
+
+* `fixed` - True, if the code was fixed.
+* `output` - Fixed code text (might be the same as input if no fixes were applied).
+* `messages` - Collection of all messages for the given code (It has the same information as explained above under `verify` block).
+
+### Linter#defineRule
+
+Each `Linter` instance holds a map of rule names to loaded rule objects. By default, all ESLint core rules are loaded. If you want to use `Linter` with custom rules, you should use the `defineRule` method to register your rules by ID.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+linter.defineRule("my-custom-rule", {
+    // (an ESLint rule)
+
+    create(context) {
+        // ...
+    }
+});
+
+const results = linter.verify("// some source text", { rules: { "my-custom-rule": "error" } });
+```
+
+### Linter#defineRules
+
+This is a convenience method similar to `Linter#defineRule`, except that it allows you to define many rules at once using an object.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+linter.defineRules({
+    "my-custom-rule": { /* an ESLint rule */ create() {} },
+    "another-custom-rule": { /* an ESLint rule */ create() {} }
+});
+
+const results = linter.verify("// some source text", {
+    rules: {
+        "my-custom-rule": "error",
+        "another-custom-rule": "warn"
+    }
+});
+```
+
+### Linter#getRules
+
+This method returns a map of all loaded rules.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+linter.getRules();
+
+/*
+Map {
+  'accessor-pairs' => { meta: { docs: [Object], schema: [Array] }, create: [Function: create] },
+  'array-bracket-newline' => { meta: { docs: [Object], schema: [Array] }, create: [Function: create] },
+  ...
+}
+*/
+```
+
+### Linter#defineParser
+
+Each instance of `Linter` holds a map of custom parsers. If you want to define a parser programmatically, you can add this function
+with the name of the parser as first argument and the [parser object](/docs/developer-guide/working-with-custom-parsers) as second argument. The default `"espree"` parser will already be loaded for every `Linter` instance.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+linter.defineParser("my-custom-parser", {
+    parse(code, options) {
+        // ...
+    }
+});
+
+const results = linter.verify("// some source text", { parser: "my-custom-parser" });
+```
+
+### Linter#version/Linter.version
+
+Each instance of `Linter` has a `version` property containing the semantic version number of ESLint that the `Linter` instance is from.
+
+```js
+const Linter = require("eslint").Linter;
+const linter = new Linter();
+
+linter.version; // => '4.5.0'
+```
+
+There is also a `Linter.version` property that you can read without instantiating `Linter`:
+
+```js
+const Linter = require("eslint").Linter;
+
+Linter.version; // => '4.5.0'
+```
+
+---
+
+## RuleTester
+
+`eslint.RuleTester` is a utility to write tests for ESLint rules. It is used internally for the bundled rules that come with ESLint, and it can also be used by plugins.
+
+Example usage:
+
+```js
+"use strict";
+
+const rule = require("../../../lib/rules/my-rule"),
+    RuleTester = require("eslint").RuleTester;
+
+const ruleTester = new RuleTester();
+
+ruleTester.run("my-rule", rule, {
+    valid: [
+        {
+            code: "var foo = true",
+            options: [{ allowFoo: true }]
+        }
+    ],
+
+    invalid: [
+        {
+            code: "var invalidVariable = true",
+            errors: [{ message: "Unexpected invalid variable." }]
+        },
+        {
+            code: "var invalidVariable = true",
+            errors: [{ message: /^Unexpected.+variable/ }]
+        }
+    ]
+});
+```
+
+The `RuleTester` constructor accepts an optional object argument, which can be used to specify defaults for your test cases. For example, if all of your test cases use ES2015, you can set it as a default:
+
+```js
+const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015 } });
+```
+
+The `RuleTester#run()` method is used to run the tests. It should be passed the following arguments:
+
+* The name of the rule (string)
+* The rule object itself (see ["working with rules"](./working-with-rules))
+* An object containing `valid` and `invalid` properties, each of which is an array containing test cases.
+
+A test case is an object with the following properties:
+
+* `name` (string, optional): The name to use for the test case, to make it easier to find
+* `code` (string, required): The source code that the rule should be run on
+* `options` (array, optional): The options passed to the rule. The rule severity should not be included in this list.
+* `filename` (string, optional): The filename for the given case (useful for rules that make assertions about filenames).
+* `only` (boolean, optional): Run this case exclusively for debugging in supported test frameworks.
+
+In addition to the properties above, invalid test cases can also have the following properties:
+
+* `errors` (number or array, required): Asserts some properties of the errors that the rule is expected to produce when run on this code. If this is a number, asserts the number of errors produced. Otherwise, this should be a list of objects, each containing information about a single reported error. The following properties can be used for an error (all are optional):
+    * `message` (string/regexp): The message for the error
+    * `messageId` (string): The Id for the error. See [testing errors with messageId](#testing-errors-with-messageid) for details
+    * `data` (object): Placeholder data which can be used in combination with `messageId`
+    * `type` (string): The type of the reported AST node
+    * `line` (number): The 1-based line number of the reported location
+    * `column` (number): The 1-based column number of the reported location
+    * `endLine` (number): The 1-based line number of the end of the reported location
+    * `endColumn` (number): The 1-based column number of the end of the reported location
+    * `suggestions` (array): An array of objects with suggestion details to check. See [Testing Suggestions](#testing-suggestions) for details
+
+    If a string is provided as an error instead of an object, the string is used to assert the `message` of the error.
+* `output` (string, required if the rule fixes code): Asserts the output that will be produced when using this rule for a single pass of autofixing (e.g. with the `--fix` command line flag). If this is `null`, asserts that none of the reported problems suggest autofixes.
+
+Any additional properties of a test case will be passed directly to the linter as config options. For example, a test case can have a `parserOptions` property to configure parser behavior:
+
+```js
+{
+    code: "let foo;",
+    parserOptions: { ecmaVersion: 2015 }
+}
+```
+
+If a valid test case only uses the `code` property, it can optionally be provided as a string containing the code, rather than an object with a `code` key.
+
+### Testing errors with `messageId`
+
+If the rule under test uses `messageId`s, you can use `messageId` property in a test case to assert reported error's `messageId` instead of its `message`.
+
+```js
+{
+    code: "let foo;",
+    errors: [{ messageId: "unexpected" }]
+}
+```
+
+For messages with placeholders, a test case can also use `data` property to additionally assert reported error's `message`.
+
+```js
+{
+    code: "let foo;",
+    errors: [{ messageId: "unexpected", data: { name: "foo" } }]
+}
+```
+
+Please note that `data` in a test case does not assert `data` passed to `context.report`. Instead, it is used to form the expected message text which is then compared with the received `message`.
+
+### Testing Suggestions
+
+Suggestions can be tested by defining a `suggestions` key on an errors object. The options to check for the suggestions are the following (all are optional):
+
+* `desc` (string): The suggestion `desc` value
+* `messageId` (string): The suggestion `messageId` value for suggestions that use `messageId`s
+* `data` (object): Placeholder data which can be used in combination with `messageId`
+* `output` (string): A code string representing the result of applying the suggestion fix to the input code
+
+Example:
+
+```js
+ruleTester.run("my-rule-for-no-foo", rule, {
+    valid: [],
+    invalid: [{
+        code: "var foo;",
+        errors: [{
+            suggestions: [{
+                desc: "Rename identifier 'foo' to 'bar'",
+                output: "var bar;"
+            }]
+        }]
+    }]
+})
+```
+
+`messageId` and `data` properties in suggestion test objects work the same way as in error test objects. See [testing errors with messageId](#testing-errors-with-messageid) for details.
+
+```js
+ruleTester.run("my-rule-for-no-foo", rule, {
+    valid: [],
+    invalid: [{
+        code: "var foo;",
+        errors: [{
+            suggestions: [{
+                messageId: "renameFoo",
+                data: { newName: "bar" },
+                output: "var bar;"
+            }]
+        }]
+    }]
+})
+```
+
+### Customizing RuleTester
+
+`RuleTester` depends on two functions to run tests: `describe` and `it`. These functions can come from various places:
+
+1. If `RuleTester.describe` and `RuleTester.it` have been set to function values, `RuleTester` will use `RuleTester.describe` and `RuleTester.it` to run tests. You can use this to customize the behavior of `RuleTester` to match a test framework that you're using.
+
+    If `RuleTester.itOnly` has been set to a function value, `RuleTester` will call `RuleTester.itOnly` instead of `RuleTester.it` to run cases with `only: true`. If `RuleTester.itOnly` is not set but `RuleTester.it` has an `only` function property, `RuleTester` will fall back to `RuleTester.it.only`.
+
+2. Otherwise, if `describe` and `it` are present as globals, `RuleTester` will use `global.describe` and `global.it` to run tests and `global.it.only` to run cases with `only: true`. This allows `RuleTester` to work when using frameworks like [Mocha](https://mochajs.org/) without any additional configuration.
+3. Otherwise, `RuleTester#run` will simply execute all of the tests in sequence, and will throw an error if one of them fails. This means you can simply execute a test file that calls `RuleTester.run` using `Node.js`, without needing a testing framework.
+
+`RuleTester#run` calls the `describe` function with two arguments: a string describing the rule, and a callback function. The callback calls the `it` function with a string describing the test case, and a test function. The test function will return successfully if the test passes, and throw an error if the test fails. The signature for `only` is the same as `it`. `RuleTester` calls either `it` or `only` for every case even when some cases have `only: true`, and the test framework is responsible for implementing test case exclusivity. (Note that this is the standard behavior for test suites when using frameworks like [Mocha](https://mochajs.org/); this information is only relevant if you plan to customize `RuleTester.describe`, `RuleTester.it`, or `RuleTester.itOnly`.)
+
+Example of customizing `RuleTester`:
+
+```js
+"use strict";
+
+const RuleTester = require("eslint").RuleTester,
+    test = require("my-test-runner"),
+    myRule = require("../../../lib/rules/my-rule");
+
+RuleTester.describe = function(text, method) {
+    RuleTester.it.title = text;
+    return method.call(this);
+};
+
+RuleTester.it = function(text, method) {
+    test(RuleTester.it.title + ": " + text, method);
+};
+
+// then use RuleTester as documented
+
+const ruleTester = new RuleTester();
+
+ruleTester.run("my-rule", myRule, {
+    valid: [
+        // valid test cases
+    ],
+    invalid: [
+        // invalid test cases
+    ]
+})
+```
+
+---
+
+[configuration object]: ../user-guide/configuring/
+[builtin-formatters]: https://eslint.org/docs/user-guide/formatters/
+[third-party-formatters]: https://www.npmjs.com/search?q=eslintformatter
+[eslint]: #eslint-class
+[eslint-constructor]: #-new-eslintoptions
+[eslint-lintfiles]: #-eslintlintfilespatterns
+[eslint-linttext]: #-eslintlinttextcode-options
+[eslint-getrulesmetaforresults]: #-eslintgetrulesmetaforresultsresults
+[eslint-calculateconfigforfile]: #-eslintcalculateconfigforfilefilepath
+[eslint-ispathignored]: #-eslintispathignoredfilepath
+[eslint-loadformatter]: #-eslintloadformatternameorpath
+[eslint-version]: #-eslintversion
+[eslint-outputfixes]: #-eslintoutputfixesresults
+[eslint-geterrorresults]: #-eslintgeterrorresultsresults
+[lintresult]: #-lintresult-type
+[lintmessage]: #-lintmessage-type
+[suppressedlintmessage]: #-suppressedlintmessage-type
+[editinfo]: #-editinfo-type
+[loadedformatter]: #-loadedformatter-type
+[linter]: #linter
diff --git a/eslint/docs/src/developer-guide/package-json-conventions.md b/eslint/docs/src/developer-guide/package-json-conventions.md
new file mode 100644 (file)
index 0000000..4733b42
--- /dev/null
@@ -0,0 +1,89 @@
+---
+title: Package.json Conventions
+layout: doc
+edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/package-json-conventions.md
+---
+
+The following applies to the "scripts" section of `package.json` files.
+
+## Names
+
+npm script names MUST contain only lower case letters, `:` to separate parts, `-` to separate words, and `+` to separate file extensions. Each part name SHOULD be either a full English word (e.g. `coverage` not `cov`) or a well-known initialism in all lowercase (e.g. `wasm`).
+
+Here is a summary of the proposal in EBNF.
+
+```ebnf
+name = life-cycle | main ":fix"? target? option* ":watch"?
+
+life-cycle = prepare | preinstall | install | postinstall | prepublish | preprepare | prepare | postprepare | prepack | postpack | prepublishOnly;
+
+main = "build" | "lint" | "start" | "test";
+
+target = ":" word ("-" word)* | extension ("+" extension)*;
+
+option = ":" word ("-" word)*;
+
+word = [a-z]+;
+
+extension = [a-z0-9]+;
+```
+
+## Order
+
+The script names MUST appear in the package.json file in alphabetical order. The other conventions outlined in this document ensure that alphabetical order will coincide with logical groupings.
+
+## Main Script Names
+
+With the exception of [npm life cycle scripts](https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts) all script names MUST begin with one of the following names.
+
+### Build
+
+Scripts that generate a set of files from source code and / or data MUST have names that begin with `build`.
+
+If a package contains any `build:*` scripts, there MAY be a script named `build`. If so, SHOULD produce the same output as running each of the `build` scripts individually. It MUST produce a subset of the output from running those scripts.
+
+### Lint
+
+Scripts that statically analyze files (mostly, but not limited to running `eslint` itself) MUST have names that begin with `lint`.
+
+If a package contains any `lint:*` scripts, there SHOULD be a script named `lint` and it MUST run all of the checks that would have been run if each `lint:*` script was called individually.
+
+If fixing is available, a linter MUST NOT apply fixes UNLESS the script contains the `:fix` modifier (see below).
+
+### Start
+
+A `start` script is used to start a server. As of this writing, no ESLint package has more than one `start` script, so there's no need `start` to have any modifiers.
+
+### Test
+
+Scripts that execute code in order to ensure the actual behavior matches expected behavior MUST have names that begin with `test`.
+
+If a package contains any `test:*` scripts, there SHOULD be a script named `test` and it MUST run of all of the tests that would have been run if each `test:*` script was called individually.
+
+A test script SHOULD NOT include linting.
+
+A test script SHOULD report test coverage when possible.
+
+## Modifiers
+
+One or more of the following modifiers MAY be appended to the standard script names above. If a target has modifiers, they MUST be in the order in which they appear below (e.g. `lint:fix:js:watch` not `lint:watch:js:fix`)
+
+### Fix
+
+If it's possible for a linter to fix problems that it finds, add a copy of the script with `:fix` appended to the end that also fixes.
+
+### Target
+
+The name of the target of the action being run. In the case of a `build` script, it SHOULD identify the build artifact(s), e.g. "javascript" or "css" or "website". In the case of a `lint` or `test` script, it SHOULD identify the item(s) being linted or tested. In the case of a `start` script, it SHOULD identify which server is starting.
+
+A target MAY refer to a list of affected file extensions (such as `cjs` or `less`) delimited by a `+`. If there is more than one extension, the list SHOULD be alphabetized. When a file extension has variants (such as `cjs` for CommonJS and `mjs` for ESM), the common part of the extension MAY be used instead of explicitly listing out all of the variants (e.g. `js` instead of `cjs+jsx+mjs`).
+
+The target SHOULD NOT refer to name of the name of the tool that's performing the action (`eleventy`, `webpack`, etc.)
+
+### Options
+
+Additional options that don't fit under the other modifiers.
+
+### Watch
+
+If a script watches the filesystem and responds to changes, add `:watch` to the script name.
diff --git a/eslint/docs/src/developer-guide/scope-manager-interface.md b/eslint/docs/src/developer-guide/scope-manager-interface.md
new file mode 100644 (file)
index 0000000..c864aba
--- /dev/null
@@ -0,0 +1,397 @@
+---
+title: ScopeManager
+layout: doc
+
+---
+
+This document was written based on the implementation of [eslint-scope](https://github.com/eslint/eslint-scope), a fork of [escope](https://github.com/estools/escope), and deprecates some members ESLint is not using.
+
+----
+
+## ScopeManager interface
+
+`ScopeManager` object has all variable scopes.
+
+### Fields
+
+#### scopes
+
+* **Type:** `Scope[]`
+* **Description:** All scopes.
+
+#### globalScope
+
+* **Type:** `Scope`
+* **Description:** The root scope.
+
+### Methods
+
+#### acquire(node, inner = false)
+
+* **Parameters:**
+    * `node` (`ASTNode`) ... An AST node to get their scope.
+    * `inner` (`boolean`) ... If the node has multiple scope, this returns the outermost scope normally. If `inner` is `true` then this returns the innermost scope. Default is `false`.
+* **Return type:** `Scope | null`
+* **Description:** Get the scope of a given AST node. The gotten scope's `block` property is the node. This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`.
+
+#### getDeclaredVariables(node)
+
+* **Parameters:**
+    * `node` (`ASTNode`) ... An AST node to get their variables.
+* **Return type:** `Variable[]`
+* **Description:** Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. If the node does not define any variable, this returns an empty array.
+
+### Deprecated members
+
+Those members are defined but not used in ESLint.
+
+#### isModule()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this program is module.
+
+#### isImpliedStrict()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this program is strict mode implicitly. I.e., `options.impliedStrict === true`.
+
+#### isStrictModeSupported()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this program supports strict mode. I.e., `options.ecmaVersion >= 5`.
+
+#### acquireAll(node)
+
+* **Parameters:**
+    * `node` (`ASTNode`) ... An AST node to get their scope.
+* **Return type:** `Scope[] | null`
+* **Description:** Get the scopes of a given AST node. The gotten scopes' `block` property is the node. If the node does not have their scope, this returns `null`.
+
+----
+
+## Scope interface
+
+`Scope` object has all variables and references in the scope.
+
+### Fields
+
+#### type
+
+* **Type:** `string`
+* **Description:** The type of this scope. This is one of `"block"`, `"catch"`, `"class"`, `"class-field-initializer"`, `"class-static-block"`, `"for"`, `"function"`, `"function-expression-name"`, `"global"`, `"module"`, `"switch"`, `"with"`.
+
+#### isStrict
+
+* **Type:** `boolean`
+* **Description:** `true` if this scope is strict mode.
+
+#### upper
+
+* **Type:** `Scope | null`
+* **Description:** The parent scope. If this is the global scope then this property is `null`.
+
+#### childScopes
+
+* **Type:** `Scope[]`
+* **Description:** The array of child scopes. This does not include grandchild scopes.
+
+#### variableScope
+
+* **Type:** `Scope`
+* **Description:** The nearest ancestor whose `type` is one of `"class-field-initializer"`, `"class-static-block"`, `"function"`, `"global"`, or `"module"`. For the aforementioned scopes this is a self-reference.
+
+> This represents the lowest enclosing function or top-level scope. Class field initializers and class static blocks are implicit functions. Historically, this was the scope which hosts variables that are defined by `var` declarations, and thus the name `variableScope`.
+
+#### block
+
+* **Type:** `ASTNode`
+* **Description:** The AST node which created this scope.
+
+#### variables
+
+* **Type:** `Variable[]`
+* **Description:** The array of all variables which are defined on this scope. This does not include variables which are defined in child scopes.
+
+#### set
+
+* **Type:** `Map<string, Variable>`
+* **Description:** The map from variable names to variable objects.
+
+> I hope to rename `set` field or replace by a method.
+
+#### references
+
+* **Type:** `Reference[]`
+* **Description:** The array of all references on this scope. This does not include references in child scopes.
+
+#### through
+
+* **Type:** `Reference[]`
+* **Description:** The array of references which could not be resolved in this scope.
+
+#### functionExpressionScope
+
+* **Type:** `boolean`
+* **Description:** `true` if this scope is `"function-expression-name"` scope.
+
+> I hope to deprecate `functionExpressionScope` field as replacing by `scope.type === "function-expression-name"`.
+
+### Deprecated members
+
+Those members are defined but not used in ESLint.
+
+#### taints
+
+* **Type:** `Map<string, boolean>`
+* **Description:** The map from variable names to `tainted` flag.
+
+#### dynamic
+
+* **Type:** `boolean`
+* **Description:** `true` if this scope is dynamic. I.e., the type of this scope is `"global"` or `"with"`.
+
+#### directCallToEvalScope
+
+* **Type:** `boolean`
+* **Description:** `true` if this scope contains `eval()` invocations.
+
+#### thisFound
+
+* **Type:** `boolean`
+* **Description:** `true` if this scope contains `this`.
+
+#### resolve(node)
+
+* **Parameters:**
+    * `node` (`ASTNode`) ... An AST node to get their reference object. The type of the node must be `"Identifier"`.
+* **Return type:** `Reference | null`
+* **Description:** Returns `this.references.find(r => r.identifier === node)`.
+
+#### isStatic()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** Returns `!this.dynamic`.
+
+#### isArgumentsMaterialized()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this is a `"function"` scope which has used `arguments` variable.
+
+#### isThisMaterialized()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** Returns `this.thisFound`.
+
+#### isUsedName(name)
+
+* **Parameters:**
+    * `name` (`string`) ... The name to check.
+* **Return type:** `boolean`
+* **Description:** `true` if a given name is used in variable names or reference names.
+
+----
+
+## Variable interface
+
+`Variable` object is variable's information.
+
+### Fields
+
+#### name
+
+* **Type:** `string`
+* **Description:** The name of this variable.
+
+#### scope
+
+* **Type:** `Scope`
+* **Description:** The scope in which this variable is defined.
+
+#### identifiers
+
+* **Type:** `ASTNode[]`
+* **Description:** The array of `Identifier` nodes which define this variable. If this variable is redeclared, this array includes two or more nodes.
+
+> I hope to deprecate `identifiers` field as replacing by `defs[].name` field.
+
+#### references
+
+* **Type:** `Reference[]`
+* **Description:** The array of the references of this variable.
+
+#### defs
+
+* **Type:** `Definition[]`
+* **Description:** The array of the definitions of this variable.
+
+### Deprecated members
+
+Those members are defined but not used in ESLint.
+
+#### tainted
+
+* **Type:** `boolean`
+* **Description:** The `tainted` flag. (always `false`)
+
+#### stack
+
+* **Type:** `boolean`
+* **Description:** The `stack` flag. (I'm not sure what this means.)
+
+----
+
+## Reference interface
+
+`Reference` object is reference's information.
+
+### Fields
+
+#### identifier
+
+* **Type:** `ASTNode`
+* **Description:** The `Identifier` node of this reference.
+
+#### from
+
+* **Type:** `Scope`
+* **Description:** The `Scope` object that this reference is on.
+
+#### resolved
+
+* **Type:** `Variable | null`
+* **Description:** The `Variable` object that this reference refers. If such variable was not defined, this is `null`.
+
+#### writeExpr
+
+* **Type:** `ASTNode | null`
+* **Description:** The ASTNode object which is right-hand side.
+
+#### init
+
+* **Type:** `boolean`
+* **Description:** `true` if this writing reference is a variable initializer or a default value.
+
+### Methods
+
+#### isWrite()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is writing.
+
+#### isRead()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is reading.
+
+#### isWriteOnly()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is writing but not reading.
+
+#### isReadOnly()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is reading but not writing.
+
+#### isReadWrite()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is reading and writing.
+
+### Deprecated members
+
+Those members are defined but not used in ESLint.
+
+#### tainted
+
+* **Type:** `boolean`
+* **Description:** The `tainted` flag. (always `false`)
+
+#### flag
+
+* **Type:** `number`
+* **Description:** `1` is reading, `2` is writing, `3` is reading/writing.
+
+#### partial
+
+* **Type:** `boolean`
+* **Description:** The `partial` flag.
+
+#### isStatic()
+
+* **Parameters:**
+* **Return type:** `boolean`
+* **Description:** `true` if this reference is resolved statically.
+
+----
+
+## Definition interface
+
+`Definition` object is variable definition's information.
+
+### Fields
+
+#### type
+
+* **Type:** `string`
+* **Description:** The type of this definition. One of `"CatchClause"`, `"ClassName"`, `"FunctionName"`, `"ImplicitGlobalVariable"`, `"ImportBinding"`, `"Parameter"`, and `"Variable"`.
+
+#### name
+
+* **Type:** `ASTNode`
+* **Description:** The `Identifier` node of this definition.
+
+#### node
+
+* **Type:** `ASTNode`
+* **Description:** The enclosing node of the name.
+
+| type                       | node |
+|:---------------------------|:-----|
+| `"CatchClause"`            | `CatchClause`
+| `"ClassName"`              | `ClassDeclaration` or `ClassExpression`
+| `"FunctionName"`           | `FunctionDeclaration` or `FunctionExpression`
+| `"ImplicitGlobalVariable"` | `Program`
+| `"ImportBinding"`          | `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`
+| `"Parameter"`              | `FunctionDeclaration`, `FunctionExpression`, or `ArrowFunctionExpression`
+| `"Variable"`               | `VariableDeclarator`
+
+#### parent
+
+* **Type:** `ASTNode | undefined | null`
+* **Description:** The enclosing statement node of the name.
+
+| type                       | parent |
+|:---------------------------|:-------|
+| `"CatchClause"`            | `null`
+| `"ClassName"`              | `null`
+| `"FunctionName"`           | `null`
+| `"ImplicitGlobalVariable"` | `null`
+| `"ImportBinding"`          | `ImportDeclaration`
+| `"Parameter"`              | `null`
+| `"Variable"`               | `VariableDeclaration`
+
+### Deprecated members
+
+Those members are defined but not used in ESLint.
+
+#### index
+
+* **Type:** `number | undefined | null`
+* **Description:** The index in the declaration statement.
+
+#### kind
+
+* **Type:** `string | undefined | null`
+* **Description:** The kind of the declaration statement.
diff --git a/eslint/docs/src/developer-guide/selectors.md b/eslint/docs/src/developer-guide/selectors.md
new file mode 100644 (file)
index 0000000..4f286c4
--- /dev/null
@@ -0,0 +1,141 @@
+---
+title: Selectors
+layout: doc
+
+---
+
+Some rules and APIs allow the use of selectors to query an AST. This page is intended to:
+
+1. Explain what selectors are
+2. Describe the syntax for creating selectors
+3. Describe what selectors can be used for
+
+## What is a selector?
+
+A selector is a string that can be used to match nodes in an Abstract Syntax Tree (AST). This is useful for describing a particular syntax pattern in your code.
+
+The syntax for AST selectors is similar to the syntax for [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors). If you've used CSS selectors before, the syntax for AST selectors should be easy to understand.
+
+The simplest selector is just a node type. A node type selector will match all nodes with the given type. For example, consider the following program:
+
+```js
+var foo = 1;
+bar.baz();
+```
+
+The selector "`Identifier`" will match all `Identifier` nodes in the program. In this case, the selector will match the nodes for `foo`, `bar`, and `baz`.
+
+Selectors are not limited to matching against single node types. For example, the selector `VariableDeclarator > Identifier` will match all `Identifier` nodes that have a `VariableDeclarator` as a direct parent. In the program above, this will match the node for `foo`, but not the nodes for `bar` and `baz`.
+
+## What syntax can selectors have?
+
+The following selectors are supported:
+
+* AST node type: `ForStatement`
+* wildcard (matches all nodes): `*`
+* attribute existence: `[attr]`
+* attribute value: `[attr="foo"]` or `[attr=123]`
+* attribute regex: `[attr=/foo.*/]` <sub>(with some [known issues](#known-issues))</sub>
+* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]`
+* nested attribute: `[attr.level2="foo"]`
+* field: `FunctionDeclaration > Identifier.id`
+* First or last child: `:first-child` or `:last-child`
+* nth-child (no ax+b support): `:nth-child(2)`
+* nth-last-child (no ax+b support): `:nth-last-child(1)`
+* descendant: `FunctionExpression ReturnStatement`
+* child: `UnaryExpression > Literal`
+* following sibling: `VariableDeclaration ~ VariableDeclaration`
+* adjacent sibling: `ArrayExpression > Literal + SpreadElement`
+* negation: `:not(ForStatement)`
+* matches-any: `:matches([attr] > :first-child, :last-child)`
+* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern`
+
+This syntax is very powerful, and can be used to precisely select many syntactic patterns in your code.
+
+<sup>The examples in this section were adapted from the [esquery](https://github.com/estools/esquery) documentation.</sup>
+
+## What can selectors be used for?
+
+If you're writing custom ESLint rules, you might be interested in using selectors to examine specific parts of the AST. If you're configuring ESLint for your codebase, you might be interested in restricting particular syntax patterns with selectors.
+
+### Listening for selectors in rules
+
+When writing a custom ESLint rule, you can listen for nodes that match a particular selector as the AST is traversed.
+
+```js
+module.exports = {
+  create(context) {
+    // ...
+
+    return {
+
+      // This listener will be called for all IfStatement nodes with blocks.
+      "IfStatement > BlockStatement": function(blockStatementNode) {
+        // ...your logic here
+      },
+
+      // This listener will be called for all function declarations with more than 3 parameters.
+      "FunctionDeclaration[params.length>3]": function(functionDeclarationNode) {
+        // ...your logic here
+      }
+    };
+  }
+};
+```
+
+Adding `:exit` to the end of a selector will cause the listener to be called when the matching nodes are exited during traversal, rather than when they are entered.
+
+If two or more selectors match the same node, their listeners will be called in order of increasing specificity. The specificity of an AST selector is similar to the specificity of a CSS selector:
+
+* When comparing two selectors, the selector that contains more class selectors, attribute selectors, and pseudo-class selectors (excluding `:not()`) has higher specificity.
+* If the class/attribute/pseudo-class count is tied, the selector that contains more node type selectors has higher specificity.
+
+If multiple selectors have equal specificity, their listeners will be called in alphabetical order for that node.
+
+### Restricting syntax with selectors
+
+With the [no-restricted-syntax](/docs/rules/no-restricted-syntax) rule, you can restrict the usage of particular syntax in your code. For example, you can use the following configuration to disallow using `if` statements that do not have block statements as their body:
+
+```json
+{
+  "rules": {
+    "no-restricted-syntax": ["error", "IfStatement > :not(BlockStatement).consequent"]
+  }
+}
+```
+
+...or equivalently, you can use this configuration:
+
+```json
+{
+  "rules": {
+    "no-restricted-syntax": ["error", "IfStatement[consequent.type!='BlockStatement']"]
+  }
+}
+```
+
+As another example, you can disallow calls to `require()`:
+
+```json
+{
+  "rules": {
+    "no-restricted-syntax": ["error", "CallExpression[callee.name='require']"]
+  }
+}
+```
+
+Or you can enforce that calls to `setTimeout` always have two arguments:
+
+```json
+{
+  "rules": {
+    "no-restricted-syntax": ["error", "CallExpression[callee.name='setTimeout'][arguments.length!=2]"]
+  }
+}
+```
+
+Using selectors in the `no-restricted-syntax` rule can give you a lot of control over problematic patterns in your codebase, without needing to write custom rules to detect each pattern.
+
+### Known issues
+
+Due to a [bug](https://github.com/estools/esquery/issues/68) in [esquery](https://github.com/estools/esquery), regular expressions that contain a forward-slash character `/` aren't properly parsed, so `[value=/some\/path/]` will be a syntax error. As a [workaround](https://github.com/estools/esquery/issues/68), you can replace the `/` character with its unicode counterpart, like so: `[value=/some\\u002Fpath/]`.
diff --git a/eslint/docs/src/developer-guide/shareable-configs.md b/eslint/docs/src/developer-guide/shareable-configs.md
new file mode 100644 (file)
index 0000000..a6ef597
--- /dev/null
@@ -0,0 +1,219 @@
+---
+title: Shareable Configs
+layout: doc
+eleventyNavigation:
+    key: shareable configs
+    parent: developer guide
+    title: Shareable Configs
+    order: 8
+
+---
+
+The configuration that you have in your `.eslintrc` file is an important part of your project, and as such, you may want to share it with other projects or people. Shareable configs allow you to publish your configuration settings on [npm](https://www.npmjs.com/) and have others download and use it in their ESLint projects.
+
+## Creating a Shareable Config
+
+Shareable configs are simply npm packages that export a configuration object. To start, [create a Node.js module](https://docs.npmjs.com/getting-started/creating-node-modules) like you normally would. Make sure the module name begins with `eslint-config-`, such as `eslint-config-myconfig`.
+
+npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported, by naming or prefixing the module with `@scope/eslint-config`, such as `@scope/eslint-config` or `@scope/eslint-config-myconfig`.
+
+Create a new `index.js` file and export an object containing your settings:
+
+```js
+module.exports = {
+
+    globals: {
+        MyGlobal: true
+    },
+
+    rules: {
+        semi: [2, "always"]
+    }
+
+};
+```
+
+Since `index.js` is just JavaScript, you can optionally read these settings from a file or generate them dynamically.
+
+## Publishing a Shareable Config
+
+Once your shareable config is ready, you can [publish to npm](https://docs.npmjs.com/getting-started/publishing-npm-packages) to share with others. We recommend using the `eslint` and `eslintconfig` keywords so others can easily find your module.
+
+You should declare your dependency on ESLint in `package.json` using the [peerDependencies](https://docs.npmjs.com/files/package.json#peerdependencies) field. The recommended way to declare a dependency for future proof compatibility is with the ">=" range syntax, using the lowest required ESLint version. For example:
+
+```json
+{
+    "peerDependencies": {
+        "eslint": ">= 3"
+    }
+}
+```
+
+If your shareable config depends on a plugin, you should also specify it as a `peerDependency` (plugins will be loaded relative to the end user's project, so the end user is required to install the plugins they need). However, if your shareable config depends on a third-party parser or another shareable config, you can specify these packages as `dependencies`.
+
+You can also test your shareable config on your computer before publishing by linking your module globally. Type:
+
+```bash
+npm link
+```
+
+Then, in your project that wants to use your shareable config, type:
+
+```bash
+npm link eslint-config-myconfig
+```
+
+Be sure to replace `eslint-config-myconfig` with the actual name of your module.
+
+## Using a Shareable Config
+
+Shareable configs are designed to work with the `extends` feature of `.eslintrc` files. Instead of using a file path for the value of `extends`, use your module name. For example:
+
+```json
+{
+    "extends": "eslint-config-myconfig"
+}
+```
+
+You can also omit the `eslint-config-` and it will be automatically assumed by ESLint:
+
+```json
+{
+    "extends": "myconfig"
+}
+```
+
+### npm scoped modules
+
+npm [scoped modules](https://docs.npmjs.com/misc/scope) are also supported in a number of ways.
+
+By using the module name:
+
+```json
+{
+    "extends": "@scope/eslint-config"
+}
+```
+
+You can also omit the `eslint-config` and it will be automatically assumed by ESLint:
+
+```json
+{
+    "extends": "@scope"
+}
+```
+
+The module name can also be customized, just note that when using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config-` prefix. Doing so would result in package naming conflicts, and thus in resolution errors in most of cases. For example a package named `@scope/eslint-config-myconfig` vs `@scope/myconfig`, since both are valid scoped package names, the configuration should be specified as:
+
+```json
+{
+    "extends": "@scope/eslint-config-myconfig"
+}
+```
+
+You can override settings from the shareable config by adding them directly into your `.eslintrc` file.
+
+## Sharing Multiple Configs
+
+It's possible to share multiple configs in the same npm package. You can specify a default config for the package by following the directions in the first section. You can specify additional configs by simply adding a new file to your npm package and then referencing it from your ESLint config.
+
+As an example, you can create a file called `my-special-config.js` in the root of your npm package and export a config, such as:
+
+```js
+module.exports = {
+    rules: {
+        quotes: [2, "double"]
+    }
+};
+```
+
+Then, assuming you're using the package name `eslint-config-myconfig`, you can access the additional config via:
+
+```json
+{
+    "extends": "myconfig/my-special-config"
+}
+```
+
+When using [scoped modules](https://docs.npmjs.com/misc/scope) it is not possible to omit the `eslint-config` namespace. Doing so would result in resolution errors as explained above. Assuming the package name is `@scope/eslint-config`, the additional config can be accessed as:
+
+```json
+{
+    "extends": "@scope/eslint-config/my-special-config"
+}
+```
+
+Note that you can leave off the `.js` from the filename. In this way, you can add as many additional configs to your package as you'd like.
+
+**Important:** We strongly recommend always including a default config for your plugin to avoid errors.
+
+## Local Config File Resolution
+
+If you need to make multiple configs that can extend from each other and live in different directories, you can create a single shareable config that handles this scenario.
+
+As an example, let's assume you're using the package name `eslint-config-myconfig` and your package looks something like this:
+
+```text
+myconfig
+├── index.js
+└─┬ lib
+  ├── defaults.js
+  ├── dev.js
+  ├── ci.js
+  └─┬ ci
+    ├── frontend.js
+    ├── backend.js
+    └── common.js
+```
+
+In your `index.js` you can do something like this:
+
+```js
+module.exports = require('./lib/ci.js');
+```
+
+Now inside your package you have `/lib/defaults.js`, which contains:
+
+```js
+module.exports = {
+    rules: {
+        'no-console': 1
+    }
+};
+```
+
+Inside your `/lib/ci.js` you have
+
+```js
+module.exports = require('./ci/backend');
+```
+
+Inside your `/lib/ci/common.js`
+
+```js
+module.exports = {
+    rules: {
+        'no-alert': 2
+    },
+    extends: 'myconfig/lib/defaults'
+};
+```
+
+Despite being in an entirely different directory, you'll see that all `extends` must use the full package path to the config file you wish to extend.
+
+Now inside your `/lib/ci/backend.js`
+
+```js
+module.exports = {
+    rules: {
+        'no-console': 1
+    },
+    extends: 'myconfig/lib/ci/common'
+};
+```
+
+In the last file, you'll once again see that to properly resolve your config, you'll need include the full package path.
+
+## Further Reading
+
+* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
diff --git a/eslint/docs/src/developer-guide/source-code.md b/eslint/docs/src/developer-guide/source-code.md
new file mode 100644 (file)
index 0000000..ec3d3ce
--- /dev/null
@@ -0,0 +1,53 @@
+---
+title: Source Code
+layout: doc
+eleventyNavigation:
+    key: getting the source code
+    parent: developer guide
+    title: Getting the Source Code
+    order: 1
+
+---
+
+ESLint is hosted at [GitHub](https://github.com/eslint/eslint) and uses [Git](https://git-scm.com/) for source control. In order to obtain the source code, you must first install Git on your system. Instructions for installing and setting up Git can be found at [https://help.github.com/articles/set-up-git/](https://help.github.com/articles/set-up-git/).
+
+If you simply want to create a local copy of the source to play with, you can clone the main repository using this command:
+
+```shell
+git clone git://github.com/eslint/eslint.git
+```
+
+If you're planning on contributing to ESLint, then it's a good idea to fork the repository. You can find instructions for forking a repository at [https://help.github.com/articles/fork-a-repo/](https://help.github.com/articles/fork-a-repo/). After forking the ESLint repository, you'll want to create a local copy of your fork.
+
+## Start Developing
+
+Before you can get started developing, you'll need to have a couple of things installed:
+
+* [Node.JS](https://nodejs.org)
+* [npm](https://www.npmjs.com/)
+
+Once you have a local copy and have Node.JS and npm installed, you'll need to install the ESLint dependencies:
+
+```shell
+cd eslint
+npm install
+```
+
+Now when you run `eslint`, it will be running your local copy and showing your changes.
+
+**Note:** It's a good idea to re-run `npm install` whenever you pull from the main repository to ensure you have the latest development dependencies.
+
+## Directory structure
+
+The ESLint directory and file structure is as follows:
+
+* `bin` - executable files that are available when ESLint is installed
+* `conf` - default configuration information
+* `docs` - documentation for the project
+* `lib` - contains the source code
+    * `formatters` - all source files defining formatters
+    * `rules` - all source files defining rules
+* `tests` - the main unit test folder
+    * `lib` - tests for the source code
+        * `formatters` - tests for the formatters
+        * `rules` - tests for the rules
diff --git a/eslint/docs/src/developer-guide/unit-tests.md b/eslint/docs/src/developer-guide/unit-tests.md
new file mode 100644 (file)
index 0000000..0c8426f
--- /dev/null
@@ -0,0 +1,58 @@
+---
+title: Unit Tests
+layout: doc
+eleventyNavigation:
+    key: run the tests
+    parent: developer guide
+    title: Run the Tests
+    order: 3
+
+---
+
+Most parts of ESLint have unit tests associated with them. Unit tests are written using [Mocha](https://mochajs.org/) and are required when making contributions to ESLint. You'll find all of the unit tests in the `tests` directory.
+
+When you first get the source code, you need to run `npm install` once initially to set ESLint for development. Once you've done that, you can run the tests via:
+
+```shell
+npm test
+```
+
+This automatically starts Mocha and runs all tests in the `tests` directory. You need only add yours and it will automatically be picked up when running tests.
+
+## Running Individual Tests
+
+If you want to quickly run just one test file, you can do so by running Mocha directly and passing in the filename. For example:
+
+```shell
+npm run test:cli tests/lib/rules/no-undef.js
+```
+
+If you want to run just one or a subset of `RuleTester` test cases, add `only: true` to each test case or wrap the test case in `RuleTester.only(...)` to add it automatically:
+
+```js
+ruleTester.run("my-rule", myRule, {
+    valid: [
+        RuleTester.only("const valid = 42;"),
+        // Other valid cases
+    ],
+    invalid: [
+        {
+            code: "const invalid = 42;",
+            only: true,
+        },
+        // Other invalid cases
+    ]
+})
+```
+
+Running individual tests is useful when you're working on a specific bug and iterating on the solution. You should be sure to run `npm test` before submitting a pull request. `npm test` uses Mocha's `--forbid-only` option to prevent `only` tests from passing full test runs.
+
+## More Control on Unit Testing
+
+`npm run test:cli` is an alias of the Mocha cli in `./node_modules/.bin/mocha`. [Options](https://mochajs.org/#command-line-usage) are available to be provided to help to better control the test to run.
+
+The default timeout for tests in `npm test` is 10000ms. You may change the timeout by providing `ESLINT_MOCHA_TIMEOUT` environment variable, for example:
+
+```shell
+ESLINT_MOCHA_TIMEOUT=20000 npm test
+```
diff --git a/eslint/docs/src/developer-guide/working-with-custom-formatters.md b/eslint/docs/src/developer-guide/working-with-custom-formatters.md
new file mode 100644 (file)
index 0000000..1d970ea
--- /dev/null
@@ -0,0 +1,389 @@
+---
+title: Working with Custom Formatters
+layout: doc
+eleventyNavigation:
+    key: working with custom formatters
+    parent: developer guide
+    title: Working with Custom Formatters
+    order: 6
+
+---
+
+While ESLint has some built-in formatters available to format the linting results, it's also possible to create and distribute your own custom formatters. You can include custom formatters in your project directly or create an npm package to distribute them separately.
+
+Each formatter is just a function that receives a `results` object and a `context` and returns a string. For example, the following is how the `json` built-in formatter is implemented:
+
+```js
+//my-awesome-formatter.js
+module.exports = function(results, context) {
+    return JSON.stringify(results, null, 2);
+};
+```
+
+A formatter can also be an async function (from ESLint v8.4.0), the following shows a simple example:
+
+```js
+//my-awesome-formatter.js
+module.exports = async function(results) {
+    const formatted = await asyncTask();
+    return formatted;
+};
+```
+
+To run ESLint with this formatter, you can use the `-f` (or `--format`) command line flag:
+
+```bash
+eslint -f ./my-awesome-formatter.js src/
+```
+
+In order to use a local file as a custom formatter, you must begin the filename with a dot (such as `./my-awesome-formatter.js` or `../formatters/my-awesome-formatter.js`).
+
+## Packaging the Custom Formatter
+
+Custom formatters can also be distributed through npm packages. To do so, create an npm package with a name in the format of `eslint-formatter-*`, where `*` is the name of your formatter (such as `eslint-formatter-awesome`). Projects should then install the package and can use the custom formatter with the `-f` (or `--format`) flag like this:
+
+```bash
+eslint -f awesome src/
+```
+
+Because ESLint knows to look for packages beginning with `eslint-formatter-` when the specified formatter doesn't begin with a dot, there is no need to type `eslint-formatter-` when using a packaged custom formatter.
+
+Tips for `package.json`:
+
+* The `main` entry should be the JavaScript file implementing your custom formatter.
+* Add these `keywords` to help users find your formatter:
+    * `"eslint"`
+    * `"eslint-formatter"`
+    * `"eslintformatter"`
+
+See all [formatters on npm](https://www.npmjs.com/search?q=eslint-formatter);
+
+## The `results` Argument
+
+The `results` object passed into a formatter is an array of objects containing the lint results for individual files. Here's some example output:
+
+```js
+[
+    {
+        filePath: "/path/to/a/file.js",
+        messages: [
+            {
+                ruleId: "curly",
+                severity: 2,
+                message: "Expected { after 'if' condition.",
+                line: 2,
+                column: 1,
+                nodeType: "IfStatement"
+            },
+            {
+                ruleId: "no-process-exit",
+                severity: 2,
+                message: "Don't use process.exit(); throw an error instead.",
+                line: 3,
+                column: 1,
+                nodeType: "CallExpression"
+            }
+        ],
+        errorCount: 2,
+        warningCount: 0,
+        fixableErrorCount: 0,
+        fixableWarningCount: 0,
+        source:
+            "var err = doStuff();\nif (err) console.log('failed tests: ' + err);\nprocess.exit(1);\n"
+    },
+    {
+        filePath: "/path/to/Gruntfile.js",
+        messages: [],
+        errorCount: 0,
+        warningCount: 0,
+        fixableErrorCount: 0,
+        fixableWarningCount: 0
+    }
+]
+```
+
+### The `result` Object
+
+<!-- This section is copied from the "Node.js API" page. Changes to this section should
+also be manually applied to that page. -->
+
+Each object in the `results` array is a `result` object. Each `result` object contains the path of the file that was linted and information about linting issues that were encountered. Here are the properties available on each `result` object:
+
+* **filePath**: The absolute path to the file that was linted.
+* **messages**: An array of `message` objects. See below for more info about messages.
+* **errorCount**: The number of errors for the given file.
+* **warningCount**: The number of warnings for the given file.
+* **source**: The source code for the given file. This property is omitted if this file has no errors/warnings or if the `output` property is present.
+* **output**: The source code for the given file with as many fixes applied as possible. This property is omitted if no fix is available.
+
+### The `message` Object
+
+Each `message` object contains information about the ESLint rule that was triggered by some source code. The properties available on each `message` object are:
+
+* **ruleId**: the ID of the rule that produced the error or warning.
+* **severity**: the severity of the failure, `1` for warnings and `2` for errors.
+* **message**: the human readable description of the error.
+* **line**: the line where the issue is located.
+* **column**: the column where the issue is located.
+* **nodeType**: the type of the node in the [AST](https://github.com/estree/estree/blob/master/spec.md#node-objects)
+
+## The `context` Argument
+
+The formatter function receives an object as the second argument. The object has two properties:
+
+* `cwd` ... The current working directory. This value comes from the `cwd` constructor option of the [ESLint](nodejs-api#-new-eslintoptions) class.
+* `rulesMeta` ... The `meta` property values of rules. See the [Working with Rules](working-with-rules) page for more information about rules.
+
+For example, here's what the object would look like if one rule, `no-extra-semi`, had been run:
+
+```js
+{
+    cwd: "/path/to/cwd",
+    rulesMeta: {
+        "no-extra-semi": {
+            type: "suggestion",
+            docs: {
+                description: "disallow unnecessary semicolons",
+                recommended: true,
+                url: "https://eslint.org/docs/rules/no-extra-semi"
+            },
+            fixable: "code",
+            schema: [],
+            messages: {
+                unexpected: "Unnecessary semicolon."
+            }
+        }
+    }
+}
+```
+
+**Note:** if a linting is executed by deprecated `CLIEngine` class, the `context` argument may be a different value because it is up to the API users. Please check whether the `context` argument is an expected value or not if you want to support legacy environments.
+
+## Examples
+
+### Summary formatter
+
+A formatter that only cares about the total count of errors and warnings will look like this:
+
+```javascript
+module.exports = function(results, context) {
+    // accumulate the errors and warnings
+    var summary = results.reduce(
+        function(seq, current) {
+            seq.errors += current.errorCount;
+            seq.warnings += current.warningCount;
+            return seq;
+        },
+        { errors: 0, warnings: 0 }
+    );
+
+    if (summary.errors > 0 || summary.warnings > 0) {
+        return (
+            "Errors: " +
+            summary.errors +
+            ", Warnings: " +
+            summary.warnings +
+            "\n"
+        );
+    }
+
+    return "";
+};
+```
+
+Running `eslint` with the previous custom formatter,
+
+```bash
+eslint -f ./my-awesome-formatter.js src/
+```
+
+Will produce the following output:
+
+```bash
+Errors: 2, Warnings: 4
+```
+
+### Detailed formatter
+
+A more complex report will look something like this:
+
+```javascript
+module.exports = function(results, context) {
+    var results = results || [];
+
+    var summary = results.reduce(
+        function(seq, current) {
+            current.messages.forEach(function(msg) {
+                var logMessage = {
+                    filePath: current.filePath,
+                    ruleId: msg.ruleId,
+                    ruleUrl: context.rulesMeta[msg.ruleId].docs.url,
+                    message: msg.message,
+                    line: msg.line,
+                    column: msg.column
+                };
+
+                if (msg.severity === 1) {
+                    logMessage.type = "warning";
+                    seq.warnings.push(logMessage);
+                }
+                if (msg.severity === 2) {
+                    logMessage.type = "error";
+                    seq.errors.push(logMessage);
+                }
+            });
+            return seq;
+        },
+        {
+            errors: [],
+            warnings: []
+        }
+    );
+
+    if (summary.errors.length > 0 || summary.warnings.length > 0) {
+        var lines = summary.errors
+            .concat(summary.warnings)
+            .map(function(msg) {
+                return (
+                    "\n" +
+                    msg.type +
+                    " " +
+                    msg.ruleId + (msg.ruleUrl ? " (" + msg.ruleUrl + ")" : "") +
+                    "\n  " +
+                    msg.filePath +
+                    ":" +
+                    msg.line +
+                    ":" +
+                    msg.column
+                );
+            })
+            .join("\n");
+
+        return lines + "\n";
+    }
+};
+```
+
+So running `eslint` with this custom formatter:
+
+```bash
+eslint -f ./my-awesome-formatter.js src/
+```
+
+The output will be
+
+```bash
+error space-infix-ops (https://eslint.org/docs/rules/space-infix-ops)
+  src/configs/bundler.js:6:8
+error semi (https://eslint.org/docs/rules/semi)
+  src/configs/bundler.js:6:10
+warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
+  src/configs/bundler.js:5:6
+warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
+  src/configs/bundler.js:6:6
+warning no-shadow (https://eslint.org/docs/rules/no-shadow)
+  src/configs/bundler.js:65:32
+warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars)
+  src/configs/clean.js:3:6
+```
+
+## Passing Arguments to Formatters
+
+While formatter functions do not receive arguments in addition to the results object and the context, it is possible to pass additional data into custom formatters using the methods described below.
+
+## Using Environment Variables
+
+Custom formatters have access to environment variables and so can change their behavior based on environment variable data. Here's an example that uses a `AF_SKIP_WARNINGS` environment variable to determine whether or not to show warnings in the results:
+
+```js
+module.exports = function(results) {
+    var skipWarnings = process.env.AF_SKIP_WARNINGS === "true"; //af stands for awesome-formatter
+
+    var results = results || [];
+    var summary = results.reduce(
+        function(seq, current) {
+            current.messages.forEach(function(msg) {
+                var logMessage = {
+                    filePath: current.filePath,
+                    ruleId: msg.ruleId,
+                    message: msg.message,
+                    line: msg.line,
+                    column: msg.column
+                };
+
+                if (msg.severity === 1) {
+                    logMessage.type = "warning";
+                    seq.warnings.push(logMessage);
+                }
+                if (msg.severity === 2) {
+                    logMessage.type = "error";
+                    seq.errors.push(logMessage);
+                }
+            });
+            return seq;
+        },
+        {
+            errors: [],
+            warnings: []
+        }
+    );
+
+    if (summary.errors.length > 0 || summary.warnings.length > 0) {
+        var warnings = !skipWarnings ? summary.warnings : []; // skip the warnings in that case
+
+        var lines = summary.errors
+            .concat(warnings)
+            .map(function(msg) {
+                return (
+                    "\n" +
+                    msg.type +
+                    " " +
+                    msg.ruleId +
+                    "\n  " +
+                    msg.filePath +
+                    ":" +
+                    msg.line +
+                    ":" +
+                    msg.column
+                );
+            })
+            .join("\n");
+
+        return lines + "\n";
+    }
+};
+```
+
+You would run ESLint with this custom formatter and an environment variable set like this:
+
+```bash
+AF_SKIP_WARNINGS=true eslint -f ./my-awesome-formatter.js src/
+```
+
+The output would be:
+
+```bash
+error space-infix-ops
+  src/configs/bundler.js:6:8
+
+error semi
+  src/configs/bundler.js:6:10
+```
+
+### Complex Argument Passing
+
+If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](https://eslint.org/docs/user-guide/formatters/) and pipe the output to a second program. For example:
+
+```bash
+eslint -f json src/ | your-program-that-reads-JSON --option
+```
+
+In this example, the `your-program-that-reads-json` program can accept the raw JSON of ESLint results and process it before outputting its own format of the results. You can pass as many command line arguments to that program as are necessary to customize the output.
+
+## Note: Formatting for Terminals
+
+Modern terminals like [iTerm2](https://www.iterm2.com/) or [Guake](http://guake-project.org/) expect a specific results format to automatically open filenames when they are clicked. Most terminals support this format for that purpose:
+
+```bash
+file:line:column
+```
diff --git a/eslint/docs/src/developer-guide/working-with-custom-parsers.md b/eslint/docs/src/developer-guide/working-with-custom-parsers.md
new file mode 100644 (file)
index 0000000..62707b3
--- /dev/null
@@ -0,0 +1,82 @@
+---
+title: Working with Custom Parsers
+layout: doc
+eleventyNavigation:
+    key: working with custom parsers
+    parent: developer guide
+    title: Working with Custom Parsers
+    order: 7
+
+---
+
+If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and optional properties `services`, `scopeManager`, and `visitorKeys`.
+
+* `ast` should contain the AST.
+* `services` can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`. Default is an empty object.
+* `scopeManager` can be a [ScopeManager](./scope-manager-interface) object. Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. Default is the `ScopeManager` object which is created by [eslint-scope](https://github.com/eslint/eslint-scope).
+    * Support for `scopeManager` was added in ESLint v4.14.0. ESLint versions which support `scopeManager` will provide an `eslintScopeManager: true` property in `parserOptions`, which can be used for feature detection.
+* `visitorKeys` can be an object to customize AST traversal. The keys of the object are the type of AST nodes. Each value is an array of the property names which should be traversed. Default is [KEYS of `eslint-visitor-keys`](https://github.com/eslint/eslint-visitor-keys#evkkeys).
+    * Support for `visitorKeys` was added in ESLint v4.14.0. ESLint versions which support `visitorKeys` will provide an `eslintVisitorKeys: true` property in `parserOptions`, which can be used for feature detection.
+
+You can find an ESLint parser project [here](https://github.com/typescript-eslint/typescript-eslint).
+
+```json
+{
+    "parser": "./path/to/awesome-custom-parser.js"
+}
+```
+
+```javascript
+var espree = require("espree");
+// awesome-custom-parser.js
+exports.parseForESLint = function(code, options) {
+    return {
+        ast: espree.parse(code, options),
+        services: {
+            foo: function() {
+                console.log("foo");
+            }
+        },
+        scopeManager: null,
+        visitorKeys: null
+    };
+};
+
+```
+
+## The AST specification
+
+The AST that custom parsers should create is based on [ESTree](https://github.com/estree/estree). The AST requires some additional properties about detail information of the source code.
+
+### All nodes:
+
+All nodes must have `range` property.
+
+* `range` (`number[]`) is an array of two numbers. Both numbers are a 0-based index which is the position in the array of source code characters. The first is the start position of the node, the second is the end position of the node. `code.slice(node.range[0], node.range[1])` must be the text of the node. This range does not include spaces/parentheses which are around the node.
+* `loc` (`SourceLocation`) must not be `null`. [The `loc` property is defined as nullable by ESTree](https://github.com/estree/estree/blob/25834f7247d44d3156030f8e8a2d07644d771fdb/es5.md#node-objects), but ESLint requires this property. On the other hand, `SourceLocation#source` property can be `undefined`. ESLint does not use the `SourceLocation#source` property.
+
+The `parent` property of all nodes must be rewritable. ESLint sets each node's `parent` property to its parent node while traversing, before any rules have access to the AST.
+
+### The `Program` node:
+
+The `Program` node must have `tokens` and `comments` properties. Both properties are an array of the below Token interface.
+
+```ts
+interface Token {
+    type: string;
+    loc: SourceLocation;
+    range: [number, number]; // See "All nodes:" section for details of `range` property.
+    value: string;
+}
+```
+
+* `tokens` (`Token[]`) is the array of tokens which affect the behavior of programs. Arbitrary spaces can exist between tokens, so rules check the `Token#range` to detect spaces between tokens. This must be sorted by `Token#range[0]`.
+* `comments` (`Token[]`) is the array of comment tokens. This must be sorted by `Token#range[0]`.
+
+The range indexes of all tokens and comments must not overlap with the range of other tokens and comments.
+
+### The `Literal` node:
+
+The `Literal` node must have `raw` property.
+
+* `raw` (`string`) is the source code of this literal. This is the same as `code.slice(node.range[0], node.range[1])`.
diff --git a/eslint/docs/src/developer-guide/working-with-plugins.md b/eslint/docs/src/developer-guide/working-with-plugins.md
new file mode 100644 (file)
index 0000000..cec3f88
--- /dev/null
@@ -0,0 +1,249 @@
+---
+title: Working with Plugins
+layout: doc
+eleventyNavigation:
+    key: working with plugings
+    parent: developer guide
+    title: Working with Plugins
+    order: 5
+
+---
+
+Each plugin is an npm module with a name in the format of `eslint-plugin-<plugin-name>`, such as `eslint-plugin-jquery`. You can also use scoped packages in the format of `@<scope>/eslint-plugin-<plugin-name>` such as `@jquery/eslint-plugin-jquery` or even `@<scope>/eslint-plugin` such as `@jquery/eslint-plugin`.
+
+## Create a Plugin
+
+The easiest way to start creating a plugin is to use the [Yeoman generator](https://www.npmjs.com/package/generator-eslint). The generator will guide you through setting up the skeleton of a plugin.
+
+### Rules in Plugins
+
+Plugins can expose additional rules for use in ESLint. To do so, the plugin must export a `rules` object containing a key-value mapping of rule ID to rule. The rule ID does not have to follow any naming convention (so it can just be `dollar-sign`, for instance).
+
+```js
+module.exports = {
+    rules: {
+        "dollar-sign": {
+            create: function (context) {
+                // rule implementation ...
+            }
+        }
+    }
+};
+```
+
+To use the rule in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the rule name. So if this plugin were named `eslint-plugin-myplugin`, then in your configuration you'd refer to the rule by the name `myplugin/dollar-sign`. Example: `"rules": {"myplugin/dollar-sign": 2}`.
+
+### Environments in Plugins
+
+Plugins can expose additional environments for use in ESLint. To do so, the plugin must export an `environments` object. The keys of the `environments` object are the names of the different environments provided and the values are the environment settings. For example:
+
+```js
+module.exports = {
+    environments: {
+        jquery: {
+            globals: {
+                $: false
+            }
+        }
+    }
+};
+```
+
+There's a `jquery` environment defined in this plugin. To use the environment in ESLint, you would use the unprefixed plugin name, followed by a slash, followed by the environment name. So if this plugin were named `eslint-plugin-myplugin`, then you would set the environment in your configuration to be `"myplugin/jquery"`.
+
+Plugin environments can define the following objects:
+
+1. `globals` - acts the same `globals` in a configuration file. The keys are the names of the globals and the values are `true` to allow the global to be overwritten and `false` to disallow.
+1. `parserOptions` - acts the same as `parserOptions` in a configuration file.
+
+### Processors in Plugins
+
+You can also create plugins that would tell ESLint how to process files other than JavaScript. In order to create a processor, the object that is exported from your module has to conform to the following interface:
+
+```js
+module.exports = {
+    processors: {
+        "processor-name": {
+            // takes text of the file and filename
+            preprocess: function(text, filename) {
+                // here, you can strip out any non-JS content
+                // and split into multiple strings to lint
+
+                return [ // return an array of code blocks to lint
+                    { text: code1, filename: "0.js" },
+                    { text: code2, filename: "1.js" },
+                ];
+            },
+
+            // takes a Message[][] and filename
+            postprocess: function(messages, filename) {
+                // `messages` argument contains two-dimensional array of Message objects
+                // where each top-level array item contains array of lint messages related
+                // to the text that was returned in array from preprocess() method
+
+                // you need to return a one-dimensional array of the messages you want to keep
+                return [].concat(...messages);
+            },
+
+            supportsAutofix: true // (optional, defaults to false)
+        }
+    }
+};
+```
+
+**The `preprocess` method** takes the file contents and filename as arguments, and returns an array of code blocks to lint. The code blocks will be linted separately but still be registered to the filename.
+
+A code block has two properties `text` and `filename`; the `text` property is the content of the block and the `filename` property is the name of the block. Name of the block can be anything, but should include the file extension, that would tell the linter how to process the current block. The linter will check [`--ext` CLI option](../user-guide/command-line-interface#--ext) to see if the current block should be linted, and resolve `overrides` configs to check how to process the current block.
+
+It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.
+
+**The `postprocess` method** takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the locations of all errors to correspond to locations in the original, unprocessed code, and aggregate them into a single flat array and return it.
+
+Reported problems have the following location information:
+
+```typescript
+{
+    line: number,
+    column: number,
+
+    endLine?: number,
+    endColumn?: number
+}
+```
+
+By default, ESLint will not perform autofixes when a processor is used, even when the `--fix` flag is enabled on the command line. To allow ESLint to autofix code when using your processor, you should take the following additional steps:
+
+1. Update the `postprocess` method to additionally transform the `fix` property of reported problems. All autofixable problems will have a `fix` property, which is an object with the following schema:
+
+    ```js
+    {
+        range: [number, number],
+        text: string
+    }
+    ```
+
+    The `range` property contains two indexes in the code, referring to the start and end location of a contiguous section of text that will be replaced. The `text` property refers to the text that will replace the given range.
+
+    In the initial list of problems, the `fix` property will refer to a fix in the processed JavaScript. The `postprocess` method should transform the object to refer to a fix in the original, unprocessed file.
+
+2. Add a `supportsAutofix: true` property to the processor.
+
+You can have both rules and processors in a single plugin. You can also have multiple processors in one plugin.
+To support multiple extensions, add each one to the `processors` element and point them to the same object.
+
+#### Specifying Processor in Config Files
+
+To use a processor, add its ID to a `processor` section in the config file. Processor ID is a concatenated string of plugin name and processor name with a slash as a separator. This can also be added to a `overrides` section of the config, to specify which processors should handle which files.
+
+For example:
+
+```yml
+plugins:
+  - a-plugin
+overrides:
+  - files: "*.md"
+    processor: a-plugin/markdown
+```
+
+See [Specifying Processor](../user-guide/configuring/plugins#specifying-processor) for details.
+
+#### File Extension-named Processor
+
+If a processor name starts with `.`, ESLint handles the processor as a **file extension-named processor** especially and applies the processor to the kind of files automatically. People don't need to specify the file extension-named processors in their config files.
+
+For example:
+
+```js
+module.exports = {
+    processors: {
+        // This processor will be applied to `*.md` files automatically.
+        // Also, people can use this processor as "plugin-id/.md" explicitly.
+        ".md": {
+            preprocess(text, filename) { /* ... */ },
+            postprocess(messageLists, filename) { /* ... */ }
+        }
+    }
+}
+```
+
+### Configs in Plugins
+
+You can bundle configurations inside a plugin by specifying them under the `configs` key. This can be useful when you want to provide not just code style, but also some custom rules to support it. Multiple configurations are supported per plugin. Note that it is not possible to specify a default configuration for a given plugin and that users must specify in their configuration file when they want to use one.
+
+```js
+// eslint-plugin-myPlugin
+
+module.exports = {
+    configs: {
+        myConfig: {
+            plugins: ["myPlugin"],
+            env: ["browser"],
+            rules: {
+                semi: "error",
+                "myPlugin/my-rule": "error",
+                "eslint-plugin-myPlugin/another-rule": "error"
+            }
+        },
+        myOtherConfig: {
+            plugins: ["myPlugin"],
+            env: ["node"],
+            rules: {
+                "myPlugin/my-rule": "off",
+                "eslint-plugin-myPlugin/another-rule": "off",
+                "eslint-plugin-myPlugin/yet-another-rule": "error"
+            }
+        }
+    }
+};
+```
+
+If the example plugin above were called `eslint-plugin-myPlugin`, the `myConfig` and `myOtherConfig` configurations would then be usable by extending off of `"plugin:myPlugin/myConfig"` and `"plugin:myPlugin/myOtherConfig"`, respectively.
+
+```json
+{
+    "extends": ["plugin:myPlugin/myConfig"]
+}
+
+```
+
+**Note:** Please note that configuration will not enable any of the plugin's rules by default, and instead should be treated as a standalone config. This means that you must specify your plugin name in the `plugins` array as well as any rules you want to enable that are part of the plugin. Any plugin rules must be prefixed with the short or long plugin name. See [Configuring Plugins](../user-guide/configuring/plugins#configuring-plugins) for more information.
+
+### Peer Dependency
+
+To make clear that the plugin requires ESLint to work correctly you have to declare ESLint as a `peerDependency` in your `package.json`.
+The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDependency` points to ESLint `0.8.0` or later.
+
+```json
+{
+    "peerDependencies": {
+        "eslint": ">=0.8.0"
+    }
+}
+```
+
+### Testing
+
+ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to test the rules of your plugin.
+
+### Linting
+
+ESLint plugins should be linted too! It's suggested to lint your plugin with the `recommended` configurations of:
+
+* [eslint](https://www.npmjs.com/package/eslint)
+* [eslint-plugin-eslint-plugin](https://www.npmjs.com/package/eslint-plugin-eslint-plugin)
+* [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node)
+
+## Share Plugins
+
+In order to make your plugin available to the community you have to publish it on npm.
+
+Recommended keywords:
+
+* `eslint`
+* `eslintplugin`
+
+Add these keywords into your `package.json` file to make it easy for others to find.
+
+## Further Reading
+
+* [npm Developer Guide](https://docs.npmjs.com/misc/developers)
diff --git a/eslint/docs/src/developer-guide/working-with-rules-deprecated.md b/eslint/docs/src/developer-guide/working-with-rules-deprecated.md
new file mode 100644 (file)
index 0000000..bd3fd77
--- /dev/null
@@ -0,0 +1,581 @@
+---
+title: Working with Rules (Deprecated)
+layout: doc
+
+---
+
+**Note:** This page covers the deprecated rule format for ESLint <= 2.13.1. [This is the most recent rule format](./working-with-rules).
+
+Each rule in ESLint has two files named with its identifier (for example, `no-extra-semi`).
+
+* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
+* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
+
+**Important:** If you submit a **core** rule to the ESLint repository, you **must** follow some conventions explained below.
+
+Here is the basic format of the source file for a rule:
+
+```js
+/**
+ * @fileoverview Rule to disallow unnecessary semicolons
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+    return {
+        // callback functions
+    };
+};
+
+module.exports.schema = []; // no options
+```
+
+## Rule Basics
+
+`schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring/rules#configuring-rules)
+
+`create` (function) returns an object with methods that ESLint calls to "visit" nodes while traversing the abstract syntax tree (AST as defined by [ESTree](https://github.com/estree/estree)) of JavaScript code:
+
+* if a key is a node type, ESLint calls that **visitor** function while going **down** the tree
+* if a key is a node type plus `:exit`, ESLint calls that **visitor** function while going **up** the tree
+* if a key is an event name, ESLint calls that **handler** function for [code path analysis](./code-path-analysis)
+
+A rule can use the current node and its surrounding tree to report or fix problems.
+
+Here are methods for the [array-callback-return](../rules/array-callback-return) rule:
+
+```js
+function checkLastSegment (node) {
+    // report problem for function if last code path segment is reachable
+}
+
+module.exports = function(context) {
+    // declare the state of the rule
+    return {
+        ReturnStatement: function(node) {
+            // at a ReturnStatement node while going down
+        },
+        // at a function expression node while going up:
+        "FunctionExpression:exit": checkLastSegment,
+        "ArrowFunctionExpression:exit": checkLastSegment,
+        onCodePathStart: function (codePath, node) {
+            // at the start of analyzing a code path
+        },
+        onCodePathEnd: function(codePath, node) {
+            // at the end of analyzing a code path
+        }
+    };
+};
+```
+
+## The Context Object
+
+The `context` object contains additional functionality that is helpful for rules to do their jobs. As the name implies, the `context` object contains information that is relevant to the context of the rule. The `context` object has the following properties:
+
+* `parserOptions` - the parser options configured for this run (more details [here](../user-guide/configuring/language-options#specifying-parser-options)).
+* `id` - the rule ID.
+* `options` - an array of rule options.
+* `settings` - the `settings` from configuration.
+* `parserPath` - the full path to the `parser` from configuration.
+
+Additionally, the `context` object has the following methods:
+
+* `getAncestors()` - returns an array of ancestor nodes based on the current traversal.
+* `getDeclaredVariables(node)` - returns the declared variables on the given node.
+* `getFilename()` - returns the filename associated with the source.
+* `getScope()` - returns the current scope.
+* `getSourceCode()` - returns a `SourceCode` object that you can use to work with the source that was passed to ESLint
+* `markVariableAsUsed(name)` - marks the named variable in scope as used. This affects the [no-unused-vars](../rules/no-unused-vars) rule.
+* `report(descriptor)` - reports a problem in the code.
+
+**Deprecated:** The following methods on the `context` object are deprecated. Please use the corresponding methods on `SourceCode` instead:
+
+* `getAllComments()` - returns an array of all comments in the source. Use `sourceCode.getAllComments()` instead.
+* `getComments(node)` - returns the leading and trailing comments arrays for the given node. Use `sourceCode.getComments(node)` instead.
+* `getFirstToken(node)` - returns the first token representing the given node. Use `sourceCode.getFirstToken(node)` instead.
+* `getFirstTokens(node, count)` - returns the first `count` tokens representing the given node. Use `sourceCode.getFirstTokens(node, count)` instead.
+* `getJSDocComment(node)` - returns the JSDoc comment for a given node or `null` if there is none. Use `sourceCode.getJSDocComment(node)` instead.
+* `getLastToken(node)` - returns the last token representing the given node.  Use `sourceCode.getLastToken(node)` instead.
+* `getLastTokens(node, count)` - returns the last `count` tokens representing the given node. Use `sourceCode.getLastTokens(node, count)` instead.
+* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index. Use `sourceCode.getNodeByRangeIndex(index)` instead.
+* `getSource(node)` - returns the source code for the given node. Omit `node` to get the whole source. Use `sourceCode.getText(node)` instead.
+* `getSourceLines()` - returns the entire source code split into an array of string lines. Use `sourceCode.lines` instead.
+* `getTokenAfter(nodeOrToken)` - returns the first token after the given node or token. Use `sourceCode.getTokenAfter(nodeOrToken)` instead.
+* `getTokenBefore(nodeOrToken)` - returns the first token before the given node or token. Use `sourceCode.getTokenBefore(nodeOrToken)` instead.
+* `getTokenByRangeStart(index)` - returns the token whose range starts at the given index in the source. Use `sourceCode.getTokenByRangeStart(index)` instead.
+* `getTokens(node)` - returns all tokens for the given node. Use `sourceCode.getTokens(node)` instead.
+* `getTokensAfter(nodeOrToken, count)` - returns `count` tokens after the given node or token. Use `sourceCode.getTokensAfter(nodeOrToken, count)` instead.
+* `getTokensBefore(nodeOrToken, count)` - returns `count` tokens before the given node or token. Use `sourceCode.getTokensBefore(nodeOrToken, count)` instead.
+* `getTokensBetween(node1, node2)` - returns the tokens between two nodes. Use `sourceCode.getTokensBetween(node1, node2)` instead.
+* `report(node, [location], message)` - reports a problem in the code.
+
+### context.report()
+
+The main method you'll use is `context.report()`, which publishes a warning or error (depending on the configuration being used). This method accepts a single argument, which is an object containing the following properties:
+
+* `message` - the problem message.
+* `node` - (optional)  the AST node related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
+* `loc` - (optional) an object specifying the location of the problem. If both `loc` and `node` are specified, then the location is used from `loc` instead of `node`.
+    * `line` - the 1-based line number at which the problem occurred.
+    * `column` - the 0-based column number at which the problem occurred.
+* `data` - (optional) placeholder data for `message`.
+* `fix` - (optional) a function that applies a fix to resolve the problem.
+
+Note that at least one of `node` or `loc` is required.
+
+The simplest example is to use just `node` and `message`:
+
+```js
+context.report({
+    node: node,
+    message: "Unexpected identifier"
+});
+```
+
+The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
+
+You can also use placeholders in the message and provide `data`:
+
+```js
+{% raw %}
+context.report({
+    node: node,
+    message: "Unexpected identifier: {{ identifier }}",
+    data: {
+        identifier: node.name
+    }
+});
+{% endraw %}
+```
+
+Note that leading and trailing whitespace is optional in message parameters.
+
+The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
+
+### Applying Fixes
+
+If you'd like ESLint to attempt to fix the problem you're reporting, you can do so by specifying the `fix` function when using `context.report()`. The `fix` function receives a single argument, a `fixer` object, that you can use to apply a fix. For example:
+
+```js
+context.report({
+    node: node,
+    message: "Missing semicolon".
+    fix: function(fixer) {
+        return fixer.insertTextAfter(node, ";");
+    }
+});
+```
+
+Here, the `fix()` function is used to insert a semicolon after the node. Note that the fix is not immediately applied and may not be applied at all if there are conflicts with other fixes. If the fix cannot be applied, then the problem message is reported as usual; if the fix can be applied, then the problem message is not reported.
+
+The `fixer` object has the following methods:
+
+* `insertTextAfter(nodeOrToken, text)` - inserts text after the given node or token
+* `insertTextAfterRange(range, text)` - inserts text after the given range
+* `insertTextBefore(nodeOrToken, text)` - inserts text before the given node or token
+* `insertTextBeforeRange(range, text)` - inserts text before the given range
+* `remove(nodeOrToken)` - removes the given node or token
+* `removeRange(range)` - removes text in the given range
+* `replaceText(nodeOrToken, text)` - replaces the text in the given node or token
+* `replaceTextRange(range, text)` - replaces the text in the given range
+
+Best practices for fixes:
+
+1. Make fixes that are as small as possible. Anything more than a single character is risky and could prevent other, simpler fixes from being made.
+1. Only make one fix per message. This is enforced because you must return the result of the fixer operation from `fix()`.
+1. Fixes should not introduce clashes with other rules. You can accidentally introduce a new problem that won't be reported until ESLint is run again. Another good reason to make as small a fix as possible.
+
+### context.options
+
+Some rules require options in order to function correctly. These options appear in configuration (`.eslintrc`, command line, or in comments). For example:
+
+```json
+{
+    "quotes": [2, "double"]
+}
+```
+
+The `quotes` rule in this example has one option, `"double"` (the `2` is the error level). You can retrieve the options for a rule by using `context.options`, which is an array containing every configured option for the rule. In this case, `context.options[0]` would contain `"double"`:
+
+```js
+module.exports = function(context) {
+
+    var isDouble = (context.options[0] === "double");
+
+    // ...
+}
+```
+
+Since `context.options` is just an array, you can use it to determine how many options have been passed as well as retrieving the actual options themselves. Keep in mind that the error level is not part of `context.options`, as the error level cannot be known or modified from inside a rule.
+
+When using options, make sure that your rule has some logic defaults in case the options are not provided.
+
+### context.getSourceCode()
+
+The `SourceCode` object is the main object for getting more information about the source code being linted. You can retrieve the `SourceCode` object at any time by using the `getSourceCode()` method:
+
+```js
+module.exports = function(context) {
+
+    var sourceCode = context.getSourceCode();
+
+    // ...
+}
+```
+
+Once you have an instance of `SourceCode`, you can use the methods on it to work with the code:
+
+* `getAllComments()` - returns an array of all comments in the source.
+* `getComments(node)` - returns the leading and trailing comments arrays for the given node.
+* `getFirstToken(node)` - returns the first token representing the given node.
+* `getFirstTokens(node, count)` - returns the first `count` tokens representing the given node.
+* `getJSDocComment(node)` - returns the JSDoc comment for a given node or `null` if there is none.
+* `getLastToken(node)` - returns the last token representing the given node.
+* `getLastTokens(node, count)` - returns the last `count` tokens representing the given node.
+* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index.
+* `isSpaceBetweenTokens(first, second)` - returns true if there is a whitespace character between the two tokens.
+* `getText(node)` - returns the source code for the given node. Omit `node` to get the whole source.
+* `getTokenAfter(nodeOrToken)` - returns the first token after the given node or token.
+* `getTokenBefore(nodeOrToken)` - returns the first token before the given node or token.
+* `getTokenByRangeStart(index)` - returns the token whose range starts at the given index in the source.
+* `getTokens(node)` - returns all tokens for the given node.
+* `getTokensAfter(nodeOrToken, count)` - returns `count` tokens after the given node or token.
+* `getTokensBefore(nodeOrToken, count)` - returns `count` tokens before the given node or token.
+* `getTokensBetween(node1, node2)` - returns the tokens between two nodes.
+
+There are also some properties you can access:
+
+* `hasBOM` - the flag to indicate whether or not the source code has Unicode BOM.
+* `text` - the full text of the code being linted. Unicode BOM has been stripped from this text.
+* `ast` - the `Program` node of the AST for the code being linted.
+* `lines` - an array of lines, split according to the specification's definition of line breaks.
+
+You should use a `SourceCode` object whenever you need to get more information about the code being linted.
+
+### Options Schemas
+
+Rules may export a `schema` property, which is a [JSON schema](http://json-schema.org/) format description of a rule's options which will be used by ESLint to validate configuration options and prevent invalid or unexpected inputs before they are passed to the rule in `context.options`.
+
+There are two formats for a rule's exported `schema`. The first is a full JSON Schema object describing all possible options the rule accepts, including the rule's error level as the first argument and any optional arguments thereafter.
+
+However, to simplify schema creation, rules may also export an array of schemas for each optional positional argument, and ESLint will automatically validate the required error level first. For example, the `yoda` rule accepts a primary mode argument, as well as an extra options object with named properties.
+
+```js
+// "yoda": [2, "never", { "exceptRange": true }]
+module.exports.schema = [
+    {
+        "enum": ["always", "never"]
+    },
+    {
+        "type": "object",
+        "properties": {
+            "exceptRange": {
+                "type": "boolean"
+            }
+        },
+        "additionalProperties": false
+    }
+];
+```
+
+In the preceding example, the error level is assumed to be the first argument. It is followed by the first optional argument, a string which may be either `"always"` or `"never"`. The final optional argument is an object, which may have a Boolean property named `exceptRange`.
+
+To learn more about JSON Schema, we recommend looking at some [examples](http://json-schema.org/examples.html) to start, and also reading [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/) (a free ebook).
+
+### Getting the Source
+
+If your rule needs to get the actual JavaScript source to work with, then use the `sourceCode.getText()` method. This method works as follows:
+
+```js
+
+// get all source
+var source = sourceCode.getText();
+
+// get source for just this AST node
+var nodeSource = sourceCode.getText(node);
+
+// get source for AST node plus previous two characters
+var nodeSourceWithPrev = sourceCode.getText(node, 2);
+
+// get source for AST node plus following two characters
+var nodeSourceWithFollowing = sourceCode.getText(node, 0, 2);
+```
+
+In this way, you can look for patterns in the JavaScript text itself when the AST isn't providing the appropriate data (such as location of commas, semicolons, parentheses, etc.).
+
+### Accessing comments
+
+If you need to access comments for a specific node you can use `sourceCode.getComments(node)`:
+
+```js
+// the "comments" variable has a "leading" and "trailing" property containing
+// its leading and trailing comments, respectively
+var comments = sourceCode.getComments(node);
+```
+
+Keep in mind that comments are technically not a part of the AST and are only attached to it on demand, i.e. when you call `getComments()`.
+
+**Note:** One of the libraries adds AST node properties for comments - do not use these properties. Always use `sourceCode.getComments()` as this is the only guaranteed API for accessing comments (we will likely change how comments are handled later).
+
+### Accessing Code Paths
+
+ESLint analyzes code paths while traversing AST.
+You can access that code path objects with five events related to code paths.
+
+[details here](./code-path-analysis)
+
+## Rule Unit Tests
+
+Each rule must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if your rule source file is `lib/rules/foo.js` then your test file should be `tests/lib/rules/foo.js`.
+
+For your rule, be sure to test:
+
+1. All instances that should be flagged as warnings.
+1. At least one pattern that should **not** be flagged as a warning.
+
+The basic pattern for a rule unit test file is:
+
+```js
+/**
+ * @fileoverview Tests for no-with rule.
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var rule = require("../../../lib/rules/no-with"),
+    RuleTester = require("../../../lib/testers/rule-tester");
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+var ruleTester = new RuleTester();
+ruleTester.run("no-with", rule, {
+    valid: [
+        "foo.bar()"
+    ],
+    invalid: [
+        {
+            code: "with(foo) { bar() }",
+            errors: [{ message: "Unexpected use of 'with' statement.", type: "WithStatement"}]
+        }
+    ]
+});
+```
+
+Be sure to replace the value of `"no-with"` with your rule's ID. There are plenty of examples in the `tests/lib/rules/` directory.
+
+### Valid Code
+
+Each valid case can be either a string or an object. The object form is used when you need to specify additional global variables or arguments for the rule. For example, the following defines `window` as a global variable for code that should not trigger the rule being tested:
+
+```js
+valid: [
+    {
+        code: "window.alert()",
+        globals: [ "window" ]
+    }
+]
+```
+
+You can also pass options to the rule (if it accepts them). These arguments are equivalent to how people can configure rules in their `.eslintrc` file. For example:
+
+```js
+valid: [
+    {
+        code: "var msg = 'Hello';",
+        options: [ "single" ]
+    }
+]
+```
+
+The `options` property must be an array of options. This gets passed through to `context.options` in the rule.
+
+### Invalid Code
+
+Each invalid case must be an object containing the code to test and at least one message that is produced by the rule. The `errors` key specifies an array of objects, each containing a message (your rule may trigger multiple messages for the same code). You should also specify the type of AST node you expect to receive back using the `type` key. The AST node should represent the actual spot in the code where there is a problem. For example:
+
+```js
+invalid: [
+    {
+        code: "function doSomething() { var f; if (true) { var build = true; } f = build; }",
+        errors: [
+            { message: "build used outside of binding context.", type: "Identifier" }
+        ]
+    }
+]
+```
+
+In this case, the message is specific to the variable being used and the AST node type is `Identifier`.
+
+Similar to the valid cases, you can also specify `options` to be passed to the rule:
+
+```js
+invalid: [
+    {
+        code: "function doSomething() { var f; if (true) { var build = true; } f = build; }",
+        options: [ "double" ],
+        errors: [
+            { message: "build used outside of binding context.", type: "Identifier" }
+        ]
+    }
+]
+```
+
+For simpler cases where the only thing that really matters is the error message, you can also specify any `errors` as strings. You can also have some strings and some objects, if you like.
+
+```js
+invalid: [
+    {
+        code: "'single quotes'",
+        options: ["double"],
+        errors: ["Strings must use doublequote."]
+    }
+]
+```
+
+### Specifying Parser Options
+
+Some tests require that a certain parser configuration must be used. This can be specified in test specifications via the `parserOptions` setting.
+
+For example, to set `ecmaVersion` to 6 (in order to use constructs like `for ... of`):
+
+```js
+valid: [
+    {
+        code: "for (x of a) doSomething();",
+        parserOptions: { ecmaVersion: 6 }
+    }
+]
+```
+
+If you are working with ES6 modules:
+
+```js
+valid: [
+    {
+        code: "export default function () {};",
+        parserOptions: { ecmaVersion: 6, sourceType: "module" }
+    }
+]
+```
+
+For non-version specific features such as JSX:
+
+```js
+valid: [
+    {
+        code: "var foo = <div>{bar}</div>",
+        parserOptions: { ecmaFeatures: { jsx: true } }
+    }
+]
+```
+
+The options available and the expected syntax for `parserOptions` is the same as those used in [configuration](../user-guide/configuring/language-options#specifying-parser-options).
+
+### Write Several Tests
+
+Provide as many unit tests as possible. Your pull request will never be turned down for having too many tests submitted with it!
+
+## Performance Testing
+
+To keep the linting process efficient and unobtrusive, it is useful to verify the performance impact of new rules or modifications to existing rules.
+
+### Overall Performance
+
+The `npm run perf` command gives a high-level overview of ESLint running time with default rules (`eslint:recommended`) enabled.
+
+```bash
+$ git checkout main
+Switched to branch 'main'
+
+$ npm run perf
+CPU Speed is 2200 with multiplier 7500000
+Performance Run #1:  1394.689313ms
+Performance Run #2:  1423.295351ms
+Performance Run #3:  1385.09515ms
+Performance Run #4:  1382.406982ms
+Performance Run #5:  1409.68566ms
+Performance budget ok:  1394.689313ms (limit: 3409.090909090909ms)
+
+$ git checkout my-rule-branch
+Switched to branch 'my-rule-branch'
+
+$ npm run perf
+CPU Speed is 2200 with multiplier 7500000
+Performance Run #1:  1443.736547ms
+Performance Run #2:  1419.193291ms
+Performance Run #3:  1436.018228ms
+Performance Run #4:  1473.605485ms
+Performance Run #5:  1457.455283ms
+Performance budget ok:  1443.736547ms (limit: 3409.090909090909ms)
+```
+
+### Per-rule Performance
+
+ESLint has a built-in method to track performance of individual rules. Setting the `TIMING` environment variable will trigger the display, upon linting completion, of the ten longest-running rules, along with their individual running time and relative performance impact as a percentage of total rule processing time.
+
+```bash
+$ TIMING=1 eslint lib
+Rule                    | Time (ms) | Relative
+:-----------------------|----------:|--------:
+no-multi-spaces         |    52.472 |     6.1%
+camelcase               |    48.684 |     5.7%
+no-irregular-whitespace |    43.847 |     5.1%
+valid-jsdoc             |    40.346 |     4.7%
+handle-callback-err     |    39.153 |     4.6%
+space-infix-ops         |    35.444 |     4.1%
+no-undefined            |    25.693 |     3.0%
+no-shadow               |    22.759 |     2.7%
+no-empty-class          |    21.976 |     2.6%
+semi                    |    19.359 |     2.3%
+```
+
+To test one rule explicitly, combine the `--no-eslintrc`, and `--rule` options:
+
+```bash
+$ TIMING=1 eslint --no-eslintrc --rule "quotes: [2, 'double']" lib
+Rule   | Time (ms) | Relative
+:------|----------:|--------:
+quotes |    18.066 |   100.0%
+```
+
+## Rule Naming Conventions
+
+The rule naming conventions for ESLint are fairly simple:
+
+* If your rule is disallowing something, prefix it with `no-` such as `no-eval` for disallowing `eval()` and `no-debugger` for disallowing `debugger`.
+* If your rule is enforcing the inclusion of something, use a short name without a special prefix.
+* Keep your rule names as short as possible, use abbreviations where appropriate, and no more than four words.
+* Use dashes between words.
+
+## Rule Acceptance Criteria
+
+Because rules are highly personal (and therefore very contentious), accepted rules should:
+
+* Not be library-specific.
+* Demonstrate a possible issue that can be resolved by rewriting the code.
+* Be general enough so as to apply for a large number of developers.
+* Not be the opposite of an existing rule.
+* Not overlap with an existing rule.
+
+## Runtime Rules
+
+The thing that makes ESLint different from other linters is the ability to define custom rules at runtime. This is perfect for rules that are specific to your project or company and wouldn't make sense for ESLint to ship with. With runtime rules, you don't have to wait for the next version of ESLint or be disappointed that your rule isn't general enough to apply to the larger JavaScript community, just write your rules and include them at runtime.
+
+Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps:
+
+1. Place all of your runtime rules in the same directory (i.e., `eslint_rules`).
+2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `1` or `2` in the configuration file.
+3. Run the [command line interface](../user-guide/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules.
diff --git a/eslint/docs/src/developer-guide/working-with-rules.md b/eslint/docs/src/developer-guide/working-with-rules.md
new file mode 100644 (file)
index 0000000..16412b5
--- /dev/null
@@ -0,0 +1,777 @@
+---
+title: Working with Rules
+layout: doc
+eleventyNavigation:
+    key: working with rules
+    parent: developer guide
+    title: Working with Rules
+    order: 4
+
+---
+
+**Note:** This page covers the most recent rule format for ESLint >= 3.0.0. There is also a [deprecated rule format](./working-with-rules-deprecated).
+
+Each rule in ESLint has three files named with its identifier (for example, `no-extra-semi`).
+
+* in the `lib/rules` directory: a source file (for example, `no-extra-semi.js`)
+* in the `tests/lib/rules` directory: a test file (for example, `no-extra-semi.js`)
+* in the `docs/src/rules` directory: a Markdown documentation file (for example, `no-extra-semi.md`)
+
+**Important:** If you submit a **core** rule to the ESLint repository, you **must** follow some conventions explained below.
+
+Here is the basic format of the source file for a rule:
+
+```js
+/**
+ * @fileoverview Rule to disallow unnecessary semicolons
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+/** @type {import('eslint').Rule.RuleModule} */
+module.exports = {
+    meta: {
+        type: "suggestion",
+
+        docs: {
+            description: "disallow unnecessary semicolons",
+            recommended: true,
+            url: "https://eslint.org/docs/rules/no-extra-semi"
+        },
+        fixable: "code",
+        schema: [] // no options
+    },
+    create: function(context) {
+        return {
+            // callback functions
+        };
+    }
+};
+```
+
+## Rule Basics
+
+The source file for a rule exports an object with the following properties.
+
+`meta` (object) contains metadata for the rule:
+
+* `type` (string) indicates the type of rule, which is one of `"problem"`, `"suggestion"`, or `"layout"`:
+    * `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
+    * `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn't changed.
+    * `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren't specified in the AST.
+
+* `docs` (object) is required for core rules of ESLint:
+
+    * `description` (string) provides the short description of the rule in the [rules index](../rules/)
+    * `recommended` (boolean) is whether the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring/configuration-files#extending-configuration-files) enables the rule
+    * `url` (string) specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations)
+
+    In a custom rule or plugin, you can omit `docs` or include any properties that you need in it.
+
+* `fixable` (string) is either `"code"` or `"whitespace"` if the `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixes problems reported by the rule
+
+    **Important:** the `fixable` property is mandatory for fixable rules. If this property isn't specified, ESLint will throw an error whenever the rule attempts to produce a fix. Omit the `fixable` property if the rule is not fixable.
+
+* `hasSuggestions` (boolean) specifies whether rules can return suggestions (defaults to `false` if omitted)
+
+     **Important:** the `hasSuggestions` property is mandatory for rules that provide suggestions. If this property isn't set to `true`, ESLint will throw an error whenever the rule attempts to produce a suggestion. Omit the `hasSuggestions` property if the rule does not provide suggestions.
+
+* `schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring/rules#configuring-rules)
+
+* `deprecated` (boolean) indicates whether the rule has been deprecated.  You may omit the `deprecated` property if the rule has not been deprecated.
+
+* `replacedBy` (array) in the case of a deprecated rule, specifies replacement rule(s)
+
+`create` (function) returns an object with methods that ESLint calls to "visit" nodes while traversing the abstract syntax tree (AST as defined by [ESTree](https://github.com/estree/estree)) of JavaScript code:
+
+* if a key is a node type or a [selector](./selectors), ESLint calls that **visitor** function while going **down** the tree
+* if a key is a node type or a [selector](./selectors) plus `:exit`, ESLint calls that **visitor** function while going **up** the tree
+* if a key is an event name, ESLint calls that **handler** function for [code path analysis](./code-path-analysis)
+
+A rule can use the current node and its surrounding tree to report or fix problems.
+
+Here are methods for the [array-callback-return](../rules/array-callback-return) rule:
+
+```js
+function checkLastSegment (node) {
+    // report problem for function if last code path segment is reachable
+}
+
+module.exports = {
+    meta: { ... },
+    create: function(context) {
+        // declare the state of the rule
+        return {
+            ReturnStatement: function(node) {
+                // at a ReturnStatement node while going down
+            },
+            // at a function expression node while going up:
+            "FunctionExpression:exit": checkLastSegment,
+            "ArrowFunctionExpression:exit": checkLastSegment,
+            onCodePathStart: function (codePath, node) {
+                // at the start of analyzing a code path
+            },
+            onCodePathEnd: function(codePath, node) {
+                // at the end of analyzing a code path
+            }
+        };
+    }
+};
+```
+
+## The Context Object
+
+The `context` object contains additional functionality that is helpful for rules to do their jobs. As the name implies, the `context` object contains information that is relevant to the context of the rule. The `context` object has the following properties:
+
+* `parserOptions` - the parser options configured for this run (more details [here](../user-guide/configuring/language-options#specifying-parser-options)).
+* `id` - the rule ID.
+* `options` - an array of the [configured options](/docs/user-guide/configuring/rules#configuring-rules) for this rule. This array does not include the rule severity. For more information, see [here](#contextoptions).
+* `settings` - the [shared settings](/docs/user-guide/configuring/configuration-files#adding-shared-settings) from configuration.
+* `parserPath` - the name of the `parser` from configuration.
+* `parserServices` - an object containing parser-provided services for rules. The default parser does not provide any services. However, if a rule is intended to be used with a custom parser, it could use `parserServices` to access anything provided by that parser. (For example, a TypeScript parser could provide the ability to get the computed type of a given node.)
+
+Additionally, the `context` object has the following methods:
+
+* `getAncestors()` - returns an array of the ancestors of the currently-traversed node, starting at the root of the AST and continuing through the direct parent of the current node. This array does not include the currently-traversed node itself.
+* `getCwd()` - returns the `cwd` passed to [Linter](./nodejs-api#linter). It is a path to a directory that should be considered as the current working directory.
+* `getDeclaredVariables(node)` - returns a list of [variables](./scope-manager-interface#variable-interface) declared by the given node. This information can be used to track references to variables.
+    * If the node is a `VariableDeclaration`, all variables declared in the declaration are returned.
+    * If the node is a `VariableDeclarator`, all variables declared in the declarator are returned.
+    * If the node is a `FunctionDeclaration` or `FunctionExpression`, the variable for the function name is returned, in addition to variables for the function parameters.
+    * If the node is an `ArrowFunctionExpression`, variables for the parameters are returned.
+    * If the node is a `ClassDeclaration` or a `ClassExpression`, the variable for the class name is returned.
+    * If the node is a `CatchClause`, the variable for the exception is returned.
+    * If the node is an `ImportDeclaration`, variables for all of its specifiers are returned.
+    * If the node is an `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`, the declared variable is returned.
+    * Otherwise, if the node does not declare any variables, an empty array is returned.
+* `getFilename()` - returns the filename associated with the source.
+* `getPhysicalFilename()` - when linting a file, it returns the full path of the file on disk without any code block information. When linting text, it returns the value passed to `—stdin-filename` or `<text>` if not specified.
+* `getScope()` - returns the [scope](./scope-manager-interface#scope-interface) of the currently-traversed node. This information can be used to track references to variables.
+* `getSourceCode()` - returns a [`SourceCode`](#contextgetsourcecode) object that you can use to work with the source that was passed to ESLint.
+* `markVariableAsUsed(name)` - marks a variable with the given name in the current scope as used. This affects the [no-unused-vars](../rules/no-unused-vars) rule. Returns `true` if a variable with the given name was found and marked as used, otherwise `false`.
+* `report(descriptor)` - reports a problem in the code (see the [dedicated section](#contextreport)).
+
+**Note:** Earlier versions of ESLint supported additional methods on the `context` object. Those methods were removed in the new format and should not be relied upon.
+
+### context.getScope()
+
+This method returns the scope which has the following types:
+
+| AST Node Type             | Scope Type |
+|:--------------------------|:-----------|
+| `Program`                 | `global`   |
+| `FunctionDeclaration`     | `function` |
+| `FunctionExpression`      | `function` |
+| `ArrowFunctionExpression` | `function` |
+| `ClassDeclaration`        | `class`    |
+| `ClassExpression`         | `class`    |
+| `BlockStatement` ※1      | `block`    |
+| `SwitchStatement` ※1     | `switch`   |
+| `ForStatement` ※2        | `for`      |
+| `ForInStatement` ※2      | `for`      |
+| `ForOfStatement` ※2      | `for`      |
+| `WithStatement`           | `with`     |
+| `CatchClause`             | `catch`    |
+| others                    | ※3        |
+
+**※1** Only if the configured parser provided the block-scope feature. The default parser provides the block-scope feature if `parserOptions.ecmaVersion` is not less than `6`.<br>
+**※2** Only if the `for` statement defines the iteration variable as a block-scoped variable (E.g., `for (let i = 0;;) {}`).<br>
+**※3** The scope of the closest ancestor node which has own scope. If the closest ancestor node has multiple scopes then it chooses the innermost scope (E.g., the `Program` node has a `global` scope and a `module` scope if `Program#sourceType` is `"module"`. The innermost scope is the `module` scope.).
+
+The returned value is a [`Scope` object](scope-manager-interface) defined by the `eslint-scope` package. The `Variable` objects of global variables have some additional properties.
+
+* `variable.writeable` (`boolean | undefined`) ... If `true`, this global variable can be assigned arbitrary value. If `false`, this global variable is read-only.
+* `variable.eslintExplicitGlobal` (`boolean | undefined`) ... If `true`, this global variable was defined by a `/* globals */` directive comment in the source code file.
+* `variable.eslintExplicitGlobalComments` (`Comment[] | undefined`) ... The array of `/* globals */` directive comments which defined this global variable in the source code file. This property is `undefined` if there are no `/* globals */` directive comments.
+* `variable.eslintImplicitGlobalSetting` (`"readonly" | "writable" | undefined`) ... The configured value in config files. This can be different from `variable.writeable` if there are `/* globals */` directive comments.
+
+### context.report()
+
+The main method you'll use is `context.report()`, which publishes a warning or error (depending on the configuration being used). This method accepts a single argument, which is an object containing the following properties:
+
+* `message` - the problem message.
+* `node` - (optional)  the AST node related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
+* `loc` - (optional) an object specifying the location of the problem. If both `loc` and `node` are specified, then the location is used from `loc` instead of `node`.
+    * `start` - An object of the start location.
+        * `line` - the 1-based line number at which the problem occurred.
+        * `column` - the 0-based column number at which the problem occurred.
+    * `end` - An object of the end location.
+        * `line` - the 1-based line number at which the problem occurred.
+        * `column` - the 0-based column number at which the problem occurred.
+* `data` - (optional) [placeholder](#using-message-placeholders) data for `message`.
+* `fix` - (optional) a function that applies a [fix](#applying-fixes) to resolve the problem.
+
+Note that at least one of `node` or `loc` is required.
+
+The simplest example is to use just `node` and `message`:
+
+```js
+context.report({
+    node: node,
+    message: "Unexpected identifier"
+});
+```
+
+The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
+
+### Using message placeholders
+
+You can also use placeholders in the message and provide `data`:
+
+```js
+{% raw %}
+context.report({
+    node: node,
+    message: "Unexpected identifier: {{ identifier }}",
+    data: {
+        identifier: node.name
+    }
+});
+{% endraw %}
+```
+
+Note that leading and trailing whitespace is optional in message parameters.
+
+The node contains all of the information necessary to figure out the line and column number of the offending text as well the source text representing the node.
+
+### `messageId`s
+
+Instead of typing out messages in both the `context.report()` call and your tests, you can use `messageId`s instead.
+
+This allows you to avoid retyping error messages. It also prevents errors reported in different sections of your rule from having out-of-date messages.
+
+```js
+{% raw %}
+// in your rule
+module.exports = {
+    meta: {
+        messages: {
+            avoidName: "Avoid using variables named '{{ name }}'"
+        }
+    },
+    create(context) {
+        return {
+            Identifier(node) {
+                if (node.name === "foo") {
+                    context.report({
+                        node,
+                        messageId: "avoidName",
+                        data: {
+                            name: "foo",
+                        }
+                    });
+                }
+            }
+        };
+    }
+};
+
+// in the file to lint:
+
+var foo = 2;
+//  ^ error: Avoid using variables named 'foo'
+
+// In your tests:
+var rule = require("../../../lib/rules/my-rule");
+var RuleTester = require("eslint").RuleTester;
+
+var ruleTester = new RuleTester();
+ruleTester.run("my-rule", rule, {
+    valid: ["bar", "baz"],
+    invalid: [
+        {
+            code: "foo",
+            errors: [
+                {
+                    messageId: "avoidName"
+                }
+            ]
+        }
+    ]
+});
+{% endraw %}
+```
+
+### Applying Fixes
+
+If you'd like ESLint to attempt to fix the problem you're reporting, you can do so by specifying the `fix` function when using `context.report()`. The `fix` function receives a single argument, a `fixer` object, that you can use to apply a fix. For example:
+
+```js
+context.report({
+    node: node,
+    message: "Missing semicolon",
+    fix: function(fixer) {
+        return fixer.insertTextAfter(node, ";");
+    }
+});
+```
+
+Here, the `fix()` function is used to insert a semicolon after the node. Note that a fix is not immediately applied, and may not be applied at all if there are conflicts with other fixes. After applying fixes, ESLint will run all of the enabled rules again on the fixed code, potentially applying more fixes. This process will repeat up to 10 times, or until no more fixable problems are found. Afterwards, any remaining problems will be reported as usual.
+
+**Important:** The `meta.fixable` property is mandatory for fixable rules. ESLint will throw an error if a rule that implements `fix` functions does not [export](#rule-basics) the `meta.fixable` property.
+
+The `fixer` object has the following methods:
+
+* `insertTextAfter(nodeOrToken, text)` - inserts text after the given node or token
+* `insertTextAfterRange(range, text)` - inserts text after the given range
+* `insertTextBefore(nodeOrToken, text)` - inserts text before the given node or token
+* `insertTextBeforeRange(range, text)` - inserts text before the given range
+* `remove(nodeOrToken)` - removes the given node or token
+* `removeRange(range)` - removes text in the given range
+* `replaceText(nodeOrToken, text)` - replaces the text in the given node or token
+* `replaceTextRange(range, text)` - replaces the text in the given range
+
+A range is a two-item array containing character indices inside of the source code. The first item is the start of the range (inclusive) and the second item is the end of the range (exclusive). Every node and token has a `range` property to identify the source code range they represent.
+
+The above methods return a `fixing` object.
+The `fix()` function can return the following values:
+
+* A `fixing` object.
+* An array which includes `fixing` objects.
+* An iterable object which enumerates `fixing` objects. Especially, the `fix()` function can be a generator.
+
+If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not be overlapped.
+
+Best practices for fixes:
+
+1. Avoid any fixes that could change the runtime behavior of code and cause it to stop working.
+1. Make fixes as small as possible. Fixes that are unnecessarily large could conflict with other fixes, and prevent them from being applied.
+1. Only make one fix per message. This is enforced because you must return the result of the fixer operation from `fix()`.
+1. Since all rules are run again after the initial round of fixes is applied, it's not necessary for a rule to check whether the code style of a fix will cause errors to be reported by another rule.
+    * For example, suppose a fixer would like to surround an object key with quotes, but it's not sure whether the user would prefer single or double quotes.
+
+        ```js
+        ({ foo : 1 })
+
+        // should get fixed to either
+
+        ({ 'foo': 1 })
+
+        // or
+
+        ({ "foo": 1 })
+        ```
+
+    * This fixer can just select a quote type arbitrarily. If it guesses wrong, the resulting code will be automatically reported and fixed by the [`quotes`](/docs/rules/quotes) rule.
+
+Note: Making fixes as small as possible is a best practice, but in some cases it may be correct to extend the range of the fix in order to intentionally prevent other rules from making fixes in a surrounding range in the same pass. For instance, if replacement text declares a new variable, it can be useful to prevent other changes in the scope of the variable as they might cause name collisions.
+
+The following example replaces `node` and also ensures that no other fixes will be applied in the range of `node.parent` in the same pass:
+
+```js
+context.report({
+    node,
+    message,
+    *fix(fixer) {
+        yield fixer.replaceText(node, replacementText);
+
+        // extend range of the fix to the range of `node.parent`
+        yield fixer.insertTextBefore(node.parent, "");
+        yield fixer.insertTextAfter(node.parent, "");
+    }
+});
+```
+
+### Providing Suggestions
+
+In some cases fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent (see the best practices for [applying fixes](#applying-fixes) listed above). In these cases, there is an alternative `suggest` option on `context.report()` that allows other tools, such as editors, to expose helpers for users to manually apply a suggestion.
+
+In order to provide suggestions, use the `suggest` key in the report argument with an array of suggestion objects. The suggestion objects represent individual suggestions that could be applied and require either a `desc` key string that describes what applying the suggestion would do or a `messageId` key (see [below](#suggestion-messageids)), and a `fix` key that is a function defining the suggestion result. This `fix` function follows the same API as regular fixes (described above in [applying fixes](#applying-fixes)).
+
+```js
+{% raw %}
+context.report({
+    node: node,
+    message: "Unnecessary escape character: \\{{character}}.",
+    data: { character },
+    suggest: [
+        {
+            desc: "Remove the `\\`. This maintains the current functionality.",
+            fix: function(fixer) {
+                return fixer.removeRange(range);
+            }
+        },
+        {
+            desc: "Replace the `\\` with `\\\\` to include the actual backslash character.",
+            fix: function(fixer) {
+                return fixer.insertTextBeforeRange(range, "\\");
+            }
+        }
+    ]
+});
+{% endraw %}
+```
+
+**Important:** The `meta.hasSuggestions` property is mandatory for rules that provide suggestions. ESLint will throw an error if a rule attempts to produce a suggestion but does not [export](#rule-basics) this property.
+
+Note: Suggestions will be applied as a stand-alone change, without triggering multipass fixes. Each suggestion should focus on a singular change in the code and should not try to conform to user defined styles. For example, if a suggestion is adding a new statement into the codebase, it should not try to match correct indentation, or conform to user preferences on presence/absence of semicolons. All of those things can be corrected by multipass autofix when the user triggers it.
+
+Best practices for suggestions:
+
+1. Don't try to do too much and suggest large refactors that could introduce a lot of breaking changes.
+1. As noted above, don't try to conform to user-defined styles.
+
+Suggestions are intended to provide fixes. ESLint will automatically remove the whole suggestion from the linting output if the suggestion's `fix` function returned `null` or an empty array/sequence.
+
+#### Suggestion `messageId`s
+
+Instead of using a `desc` key for suggestions a `messageId` can be used instead. This works the same way as `messageId`s for the overall error (see [messageIds](#messageids)). Here is an example of how to use it in a rule:
+
+```js
+{% raw %}
+module.exports = {
+    meta: {
+        messages: {
+            unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
+            removeEscape: "Remove the `\\`. This maintains the current functionality.",
+            escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character."
+        },
+        hasSuggestions: true
+    },
+    create: function(context) {
+        // ...
+        context.report({
+            node: node,
+            messageId: 'unnecessaryEscape',
+            data: { character },
+            suggest: [
+                {
+                    messageId: "removeEscape",
+                    fix: function(fixer) {
+                        return fixer.removeRange(range);
+                    }
+                },
+                {
+                    messageId: "escapeBackslash",
+                    fix: function(fixer) {
+                        return fixer.insertTextBeforeRange(range, "\\");
+                    }
+                }
+            ]
+        });
+    }
+};
+{% endraw %}
+```
+
+#### Placeholders in suggestion messages
+
+You can also use placeholders in the suggestion message. This works the same way as placeholders for the overall error (see [using message placeholders](#using-message-placeholders)).
+
+Please note that you have to provide `data` on the suggestion's object. Suggestion messages cannot use properties from the overall error's `data`.
+
+```js
+{% raw %}
+module.exports = {
+    meta: {
+        messages: {
+            unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
+            removeEscape: "Remove `\\` before {{character}}.",
+        },
+        hasSuggestions: true
+    },
+    create: function(context) {
+        // ...
+        context.report({
+            node: node,
+            messageId: "unnecessaryEscape",
+            data: { character }, // data for the unnecessaryEscape overall message
+            suggest: [
+                {
+                    messageId: "removeEscape",
+                    data: { character }, // data for the removeEscape suggestion message
+                    fix: function(fixer) {
+                        return fixer.removeRange(range);
+                    }
+                }
+            ]
+        });
+    }
+};
+{% endraw %}
+```
+
+### context.options
+
+Some rules require options in order to function correctly. These options appear in configuration (`.eslintrc`, command line, or in comments). For example:
+
+```json
+{
+    "quotes": ["error", "double"]
+}
+```
+
+The `quotes` rule in this example has one option, `"double"` (the `error` is the error level). You can retrieve the options for a rule by using `context.options`, which is an array containing every configured option for the rule. In this case, `context.options[0]` would contain `"double"`:
+
+```js
+module.exports = {
+    create: function(context) {
+        var isDouble = (context.options[0] === "double");
+
+        // ...
+    }
+};
+```
+
+Since `context.options` is just an array, you can use it to determine how many options have been passed as well as retrieving the actual options themselves. Keep in mind that the error level is not part of `context.options`, as the error level cannot be known or modified from inside a rule.
+
+When using options, make sure that your rule has some logical defaults in case the options are not provided.
+
+### context.getSourceCode()
+
+The `SourceCode` object is the main object for getting more information about the source code being linted. You can retrieve the `SourceCode` object at any time by using the `getSourceCode()` method:
+
+```js
+module.exports = {
+    create: function(context) {
+        var sourceCode = context.getSourceCode();
+
+        // ...
+    }
+};
+```
+
+Once you have an instance of `SourceCode`, you can use the following methods on it to work with the code:
+
+* `getText(node)` - returns the source code for the given node. Omit `node` to get the whole source.
+* `getAllComments()` - returns an array of all comments in the source.
+* `getCommentsBefore(nodeOrToken)` - returns an array of comment tokens that occur directly before the given node or token.
+* `getCommentsAfter(nodeOrToken)` - returns an array of comment tokens that occur directly after the given node or token.
+* `getCommentsInside(node)` - returns an array of all comment tokens inside a given node.
+* `isSpaceBetween(nodeOrToken, nodeOrToken)` - returns true if there is a whitespace character between the two tokens or, if given a node, the last token of the first node and the first token of the second node.
+* `getFirstToken(node, skipOptions)` - returns the first token representing the given node.
+* `getFirstTokens(node, countOptions)` - returns the first `count` tokens representing the given node.
+* `getLastToken(node, skipOptions)` - returns the last token representing the given node.
+* `getLastTokens(node, countOptions)` - returns the last `count` tokens representing the given node.
+* `getTokenAfter(nodeOrToken, skipOptions)` - returns the first token after the given node or token.
+* `getTokensAfter(nodeOrToken, countOptions)` - returns `count` tokens after the given node or token.
+* `getTokenBefore(nodeOrToken, skipOptions)` - returns the first token before the given node or token.
+* `getTokensBefore(nodeOrToken, countOptions)` - returns `count` tokens before the given node or token.
+* `getFirstTokenBetween(nodeOrToken1, nodeOrToken2, skipOptions)` - returns the first token between two nodes or tokens.
+* `getFirstTokensBetween(nodeOrToken1, nodeOrToken2, countOptions)` - returns the first `count` tokens between two nodes or tokens.
+* `getLastTokenBetween(nodeOrToken1, nodeOrToken2, skipOptions)` - returns the last token between two nodes or tokens.
+* `getLastTokensBetween(nodeOrToken1, nodeOrToken2, countOptions)` - returns the last `count` tokens between two nodes or tokens.
+* `getTokens(node)` - returns all tokens for the given node.
+* `getTokensBetween(nodeOrToken1, nodeOrToken2)` - returns all tokens between two nodes.
+* `getTokenByRangeStart(index, rangeOptions)` - returns the token whose range starts at the given index in the source.
+* `getNodeByRangeIndex(index)` - returns the deepest node in the AST containing the given source index.
+* `getLocFromIndex(index)` - returns an object with `line` and `column` properties, corresponding to the location of the given source index. `line` is 1-based and `column` is 0-based.
+* `getIndexFromLoc(loc)` - returns the index of a given location in the source code, where `loc` is an object with a 1-based `line` key and a 0-based `column` key.
+* `commentsExistBetween(nodeOrToken1, nodeOrToken2)` - returns `true` if comments exist between two nodes.
+
+`skipOptions` is an object which has 3 properties; `skip`, `includeComments`, and `filter`. Default is `{skip: 0, includeComments: false, filter: null}`.
+
+* `skip` is a positive integer, the number of skipping tokens. If `filter` option is given at the same time, it doesn't count filtered tokens as skipped.
+* `includeComments` is a boolean value, the flag to include comment tokens into the result.
+* `filter` is a function which gets a token as the first argument, if the function returns `false` then the result excludes the token.
+
+`countOptions` is an object which has 3 properties; `count`, `includeComments`, and `filter`. Default is `{count: 0, includeComments: false, filter: null}`.
+
+* `count` is a positive integer, the maximum number of returning tokens.
+* `includeComments` is a boolean value, the flag to include comment tokens into the result.
+* `filter` is a function which gets a token as the first argument, if the function returns `false` then the result excludes the token.
+
+`rangeOptions` is an object which has 1 property: `includeComments`.
+
+* `includeComments` is a boolean value, the flag to include comment tokens into the result.
+
+There are also some properties you can access:
+
+* `hasBOM` - the flag to indicate whether or not the source code has Unicode BOM.
+* `text` - the full text of the code being linted. Unicode BOM has been stripped from this text.
+* `ast` - the `Program` node of the AST for the code being linted.
+* `scopeManager` - the [ScopeManager](./scope-manager-interface#scopemanager-interface) object of the code.
+* `visitorKeys` - the visitor keys to traverse this AST.
+* `lines` - an array of lines, split according to the specification's definition of line breaks.
+
+You should use a `SourceCode` object whenever you need to get more information about the code being linted.
+
+#### Deprecated
+
+Please note that the following methods have been deprecated and will be removed in a future version of ESLint:
+
+* `getComments()` - replaced by `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()`
+* `getTokenOrCommentBefore()` - replaced by `getTokenBefore()` with the `{ includeComments: true }` option
+* `getTokenOrCommentAfter()` - replaced by `getTokenAfter()` with the `{ includeComments: true }` option
+* `isSpaceBetweenTokens()` - replaced by `isSpaceBetween()`
+* `getJSDocComment()`
+
+### Options Schemas
+
+Rules may export a `schema` property, which is a [JSON schema](https://json-schema.org/) format description of a rule's options which will be used by ESLint to validate configuration options and prevent invalid or unexpected inputs before they are passed to the rule in `context.options`.
+
+There are two formats for a rule's exported `schema`. The first is a full JSON Schema object describing all possible options the rule accepts, including the rule's error level as the first argument and any optional arguments thereafter.
+
+However, to simplify schema creation, rules may also export an array of schemas for each optional positional argument, and ESLint will automatically validate the required error level first. For example, the `yoda` rule accepts a primary mode argument, as well as an extra options object with named properties.
+
+```js
+// "yoda": [2, "never", { "exceptRange": true }]
+module.exports = {
+    meta: {
+        schema: [
+            {
+                "enum": ["always", "never"]
+            },
+            {
+                "type": "object",
+                "properties": {
+                    "exceptRange": {
+                        "type": "boolean"
+                    }
+                },
+                "additionalProperties": false
+            }
+        ]
+    },
+};
+```
+
+In the preceding example, the error level is assumed to be the first argument. It is followed by the first optional argument, a string which may be either `"always"` or `"never"`. The final optional argument is an object, which may have a Boolean property named `exceptRange`.
+
+To learn more about JSON Schema, we recommend looking at some examples in [website](https://json-schema.org/learn/) to start, and also reading [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/) (a free ebook).
+
+**Note:** Currently you need to use full JSON Schema object rather than array in case your schema has references ($ref), because in case of array format ESLint transforms this array into a single schema without updating references that makes them incorrect (they are ignored).
+
+### Getting the Source
+
+If your rule needs to get the actual JavaScript source to work with, then use the `sourceCode.getText()` method. This method works as follows:
+
+```js
+
+// get all source
+var source = sourceCode.getText();
+
+// get source for just this AST node
+var nodeSource = sourceCode.getText(node);
+
+// get source for AST node plus previous two characters
+var nodeSourceWithPrev = sourceCode.getText(node, 2);
+
+// get source for AST node plus following two characters
+var nodeSourceWithFollowing = sourceCode.getText(node, 0, 2);
+```
+
+In this way, you can look for patterns in the JavaScript text itself when the AST isn't providing the appropriate data (such as location of commas, semicolons, parentheses, etc.).
+
+### Accessing Comments
+
+While comments are not technically part of the AST, ESLint provides a few ways for rules to access them:
+
+#### sourceCode.getAllComments()
+
+This method returns an array of all the comments found in the program. This is useful for rules that need to check all comments regardless of location.
+
+#### sourceCode.getCommentsBefore(), sourceCode.getCommentsAfter(), and sourceCode.getCommentsInside()
+
+These methods return an array of comments that appear directly before, directly after, and inside nodes, respectively. They are useful for rules that need to check comments in relation to a given node or token.
+
+Keep in mind that the results of this method are calculated on demand.
+
+#### Token traversal methods
+
+Finally, comments can be accessed through many of `sourceCode`'s methods using the `includeComments` option.
+
+### Accessing Shebangs
+
+Shebangs are represented by tokens of type `"Shebang"`. They are treated as comments and can be accessed by the methods outlined above.
+
+### Accessing Code Paths
+
+ESLint analyzes code paths while traversing AST.
+You can access that code path objects with five events related to code paths.
+
+[details here](./code-path-analysis)
+
+## Rule Unit Tests
+
+Each bundled rule for ESLint core must have a set of unit tests submitted with it to be accepted. The test file is named the same as the source file but lives in `tests/lib/`. For example, if the rule source file is `lib/rules/foo.js` then the test file should be `tests/lib/rules/foo.js`.
+
+ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to write tests for rules.
+
+## Performance Testing
+
+To keep the linting process efficient and unobtrusive, it is useful to verify the performance impact of new rules or modifications to existing rules.
+
+### Overall Performance
+
+When developing in the ESLint core repository, the `npm run perf` command gives a high-level overview of ESLint running time with all core rules enabled.
+
+```bash
+$ git checkout main
+Switched to branch 'main'
+
+$ npm run perf
+CPU Speed is 2200 with multiplier 7500000
+Performance Run #1:  1394.689313ms
+Performance Run #2:  1423.295351ms
+Performance Run #3:  1385.09515ms
+Performance Run #4:  1382.406982ms
+Performance Run #5:  1409.68566ms
+Performance budget ok:  1394.689313ms (limit: 3409.090909090909ms)
+
+$ git checkout my-rule-branch
+Switched to branch 'my-rule-branch'
+
+$ npm run perf
+CPU Speed is 2200 with multiplier 7500000
+Performance Run #1:  1443.736547ms
+Performance Run #2:  1419.193291ms
+Performance Run #3:  1436.018228ms
+Performance Run #4:  1473.605485ms
+Performance Run #5:  1457.455283ms
+Performance budget ok:  1443.736547ms (limit: 3409.090909090909ms)
+```
+
+### Per-rule Performance
+
+ESLint has a built-in method to track performance of individual rules. Setting the `TIMING` environment variable will trigger the display, upon linting completion, of the ten longest-running rules, along with their individual running time (rule creation + rule execution) and relative performance impact as a percentage of total rule processing time (rule creation + rule execution).
+
+```bash
+$ TIMING=1 eslint lib
+Rule                    | Time (ms) | Relative
+:-----------------------|----------:|--------:
+no-multi-spaces         |    52.472 |     6.1%
+camelcase               |    48.684 |     5.7%
+no-irregular-whitespace |    43.847 |     5.1%
+valid-jsdoc             |    40.346 |     4.7%
+handle-callback-err     |    39.153 |     4.6%
+space-infix-ops         |    35.444 |     4.1%
+no-undefined            |    25.693 |     3.0%
+no-shadow               |    22.759 |     2.7%
+no-empty-class          |    21.976 |     2.6%
+semi                    |    19.359 |     2.3%
+```
+
+To test one rule explicitly, combine the `--no-eslintrc`, and `--rule` options:
+
+```bash
+$ TIMING=1 eslint --no-eslintrc --rule "quotes: [2, 'double']" lib
+Rule   | Time (ms) | Relative
+:------|----------:|--------:
+quotes |    18.066 |   100.0%
+```
+
+To see a longer list of results (more than 10), set the environment variable to another value such as `TIMING=50` or `TIMING=all`.
+
+## Rule Naming Conventions
+
+The rule naming conventions for ESLint are fairly simple:
+
+* If your rule is disallowing something, prefix it with `no-` such as `no-eval` for disallowing `eval()` and `no-debugger` for disallowing `debugger`.
+* If your rule is enforcing the inclusion of something, use a short name without a special prefix.
+* Use dashes between words.
+
+## Runtime Rules
+
+The thing that makes ESLint different from other linters is the ability to define custom rules at runtime. This is perfect for rules that are specific to your project or company and wouldn't make sense for ESLint to ship with. With runtime rules, you don't have to wait for the next version of ESLint or be disappointed that your rule isn't general enough to apply to the larger JavaScript community, just write your rules and include them at runtime.
+
+Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps:
+
+1. Place all of your runtime rules in the same directory (e.g., `eslint_rules`).
+2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `"warn"` or `"error"` in the configuration file.
+3. Run the [command line interface](../user-guide/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules.
diff --git a/eslint/docs/src/library/alert.md b/eslint/docs/src/library/alert.md
new file mode 100644 (file)
index 0000000..cefd830
--- /dev/null
@@ -0,0 +1,23 @@
+---
+title: alert 
+---
+
+The alert message comes in three different types: a warning, a tip, and an important note.
+
+## Usage
+
+There is a shortcode for each type of alert. The shortcode expects you to provide the text and URL for the “Learn more” link.
+
+```html
+{ % warning "This rule has been removed in version x.xx", "/link/to/learn/more" % }
+
+{ % tip "Kind reminder to do something maybe", "/link/to/learn/more" % }
+
+{ % important "This rule has been deprecated in version x.xx", "/link/to/learn/more" % }
+```
+
+## Examples
+
+{% warning "warning text", "/" %}
+{% tip "tip text", "/" %}
+{% important "text", "/" %}
diff --git a/eslint/docs/src/library/buttons.md b/eslint/docs/src/library/buttons.md
new file mode 100644 (file)
index 0000000..45bf205
--- /dev/null
@@ -0,0 +1,36 @@
+---
+title: Buttons 
+---
+
+{% from 'components/button.macro.html' import button %}
+
+There are three types of buttons: primary, secondary, and "ghost". The button styles can be applied to buttons and/or links that look like buttons.
+
+To render the proper semantic element, provide the kind of behavior that is expected: `action` or `link` value. If the button performs an action, it is rendered as a `button`. If the button links somewhere, it renders as a `<a>`.
+
+The button macro will default to `link`, which will render an <code>&lt;a&gt;</code> tag that looks like a button. If you provide `action` as a value for `behavior`, it indicates that it is a button _that performs an action_ and is therefore rendered as a `<button type="button">`.
+
+## Usage
+
+```html
+
+<!-- import the macro in the page(s) you want to render the button(s) in -->
+{% from 'components/button.macro.html' import button %}
+
+<!-- use the macro -->
+
+{ { button({ behavior: "action", type: "primary", text: "Do Something" }) } }
+
+<!-- defaults to behavior: link -->
+{ { button({ type: "primary", text: "Go somewhere", url: "/url/to/somewhere/" }) } }
+```
+
+## Examples
+
+{{ button({ behavior: "action", type: "primary" }) }}
+{{ button({ behavior: "action", text: "I perform an action", type: "secondary" }) }}
+{{ button({ behavior: "action", text: "I perform an action", type: "ghost" }) }}
+
+{{ button({ type: "primary", text: "I link somewhere", url: "#" }) }}
+{{ button({ type: "secondary", text: "Secondary Button", url:"#" }) }}
+{{ button({ type: "ghost", text: "Ghost Button", url:"#" }) }}
diff --git a/eslint/docs/src/library/code-blocks.md b/eslint/docs/src/library/code-blocks.md
new file mode 100644 (file)
index 0000000..222d3e6
--- /dev/null
@@ -0,0 +1,95 @@
+---
+title: Correct and incorrect code usage 
+---
+
+To indicate correct and incorrect code usage, some code blocks can have correct and incorrect icons added to them, respectively.
+
+## Usage
+
+To indicate that a code block is correct or incorrect, wrap the code block in a container labeled either `correct` or `incorrect`.
+
+Make sure to leave space above and below the markdown code block to ensure it is rendered correctly.
+
+```text
+::: correct
+
+`` `js
+function() {
+    const another = [];
+}
+`` `
+:::
+
+::: incorrect
+
+`` `js
+function() {
+    const another = [];
+}
+`` `
+:::
+```
+
+## Examples
+
+Correct usage:
+
+::: correct
+
+```js
+const { ESLint } = require("eslint");
+
+(async function main() {
+  // 1. Create an instance with the `fix` option.
+  const eslint = new ESLint({ fix: true });
+
+  // 2. Lint files. This doesn't modify target files.
+  const results = await eslint.lintFiles(["lib/**/*.js"]);
+
+  // 3. Modify the files with the fixed code.
+  await ESLint.outputFixes(results);
+
+  // 4. Format the results.
+  const formatter = await eslint.loadFormatter("stylish");
+  const resultText = formatter.format(results);
+
+  // 5. Output it.
+  console.log(resultText);
+})().catch((error) => {
+  process.exitCode = 1;
+  console.error(error);
+});
+```
+
+:::
+
+Incorrect usage:
+
+::: incorrect
+
+```js
+const { ESLint } = require("eslint");
+
+(async function main() {
+  // 1. Create an instance with the `fix` option.
+  const eslint = new ESLint({ fix: true });
+
+  // 2. Lint files. This doesn't modify target files.
+  const results = await eslint.lintFiles(["lib/**/*.js"]);
+
+  // 3. Modify the files with the fixed code.
+  await ESLint.outputFixes(results);
+
+  // 4. Format the results.
+  const formatter = await eslint.loadFormatter("stylish");
+  const resultText = formatter.format(results);
+
+  // 5. Output it.
+  console.log(resultText);
+})().catch((error) => {
+  process.exitCode = 1;
+  console.error(error);
+});
+```
+
+:::
diff --git a/eslint/docs/src/library/code-tabs.md b/eslint/docs/src/library/code-tabs.md
new file mode 100644 (file)
index 0000000..d035647
--- /dev/null
@@ -0,0 +1,9 @@
+---
+title: Code block tabs
+---
+
+This component is a partial found in `/components/code-tabs.html`. To use this component, copy the code for the tabs from the partial and replace the code blocks with the ones you want to render.
+
+## Example
+
+{% include 'components/code-tabs.html' %}
diff --git a/eslint/docs/src/library/language-switcher.md b/eslint/docs/src/library/language-switcher.md
new file mode 100644 (file)
index 0000000..745afda
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Language Switcher 
+---
+
+{% include 'components/language-switcher.html' %}
diff --git a/eslint/docs/src/library/library.json b/eslint/docs/src/library/library.json
new file mode 100644 (file)
index 0000000..dd622a7
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "layout": "components.html",
+    "permalink": "/component-library/{{ page.fileSlug }}.html"
+}
diff --git a/eslint/docs/src/library/link-card.md b/eslint/docs/src/library/link-card.md
new file mode 100644 (file)
index 0000000..db400f3
--- /dev/null
@@ -0,0 +1,15 @@
+---
+title: Link Card 
+---
+
+Links can be rendered as cards by using the `link` shortcode. The only required parameter is the URL you wish to scrape for metadata.
+
+```html
+{ % link "https://thesiteurl.com" % }
+```
+
+## Examples
+
+{% link "https://blog.izs.me/2010/12/an-open-letter-to-javascript-leaders-regarding/" %}
+
+{% link "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get" %}
diff --git a/eslint/docs/src/library/related-rules.md b/eslint/docs/src/library/related-rules.md
new file mode 100644 (file)
index 0000000..21003b1
--- /dev/null
@@ -0,0 +1,17 @@
+---
+title: Related rules 
+---
+
+The `related_rules` shortcode is used to add one or more related rules to a rule.
+
+## Usage
+
+The shortcode expects an array of rule names.
+
+```html
+{ % related_rules ["no-extra-semi", "no-unexpected-multiline", "semi-spacing"] % }
+```
+
+## Example
+
+{% related_rules ["no-extra-semi", "no-unexpected-multiline", "semi-spacing"] %}
diff --git a/eslint/docs/src/library/rule-categories.md b/eslint/docs/src/library/rule-categories.md
new file mode 100644 (file)
index 0000000..9f6688f
--- /dev/null
@@ -0,0 +1,43 @@
+---
+title: Rule categories
+---
+
+## Rule categories
+
+The rule categories—namely “recommended”, “fixable”, and “hasSuggestions”—are shown in the [rules page](/rules/). They are rendered using the `ruleCategories` macro (imported from `/components/rule-categories.macro.html`). There is also an individual macro for each category type.
+
+```html
+{ % from 'components/rule-categories.macro.html' import ruleCategories % }
+
+{ { ruleCategories({
+        recommended: true,
+        fixable: true,
+        hasSuggestions: true
+}) } }
+```
+
+### Example
+
+{% from 'components/rule-categories.macro.html' import ruleCategories, recommended, fixable, hasSuggestions %}
+
+{{ ruleCategories({
+        recommended: true,
+        fixable: true,
+        hasSuggestions: true
+}) }}
+
+## A rule category
+
+For every rule, you can render the category it belongs to using the corresponding category shortcode:
+
+```html
+{ % recommended % }
+{ % fixable % }
+{ % hasSuggestions % }
+```
+
+## Examples
+
+{% recommended %}
+{% fixable %}
+{% hasSuggestions %}
diff --git a/eslint/docs/src/library/rule-list.md b/eslint/docs/src/library/rule-list.md
new file mode 100644 (file)
index 0000000..635e6b4
--- /dev/null
@@ -0,0 +1,25 @@
+---
+title: Rule list
+---
+
+The rule list is a macro defined in `components/rule-list.macro.html`. The macro accepts a list of rule names and renders comma-separated links.
+
+## Usage
+
+{% raw %}
+
+```html
+<!-- import the macro -->
+{% from 'components/rule-list.macro.html' import ruleList %}
+
+<!-- use the macro -->
+{{ ruleList({ rules: ['accessor-pairs', 'no-undef'] }) }}
+```
+
+{% endraw %}
+
+## Examples
+
+{% from 'components/rule-list.macro.html' import ruleList %}
+
+{{ ruleList({ rules: ['accessor-pairs', 'no-undef'] }) }}
diff --git a/eslint/docs/src/library/rule.md b/eslint/docs/src/library/rule.md
new file mode 100644 (file)
index 0000000..45bccea
--- /dev/null
@@ -0,0 +1,72 @@
+---
+title: Rule 
+---
+
+The rule component is a macro defined in `/components/rule.macro.html`. The macro accepts a set of parameters used to render the rule.
+
+A rule has a:
+
+* name
+* description
+* a flag to indicate whether it's deprecated or removed: `deprecated` and `removed` respectively
+* a replacedBy value indicating the rule it has been replaced with (if applicable)
+* a categories object indicating the rule's category
+
+## Usage
+
+```html
+<!-- import the macro -->
+{ % from 'components/rule.macro.html' import rule % }
+
+<!-- use the macro -->
+ { { rule({
+    name: "rule-name",
+    deprecated: true, // or removed: true
+    replacedBy: "name-of-replacement-rule"
+    description: 'Example: Enforce `return` statements in getters.',
+    categories: {
+        recommended: true,
+        fixable: true,
+        hasSuggestions: false
+    }
+}) } }
+```
+
+## Examples
+
+{% from 'components/rule.macro.html' import rule %}
+
+ {{ rule({
+    name: "getter-return",
+    deprecated: true,
+    description: 'Enforce `return` statements in getters.',
+    categories: {
+        recommended: true,
+        fixable: true,
+        hasSuggestions: false
+    }
+}) }}
+
+ {{ rule({
+    name: "getter-return",
+    removed: true,
+    description: 'Enforce `return` statements in getters.',
+    replacedBy: "other-rule-here",
+    categories: {
+        recommended: true,
+        fixable: true,
+        hasSuggestions: false
+    }
+}) }}
+
+{{ rule({
+    name: "getter-return",
+    deprecated: false,
+    description: 'Enforce `return` statements in getters.',
+    categories: {
+        recommended: true,
+        fixable: false,
+        hasSuggestions: false
+    }
+
+}) }}
diff --git a/eslint/docs/src/library/social-icons.md b/eslint/docs/src/library/social-icons.md
new file mode 100644 (file)
index 0000000..b76f726
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Social Icons 
+---
+
+{% include 'components/social-icons.html' %}
diff --git a/eslint/docs/src/library/theme-switcher.md b/eslint/docs/src/library/theme-switcher.md
new file mode 100644 (file)
index 0000000..1289998
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Theme Switcher 
+---
+
+{% include 'components/theme-switcher.html' %}
diff --git a/eslint/docs/src/library/version-switcher.md b/eslint/docs/src/library/version-switcher.md
new file mode 100644 (file)
index 0000000..5b72f4a
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Version Switcher 
+---
+
+{% include 'components/version-switcher.html' %}
diff --git a/eslint/docs/src/maintainer-guide/governance.md b/eslint/docs/src/maintainer-guide/governance.md
new file mode 100644 (file)
index 0000000..0705b64
--- /dev/null
@@ -0,0 +1,205 @@
+---
+title: Governance
+layout: doc
+eleventyNavigation:
+    key: governance
+    parent: maintainer guide
+    title: Governance
+    order: 4
+
+---
+
+ESLint is an open source project that depends on contributions from the community. Anyone may contribute to the project at any time by submitting code, participating in discussions, making suggestions, or any other contribution they see fit. This document describes how various types of contributors work within the ESLint project.
+
+## Roles and Responsibilities
+
+### Users
+
+Users are community members who have a need for the project. Anyone can be a User; there are no special requirements. Common User contributions include evangelizing the project (e.g., display a link on a website and raise awareness through word-of-mouth), informing developers of strengths and weaknesses from a new user perspective, or providing moral support (a "thank you" goes a long way).
+
+Users who continue to engage with the project and its community will often become more and more involved. Such Users may find themselves becoming Contributors, as described in the next section.
+
+### Contributors
+
+Contributors are community members who contribute in concrete ways to the project, most often in the form of code and/or documentation. Anyone can become a Contributor, and contributions can take many forms. There is no expectation of commitment to the project, no specific skill requirements, and no selection process.
+
+Contributors have read-only access to source code and so submit changes via pull requests. Contributor pull requests have their contribution reviewed and merged by a TSC member. TSC members and Committers work with Contributors to review their code and prepare it for merging.
+
+As Contributors gain experience and familiarity with the project, their profile within, and commitment to, the community will increase. At some stage, they may find themselves being nominated as either a Website Team Member or Committer by an existing Website Team Member or Committer.
+
+### Website Team Member
+
+Website Team Members are community members who have shown that they are committed to the continued maintenance of [eslint.org](https://eslint.org/) through ongoing engagement with the community. Website Team Members are given push access to the `eslint.org` GitHub repository and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/).
+
+ Website Team Members:
+
+* Are expected to work on public branches of the source repository and submit pull requests from that branch to the master branch.
+* Are expected to delete their public branches when they are no longer necessary.
+* Must submit pull requests for all changes.
+* Have their work reviewed by Reviewers and TSC members before acceptance into the repository.
+* May label and close website-related issues (see [Managing Issues](issues.html))
+* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
+
+To become a  Website Team Member:
+
+* One must have shown a willingness and ability to participate in the maintenance of [eslint.org](https://eslint.org/) as a team player. Typically, a potential  Website Team Member will need to show that they have an understanding of the structure of the website and how it fits into the larger ESLint project's objectives and strategy.
+* Website Team Members are expected to be respectful of every community member and to work collaboratively in the spirit of inclusion.
+* Have submitted a minimum of 10 website-related pull requests. What's a website-related pull request? One that is made to the `eslint.org` repository or the `docs` directory in the `eslint` repository and requires little effort to accept because it's well documented and tested.
+
+New Website Team Members can be nominated by any existing Website Team Member or Committer. Once they have been nominated, there will be a vote by the TSC members.
+
+It is important to recognize that membership on the website team is a privilege, not a right. That privilege must be earned and once earned it can be removed by the TSC members by a standard TSC motion. However, under normal circumstances Website Team Members remain for as long as they wish to continue engaging with the project.
+
+### Committers
+
+Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/).
+
+Committers:
+
+* Are expected to work on public branches of the source repository and submit pull requests from that branch to the master branch.
+* Are expected to delete their public branches when they are no longer necessary.
+* Must submit pull requests for all changes.
+* Have their work reviewed by TSC members before acceptance into the repository.
+* May label and close issues (see [Managing Issues](issues.html))
+* May merge some pull requests (see [Managing Pull Requests](pullrequests.html))
+
+To become a Committer:
+
+* One must have shown a willingness and ability to participate in the project as a team player. Typically, a potential Committer will need to show that they have an understanding of and alignment with the project, its objectives, and its strategy.
+* Committers are expected to be respectful of every community member and to work collaboratively in the spirit of inclusion.
+* Have submitted a minimum of 10 qualifying pull requests. What's a qualifying pull request? One that carries significant technical weight and requires little effort to accept because it's well documented and tested.
+
+New Committers can be nominated by any existing Committer. Once they have been nominated, there will be a vote by the TSC members.
+
+It is important to recognize that committership is a privilege, not a right. That privilege must be earned and once earned it can be removed by the TSC members by a standard TSC motion. However, under normal circumstances committership exists for as long as the Committer wishes to continue engaging with the project.
+
+A Committer who shows an above-average level of contribution to the project, particularly with respect to its strategic direction and long-term health, may be nominated to become a reviewer, described below.
+
+#### Process for Adding Committers
+
+1. Send email congratulating the new committer and confirming that they would like to accept. This should also outline the responsibilities of a committer with a link to the maintainer guide.
+1. Add the GitHub user to the "ESLint Team" team
+1. Add committer email to the ESLint team mailing list
+1. Invite to Discord team channel
+1. Tweet congratulations to the new committer from the ESLint Twitter account
+
+### Reviewers
+
+Reviewers are community members who have contributed a significant amount of time to the project through triaging of issues, fixing bugs, implementing enhancements/features, and are trusted community leaders.
+
+Reviewers may perform all of the duties of Committers, and also:
+
+* May merge external pull requests for accepted issues upon reviewing and approving the changes.
+* May merge their own pull requests once they have collected the feedback they deem necessary. (No pull request should be merged without at least one Committer/Reviewer/TSC member comment stating they've looked at the code.)
+
+To become a Reviewer:
+
+* Work in a helpful and collaborative way with the community.
+* Have given good feedback on others' submissions and displayed an overall understanding of the code quality standards for the project.
+* Commit to being a part of the community for the long-term.
+* Have submitted a minimum of 50 qualifying pull requests.
+
+A Committer is invited to become a Reviewer by existing Reviewers and TSC members. A nomination will result in discussion and then a decision by the TSC.
+
+#### Process for Adding Reviewers
+
+1. Add the GitHub user to the "ESLint Reviewers" GitHub team
+1. Tweet congratulations to the new Reviewer from the ESLint Twitter account
+
+### Technical Steering Committee (TSC)
+
+The ESLint project is jointly governed by a Technical Steering Committee (TSC) which is responsible for high-level guidance of the project.
+
+The TSC has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+
+TSC seats are not time-limited. The size of the TSC can not be larger than five members. This size ensures adequate coverage of important areas of expertise balanced with the ability to make decisions efficiently.
+
+The TSC may add additional members to the TSC by a standard TSC motion.
+
+A TSC member may be removed from the TSC by voluntary resignation, by a standard TSC motion, or by missing four consecutive TSC meetings. In all cases, the TSC member will revert to Reviewer status unless they prefer Alumni status.
+
+Changes to TSC membership should be posted in the agenda, and may be suggested as any other agenda item (see "TSC Meetings" below).
+
+No more than 1/3 of the TSC members may be affiliated with the same employer. If removal or resignation of a TSC member, or a change of employment by a TSC member, creates a situation where more than 1/3 of the TSC membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more TSC members affiliated with the over-represented employer(s).
+
+TSC members have additional responsibilities over and above those of a Reviewer. These responsibilities ensure the smooth running of the project. TSC members are expected to review code contributions, approve changes to this document, manage the copyrights within the project outputs, and attend regular TSC meetings.
+
+TSC members may perform all of the duties of Reviewers, and also:
+
+* May release new versions of all ESLint projects.
+* May participate in TSC meetings.
+* May propose budget items.
+* May propose new ESLint projects.
+
+There is no specific set of requirements or qualifications for TSC members beyond those that are expected of Reviewers.
+
+A Reviewer is invited to become a TSC member by existing TSC members. A nomination will result in discussion and then a decision by the TSC.
+
+#### Process for Adding TSC Members
+
+1. Add the GitHub user to the "ESLint TSC" GitHub team
+1. Set the GitHub user to be have the "Owner" role for the ESLint organization
+1. Send a welcome email with a link to the [maintainer guide](./) and instructions for npm 2FA.
+1. Invite to the Discord TSC channel
+1. Make the TSC member an admin on the ESLint team mailing list
+1. Add the TSC member to the recurring TSC meeting event on Google Calendar
+1. Add the TSC member as an admin to ESLint Twitter Account on Tweetdeck
+1. Add the TSC member to the ESLint TSC mailing list as an "Owner"
+1. Tweet congratulations to the new TSC member from the ESLint Twitter account
+
+#### TSC Meetings
+
+The TSC meets every other week in the TSC Meeting [Discord](https://eslint.org/chat) channel. The meeting is run by a designated moderator approved by the TSC.
+
+Items are added to the TSC agenda which are considered contentious or
+are modifications of governance, contribution policy, TSC membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches.
+That should happen continuously on GitHub and be handled by the larger
+group of Committers.
+
+Any community member, Committer, or Reviewer can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Anyone can add the item to the agenda by adding
+the "tsc agenda" tag to the issue.
+
+Prior to each TSC meeting, the moderator will share the Agenda with
+members of the TSC. TSC members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the TSC
+cannot veto or remove items.
+
+No binding votes on TSC agenda items can take place without a quorum of
+TSC members present in the meeting. Quorum is achieved when more than
+half of the TSC members (minus non-attending members) are present.
+
+The TSC may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sending it as a pull request after the meeting.
+
+## Consensus Seeking Process
+
+The TSC follows a
+[Consensus Seeking](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision making model.
+
+When an agenda item has appeared to reach a consensus, the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus, a TSC member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be approved by a majority of the TSC
+or else the discussion will continue. Simple majority wins.
+
+----
+
+This work is a derivative of [YUI Contributor Model](https://github.com/yui/yui3/wiki/Contributor-Model) and the [Node.js Project Governance Model](https://github.com/nodejs/node/blob/master/GOVERNANCE.md).
+
+This work is licensed under a [Creative Commons Attribution-ShareAlike 2.0 UK: England & Wales License](https://creativecommons.org/licenses/by-sa/2.0/uk/).
diff --git a/eslint/docs/src/maintainer-guide/index.md b/eslint/docs/src/maintainer-guide/index.md
new file mode 100644 (file)
index 0000000..ecac32f
--- /dev/null
@@ -0,0 +1,31 @@
+---
+title: Maintainer Guide
+layout: doc
+eleventyNavigation:
+    key: maintainer guide 
+    title: Maintainer Guide 
+    order: 3
+
+---
+
+This guide is intended for those who work as part of the ESLint project team.
+
+## [Managing Issues](issues)
+
+Describes how to deal with issues when they're opened, when interacting with users, and how to close them effectively.
+
+## [Reviewing Pull Requests](pullrequests)
+
+Describes how to review incoming pull requests.
+
+## [Managing Releases](releases)
+
+Describes how to do an ESLint project release.
+
+## [Governance](governance)
+
+Describes the governance policy for ESLint, including the rights and privileges of individuals inside the project.
+
+## [Working Groups](working-groups)
+
+Describes how working groups are created and how they function within the ESLint project.
diff --git a/eslint/docs/src/maintainer-guide/issues.md b/eslint/docs/src/maintainer-guide/issues.md
new file mode 100644 (file)
index 0000000..ca6abf3
--- /dev/null
@@ -0,0 +1,159 @@
+---
+title: Managing Issues
+layout: doc
+eleventyNavigation:
+    key: managing issues
+    parent: maintainer guide 
+    title: Managing Issues
+    order: 1
+
+---
+
+New issues are filed frequently, and how we respond to those issues directly affects the success of the project. Being part of the project team means helping to triage and address issues as they come in so the project can continue to run smoothly.
+
+## Things to Keep in Mind
+
+1. **Be nice.** Even if the people are being rude or aggressive on an issue, as a project team member you must be the mature one in the conversation. Do your best to work with everyone no matter their style. Remember, poor wording choice can also be a sign of someone who doesn't know English very well, so be sure to consider that when trying to determine the tone of someone's message. Being rude, even when someone is being rude to you, reflects poorly on the team and the project as a whole.
+1. **Be inquisitive.** Ask questions on the issue whenever something isn't clear. Don't assume you understand what's being reported if there are details missing. Whenever you are unsure, it's best to ask for more information.
+1. **Not all requests are equal.** It's unlikely we'll be able to accommodate every request, so don't be afraid to say that something doesn't fit into the scope of the project or isn't practical. It's better to give such feedback if that's the case.
+1. **Close when appropriate.** Don't be afraid to close issues that you don't think will be done, or when it's become clear from the conversation that there's no further work to do. Issues can always be reopened if they are closed incorrectly, so feel free to close issues when appropriate. Just be sure to leave a comment explaining why the issue is being closed (if not closed by a commit).
+
+## Types of Issues
+
+There are four primary issue categories:
+
+1. **Bug** - something isn't working the way it's expected to work.
+1. **Enhancement** - a change to something that already exists. For instance, adding a new option to an existing rule or a bug in a rule where fixing it will result in the rule reporting more problems (in this case, use both "Bug" and "Enhancement").
+1. **Feature** - adding something that doesn't already exist. For example, adding a new rule, new formatter, or new command line flag.
+1. **Question** - an inquiry about how something works that won't result in a code change. We'd prefer if people use the mailing list or chatroom for questions, but sometimes they'll open an issue.
+
+The first goal when evaluating an issue is to determine which category the issue falls into.
+
+## Triaging Process
+
+All of ESLint's issues, across all GitHub repositories, are managed on our [Triage Project](https://github.com/orgs/eslint/projects/2). Please use the Triage project instead of the issues list when reviewing issues to determine what to work on. The Triage project has several columns:
+
+* **Needs Triage** - issues that have not yet been reviewed by anyone
+* **Triaging** - issues that someone has reviewed but has not been able to fully triage yet
+* **Ready for Dev Team** - issues that have been triaged and have all of the information necessary for the dev team to take a look
+* **Evaluating** - the dev team is evaluating these issues to determine whether to move forward or not
+* **Feedback Needed** - a team member is requesting more input from the rest of the team before proceeding
+* **Waiting for RFC** - the next step in the process is for an RFC to be written
+* **RFC Opened** - an RFC is opened to address these issues
+* **Blocked** - the issue can't move forward due to some dependency
+* **Ready to Implement** - these issues have all of the details necessary to start implementation
+* **PR Opened** - there is an open pull request for each of these issues
+* **Completed** - the issue has been closed (either via pull request merge or by the team manually closing the issue)
+
+We make every attempt to automate movement between as many columns as we can, but sometimes moving issues needs to be done manually.
+
+### When an Issue is Opened
+
+When an issue is opened, it is automatically added to the "Needs Triage" column in the Triage project. These issues need to be evaluated to determine next steps. Anyone on the support team or dev team can follow these steps to properly triage issues.
+
+**Note:** If an issue is in the "Triaging" column, that means someone is already triaging it and you should let them finish. There's no need to comment on issues in the "Triaging" column unless someone asks for help.
+
+The steps for triaging an issue are:
+
+1. Move the issue from "Needs Triage" to "Triaging" in the Triage project
+1. Check: Has all of the information in the issue template been provided?
+    * **No:** If information is missing from the issue template, or you can't tell what is being requested, please ask the author to provide the missing information:
+        * Add the "needs info" label to the issue so we know that this issue is stalled due to lack of information.
+        * Don't move on to other steps until the necessary information has been provided.
+        * If the issue author hasn't provided the necessary information after 7 days, please close the issue. The bot will add a comment stating that the issue was closed because there was information missing.
+    * **Yes:**
+        * If the issue is actually a question (rather than something the dev team needs to change), please [convert it to a discussion](https://docs.github.com/en/free-pro-team@latest/discussions/managing-discussions-for-your-community/moderating-discussions#converting-an-issue-to-a-discussion). You can continue the conversation as a discussion.
+        * If the issue is reporting a bug, try to reproduce the issue following the instructions in the issue. If you can reproduce the bug, please add the "repro:yes" label. (The bot will automatically remove the "repro:needed" label.) If you can't reproduce the bug, ask the author for more information about their environment or to clarify reproduction steps.
+        * If the issue is reporting something that works as intended, please add the "works as intended" label and close the issue.
+        * For all issues, please add labels describing the part of ESLint affected:
+            * "3rd party plugin" - related to third-party functionality (plugins, parsers, rules, etc.)
+            * "build" - related to commands run during a build (testing, linting, release scripts, etc.)
+            * "cli" - related to command line input or output, or to `CLIEngine`
+            * "core" - related to internal APIs
+            * "documentation" - related to content on eslint.org
+            * "infrastructure" - related to resources needed for builds or deployment (VMs, CI tools, bots, etc.)
+            * "rule" - related to core rules
+        * If you can't properly triage the issue, move the issue back to the "Needs Triage" column in the Triage project so someone else can triage it
+        * If you have triaged the issue, move the issue to the "Ready for Dev Team" column in the Triage project
+
+## Evaluation Process
+
+When an issue has been moved to the "Ready for Dev Team" column, any dev team member can pick up the issue to start evaluating it.
+
+1. Move the issue into the "Evaluating" column.
+1. Next steps:
+    * **Bugs:** if you can verify the bug, add the "accepted" label and ask if they would like to submit a pull request.
+    * **New Rules:** if you are willing to champion the rule (meaning you believe it should be included in ESLint core and you will take ownership of the process for including it), add a comment saying you will champion the issue, assign the issue to yourself, and follow the [guidelines](#championing-issues) below.
+    * **Rule Changes:** if you are willing to champion the change and it would not be a breaking change (requiring a major version increment), add a comment saying that you will champion the issue, assign the issue to yourself, and follow the [guidelines](#championing-issues) below.
+    * **Breaking Changes:** if you suspect or can verify that a change would be breaking, label it as "Breaking".
+    * **Duplicates:** if you can verify the issue is a duplicate, add a comment mentioning the duplicate issue (such as, "Duplicate of #1234") and close the issue.
+1. Regardless of the above, always leave a comment. Don't just add labels, engage with the person who opened the issue by asking a question (request more information if necessary) or stating your opinion of the issue. If it's a verified bug, ask if the user would like to submit a pull request.
+1. If the issue can't be implemented because it needs an external dependency to be updated or needs to wait for another issue to be resolved, move the issue to the "Blocked" column.
+1. If the issue has been accepted and an RFC is required as the next step, move the issue to the "Waiting for RFC" column and comment on the issue that an RFC is needed.
+
+**Note:** "Good first issue" issues are intended to help new contributors feel welcome and empowered to make a contribution to ESLint. To ensure that new contributors are given a chance to work on these issues, issues labeled "good first issue" must be open for 30 days *from the day the issue was labeled* before a team member is permitted to work on them.
+
+## Accepting Issues
+
+Issues may be labeled as "accepted" when the issue is:
+
+* A bug that you've been able to reproduce and verify (i.e. you're sure it's a bug)
+* A new rule or rule change that you're championing and [consensus](#consensus) has been reached for its inclusion in the project
+
+The "accepted" label will be added to other issues by a TSC member if it's appropriate for the roadmap.
+
+When an issue is accepted and implementation can begin, it should be moved to the "Ready to Implement" column.
+
+## Championing Issues
+
+New rules and rule changes require a champion. As champion, it's your job to:
+
+* Gain [consensus](#consensus) from the ESLint team on inclusion
+* Guide the rule creation process until it's complete (so only champion a rule that you have time to implement or help another contributor implement)
+
+Once consensus has been reached on inclusion, add the "accepted" and, optionally, "help wanted" and "good first issue" labels, as necessary.
+
+## Consensus
+
+Consensus is reached on issues when there are at least three team members who believe the change is a good idea and no one who believes the change is a bad idea. In order to indicate your support for an issue, leave a +1 reaction (thumbs up) on the original issue description in addition to any comments you might have.
+
+## When to Send to TSC
+
+If consensus cannot be reached on an issue, or an issue's progress has been stalled and it's not clear if the issue should be closed, then you can refer the issue to the TSC for resolution. To do so, add the "tsc agenda" label to the issue and add a comment including the following information:
+
+1. A one-paragraph summary of the discussion to this point.
+2. The question you would like the TSC to answer.
+
+The issue will be discussed at the next TSC meeting and the resolution will be posted back to the issue.
+
+## Evaluating Core Features and Enhancements (TSC members only)
+
+In addition to the above, changes to the core (including CLI changes) that would result in a minor or major version release must be approved by the TSC by standard TSC motion. Add the label "tsc agenda" to the issue and it will be discussed at the next TSC meeting. In general, requests should meet the following criteria to be considered:
+
+1. The feature or enhancement is in scope for the project and should be added to the roadmap
+1. Someone is committed to including the change within the next year
+1. There is reasonable certainty about who will do the work
+
+When a suggestion is too ambitious or would take too much time to complete, it's better not to accept the proposal. Stick to small, incremental changes and lay out a roadmap of where you'd like the project to go eventually. Don't let the project get bogged down in big features that will take a long time to complete.
+
+**Breaking Changes:** Be on the lookout for changes that would be breaking. Issues that represent breaking changes should be labeled as "breaking".
+
+## When to Close an Issue
+
+All team members are allowed to close issues depending on how the issue has been resolved.
+
+Team members may close an issue **immediately** if:
+
+1. The issue is a duplicate of an existing issue.
+1. The issue is just a question and has been answered.
+
+Team members may close an issue where the consensus is to not accept the issue after a waiting period (to ensure that other team members have a chance to review the issue before it is closed):
+
+* Wait **2 days** if the issue was opened Monday through Friday.
+* Wait **3 days** if the issue was opened on Saturday or Sunday.
+
+In an effort to keep the issues backlog manageable, team members may also close an issue if the following conditions are met:
+
+* **Unaccepted**: Close after it has been open for 21 days, as these issues do not have enough support to move forward.
+* **Accepted**: Close after 90 days if no one from the team or the community is willing to step forward and own the work to complete to it.
+* **Help wanted:** Close after 90 days if it has not been completed.
diff --git a/eslint/docs/src/maintainer-guide/pullrequests.md b/eslint/docs/src/maintainer-guide/pullrequests.md
new file mode 100644 (file)
index 0000000..3c0b064
--- /dev/null
@@ -0,0 +1,109 @@
+---
+title: Reviewing Pull Requests
+layout: doc
+eleventyNavigation:
+    key: reviewing pull requests
+    parent: maintainer guide 
+    title: Reviewing Pull Requests
+    order: 2
+
+---
+
+Pull requests are submitted frequently and represent our best opportunity to interact with the community. As such, it's important that pull requests are well-reviewed before being merged and that interactions on pull requests are positive.
+
+## Who Can Review Pull Requests?
+
+Anyone, both team members and the public, may leave comments on pull requests.
+
+## Reviewing a Pull Request
+
+When a pull request is opened, the bot will check the following:
+
+1. Has the submitter signed a CLA?
+1. Is the commit message summary in the correct format?
+1. Is the commit summary too long?
+
+The bot will add a comment specifying the problems that it finds. You do not need to look at the pull request any further until those problems have been addressed (there's no need to comment on the pull request to ask the submitter to do what the bot asked - that's why we have the bot!).
+
+Once the bot checks have been satisfied, you check the following:
+
+1. Double-check that the commit message tag ("Fix:", "New:", etc.) is correct based on the issue (or, if no issue is referenced, based on the stated problem).
+1. If the pull request makes a change to core, ensure that an issue exists and the pull request references the issue in the commit message.
+1. Does the code follow our conventions (including header comments, JSDoc comments, etc.)? If not, please leave that feedback and reference the conventions document.
+1. For code changes:
+    * Are there tests that verify the change? If not, please ask for them.
+    * Is documentation needed for the change? If yes, please let the submitter know.
+1. Are there any automated testing errors? If yes, please ask the submitter to check on them.
+1. If you've reviewed the pull request and there are no outstanding issues, leave a comment "LGTM" to indicate your approval. If you would like someone else to verify the change, comment "LGTM but would like someone else to verify."
+
+**Note:** If you are a team member and you've left a comment on the pull request, please follow up to verify that your comments have been addressed.
+
+## Who Can Merge a Pull Request
+
+TSC members, Reviewers, Committers, and Website Team Members may merge pull requests, depending on the contents of the pull request.
+
+Website Team Members may merge a pull request in the `eslint.org` repository if it is:
+
+1. A documentation change
+1. A dependency upgrade
+1. A chore
+
+Committers may merge a pull request if it is a non-breaking change and is:
+
+1. A documentation change
+1. A bug fix (for either rules or core)
+1. A dependency upgrade
+1. Related to the build tool
+1. A chore
+
+In addition, committers may merge any non-breaking pull request if it has been approved by at least one TSC member.
+
+TSC members may merge all pull requests, including those that committers may merge.
+
+## When to Merge a Pull Request
+
+We use the "Merge" button to merge requests into the repository. Before merging a pull request, verify that:
+
+1. All comments have been addressed
+1. Any team members who made comments have verified that their concerns were addressed
+1. All automated tests are passing (never merge a pull request with failing tests)
+
+Be sure to say thank you to the submitter before merging, especially if they put a lot of work into the pull request.
+
+Team members may merge a pull request immediately if it:
+
+1. Makes a small documentation change
+1. Is a chore
+1. Fixes a block of other work on the repository (build-related, test-related, dependency-related, etc.)
+1. Is an important fix to get into a patch release
+
+Otherwise, team members should observe a waiting period before merging a pull request:
+
+* Wait **2 days** if the pull request was opened Monday through Friday.
+* Wait **3 days** if the pull request was opened on Saturday or Sunday.
+
+The waiting period ensures that other team members have a chance to review the pull request before it is merged.
+
+If the pull request was created from a branch on the `eslint/eslint` repository (as opposed to a fork), delete the branch after merging the pull request. (GitHub will display a "Delete branch" button after the pull request is merged.)
+
+**Note:** You should not merge your own pull request unless you're received feedback from at least one other team member.
+
+## When to Close a Pull Request
+
+There are several times when it's appropriate to close a pull request without merging:
+
+1. The pull request addresses an issue that is already fixed
+1. The pull request hasn't been updated in 30 days
+1. The pull request submitter isn't willing to follow project guidelines.
+
+In any of these cases, please be sure to leave a comment stating why the pull request is being closed.
+
+### Example Closing Comments
+
+If a pull request hasn't been updated in 30 days:
+
+> Closing because there hasn't been activity for 30 days. If you're still interested in submitting this code, please feel free to resubmit.
+
+If a pull request submitter isn't willing to follow project guidelines.
+
+> Unfortunately, we can't accept pull requests that don't follow our guidelines. I'm going to close this pull request now, but if you'd like to resubmit following our guidelines, we'll be happy to review.
diff --git a/eslint/docs/src/maintainer-guide/releases.md b/eslint/docs/src/maintainer-guide/releases.md
new file mode 100644 (file)
index 0000000..975717d
--- /dev/null
@@ -0,0 +1,68 @@
+---
+title: Managing Releases
+layout: doc
+eleventyNavigation:
+    key: managing releases
+    parent: maintainer guide 
+    title: Managing Releases
+    order: 3
+
+---
+
+Releases are when a project formally publishes a new version so the community can use it. There are two types of releases:
+
+* Regular releases that follow [semantic versioning](https://semver.org/) and are considered production-ready.
+* Prereleases that are not considered production-ready and are intended to give the community a preview of upcoming changes.
+
+## Release Team
+
+A two-person release team is assigned to each scheduled release. This two-person team is responsible for:
+
+1. The scheduled release on Friday
+1. Monitoring issues over the weekend
+1. Determining if a patch release is necessary on Monday
+1. Publishing the patch release (if necessary)
+
+The two-person team should seek input from the whole team on the Monday following a release to double-check if a patch release is necessary.
+
+At least one member of the release team needs to have access to eslint's two-factor authentication for npm in order to do a release.
+
+## Release Communication
+
+Each scheduled release should be associated with a release issue ([example](https://github.com/eslint/eslint/issues/8138)). The release issue is the source of information for the team about the status of a release. Be sure the release issue has the "release" label so that it's easy to find.
+
+## Process
+
+On the day of a scheduled release, the release team should follow these steps:
+
+1. Review open pull requests to see if any should be merged. In general, you can merge pull requests that:
+    * Have been open at least two days and have been reviewed (these are just waiting for merge).
+    * Important pull requests (as determined by the team). You should stop and have people review before merging if they haven't been already.
+    * Documentation changes.
+    * Small bugfixes written by a team member.
+1. Log into Jenkins and schedule a build for the "ESLint Release" job.
+1. Watch the console output of the build on Jenkins. At some point, the build will pause and a link will be produced with an input field for a six-digit 2FA code.
+1. Enter the current six-digit 2FA code from your authenticator app.
+1. Continue the build and wait for it to finish.
+1. Update the release blog post with a "Highlights" section, including new rules and anything else that's important.
+1. Make a release announcement in the public chatroom.
+1. Make a release announcement on Twitter.
+1. Make a release announcement on the release issue. Document any problems that occurred during the release, and remind the team not to merge anything other than documentation changes and bugfixes. Leave the release issue open.
+1. Add the `patch release pending` label to the release issue. (When this label is present, `eslint-github-bot` will create a pending status check on non-semver-patch pull requests, to ensure that they aren't accidentally merged while a patch release is pending.)
+
+On the Monday following the scheduled release, the release team needs to determine if a patch release is necessary. A patch release is considered necessary if any of the following occurred since the scheduled release:
+
+* A regression bug is causing people's lint builds to fail when it previously passed.
+* Any bug that is causing a lot of problems for users (frequently happens due to new functionality).
+
+The patch release decision should be made as early on Monday as possible. If a patch release is necessary, then follow the same steps as the scheduled release process.
+
+In rare cases, a second patch release might be necessary if the release is known to have a severe regression that hasn't been fixed by Monday. If this occurs, the release team should announce the situation on the release issue, and leave the issue open until all patch releases are complete. However, it's usually better to fix bugs for the next release cycle rather than doing a second patch release.
+
+After the patch release has been published (or no patch release is necessary), close the release issue and inform the team that they can start merging in semver-minor changes again.
+
+## Emergency Releases
+
+In general, we try not to do emergency releases (an emergency release is unplanned and isn't the regularly scheduled release or the anticipated patch release). Even if there is a regression, it's best to wait the weekend to see if any other problems arise so a patch release can fix as many issues as possible.
+
+The only real exception is if ESLint is completely unusable by most of the current users. For instance, we once pushed a release that errored for everyone because it was missing some core files. In that case, an emergency release is appropriate.
diff --git a/eslint/docs/src/maintainer-guide/working-groups.md b/eslint/docs/src/maintainer-guide/working-groups.md
new file mode 100644 (file)
index 0000000..4a79ff4
--- /dev/null
@@ -0,0 +1,26 @@
+---
+title: Working Groups
+layout: doc
+
+---
+
+The ESLint TSC may form working groups to focus on a specific area of the project.
+
+## Creating a Working Group
+
+Working groups are created by sending an email to the team mailing list. Each working group:
+
+1. Must have a GitHub team under the "ESLint Team" top-level GitHub team. (The GitHub team name should end with "WG" to distinguish it from other types of teams.)
+1. Must have at least one TSC member.
+1. May have any number of Committers and Reviewers.
+1. Must have at least two members.
+
+Active working groups are listed on the [team page](https://eslint.org/team).
+
+## How Working Groups Work
+
+Each working group is responsible for its own inner working. Working groups can decide how large or small they should be (so long as there is at least two members), when and who to add or remove from the working group, and how to accomplish their objectives.
+
+Working groups may be temporary or permanent.
+
+If working groups intend to make a significant change to the ESLint project, the proposal must still be approved by the TSC.
diff --git a/eslint/docs/src/pages/404.html b/eslint/docs/src/pages/404.html
new file mode 100644 (file)
index 0000000..ee6413c
--- /dev/null
@@ -0,0 +1,29 @@
+---
+layout: main.html
+permalink: /404.html
+eleventyExcludeFromCollections: true
+hook: "404_page"
+---
+
+<section class="404 section">
+    <div class="content-container grid">
+        <div class="span-1-5">
+            <h1 class="section-title h0">
+                <span class="eyebrow">{{ site.404_page.title }}</span>
+                {{ site.404_page.subtitle }}
+            </h1>
+            <p class="section-supporting-text">
+                {{ site.404_page.description }}
+            </p>
+            <div class="eslint-actions">
+                <a href="/" class="c-btn c-btn--primary c-btn--large">{{ site.404_page.actions.back_to_home }}</a>
+                <a href="{{ links.docs }}" class="c-btn c-btn--secondary c-btn--large">{{
+                    site.404_page.actions.browse_docs }}</a>
+            </div>
+        </div>
+
+        <div class="content-container span-7-12">
+            <img width="480" height="366" src="{{ '/assets/images/404.png' | url }}" alt="">
+        </div>
+    </div>
+</section>
diff --git a/eslint/docs/src/pages/component-library.html b/eslint/docs/src/pages/component-library.html
new file mode 100644 (file)
index 0000000..555698e
--- /dev/null
@@ -0,0 +1,9 @@
+---
+layout: components.html
+permalink: /component-library/index.html
+hook: "component-library"
+---
+
+The list of components on the left includes shortcodes, macros and partials used across the Docs.
+
+Most of the components are shortcodes used in individual doc pages. Usage notes are included for each component.
diff --git a/eslint/docs/src/pages/index.md b/eslint/docs/src/pages/index.md
new file mode 100644 (file)
index 0000000..43c7954
--- /dev/null
@@ -0,0 +1,21 @@
+---
+title: Documentation
+layout: doc
+permalink: /index.html
+---
+
+Welcome to our documentation pages! What would you like to view?
+
+## [User Guide](user-guide/)
+
+Intended for end users of ESLint. Contains information about core rules, configuration, command line options, formatters, and integrations,
+as well as guides for migrating from earlier versions of ESLint.
+
+## [Developer Guide](developer-guide/)
+
+Intended for contributors to ESLint and people who wish to extend ESLint. Contains information about contributing to ESLint; creating custom
+rules, configurations, plugins, and formatters; and information about our architecture and Node.js API.
+
+## [Maintainer Guide](maintainer-guide/)
+
+Intended for maintainers of ESLint.
diff --git a/eslint/docs/src/pages/languages.md b/eslint/docs/src/pages/languages.md
new file mode 100644 (file)
index 0000000..9491e24
--- /dev/null
@@ -0,0 +1,21 @@
+---
+layout: main.html
+title: Languages
+permalink: /languages/
+hook: "languages-page"
+---
+
+{%- from 'components/hero.macro.html' import hero %}
+
+{{ hero({
+    title: "Languages",
+    supporting_text: "Choose your language"
+}) }}
+
+<section class="languages-section section">
+    <div class="content-container">
+        <nav aria-labelledby="languages-label">
+            {% include 'partials/languages-list.html' %}
+        </nav>
+    </div>
+</section>
diff --git a/eslint/docs/src/pages/pages.11tydata.json b/eslint/docs/src/pages/pages.11tydata.json
new file mode 100644 (file)
index 0000000..228d99b
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "hook": "page"
+}
diff --git a/eslint/docs/src/pages/rules.md b/eslint/docs/src/pages/rules.md
new file mode 100644 (file)
index 0000000..7ede8bf
--- /dev/null
@@ -0,0 +1,88 @@
+---
+title: Rules
+layout: doc
+permalink: /rules/index.html
+eleventyNavigation:
+    key: rules
+    parent: user guide
+    title: Rules
+    order: 4
+---
+
+{% from 'components/rule-categories.macro.html' import ruleCategories, recommended, fixable, hasSuggestions %}
+{% from 'components/rule.macro.html' import rule %}
+
+Rules in ESLint are grouped by type to help you understand their purpose. Each rule has emojis denoting:
+
+{{ ruleCategories({
+        index: true,
+        recommended: true,
+        fixable: true,
+        hasSuggestions: true
+}) }}
+
+{%- for type in rules.types -%}
+
+<h2 id="{{ type.displayName | slugify }}"> {{ type.displayName }} </h2>
+
+{{ type.description | safe }}
+
+    {%- for the_rule in type.rules -%}
+    {%- if type.displayName == 'deprecated' -%}{%- set deprecated_value = true -%}{%- endif -%}
+
+    {%- set name_value = the_rule.name -%}
+    {%- set description_value = the_rule.description -%}
+    {%- set isRecommended = the_rule.recommended -%}
+    {%- set isFixable = the_rule.fixable -%}
+    {%- set isHasSuggestions = the_rule.hasSuggestions -%}
+
+    {{ rule({
+            name: name_value,
+            deprecated: deprecated_value,
+            description: description_value,
+            categories: {
+                recommended: isRecommended,
+                fixable: isFixable,
+                hasSuggestions: isHasSuggestions
+            }
+    }) }}
+    {%- endfor -%}
+{%- endfor -%}
+
+{%- if rules.deprecated -%}
+
+<h2 id="{{ rules.deprecated.name | slugify }}">{{ rules.deprecated.name }}</h2>
+
+{{ rules.deprecated.description | safe }}
+
+{%- for the_rule in rules.deprecated.rules -%}
+    {%- set name_value = the_rule.name -%}
+    {%- set isReplacedBy = the_rule.replacedBy -%}
+
+    {{ rule({
+            name: name_value,
+            deprecated: true,
+            replacedBy: isReplacedBy
+    }) }}
+{%- endfor -%}
+{%- endif -%}
+
+{%- if rules.removed -%}
+
+<h2 id="{{ rules.removed.name | slugify }}">{{ rules.removed.name }}</h2>
+
+{{ rules.removed.description | safe }}
+
+{%- for the_rule in rules.removed.rules -%}
+    {%- set name_value = the_rule.removed -%}
+    {%- set isReplacedBy = the_rule.replacedBy -%}
+
+    {{ rule({
+            name: name_value,
+            removed: true,
+            replacedBy: isReplacedBy
+    }) }}
+{%- endfor -%}
+{%- endif -%}
+
+{# <!-- markdownlint-disable-file MD046 --> #}
diff --git a/eslint/docs/src/pages/versions.md b/eslint/docs/src/pages/versions.md
new file mode 100644 (file)
index 0000000..ce92a8e
--- /dev/null
@@ -0,0 +1,21 @@
+---
+layout: main.html
+title: Versions
+permalink: /versions/
+hook: "versions-page"
+---
+
+{%- from 'components/hero.macro.html' import hero %}
+
+{{ hero({
+    title: "ESLint Versions",
+    supporting_text: "Choose the documentation version"
+}) }}
+
+<section class="versions-section section">
+    <div class="content-container">
+        <nav aria-labelledby="versions-label">
+            {% include 'partials/versions-list.html' %}
+        </nav>
+    </div>
+</section>
diff --git a/eslint/docs/src/rules/accessor-pairs.md b/eslint/docs/src/rules/accessor-pairs.md
new file mode 100644 (file)
index 0000000..638bbc8
--- /dev/null
@@ -0,0 +1,324 @@
+---
+title: accessor-pairs
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-dupe-keys
+- no-dupe-class-members
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
+---
+
+
+It's a common mistake in JavaScript to create an object with just a setter for a property but never have a corresponding getter defined for it. Without a getter, you cannot read the property, so it ends up not being used.
+
+Here are some examples:
+
+```js
+// Bad
+var o = {
+    set a(value) {
+        this.val = value;
+    }
+};
+
+
+// Good
+var o = {
+    set a(value) {
+        this.val = value;
+    },
+    get a() {
+        return this.val;
+    }
+};
+
+```
+
+This rule warns if setters are defined without getters. Using an option `getWithoutSet`, it will warn if you have a getter without a setter also.
+
+## Rule Details
+
+This rule enforces a style where it requires to have a getter for every property which has a setter defined.
+
+By activating the option `getWithoutSet` it enforces the presence of a setter for every property which has a getter defined.
+
+This rule always checks object literals and property descriptors. By default, it also checks class declarations and class expressions.
+
+## Options
+
+* `setWithoutGet` set to `true` will warn for setters without getters (Default `true`).
+* `getWithoutSet` set to `true` will warn for getters without setters (Default `false`).
+* `enforceForClassMembers` set to `true` additionally applies this rule to class getters/setters (Default `true`). Set `enforceForClassMembers` to `false` if you want this rule to ignore class declarations and class expressions.
+
+### setWithoutGet
+
+Examples of **incorrect** code for the default `{ "setWithoutGet": true }` option:
+
+:::incorrect
+
+```js
+/*eslint accessor-pairs: "error"*/
+
+var o = {
+    set a(value) {
+        this.val = value;
+    }
+};
+
+
+var o = {d: 1};
+Object.defineProperty(o, 'c', {
+    set: function(value) {
+        this.val = value;
+    }
+});
+```
+
+:::
+
+Examples of **correct** code for the default `{ "setWithoutGet": true }` option:
+
+:::correct
+
+```js
+/*eslint accessor-pairs: "error"*/
+
+var o = {
+    set a(value) {
+        this.val = value;
+    },
+    get a() {
+        return this.val;
+    }
+};
+
+var o = {d: 1};
+Object.defineProperty(o, 'c', {
+    set: function(value) {
+        this.val = value;
+    },
+    get: function() {
+        return this.val;
+    }
+});
+
+```
+
+:::
+
+### getWithoutSet
+
+Examples of **incorrect** code for the `{ "getWithoutSet": true }` option:
+
+:::incorrect
+
+```js
+/*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/
+
+var o = {
+    set a(value) {
+        this.val = value;
+    }
+};
+
+var o = {
+    get a() {
+        return this.val;
+    }
+};
+
+var o = {d: 1};
+Object.defineProperty(o, 'c', {
+    set: function(value) {
+        this.val = value;
+    }
+});
+
+var o = {d: 1};
+Object.defineProperty(o, 'c', {
+    get: function() {
+        return this.val;
+    }
+});
+```
+
+:::
+
+Examples of **correct** code for the `{ "getWithoutSet": true }` option:
+
+:::correct
+
+```js
+/*eslint accessor-pairs: ["error", { "getWithoutSet": true }]*/
+var o = {
+    set a(value) {
+        this.val = value;
+    },
+    get a() {
+        return this.val;
+    }
+};
+
+var o = {d: 1};
+Object.defineProperty(o, 'c', {
+    set: function(value) {
+        this.val = value;
+    },
+    get: function() {
+        return this.val;
+    }
+});
+
+```
+
+:::
+
+### enforceForClassMembers
+
+When `enforceForClassMembers` is set to `true` (default):
+
+* `"getWithoutSet": true` will also warn for getters without setters in classes.
+* `"setWithoutGet": true` will also warn for setters without getters in classes.
+
+Examples of **incorrect** code for `{ "getWithoutSet": true, "enforceForClassMembers": true }`:
+
+:::incorrect
+
+```js
+/*eslint accessor-pairs: ["error", { "getWithoutSet": true, "enforceForClassMembers": true }]*/
+
+class Foo {
+    get a() {
+        return this.val;
+    }
+}
+
+class Bar {
+    static get a() {
+        return this.val;
+    }
+}
+
+const Baz = class {
+    get a() {
+        return this.val;
+    }
+    static set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+Examples of **incorrect** code for `{ "setWithoutGet": true, "enforceForClassMembers": true }`:
+
+:::incorrect
+
+```js
+/*eslint accessor-pairs: ["error", { "setWithoutGet": true, "enforceForClassMembers": true }]*/
+
+class Foo {
+    set a(value) {
+        this.val = value;
+    }
+}
+
+const Bar = class {
+    static set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+When `enforceForClassMembers` is set to `false`, this rule ignores classes.
+
+Examples of **correct** code for `{ "getWithoutSet": true, "setWithoutGet": true, "enforceForClassMembers": false }`:
+
+:::correct
+
+```js
+/*eslint accessor-pairs: ["error", {
+    "getWithoutSet": true, "setWithoutGet": true, "enforceForClassMembers": false
+}]*/
+
+class Foo {
+    get a() {
+        return this.val;
+    }
+}
+
+class Bar {
+    static set a(value) {
+        this.val = value;
+    }
+}
+
+const Baz = class {
+    static get a() {
+        return this.val;
+    }
+}
+
+const Quux = class {
+    set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+## Known Limitations
+
+Due to the limits of static analysis, this rule does not account for possible side effects and in certain cases
+might not report a missing pair for a getter/setter that has a computed key, like in the following example:
+
+```js
+/*eslint accessor-pairs: "error"*/
+
+var a = 1;
+
+// no warnings
+var o = {
+    get [a++]() {
+        return this.val;
+    },
+    set [a++](value) {
+        this.val = value;
+    }
+};
+```
+
+Also, this rule does not disallow duplicate keys in object literals and class definitions, and in certain cases with duplicate keys
+might not report a missing pair for a getter/setter, like in the following example:
+
+```js
+/*eslint accessor-pairs: "error"*/
+
+// no warnings
+var o = {
+    get a() {
+        return this.val;
+    },
+    a: 1,
+    set a(value) {
+        this.val = value;
+    }
+};
+```
+
+The code above creates an object with just a setter for the property `"a"`.
+
+See [no-dupe-keys](no-dupe-keys) if you also want to disallow duplicate keys in object literals.
+
+See [no-dupe-class-members](no-dupe-class-members) if you also want to disallow duplicate names in class definitions.
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the simultaneous presence of setters and getters on objects.
diff --git a/eslint/docs/src/rules/array-bracket-newline.md b/eslint/docs/src/rules/array-bracket-newline.md
new file mode 100644 (file)
index 0000000..16e80e1
--- /dev/null
@@ -0,0 +1,332 @@
+---
+title: array-bracket-newline
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+---
+
+
+
+A number of style guides require or disallow line breaks inside of array brackets.
+
+## Rule Details
+
+This rule enforces line breaks after opening and before closing array brackets.
+
+## Options
+
+This rule has either a string option:
+
+* `"always"` requires line breaks inside brackets
+* `"never"` disallows line breaks inside brackets
+* `"consistent"` requires consistent usage of linebreaks for each pair of brackets. It reports an error if one bracket in the pair has a linebreak inside it and the other bracket does not.
+
+Or an object option (Requires line breaks if any of properties is satisfied. Otherwise, disallows line breaks):
+
+* `"multiline": true` (default) requires line breaks if there are line breaks inside elements or between elements. If this is false, this condition is disabled.
+* `"minItems": null` (default) requires line breaks if the number of elements is at least the given integer. If this is 0, this condition will act the same as the option `"always"`. If this is `null` (the default), this condition is disabled.
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", "always"]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1,
+    2];
+var e = [function foo() {
+    dosomething();
+}];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", "always"]*/
+
+var a = [
+];
+var b = [
+    1
+];
+var c = [
+    1, 2
+];
+var d = [
+    1,
+    2
+];
+var e = [
+    function foo() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", "never"]*/
+
+var a = [
+];
+var b = [
+    1
+];
+var c = [
+    1, 2
+];
+var d = [
+    1,
+    2
+];
+var e = [
+    function foo() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", "never"]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1,
+    2];
+var e = [function foo() {
+    dosomething();
+}];
+```
+
+:::
+
+### consistent
+
+Examples of **incorrect** code for this rule with the `"consistent"` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", "consistent"]*/
+
+var a = [1
+];
+var b = [
+    1];
+var c = [function foo() {
+    dosomething();
+}
+]
+var d = [
+    function foo() {
+        dosomething();
+    }]
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", "consistent"]*/
+
+var a = [];
+var b = [
+];
+var c = [1];
+var d = [
+    1
+];
+var e = [function foo() {
+    dosomething();
+}];
+var f = [
+    function foo() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### multiline
+
+Examples of **incorrect** code for this rule with the default `{ "multiline": true }` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
+
+var a = [
+];
+var b = [
+    1
+];
+var c = [
+    1, 2
+];
+var d = [1,
+    2];
+var e = [function foo() {
+    dosomething();
+}];
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "multiline": true }` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [
+    1,
+    2
+];
+var e = [
+    function foo() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### minItems
+
+Examples of **incorrect** code for this rule with the `{ "minItems": 2 }` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
+
+var a = [
+];
+var b = [
+    1
+];
+var c = [1, 2];
+var d = [1,
+    2];
+var e = [
+  function foo() {
+    dosomething();
+  }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "minItems": 2 }` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
+
+var a = [];
+var b = [1];
+var c = [
+    1, 2
+];
+var d = [
+    1,
+    2
+];
+var e = [function foo() {
+    dosomething();
+}];
+```
+
+:::
+
+### multiline and minItems
+
+Examples of **incorrect** code for this rule with the `{ "multiline": true, "minItems": 2 }` options:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
+
+var a = [
+];
+var b = [
+    1
+];
+var c = [1, 2];
+var d = [1,
+    2];
+var e = [function foo() {
+    dosomething();
+}];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "multiline": true, "minItems": 2 }` options:
+
+:::correct
+
+```js
+/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
+
+var a = [];
+var b = [1];
+var c = [
+    1, 2
+];
+var d = [
+    1,
+    2
+];
+var e = [
+    function foo() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce line breaks after opening and before closing array brackets, don't enable this rule.
+
+## Compatibility
+
+* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)
diff --git a/eslint/docs/src/rules/array-bracket-spacing.md b/eslint/docs/src/rules/array-bracket-spacing.md
new file mode 100644 (file)
index 0000000..275b32f
--- /dev/null
@@ -0,0 +1,267 @@
+---
+title: array-bracket-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- space-in-parens
+- object-curly-spacing
+- computed-property-spacing
+---
+
+
+
+A number of style guides require or disallow spaces between array brackets and other tokens. This rule
+applies to both array literals and destructuring assignments (ECMAScript 6).
+
+```js
+/*eslint-env es6*/
+
+var arr = [ 'foo', 'bar' ];
+var [ x, y ] = z;
+
+var arr = ['foo', 'bar'];
+var [x,y] = z;
+```
+
+## Rule Details
+
+This rule enforces consistent spacing inside array brackets.
+
+## Options
+
+This rule has a string option:
+
+* `"never"` (default) disallows spaces inside array brackets
+* `"always"` requires one or more spaces or newlines inside array brackets
+
+This rule has an object option for exceptions to the `"never"` option:
+
+* `"singleValue": true` requires one or more spaces or newlines inside brackets of array literals that contain a single element
+* `"objectsInArrays": true` requires one or more spaces or newlines between brackets of array literals and braces of their object literal elements `[ {` or `} ]`
+* `"arraysInArrays": true` requires one or more spaces or newlines between brackets of array literals and brackets of their array literal elements `[ [` or `] ]`
+
+This rule has an object option for exceptions to the `"always"` option:
+
+* `"singleValue": false` disallows spaces inside brackets of array literals that contain a single element
+* `"objectsInArrays": false` disallows spaces between brackets of array literals and braces of their object literal elements `[{` or `}]`
+* `"arraysInArrays": false` disallows spaces between brackets of array literals and brackets of their array literal elements `[[` or `]]`
+
+This rule has built-in exceptions:
+
+* `"never"` (and also the exceptions to the `"always"` option) allows newlines inside array brackets, because this is a common pattern
+* `"always"` does not require spaces or newlines in empty array literals `[]`
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-spacing: ["error", "never"]*/
+/*eslint-env es6*/
+
+var arr = [ 'foo', 'bar' ];
+var arr = ['foo', 'bar' ];
+var arr = [ ['foo'], 'bar'];
+var arr = [[ 'foo' ], 'bar'];
+var arr = [ 'foo',
+  'bar'
+];
+var [ x, y ] = z;
+var [ x,y ] = z;
+var [ x, ...y ] = z;
+var [ ,,x, ] = z;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-spacing: ["error", "never"]*/
+/*eslint-env es6*/
+
+var arr = [];
+var arr = ['foo', 'bar', 'baz'];
+var arr = [['foo'], 'bar', 'baz'];
+var arr = [
+  'foo',
+  'bar',
+  'baz'
+];
+var arr = ['foo',
+  'bar'
+];
+var arr = [
+  'foo',
+  'bar'];
+
+var [x, y] = z;
+var [x,y] = z;
+var [x, ...y] = z;
+var [,,x,] = z;
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-spacing: ["error", "always"]*/
+/*eslint-env es6*/
+
+var arr = ['foo', 'bar'];
+var arr = ['foo', 'bar' ];
+var arr = [ ['foo'], 'bar' ];
+var arr = ['foo',
+  'bar'
+];
+var arr = [
+  'foo',
+  'bar'];
+
+var [x, y] = z;
+var [x,y] = z;
+var [x, ...y] = z;
+var [,,x,] = z;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+:::correct
+
+```js
+/*eslint array-bracket-spacing: ["error", "always"]*/
+/*eslint-env es6*/
+
+var arr = [];
+var arr = [ 'foo', 'bar', 'baz' ];
+var arr = [ [ 'foo' ], 'bar', 'baz' ];
+var arr = [ 'foo',
+  'bar'
+];
+var arr = [
+  'foo',
+  'bar' ];
+var arr = [
+  'foo',
+  'bar',
+  'baz'
+];
+
+var [ x, y ] = z;
+var [ x,y ] = z;
+var [ x, ...y ] = z;
+var [ ,,x, ] = z;
+```
+
+:::
+
+### singleValue
+
+Examples of **incorrect** code for this rule with the `"always", { "singleValue": false }` options:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "singleValue": false }]*/
+
+var foo = [ 'foo' ];
+var foo = [ 'foo'];
+var foo = ['foo' ];
+var foo = [ 1 ];
+var foo = [ 1];
+var foo = [1 ];
+var foo = [ [ 1, 2 ] ];
+var foo = [ { 'foo': 'bar' } ];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "singleValue": false }` options:
+
+:::correct
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "singleValue": false }]*/
+
+var foo = ['foo'];
+var foo = [1];
+var foo = [[ 1, 1 ]];
+var foo = [{ 'foo': 'bar' }];
+```
+
+:::
+
+### objectsInArrays
+
+Examples of **incorrect** code for this rule with the `"always", { "objectsInArrays": false }` options:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "objectsInArrays": false }]*/
+
+var arr = [ { 'foo': 'bar' } ];
+var arr = [ {
+  'foo': 'bar'
+} ]
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "objectsInArrays": false }` options:
+
+:::correct
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "objectsInArrays": false }]*/
+
+var arr = [{ 'foo': 'bar' }];
+var arr = [{
+  'foo': 'bar'
+}];
+```
+
+:::
+
+### arraysInArrays
+
+Examples of **incorrect** code for this rule with the `"always", { "arraysInArrays": false }` options:
+
+:::incorrect
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "arraysInArrays": false }]*/
+
+var arr = [ [ 1, 2 ], 2, 3, 4 ];
+var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "arraysInArrays": false }` options:
+
+:::correct
+
+```js
+/*eslint array-bracket-spacing: ["error", "always", { "arraysInArrays": false }]*/
+
+var arr = [[ 1, 2 ], 2, 3, 4 ];
+var arr = [[ 1, 2 ], 2, [ 3, 4 ]];
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing between array brackets.
diff --git a/eslint/docs/src/rules/array-callback-return.md b/eslint/docs/src/rules/array-callback-return.md
new file mode 100644 (file)
index 0000000..b3b0fba
--- /dev/null
@@ -0,0 +1,178 @@
+---
+title: array-callback-return
+layout: doc
+rule_type: problem
+---
+
+
+`Array` has several methods for filtering, mapping, and folding.
+If we forget to write `return` statement in a callback of those, it's probably a mistake. If you don't want to use a return or don't need the returned results, consider using [.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) instead.
+
+```js
+// example: convert ['a', 'b', 'c'] --> {a: 0, b: 1, c: 2}
+var indexMap = myArray.reduce(function(memo, item, index) {
+  memo[item] = index;
+}, {}); // Error: cannot set property 'b' of undefined
+```
+
+## Rule Details
+
+This rule enforces usage of `return` statement in callbacks of array's methods.
+Additionally, it may also enforce the `forEach` array method callback to **not** return a value by using the `checkForEach` option.
+
+This rule finds callback functions of the following methods, then checks usage of `return` statement.
+
+* [`Array.from`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.from)
+* [`Array.prototype.every`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.every)
+* [`Array.prototype.filter`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.filter)
+* [`Array.prototype.find`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.find)
+* [`Array.prototype.findIndex`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.findindex)
+* [`Array.prototype.flatMap`](https://www.ecma-international.org/ecma-262/10.0/#sec-array.prototype.flatmap)
+* [`Array.prototype.forEach`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.foreach) (optional, based on `checkForEach` parameter)
+* [`Array.prototype.map`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.map)
+* [`Array.prototype.reduce`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.reduce)
+* [`Array.prototype.reduceRight`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.reduceright)
+* [`Array.prototype.some`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.some)
+* [`Array.prototype.sort`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.sort)
+* And above of typed arrays.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint array-callback-return: "error"*/
+
+var indexMap = myArray.reduce(function(memo, item, index) {
+    memo[item] = index;
+}, {});
+
+var foo = Array.from(nodes, function(node) {
+    if (node.tagName === "DIV") {
+        return true;
+    }
+});
+
+var bar = foo.filter(function(x) {
+    if (x) {
+        return true;
+    } else {
+        return;
+    }
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint array-callback-return: "error"*/
+
+var indexMap = myArray.reduce(function(memo, item, index) {
+    memo[item] = index;
+    return memo;
+}, {});
+
+var foo = Array.from(nodes, function(node) {
+    if (node.tagName === "DIV") {
+        return true;
+    }
+    return false;
+});
+
+var bar = foo.map(node => node.getAttribute("id"));
+```
+
+:::
+
+## Options
+
+This rule accepts a configuration object with two options:
+
+* `"allowImplicit": false` (default) When set to `true`, allows callbacks of methods that require a return value to implicitly return `undefined` with a `return` statement containing no expression.
+* `"checkForEach": false` (default) When set to `true`, rule will also report `forEach` callbacks that return a value.
+
+### allowImplicit
+
+Examples of **correct** code for the `{ "allowImplicit": true }` option:
+
+:::correct
+
+```js
+/*eslint array-callback-return: ["error", { allowImplicit: true }]*/
+var undefAllTheThings = myArray.map(function(item) {
+    return;
+});
+```
+
+:::
+
+### checkForEach
+
+Examples of **incorrect** code for the `{ "checkForEach": true }` option:
+
+:::incorrect
+
+```js
+/*eslint array-callback-return: ["error", { checkForEach: true }]*/
+
+myArray.forEach(function(item) {
+    return handleItem(item)
+});
+
+myArray.forEach(function(item) {
+    if (item < 0) {
+        return x;
+    }
+    handleItem(item);
+});
+
+myArray.forEach(item => handleItem(item));
+
+myArray.forEach(item => {
+    return handleItem(item);
+});
+```
+
+:::
+
+Examples of **correct** code for the `{ "checkForEach": true }` option:
+
+:::correct
+
+```js
+/*eslint array-callback-return: ["error", { checkForEach: true }]*/
+
+myArray.forEach(function(item) {
+    handleItem(item)
+});
+
+myArray.forEach(function(item) {
+    if (item < 0) {
+        return;
+    }
+    handleItem(item);
+});
+
+myArray.forEach(function(item) {
+    handleItem(item);
+    return;
+});
+
+myArray.forEach(item => {
+    handleItem(item);
+});
+```
+
+:::
+
+## Known Limitations
+
+This rule checks callback functions of methods with the given names, *even if* the object which has the method is *not* an array.
+
+## When Not To Use It
+
+If you don't want to warn about usage of `return` statement in callbacks of array's methods, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/array-element-newline.md b/eslint/docs/src/rules/array-element-newline.md
new file mode 100644 (file)
index 0000000..73b545a
--- /dev/null
@@ -0,0 +1,450 @@
+---
+title: array-element-newline
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+- array-bracket-newline
+- object-property-newline
+- object-curly-spacing
+- object-curly-newline
+- max-statements-per-line
+- block-spacing
+- brace-style
+---
+
+
+
+A number of style guides require or disallow line breaks between array elements.
+
+## Rule Details
+
+This rule enforces line breaks between array elements.
+
+## Options
+
+This rule has either a string option:
+
+* `"always"` (default) requires line breaks between array elements
+* `"never"` disallows line breaks between array elements
+* `"consistent"` requires consistent usage of linebreaks between array elements
+
+Or an object option (Requires line breaks if any of properties is satisfied. Otherwise, disallows line breaks):
+
+* `"multiline": <boolean>` requires line breaks if there are line breaks inside elements. If this is false, this condition is disabled.
+* `"minItems": <number>` requires line breaks if the number of elements is at least the given integer. If this is 0, this condition will act the same as the option `"always"`. If this is `null` (the default), this condition is disabled.
+
+Alternatively, different configurations can be specified for array expressions and array patterns:
+
+```json
+{
+    "array-element-newline": ["error", {
+        "ArrayExpression": "consistent",
+        "ArrayPattern": { "minItems": 3 },
+    }]
+}
+```
+
+* `"ArrayExpression"` configuration for array expressions (if unspecified, this rule will not apply to array expressions)
+* `"ArrayPattern"` configuration for array patterns of destructuring assignments (if unspecified, this rule will not apply to array patterns)
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", "always"]*/
+
+var c = [1, 2];
+var d = [1, 2, 3];
+var e = [1, 2, 3
+];
+var f = [
+  1, 2, 3
+];
+var g = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", "always"]*/
+
+var a = [];
+var b = [1];
+var c = [1,
+    2];
+var d = [1,
+    2,
+    3];
+var d = [
+  1, 
+  2, 
+  3
+];
+var e = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", "never"]*/
+
+var c = [
+    1,
+    2
+];
+var d = [
+    1,
+    2,
+    3
+];
+var e = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", "never"]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1, 2, 3];
+var e = [
+    1, 2, 3];
+var f = [
+  1, 2, 3
+];
+var g = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### consistent
+
+Examples of **incorrect** code for this rule with the `"consistent"` option:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", "consistent"]*/
+
+var a = [
+    1, 2,
+    3
+];
+var b = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    },
+    function baz() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", "consistent"]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1, 2, 3];
+var e = [
+    1,
+    2
+];
+var f = [
+    1,
+    2,
+    3
+];
+var g = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }, function baz() {
+        dosomething();
+    }
+];
+var h = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    },
+    function baz() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### multiline
+
+Examples of **incorrect** code for this rule with the `{ "multiline": true }` option:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", { "multiline": true }]*/
+
+var d = [1,
+    2, 3];
+var e = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "multiline": true }` option:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", { "multiline": true }]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1, 2, 3];
+var e = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### minItems
+
+Examples of **incorrect** code for this rule with the `{ "minItems": 3 }` option:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", { "minItems": 3 }]*/
+
+var c = [1,
+    2];
+var d = [1, 2, 3];
+var e = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "minItems": 3 }` option:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", { "minItems": 3 }]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1,
+    2,
+    3];
+var e = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### multiline and minItems
+
+Examples of **incorrect** code for this rule with the `{ "multiline": true, "minItems": 3 }` options:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", { "multiline": true, "minItems": 3 }]*/
+
+var c = [1,
+2];
+var d = [1, 2, 3];
+var e = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "multiline": true, "minItems": 3 }` options:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", { "multiline": true, "minItems": 3 }]*/
+
+var a = [];
+var b = [1];
+var c = [1, 2];
+var d = [1,
+    2,
+    3];
+var e = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+```
+
+:::
+
+### ArrayExpression and ArrayPattern
+
+Examples of **incorrect** code for this rule with the `{ "ArrayExpression": "always", "ArrayPattern": "never" }` options:
+
+:::incorrect
+
+```js
+/*eslint array-element-newline: ["error", { "ArrayExpression": "always", "ArrayPattern": "never" }]*/
+
+var a = [1, 2];
+var b = [1, 2, 3];
+var c = [
+    function foo() {
+        dosomething();
+    }, function bar() {
+        dosomething();
+    }
+];
+
+var [d,
+    e] = arr;
+var [f,
+    g,
+    h] = arr;
+var [i = function foo() {
+  dosomething()
+},
+j = function bar() {
+  dosomething()
+}] = arr
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ArrayExpression": "always", "ArrayPattern": "never" }` options:
+
+:::correct
+
+```js
+/*eslint array-element-newline: ["error", { "ArrayExpression": "always", "ArrayPattern": "never" }]*/
+
+var a = [1,
+    2];
+var b = [1,
+    2,
+    3];
+var c = [
+    function foo() {
+        dosomething();
+    },
+    function bar() {
+        dosomething();
+    }
+];
+
+var [d, e] = arr
+var [f, g, h] = arr
+var [i = function foo() {
+    dosomething()
+}, j = function bar() {
+    dosomething()
+}] = arr
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce linebreaks between array elements, don't enable this rule.
+
+## Compatibility
+
+* **JSCS:** [validateNewlineAfterArrayElements](https://jscs-dev.github.io/rule/validateNewlineAfterArrayElements)
diff --git a/eslint/docs/src/rules/arrow-body-style.md b/eslint/docs/src/rules/arrow-body-style.md
new file mode 100644 (file)
index 0000000..1964b1a
--- /dev/null
@@ -0,0 +1,176 @@
+---
+title: arrow-body-style
+layout: doc
+rule_type: suggestion
+---
+
+Arrow functions have two syntactic forms for their function bodies.  They may be defined with a *block* body (denoted by curly braces) `() => { ... }` or with a single expression `() => ...`, whose value is implicitly returned.
+
+## Rule Details
+
+This rule can enforce or disallow the use of braces around arrow function body.
+
+## Options
+
+The rule takes one or two options. The first is a string, which can be:
+
+* `"always"` enforces braces around the function body
+* `"as-needed"` enforces no braces where they can be omitted (default)
+* `"never"` enforces no braces around the function body (constrains arrow functions to the role of returning an expression)
+
+The second one is an object for more fine-grained configuration when the first option is `"as-needed"`. Currently, the only available option is `requireReturnForObjectLiteral`, a boolean property. It's `false` by default. If set to `true`, it requires braces and an explicit return for object literals.
+
+```json
+"arrow-body-style": ["error", "always"]
+```
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-body-style: ["error", "always"]*/
+/*eslint-env es6*/
+let foo = () => 0;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+:::correct
+
+```js
+let foo = () => {
+    return 0;
+};
+let foo = (retv, name) => {
+    retv[name] = true;
+    return retv;
+};
+```
+
+:::
+
+### as-needed
+
+Examples of **incorrect** code for this rule with the default `"as-needed"` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-body-style: ["error", "as-needed"]*/
+/*eslint-env es6*/
+
+let foo = () => {
+    return 0;
+};
+let foo = () => {
+    return {
+       bar: {
+            foo: 1,
+            bar: 2,
+        }
+    };
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"as-needed"` option:
+
+:::correct
+
+```js
+/*eslint arrow-body-style: ["error", "as-needed"]*/
+/*eslint-env es6*/
+
+let foo = () => 0;
+let foo = (retv, name) => {
+    retv[name] = true;
+    return retv;
+};
+let foo = () => ({
+    bar: {
+        foo: 1,
+        bar: 2,
+    }
+});
+let foo = () => { bar(); };
+let foo = () => {};
+let foo = () => { /* do nothing */ };
+let foo = () => {
+    // do nothing.
+};
+let foo = () => ({ bar: 0 });
+```
+
+:::
+
+#### requireReturnForObjectLiteral
+
+> This option is only applicable when used in conjunction with the `"as-needed"` option.
+
+Examples of **incorrect** code for this rule with the `{ "requireReturnForObjectLiteral": true }` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-body-style: ["error", "as-needed", { "requireReturnForObjectLiteral": true }]*/
+/*eslint-env es6*/
+let foo = () => ({});
+let foo = () => ({ bar: 0 });
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "requireReturnForObjectLiteral": true }` option:
+
+:::correct
+
+```js
+/*eslint arrow-body-style: ["error", "as-needed", { "requireReturnForObjectLiteral": true }]*/
+/*eslint-env es6*/
+
+let foo = () => {};
+let foo = () => { return { bar: 0 }; };
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-body-style: ["error", "never"]*/
+/*eslint-env es6*/
+
+let foo = () => {
+    return 0;
+};
+let foo = (retv, name) => {
+    retv[name] = true;
+    return retv;
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+:::correct
+
+```js
+/*eslint arrow-body-style: ["error", "never"]*/
+/*eslint-env es6*/
+
+let foo = () => 0;
+let foo = () => ({ foo: 0 });
+```
+
+:::
diff --git a/eslint/docs/src/rules/arrow-parens.md b/eslint/docs/src/rules/arrow-parens.md
new file mode 100644 (file)
index 0000000..b3214ce
--- /dev/null
@@ -0,0 +1,255 @@
+---
+title: arrow-parens
+layout: doc
+rule_type: layout
+further_reading:
+- https://github.com/airbnb/javascript#arrows--one-arg-parens
+---
+
+
+
+Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must
+be wrapped in parentheses. This rule enforces the consistent use of parentheses in arrow functions.
+
+## Rule Details
+
+This rule enforces parentheses around arrow function parameters regardless of arity. For example:
+
+```js
+/*eslint-env es6*/
+
+// Bad
+a => {}
+
+// Good
+(a) => {}
+```
+
+Following this style will help you find arrow functions (`=>`) which may be mistakenly included in a condition
+when a comparison such as `>=` was the intent.
+
+```js
+/*eslint-env es6*/
+
+// Bad
+if (a => 2) {
+}
+
+// Good
+if (a >= 2) {
+}
+```
+
+The rule can also be configured to discourage the use of parens when they are not required:
+
+```js
+/*eslint-env es6*/
+
+// Bad
+(a) => {}
+
+// Good
+a => {}
+```
+
+## Options
+
+This rule has a string option and an object one.
+
+String options are:
+
+* `"always"` (default) requires parens around arguments in all cases.
+* `"as-needed"` enforces no parens where they can be omitted.
+
+Object properties for variants of the `"as-needed"` option:
+
+* `"requireForBlockBody": true` modifies the as-needed rule in order to require parens if the function body is in an instructions block (surrounded by braces).
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-parens: ["error", "always"]*/
+/*eslint-env es6*/
+
+a => {};
+a => a;
+a => {'\n'};
+a.then(foo => {});
+a.then(foo => a);
+a(foo => { if (true) {} });
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+:::correct
+
+```js
+/*eslint arrow-parens: ["error", "always"]*/
+/*eslint-env es6*/
+
+() => {};
+(a) => {};
+(a) => a;
+(a) => {'\n'}
+a.then((foo) => {});
+a.then((foo) => { if (true) {} });
+```
+
+:::
+
+#### If Statements
+
+One of the benefits of this option is that it prevents the incorrect use of arrow functions in conditionals:
+
+```js
+/*eslint-env es6*/
+
+var a = 1;
+var b = 2;
+// ...
+if (a => b) {
+ console.log('bigger');
+} else {
+ console.log('smaller');
+}
+// outputs 'bigger', not smaller as expected
+```
+
+The contents of the `if` statement is an arrow function, not a comparison.
+
+If the arrow function is intentional, it should be wrapped in parens to remove ambiguity.
+
+```js
+/*eslint-env es6*/
+
+var a = 1;
+var b = 0;
+// ...
+if ((a) => b) {
+ console.log('truthy value returned');
+} else {
+ console.log('falsey value returned');
+}
+// outputs 'truthy value returned'
+```
+
+The following is another example of this behavior:
+
+```js
+/*eslint-env es6*/
+
+var a = 1, b = 2, c = 3, d = 4;
+var f = a => b ? c: d;
+// f = ?
+```
+
+`f` is an arrow function which takes `a` as an argument and returns the result of `b ? c: d`.
+
+This should be rewritten like so:
+
+```js
+/*eslint-env es6*/
+
+var a = 1, b = 2, c = 3, d = 4;
+var f = (a) => b ? c: d;
+```
+
+### as-needed
+
+Examples of **incorrect** code for this rule with the `"as-needed"` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-parens: ["error", "as-needed"]*/
+/*eslint-env es6*/
+
+(a) => {};
+(a) => a;
+(a) => {'\n'};
+a.then((foo) => {});
+a.then((foo) => a);
+a((foo) => { if (true) {} });
+const f = /** @type {number} */(a) => a + a;
+const g = /* comment */ (a) => a + a;
+const h = (a) /* comment */ => a + a;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"as-needed"` option:
+
+:::correct
+
+```js
+/*eslint arrow-parens: ["error", "as-needed"]*/
+/*eslint-env es6*/
+
+() => {};
+a => {};
+a => a;
+a => {'\n'};
+a.then(foo => {});
+a.then(foo => { if (true) {} });
+(a, b, c) => a;
+(a = 10) => a;
+([a, b]) => a;
+({a, b}) => a;
+const f = (/** @type {number} */a) => a + a;
+const g = (/* comment */ a) => a + a;
+const h = (a /* comment */) => a + a;
+```
+
+:::
+
+### requireForBlockBody
+
+Examples of **incorrect** code for the `{ "requireForBlockBody": true }` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-parens: [2, "as-needed", { "requireForBlockBody": true }]*/
+/*eslint-env es6*/
+
+(a) => a;
+a => {};
+a => {'\n'};
+a.map((x) => x * x);
+a.map(x => {
+  return x * x;
+});
+a.then(foo => {});
+```
+
+:::
+
+Examples of **correct** code for the `{ "requireForBlockBody": true }` option:
+
+:::correct
+
+```js
+/*eslint arrow-parens: [2, "as-needed", { "requireForBlockBody": true }]*/
+/*eslint-env es6*/
+
+(a) => {};
+(a) => {'\n'};
+a => ({});
+() => {};
+a => a;
+a.then((foo) => {});
+a.then((foo) => { if (true) {} });
+a((foo) => { if (true) {} });
+(a, b, c) => a;
+(a = 10) => a;
+([a, b]) => a;
+({a, b}) => a;
+```
+
+:::
diff --git a/eslint/docs/src/rules/arrow-spacing.md b/eslint/docs/src/rules/arrow-spacing.md
new file mode 100644 (file)
index 0000000..e24b168
--- /dev/null
@@ -0,0 +1,123 @@
+---
+title: arrow-spacing
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule normalize style of spacing before/after an arrow function's arrow(`=>`).
+
+```js
+/*eslint-env es6*/
+
+// { "before": true, "after": true }
+(a) => {}
+
+// { "before": false, "after": false }
+(a)=>{}
+```
+
+## Rule Details
+
+This rule takes an object argument with `before` and `after` properties, each with a Boolean value.
+
+The default configuration is `{ "before": true, "after": true }`.
+
+`true` means there should be **one or more spaces** and `false` means **no spaces**.
+
+Examples of **incorrect** code for this rule with the default `{ "before": true, "after": true }` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-spacing: "error"*/
+/*eslint-env es6*/
+
+()=> {};
+() =>{};
+(a)=> {};
+(a) =>{};
+a =>a;
+a=> a;
+()=> {'\n'};
+() =>{'\n'};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "before": true, "after": true }` option:
+
+:::correct
+
+```js
+/*eslint arrow-spacing: "error"*/
+/*eslint-env es6*/
+
+() => {};
+(a) => {};
+a => a;
+() => {'\n'};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "before": false, "after": false }` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-spacing: ["error", { "before": false, "after": false }]*/
+/*eslint-env es6*/
+
+() =>{};
+(a) => {};
+()=> {'\n'};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": false, "after": false }` option:
+
+:::correct
+
+```js
+/*eslint arrow-spacing: ["error", { "before": false, "after": false }]*/
+/*eslint-env es6*/
+
+()=>{};
+(a)=>{};
+()=>{'\n'};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "before": false, "after": true }` option:
+
+:::incorrect
+
+```js
+/*eslint arrow-spacing: ["error", { "before": false, "after": true }]*/
+/*eslint-env es6*/
+
+() =>{};
+(a) => {};
+()=>{'\n'};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": false, "after": true }` option:
+
+:::correct
+
+```js
+/*eslint arrow-spacing: ["error", { "before": false, "after": true }]*/
+/*eslint-env es6*/
+
+()=> {};
+(a)=> {};
+()=> {'\n'};
+```
+
+:::
diff --git a/eslint/docs/src/rules/block-scoped-var.md b/eslint/docs/src/rules/block-scoped-var.md
new file mode 100644 (file)
index 0000000..566d602
--- /dev/null
@@ -0,0 +1,122 @@
+---
+title: block-scoped-var
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting
+---
+
+
+The `block-scoped-var` rule generates warnings when variables are used outside of the block in which they were defined. This emulates C-style block scope.
+
+## Rule Details
+
+This rule aims to reduce the usage of variables outside of their binding context and emulate traditional block scope from other languages. This is to help newcomers to the language avoid difficult bugs with variable hoisting.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint block-scoped-var: "error"*/
+
+function doIf() {
+    if (true) {
+        var build = true;
+    }
+
+    console.log(build);
+}
+
+function doIfElse() {
+    if (true) {
+        var build = true;
+    } else {
+        var build = false;
+    }
+}
+
+function doTryCatch() {
+    try {
+        var build = 1;
+    } catch (e) {
+        var f = build;
+    }
+}
+
+function doFor() {
+    for (var x = 1; x < 10; x++) {
+        var y = f(x);
+    }
+    console.log(y);
+}
+
+class C {
+    static {
+        if (something) {
+            var build = true;
+        }
+        build = false;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint block-scoped-var: "error"*/
+
+function doIf() {
+    var build;
+
+    if (true) {
+        build = true;
+    }
+
+    console.log(build);
+}
+
+function doIfElse() {
+    var build;
+
+    if (true) {
+        build = true;
+    } else {
+        build = false;
+    }
+}
+
+function doTryCatch() {
+    var build;
+    var f;
+
+    try {
+        build = 1;
+    } catch (e) {
+        f = build;
+    }
+}
+
+function doFor() {
+    for (var x = 1; x < 10; x++) {
+        var y = f(x);
+        console.log(y);
+    }
+}
+
+class C {
+    static {
+        var build = false;
+        if (something) {
+            build = true;
+        }
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/block-spacing.md b/eslint/docs/src/rules/block-spacing.md
new file mode 100644 (file)
index 0000000..99b3540
--- /dev/null
@@ -0,0 +1,100 @@
+---
+title: block-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- space-before-blocks
+- brace-style
+---
+
+
+
+## Rule Details
+
+This rule enforces consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) requires one or more spaces
+* `"never"` disallows spaces
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint block-spacing: "error"*/
+
+function foo() {return true;}
+if (foo) { bar = 0;}
+function baz() {let i = 0;
+    return i;
+}
+
+class C {
+    static {this.bar = 0;}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+:::correct
+
+```js
+/*eslint block-spacing: "error"*/
+
+function foo() { return true; }
+if (foo) { bar = 0; }
+
+class C {
+    static { this.bar = 0; }
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint block-spacing: ["error", "never"]*/
+
+function foo() { return true; }
+if (foo) { bar = 0;}
+
+class C {
+    static { this.bar = 0; }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+:::correct
+
+```js
+/*eslint block-spacing: ["error", "never"]*/
+
+function foo() {return true;}
+if (foo) {bar = 0;}
+
+class C {
+    static {this.bar = 0;}
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about spacing style inside of blocks, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/brace-style.md b/eslint/docs/src/rules/brace-style.md
new file mode 100644 (file)
index 0000000..ccca32f
--- /dev/null
@@ -0,0 +1,432 @@
+---
+title: brace-style
+layout: doc
+rule_type: layout
+related_rules:
+- block-spacing
+- space-before-blocks
+further_reading:
+- https://en.wikipedia.org/wiki/Indent_style
+---
+
+
+
+Brace style is closely related to [indent style](https://en.wikipedia.org/wiki/Indent_style) in programming and describes the placement of braces relative to their control statement and body. There are probably a dozen, if not more, brace styles in the world.
+
+The *one true brace style* is one of the most common brace styles in JavaScript, in which the opening brace of a block is placed on the same line as its corresponding statement or declaration. For example:
+
+```js
+if (foo) {
+  bar();
+} else {
+  baz();
+}
+```
+
+One common variant of one true brace style is called Stroustrup, in which the `else` statements in an `if-else` construct, as well as `catch` and `finally`, must be on its own line after the preceding closing brace. For example:
+
+```js
+if (foo) {
+  bar();
+}
+else {
+  baz();
+}
+```
+
+Another style is called [Allman](https://en.wikipedia.org/wiki/Indent_style#Allman_style), in which all the braces are expected to be on their own lines without any extra indentation. For example:
+
+```js
+if (foo)
+{
+  bar();
+}
+else
+{
+  baz();
+}
+```
+
+While no style is considered better than the other, most developers agree that having a consistent style throughout a project is important for its long-term maintainability.
+
+## Rule Details
+
+This rule enforces consistent brace style for blocks.
+
+## Options
+
+This rule has a string option:
+
+* `"1tbs"` (default) enforces one true brace style
+* `"stroustrup"` enforces Stroustrup style
+* `"allman"` enforces Allman style
+
+This rule has an object option for an exception:
+
+* `"allowSingleLine": true` (default `false`) allows the opening and closing braces for a block to be on the *same* line
+
+### 1tbs
+
+Examples of **incorrect** code for this rule with the default `"1tbs"` option:
+
+:::incorrect
+
+```js
+/*eslint brace-style: "error"*/
+
+function foo()
+{
+  return true;
+}
+
+if (foo)
+{
+  bar();
+}
+
+try
+{
+  somethingRisky();
+} catch(e)
+{
+  handleError();
+}
+
+if (foo) {
+  bar();
+}
+else {
+  baz();
+}
+
+class C
+{
+    static
+    {
+        foo();
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"1tbs"` option:
+
+:::correct
+
+```js
+/*eslint brace-style: "error"*/
+
+function foo() {
+  return true;
+}
+
+if (foo) {
+  bar();
+}
+
+if (foo) {
+  bar();
+} else {
+  baz();
+}
+
+try {
+  somethingRisky();
+} catch(e) {
+  handleError();
+}
+
+class C {
+    static {
+        foo();
+    }
+}
+
+// when there are no braces, there are no problems
+if (foo) bar();
+else if (baz) boom();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"1tbs", { "allowSingleLine": true }` options:
+
+:::correct
+
+```js
+/*eslint brace-style: ["error", "1tbs", { "allowSingleLine": true }]*/
+
+function nop() { return; }
+
+if (foo) { bar(); }
+
+if (foo) { bar(); } else { baz(); }
+
+try { somethingRisky(); } catch(e) { handleError(); }
+
+if (foo) { baz(); } else {
+  boom();
+}
+
+if (foo) { baz(); } else if (bar) {
+  boom();
+}
+
+if (foo) { baz(); } else
+if (bar) {
+  boom();
+}
+
+if (foo) { baz(); } else if (bar) {
+  boom();
+}
+
+try { somethingRisky(); } catch(e) {
+  handleError();
+}
+
+class C {
+    static { foo(); }
+}
+
+class D { static { foo(); } }
+```
+
+:::
+
+### stroustrup
+
+Examples of **incorrect** code for this rule with the `"stroustrup"` option:
+
+:::incorrect
+
+```js
+/*eslint brace-style: ["error", "stroustrup"]*/
+
+function foo()
+{
+  return true;
+}
+
+if (foo)
+{
+  bar();
+}
+
+try
+{
+  somethingRisky();
+} catch(e)
+{
+  handleError();
+}
+
+class C
+{
+    static
+    {
+        foo();
+    }
+}
+
+if (foo) {
+  bar();
+} else {
+  baz();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"stroustrup"` option:
+
+:::correct
+
+```js
+/*eslint brace-style: ["error", "stroustrup"]*/
+
+function foo() {
+  return true;
+}
+
+if (foo) {
+  bar();
+}
+
+if (foo) {
+  bar();
+}
+else {
+  baz();
+}
+
+try {
+  somethingRisky();
+}
+catch(e) {
+  handleError();
+}
+
+class C {
+    static {
+        foo();
+    }
+}
+
+// when there are no braces, there are no problems
+if (foo) bar();
+else if (baz) boom();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"stroustrup", { "allowSingleLine": true }` options:
+
+:::correct
+
+```js
+/*eslint brace-style: ["error", "stroustrup", { "allowSingleLine": true }]*/
+
+function nop() { return; }
+
+if (foo) { bar(); }
+
+if (foo) { bar(); }
+else { baz(); }
+
+try { somethingRisky(); }
+catch(e) { handleError(); }
+
+class C {
+    static { foo(); }
+}
+
+class D { static { foo(); } }
+```
+
+:::
+
+### allman
+
+Examples of **incorrect** code for this rule with the `"allman"` option:
+
+:::incorrect
+
+```js
+/*eslint brace-style: ["error", "allman"]*/
+
+function foo() {
+  return true;
+}
+
+if (foo)
+{
+  bar(); }
+
+try
+{
+  somethingRisky();
+} catch(e)
+{
+  handleError();
+}
+
+class C {
+    static {
+        foo();
+    }
+}
+
+if (foo) {
+  bar();
+} else {
+  baz();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"allman"` option:
+
+:::correct
+
+```js
+/*eslint brace-style: ["error", "allman"]*/
+
+function foo()
+{
+  return true;
+}
+
+if (foo)
+{
+  bar();
+}
+
+if (foo)
+{
+  bar();
+}
+else
+{
+  baz();
+}
+
+try
+{
+  somethingRisky();
+}
+catch(e)
+{
+  handleError();
+}
+
+class C
+{
+    static
+    {
+        foo();
+    }
+}
+
+// when there are no braces, there are no problems
+if (foo) bar();
+else if (baz) boom();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"allman", { "allowSingleLine": true }` options:
+
+:::correct
+
+```js
+/*eslint brace-style: ["error", "allman", { "allowSingleLine": true }]*/
+
+function nop() { return; }
+
+if (foo) { bar(); }
+
+if (foo) { bar(); }
+else { baz(); }
+
+try { somethingRisky(); }
+catch(e) { handleError(); }
+
+class C
+{
+    static { foo(); }
+
+    static
+    { foo(); }
+}
+
+class D { static { foo(); } }
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce a particular brace style, don't enable this rule.
diff --git a/eslint/docs/src/rules/callback-return.md b/eslint/docs/src/rules/callback-return.md
new file mode 100644 (file)
index 0000000..2b7ded0
--- /dev/null
@@ -0,0 +1,192 @@
+---
+title: callback-return
+layout: doc
+rule_type: suggestion
+related_rules:
+- handle-callback-err
+further_reading:
+- https://github.com/maxogden/art-of-node#callbacks
+- https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+The callback pattern is at the heart of most I/O and event-driven programming
+ in JavaScript.
+
+```js
+function doSomething(err, callback) {
+    if (err) {
+        return callback(err);
+    }
+    callback();
+}
+```
+
+To prevent calling the callback multiple times it is important to `return` anytime the callback is triggered outside
+ of the main function body. Neglecting this technique often leads to issues where you do something more than once.
+ For example, in the case of an HTTP request, you may try to send HTTP headers more than once leading Node.js to `throw`
+ a `Can't render headers after they are sent to the client.` error.
+
+## Rule Details
+
+This rule is aimed at ensuring that callbacks used outside of the main function block are always part-of or immediately
+preceding a `return` statement. This rule decides what is a callback based on the name of the function being called.
+
+## Options
+
+The rule takes a single option - an array of possible callback names - which may include object methods. The default callback names are `callback`, `cb`, `next`.
+
+### Default callback names
+
+Examples of **incorrect** code for this rule with the default `["callback", "cb", "next"]` option:
+
+:::incorrect
+
+```js
+/*eslint callback-return: "error"*/
+
+function foo(err, callback) {
+    if (err) {
+        callback(err);
+    }
+    callback();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `["callback", "cb", "next"]` option:
+
+:::correct
+
+```js
+/*eslint callback-return: "error"*/
+
+function foo(err, callback) {
+    if (err) {
+        return callback(err);
+    }
+    callback();
+}
+```
+
+:::
+
+### Supplied callback names
+
+Examples of **incorrect** code for this rule with the option `["done", "send.error", "send.success"]`:
+
+:::incorrect
+
+```js
+/*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
+
+function foo(err, done) {
+    if (err) {
+        done(err);
+    }
+    done();
+}
+
+function bar(err, send) {
+    if (err) {
+        send.error(err);
+    }
+    send.success();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the option `["done", "send.error", "send.success"]`:
+
+:::correct
+
+```js
+/*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
+
+function foo(err, done) {
+    if (err) {
+        return done(err);
+    }
+    done();
+}
+
+function bar(err, send) {
+    if (err) {
+        return send.error(err);
+    }
+    send.success();
+}
+```
+
+:::
+
+## Known Limitations
+
+Because it is difficult to understand the meaning of a program through static analysis, this rule has limitations:
+
+* *false negatives* when this rule reports correct code, but the program calls the callback more than one time (which is incorrect behavior)
+* *false positives* when this rule reports incorrect code, but the program calls the callback only one time (which is correct behavior)
+
+### Passing the callback by reference
+
+The static analysis of this rule does not detect that the program calls the callback if it is an argument of a function (for example,  `setTimeout`).
+
+Example of a *false negative* when this rule reports correct code:
+
+```js
+/*eslint callback-return: "error"*/
+
+function foo(err, callback) {
+    if (err) {
+        setTimeout(callback, 0); // this is bad, but WILL NOT warn
+    }
+    callback();
+}
+```
+
+### Triggering the callback within a nested function
+
+The static analysis of this rule does not detect that the program calls the callback from within a nested function or an immediately-invoked function expression (IIFE).
+
+Example of a *false negative* when this rule reports correct code:
+
+```js
+/*eslint callback-return: "error"*/
+
+function foo(err, callback) {
+    if (err) {
+        process.nextTick(function() {
+            return callback(); // this is bad, but WILL NOT warn
+        });
+    }
+    callback();
+}
+```
+
+### If/else statements
+
+The static analysis of this rule does not detect that the program calls the callback only one time in each branch of an `if` statement.
+
+Example of a *false positive* when this rule reports incorrect code:
+
+```js
+/*eslint callback-return: "error"*/
+
+function foo(err, callback) {
+    if (err) {
+        callback(err); // this is fine, but WILL warn
+    } else {
+        callback();    // this is fine, but WILL warn
+    }
+}
+```
+
+## When Not To Use It
+
+There are some cases where you might want to call a callback function more than once. In those cases this rule
+ may lead to incorrect behavior. In those cases you may want to reserve a special name for those callbacks and
+ not include that in the list of callbacks that trigger warnings.
diff --git a/eslint/docs/src/rules/camelcase.md b/eslint/docs/src/rules/camelcase.md
new file mode 100644 (file)
index 0000000..7678aab
--- /dev/null
@@ -0,0 +1,339 @@
+---
+title: camelcase
+layout: doc
+rule_type: suggestion
+---
+
+
+When it comes to naming variables, style guides generally fall into one of two camps: camelcase (`variableName`) and underscores (`variable_name`). This rule focuses on using the camelcase approach. If your style guide calls for camelCasing your variable names, then this rule is for you!
+
+## Rule Details
+
+This rule looks for any underscores (`_`) located within the source code. It ignores leading and trailing underscores and only checks those in the middle of a variable name. If ESLint decides that the variable is a constant (all uppercase), then no warning will be thrown. Otherwise, a warning will be thrown. This rule only flags definitions and assignments but not function calls. In case of ES6 `import` statements, this rule only targets the name of the variable that will be imported into the local module scope.
+
+## Options
+
+This rule has an object option:
+
+* `"properties": "always"` (default) enforces camelcase style for property names
+* `"properties": "never"` does not check property names
+* `"ignoreDestructuring": false` (default) enforces camelcase style for destructured identifiers
+* `"ignoreDestructuring": true` does not check destructured identifiers (but still checks any use of those identifiers later in the code)
+* `"ignoreImports": false` (default) enforces camelcase style for ES2015 imports
+* `"ignoreImports": true` does not check ES2015 imports (but still checks any use of the imports later in the code except function arguments)
+* `"ignoreGlobals": false` (default) enforces camelcase style for global variables
+* `"ignoreGlobals": true` does not enforce camelcase style for global variables
+* `allow` (`string[]`) list of properties to accept. Accept regex.
+
+### properties: "always"
+
+Examples of **incorrect** code for this rule with the default `{ "properties": "always" }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: "error"*/
+
+import { no_camelcased } from "external-module"
+
+var my_favorite_color = "#112C85";
+
+function do_something() {
+    // ...
+}
+
+obj.do_something = function() {
+    // ...
+};
+
+function foo({ no_camelcased }) {
+    // ...
+};
+
+function foo({ isCamelcased: no_camelcased }) {
+    // ...
+}
+
+function foo({ no_camelcased = 'default value' }) {
+    // ...
+};
+
+var obj = {
+    my_pref: 1
+};
+
+var { category_id = 1 } = query;
+
+var { foo: no_camelcased } = bar;
+
+var { foo: bar_baz = 1 } = quz;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "properties": "always" }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: "error"*/
+
+import { no_camelcased as camelCased } from "external-module";
+
+var myFavoriteColor   = "#112C85";
+var _myFavoriteColor  = "#112C85";
+var myFavoriteColor_  = "#112C85";
+var MY_FAVORITE_COLOR = "#112C85";
+var foo = bar.baz_boom;
+var foo = { qux: bar.baz_boom };
+
+obj.do_something();
+do_something();
+new do_something();
+
+var { category_id: category } = query;
+
+function foo({ isCamelCased }) {
+    // ...
+};
+
+function foo({ isCamelCased: isAlsoCamelCased }) {
+    // ...
+}
+
+function foo({ isCamelCased = 'default value' }) {
+    // ...
+};
+
+var { categoryId = 1 } = query;
+
+var { foo: isCamelCased } = bar;
+
+var { foo: isCamelCased = 1 } = quz;
+
+```
+
+:::
+
+### properties: "never"
+
+Examples of **correct** code for this rule with the `{ "properties": "never" }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {properties: "never"}]*/
+
+var obj = {
+    my_pref: 1
+};
+```
+
+:::
+
+### ignoreDestructuring: false
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreDestructuring": false }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: "error"*/
+
+var { category_id } = query;
+
+var { category_id = 1 } = query;
+
+var { category_id: category_id } = query;
+
+var { category_id: category_alias } = query;
+
+var { category_id: categoryId, ...other_props } = query;
+```
+
+:::
+
+### ignoreDestructuring: true
+
+Examples of **incorrect** code for this rule with the `{ "ignoreDestructuring": true }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
+
+var { category_id: category_alias } = query;
+
+var { category_id, ...other_props } = query;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreDestructuring": true }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
+
+var { category_id } = query;
+
+var { category_id = 1 } = query;
+
+var { category_id: category_id } = query;
+```
+
+:::
+
+Please note that this option applies only to identifiers inside destructuring patterns. It doesn't additionally allow any particular use of the created variables later in the code apart from the use that is already allowed by default or by other options.
+
+Examples of additional **incorrect** code for this rule with the `{ "ignoreDestructuring": true }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
+
+var { some_property } = obj; // allowed by {ignoreDestructuring: true}
+var foo = some_property + 1; // error, ignoreDestructuring does not apply to this statement
+```
+
+:::
+
+A common use case for this option is to avoid useless renaming when the identifier is not intended to be used later in the code.
+
+Examples of additional **correct** code for this rule with the `{ "ignoreDestructuring": true }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {ignoreDestructuring: true}]*/
+
+var { some_property, ...rest } = obj;
+// do something with 'rest', nothing with 'some_property'
+```
+
+:::
+
+Another common use case for this option is in combination with `{ "properties": "never" }`, when the identifier is intended to be used only as a property shorthand.
+
+Examples of additional **correct** code for this rule with the `{ "properties": "never", "ignoreDestructuring": true }` options:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {"properties": "never", ignoreDestructuring: true}]*/
+
+var { some_property } = obj;
+doSomething({ some_property });
+```
+
+:::
+
+### ignoreImports: false
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreImports": false }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: "error"*/
+
+import { snake_cased } from 'mod';
+```
+
+:::
+
+### ignoreImports: true
+
+Examples of **incorrect** code for this rule with the `{ "ignoreImports": true }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: ["error", {ignoreImports: true}]*/
+
+import default_import from 'mod';
+
+import * as namespaced_import from 'mod';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreImports": true }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {ignoreImports: true}]*/
+
+import { snake_cased } from 'mod';
+```
+
+:::
+
+### ignoreGlobals: false
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreGlobals": false }` option:
+
+:::incorrect
+
+```js
+/*eslint camelcase: ["error", {ignoreGlobals: false}]*/
+/* global no_camelcased */
+
+const foo = no_camelcased;
+```
+
+:::
+
+### ignoreGlobals: true
+
+Examples of **correct** code for this rule with the `{ "ignoreGlobals": true }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {ignoreGlobals: true}]*/
+/* global no_camelcased */
+
+const foo = no_camelcased;
+```
+
+:::
+
+### allow
+
+Examples of **correct** code for this rule with the `allow` option:
+
+:::correct
+
+```js
+/*eslint camelcase: ["error", {allow: ["UNSAFE_componentWillMount"]}]*/
+
+function UNSAFE_componentWillMount() {
+    // ...
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint camelcase: ["error", {allow: ["^UNSAFE_"]}]*/
+
+function UNSAFE_componentWillMount() {
+    // ...
+}
+
+function UNSAFE_componentWillMount() {
+    // ...
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you have established coding standards using a different naming convention (separating words with underscores), turn this rule off.
diff --git a/eslint/docs/src/rules/capitalized-comments.md b/eslint/docs/src/rules/capitalized-comments.md
new file mode 100644 (file)
index 0000000..8c62ae5
--- /dev/null
@@ -0,0 +1,303 @@
+---
+title: capitalized-comments
+layout: doc
+rule_type: suggestion
+---
+
+
+
+Comments are useful for leaving information for future developers. In order for that information to be useful and not distracting, it is sometimes desirable for comments to follow a particular style. One element of comment formatting styles is whether the first word of a comment should be capitalized or lowercase.
+
+In general, no comment style is any more or less valid than any others, but many developers would agree that a consistent style can improve a project's maintainability.
+
+## Rule Details
+
+This rule aims to enforce a consistent style of comments across your codebase, specifically by either requiring or disallowing a capitalized letter as the first word character in a comment. This rule will not issue warnings when non-cased letters are used.
+
+By default, this rule will require a non-lowercase letter at the beginning of comments.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/* eslint capitalized-comments: ["error"] */
+
+// lowercase comment
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+
+// Capitalized comment
+
+// 1. Non-letter at beginning of comment
+
+// 丈 Non-Latin character at beginning of comment
+
+/* eslint semi:off */
+/* eslint-env node */
+/* eslint-disable */
+/* eslint-enable */
+/* istanbul ignore next */
+/* jscs:enable */
+/* jshint asi:true */
+/* global foo */
+/* globals foo */
+/* exported myVar */
+// eslint-disable-line
+// eslint-disable-next-line
+// https://github.com
+
+```
+
+:::
+
+### Options
+
+This rule has two options: a string value `"always"` or `"never"` which determines whether capitalization of the first word of a comment should be required or forbidden, and optionally an object containing more configuration parameters for the rule.
+
+Here are the supported object options:
+
+* `ignorePattern`: A string representing a regular expression pattern of words that should be ignored by this rule. If the first word of a comment matches the pattern, this rule will not report that comment.
+    * Note that the following words are always ignored by this rule: `["jscs", "jshint", "eslint", "istanbul", "global", "globals", "exported"]`.
+* `ignoreInlineComments`: If this is `true`, the rule will not report on comments in the middle of code. By default, this is `false`.
+* `ignoreConsecutiveComments`: If this is `true`, the rule will not report on a comment which violates the rule, as long as the comment immediately follows another comment. By default, this is `false`.
+
+Here is an example configuration:
+
+```json
+{
+    "capitalized-comments": [
+        "error",
+        "always",
+        {
+            "ignorePattern": "pragma|ignored",
+            "ignoreInlineComments": true
+        }
+    ]
+}
+```
+
+#### `"always"`
+
+Using the `"always"` option means that this rule will report any comments which start with a lowercase letter. This is the default configuration for this rule.
+
+Note that configuration comments and comments which start with URLs are never reported.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/* eslint capitalized-comments: ["error", "always"] */
+
+// lowercase comment
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "always"] */
+
+// Capitalized comment
+
+// 1. Non-letter at beginning of comment
+
+// 丈 Non-Latin character at beginning of comment
+
+/* eslint semi:off */
+/* eslint-env node */
+/* eslint-disable */
+/* eslint-enable */
+/* istanbul ignore next */
+/* jscs:enable */
+/* jshint asi:true */
+/* global foo */
+/* globals foo */
+/* exported myVar */
+// eslint-disable-line
+// eslint-disable-next-line
+// https://github.com
+
+```
+
+:::
+
+#### `"never"`
+
+Using the `"never"` option means that this rule will report any comments which start with an uppercase letter.
+
+Examples of **incorrect** code with the `"never"` option:
+
+:::incorrect
+
+```js
+/* eslint capitalized-comments: ["error", "never"] */
+
+// Capitalized comment
+
+```
+
+:::
+
+Examples of **correct** code with the `"never"` option:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "never"] */
+
+// lowercase comment
+
+// 1. Non-letter at beginning of comment
+
+// 丈 Non-Latin character at beginning of comment
+
+```
+
+:::
+
+#### `ignorePattern`
+
+The `ignorePattern` object takes a string value, which is used as a regular expression applied to the first word of a comment.
+
+Examples of **correct** code with the `"ignorePattern"` option set to `"pragma"`:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "ignorePattern": "pragma" }] */
+
+function foo() {
+    /* pragma wrap(true) */
+}
+
+```
+
+:::
+
+#### `ignoreInlineComments`
+
+Setting the `ignoreInlineComments` option to `true` means that comments in the middle of code (with a token on the same line as the beginning of the comment, and another token on the same line as the end of the comment) will not be reported by this rule.
+
+Examples of **correct** code with the `"ignoreInlineComments"` option set to `true`:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "ignoreInlineComments": true }] */
+
+function foo(/* ignored */ a) {
+}
+
+```
+
+:::
+
+#### `ignoreConsecutiveComments`
+
+If the `ignoreConsecutiveComments` option is set to `true`, then comments which otherwise violate the rule will not be reported as long as they immediately follow another comment. This can be applied more than once.
+
+Examples of **correct** code with `ignoreConsecutiveComments` set to `true`:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "ignoreConsecutiveComments": true }] */
+
+// This comment is valid since it has the correct capitalization.
+// this comment is ignored since it follows another comment,
+// and this one as well because it follows yet another comment.
+
+/* Here is a block comment which has the correct capitalization, */
+/* but this one is ignored due to being consecutive; */
+/*
+ * in fact, even if any of these are multi-line, that is fine too.
+ */
+```
+
+:::
+
+Examples of **incorrect** code with `ignoreConsecutiveComments` set to `true`:
+
+:::incorrect
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "ignoreConsecutiveComments": true }] */
+
+// this comment is invalid, but only on this line.
+// this comment does NOT get reported, since it is a consecutive comment.
+```
+
+:::
+
+### Using Different Options for Line and Block Comments
+
+If you wish to have a different configuration for line comments and block comments, you can do so by using two different object configurations (note that the capitalization option will be enforced consistently for line and block comments):
+
+```json
+{
+    "capitalized-comments": [
+        "error",
+        "always",
+        {
+            "line": {
+                "ignorePattern": "pragma|ignored",
+            },
+            "block": {
+                "ignoreInlineComments": true,
+                "ignorePattern": "ignored"
+            }
+        }
+    ]
+}
+```
+
+Examples of **incorrect** code with different line and block comment configuration:
+
+:::incorrect
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "block": { "ignorePattern": "blockignore" } }] */
+
+// capitalized line comment, this is incorrect, blockignore does not help here
+/* lowercased block comment, this is incorrect too */
+
+```
+
+:::
+
+Examples of **correct** code with different line and block comment configuration:
+
+:::correct
+
+```js
+/* eslint capitalized-comments: ["error", "always", { "block": { "ignorePattern": "blockignore" } }] */
+
+// Uppercase line comment, this is correct
+/* blockignore lowercase block comment, this is correct due to ignorePattern */
+
+```
+
+:::
+
+## When Not To Use It
+
+This rule can be disabled if you do not care about the grammatical style of comments in your codebase.
+
+## Compatibility
+
+* **JSCS**: [requireCapitalizedComments](https://jscs-dev.github.io/rule/requireCapitalizedComments)
+* **JSCS**: [disallowCapitalizedComments](https://jscs-dev.github.io/rule/disallowCapitalizedComments)
diff --git a/eslint/docs/src/rules/class-methods-use-this.md b/eslint/docs/src/rules/class-methods-use-this.md
new file mode 100644 (file)
index 0000000..49c74e6
--- /dev/null
@@ -0,0 +1,204 @@
+---
+title: class-methods-use-this
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
+---
+
+
+If a class method does not use `this`, it can *sometimes* be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (`MyClass.callStaticMethod()`)
+
+It's possible to have a class method which doesn't use `this`, such as:
+
+```js
+class A {
+    constructor() {
+        this.a = "hi";
+    }
+
+    print() {
+        console.log(this.a);
+    }
+
+    sayHi() {
+        console.log("hi");
+    }
+}
+
+let a = new A();
+a.sayHi(); // => "hi"
+```
+
+In the example above, the `sayHi` method doesn't use `this`, so we can make it a static method:
+
+```js
+class A {
+    constructor() {
+        this.a = "hi";
+    }
+
+    print() {
+        console.log(this.a);
+    }
+
+    static sayHi() {
+        console.log("hi");
+    }
+}
+
+A.sayHi(); // => "hi"
+```
+
+Also note in the above examples that if you switch a method to a static method, *instances* of the class that call the static method (`let a = new A(); a.sayHi();`) have to be updated to being a static call (`A.sayHi();`) instead of having the instance of the *class* call the method
+
+## Rule Details
+
+This rule is aimed to flag class methods that do not use `this`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint class-methods-use-this: "error"*/
+/*eslint-env es6*/
+
+class A {
+    foo() {
+        console.log("Hello World");     /*error Expected 'this' to be used by class method 'foo'.*/
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint class-methods-use-this: "error"*/
+/*eslint-env es6*/
+class A {
+    foo() {
+        this.bar = "Hello World"; // OK, this is used
+    }
+}
+
+class A {
+    constructor() {
+        // OK. constructor is exempt
+    }
+}
+
+class A {
+    static foo() {
+        // OK. static methods aren't expected to use this.
+    }
+
+    static {
+        // OK. static blocks are exempt.
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has two options:
+
+* `"exceptMethods"` allows specified method names to be ignored with this rule.
+* `"enforceForClassFields"` enforces that functions used as instance field initializers utilize `this`. (default: `true`)
+
+### exceptMethods
+
+```js
+"class-methods-use-this": [<enabled>, { "exceptMethods": [<...exceptions>] }]
+```
+
+The `exceptMethods` option allows you to pass an array of method names for which you would like to ignore warnings. For example, you might have a spec from an external library that requires you to overwrite a method as a regular function (and not as a static method) and does not use `this` inside the function body. In this case, you can add that method to ignore in the warnings.
+
+Examples of **incorrect** code for this rule when used without exceptMethods:
+
+::: incorrect
+
+```js
+/*eslint class-methods-use-this: "error"*/
+
+class A {
+    foo() {
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule when used with exceptMethods:
+
+::: correct
+
+```js
+/*eslint class-methods-use-this: ["error", { "exceptMethods": ["foo", "#bar"] }] */
+
+class A {
+    foo() {
+    }
+    #bar() {
+    }
+}
+```
+
+:::
+
+### enforceForClassFields
+
+```js
+"class-methods-use-this": [<enabled>, { "enforceForClassFields": true | false }]
+```
+
+The `enforceForClassFields` option enforces that arrow functions and function expressions used as instance field initializers utilize `this`. (default: `true`)
+
+Examples of **incorrect** code for this rule with the `{ "enforceForClassFields": true }` option (default):
+
+::: incorrect
+
+```js
+/*eslint class-methods-use-this: ["error", { "enforceForClassFields": true }] */
+
+class A {
+    foo = () => {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "enforceForClassFields": true }` option (default):
+
+::: correct
+
+```js
+/*eslint class-methods-use-this: ["error", { "enforceForClassFields": true }] */
+
+class A {
+    foo = () => {this;}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "enforceForClassFields": false }` option:
+
+::: correct
+
+```js
+/*eslint class-methods-use-this: ["error", { "enforceForClassFields": false }] */
+
+class A {
+    foo = () => {}
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/comma-dangle.md b/eslint/docs/src/rules/comma-dangle.md
new file mode 100644 (file)
index 0000000..b3f27a2
--- /dev/null
@@ -0,0 +1,369 @@
+---
+title: comma-dangle
+layout: doc
+rule_type: layout
+---
+
+
+
+Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec. However, IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.
+
+```js
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+```
+
+Trailing commas simplify adding and removing items to objects and arrays, since only the lines you are modifying must be touched.
+Another argument in favor of trailing commas is that it improves the clarity of diffs when an item is added or removed from an object or array:
+
+Less clear:
+
+```diff
+ var foo = {
+-    bar: "baz",
+-    qux: "quux"
++    bar: "baz"
+ };
+```
+
+More clear:
+
+```diff
+ var foo = {
+     bar: "baz",
+-    qux: "quux",
+ };
+```
+
+## Rule Details
+
+This rule enforces consistent use of trailing commas in object and array literals.
+
+## Options
+
+This rule has a string option or an object option:
+
+```json
+{
+    "comma-dangle": ["error", "never"],
+    // or
+    "comma-dangle": ["error", {
+        "arrays": "never",
+        "objects": "never",
+        "imports": "never",
+        "exports": "never",
+        "functions": "never"
+    }]
+}
+```
+
+* `"never"` (default) disallows trailing commas
+* `"always"` requires trailing commas
+* `"always-multiline"` requires trailing commas when the last element or property is in a *different* line than the closing `]` or `}` and disallows trailing commas when the last element or property is on the *same* line as the closing `]` or `}`
+* `"only-multiline"` allows (but does not require) trailing commas when the last element or property is in a *different* line than the closing `]` or `}` and disallows trailing commas when the last element or property is on the *same* line as the closing `]` or `}`
+
+You can also use an object option to configure this rule for each type of syntax.
+Each of the following options can be set to `"never"`, `"always"`, `"always-multiline"`, `"only-multiline"`, or `"ignore"`.
+The default for each option is `"never"` unless otherwise specified.
+
+* `arrays` is for array literals and array patterns of destructuring. (e.g. `let [a,] = [1,];`)
+* `objects` is for object literals and object patterns of destructuring. (e.g. `let {a,} = {a: 1};`)
+* `imports` is for import declarations of ES Modules. (e.g. `import {a,} from "foo";`)
+* `exports` is for export declarations of ES Modules. (e.g. `export {a,};`)
+* `functions` is for function declarations and function calls. (e.g. `(function(a,){ })(b,);`)
+    * `functions` should only be enabled when linting ECMAScript 2017 or higher.
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", "never"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+
+var arr = [1,2,];
+
+foo({
+  bar: "baz",
+  qux: "quux",
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", "never"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux"
+};
+
+var arr = [1,2];
+
+foo({
+  bar: "baz",
+  qux: "quux"
+});
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", "always"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux"
+};
+
+var arr = [1,2];
+
+foo({
+  bar: "baz",
+  qux: "quux"
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", "always"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+
+var arr = [1,2,];
+
+foo({
+  bar: "baz",
+  qux: "quux",
+});
+```
+
+:::
+
+### always-multiline
+
+Examples of **incorrect** code for this rule with the `"always-multiline"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", "always-multiline"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux"
+};
+
+var foo = { bar: "baz", qux: "quux", };
+
+var arr = [1,2,];
+
+var arr = [1,
+    2,];
+
+var arr = [
+    1,
+    2
+];
+
+foo({
+  bar: "baz",
+  qux: "quux"
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always-multiline"` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", "always-multiline"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+
+var foo = {bar: "baz", qux: "quux"};
+var arr = [1,2];
+
+var arr = [1,
+    2];
+
+var arr = [
+    1,
+    2,
+];
+
+foo({
+  bar: "baz",
+  qux: "quux",
+});
+```
+
+:::
+
+### only-multiline
+
+Examples of **incorrect** code for this rule with the `"only-multiline"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", "only-multiline"]*/
+
+var foo = { bar: "baz", qux: "quux", };
+
+var arr = [1,2,];
+
+var arr = [1,
+    2,];
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"only-multiline"` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", "only-multiline"]*/
+
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+
+var foo = {
+    bar: "baz",
+    qux: "quux"
+};
+
+var foo = {bar: "baz", qux: "quux"};
+var arr = [1,2];
+
+var arr = [1,
+    2];
+
+var arr = [
+    1,
+    2,
+];
+
+var arr = [
+    1,
+    2
+];
+
+foo({
+  bar: "baz",
+  qux: "quux",
+});
+
+foo({
+  bar: "baz",
+  qux: "quux"
+});
+```
+
+:::
+
+### functions
+
+Examples of **incorrect** code for this rule with the `{"functions": "never"}` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", {"functions": "never"}]*/
+
+function foo(a, b,) {
+}
+
+foo(a, b,);
+new foo(a, b,);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"functions": "never"}` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", {"functions": "never"}]*/
+
+function foo(a, b) {
+}
+
+foo(a, b);
+new foo(a, b);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{"functions": "always"}` option:
+
+:::incorrect
+
+```js
+/*eslint comma-dangle: ["error", {"functions": "always"}]*/
+
+function foo(a, b) {
+}
+
+foo(a, b);
+new foo(a, b);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"functions": "always"}` option:
+
+:::correct
+
+```js
+/*eslint comma-dangle: ["error", {"functions": "always"}]*/
+
+function foo(a, b,) {
+}
+
+foo(a, b,);
+new foo(a, b,);
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with dangling commas.
diff --git a/eslint/docs/src/rules/comma-spacing.md b/eslint/docs/src/rules/comma-spacing.md
new file mode 100644 (file)
index 0000000..169077d
--- /dev/null
@@ -0,0 +1,163 @@
+---
+title: comma-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+- comma-style
+- object-curly-spacing
+- space-in-brackets
+- space-in-parens
+- space-infix-ops
+- space-after-keywords
+- space-unary-ops
+- space-return-throw-case
+further_reading:
+- https://www.crockford.com/code.html
+- https://dojotoolkit.org/reference-guide/1.9/developer/styleguide.html
+---
+
+
+
+Spacing around commas improves readability of a list of items. Although most of the style guidelines for languages prescribe adding a space after a comma and not before it, it is subjective to the preferences of a project.
+
+```js
+var foo = 1, bar = 2;
+var foo = 1 ,bar = 2;
+```
+
+## Rule Details
+
+This rule enforces consistent spacing before and after commas in variable declarations, array literals, object literals, function parameters, and sequences.
+
+This rule does not apply in either of the following cases:
+
+* between two commas
+* between opening bracket `[` and comma, to avoid conflicts with the [`array-bracket-spacing`](array-bracket-spacing) rule
+* between comma and closing bracket `]`, to avoid conflicts with the [`array-bracket-spacing`](array-bracket-spacing) rule
+* between comma and closing brace `}`, to avoid conflicts with the [`object-curly-spacing`](object-curly-spacing) rule
+* between comma and closing parentheses `)`, to avoid conflicts with the [`space-in-parens`](space-in-parens) rule
+
+## Options
+
+This rule has an object option:
+
+* `"before": false` (default) disallows spaces before commas
+* `"before": true` requires one or more spaces before commas
+* `"after": true` (default) requires one or more spaces after commas
+* `"after": false` disallows spaces after commas
+
+### after
+
+Examples of **incorrect** code for this rule with the default `{ "before": false, "after": true }` options:
+
+:::incorrect
+
+```js
+/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
+
+var foo = 1 ,bar = 2;
+var arr = [1 , 2];
+var obj = {"foo": "bar" ,"baz": "qur"};
+foo(a ,b);
+new Foo(a ,b);
+function foo(a ,b){}
+a ,b
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "before": false, "after": true }` options:
+
+:::correct
+
+```js
+/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
+
+var foo = 1, bar = 2
+    , baz = 3;
+var arr = [1, 2];
+var arr = [1,, 3]
+var obj = {"foo": "bar", "baz": "qur"};
+foo(a, b);
+new Foo(a, b);
+function foo(a, b){}
+a, b
+```
+
+:::
+
+Additional examples of **correct** code for this rule with the default `{ "before": false, "after": true }` options:
+
+:::correct
+
+```js
+/*eslint comma-spacing: ["error", { "before": false, "after": true }]*/
+
+// this rule does not enforce spacing between two commas
+var arr = [
+    ,,
+    , ,
+];
+
+// this rule does not enforce spacing after `[` and before `]`
+var arr = [,];
+var arr = [ , ];
+var arr = [a, b,];
+[,] = arr;
+[ , ] = arr;
+[a, b,] = arr;
+
+// this rule does not enforce spacing before `}`
+var obj = {x, y,};
+var {z, q,} = obj;
+import {foo, bar,} from "mod";
+
+// this rule does not enforce spacing before `)`
+foo(a, b,)
+```
+
+:::
+
+### before
+
+Examples of **incorrect** code for this rule with the `{ "before": true, "after": false }` options:
+
+:::incorrect
+
+```js
+/*eslint comma-spacing: ["error", { "before": true, "after": false }]*/
+
+var foo = 1, bar = 2;
+var arr = [1 , 2];
+var obj = {"foo": "bar", "baz": "qur"};
+new Foo(a,b);
+function foo(a,b){}
+a, b
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": true, "after": false }` options:
+
+:::correct
+
+```js
+/*eslint comma-spacing: ["error", { "before": true, "after": false }]*/
+
+var foo = 1 ,bar = 2 ,
+    baz = true;
+var arr = [1 ,2];
+var arr = [1 ,,3]
+var obj = {"foo": "bar" ,"baz": "qur"};
+foo(a ,b);
+new Foo(a ,b);
+function foo(a ,b){}
+a ,b
+```
+
+:::
+
+## When Not To Use It
+
+If your project will not be following a consistent comma-spacing pattern, turn this rule off.
diff --git a/eslint/docs/src/rules/comma-style.md b/eslint/docs/src/rules/comma-style.md
new file mode 100644 (file)
index 0000000..ef3b358
--- /dev/null
@@ -0,0 +1,192 @@
+---
+title: comma-style
+layout: doc
+rule_type: layout
+related_rules:
+- operator-linebreak
+further_reading:
+- https://gist.github.com/isaacs/357981
+---
+
+
+
+The Comma Style rule enforces styles for comma-separated lists. There are two comma styles primarily used in JavaScript:
+
+* The standard style, in which commas are placed at the end of the current line
+* Comma First style, in which commas are placed at the start of the next line
+
+One of the justifications for using Comma First style is that it can help track missing and trailing commas. These are problematic because missing commas in variable declarations can lead to the leakage of global variables and trailing commas can lead to errors in older versions of IE.
+
+## Rule Details
+
+This rule enforce consistent comma style in array literals, object literals, and variable declarations.
+
+This rule does not apply in either of the following cases:
+
+* comma preceded and followed by linebreak (lone comma)
+* single-line array literals, object literals, and variable declarations
+
+## Options
+
+This rule has a string option:
+
+* `"last"` (default) requires a comma after and on the same line as an array element, object property, or variable declaration
+* `"first"` requires a comma before and on the same line as an array element, object property, or variable declaration
+
+This rule also accepts an additional `exceptions` object:
+
+* `"exceptions"` has properties whose names correspond to node types in the abstract syntax tree (AST) of JavaScript code:
+
+    * `"ArrayExpression": true` ignores comma style in array literals
+    * `"ArrayPattern": true` ignores comma style in array patterns of destructuring
+    * `"ArrowFunctionExpression": true` ignores comma style in the parameters of arrow function expressions
+    * `"CallExpression": true` ignores comma style in the arguments of function calls
+    * `"FunctionDeclaration": true` ignores comma style in the parameters of function declarations
+    * `"FunctionExpression": true` ignores comma style in the parameters of function expressions
+    * `"ImportDeclaration": true` ignores comma style in the specifiers of import declarations
+    * `"ObjectExpression": true` ignores comma style in object literals
+    * `"ObjectPattern": true` ignores comma style in object patterns of destructuring
+    * `"VariableDeclaration": true` ignores comma style in variable declarations
+    * `"NewExpression": true` ignores comma style in the parameters of constructor expressions
+
+A way to determine the node types as defined by [ESTree](https://github.com/estree/estree) is to use [AST Explorer](https://astexplorer.net/) with the espree parser.
+
+### last
+
+Examples of **incorrect** code for this rule with the default `"last"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-style: ["error", "last"]*/
+
+var foo = 1
+,
+bar = 2;
+
+var foo = 1
+  , bar = 2;
+
+var foo = ["apples"
+           , "oranges"];
+
+function bar() {
+    return {
+        "a": 1
+        ,"b:": 2
+    };
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"last"` option:
+
+:::correct
+
+```js
+/*eslint comma-style: ["error", "last"]*/
+
+var foo = 1, bar = 2;
+
+var foo = 1,
+    bar = 2;
+
+var foo = ["apples",
+           "oranges"];
+
+function bar() {
+    return {
+        "a": 1,
+        "b:": 2
+    };
+}
+```
+
+:::
+
+### first
+
+Examples of **incorrect** code for this rule with the `"first"` option:
+
+:::incorrect
+
+```js
+/*eslint comma-style: ["error", "first"]*/
+
+var foo = 1,
+    bar = 2;
+
+var foo = ["apples",
+           "oranges"];
+
+function bar() {
+    return {
+        "a": 1,
+        "b:": 2
+    };
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"first"` option:
+
+:::correct
+
+```js
+/*eslint comma-style: ["error", "first"]*/
+
+var foo = 1, bar = 2;
+
+var foo = 1
+    ,bar = 2;
+
+var foo = ["apples"
+          ,"oranges"];
+
+function bar() {
+    return {
+        "a": 1
+        ,"b:": 2
+    };
+}
+```
+
+:::
+
+### exceptions
+
+An example use case is to enforce comma style *only* in var statements.
+
+Examples of **incorrect** code for this rule with sample `"first", { "exceptions": { … } }` options:
+
+:::incorrect
+
+```js
+/*eslint comma-style: ["error", "first", { "exceptions": { "ArrayExpression": true, "ObjectExpression": true } }]*/
+
+var o = {},
+    a = [];
+```
+
+:::
+
+Examples of **correct** code for this rule with sample `"first", { "exceptions": { … } }` options:
+
+:::correct
+
+```js
+/*eslint comma-style: ["error", "first", { "exceptions": { "ArrayExpression": true, "ObjectExpression": true } }]*/
+
+var o = {fst:1,
+         snd: [1,
+               2]}
+  , a = [];
+```
+
+:::
+
+## When Not To Use It
+
+This rule can safely be turned off if your project does not care about enforcing a consistent comma style.
diff --git a/eslint/docs/src/rules/complexity.md b/eslint/docs/src/rules/complexity.md
new file mode 100644 (file)
index 0000000..33b367b
--- /dev/null
@@ -0,0 +1,160 @@
+---
+title: complexity
+layout: doc
+rule_type: suggestion
+related_rules:
+- max-depth
+- max-len
+- max-lines
+- max-lines-per-function
+- max-nested-callbacks
+- max-params
+- max-statements
+further_reading:
+- https://en.wikipedia.org/wiki/Cyclomatic_complexity
+- https://ariya.io/2012/12/complexity-analysis-of-javascript-code
+- https://craftsmanshipforsoftware.com/2015/05/25/complexity-for-javascript/
+- https://web.archive.org/web/20160808115119/http://jscomplexity.org/complexity
+- https://github.com/eslint/eslint/issues/4808#issuecomment-167795140
+---
+
+
+Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.
+
+```js
+function a(x) {
+    if (true) {
+        return x; // 1st path
+    } else if (false) {
+        return x+1; // 2nd path
+    } else {
+        return 4; // 3rd path
+    }
+}
+```
+
+## Rule Details
+
+This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is `20`).
+
+Examples of **incorrect** code for a maximum of 2:
+
+::: incorrect
+
+```js
+/*eslint complexity: ["error", 2]*/
+
+function a(x) {
+    if (true) {
+        return x;
+    } else if (false) {
+        return x+1;
+    } else {
+        return 4; // 3rd path
+    }
+}
+
+function b() {
+    foo ||= 1;
+    bar &&= 1;
+}
+```
+
+:::
+
+Examples of **correct** code for a maximum of 2:
+
+::: correct
+
+```js
+/*eslint complexity: ["error", 2]*/
+
+function a(x) {
+    if (true) {
+        return x;
+    } else {
+        return 4;
+    }
+}
+
+function b() {
+    foo ||= 1;
+}
+```
+
+:::
+
+Class field initializers and class static blocks are implicit functions. Therefore, their complexity is calculated separately for each initializer and each static block, and it doesn't contribute to the complexity of the enclosing code.
+
+Examples of additional **incorrect** code for a maximum of 2:
+
+::: incorrect
+
+```js
+/*eslint complexity: ["error", 2]*/
+
+class C {
+    x = a || b || c; // this initializer has complexity = 3
+}
+
+class D { // this static block has complexity = 3
+    static {
+        if (foo) {
+            bar = baz || qux;
+        }
+    }
+}
+```
+
+:::
+
+Examples of additional **correct** code for a maximum of 2:
+
+::: correct
+
+```js
+/*eslint complexity: ["error", 2]*/
+
+function foo() { // this function has complexity = 1
+    class C {
+        x = a + b; // this initializer has complexity = 1
+        y = c || d; // this initializer has complexity = 2
+        z = e && f; // this initializer has complexity = 2
+
+        static p = g || h; // this initializer has complexity = 2
+        static q = i ? j : k; // this initializer has complexity = 2
+
+        static { // this static block has complexity = 2
+            if (foo) {
+                baz = bar;
+            }
+        }
+
+        static { // this static block has complexity = 2
+            qux = baz || quux;
+        }
+    }
+}
+```
+
+:::
+
+## Options
+
+Optionally, you may specify a `max` object property:
+
+```json
+"complexity": ["error", 2]
+```
+
+is equivalent to
+
+```json
+"complexity": ["error", { "max": 2 }]
+```
+
+**Deprecated:** the object property `maximum` is deprecated. Please use the property `max` instead.
+
+## When Not To Use It
+
+If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.
diff --git a/eslint/docs/src/rules/computed-property-spacing.md b/eslint/docs/src/rules/computed-property-spacing.md
new file mode 100644 (file)
index 0000000..58849da
--- /dev/null
@@ -0,0 +1,211 @@
+---
+title: computed-property-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+- comma-spacing
+- space-in-parens
+---
+
+
+
+While formatting preferences are very personal, a number of style guides require
+or disallow spaces between computed properties in the following situations:
+
+```js
+/*eslint-env es6*/
+
+var obj = { prop: "value" };
+var a = "prop";
+var x = obj[a]; // computed property in object member expression
+
+var a = "prop";
+var obj = {
+  [a]: "value" // computed property key in object literal (ECMAScript 6)
+};
+
+var obj = { prop: "value" };
+var a = "prop";
+var { [a]: x } = obj; // computed property key in object destructuring pattern (ECMAScript 6)
+```
+
+## Rule Details
+
+This rule enforces consistent spacing inside computed property brackets.
+
+It either requires or disallows spaces between the brackets and the values inside of them.
+This rule does not apply to brackets that are separated from the adjacent value by a newline.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"never"` (default) disallows spaces inside computed property brackets
+* `"always"` requires one or more spaces inside computed property brackets
+
+Object option:
+
+* `"enforceForClassMembers": true` (default) additionally applies this rule to class members.
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint computed-property-spacing: ["error", "never"]*/
+/*eslint-env es6*/
+
+obj[foo ]
+obj[ 'foo']
+var x = {[ b ]: a}
+obj[foo[ bar ]]
+
+const { [ a ]: someProp } = obj;
+({ [ b ]: anotherProp } = anotherObj);
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint computed-property-spacing: ["error", "never"]*/
+/*eslint-env es6*/
+
+obj[foo]
+obj['foo']
+var x = {[b]: a}
+obj[foo[bar]]
+
+const { [a]: someProp } = obj;
+({ [b]: anotherProp } = anotherObj);
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint computed-property-spacing: ["error", "always"]*/
+/*eslint-env es6*/
+
+obj[foo]
+var x = {[b]: a}
+obj[ foo]
+obj['foo' ]
+obj[foo[ bar ]]
+var x = {[ b]: a}
+const { [a]: someProp } = obj;
+({ [b ]: anotherProp } = anotherObj);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint computed-property-spacing: ["error", "always"]*/
+/*eslint-env es6*/
+
+obj[ foo ]
+obj[ 'foo' ]
+var x = {[ b ]: a}
+obj[ foo[ bar ] ]
+const { [ a ]: someProp } = obj;
+({ [ b ]: anotherProp } = anotherObj);
+```
+
+:::
+
+#### enforceForClassMembers
+
+With `enforceForClassMembers` set to `true` (default), the rule also disallows/enforces spaces inside of computed keys of class methods, getters and setters.
+
+Examples of **incorrect** code for this rule with `"never"` and `{ "enforceForClassMembers": true }` (default):
+
+::: incorrect
+
+```js
+/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": true }]*/
+/*eslint-env es6*/
+
+class Foo {
+  [a ]() {}
+  get [b ]() {}
+  set [b ](value) {}
+}
+
+const Bar = class {
+  [ a](){}
+  static [ b]() {}
+  static get [ c ]() {}
+  static set [ c ](value) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"never"` and `{ "enforceForClassMembers": true }` (default):
+
+::: correct
+
+```js
+/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": true }]*/
+/*eslint-env es6*/
+
+class Foo {
+  [a]() {}
+  get [b]() {}
+  set [b](value) {}
+}
+
+const Bar = class {
+  [a](){}
+  static [b]() {}
+  static get [c]() {}
+  static set [c](value) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"never"` and `{ "enforceForClassMembers": false }`:
+
+::: correct
+
+```js
+/*eslint computed-property-spacing: ["error", "never", { "enforceForClassMembers": false }]*/
+/*eslint-env es6*/
+
+class Foo {
+  [a ]() {}
+  get [b ]() {}
+  set [b ](value) {}
+}
+
+const Bar = class {
+  [ a](){}
+  static [ b]() {}
+  static get [ c ]() {}
+  static set [ c ](value) {}
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of computed properties.
diff --git a/eslint/docs/src/rules/consistent-return.md b/eslint/docs/src/rules/consistent-return.md
new file mode 100644 (file)
index 0000000..068d3b9
--- /dev/null
@@ -0,0 +1,170 @@
+---
+title: consistent-return
+layout: doc
+rule_type: suggestion
+---
+
+
+Unlike statically-typed languages which enforce that a function returns a specified type of value, JavaScript allows different code paths in a function to return different types of values.
+
+A confusing aspect of JavaScript is that a function returns `undefined` if any of the following are true:
+
+* it does not execute a `return` statement before it exits
+* it executes `return` which does not specify a value explicitly
+* it executes `return undefined`
+* it executes `return void` followed by an expression (for example, a function call)
+* it executes `return` followed by any other expression which evaluates to `undefined`
+
+If any code paths in a function return a value explicitly but some code path do not return a value explicitly, it might be a typing mistake, especially in a large function. In the following example:
+
+* a code path through the function returns a Boolean value `true`
+* another code path does not return a value explicitly, therefore returns `undefined` implicitly
+
+```js
+function doSomething(condition) {
+    if (condition) {
+        return true;
+    } else {
+        return;
+    }
+}
+```
+
+## Rule Details
+
+This rule requires `return` statements to either always or never specify values. This rule ignores function definitions where the name begins with an uppercase letter, because constructors (when invoked with the `new` operator) return the instantiated object implicitly if they do not return another object explicitly.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint consistent-return: "error"*/
+
+function doSomething(condition) {
+    if (condition) {
+        return true;
+    } else {
+        return;
+    }
+}
+
+function doSomething(condition) {
+    if (condition) {
+        return true;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint consistent-return: "error"*/
+
+function doSomething(condition) {
+    if (condition) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+function Foo() {
+    if (!(this instanceof Foo)) {
+        return new Foo();
+    }
+
+    this.a = 0;
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"treatUndefinedAsUnspecified": false` (default) always either specify values or return `undefined` implicitly only.
+* `"treatUndefinedAsUnspecified": true` always either specify values or return `undefined` explicitly or implicitly.
+
+### treatUndefinedAsUnspecified
+
+Examples of **incorrect** code for this rule with the default `{ "treatUndefinedAsUnspecified": false }` option:
+
+::: incorrect
+
+```js
+/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": false }]*/
+
+function foo(callback) {
+    if (callback) {
+        return void callback();
+    }
+    // no return statement
+}
+
+function bar(condition) {
+    if (condition) {
+        return undefined;
+    }
+    // no return statement
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "treatUndefinedAsUnspecified": true }` option:
+
+::: incorrect
+
+```js
+/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
+
+function foo(callback) {
+    if (callback) {
+        return void callback();
+    }
+    return true;
+}
+
+function bar(condition) {
+    if (condition) {
+        return undefined;
+    }
+    return true;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "treatUndefinedAsUnspecified": true }` option:
+
+::: correct
+
+```js
+/*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
+
+function foo(callback) {
+    if (callback) {
+        return void callback();
+    }
+    // no return statement
+}
+
+function bar(condition) {
+    if (condition) {
+        return undefined;
+    }
+    // no return statement
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow functions to have different `return` behavior depending on code branching, then it is safe to disable this rule.
diff --git a/eslint/docs/src/rules/consistent-this.md b/eslint/docs/src/rules/consistent-this.md
new file mode 100644 (file)
index 0000000..8a5a56b
--- /dev/null
@@ -0,0 +1,105 @@
+---
+title: consistent-this
+layout: doc
+rule_type: suggestion
+---
+
+
+It is often necessary to capture the current execution context in order to make it available subsequently. A prominent example of this are jQuery callbacks:
+
+```js
+var that = this;
+jQuery('li').click(function (event) {
+    // here, "this" is the HTMLElement where the click event occurred
+    that.setFoo(42);
+});
+```
+
+There are many commonly used aliases for `this` such as `that`, `self` or `me`. It is desirable to ensure that whichever alias the team agrees upon is used consistently throughout the application.
+
+## Rule Details
+
+This rule enforces two things about variables with the designated alias names for `this`:
+
+* If a variable with a designated name is declared, it *must* be either initialized (in the declaration) or assigned (in the same scope as the declaration) the value `this`.
+* If a variable is initialized or assigned the value `this`, the name of the variable *must* be a designated alias.
+
+## Options
+
+This rule has one or more string options:
+
+* designated alias names for `this` (default `"that"`)
+
+Examples of **incorrect** code for this rule with the default `"that"` option:
+
+::: incorrect
+
+```js
+/*eslint consistent-this: ["error", "that"]*/
+
+var that = 42;
+
+var self = this;
+
+that = 42;
+
+self = this;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"that"` option:
+
+::: correct
+
+```js
+/*eslint consistent-this: ["error", "that"]*/
+
+var that = this;
+
+var self = 42;
+
+var self;
+
+that = this;
+
+foo.bar = this;
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the default `"that"` option, if the variable is not initialized:
+
+::: incorrect
+
+```js
+/*eslint consistent-this: ["error", "that"]*/
+
+var that;
+function f() {
+    that = this;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"that"` option, if the variable is not initialized:
+
+::: correct
+
+```js
+/*eslint consistent-this: ["error", "that"]*/
+
+var that;
+that = this;
+
+var foo, that;
+foo = 42;
+that = this;
+```
+
+:::
+
+## When Not To Use It
+
+If you need to capture nested context, `consistent-this` is going to be problematic. Code of that nature is usually difficult to read and maintain and you should consider refactoring it.
diff --git a/eslint/docs/src/rules/constructor-super.md b/eslint/docs/src/rules/constructor-super.md
new file mode 100644 (file)
index 0000000..c3cf06e
--- /dev/null
@@ -0,0 +1,72 @@
+---
+title: constructor-super
+layout: doc
+rule_type: problem
+---
+
+Constructors of derived classes must call `super()`.
+Constructors of non derived classes must not call `super()`.
+If this is not observed, the JavaScript engine will raise a runtime error.
+
+This rule checks whether or not there is a valid `super()` call.
+
+## Rule Details
+
+This rule is aimed to flag invalid/missing `super()` calls.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint constructor-super: "error"*/
+/*eslint-env es6*/
+
+class A {
+    constructor() {
+        super();  // This is a SyntaxError.
+    }
+}
+
+class A extends B {
+    constructor() { }  // Would throw a ReferenceError.
+}
+
+// Classes which inherits from a non constructor are always problems.
+class A extends null {
+    constructor() {
+        super();  // Would throw a TypeError.
+    }
+}
+
+class A extends null {
+    constructor() { }  // Would throw a ReferenceError.
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint constructor-super: "error"*/
+/*eslint-env es6*/
+
+class A {
+    constructor() { }
+}
+
+class A extends B {
+    constructor() {
+        super();
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about invalid/missing `super()` callings in constructors, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/curly.md b/eslint/docs/src/rules/curly.md
new file mode 100644 (file)
index 0000000..fe48feb
--- /dev/null
@@ -0,0 +1,351 @@
+---
+title: curly
+layout: doc
+rule_type: suggestion
+---
+
+
+
+JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to _never_ omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity. So the following:
+
+```js
+if (foo) foo++;
+```
+
+Can be rewritten as:
+
+```js
+if (foo) {
+    foo++;
+}
+```
+
+There are, however, some who prefer to only use braces when there is more than one statement to be executed.
+
+## Rule Details
+
+This rule is aimed at preventing bugs and increasing code clarity by ensuring that block statements are wrapped in curly braces. It will warn when it encounters blocks that omit curly braces.
+
+## Options
+
+### all
+
+Examples of **incorrect** code for the default `"all"` option:
+
+::: incorrect
+
+```js
+/*eslint curly: "error"*/
+
+if (foo) foo++;
+
+while (bar)
+    baz();
+
+if (foo) {
+    baz();
+} else qux();
+```
+
+:::
+
+Examples of **correct** code for the default `"all"` option:
+
+::: correct
+
+```js
+/*eslint curly: "error"*/
+
+if (foo) {
+    foo++;
+}
+
+while (bar) {
+    baz();
+}
+
+if (foo) {
+    baz();
+} else {
+    qux();
+}
+```
+
+:::
+
+### multi
+
+By default, this rule warns whenever `if`, `else`, `for`, `while`, or `do` are used without block statements as their body. However, you can specify that block statements should be used only when there are multiple statements in the block and warn when there is only one statement in the block.
+
+Examples of **incorrect** code for the `"multi"` option:
+
+::: incorrect
+
+```js
+/*eslint curly: ["error", "multi"]*/
+
+if (foo) {
+    foo++;
+}
+
+if (foo) bar();
+else {
+    foo++;
+}
+
+while (true) {
+    doSomething();
+}
+
+for (var i=0; i < items.length; i++) {
+    doSomething();
+}
+```
+
+:::
+
+Examples of **correct** code for the `"multi"` option:
+
+::: correct
+
+```js
+/*eslint curly: ["error", "multi"]*/
+
+if (foo) foo++;
+
+else foo();
+
+while (true) {
+    doSomething();
+    doSomethingElse();
+}
+```
+
+:::
+
+### multi-line
+
+Alternatively, you can relax the rule to allow brace-less single-line `if`, `else if`, `else`, `for`, `while`, or `do`, while still enforcing the use of curly braces for other instances.
+
+Examples of **incorrect** code for the `"multi-line"` option:
+
+::: incorrect
+
+```js
+/*eslint curly: ["error", "multi-line"]*/
+
+if (foo)
+  doSomething();
+else
+  doSomethingElse();
+
+if (foo) foo(
+  bar,
+  baz);
+```
+
+:::
+
+Examples of **correct** code for the `"multi-line"` option:
+
+::: correct
+
+```js
+/*eslint curly: ["error", "multi-line"]*/
+
+if (foo) foo++; else doSomething();
+
+if (foo) foo++;
+else if (bar) baz()
+else doSomething();
+
+do something();
+while (foo);
+
+while (foo
+  && bar) baz();
+
+if (foo) {
+    foo++;
+}
+
+if (foo) { foo++; }
+
+while (true) {
+    doSomething();
+    doSomethingElse();
+}
+```
+
+:::
+
+### multi-or-nest
+
+You can use another configuration that forces brace-less `if`, `else if`, `else`, `for`, `while`, or `do` if their body contains only one single-line statement. And forces braces in all other cases.
+
+Examples of **incorrect** code for the `"multi-or-nest"` option:
+
+::: incorrect
+
+```js
+/*eslint curly: ["error", "multi-or-nest"]*/
+
+if (!foo)
+    foo = {
+        bar: baz,
+        qux: foo
+    };
+
+while (true)
+  if(foo)
+      doSomething();
+  else
+      doSomethingElse();
+
+if (foo) {
+    foo++;
+}
+
+while (true) {
+    doSomething();
+}
+
+for (var i = 0; foo; i++) {
+    doSomething();
+}
+```
+
+:::
+
+Examples of **correct** code for the `"multi-or-nest"` option:
+
+::: correct
+
+```js
+/*eslint curly: ["error", "multi-or-nest"]*/
+
+if (!foo) {
+    foo = {
+        bar: baz,
+        qux: foo
+    };
+}
+
+while (true) {
+  if(foo)
+      doSomething();
+  else
+      doSomethingElse();
+}
+
+if (foo)
+    foo++;
+
+while (true)
+    doSomething();
+
+for (var i = 0; foo; i++)
+    doSomething();
+```
+
+:::
+
+For single-line statements preceded by a comment, braces are allowed but not required.
+
+Examples of additional **correct** code for the `"multi-or-nest"` option:
+
+::: correct
+
+```js
+/*eslint curly: ["error", "multi-or-nest"]*/
+
+if (foo)
+    // some comment
+    bar();
+
+if (foo) {
+    // some comment
+    bar();
+}
+```
+
+:::
+
+### consistent
+
+When using any of the `multi*` options, you can add an option to enforce all bodies of a `if`,
+`else if` and `else` chain to be with or without braces.
+
+Examples of **incorrect** code for the `"multi", "consistent"` options:
+
+::: incorrect
+
+```js
+/*eslint curly: ["error", "multi", "consistent"]*/
+
+if (foo) {
+    bar();
+    baz();
+} else
+    buz();
+
+if (foo)
+    bar();
+else if (faa)
+    bor();
+else {
+    other();
+    things();
+}
+
+if (true)
+    foo();
+else {
+    baz();
+}
+
+if (foo) {
+    foo++;
+}
+```
+
+:::
+
+Examples of **correct** code for the `"multi", "consistent"` options:
+
+::: correct
+
+```js
+/*eslint curly: ["error", "multi", "consistent"]*/
+
+if (foo) {
+    bar();
+    baz();
+} else {
+    buz();
+}
+
+if (foo) {
+    bar();
+} else if (faa) {
+    bor();
+} else {
+    other();
+    things();
+}
+
+if (true)
+    foo();
+else
+    baz();
+
+if (foo)
+    foo++;
+
+```
+
+:::
+
+## When Not To Use It
+
+If you have no strict conventions about when to use block statements and when not to, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/default-case-last.md b/eslint/docs/src/rules/default-case-last.md
new file mode 100644 (file)
index 0000000..2502a83
--- /dev/null
@@ -0,0 +1,134 @@
+---
+title: default-case-last
+layout: doc
+rule_type: suggestion
+related_rules:
+- default-case
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch
+---
+
+
+A `switch` statement can optionally have a `default` clause.
+
+If present, it's usually the last clause, but it doesn't need to be. It is also allowed to put the `default` clause before all `case` clauses, or anywhere between. The behavior is mostly the same as if it was the last clause. The `default` block will be still executed only if there is no match in the `case` clauses (including those defined after the `default`), but there is also the ability to "fall through" from the `default` clause to the following clause in the list. However, such flow is not common and it would be confusing to the readers.
+
+Even if there is no "fall through" logic, it's still unexpected to see the `default` clause before or between the `case` clauses. By convention, it is expected to be the last clause.
+
+If a `switch` statement should have a `default` clause, it's considered a best practice to define it as the last clause.
+
+## Rule Details
+
+This rule enforces `default` clauses in `switch` statements to be last.
+
+It applies only to `switch` statements that already have a `default` clause.
+
+This rule does not enforce the existence of `default` clauses. See [default-case](default-case) if you also want to enforce the existence of `default` clauses in `switch` statements.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint default-case-last: "error"*/
+
+switch (foo) {
+    default:
+        bar();
+        break;
+    case "a":
+        baz();
+        break;
+}
+
+switch (foo) {
+    case 1:
+        bar();
+        break;
+    default:
+        baz();
+        break;
+    case 2:
+        quux();
+        break;
+}
+
+switch (foo) {
+    case "x":
+        bar();
+        break;
+    default:
+    case "y":
+        baz();
+        break;
+}
+
+switch (foo) {
+    default:
+        break;
+    case -1:
+        bar();
+        break;
+}
+
+switch (foo) {
+  default:
+    doSomethingIfNotZero();
+  case 0:
+    doSomethingAnyway();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint default-case-last: "error"*/
+
+switch (foo) {
+    case "a":
+        baz();
+        break;
+    default:
+        bar();
+        break;
+}
+
+switch (foo) {
+    case 1:
+        bar();
+        break;
+    case 2:
+        quux();
+        break;
+    default:
+        baz();
+        break;
+}
+
+switch (foo) {
+    case "x":
+        bar();
+        break;
+    case "y":
+    default:
+        baz();
+        break;
+}
+
+switch (foo) {
+    case -1:
+        bar();
+        break;
+}
+
+if (foo !== 0) {
+    doSomethingIfNotZero();
+}
+doSomethingAnyway();
+```
+
+:::
diff --git a/eslint/docs/src/rules/default-case.md b/eslint/docs/src/rules/default-case.md
new file mode 100644 (file)
index 0000000..f05ae44
--- /dev/null
@@ -0,0 +1,140 @@
+---
+title: default-case
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-fallthrough
+---
+
+
+Some code conventions require that all `switch` statements have a `default` case, even if the default case is empty, such as:
+
+```js
+switch (foo) {
+    case 1:
+        doSomething();
+        break;
+
+    case 2:
+        doSomething();
+        break;
+
+    default:
+    // do nothing
+}
+```
+
+The thinking is that it's better to always explicitly state what the default behavior should be so that it's clear whether or not the developer forgot to include the default behavior by mistake.
+
+Other code conventions allow you to skip the `default` case so long as there is a comment indicating the omission is intentional, such as:
+
+```js
+switch (foo) {
+    case 1:
+        doSomething();
+        break;
+
+    case 2:
+        doSomething();
+        break;
+
+    // no default
+}
+```
+
+Once again, the intent here is to show that the developer intended for there to be no default behavior.
+
+## Rule Details
+
+This rule aims to require `default` case in `switch` statements. You may optionally include a `// no default` after the last `case` if there is no `default` case. The comment may be in any desired case, such as `// No Default`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint default-case: "error"*/
+
+switch (a) {
+    case 1:
+        /* code */
+        break;
+}
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint default-case: "error"*/
+
+switch (a) {
+    case 1:
+        /* code */
+        break;
+
+    default:
+        /* code */
+        break;
+}
+
+switch (a) {
+    case 1:
+        /* code */
+        break;
+
+    // no default
+}
+
+switch (a) {
+    case 1:
+        /* code */
+        break;
+
+    // No Default
+}
+```
+
+:::
+
+## Options
+
+This rule accepts a single options argument:
+
+* Set the `commentPattern` option to a regular expression string to change the default `/^no default$/i` comment test pattern
+
+### commentPattern
+
+Examples of **correct** code for the `{ "commentPattern": "^skip\\sdefault" }` option:
+
+::: correct
+
+```js
+/*eslint default-case: ["error", { "commentPattern": "^skip\\sdefault" }]*/
+
+switch(a) {
+    case 1:
+        /* code */
+        break;
+
+    // skip default
+}
+
+switch(a) {
+    case 1:
+        /* code */
+        break;
+
+    // skip default case
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce a `default` case for `switch` statements, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/default-param-last.md b/eslint/docs/src/rules/default-param-last.md
new file mode 100644 (file)
index 0000000..0343ce7
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: default-param-last
+layout: doc
+rule_type: suggestion
+---
+
+Putting default parameter at last allows function calls to omit optional tail arguments.
+
+```js
+// Correct: optional argument can be omitted
+function createUser(id, isAdmin = false) {}
+createUser("tabby")
+
+// Incorrect: optional argument can **not** be omitted
+function createUser(isAdmin = false, id) {}
+createUser(undefined, "tabby")
+```
+
+## Rule Details
+
+This rule enforces default parameters to be the last of parameters.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint default-param-last: ["error"] */
+
+function f(a = 0, b) {}
+
+function f(a, b = 0, c) {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint default-param-last: ["error"] */
+
+function f(a, b = 0) {}
+```
+
+:::
diff --git a/eslint/docs/src/rules/dot-location.md b/eslint/docs/src/rules/dot-location.md
new file mode 100644 (file)
index 0000000..34ab8c5
--- /dev/null
@@ -0,0 +1,105 @@
+---
+title: dot-location
+layout: doc
+rule_type: layout
+related_rules:
+- newline-after-var
+- dot-notation
+---
+
+
+
+JavaScript allows you to place newlines before or after a dot in a member expression.
+
+Consistency in placing a newline before or after the dot can greatly increase readability.
+
+```js
+var a = universe.
+        galaxy;
+
+var b = universe
+       .galaxy;
+```
+
+## Rule Details
+
+This rule aims to enforce newline consistency in member expressions. This rule prevents the use of mixed newlines around the dot in a member expression.
+
+## Options
+
+The rule takes one option, a string:
+
+* If it is `"object"` (default), the dot in a member expression should be on the same line as the object portion.
+* If it is `"property"`, the dot in a member expression should be on the same line as the property portion.
+
+### object
+
+The default `"object"` option requires the dot to be on the same line as the object.
+
+Examples of **incorrect** code for the default `"object"` option:
+
+::: incorrect
+
+```js
+/*eslint dot-location: ["error", "object"]*/
+
+var foo = object
+.property;
+```
+
+:::
+
+Examples of **correct** code for the default `"object"` option:
+
+::: correct
+
+```js
+/*eslint dot-location: ["error", "object"]*/
+
+var foo = object.
+property;
+
+var bar = (
+    object
+).
+property;
+
+var baz = object.property;
+```
+
+:::
+
+### property
+
+The `"property"` option requires the dot to be on the same line as the property.
+
+Examples of **incorrect** code for the `"property"` option:
+
+::: incorrect
+
+```js
+/*eslint dot-location: ["error", "property"]*/
+
+var foo = object.
+property;
+```
+
+:::
+
+Examples of **correct** code for the `"property"` option:
+
+::: correct
+
+```js
+/*eslint dot-location: ["error", "property"]*/
+
+var foo = object
+.property;
+var bar = object.property;
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of newlines before or after dots in member expressions.
diff --git a/eslint/docs/src/rules/dot-notation.md b/eslint/docs/src/rules/dot-notation.md
new file mode 100644 (file)
index 0000000..7637004
--- /dev/null
@@ -0,0 +1,106 @@
+---
+title: dot-notation
+layout: doc
+rule_type: suggestion
+---
+
+
+
+In JavaScript, one can access properties using the dot notation (`foo.bar`) or square-bracket notation (`foo["bar"]`). However, the dot notation is often preferred because it is easier to read, less verbose, and works better with aggressive JavaScript minimizers.
+
+```js
+foo["bar"];
+```
+
+## Rule Details
+
+This rule is aimed at maintaining code consistency and improving code readability by encouraging use of the dot notation style whenever possible. As such, it will warn when it encounters an unnecessary use of square-bracket notation.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint dot-notation: "error"*/
+
+var x = foo["bar"];
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint dot-notation: "error"*/
+
+var x = foo.bar;
+
+var x = foo[bar];    // Property name is a variable, square-bracket notation required
+```
+
+:::
+
+## Options
+
+This rule accepts a single options argument:
+
+* Set the `allowKeywords` option to `false` (default is `true`) to follow ECMAScript version 3 compatible style, avoiding dot notation for reserved word properties.
+* Set the `allowPattern` option to a regular expression string to allow bracket notation for property names that match a pattern (by default, no pattern is tested).
+
+### allowKeywords
+
+Examples of **correct** code for the `{ "allowKeywords": false }` option:
+
+:::correct
+
+```js
+/*eslint dot-notation: ["error", { "allowKeywords": false }]*/
+
+var foo = { "class": "CS 101" }
+var x = foo["class"]; // Property name is a reserved word, square-bracket notation required
+```
+
+:::
+
+Examples of additional **correct** code for the `{ "allowKeywords": false }` option:
+
+:::correct
+
+```js
+/*eslint dot-notation: ["error", { "allowKeywords": false }]*/
+
+class C {
+    #in;
+    foo() {
+        this.#in; // Dot notation is required for private identifiers
+    }
+}
+```
+
+:::
+
+### allowPattern
+
+For example, when preparing data to be sent to an external API, it is often required to use property names that include underscores.  If the `camelcase` rule is in effect, these [snake case](https://en.wikipedia.org/wiki/Snake_case) properties would not be allowed.  By providing an `allowPattern` to the `dot-notation` rule, these snake case properties can be accessed with bracket notation.
+
+Examples of **correct** code for the sample `{ "allowPattern": "^[a-z]+(_[a-z]+)+$" }` option:
+
+:::correct
+
+```js
+/*eslint camelcase: "error"*/
+/*eslint dot-notation: ["error", { "allowPattern": "^[a-z]+(_[a-z]+)+$" }]*/
+
+var data = {};
+data.foo_bar = 42;
+
+var data = {};
+data["fooBar"] = 42;
+
+var data = {};
+data["foo_bar"] = 42; // no warning
+```
+
+:::
diff --git a/eslint/docs/src/rules/eol-last.md b/eslint/docs/src/rules/eol-last.md
new file mode 100644 (file)
index 0000000..4e7dbc0
--- /dev/null
@@ -0,0 +1,60 @@
+---
+title: eol-last
+layout: doc
+rule_type: layout
+---
+
+
+
+Trailing newlines in non-empty files are a common UNIX idiom. Benefits of
+trailing newlines include the ability to concatenate or append to files as well
+as output files to the terminal without interfering with shell prompts.
+
+## Rule Details
+
+This rule enforces at least one newline (or absence thereof) at the end
+of non-empty files.
+
+Prior to v0.16.0 this rule also enforced that there was only a single line at
+the end of the file. If you still want this behavior, consider enabling
+[no-multiple-empty-lines](no-multiple-empty-lines) with `maxEOF` and/or
+[no-trailing-spaces](no-trailing-spaces).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint eol-last: ["error", "always"]*/
+
+function doSomething() {
+  var foo = 2;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint eol-last: ["error", "always"]*/
+
+function doSomething() {
+  var foo = 2;
+}\n
+```
+
+:::
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) enforces that files end with a newline (LF)
+* `"never"` enforces that files do not end with a newline
+* `"unix"` (deprecated) is identical to "always"
+* `"windows"` (deprecated) is identical to "always", but will use a CRLF character when autofixing
+
+**Deprecated:** The options `"unix"` and `"windows"` are deprecated. If you need to enforce a specific linebreak style, use this rule in conjunction with `linebreak-style`.
diff --git a/eslint/docs/src/rules/eqeqeq.md b/eslint/docs/src/rules/eqeqeq.md
new file mode 100644 (file)
index 0000000..f89c303
--- /dev/null
@@ -0,0 +1,151 @@
+---
+title: eqeqeq
+layout: doc
+rule_type: suggestion
+---
+
+
+
+It is considered good practice to use the type-safe equality operators `===` and `!==` instead of their regular counterparts `==` and `!=`.
+
+The reason for this is that `==` and `!=` do type coercion which follows the rather obscure [Abstract Equality Comparison Algorithm](https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3).
+For instance, the following statements are all considered `true`:
+
+* `[] == false`
+* `[] == ![]`
+* `3 == "03"`
+
+If one of those occurs in an innocent-looking statement such as `a == b` the actual problem is very difficult to spot.
+
+## Rule Details
+
+This rule is aimed at eliminating the type-unsafe equality operators.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint eqeqeq: "error"*/
+
+if (x == 42) { }
+
+if ("" == text) { }
+
+if (obj.getStuff() != undefined) { }
+```
+
+:::
+
+The `--fix` option on the command line automatically fixes some problems reported by this rule. A problem is only fixed if one of the operands is a `typeof` expression, or if both operands are literals with the same type.
+
+## Options
+
+### always
+
+The `"always"` option (default) enforces the use of `===` and `!==` in every situation (except when you opt-in to more specific handling of `null` [see below]).
+
+Examples of **incorrect** code for the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint eqeqeq: ["error", "always"]*/
+
+a == b
+foo == true
+bananas != 1
+value == undefined
+typeof foo == 'undefined'
+'hello' != 'world'
+0 == 0
+true == true
+foo == null
+
+```
+
+:::
+
+Examples of **correct** code for the `"always"` option:
+
+::: correct
+
+```js
+/*eslint eqeqeq: ["error", "always"]*/
+
+a === b
+foo === true
+bananas !== 1
+value === undefined
+typeof foo === 'undefined'
+'hello' !== 'world'
+0 === 0
+true === true
+foo === null
+
+```
+
+:::
+
+This rule optionally takes a second argument, which should be an object with the following supported properties:
+
+* `"null"`: Customize how this rule treats `null` literals. Possible values:
+    * `always` (default) - Always use === or !==.
+    * `never` - Never use === or !== with `null`.
+    * `ignore` - Do not apply this rule to `null`.
+
+### smart
+
+The `"smart"` option enforces the use of `===` and `!==` except for these cases:
+
+* Comparing two literal values
+* Evaluating the value of `typeof`
+* Comparing against `null`
+
+Examples of **incorrect** code for the `"smart"` option:
+
+::: incorrect
+
+```js
+/*eslint eqeqeq: ["error", "smart"]*/
+
+// comparing two variables requires ===
+a == b
+
+// only one side is a literal
+foo == true
+bananas != 1
+
+// comparing to undefined requires ===
+value == undefined
+```
+
+:::
+
+Examples of **correct** code for the `"smart"` option:
+
+::: correct
+
+```js
+/*eslint eqeqeq: ["error", "smart"]*/
+
+typeof foo == 'undefined'
+'hello' != 'world'
+0 == 0
+true == true
+foo == null
+```
+
+:::
+
+### allow-null
+
+**Deprecated:** Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell ESLint to always enforce strict equality except when comparing with the `null` literal.
+
+```js
+["error", "always", {"null": "ignore"}]
+```
+
+## When Not To Use It
+
+If you don't want to enforce a style for using equality operators, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/for-direction.md b/eslint/docs/src/rules/for-direction.md
new file mode 100644 (file)
index 0000000..352ed84
--- /dev/null
@@ -0,0 +1,41 @@
+---
+title: for-direction
+layout: doc
+rule_type: problem
+---
+
+
+
+## Rule Details
+
+A `for` loop with a stop condition that can never be reached, such as one with a counter that moves in the wrong direction, will run infinitely. While there are occasions when an infinite loop is intended, the convention is to construct such loops as `while` loops. More typically, an infinite for loop is a bug.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint for-direction: "error"*/
+for (var i = 0; i < 10; i--) {
+}
+
+for (var i = 10; i >= 0; i++) {
+}
+
+for (var i = 0; i > 10; i++) {
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint for-direction: "error"*/
+for (var i = 0; i < 10; i++) {
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/func-call-spacing.md b/eslint/docs/src/rules/func-call-spacing.md
new file mode 100644 (file)
index 0000000..542ac8b
--- /dev/null
@@ -0,0 +1,133 @@
+---
+title: func-call-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- no-spaced-func
+---
+
+
+
+When calling a function, developers may insert optional whitespace between the function's name and the parentheses that invoke it. The following pairs of function calls are equivalent:
+
+```js
+alert('Hello');
+alert ('Hello');
+
+console.log(42);
+console.log (42);
+
+new Date();
+new Date ();
+```
+
+## Rule Details
+
+This rule requires or disallows spaces between the function name and the opening parenthesis that calls it.
+
+## Options
+
+This rule has a string option:
+
+* `"never"` (default) disallows space between the function name and the opening parenthesis.
+* `"always"` requires space between the function name and the opening parenthesis.
+
+Further, in `"always"` mode, a second object option is available that contains a single boolean `allowNewlines` property.
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint func-call-spacing: ["error", "never"]*/
+
+fn ();
+
+fn
+();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint func-call-spacing: ["error", "never"]*/
+
+fn();
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint func-call-spacing: ["error", "always"]*/
+
+fn();
+
+fn
+();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint func-call-spacing: ["error", "always"]*/
+
+fn ();
+```
+
+:::
+
+#### allowNewlines
+
+By default, `"always"` does not allow newlines. To permit newlines when in `"always"` mode, set the `allowNewlines` option to `true`. Newlines are never required.
+
+Examples of **incorrect** code for this rule with `allowNewlines` option enabled:
+
+::: incorrect
+
+```js
+/*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
+
+fn();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `allowNewlines` option enabled:
+
+::: correct
+
+```js
+/*eslint func-call-spacing: ["error", "always", { "allowNewlines": true }]*/
+
+fn (); // Newlines are never required.
+
+fn
+();
+```
+
+:::
+
+## When Not To Use It
+
+This rule can safely be turned off if your project does not care about enforcing a consistent style for spacing within function calls.
+
+## Compatibility
+
+* **JSCS**: [disallowSpacesInCallExpression](https://jscs-dev.github.io/rule/disallowSpacesInCallExpression)
+* **JSCS**: [requireSpacesInCallExpression](https://jscs-dev.github.io/rule/requireSpacesInCallExpression)
diff --git a/eslint/docs/src/rules/func-name-matching.md b/eslint/docs/src/rules/func-name-matching.md
new file mode 100644 (file)
index 0000000..d42db46
--- /dev/null
@@ -0,0 +1,211 @@
+---
+title: func-name-matching
+layout: doc
+rule_type: suggestion
+---
+
+
+## Rule Details
+
+This rule requires function names to match the name of the variable or property to which they are assigned. The rule will ignore property assignments where the property name is a literal that is not a valid identifier in the ECMAScript version specified in your configuration (default ES5).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint func-name-matching: "error"*/
+
+var foo = function bar() {};
+foo = function bar() {};
+obj.foo = function bar() {};
+obj['foo'] = function bar() {};
+var obj = {foo: function bar() {}};
+({['foo']: function bar() {}});
+
+class C {
+    foo = function bar() {};
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint func-name-matching: ["error", "never"] */
+
+var foo = function foo() {};
+foo = function foo() {};
+obj.foo = function foo() {};
+obj['foo'] = function foo() {};
+var obj = {foo: function foo() {}};
+({['foo']: function foo() {}});
+
+class C {
+    foo = function foo() {};
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint func-name-matching: "error"*/
+/*eslint func-name-matching: ["error", "always"]*/ // these are equivalent
+/*eslint-env es6*/
+
+var foo = function foo() {};
+var foo = function() {};
+var foo = () => {};
+foo = function foo() {};
+
+obj.foo = function foo() {};
+obj['foo'] = function foo() {};
+obj['foo//bar'] = function foo() {};
+obj[foo] = function bar() {};
+
+var obj = {foo: function foo() {}};
+var obj = {[foo]: function bar() {}};
+var obj = {'foo//bar': function foo() {}};
+var obj = {foo: function() {}};
+
+obj['x' + 2] = function bar(){};
+var [ bar ] = [ function bar(){} ];
+({[foo]: function bar() {}})
+
+class C {
+    foo = function foo() {};
+    baz = function() {};
+}
+
+// private names are ignored
+class D {
+    #foo = function foo() {};
+    #bar = function foo() {};
+    baz() {
+        this.#foo = function foo() {};
+        this.#foo = function bar() {};
+    }
+}
+
+module.exports = function foo(name) {};
+module['exports'] = function foo(name) {};
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint func-name-matching: ["error", "never"] */
+/*eslint-env es6*/
+
+var foo = function bar() {};
+var foo = function() {};
+var foo = () => {};
+foo = function bar() {};
+
+obj.foo = function bar() {};
+obj['foo'] = function bar() {};
+obj['foo//bar'] = function foo() {};
+obj[foo] = function foo() {};
+
+var obj = {foo: function bar() {}};
+var obj = {[foo]: function foo() {}};
+var obj = {'foo//bar': function foo() {}};
+var obj = {foo: function() {}};
+
+obj['x' + 2] = function bar(){};
+var [ bar ] = [ function bar(){} ];
+({[foo]: function bar() {}})
+
+class C {
+    foo = function bar() {};
+    baz = function() {};
+}
+
+// private names are ignored
+class D {
+    #foo = function foo() {};
+    #bar = function foo() {};
+    baz() {
+        this.#foo = function foo() {};
+        this.#foo = function bar() {};
+    }
+}
+
+module.exports = function foo(name) {};
+module['exports'] = function foo(name) {};
+```
+
+:::
+
+## Options
+
+This rule takes an optional string of "always" or "never" (when omitted, it defaults to "always"), and an optional options object with two properties `considerPropertyDescriptor` and `includeCommonJSModuleExports`.
+
+### considerPropertyDescriptor
+
+A boolean value that defaults to `false`. If `considerPropertyDescriptor` is set to true, the check will take into account the use of `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty`.
+
+Examples of **correct** code for the `{ considerPropertyDescriptor: true }` option:
+
+::: correct
+
+```js
+/*eslint func-name-matching: ["error", { "considerPropertyDescriptor": true }]*/
+/*eslint func-name-matching: ["error", "always", { "considerPropertyDescriptor": true }]*/ // these are equivalent
+var obj = {};
+Object.create(obj, {foo:{value: function foo() {}}});
+Object.defineProperty(obj, 'bar', {value: function bar() {}});
+Object.defineProperties(obj, {baz:{value: function baz() {} }});
+Reflect.defineProperty(obj, 'foo', {value: function foo() {}});
+```
+
+:::
+
+Examples of **incorrect** code for the `{ considerPropertyDescriptor: true }` option:
+
+::: incorrect
+
+```js
+/*eslint func-name-matching: ["error", { "considerPropertyDescriptor": true }]*/
+/*eslint func-name-matching: ["error", "always", { "considerPropertyDescriptor": true }]*/ // these are equivalent
+var obj = {};
+Object.create(obj, {foo:{value: function bar() {}}});
+Object.defineProperty(obj, 'bar', {value: function baz() {}});
+Object.defineProperties(obj, {baz:{value: function foo() {} }});
+Reflect.defineProperty(obj, 'foo', {value: function value() {}});
+```
+
+:::
+
+### includeCommonJSModuleExports
+
+A boolean value that defaults to `false`. If `includeCommonJSModuleExports` is set to true, `module.exports` and `module["exports"]` will be checked by this rule.
+
+Examples of **incorrect** code for the `{ includeCommonJSModuleExports: true }` option:
+
+::: incorrect
+
+```js
+/*eslint func-name-matching: ["error", { "includeCommonJSModuleExports": true }]*/
+/*eslint func-name-matching: ["error", "always", { "includeCommonJSModuleExports": true }]*/ // these are equivalent
+
+module.exports = function foo(name) {};
+module['exports'] = function foo(name) {};
+```
+
+:::
+
+## When Not To Use It
+
+Do not use this rule if you want to allow named functions to have different names from the variable or property to which they are assigned.
+
+## Compatibility
+
+* **JSCS**: [requireMatchingFunctionName](https://jscs-dev.github.io/rule/requireMatchingFunctionName)
diff --git a/eslint/docs/src/rules/func-names.md b/eslint/docs/src/rules/func-names.md
new file mode 100644 (file)
index 0000000..ceb575e
--- /dev/null
@@ -0,0 +1,276 @@
+---
+title: func-names
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://web.archive.org/web/20201112040809/http://markdaggett.com/blog/2013/02/15/functions-explained/
+- https://2ality.com/2015/09/function-names-es6.html
+---
+
+
+A pattern that's becoming more common is to give function expressions names to aid in debugging. For example:
+
+```js
+Foo.prototype.bar = function bar() {};
+```
+
+Adding the second `bar` in the above example is optional.  If you leave off the function name then when the function throws an exception you are likely to get something similar to `anonymous function` in the stack trace.  If you provide the optional name for a function expression then you will get the name of the function expression in the stack trace.
+
+## Rule Details
+
+This rule can enforce or disallow the use of named function expressions.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) requires function expressions to have a name
+* `"as-needed"` requires function expressions to have a name, if the name isn't assigned automatically per the ECMAScript specification.
+* `"never"` disallows named function expressions, except in recursive functions, where a name is needed
+
+This rule has an object option:
+
+* `"generators": "always" | "as-needed" | "never"`
+    * `"always"` require named generators
+    * `"as-needed"` require named generators if the name isn't assigned automatically per the ECMAScript specification.
+    * `"never"` disallow named generators where possible.
+
+When a value for `generators` is not provided the behavior for generator functions falls back to the base option.
+
+Please note that `"always"` and `"as-needed"` require function expressions and function declarations in `export default` declarations to have a name.
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "always"]*/
+
+Foo.prototype.bar = function() {};
+
+const cat = {
+  meow: function() {}
+}
+
+(function() {
+    // ...
+}())
+
+export default function() {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "always"]*/
+
+Foo.prototype.bar = function bar() {};
+
+const cat = {
+  meow() {}
+}
+
+(function bar() {
+    // ...
+}())
+
+export default function foo() {}
+```
+
+:::
+
+### as-needed
+
+ECMAScript 6 introduced a `name` property on all functions. The value of `name` is determined by evaluating the code around the function to see if a name can be inferred. For example, a function assigned to a variable will automatically have a `name` property equal to the name of the variable. The value of `name` is then used in stack traces for easier debugging.
+
+Examples of **incorrect** code for this rule with the `"as-needed"` option:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "as-needed"]*/
+
+Foo.prototype.bar = function() {};
+
+(function() {
+    // ...
+}())
+
+export default function() {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"as-needed"` option:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "as-needed"]*/
+
+var bar = function() {};
+
+const cat = {
+  meow: function() {}
+}
+
+class C {
+    #bar = function() {};
+    baz = function() {};
+}
+
+quux ??= function() {};
+
+(function bar() {
+    // ...
+}())
+
+export default function foo() {}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "never"]*/
+
+Foo.prototype.bar = function bar() {};
+
+(function bar() {
+    // ...
+}())
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "never"]*/
+
+Foo.prototype.bar = function() {};
+
+(function() {
+    // ...
+}())
+```
+
+:::
+
+### generators
+
+Examples of **incorrect** code for this rule with the `"always", { "generators": "as-needed" }` options:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "always", { "generators": "as-needed" }]*/
+
+(function*() {
+    // ...
+}())
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "generators": "as-needed" }` options:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "always", { "generators": "as-needed" }]*/
+
+var foo = function*() {};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"always", { "generators": "never" }` options:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "always", { "generators": "never" }]*/
+
+var foo = bar(function *baz() {});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "generators": "never" }` options:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "always", { "generators": "never" }]*/
+
+var foo = bar(function *() {});
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"as-needed", { "generators": "never" }` options:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "as-needed", { "generators": "never" }]*/
+
+var foo = bar(function *baz() {});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"as-needed", { "generators": "never" }` options:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "as-needed", { "generators": "never" }]*/
+
+var foo = bar(function *() {});
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never", { "generators": "always" }` options:
+
+::: incorrect
+
+```js
+/*eslint func-names: ["error", "never", { "generators": "always" }]*/
+
+var foo = bar(function *() {});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never", { "generators": "always" }` options:
+
+::: correct
+
+```js
+/*eslint func-names: ["error", "never", { "generators": "always" }]*/
+
+var foo = bar(function *baz() {});
+```
+
+:::
+
+## Compatibility
+
+* **JSCS**: [requireAnonymousFunctions](https://jscs-dev.github.io/rule/requireAnonymousFunctions)
+* **JSCS**: [disallowAnonymousFunctions](https://jscs-dev.github.io/rule/disallowAnonymousFunctions)
diff --git a/eslint/docs/src/rules/func-style.md b/eslint/docs/src/rules/func-style.md
new file mode 100644 (file)
index 0000000..56a9fca
--- /dev/null
@@ -0,0 +1,154 @@
+---
+title: func-style
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
+---
+
+
+There are two ways of defining functions in JavaScript: `function` declarations and `function` expressions. Declarations contain the `function` keyword first, followed by a name and then its arguments and the function body, for example:
+
+```js
+function doSomething() {
+    // ...
+}
+```
+
+Equivalent function expressions begin with the `var` keyword, followed by a name and then the function itself, such as:
+
+```js
+var doSomething = function() {
+    // ...
+};
+```
+
+The primary difference between `function` declarations and `function expressions` is that declarations are *hoisted* to the top of the scope in which they are defined, which allows you to write code that uses the function before its declaration. For example:
+
+```js
+doSomething();
+
+function doSomething() {
+    // ...
+}
+```
+
+Although this code might seem like an error, it actually works fine because JavaScript engines hoist the `function` declarations to the top of the scope. That means this code is treated as if the declaration came before the invocation.
+
+For `function` expressions, you must define the function before it is used, otherwise it causes an error. Example:
+
+```js
+doSomething();  // error!
+
+var doSomething = function() {
+    // ...
+};
+```
+
+In this case, `doSomething()` is undefined at the time of invocation and so causes a runtime error.
+
+Due to these different behaviors, it is common to have guidelines as to which style of function should be used. There is really no correct or incorrect choice here, it is just a preference.
+
+## Rule Details
+
+This rule enforces a particular type of `function` style throughout a JavaScript file, either declarations or expressions. You can specify which you prefer in the configuration.
+
+## Options
+
+This rule has a string option:
+
+* `"expression"` (default) requires the use of function expressions instead of function declarations
+* `"declaration"` requires the use of function declarations instead of function expressions
+
+This rule has an object option for an exception:
+
+* `"allowArrowFunctions"`: `true` (default `false`) allows the use of arrow functions. This option applies only when the string option is set to `"declaration"` (arrow functions are always allowed when the string option is set to `"expression"`, regardless of this option)
+
+### expression
+
+Examples of **incorrect** code for this rule with the default `"expression"` option:
+
+::: incorrect
+
+```js
+/*eslint func-style: ["error", "expression"]*/
+
+function foo() {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"expression"` option:
+
+::: correct
+
+```js
+/*eslint func-style: ["error", "expression"]*/
+
+var foo = function() {
+    // ...
+};
+
+var foo = () => {};
+
+// allowed as allowArrowFunctions : false is applied only for declaration
+```
+
+:::
+
+### declaration
+
+Examples of **incorrect** code for this rule with the `"declaration"` option:
+
+::: incorrect
+
+```js
+/*eslint func-style: ["error", "declaration"]*/
+
+var foo = function() {
+    // ...
+};
+
+var foo = () => {};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"declaration"` option:
+
+::: correct
+
+```js
+/*eslint func-style: ["error", "declaration"]*/
+
+function foo() {
+    // ...
+}
+
+// Methods (functions assigned to objects) are not checked by this rule
+SomeObject.foo = function() {
+    // ...
+};
+```
+
+:::
+
+### allowArrowFunctions
+
+Examples of additional **correct** code for this rule with the `"declaration", { "allowArrowFunctions": true }` options:
+
+::: correct
+
+```js
+/*eslint func-style: ["error", "declaration", { "allowArrowFunctions": true }]*/
+
+var foo = () => {};
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow developers to each decide how they want to write functions on their own, then you can disable this rule.
diff --git a/eslint/docs/src/rules/function-call-argument-newline.md b/eslint/docs/src/rules/function-call-argument-newline.md
new file mode 100644 (file)
index 0000000..baba38c
--- /dev/null
@@ -0,0 +1,227 @@
+---
+title: function-call-argument-newline
+layout: doc
+rule_type: layout
+related_rules:
+- function-paren-newline
+- func-call-spacing
+- object-property-newline
+- array-element-newline
+---
+
+
+
+A number of style guides require or disallow line breaks between arguments of a function call.
+
+## Rule Details
+
+This rule enforces line breaks between arguments of a function call.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) requires line breaks between arguments
+* `"never"` disallows line breaks between arguments
+* `"consistent"` requires consistent usage of line breaks between arguments
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint function-call-argument-newline: ["error", "always"]*/
+
+foo("one", "two", "three");
+
+bar("one", "two", {
+    one: 1,
+    two: 2
+});
+
+baz("one", "two", (x) => {
+    console.log(x);
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint function-call-argument-newline: ["error", "always"]*/
+
+foo(
+    "one",
+    "two",
+    "three"
+);
+
+bar(
+    "one",
+    "two",
+    { one: 1, two: 2 }
+);
+// or
+bar(
+    "one",
+    "two",
+    {
+        one: 1,
+        two: 2
+    }
+);
+
+baz(
+    "one",
+    "two",
+    (x) => {
+        console.log(x);
+    }
+);
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint function-call-argument-newline: ["error", "never"]*/
+
+foo(
+    "one",
+    "two", "three"
+);
+
+bar(
+    "one",
+    "two", {
+        one: 1,
+        two: 2
+    }
+);
+
+baz(
+    "one",
+    "two", (x) => {
+        console.log(x);
+    }
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint function-call-argument-newline: ["error", "never"]*/
+
+foo("one", "two", "three");
+// or
+foo(
+    "one", "two", "three"
+);
+
+bar("one", "two", { one: 1, two: 2 });
+// or
+bar("one", "two", {
+    one: 1,
+    two: 2
+});
+
+baz("one", "two", (x) => {
+    console.log(x);
+});
+```
+
+:::
+
+### consistent
+
+Examples of **incorrect** code for this rule with the `"consistent"` option:
+
+::: incorrect
+
+```js
+/*eslint function-call-argument-newline: ["error", "consistent"]*/
+
+foo("one", "two",
+    "three");
+//or
+foo("one",
+    "two", "three");
+
+bar("one", "two",
+    { one: 1, two: 2}
+);
+
+baz("one", "two",
+    (x) => { console.log(x); }
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+::: correct
+
+```js
+/*eslint function-call-argument-newline: ["error", "consistent"]*/
+
+foo("one", "two", "three");
+// or
+foo(
+    "one",
+    "two",
+    "three"
+);
+
+bar("one", "two", {
+    one: 1,
+    two: 2
+});
+// or
+bar(
+    "one",
+    "two",
+    { one: 1, two: 2 }
+);
+// or
+bar(
+    "one",
+    "two",
+    {
+        one: 1,
+        two: 2
+    }
+);
+
+baz("one", "two", (x) => {
+    console.log(x);
+});
+// or
+baz(
+    "one",
+    "two",
+    (x) => {
+        console.log(x);
+    }
+);
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce line breaks between arguments, don't enable this rule.
diff --git a/eslint/docs/src/rules/function-paren-newline.md b/eslint/docs/src/rules/function-paren-newline.md
new file mode 100644 (file)
index 0000000..68d38fa
--- /dev/null
@@ -0,0 +1,382 @@
+---
+title: function-paren-newline
+layout: doc
+rule_type: layout
+---
+
+
+
+Many style guides require or disallow newlines inside of function parentheses.
+
+## Rule Details
+
+This rule enforces consistent line breaks inside parentheses of function parameters or arguments.
+
+### Options
+
+This rule has a single option, which can either be a string or an object.
+
+* `"always"` requires line breaks inside all function parentheses.
+* `"never"` disallows line breaks inside all function parentheses.
+* `"multiline"` (default) requires linebreaks inside function parentheses if any of the parameters/arguments have a line break between them. Otherwise, it disallows linebreaks.
+* `"multiline-arguments"` works like `multiline` but allows linebreaks inside function parentheses if there is only one parameter/argument.
+* `"consistent"` requires consistent usage of linebreaks for each pair of parentheses. It reports an error if one parenthesis in the pair has a linebreak inside it and the other parenthesis does not.
+* `{ "minItems": value }` requires linebreaks inside function parentheses if the number of parameters/arguments is at least `value`. Otherwise, it disallows linebreaks.
+
+Example configurations:
+
+```json
+{
+  "rules": {
+    "function-paren-newline": ["error", "never"]
+  }
+}
+```
+
+```json
+{
+  "rules": {
+    "function-paren-newline": ["error", { "minItems": 3 }]
+  }
+}
+```
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", "always"] */
+
+function foo(bar, baz) {}
+
+var foo = function(bar, baz) {};
+
+var foo = (bar, baz) => {};
+
+foo(bar, baz);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", "always"] */
+
+function foo(
+  bar,
+  baz
+) {}
+
+var foo = function(
+  bar, baz
+) {};
+
+var foo = (
+  bar,
+  baz
+) => {};
+
+foo(
+  bar,
+  baz
+);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", "never"] */
+
+function foo(
+  bar,
+  baz
+) {}
+
+var foo = function(
+  bar, baz
+) {};
+
+var foo = (
+  bar,
+  baz
+) => {};
+
+foo(
+  bar,
+  baz
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", "never"] */
+
+function foo(bar, baz) {}
+
+function foo(bar,
+             baz) {}
+
+var foo = function(bar, baz) {};
+
+var foo = (bar, baz) => {};
+
+foo(bar, baz);
+
+foo(bar,
+  baz);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the default `"multiline"` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", "multiline"] */
+
+function foo(bar,
+  baz
+) {}
+
+var foo = function(
+  bar, baz
+) {};
+
+var foo = (
+  bar,
+  baz) => {};
+
+foo(bar,
+  baz);
+
+foo(
+  function() {
+    return baz;
+  }
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"multiline"` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", "multiline"] */
+
+function foo(bar, baz) {}
+
+var foo = function(
+  bar,
+  baz
+) {};
+
+var foo = (bar, baz) => {};
+
+foo(bar, baz, qux);
+
+foo(
+  bar,
+  baz,
+  qux
+);
+
+foo(function() {
+  return baz;
+});
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"consistent"` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", "consistent"] */
+
+function foo(bar,
+  baz
+) {}
+
+var foo = function(bar,
+  baz
+) {};
+
+var foo = (
+  bar,
+  baz) => {};
+
+foo(
+  bar,
+  baz);
+
+foo(
+  function() {
+    return baz;
+  });
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", "consistent"] */
+
+function foo(bar,
+  baz) {}
+
+var foo = function(bar, baz) {};
+
+var foo = (
+  bar,
+  baz
+) => {};
+
+foo(
+  bar, baz
+);
+
+foo(
+  function() {
+    return baz;
+  }
+);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"multiline-arguments"` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", "multiline-arguments"] */
+
+function foo(bar,
+  baz
+) {}
+
+var foo = function(bar,
+  baz
+) {};
+
+var foo = (
+  bar,
+  baz) => {};
+
+foo(
+  bar,
+  baz);
+
+foo(
+  bar, qux,
+  baz
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the consistent `"multiline-arguments"` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", "multiline-arguments"] */
+
+function foo(
+  bar,
+  baz
+) {}
+
+var foo = function(bar, baz) {};
+
+var foo = (
+  bar
+) => {};
+
+foo(
+  function() {
+    return baz;
+  }
+);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "minItems": 3 }` option:
+
+::: incorrect
+
+```js
+/* eslint function-paren-newline: ["error", { "minItems": 3 }] */
+
+function foo(
+  bar,
+  baz
+) {}
+
+function foo(bar, baz, qux) {}
+
+var foo = function(
+  bar, baz
+) {};
+
+var foo = (bar,
+  baz) => {};
+
+foo(bar,
+  baz);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "minItems": 3 }` option:
+
+::: correct
+
+```js
+/* eslint function-paren-newline: ["error", { "minItems": 3 }] */
+
+function foo(bar, baz) {}
+
+var foo = function(
+  bar,
+  baz,
+  qux
+) {};
+
+var foo = (
+  bar, baz, qux
+) => {};
+
+foo(bar, baz);
+
+foo(
+  bar, baz, qux
+);
+```
+
+:::
+
+## When Not To Use It
+
+If don't want to enforce consistent linebreaks inside function parentheses, do not turn on this rule.
diff --git a/eslint/docs/src/rules/generator-star-spacing.md b/eslint/docs/src/rules/generator-star-spacing.md
new file mode 100644 (file)
index 0000000..82cdbcd
--- /dev/null
@@ -0,0 +1,235 @@
+---
+title: generator-star-spacing
+layout: doc
+rule_type: layout
+further_reading:
+- https://leanpub.com/understandinges6/read/#leanpub-auto-generators
+---
+
+
+
+Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
+These special functions are indicated by placing an `*` after the `function` keyword.
+
+Here is an example of a generator function:
+
+```js
+/*eslint-env es6*/
+
+function* generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+This is also valid:
+
+```js
+/*eslint-env es6*/
+
+function *generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+This is valid as well:
+
+```js
+/*eslint-env es6*/
+
+function * generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+To keep a sense of consistency when using generators this rule enforces a single position for the `*`.
+
+## Rule Details
+
+This rule aims to enforce spacing around the `*` of generator functions.
+
+## Options
+
+The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
+
+* `before` enforces spacing between the `*` and the `function` keyword.
+  If it is `true`, a space is required, otherwise spaces are disallowed.
+
+  In object literal shorthand methods, spacing before the `*` is not checked, as they lack a `function` keyword.
+
+* `after` enforces spacing between the `*` and the function name (or the opening parenthesis for anonymous generator functions).
+  If it is `true`, a space is required, otherwise spaces are disallowed.
+
+The default is `{"before": true, "after": false}`.
+
+An example configuration:
+
+```json
+"generator-star-spacing": ["error", {"before": true, "after": false}]
+```
+
+And the option has shorthand as a string keyword:
+
+* `{"before": true, "after": false}` → `"before"`
+* `{"before": false, "after": true}` → `"after"`
+* `{"before": true, "after": true}` → `"both"`
+* `{"before": false, "after": false}` → `"neither"`
+
+An example of shorthand configuration:
+
+```json
+"generator-star-spacing": ["error", "after"]
+```
+
+Additionally, this rule allows further configurability via overrides per function type.
+
+* `named` provides overrides for named functions
+* `anonymous` provides overrides for anonymous functions
+* `method` provides overrides for class methods or property function shorthand
+
+An example of a configuration with overrides:
+
+```json
+"generator-star-spacing": ["error", {
+    "before": false,
+    "after": true,
+    "anonymous": "neither",
+    "method": {"before": true, "after": true}
+}]
+```
+
+In the example configuration above, the top level "before" and "after" options define the default behavior of
+the rule, while the "anonymous" and "method" options override the default behavior.
+Overrides can be either an object with "before" and "after", or a shorthand string as above.
+
+## Examples
+
+### before
+
+Examples of **correct** code for this rule with the `"before"` option:
+
+::: correct
+
+```js
+/*eslint generator-star-spacing: ["error", {"before": true, "after": false}]*/
+/*eslint-env es6*/
+
+function *generator() {}
+
+var anonymous = function *() {};
+
+var shorthand = { *generator() {} };
+```
+
+:::
+
+### after
+
+Examples of **correct** code for this rule with the `"after"` option:
+
+::: correct
+
+```js
+/*eslint generator-star-spacing: ["error", {"before": false, "after": true}]*/
+/*eslint-env es6*/
+
+function* generator() {}
+
+var anonymous = function* () {};
+
+var shorthand = { * generator() {} };
+```
+
+:::
+
+### both
+
+Examples of **correct** code for this rule with the `"both"` option:
+
+::: correct
+
+```js
+/*eslint generator-star-spacing: ["error", {"before": true, "after": true}]*/
+/*eslint-env es6*/
+
+function * generator() {}
+
+var anonymous = function * () {};
+
+var shorthand = { * generator() {} };
+```
+
+:::
+
+### neither
+
+Examples of **correct** code for this rule with the `"neither"` option:
+
+::: correct
+
+```js
+/*eslint generator-star-spacing: ["error", {"before": false, "after": false}]*/
+/*eslint-env es6*/
+
+function*generator() {}
+
+var anonymous = function*() {};
+
+var shorthand = { *generator() {} };
+```
+
+:::
+
+Examples of **incorrect** code for this rule with overrides present:
+
+::: incorrect
+
+```js
+/*eslint generator-star-spacing: ["error", {
+    "before": false,
+    "after": true,
+    "anonymous": "neither",
+    "method": {"before": true, "after": true}
+}]*/
+/*eslint-env es6*/
+
+function * generator() {}
+
+var anonymous = function* () {};
+
+var shorthand = { *generator() {} };
+
+class Class { static* method() {} }
+```
+
+:::
+
+Examples of **correct** code for this rule with overrides present:
+
+::: correct
+
+```js
+/*eslint generator-star-spacing: ["error", {
+    "before": false,
+    "after": true,
+    "anonymous": "neither",
+    "method": {"before": true, "after": true}
+}]*/
+/*eslint-env es6*/
+
+function* generator() {}
+
+var anonymous = function*() {};
+
+var shorthand = { * generator() {} };
+
+class Class { static * method() {} }
+```
+
+:::
+
+## When Not To Use It
+
+If your project will not be using generators or you are not concerned with spacing consistency, you do not need this rule.
diff --git a/eslint/docs/src/rules/generator-star.md b/eslint/docs/src/rules/generator-star.md
new file mode 100644 (file)
index 0000000..60b1780
--- /dev/null
@@ -0,0 +1,129 @@
+---
+title: generator-star
+layout: doc
+further_reading:
+- https://leanpub.com/understandinges6/read/#leanpub-auto-generators
+---
+
+Enforces consistent spacing around the asterisk in generator functions.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [generator-star-spacing](generator-star-spacing) rule.
+
+Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
+These special functions are indicated by placing an `*` after the `function` keyword.
+
+Here is an example of a generator function:
+
+```js
+/*eslint-env es6*/
+
+function* generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+This is also valid:
+
+```js
+/*eslint-env es6*/
+
+function *generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+This is valid as well:
+
+```js
+/*eslint-env es6*/
+
+function * generator() {
+    yield "44";
+    yield "55";
+}
+```
+
+To keep a sense of consistency when using generators this rule enforces a single position for the `*`.
+
+## Rule Details
+
+This rule enforces that the `*` is either placed next to the `function` keyword or the name of the function. The single
+option for this rule is a string specifying the placement of the asterisk. For this option you may pass
+`"start"`, `"middle"` or `"end"`. The default is `"end"`.
+
+You can set the style in configuration like this:
+
+```json
+"generator-star": ["error", "start"]
+```
+
+When using `"start"` this placement will be enforced:
+
+```js
+/*eslint-env es6*/
+
+function* generator() {
+}
+```
+
+When using `"middle"` this placement will be enforced:
+
+```js
+/*eslint-env es6*/
+
+function * generator() {
+}
+```
+
+When using `"end"` this placement will be enforced:
+
+```js
+/*eslint-env es6*/
+
+function *generator() {
+}
+```
+
+When using the expression syntax `"start"` will be enforced here:
+
+```js
+/*eslint-env es6*/
+
+var generator = function* () {
+}
+```
+
+When using the expression syntax `"middle"` will be enforced here:
+
+```js
+/*eslint-env es6*/
+
+var generator = function * () {
+}
+```
+
+When using the expression syntax `"end"` will be enforced here:
+
+```js
+/*eslint-env es6*/
+
+var generator = function *() {
+}
+```
+
+When using the expression syntax this is valid for both `"start"` and `"end"`:
+
+```js
+/*eslint-env es6*/
+
+var generator = function*() {
+}
+```
+
+The shortened object literal syntax for generators is not affected by this rule.
+
+## When Not To Use It
+
+If your project will not be using generators you do not need this rule.
diff --git a/eslint/docs/src/rules/getter-return.md b/eslint/docs/src/rules/getter-return.md
new file mode 100644 (file)
index 0000000..b35f0d5
--- /dev/null
@@ -0,0 +1,113 @@
+---
+title: getter-return
+layout: doc
+rule_type: problem
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
+- https://leanpub.com/understandinges6/read/#leanpub-auto-accessor-properties
+---
+
+
+
+The get syntax binds an object property to a function that will be called when that property is looked up. It was first introduced in ECMAScript 5:
+
+```js
+var p = {
+    get name(){
+        return "nicholas";
+    }
+};
+
+Object.defineProperty(p, "age", {
+    get: function (){
+        return 17;
+    }
+});
+```
+
+Note that every `getter` is expected to return a value.
+
+## Rule Details
+
+This rule enforces that a return statement is present in property getters.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint getter-return: "error"*/
+
+p = {
+    get name(){
+        // no returns.
+    }
+};
+
+Object.defineProperty(p, "age", {
+    get: function (){
+        // no returns.
+    }
+});
+
+class P{
+    get name(){
+        // no returns.
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint getter-return: "error"*/
+
+p = {
+    get name(){
+        return "nicholas";
+    }
+};
+
+Object.defineProperty(p, "age", {
+    get: function (){
+        return 18;
+    }
+});
+
+class P{
+    get name(){
+        return "nicholas";
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"allowImplicit": false` (default) disallows implicitly returning `undefined` with a `return` statement.
+
+Examples of **correct** code for the `{ "allowImplicit": true }` option:
+
+::: correct
+
+```js
+/*eslint getter-return: ["error", { allowImplicit: true }]*/
+p = {
+    get name(){
+        return; // return undefined implicitly.
+    }
+};
+```
+
+:::
+
+## When Not To Use It
+
+If your project will not be using ES5 property getters you do not need this rule.
diff --git a/eslint/docs/src/rules/global-require.md b/eslint/docs/src/rules/global-require.md
new file mode 100644 (file)
index 0000000..0fddee7
--- /dev/null
@@ -0,0 +1,111 @@
+---
+title: global-require
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In Node.js, module dependencies are included using the `require()` function, such as:
+
+```js
+var fs = require("fs");
+```
+
+While `require()` may be called anywhere in code, some style guides prescribe that it should be called only in the top level of a module to make it easier to identify dependencies. For instance, it's arguably harder to identify dependencies when they are deeply nested inside of functions and other statements:
+
+```js
+function foo() {
+    if (condition) {
+        var fs = require("fs");
+    }
+}
+```
+
+Since `require()` does a synchronous load, it can cause performance problems when used in other locations.
+
+Further, ES6 modules mandate that `import` and `export` statements can only occur in the top level of the module's body.
+
+## Rule Details
+
+This rule requires all calls to `require()` to be at the top level of the module, similar to ES6 `import` and `export` statements, which also can occur only at the top level.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint global-require: "error"*/
+/*eslint-env es6*/
+
+// calling require() inside of a function is not allowed
+function readFile(filename, callback) {
+    var fs = require("fs");
+    fs.readFile(filename, callback);
+}
+
+// conditional requires like this are also not allowed
+if (DEBUG) {
+    require("debug");
+}
+
+// a require() in a switch statement is also flagged
+switch (x) {
+    case "1":
+        require("1");
+        break;
+}
+
+// you may not require() inside an arrow function body
+var getModule = (name) => require(name);
+
+// you may not require() inside of a function body as well
+function getModule(name) {
+    return require(name);
+}
+
+// you may not require() inside of a try/catch block
+try {
+    require(unsafeModule);
+} catch (e) {
+    console.log(e);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint global-require: "error"*/
+
+// all these variations of require() are ok
+require("x");
+var y = require("y");
+var z;
+z = require("z").initialize();
+
+// requiring a module and using it in a function is ok
+var fs = require("fs");
+function readFile(filename, callback) {
+    fs.readFile(filename, callback);
+}
+
+// you can use a ternary to determine which module to require
+var logger = DEBUG ? require("dev-logger") : require("logger");
+
+// if you want you can require() at the end of your module
+function doSomethingA() {}
+function doSomethingB() {}
+var x = require("x"),
+    z = require("z");
+```
+
+:::
+
+## When Not To Use It
+
+If you have a module that must be initialized with information that comes from the file-system or if a module is only used in very rare situations and will cause significant overhead to load it may make sense to disable the rule. If you need to `require()` an optional dependency inside of a `try`/`catch`, you can disable this rule for just that dependency using the `// eslint-disable-line global-require` comment.
diff --git a/eslint/docs/src/rules/global-strict.md b/eslint/docs/src/rules/global-strict.md
new file mode 100644 (file)
index 0000000..08c0c02
--- /dev/null
@@ -0,0 +1,67 @@
+---
+title: global-strict
+layout: doc
+
+---
+
+Requires or disallows strict mode directives in the global scope.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [strict](strict) rule. The `"global"` option in the new rule is most similar to the removed rule.
+
+Strict mode is enabled by using the following pragma in your code:
+
+```js
+"use strict";
+```
+
+When used globally, as in this example, the strict mode pragma applies to all code within a single file. This can be dangerous if you concatenate scripts together before serving them to a browser. For instance, if you have a file running in strict mode and you concatenate that file with jQuery, the strict mode now also applies to jQuery and may cause errors.
+
+However, if you're using Node.js, you may want to turn strict mode on globally. Files are typically not concatenated together in Node.js projects and therefore the risk of applying strict mode accidentally is minimal. Further, since every file in Node.js has its own scope, global strict mode only effects the single file in which it is placed.
+
+## Rule Details
+
+This rule requires or disallows global strict mode invoked by a `"use strict"` pragma in the global scope.
+
+The following pattern is under strict mode globally and is considered valid with the `"always"` option and a warning with the `"never"` option.
+
+```js
+"use strict";
+
+function foo() {
+    return true;
+}
+```
+
+The following patterns apply strict mode only to functions so are valid with the `"never"` option but are problems with the `"always"` option.
+
+```js
+function foo() {
+    "use strict";
+
+    return true;
+}
+
+(function() {
+    "use strict";
+
+    // other code
+}());
+```
+
+## Options
+
+```json
+"global-strict": ["error", "always"]
+```
+
+Requires that every file have a top-level `"use strict"` statement.
+
+```json
+"global-strict": ["error", "never"]
+```
+
+Warns whenever `"use strict"` is used in the global scope such that it could contaminate concatenated files.
+
+## When Not To Use It
+
+When a project may use non-strict-mode code side by side with strict-mode code and the files are not concatenated, the decision to use global strict mode can be made on an individual basis, rendering this rule unnecessary.
diff --git a/eslint/docs/src/rules/grouped-accessor-pairs.md b/eslint/docs/src/rules/grouped-accessor-pairs.md
new file mode 100644 (file)
index 0000000..a8e40da
--- /dev/null
@@ -0,0 +1,351 @@
+---
+title: grouped-accessor-pairs
+layout: doc
+rule_type: suggestion
+related_rules:
+- accessor-pairs
+- no-dupe-keys
+- no-dupe-class-members
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
+---
+
+
+A getter and setter for the same property don't necessarily have to be defined adjacent to each other.
+
+For example, the following statements would create the same object:
+
+```js
+var o = {
+    get a() {
+        return this.val;
+    },
+    set a(value) {
+        this.val = value;
+    },
+    b: 1
+};
+
+var o = {
+    get a() {
+        return this.val;
+    },
+    b: 1,
+    set a(value) {
+        this.val = value;
+    }
+};
+```
+
+While it is allowed to define the pair for a getter or a setter anywhere in an object or class definition, it's considered a best practice to group accessor functions for the same property.
+
+In other words, if a property has a getter and a setter, the setter should be defined right after the getter, or vice versa.
+
+## Rule Details
+
+This rule requires grouped definitions of accessor functions for the same property in object literals, class declarations and class expressions.
+
+Optionally, this rule can also enforce consistent order (`getBeforeSet` or `setBeforeGet`).
+
+This rule does not enforce the existence of the pair for a getter or a setter. See [accessor-pairs](accessor-pairs) if you also want to enforce getter/setter pairs.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint grouped-accessor-pairs: "error"*/
+
+var foo = {
+    get a() {
+        return this.val;
+    },
+    b: 1,
+    set a(value) {
+        this.val = value;
+    }
+};
+
+var bar = {
+    set b(value) {
+        this.val = value;
+    },
+    a: 1,
+    get b() {
+        return this.val;
+    }
+}
+
+class Foo {
+    set a(value) {
+        this.val = value;
+    }
+    b(){}
+    get a() {
+        return this.val;
+    }
+}
+
+const Bar = class {
+    static get a() {
+        return this.val;
+    }
+    b(){}
+    static set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint grouped-accessor-pairs: "error"*/
+
+var foo = {
+    get a() {
+        return this.val;
+    },
+    set a(value) {
+        this.val = value;
+    },
+    b: 1
+};
+
+var bar = {
+    set b(value) {
+        this.val = value;
+    },
+    get b() {
+        return this.val;
+    },
+    a: 1
+}
+
+class Foo {
+    set a(value) {
+        this.val = value;
+    }
+    get a() {
+        return this.val;
+    }
+    b(){}
+}
+
+const Bar = class {
+    static get a() {
+        return this.val;
+    }
+    static set a(value) {
+        this.val = value;
+    }
+    b(){}
+}
+```
+
+:::
+
+## Options
+
+This rule has a string option:
+
+* `"anyOrder"` (default) does not enforce order.
+* `"getBeforeSet"` if a property has both getter and setter, requires the getter to be defined before the setter.
+* `"setBeforeGet"` if a property has both getter and setter, requires the setter to be defined before the getter.
+
+### getBeforeSet
+
+Examples of **incorrect** code for this rule with the `"getBeforeSet"` option:
+
+::: incorrect
+
+```js
+/*eslint grouped-accessor-pairs: ["error", "getBeforeSet"]*/
+
+var foo = {
+    set a(value) {
+        this.val = value;
+    },
+    get a() {
+        return this.val;
+    }
+};
+
+class Foo {
+    set a(value) {
+        this.val = value;
+    }
+    get a() {
+        return this.val;
+    }
+}
+
+const Bar = class {
+    static set a(value) {
+        this.val = value;
+    }
+    static get a() {
+        return this.val;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"getBeforeSet"` option:
+
+::: correct
+
+```js
+/*eslint grouped-accessor-pairs: ["error", "getBeforeSet"]*/
+
+var foo = {
+    get a() {
+        return this.val;
+    },
+    set a(value) {
+        this.val = value;
+    }
+};
+
+class Foo {
+    get a() {
+        return this.val;
+    }
+    set a(value) {
+        this.val = value;
+    }
+}
+
+const Bar = class {
+    static get a() {
+        return this.val;
+    }
+    static set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+### setBeforeGet
+
+Examples of **incorrect** code for this rule with the `"setBeforeGet"` option:
+
+::: incorrect
+
+```js
+/*eslint grouped-accessor-pairs: ["error", "setBeforeGet"]*/
+
+var foo = {
+    get a() {
+        return this.val;
+    },
+    set a(value) {
+        this.val = value;
+    }
+};
+
+class Foo {
+    get a() {
+        return this.val;
+    }
+    set a(value) {
+        this.val = value;
+    }
+}
+
+const Bar = class {
+    static get a() {
+        return this.val;
+    }
+    static set a(value) {
+        this.val = value;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"setBeforeGet"` option:
+
+::: correct
+
+```js
+/*eslint grouped-accessor-pairs: ["error", "setBeforeGet"]*/
+
+var foo = {
+    set a(value) {
+        this.val = value;
+    },
+    get a() {
+        return this.val;
+    }
+};
+
+class Foo {
+    set a(value) {
+        this.val = value;
+    }
+    get a() {
+        return this.val;
+    }
+}
+
+const Bar = class {
+    static set a(value) {
+        this.val = value;
+    }
+    static get a() {
+        return this.val;
+    }
+}
+```
+
+:::
+
+## Known Limitations
+
+Due to the limits of static analysis, this rule does not account for possible side effects and in certain cases
+might require or miss to require grouping or order for getters/setters that have a computed key, like in the following example:
+
+```js
+/*eslint grouped-accessor-pairs: "error"*/
+
+var a = 1;
+
+// false warning (false positive)
+var foo = {
+    get [a++]() {
+        return this.val;
+    },
+    b: 1,
+    set [a++](value) {
+        this.val = value;
+    }
+};
+
+// missed warning (false negative)
+var bar = {
+    get [++a]() {
+        return this.val;
+    },
+    b: 1,
+    set [a](value) {
+        this.val = value;
+    }
+};
+```
+
+Also, this rule does not report any warnings for properties that have duplicate getters or setters.
+
+See [no-dupe-keys](no-dupe-keys) if you also want to disallow duplicate keys in object literals.
+
+See [no-dupe-class-members](no-dupe-class-members) if you also want to disallow duplicate names in class definitions.
diff --git a/eslint/docs/src/rules/guard-for-in.md b/eslint/docs/src/rules/guard-for-in.md
new file mode 100644 (file)
index 0000000..c6cdbab
--- /dev/null
@@ -0,0 +1,61 @@
+---
+title: guard-for-in
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-prototype-builtins
+further_reading:
+- https://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/
+- https://2ality.com/2012/01/objects-as-maps.html
+---
+
+
+Looping over objects with a `for in` loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.
+
+```js
+for (key in foo) {
+    doSomething(key);
+}
+```
+
+Note that simply checking `foo.hasOwnProperty(key)` is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins).
+
+## Rule Details
+
+This rule is aimed at preventing unexpected behavior that could arise from using a `for in` loop without filtering the results in the loop. As such, it will warn when `for in` loops do not filter their results with an `if` statement.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint guard-for-in: "error"*/
+
+for (key in foo) {
+    doSomething(key);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint guard-for-in: "error"*/
+
+for (key in foo) {
+    if (Object.prototype.hasOwnProperty.call(foo, key)) {
+        doSomething(key);
+    }
+}
+
+for (key in foo) {
+    if ({}.hasOwnProperty.call(foo, key)) {
+        doSomething(key);
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/handle-callback-err.md b/eslint/docs/src/rules/handle-callback-err.md
new file mode 100644 (file)
index 0000000..4f4b8c9
--- /dev/null
@@ -0,0 +1,98 @@
+---
+title: handle-callback-err
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://github.com/maxogden/art-of-node#callbacks
+- https://web.archive.org/web/20171224042620/https://docs.nodejitsu.com/articles/errors/what-are-the-error-conventions/
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In Node.js, a common pattern for dealing with asynchronous behavior is called the callback pattern.
+This pattern expects an `Error` object or `null` as the first argument of the callback.
+Forgetting to handle these errors can lead to some really strange behavior in your application.
+
+```js
+function loadData (err, data) {
+    doSomething(); // forgot to handle error
+}
+```
+
+## Rule Details
+
+This rule expects that when you're using the callback pattern in Node.js you'll handle the error.
+
+## Options
+
+The rule takes a single string option: the name of the error parameter. The default is `"err"`.
+
+Examples of **incorrect** code for this rule with the default `"err"` parameter name:
+
+::: incorrect
+
+```js
+/*eslint handle-callback-err: "error"*/
+
+function loadData (err, data) {
+    doSomething();
+}
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"err"` parameter name:
+
+::: correct
+
+```js
+/*eslint handle-callback-err: "error"*/
+
+function loadData (err, data) {
+    if (err) {
+        console.log(err.stack);
+    }
+    doSomething();
+}
+
+function generateError (err) {
+    if (err) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with a sample `"error"` parameter name:
+
+::: correct
+
+```js
+/*eslint handle-callback-err: ["error", "error"]*/
+
+function loadData (error, data) {
+    if (error) {
+       console.log(error.stack);
+    }
+    doSomething();
+}
+```
+
+:::
+
+### regular expression
+
+Sometimes (especially in big projects) the name of the error variable is not consistent across the project,
+so you need a more flexible configuration to ensure that the rule reports all unhandled errors.
+
+If the configured name of the error variable begins with a `^` it is considered to be a regexp pattern.
+
+* If the option is `"^(err|error|anySpecificError)$"`, the rule reports unhandled errors where the parameter name can be `err`, `error` or `anySpecificError`.
+* If the option is `"^.+Error$"`, the rule reports unhandled errors where the parameter name ends with `Error` (for example, `connectionError` or `validationError` will match).
+* If the option is `"^.*(e|E)rr"`, the rule reports unhandled errors where the parameter name matches any string that contains `err` or `Err` (for example, `err`, `error`, `anyError`, `some_err` will match).
+
+## When Not To Use It
+
+There are cases where it may be safe for your application to ignore errors, however only ignore errors if you are
+confident that some other form of monitoring will help you catch the problem.
diff --git a/eslint/docs/src/rules/id-blacklist.md b/eslint/docs/src/rules/id-blacklist.md
new file mode 100644 (file)
index 0000000..267eece
--- /dev/null
@@ -0,0 +1,8 @@
+---
+title: id-blacklist
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.5.0 and replaced by the [id-denylist](id-denylist) rule.
diff --git a/eslint/docs/src/rules/id-denylist.md b/eslint/docs/src/rules/id-denylist.md
new file mode 100644 (file)
index 0000000..271d2a3
--- /dev/null
@@ -0,0 +1,131 @@
+---
+title: id-denylist
+layout: doc
+rule_type: suggestion
+---
+
+
+> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
+
+Generic names can lead to hard-to-decipher code. This rule allows you to specify a deny list of disallowed identifier names to avoid this practice.
+
+## Rule Details
+
+This rule disallows specified identifiers in assignments and `function` definitions.
+
+This rule will catch disallowed identifiers that are:
+
+* variable declarations
+* function declarations
+* object properties assigned to during object creation
+* class fields
+* class methods
+
+It will not catch disallowed identifiers that are:
+
+* function calls (so you can still use functions you do not have control over)
+* object properties (so you can still use objects you do not have control over)
+
+## Options
+
+The rule takes one or more strings as options: the names of restricted identifiers.
+
+For example, to restrict the use of common generic identifiers:
+
+```json
+{
+    "id-denylist": ["error", "data", "err", "e", "cb", "callback"]
+}
+```
+
+**Note:** The first element of the array is for the rule severity (see [configuring rules](/docs/latest/user-guide/configuring/rules). The other elements in the array are the identifiers that you want to disallow.
+
+Examples of **incorrect** code for this rule with sample `"data", "callback"` restricted identifiers:
+
+::: incorrect
+
+```js
+/*eslint id-denylist: ["error", "data", "callback"] */
+
+var data = {...};
+
+function callback() {
+    // ...
+}
+
+element.callback = function() {
+    // ...
+};
+
+var itemSet = {
+    data: [...]
+};
+
+class Foo {
+    data = [];
+}
+
+class Foo {
+    #data = [];
+}
+
+class Foo {
+    callback( {);
+}
+
+class Foo {
+    #callback( {);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with sample `"data", "callback"` restricted identifiers:
+
+::: correct
+
+```js
+/*eslint id-denylist: ["error", "data", "callback"] */
+
+var encodingOptions = {...};
+
+function processFileResult() {
+    // ...
+}
+
+element.successHandler = function() {
+    // ...
+};
+
+var itemSet = {
+    entities: [...]
+};
+
+callback(); // all function calls are ignored
+
+foo.callback(); // all function calls are ignored
+
+foo.data; // all property names that are not assignments are ignored
+
+class Foo {
+    items = [];
+}
+
+class Foo {
+    #items = [];
+}
+
+class Foo {
+    method( {);
+}
+
+class Foo {
+    #method( {);
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you do not want to restrict the use of certain identifiers.
diff --git a/eslint/docs/src/rules/id-length.md b/eslint/docs/src/rules/id-length.md
new file mode 100644 (file)
index 0000000..fb69db1
--- /dev/null
@@ -0,0 +1,294 @@
+---
+title: id-length
+layout: doc
+rule_type: suggestion
+related_rules:
+- max-len
+- new-cap
+- func-names
+- camelcase
+---
+
+
+Very short identifier names like `e`, `x`, `_t` or very long ones like `hashGeneratorResultOutputContainerObject` can make code harder to read and potentially less maintainable. To prevent this, one may enforce a minimum and/or maximum identifier length.
+
+```js
+var x = 5; // too short; difficult to understand its purpose without context
+```
+
+## Rule Details
+
+This rule enforces a minimum and/or maximum identifier length convention.
+
+## Options
+
+Examples of **incorrect** code for this rule with the default options:
+
+::: incorrect
+
+```js
+/*eslint id-length: "error"*/     // default is minimum 2-chars ({ "min": 2 })
+/*eslint-env es6*/
+
+var x = 5;
+obj.e = document.body;
+var foo = function (e) { };
+try {
+    dangerousStuff();
+} catch (e) {
+    // ignore as many do
+}
+var myObj = { a: 1 };
+(a) => { a * a };
+class x { }
+class Foo { x() {} }
+class Foo { #x() {} }
+class Foo { x = 1 }
+class Foo { #x = 1 }
+function foo(...x) { }
+function foo([x]) { }
+var [x] = arr;
+var { prop: [x]} = {};
+function foo({x}) { }
+var { x } = {};
+var { prop: a} = {};
+({ prop: obj.x } = {});
+```
+
+:::
+
+Examples of **correct** code for this rule with the default options:
+
+::: correct
+
+```js
+/*eslint id-length: "error"*/     // default is minimum 2-chars ({ "min": 2 })
+/*eslint-env es6*/
+
+var num = 5;
+function _f() { return 42; }
+function _func() { return 42; }
+obj.el = document.body;
+var foo = function (evt) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (error) {
+    // ignore as many do
+}
+var myObj = { apple: 1 };
+(num) => { num * num };
+function foo(num = 0) { }
+class MyClass { }
+class Foo { method() {} }
+class Foo { #method() {} }
+class Foo { field = 1 }
+class Foo { #field = 1 }
+function foo(...args) { }
+function foo([longName]) { }
+var { prop } = {};
+var { prop: [longName] } = {};
+var [longName] = arr;
+function foo({ prop }) { }
+function foo({ a: prop }) { }
+var { prop } = {};
+var { a: prop } = {};
+({ prop: obj.longName } = {});
+var data = { "x": 1 };  // excused because of quotes
+data["y"] = 3;  // excused because of calculated property access
+```
+
+:::
+
+This rule has an object option:
+
+* `"min"` (default: 2) enforces a minimum identifier length
+* `"max"` (default: Infinity) enforces a maximum identifier length
+* `"properties": always` (default) enforces identifier length convention for property names
+* `"properties": never` ignores identifier length convention for property names
+* `"exceptions"` allows an array of specified identifier names
+* `"exceptionPatterns"` array of strings representing regular expression patterns, allows identifiers that match any of the patterns.
+
+### min
+
+Examples of **incorrect** code for this rule with the `{ "min": 4 }` option:
+
+::: incorrect
+
+```js
+/*eslint id-length: ["error", { "min": 4 }]*/
+/*eslint-env es6*/
+
+var val = 5;
+obj.e = document.body;
+function foo (e) { };
+try {
+    dangerousStuff();
+} catch (e) {
+    // ignore as many do
+}
+var myObj = { a: 1 };
+(val) => { val * val };
+class x { }
+class Foo { x() {} }
+function foo(...x) { }
+var { x } = {};
+var { prop: a} = {};
+var [x] = arr;
+var { prop: [x]} = {};
+({ prop: obj.x } = {});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "min": 4 }` option:
+
+::: correct
+
+```js
+/*eslint id-length: ["error", { "min": 4 }]*/
+/*eslint-env es6*/
+
+var value = 5;
+function func() { return 42; }
+obj.element = document.body;
+var foobar = function (event) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (error) {
+    // ignore as many do
+}
+var myObj = { apple: 1 };
+(value) => { value * value };
+function foobar(value = 0) { }
+class MyClass { }
+class Foobar { method() {} }
+function foobar(...args) { }
+var { prop } = {};
+var [longName] = foo;
+var { a: [prop] } = {};
+var { a: longName } = {};
+({ prop: obj.name } = {});
+var data = { "x": 1 };  // excused because of quotes
+data["y"] = 3;  // excused because of calculated property access
+```
+
+:::
+
+### max
+
+Examples of **incorrect** code for this rule with the `{ "max": 10 }` option:
+
+::: incorrect
+
+```js
+/*eslint id-length: ["error", { "max": 10 }]*/
+/*eslint-env es6*/
+
+var reallyLongVarName = 5;
+function reallyLongFuncName() { return 42; }
+obj.reallyLongPropName = document.body;
+var foo = function (reallyLongArgName) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (reallyLongErrorName) {
+    // ignore as many do
+}
+(reallyLongArgName) => { return !reallyLongArgName; };
+var [reallyLongFirstElementName] = arr;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "max": 10 }` option:
+
+::: correct
+
+```js
+/*eslint id-length: ["error", { "max": 10 }]*/
+/*eslint-env es6*/
+
+var varName = 5;
+function funcName() { return 42; }
+obj.propName = document.body;
+var foo = function (arg) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (error) {
+    // ignore as many do
+}
+(arg) => { return !arg; };
+var [first] = arr;
+```
+
+:::
+
+### properties
+
+Examples of **correct** code for this rule with the `{ "properties": "never" }` option:
+
+::: correct
+
+```js
+/*eslint id-length: ["error", { "properties": "never" }]*/
+/*eslint-env es6*/
+
+var myObj = { a: 1 };
+({ a: obj.x.y.z } = {});
+({ prop: obj.i } = {});
+```
+
+:::
+
+### exceptions
+
+Examples of additional **correct** code for this rule with the `{ "exceptions": ["x"] }` option:
+
+::: correct
+
+```js
+/*eslint id-length: ["error", { "exceptions": ["x"] }]*/
+/*eslint-env es6*/
+
+var x = 5;
+function x() { return 42; }
+obj.x = document.body;
+var foo = function (x) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (x) {
+    // ignore as many do
+}
+(x) => { return x * x; };
+var [x] = arr;
+const { x } = foo;
+const { a: x } = foo;
+```
+
+:::
+
+### exceptionPatterns
+
+Examples of additional **correct** code for this rule with the `{ "exceptionPatterns": ["E|S", "[x-z]"] }` option:
+
+::: correct
+
+```js
+/*eslint id-length: ["error", { "exceptionPatterns": ["E|S", "[x-z]"] }]*/
+/*eslint-env es6*/
+
+var E = 5;
+function S() { return 42; }
+obj.x = document.body;
+var foo = function (x) { /* do stuff */ };
+try {
+    dangerousStuff();
+} catch (x) {
+    // ignore as many do
+}
+(y) => {return  y * y};
+var [E] = arr;
+const { y } = foo;
+const { a: z } = foo;
+```
+
+:::
diff --git a/eslint/docs/src/rules/id-match.md b/eslint/docs/src/rules/id-match.md
new file mode 100644 (file)
index 0000000..8e4bea9
--- /dev/null
@@ -0,0 +1,208 @@
+---
+title: id-match
+layout: doc
+rule_type: suggestion
+---
+
+
+> "There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton
+
+Naming things consistently in a project is an often underestimated aspect of code creation.
+When done correctly, it can save your team hours of unnecessary head scratching and misdirections.
+This rule allows you to precisely define and enforce the variables and function names on your team should use.
+No more limiting yourself to camelCase, snake_case, PascalCase or oHungarianNotation. Id-match has all your needs covered!
+
+## Rule Details
+
+This rule requires identifiers in assignments and `function` definitions to match a specified regular expression.
+
+## Options
+
+This rule has a string option for the specified regular expression.
+
+For example, to enforce a camelcase naming convention:
+
+```json
+{
+    "id-match": ["error", "^[a-z]+([A-Z][a-z]+)*$"]
+}
+```
+
+Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option:
+
+::: incorrect
+
+```js
+/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/
+
+var my_favorite_color = "#112C85";
+var _myFavoriteColor  = "#112C85";
+var myFavoriteColor_  = "#112C85";
+var MY_FAVORITE_COLOR = "#112C85";
+function do_something() {
+    // ...
+}
+
+obj.do_something = function() {
+    // ...
+};
+
+class My_Class {}
+
+class myClass {
+    do_something() {}
+}
+
+class myClass {
+    #do_something() {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$"` option:
+
+::: correct
+
+```js
+/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$"]*/
+
+var myFavoriteColor   = "#112C85";
+var foo = bar.baz_boom;
+var foo = { qux: bar.baz_boom };
+do_something();
+var obj = {
+    my_pref: 1
+};
+
+class myClass {}
+
+class myClass {
+    doSomething() {}
+}
+
+class myClass {
+    #doSomething() {}
+}
+```
+
+:::
+
+This rule has an object option:
+
+* `"properties": false` (default) does not check object properties
+* `"properties": true` requires object literal properties and member expression assignment properties to match the specified regular expression
+* `"classFields": false` (default) does not class field names
+* `"classFields": true` requires class field names to match the specified regular expression
+* `"onlyDeclarations": false` (default) requires all variable names to match the specified regular expression
+* `"onlyDeclarations": true` requires only `var`, `function`, and `class` declarations to match the specified regular expression
+* `"ignoreDestructuring": false` (default) enforces `id-match` for destructured identifiers
+* `"ignoreDestructuring": true` does not check destructured identifiers
+
+### properties
+
+Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "properties": true }` options:
+
+::: incorrect
+
+```js
+/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$", { "properties": true }]*/
+
+var obj = {
+    my_pref: 1
+};
+```
+
+:::
+
+### classFields
+
+Examples of **incorrect** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "classFields": true }` options:
+
+::: incorrect
+
+```js
+/*eslint id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$", { "properties": true }]*/
+
+class myClass {
+    my_pref = 1;
+}
+
+class myClass {
+    #my_pref = 1;
+}
+```
+
+:::
+
+### onlyDeclarations
+
+Examples of **correct** code for this rule with the `"^[a-z]+([A-Z][a-z]+)*$", { "onlyDeclarations": true }` options:
+
+::: correct
+
+```js
+/*eslint id-match: [2, "^[a-z]+([A-Z][a-z]+)*$", { "onlyDeclarations": true }]*/
+
+do_something(__dirname);
+```
+
+:::
+
+### ignoreDestructuring: false
+
+Examples of **incorrect** code for this rule with the default `"^[^_]+$", { "ignoreDestructuring": false }` option:
+
+::: incorrect
+
+```js
+/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": false }]*/
+
+var { category_id } = query;
+
+var { category_id = 1 } = query;
+
+var { category_id: category_id } = query;
+
+var { category_id: category_alias } = query;
+
+var { category_id: categoryId, ...other_props } = query;
+```
+
+:::
+
+### ignoreDestructuring: true
+
+Examples of **incorrect** code for this rule with the `"^[^_]+$", { "ignoreDestructuring": true }` option:
+
+::: incorrect
+
+```js
+/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": true }]*/
+
+var { category_id: category_alias } = query;
+
+var { category_id, ...other_props } = query;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"^[^_]+$", { "ignoreDestructuring": true }` option:
+
+::: correct
+
+```js
+/*eslint id-match: [2, "^[^_]+$", { "ignoreDestructuring": true }]*/
+
+var { category_id } = query;
+
+var { category_id = 1 } = query;
+
+var { category_id: category_id } = query;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce any particular naming convention for all identifiers, or your naming convention is too complex to be enforced by configuring this rule, then you should not enable this rule.
diff --git a/eslint/docs/src/rules/implicit-arrow-linebreak.md b/eslint/docs/src/rules/implicit-arrow-linebreak.md
new file mode 100644 (file)
index 0000000..c0d9f9f
--- /dev/null
@@ -0,0 +1,120 @@
+---
+title: implicit-arrow-linebreak
+layout: doc
+rule_type: layout
+related_rules:
+- brace-style
+---
+
+
+
+An arrow function body can contain an implicit return as an expression instead of a block body. It can be useful to enforce a consistent location for the implicitly returned expression.
+
+## Rule Details
+
+This rule aims to enforce a consistent location for an arrow function containing an implicit return.
+
+### Options
+
+This rule accepts a string option:
+
+* `"beside"` (default) disallows a newline before an arrow function body.
+* `"below"` requires a newline before an arrow function body.
+
+Examples of **incorrect** code for this rule with the default `"beside"` option:
+
+::: incorrect
+
+```js
+/* eslint implicit-arrow-linebreak: ["error", "beside"] */
+
+(foo) =>
+  bar;
+
+(foo) =>
+  (bar);
+
+(foo) =>
+  bar =>
+    baz;
+
+(foo) =>
+(
+  bar()
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"beside"` option:
+
+::: correct
+
+```js
+/* eslint implicit-arrow-linebreak: ["error", "beside"] */
+
+(foo) => bar;
+
+(foo) => (bar);
+
+(foo) => bar => baz;
+
+(foo) => (
+  bar()
+);
+
+// functions with block bodies allowed with this rule using any style
+// to enforce a consistent location for this case, see the rule: `brace-style`
+(foo) => {
+  return bar();
+}
+
+(foo) =>
+{
+  return bar();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"below"` option:
+
+::: incorrect
+
+```js
+/* eslint implicit-arrow-linebreak: ["error", "below"] */
+
+(foo) => bar;
+
+(foo) => (bar);
+
+(foo) => bar => baz;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"below"` option:
+
+::: correct
+
+```js
+/* eslint implicit-arrow-linebreak: ["error", "below"] */
+
+(foo) =>
+  bar;
+
+(foo) =>
+  (bar);
+
+(foo) =>
+  bar =>
+    baz;
+```
+
+:::
+
+## When Not To Use It
+
+If you're not concerned about consistent locations of implicitly returned arrow function expressions, you should not turn on this rule.
+
+You can also disable this rule if you are using the `"always"` option for the [`arrow-body-style`](arrow-body-style), since this will disable the use of implicit returns in arrow functions.
diff --git a/eslint/docs/src/rules/indent-legacy.md b/eslint/docs/src/rules/indent-legacy.md
new file mode 100644 (file)
index 0000000..13ca8b6
--- /dev/null
@@ -0,0 +1,674 @@
+---
+title: indent-legacy
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule was **deprecated** in ESLint v4.0.0.
+
+ESLint 4.0.0 introduced a rewrite of the [`indent`](/docs/rules/indent) rule, which now reports more errors than it did in previous versions. To ease the process of migrating to 4.0.0, the `indent-legacy` rule was introduced as a snapshot of the `indent` rule from ESLint 3.x. If your build is failing after the upgrade to 4.0.0, you can disable `indent` and enable `indent-legacy` as a quick fix. Eventually, you should switch back to the `indent` rule to get bugfixes and improvements in future versions.
+
+---
+
+There are several common guidelines which require specific indentation of nested blocks and statements, like:
+
+```js
+function hello(indentSize, type) {
+    if (indentSize === 4 && type !== 'tab') {
+        console.log('Each next indentation will increase on 4 spaces');
+    }
+}
+```
+
+These are the most common scenarios recommended in different style guides:
+
+* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix
+* Tabs: jQuery
+* Four spaces: Crockford
+
+## Rule Details
+
+This rule enforces a consistent indentation style. The default style is `4 spaces`.
+
+## Options
+
+This rule has a mixed option:
+
+For example, for 2-space indentation:
+
+```json
+{
+    "indent": ["error", 2]
+}
+```
+
+Or for tabbed indentation:
+
+```json
+{
+    "indent": ["error", "tab"]
+}
+```
+
+Examples of **incorrect** code for this rule with the default options:
+
+::: incorrect
+
+```js
+/*eslint indent: "error"*/
+
+if (a) {
+  b=c;
+  function foo(d) {
+    e=f;
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default options:
+
+::: correct
+
+```js
+/*eslint indent: "error"*/
+
+if (a) {
+    b=c;
+    function foo(d) {
+        e=f;
+    }
+}
+```
+
+:::
+
+This rule has an object option:
+
+* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements
+* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations.
+* `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs.
+* `"MemberExpression"` (off by default) enforces indentation level for multi-line property chains (except in variable declarations and assignments)
+* `"FunctionDeclaration"` takes an object to define rules for function declarations.
+    * `parameters` (off by default) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the declaration must be aligned with the first parameter.
+    * `body` (default: 1) enforces indentation level for the body of a function declaration.
+* `"FunctionExpression"` takes an object to define rules for function expressions.
+    * `parameters` (off by default) enforces indentation level for parameters in a function expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the expression must be aligned with the first parameter.
+    * `body` (default: 1) enforces indentation level for the body of a function expression.
+* `"CallExpression"` takes an object to define rules for function call expressions.
+    * `arguments` (off by default) enforces indentation level for arguments in a call expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all arguments of the expression must be aligned with the first argument.
+* `"ArrayExpression"` (default: 1) enforces indentation level for elements in arrays. It can also be set to the string `"first"`, indicating that all the elements in the array should be aligned with the first element.
+* `"ObjectExpression"` (default: 1) enforces indentation level for properties in objects. It can be set to the string `"first"`, indicating that all properties in the object should be aligned with the first property.
+
+Level of indentation denotes the multiple of the indent specified. Example:
+
+* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.
+* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.
+* Indent of 2 spaces with `VariableDeclarator` set to `{"var": 2, "let": 2, "const": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.
+* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.
+* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.
+* Indent of 2 spaces with `SwitchCase` set to `1` will indent `case` clauses with 2 spaces with respect to `switch` statements.
+* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.
+* Indent of tab with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.
+* Indent of 2 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
+* Indent of 2 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 2 spaces.
+* Indent of 2 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 4 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 4 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 8 spaces.
+
+### tab
+
+Examples of **incorrect** code for this rule with the `"tab"` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", "tab"]*/
+
+if (a) {
+     b=c;
+function foo(d) {
+           e=f;
+ }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"tab"` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", "tab"]*/
+
+if (a) {
+/*tab*/b=c;
+/*tab*/function foo(d) {
+/*tab*//*tab*/e=f;
+/*tab*/}
+}
+```
+
+:::
+
+### SwitchCase
+
+Examples of **incorrect** code for this rule with the `2, { "SwitchCase": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
+
+switch(a){
+case "a":
+    break;
+case "b":
+    break;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "SwitchCase": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
+
+switch(a){
+  case "a":
+    break;
+  case "b":
+    break;
+}
+```
+
+:::
+
+### VariableDeclarator
+
+Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+    b = 2,
+    c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
+/*eslint-env es6*/
+
+var a,
+  b,
+  c;
+let a,
+  b,
+  c;
+const a = 1,
+  b = 2,
+  c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 2 }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 2 }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+    b = 2,
+    c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+      b = 2,
+      c = 3;
+```
+
+:::
+
+### outerIIFEBody
+
+Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
+
+(function() {
+
+  function foo(x) {
+    return x + 1;
+  }
+
+})();
+
+if(y) {
+console.log('foo');
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the options `2, {"outerIIFEBody": 0}`:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
+
+(function() {
+
+function foo(x) {
+  return x + 1;
+}
+
+})();
+
+if(y) {
+   console.log('foo');
+}
+```
+
+:::
+
+### MemberExpression
+
+Examples of **incorrect** code for this rule with the `2, { "MemberExpression": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
+
+foo
+.bar
+.baz()
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "MemberExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
+
+foo
+  .bar
+  .baz();
+
+// Any indentation is permitted in variable declarations and assignments.
+var bip = aardvark.badger
+                  .coyote;
+```
+
+:::
+
+### FunctionDeclaration
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
+
+function foo(bar,
+  baz,
+  qux) {
+    qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
+
+function foo(bar,
+    baz,
+    qux) {
+  qux();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
+
+function foo(bar, baz,
+  qux, boop) {
+  qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
+
+function foo(bar, baz,
+             qux, boop) {
+  qux();
+}
+```
+
+:::
+
+### FunctionExpression
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
+
+var foo = function(bar,
+  baz,
+  qux) {
+    qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
+
+var foo = function(bar,
+    baz,
+    qux) {
+  qux();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
+
+var foo = function(bar, baz,
+  qux, boop) {
+  qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
+
+var foo = function(bar, baz,
+                   qux, boop) {
+  qux();
+}
+```
+
+:::
+
+### CallExpression
+
+Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
+
+foo(bar,
+    baz,
+      qux
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
+
+foo(bar,
+  baz,
+  qux
+);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
+
+foo(bar, baz,
+  baz, boop, beep);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
+
+foo(bar, baz,
+    baz, boop, beep);
+```
+
+:::
+
+### ArrayExpression
+
+Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": 1 }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
+
+var foo = [
+    bar,
+baz,
+      qux
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ArrayExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
+
+var foo = [
+  bar,
+  baz,
+  qux
+];
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": "first" }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
+
+var foo = [bar,
+  baz,
+  qux
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ArrayExpression": "first" }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
+
+var foo = [bar,
+           baz,
+           qux
+];
+```
+
+:::
+
+### ObjectExpression
+
+Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": 1 }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
+
+var foo = {
+    bar: 1,
+baz: 2,
+      qux: 3
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ObjectExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
+
+var foo = {
+  bar: 1,
+  baz: 2,
+  qux: 3
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": "first" }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
+
+var foo = { bar: 1,
+  baz: 2 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ObjectExpression": "first" }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
+
+var foo = { bar: 1,
+            baz: 2 };
+```
+
+:::
+
+## Compatibility
+
+* **JSHint**: `indent`
+* **JSCS**: [validateIndentation](https://jscs-dev.github.io/rule/validateIndentation)
diff --git a/eslint/docs/src/rules/indent.md b/eslint/docs/src/rules/indent.md
new file mode 100644 (file)
index 0000000..461abbe
--- /dev/null
@@ -0,0 +1,1072 @@
+---
+title: indent
+layout: doc
+rule_type: layout
+---
+
+
+
+There are several common guidelines which require specific indentation of nested blocks and statements, like:
+
+```js
+function hello(indentSize, type) {
+    if (indentSize === 4 && type !== 'tab') {
+        console.log('Each next indentation will increase on 4 spaces');
+    }
+}
+```
+
+These are the most common scenarios recommended in different style guides:
+
+* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix
+* Tabs: jQuery
+* Four spaces: Crockford
+
+## Rule Details
+
+This rule enforces a consistent indentation style. The default style is `4 spaces`.
+
+## Options
+
+This rule has a mixed option:
+
+For example, for 2-space indentation:
+
+```json
+{
+    "indent": ["error", 2]
+}
+```
+
+Or for tabbed indentation:
+
+```json
+{
+    "indent": ["error", "tab"]
+}
+```
+
+Examples of **incorrect** code for this rule with the default options:
+
+::: incorrect
+
+```js
+/*eslint indent: "error"*/
+
+if (a) {
+  b=c;
+  function foo(d) {
+    e=f;
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default options:
+
+::: correct
+
+```js
+/*eslint indent: "error"*/
+
+if (a) {
+    b=c;
+    function foo(d) {
+        e=f;
+    }
+}
+```
+
+:::
+
+This rule has an object option:
+
+* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](/docs/developer-guide/selectors). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern.
+* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements
+* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations. It can also be `"first"`, indicating all the declarators should be aligned with the first declarator.
+* `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs. This can also be set to `"off"` to disable checking for file-level IIFEs.
+* `"MemberExpression"` (default: 1) enforces indentation level for multi-line property chains. This can also be set to `"off"` to disable checking for MemberExpression indentation.
+* `"FunctionDeclaration"` takes an object to define rules for function declarations.
+    * `parameters` (default: 1) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the declaration must be aligned with the first parameter. This can also be set to `"off"` to disable checking for FunctionDeclaration parameters.
+    * `body` (default: 1) enforces indentation level for the body of a function declaration.
+* `"FunctionExpression"` takes an object to define rules for function expressions.
+    * `parameters` (default: 1) enforces indentation level for parameters in a function expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all parameters of the expression must be aligned with the first parameter. This can also be set to `"off"` to disable checking for FunctionExpression parameters.
+    * `body` (default: 1) enforces indentation level for the body of a function expression.
+* `"StaticBlock"` takes an object to define rules for class static blocks.
+    * `body` (default: 1) enforces indentation level for the body of a class static block.
+* `"CallExpression"` takes an object to define rules for function call expressions.
+    * `arguments` (default: 1) enforces indentation level for arguments in a call expression. This can either be a number indicating indentation level, or the string `"first"` indicating that all arguments of the expression must be aligned with the first argument. This can also be set to `"off"` to disable checking for CallExpression arguments.
+* `"ArrayExpression"` (default: 1) enforces indentation level for elements in arrays. It can also be set to the string `"first"`, indicating that all the elements in the array should be aligned with the first element. This can also be set to `"off"` to disable checking for array elements.
+* `"ObjectExpression"` (default: 1) enforces indentation level for properties in objects. It can be set to the string `"first"`, indicating that all properties in the object should be aligned with the first property. This can also be set to `"off"` to disable checking for object properties.
+* `"ImportDeclaration"` (default: 1) enforces indentation level for import statements. It can be set to the string `"first"`, indicating that all imported members from a module should be aligned with the first member in the list. This can also be set to `"off"` to disable checking for imported module members.
+* `"flatTernaryExpressions": true` (`false` by default) requires no indentation for ternary expressions which are nested in other ternary expressions.
+* `"offsetTernaryExpressions": true` (`false` by default) requires indentation for values of ternary expressions.
+* `"ignoreComments"` (default: false) can be used when comments do not need to be aligned with nodes on the previous or next line.
+
+Level of indentation denotes the multiple of the indent specified. Example:
+
+* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.
+* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.
+* Indent of 2 spaces with `VariableDeclarator` set to `{"var": 2, "let": 2, "const": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.
+* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.
+* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.
+* Indent of 2 spaces with `SwitchCase` set to `1` will indent `case` clauses with 2 spaces with respect to `switch` statements.
+* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.
+* Indent of tab with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.
+* Indent of 2 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
+* Indent of 2 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 2 spaces.
+* Indent of 2 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 4 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `0` will indent the multi-line property chains with 0 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `1` will indent the multi-line property chains with 4 spaces.
+* Indent of 4 spaces with `MemberExpression` set to `2` will indent the multi-line property chains with 8 spaces.
+
+### tab
+
+Examples of **incorrect** code for this rule with the `"tab"` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", "tab"]*/
+
+if (a) {
+     b=c;
+function foo(d) {
+           e=f;
+ }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"tab"` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", "tab"]*/
+
+if (a) {
+/*tab*/b=c;
+/*tab*/function foo(d) {
+/*tab*//*tab*/e=f;
+/*tab*/}
+}
+```
+
+:::
+
+### ignoredNodes
+
+The following configuration ignores the indentation of `ConditionalExpression` ("ternary expression") nodes:
+
+Examples of **correct** code for this rule with the `4, { "ignoredNodes": ["ConditionalExpression"] }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "ignoredNodes": ["ConditionalExpression"] }]*/
+
+var a = foo
+      ? bar
+      : baz;
+
+var a = foo
+                ? bar
+: baz;
+```
+
+:::
+
+The following configuration ignores indentation in the body of IIFEs.
+
+Examples of **correct** code for this rule with the `4, { "ignoredNodes": ["CallExpression > FunctionExpression.callee > BlockStatement.body"] }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "ignoredNodes": ["CallExpression > FunctionExpression.callee > BlockStatement.body"] }]*/
+
+(function() {
+
+foo();
+bar();
+
+})
+```
+
+:::
+
+All AST node types can be found at [ESTree](https://github.com/estree/estree) specification. You can use [AST Explorer](https://astexplorer.net/) with the espree parser to examine AST tree of a code snippet.
+
+### SwitchCase
+
+Examples of **incorrect** code for this rule with the `2, { "SwitchCase": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
+
+switch(a){
+case "a":
+    break;
+case "b":
+    break;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "SwitchCase": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "SwitchCase": 1 }]*/
+
+switch(a){
+  case "a":
+    break;
+  case "b":
+    break;
+}
+```
+
+:::
+
+### VariableDeclarator
+
+Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+    b = 2,
+    c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 1 }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 1 }]*/
+/*eslint-env es6*/
+
+var a,
+  b,
+  c;
+let a,
+  b,
+  c;
+const a = 1,
+  b = 2,
+  c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": 2 }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": 2 }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+    b = 2,
+    c = 3;
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "VariableDeclarator": "first" }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": "first" }]*/
+/*eslint-env es6*/
+
+var a,
+  b,
+  c;
+let a,
+  b,
+  c;
+const a = 1,
+  b = 2,
+  c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": "first" }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": "first" }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+      b = 2,
+      c = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }` options:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }]*/
+/*eslint-env es6*/
+
+var a,
+    b,
+    c;
+let a,
+    b,
+    c;
+const a = 1,
+      b = 2,
+      c = 3;
+```
+
+:::
+
+### outerIIFEBody
+
+Examples of **incorrect** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
+
+(function() {
+
+  function foo(x) {
+    return x + 1;
+  }
+
+})();
+
+if (y) {
+console.log('foo');
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the options `2, { "outerIIFEBody": 0 }`:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "outerIIFEBody": 0 }]*/
+
+(function() {
+
+function foo(x) {
+  return x + 1;
+}
+
+})();
+
+if (y) {
+   console.log('foo');
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the options `2, { "outerIIFEBody":  "off" }`:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "outerIIFEBody": "off" }]*/
+
+(function() {
+
+function foo(x) {
+  return x + 1;
+}
+
+})();
+
+(function() {
+
+  function foo(x) {
+    return x + 1;
+  }
+
+})();
+
+if (y) {
+  console.log('foo');
+}
+```
+
+:::
+
+### MemberExpression
+
+Examples of **incorrect** code for this rule with the `2, { "MemberExpression": 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
+
+foo
+.bar
+.baz()
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "MemberExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "MemberExpression": 1 }]*/
+
+foo
+  .bar
+  .baz();
+```
+
+:::
+
+### FunctionDeclaration
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
+
+function foo(bar,
+  baz,
+  qux) {
+    qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "FunctionDeclaration": {"body": 1, "parameters": 2} }]*/
+
+function foo(bar,
+    baz,
+    qux) {
+  qux();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
+
+function foo(bar, baz,
+  qux, boop) {
+  qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionDeclaration": {"parameters": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"FunctionDeclaration": {"parameters": "first"}}]*/
+
+function foo(bar, baz,
+             qux, boop) {
+  qux();
+}
+```
+
+:::
+
+### FunctionExpression
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
+
+var foo = function(bar,
+  baz,
+  qux) {
+    qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"body": 1, "parameters": 2} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "FunctionExpression": {"body": 1, "parameters": 2} }]*/
+
+var foo = function(bar,
+    baz,
+    qux) {
+  qux();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
+
+var foo = function(bar, baz,
+  qux, boop) {
+  qux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "FunctionExpression": {"parameters": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"FunctionExpression": {"parameters": "first"}}]*/
+
+var foo = function(bar, baz,
+                   qux, boop) {
+  qux();
+}
+```
+
+:::
+
+### StaticBlock
+
+Examples of **incorrect** code for this rule with the `2, { "StaticBlock": {"body": 1} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "StaticBlock": {"body": 1} }]*/
+
+class C {
+  static {
+      foo();
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "StaticBlock": {"body": 1} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "StaticBlock": {"body": 1} }]*/
+
+class C {
+  static {
+    foo();
+  }
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "StaticBlock": {"body": 2} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "StaticBlock": {"body": 2} }]*/
+
+class C {
+  static {
+    foo();
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "StaticBlock": {"body": 2} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "StaticBlock": {"body": 2} }]*/
+
+class C {
+  static {
+      foo();
+  }
+}
+```
+
+:::
+
+### CallExpression
+
+Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
+
+foo(bar,
+    baz,
+      qux
+);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": 1} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "CallExpression": {"arguments": 1} }]*/
+
+foo(bar,
+  baz,
+  qux
+);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
+
+foo(bar, baz,
+  baz, boop, beep);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "CallExpression": {"arguments": "first"} }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"CallExpression": {"arguments": "first"}}]*/
+
+foo(bar, baz,
+    baz, boop, beep);
+```
+
+:::
+
+### ArrayExpression
+
+Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": 1 }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
+
+var foo = [
+    bar,
+baz,
+      qux
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ArrayExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "ArrayExpression": 1 }]*/
+
+var foo = [
+  bar,
+  baz,
+  qux
+];
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "ArrayExpression": "first" }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
+
+var foo = [bar,
+  baz,
+  qux
+];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ArrayExpression": "first" }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"ArrayExpression": "first"}]*/
+
+var foo = [bar,
+           baz,
+           qux
+];
+```
+
+:::
+
+### ObjectExpression
+
+Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": 1 }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
+
+var foo = {
+    bar: 1,
+baz: 2,
+      qux: 3
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ObjectExpression": 1 }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "ObjectExpression": 1 }]*/
+
+var foo = {
+  bar: 1,
+  baz: 2,
+  qux: 3
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "ObjectExpression": "first" }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
+
+var foo = { bar: 1,
+  baz: 2 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "ObjectExpression": "first" }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, {"ObjectExpression": "first"}]*/
+
+var foo = { bar: 1,
+            baz: 2 };
+```
+
+:::
+
+### ImportDeclaration
+
+Examples of **correct** code for this rule with the `4, { "ImportDeclaration": 1 }` option (the default):
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "ImportDeclaration": 1 }]*/
+
+import { foo,
+    bar,
+    baz,
+} from 'qux';
+
+import {
+    foo,
+    bar,
+    baz,
+} from 'qux';
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
+
+import { foo,
+    bar,
+    baz,
+} from 'qux';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
+
+import { foo,
+         bar,
+         baz,
+} from 'qux';
+```
+
+:::
+
+### flatTernaryExpressions
+
+Examples of **incorrect** code for this rule with the default `4, { "flatTernaryExpressions": false }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 4, { "flatTernaryExpressions": false }]*/
+
+var a =
+    foo ? bar :
+    baz ? qux :
+    boop;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `4, { "flatTernaryExpressions": false }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "flatTernaryExpressions": false }]*/
+
+var a =
+    foo ? bar :
+        baz ? qux :
+            boop;
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `4, { "flatTernaryExpressions": true }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 4, { "flatTernaryExpressions": true }]*/
+
+var a =
+    foo ? bar :
+        baz ? qux :
+            boop;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `4, { "flatTernaryExpressions": true }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "flatTernaryExpressions": true }]*/
+
+var a =
+    foo ? bar :
+    baz ? qux :
+    boop;
+```
+
+:::
+
+### offsetTernaryExpressions
+
+Examples of **incorrect** code for this rule with the default `2, { "offsetTernaryExpressions": false }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "offsetTernaryExpressions": false }]*/
+
+condition
+  ? () => {
+      return true
+    }
+  : () => {
+      false
+    }
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `2, { "offsetTernaryExpressions": false }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "offsetTernaryExpressions": false }]*/
+
+condition
+  ? () => {
+    return true
+  }
+  : condition2
+    ? () => {
+      return true
+    }
+    : () => {
+      return false
+    }
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `2, { "offsetTernaryExpressions": true }` option:
+
+::: incorrect
+
+```js
+/*eslint indent: ["error", 2, { "offsetTernaryExpressions": true }]*/
+
+condition
+  ? () => {
+    return true
+  }
+  : condition2
+    ? () => {
+      return true
+    }
+    : () => {
+      return false
+    }
+```
+
+:::
+
+Examples of **correct** code for this rule with the `2, { "offsetTernaryExpressions": true }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 2, { "offsetTernaryExpressions": true }]*/
+
+condition
+  ? () => {
+      return true
+    }
+  : condition2
+    ? () => {
+        return true
+      }
+    : () => {
+        return false
+      }
+```
+
+:::
+
+### ignoreComments
+
+Examples of additional **correct** code for this rule with the `4, { "ignoreComments": true }` option:
+
+::: correct
+
+```js
+/*eslint indent: ["error", 4, { "ignoreComments": true }] */
+
+if (foo) {
+    doSomething();
+
+// comment intentionally de-indented
+    doSomethingElse();
+}
+```
+
+:::
+
+## Compatibility
+
+* **JSHint**: `indent`
+* **JSCS**: [validateIndentation](https://jscs-dev.github.io/rule/validateIndentation)
diff --git a/eslint/docs/src/rules/init-declarations.md b/eslint/docs/src/rules/init-declarations.md
new file mode 100644 (file)
index 0000000..f7612e6
--- /dev/null
@@ -0,0 +1,156 @@
+---
+title: init-declarations
+layout: doc
+rule_type: suggestion
+---
+
+
+In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, `foo` is initialized during declaration, while `bar` is initialized later.
+
+```js
+var foo = 1;
+var bar;
+
+if (foo) {
+    bar = 1;
+} else {
+    bar = 2;
+}
+```
+
+## Rule Details
+
+This rule is aimed at enforcing or eliminating variable initializations during declaration. For example, in the following code, `foo` is initialized during declaration, while `bar` is not.
+
+```js
+var foo = 1;
+var bar;
+
+bar = 2;
+```
+
+This rule aims to bring consistency to variable initializations and declarations.
+
+## Options
+
+The rule takes two options:
+
+1. A string which must be either `"always"` (the default), to enforce initialization at declaration, or `"never"` to disallow initialization during declaration. This rule applies to `var`, `let`, and `const` variables, however `"never"` is ignored for `const` variables, as unassigned `const`s generate a parse error.
+2. An object that further controls the behavior of this rule. Currently, the only available parameter is `ignoreForLoopInit`, which indicates if initialization at declaration is allowed in `for` loops when `"never"` is set, since it is a very typical use case.
+
+You can configure the rule as follows:
+
+Variables must be initialized at declaration (default)
+
+```json
+{
+    "init-declarations": ["error", "always"],
+}
+```
+
+Variables must not be initialized at declaration
+
+```json
+{
+    "init-declarations": ["error", "never"]
+}
+```
+
+Variables must not be initialized at declaration, except in for loops, where it is allowed
+
+```json
+{
+    "init-declarations": ["error", "never", { "ignoreForLoopInit": true }]
+}
+```
+
+### always
+
+Examples of **incorrect** code for the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint init-declarations: ["error", "always"]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar;
+    let baz;
+}
+```
+
+:::
+
+Examples of **correct** code for the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint init-declarations: ["error", "always"]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar = 1;
+    let baz = 2;
+    const qux = 3;
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint init-declarations: ["error", "never"]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar = 1;
+    let baz = 2;
+
+    for (var i = 0; i < 1; i++) {}
+}
+```
+
+:::
+
+Examples of **correct** code for the `"never"` option:
+
+::: correct
+
+```js
+/*eslint init-declarations: ["error", "never"]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar;
+    let baz;
+    const buzz = 1;
+}
+```
+
+:::
+
+The `"never"` option ignores `const` variable initializations.
+
+### ignoreForLoopInit
+
+Examples of **correct** code for the `"never", { "ignoreForLoopInit": true }` options:
+
+::: correct
+
+```js
+/*eslint init-declarations: ["error", "never", { "ignoreForLoopInit": true }]*/
+for (var i = 0; i < 1; i++) {}
+```
+
+:::
+
+## When Not To Use It
+
+When you are indifferent as to how your variables are initialized.
diff --git a/eslint/docs/src/rules/jsx-quotes.md b/eslint/docs/src/rules/jsx-quotes.md
new file mode 100644 (file)
index 0000000..f1af499
--- /dev/null
@@ -0,0 +1,93 @@
+---
+title: jsx-quotes
+layout: doc
+rule_type: layout
+related_rules:
+- quotes
+---
+
+
+
+JSX attribute values can contain string literals, which are delimited with single or double quotes.
+
+```xml
+<a b='c' />
+<a b="c" />
+```
+
+Unlike string literals in JavaScript, string literals within JSX attributes can’t contain escaped quotes.
+If you want to have e.g. a double quote within a JSX attribute value, you have to use single quotes as string delimiter.
+
+```xml
+<a b="'" />
+<a b='"' />
+```
+
+## Rule Details
+
+This rule enforces the consistent use of either double or single quotes in JSX attributes.
+
+## Options
+
+This rule has a string option:
+
+* `"prefer-double"` (default) enforces the use of double quotes for all JSX attribute values that don't contain a double quote.
+* `"prefer-single"` enforces the use of single quotes for all JSX attribute values that don’t contain a single quote.
+
+### prefer-double
+
+Examples of **incorrect** code for this rule with the default `"prefer-double"` option:
+
+:::incorrect
+
+```xml
+/*eslint jsx-quotes: ["error", "prefer-double"]*/
+
+<a b='c' />
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"prefer-double"` option:
+
+:::correct
+
+```xml
+/*eslint jsx-quotes: ["error", "prefer-double"]*/
+
+<a b="c" />
+<a b='"' />
+```
+
+:::
+
+### prefer-single
+
+Examples of **incorrect** code for this rule with the `"prefer-single"` option:
+
+:::incorrect
+
+```xml
+/*eslint jsx-quotes: ["error", "prefer-single"]*/
+
+<a b="c" />
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"prefer-single"` option:
+
+:::correct
+
+```xml
+/*eslint jsx-quotes: ["error", "prefer-single"]*/
+
+<a b='c' />
+<a b="'" />
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you don’t use JSX or if you aren’t concerned with a consistent usage of quotes within JSX attributes.
diff --git a/eslint/docs/src/rules/key-spacing.md b/eslint/docs/src/rules/key-spacing.md
new file mode 100644 (file)
index 0000000..4b96fc0
--- /dev/null
@@ -0,0 +1,416 @@
+---
+title: key-spacing
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal.
+
+## Rule Details
+
+This rule enforces consistent spacing between keys and values in object literal properties. In the case of long lines, it is acceptable to add a new line wherever whitespace is allowed.
+
+## Options
+
+This rule has an object option:
+
+* `"beforeColon": false (default) | true`
+    * `false`: disallows spaces between the key and the colon in object literals.
+    * `true`: requires at least one space between the key and the colon in object literals.
+* `"afterColon": true (default) | false`
+    * `true`: requires at least one space between the colon and the value in object literals.
+    * `false`: disallows spaces between the colon and the value in object literals.
+* `"mode": "strict" (default) | "minimum"`
+    * `"strict"`: enforces exactly one space before or after colons in object literals.
+    * `"minimum"`: enforces one or more spaces before or after colons in object literals.
+* `"align": "value" | "colon"`
+    * `"value"`: enforces horizontal alignment of values in object literals.
+    * `"colon"` enforces horizontal alignment of both colons and values in object literals.
+* `"align"` with an object value allows for fine-grained spacing when values are being aligned in object literals.
+* `"singleLine"` specifies a spacing style for single-line object literals.
+* `"multiLine"` specifies a spacing style for multi-line object literals.
+
+Please note that you can either use the top-level options or the grouped options (`singleLine` and `multiLine`) but not both.
+
+### beforeColon
+
+Examples of **incorrect** code for this rule with the default `{ "beforeColon": false }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "beforeColon": false }]*/
+
+var obj = { "foo" : 42 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "beforeColon": false }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "beforeColon": false }]*/
+
+var obj = { "foo": 42 };
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "beforeColon": true }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "beforeColon": true }]*/
+
+var obj = { "foo": 42 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeColon": true }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "beforeColon": true }]*/
+
+var obj = { "foo" : 42 };
+```
+
+:::
+
+### afterColon
+
+Examples of **incorrect** code for this rule with the default `{ "afterColon": true }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "afterColon": true }]*/
+
+var obj = { "foo":42 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "afterColon": true }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "afterColon": true }]*/
+
+var obj = { "foo": 42 };
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "afterColon": false }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "afterColon": false }]*/
+
+var obj = { "foo": 42 };
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterColon": false }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "afterColon": false }]*/
+
+var obj = { "foo":42 };
+```
+
+:::
+
+### mode
+
+Examples of **incorrect** code for this rule with the default `{ "mode": "strict" }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "mode": "strict" }]*/
+
+call({
+    foobar: 42,
+    bat:    2 * 2
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "mode": "strict" }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "mode": "strict" }]*/
+
+call({
+    foobar: 42,
+    bat: 2 * 2
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "mode": "minimum" }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "mode": "minimum" }]*/
+
+call({
+    foobar: 42,
+    bat:    2 * 2
+});
+```
+
+:::
+
+### align
+
+Examples of **incorrect** code for this rule with the `{ "align": "value" }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "align": "value" }]*/
+
+var obj = {
+    a: value,
+    bcde:  42,
+    fg :   foo()
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "align": "value" }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "align": "value" }]*/
+
+var obj = {
+    a:    value,
+    bcde: 42,
+
+    fg: foo(),
+    h:  function() {
+        return this.a;
+    },
+    ijkl: 'Non-consecutive lines form a new group'
+};
+
+var obj = { a: "foo", longPropertyName: "bar" };
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "align": "colon" }` option:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", { "align": "colon" }]*/
+
+call({
+    foobar: 42,
+    bat:    2 * 2
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "align": "colon" }` option:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", { "align": "colon" }]*/
+
+call({
+    foobar: 42,
+    bat   : 2 * 2
+});
+```
+
+:::
+
+### align
+
+The `align` option can take additional configuration through the `beforeColon`, `afterColon`, `mode`, and `on` options.
+
+If `align` is defined as an object, but not all of the parameters are provided, undefined parameters will default to the following:
+
+```js
+// Defaults
+align: {
+    "beforeColon": false,
+    "afterColon": true,
+    "on": "colon",
+    "mode": "strict"
+}
+```
+
+Examples of **correct** code for this rule with sample `{ "align": { } }` options:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", {
+    "align": {
+        "beforeColon": true,
+        "afterColon": true,
+        "on": "colon"
+    }
+}]*/
+
+var obj = {
+    "one"   : 1,
+    "seven" : 7
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", {
+    "align": {
+        "beforeColon": false,
+        "afterColon": false,
+        "on": "value"
+    }
+}]*/
+
+var obj = {
+    "one":  1,
+    "seven":7
+}
+```
+
+:::
+
+### align and multiLine
+
+The `multiLine` and `align` options can differ, which allows for fine-tuned control over the `key-spacing` of your files.  `align` will **not** inherit from `multiLine` if `align` is configured as an object.
+
+`multiLine` is used any time  an object literal spans multiple lines.  The `align` configuration is used when there is a group of properties in the same object. For example:
+
+```javascript
+var myObj = {
+  key1: 1, // uses multiLine
+
+  key2: 2, // uses align (when defined)
+  key3: 3, // uses align (when defined)
+
+  key4: 4 // uses multiLine
+}
+
+```
+
+Examples of **incorrect** code for this rule with sample `{ "align": { }, "multiLine": { } }` options:
+
+::: incorrect
+
+```js
+/*eslint key-spacing: ["error", {
+    "multiLine": {
+        "beforeColon": false,
+        "afterColon":true
+    },
+    "align": {
+        "beforeColon": true,
+        "afterColon": true,
+        "on": "colon"
+    }
+}]*/
+
+var obj = {
+    "myObjectFunction": function() {
+        // Do something
+    },
+    "one"             : 1,
+    "seven"           : 7
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with sample `{ "align": { }, "multiLine": { } }` options:
+
+::: correct
+
+```js
+/*eslint key-spacing: ["error", {
+    "multiLine": {
+        "beforeColon": false,
+        "afterColon": true
+
+    },
+    "align": {
+        "beforeColon": true,
+        "afterColon": true,
+        "on": "colon"
+    }
+}]*/
+
+var obj = {
+    "myObjectFunction": function() {
+        // Do something
+        //
+    }, // These are two separate groups, so no alignment between `myObjectFunction` and `one`
+    "one"   : 1,
+    "seven" : 7 // `one` and `seven` are in their own group, and therefore aligned
+}
+```
+
+:::
+
+### singleLine and multiLine
+
+Examples of **correct** code for this rule with sample `{ "singleLine": { }, "multiLine": { } }` options:
+
+::: correct
+
+```js
+/*eslint "key-spacing": [2, {
+    "singleLine": {
+        "beforeColon": false,
+        "afterColon": true
+    },
+    "multiLine": {
+        "beforeColon": true,
+        "afterColon": true,
+        "align": "colon"
+    }
+}]*/
+var obj = { one: 1, "two": 2, three: 3 };
+var obj2 = {
+    "two" : 2,
+    three : 3
+};
+```
+
+:::
+
+## When Not To Use It
+
+If you have another convention for property spacing that might not be consistent with the available options, or if you want to permit multiple styles concurrently you can safely disable this rule.
diff --git a/eslint/docs/src/rules/keyword-spacing.md b/eslint/docs/src/rules/keyword-spacing.md
new file mode 100644 (file)
index 0000000..ada2208
--- /dev/null
@@ -0,0 +1,324 @@
+---
+title: keyword-spacing
+layout: doc
+rule_type: layout
+---
+
+
+
+Keywords are syntax elements of JavaScript, such as `try` and `if`.
+These keywords have special meaning to the language and so often appear in a different color in code editors.
+As an important part of the language, style guides often refer to the spacing that should be used around keywords.
+For example, you might have a style guide that says keywords should be always surrounded by spaces, which would mean `if-else` statements must look like this:
+
+```js
+if (foo) {
+    // ...
+} else {
+    // ...
+}
+```
+
+Of course, you could also have a style guide that disallows spaces around keywords.
+
+However, if you want to enforce the style of spacing between the `function` keyword and the following opening parenthesis, please refer to [space-before-function-paren](space-before-function-paren).
+
+## Rule Details
+
+This rule enforces consistent spacing around keywords and keyword-like tokens: `as` (in module declarations), `async` (of async functions), `await` (of await expressions), `break`, `case`, `catch`, `class`, `const`, `continue`, `debugger`, `default`, `delete`, `do`, `else`, `export`, `extends`, `finally`, `for`, `from` (in module declarations), `function`, `get` (of getters), `if`, `import`, `in` (in for-in statements), `let`, `new`, `of` (in for-of statements), `return`, `set` (of setters), `static`, `super`, `switch`, `this`, `throw`, `try`, `typeof`, `var`, `void`, `while`, `with`, and `yield`. This rule is designed carefully not to conflict with other spacing rules: it does not apply to spacing where other rules report problems.
+
+## Options
+
+This rule has an object option:
+
+* `"before": true` (default) requires at least one space before keywords
+* `"before": false` disallows spaces before keywords
+* `"after": true` (default) requires at least one space after keywords
+* `"after": false` disallows spaces after keywords
+* `"overrides"` allows overriding spacing style for specified keywords
+
+### before
+
+Examples of **incorrect** code for this rule with the default `{ "before": true }` option:
+
+::: incorrect
+
+```js
+/*eslint keyword-spacing: ["error", { "before": true }]*/
+
+if (foo) {
+    //...
+}else if (bar) {
+    //...
+}else {
+    //...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "before": true }` option:
+
+::: correct
+
+```js
+/*eslint keyword-spacing: ["error", { "before": true }]*/
+/*eslint-env es6*/
+
+if (foo) {
+    //...
+} else if (bar) {
+    //...
+} else {
+    //...
+}
+
+// Avoid conflict with `array-bracket-spacing`
+let a = [this];
+let b = [function() {}];
+
+// Avoid conflict with `arrow-spacing`
+let a = ()=> this.foo;
+
+// Avoid conflict with `block-spacing`
+{function foo() {}}
+
+// Avoid conflict with `comma-spacing`
+let a = [100,this.foo, this.bar];
+
+// Avoid conflict with `computed-property-spacing`
+obj[this.foo] = 0;
+
+// Avoid conflict with `generator-star-spacing`
+function *foo() {}
+
+// Avoid conflict with `key-spacing`
+let obj = {
+    foo:function() {}
+};
+
+// Avoid conflict with `object-curly-spacing`
+let obj = {foo: this};
+
+// Avoid conflict with `semi-spacing`
+let a = this;function foo() {}
+
+// Avoid conflict with `space-in-parens`
+(function () {})();
+
+// Avoid conflict with `space-infix-ops`
+if ("foo"in {foo: 0}) {}
+if (10+this.foo<= this.bar) {}
+
+// Avoid conflict with `jsx-curly-spacing`
+let a = <A foo={this.foo} bar={function(){}} />
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "before": false }` option:
+
+::: incorrect
+
+```js
+/*eslint keyword-spacing: ["error", { "before": false }]*/
+
+if (foo) {
+    //...
+} else if (bar) {
+    //...
+} else {
+    //...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": false }` option:
+
+::: correct
+
+```js
+/*eslint keyword-spacing: ["error", { "before": false }]*/
+
+if (foo) {
+    //...
+}else if (bar) {
+    //...
+}else {
+    //...
+}
+```
+
+:::
+
+### after
+
+Examples of **incorrect** code for this rule with the default `{ "after": true }` option:
+
+::: incorrect
+
+```js
+/*eslint keyword-spacing: ["error", { "after": true }]*/
+
+if(foo) {
+    //...
+} else if(bar) {
+    //...
+} else{
+    //...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "after": true }` option:
+
+::: correct
+
+```js
+/*eslint keyword-spacing: ["error", { "after": true }]*/
+
+if (foo) {
+    //...
+} else if (bar) {
+    //...
+} else {
+    //...
+}
+
+// Avoid conflict with `array-bracket-spacing`
+let a = [this];
+
+// Avoid conflict with `arrow-spacing`
+let a = ()=> this.foo;
+
+// Avoid conflict with `comma-spacing`
+let a = [100, this.foo, this.bar];
+
+// Avoid conflict with `computed-property-spacing`
+obj[this.foo] = 0;
+
+// Avoid conflict with `generator-star-spacing`
+function* foo() {}
+
+// Avoid conflict with `key-spacing`
+let obj = {
+    foo:function() {}
+};
+
+// Avoid conflict with `func-call-spacing`
+class A {
+    constructor() {
+        super();
+    }
+}
+
+// Avoid conflict with `object-curly-spacing`
+let obj = {foo: this};
+
+// Avoid conflict with `semi-spacing`
+let a = this;function foo() {}
+
+// Avoid conflict with `space-before-function-paren`
+function() {}
+
+// Avoid conflict with `space-infix-ops`
+if ("foo"in{foo: 0}) {}
+if (10+this.foo<= this.bar) {}
+
+// Avoid conflict with `space-unary-ops`
+function* foo(a) {
+    return yield+a;
+}
+
+// Avoid conflict with `yield-star-spacing`
+function* foo(a) {
+    return yield* a;
+}
+
+// Avoid conflict with `jsx-curly-spacing`
+let a = <A foo={this.foo} bar={function(){}} />
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "after": false }` option:
+
+::: incorrect
+
+```js
+/*eslint keyword-spacing: ["error", { "after": false }]*/
+
+if (foo) {
+    //...
+} else if (bar) {
+    //...
+} else {
+    //...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "after": false }` option:
+
+::: correct
+
+```js
+/*eslint keyword-spacing: ["error", { "after": false }]*/
+
+if(foo) {
+    //...
+} else if(bar) {
+    //...
+} else{
+    //...
+}
+```
+
+:::
+
+### overrides
+
+Examples of **correct** code for this rule with the `{ "overrides": { "if": { "after": false }, "for": { "after": false }, "while": { "after": false }, "static": { "after": false }, "as": { "after": false } } }` option:
+
+::: correct
+
+```js
+/*eslint keyword-spacing: ["error", { "overrides": {
+  "if": { "after": false },
+  "for": { "after": false },
+  "while": { "after": false },
+  "static": { "after": false },
+  "as": { "after": false }
+} }]*/
+
+if(foo) {
+    //...
+} else if(bar) {
+    //...
+} else {
+    //...
+}
+
+for(;;);
+
+while(true) {
+    //...
+}
+
+class C {
+    static{
+        //...
+    }
+}
+
+export { C as"my class" };
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce consistency on keyword spacing, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/line-comment-position.md b/eslint/docs/src/rules/line-comment-position.md
new file mode 100644 (file)
index 0000000..21c8b68
--- /dev/null
@@ -0,0 +1,140 @@
+---
+title: line-comment-position
+layout: doc
+rule_type: layout
+---
+
+
+Line comments can be positioned above or beside code. This rule helps teams maintain a consistent style.
+
+```js
+// above comment
+var foo = "bar";  // beside comment
+```
+
+## Rule Details
+
+This rule enforces consistent position of line comments. Block comments are not affected by this rule. By default, this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`, `falls through`.
+
+## Options
+
+This rule takes one argument, which can be a string or an object. The string settings are the same as those of the `position` property (explained below). The object option has the following properties:
+
+### position
+
+The `position` option has two settings:
+
+* `above` (default) enforces line comments only above code, in its own line.
+* `beside` enforces line comments only at the end of code lines.
+
+#### position: above
+
+Examples of **correct** code for the `{ "position": "above" }` option:
+
+::: correct
+
+```js
+/*eslint line-comment-position: ["error", { "position": "above" }]*/
+// valid comment
+1 + 1;
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "position": "above" }` option:
+
+::: incorrect
+
+```js
+/*eslint line-comment-position: ["error", { "position": "above" }]*/
+1 + 1; // invalid comment
+```
+
+:::
+
+#### position: beside
+
+Examples of **correct** code for the `{ "position": "beside" }` option:
+
+::: correct
+
+```js
+/*eslint line-comment-position: ["error", { "position": "beside" }]*/
+1 + 1; // valid comment
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "position": "beside" }` option:
+
+::: incorrect
+
+```js
+/*eslint line-comment-position: ["error", { "position": "beside" }]*/
+// invalid comment
+1 + 1;
+```
+
+:::
+
+### ignorePattern
+
+By default this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`, `falls through`. An alternative regular expression can be provided.
+
+Examples of **correct** code for the `ignorePattern` option:
+
+::: correct
+
+```js
+/*eslint line-comment-position: ["error", { "ignorePattern": "pragma" }]*/
+1 + 1; // pragma valid comment
+```
+
+:::
+
+Examples of **incorrect** code for the `ignorePattern` option:
+
+::: incorrect
+
+```js
+/*eslint line-comment-position: ["error", { "ignorePattern": "pragma" }]*/
+1 + 1; // invalid comment
+```
+
+:::
+
+### applyDefaultIgnorePatterns
+
+Default ignore patterns are applied even when `ignorePattern` is provided. If you want to omit default patterns, set this option to `false`.
+
+Examples of **correct** code for the `{ "applyDefaultIgnorePatterns": false }` option:
+
+::: correct
+
+```js
+/*eslint line-comment-position: ["error", { "ignorePattern": "pragma", "applyDefaultIgnorePatterns": false }]*/
+1 + 1; // pragma valid comment
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "applyDefaultIgnorePatterns": false }` option:
+
+::: incorrect
+
+```js
+/*eslint line-comment-position: ["error", { "ignorePattern": "pragma", "applyDefaultIgnorePatterns": false }]*/
+1 + 1; // falls through
+```
+
+:::
+
+**Deprecated:** the object property `applyDefaultPatterns` is deprecated. Please use the property `applyDefaultIgnorePatterns` instead.
+
+## When Not To Use It
+
+If you aren't concerned about having different line comment styles, then you can turn off this rule.
+
+## Compatibility
+
+**JSCS**: [validateCommentPosition](https://jscs-dev.github.io/rule/validateCommentPosition)
diff --git a/eslint/docs/src/rules/linebreak-style.md b/eslint/docs/src/rules/linebreak-style.md
new file mode 100644 (file)
index 0000000..8e97515
--- /dev/null
@@ -0,0 +1,107 @@
+---
+title: linebreak-style
+layout: doc
+rule_type: layout
+---
+
+
+
+When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that
+different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).
+
+The linebreaks (new lines) used in windows operating system are usually _carriage returns_ (CR) followed by a _line feed_ (LF) making it a _carriage return line feed_ (CRLF)
+whereas Linux and Unix use a simple _line feed_ (LF). The corresponding _control sequences_ are `"\n"` (for LF) and `"\r\n"` for (CRLF).
+
+Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies, you can activate this rule.
+
+## Rule Details
+
+This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
+
+### Options
+
+This rule has a string option:
+
+* `"unix"` (default) enforces the usage of Unix line endings: `\n` for LF.
+* `"windows"` enforces the usage of Windows line endings: `\r\n` for CRLF.
+
+### unix
+
+Examples of **incorrect** code for this rule with the default `"unix"` option:
+
+::: incorrect
+
+```js
+/*eslint linebreak-style: ["error", "unix"]*/
+
+var a = 'a'; // \r\n
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"unix"` option:
+
+::: correct
+
+```js
+/*eslint linebreak-style: ["error", "unix"]*/
+
+var a = 'a', // \n
+    b = 'b'; // \n
+// \n
+function foo(params) { // \n
+    // do stuff \n
+}// \n
+```
+
+:::
+
+### windows
+
+Examples of **incorrect** code for this rule with the `"windows"` option:
+
+::: incorrect
+
+```js
+/*eslint linebreak-style: ["error", "windows"]*/
+
+var a = 'a'; // \n
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"windows"` option:
+
+::: correct
+
+```js
+/*eslint linebreak-style: ["error", "windows"]*/
+
+var a = 'a', // \r\n
+    b = 'b'; // \r\n
+// \r\n
+function foo(params) { // \r\n
+    // do stuff \r\n
+} // \r\n
+```
+
+:::
+
+### Using this rule with version control systems
+
+Version control systems sometimes have special behavior for linebreaks. To make it easy for developers to contribute to your codebase from different platforms, you may want to configure your VCS to handle linebreaks appropriately.
+
+For example, the default behavior of [git](https://git-scm.com/) on Windows systems is to convert LF linebreaks to CRLF when checking out files, but to store the linebreaks as LF when committing a change. This will cause the `linebreak-style` rule to report errors if configured with the `"unix"` setting, because the files that ESLint sees will have CRLF linebreaks. If you use git, you may want to add a line to your [`.gitattributes` file](https://git-scm.com/docs/gitattributes) to prevent git from converting linebreaks in `.js` files:
+
+```txt
+*.js text eol=lf
+```
+
+## When Not To Use It
+
+If you aren't concerned about having different line endings within your code, then you can safely turn this rule off.
+
+## Compatibility
+
+* **JSCS**: [validateLineBreaks](https://jscs-dev.github.io/rule/validateLineBreaks)
diff --git a/eslint/docs/src/rules/lines-around-comment.md b/eslint/docs/src/rules/lines-around-comment.md
new file mode 100644 (file)
index 0000000..472b61b
--- /dev/null
@@ -0,0 +1,723 @@
+---
+title: lines-around-comment
+layout: doc
+rule_type: layout
+related_rules:
+- space-before-blocks
+- spaced-comment
+---
+
+
+
+Many style guides require empty lines before or after comments. The primary goal
+of these rules is to make the comments easier to read and improve readability of the code.
+
+## Rule Details
+
+This rule requires empty lines before and/or after comments. It can be enabled separately for both block (`/*`) and line (`//`) comments. This rule does not apply to comments that appear on the same line as code and does not require empty lines at the beginning or end of a file.
+
+## Options
+
+This rule has an object option:
+
+* `"beforeBlockComment": true` (default) requires an empty line before block comments
+* `"afterBlockComment": true` requires an empty line after block comments
+* `"beforeLineComment": true` requires an empty line before line comments
+* `"afterLineComment": true` requires an empty line after line comments
+* `"allowBlockStart": true` allows comments to appear at the start of block statements, function bodies, classes, switch statements, and class static blocks
+* `"allowBlockEnd": true` allows comments to appear at the end of block statements, function bodies, classes, switch statements, and class static blocks
+* `"allowObjectStart": true` allows comments to appear at the start of object literals
+* `"allowObjectEnd": true` allows comments to appear at the end of object literals
+* `"allowArrayStart": true` allows comments to appear at the start of array literals
+* `"allowArrayEnd": true` allows comments to appear at the end of array literals
+* `"allowClassStart": true` allows comments to appear at the start of classes
+* `"allowClassEnd": true` allows comments to appear at the end of classes
+* `"applyDefaultIgnorePatterns"` enables or disables the default comment patterns to be ignored by the rule
+* `"ignorePattern"` custom patterns to be ignored by the rule
+
+### beforeBlockComment
+
+Examples of **incorrect** code for this rule with the default `{ "beforeBlockComment": true }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true }]*/
+
+var night = "long";
+/* what a great and wonderful day */
+var day = "great"
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "beforeBlockComment": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true }]*/
+
+var night = "long";
+
+/* what a great and wonderful day */
+var day = "great"
+```
+
+:::
+
+### afterBlockComment
+
+Examples of **incorrect** code for this rule with the `{ "afterBlockComment": true }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true }]*/
+
+var night = "long";
+
+/* what a great and wonderful day */
+var day = "great"
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterBlockComment": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true }]*/
+
+var night = "long";
+
+/* what a great and wonderful day */
+
+var day = "great"
+```
+
+:::
+
+### beforeLineComment
+
+Examples of **incorrect** code for this rule with the `{ "beforeLineComment": true }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true }]*/
+
+var night = "long";
+// what a great and wonderful day
+var day = "great"
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true }]*/
+
+var night = "long";
+
+// what a great and wonderful day
+var day = "great"
+```
+
+:::
+
+### afterLineComment
+
+Examples of **incorrect** code for this rule with the `{ "afterLineComment": true }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true }]*/
+
+var night = "long";
+// what a great and wonderful day
+var day = "great"
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterLineComment": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true }]*/
+
+var night = "long";
+// what a great and wonderful day
+
+var day = "great"
+```
+
+:::
+
+### allowBlockStart
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowBlockStart": true }` options:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowBlockStart": true }]*/
+
+function foo(){
+    // what a great and wonderful day
+    var day = "great"
+    return day;
+}
+
+if (bar) {
+    // what a great and wonderful day
+    foo();
+}
+
+class C {
+    // what a great and wonderful day
+
+    method() {
+        // what a great and wonderful day
+        foo();
+    }
+
+    static {
+        // what a great and wonderful day
+        foo();
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowBlockStart": true }` options:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowBlockStart": true }]*/
+
+function foo(){
+    /* what a great and wonderful day */
+    var day = "great"
+    return day;
+}
+
+if (bar) {
+    /* what a great and wonderful day */
+    foo();
+}
+
+class C {
+    /* what a great and wonderful day */
+
+    method() {
+        /* what a great and wonderful day */
+        foo();
+    }
+
+    static {
+        /* what a great and wonderful day */
+        foo();
+    }
+}
+
+switch (foo) {
+  /* what a great and wonderful day */
+
+  case 1:    
+    bar();
+    break;
+}
+```
+
+:::
+
+### allowBlockEnd
+
+Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowBlockEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowBlockEnd": true }]*/
+
+function foo(){
+    var day = "great"
+    return day;
+    // what a great and wonderful day
+}
+
+if (bar) {
+    foo();
+    // what a great and wonderful day
+}
+
+class C {
+
+    method() {
+        foo();
+        // what a great and wonderful day
+    }
+
+    static {
+        foo();
+        // what a great and wonderful day
+    }
+
+    // what a great and wonderful day
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowBlockEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowBlockEnd": true }]*/
+
+function foo(){
+    var day = "great"
+    return day;
+
+    /* what a great and wonderful day */
+}
+
+if (bar) {
+    foo();
+
+    /* what a great and wonderful day */
+}
+
+class C {
+
+    method() {
+        foo();
+
+        /* what a great and wonderful day */
+    }
+
+    static {
+        foo();
+
+        /* what a great and wonderful day */
+    }
+
+    /* what a great and wonderful day */
+}
+
+switch (foo) {
+  case 1:    
+    bar();
+    break;
+
+  /* what a great and wonderful day */
+}
+```
+
+:::
+
+### allowClassStart
+
+Examples of **incorrect** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": false }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": false }]*/
+
+class foo {
+    // what a great and wonderful day
+    day() {}
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": false }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": false }]*/
+
+class foo {
+
+    // what a great and wonderful day
+    day() {}
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowClassStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowClassStart": true }]*/
+
+class foo {
+    // what a great and wonderful day
+    day() {}
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": false }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": false }]*/
+
+class foo {
+    /* what a great and wonderful day */
+    day() {}
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": false }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": false }]*/
+
+class foo {
+
+    /* what a great and wonderful day */
+    day() {}
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowClassStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowClassStart": true }]*/
+
+class foo {
+    /* what a great and wonderful day */
+    day() {}
+};
+```
+
+:::
+
+### allowClassEnd
+
+Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowClassEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowClassEnd": true }]*/
+
+class foo {
+    day() {}
+    // what a great and wonderful day
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowClassEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowClassEnd": true }]*/
+
+class foo {
+    day() {}
+
+    /* what a great and wonderful day */
+};
+```
+
+:::
+
+### allowObjectStart
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowObjectStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowObjectStart": true }]*/
+
+var foo = {
+    // what a great and wonderful day
+    day: "great"
+};
+
+const {
+    // what a great and wonderful day
+    foo: someDay
+} = {foo: "great"};
+
+const {
+    // what a great and wonderful day
+    day
+} = {day: "great"};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowObjectStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowObjectStart": true }]*/
+
+var foo = {
+    /* what a great and wonderful day */
+    day: "great"
+};
+
+const {
+    /* what a great and wonderful day */
+    foo: someDay
+} = {foo: "great"};
+
+const {
+    /* what a great and wonderful day */
+    day
+} = {day: "great"};
+```
+
+:::
+
+### allowObjectEnd
+
+Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowObjectEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowObjectEnd": true }]*/
+
+var foo = {
+    day: "great"
+    // what a great and wonderful day
+};
+
+const {
+    foo: someDay
+    // what a great and wonderful day
+} = {foo: "great"};
+
+const {
+    day
+    // what a great and wonderful day
+} = {day: "great"};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowObjectEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowObjectEnd": true }]*/
+
+var foo = {
+    day: "great"
+
+    /* what a great and wonderful day */
+};
+
+const {
+    foo: someDay
+
+    /* what a great and wonderful day */
+} = {foo: "great"};
+
+const {
+    day
+
+    /* what a great and wonderful day */
+} = {day: "great"};
+```
+
+:::
+
+### allowArrayStart
+
+Examples of **correct** code for this rule with the `{ "beforeLineComment": true, "allowArrayStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeLineComment": true, "allowArrayStart": true }]*/
+
+var day = [
+    // what a great and wonderful day
+    "great",
+    "wonderful"
+];
+
+const [
+    // what a great and wonderful day
+    someDay
+] = ["great", "not great"];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "beforeBlockComment": true, "allowArrayStart": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "beforeBlockComment": true, "allowArrayStart": true }]*/
+
+var day = [
+    /* what a great and wonderful day */
+    "great",
+    "wonderful"
+];
+
+const [
+    /* what a great and wonderful day */
+    someDay
+] = ["great", "not great"];
+```
+
+:::
+
+### allowArrayEnd
+
+Examples of **correct** code for this rule with the `{ "afterLineComment": true, "allowArrayEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterLineComment": true, "allowArrayEnd": true }]*/
+
+var day = [
+    "great",
+    "wonderful"
+    // what a great and wonderful day
+];
+
+const [
+    someDay
+    // what a great and wonderful day
+] = ["great", "not great"];
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "afterBlockComment": true, "allowArrayEnd": true }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "afterBlockComment": true, "allowArrayEnd": true }]*/
+
+var day = [
+    "great",
+    "wonderful"
+
+    /* what a great and wonderful day */
+];
+
+const [
+    someDay
+
+    /* what a great and wonderful day */
+] = ["great", "not great"];
+```
+
+:::
+
+### ignorePattern
+
+By default this rule ignores comments starting with the following words: `eslint`, `jshint`, `jslint`, `istanbul`, `global`, `exported`, `jscs`. To ignore more comments in addition to the defaults, set the `ignorePattern` option to a string pattern that will be passed to the [`RegExp` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp).
+
+Examples of **correct** code for the `ignorePattern` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error"]*/
+
+foo();
+/* eslint mentioned in this comment */,
+bar();
+
+/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma" }] */
+
+foo();
+/* a valid comment using pragma in it */
+```
+
+:::
+
+Examples of **incorrect** code for the `ignorePattern` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma" }] */
+
+1 + 1;
+/* something else */
+```
+
+:::
+
+### applyDefaultIgnorePatterns
+
+Default ignore patterns are applied even when `ignorePattern` is provided. If you want to omit default patterns, set this option to `false`.
+
+Examples of **correct** code for the `{ "applyDefaultIgnorePatterns": false }` option:
+
+::: correct
+
+```js
+/*eslint lines-around-comment: ["error", { "ignorePattern": "pragma", applyDefaultIgnorePatterns: false }] */
+
+foo();
+/* a valid comment using pragma in it */
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "applyDefaultIgnorePatterns": false }` option:
+
+::: incorrect
+
+```js
+/*eslint lines-around-comment: ["error", { "applyDefaultIgnorePatterns": false }] */
+
+foo();
+/* eslint mentioned in comment */
+
+```
+
+:::
+
+## When Not To Use It
+
+Many people enjoy a terser code style and don't mind comments bumping up against code. If you fall into that category this rule is not for you.
diff --git a/eslint/docs/src/rules/lines-around-directive.md b/eslint/docs/src/rules/lines-around-directive.md
new file mode 100644 (file)
index 0000000..42133a3
--- /dev/null
@@ -0,0 +1,355 @@
+---
+title: lines-around-directive
+layout: doc
+rule_type: layout
+related_rules:
+- lines-around-comment
+- padded-blocks
+---
+
+
+
+This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements) rule.
+
+Directives are used in JavaScript to indicate to the execution environment that a script would like to opt into a feature such as `"strict mode"`. Directives are grouped together in a [directive prologue](https://www.ecma-international.org/ecma-262/7.0/#directive-prologue) at the top of either a file or function block and are applied to the scope in which they occur.
+
+```js
+// Strict mode is invoked for the entire script
+"use strict";
+
+var foo;
+
+function bar() {
+  var baz;
+}
+```
+
+```js
+var foo;
+
+function bar() {
+  // Strict mode is only invoked within this function
+  "use strict";
+
+  var baz;
+}
+```
+
+## Rule Details
+
+This rule requires or disallows blank newlines around directive prologues. This rule does not enforce any conventions about blank newlines between the individual directives. In addition, it does not require blank newlines before directive prologues unless they are preceded by a comment. Please use the [padded-blocks](padded-blocks) rule if this is a style you would like to enforce.
+
+## Options
+
+This rule has one option. It can either be a string or an object:
+
+* `"always"` (default) enforces blank newlines around directives.
+* `"never"` disallows blank newlines around directives.
+
+or
+
+```js
+{
+  "before": "always" or "never"
+  "after": "always" or "never",
+}
+```
+
+### always
+
+This is the default option.
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/* eslint lines-around-directive: ["error", "always"] */
+
+/* Top of file */
+"use strict";
+var foo;
+
+/* Top of file */
+// comment
+"use strict";
+"use asm";
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+  var bar;
+}
+
+function foo() {
+  // comment
+  "use strict";
+  var bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/* eslint lines-around-directive: ["error", "always"] */
+
+/* Top of file */
+"use strict";
+
+var foo;
+
+/* Top of file */
+// comment
+
+"use strict";
+"use asm";
+
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+
+  var bar;
+}
+
+function foo() {
+  // comment
+
+  "use strict";
+
+  var bar;
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/* eslint lines-around-directive: ["error", "never"] */
+
+/* Top of file */
+
+"use strict";
+
+var foo;
+
+/* Top of file */
+// comment
+
+"use strict";
+"use asm";
+
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+
+  var bar;
+}
+
+function foo() {
+  // comment
+
+  "use strict";
+
+  var bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/* eslint lines-around-directive: ["error", "never"] */
+
+/* Top of file */
+"use strict";
+var foo;
+
+/* Top of file */
+// comment
+"use strict";
+"use asm";
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+  var bar;
+}
+
+function foo() {
+  // comment
+  "use strict";
+  var bar;
+}
+```
+
+:::
+
+### before & after
+
+Examples of **incorrect** code for this rule with the `{ "before": "never", "after": "always" }` option:
+
+::: incorrect
+
+```js
+/* eslint lines-around-directive: ["error", { "before": "never", "after": "always" }] */
+
+/* Top of file */
+
+"use strict";
+var foo;
+
+/* Top of file */
+// comment
+
+"use strict";
+"use asm";
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+  var bar;
+}
+
+function foo() {
+  // comment
+
+  "use strict";
+  var bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": "never", "after": "always" }`  option:
+
+::: correct
+
+```js
+/* eslint lines-around-directive: ["error", { "before": "never", "after": "always" }] */
+
+/* Top of file */
+"use strict";
+
+var foo;
+
+/* Top of file */
+// comment
+"use strict";
+"use asm";
+
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+
+  var bar;
+}
+
+function foo() {
+  // comment
+  "use strict";
+
+  var bar;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "before": "always", "after": "never" }` option:
+
+::: incorrect
+
+```js
+/* eslint lines-around-directive: ["error", { "before": "always", "after": "never" }] */
+
+/* Top of file */
+"use strict";
+
+var foo;
+
+/* Top of file */
+// comment
+"use strict";
+"use asm";
+
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+
+  var bar;
+}
+
+function foo() {
+  // comment
+  "use strict";
+
+  var bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "before": "always", "after": "never" }` option:
+
+::: correct
+
+```js
+/* eslint lines-around-directive: ["error", { "before": "always", "after": "never" }] */
+
+/* Top of file */
+"use strict";
+var foo;
+
+/* Top of file */
+// comment
+
+"use strict";
+"use asm";
+var foo;
+
+function foo() {
+  "use strict";
+  "use asm";
+  var bar;
+}
+
+function foo() {
+  // comment
+
+  "use strict";
+  var bar;
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can safely disable this rule if you do not have any strict conventions about whether or not directive prologues should have blank newlines before or after them.
+
+## Compatibility
+
+* **JSCS**: [requirePaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterUseStrict)
+* **JSCS**: [disallowPaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterUseStrict)
diff --git a/eslint/docs/src/rules/lines-between-class-members.md b/eslint/docs/src/rules/lines-between-class-members.md
new file mode 100644 (file)
index 0000000..13fcbe4
--- /dev/null
@@ -0,0 +1,159 @@
+---
+title: lines-between-class-members
+layout: doc
+rule_type: layout
+related_rules:
+- padded-blocks
+- padding-line-between-statements
+---
+
+
+
+This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member, since that is already taken care of by padded-blocks.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint lines-between-class-members: ["error", "always"]*/
+class MyClass {
+  x;
+  foo() {
+    //...
+  }
+  bar() {
+    //...
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint lines-between-class-members: ["error", "always"]*/
+class MyClass {
+  x;
+
+  foo() {
+    //...
+  }
+
+  bar() {
+    //...
+  }
+}
+```
+
+:::
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint lines-between-class-members: ["error", "always"]*/
+class MyClass {
+  x = 1
+
+  ;in = 2
+}
+```
+
+:::
+
+### Options
+
+This rule has a string option and an object option.
+
+String option:
+
+* `"always"`(default) require an empty line after class members
+* `"never"` disallows an empty line after class members
+
+Object option:
+
+* `"exceptAfterSingleLine": false`(default) **do not** skip checking empty lines after single-line class members
+* `"exceptAfterSingleLine": true` skip checking empty lines after single-line class members
+
+Examples of **incorrect** code for this rule with the string option:
+
+::: incorrect
+
+```js
+/* eslint lines-between-class-members: ["error", "always"]*/
+class Foo{
+  x;
+  bar(){}
+  baz(){}
+}
+
+/* eslint lines-between-class-members: ["error", "never"]*/
+class Foo{
+  x;
+
+  bar(){}
+
+  baz(){}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the string option:
+
+::: correct
+
+```js
+/* eslint lines-between-class-members: ["error", "always"]*/
+class Foo{
+  x;
+
+  bar(){}
+
+  baz(){}
+}
+
+/* eslint lines-between-class-members: ["error", "never"]*/
+class Foo{
+  x;
+  bar(){}
+  baz(){}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the object option:
+
+::: correct
+
+```js
+/* eslint lines-between-class-members: ["error", "always", { "exceptAfterSingleLine": true }]*/
+class Foo{
+  x; // single line class member
+  bar(){} // single line class member
+  baz(){
+    // multi line class member
+  }
+
+  qux(){}
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce empty lines between class members, you can disable this rule.
+
+## Compatibility
+
+* [requirePaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterBlocks)
+* [disallowPaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterBlocks)
diff --git a/eslint/docs/src/rules/max-classes-per-file.md b/eslint/docs/src/rules/max-classes-per-file.md
new file mode 100644 (file)
index 0000000..d7a47ba
--- /dev/null
@@ -0,0 +1,99 @@
+---
+title: max-classes-per-file
+layout: doc
+rule_type: suggestion
+---
+
+
+Files containing multiple classes can often result in a less navigable
+and poorly structured codebase. Best practice is to keep each file
+limited to a single responsibility.
+
+## Rule Details
+
+This rule enforces that each file may contain only a particular number
+of classes and no more.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint max-classes-per-file: "error"*/
+
+class Foo {}
+class Bar {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint max-classes-per-file: "error"*/
+
+class Foo {}
+```
+
+:::
+
+## Options
+
+This rule may be configured with either an object or a number.
+
+If the option is an object, it may contain one or both of:
+
+* `ignoreExpressions`: a boolean option (defaulted to `false`) to ignore class expressions.
+* `max`: a numeric option (defaulted to 1) to specify the maximum number of classes.
+
+For example:
+
+```json
+{
+    "max-classes-per-file": ["error", 1]
+}
+```
+
+```json
+{
+    "max-classes-per-file": [
+        "error",
+        { "ignoreExpressions": true, "max": 2 }
+    ]
+}
+```
+
+Examples of **correct** code for this rule with the `max` option set to `2`:
+
+::: correct
+
+```js
+/* eslint max-classes-per-file: ["error", 2] */
+
+class Foo {}
+class Bar {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `ignoreExpressions` option set to `true`:
+
+::: correct
+
+```js
+/* eslint max-classes-per-file: ["error", { ignoreExpressions: true }] */
+
+class VisitorFactory {
+    forDescriptor(descriptor) {
+        return class {
+            visit(node) {
+                return `Visiting ${descriptor}.`;
+            }
+        };
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/max-depth.md b/eslint/docs/src/rules/max-depth.md
new file mode 100644 (file)
index 0000000..70f441a
--- /dev/null
@@ -0,0 +1,124 @@
+---
+title: max-depth
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-len
+- max-lines
+- max-lines-per-function
+- max-nested-callbacks
+- max-params
+- max-statements
+---
+
+
+Many developers consider code difficult to read if blocks are nested beyond a certain depth.
+
+## Rule Details
+
+This rule enforces a maximum depth that blocks can be nested to reduce code complexity.
+
+## Options
+
+This rule has a number or object option:
+
+* `"max"` (default `4`) enforces a maximum depth that blocks can be nested
+
+**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
+
+### max
+
+Examples of **incorrect** code for this rule with the default `{ "max": 4 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-depth: ["error", 4]*/
+
+function foo() {
+    for (;;) { // Nested 1 deep
+        while (true) { // Nested 2 deep
+            if (true) { // Nested 3 deep
+                if (true) { // Nested 4 deep
+                    if (true) { // Nested 5 deep
+                    }
+                }
+            }
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "max": 4 }` option:
+
+::: correct
+
+```js
+/*eslint max-depth: ["error", 4]*/
+
+function foo() {
+    for (;;) { // Nested 1 deep
+        while (true) { // Nested 2 deep
+            if (true) { // Nested 3 deep
+                if (true) { // Nested 4 deep
+                }
+            }
+        }
+    }
+}
+```
+
+:::
+
+Note that class static blocks do not count as nested blocks, and that the depth in them is calculated separately from the enclosing context.
+
+Examples of **incorrect** code for this rule with `{ "max": 2 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-depth: ["error", 2]*/
+
+function foo() {
+    if (true) { // Nested 1 deep
+        class C {
+            static {
+                if (true) { // Nested 1 deep
+                    if (true) { // Nested 2 deep
+                        if (true) { // Nested 3 deep
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `{ "max": 2 }` option:
+
+::: correct
+
+```js
+/*eslint max-depth: ["error", 2]*/
+
+function foo() {
+    if (true) { // Nested 1 deep
+        class C {
+            static {
+                if (true) { // Nested 1 deep
+                    if (true) { // Nested 2 deep
+                    }
+                }
+            }
+        }
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/max-len.md b/eslint/docs/src/rules/max-len.md
new file mode 100644 (file)
index 0000000..ae3d527
--- /dev/null
@@ -0,0 +1,212 @@
+---
+title: max-len
+layout: doc
+rule_type: layout
+related_rules:
+- complexity
+- max-depth
+- max-nested-callbacks
+- max-params
+- max-statements
+---
+
+
+Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters).
+
+```js
+var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" }; // very long
+```
+
+## Rule Details
+
+This rule enforces a maximum line length to increase code readability and maintainability. The length of a line is defined as the number of Unicode characters in the line.
+
+## Options
+
+This rule has a number or object option:
+
+* `"code"` (default `80`) enforces a maximum line length
+* `"tabWidth"` (default `4`) specifies the character width for tab characters
+* `"comments"` enforces a maximum line length for comments; defaults to value of `code`
+* `"ignorePattern"` ignores lines matching a regular expression; can only match a single line and need to be double escaped when written in YAML or JSON
+* `"ignoreComments": true` ignores all trailing comments and comments on their own line
+* `"ignoreTrailingComments": true` ignores only trailing comments
+* `"ignoreUrls": true` ignores lines that contain a URL
+* `"ignoreStrings": true` ignores lines that contain a double-quoted or single-quoted string
+* `"ignoreTemplateLiterals": true` ignores lines that contain a template literal
+* `"ignoreRegExpLiterals": true` ignores lines that contain a RegExp literal
+
+### code
+
+Examples of **incorrect** code for this rule with the default `{ "code": 80 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-len: ["error", { "code": 80 }]*/
+
+var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "difficult": "to read" };
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "code": 80 }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "code": 80 }]*/
+
+var foo = {
+  "bar": "This is a bar.",
+  "baz": { "qux": "This is a qux" },
+  "easier": "to read"
+};
+```
+
+:::
+
+### tabWidth
+
+Examples of **incorrect** code for this rule with the default `{ "tabWidth": 4 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-len: ["error", { "code": 80, "tabWidth": 4 }]*/
+
+\t  \t  var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" } };
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "tabWidth": 4 }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "code": 80, "tabWidth": 4 }]*/
+
+\t  \t  var foo = {
+\t  \t  \t  \t  "bar": "This is a bar.",
+\t  \t  \t  \t  "baz": { "qux": "This is a qux" }
+\t  \t  };
+```
+
+:::
+
+### comments
+
+Examples of **incorrect** code for this rule with the `{ "comments": 65 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-len: ["error", { "comments": 65 }]*/
+
+/**
+ * This is a comment that violates the maximum line length we have specified
+**/
+```
+
+:::
+
+### ignoreComments
+
+Examples of **correct** code for this rule with the `{ "ignoreComments": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreComments": true }]*/
+
+/**
+ * This is a really really really really really really really really really long comment
+**/
+```
+
+:::
+
+### ignoreTrailingComments
+
+Examples of **correct** code for this rule with the `{ "ignoreTrailingComments": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreTrailingComments": true }]*/
+
+var foo = 'bar'; // This is a really really really really really really really long comment
+```
+
+:::
+
+### ignoreUrls
+
+Examples of **correct** code for this rule with the `{ "ignoreUrls": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreUrls": true }]*/
+
+var url = 'https://www.example.com/really/really/really/really/really/really/really/long';
+```
+
+:::
+
+### ignoreStrings
+
+Examples of **correct** code for this rule with the `{ "ignoreStrings": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreStrings": true }]*/
+
+var longString = 'this is a really really really really really long string!';
+```
+
+:::
+
+### ignoreTemplateLiterals
+
+Examples of **correct** code for this rule with the `{ "ignoreTemplateLiterals": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreTemplateLiterals": true }]*/
+
+var longTemplateLiteral = `this is a really really really really really long template literal!`;
+```
+
+:::
+
+### ignoreRegExpLiterals
+
+Examples of **correct** code for this rule with the `{ "ignoreRegExpLiterals": true }` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignoreRegExpLiterals": true }]*/
+
+var longRegExpLiteral = /this is a really really really really really long regular expression!/;
+```
+
+:::
+
+### ignorePattern
+
+Examples of **correct** code for this rule with the `ignorePattern` option:
+
+::: correct
+
+```js
+/*eslint max-len: ["error", { "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\(" }]*/
+
+var dep = require('really/really/really/really/really/really/really/really/long/module');
+```
+
+:::
diff --git a/eslint/docs/src/rules/max-lines-per-function.md b/eslint/docs/src/rules/max-lines-per-function.md
new file mode 100644 (file)
index 0000000..f0ca7cb
--- /dev/null
@@ -0,0 +1,250 @@
+---
+title: max-lines-per-function
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-depth
+- max-lines
+- max-nested-callbacks
+- max-params
+- max-statements
+- max-statements-per-line
+---
+
+
+Some people consider large functions a code smell. Large functions tend to do a lot of things and can make it hard following what's going on. Many coding style guides dictate a limit of the number of lines that a function can comprise of. This rule can help enforce that style.
+
+## Rule Details
+
+This rule enforces a maximum number of lines per function, in order to aid in maintainability and reduce complexity.
+
+### Why not use `max-statements` or other complexity measurement rules instead?
+
+Nested long method chains like the below example are often broken onto separate lines for readability:
+
+```js
+function() {
+    return m("div", [
+        m("table", {className: "table table-striped latest-data"}, [
+            m("tbody",
+                data.map(function(db) {
+                    return m("tr", {key: db.dbname}, [
+                        m("td", {className: "dbname"}, db.dbname),
+                        m("td", {className: "query-count"},  [
+                            m("span", {className: db.lastSample.countClassName}, db.lastSample.nbQueries)
+                        ])
+                    ])
+                })
+            )
+        ])
+    ])
+}
+```
+
+* `max-statements` will only report this as 1 statement, despite being 16 lines of code.
+* `complexity` will only report a complexity of 1
+* `max-nested-callbacks` will only report 1
+* `max-depth` will report a depth of 0
+
+## Options
+
+This rule has the following options that can be specified using an object:
+
+* `"max"` (default `50`) enforces a maximum number of lines in a function.
+
+* `"skipBlankLines"` (default `false`) ignore lines made up purely of whitespace.
+
+* `"skipComments"` (default `false`) ignore lines containing just comments.
+
+* `"IIFEs"` (default `false`) include any code included in IIFEs.
+
+Alternatively, you may specify a single integer for the `max` option:
+
+```json
+"max-lines-per-function": ["error", 20]
+```
+
+is equivalent to
+
+```json
+"max-lines-per-function": ["error", { "max": 20 }]
+```
+
+### code
+
+Examples of **incorrect** code for this rule with a max value of `2`:
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", 2]*/
+function foo() {
+    var x = 0;
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", 2]*/
+function foo() {
+    // a comment
+    var x = 0;
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", 2]*/
+function foo() {
+    // a comment followed by a blank line
+
+    var x = 0;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with a max value of `3`:
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", 3]*/
+function foo() {
+    var x = 0;
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", 3]*/
+function foo() {
+    // a comment
+    var x = 0;
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", 3]*/
+function foo() {
+    // a comment followed by a blank line
+
+    var x = 0;
+}
+```
+
+:::
+
+### skipBlankLines
+
+Examples of **incorrect** code for this rule with the `{ "skipBlankLines": true }` option:
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 2, "skipBlankLines": true}]*/
+function foo() {
+
+    var x = 0;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 3, "skipBlankLines": true}]*/
+function foo() {
+
+    var x = 0;
+}
+```
+
+:::
+
+### skipComments
+
+Examples of **incorrect** code for this rule with the `{ "skipComments": true }` option:
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 2, "skipComments": true}]*/
+function foo() {
+    // a comment
+    var x = 0;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "skipComments": true }` option:
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 3, "skipComments": true}]*/
+function foo() {
+    // a comment
+    var x = 0;
+}
+```
+
+:::
+
+### IIFEs
+
+Examples of **incorrect** code for this rule with the `{ "IIFEs": true }` option:
+
+::: incorrect
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 2, "IIFEs": true}]*/
+(function(){
+    var x = 0;
+}());
+
+(() => {
+    var x = 0;
+})();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "IIFEs": true }` option:
+
+::: correct
+
+```js
+/*eslint max-lines-per-function: ["error", {"max": 3, "IIFEs": true}]*/
+(function(){
+    var x = 0;
+}());
+
+(() => {
+    var x = 0;
+})();
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the number of lines in your functions.
diff --git a/eslint/docs/src/rules/max-lines.md b/eslint/docs/src/rules/max-lines.md
new file mode 100644 (file)
index 0000000..3064683
--- /dev/null
@@ -0,0 +1,168 @@
+---
+title: max-lines
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-depth
+- max-lines-per-function
+- max-nested-callbacks
+- max-params
+- max-statements
+further_reading:
+- https://web.archive.org/web/20160725154648/http://www.mind2b.com/component/content/article/24-software-module-size-and-file-size
+---
+
+
+Some people consider large files a code smell. Large files tend to do a lot of things and can make it hard following what's going. While there is not an objective maximum number of lines considered acceptable in a file, most people would agree it should not be in the thousands. Recommendations usually range from 100 to 500 lines.
+
+## Rule Details
+
+This rule enforces a maximum number of lines per file, in order to aid in maintainability and reduce complexity.
+
+Please note that most editors show an additional empty line at the end if the file ends with a line break. This rule does not count that extra line.
+
+## Options
+
+This rule has a number or object option:
+
+* `"max"` (default `300`) enforces a maximum number of lines in a file
+
+* `"skipBlankLines": true` ignore lines made up purely of whitespace.
+
+* `"skipComments": true` ignore lines containing just comments
+
+### max
+
+Examples of **incorrect** code for this rule with a max value of `2`:
+
+::: incorrect
+
+```js
+/*eslint max-lines: ["error", 2]*/
+var a,
+    b,
+    c;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint max-lines: ["error", 2]*/
+
+var a,
+    b,c;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint max-lines: ["error", 2]*/
+// a comment
+var a,
+    b,c;
+```
+
+:::
+
+Examples of **correct** code for this rule with a max value of `2`:
+
+::: correct
+
+```js
+/*eslint max-lines: ["error", 2]*/
+var a,
+    b, c;
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint max-lines: ["error", 2]*/
+
+var a, b, c;
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint max-lines: ["error", 2]*/
+// a comment
+var a, b, c;
+```
+
+:::
+
+### skipBlankLines
+
+Examples of **incorrect** code for this rule with the `{ "skipBlankLines": true }` option:
+
+::: incorrect
+
+```js
+/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
+
+var a,
+    b,
+    c;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
+
+::: correct
+
+```js
+/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
+
+var a,
+    b, c;
+```
+
+:::
+
+### skipComments
+
+Examples of **incorrect** code for this rule with the `{ "skipComments": true }` option:
+
+::: incorrect
+
+```js
+/*eslint max-lines: ["error", {"max": 2, "skipComments": true}]*/
+// a comment
+var a,
+    b,
+    c;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "skipComments": true }` option:
+
+::: correct
+
+```js
+/*eslint max-lines: ["error", {"max": 2, "skipComments": true}]*/
+// a comment
+var a,
+    b, c;
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the number of lines in your files.
+
+## Compatibility
+
+* **JSCS**: [maximumNumberOfLines](https://jscs-dev.github.io/rule/maximumNumberOfLines)
diff --git a/eslint/docs/src/rules/max-nested-callbacks.md b/eslint/docs/src/rules/max-nested-callbacks.md
new file mode 100644 (file)
index 0000000..ea83c63
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: max-nested-callbacks
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-depth
+- max-len
+- max-lines
+- max-lines-per-function
+- max-params
+- max-statements
+further_reading:
+- http://book.mixu.net/node/ch7.html
+- https://web.archive.org/web/20220104141150/https://howtonode.org/control-flow
+- https://web.archive.org/web/20220127215850/https://howtonode.org/control-flow-part-ii
+---
+
+
+Many JavaScript libraries use the callback pattern to manage asynchronous operations. A program of any complexity will most likely need to manage several asynchronous operations at various levels of concurrency. A common pitfall that is easy to fall into is nesting callbacks, which makes code more difficult to read the deeper the callbacks are nested.
+
+```js
+foo(function () {
+    bar(function () {
+        baz(function() {
+            qux(function () {
+
+            });
+        });
+    });
+});
+```
+
+## Rule Details
+
+This rule enforces a maximum depth that callbacks can be nested to increase code clarity.
+
+## Options
+
+This rule has a number or object option:
+
+* `"max"` (default `10`) enforces a maximum depth that callbacks can be nested
+
+**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
+
+### max
+
+Examples of **incorrect** code for this rule with the `{ "max": 3 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-nested-callbacks: ["error", 3]*/
+
+foo1(function() {
+    foo2(function() {
+        foo3(function() {
+            foo4(function() {
+                // Do something
+            });
+        });
+    });
+});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "max": 3 }` option:
+
+::: correct
+
+```js
+/*eslint max-nested-callbacks: ["error", 3]*/
+
+foo1(handleFoo1);
+
+function handleFoo1() {
+    foo2(handleFoo2);
+}
+
+function handleFoo2() {
+    foo3(handleFoo3);
+}
+
+function handleFoo3() {
+    foo4(handleFoo4);
+}
+
+function handleFoo4() {
+    foo5();
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/max-params.md b/eslint/docs/src/rules/max-params.md
new file mode 100644 (file)
index 0000000..5456cb1
--- /dev/null
@@ -0,0 +1,74 @@
+---
+title: max-params
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-depth
+- max-len
+- max-lines
+- max-lines-per-function
+- max-nested-callbacks
+- max-statements
+---
+
+
+Functions that take numerous parameters can be difficult to read and write because it requires the memorization of what each parameter is, its type, and the order they should appear in. As a result, many coders adhere to a convention that caps the number of parameters a function can take.
+
+```js
+function foo (bar, baz, qux, qxx) { // four parameters, may be too many
+    doSomething();
+}
+```
+
+## Rule Details
+
+This rule enforces a maximum number of parameters allowed in function definitions.
+
+## Options
+
+This rule has a number or object option:
+
+* `"max"` (default `3`) enforces a maximum number of parameters in function definitions
+
+**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
+
+### max
+
+Examples of **incorrect** code for this rule with the default `{ "max": 3 }` option:
+
+:::incorrect
+
+```js
+/*eslint max-params: ["error", 3]*/
+/*eslint-env es6*/
+
+function foo (bar, baz, qux, qxx) {
+    doSomething();
+}
+
+let foo = (bar, baz, qux, qxx) => {
+    doSomething();
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "max": 3 }` option:
+
+:::correct
+
+```js
+/*eslint max-params: ["error", 3]*/
+/*eslint-env es6*/
+
+function foo (bar, baz, qux) {
+    doSomething();
+}
+
+let foo = (bar, baz, qux) => {
+    doSomething();
+};
+```
+
+:::
diff --git a/eslint/docs/src/rules/max-statements-per-line.md b/eslint/docs/src/rules/max-statements-per-line.md
new file mode 100644 (file)
index 0000000..efa8160
--- /dev/null
@@ -0,0 +1,106 @@
+---
+title: max-statements-per-line
+layout: doc
+rule_type: layout
+related_rules:
+- max-depth
+- max-len
+- max-lines
+- max-lines-per-function
+- max-nested-callbacks
+- max-params
+- max-statements
+---
+
+
+A line of code containing too many statements can be difficult to read. Code is generally read from the top down, especially when scanning, so limiting the number of statements allowed on a single line can be very beneficial for readability and maintainability.
+
+```js
+function foo () { var bar; if (condition) { bar = 1; } else { bar = 2; } return true; } // too many statements
+```
+
+## Rule Details
+
+This rule enforces a maximum number of statements allowed per line.
+
+## Options
+
+### max
+
+The "max" object property is optional (default: 1).
+
+Examples of **incorrect** code for this rule with the default `{ "max": 1 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-statements-per-line: ["error", { "max": 1 }]*/
+
+var bar; var baz;
+if (condition) { bar = 1; }
+for (var i = 0; i < length; ++i) { bar = 1; }
+switch (discriminant) { default: break; }
+function foo() { bar = 1; }
+var foo = function foo() { bar = 1; };
+(function foo() { bar = 1; })();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "max": 1 }` option:
+
+::: correct
+
+```js
+/*eslint max-statements-per-line: ["error", { "max": 1 }]*/
+
+var bar, baz;
+if (condition) bar = 1;
+for (var i = 0; i < length; ++i);
+switch (discriminant) { default: }
+function foo() { }
+var foo = function foo() { };
+(function foo() { })();
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "max": 2 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-statements-per-line: ["error", { "max": 2 }]*/
+
+var bar; var baz; var qux;
+if (condition) { bar = 1; } else { baz = 2; }
+for (var i = 0; i < length; ++i) { bar = 1; baz = 2; }
+switch (discriminant) { case 'test': break; default: break; }
+function foo() { bar = 1; baz = 2; }
+var foo = function foo() { bar = 1; };
+(function foo() { bar = 1; baz = 2; })();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "max": 2 }` option:
+
+::: correct
+
+```js
+/*eslint max-statements-per-line: ["error", { "max": 2 }]*/
+
+var bar; var baz;
+if (condition) bar = 1; if (condition) baz = 2;
+for (var i = 0; i < length; ++i) { bar = 1; }
+switch (discriminant) { default: break; }
+function foo() { bar = 1; }
+var foo = function foo() { bar = 1; };
+(function foo() { var bar = 1; })();
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the number of statements on each line.
diff --git a/eslint/docs/src/rules/max-statements.md b/eslint/docs/src/rules/max-statements.md
new file mode 100644 (file)
index 0000000..c29a595
--- /dev/null
@@ -0,0 +1,188 @@
+---
+title: max-statements
+layout: doc
+rule_type: suggestion
+related_rules:
+- complexity
+- max-depth
+- max-len
+- max-lines
+- max-lines-per-function
+- max-nested-callbacks
+- max-params
+---
+
+
+The `max-statements` rule allows you to specify the maximum number of statements allowed in a function.
+
+```js
+function foo() {
+  var bar = 1; // one statement
+  var baz = 2; // two statements
+  var qux = 3; // three statements
+}
+```
+
+## Rule Details
+
+This rule enforces a maximum number of statements allowed in function blocks.
+
+## Options
+
+This rule has a number or object option:
+
+* `"max"` (default `10`) enforces a maximum number of statements allows in function blocks
+
+**Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
+
+This rule has an object option:
+
+* `"ignoreTopLevelFunctions": true` ignores top-level functions
+
+### max
+
+Examples of **incorrect** code for this rule with the default `{ "max": 10 }` option:
+
+::: incorrect
+
+```js
+/*eslint max-statements: ["error", 10]*/
+/*eslint-env es6*/
+
+function foo() {
+  var foo1 = 1;
+  var foo2 = 2;
+  var foo3 = 3;
+  var foo4 = 4;
+  var foo5 = 5;
+  var foo6 = 6;
+  var foo7 = 7;
+  var foo8 = 8;
+  var foo9 = 9;
+  var foo10 = 10;
+
+  var foo11 = 11; // Too many.
+}
+
+let foo = () => {
+  var foo1 = 1;
+  var foo2 = 2;
+  var foo3 = 3;
+  var foo4 = 4;
+  var foo5 = 5;
+  var foo6 = 6;
+  var foo7 = 7;
+  var foo8 = 8;
+  var foo9 = 9;
+  var foo10 = 10;
+
+  var foo11 = 11; // Too many.
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "max": 10 }` option:
+
+::: correct
+
+```js
+/*eslint max-statements: ["error", 10]*/
+/*eslint-env es6*/
+
+function foo() {
+  var foo1 = 1;
+  var foo2 = 2;
+  var foo3 = 3;
+  var foo4 = 4;
+  var foo5 = 5;
+  var foo6 = 6;
+  var foo7 = 7;
+  var foo8 = 8;
+  var foo9 = 9;
+  var foo10 = 10;
+  return function () {
+
+    // The number of statements in the inner function does not count toward the
+    // statement maximum.
+
+    return 42;
+  };
+}
+
+let foo = () => {
+  var foo1 = 1;
+  var foo2 = 2;
+  var foo3 = 3;
+  var foo4 = 4;
+  var foo5 = 5;
+  var foo6 = 6;
+  var foo7 = 7;
+  var foo8 = 8;
+  var foo9 = 9;
+  var foo10 = 10;
+  return function () {
+
+    // The number of statements in the inner function does not count toward the
+    // statement maximum.
+
+    return 42;
+  };
+}
+```
+
+:::
+
+Note that this rule does not apply to class static blocks, and that statements in class static blocks do not count as statements in the enclosing function.
+
+Examples of **correct** code for this rule with `{ "max": 2 }` option:
+
+::: correct
+
+```js
+/*eslint max-statements: ["error", 2]*/
+
+function foo() {
+    let one;
+    let two = class {
+        static {
+            let three;
+            let four;
+            let five;
+            if (six) {
+                let seven;
+                let eight;
+                let nine;
+            }
+        }
+    };
+}
+```
+
+:::
+
+### ignoreTopLevelFunctions
+
+Examples of additional **correct** code for this rule with the `{ "max": 10 }, { "ignoreTopLevelFunctions": true }` options:
+
+::: correct
+
+```js
+/*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
+
+function foo() {
+  var foo1 = 1;
+  var foo2 = 2;
+  var foo3 = 3;
+  var foo4 = 4;
+  var foo5 = 5;
+  var foo6 = 6;
+  var foo7 = 7;
+  var foo8 = 8;
+  var foo9 = 9;
+  var foo10 = 10;
+  var foo11 = 11;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/multiline-comment-style.md b/eslint/docs/src/rules/multiline-comment-style.md
new file mode 100644 (file)
index 0000000..657de1d
--- /dev/null
@@ -0,0 +1,152 @@
+---
+title: multiline-comment-style
+layout: doc
+rule_type: suggestion
+---
+
+
+
+Many style guides require a particular style for comments that span multiple lines. For example, some style guides prefer the use of a single block comment for multiline comments, whereas other style guides prefer consecutive line comments.
+
+## Rule Details
+
+This rule aims to enforce a particular style for multiline comments.
+
+### Options
+
+This rule has a string option, which can have one of the following values:
+
+* `"starred-block"` (default): Disallows consecutive line comments in favor of block comments. Additionally, requires block comments to have an aligned `*` character before each line.
+* `"bare-block"`: Disallows consecutive line comments in favor of block comments, and disallows block comments from having a `"*"` character before each line.
+* `"separate-lines"`: Disallows block comments in favor of consecutive line comments
+
+The rule always ignores directive comments such as `/* eslint-disable */`. Additionally, unless the mode is `"starred-block"`, the rule ignores JSDoc comments.
+
+Examples of **incorrect** code for this rule with the default `"starred-block"` option:
+
+::: incorrect
+
+```js
+
+/* eslint multiline-comment-style: ["error", "starred-block"] */
+
+// this line
+// calls foo()
+foo();
+
+/* this line
+calls foo() */
+foo();
+
+/* this comment
+ * is missing a newline after /*
+ */
+
+/*
+ * this comment
+ * is missing a newline at the end */
+
+/*
+* the star in this line should have a space before it
+ */
+
+/*
+ * the star on the following line should have a space before it
+*/
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"starred-block"` option:
+
+::: correct
+
+```js
+/* eslint multiline-comment-style: ["error", "starred-block"] */
+
+/*
+ * this line
+ * calls foo()
+ */
+foo();
+
+// single-line comment
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"bare-block"` option:
+
+::: incorrect
+
+```js
+/* eslint multiline-comment-style: ["error", "bare-block"] */
+
+// this line
+// calls foo()
+foo();
+
+/*
+ * this line
+ * calls foo()
+ */
+foo();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"bare-block"` option:
+
+::: correct
+
+```js
+/* eslint multiline-comment-style: ["error", "bare-block"] */
+
+/* this line
+   calls foo() */
+foo();
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"separate-lines"` option:
+
+::: incorrect
+
+```js
+
+/* eslint multiline-comment-style: ["error", "separate-lines"] */
+
+/* This line
+calls foo() */
+foo();
+
+/*
+ * This line
+ * calls foo()
+ */
+foo();
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"separate-lines"` option:
+
+::: correct
+
+```js
+/* eslint multiline-comment-style: ["error", "separate-lines"] */
+
+// This line
+// calls foo()
+foo();
+
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce a particular style for multiline comments, you can disable the rule.
diff --git a/eslint/docs/src/rules/multiline-ternary.md b/eslint/docs/src/rules/multiline-ternary.md
new file mode 100644 (file)
index 0000000..f3ba255
--- /dev/null
@@ -0,0 +1,181 @@
+---
+title: multiline-ternary
+layout: doc
+rule_type: layout
+related_rules:
+- operator-linebreak
+---
+
+
+
+JavaScript allows operands of ternary expressions to be separated by newlines, which can improve the readability of your program.
+
+For example:
+
+```js
+var foo = bar > baz ? value1 : value2;
+```
+
+The above can be rewritten as the following to improve readability and more clearly delineate the operands:
+
+```js
+var foo = bar > baz ?
+    value1 :
+    value2;
+```
+
+## Rule Details
+
+This rule enforces or disallows newlines between operands of a ternary expression.
+Note: The location of the operators is not enforced by this rule. Please see the [operator-linebreak](operator-linebreak) rule if you are interested in enforcing the location of the operators themselves.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) enforces newlines between the operands of a ternary expression.
+* `"always-multiline"` enforces newlines between the operands of a ternary expression if the expression spans multiple lines.
+* `"never"` disallows newlines between the operands of a ternary expression.
+
+### always
+
+This is the default option.
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint multiline-ternary: ["error", "always"]*/
+
+foo > bar ? value1 : value2;
+
+foo > bar ? value :
+    value2;
+
+foo > bar ?
+    value : value2;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint multiline-ternary: ["error", "always"]*/
+
+foo > bar ?
+    value1 :
+    value2;
+
+foo > bar ?
+    (baz > qux ?
+        value1 :
+        value2) :
+    value3;
+```
+
+:::
+
+### always-multiline
+
+Examples of **incorrect** code for this rule with the `"always-multiline"` option:
+
+::: incorrect
+
+```js
+/*eslint multiline-ternary: ["error", "always-multiline"]*/
+
+foo > bar ? value1 :
+    value2;
+
+foo > bar ?
+    value1 : value2;
+
+foo > bar &&
+    bar > baz ? value1 : value2;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always-multiline"` option:
+
+::: correct
+
+```js
+/*eslint multiline-ternary: ["error", "always-multiline"]*/
+
+foo > bar ? value1 : value2;
+
+foo > bar ?
+    value1 :
+    value2;
+
+foo > bar ?
+    (baz > qux ? value1 : value2) :
+    value3;
+
+foo > bar ?
+    (baz > qux ?
+        value1 :
+        value2) :
+    value3;
+
+foo > bar &&
+    bar > baz ?
+        value1 :
+        value2;
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint multiline-ternary: ["error", "never"]*/
+
+foo > bar ? value :
+    value2;
+
+foo > bar ?
+    value : value2;
+
+foo >
+    bar ?
+    value1 :
+    value2;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint multiline-ternary: ["error", "never"]*/
+
+foo > bar ? value1 : value2;
+
+foo > bar ? (baz > qux ? value1 : value2) : value3;
+
+foo > bar ? (
+    baz > qux ? value1 : value2
+) : value3;
+```
+
+:::
+
+## When Not To Use It
+
+You can safely disable this rule if you do not have any strict conventions about whether the operands of a ternary expression should be separated by newlines.
+
+## Compatibility
+
+* **JSCS**: [requireMultiLineTernary](https://jscs-dev.github.io/rule/requireMultiLineTernary)
diff --git a/eslint/docs/src/rules/new-cap.md b/eslint/docs/src/rules/new-cap.md
new file mode 100644 (file)
index 0000000..cf49280
--- /dev/null
@@ -0,0 +1,277 @@
+---
+title: new-cap
+layout: doc
+rule_type: suggestion
+---
+
+
+The `new` operator in JavaScript creates a new instance of a particular type of object. That type of object is represented by a constructor function. Since constructor functions are just regular functions, the only defining characteristic is that `new` is being used as part of the call. Native JavaScript functions begin with an uppercase letter to distinguish those functions that are to be used as constructors from functions that are not. Many style guides recommend following this pattern to more easily determine which functions are to be used as constructors.
+
+```js
+var friend = new Person();
+```
+
+## Rule Details
+
+This rule requires constructor names to begin with a capital letter. Certain built-in identifiers are exempt from this rule. These identifiers are:
+
+* `Array`
+* `Boolean`
+* `Date`
+* `Error`
+* `Function`
+* `Number`
+* `Object`
+* `RegExp`
+* `String`
+* `Symbol`
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint new-cap: "error"*/
+
+function foo(arg) {
+    return Boolean(arg);
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"newIsCap": true` (default) requires all `new` operators to be called with uppercase-started functions.
+* `"newIsCap": false` allows `new` operators to be called with lowercase-started or uppercase-started functions.
+* `"capIsNew": true` (default) requires all uppercase-started functions to be called with `new` operators.
+* `"capIsNew": false` allows uppercase-started functions to be called without `new` operators.
+* `"newIsCapExceptions"` allows specified lowercase-started function names to be called with the `new` operator.
+* `"newIsCapExceptionPattern"` allows any lowercase-started function names that match the specified regex pattern to be called with the `new` operator.
+* `"capIsNewExceptions"` allows specified uppercase-started function names to be called without the `new` operator.
+* `"capIsNewExceptionPattern"` allows any uppercase-started function names that match the specified regex pattern to be called without the `new` operator.
+* `"properties": true` (default) enables checks on object properties
+* `"properties": false` disables checks on object properties
+
+### newIsCap
+
+Examples of **incorrect** code for this rule with the default `{ "newIsCap": true }` option:
+
+::: incorrect
+
+```js
+/*eslint new-cap: ["error", { "newIsCap": true }]*/
+
+var friend = new person();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "newIsCap": true }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "newIsCap": true }]*/
+
+var friend = new Person();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "newIsCap": false }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "newIsCap": false }]*/
+
+var friend = new person();
+```
+
+:::
+
+### capIsNew
+
+Examples of **incorrect** code for this rule with the default `{ "capIsNew": true }` option:
+
+::: incorrect
+
+```js
+/*eslint new-cap: ["error", { "capIsNew": true }]*/
+
+var colleague = Person();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "capIsNew": true }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNew": true }]*/
+
+var colleague = new Person();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "capIsNew": false }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNew": false }]*/
+
+var colleague = Person();
+```
+
+:::
+
+### newIsCapExceptions
+
+Examples of additional **correct** code for this rule with the `{ "newIsCapExceptions": ["events"] }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "newIsCapExceptions": ["events"] }]*/
+
+var events = require('events');
+
+var emitter = new events();
+```
+
+:::
+
+### newIsCapExceptionPattern
+
+Examples of additional **correct** code for this rule with the `{ "newIsCapExceptionPattern": "^person\\.." }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "newIsCapExceptionPattern": "^person\\.." }]*/
+
+var friend = new person.acquaintance();
+
+var bestFriend = new person.friend();
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "newIsCapExceptionPattern": "\\.bar$" }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "newIsCapExceptionPattern": "\\.bar$" }]*/
+
+var friend = new person.bar();
+```
+
+:::
+
+### capIsNewExceptions
+
+Examples of additional **correct** code for this rule with the `{ "capIsNewExceptions": ["Person"] }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNewExceptions": ["Person"] }]*/
+
+function foo(arg) {
+    return Person(arg);
+}
+```
+
+:::
+
+### capIsNewExceptionPattern
+
+Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "^person\\.." }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "^person\\.." }]*/
+
+var friend = person.Acquaintance();
+var bestFriend = person.Friend();
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "\\.Bar$" }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "\\.Bar$" }]*/
+
+foo.Bar();
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "capIsNewExceptionPattern": "^Foo" }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "capIsNewExceptionPattern": "^Foo" }]*/
+
+var x = Foo(42);
+
+var y = Foobar(42);
+
+var z = Foo.Bar(42);
+```
+
+:::
+
+### properties
+
+Examples of **incorrect** code for this rule with the default `{ "properties": true }` option:
+
+::: incorrect
+
+```js
+/*eslint new-cap: ["error", { "properties": true }]*/
+
+var friend = new person.acquaintance();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "properties": true }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "properties": true }]*/
+
+var friend = new person.Acquaintance();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "properties": false }` option:
+
+::: correct
+
+```js
+/*eslint new-cap: ["error", { "properties": false }]*/
+
+var friend = new person.acquaintance();
+```
+
+:::
+
+## When Not To Use It
+
+If you have conventions that don't require an uppercase letter for constructors, or don't require capitalized functions be only used as constructors, turn this rule off.
diff --git a/eslint/docs/src/rules/new-parens.md b/eslint/docs/src/rules/new-parens.md
new file mode 100644 (file)
index 0000000..02bceef
--- /dev/null
@@ -0,0 +1,81 @@
+---
+title: new-parens
+layout: doc
+rule_type: layout
+---
+
+
+
+JavaScript allows the omission of parentheses when invoking a function via the `new` keyword and the constructor has no arguments. However, some coders believe that omitting the parentheses is inconsistent with the rest of the language and thus makes code less clear.
+
+```js
+var person = new Person;
+```
+
+## Rule Details
+
+This rule can enforce or disallow parentheses when invoking a constructor with no arguments using the `new` keyword.
+
+## Options
+
+This rule takes one option.
+
+* `"always"` enforces parenthesis after a new constructor with no arguments (default)
+* `"never"` enforces no parenthesis after a new constructor with no arguments
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint new-parens: "error"*/
+
+var person = new Person;
+var person = new (Person);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint new-parens: "error"*/
+
+var person = new Person();
+var person = new (Person)();
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint new-parens: ["error", "never"]*/
+
+var person = new Person();
+var person = new (Person)();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint new-parens: ["error", "never"]*/
+
+var person = new Person;
+var person = (new Person);
+var person = new Person("Name");
+```
+
+:::
diff --git a/eslint/docs/src/rules/newline-after-var.md b/eslint/docs/src/rules/newline-after-var.md
new file mode 100644 (file)
index 0000000..a516b53
--- /dev/null
@@ -0,0 +1,164 @@
+---
+title: newline-after-var
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements) rule.
+
+As of today there is no consistency in separating variable declarations from the rest of the code. Some developers leave an empty line between var statements and the rest of the code like:
+
+```js
+var foo;
+
+// do something with foo
+```
+
+Whereas others don't leave any empty newlines at all.
+
+```js
+var foo;
+// do something with foo
+```
+
+The problem is when these developers work together in a project. This rule enforces a coding style where empty newlines are allowed or disallowed after `var`, `let`, or `const` statements. It helps the code to look consistent across the entire project.
+
+## Rule Details
+
+This rule enforces a coding style where empty lines are required or disallowed after `var`, `let`, or `const` statements to achieve a consistent coding style across the project.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` (default) requires an empty line after `var`, `let`, or `const`
+
+  Comments on a line directly after var statements are treated like additional var statements.
+
+* `"never"` disallows empty lines after `var`, `let`, or `const`
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint newline-after-var: ["error", "always"]*/
+/*eslint-env es6*/
+
+var greet = "hello,",
+    name = "world";
+console.log(greet, name);
+
+let greet = "hello,",
+    name = "world";
+console.log(greet, name);
+
+var greet = "hello,";
+const NAME = "world";
+console.log(greet, NAME);
+
+var greet = "hello,";
+var name = "world";
+// var name = require("world");
+console.log(greet, name);
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint newline-after-var: ["error", "always"]*/
+/*eslint-env es6*/
+
+var greet = "hello,",
+    name = "world";
+
+console.log(greet, name);
+
+let greet = "hello,",
+    name = "world";
+
+console.log(greet, name);
+
+var greet = "hello,";
+const NAME = "world";
+
+console.log(greet, NAME);
+
+var greet = "hello,";
+var name = "world";
+// var name = require("world");
+
+console.log(greet, name);
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint newline-after-var: ["error", "never"]*/
+/*eslint-env es6*/
+
+var greet = "hello,",
+    name = "world";
+
+console.log(greet, name);
+
+let greet = "hello,",
+    name = "world";
+
+console.log(greet, name);
+
+var greet = "hello,";
+const NAME = "world";
+
+console.log(greet, NAME);
+
+var greet = "hello,";
+var name = "world";
+// var name = require("world");
+
+console.log(greet, name);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint newline-after-var: ["error", "never"]*/
+/*eslint-env es6*/
+
+var greet = "hello,",
+    name = "world";
+console.log(greet, name);
+
+let greet = "hello,",
+    name = "world";
+console.log(greet, name);
+
+var greet = "hello,";
+const NAME = "world";
+console.log(greet, NAME);
+
+var greet = "hello,";
+var name = "world";
+// var name = require("world");
+console.log(greet, name);
+```
+
+:::
diff --git a/eslint/docs/src/rules/newline-before-return.md b/eslint/docs/src/rules/newline-before-return.md
new file mode 100644 (file)
index 0000000..2851e68
--- /dev/null
@@ -0,0 +1,128 @@
+---
+title: newline-before-return
+layout: doc
+rule_type: layout
+related_rules:
+- newline-after-var
+---
+
+
+
+This rule was **deprecated** in ESLint v4.0.0 and replaced by the [padding-line-between-statements](padding-line-between-statements) rule.
+
+There is no hard and fast rule about whether empty lines should precede `return` statements in JavaScript. However, clearly delineating where a function is returning can greatly increase the readability and clarity of the code. For example:
+
+```js
+function foo(bar) {
+  var baz = 'baz';
+  if (!bar) {
+    bar = baz;
+    return bar;
+  }
+  return bar;
+}
+```
+
+Adding newlines visibly separates the return statements from the previous lines, making it clear where the function exits and what value it returns:
+
+```js
+function foo(bar) {
+  var baz = 'baz';
+
+  if (!bar) {
+    bar = baz;
+
+    return bar;
+  }
+
+  return bar;
+}
+```
+
+## Rule Details
+
+This rule requires an empty line before `return` statements to increase code clarity, except when the `return` is alone inside a statement group (such as an if statement). In the latter case, the `return` statement does not need to be delineated by virtue of it being alone. Comments are ignored and do not count as empty lines.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint newline-before-return: "error"*/
+
+function foo(bar) {
+    if (!bar) {
+        return;
+    }
+    return bar;
+}
+
+function foo(bar) {
+    if (!bar) {
+        return;
+    }
+    /* multi-line
+    comment */
+    return bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint newline-before-return: "error"*/
+
+function foo() {
+    return;
+}
+
+function foo() {
+
+    return;
+}
+
+function foo(bar) {
+    if (!bar) return;
+}
+
+function foo(bar) {
+    if (!bar) { return };
+}
+
+function foo(bar) {
+    if (!bar) {
+        return;
+    }
+}
+
+function foo(bar) {
+    if (!bar) {
+        return;
+    }
+
+    return bar;
+}
+
+function foo(bar) {
+    if (!bar) {
+
+        return;
+    }
+}
+
+function foo() {
+
+    // comment
+    return;
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can safely disable this rule if you do not have any strict conventions about whitespace before `return` statements.
diff --git a/eslint/docs/src/rules/newline-per-chained-call.md b/eslint/docs/src/rules/newline-per-chained-call.md
new file mode 100644 (file)
index 0000000..4ceff02
--- /dev/null
@@ -0,0 +1,132 @@
+---
+title: newline-per-chained-call
+layout: doc
+rule_type: layout
+---
+
+
+
+Chained method calls on a single line without line breaks are harder to read, so some developers place a newline character after each method call in the chain to make it more readable and easy to maintain.
+
+Let's look at the following perfectly valid (but single line) code.
+
+```js
+d3.select("body").selectAll("p").data([4, 8, 15, 16, 23, 42 ]).enter().append("p").text(function(d) { return "I'm number " + d + "!"; });
+```
+
+However, with appropriate new lines, it becomes easy to read and understand. Look at the same code written below with line breaks after each call.
+
+```js
+d3
+    .select("body")
+    .selectAll("p")
+    .data([
+        4,
+        8,
+        15,
+        16,
+        23,
+        42
+    ])
+    .enter()
+    .append("p")
+    .text(function (d) {
+        return "I'm number " + d + "!";
+    });
+```
+
+Another argument in favor of this style is that it improves the clarity of diffs when something in the method chain is changed:
+
+Less clear:
+
+```diff
+-d3.select("body").selectAll("p").style("color", "white");
++d3.select("body").selectAll("p").style("color", "blue");
+```
+
+More clear:
+
+```diff
+d3
+    .select("body")
+    .selectAll("p")
+-    .style("color", "white");
++    .style("color", "blue");
+```
+
+## Rule Details
+
+This rule requires a newline after each call in a method chain or deep member access. Computed property accesses such as `instance[something]` are excluded.
+
+## Options
+
+This rule has an object option:
+
+* `"ignoreChainWithDepth"` (default: `2`) allows chains up to a specified depth.
+
+### ignoreChainWithDepth
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreChainWithDepth": 2 }` option:
+
+::: incorrect
+
+```js
+/*eslint newline-per-chained-call: ["error", { "ignoreChainWithDepth": 2 }]*/
+
+_.chain({}).map(foo).filter(bar).value();
+
+// Or
+_.chain({}).map(foo).filter(bar);
+
+// Or
+_
+  .chain({}).map(foo)
+  .filter(bar);
+
+// Or
+obj.method().method2().method3();
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "ignoreChainWithDepth": 2 }` option:
+
+::: correct
+
+```js
+/*eslint newline-per-chained-call: ["error", { "ignoreChainWithDepth": 2 }]*/
+
+_
+  .chain({})
+  .map(foo)
+  .filter(bar)
+  .value();
+
+// Or
+_
+  .chain({})
+  .map(foo)
+  .filter(bar);
+
+// Or
+_.chain({})
+  .map(foo)
+  .filter(bar);
+
+// Or
+obj
+  .prop
+  .method().prop;
+
+// Or
+obj
+  .prop.method()
+  .method2()
+  .method3().prop;
+```
+
+:::
+
+## When Not To Use It
+
+If you have conflicting rules or when you are fine with chained calls on one line, you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-alert.md b/eslint/docs/src/rules/no-alert.md
new file mode 100644 (file)
index 0000000..6088cb3
--- /dev/null
@@ -0,0 +1,56 @@
+---
+title: no-alert
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-console
+- no-debugger
+---
+
+
+JavaScript's `alert`, `confirm`, and `prompt` functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, `alert` is often used while debugging code, which should be removed before deployment to production.
+
+```js
+alert("here!");
+```
+
+## Rule Details
+
+This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters `alert`, `prompt`, and `confirm` function calls which are not shadowed.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-alert: "error"*/
+
+alert("here!");
+
+confirm("Are you sure?");
+
+prompt("What's your name?", "John Doe");
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint no-alert: "error"*/
+
+customAlert("Something happened!");
+
+customConfirm("Are you sure?");
+
+customPrompt("Who are you?");
+
+function foo() {
+    var alert = myCustomLib.customAlert;
+    alert();
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-array-constructor.md b/eslint/docs/src/rules/no-array-constructor.md
new file mode 100644 (file)
index 0000000..730da6c
--- /dev/null
@@ -0,0 +1,54 @@
+---
+title: no-array-constructor
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-new-object
+- no-new-wrappers
+---
+
+
+Use of the `Array` constructor to construct a new array is generally
+discouraged in favor of array literal notation because of the single-argument
+pitfall and because the `Array` global may be redefined. The exception is when
+the Array constructor is used to intentionally create sparse arrays of a
+specified size by giving the constructor a single numeric argument.
+
+## Rule Details
+
+This rule disallows `Array` constructors.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-array-constructor: "error"*/
+
+Array(0, 1, 2)
+
+new Array(0, 1, 2)
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint no-array-constructor: "error"*/
+
+Array(500)
+
+new Array(someOtherArray.length)
+
+[0, 1, 2]
+```
+
+:::
+
+## When Not To Use It
+
+This rule enforces a nearly universal stylistic concern. That being said, this
+rule may be disabled if the constructor style is preferred.
diff --git a/eslint/docs/src/rules/no-arrow-condition.md b/eslint/docs/src/rules/no-arrow-condition.md
new file mode 100644 (file)
index 0000000..6783bde
--- /dev/null
@@ -0,0 +1,56 @@
+---
+title: no-arrow-condition
+layout: doc
+
+related_rules:
+- arrow-parens
+- no-confusing-arrow
+- no-constant-condition
+---
+
+Disallows arrow functions where test conditions are expected.
+
+(removed) This rule was **removed** in ESLint v2.0 and **replaced** by a combination of the [no-confusing-arrow](no-confusing-arrow) and [no-constant-condition](no-constant-condition) rules.
+
+Arrow functions (`=>`) are similar in syntax to some comparison operators (`>`, `<`, `<=`, and `>=`). This rule warns against using the arrow function syntax in places where a condition is expected. Even if the arguments of the arrow function are wrapped with parens, this rule still warns about it.
+
+Here's an example where the usage of `=>` is most likely a typo:
+
+```js
+// This is probably a typo
+if (a => 1) {}
+// And should instead be
+if (a >= 1) {}
+```
+
+There are also cases where the usage of `=>` can be ambiguous and should be rewritten to more clearly show the author's intent:
+
+```js
+// The intent is not clear
+var x = a => 1 ? 2 : 3
+// Did the author mean this
+var x = function (a) { return a >= 1 ? 2 : 3 }
+// Or this
+var x = a <= 1 ? 2 : 3
+```
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-arrow-condition: "error"*/
+/*eslint-env es6*/
+
+if (a => 1) {}
+while (a => 1) {}
+for (var a = 1; a => 10; a++) {}
+a => 1 ? 2 : 3
+(a => 1) ? 2 : 3
+var x = a => 1 ? 2 : 3
+var x = (a) => 1 ? 2 : 3
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-async-promise-executor.md b/eslint/docs/src/rules/no-async-promise-executor.md
new file mode 100644 (file)
index 0000000..4c6a854
--- /dev/null
@@ -0,0 +1,76 @@
+---
+title: no-async-promise-executor
+layout: doc
+rule_type: problem
+---
+
+
+
+The `new Promise` constructor accepts an *executor* function as an argument, which has `resolve` and `reject` parameters that can be used to control the state of the created Promise. For example:
+
+```js
+const result = new Promise(function executor(resolve, reject) {
+  readFile('foo.txt', function(err, result) {
+    if (err) {
+      reject(err);
+    } else {
+      resolve(result);
+    }
+  });
+});
+```
+
+The executor function can also be an `async function`. However, this is usually a mistake, for a few reasons:
+
+* If an async executor function throws an error, the error will be lost and won't cause the newly-constructed `Promise` to reject. This could make it difficult to debug and handle some errors.
+* If a Promise executor function is using `await`, this is usually a sign that it is not actually necessary to use the `new Promise` constructor, or the scope of the `new Promise` constructor can be reduced.
+
+## Rule Details
+
+This rule aims to disallow async Promise executor functions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+const foo = new Promise(async (resolve, reject) => {
+  readFile('foo.txt', function(err, result) {
+    if (err) {
+      reject(err);
+    } else {
+      resolve(result);
+    }
+  });
+});
+
+const result = new Promise(async (resolve, reject) => {
+  resolve(await foo);
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+const foo = new Promise((resolve, reject) => {
+  readFile('foo.txt', function(err, result) {
+    if (err) {
+      reject(err);
+    } else {
+      resolve(result);
+    }
+  });
+});
+
+const result = Promise.resolve(foo);
+```
+
+:::
+
+## When Not To Use It
+
+If your codebase doesn't support async function syntax, there's no need to enable this rule.
diff --git a/eslint/docs/src/rules/no-await-in-loop.md b/eslint/docs/src/rules/no-await-in-loop.md
new file mode 100644 (file)
index 0000000..f661a5b
--- /dev/null
@@ -0,0 +1,92 @@
+---
+title: no-await-in-loop
+layout: doc
+rule_type: problem
+---
+
+
+Performing an operation on each element of an iterable is a common task. However, performing an
+`await` as part of each operation is an indication that the program is not taking full advantage of
+the parallelization benefits of `async`/`await`.
+
+Usually, the code should be refactored to create all the promises at once, then get access to the
+results using `Promise.all()`. Otherwise, each successive operation will not start until the
+previous one has completed.
+
+Concretely, the following function should be refactored as shown:
+
+```js
+async function foo(things) {
+  const results = [];
+  for (const thing of things) {
+    // Bad: each loop iteration is delayed until the entire asynchronous operation completes
+    results.push(await bar(thing));
+  }
+  return baz(results);
+}
+```
+
+```js
+async function foo(things) {
+  const results = [];
+  for (const thing of things) {
+    // Good: all asynchronous operations are immediately started.
+    results.push(bar(thing));
+  }
+  // Now that all the asynchronous operations are running, here we wait until they all complete.
+  return baz(await Promise.all(results));
+}
+```
+
+## Rule Details
+
+This rule disallows the use of `await` within loop bodies.
+
+## Examples
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint no-await-in-loop: "error"*/
+
+async function foo(things) {
+  const results = [];
+  for (const thing of things) {
+    // Good: all asynchronous operations are immediately started.
+    results.push(bar(thing));
+  }
+  // Now that all the asynchronous operations are running, here we wait until they all complete.
+  return baz(await Promise.all(results));
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-await-in-loop: "error"*/
+
+async function foo(things) {
+  const results = [];
+  for (const thing of things) {
+    // Bad: each loop iteration is delayed until the entire asynchronous operation completes
+    results.push(await bar(thing));
+  }
+  return baz(results);
+}
+```
+
+:::
+
+## When Not To Use It
+
+In many cases the iterations of a loop are not actually independent of each-other. For example, the
+output of one iteration might be used as the input to another. Or, loops may be used to retry
+asynchronous operations that were unsuccessful. Or, loops may be used to prevent your code from sending
+an excessive amount of requests in parallel. In such cases it makes sense to use `await` within a
+loop and it is recommended to disable the rule via a standard ESLint disable comment.
diff --git a/eslint/docs/src/rules/no-bitwise.md b/eslint/docs/src/rules/no-bitwise.md
new file mode 100644 (file)
index 0000000..2df0b8a
--- /dev/null
@@ -0,0 +1,107 @@
+---
+title: no-bitwise
+layout: doc
+rule_type: suggestion
+---
+
+
+The use of bitwise operators in JavaScript is very rare and often `&` or `|` is simply a mistyped `&&` or `||`, which will lead to unexpected behavior.
+
+```js
+var x = y | z;
+```
+
+## Rule Details
+
+This rule disallows bitwise operators.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-bitwise: "error"*/
+
+var x = y | z;
+
+var x = y & z;
+
+var x = y ^ z;
+
+var x = ~ z;
+
+var x = y << z;
+
+var x = y >> z;
+
+var x = y >>> z;
+
+x |= y;
+
+x &= y;
+
+x ^= y;
+
+x <<= y;
+
+x >>= y;
+
+x >>>= y;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-bitwise: "error"*/
+
+var x = y || z;
+
+var x = y && z;
+
+var x = y > z;
+
+var x = y < z;
+
+x += y;
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"allow"`: Allows a list of bitwise operators to be used as exceptions.
+* `"int32Hint"`: Allows the use of bitwise OR in `|0` pattern for type casting.
+
+### allow
+
+Examples of **correct** code for this rule with the `{ "allow": ["~"] }` option:
+
+::: correct
+
+```js
+/*eslint no-bitwise: ["error", { "allow": ["~"] }] */
+
+~[1,2,3].indexOf(1) === -1;
+```
+
+:::
+
+### int32Hint
+
+Examples of **correct** code for this rule with the `{ "int32Hint": true }` option:
+
+::: correct
+
+```js
+/*eslint no-bitwise: ["error", { "int32Hint": true }] */
+
+var b = a|0;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-buffer-constructor.md b/eslint/docs/src/rules/no-buffer-constructor.md
new file mode 100644 (file)
index 0000000..18f4f17
--- /dev/null
@@ -0,0 +1,54 @@
+---
+title: no-buffer-constructor
+layout: doc
+rule_type: problem
+further_reading:
+- https://nodejs.org/api/buffer.html
+- https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md
+- https://github.com/nodejs/node/issues/4660
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In Node.js, the behavior of the `Buffer` constructor is different depending on the type of its argument. Passing an argument from user input to `Buffer()` without validating its type can lead to security vulnerabilities such as remote memory disclosure and denial of service. As a result, the `Buffer` constructor has been deprecated and should not be used. Use the producer methods `Buffer.from`, `Buffer.alloc`, and `Buffer.allocUnsafe` instead.
+
+## Rule Details
+
+This rule disallows calling and constructing the `Buffer()` constructor.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+new Buffer(5);
+new Buffer([1, 2, 3]);
+
+Buffer(5);
+Buffer([1, 2, 3]);
+
+new Buffer(res.body.amount);
+new Buffer(res.body.values);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+Buffer.alloc(5);
+Buffer.allocUnsafe(5);
+Buffer.from([1, 2, 3]);
+
+Buffer.alloc(res.body.amount);
+Buffer.from(res.body.values);
+```
+
+:::
+
+## When Not To Use It
+
+If you don't use Node.js, or you still need to support versions of Node.js that lack methods like `Buffer.from`, then you should not enable this rule.
diff --git a/eslint/docs/src/rules/no-caller.md b/eslint/docs/src/rules/no-caller.md
new file mode 100644 (file)
index 0000000..5a1e2b7
--- /dev/null
@@ -0,0 +1,62 @@
+---
+title: no-caller
+layout: doc
+rule_type: suggestion
+---
+
+
+The use of `arguments.caller` and `arguments.callee` make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode.
+
+```js
+function foo() {
+    var callee = arguments.callee;
+}
+```
+
+## Rule Details
+
+This rule is aimed at discouraging the use of deprecated and sub-optimal code by disallowing the use of `arguments.caller` and `arguments.callee`. As such, it will warn when `arguments.caller` and `arguments.callee` are used.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-caller: "error"*/
+
+function foo(n) {
+    if (n <= 0) {
+        return;
+    }
+
+    arguments.callee(n - 1);
+}
+
+[1,2,3,4,5].map(function(n) {
+    return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-caller: "error"*/
+
+function foo(n) {
+    if (n <= 0) {
+        return;
+    }
+
+    foo(n - 1);
+}
+
+[1,2,3,4,5].map(function factorial(n) {
+    return !(n > 1) ? 1 : factorial(n - 1) * n;
+});
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-case-declarations.md b/eslint/docs/src/rules/no-case-declarations.md
new file mode 100644 (file)
index 0000000..b9aa9b5
--- /dev/null
@@ -0,0 +1,87 @@
+---
+title: no-case-declarations
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-fallthrough
+---
+
+
+
+This rule disallows lexical declarations (`let`, `const`, `function` and `class`)
+in `case`/`default` clauses. The reason is that the lexical declaration is visible
+in the entire switch block but it only gets initialized when it is assigned, which
+will only happen if the case where it is defined is reached.
+
+To ensure that the lexical declaration only applies to the current case clause
+wrap your clauses in blocks.
+
+## Rule Details
+
+This rule aims to prevent access to uninitialized lexical bindings as well as accessing hoisted functions across case clauses.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-case-declarations: "error"*/
+/*eslint-env es6*/
+
+switch (foo) {
+    case 1:
+        let x = 1;
+        break;
+    case 2:
+        const y = 2;
+        break;
+    case 3:
+        function f() {}
+        break;
+    default:
+        class C {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-case-declarations: "error"*/
+/*eslint-env es6*/
+
+// Declarations outside switch-statements are valid
+const a = 0;
+
+switch (foo) {
+    // The following case clauses are wrapped into blocks using brackets
+    case 1: {
+        let x = 1;
+        break;
+    }
+    case 2: {
+        const y = 2;
+        break;
+    }
+    case 3: {
+        function f() {}
+        break;
+    }
+    case 4:
+        // Declarations using var without brackets are valid due to function-scope hoisting
+        var z = 4;
+        break;
+    default: {
+        class C {}
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you depend on fall through behavior and want access to bindings introduced in the case block.
diff --git a/eslint/docs/src/rules/no-catch-shadow.md b/eslint/docs/src/rules/no-catch-shadow.md
new file mode 100644 (file)
index 0000000..abf86b9
--- /dev/null
@@ -0,0 +1,86 @@
+---
+title: no-catch-shadow
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v5.1.0.
+
+In IE 8 and earlier, the catch clause parameter can overwrite the value of a variable in the outer scope, if that variable has the same name as the catch clause parameter.
+
+```js
+var err = "x";
+
+try {
+    throw "problem";
+} catch (err) {
+
+}
+
+console.log(err)    // err is 'problem', not 'x'
+```
+
+## Rule Details
+
+This rule is aimed at preventing unexpected behavior in your program that may arise from a bug in IE 8 and earlier, in which the catch clause parameter can leak into outer scopes. This rule will warn whenever it encounters a catch clause parameter that has the same name as a variable in an outer scope.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-catch-shadow: "error"*/
+
+var err = "x";
+
+try {
+    throw "problem";
+} catch (err) {
+
+}
+
+function err() {
+    // ...
+};
+
+try {
+    throw "problem";
+} catch (err) {
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-catch-shadow: "error"*/
+
+var err = "x";
+
+try {
+    throw "problem";
+} catch (e) {
+
+}
+
+function err() {
+    // ...
+};
+
+try {
+    throw "problem";
+} catch (e) {
+
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you do not need to support IE 8 and earlier, you should turn this rule off.
diff --git a/eslint/docs/src/rules/no-class-assign.md b/eslint/docs/src/rules/no-class-assign.md
new file mode 100644 (file)
index 0000000..153be8e
--- /dev/null
@@ -0,0 +1,127 @@
+---
+title: no-class-assign
+layout: doc
+rule_type: problem
+---
+
+
+
+`ClassDeclaration` creates a variable, and we can modify the variable.
+
+```js
+/*eslint-env es6*/
+
+class A { }
+A = 0;
+```
+
+But the modification is a mistake in most cases.
+
+## Rule Details
+
+This rule is aimed to flag modifying variables of class declarations.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+class A { }
+A = 0;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+A = 0;
+class A { }
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+class A {
+    b() {
+        A = 0;
+    }
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+let A = class A {
+    b() {
+        A = 0;
+        // `let A` is shadowed by the class name.
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+let A = class A { }
+A = 0; // A is a variable.
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-class-assign: "error"*/
+/*eslint-env es6*/
+
+let A = class {
+    b() {
+        A = 0; // A is a variable.
+    }
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-class-assign: 2*/
+/*eslint-env es6*/
+
+class A {
+    b(A) {
+        A = 0; // A is a parameter.
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about modifying variables of class declarations, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-comma-dangle.md b/eslint/docs/src/rules/no-comma-dangle.md
new file mode 100644 (file)
index 0000000..de0faf7
--- /dev/null
@@ -0,0 +1,66 @@
+---
+title: no-comma-dangle
+layout: doc
+
+---
+
+Disallows trailing commas in object and array literals.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [comma-dangle](comma-dangle) rule.
+
+Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec, however IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript.
+
+```js
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+```
+
+## Rule Details
+
+This rule is aimed at detecting trailing commas in object literals. As such, it will warn whenever it encounters a trailing comma in an object literal.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var foo = {
+    bar: "baz",
+    qux: "quux",
+};
+
+var arr = [1,2,];
+
+foo({
+  bar: "baz",
+  qux: "quux",
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+var foo = {
+    bar: "baz",
+    qux: "quux"
+};
+
+var arr = [1,2];
+
+foo({
+  bar: "baz",
+  qux: "quux"
+});
+```
+
+:::
+
+## When Not To Use It
+
+If your code will not be run in IE8 or below (a Node.js application, for example) and you'd prefer to allow trailing commas, turn this rule off.
diff --git a/eslint/docs/src/rules/no-compare-neg-zero.md b/eslint/docs/src/rules/no-compare-neg-zero.md
new file mode 100644 (file)
index 0000000..5d7da2a
--- /dev/null
@@ -0,0 +1,51 @@
+---
+title: no-compare-neg-zero
+layout: doc
+rule_type: problem
+---
+
+
+
+## Rule Details
+
+The rule should warn against code that tries to compare against `-0`, since that will not work as intended. That is, code like `x === -0` will pass for both `+0` and `-0`. The author probably intended `Object.is(x, -0)`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint no-compare-neg-zero: "error" */
+
+if (x === -0) {
+    // doSomething()...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint no-compare-neg-zero: "error" */
+
+if (x === 0) {
+    // doSomething()...
+}
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint no-compare-neg-zero: "error" */
+
+if (Object.is(x, -0)) {
+    // doSomething()...
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-cond-assign.md b/eslint/docs/src/rules/no-cond-assign.md
new file mode 100644 (file)
index 0000000..af04548
--- /dev/null
@@ -0,0 +1,147 @@
+---
+title: no-cond-assign
+layout: doc
+rule_type: problem
+related_rules:
+- no-extra-parens
+---
+
+
+
+In conditional statements, it is very easy to mistype a comparison operator (such as `==`) as an assignment operator (such as `=`). For example:
+
+```js
+// Check the user's job title
+if (user.jobTitle = "manager") {
+    // user.jobTitle is now incorrect
+}
+```
+
+There are valid reasons to use assignment operators in conditional statements. However, it can be difficult to tell whether a specific assignment was intentional.
+
+## Rule Details
+
+This rule disallows ambiguous assignment operators in test conditions of `if`, `for`, `while`, and `do...while` statements.
+
+## Options
+
+This rule has a string option:
+
+* `"except-parens"` (default) allows assignments in test conditions *only if* they are enclosed in parentheses (for example, to allow reassigning a variable in the test of a `while` or `do...while` loop)
+* `"always"` disallows all assignments in test conditions
+
+### except-parens
+
+Examples of **incorrect** code for this rule with the default `"except-parens"` option:
+
+::: incorrect
+
+```js
+/*eslint no-cond-assign: "error"*/
+
+// Unintentional assignment
+var x;
+if (x = 0) {
+    var b = 1;
+}
+
+// Practical example that is similar to an error
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while (someNode = someNode.parentNode);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"except-parens"` option:
+
+::: correct
+
+```js
+/*eslint no-cond-assign: "error"*/
+
+// Assignment replaced by comparison
+var x;
+if (x === 0) {
+    var b = 1;
+}
+
+// Practical example that wraps the assignment in parentheses
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while ((someNode = someNode.parentNode));
+}
+
+// Practical example that wraps the assignment and tests for 'null'
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while ((someNode = someNode.parentNode) !== null);
+}
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint no-cond-assign: ["error", "always"]*/
+
+// Unintentional assignment
+var x;
+if (x = 0) {
+    var b = 1;
+}
+
+// Practical example that is similar to an error
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while (someNode = someNode.parentNode);
+}
+
+// Practical example that wraps the assignment in parentheses
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while ((someNode = someNode.parentNode));
+}
+
+// Practical example that wraps the assignment and tests for 'null'
+function setHeight(someNode) {
+    "use strict";
+    do {
+        someNode.height = "100px";
+    } while ((someNode = someNode.parentNode) !== null);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint no-cond-assign: ["error", "always"]*/
+
+// Assignment replaced by comparison
+var x;
+if (x === 0) {
+    var b = 1;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-confusing-arrow.md b/eslint/docs/src/rules/no-confusing-arrow.md
new file mode 100644 (file)
index 0000000..18d0563
--- /dev/null
@@ -0,0 +1,113 @@
+---
+title: no-confusing-arrow
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-constant-condition
+- arrow-parens
+---
+
+
+
+Arrow functions (`=>`) are similar in syntax to some comparison operators (`>`, `<`, `<=`, and `>=`). This rule warns against using the arrow function syntax in places where it could be confused with a comparison operator.
+
+Here's an example where the usage of `=>` could be confusing:
+
+```js
+// The intent is not clear
+var x = a => 1 ? 2 : 3;
+// Did the author mean this
+var x = function (a) {
+    return 1 ? 2 : 3;
+};
+// Or this
+var x = a <= 1 ? 2 : 3;
+```
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-confusing-arrow: "error"*/
+/*eslint-env es6*/
+
+var x = a => 1 ? 2 : 3;
+var x = (a) => 1 ? 2 : 3;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-confusing-arrow: "error"*/
+/*eslint-env es6*/
+var x = a => (1 ? 2 : 3);
+var x = (a) => (1 ? 2 : 3);
+var x = (a) => {
+    return 1 ? 2 : 3;
+};
+var x = a => { return 1 ? 2 : 3; };
+```
+
+:::
+
+## Options
+
+This rule accepts two options argument with the following defaults:
+
+```json
+{
+    "rules": {
+        "no-confusing-arrow": [
+            "error",
+            { "allowParens": true, "onlyOneSimpleParam": false }
+        ]
+    }
+}
+```
+
+`allowParens` is a boolean setting that can be `true`(default) or `false`:
+
+1. `true` relaxes the rule and accepts parenthesis as a valid "confusion-preventing" syntax.
+2. `false` warns even if the expression is wrapped in parenthesis
+
+Examples of **incorrect** code for this rule with the `{"allowParens": false}` option:
+
+::: incorrect
+
+```js
+/*eslint no-confusing-arrow: ["error", {"allowParens": false}]*/
+/*eslint-env es6*/
+var x = a => (1 ? 2 : 3);
+var x = (a) => (1 ? 2 : 3);
+```
+
+:::
+
+`onlyOneSimpleParam` is a boolean setting that can be `true` or `false`(default):
+
+1. `true` relaxes the rule and doesn't report errors if the arrow function has 0 or more than 1 parameters, or the parameter is not an identifier.
+2. `false` warns regardless of parameters.
+
+Examples of **correct** code for this rule with the `{"onlyOneSimpleParam": true}` option:
+
+::: correct
+
+```js
+/*eslint no-confusing-arrow: ["error", {"onlyOneSimpleParam": true}]*/
+/*eslint-env es6*/
+() => 1 ? 2 : 3;
+(a, b) => 1 ? 2 : 3;
+(a = b) => 1 ? 2 : 3;
+({ a }) => 1 ? 2 : 3;
+([a]) => 1 ? 2 : 3;
+(...a) => 1 ? 2 : 3;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-console.md b/eslint/docs/src/rules/no-console.md
new file mode 100644 (file)
index 0000000..05a1dfe
--- /dev/null
@@ -0,0 +1,112 @@
+---
+title: no-console
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-alert
+- no-debugger
+---
+
+
+In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on `console`. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using `console` should be stripped before being pushed to production.
+
+```js
+console.log("Made it here.");
+console.error("That shouldn't have happened.");
+```
+
+## Rule Details
+
+This rule disallows calls or assignments to methods of the `console` object.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint no-console: "error" */
+
+console.log("Log a debug level message.");
+console.warn("Log a warn level message.");
+console.error("Log an error level message.");
+console.log = foo();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint no-console: "error" */
+
+// custom console
+Console.log("Hello world!");
+```
+
+:::
+
+## Options
+
+This rule has an object option for exceptions:
+
+* `"allow"` has an array of strings which are allowed methods of the `console` object
+
+Examples of additional **correct** code for this rule with a sample `{ "allow": ["warn", "error"] }` option:
+
+::: correct
+
+```js
+/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
+
+console.warn("Log a warn level message.");
+console.error("Log an error level message.");
+```
+
+:::
+
+## When Not To Use It
+
+If you're using Node.js, however, `console` is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.
+
+Another case where you might not use this rule is if you want to enforce console calls and not console overwrites. For example:
+
+```js
+/* eslint no-console: ["error", { allow: ["warn"] }] */
+console.error = function (message) {
+  throw new Error(message);
+};
+```
+
+With the `no-console` rule in the above example, ESLint will report an error. For the above example, you can disable the rule:
+
+```js
+// eslint-disable-next-line no-console
+console.error = function (message) {
+  throw new Error(message);
+};
+
+// or
+
+console.error = function (message) {  // eslint-disable-line no-console
+  throw new Error(message);
+};
+```
+
+However, you might not want to manually add `eslint-disable-next-line` or `eslint-disable-line`. You can achieve the effect of only receiving errors for console calls with the `no-restricted-syntax` rule:
+
+```json
+{
+    "rules": {
+        "no-console": "off",
+        "no-restricted-syntax": [
+            "error",
+            {
+                "selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
+                "message": "Unexpected property on console object was called"
+            }
+        ]
+    }
+}
+```
diff --git a/eslint/docs/src/rules/no-const-assign.md b/eslint/docs/src/rules/no-const-assign.md
new file mode 100644 (file)
index 0000000..67be27e
--- /dev/null
@@ -0,0 +1,98 @@
+---
+title: no-const-assign
+layout: doc
+rule_type: problem
+---
+
+
+
+We cannot modify variables that are declared using `const` keyword.
+It will raise a runtime error.
+
+Under non ES2015 environment, it might be ignored merely.
+
+## Rule Details
+
+This rule is aimed to flag modifying variables that are declared using `const` keyword.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+const a = 0;
+a = 1;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+const a = 0;
+a += 1;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+const a = 0;
+++a;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+const a = 0;
+console.log(a);
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+for (const a in [1, 2, 3]) { // `a` is re-defined (not modified) on each loop step.
+    console.log(a);
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-const-assign: "error"*/
+/*eslint-env es6*/
+
+for (const a of [1, 2, 3]) { // `a` is re-defined (not modified) on each loop step.
+    console.log(a);
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about modifying variables that are declared using `const` keyword, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-constant-binary-expression.md b/eslint/docs/src/rules/no-constant-binary-expression.md
new file mode 100644 (file)
index 0000000..43deeae
--- /dev/null
@@ -0,0 +1,81 @@
+---
+title: no-constant-binary-expression
+layout: doc
+rule_type: problem
+related_rules:
+- no-constant-condition
+further_reading:
+- https://eslint.org/blog/2022/07/interesting-bugs-caught-by-no-constant-binary-expression/
+---
+
+
+Comparisons which will always evaluate to true or false and logical expressions (`||`, `&&`, `??`) which either always short-circuit or never short-circuit are both likely indications of programmer error.
+
+These errors are especially common in complex expressions where operator precedence is easy to misjudge. For example:
+
+```js
+// One might think this would evaluate as `a + (b ?? c)`:
+const x = a + b ?? c;
+
+// But it actually evaluates as `(a + b) ?? c`. Since `a + b` can never be null,
+// the `?? c` has no effect.
+```
+
+Additionally, this rule detects comparisons to newly constructed objects/arrays/functions/etc. In JavaScript, where objects are compared by reference, a newly constructed object can _never_ `===` any other value. This can be surprising for programmers coming from languages where objects are compared by value.
+
+```js
+// Programmers coming from a language where objects are compared by value might expect this to work:
+const isEmpty = x === [];
+
+// However, this will always result in `isEmpty` being `false`.
+```
+
+## Rule Details
+
+This rule identifies `==` and `===` comparisons which, based on the semantics of the JavaScript language, will always evaluate to `true` or `false`.
+
+It also identifies `||`, `&&` and `??` logical expressions which will either always or never short-circuit.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-constant-binary-expression: "error"*/
+
+const value1 = +x == null;
+
+const value2 = condition ? x : {} || DEFAULT;
+
+const value3 = !foo == null;
+
+const value4 = new Boolean(foo) === true;
+
+const objIsEmpty = someObj === {};
+
+const arrIsEmpty = someArr === [];
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-constant-binary-expression: "error"*/
+
+const value1 = x == null;
+
+const value2 = (condition ? x : {}) || DEFAULT;
+
+const value3 = !(foo == null);
+
+const value4 = Boolean(foo) === true;
+
+const objIsEmpty = Object.keys(someObj).length === 0;
+
+const arrIsEmpty = someArr.length === 0;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-constant-condition.md b/eslint/docs/src/rules/no-constant-condition.md
new file mode 100644 (file)
index 0000000..a3bad57
--- /dev/null
@@ -0,0 +1,145 @@
+---
+title: no-constant-condition
+layout: doc
+rule_type: problem
+related_rules:
+- no-constant-binary-expression
+---
+
+
+
+A constant expression (for example, a literal) as a test condition might be a typo or development trigger for a specific behavior. For example, the following code looks as if it is not ready for production.
+
+```js
+if (false) {
+    doSomethingUnfinished();
+}
+```
+
+## Rule Details
+
+This rule disallows constant expressions in the test condition of:
+
+* `if`, `for`, `while`, or `do...while` statement
+* `?:` ternary expression
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-constant-condition: "error"*/
+
+if (false) {
+    doSomethingUnfinished();
+}
+
+if (void x) {
+    doSomethingUnfinished();
+}
+
+if (x &&= false) {
+    doSomethingNever();
+}
+
+if (class {}) {
+    doSomethingAlways();
+}
+
+if (new Boolean(x)) {
+    doSomethingAlways();
+}
+
+if (Boolean(1)) {
+    doSomethingAlways();
+}
+
+if (undefined) {
+    doSomethingUnfinished();
+}
+
+if (x ||= true) {
+    doSomethingAlways();
+}
+
+for (;-2;) {
+    doSomethingForever();
+}
+
+while (typeof x) {
+    doSomethingForever();
+}
+
+do {
+    doSomethingForever();
+} while (x = -1);
+
+var result = 0 ? a : b;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-constant-condition: "error"*/
+
+if (x === 0) {
+    doSomething();
+}
+
+for (;;) {
+    doSomethingForever();
+}
+
+while (typeof x === "undefined") {
+    doSomething();
+}
+
+do {
+    doSomething();
+} while (x);
+
+var result = x !== 0 ? a : b;
+```
+
+:::
+
+## Options
+
+### checkLoops
+
+Set to `true` by default. Setting this option to `false` allows constant expressions in loops.
+
+Examples of **correct** code for when `checkLoops` is `false`:
+
+::: correct
+
+```js
+/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
+
+while (true) {
+    doSomething();
+    if (condition()) {
+        break;
+    }
+};
+
+for (;true;) {
+    doSomething();
+    if (condition()) {
+        break;
+    }
+};
+
+do {
+    doSomething();
+    if (condition()) {
+        break;
+    }
+} while (true)
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-constructor-return.md b/eslint/docs/src/rules/no-constructor-return.md
new file mode 100644 (file)
index 0000000..1e74eb7
--- /dev/null
@@ -0,0 +1,63 @@
+---
+title: no-constructor-return
+layout: doc
+rule_type: problem
+---
+
+
+In JavaScript, returning a value in the constructor of a class may be a mistake. Forbidding this pattern prevents mistakes resulting from unfamiliarity with the language or a copy-paste error.
+
+## Rule Details
+
+This rule disallows return statements in the constructor of a class. Note that returning nothing with flow control is allowed.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-constructor-return: "error"*/
+
+class A {
+    constructor(a) {
+        this.a = a;
+        return a;
+    }
+}
+
+class B {
+    constructor(f) {
+        if (!f) {
+            return 'falsy';
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-constructor-return: "error"*/
+
+class C {
+    constructor(c) {
+        this.c = c;
+    }
+}
+
+class D {
+    constructor(f) {
+        if (!f) {
+            return;  // Flow control.
+        }
+
+        f();
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-continue.md b/eslint/docs/src/rules/no-continue.md
new file mode 100644 (file)
index 0000000..0753e36
--- /dev/null
@@ -0,0 +1,88 @@
+---
+title: no-continue
+layout: doc
+rule_type: suggestion
+---
+
+
+The `continue` statement terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. When used incorrectly it makes code less testable, less readable and less maintainable. Structured control flow statements such as `if` should be used instead.
+
+```js
+var sum = 0,
+    i;
+
+for(i = 0; i < 10; i++) {
+    if(i >= 5) {
+        continue;
+    }
+
+    a += i;
+}
+```
+
+## Rule Details
+
+This rule disallows `continue` statements.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-continue: "error"*/
+
+var sum = 0,
+    i;
+
+for(i = 0; i < 10; i++) {
+    if(i >= 5) {
+        continue;
+    }
+
+    a += i;
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-continue: "error"*/
+
+var sum = 0,
+    i;
+
+labeledLoop: for(i = 0; i < 10; i++) {
+    if(i >= 5) {
+        continue labeledLoop;
+    }
+
+    a += i;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-continue: "error"*/
+
+var sum = 0,
+    i;
+
+for(i = 0; i < 10; i++) {
+    if(i < 5) {
+       a += i;
+    }
+}
+```
+
+:::
+
+## Compatibility
+
+* **JSLint**: `continue`
diff --git a/eslint/docs/src/rules/no-control-regex.md b/eslint/docs/src/rules/no-control-regex.md
new file mode 100644 (file)
index 0000000..65149cd
--- /dev/null
@@ -0,0 +1,80 @@
+---
+title: no-control-regex
+layout: doc
+rule_type: problem
+related_rules:
+- no-div-regex
+- no-regex-spaces
+---
+
+
+
+Control characters are special, invisible characters in the ASCII range 0-31. These characters are rarely used in JavaScript strings so a regular expression containing elements that explicitly match these characters is most likely a mistake.
+
+## Rule Details
+
+This rule disallows control characters and some escape sequences that match control characters in regular expressions.
+
+The following elements of regular expression patterns are considered possible errors in typing and are therefore disallowed by this rule:
+
+* Hexadecimal character escapes from `\x00` to `\x1F`.
+* Unicode character escapes from `\u0000` to `\u001F`.
+* Unicode code point escapes from `\u{0}` to `\u{1F}`.
+* Unescaped raw characters from U+0000 to U+001F.
+
+Control escapes such as `\t` and `\n` are allowed by this rule.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-control-regex: "error"*/
+
+var pattern1 = /\x00/;
+var pattern2 = /\x0C/;
+var pattern3 = /\x1F/;
+var pattern4 = /\u000C/;
+var pattern5 = /\u{C}/u;
+var pattern6 = new RegExp("\x0C"); // raw U+000C character in the pattern
+var pattern7 = new RegExp("\\x0C"); // \x0C pattern
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-control-regex: "error"*/
+
+var pattern1 = /\x20/;
+var pattern2 = /\u0020/;
+var pattern3 = /\u{20}/u;
+var pattern4 = /\t/;
+var pattern5 = /\n/;
+var pattern6 = new RegExp("\x20");
+var pattern7 = new RegExp("\\t");
+var pattern8 = new RegExp("\\n");
+```
+
+:::
+
+## Known Limitations
+
+When checking `RegExp` constructor calls, this rule examines evaluated regular expression patterns. Therefore, although this rule intends to allow syntax such as `\t`, it doesn't allow `new RegExp("\t")` since the evaluated pattern (string value of `"\t"`) contains a raw control character (the TAB character).
+
+```js
+/*eslint no-control-regex: "error"*/
+
+new RegExp("\t"); // disallowed since the pattern is: <TAB>
+
+new RegExp("\\t"); // allowed since the pattern is: \t
+```
+
+There is no difference in behavior between `new RegExp("\t")` and `new RegExp("\\t")`, and the intention to match the TAB character is clear in both cases. They are equally valid for the purpose of this rule, but it only allows `new RegExp("\\t")`.
+
+## When Not To Use It
+
+If you need to use control character pattern matching, then you should turn this rule off.
diff --git a/eslint/docs/src/rules/no-debugger.md b/eslint/docs/src/rules/no-debugger.md
new file mode 100644 (file)
index 0000000..07da9b8
--- /dev/null
@@ -0,0 +1,51 @@
+---
+title: no-debugger
+layout: doc
+rule_type: problem
+related_rules:
+- no-alert
+- no-console
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
+---
+
+
+
+The `debugger` statement is used to tell the executing JavaScript environment to stop execution and start up a debugger at the current point in the code. This has fallen out of favor as a good practice with the advent of modern debugging and development tools. Production code should definitely not contain `debugger`, as it will cause the browser to stop executing code and open an appropriate debugger.
+
+## Rule Details
+
+This rule disallows `debugger` statements.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-debugger: "error"*/
+
+function isTruthy(x) {
+    debugger;
+    return Boolean(x);
+}
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-debugger: "error"*/
+
+function isTruthy(x) {
+    return Boolean(x); // set a breakpoint at this line
+}
+```
+
+:::
+
+## When Not To Use It
+
+If your code is still very much in development and don't want to worry about stripping `debugger` statements, then turn this rule off. You'll generally want to turn it back on when testing code prior to deployment.
diff --git a/eslint/docs/src/rules/no-delete-var.md b/eslint/docs/src/rules/no-delete-var.md
new file mode 100644 (file)
index 0000000..8d5f680
--- /dev/null
@@ -0,0 +1,28 @@
+---
+title: no-delete-var
+layout: doc
+rule_type: suggestion
+---
+
+
+
+The purpose of the `delete` operator is to remove a property from an object. Using the `delete` operator on a variable might lead to unexpected behavior.
+
+## Rule Details
+
+This rule disallows the use of the `delete` operator on variables.
+
+If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-delete-var: "error"*/
+
+var x;
+delete x;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-div-regex.md b/eslint/docs/src/rules/no-div-regex.md
new file mode 100644 (file)
index 0000000..d44b3dd
--- /dev/null
@@ -0,0 +1,44 @@
+---
+title: no-div-regex
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-control-regex
+- no-regex-spaces
+---
+
+
+
+Require regex literals to escape division operators.
+
+```js
+function bar() { return /=foo/; }
+```
+
+## Rule Details
+
+This is used to disambiguate the division operator to not confuse users.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-div-regex: "error"*/
+
+function bar() { return /=foo/; }
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint no-div-regex: "error"*/
+
+function bar() { return /[=]foo/; }
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-dupe-args.md b/eslint/docs/src/rules/no-dupe-args.md
new file mode 100644 (file)
index 0000000..84ca185
--- /dev/null
@@ -0,0 +1,51 @@
+---
+title: no-dupe-args
+layout: doc
+rule_type: problem
+---
+
+
+
+If more than one parameter has the same name in a function definition, the last occurrence "shadows" the preceding occurrences. A duplicated name might be a typing error.
+
+## Rule Details
+
+This rule disallows duplicate parameter names in function declarations or expressions. It does not apply to arrow functions or class methods, because the parser reports the error.
+
+If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-dupe-args: "error"*/
+
+function foo(a, b, a) {
+    console.log("value of the second a:", a);
+}
+
+var bar = function (a, b, a) {
+    console.log("value of the second a:", a);
+};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-dupe-args: "error"*/
+
+function foo(a, b, c) {
+    console.log(a, b, c);
+}
+
+var bar = function (a, b, c) {
+    console.log(a, b, c);
+};
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-dupe-class-members.md b/eslint/docs/src/rules/no-dupe-class-members.md
new file mode 100644 (file)
index 0000000..91b096f
--- /dev/null
@@ -0,0 +1,106 @@
+---
+title: no-dupe-class-members
+layout: doc
+rule_type: problem
+---
+
+
+
+If there are declarations of the same name in class members, the last declaration overwrites other declarations silently.
+It can cause unexpected behaviors.
+
+```js
+/*eslint-env es6*/
+
+class Foo {
+  bar() { console.log("hello"); }
+  bar() { console.log("goodbye"); }
+}
+
+var foo = new Foo();
+foo.bar(); // goodbye
+```
+
+## Rule Details
+
+This rule is aimed to flag the use of duplicate names in class members.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-dupe-class-members: "error"*/
+
+class Foo {
+  bar() { }
+  bar() { }
+}
+
+class Foo {
+  bar() { }
+  get bar() { }
+}
+
+class Foo {
+  bar;
+  bar;
+}
+
+class Foo {
+  bar;
+  bar() { }
+}
+
+class Foo {
+  static bar() { }
+  static bar() { }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-dupe-class-members: "error"*/
+
+class Foo {
+  bar() { }
+  qux() { }
+}
+
+class Foo {
+  get bar() { }
+  set bar(value) { }
+}
+
+class Foo {
+  bar;
+  qux;
+}
+
+class Foo {
+  bar;
+  qux() { }
+}
+
+class Foo {
+  static bar() { }
+  bar() { }
+}
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+
+In ES2015 (ES6) or later, if you don't want to be notified about duplicate names in class members, you can safely disable this rule.
+
+It's also safe to disable this rule when using TypeScript because TypeScript's compiler already checks for duplicate function implementations.
diff --git a/eslint/docs/src/rules/no-dupe-else-if.md b/eslint/docs/src/rules/no-dupe-else-if.md
new file mode 100644 (file)
index 0000000..2ab75a6
--- /dev/null
@@ -0,0 +1,194 @@
+---
+title: no-dupe-else-if
+layout: doc
+rule_type: problem
+related_rules:
+- no-duplicate-case
+- no-lonely-if
+---
+
+
+
+`if-else-if` chains are commonly used when there is a need to execute only one branch (or at most one branch) out of several possible branches, based on certain conditions.
+
+```js
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (c) {
+    baz();
+}
+```
+
+Two identical test conditions in the same chain are almost always a mistake in the code. Unless there are side effects in the expressions, a duplicate will evaluate to the same `true` or `false` value as the identical expression earlier in the chain, meaning that its branch can never execute.
+
+```js
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (b) {
+    baz();
+}
+```
+
+In the above example, `baz()` can never execute. Obviously, `baz()` could be executed only when `b` evaluates to `true`, but in that case `bar()` would be executed instead, since it's earlier in the chain.
+
+## Rule Details
+
+This rule disallows duplicate conditions in the same `if-else-if` chain.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-dupe-else-if: "error"*/
+
+if (isSomething(x)) {
+    foo();
+} else if (isSomething(x)) {
+    bar();
+}
+
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (c && d) {
+    baz();
+} else if (c && d) {
+    quux();
+} else {
+    quuux();
+}
+
+if (n === 1) {
+    foo();
+} else if (n === 2) {
+    bar();
+} else if (n === 3) {
+    baz();
+} else if (n === 2) {
+    quux();
+} else if (n === 5) {
+    quuux();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-dupe-else-if: "error"*/
+
+if (isSomething(x)) {
+    foo();
+} else if (isSomethingElse(x)) {
+    bar();
+}
+
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (c && d) {
+    baz();
+} else if (c && e) {
+    quux();
+} else {
+    quuux();
+}
+
+if (n === 1) {
+    foo();
+} else if (n === 2) {
+    bar();
+} else if (n === 3) {
+    baz();
+} else if (n === 4) {
+    quux();
+} else if (n === 5) {
+    quuux();
+}
+```
+
+:::
+
+This rule can also detect some cases where the conditions are not identical, but the branch can never execute due to the logic of `||` and `&&` operators.
+
+Examples of additional **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-dupe-else-if: "error"*/
+
+if (a || b) {
+    foo();
+} else if (a) {
+    bar();
+}
+
+if (a) {
+    foo();
+} else if (b) {
+    bar();
+} else if (a || b) {
+    baz();
+}
+
+if (a) {
+    foo();
+} else if (a && b) {
+    bar();
+}
+
+if (a && b) {
+    foo();
+} else if (a && b && c) {
+    bar();
+}
+
+if (a || b) {
+    foo();
+} else if (b && c) {
+    bar();
+}
+
+if (a) {
+    foo();
+} else if (b && c) {
+    bar();
+} else if (d && (c && e && b || a)) {
+    baz();
+}
+```
+
+:::
+
+Please note that this rule does not compare conditions from the chain with conditions inside statements, and will not warn in the cases such as follows:
+
+```js
+if (a) {
+    if (a) {
+        foo();
+    }
+}
+
+if (a) {
+    foo();
+} else {
+    if (a) {
+        bar();
+    }
+}
+```
+
+## When Not To Use It
+
+In rare cases where you really need identical test conditions in the same chain, which necessarily means that the expressions in the chain are causing and relying on side effects, you will have to turn this rule off.
diff --git a/eslint/docs/src/rules/no-dupe-keys.md b/eslint/docs/src/rules/no-dupe-keys.md
new file mode 100644 (file)
index 0000000..aa33693
--- /dev/null
@@ -0,0 +1,60 @@
+---
+title: no-dupe-keys
+layout: doc
+rule_type: problem
+---
+
+
+
+Multiple properties with the same key in object literals can cause unexpected behavior in your application.
+
+```js
+var foo = {
+    bar: "baz",
+    bar: "qux"
+};
+```
+
+## Rule Details
+
+This rule disallows duplicate keys in object literals.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-dupe-keys: "error"*/
+
+var foo = {
+    bar: "baz",
+    bar: "qux"
+};
+
+var foo = {
+    "bar": "baz",
+    bar: "qux"
+};
+
+var foo = {
+    0x1: "baz",
+    1: "qux"
+};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-dupe-keys: "error"*/
+
+var foo = {
+    bar: "baz",
+    quxx: "qux"
+};
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-duplicate-case.md b/eslint/docs/src/rules/no-duplicate-case.md
new file mode 100644 (file)
index 0000000..26ffeb0
--- /dev/null
@@ -0,0 +1,120 @@
+---
+title: no-duplicate-case
+layout: doc
+rule_type: problem
+---
+
+
+
+If a `switch` statement has duplicate test expressions in `case` clauses, it is likely that a programmer copied a `case` clause but forgot to change the test expression.
+
+## Rule Details
+
+This rule disallows duplicate test expressions in `case` clauses of `switch` statements.
+
+Examples of **incorrect** code for this rule:
+
+:::incorrect
+
+```js
+/*eslint no-duplicate-case: "error"*/
+
+var a = 1,
+    one = 1;
+
+switch (a) {
+    case 1:
+        break;
+    case 2:
+        break;
+    case 1:         // duplicate test expression
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case one:
+        break;
+    case 2:
+        break;
+    case one:         // duplicate test expression
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case "1":
+        break;
+    case "2":
+        break;
+    case "1":         // duplicate test expression
+        break;
+    default:
+        break;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+:::correct
+
+```js
+/*eslint no-duplicate-case: "error"*/
+
+var a = 1,
+    one = 1;
+
+switch (a) {
+    case 1:
+        break;
+    case 2:
+        break;
+    case 3:
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case one:
+        break;
+    case 2:
+        break;
+    case 3:
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case "1":
+        break;
+    case "2":
+        break;
+    case "3":
+        break;
+    default:
+        break;
+}
+```
+
+:::
+
+## When Not To Use It
+
+In rare cases where identical test expressions in `case` clauses produce different values, which necessarily means that the expressions are causing and relying on side effects, you will have to disable this rule.
+
+```js
+switch (a) {
+    case i++:
+        foo();
+        break;
+    case i++: // eslint-disable-line no-duplicate-case
+        bar();
+        break;
+}
+```
diff --git a/eslint/docs/src/rules/no-duplicate-imports.md b/eslint/docs/src/rules/no-duplicate-imports.md
new file mode 100644 (file)
index 0000000..c94a178
--- /dev/null
@@ -0,0 +1,113 @@
+---
+title: no-duplicate-imports
+layout: doc
+rule_type: problem
+---
+
+
+Using a single `import` statement per module will make the code clearer because you can see everything being imported from that module on one line.
+
+In the following example the `module` import on line 1 is repeated on line 3. These can be combined to make the list of imports more succinct.
+
+```js
+import { merge } from 'module';
+import something from 'another-module';
+import { find } from 'module';
+```
+
+## Rule Details
+
+This rule requires that all imports from a single module that can be merged exist in a single `import` statement.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-duplicate-imports: "error"*/
+
+import { merge } from 'module';
+import something from 'another-module';
+import { find } from 'module';
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-duplicate-imports: "error"*/
+
+import { merge, find } from 'module';
+import something from 'another-module';
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-duplicate-imports: "error"*/
+
+// not mergeable
+import { merge } from 'module';
+import * as something from 'module';
+```
+
+:::
+
+## Options
+
+This rule takes one optional argument, an object with a single key, `includeExports` which is a `boolean`. It defaults to `false`.
+
+If re-exporting from an imported module, you should add the imports to the `import`-statement, and export that directly, not use `export ... from`.
+
+Example of **incorrect** code for this rule with the `{ "includeExports": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
+
+import { merge } from 'module';
+
+export { find } from 'module';
+```
+
+:::
+
+Example of **correct** code for this rule with the `{ "includeExports": true }` option:
+
+::: correct
+
+```js
+/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
+
+import { merge, find } from 'module';
+
+export { find };
+```
+
+:::
+
+Example of **correct** code for this rule with the `{ "includeExports": true }` option:
+
+::: correct
+
+```js
+/*eslint no-duplicate-imports: ["error", { "includeExports": true }]*/
+
+import { merge, find } from 'module';
+
+// cannot be merged with the above import
+export * as something from 'module';
+
+// cannot be written differently
+export * from 'module';
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-else-return.md b/eslint/docs/src/rules/no-else-return.md
new file mode 100644 (file)
index 0000000..c67c5f3
--- /dev/null
@@ -0,0 +1,179 @@
+---
+title: no-else-return
+layout: doc
+rule_type: suggestion
+---
+
+
+
+If an `if` block contains a `return` statement, the `else` block becomes unnecessary. Its contents can be placed outside of the block.
+
+```js
+function foo() {
+    if (x) {
+        return y;
+    } else {
+        return z;
+    }
+}
+```
+
+## Rule Details
+
+This rule is aimed at highlighting an unnecessary block of code following an `if` containing a return statement. As such, it will warn when it encounters an `else` following a chain of `if`s, all of them containing a `return` statement.
+
+## Options
+
+This rule has an object option:
+
+* `allowElseIf: true` (default) allows `else if` blocks after a return
+* `allowElseIf: false` disallows `else if` blocks after a return
+
+### `allowElseIf: true`
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-else-return: "error"*/
+
+function foo() {
+    if (x) {
+        return y;
+    } else {
+        return z;
+    }
+}
+
+function foo() {
+    if (x) {
+        return y;
+    } else if (z) {
+        return w;
+    } else {
+        return t;
+    }
+}
+
+function foo() {
+    if (x) {
+        return y;
+    } else {
+        var t = "foo";
+    }
+
+    return t;
+}
+
+function foo() {
+    if (error) {
+        return 'It failed';
+    } else {
+        if (loading) {
+            return "It's still loading";
+        }
+    }
+}
+
+// Two warnings for nested occurrences
+function foo() {
+    if (x) {
+        if (y) {
+            return y;
+        } else {
+            return x;
+        }
+    } else {
+        return z;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-else-return: "error"*/
+
+function foo() {
+    if (x) {
+        return y;
+    }
+
+    return z;
+}
+
+function foo() {
+    if (x) {
+        return y;
+    } else if (z) {
+        var t = "foo";
+    } else {
+        return w;
+    }
+}
+
+function foo() {
+    if (x) {
+        if (z) {
+            return y;
+        }
+    } else {
+        return z;
+    }
+}
+
+function foo() {
+    if (error) {
+        return 'It failed';
+    } else if (loading) {
+        return "It's still loading";
+    }
+}
+```
+
+:::
+
+### `allowElseIf: false`
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-else-return: ["error", {allowElseIf: false}]*/
+
+function foo() {
+    if (error) {
+        return 'It failed';
+    } else if (loading) {
+        return "It's still loading";
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-else-return: ["error", {allowElseIf: false}]*/
+
+function foo() {
+    if (error) {
+        return 'It failed';
+    }
+
+    if (loading) {
+        return "It's still loading";
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-empty-character-class.md b/eslint/docs/src/rules/no-empty-character-class.md
new file mode 100644 (file)
index 0000000..d916950
--- /dev/null
@@ -0,0 +1,58 @@
+---
+title: no-empty-character-class
+layout: doc
+rule_type: problem
+---
+
+
+
+Because empty character classes in regular expressions do not match anything, they might be typing mistakes.
+
+```js
+var foo = /^abc[]/;
+```
+
+## Rule Details
+
+This rule disallows empty character classes in regular expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-empty-character-class: "error"*/
+
+/^abc[]/.test("abcdefg"); // false
+"abcdefg".match(/^abc[]/); // null
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-empty-character-class: "error"*/
+
+/^abc/.test("abcdefg"); // true
+"abcdefg".match(/^abc/); // ["abc"]
+
+/^abc[a-z]/.test("abcdefg"); // true
+"abcdefg".match(/^abc[a-z]/); // ["abcd"]
+```
+
+:::
+
+## Known Limitations
+
+This rule does not report empty character classes in the string argument of calls to the `RegExp` constructor.
+
+Example of a *false negative* when this rule reports correct code:
+
+```js
+/*eslint no-empty-character-class: "error"*/
+
+var abcNeverMatches = new RegExp("^abc[]");
+```
diff --git a/eslint/docs/src/rules/no-empty-class.md b/eslint/docs/src/rules/no-empty-class.md
new file mode 100644 (file)
index 0000000..4326054
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: no-empty-class
+layout: doc
+
+---
+
+Disallows empty character classes in regular expressions.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [no-empty-character-class](no-empty-character-class) rule.
+
+Empty character classes in regular expressions do not match anything and can result in code that may not work as intended.
+
+```js
+var foo = /^abc[]/;
+```
+
+## Rule Details
+
+This rule is aimed at highlighting possible typos and unexpected behavior in regular expressions which may arise from the use of empty character classes.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var foo = /^abc[]/;
+
+/^abc[]/.test(foo);
+
+bar.match(/^abc[]/);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+var foo = /^abc/;
+
+var foo = /^abc[a-z]/;
+
+var bar = new RegExp("^abc[]");
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-empty-function.md b/eslint/docs/src/rules/no-empty-function.md
new file mode 100644 (file)
index 0000000..6542317
--- /dev/null
@@ -0,0 +1,398 @@
+---
+title: no-empty-function
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-empty
+---
+
+
+Empty functions can reduce readability because readers need to guess whether it's intentional or not.
+So writing a clear comment for empty functions is a good practice.
+
+```js
+function foo() {
+    // do nothing.
+}
+```
+
+Especially, the empty block of arrow functions might be confusing developers.
+It's very similar to an empty object literal.
+
+```js
+list.map(() => {});   // This is a block, would return undefined.
+list.map(() => ({})); // This is an empty object.
+```
+
+## Rule Details
+
+This rule is aimed at eliminating empty functions.
+A function will not be considered a problem if it contains a comment.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-empty-function: "error"*/
+/*eslint-env es6*/
+
+function foo() {}
+
+var foo = function() {};
+
+var foo = () => {};
+
+function* foo() {}
+
+var foo = function*() {};
+
+var obj = {
+    foo: function() {},
+
+    foo: function*() {},
+
+    foo() {},
+
+    *foo() {},
+
+    get foo() {},
+
+    set foo(value) {}
+};
+
+class A {
+    constructor() {}
+
+    foo() {}
+
+    *foo() {}
+
+    get foo() {}
+
+    set foo(value) {}
+
+    static foo() {}
+
+    static *foo() {}
+
+    static get foo() {}
+
+    static set foo(value) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-empty-function: "error"*/
+/*eslint-env es6*/
+
+function foo() {
+    // do nothing.
+}
+
+var foo = function() {
+    // any clear comments.
+};
+
+var foo = () => {
+    bar();
+};
+
+function* foo() {
+    // do nothing.
+}
+
+var foo = function*() {
+    // do nothing.
+};
+
+var obj = {
+    foo: function() {
+        // do nothing.
+    },
+
+    foo: function*() {
+        // do nothing.
+    },
+
+    foo() {
+        // do nothing.
+    },
+
+    *foo() {
+        // do nothing.
+    },
+
+    get foo() {
+        // do nothing.
+    },
+
+    set foo(value) {
+        // do nothing.
+    }
+};
+
+class A {
+    constructor() {
+        // do nothing.
+    }
+
+    foo() {
+        // do nothing.
+    }
+
+    *foo() {
+        // do nothing.
+    }
+
+    get foo() {
+        // do nothing.
+    }
+
+    set foo(value) {
+        // do nothing.
+    }
+
+    static foo() {
+        // do nothing.
+    }
+
+    static *foo() {
+        // do nothing.
+    }
+
+    static get foo() {
+        // do nothing.
+    }
+
+    static set foo(value) {
+        // do nothing.
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has an option to allow specific kinds of functions to be empty.
+
+* `allow` (`string[]`) - A list of kind to allow empty functions. List items are some of the following strings. An empty array (`[]`) by default.
+    * `"functions"` - Normal functions.
+    * `"arrowFunctions"` - Arrow functions.
+    * `"generatorFunctions"` - Generator functions.
+    * `"methods"` - Class methods and method shorthands of object literals.
+    * `"generatorMethods"` - Class methods and method shorthands of object literals with generator.
+    * `"getters"` - Getters.
+    * `"setters"` - Setters.
+    * `"constructors"` - Class constructors.
+    * `"asyncFunctions"` - Async functions.
+    * `"asyncMethods"` - Async class methods and method shorthands of object literals.
+
+### allow: functions
+
+Examples of **correct** code for the `{ "allow": ["functions"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["functions"] }]*/
+
+function foo() {}
+
+var foo = function() {};
+
+var obj = {
+    foo: function() {}
+};
+```
+
+:::
+
+### allow: arrowFunctions
+
+Examples of **correct** code for the `{ "allow": ["arrowFunctions"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["arrowFunctions"] }]*/
+/*eslint-env es6*/
+
+var foo = () => {};
+```
+
+:::
+
+### allow: generatorFunctions
+
+Examples of **correct** code for the `{ "allow": ["generatorFunctions"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["generatorFunctions"] }]*/
+/*eslint-env es6*/
+
+function* foo() {}
+
+var foo = function*() {};
+
+var obj = {
+    foo: function*() {}
+};
+```
+
+:::
+
+### allow: methods
+
+Examples of **correct** code for the `{ "allow": ["methods"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["methods"] }]*/
+/*eslint-env es6*/
+
+var obj = {
+    foo() {}
+};
+
+class A {
+    foo() {}
+    static foo() {}
+}
+```
+
+:::
+
+### allow: generatorMethods
+
+Examples of **correct** code for the `{ "allow": ["generatorMethods"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["generatorMethods"] }]*/
+/*eslint-env es6*/
+
+var obj = {
+    *foo() {}
+};
+
+class A {
+    *foo() {}
+    static *foo() {}
+}
+```
+
+:::
+
+### allow: getters
+
+Examples of **correct** code for the `{ "allow": ["getters"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["getters"] }]*/
+/*eslint-env es6*/
+
+var obj = {
+    get foo() {}
+};
+
+class A {
+    get foo() {}
+    static get foo() {}
+}
+```
+
+:::
+
+### allow: setters
+
+Examples of **correct** code for the `{ "allow": ["setters"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["setters"] }]*/
+/*eslint-env es6*/
+
+var obj = {
+    set foo(value) {}
+};
+
+class A {
+    set foo(value) {}
+    static set foo(value) {}
+}
+```
+
+:::
+
+### allow: constructors
+
+Examples of **correct** code for the `{ "allow": ["constructors"] }` option:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["constructors"] }]*/
+/*eslint-env es6*/
+
+class A {
+    constructor() {}
+}
+```
+
+:::
+
+### allow: asyncFunctions
+
+Examples of **correct** code for the `{ "allow": ["asyncFunctions"] }` options:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["asyncFunctions"] }]*/
+/*eslint-env es2017*/
+
+async function a(){}
+```
+
+:::
+
+### allow: asyncMethods
+
+Examples of **correct** code for the `{ "allow": ["asyncMethods"] }` options:
+
+::: correct
+
+```js
+/*eslint no-empty-function: ["error", { "allow": ["asyncMethods"] }]*/
+/*eslint-env es2017*/
+
+var obj = {
+    async foo() {}
+};
+
+class A {
+    async foo() {}
+    static async foo() {}
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about empty functions, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-empty-label.md b/eslint/docs/src/rules/no-empty-label.md
new file mode 100644 (file)
index 0000000..6666960
--- /dev/null
@@ -0,0 +1,51 @@
+---
+title: no-empty-label
+layout: doc
+
+related_rules:
+- no-labels
+- no-label-var
+- no-unused-labels
+---
+
+Disallows labels for anything other than loops and switches.
+
+(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [no-labels](no-labels) rule.
+
+Labeled statements are only used in conjunction with labeled break and continue statements. ECMAScript has no goto statement.
+
+## Rule Details
+
+This error occurs when a label is used to mark a statement that is not an iteration or switch
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-empty-label: "error"*/
+
+labeled:
+var x = 10;
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-empty-label: "error"*/
+
+labeled:
+for (var i=10; i; i--) {
+    // ...
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of labels, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-empty-pattern.md b/eslint/docs/src/rules/no-empty-pattern.md
new file mode 100644 (file)
index 0000000..374535f
--- /dev/null
@@ -0,0 +1,68 @@
+---
+title: no-empty-pattern
+layout: doc
+rule_type: problem
+---
+
+
+
+When using destructuring, it's possible to create a pattern that has no effect. This happens when empty curly braces are used to the right of an embedded object destructuring pattern, such as:
+
+```js
+// doesn't create any variables
+var {a: {}} = foo;
+```
+
+In this code, no new variables are created because `a` is just a location helper while the `{}` is expected to contain the variables to create, such as:
+
+```js
+// creates variable b
+var {a: { b }} = foo;
+```
+
+In many cases, the empty object pattern is a mistake where the author intended to use a default value instead, such as:
+
+```js
+// creates variable a
+var {a = {}} = foo;
+```
+
+The difference between these two patterns is subtle, especially because the problematic empty pattern looks just like an object literal.
+
+## Rule Details
+
+This rule aims to flag any empty patterns in destructured objects and arrays, and as such, will report a problem whenever one is encountered.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-empty-pattern: "error"*/
+
+var {} = foo;
+var [] = foo;
+var {a: {}} = foo;
+var {a: []} = foo;
+function foo({}) {}
+function foo([]) {}
+function foo({a: {}}) {}
+function foo({a: []}) {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-empty-pattern: "error"*/
+
+var {a = {}} = foo;
+var {a = []} = foo;
+function foo({a = {}}) {}
+function foo({a = []}) {}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-empty.md b/eslint/docs/src/rules/no-empty.md
new file mode 100644 (file)
index 0000000..68a3634
--- /dev/null
@@ -0,0 +1,105 @@
+---
+title: no-empty
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-empty-function
+---
+
+
+
+Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can cause confusion when reading code.
+
+## Rule Details
+
+This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty `catch` or `finally` block of a `try` statement to indicate that execution should continue regardless of errors).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-empty: "error"*/
+
+if (foo) {
+}
+
+while (foo) {
+}
+
+switch(foo) {
+}
+
+try {
+    doSomething();
+} catch(ex) {
+
+} finally {
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-empty: "error"*/
+
+if (foo) {
+    // empty
+}
+
+while (foo) {
+    /* empty */
+}
+
+try {
+    doSomething();
+} catch (ex) {
+    // continue regardless of error
+}
+
+try {
+    doSomething();
+} finally {
+    /* continue regardless of error */
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option for exceptions:
+
+* `"allowEmptyCatch": true` allows empty `catch` clauses (that is, which do not contain a comment)
+
+### allowEmptyCatch
+
+Examples of additional **correct** code for this rule with the `{ "allowEmptyCatch": true }` option:
+
+::: correct
+
+```js
+/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
+try {
+    doSomething();
+} catch (ex) {}
+
+try {
+    doSomething();
+}
+catch (ex) {}
+finally {
+    /* continue regardless of error */
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you intentionally use empty block statements then you can disable this rule.
diff --git a/eslint/docs/src/rules/no-eq-null.md b/eslint/docs/src/rules/no-eq-null.md
new file mode 100644 (file)
index 0000000..6511bd7
--- /dev/null
@@ -0,0 +1,62 @@
+---
+title: no-eq-null
+layout: doc
+rule_type: suggestion
+---
+
+
+Comparing to `null` without a type-checking operator (`==` or `!=`), can have unintended results as the comparison will evaluate to true when comparing to not just a `null`, but also an `undefined` value.
+
+```js
+if (foo == null) {
+  bar();
+}
+```
+
+## Rule Details
+
+The `no-eq-null` rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to `null` only match `null`, and not also `undefined`. As such it will flag comparisons to null when using `==` and `!=`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-eq-null: "error"*/
+
+if (foo == null) {
+  bar();
+}
+
+while (qux != null) {
+  baz();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-eq-null: "error"*/
+
+if (foo === null) {
+  bar();
+}
+
+while (qux !== null) {
+  baz();
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you want to enforce type-checking operations in general, use the more powerful [eqeqeq](./eqeqeq) instead.
+
+## Compatibility
+
+* **JSHint**: This rule corresponds to `eqnull` rule of JSHint.
diff --git a/eslint/docs/src/rules/no-eval.md b/eslint/docs/src/rules/no-eval.md
new file mode 100644 (file)
index 0000000..166087d
--- /dev/null
@@ -0,0 +1,188 @@
+---
+title: no-eval
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-implied-eval
+further_reading:
+- https://ericlippert.com/2003/11/01/eval-is-evil-part-one/
+- https://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/
+---
+
+
+JavaScript's `eval()` function is potentially dangerous and is often misused. Using `eval()` on untrusted code can open a program up to several different injection attacks. The use of `eval()` in most contexts can be substituted for a better, alternative approach to a problem.
+
+```js
+var obj = { x: "foo" },
+    key = "x",
+    value = eval("obj." + key);
+```
+
+## Rule Details
+
+This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the `eval()` function. As such, it will warn whenever the `eval()` function is used.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-eval: "error"*/
+
+var obj = { x: "foo" },
+    key = "x",
+    value = eval("obj." + key);
+
+(0, eval)("var a = 0");
+
+var foo = eval;
+foo("var a = 0");
+
+// This `this` is the global object.
+this.eval("var a = 0");
+```
+
+:::
+
+Example of additional **incorrect** code for this rule when `browser` environment is set to `true`:
+
+::: incorrect
+
+```js
+/*eslint no-eval: "error"*/
+/*eslint-env browser*/
+
+window.eval("var a = 0");
+```
+
+:::
+
+Example of additional **incorrect** code for this rule when `node` environment is set to `true`:
+
+::: incorrect
+
+```js
+/*eslint no-eval: "error"*/
+/*eslint-env node*/
+
+global.eval("var a = 0");
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-eval: "error"*/
+/*eslint-env es6*/
+
+var obj = { x: "foo" },
+    key = "x",
+    value = obj[key];
+
+class A {
+    foo() {
+        // This is a user-defined method.
+        this.eval("var a = 0");
+    }
+
+    eval() {
+    }
+
+    static {
+        // This is a user-defined static method.
+        this.eval("var a = 0");
+    }
+
+    static eval() {
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has an option to allow indirect calls to `eval`.
+Indirect calls to `eval` are less dangerous than direct calls to `eval` because they cannot dynamically change the scope. Because of this, they also will not negatively impact performance to the degree of direct `eval`.
+
+```js
+{
+    "no-eval": ["error", {"allowIndirect": true}] // default is false
+}
+```
+
+Example of **incorrect** code for this rule with the `{"allowIndirect": true}` option:
+
+::: incorrect
+
+```js
+/*eslint no-eval: "error"*/
+
+var obj = { x: "foo" },
+    key = "x",
+    value = eval("obj." + key);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"allowIndirect": true}` option:
+
+::: correct
+
+```js
+/*eslint no-eval: "error"*/
+
+(0, eval)("var a = 0");
+
+var foo = eval;
+foo("var a = 0");
+
+this.eval("var a = 0");
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-eval: "error"*/
+/*eslint-env browser*/
+
+window.eval("var a = 0");
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-eval: "error"*/
+/*eslint-env node*/
+
+global.eval("var a = 0");
+```
+
+:::
+
+## Known Limitations
+
+* This rule is warning every `eval()` even if the `eval` is not global's.
+  This behavior is in order to detect calls of direct `eval`. Such as:
+
+  ```js
+  module.exports = function(eval) {
+      // If the value of this `eval` is built-in `eval` function, this is a
+      // call of direct `eval`.
+      eval("var a = 0");
+  };
+  ```
+
+* This rule cannot catch renaming the global object. Such as:
+
+  ```js
+  var foo = window;
+  foo.eval("var a = 0");
+  ```
diff --git a/eslint/docs/src/rules/no-ex-assign.md b/eslint/docs/src/rules/no-ex-assign.md
new file mode 100644 (file)
index 0000000..edf2fca
--- /dev/null
@@ -0,0 +1,48 @@
+---
+title: no-ex-assign
+layout: doc
+rule_type: problem
+further_reading:
+- https://bocoup.com/blog/the-catch-with-try-catch
+---
+
+
+
+If a `catch` clause in a `try` statement accidentally (or purposely) assigns another value to the exception parameter, it is impossible to refer to the error from that point on.
+Since there is no `arguments` object to offer alternative access to this data, assignment of the parameter is absolutely destructive.
+
+## Rule Details
+
+This rule disallows reassigning exceptions in `catch` clauses.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-ex-assign: "error"*/
+
+try {
+    // code
+} catch (e) {
+    e = 10;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-ex-assign: "error"*/
+
+try {
+    // code
+} catch (e) {
+    var foo = 10;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-extend-native.md b/eslint/docs/src/rules/no-extend-native.md
new file mode 100644 (file)
index 0000000..abdf812
--- /dev/null
@@ -0,0 +1,86 @@
+---
+title: no-extend-native
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-global-assign
+---
+
+
+In JavaScript, you can extend any object, including builtin or "native" objects. Sometimes people change the behavior of these native objects in ways that break the assumptions made about them in other parts of the code.
+
+For example here we are overriding a builtin method that will then affect all Objects, even other builtins.
+
+```js
+// seems harmless
+Object.prototype.extra = 55;
+
+// loop through some userIds
+var users = {
+    "123": "Stan",
+    "456": "David"
+};
+
+// not what you'd expect
+for (var id in users) {
+    console.log(id); // "123", "456", "extra"
+}
+```
+
+A common suggestion to avoid this problem would be to wrap the inside of the `for` loop with `users.hasOwnProperty(id)`. However, if this rule is strictly enforced throughout your codebase you won't need to take that step.
+
+## Rule Details
+
+Disallows directly modifying the prototype of builtin objects.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-extend-native: "error"*/
+
+Object.prototype.a = "a";
+Object.defineProperty(Array.prototype, "times", { value: 999 });
+```
+
+:::
+
+## Options
+
+This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which extensions will be allowed.
+
+### exceptions
+
+Examples of **correct** code for the sample `{ "exceptions": ["Object"] }` option:
+
+::: correct
+
+```js
+/*eslint no-extend-native: ["error", { "exceptions": ["Object"] }]*/
+
+Object.prototype.a = "a";
+```
+
+:::
+
+## Known Limitations
+
+This rule *does not* report any of the following less obvious approaches to modify the prototype of builtin objects:
+
+```js
+var x = Object;
+x.prototype.thing = a;
+
+eval("Array.prototype.forEach = 'muhahaha'");
+
+with(Array) {
+    prototype.thing = 'thing';
+};
+
+window.Function.prototype.bind = 'tight';
+```
+
+## When Not To Use It
+
+You may want to disable this rule when working with polyfills that try to patch older versions of JavaScript with the latest spec, such as those that might `Function.prototype.bind` or `Array.prototype.forEach` in a future-friendly way.
diff --git a/eslint/docs/src/rules/no-extra-bind.md b/eslint/docs/src/rules/no-extra-bind.md
new file mode 100644 (file)
index 0000000..4133e75
--- /dev/null
@@ -0,0 +1,98 @@
+---
+title: no-extra-bind
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
+- https://www.smashingmagazine.com/2014/01/understanding-javascript-function-prototype-bind/
+---
+
+
+
+The `bind()` method is used to create functions with specific `this` values and, optionally, binds arguments to specific values. When used to specify the value of `this`, it's important that the function actually uses `this` in its function body. For example:
+
+```js
+var boundGetName = (function getName() {
+    return this.name;
+}).bind({ name: "ESLint" });
+
+console.log(boundGetName());      // "ESLint"
+```
+
+This code is an example of a good use of `bind()` for setting the value of `this`.
+
+Sometimes during the course of code maintenance, the `this` value is removed from the function body. In that case, you can end up with a call to `bind()` that doesn't accomplish anything:
+
+```js
+// useless bind
+var boundGetName = (function getName() {
+    return "ESLint";
+}).bind({ name: "ESLint" });
+
+console.log(boundGetName());      // "ESLint"
+```
+
+In this code, the reference to `this` has been removed but `bind()` is still used. In this case, the `bind()` is unnecessary overhead (and a performance hit) and can be safely removed.
+
+## Rule Details
+
+This rule is aimed at avoiding the unnecessary use of `bind()` and as such will warn whenever an immediately-invoked function expression (IIFE) is using `bind()` and doesn't have an appropriate `this` value. This rule won't flag usage of `bind()` that includes function argument binding.
+
+**Note:** Arrow functions can never have their `this` value set using `bind()`. This rule flags all uses of `bind()` with arrow functions as a problem
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-extra-bind: "error"*/
+/*eslint-env es6*/
+
+var x = function () {
+    foo();
+}.bind(bar);
+
+var x = (() => {
+    foo();
+}).bind(bar);
+
+var x = (() => {
+    this.foo();
+}).bind(bar);
+
+var x = function () {
+    (function () {
+      this.foo();
+    }());
+}.bind(bar);
+
+var x = function () {
+    function foo() {
+      this.bar();
+    }
+}.bind(baz);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-extra-bind: "error"*/
+
+var x = function () {
+    this.foo();
+}.bind(bar);
+
+var x = function (a) {
+    return a + 1;
+}.bind(foo, bar);
+```
+
+:::
+
+## When Not To Use It
+
+If you are not concerned about unnecessary calls to `bind()`, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-extra-boolean-cast.md b/eslint/docs/src/rules/no-extra-boolean-cast.md
new file mode 100644 (file)
index 0000000..d08a4ea
--- /dev/null
@@ -0,0 +1,148 @@
+---
+title: no-extra-boolean-cast
+layout: doc
+rule_type: suggestion
+---
+
+
+
+
+
+In contexts such as an `if` statement's test where the result of the expression will already be coerced to a Boolean, casting to a Boolean via double negation (`!!`) or a `Boolean` call is unnecessary. For example, these `if` statements are equivalent:
+
+```js
+if (!!foo) {
+    // ...
+}
+
+if (Boolean(foo)) {
+    // ...
+}
+
+if (foo) {
+    // ...
+}
+```
+
+## Rule Details
+
+This rule disallows unnecessary boolean casts.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-extra-boolean-cast: "error"*/
+
+var foo = !!!bar;
+
+var foo = !!bar ? baz : bat;
+
+var foo = Boolean(!!bar);
+
+var foo = new Boolean(!!bar);
+
+if (!!foo) {
+    // ...
+}
+
+if (Boolean(foo)) {
+    // ...
+}
+
+while (!!foo) {
+    // ...
+}
+
+do {
+    // ...
+} while (Boolean(foo));
+
+for (; !!foo; ) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-extra-boolean-cast: "error"*/
+
+var foo = !!bar;
+var foo = Boolean(bar);
+
+function foo() {
+    return !!bar;
+}
+
+var foo = bar ? !!baz : !!bat;
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"enforceForLogicalOperands"` when set to `true`, in addition to checking default contexts, checks whether the extra boolean cast is contained within a logical expression. Default is `false`, meaning that this rule by default does not warn about extra booleans cast inside logical expression.
+
+### enforceForLogicalOperands
+
+Examples of **incorrect** code for this rule with `"enforceForLogicalOperands"` option set to `true`:
+
+::: incorrect
+
+```js
+/*eslint no-extra-boolean-cast: ["error", {"enforceForLogicalOperands": true}]*/
+
+if (!!foo || bar) {
+    //...
+}
+
+while (!!foo && bar) {
+    //...
+}
+
+if ((!!foo || bar) && baz) {
+    //...
+}
+
+foo && Boolean(bar) ? baz : bat
+
+var foo = new Boolean(!!bar || baz)
+```
+
+:::
+
+Examples of **correct** code for this rule with `"enforceForLogicalOperands"` option set to `true`:
+
+::: correct
+
+```js
+/*eslint no-extra-boolean-cast: ["error", {"enforceForLogicalOperands": true}]*/
+
+if (foo || bar) {
+    //...
+}
+
+while (foo && bar) {
+    //...
+}
+
+if ((foo || bar) && baz) {
+    //...
+}
+
+foo && bar ? baz : bat
+
+var foo = new Boolean(bar || baz)
+
+var foo = !!bar || baz;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-extra-label.md b/eslint/docs/src/rules/no-extra-label.md
new file mode 100644 (file)
index 0000000..bd2cb58
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: no-extra-label
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-labels
+- no-label-var
+- no-unused-labels
+---
+
+
+
+If a loop contains no nested loops or switches, labeling the loop is unnecessary.
+
+```js
+A: while (a) {
+    break A;
+}
+```
+
+You can achieve the same result by removing the label and using `break` or `continue` without a label.
+Probably those labels would confuse developers because they expect labels to jump to further.
+
+## Rule Details
+
+This rule is aimed at eliminating unnecessary labels.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-extra-label: "error"*/
+
+A: while (a) {
+    break A;
+}
+
+B: for (let i = 0; i < 10; ++i) {
+    break B;
+}
+
+C: switch (a) {
+    case 0:
+        break C;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-extra-label: "error"*/
+
+while (a) {
+    break;
+}
+
+for (let i = 0; i < 10; ++i) {
+    break;
+}
+
+switch (a) {
+    case 0:
+        break;
+}
+
+A: {
+    break A;
+}
+
+B: while (a) {
+    while (b) {
+        break B;
+    }
+}
+
+C: switch (a) {
+    case 0:
+        while (b) {
+            break C;
+        }
+        break;
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of labels, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-extra-parens.md b/eslint/docs/src/rules/no-extra-parens.md
new file mode 100644 (file)
index 0000000..ab3fd1c
--- /dev/null
@@ -0,0 +1,366 @@
+---
+title: no-extra-parens
+layout: doc
+rule_type: layout
+related_rules:
+- arrow-parens
+- no-cond-assign
+- no-return-assign
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
+---
+
+
+
+This rule restricts the use of parentheses to only where they are necessary.
+
+## Rule Details
+
+This rule always ignores extra parentheses around the following:
+
+* RegExp literals such as `(/abc/).test(var)` to avoid conflicts with the [wrap-regex](wrap-regex) rule
+* immediately-invoked function expressions (also known as IIFEs) such as `var x = (function () {})();` and `var x = (function () {}());` to avoid conflicts with the [wrap-iife](wrap-iife) rule
+* arrow function arguments to avoid conflicts with the [arrow-parens](arrow-parens) rule
+
+## Options
+
+This rule has a string option:
+
+* `"all"` (default) disallows unnecessary parentheses around *any* expression
+* `"functions"` disallows unnecessary parentheses *only* around function expressions
+
+This rule has an object option for exceptions to the `"all"` option:
+
+* `"conditionalAssign": false` allows extra parentheses around assignments in conditional test expressions
+* `"returnAssign": false` allows extra parentheses around assignments in `return` statements
+* `"nestedBinaryExpressions": false` allows extra parentheses in nested binary expressions
+* `"ignoreJSX": "none|all|multi-line|single-line"` allows extra parentheses around no/all/multi-line/single-line JSX components. Defaults to `none`.
+* `"enforceForArrowConditionals": false` allows extra parentheses around ternary expressions which are the body of an arrow function
+* `"enforceForSequenceExpressions": false` allows extra parentheses around sequence expressions
+* `"enforceForNewInMemberExpressions": false` allows extra parentheses around `new` expressions in member expressions
+* `"enforceForFunctionPrototypeMethods": false` allows extra parentheses around immediate `.call` and `.apply` method calls on function expressions and around function expressions in the same context.
+
+### all
+
+Examples of **incorrect** code for this rule with the default `"all"` option:
+
+::: incorrect
+
+```js
+/* eslint no-extra-parens: "error" */
+
+a = (b * c);
+
+(a * b) + c;
+
+for (a in (b, c));
+
+for (a in (b));
+
+for (a of (b));
+
+typeof (a);
+
+(function(){} ? a() : b());
+
+class A {
+    [(x)] = 1;
+}
+
+class B {
+    x = (y + z);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"all"` option:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: "error" */
+
+(0).toString();
+
+(Object.prototype.toString.call());
+
+({}.toString.call());
+
+(function(){}) ? a() : b();
+
+(/^a$/).test(x);
+
+for (a of (b, c));
+
+for (a of b);
+
+for (a in b, c);
+
+for (a in b);
+
+class A {
+    [x] = 1;
+}
+
+class B {
+    x = y + z;
+}
+```
+
+:::
+
+### conditionalAssign
+
+Examples of **correct** code for this rule with the `"all"` and `{ "conditionalAssign": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "conditionalAssign": false }] */
+
+while ((foo = bar())) {}
+
+if ((foo = bar())) {}
+
+do; while ((foo = bar()))
+
+for (;(a = b););
+```
+
+:::
+
+### returnAssign
+
+Examples of **correct** code for this rule with the `"all"` and `{ "returnAssign": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "returnAssign": false }] */
+
+function a(b) {
+  return (b = 1);
+}
+
+function a(b) {
+  return b ? (c = d) : (c = e);
+}
+
+b => (b = 1);
+
+b => b ? (c = d) : (c = e);
+```
+
+:::
+
+### nestedBinaryExpressions
+
+Examples of **correct** code for this rule with the `"all"` and `{ "nestedBinaryExpressions": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "nestedBinaryExpressions": false }] */
+
+x = a || (b && c);
+x = a + (b * c);
+x = (a * b) / c;
+```
+
+:::
+
+### ignoreJSX
+
+Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "all" }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "all" }] */
+const Component = (<div />)
+const Component = (
+    <div
+        prop={true}
+    />
+)
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `all` and `{ "ignoreJSX": "multi-line" }` options:
+
+::: incorrect
+
+```js
+/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "multi-line" }] */
+const Component = (<div />)
+const Component = (<div><p /></div>)
+```
+
+:::
+
+Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "multi-line" }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "multi-line" }] */
+const Component = (
+    <div>
+        <p />
+    </div>
+)
+const Component = (
+    <div
+        prop={true}
+    />
+)
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `all` and `{ "ignoreJSX": "single-line" }` options:
+
+::: incorrect
+
+```js
+/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "single-line" }] */
+const Component = (
+    <div>
+        <p />
+    </div>
+)
+const Component = (
+    <div
+        prop={true}
+    />
+)
+```
+
+:::
+
+Examples of **correct** code for this rule with the `all` and `{ "ignoreJSX": "single-line" }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { ignoreJSX: "single-line" }] */
+const Component = (<div />)
+const Component = (<div><p /></div>)
+```
+
+:::
+
+### enforceForArrowConditionals
+
+Examples of **correct** code for this rule with the `"all"` and `{ "enforceForArrowConditionals": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "enforceForArrowConditionals": false }] */
+
+const b = a => 1 ? 2 : 3;
+const d = c => (1 ? 2 : 3);
+```
+
+:::
+
+### enforceForSequenceExpressions
+
+Examples of **correct** code for this rule with the `"all"` and `{ "enforceForSequenceExpressions": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "enforceForSequenceExpressions": false }] */
+
+(a, b);
+
+if ((val = foo(), val < 10)) {}
+
+while ((val = foo(), val < 10));
+```
+
+:::
+
+### enforceForNewInMemberExpressions
+
+Examples of **correct** code for this rule with the `"all"` and `{ "enforceForNewInMemberExpressions": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "enforceForNewInMemberExpressions": false }] */
+
+const foo = (new Bar()).baz;
+
+const quux = (new Bar())[baz];
+
+(new Bar()).doSomething();
+```
+
+:::
+
+### enforceForFunctionPrototypeMethods
+
+Examples of **correct** code for this rule with the `"all"` and `{ "enforceForFunctionPrototypeMethods": false }` options:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "all", { "enforceForFunctionPrototypeMethods": false }] */
+
+const foo = (function () {}).call();
+
+const bar = (function () {}).apply();
+
+const baz = (function () {}.call());
+
+const quux = (function () {}.apply());
+```
+
+:::
+
+### functions
+
+Examples of **incorrect** code for this rule with the `"functions"` option:
+
+::: incorrect
+
+```js
+/* eslint no-extra-parens: ["error", "functions"] */
+
+((function foo() {}))();
+
+var y = (function () {return 1;});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"functions"` option:
+
+::: correct
+
+```js
+/* eslint no-extra-parens: ["error", "functions"] */
+
+(0).toString();
+
+(Object.prototype.toString.call());
+
+({}.toString.call());
+
+(function(){} ? a() : b());
+
+(/^a$/).test(x);
+
+a = (b * c);
+
+(a * b) + c;
+
+typeof (a);
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-extra-semi.md b/eslint/docs/src/rules/no-extra-semi.md
new file mode 100644 (file)
index 0000000..6132bcb
--- /dev/null
@@ -0,0 +1,82 @@
+---
+title: no-extra-semi
+layout: doc
+rule_type: suggestion
+related_rules:
+- semi
+- semi-spacing
+---
+
+
+
+
+
+Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.
+
+## Rule Details
+
+This rule disallows unnecessary semicolons.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-extra-semi: "error"*/
+
+var x = 5;;
+
+function foo() {
+    // code
+};
+
+class C {
+    field;;
+
+    method() {
+        // code
+    };
+
+    static {
+        // code
+    };
+};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-extra-semi: "error"*/
+
+var x = 5;
+
+function foo() {
+    // code
+}
+
+var bar = function() {
+    // code
+};
+
+class C {
+    field;
+
+    method() {
+        // code
+    }
+
+    static {
+        // code
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you intentionally use extra semicolons then you can disable this rule.
diff --git a/eslint/docs/src/rules/no-extra-strict.md b/eslint/docs/src/rules/no-extra-strict.md
new file mode 100644 (file)
index 0000000..caeff8a
--- /dev/null
@@ -0,0 +1,66 @@
+---
+title: no-extra-strict
+layout: doc
+
+further_reading:
+- https://es5.github.io/#C
+---
+
+Disallows strict mode directives when already in strict mode.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [strict](strict) rule. The `"global"` or `"function"` options in the new rule are similar to the removed rule.
+
+The `"use strict";` directive applies to the scope in which it appears and all inner scopes contained within that scope. Therefore, using the `"use strict";` directive in one of these inner scopes is unnecessary.
+
+```js
+"use strict";
+
+(function () {
+    "use strict";
+    var foo = true;
+}());
+```
+
+## Rule Details
+
+This rule is aimed at preventing unnecessary `"use strict";` directives. As such, it will warn when it encounters a `"use strict";` directive when already in strict mode.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+"use strict";
+
+(function () {
+    "use strict";
+    var foo = true;
+}());
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+"use strict";
+
+(function () {
+    var foo = true;
+}());
+```
+
+:::
+
+::: correct
+
+```js
+(function () {
+    "use strict";
+    var foo = true;
+}());
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-fallthrough.md b/eslint/docs/src/rules/no-fallthrough.md
new file mode 100644 (file)
index 0000000..7986b81
--- /dev/null
@@ -0,0 +1,236 @@
+---
+title: no-fallthrough
+layout: doc
+rule_type: problem
+related_rules:
+- default-case
+---
+
+
+
+The `switch` statement in JavaScript is one of the more error-prone constructs of the language thanks in part to the ability to "fall through" from one `case` to the next. For example:
+
+```js
+switch(foo) {
+    case 1:
+        doSomething();
+
+    case 2:
+        doSomethingElse();
+}
+```
+
+In this example, if `foo` is `1`, then execution will flow through both cases, as the first falls through to the second. You can prevent this by using `break`, as in this example:
+
+```js
+switch(foo) {
+    case 1:
+        doSomething();
+        break;
+
+    case 2:
+        doSomethingElse();
+}
+```
+
+That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the `/falls?\s?through/i` regular expression:
+
+```js
+switch(foo) {
+    case 1:
+        doSomething();
+        // falls through
+
+    case 2:
+        doSomethingElse();
+}
+
+switch(foo) {
+    case 1:
+        doSomething();
+        // fall through
+
+    case 2:
+        doSomethingElse();
+}
+
+switch(foo) {
+    case 1:
+        doSomething();
+        // fallsthrough
+
+    case 2:
+        doSomethingElse();
+}
+
+switch(foo) {
+    case 1: {
+        doSomething();
+        // falls through
+    }
+
+    case 2: {
+        doSomethingElse();
+    }
+}
+```
+
+In this example, there is no confusion as to the expected behavior. It is clear that the first case is meant to fall through to the second case.
+
+## Rule Details
+
+This rule is aimed at eliminating unintentional fallthrough of one case to the other. As such, it flags any fallthrough scenarios that are not marked by a comment.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-fallthrough: "error"*/
+
+switch(foo) {
+    case 1:
+        doSomething();
+
+    case 2:
+        doSomething();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-fallthrough: "error"*/
+
+switch(foo) {
+    case 1:
+        doSomething();
+        break;
+
+    case 2:
+        doSomething();
+}
+
+function bar(foo) {
+    switch(foo) {
+        case 1:
+            doSomething();
+            return;
+
+        case 2:
+            doSomething();
+    }
+}
+
+switch(foo) {
+    case 1:
+        doSomething();
+        throw new Error("Boo!");
+
+    case 2:
+        doSomething();
+}
+
+switch(foo) {
+    case 1:
+    case 2:
+        doSomething();
+}
+
+switch(foo) {
+    case 1:
+        doSomething();
+        // falls through
+
+    case 2:
+        doSomething();
+}
+
+switch(foo) {
+    case 1: {
+        doSomething();
+        // falls through
+    }
+
+    case 2: {
+        doSomethingElse();
+    }
+}
+```
+
+:::
+
+Note that the last `case` statement in these examples does not cause a warning because there is nothing to fall through into.
+
+## Options
+
+This rule has an object option:
+
+* Set the `commentPattern` option to a regular expression string to change the test for intentional fallthrough comment.
+
+* Set the `allowEmptyCase` option to `true` to allow empty cases regardless of the layout. By default, this rule does not require a fallthrough comment after an empty `case` only if the empty `case` and the next `case` are on the same line or on consecutive lines.
+
+### commentPattern
+
+Examples of **correct** code for the `{ "commentPattern": "break[\\s\\w]*omitted" }` option:
+
+::: correct
+
+```js
+/*eslint no-fallthrough: ["error", { "commentPattern": "break[\\s\\w]*omitted" }]*/
+
+switch(foo) {
+    case 1:
+        doSomething();
+        // break omitted
+
+    case 2:
+        doSomething();
+}
+
+switch(foo) {
+    case 1:
+        doSomething();
+        // caution: break is omitted intentionally
+
+    default:
+        doSomething();
+}
+```
+
+:::
+
+### allowEmptyCase
+
+Examples of **correct** code for the `{ "allowEmptyCase": true }` option:
+
+::: correct
+
+```js
+/* eslint no-fallthrough: ["error", { "allowEmptyCase": true }] */
+
+switch(foo){
+    case 1:
+
+    case 2: doSomething();
+}
+
+switch(foo){
+    case 1:
+    /*
+    Put a message here 
+    */
+    case 2: doSomething();
+}
+
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce that each `case` statement should end with a `throw`, `return`, `break`, or comment, then you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-floating-decimal.md b/eslint/docs/src/rules/no-floating-decimal.md
new file mode 100644 (file)
index 0000000..e1c26d2
--- /dev/null
@@ -0,0 +1,57 @@
+---
+title: no-floating-decimal
+layout: doc
+rule_type: suggestion
+---
+
+
+
+Float values in JavaScript contain a decimal point, and there is no requirement that the decimal point be preceded or followed by a number. For example, the following are all valid JavaScript numbers:
+
+```js
+var num = .5;
+var num = 2.;
+var num = -.7;
+```
+
+Although not a syntax error, this format for numbers can make it difficult to distinguish between true decimal numbers and the dot operator. For this reason, some recommend that you should always include a number before and after a decimal point to make it clear the intent is to create a decimal number.
+
+## Rule Details
+
+This rule is aimed at eliminating floating decimal points and will warn whenever a numeric value has a decimal point but is missing a number either before or after it.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-floating-decimal: "error"*/
+
+var num = .5;
+var num = 2.;
+var num = -.7;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-floating-decimal: "error"*/
+
+var num = 0.5;
+var num = 2.0;
+var num = -0.7;
+```
+
+:::
+
+## When Not To Use It
+
+If you aren't concerned about misinterpreting floating decimal point values, then you can safely turn this rule off.
+
+## Compatibility
+
+* **JSHint**: W008, W047
diff --git a/eslint/docs/src/rules/no-func-assign.md b/eslint/docs/src/rules/no-func-assign.md
new file mode 100644 (file)
index 0000000..84971db
--- /dev/null
@@ -0,0 +1,73 @@
+---
+title: no-func-assign
+layout: doc
+rule_type: problem
+---
+
+
+
+JavaScript functions can be written as a FunctionDeclaration `function foo() { ... }` or as a FunctionExpression `var foo = function() { ... };`. While a JavaScript interpreter might tolerate it, overwriting/reassigning a function written as a FunctionDeclaration is often indicative of a mistake or issue.
+
+```js
+function foo() {}
+foo = bar;
+```
+
+## Rule Details
+
+This rule disallows reassigning `function` declarations.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-func-assign: "error"*/
+
+function foo() {}
+foo = bar;
+
+function foo() {
+    foo = bar;
+}
+
+var a = function hello() {
+  hello = 123;
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule, unlike the corresponding rule in JSHint:
+
+::: incorrect
+
+```js
+/*eslint no-func-assign: "error"*/
+
+foo = bar;
+function foo() {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-func-assign: "error"*/
+
+var foo = function () {}
+foo = bar;
+
+function foo(foo) { // `foo` is shadowed.
+    foo = bar;
+}
+
+function foo() {
+    var foo = bar;  // `foo` is shadowed.
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-global-assign.md b/eslint/docs/src/rules/no-global-assign.md
new file mode 100644 (file)
index 0000000..95ca90d
--- /dev/null
@@ -0,0 +1,117 @@
+---
+title: no-global-assign
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extend-native
+- no-redeclare
+- no-shadow
+---
+
+
+
+JavaScript environments contain a number of built-in global variables, such as `window` in browsers and `process` in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:
+
+```js
+window = {};
+```
+
+While examples such as `window` are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.
+
+## Rule Details
+
+This rule disallows modifications to read-only global variables.
+
+ESLint has the capability to configure global variables as read-only.
+
+* [Specifying Environments](../user-guide/configuring#specifying-environments)
+* [Specifying Globals](../user-guide/configuring#specifying-globals)
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-global-assign: "error"*/
+
+Object = null
+undefined = 1
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-global-assign: "error"*/
+/*eslint-env browser*/
+
+window = {}
+length = 1
+top = 1
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-global-assign: "error"*/
+/*global a:readonly*/
+
+a = 1
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-global-assign: "error"*/
+
+a = 1
+var b = 1
+b = 2
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-global-assign: "error"*/
+/*eslint-env browser*/
+
+onload = function() {}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-global-assign: "error"*/
+/*global a:writable*/
+
+a = 1
+```
+
+:::
+
+## Options
+
+This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which reassignments will be allowed:
+
+```json
+{
+    "rules": {
+        "no-global-assign": ["error", {"exceptions": ["Object"]}]
+    }
+}
+```
+
+## When Not To Use It
+
+If you are trying to override one of the native objects.
diff --git a/eslint/docs/src/rules/no-implicit-coercion.md b/eslint/docs/src/rules/no-implicit-coercion.md
new file mode 100644 (file)
index 0000000..746c988
--- /dev/null
@@ -0,0 +1,207 @@
+---
+title: no-implicit-coercion
+layout: doc
+rule_type: suggestion
+---
+
+
+
+In JavaScript, there are a lot of different ways to convert value types.
+Some of them might be hard to read and understand.
+
+Such as:
+
+```js
+var b = !!foo;
+var b = ~foo.indexOf(".");
+var n = +foo;
+var n = 1 * foo;
+var s = "" + foo;
+foo += ``;
+```
+
+Those can be replaced with the following code:
+
+```js
+var b = Boolean(foo);
+var b = foo.indexOf(".") !== -1;
+var n = Number(foo);
+var n = Number(foo);
+var s = String(foo);
+foo = String(foo);
+```
+
+## Rule Details
+
+This rule is aimed to flag shorter notations for the type conversion, then suggest a more self-explanatory notation.
+
+## Options
+
+This rule has three main options and one override option to allow some coercions as required.
+
+* `"boolean"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `boolean` type.
+* `"number"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `number` type.
+* `"string"` (`true` by default) - When this is `true`, this rule warns shorter type conversions for `string` type.
+* `"disallowTemplateShorthand"` (`false` by default) - When this is `true`, this rule warns `string` type conversions using `${expression}` form.
+* `"allow"` (`empty` by default) - Each entry in this array can be one of `~`, `!!`, `+` or `*` that are to be allowed.
+
+Note that operator `+` in `allow` list would allow `+foo` (number coercion) as well as `"" + foo` (string coercion).
+
+### boolean
+
+Examples of **incorrect** code for the default `{ "boolean": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var b = !!foo;
+var b = ~foo.indexOf(".");
+// bitwise not is incorrect only with `indexOf`/`lastIndexOf` method calling.
+```
+
+:::
+
+Examples of **correct** code for the default `{ "boolean": true }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var b = Boolean(foo);
+var b = foo.indexOf(".") !== -1;
+
+var n = ~foo; // This is a just bitwise not.
+```
+
+:::
+
+### number
+
+Examples of **incorrect** code for the default `{ "number": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var n = +foo;
+var n = 1 * foo;
+```
+
+:::
+
+Examples of **correct** code for the default `{ "number": true }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var n = Number(foo);
+var n = parseFloat(foo);
+var n = parseInt(foo, 10);
+```
+
+:::
+
+### string
+
+Examples of **incorrect** code for the default `{ "string": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var s = "" + foo;
+var s = `` + foo;
+foo += "";
+foo += ``;
+```
+
+:::
+
+Examples of **correct** code for the default `{ "string": true }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: "error"*/
+
+var s = String(foo);
+foo = String(foo);
+```
+
+:::
+
+### disallowTemplateShorthand
+
+This option is **not** affected by the `string` option.
+
+Examples of **incorrect** code for the `{ "disallowTemplateShorthand": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": true }]*/
+
+var s = `${foo}`;
+```
+
+:::
+
+Examples of **correct** code for the `{ "disallowTemplateShorthand": true }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": true }]*/
+
+var s = String(foo);
+
+var s = `a${foo}`;
+
+var s = `${foo}b`;
+
+var s = `${foo}${bar}`;
+
+var s = tag`${foo}`;
+```
+
+:::
+
+Examples of **correct** code for the default `{ "disallowTemplateShorthand": false }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: ["error", { "disallowTemplateShorthand": false }]*/
+
+var s = `${foo}`;
+```
+
+:::
+
+### allow
+
+Using `allow` list, we can override and allow specific operators.
+
+Examples of **correct** code for the sample `{ "allow": ["!!", "~"] }` option:
+
+::: correct
+
+```js
+/*eslint no-implicit-coercion: [2, { "allow": ["!!", "~"] } ]*/
+
+var b = !!foo;
+var b = ~foo.indexOf(".");
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about shorter notations for the type conversion, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-implicit-globals.md b/eslint/docs/src/rules/no-implicit-globals.md
new file mode 100644 (file)
index 0000000..15c0386
--- /dev/null
@@ -0,0 +1,267 @@
+---
+title: no-implicit-globals
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-undef
+- no-global-assign
+further_reading:
+- https://benalman.com/news/2010/11/immediately-invoked-function-expression/
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone
+---
+
+
+It is the best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script.
+
+Global variables created from a script can produce name collisions with global variables created from another script, which will
+usually lead to runtime errors or unexpected behavior.
+
+This rule disallows the following:
+
+* Declarations that create one or more variables in the global scope.
+* Global variable leaks.
+* Redeclarations of read-only global variables and assignments to read-only global variables.
+
+There is an explicit way to create a global variable when needed, by assigning to a property of the global object.
+
+This rule is mostly useful for browser scripts. Top-level declarations in ES modules and CommonJS modules create module-scoped
+variables. ES modules also have implicit `strict` mode, which prevents global variable leaks.
+
+By default, this rule does not check `const`, `let` and `class` declarations.
+
+This rule has an object option with one option:
+
+* Set `"lexicalBindings"` to `true` if you want this rule to check `const`, `let` and `class` declarations as well.
+
+## Rule Details
+
+### `var` and `function` declarations
+
+When working with browser scripts, developers often forget that variable and function declarations at the top-level scope become global variables on the `window` object. As opposed to modules which have their own scope. Globals should be explicitly assigned to `window` or `self` if that is the intent. Otherwise variables intended to be local to the script should be wrapped in an IIFE.
+
+This rule disallows `var` and `function` declarations at the top-level script scope. This does not apply to ES and CommonJS modules since they have a module scope.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-globals: "error"*/
+
+var foo = 1;
+
+function bar() {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-implicit-globals: "error"*/
+
+// explicitly set on window
+window.foo = 1;
+window.bar = function() {};
+
+// intended to be scope to this file
+(function() {
+  var foo = 1;
+
+  function bar() {}
+})();
+```
+
+:::
+
+Examples of **correct** code for this rule with `"parserOptions": { "sourceType": "module" }` in the ESLint configuration:
+
+::: correct
+
+```js
+/*eslint no-implicit-globals: "error"*/
+
+// foo and bar are local to module
+var foo = 1;
+function bar() {}
+```
+
+:::
+
+### Global variable leaks
+
+When the code is not in `strict` mode, an assignment to an undeclared variable creates
+a new global variable. This will happen even if the code is in a function.
+
+This does not apply to ES modules since the module code is implicitly in `strict` mode.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-globals: "error"*/
+
+foo = 1;
+
+Bar.prototype.baz = function () {
+    a = 1; // Intended to be this.a = 1;
+};
+```
+
+:::
+
+### Read-only global variables
+
+This rule also disallows redeclarations of read-only global variables and assignments to read-only global variables.
+
+A read-only global variable can be a built-in ES global (e.g. `Array`), an environment specific global
+(e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file
+or in a `/*global */` comment.
+
+* [Specifying Environments](../user-guide/configuring#specifying-environments)
+* [Specifying Globals](../user-guide/configuring#specifying-globals)
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-globals: "error"*/
+
+/*global foo:readonly*/
+
+foo = 1;
+
+Array = [];
+var Object;
+```
+
+:::
+
+### `const`, `let` and `class` declarations
+
+Lexical declarations `const` and `let`, as well as `class` declarations, create variables that are block-scoped.
+
+However, when declared in the top-level of a browser script these variables are not 'script-scoped'.
+They are actually created in the global scope and could produce name collisions with
+`var`, `const` and `let` variables and `function` and `class` declarations from other scripts.
+This does not apply to ES and CommonJS  modules.
+
+If the variable is intended to be local to the script, wrap the code with a block or with an immediately-invoked function expression (IIFE).
+
+Examples of **correct** code for this rule with `"lexicalBindings"` option set to `false` (default):
+
+::: correct
+
+```js
+/*eslint no-implicit-globals: ["error", {"lexicalBindings": false}]*/
+
+const foo = 1;
+
+let baz;
+
+class Bar {}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with `"lexicalBindings"` option set to `true`:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
+
+const foo = 1;
+
+let baz;
+
+class Bar {}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"lexicalBindings"` option set to `true`:
+
+::: correct
+
+```js
+/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
+
+{
+    const foo = 1;
+    let baz;
+    class Bar {}
+}
+
+(function() {
+    const foo = 1;
+    let baz;
+    class Bar {}
+}());
+```
+
+:::
+
+If you intend to create a global `const` or `let` variable or a global `class` declaration, to be used from other scripts,
+be aware that there are certain differences when compared to the traditional methods, which are `var` declarations and assigning to a property of the global `window` object:
+
+* Lexically declared variables cannot be conditionally created. A script cannot check for the existence of
+a variable and then create a new one. `var` variables are also always created, but redeclarations do not
+cause runtime exceptions.
+* Lexically declared variables do not create properties on the global object, which is what a consuming script might expect.
+* Lexically declared variables are shadowing properties of the global object, which might produce errors if a
+consuming script is using both the variable and the property.
+* Lexically declared variables can produce a permanent Temporal Dead Zone (TDZ) if the initialization throws an exception.
+Even the `typeof` check is not safe from TDZ reference exceptions.
+
+Examples of **incorrect** code for this rule with `"lexicalBindings"` option set to `true`:
+
+::: incorrect
+
+```js
+/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
+
+const MyGlobalFunction = (function() {
+    const a = 1;
+    let b = 2;
+    return function() {
+        return a + b;
+    }
+}());
+```
+
+:::
+
+Examples of **correct** code for this rule with `"lexicalBindings"` option set to `true`:
+
+::: correct
+
+```js
+/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
+
+window.MyGlobalFunction = (function() {
+    const a = 1;
+    let b = 2;
+    return function() {
+        return a + b;
+    }
+}());
+```
+
+:::
+
+## When Not To Use It
+
+In the case of a browser script, if you want to be able to explicitly declare variables and functions in the global scope,
+and your code is in strict mode or you don't want this rule to warn you about undeclared variables,
+and you also don't want this rule to warn you about read-only globals, you can disable this rule.
+
+In the case of a CommonJS module, if your code is in strict mode or you don't want this rule to warn you about undeclared variables,
+and you also don't want this rule to warn you about the read-only globals, you can disable this rule.
+
+In the case of an ES module, if you don't want this rule to warn you about the read-only globals you can disable this rule.
diff --git a/eslint/docs/src/rules/no-implied-eval.md b/eslint/docs/src/rules/no-implied-eval.md
new file mode 100644 (file)
index 0000000..acfcfd5
--- /dev/null
@@ -0,0 +1,73 @@
+---
+title: no-implied-eval
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-eval
+---
+
+
+It's considered a good practice to avoid using `eval()` in JavaScript. There are security and performance implications involved with doing so, which is why many linters (including ESLint) recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.
+
+The first is using `setTimeout()`, `setInterval()` or `execScript()` (Internet Explorer only), all of which can accept a string of JavaScript code as their first argument. For example:
+
+```js
+setTimeout("alert('Hi!');", 100);
+```
+
+This is considered an implied `eval()` because a string of JavaScript code is
+ passed in to be interpreted. The same can be done with `setInterval()` and `execScript()`. Both interpret the JavaScript code in  the global scope. For  both `setTimeout()` and `setInterval()`, the first argument can also be a function, and that is considered safer and is more performant:
+
+```js
+setTimeout(function() {
+    alert("Hi!");
+}, 100);
+```
+
+The best practice is to always use a function for the first argument of `setTimeout()` and `setInterval()` (and avoid `execScript()`).
+
+## Rule Details
+
+This rule aims to eliminate implied `eval()` through the use of `setTimeout()`, `setInterval()` or `execScript()`. As such, it will warn when either function is used with a string as the first argument.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-implied-eval: "error"*/
+
+setTimeout("alert('Hi!');", 100);
+
+setInterval("alert('Hi!');", 100);
+
+execScript("alert('Hi!')");
+
+window.setTimeout("count = 5", 10);
+
+window.setInterval("foo = bar", 10);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-implied-eval: "error"*/
+
+setTimeout(function() {
+    alert("Hi!");
+}, 100);
+
+setInterval(function() {
+    alert("Hi!");
+}, 100);
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow `setTimeout()` and `setInterval()` with string arguments, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-import-assign.md b/eslint/docs/src/rules/no-import-assign.md
new file mode 100644 (file)
index 0000000..c19cfd2
--- /dev/null
@@ -0,0 +1,60 @@
+---
+title: no-import-assign
+layout: doc
+rule_type: problem
+---
+
+
+
+The updates of imported bindings by ES Modules cause runtime errors.
+
+## Rule Details
+
+This rule warns the assignments, increments, and decrements of imported bindings.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-import-assign: "error"*/
+
+import mod, { named } from "./mod.mjs"
+import * as mod_ns from "./mod.mjs"
+
+mod = 1          // ERROR: 'mod' is readonly.
+named = 2        // ERROR: 'named' is readonly.
+mod_ns.named = 3 // ERROR: The members of 'mod_ns' are readonly.
+mod_ns = {}      // ERROR: 'mod_ns' is readonly.
+// Can't extend 'mod_ns'
+Object.assign(mod_ns, { foo: "foo" }) // ERROR: The members of 'mod_ns' are readonly.
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-import-assign: "error"*/
+
+import mod, { named } from "./mod.mjs"
+import * as mod_ns from "./mod.mjs"
+
+mod.prop = 1
+named.prop = 2
+mod_ns.named.prop = 3
+
+// Known Limitation
+function test(obj) {
+    obj.named = 4 // Not errored because 'obj' is not namespace objects.
+}
+test(mod_ns) // Not errored because it doesn't know that 'test' updates the member of the argument.
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about modifying imported bindings, you can disable this rule.
diff --git a/eslint/docs/src/rules/no-inline-comments.md b/eslint/docs/src/rules/no-inline-comments.md
new file mode 100644 (file)
index 0000000..093214c
--- /dev/null
@@ -0,0 +1,140 @@
+---
+title: no-inline-comments
+layout: doc
+rule_type: suggestion
+---
+
+
+Some style guides disallow comments on the same line as code. Code can become difficult to read if comments immediately follow the code on the same line.
+On the other hand, it is sometimes faster and more obvious to put comments immediately following code.
+
+## Rule Details
+
+This rule disallows comments on the same line as code.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-inline-comments: "error"*/
+
+var a = 1; // declaring a to 1
+
+function getRandomNumber(){
+    return 4; // chosen by fair dice roll.
+              // guaranteed to be random.
+}
+
+/* A block comment before code */ var b = 2;
+
+var c = 3; /* A block comment after code */
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-inline-comments: "error"*/
+
+// This is a comment above a line of code
+var foo = 5;
+
+var bar = 5;
+//This is a comment below a line of code
+```
+
+:::
+
+### JSX exception
+
+Comments inside the curly braces in JSX are allowed to be on the same line as the braces, but only if they are not on the same line with other code, and the braces do not enclose an actual expression.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-inline-comments: "error"*/
+
+var foo = <div>{ /* On the same line with other code */ }<h1>Some heading</h1></div>;
+
+var bar = (
+    <div>
+    {   // These braces are not just for the comment, so it can't be on the same line
+        baz
+    }
+    </div>
+);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-inline-comments: "error"*/
+
+var foo = (
+    <div>
+      {/* These braces are just for this comment and there is nothing else on this line */}
+      <h1>Some heading</h1>
+    </div>
+)
+
+var bar = (
+    <div>
+    {
+        // There is nothing else on this line
+        baz
+    }
+    </div>
+);
+
+var quux = (
+    <div>
+      {/*
+        Multiline
+        comment
+      */}
+      <h1>Some heading</h1>
+    </div>
+)
+```
+
+:::
+
+## Options
+
+### ignorePattern
+
+To make this rule ignore specific comments, set the `ignorePattern` option to a string pattern that will be passed to the [`RegExp` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp).
+
+Examples of **correct** code for the `ignorePattern` option:
+
+::: correct
+
+```js
+/*eslint no-inline-comments: ["error", { "ignorePattern": "webpackChunkName:\\s.+" }]*/
+
+import(/* webpackChunkName: "my-chunk-name" */ './locale/en');
+```
+
+:::
+
+Examples of **incorrect** code for the `ignorePattern` option:
+
+::: incorrect
+
+```js
+/*eslint no-inline-comments: ["error", { "ignorePattern": "something" }] */
+
+var foo = 4; // other thing
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-inner-declarations.md b/eslint/docs/src/rules/no-inner-declarations.md
new file mode 100644 (file)
index 0000000..d098999
--- /dev/null
@@ -0,0 +1,201 @@
+---
+title: no-inner-declarations
+layout: doc
+rule_type: problem
+---
+
+
+
+In JavaScript, prior to ES6, a function declaration is only allowed in the first level of a program or the body of another function, though parsers sometimes [erroneously accept them elsewhere](https://code.google.com/p/esprima/issues/detail?id=422). This only applies to function declarations; named or anonymous function expressions can occur anywhere an expression is permitted.
+
+```js
+// Good
+function doSomething() { }
+
+// Bad
+if (test) {
+    function doSomethingElse () { }
+}
+
+function anotherThing() {
+    var fn;
+
+    if (test) {
+
+        // Good
+        fn = function expression() { };
+
+        // Bad
+        function declaration() { }
+    }
+}
+```
+
+A variable declaration is permitted anywhere a statement can go, even nested deeply inside other blocks. This is often undesirable due to variable hoisting, and moving declarations to the root of the program or function body can increase clarity. Note that [block bindings](https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings) (`let`, `const`) are not hoisted and therefore they are not affected by this rule.
+
+```js
+/*eslint-env es6*/
+
+// Good
+var foo = 42;
+
+// Good
+if (foo) {
+    let bar1;
+}
+
+// Bad
+while (test) {
+    var bar2;
+}
+
+function doSomething() {
+    // Good
+    var baz = true;
+
+    // Bad
+    if (baz) {
+        var quux;
+    }
+}
+```
+
+## Rule Details
+
+This rule requires that function declarations and, optionally, variable declarations be in the root of a program, or in the root of the body of a function, or in the root of the body of a class static block.
+
+## Options
+
+This rule has a string option:
+
+* `"functions"` (default) disallows `function` declarations in nested blocks
+* `"both"` disallows `function` and `var` declarations in nested blocks
+
+### functions
+
+Examples of **incorrect** code for this rule with the default `"functions"` option:
+
+::: incorrect
+
+```js
+/*eslint no-inner-declarations: "error"*/
+
+if (test) {
+    function doSomething() { }
+}
+
+function doSomethingElse() {
+    if (test) {
+        function doAnotherThing() { }
+    }
+}
+
+if (foo) function f(){}
+
+class C {
+    static {
+        if (test) {
+            function doSomething() { }
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"functions"` option:
+
+::: correct
+
+```js
+/*eslint no-inner-declarations: "error"*/
+
+function doSomething() { }
+
+function doSomethingElse() {
+    function doAnotherThing() { }
+}
+
+class C {
+    static {
+        function doSomething() { }
+    }
+}
+
+if (test) {
+    asyncCall(id, function (err, data) { });
+}
+
+var fn;
+if (test) {
+    fn = function fnExpression() { };
+}
+
+if (foo) var a;
+```
+
+:::
+
+### both
+
+Examples of **incorrect** code for this rule with the `"both"` option:
+
+::: incorrect
+
+```js
+/*eslint no-inner-declarations: ["error", "both"]*/
+
+if (test) {
+    var foo = 42;
+}
+
+function doAnotherThing() {
+    if (test) {
+        var bar = 81;
+    }
+}
+
+if (foo) var a;
+
+if (foo) function f(){}
+
+class C {
+    static {
+        if (test) {
+            var something;
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"both"` option:
+
+::: correct
+
+```js
+/*eslint no-inner-declarations: ["error", "both"]*/
+
+var bar = 42;
+
+if (test) {
+    let baz = 43;
+}
+
+function doAnotherThing() {
+    var baz = 81;
+}
+
+class C {
+    static {
+        var something;
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+The function declaration portion rule will be rendered obsolete when [block-scoped functions](https://bugzilla.mozilla.org/show_bug.cgi?id=585536) land in ES6, but until then, it should be left on to enforce valid constructions. Disable checking variable declarations when using [block-scoped-var](block-scoped-var) or if declaring variables in nested blocks is acceptable despite hoisting.
diff --git a/eslint/docs/src/rules/no-invalid-regexp.md b/eslint/docs/src/rules/no-invalid-regexp.md
new file mode 100644 (file)
index 0000000..59fe9dc
--- /dev/null
@@ -0,0 +1,73 @@
+---
+title: no-invalid-regexp
+layout: doc
+rule_type: problem
+further_reading:
+- https://es5.github.io/#x7.8.5
+---
+
+
+
+An invalid pattern in a regular expression literal is a `SyntaxError` when the code is parsed, but an invalid string in `RegExp` constructors throws a `SyntaxError` only when the code is executed.
+
+## Rule Details
+
+This rule disallows invalid regular expression strings in `RegExp` constructors.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-invalid-regexp: "error"*/
+
+RegExp('[')
+
+RegExp('.', 'z')
+
+new RegExp('\\')
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-invalid-regexp: "error"*/
+
+RegExp('.')
+
+new RegExp
+
+this.RegExp('[')
+```
+
+:::
+
+Please note that this rule validates regular expressions per the latest ECMAScript specification, regardless of your parser settings.
+
+If you want to allow additional constructor flags for any reason, you can specify them using the `allowConstructorFlags` option. These flags will then be ignored by the rule.
+
+## Options
+
+This rule has an object option for exceptions:
+
+* `"allowConstructorFlags"` is an array of flags
+
+### allowConstructorFlags
+
+Examples of **correct** code for this rule with the `{ "allowConstructorFlags": ["a", "z"] }` option:
+
+::: correct
+
+```js
+/*eslint no-invalid-regexp: ["error", { "allowConstructorFlags": ["a", "z"] }]*/
+
+new RegExp('.', 'a')
+
+new RegExp('.', 'az')
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-invalid-this.md b/eslint/docs/src/rules/no-invalid-this.md
new file mode 100644 (file)
index 0000000..62c11ba
--- /dev/null
@@ -0,0 +1,290 @@
+---
+title: no-invalid-this
+layout: doc
+rule_type: suggestion
+---
+
+
+Under the strict mode, `this` keywords outside of classes or class-like objects might be `undefined` and raise a `TypeError`.
+
+## Rule Details
+
+This rule aims to flag usage of `this` keywords in contexts where the value of `this` is `undefined`.
+
+Top-level `this` in scripts is always considered valid because it refers to the global object regardless of the strict mode.
+
+Top-level `this` in ECMAScript modules is always considered invalid because its value is `undefined`.
+
+For `this` inside functions, this rule basically checks whether or not the function containing `this` keyword is a constructor or a method. Note that arrow functions have lexical `this`, and that therefore this rule checks their enclosing contexts.
+
+This rule judges from following conditions whether or not the function is a constructor:
+
+* The name of the function starts with uppercase.
+* The function is assigned to a variable which starts with an uppercase letter.
+* The function is a constructor of ES2015 Classes.
+
+This rule judges from following conditions whether or not the function is a method:
+
+* The function is on an object literal.
+* The function is assigned to a property.
+* The function is a method/getter/setter of ES2015 Classes.
+
+And this rule allows `this` keywords in functions below:
+
+* The `call/apply/bind` method of the function is called directly.
+* The function is a callback of array methods (such as `.forEach()`) if `thisArg` is given.
+* The function has `@this` tag in its JSDoc comment.
+
+And this rule always allows `this` keywords in the following contexts:
+
+* At the top level of scripts.
+* In class field initializers.
+* In class static blocks.
+
+Otherwise are considered problems.
+
+This rule applies **only** in strict mode.
+With `"parserOptions": { "sourceType": "module" }` in the ESLint configuration, your code is in strict mode even without a `"use strict"` directive.
+
+Examples of **incorrect** code for this rule in strict mode:
+
+::: incorrect
+
+```js
+/*eslint no-invalid-this: "error"*/
+/*eslint-env es6*/
+
+"use strict";
+
+(function() {
+    this.a = 0;
+    baz(() => this);
+})();
+
+function foo() {
+    this.a = 0;
+    baz(() => this);
+}
+
+var foo = function() {
+    this.a = 0;
+    baz(() => this);
+};
+
+foo(function() {
+    this.a = 0;
+    baz(() => this);
+});
+
+var obj = {
+    aaa: function() {
+        return function foo() {
+            // There is in a method `aaa`, but `foo` is not a method.
+            this.a = 0;
+            baz(() => this);
+        };
+    }
+};
+
+foo.forEach(function() {
+    this.a = 0;
+    baz(() => this);
+});
+```
+
+:::
+
+Examples of **correct** code for this rule in strict mode:
+
+::: correct
+
+```js
+/*eslint no-invalid-this: "error"*/
+/*eslint-env es6*/
+
+"use strict";
+
+this.a = 0;
+baz(() => this);
+
+function Foo() {
+    // OK, this is in a legacy style constructor.
+    this.a = 0;
+    baz(() => this);
+}
+
+class Foo {
+    constructor() {
+        // OK, this is in a constructor.
+        this.a = 0;
+        baz(() => this);
+    }
+}
+
+var obj = {
+    foo: function foo() {
+        // OK, this is in a method (this function is on object literal).
+        this.a = 0;
+    }
+};
+
+var obj = {
+    foo() {
+        // OK, this is in a method (this function is on object literal).
+        this.a = 0;
+    }
+};
+
+var obj = {
+    get foo() {
+        // OK, this is in a method (this function is on object literal).
+        return this.a;
+    }
+};
+
+var obj = Object.create(null, {
+    foo: {value: function foo() {
+        // OK, this is in a method (this function is on object literal).
+        this.a = 0;
+    }}
+});
+
+Object.defineProperty(obj, "foo", {
+    value: function foo() {
+        // OK, this is in a method (this function is on object literal).
+        this.a = 0;
+    }
+});
+
+Object.defineProperties(obj, {
+    foo: {value: function foo() {
+        // OK, this is in a method (this function is on object literal).
+        this.a = 0;
+    }}
+});
+
+function Foo() {
+    this.foo = function foo() {
+        // OK, this is in a method (this function assigns to a property).
+        this.a = 0;
+        baz(() => this);
+    };
+}
+
+obj.foo = function foo() {
+    // OK, this is in a method (this function assigns to a property).
+    this.a = 0;
+};
+
+Foo.prototype.foo = function foo() {
+    // OK, this is in a method (this function assigns to a property).
+    this.a = 0;
+};
+
+class Foo {
+
+    // OK, this is in a class field initializer.
+    a = this.b;
+
+    // OK, static initializers also have valid this.
+    static a = this.b;
+
+    foo() {
+        // OK, this is in a method.
+        this.a = 0;
+        baz(() => this);
+    }
+
+    static foo() {
+        // OK, this is in a method (static methods also have valid this).
+        this.a = 0;
+        baz(() => this);
+    }
+
+    static {
+        // OK, static blocks also have valid this.
+        this.a = 0;
+        baz(() => this);
+    }
+}
+
+var foo = (function foo() {
+    // OK, the `bind` method of this function is called directly.
+    this.a = 0;
+}).bind(obj);
+
+foo.forEach(function() {
+    // OK, `thisArg` of `.forEach()` is given.
+    this.a = 0;
+    baz(() => this);
+}, thisArg);
+
+/** @this Foo */
+function foo() {
+    // OK, this function has a `@this` tag in its JSDoc comment.
+    this.a = 0;
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option, with one option:
+
+* `"capIsConstructor": false` (default `true`) disables the assumption that a function which name starts with an uppercase is a constructor.
+
+### capIsConstructor
+
+By default, this rule always allows the use of `this` in functions which name starts with an uppercase and anonymous functions that are assigned to a variable which name starts with an uppercase, assuming that those functions are used as constructor functions.
+
+Set `"capIsConstructor"` to `false` if you want those functions to be treated as 'regular' functions.
+
+Examples of **incorrect** code for this rule with `"capIsConstructor"` option set to `false`:
+
+::: incorrect
+
+```js
+/*eslint no-invalid-this: ["error", { "capIsConstructor": false }]*/
+
+"use strict";
+
+function Foo() {
+    this.a = 0;
+}
+
+var bar = function Foo() {
+    this.a = 0;
+}
+
+var Bar = function() {
+    this.a = 0;
+};
+
+Baz = function() {
+    this.a = 0;
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with `"capIsConstructor"` option set to `false`:
+
+::: correct
+
+```js
+/*eslint no-invalid-this: ["error", { "capIsConstructor": false }]*/
+
+"use strict";
+
+obj.Foo = function Foo() {
+    // OK, this is in a method.
+    this.a = 0;
+};
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of `this` keyword outside of classes or class-like objects, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-irregular-whitespace.md b/eslint/docs/src/rules/no-irregular-whitespace.md
new file mode 100644 (file)
index 0000000..3f27133
--- /dev/null
@@ -0,0 +1,198 @@
+---
+title: no-irregular-whitespace
+layout: doc
+rule_type: problem
+further_reading:
+- https://es5.github.io/#x7.2
+- https://web.archive.org/web/20200414142829/http://timelessrepo.com/json-isnt-a-javascript-subset
+---
+
+
+
+Invalid or irregular whitespace causes issues with ECMAScript 5 parsers and also makes code harder to debug in a similar nature to mixed tabs and spaces.
+
+Various whitespace characters can be inputted by programmers by mistake for example from copying or keyboard shortcuts. Pressing Alt + Space on macOS adds in a non breaking space character for example.
+
+A simple fix for this problem could be to rewrite the offending line from scratch. This might also be a problem introduced by the text editor: if rewriting the line does not fix it, try using a different editor.
+
+Known issues these spaces cause:
+
+* Zero Width Space
+    * Is NOT considered a separator for tokens and is often parsed as an `Unexpected token ILLEGAL`
+    * Is NOT shown in modern browsers making code repository software expected to resolve the visualization
+* Line Separator
+    * Is NOT a valid character within JSON which would cause parse errors
+
+## Rule Details
+
+This rule is aimed at catching invalid whitespace that is not a normal tab and space. Some of these characters may cause issues in modern browsers and others will be a debugging issue to spot.
+
+This rule disallows the following characters except where the options allow:
+
+```text
+\u000B - Line Tabulation (\v) - <VT>
+\u000C - Form Feed (\f) - <FF>
+\u00A0 - No-Break Space - <NBSP>
+\u0085 - Next Line
+\u1680 - Ogham Space Mark
+\u180E - Mongolian Vowel Separator - <MVS>
+\ufeff - Zero Width No-Break Space - <BOM>
+\u2000 - En Quad
+\u2001 - Em Quad
+\u2002 - En Space - <ENSP>
+\u2003 - Em Space - <EMSP>
+\u2004 - Three-Per-Em
+\u2005 - Four-Per-Em
+\u2006 - Six-Per-Em
+\u2007 - Figure Space
+\u2008 - Punctuation Space - <PUNCSP>
+\u2009 - Thin Space
+\u200A - Hair Space
+\u200B - Zero Width Space - <ZWSP>
+\u2028 - Line Separator
+\u2029 - Paragraph Separator
+\u202F - Narrow No-Break Space
+\u205f - Medium Mathematical Space
+\u3000 - Ideographic Space
+```
+
+## Options
+
+This rule has an object option for exceptions:
+
+* `"skipStrings": true` (default) allows any whitespace characters in string literals
+* `"skipComments": true` allows any whitespace characters in comments
+* `"skipRegExps": true` allows any whitespace characters in regular expression literals
+* `"skipTemplates": true` allows any whitespace characters in template literals
+
+### skipStrings
+
+Examples of **incorrect** code for this rule with the default `{ "skipStrings": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-irregular-whitespace: "error"*/
+
+function thing() /*<NBSP>*/{
+    return 'test';
+}
+
+function thing( /*<NBSP>*/){
+    return 'test';
+}
+
+function thing /*<NBSP>*/(){
+    return 'test';
+}
+
+function thing᠎/*<MVS>*/(){
+    return 'test';
+}
+
+function thing() {
+    return 'test'; /*<ENSP>*/
+}
+
+function thing() {
+    return 'test'; /*<NBSP>*/
+}
+
+function thing() {
+    // Description <NBSP>: some descriptive text
+}
+
+/*
+Description <NBSP>: some descriptive text
+*/
+
+function thing() {
+    return / <NBSP>regexp/;
+}
+
+/*eslint-env es6*/
+function thing() {
+    return `template <NBSP>string`;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "skipStrings": true }` option:
+
+::: correct
+
+```js
+/*eslint no-irregular-whitespace: "error"*/
+
+function thing() {
+    return ' <NBSP>thing';
+}
+
+function thing() {
+    return '​<ZWSP>thing';
+}
+
+function thing() {
+    return 'th <NBSP>ing';
+}
+```
+
+:::
+
+### skipComments
+
+Examples of additional **correct** code for this rule with the `{ "skipComments": true }` option:
+
+::: correct
+
+```js
+/*eslint no-irregular-whitespace: ["error", { "skipComments": true }]*/
+
+function thing() {
+    // Description <NBSP>: some descriptive text
+}
+
+/*
+Description <NBSP>: some descriptive text
+*/
+```
+
+:::
+
+### skipRegExps
+
+Examples of additional **correct** code for this rule with the `{ "skipRegExps": true }` option:
+
+::: correct
+
+```js
+/*eslint no-irregular-whitespace: ["error", { "skipRegExps": true }]*/
+
+function thing() {
+    return / <NBSP>regexp/;
+}
+```
+
+:::
+
+### skipTemplates
+
+Examples of additional **correct** code for this rule with the `{ "skipTemplates": true }` option:
+
+::: correct
+
+```js
+/*eslint no-irregular-whitespace: ["error", { "skipTemplates": true }]*/
+/*eslint-env es6*/
+
+function thing() {
+    return `template <NBSP>string`;
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you decide that you wish to use whitespace other than tabs and spaces outside of strings in your application.
diff --git a/eslint/docs/src/rules/no-iterator.md b/eslint/docs/src/rules/no-iterator.md
new file mode 100644 (file)
index 0000000..b0335e8
--- /dev/null
@@ -0,0 +1,55 @@
+---
+title: no-iterator
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
+- https://kangax.github.io/es5-compat-table/es6/#Iterators
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#Object_methods
+---
+
+
+The `__iterator__` property was a SpiderMonkey extension to JavaScript that could be used to create custom iterators that are compatible with JavaScript's `for in` and `for each` constructs. However, this property is now obsolete, so it should not be used. Here's an example of how this used to work:
+
+```js
+Foo.prototype.__iterator__ = function() {
+    return new FooIterator(this);
+}
+```
+
+You should use ECMAScript 6 iterators and generators instead.
+
+## Rule Details
+
+This rule is aimed at preventing errors that may arise from using the `__iterator__` property, which is not implemented in several browsers. As such, it will warn whenever it encounters the `__iterator__` property.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-iterator: "error"*/
+
+Foo.prototype.__iterator__ = function() {
+    return new FooIterator(this);
+};
+
+foo.__iterator__ = function () {};
+
+foo["__iterator__"] = function () {};
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-iterator: "error"*/
+
+var __iterator__ = foo; // Not using the `__iterator__` property.
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-label-var.md b/eslint/docs/src/rules/no-label-var.md
new file mode 100644 (file)
index 0000000..422538a
--- /dev/null
@@ -0,0 +1,59 @@
+---
+title: no-label-var
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extra-label
+- no-labels
+- no-unused-labels
+---
+
+
+## Rule Details
+
+This rule aims to create clearer code by disallowing the bad practice of creating a label that shares a name with a variable that is in scope.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-label-var: "error"*/
+
+var x = foo;
+function bar() {
+x:
+  for (;;) {
+    break x;
+  }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-label-var: "error"*/
+
+// The variable that has the same name as the label is not in scope.
+
+function foo() {
+  var q = t;
+}
+
+function bar() {
+q:
+  for(;;) {
+    break q;
+  }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of labels, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-labels.md b/eslint/docs/src/rules/no-labels.md
new file mode 100644 (file)
index 0000000..c8d65c8
--- /dev/null
@@ -0,0 +1,142 @@
+---
+title: no-labels
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extra-label
+- no-label-var
+- no-unused-labels
+---
+
+
+Labeled statements in JavaScript are used in conjunction with `break` and `continue` to control flow around multiple loops. For example:
+
+```js
+outer:
+    while (true) {
+
+        while (true) {
+            break outer;
+        }
+    }
+```
+
+The `break outer` statement ensures that this code will not result in an infinite loop because control is returned to the next statement after the `outer` label was applied. If this statement was changed to be just `break`, control would flow back to the outer `while` statement and an infinite loop would result.
+
+While convenient in some cases, labels tend to be used only rarely and are frowned upon by some as a remedial form of flow control that is more error prone and harder to understand.
+
+## Rule Details
+
+This rule aims to eliminate the use of labeled statements in JavaScript. It will warn whenever a labeled statement is encountered and whenever `break` or `continue` are used with a label.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-labels: "error"*/
+
+label:
+    while(true) {
+        // ...
+    }
+
+label:
+    while(true) {
+        break label;
+    }
+
+label:
+    while(true) {
+        continue label;
+    }
+
+label:
+    switch (a) {
+    case 0:
+        break label;
+    }
+
+label:
+    {
+        break label;
+    }
+
+label:
+    if (a) {
+        break label;
+    }
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-labels: "error"*/
+
+var f = {
+    label: "foo"
+};
+
+while (true) {
+    break;
+}
+
+while (true) {
+    continue;
+}
+```
+
+:::
+
+## Options
+
+The options allow labels with loop or switch statements:
+
+* `"allowLoop"` (`boolean`, default is `false`) - If this option was set `true`, this rule ignores labels which are sticking to loop statements.
+* `"allowSwitch"` (`boolean`, default is `false`) - If this option was set `true`, this rule ignores labels which are sticking to switch statements.
+
+Actually labeled statements in JavaScript can be used with other than loop and switch statements.
+However, this way is ultra rare, not well-known, so this would be confusing developers.
+
+### allowLoop
+
+Examples of **correct** code for the `{ "allowLoop": true }` option:
+
+::: correct
+
+```js
+/*eslint no-labels: ["error", { "allowLoop": true }]*/
+
+label:
+    while (true) {
+        break label;
+    }
+```
+
+:::
+
+### allowSwitch
+
+Examples of **correct** code for the `{ "allowSwitch": true }` option:
+
+::: correct
+
+```js
+/*eslint no-labels: ["error", { "allowSwitch": true }]*/
+
+label:
+    switch (a) {
+        case 0:
+            break label;
+    }
+```
+
+:::
+
+## When Not To Use It
+
+If you need to use labeled statements everywhere, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-lone-blocks.md b/eslint/docs/src/rules/no-lone-blocks.md
new file mode 100644 (file)
index 0000000..22703f8
--- /dev/null
@@ -0,0 +1,131 @@
+---
+title: no-lone-blocks
+layout: doc
+rule_type: suggestion
+---
+
+
+In JavaScript, prior to ES6, standalone code blocks delimited by curly braces do not create a new scope and have no use. For example, these curly braces do nothing to `foo`:
+
+```js
+{
+    var foo = bar();
+}
+```
+
+In ES6, code blocks may create a new scope if a block-level binding (`let` and `const`), a class declaration or a function declaration (in strict mode) are present. A block is not considered redundant in these cases.
+
+## Rule Details
+
+This rule aims to eliminate unnecessary and potentially confusing blocks at the top level of a script or within other blocks.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-lone-blocks: "error"*/
+
+{}
+
+if (foo) {
+    bar();
+    {
+        baz();
+    }
+}
+
+function bar() {
+    {
+        baz();
+    }
+}
+
+{
+    function foo() {}
+}
+
+{
+    aLabel: {
+    }
+}
+
+class C {
+    static {
+        {
+            foo();
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with ES6 environment:
+
+::: correct
+
+```js
+/*eslint no-lone-blocks: "error"*/
+/*eslint-env es6*/
+
+while (foo) {
+    bar();
+}
+
+if (foo) {
+    if (bar) {
+        baz();
+    }
+}
+
+function bar() {
+    baz();
+}
+
+{
+    let x = 1;
+}
+
+{
+    const y = 1;
+}
+
+{
+    class Foo {}
+}
+
+aLabel: {
+}
+
+class C {
+    static {
+        lbl: {
+            if (something) {
+                break lbl;
+            }
+
+            foo();
+        }
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with ES6 environment and strict mode via `"parserOptions": { "sourceType": "module" }` in the ESLint configuration or `"use strict"` directive in the code:
+
+::: correct
+
+```js
+/*eslint no-lone-blocks: "error"*/
+/*eslint-env es6*/
+
+"use strict";
+
+{
+    function foo() {}
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-lonely-if.md b/eslint/docs/src/rules/no-lonely-if.md
new file mode 100644 (file)
index 0000000..2b306d4
--- /dev/null
@@ -0,0 +1,98 @@
+---
+title: no-lonely-if
+layout: doc
+rule_type: suggestion
+---
+
+
+
+If an `if` statement is the only statement in the `else` block, it is often clearer to use an `else if` form.
+
+```js
+if (foo) {
+    // ...
+} else {
+    if (bar) {
+        // ...
+    }
+}
+```
+
+should be rewritten as
+
+```js
+if (foo) {
+    // ...
+} else if (bar) {
+    // ...
+}
+```
+
+## Rule Details
+
+This rule disallows `if` statements as the only statement in `else` blocks.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-lonely-if: "error"*/
+
+if (condition) {
+    // ...
+} else {
+    if (anotherCondition) {
+        // ...
+    }
+}
+
+if (condition) {
+    // ...
+} else {
+    if (anotherCondition) {
+        // ...
+    } else {
+        // ...
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-lonely-if: "error"*/
+
+if (condition) {
+    // ...
+} else if (anotherCondition) {
+    // ...
+}
+
+if (condition) {
+    // ...
+} else if (anotherCondition) {
+    // ...
+} else {
+    // ...
+}
+
+if (condition) {
+    // ...
+} else {
+    if (anotherCondition) {
+        // ...
+    }
+    doSomething();
+}
+```
+
+:::
+
+## When Not To Use It
+
+Disable this rule if the code is clearer without requiring the `else if` form.
diff --git a/eslint/docs/src/rules/no-loop-func.md b/eslint/docs/src/rules/no-loop-func.md
new file mode 100644 (file)
index 0000000..07e22b5
--- /dev/null
@@ -0,0 +1,110 @@
+---
+title: no-loop-func
+layout: doc
+rule_type: suggestion
+---
+
+
+Writing functions within loops tends to result in errors due to the way the function creates a closure around the loop. For example:
+
+```js
+for (var i = 0; i < 10; i++) {
+    funcs[i] = function() {
+        return i;
+    };
+}
+```
+
+In this case, you would expect each function created within the loop to return a different number. In reality, each function returns 10, because that was the last value of `i` in the scope.
+
+`let` or `const` mitigate this problem.
+
+```js
+/*eslint-env es6*/
+
+for (let i = 0; i < 10; i++) {
+    funcs[i] = function() {
+        return i;
+    };
+}
+```
+
+In this case, each function created within the loop returns a different number as expected.
+
+## Rule Details
+
+This error is raised to highlight a piece of code that may not work as you expect it to and could also indicate a misunderstanding of how the language works. Your code may run without any problems if you do not fix this error, but in some situations it could behave unexpectedly.
+
+This rule disallows any function within a loop that contains unsafe references (e.g. to modified variables from the outer scope).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-loop-func: "error"*/
+/*eslint-env es6*/
+
+for (var i=10; i; i--) {
+    (function() { return i; })();
+}
+
+while(i) {
+    var a = function() { return i; };
+    a();
+}
+
+do {
+    function a() { return i; };
+    a();
+} while (i);
+
+let foo = 0;
+for (let i = 0; i < 10; ++i) {
+    //Bad, `foo` is not in the loop-block's scope and `foo` is modified in/after the loop
+    setTimeout(() => console.log(foo));
+    foo += 1;
+}
+
+for (let i = 0; i < 10; ++i) {
+    //Bad, `foo` is not in the loop-block's scope and `foo` is modified in/after the loop
+    setTimeout(() => console.log(foo));
+}
+foo = 100;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-loop-func: "error"*/
+/*eslint-env es6*/
+
+var a = function() {};
+
+for (var i=10; i; i--) {
+    a();
+}
+
+for (var i=10; i; i--) {
+    var a = function() {}; // OK, no references to variables in the outer scopes.
+    a();
+}
+
+for (let i=10; i; i--) {
+    var a = function() { return i; }; // OK, all references are referring to block scoped variables in the loop.
+    a();
+}
+
+var foo = 100;
+for (let i=10; i; i--) {
+    var a = function() { return foo; }; // OK, all references are referring to never modified variables.
+    a();
+}
+//... no modifications of foo after this loop ...
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-loss-of-precision.md b/eslint/docs/src/rules/no-loss-of-precision.md
new file mode 100644 (file)
index 0000000..2eed801
--- /dev/null
@@ -0,0 +1,48 @@
+---
+title: no-loss-of-precision
+layout: doc
+rule_type: problem
+---
+
+
+
+This rule would disallow the use of number literals that lose precision at runtime when converted to a JS `Number` due to 64-bit floating-point rounding.
+
+## Rule Details
+
+In JS, `Number`s are stored as double-precision floating-point numbers according to the [IEEE 754 standard](https://en.wikipedia.org/wiki/IEEE_754). Because of this, numbers can only retain accuracy up to a certain amount of digits. If the programmer enters additional digits, those digits will be lost in the conversion to the `Number` type and will result in unexpected behavior.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-loss-of-precision: "error"*/
+
+const x = 9007199254740993
+const x = 5123000000000000000000000000001
+const x = 1230000000000000000000000.0
+const x = .1230000000000000000000000
+const x = 0X20000000000001
+const x = 0X2_000000000_0001;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-loss-of-precision: "error"*/
+
+const x = 12345
+const x = 123.456
+const x = 123e34
+const x = 12300000000000000000000000
+const x = 0x1FFFFFFFFFFFFF
+const x = 9007199254740991
+const x = 9007_1992547409_91
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-magic-numbers.md b/eslint/docs/src/rules/no-magic-numbers.md
new file mode 100644 (file)
index 0000000..fca63d6
--- /dev/null
@@ -0,0 +1,254 @@
+---
+title: no-magic-numbers
+layout: doc
+rule_type: suggestion
+---
+
+
+'Magic numbers' are numbers that occur multiple times in code without an explicit meaning.
+They should preferably be replaced by named constants.
+
+```js
+var now = Date.now(),
+    inOneHour = now + (60 * 60 * 1000);
+```
+
+## Rule Details
+
+The `no-magic-numbers` rule aims to make code more readable and refactoring easier by ensuring that special numbers
+are declared as constants to make their meaning explicit.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: "error"*/
+
+var dutyFreePrice = 100,
+    finalPrice = dutyFreePrice + (dutyFreePrice * 0.25);
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: "error"*/
+
+var data = ['foo', 'bar', 'baz'];
+
+var dataLast = data[2];
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: "error"*/
+
+var SECONDS;
+
+SECONDS = 60;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: "error"*/
+
+var TAX = 0.25;
+
+var dutyFreePrice = 100,
+    finalPrice = dutyFreePrice + (dutyFreePrice * TAX);
+```
+
+:::
+
+## Options
+
+### ignore
+
+An array of numbers to ignore. It's set to `[]` by default.
+If provided, it must be an `Array`.
+
+The array can contain values of `number` and `string` types.
+If it's a string, the text must be parsed as `bigint` literal (e.g., `"100n"`).
+
+Examples of **correct** code for the sample `{ "ignore": [1] }` option:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignore": [1] }]*/
+
+var data = ['foo', 'bar', 'baz'];
+var dataLast = data.length && data[data.length - 1];
+```
+
+:::
+
+Examples of **correct** code for the sample `{ "ignore": ["1n"] }` option:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignore": ["1n"] }]*/
+
+foo(1n);
+```
+
+:::
+
+### ignoreArrayIndexes
+
+A boolean to specify if numbers used in the context of array indexes (e.g., `data[2]`) are considered okay. `false` by default.
+
+This option allows only valid array indexes: numbers that will be coerced to one of `"0"`, `"1"`, `"2"` ... `"4294967294"`.
+
+Arrays are objects, so they can have property names such as `"-1"` or `"2.5"`. However, those are just "normal" object properties that don't represent array elements. They don't influence the array's `length`, and they are ignored by array methods like `.map` or `.forEach`.
+
+Additionally, since the maximum [array length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) is 2<sup>32</sup> - 1, all values above 2<sup>32</sup> - 2 also represent just normal property names and are thus not considered to be array indexes.
+
+Examples of **correct** code for the `{ "ignoreArrayIndexes": true }` option:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignoreArrayIndexes": true }]*/
+
+var item = data[2];
+
+data[100] = a;
+
+f(data[0]);
+
+a = data[-0]; // same as data[0], -0 will be coerced to "0"
+
+a = data[0xAB];
+
+a = data[5.6e1];
+
+a = data[10n]; // same as data[10], 10n will be coerced to "10"
+
+a = data[4294967294]; // max array index
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "ignoreArrayIndexes": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignoreArrayIndexes": true }]*/
+
+f(2); // not used as array index
+
+a = data[-1];
+
+a = data[2.5];
+
+a = data[5.67e1];
+
+a = data[-10n];
+
+a = data[4294967295]; // above the max array index
+
+a = data[1e500]; // same as data["Infinity"]
+```
+
+:::
+
+### ignoreDefaultValues
+
+A boolean to specify if numbers used in default value assignments are considered okay. `false` by default.
+
+Examples of **correct** code for the `{ "ignoreDefaultValues": true }` option:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignoreDefaultValues": true }]*/
+
+const { tax = 0.25 } = accountancy;
+
+function mapParallel(concurrency = 3) { /***/ }
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "ignoreDefaultValues": true }]*/
+
+let head;
+[head = 100] = []
+```
+
+:::
+
+### enforceConst
+
+A boolean to specify if we should check for the const keyword in variable declaration of numbers. `false` by default.
+
+Examples of **incorrect** code for the `{ "enforceConst": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: ["error", { "enforceConst": true }]*/
+
+var TAX = 0.25;
+
+var dutyFreePrice = 100,
+    finalPrice = dutyFreePrice + (dutyFreePrice * TAX);
+```
+
+:::
+
+### detectObjects
+
+A boolean to specify if we should detect numbers when setting object properties for example. `false` by default.
+
+Examples of **incorrect** code for the `{ "detectObjects": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-magic-numbers: ["error", { "detectObjects": true }]*/
+
+var magic = {
+  tax: 0.25
+};
+
+var dutyFreePrice = 100,
+    finalPrice = dutyFreePrice + (dutyFreePrice * magic.tax);
+```
+
+:::
+
+Examples of **correct** code for the `{ "detectObjects": true }` option:
+
+::: correct
+
+```js
+/*eslint no-magic-numbers: ["error", { "detectObjects": true }]*/
+
+var TAX = 0.25;
+
+var magic = {
+  tax: TAX
+};
+
+var dutyFreePrice = 100,
+    finalPrice = dutyFreePrice + (dutyFreePrice * magic.tax);
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-misleading-character-class.md b/eslint/docs/src/rules/no-misleading-character-class.md
new file mode 100644 (file)
index 0000000..57b3ee6
--- /dev/null
@@ -0,0 +1,89 @@
+---
+title: no-misleading-character-class
+layout: doc
+rule_type: problem
+---
+
+
+
+
+
+Unicode includes the characters which are made with multiple code points.
+RegExp character class syntax (`/[abc]/`) cannot handle characters which are made by multiple code points as a character; those characters will be dissolved to each code point. For example, `❇️` is made by `❇` (`U+2747`) and VARIATION SELECTOR-16 (`U+FE0F`). If this character is in RegExp character class, it will match to either `❇` (`U+2747`) or VARIATION SELECTOR-16 (`U+FE0F`) rather than `❇️`.
+
+This rule reports the regular expressions which include multiple code point characters in character class syntax. This rule considers the following characters as multiple code point characters.
+
+**A character with combining characters:**
+
+The combining characters are characters which belong to one of `Mc`, `Me`, and `Mn` [Unicode general categories](http://www.unicode.org/L2/L1999/UnicodeData.html#General%20Category).
+
+```js
+/^[Á]$/u.test("Á") //→ false
+/^[❇️]$/u.test("❇️") //→ false
+```
+
+**A character with Emoji modifiers:**
+
+```js
+/^[👶🏻]$/u.test("👶🏻") //→ false
+/^[👶🏽]$/u.test("👶🏽") //→ false
+```
+
+**A pair of regional indicator symbols:**
+
+```js
+/^[🇯🇵]$/u.test("🇯🇵") //→ false
+```
+
+**Characters that ZWJ joins:**
+
+```js
+/^[👨‍👩‍👦]$/u.test("👨‍👩‍👦") //→ false
+```
+
+**A surrogate pair without Unicode flag:**
+
+```js
+/^[👍]$/.test("👍") //→ false
+
+// Surrogate pair is OK if with u flag.
+/^[👍]$/u.test("👍") //→ true
+```
+
+## Rule Details
+
+This rule reports the regular expressions which include multiple code point characters in character class syntax.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-misleading-character-class: error */
+
+/^[Á]$/u
+/^[❇️]$/u
+/^[👶🏻]$/u
+/^[🇯🇵]$/u
+/^[👨‍👩‍👦]$/u
+/^[👍]$/
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-misleading-character-class: error */
+
+/^[abc]$/
+/^[👍]$/u
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you don't want to check RegExp character class syntax for multiple code point characters.
diff --git a/eslint/docs/src/rules/no-mixed-operators.md b/eslint/docs/src/rules/no-mixed-operators.md
new file mode 100644 (file)
index 0000000..17422cb
--- /dev/null
@@ -0,0 +1,219 @@
+---
+title: no-mixed-operators
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extra-parens
+---
+
+
+Enclosing complex expressions by parentheses clarifies the developer's intention, which makes the code more readable.
+This rule warns when different operators are used consecutively without parentheses in an expression.
+
+```js
+var foo = a && b || c || d;    /*BAD: Unexpected mix of '&&' and '||'.*/
+var foo = (a && b) || c || d;  /*GOOD*/
+var foo = a && (b || c || d);  /*GOOD*/
+```
+
+**Note:**
+It is expected for this rule to emit one error for each mixed operator in a pair. As a result, for each two consecutive mixed operators used, a distinct error will be displayed, pointing to where the specific operator that breaks the rule is used:
+
+```js
+var foo = a && b || c || d;
+```
+
+will generate
+
+```shell
+1:13  Unexpected mix of '&&' and '||'. (no-mixed-operators)
+1:18  Unexpected mix of '&&' and '||'. (no-mixed-operators)
+```
+
+## Rule Details
+
+This rule checks `BinaryExpression`, `LogicalExpression` and `ConditionalExpression`.
+
+This rule may conflict with [no-extra-parens](no-extra-parens) rule.
+If you use both this and [no-extra-parens](no-extra-parens) rule together, you need to use the `nestedBinaryExpressions` option of [no-extra-parens](no-extra-parens) rule.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-operators: "error"*/
+
+var foo = a && b < 0 || c > 0 || d + 1 === 0;
+var foo = a + b * c;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-mixed-operators: "error"*/
+
+var foo = a || b || c;
+var foo = a && b && c;
+var foo = (a && b < 0) || c > 0 || d + 1 === 0;
+var foo = a && (b < 0 || c > 0 || d + 1 === 0);
+var foo = a + (b * c);
+var foo = (a + b) * c;
+```
+
+:::
+
+## Options
+
+```json
+{
+    "no-mixed-operators": [
+        "error",
+        {
+            "groups": [
+                ["+", "-", "*", "/", "%", "**"],
+                ["&", "|", "^", "~", "<<", ">>", ">>>"],
+                ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
+                ["&&", "||"],
+                ["in", "instanceof"]
+            ],
+            "allowSamePrecedence": true
+        }
+    ]
+}
+```
+
+This rule has 2 options.
+
+* `groups` (`string[][]`) - specifies operator groups to be checked. The `groups` option is a list of groups, and a group is a list of binary operators. Default operator groups are defined as arithmetic, bitwise, comparison, logical, and relational operators. Note: Ternary operator(?:) can be part of any group and by default is allowed to be mixed with other operators.
+
+* `allowSamePrecedence` (`boolean`) - specifies whether to allow mixed operators if they are of equal precedence. Default is `true`.
+
+### groups
+
+The following operators can be used in `groups` option:
+
+* Arithmetic Operators: `"+"`, `"-"`, `"*"`, `"/"`, `"%"`, `"**"`
+* Bitwise Operators: `"&"`, `"|"`, `"^"`, `"~"`, `"<<"`, `">>"`, `">>>"`
+* Comparison Operators: `"=="`, `"!="`, `"==="`, `"!=="`, `">"`, `">="`, `"<"`, `"<="`
+* Logical Operators: `"&&"`, `"||"`
+* Coalesce Operator: `"??"`
+* Relational Operators: `"in"`, `"instanceof"`
+* Ternary Operator: `?:`
+
+Now, consider the following group configuration: `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}`.
+There are 2 groups specified in this configuration: bitwise operators and logical operators.
+This rule checks if the operators belong to the same group only.
+In this case, this rule checks if bitwise operators and logical operators are mixed, but ignores all other operators.
+
+Examples of **incorrect** code for this rule with `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}` option:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-operators: ["error", {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}]*/
+
+var foo = a && b < 0 || c > 0 || d + 1 === 0;
+var foo = a & b | c;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-mixed-operators: ["error", {"groups": [["&&", "||", "?:"]]}]*/
+
+var foo = a || b ? c : d;
+
+var bar = a ? b || c : d;
+
+var baz = a ? b : c || d;
+```
+
+:::
+
+Examples of **correct** code for this rule with `{"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}` option:
+
+::: correct
+
+```js
+/*eslint no-mixed-operators: ["error", {"groups": [["&", "|", "^", "~", "<<", ">>", ">>>"], ["&&", "||"]]}]*/
+
+var foo = a || b > 0 || c + 1 === 0;
+var foo = a && b > 0 && c + 1 === 0;
+var foo = (a && b < 0) || c > 0 || d + 1 === 0;
+var foo = a && (b < 0 ||  c > 0 || d + 1 === 0);
+var foo = (a & b) | c;
+var foo = a & (b | c);
+var foo = a + b * c;
+var foo = a + (b * c);
+var foo = (a + b) * c;
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-mixed-operators: ["error", {"groups": [["&&", "||", "?:"]]}]*/
+
+var foo = (a || b) ? c : d;
+var foo = a || (b ? c : d);
+
+var bar = a ? (b || c) : d;
+
+var baz = a ? b : (c || d);
+var baz = (a ? b : c) || d;
+```
+
+:::
+
+### allowSamePrecedence
+
+Examples of **correct** code for this rule with `{"allowSamePrecedence": true}` option:
+
+::: correct
+
+```js
+/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": true}]*/
+
+// + and - have the same precedence.
+var foo = a + b - c;
+```
+
+:::
+
+Examples of **incorrect** code for this rule with `{"allowSamePrecedence": false}` option:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
+
+// + and - have the same precedence.
+var foo = a + b - c;
+```
+
+:::
+
+Examples of **correct** code for this rule with `{"allowSamePrecedence": false}` option:
+
+::: correct
+
+```js
+/*eslint no-mixed-operators: ["error", {"allowSamePrecedence": false}]*/
+
+// + and - have the same precedence.
+var foo = (a + b) - c;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about mixed operators, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-mixed-requires.md b/eslint/docs/src/rules/no-mixed-requires.md
new file mode 100644 (file)
index 0000000..1f813d9
--- /dev/null
@@ -0,0 +1,151 @@
+---
+title: no-mixed-requires
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In the Node.js community it is often customary to separate initializations with calls to `require` modules from other variable declarations, sometimes also grouping them by the type of module. This rule helps you enforce this convention.
+
+## Rule Details
+
+When this rule is enabled, each `var` statement must satisfy the following conditions:
+
+* either none or all variable declarations must be require declarations (default)
+* all require declarations must be of the same type (grouping)
+
+This rule distinguishes between six kinds of variable declaration types:
+
+* `core`: declaration of a required [core module][1]
+* `file`: declaration of a required [file module][2]
+* `module`: declaration of a required module from the [node_modules folder][3]
+* `computed`: declaration of a required module whose type could not be determined (either because it is computed or because require was called without an argument)
+* `uninitialized`: a declaration that is not initialized
+* `other`: any other kind of declaration
+
+In this document, the first four types are summed up under the term *require declaration*.
+
+```js
+var fs = require('fs'),        // "core"     \
+    async = require('async'),  // "module"   |- these are "require declaration"s
+    foo = require('./foo'),    // "file"     |
+    bar = require(getName()),  // "computed" /
+    baz = 42,                  // "other"
+    bam;                       // "uninitialized"
+```
+
+## Options
+
+This rule can have an object literal option whose two properties have `false` values by default.
+
+Configuring this rule with one boolean option `true` is deprecated.
+
+Examples of **incorrect** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-requires: "error"*/
+
+var fs = require('fs'),
+    i = 0;
+
+var async = require('async'),
+    debug = require('diagnostics').someFunction('my-module'),
+    eslint = require('eslint');
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
+
+::: correct
+
+```js
+/*eslint no-mixed-requires: "error"*/
+
+// only require declarations (grouping off)
+var eventEmitter = require('events').EventEmitter,
+    myUtils = require('./utils'),
+    util = require('util'),
+    bar = require(getBarModuleName());
+
+// only non-require declarations
+var foo = 42,
+    bar = 'baz';
+
+// always valid regardless of grouping because all declarations are of the same type
+var foo = require('foo' + VERSION),
+    bar = require(getBarModuleName()),
+    baz = require();
+```
+
+:::
+
+### grouping
+
+Examples of **incorrect** code for this rule with the `{ "grouping": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-requires: ["error", { "grouping": true }]*/
+
+// invalid because of mixed types "core" and "module"
+var fs = require('fs'),
+    async = require('async');
+
+// invalid because of mixed types "file" and "unknown"
+var foo = require('foo'),
+    bar = require(getBarModuleName());
+```
+
+:::
+
+### allowCall
+
+Examples of **incorrect** code for this rule with the `{ "allowCall": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
+
+var async = require('async'),
+    debug = require('diagnostics').someFunction('my-module'), /* allowCall doesn't allow calling any function */
+    eslint = require('eslint');
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "allowCall": true }` option:
+
+::: correct
+
+```js
+/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
+
+var async = require('async'),
+    debug = require('diagnostics')('my-module'),
+    eslint = require('eslint');
+```
+
+:::
+
+## Known Limitations
+
+* The implementation is not aware of any local functions with the name `require` that may shadow Node.js' global `require`.
+
+* Internally, the list of core modules is retrieved via `require("repl")._builtinLibs`. If you use different versions of Node.js for ESLint and your application, the list of core modules for each version may be different.
+  The above mentioned `_builtinLibs` property became available in 0.8, for earlier versions a hardcoded list of module names is used as a fallback. If your version of Node.js is older than 0.6 that list may be inaccurate.
+
+## When Not To Use It
+
+If you use a pattern such as [UMD][4] where the `require`d modules are not loaded in variable declarations, this rule will obviously do nothing for you.
+
+[1]: https://nodejs.org/api/modules.html#modules_core_modules
+[2]: https://nodejs.org/api/modules.html#modules_file_modules
+[3]: https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
+[4]: https://github.com/umdjs/umd
diff --git a/eslint/docs/src/rules/no-mixed-spaces-and-tabs.md b/eslint/docs/src/rules/no-mixed-spaces-and-tabs.md
new file mode 100644 (file)
index 0000000..4f34752
--- /dev/null
@@ -0,0 +1,80 @@
+---
+title: no-mixed-spaces-and-tabs
+layout: doc
+rule_type: layout
+further_reading:
+- https://www.emacswiki.org/emacs/SmartTabs
+---
+
+
+
+Most code conventions require either tabs or spaces be used for indentation. As such, it's usually an error if a single line of code is indented with both tabs and spaces.
+
+## Rule Details
+
+This rule disallows mixed spaces and tabs for indentation.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-mixed-spaces-and-tabs: "error"*/
+
+function add(x, y) {
+// --->..return x + y;
+
+      return x + y;
+}
+
+function main() {
+// --->var x = 5,
+// --->....y = 7;
+
+    var x = 5,
+        y = 7;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-mixed-spaces-and-tabs: "error"*/
+
+function add(x, y) {
+// --->return x + y;
+    return x + y;
+}
+```
+
+:::
+
+## Options
+
+This rule has a string option.
+
+* `"smart-tabs"` allows mixed tabs and spaces when the spaces are used for alignment.
+
+### smart-tabs
+
+Examples of **correct** code for this rule with the `"smart-tabs"` option:
+
+::: correct
+
+```js
+/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
+
+function main() {
+// --->var x = 5,
+// --->....y = 7;
+
+    var x = 5,
+        y = 7;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-multi-assign.md b/eslint/docs/src/rules/no-multi-assign.md
new file mode 100644 (file)
index 0000000..351e4a6
--- /dev/null
@@ -0,0 +1,118 @@
+---
+title: no-multi-assign
+layout: doc
+rule_type: suggestion
+related_rules:
+- max-statements-per-line
+---
+
+
+Chaining the assignment of variables can lead to unexpected results and be difficult to read.
+
+```js
+(function() {
+    const foo = bar = 0; // Did you mean `foo = bar == 0`?
+    bar = 1;             // This will not fail since `bar` is not constant.
+})();
+console.log(bar);        // This will output 1 since `bar` is not scoped.
+```
+
+## Rule Details
+
+This rule disallows using multiple assignments within a single statement.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-multi-assign: "error"*/
+
+var a = b = c = 5;
+
+const foo = bar = "baz";
+
+let a =
+    b =
+    c;
+
+class Foo {
+    a = b = 10;
+}
+
+a = b = "quux";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-multi-assign: "error"*/
+
+var a = 5;
+var b = 5;
+var c = 5;
+
+const foo = "baz";
+const bar = "baz";
+
+let a = c;
+let b = c;
+
+class Foo {
+    a = 10;
+    b = 10;
+}
+
+a = "quux";
+b = "quux";
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"ignoreNonDeclaration"`: When set to `true`, the rule allows chains that don't include initializing a variable in a declaration or initializing a class field. Default is `false`.
+
+### ignoreNonDeclaration
+
+Examples of **correct** code for the `{ "ignoreNonDeclaration": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-assign: ["error", { "ignoreNonDeclaration": true }]*/
+
+let a;
+let b;
+a = b = "baz";
+
+const x = {};
+const y = {};
+x.one = y.one = 1;
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "ignoreNonDeclaration": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-multi-assign: ["error", { "ignoreNonDeclaration": true }]*/
+
+let a = b = "baz";
+
+const foo = bar = 1;
+
+class Foo {
+    a = b = 10;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-multi-spaces.md b/eslint/docs/src/rules/no-multi-spaces.md
new file mode 100644 (file)
index 0000000..0345336
--- /dev/null
@@ -0,0 +1,215 @@
+---
+title: no-multi-spaces
+layout: doc
+rule_type: layout
+related_rules:
+- key-spacing
+- space-infix-ops
+- space-in-brackets
+- space-in-parens
+- space-after-keywords
+- space-unary-ops
+- space-return-throw-case
+---
+
+
+
+Multiple spaces in a row that are not used for indentation are typically mistakes. For example:
+
+```js
+
+if(foo  === "bar") {}
+
+```
+
+It's hard to tell, but there are two spaces between `foo` and `===`. Multiple spaces such as this are generally frowned upon in favor of single spaces:
+
+```js
+
+if(foo === "bar") {}
+
+```
+
+## Rule Details
+
+This rule aims to disallow multiple whitespace around logical expressions, conditional expressions, declarations, array elements, object properties, sequences and function parameters.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-multi-spaces: "error"*/
+
+var a =  1;
+
+if(foo   === "bar") {}
+
+a <<  b
+
+var arr = [1,  2];
+
+a ?  b: c
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: "error"*/
+
+var a = 1;
+
+if(foo === "bar") {}
+
+a << b
+
+var arr = [1, 2];
+
+a ? b: c
+```
+
+:::
+
+## Options
+
+This rule's configuration consists of an object with the following properties:
+
+* `"ignoreEOLComments": true` (defaults to `false`) ignores multiple spaces before comments that occur at the end of lines
+* `"exceptions": { "Property": true }` (`"Property"` is the only node specified by default) specifies nodes to ignore
+
+### ignoreEOLComments
+
+Examples of **incorrect** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
+
+::: incorrect
+
+```js
+/*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
+
+var x = 5;      // comment
+var x = 5;      /* multiline
+ * comment
+ */
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
+
+var x = 5; // comment
+var x = 5; /* multiline
+ * comment
+ */
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreEOLComments": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: ["error", { ignoreEOLComments: true }]*/
+
+var x = 5; // comment
+var x = 5;      // comment
+var x = 5; /* multiline
+ * comment
+ */
+var x = 5;      /* multiline
+ * comment
+ */
+```
+
+:::
+
+### exceptions
+
+To avoid contradictions with other rules that require multiple spaces, this rule has an `exceptions` option to ignore certain nodes.
+
+This option is an object that expects property names to be AST node types as defined by [ESTree](https://github.com/estree/estree). The easiest way to determine the node types for `exceptions` is to use [AST Explorer](https://astexplorer.net/) with the espree parser.
+
+Only the `Property` node type is ignored by default, because for the [key-spacing](key-spacing) rule some alignment options require multiple spaces in properties of object literals.
+
+Examples of **correct** code for the default `"exceptions": { "Property": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: "error"*/
+/*eslint key-spacing: ["error", { align: "value" }]*/
+
+var obj = {
+    first:  "first",
+    second: "second"
+};
+```
+
+:::
+
+Examples of **incorrect** code for the `"exceptions": { "Property": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-multi-spaces: ["error", { exceptions: { "Property": false } }]*/
+/*eslint key-spacing: ["error", { align: "value" }]*/
+
+var obj = {
+    first:  "first",
+    second: "second"
+};
+```
+
+:::
+
+Examples of **correct** code for the `"exceptions": { "BinaryExpression": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: ["error", { exceptions: { "BinaryExpression": true } }]*/
+
+var a = 1  *  2;
+```
+
+:::
+
+Examples of **correct** code for the `"exceptions": { "VariableDeclarator": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: ["error", { exceptions: { "VariableDeclarator": true } }]*/
+
+var someVar      = 'foo';
+var someOtherVar = 'barBaz';
+```
+
+:::
+
+Examples of **correct** code for the `"exceptions": { "ImportDeclaration": true }` option:
+
+::: correct
+
+```js
+/*eslint no-multi-spaces: ["error", { exceptions: { "ImportDeclaration": true } }]*/
+
+import mod          from 'mod';
+import someOtherMod from 'some-other-mod';
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to check and disallow multiple spaces, then you should turn this rule off.
diff --git a/eslint/docs/src/rules/no-multi-str.md b/eslint/docs/src/rules/no-multi-str.md
new file mode 100644 (file)
index 0000000..c118a51
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: no-multi-str
+layout: doc
+rule_type: suggestion
+---
+
+
+It's possible to create multiline strings in JavaScript by using a slash before a newline, such as:
+
+```js
+var x = "Line 1 \
+         Line 2";
+```
+
+Some consider this to be a bad practice as it was an undocumented feature of JavaScript that was only formalized later.
+
+## Rule Details
+
+This rule is aimed at preventing the use of multiline strings.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-multi-str: "error"*/
+
+var x = "some very \
+long text";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-multi-str: "error"*/
+
+var x = "some very long text";
+
+var x = "some very " +
+        "long text";
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-multiple-empty-lines.md b/eslint/docs/src/rules/no-multiple-empty-lines.md
new file mode 100644 (file)
index 0000000..8ca5d23
--- /dev/null
@@ -0,0 +1,144 @@
+---
+title: no-multiple-empty-lines
+layout: doc
+rule_type: layout
+---
+
+
+
+Some developers prefer to have multiple blank lines removed, while others feel that it helps improve readability. Whitespace is useful for separating logical sections of code, but excess whitespace takes up more of the screen.
+
+## Rule Details
+
+This rule aims to reduce the scrolling required when reading through your code. It will warn when the maximum amount of empty lines has been exceeded.
+
+## Options
+
+This rule has an object option:
+
+* `"max"` (default: `2`) enforces a maximum number of consecutive empty lines.
+* `"maxEOF"` enforces a maximum number of consecutive empty lines at the end of files.
+* `"maxBOF"` enforces a maximum number of consecutive empty lines at the beginning of files.
+
+### max
+
+Examples of **incorrect** code for this rule with the default `{ "max": 2 }` option:
+
+::: incorrect
+
+```js
+/*eslint no-multiple-empty-lines: "error"*/
+
+var foo = 5;
+
+
+var bar = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "max": 2 }` option:
+
+::: correct
+
+```js
+/*eslint no-multiple-empty-lines: "error"*/
+
+var foo = 5;
+
+var bar = 3;
+```
+
+:::
+
+### maxEOF
+
+Examples of **incorrect** code for this rule with the `{ max: 2, maxEOF: 0 }` options:
+
+::: incorrect
+
+```js
+/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/
+
+var foo = 5;
+
+var bar = 3;
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ max: 2, maxEOF: 0 }` options:
+
+::: correct
+
+```js
+/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/
+
+var foo = 5;
+
+var bar = 3;
+```
+
+:::
+
+**Note**: Although this ensures zero empty lines at the EOF, most editors will still show one empty line at the end if the file ends with a line break, as illustrated below. There is no empty line at the end of a file after the last `\n`, although editors may show an additional line. A true additional line would be represented by `\n\n`.
+
+**Incorrect**:
+
+```js
+1    /*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/⏎
+2    ⏎
+3    var foo = 5;⏎
+4    ⏎
+5    ⏎
+6    var bar = 3;⏎
+7    ⏎
+8
+```
+
+**Correct**:
+
+```js
+1    /*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxEOF": 0 }]*/⏎
+2    ⏎
+3    var foo = 5;⏎
+4    ⏎
+5    ⏎
+6    var bar = 3;⏎
+7
+```
+
+### maxBOF
+
+Examples of **incorrect** code for this rule with the `{ max: 2, maxBOF: 1 }` options:
+
+::: incorrect
+
+```js
+/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxBOF": 1 }]*/
+
+var foo = 5;
+
+var bar = 3;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ max: 2, maxBOF: 1 }` options:
+
+::: correct
+
+```js
+/*eslint no-multiple-empty-lines: ["error", { "max": 2, "maxBOF": 1}]*/
+
+var foo = 5;
+
+var bar = 3;
+```
+
+:::
+
+## When Not To Use It
+
+If you do not care about extra blank lines, turn this off.
diff --git a/eslint/docs/src/rules/no-native-reassign.md b/eslint/docs/src/rules/no-native-reassign.md
new file mode 100644 (file)
index 0000000..226a173
--- /dev/null
@@ -0,0 +1,118 @@
+---
+title: no-native-reassign
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extend-native
+- no-redeclare
+- no-shadow
+---
+
+
+This rule was **deprecated** in ESLint v3.3.0 and replaced by the [no-global-assign](no-global-assign) rule.
+
+JavaScript environments contain a number of built-in global variables, such as `window` in browsers and `process` in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:
+
+```js
+window = {};
+```
+
+While examples such as `window` are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.
+
+## Rule Details
+
+This rule disallows modifications to read-only global variables.
+
+ESLint has the capability to configure global variables as read-only.
+
+* [Specifying Environments](../user-guide/configuring#specifying-environments)
+* [Specifying Globals](../user-guide/configuring#specifying-globals)
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-native-reassign: "error"*/
+
+Object = null
+undefined = 1
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-native-reassign: "error"*/
+/*eslint-env browser*/
+
+window = {}
+length = 1
+top = 1
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-native-reassign: "error"*/
+/*global a:readonly*/
+
+a = 1
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-native-reassign: "error"*/
+
+a = 1
+var b = 1
+b = 2
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-native-reassign: "error"*/
+/*eslint-env browser*/
+
+onload = function() {}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-native-reassign: "error"*/
+/*global a:writable*/
+
+a = 1
+```
+
+:::
+
+## Options
+
+This rule accepts an `exceptions` option, which can be used to specify a list of builtins for which reassignments will be allowed:
+
+```json
+{
+    "rules": {
+        "no-native-reassign": ["error", {"exceptions": ["Object"]}]
+    }
+}
+```
+
+## When Not To Use It
+
+If you are trying to override one of the native objects.
diff --git a/eslint/docs/src/rules/no-negated-condition.md b/eslint/docs/src/rules/no-negated-condition.md
new file mode 100644 (file)
index 0000000..ab9e226
--- /dev/null
@@ -0,0 +1,71 @@
+---
+title: no-negated-condition
+layout: doc
+rule_type: suggestion
+---
+
+
+Negated conditions are more difficult to understand. Code can be made more readable by inverting the condition instead.
+
+## Rule Details
+
+This rule disallows negated conditions in either of the following:
+
+* `if` statements which have an `else` branch
+* ternary expressions
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-negated-condition: "error"*/
+
+if (!a) {
+    doSomething();
+} else {
+    doSomethingElse();
+}
+
+if (a != b) {
+    doSomething();
+} else {
+    doSomethingElse();
+}
+
+if (a !== b) {
+    doSomething();
+} else {
+    doSomethingElse();
+}
+
+!a ? c : b
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-negated-condition: "error"*/
+
+if (!a) {
+    doSomething();
+}
+
+if (!a) {
+    doSomething();
+} else if (b) {
+    doSomething();
+}
+
+if (a != b) {
+    doSomething();
+}
+
+a ? b : c
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-negated-in-lhs.md b/eslint/docs/src/rules/no-negated-in-lhs.md
new file mode 100644 (file)
index 0000000..da39b05
--- /dev/null
@@ -0,0 +1,52 @@
+---
+title: no-negated-in-lhs
+layout: doc
+rule_type: problem
+---
+
+
+This rule was **deprecated** in ESLint v3.3.0 and replaced by the [no-unsafe-negation](no-unsafe-negation) rule.
+
+Just as developers might type `-a + b` when they mean `-(a + b)` for the negative of a sum, they might type `!key in object` by mistake when they almost certainly mean `!(key in object)` to test that a key is not in an object.
+
+## Rule Details
+
+This rule disallows negating the left operand in `in` expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-negated-in-lhs: "error"*/
+
+if(!key in object) {
+    // operator precedence makes it equivalent to (!key) in object
+    // and type conversion makes it equivalent to (key ? "false" : "true") in object
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-negated-in-lhs: "error"*/
+
+if(!(key in object)) {
+    // key is not in object
+}
+
+if(('' + !key) in object) {
+    // make operator precedence and type conversion explicit
+    // in a rare situation when that is the intended meaning
+}
+```
+
+:::
+
+## When Not To Use It
+
+Never.
diff --git a/eslint/docs/src/rules/no-nested-ternary.md b/eslint/docs/src/rules/no-nested-ternary.md
new file mode 100644 (file)
index 0000000..9716be8
--- /dev/null
@@ -0,0 +1,55 @@
+---
+title: no-nested-ternary
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-ternary
+- no-unneeded-ternary
+---
+
+
+Nesting ternary expressions can make code more difficult to understand.
+
+```js
+var foo = bar ? baz : qux === quxx ? bing : bam;
+```
+
+## Rule Details
+
+The `no-nested-ternary` rule disallows nested ternary expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-nested-ternary: "error"*/
+
+var thing = foo ? bar : baz === qux ? quxx : foobar;
+
+foo ? baz === qux ? quxx() : foobar() : bar();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-nested-ternary: "error"*/
+
+var thing = foo ? bar : foobar;
+
+var thing;
+
+if (foo) {
+  thing = bar;
+} else if (baz === qux) {
+  thing = quxx;
+} else {
+  thing = foobar;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-new-func.md b/eslint/docs/src/rules/no-new-func.md
new file mode 100644 (file)
index 0000000..abe4d00
--- /dev/null
@@ -0,0 +1,57 @@
+---
+title: no-new-func
+layout: doc
+rule_type: suggestion
+---
+
+
+It's possible to create functions in JavaScript from strings at runtime using the `Function` constructor, such as:
+
+```js
+var x = new Function("a", "b", "return a + b");
+var x = Function("a", "b", "return a + b");
+var x = Function.call(null, "a", "b", "return a + b");
+var x = Function.apply(null, ["a", "b", "return a + b"]);
+var x = Function.bind(null, "a", "b", "return a + b")();
+```
+
+This is considered by many to be a bad practice due to the difficulty in debugging and reading these types of functions. In addition, Content-Security-Policy (CSP) directives may disallow the use of eval() and similar methods for creating code from strings.
+
+## Rule Details
+
+This error is raised to highlight the use of a bad practice. By passing a string to the Function constructor, you are requiring the engine to parse that string much in the way it has to when you call the `eval` function.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new-func: "error"*/
+
+var x = new Function("a", "b", "return a + b");
+var x = Function("a", "b", "return a + b");
+var x = Function.call(null, "a", "b", "return a + b");
+var x = Function.apply(null, ["a", "b", "return a + b"]);
+var x = Function.bind(null, "a", "b", "return a + b")();
+var f = Function.bind(null, "a", "b", "return a + b"); // assuming that the result of Function.bind(...) will be eventually called.
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new-func: "error"*/
+
+var x = function (a, b) {
+    return a + b;
+};
+```
+
+:::
+
+## When Not To Use It
+
+In more advanced cases where you really need to use the `Function` constructor.
diff --git a/eslint/docs/src/rules/no-new-object.md b/eslint/docs/src/rules/no-new-object.md
new file mode 100644 (file)
index 0000000..377a682
--- /dev/null
@@ -0,0 +1,64 @@
+---
+title: no-new-object
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-array-constructor
+- no-new-wrappers
+---
+
+
+The `Object` constructor is used to create new generic objects in JavaScript, such as:
+
+```js
+var myObject = new Object();
+```
+
+However, this is no different from using the more concise object literal syntax:
+
+```js
+var myObject = {};
+```
+
+For this reason, many prefer to always use the object literal syntax and never use the `Object` constructor.
+
+While there are no performance differences between the two approaches, the byte savings and conciseness of the object literal form is what has made it the de facto way of creating new objects.
+
+## Rule Details
+
+This rule disallows `Object` constructors.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new-object: "error"*/
+
+var myObject = new Object();
+
+new Object();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new-object: "error"*/
+
+var myObject = new CustomObject();
+
+var myObject = {};
+
+var Object = function Object() {};
+new Object();
+```
+
+:::
+
+## When Not To Use It
+
+If you wish to allow the use of the `Object` constructor, you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-new-require.md b/eslint/docs/src/rules/no-new-require.md
new file mode 100644 (file)
index 0000000..f168795
--- /dev/null
@@ -0,0 +1,61 @@
+---
+title: no-new-require
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+The `require` function is used to include modules that exist in separate files, such as:
+
+```js
+var appHeader = require('app-header');
+```
+
+Some modules return a constructor which can potentially lead to code such as:
+
+```js
+var appHeader = new require('app-header');
+```
+
+Unfortunately, this introduces a high potential for confusion since the code author likely meant to write:
+
+```js
+var appHeader = new (require('app-header'));
+```
+
+For this reason, it is usually best to disallow this particular expression.
+
+## Rule Details
+
+This rule aims to eliminate use of the `new require` expression.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new-require: "error"*/
+
+var appHeader = new require('app-header');
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new-require: "error"*/
+
+var AppHeader = require('app-header');
+var appHeader = new AppHeader();
+```
+
+:::
+
+## When Not To Use It
+
+If you are using a custom implementation of `require` and your code will never be used in projects where a standard `require` (CommonJS, Node.js, AMD) is expected, you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-new-symbol.md b/eslint/docs/src/rules/no-new-symbol.md
new file mode 100644 (file)
index 0000000..f182f27
--- /dev/null
@@ -0,0 +1,59 @@
+---
+title: no-new-symbol
+layout: doc
+rule_type: problem
+further_reading:
+- https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects
+---
+
+
+
+`Symbol` is not intended to be used with the `new` operator, but to be called as a function.
+
+```js
+var foo = new Symbol("foo");
+```
+
+This throws a `TypeError` exception.
+
+## Rule Details
+
+This rule is aimed at preventing the accidental calling of `Symbol` with the `new` operator.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new-symbol: "error"*/
+/*eslint-env es6*/
+
+var foo = new Symbol('foo');
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new-symbol: "error"*/
+/*eslint-env es6*/
+
+var foo = Symbol('foo');
+
+// Ignores shadowed Symbol.
+function bar(Symbol) {
+    const baz = new Symbol("baz");
+}
+
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
diff --git a/eslint/docs/src/rules/no-new-wrappers.md b/eslint/docs/src/rules/no-new-wrappers.md
new file mode 100644 (file)
index 0000000..b15488d
--- /dev/null
@@ -0,0 +1,87 @@
+---
+title: no-new-wrappers
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-array-constructor
+- no-new-object
+further_reading:
+- https://www.inkling.com/read/javascript-definitive-guide-david-flanagan-6th/chapter-3/wrapper-objects
+---
+
+
+There are three primitive types in JavaScript that have wrapper objects: string, number, and boolean. These are represented by the constructors `String`, `Number`, and `Boolean`, respectively. The primitive wrapper types are used whenever one of these primitive values is read, providing them with object-like capabilities such as methods. Behind the scenes, an object of the associated wrapper type is created and then destroyed, which is why you can call methods on primitive values, such as:
+
+```js
+var text = "Hello world".substring(2);
+```
+
+Behind the scenes in this example, a `String` object is constructed. The `substring()` method exists on `String.prototype` and so is accessible to the string instance.
+
+It's also possible to manually create a new wrapper instance:
+
+```js
+var stringObject = new String("Hello world");
+var numberObject = new Number(33);
+var booleanObject = new Boolean(false);
+```
+
+Although possible, there aren't any good reasons to use these primitive wrappers as constructors. They tend to confuse other developers more than anything else because they seem like they should act as primitives, but they do not. For example:
+
+```js
+var stringObject = new String("Hello world");
+console.log(typeof stringObject);       // "object"
+
+var text = "Hello world";
+console.log(typeof text);               // "string"
+
+var booleanObject = new Boolean(false);
+if (booleanObject) {    // all objects are truthy!
+    console.log("This executes");
+}
+```
+
+The first problem is that primitive wrapper objects are, in fact, objects. That means `typeof` will return `"object"` instead of `"string"`, `"number"`, or `"boolean"`. The second problem comes with boolean objects. Every object is truthy, that means an instance of `Boolean` always resolves to `true` even when its actual value is `false`.
+
+For these reasons, it's considered a best practice to avoid using primitive wrapper types with `new`.
+
+## Rule Details
+
+This rule aims to eliminate the use of `String`, `Number`, and `Boolean` with the `new` operator. As such, it warns whenever it sees `new String`, `new Number`, or `new Boolean`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new-wrappers: "error"*/
+
+var stringObject = new String("Hello world");
+var numberObject = new Number(33);
+var booleanObject = new Boolean(false);
+
+var stringObject = new String;
+var numberObject = new Number;
+var booleanObject = new Boolean;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new-wrappers: "error"*/
+
+var text = String(someValue);
+var num = Number(someValue);
+
+var object = new MyString();
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow the use of primitive wrapper objects, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-new.md b/eslint/docs/src/rules/no-new.md
new file mode 100644 (file)
index 0000000..15f4b9e
--- /dev/null
@@ -0,0 +1,50 @@
+---
+title: no-new
+layout: doc
+rule_type: suggestion
+---
+
+
+The goal of using `new` with a constructor is typically to create an object of a particular type and store that object in a variable, such as:
+
+```js
+var person = new Person();
+```
+
+It's less common to use `new` and not store the result, such as:
+
+```js
+new Person();
+```
+
+In this case, the created object is thrown away because its reference isn't stored anywhere, and in many cases, this means that the constructor should be replaced with a function that doesn't require `new` to be used.
+
+## Rule Details
+
+This rule is aimed at maintaining consistency and convention by disallowing constructor calls using the `new` keyword that do not assign the resulting object to a variable.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-new: "error"*/
+
+new Thing();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-new: "error"*/
+
+var thing = new Thing();
+
+Thing();
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-nonoctal-decimal-escape.md b/eslint/docs/src/rules/no-nonoctal-decimal-escape.md
new file mode 100644 (file)
index 0000000..ec267e1
--- /dev/null
@@ -0,0 +1,74 @@
+---
+title: no-nonoctal-decimal-escape
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-octal-escape
+further_reading:
+- https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence
+---
+
+
+
+
+
+Although not being specified in the language until ECMAScript 2021, `\8` and `\9` escape sequences in string literals were allowed in most JavaScript engines, and treated as "useless" escapes:
+
+```js
+"\8" === "8"; // true
+"\9" === "9"; // true
+```
+
+Since ECMAScript 2021, these escape sequences are specified as [non-octal decimal escape sequences](https://tc39.es/ecma262/#prod-annexB-NonOctalDecimalEscapeSequence), retaining the same behavior.
+
+Nevertheless, the ECMAScript specification treats `\8` and `\9` in string literals as a legacy feature. This syntax is optional if the ECMAScript host is not a web browser. Browsers still have to support it, but only in non-strict mode.
+
+Regardless of your targeted environment, these escape sequences shouldn't be used when writing new code.
+
+## Rule Details
+
+This rule disallows `\8` and `\9` escape sequences in string literals.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-nonoctal-decimal-escape: "error"*/
+
+"\8";
+
+"\9";
+
+var foo = "w\8less";
+
+var bar = "December 1\9";
+
+var baz = "Don't use \8 and \9 escapes.";
+
+var quux = "\0\8";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-nonoctal-decimal-escape: "error"*/
+
+"8";
+
+"9";
+
+var foo = "w8less";
+
+var bar = "December 19";
+
+var baz = "Don't use \\8 and \\9 escapes.";
+
+var quux = "\0\u0038";
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-obj-calls.md b/eslint/docs/src/rules/no-obj-calls.md
new file mode 100644 (file)
index 0000000..78f4de0
--- /dev/null
@@ -0,0 +1,77 @@
+---
+title: no-obj-calls
+layout: doc
+rule_type: problem
+further_reading:
+- https://es5.github.io/#x15.8
+---
+
+
+
+ECMAScript provides several global objects that are intended to be used as-is. Some of these objects look as if they could be constructors due their capitalization (such as `Math` and `JSON`) but will throw an error if you try to execute them as functions.
+
+The [ECMAScript 5 specification](https://es5.github.io/#x15.8) makes it clear that both `Math` and `JSON` cannot be invoked:
+
+> The Math object does not have a `[[Call]]` internal property; it is not possible to invoke the Math object as a function.
+
+The [ECMAScript 2015 specification](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect-object) makes it clear that `Reflect` cannot be invoked:
+
+> The Reflect object also does not have a `[[Call]]` internal method; it is not possible to invoke the Reflect object as a function.
+
+And the [ECMAScript 2017 specification](https://www.ecma-international.org/ecma-262/8.0/index.html#sec-atomics-object) makes it clear that `Atomics` cannot be invoked:
+
+> The Atomics object does not have a `[[Call]]` internal method; it is not possible to invoke the Atomics object as a function.
+
+## Rule Details
+
+This rule disallows calling the `Math`, `JSON`, `Reflect` and `Atomics` objects as functions.
+
+This rule also disallows using these objects as constructors with the `new` operator.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-obj-calls: "error"*/
+/*eslint-env es2017*/
+
+var math = Math();
+
+var newMath = new Math();
+
+var json = JSON();
+
+var newJSON = new JSON();
+
+var reflect = Reflect();
+
+var newReflect = new Reflect();
+
+var atomics = Atomics();
+
+var newAtomics = new Atomics();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-obj-calls: "error"*/
+/*eslint-env es2017*/
+
+function area(r) {
+    return Math.PI * r * r;
+}
+
+var object = JSON.parse("{}");
+
+var value = Reflect.get({ x: 1, y: 2 }, "x");
+
+var first = Atomics.load(foo, 0);
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-octal-escape.md b/eslint/docs/src/rules/no-octal-escape.md
new file mode 100644 (file)
index 0000000..38fa4fc
--- /dev/null
@@ -0,0 +1,44 @@
+---
+title: no-octal-escape
+layout: doc
+rule_type: suggestion
+---
+
+
+As of the ECMAScript 5 specification, octal escape sequences in string literals are deprecated and should not be used. Unicode escape sequences should be used instead.
+
+```js
+var foo = "Copyright \251";
+```
+
+## Rule Details
+
+This rule disallows octal escape sequences in string literals.
+
+If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-octal-escape: "error"*/
+
+var foo = "Copyright \251";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-octal-escape: "error"*/
+
+var foo = "Copyright \u00A9";   // unicode
+
+var foo = "Copyright \xA9";     // hexadecimal
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-octal.md b/eslint/docs/src/rules/no-octal.md
new file mode 100644 (file)
index 0000000..2c961a4
--- /dev/null
@@ -0,0 +1,50 @@
+---
+title: no-octal
+layout: doc
+rule_type: suggestion
+---
+
+
+
+Octal literals are numerals that begin with a leading zero, such as:
+
+```js
+var num = 071;      // 57
+```
+
+Because the leading zero which identifies an octal literal has been a source of confusion and error in JavaScript code, ECMAScript 5 deprecates the use of octal numeric literals.
+
+## Rule Details
+
+The rule disallows octal literals.
+
+If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-octal: "error"*/
+
+var num = 071;
+var result = 5 + 07;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-octal: "error"*/
+
+var num  = "071";
+```
+
+:::
+
+## Compatibility
+
+* **JSHint**: W115
diff --git a/eslint/docs/src/rules/no-param-reassign.md b/eslint/docs/src/rules/no-param-reassign.md
new file mode 100644 (file)
index 0000000..db740ea
--- /dev/null
@@ -0,0 +1,186 @@
+---
+title: no-param-reassign
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://spin.atomicobject.com/2011/04/10/javascript-don-t-reassign-your-function-arguments/
+---
+
+
+Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the `arguments` object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.
+
+This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.
+
+## Rule Details
+
+This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-param-reassign: "error"*/
+
+function foo(bar) {
+    bar = 13;
+}
+
+function foo(bar) {
+    bar++;
+}
+
+function foo(bar) {
+    for (bar in baz) {}
+}
+
+function foo(bar) {
+    for (bar of baz) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-param-reassign: "error"*/
+
+function foo(bar) {
+    var baz = bar;
+}
+```
+
+:::
+
+## Options
+
+This rule takes one option, an object, with a boolean property `"props"`, and  arrays `"ignorePropertyModificationsFor"` and `"ignorePropertyModificationsForRegex"`. `"props"` is `false` by default. If `"props"` is set to `true`, this rule warns against the modification of parameter properties unless they're included in `"ignorePropertyModificationsFor"` or `"ignorePropertyModificationsForRegex"`, which is an empty array by default.
+
+### props
+
+Examples of **correct** code for the default `{ "props": false }` option:
+
+::: correct
+
+```js
+/*eslint no-param-reassign: ["error", { "props": false }]*/
+
+function foo(bar) {
+    bar.prop = "value";
+}
+
+function foo(bar) {
+    delete bar.aaa;
+}
+
+function foo(bar) {
+    bar.aaa++;
+}
+
+function foo(bar) {
+    for (bar.aaa in baz) {}
+}
+
+function foo(bar) {
+    for (bar.aaa of baz) {}
+}
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "props": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-param-reassign: ["error", { "props": true }]*/
+
+function foo(bar) {
+    bar.prop = "value";
+}
+
+function foo(bar) {
+    delete bar.aaa;
+}
+
+function foo(bar) {
+    bar.aaa++;
+}
+
+function foo(bar) {
+    for (bar.aaa in baz) {}
+}
+
+function foo(bar) {
+    for (bar.aaa of baz) {}
+}
+```
+
+:::
+
+Examples of **correct** code for the `{ "props": true }` option with `"ignorePropertyModificationsFor"` set:
+
+::: correct
+
+```js
+/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/
+
+function foo(bar) {
+    bar.prop = "value";
+}
+
+function foo(bar) {
+    delete bar.aaa;
+}
+
+function foo(bar) {
+    bar.aaa++;
+}
+
+function foo(bar) {
+    for (bar.aaa in baz) {}
+}
+
+function foo(bar) {
+    for (bar.aaa of baz) {}
+}
+```
+
+:::
+
+Examples of **correct** code for the `{ "props": true }` option with `"ignorePropertyModificationsForRegex"` set:
+
+::: correct
+
+```js
+/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsForRegex": ["^bar"] }]*/
+
+function foo(barVar) {
+    barVar.prop = "value";
+}
+
+function foo(barrito) {
+    delete barrito.aaa;
+}
+
+function foo(bar_) {
+    bar_.aaa++;
+}
+
+function foo(barBaz) {
+    for (barBaz.aaa in baz) {}
+}
+
+function foo(barBaz) {
+    for (barBaz.aaa of baz) {}
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow assignment to function parameters, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-path-concat.md b/eslint/docs/src/rules/no-path-concat.md
new file mode 100644 (file)
index 0000000..ebde85c
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: no-path-concat
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In Node.js, the `__dirname` and `__filename` global variables contain the directory path and the file path of the currently executing script file, respectively. Sometimes, developers try to use these variables to create paths to other files, such as:
+
+```js
+var fullPath = __dirname + "/foo.js";
+```
+
+However, there are a few problems with this. First, you can't be sure what type of system the script is running on. Node.js can be run on any computer, including Windows, which uses a different path separator. It's very easy, therefore, to create an invalid path using string concatenation and assuming Unix-style separators. There's also the possibility of having double separators, or otherwise ending up with an invalid path.
+
+In order to avoid any confusion as to how to create the correct path, Node.js provides the `path` module. This module uses system-specific information to always return the correct value. So you can rewrite the previous example as:
+
+```js
+var fullPath = path.join(__dirname, "foo.js");
+```
+
+This example doesn't need to include separators as `path.join()` will do it in the most appropriate manner. Alternately, you can use `path.resolve()` to retrieve the fully-qualified path:
+
+```js
+var fullPath = path.resolve(__dirname, "foo.js");
+```
+
+Both `path.join()` and `path.resolve()` are suitable replacements for string concatenation wherever file or directory paths are being created.
+
+## Rule Details
+
+This rule aims to prevent string concatenation of directory paths in Node.js
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-path-concat: "error"*/
+
+var fullPath = __dirname + "/foo.js";
+
+var fullPath = __filename + "/foo.js";
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-path-concat: "error"*/
+
+var fullPath = dirname + "/foo.js";
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow string concatenation of path names.
diff --git a/eslint/docs/src/rules/no-plusplus.md b/eslint/docs/src/rules/no-plusplus.md
new file mode 100644 (file)
index 0000000..47a1038
--- /dev/null
@@ -0,0 +1,121 @@
+---
+title: no-plusplus
+layout: doc
+rule_type: suggestion
+---
+
+
+Because the unary `++` and `--` operators are subject to automatic semicolon insertion, differences in whitespace can change semantics of source code.
+
+```js
+var i = 10;
+var j = 20;
+
+i ++
+j
+// i = 11, j = 20
+```
+
+```js
+var i = 10;
+var j = 20;
+
+i
+++
+j
+// i = 10, j = 21
+```
+
+## Rule Details
+
+This rule disallows the unary operators `++` and `--`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-plusplus: "error"*/
+
+var foo = 0;
+foo++;
+
+var bar = 42;
+bar--;
+
+for (i = 0; i < l; i++) {
+    return;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-plusplus: "error"*/
+
+var foo = 0;
+foo += 1;
+
+var bar = 42;
+bar -= 1;
+
+for (i = 0; i < l; i += 1) {
+    return;
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option.
+
+* `"allowForLoopAfterthoughts": true` allows unary operators `++` and `--` in the afterthought (final expression) of a `for` loop.
+
+### allowForLoopAfterthoughts
+
+Examples of **correct** code for this rule with the `{ "allowForLoopAfterthoughts": true }` option:
+
+::: correct
+
+```js
+/*eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }]*/
+
+for (i = 0; i < l; i++) {
+    doSomething(i);
+}
+
+for (i = l; i >= 0; i--) {
+    doSomething(i);
+}
+
+for (i = 0, j = l; i < l; i++, j--) {
+    doSomething(i, j);
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "allowForLoopAfterthoughts": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }]*/
+
+for (i = 0; i < l; j = i++) {
+    doSomething(i, j);
+}
+
+for (i = l; i--;) {
+    doSomething(i);
+}
+
+for (i = 0; i < l;) i++;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-process-env.md b/eslint/docs/src/rules/no-process-env.md
new file mode 100644 (file)
index 0000000..a08bc25
--- /dev/null
@@ -0,0 +1,51 @@
+---
+title: no-process-env
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files
+- https://blog.benhall.me.uk/2012/02/storing-application-config-data-in/
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+The `process.env` object in Node.js is used to store deployment/configuration parameters. Littering it through out a project could lead to maintenance issues as it's another kind of global dependency. As such, it could lead to merge conflicts in a multi-user setup and deployment issues in a multi-server setup. Instead, one of the best practices is to define all those parameters in a single configuration/settings file which could be accessed throughout the project.
+
+## Rule Details
+
+This rule is aimed at discouraging use of `process.env` to avoid global dependencies. As such, it will warn whenever `process.env` is used.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-process-env: "error"*/
+
+if(process.env.NODE_ENV === "development") {
+    //...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-process-env: "error"*/
+
+var config = require("./config");
+
+if(config.env === "development") {
+    //...
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you prefer to use `process.env` throughout your project to retrieve values from environment variables, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-process-exit.md b/eslint/docs/src/rules/no-process-exit.md
new file mode 100644 (file)
index 0000000..f224218
--- /dev/null
@@ -0,0 +1,63 @@
+---
+title: no-process-exit
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+The `process.exit()` method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:
+
+```js
+if (somethingBadHappened) {
+    console.error("Something bad happened!");
+    process.exit(1);
+}
+```
+
+This code could appear in any module and will stop the entire application when `somethingBadHappened` is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:
+
+```js
+if (somethingBadHappened) {
+    throw new Error("Something bad happened!");
+}
+```
+
+By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.
+
+If you are using `process.exit()` only for specifying the exit code, you can set [`process.exitCode`](https://nodejs.org/api/process.html#process_process_exitcode) (introduced in Node.js 0.11.8) instead.
+
+## Rule Details
+
+This rule aims to prevent the use of `process.exit()` in Node.js JavaScript. As such, it warns whenever `process.exit()` is found in code.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-process-exit: "error"*/
+
+process.exit(1);
+process.exit(0);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-process-exit: "error"*/
+
+Process.exit();
+var exit = process.exit;
+```
+
+:::
+
+## When Not To Use It
+
+There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code.
diff --git a/eslint/docs/src/rules/no-promise-executor-return.md b/eslint/docs/src/rules/no-promise-executor-return.md
new file mode 100644 (file)
index 0000000..95283d7
--- /dev/null
@@ -0,0 +1,105 @@
+---
+title: no-promise-executor-return
+layout: doc
+rule_type: problem
+related_rules:
+- no-async-promise-executor
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
+---
+
+
+The `new Promise` constructor accepts a single argument, called an *executor*.
+
+```js
+const myPromise = new Promise(function executor(resolve, reject) {
+    readFile('foo.txt', function(err, result) {
+        if (err) {
+            reject(err);
+        } else {
+            resolve(result);
+        }
+    });
+});
+```
+
+The executor function usually initiates some asynchronous operation. Once it is finished, the executor should call `resolve` with the result, or `reject` if an error occurred.
+
+The return value of the executor is ignored. Returning a value from an executor function is a possible error because the returned value cannot be used and it doesn't affect the promise in any way.
+
+## Rule Details
+
+This rule disallows returning values from Promise executor functions.
+
+Only `return` without a value is allowed, as it's a control flow statement.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-promise-executor-return: "error"*/
+
+new Promise((resolve, reject) => {
+    if (someCondition) {
+        return defaultResult;
+    }
+    getSomething((err, result) => {
+        if (err) {
+            reject(err);
+        } else {
+            resolve(result);
+        }
+    });
+});
+
+new Promise((resolve, reject) => getSomething((err, data) => {
+    if (err) {
+        reject(err);
+    } else {
+        resolve(data);
+    }
+}));
+
+new Promise(() => {
+    return 1;
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-promise-executor-return: "error"*/
+
+new Promise((resolve, reject) => {
+    if (someCondition) {
+        resolve(defaultResult);
+        return;
+    }
+    getSomething((err, result) => {
+        if (err) {
+            reject(err);
+        } else {
+            resolve(result);
+        }
+    });
+});
+
+new Promise((resolve, reject) => {
+    getSomething((err, data) => {
+        if (err) {
+            reject(err);
+        } else {
+            resolve(data);
+        }
+    });
+});
+
+Promise.resolve(1);
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-proto.md b/eslint/docs/src/rules/no-proto.md
new file mode 100644 (file)
index 0000000..7b6c8c4
--- /dev/null
@@ -0,0 +1,53 @@
+---
+title: no-proto
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://johnresig.com/blog/objectgetprototypeof/
+---
+
+
+`__proto__` property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use `Object.getPrototypeOf` and `Object.setPrototypeOf` instead.
+
+## Rule Details
+
+When an object is created with the `new` operator, `__proto__` is set to the original "prototype" property of the object's constructor function. `Object.getPrototypeOf` is the preferred method of getting the object's prototype. To change an object's prototype, use `Object.setPrototypeOf`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-proto: "error"*/
+
+var a = obj.__proto__;
+
+var a = obj["__proto__"];
+
+obj.__proto__ = b;
+
+obj["__proto__"] = b;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-proto: "error"*/
+
+var a = Object.getPrototypeOf(obj);
+
+Object.setPrototypeOf(obj, b);
+
+var c = { __proto__: a };
+```
+
+:::
+
+## When Not To Use It
+
+You might want to turn this rule off if you need to support legacy browsers which implement the
+`__proto__` property but not `Object.getPrototypeOf` or `Object.setPrototypeOf`.
diff --git a/eslint/docs/src/rules/no-prototype-builtins.md b/eslint/docs/src/rules/no-prototype-builtins.md
new file mode 100644 (file)
index 0000000..43e9373
--- /dev/null
@@ -0,0 +1,53 @@
+---
+title: no-prototype-builtins
+layout: doc
+rule_type: problem
+---
+
+
+
+In ECMAScript 5.1, `Object.create` was added, which enables the creation of objects with a specified `[[Prototype]]`. `Object.create(null)` is a common pattern used to create objects that will be used as a Map. This can lead to errors when it is assumed that objects will have properties from `Object.prototype`. This rule prevents calling some `Object.prototype` methods directly from an object.
+
+Additionally, objects can have properties that shadow the builtins on `Object.prototype`, potentially causing unintended behavior or denial-of-service security vulnerabilities. For example, it would be unsafe for a webserver to parse JSON input from a client and call `hasOwnProperty` directly on the resulting object, because a malicious client could send a JSON value like `{"hasOwnProperty": 1}` and cause the server to crash.
+
+To avoid subtle bugs like this, it's better to always call these methods from `Object.prototype`. For example, `foo.hasOwnProperty("bar")` should be replaced with `Object.prototype.hasOwnProperty.call(foo, "bar")`.
+
+## Rule Details
+
+This rule disallows calling some `Object.prototype` methods directly on object instances.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-prototype-builtins: "error"*/
+
+var hasBarProperty = foo.hasOwnProperty("bar");
+
+var isPrototypeOfBar = foo.isPrototypeOf(bar);
+
+var barIsEnumerable = foo.propertyIsEnumerable("bar");
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-prototype-builtins: "error"*/
+
+var hasBarProperty = Object.prototype.hasOwnProperty.call(foo, "bar");
+
+var isPrototypeOfBar = Object.prototype.isPrototypeOf.call(foo, bar);
+
+var barIsEnumerable = {}.propertyIsEnumerable.call(foo, "bar");
+```
+
+:::
+
+## When Not To Use It
+
+You may want to turn this rule off if your code only touches objects with hardcoded keys, and you will never use an object that shadows an `Object.prototype` method or which does not inherit from `Object.prototype`.
diff --git a/eslint/docs/src/rules/no-redeclare.md b/eslint/docs/src/rules/no-redeclare.md
new file mode 100644 (file)
index 0000000..1c16b12
--- /dev/null
@@ -0,0 +1,104 @@
+---
+title: no-redeclare
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-shadow
+---
+
+
+
+In JavaScript, it's possible to redeclare the same variable name using `var`. This can lead to confusion as to where the variable is actually declared and initialized.
+
+## Rule Details
+
+This rule is aimed at eliminating variables that have multiple declarations in the same scope.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-redeclare: "error"*/
+
+var a = 3;
+var a = 10;
+
+class C {
+    foo() {
+        var b = 3;
+        var b = 10;
+    }
+
+    static {
+        var c = 3;
+        var c = 10;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-redeclare: "error"*/
+
+var a = 3;
+a = 10;
+
+class C {
+    foo() {
+        var b = 3;
+        b = 10;
+    }
+
+    static {
+        var c = 3;
+        c = 10;
+    }
+}
+
+```
+
+:::
+
+## Options
+
+This rule takes one optional argument, an object with a boolean property `"builtinGlobals"`. It defaults to `true`.
+If set to `true`, this rule also checks redeclaration of built-in globals, such as `Object`, `Array`, `Number`...
+
+### builtinGlobals
+
+The `"builtinGlobals"` option will check for redeclaration of built-in globals in global scope.
+
+Examples of **incorrect** code for the `{ "builtinGlobals": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
+
+var Object = 0;
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "builtinGlobals": true }` option and the `browser` environment:
+
+::: incorrect
+
+```js
+/*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
+/*eslint-env browser*/
+
+var top = 0;
+```
+
+:::
+
+The `browser` environment has many built-in global variables (for example, `top`). Some of built-in global variables cannot be redeclared.
+
+Note that when using the `node` or `commonjs` environments (or `ecmaFeatures.globalReturn`, if using the default parser), the top scope of a program is not actually the global scope, but rather a "module" scope. When this is the case, declaring a variable named after a builtin global is not a redeclaration, but rather a shadowing of the global variable. In that case, the [`no-shadow`](no-shadow) rule with the `"builtinGlobals"` option should be used.
diff --git a/eslint/docs/src/rules/no-regex-spaces.md b/eslint/docs/src/rules/no-regex-spaces.md
new file mode 100644 (file)
index 0000000..48d3e45
--- /dev/null
@@ -0,0 +1,60 @@
+---
+title: no-regex-spaces
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-div-regex
+- no-control-regex
+---
+
+
+
+
+
+Regular expressions can be very complex and difficult to understand, which is why it's important to keep them as simple as possible in order to avoid mistakes. One of the more error-prone things you can do with a regular expression is to use more than one space, such as:
+
+```js
+var re = /foo   bar/;
+```
+
+In this regular expression, it's very hard to tell how many spaces are intended to be matched. It's better to use only one space and then specify how many spaces are expected, such as:
+
+```js
+var re = /foo {3}bar/;
+```
+
+Now it is very clear that three spaces are expected to be matched.
+
+## Rule Details
+
+This rule disallows multiple spaces in regular expression literals.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-regex-spaces: "error"*/
+
+var re = /foo   bar/;
+var re = new RegExp("foo   bar");
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-regex-spaces: "error"*/
+
+var re = /foo {3}bar/;
+var re = new RegExp("foo {3}bar");
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow multiple spaces in a regular expression, then you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-reserved-keys.md b/eslint/docs/src/rules/no-reserved-keys.md
new file mode 100644 (file)
index 0000000..1b4f048
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: no-reserved-keys
+layout: doc
+
+further_reading:
+- https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names
+---
+
+Disallows unquoted reserved words as property names in object literals.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [quote-props](quote-props) rule.
+
+ECMAScript 3 described as series of keywords and reserved words, such as `if` and `public`, that are used or intended to be used for a core language feature. The specification also indicated that these keywords and reserved words could not be used as object property names without being enclosed in strings. An error occurs in an ECMAScript 3 environment when you use a keyword or reserved word in an object literal. For example:
+
+```js
+var values = {
+    enum: ["red", "blue", "green"]  // throws an error in ECMAScript 3
+}
+```
+
+In this code, `enum` is used as an object key and will throw an error in an ECMAScript 3 environment (such as Internet Explorer 8).
+
+ECMAScript 5 loosened the restriction such that keywords and reserved words can be used as object keys without causing an error. However, any code that needs to run in ECMAScript 3 still needs to avoid using keywords and reserved words as keys.
+
+## Rule Details
+
+This rule is aimed at eliminating the use of ECMAScript 3 keywords and reserved words as object literal keys. As such, it warns whenever an object key would throw an error in an ECMAScript 3 environment.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var superman = {
+    class: "Superhero",
+    private: "Clark Kent"
+};
+
+var values = {
+    enum: ["red", "blue", "green"]
+};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+var superman = {
+    "class": "Superhero",
+    "private": "Clark Kent"
+};
+
+var values = {
+    "enum": ["red", "blue", "green"]
+};
+```
+
+:::
+
+## When Not To Use It
+
+If your code is only going to be executed in an ECMAScript 5 or higher environment, then you can safely leave this rule off.
diff --git a/eslint/docs/src/rules/no-restricted-exports.md b/eslint/docs/src/rules/no-restricted-exports.md
new file mode 100644 (file)
index 0000000..b1b2065
--- /dev/null
@@ -0,0 +1,139 @@
+---
+title: no-restricted-exports
+layout: doc
+rule_type: suggestion
+---
+
+
+In a project, certain names may be disallowed from being used as exported names for various reasons.
+
+## Rule Details
+
+This rule disallows specified names from being used as exported names.
+
+## Options
+
+By default, this rule doesn't disallow any names. Only the names you specify in the configuration will be disallowed.
+
+This rule has an object option:
+
+* `"restrictedNamedExports"` is an array of strings, where each string is a name to be restricted.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-restricted-exports: ["error", {
+    "restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d", "e", "👍"]
+}]*/
+
+export const foo = 1;
+
+export function bar() {}
+
+export class Baz {}
+
+const a = {};
+export { a };
+
+function someFunction() {}
+export { someFunction as b };
+
+export { c } from "some_module";
+
+export { "d" } from "some_module";
+
+export { something as e } from "some_module";
+
+export { "👍" } from "some_module";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-restricted-exports: ["error", {
+    "restrictedNamedExports": ["foo", "bar", "Baz", "a", "b", "c", "d", "e", "👍"]
+}]*/
+
+export const quux = 1;
+
+export function myFunction() {}
+
+export class MyClass {}
+
+const a = {};
+export { a as myObject };
+
+function someFunction() {}
+export { someFunction };
+
+export { c as someName } from "some_module";
+
+export { "d" as " d " } from "some_module";
+
+export { something } from "some_module";
+
+export { "👍" as thumbsUp } from "some_module";
+```
+
+:::
+
+### Default exports
+
+By design, this rule doesn't disallow `export default` declarations. If you configure `"default"` as a restricted name, that restriction will apply only to named export declarations.
+
+Examples of additional **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default"] }]*/
+
+function foo() {}
+
+export { foo as default };
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default"] }]*/
+
+export { default } from "some_module";
+```
+
+:::
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["default", "foo"] }]*/
+
+export default function foo() {}
+```
+
+:::
+
+## Known Limitations
+
+This rule doesn't inspect the content of source modules in re-export declarations. In particular, if you are re-exporting everything from another module's export, that export may include a restricted name. This rule cannot detect such cases.
+
+```js
+
+//----- some_module.js -----
+export function foo() {}
+
+//----- my_module.js -----
+/*eslint no-restricted-exports: ["error", { "restrictedNamedExports": ["foo"] }]*/
+
+export * from "some_module"; // allowed, although this declaration exports "foo" from my_module
+```
diff --git a/eslint/docs/src/rules/no-restricted-globals.md b/eslint/docs/src/rules/no-restricted-globals.md
new file mode 100644 (file)
index 0000000..0bcf27d
--- /dev/null
@@ -0,0 +1,109 @@
+---
+title: no-restricted-globals
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-restricted-properties
+- no-restricted-syntax
+---
+
+
+Disallowing usage of specific global variables can be useful if you want to allow a set of global
+variables by enabling an environment, but still want to disallow some of those.
+
+For instance, early Internet Explorer versions exposed the current DOM event as a global variable
+`event`, but using this variable has been considered as a bad practice for a long time. Restricting
+this will make sure this variable isn't used in browser code.
+
+## Rule Details
+
+This rule allows you to specify global variable names that you don't want to use in your application.
+
+## Options
+
+This rule takes a list of strings, where each string is a global to be restricted:
+
+```json
+{
+    "rules": {
+        "no-restricted-globals": ["error", "event", "fdescribe"]
+    }
+}
+```
+
+Alternatively, the rule also accepts objects, where the global name and an optional custom message are specified:
+
+```json
+{
+    "rules": {
+        "no-restricted-globals": [
+            "error",
+            {
+                "name": "event",
+                "message": "Use local parameter instead."
+            },
+            {
+                "name": "fdescribe",
+                "message": "Do not commit fdescribe. Use describe instead."
+            }
+        ]
+    }
+}
+```
+
+Examples of **incorrect** code for sample `"event", "fdescribe"` global variable names:
+
+::: incorrect
+
+```js
+/*global event, fdescribe*/
+/*eslint no-restricted-globals: ["error", "event", "fdescribe"]*/
+
+function onClick() {
+    console.log(event);
+}
+
+fdescribe("foo", function() {
+});
+```
+
+:::
+
+Examples of **correct** code for a sample `"event"` global variable name:
+
+::: correct
+
+```js
+/*global event*/
+/*eslint no-restricted-globals: ["error", "event"]*/
+
+import event from "event-module";
+```
+
+:::
+
+::: correct
+
+```js
+/*global event*/
+/*eslint no-restricted-globals: ["error", "event"]*/
+
+var event = 1;
+```
+
+:::
+
+Examples of **incorrect** code for a sample `"event"` global variable name, along with a custom error message:
+
+::: incorrect
+
+```js
+/*global event*/
+/* eslint no-restricted-globals: ["error", { name: "event", message: "Use local parameter instead." }] */
+
+function onClick() {
+    console.log(event);    // Unexpected global variable 'event'. Use local parameter instead.
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-restricted-imports.md b/eslint/docs/src/rules/no-restricted-imports.md
new file mode 100644 (file)
index 0000000..646e1b0
--- /dev/null
@@ -0,0 +1,361 @@
+---
+title: no-restricted-imports
+layout: doc
+rule_type: suggestion
+---
+
+
+Imports are an ES6/ES2015 standard for making the functionality of other modules available in your current module. In CommonJS this is implemented through the `require()` call which makes this ESLint rule roughly equivalent to its CommonJS counterpart `no-restricted-modules`.
+
+Why would you want to restrict imports?
+
+* Some imports might not make sense in a particular environment. For example, Node.js' `fs` module would not make sense in an environment that didn't have a file system.
+
+* Some modules provide similar or identical functionality, think `lodash` and `underscore`. Your project may have standardized on a module. You want to make sure that the other alternatives are not being used as this would unnecessarily bloat the project and provide a higher maintenance cost of two dependencies when one would suffice.
+
+## Rule Details
+
+This rule allows you to specify imports that you don't want to use in your application.
+
+It applies to static imports only, not dynamic ones.
+
+## Options
+
+The syntax to specify restricted imports looks like this:
+
+```json
+"no-restricted-imports": ["error", "import1", "import2"]
+```
+
+or like this:
+
+```json
+"no-restricted-imports": ["error", { "paths": ["import1", "import2"] }]
+```
+
+When using the object form, you can also specify an array of gitignore-style patterns:
+
+```json
+"no-restricted-imports": ["error", {
+    "paths": ["import1", "import2"],
+    "patterns": ["import1/private/*", "import2/*", "!import2/good"]
+}]
+```
+
+You may also specify a custom message for any paths you want to restrict as follows:
+
+```json
+"no-restricted-imports": ["error", {
+    "name": "import-foo",
+    "message": "Please use import-bar instead."
+}, {
+    "name": "import-baz",
+    "message": "Please use import-quux instead."
+}]
+```
+
+or like this:
+
+```json
+"no-restricted-imports": ["error", {
+    "paths": [{
+        "name": "import-foo",
+        "message": "Please use import-bar instead."
+    }, {
+        "name": "import-baz",
+        "message": "Please use import-quux instead."
+    }]
+}]
+```
+
+or like this if you need to restrict only certain imports from a module:
+
+```json
+"no-restricted-imports": ["error", {
+  "paths": [{
+    "name": "import-foo",
+    "importNames": ["Bar"],
+    "message": "Please use Bar from /import-bar/baz/ instead."
+  }]
+}]
+```
+
+or like this if you want to apply a custom message to pattern matches:
+
+```json
+"no-restricted-imports": ["error", {
+    "patterns": [{
+      "group": ["import1/private/*"],
+      "message": "usage of import1 private modules not allowed."
+    }, {
+      "group": ["import2/*", "!import2/good"],
+      "message": "import2 is deprecated, except the modules in import2/good."
+    }]
+}]
+```
+
+The custom message will be appended to the default error message.
+
+Pattern matches can also be configured to be case-sensitive:
+
+```json
+"no-restricted-imports": ["error", {
+    "patterns": [{
+      "group": ["import1/private/prefix[A-Z]*"],
+      "caseSensitive": true
+    }]
+}]
+```
+
+Pattern matches can restrict specific import names only, similar to the `paths` option:
+
+```json
+"no-restricted-imports": ["error", {
+    "patterns": [{
+      "group": ["utils/*"],
+      "importNames": ["isEmpty"],
+      "message": "Use 'isEmpty' from lodash instead."
+    }]
+}]
+```
+
+To restrict the use of all Node.js core imports (via <https://github.com/nodejs/node/tree/master/lib>):
+
+```json
+    "no-restricted-imports": ["error",
+         "assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","freelist","fs","http","https","module","net","os","path","punycode","querystring","readline","repl","smalloc","stream","string_decoder","sys","timers","tls","tracing","tty","url","util","vm","zlib"
+    ],
+```
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", "fs"]*/
+
+import fs from 'fs';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", "fs"]*/
+
+export { fs } from 'fs';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", "fs"]*/
+
+export * from 'fs';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { "paths": ["cluster"] }]*/
+
+import cluster from 'cluster';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { "patterns": ["lodash/*"] }]*/
+
+import pick from 'lodash/pick';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { paths: [{
+    name: "foo",
+    importNames: ["default"],
+    message: "Please use the default import from '/bar/baz/' instead."
+}]}]*/
+
+import DisallowedObject from "foo";
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { paths: [{
+    name: "foo",
+    importNames: ["DisallowedObject"],
+    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
+}]}]*/
+
+import { DisallowedObject } from "foo";
+
+import { DisallowedObject as AllowedObject } from "foo";
+
+import { "DisallowedObject" as AllowedObject } from "foo";
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { paths: [{
+    name: "foo",
+    importNames: ["DisallowedObject"],
+    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
+}]}]*/
+
+import * as Foo from "foo";
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["lodash/*"],
+    message: "Please use the default import from 'lodash' instead."
+}]}]*/
+
+import pick from 'lodash/pick';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["foo[A-Z]*"],
+    caseSensitive: true
+}]}]*/
+
+import pick from 'fooBar';
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["utils/*"],
+    importNames: ['isEmpty'],
+    message: "Use 'isEmpty' from lodash instead."
+}]}]*/
+
+import { isEmpty } from 'utils/collection-utils';
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", "fs"]*/
+
+import crypto from 'crypto';
+export { foo } from "bar";
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { "paths": ["fs"], "patterns": ["eslint/*"] }]*/
+
+import crypto from 'crypto';
+import eslint from 'eslint';
+export * from "path";
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { paths: [{ name: "foo", importNames: ["DisallowedObject"] }] }]*/
+
+import DisallowedObject from "foo"
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { paths: [{
+    name: "foo",
+    importNames: ["DisallowedObject"],
+    message: "Please import 'DisallowedObject' from '/bar/baz/' instead."
+}]}]*/
+
+import { AllowedObject as DisallowedObject } from "foo";
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["lodash/*"],
+    message: "Please use the default import from 'lodash' instead."
+}]}]*/
+
+import lodash from 'lodash';
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["foo[A-Z]*"],
+    caseSensitive: true
+}]}]*/
+
+import pick from 'food';
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-imports: ["error", { patterns: [{
+    group: ["utils/*"],
+    importNames: ['isEmpty'],
+    message: "Use 'isEmpty' from lodash instead."
+}]}]*/
+
+import { hasValues } from 'utils/collection-utils';
+```
+
+:::
+
+## When Not To Use It
+
+Don't use this rule or don't include a module in the list for this rule if you want to be able to import a module in your project without an ESLint error or warning.
diff --git a/eslint/docs/src/rules/no-restricted-modules.md b/eslint/docs/src/rules/no-restricted-modules.md
new file mode 100644 (file)
index 0000000..c8f77bf
--- /dev/null
@@ -0,0 +1,134 @@
+---
+title: no-restricted-modules
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+A module in Node.js is a simple or complex functionality organized in a JavaScript file which can be reused throughout the Node.js
+application. The keyword `require` is used in Node.js/CommonJS to import modules into an application. This way you can have dynamic loading where the loaded module name isn't predefined /static, or where you conditionally load a module only if it's "truly required".
+
+Why would you want to restrict a module?
+
+Disallowing usage of specific Node.js modules can be useful if you want to limit the available methods a developer can use. For example, you can block usage of the `fs` module if you want to disallow file system access.
+
+## Rule Details
+
+This rule allows you to specify modules that you don’t want to use in your application.
+
+## Options
+
+The rule takes one or more strings as options: the names of restricted modules.
+
+```json
+"no-restricted-modules": ["error", "foo-module", "bar-module"]
+```
+
+It can also take an object with lists of `paths` and gitignore-style `patterns` strings.
+
+```json
+"no-restricted-modules": ["error", { "paths": ["foo-module", "bar-module"] }]
+```
+
+```json
+"no-restricted-modules": ["error", {
+    "paths": ["foo-module", "bar-module"],
+    "patterns": ["foo-module/private/*", "bar-module/*","!baz-module/good"]
+}]
+```
+
+You may also specify a custom message for any paths you want to restrict as follows:
+
+```json
+"no-restricted-modules": ["error", {
+  "name": "foo-module",
+  "message": "Please use bar-module instead."
+  }
+]
+```
+
+or like this:
+
+```json
+"no-restricted-modules": ["error",{
+"paths":[{
+  "name": "foo-module",
+  "message": "Please use bar-module instead."
+  }]
+}]
+```
+
+The custom message will be appended to the default error message. Please note that you may not specify custom error messages for restricted patterns as a particular module may match more than one pattern.
+
+To restrict the use of all Node.js core modules (via <https://github.com/nodejs/node/tree/master/lib>):
+
+```json
+{
+    "no-restricted-modules": ["error",
+        "assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","freelist","fs","http","https","module","net","os","path","punycode","querystring","readline","repl","smalloc","stream","string_decoder","sys","timers","tls","tracing","tty","url","util","vm","zlib"
+    ]
+}
+```
+
+## Examples
+
+Examples of **incorrect** code for this rule  with sample `"fs", "cluster", "lodash"` restricted modules:
+
+::: incorrect
+
+```js
+/*eslint no-restricted-modules: ["error", "fs", "cluster"]*/
+
+var fs = require('fs');
+var cluster = require('cluster');
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-modules: ["error", {"paths": ["cluster"] }]*/
+
+var cluster = require('cluster');
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-restricted-modules: ["error", { "patterns": ["lodash/*"] }]*/
+
+var pick = require('lodash/pick');
+```
+
+:::
+
+Examples of **correct** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
+
+::: correct
+
+```js
+/*eslint no-restricted-modules: ["error", "fs", "cluster"]*/
+
+var crypto = require('crypto');
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-restricted-modules: ["error", {
+    "paths": ["fs", "cluster"],
+    "patterns": ["lodash/*", "!lodash/pick"]
+}]*/
+
+var crypto = require('crypto');
+var pick = require('lodash/pick');
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-restricted-properties.md b/eslint/docs/src/rules/no-restricted-properties.md
new file mode 100644 (file)
index 0000000..758bd5c
--- /dev/null
@@ -0,0 +1,147 @@
+---
+title: no-restricted-properties
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-restricted-globals
+- no-restricted-syntax
+---
+
+
+Certain properties on objects may be disallowed in a codebase. This is useful for deprecating an API or restricting usage of a module's methods. For example, you may want to disallow using `describe.only` when using Mocha or telling people to use `Object.assign` instead of `_.extend`.
+
+## Rule Details
+
+This rule looks for accessing a given property key on a given object name, either when reading the property's value or invoking it as a function. You may specify an optional message to indicate an alternative API or a reason for the restriction.
+
+### Options
+
+This rule takes a list of objects, where the object name and property names are specified:
+
+```json
+{
+    "rules": {
+        "no-restricted-properties": [2, {
+            "object": "disallowedObjectName",
+            "property": "disallowedPropertyName"
+        }]
+    }
+}
+```
+
+Multiple object/property values can be disallowed, and you can specify an optional message:
+
+```json
+{
+    "rules": {
+        "no-restricted-properties": [2, {
+            "object": "disallowedObjectName",
+            "property": "disallowedPropertyName"
+        }, {
+            "object": "disallowedObjectName",
+            "property": "anotherDisallowedPropertyName",
+            "message": "Please use allowedObjectName.allowedPropertyName."
+        }]
+    }
+}
+```
+
+If the object name is omitted, the property is disallowed for all objects:
+
+```json
+{
+    "rules": {
+        "no-restricted-properties": [2, {
+            "property": "__defineGetter__",
+            "message": "Please use Object.defineProperty instead."
+        }]
+    }
+}
+```
+
+If the property name is omitted, accessing any property of the given object is disallowed:
+
+```json
+{
+    "rules": {
+        "no-restricted-properties": [2, {
+            "object": "require",
+            "message": "Please call require() directly."
+        }]
+    }
+}
+```
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint no-restricted-properties: [2, {
+    "object": "disallowedObjectName",
+    "property": "disallowedPropertyName"
+}] */
+
+var example = disallowedObjectName.disallowedPropertyName; /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/
+
+disallowedObjectName.disallowedPropertyName(); /*error Disallowed object property: disallowedObjectName.disallowedPropertyName.*/
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint no-restricted-properties: [2, {
+    "property": "__defineGetter__"
+}] */
+
+foo.__defineGetter__(bar, baz);
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint no-restricted-properties: [2, {
+    "object": "require"
+}] */
+
+require.resolve('foo');
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint no-restricted-properties: [2, {
+    "object": "disallowedObjectName",
+    "property": "disallowedPropertyName"
+}] */
+
+var example = disallowedObjectName.somePropertyName;
+
+allowedObjectName.disallowedPropertyName();
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint no-restricted-properties: [2, {
+    "object": "require"
+}] */
+
+require('foo');
+```
+
+:::
+
+## When Not To Use It
+
+If you don't have any object/property combinations to restrict, you should not use this rule.
diff --git a/eslint/docs/src/rules/no-restricted-syntax.md b/eslint/docs/src/rules/no-restricted-syntax.md
new file mode 100644 (file)
index 0000000..bb700f0
--- /dev/null
@@ -0,0 +1,95 @@
+---
+title: no-restricted-syntax
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-alert
+- no-console
+- no-debugger
+- no-restricted-properties
+---
+
+
+JavaScript has a lot of language features, and not everyone likes all of them. As a result, some projects choose to disallow the use of certain language features altogether. For instance, you might decide to disallow the use of `try-catch` or `class`, or you might decide to disallow the use of the `in` operator.
+
+Rather than creating separate rules for every language feature you want to turn off, this rule allows you to configure the syntax elements you want to restrict use of. These elements are represented by their [ESTree](https://github.com/estree/estree) node types. For example, a function declaration is represented by `FunctionDeclaration` and the `with` statement is represented by `WithStatement`. You may find the full list of AST node names you can use [on GitHub](https://github.com/eslint/eslint-visitor-keys/blob/main/lib/visitor-keys.js) and use [AST Explorer](https://astexplorer.net/) with the espree parser to see what type of nodes your code consists of.
+
+You can also specify [AST selectors](../developer-guide/selectors) to restrict, allowing much more precise control over syntax patterns.
+
+## Rule Details
+
+This rule disallows specified (that is, user-defined) syntax.
+
+## Options
+
+This rule takes a list of strings, where each string is an AST selector:
+
+```json
+{
+    "rules": {
+        "no-restricted-syntax": ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"]
+    }
+}
+```
+
+Alternatively, the rule also accepts objects, where the selector and an optional custom message are specified:
+
+```json
+{
+    "rules": {
+        "no-restricted-syntax": [
+            "error",
+            {
+                "selector": "FunctionExpression",
+                "message": "Function expressions are not allowed."
+            },
+            {
+                "selector": "CallExpression[callee.name='setTimeout'][arguments.length!=2]",
+                "message": "setTimeout must always be invoked with two arguments."
+            }
+        ]
+    }
+}
+```
+
+If a custom message is specified with the `message` property, ESLint will use that message when reporting occurrences of the syntax specified in the `selector` property.
+
+The string and object formats can be freely mixed in the configuration as needed.
+
+Examples of **incorrect** code for this rule with the `"FunctionExpression", "WithStatement", BinaryExpression[operator='in']` options:
+
+::: incorrect
+
+```js
+/* eslint no-restricted-syntax: ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"] */
+
+with (me) {
+    dontMess();
+}
+
+var doSomething = function () {};
+
+foo in bar;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"FunctionExpression", "WithStatement", BinaryExpression[operator='in']` options:
+
+::: correct
+
+```js
+/* eslint no-restricted-syntax: ["error", "FunctionExpression", "WithStatement", "BinaryExpression[operator='in']"] */
+
+me.dontMess();
+
+function doSomething() {};
+
+foo instanceof bar;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to restrict your code from using any JavaScript features or syntax, you should not use this rule.
diff --git a/eslint/docs/src/rules/no-return-assign.md b/eslint/docs/src/rules/no-return-assign.md
new file mode 100644 (file)
index 0000000..0a63724
--- /dev/null
@@ -0,0 +1,139 @@
+---
+title: no-return-assign
+layout: doc
+rule_type: suggestion
+---
+
+
+One of the interesting, and sometimes confusing, aspects of JavaScript is that assignment can happen at almost any point. Because of this, an errant equals sign can end up causing assignment when the true intent was to do a comparison. This is especially true when using a `return` statement. For example:
+
+```js
+function doSomething() {
+    return foo = bar + 2;
+}
+```
+
+It is difficult to tell the intent of the `return` statement here. It's possible that the function is meant to return the result of `bar + 2`, but then why is it assigning to `foo`? It's also possible that the intent was to use a comparison operator such as `==` and that this code is an error.
+
+Because of this ambiguity, it's considered a best practice to not use assignment in `return` statements.
+
+## Rule Details
+
+This rule aims to eliminate assignments from `return` statements. As such, it will warn whenever an assignment is found as part of `return`.
+
+## Options
+
+The rule takes one option, a string, which must contain one of the following values:
+
+* `except-parens` (default): Disallow assignments unless they are enclosed in parentheses.
+* `always`: Disallow all assignments.
+
+### except-parens
+
+This is the default option.
+It disallows assignments unless they are enclosed in parentheses.
+
+Examples of **incorrect** code for the default `"except-parens"` option:
+
+::: incorrect
+
+```js
+/*eslint no-return-assign: "error"*/
+
+function doSomething() {
+    return foo = bar + 2;
+}
+
+function doSomething() {
+    return foo += 2;
+}
+
+const foo = (a, b) => a = b
+
+const bar = (a, b, c) => (a = b, c == b)
+
+function doSomething() {
+    return foo = bar && foo > 0;
+}
+```
+
+:::
+
+Examples of **correct** code for the default `"except-parens"` option:
+
+::: correct
+
+```js
+/*eslint no-return-assign: "error"*/
+
+function doSomething() {
+    return foo == bar + 2;
+}
+
+function doSomething() {
+    return foo === bar + 2;
+}
+
+function doSomething() {
+    return (foo = bar + 2);
+}
+
+const foo = (a, b) => (a = b)
+
+const bar = (a, b, c) => ((a = b), c == b)
+
+function doSomething() {
+    return (foo = bar) && foo > 0;
+}
+```
+
+:::
+
+### always
+
+This option disallows all assignments in `return` statements.
+All assignments are treated as problems.
+
+Examples of **incorrect** code for the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint no-return-assign: ["error", "always"]*/
+
+function doSomething() {
+    return foo = bar + 2;
+}
+
+function doSomething() {
+    return foo += 2;
+}
+
+function doSomething() {
+    return (foo = bar + 2);
+}
+```
+
+:::
+
+Examples of **correct** code for the `"always"` option:
+
+::: correct
+
+```js
+/*eslint no-return-assign: ["error", "always"]*/
+
+function doSomething() {
+    return foo == bar + 2;
+}
+
+function doSomething() {
+    return foo === bar + 2;
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow the use of assignment operators in a `return` statement, then you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-return-await.md b/eslint/docs/src/rules/no-return-await.md
new file mode 100644 (file)
index 0000000..164843d
--- /dev/null
@@ -0,0 +1,71 @@
+---
+title: no-return-await
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
+- https://jakearchibald.com/2017/await-vs-return-vs-return-await/
+---
+
+
+Using `return await` inside an `async function` keeps the current function in the call stack until the Promise that is being awaited has resolved, at the cost of an extra microtask before resolving the outer Promise. `return await` can also be used in a try/catch statement to catch errors from another function that returns a Promise.
+
+You can avoid the extra microtask by not awaiting the return value, with the trade off of the function no longer being a part of the stack trace if an error is thrown asynchronously from the Promise being returned. This can make debugging more difficult.
+
+## Rule Details
+
+This rule aims to prevent a likely common performance hazard due to a lack of understanding of the semantics of `async function`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-return-await: "error"*/
+
+async function foo() {
+    return await bar();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-return-await: "error"*/
+
+async function foo() {
+    return bar();
+}
+
+async function foo() {
+    await bar();
+    return;
+}
+
+// This is essentially the same as `return await bar();`, but the rule checks only `await` in `return` statements
+async function foo() {
+    const x = await bar();
+    return x;
+}
+
+// In this example the `await` is necessary to be able to catch errors thrown from `bar()`
+async function foo() {
+    try {
+        return await bar();
+    } catch (error) {}
+}
+```
+
+:::
+
+## When Not To Use It
+
+There are a few reasons you might want to turn this rule off:
+
+* If you want to use `await` to denote a value that is a thenable
+* If you do not want the performance benefit of avoiding `return await`
+* If you want the functions to show up in stack traces (useful for debugging purposes)
diff --git a/eslint/docs/src/rules/no-script-url.md b/eslint/docs/src/rules/no-script-url.md
new file mode 100644 (file)
index 0000000..6255cf9
--- /dev/null
@@ -0,0 +1,30 @@
+---
+title: no-script-url
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://stackoverflow.com/questions/13497971/what-is-the-matter-with-script-targeted-urls
+---
+
+
+Using `javascript:` URLs is considered by some as a form of `eval`. Code passed in `javascript:` URLs has to be parsed and evaluated by the browser in the same way that `eval` is processed.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-script-url: "error"*/
+
+location.href = "javascript:void(0)";
+
+location.href = `javascript:void(0)`;
+```
+
+:::
+
+## Compatibility
+
+* **JSHint**: This rule corresponds to `scripturl` rule of JSHint.
diff --git a/eslint/docs/src/rules/no-self-assign.md b/eslint/docs/src/rules/no-self-assign.md
new file mode 100644 (file)
index 0000000..a65b242
--- /dev/null
@@ -0,0 +1,112 @@
+---
+title: no-self-assign
+layout: doc
+rule_type: problem
+---
+
+
+
+Self assignments have no effect, so probably those are an error due to incomplete refactoring.
+Those indicate that what you should do is still remaining.
+
+```js
+foo = foo;
+[bar, baz] = [bar, qiz];
+```
+
+## Rule Details
+
+This rule is aimed at eliminating self assignments.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-self-assign: "error"*/
+
+foo = foo;
+
+[a, b] = [a, b];
+
+[a, ...b] = [x, ...b];
+
+({a, b} = {a, x});
+
+foo &&= foo;
+foo ||= foo;
+foo ??= foo;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-self-assign: "error"*/
+
+foo = bar;
+[a, b] = [b, a];
+
+// This pattern is warned by the `no-use-before-define` rule.
+let foo = foo;
+
+// The default values have an effect.
+[foo = 1] = [foo];
+
+// non-self-assignments with properties.
+obj.a = obj.b;
+obj.a.b = obj.c.b;
+obj.a.b = obj.a.c;
+obj[a] = obj["a"];
+
+// This ignores if there is a function call.
+obj.a().b = obj.a().b;
+a().b = a().b;
+
+// `&=` and `|=` have an effect on non-integers.
+foo &= foo;
+foo |= foo;
+
+// Known limitation: this does not support computed properties except single literal or single identifier.
+obj[a + b] = obj[a + b];
+obj["a" + "b"] = obj["a" + "b"];
+```
+
+:::
+
+## Options
+
+This rule has the option to check properties as well.
+
+```json
+{
+    "no-self-assign": ["error", {"props": true}]
+}
+```
+
+* `props` - if this is `true`, `no-self-assign` rule warns self-assignments of properties. Default is `true`.
+
+### props
+
+Examples of **correct** code with the `{ "props": false }` option:
+
+::: correct
+
+```js
+/*eslint no-self-assign: ["error", {"props": false}]*/
+
+// self-assignments with properties.
+obj.a = obj.a;
+obj.a.b = obj.a.b;
+obj["a"] = obj["a"];
+obj[a] = obj[a];
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify about self assignments, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-self-compare.md b/eslint/docs/src/rules/no-self-compare.md
new file mode 100644 (file)
index 0000000..12b2776
--- /dev/null
@@ -0,0 +1,29 @@
+---
+title: no-self-compare
+layout: doc
+rule_type: problem
+---
+
+
+Comparing a variable against itself is usually an error, either a typo or refactoring error. It is confusing to the reader and may potentially introduce a runtime error.
+
+The only time you would compare a variable against itself is when you are testing for `NaN`. However, it is far more appropriate to use `typeof x === 'number' && isNaN(x)` or the [Number.isNaN ES2015 function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) for that use case rather than leaving the reader of the code to determine the intent of self comparison.
+
+## Rule Details
+
+This error is raised to highlight a potentially confusing and potentially pointless piece of code. There are almost no situations in which you would need to compare something to itself.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-self-compare: "error"*/
+
+var x = 10;
+if (x === x) {
+    x = 20;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-sequences.md b/eslint/docs/src/rules/no-sequences.md
new file mode 100644 (file)
index 0000000..dcc13f1
--- /dev/null
@@ -0,0 +1,172 @@
+---
+title: no-sequences
+layout: doc
+rule_type: suggestion
+---
+
+
+The comma operator includes multiple expressions where only one is expected. It evaluates each operand from left to right and returns the value of the last operand. However, this frequently obscures side effects, and its use is often an accident. Here are some examples of sequences:
+
+```js
+var a = (3, 5); // a = 5
+
+a = b += 5, a + b;
+
+while (a = next(), a && a.length);
+
+(0, eval)("doSomething();");
+```
+
+## Rule Details
+
+This rule forbids the use of the comma operator, with the following exceptions:
+
+* In the initialization or update portions of a `for` statement.
+* By default, if the expression sequence is explicitly wrapped in parentheses. This exception can be removed with the `allowInParentheses` option.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-sequences: "error"*/
+
+foo = doSomething(), val;
+
+0, eval("doSomething();");
+
+do {} while (doSomething(), !!test);
+
+for (; doSomething(), !!test; );
+
+if (doSomething(), !!test);
+
+switch (val = foo(), val) {}
+
+while (val = foo(), val < 42);
+
+with (doSomething(), val) {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-sequences: "error"*/
+
+foo = (doSomething(), val);
+
+(0, eval)("doSomething();");
+
+do {} while ((doSomething(), !!test));
+
+for (i = 0, j = 10; i < j; i++, j--);
+
+if ((doSomething(), !!test));
+
+switch ((val = foo(), val)) {}
+
+while ((val = foo(), val < 42));
+
+with ((doSomething(), val)) {}
+```
+
+:::
+
+### Note about arrow function bodies
+
+If an arrow function body is a statement rather than a block, and that statement contains a sequence, you need to use double parentheses around the statement to indicate that the sequence is intentional.
+
+Examples of **incorrect** code for arrow functions:
+
+::: incorrect
+
+```js
+/*eslint no-sequences: "error"*/
+const foo = (val) => (console.log('bar'), val);
+
+const foo = () => ((bar = 123), 10);
+
+const foo = () => { return (bar = 123), 10 }
+```
+
+:::
+
+Examples of **correct** code for arrow functions:
+
+::: correct
+
+```js
+/*eslint no-sequences: "error"*/
+const foo = (val) => ((console.log('bar'), val));
+
+const foo = () => (((bar = 123), 10));
+
+const foo = () => { return ((bar = 123), 10) }
+```
+
+:::
+
+## Options
+
+This rule takes one option, an object, with the following properties:
+
+* `"allowInParentheses"`: If set to `true` (default), this rule allows expression sequences that are explicitly wrapped in parentheses.
+
+### allowInParentheses
+
+Examples of **incorrect** code for this rule with the `{ "allowInParentheses": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-sequences: ["error", { "allowInParentheses": false }]*/
+
+foo = (doSomething(), val);
+
+(0, eval)("doSomething();");
+
+do {} while ((doSomething(), !!test));
+
+for (; (doSomething(), !!test); );
+
+if ((doSomething(), !!test));
+
+switch ((val = foo(), val)) {}
+
+while ((val = foo(), val < 42));
+
+with ((doSomething(), val)) {}
+
+const foo = (val) => ((console.log('bar'), val));
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "allowInParentheses": false }` option:
+
+::: correct
+
+```js
+/*eslint no-sequences: ["error", { "allowInParentheses": false }]*/
+
+for (i = 0, j = 10; i < j; i++, j--);
+```
+
+:::
+
+## When Not To Use It
+
+Disable this rule if sequence expressions with the comma operator are acceptable.
+Another case is where you might want to report all usages of the comma operator, even in a for loop. You can achieve this using rule `no-restricted-syntax`:
+
+```js
+{
+    "rules": {
+        "no-restricted-syntax": ["error", "SequenceExpression"]
+    }
+}
+```
diff --git a/eslint/docs/src/rules/no-setter-return.md b/eslint/docs/src/rules/no-setter-return.md
new file mode 100644 (file)
index 0000000..2ed21d3
--- /dev/null
@@ -0,0 +1,111 @@
+---
+title: no-setter-return
+layout: doc
+rule_type: problem
+related_rules:
+- getter-return
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set
+---
+
+
+
+Setters cannot return values.
+
+While returning a value from a setter does not produce an error, the returned value is being ignored. Therefore, returning a value from a setter is either unnecessary or a possible error, since the returned value cannot be used.
+
+## Rule Details
+
+This rule disallows returning values from setters and reports `return` statements in setter functions.
+
+Only `return` without a value is allowed, as it's a control flow statement.
+
+This rule checks setters in:
+
+* Object literals.
+* Class declarations and class expressions.
+* Property descriptors in `Object.create`, `Object.defineProperty`, `Object.defineProperties`, and `Reflect.defineProperty` methods of the global objects.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-setter-return: "error"*/
+
+var foo = {
+    set a(value) {
+        this.val = value;
+        return value;
+    }
+};
+
+class Foo {
+    set a(value) {
+        this.val = value * 2;
+        return this.val;
+    }
+}
+
+const Bar = class {
+    static set a(value) {
+        if (value < 0) {
+            this.val = 0;
+            return 0;
+        }
+        this.val = value;
+    }
+};
+
+Object.defineProperty(foo, "bar", {
+    set(value) {
+        if (value < 0) {
+            return false;
+        }
+        this.val = value;
+    }
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-setter-return: "error"*/
+
+var foo = {
+    set a(value) {
+        this.val = value;
+    }
+};
+
+class Foo {
+    set a(value) {
+        this.val = value * 2;
+    }
+}
+
+const Bar = class {
+    static set a(value) {
+        if (value < 0) {
+            this.val = 0;
+            return;
+        }
+        this.val = value;
+    }
+};
+
+Object.defineProperty(foo, "bar", {
+    set(value) {
+        if (value < 0) {
+            throw new Error("Negative value.");
+        }
+        this.val = value;
+    }
+});
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-shadow-restricted-names.md b/eslint/docs/src/rules/no-shadow-restricted-names.md
new file mode 100644 (file)
index 0000000..cea6a12
--- /dev/null
@@ -0,0 +1,57 @@
+---
+title: no-shadow-restricted-names
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-shadow
+further_reading:
+- https://es5.github.io/#x15.1.1
+- https://es5.github.io/#C
+---
+
+
+
+ES5 §15.1.1 Value Properties of the Global Object (`NaN`, `Infinity`, `undefined`) as well as strict mode restricted identifiers `eval` and `arguments` are considered to be restricted names in JavaScript. Defining them to mean something else can have unintended consequences and confuse others reading the code. For example, there's nothing preventing you from writing:
+
+```js
+var undefined = "foo";
+```
+
+Then any code used within the same scope would not get the global `undefined`, but rather the local version with a very different meaning.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-shadow-restricted-names: "error"*/
+
+function NaN(){}
+
+!function(Infinity){};
+
+var undefined = 5;
+
+try {} catch(eval){}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-shadow-restricted-names: "error"*/
+
+var Object;
+
+function f(a, b){}
+
+// Exception: `undefined` may be shadowed if the variable is never assigned a value.
+var undefined;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-shadow.md b/eslint/docs/src/rules/no-shadow.md
new file mode 100644 (file)
index 0000000..229cdcb
--- /dev/null
@@ -0,0 +1,238 @@
+---
+title: no-shadow
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-shadow-restricted-names
+further_reading:
+- https://en.wikipedia.org/wiki/Variable_shadowing
+---
+
+
+Shadowing is the process by which a local variable shares the same name as a variable in its containing scope. For example:
+
+```js
+var a = 3;
+function b() {
+    var a = 10;
+}
+```
+
+In this case, the variable `a` inside of `b()` is shadowing the variable `a` in the global scope. This can cause confusion while reading the code and it's impossible to access the global variable.
+
+## Rule Details
+
+This rule aims to eliminate shadowed variable declarations.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-shadow: "error"*/
+/*eslint-env es6*/
+
+var a = 3;
+function b() {
+    var a = 10;
+}
+
+var b = function () {
+    var a = 10;
+}
+
+function b(a) {
+    a = 10;
+}
+b(a);
+
+if (true) {
+    let a = 5;
+}
+```
+
+:::
+
+## Options
+
+This rule takes one option, an object, with properties `"builtinGlobals"`, `"hoist"`, `"allow"` and `"ignoreOnInitialization"`.
+
+```json
+{
+    "no-shadow": ["error", { "builtinGlobals": false, "hoist": "functions", "allow": [], "ignoreOnInitialization": false }]
+}
+```
+
+### builtinGlobals
+
+The `builtinGlobals` option is `false` by default.
+If it is `true`, the rule prevents shadowing of built-in global variables: `Object`, `Array`, `Number`, and so on.
+
+Examples of **incorrect** code for the `{ "builtinGlobals": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-shadow: ["error", { "builtinGlobals": true }]*/
+
+function foo() {
+    var Object = 0;
+}
+```
+
+:::
+
+### hoist
+
+The `hoist` option has three settings:
+
+* `functions` (by default) - reports shadowing before the outer functions are defined.
+* `all` - reports all shadowing before the outer variables/functions are defined.
+* `never` - never report shadowing before the outer variables/functions are defined.
+
+#### hoist: functions
+
+Examples of **incorrect** code for the default `{ "hoist": "functions" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-shadow: ["error", { "hoist": "functions" }]*/
+/*eslint-env es6*/
+
+if (true) {
+    let b = 6;
+}
+
+function b() {}
+```
+
+:::
+
+Although `let b` in the `if` statement is before the *function* declaration in the outer scope, it is incorrect.
+
+Examples of **correct** code for the default `{ "hoist": "functions" }` option:
+
+::: correct
+
+```js
+/*eslint no-shadow: ["error", { "hoist": "functions" }]*/
+/*eslint-env es6*/
+
+if (true) {
+    let a = 3;
+}
+
+let a = 5;
+```
+
+:::
+
+Because `let a` in the `if` statement is before the *variable* declaration in the outer scope, it is correct.
+
+#### hoist: all
+
+Examples of **incorrect** code for the `{ "hoist": "all" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-shadow: ["error", { "hoist": "all" }]*/
+/*eslint-env es6*/
+
+if (true) {
+    let a = 3;
+    let b = 6;
+}
+
+let a = 5;
+function b() {}
+```
+
+:::
+
+#### hoist: never
+
+Examples of **correct** code for the `{ "hoist": "never" }` option:
+
+::: correct
+
+```js
+/*eslint no-shadow: ["error", { "hoist": "never" }]*/
+/*eslint-env es6*/
+
+if (true) {
+    let a = 3;
+    let b = 6;
+}
+
+let a = 5;
+function b() {}
+```
+
+:::
+
+Because `let a` and `let b` in the `if` statement are before the declarations in the outer scope, they are correct.
+
+### allow
+
+The `allow` option is an array of identifier names for which shadowing is allowed. For example, `"resolve"`, `"reject"`, `"done"`, `"cb"`.
+
+Examples of **correct** code for the `{ "allow": ["done"] }` option:
+
+::: correct
+
+```js
+/*eslint no-shadow: ["error", { "allow": ["done"] }]*/
+/*eslint-env es6*/
+
+import async from 'async';
+
+function foo(done) {
+  async.map([1, 2], function (e, done) {
+    done(null, e * 2)
+  }, done);
+}
+
+foo(function (err, result) {
+  console.log({ err, result });
+});
+```
+
+:::
+
+### ignoreOnInitialization
+
+The `ignoreOnInitialization` option is `false` by default. If it is `true`, it prevents reporting shadowing of variables in their initializers when the shadowed variable is presumably still uninitialized.
+
+The shadowed variable must be on the left side. The shadowing variable must be on the right side and declared in a callback function or in an IIFE.
+
+Examples of **incorrect** code for the `{ "ignoreOnInitialization": "true" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-shadow: ["error", { "ignoreOnInitialization": true }]*/
+
+var x = x => x;
+```
+
+:::
+
+Because the shadowing variable `x` will shadow the already initialized shadowed variable `x`.
+
+Examples of **correct** code for the `{ "ignoreOnInitialization": true }` option:
+
+::: correct
+
+```js
+/*eslint no-shadow: ["error", { "ignoreOnInitialization": true }]*/
+
+var x = foo(x => x)
+
+var y = (y => y)()
+```
+
+:::
+
+The rationale for callback functions is the assumption that they will be called during the initialization, so that at the time when the shadowing variable will be used, the shadowed variable has not yet been initialized.
diff --git a/eslint/docs/src/rules/no-space-before-semi.md b/eslint/docs/src/rules/no-space-before-semi.md
new file mode 100644 (file)
index 0000000..5e50520
--- /dev/null
@@ -0,0 +1,55 @@
+---
+title: no-space-before-semi
+layout: doc
+
+related_rules:
+- semi
+- no-extra-semi
+---
+
+Disallows spaces before semicolons.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [semi-spacing](semi-spacing) rule.
+
+JavaScript allows for placing unnecessary spaces between an expression and the closing semicolon.
+
+Space issues can also cause code to look inconsistent and harder to read.
+
+```js
+var thing = function () {
+  var test = 12 ;
+}  ;
+```
+
+## Rule Details
+
+This rule prevents the use of spaces before a semicolon in expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var foo = "bar" ;
+
+var foo = function() {} ;
+
+var foo = function() {
+} ;
+
+var foo = 1 + 2 ;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+;(function(){}());
+
+var foo = "bar";
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-spaced-func.md b/eslint/docs/src/rules/no-spaced-func.md
new file mode 100644 (file)
index 0000000..c844996
--- /dev/null
@@ -0,0 +1,42 @@
+---
+title: no-spaced-func
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule was **deprecated** in ESLint v3.3.0 and replaced by the [func-call-spacing](func-call-spacing) rule.
+
+While it's possible to have whitespace between the name of a function and the parentheses that execute it, such patterns tend to look more like errors.
+
+## Rule Details
+
+This rule disallows spacing between function identifiers and their applications.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-spaced-func: "error"*/
+
+fn ()
+
+fn
+()
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-spaced-func: "error"*/
+
+fn()
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-sparse-arrays.md b/eslint/docs/src/rules/no-sparse-arrays.md
new file mode 100644 (file)
index 0000000..cbeb57c
--- /dev/null
@@ -0,0 +1,62 @@
+---
+title: no-sparse-arrays
+layout: doc
+rule_type: problem
+further_reading:
+- https://www.nczonline.net/blog/2007/09/09/inconsistent-array-literals/
+---
+
+
+
+Sparse arrays contain empty slots, most frequently due to multiple commas being used in an array literal, such as:
+
+```js
+var items = [,,];
+```
+
+While the `items` array in this example has a `length` of 2, there are actually no values in `items[0]` or `items[1]`. The fact that the array literal is valid with only commas inside, coupled with the `length` being set and actual item values not being set, make sparse arrays confusing for many developers. Consider the following:
+
+```js
+var colors = [ "red",, "blue" ];
+```
+
+In this example, the `colors` array has a `length` of 3. But did the developer intend for there to be an empty spot in the middle of the array? Or is it a typo?
+
+The confusion around sparse arrays defined in this manner is enough that it's recommended to avoid using them unless you are certain that they are useful in your code.
+
+## Rule Details
+
+This rule disallows sparse array literals which have "holes" where commas are not preceded by elements. It does not apply to a trailing comma following the last element.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-sparse-arrays: "error"*/
+
+var items = [,];
+var colors = [ "red",, "blue" ];
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-sparse-arrays: "error"*/
+
+var items = [];
+var items = new Array(23);
+
+// trailing comma (after the last element) is not a problem
+var colors = [ "red", "blue", ];
+```
+
+:::
+
+## When Not To Use It
+
+If you want to use sparse arrays, then it is safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-sync.md b/eslint/docs/src/rules/no-sync.md
new file mode 100644 (file)
index 0000000..4b5eb57
--- /dev/null
@@ -0,0 +1,82 @@
+---
+title: no-sync
+layout: doc
+rule_type: suggestion
+---
+
+
+This rule was **deprecated** in ESLint v7.0.0. Please use the corresponding rule in [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node).
+
+In Node.js, most I/O is done through asynchronous methods. However, there are often synchronous versions of the asynchronous methods. For example, `fs.exists()` and `fs.existsSync()`. In some contexts, using synchronous operations is okay (if, as with ESLint, you are writing a command line utility). However, in other contexts the use of synchronous operations is considered a bad practice that should be avoided. For example, if you are running a high-travel web server on Node.js, you should consider carefully if you want to allow any synchronous operations that could lock up the server.
+
+## Rule Details
+
+This rule is aimed at preventing synchronous methods from being called in Node.js. It looks specifically for the method suffix "`Sync`" (as is the convention with Node.js operations).
+
+## Options
+
+This rule has an optional object option `{ allowAtRootLevel: <boolean> }`, which determines whether synchronous methods should be allowed at the top level of a file, outside of any functions. This option defaults to `false`.
+
+Examples of **incorrect** code for this rule with the default `{ allowAtRootLevel: false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-sync: "error"*/
+
+fs.existsSync(somePath);
+
+function foo() {
+  var contents = fs.readFileSync(somePath).toString();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ allowAtRootLevel: false }` option:
+
+::: correct
+
+```js
+/*eslint no-sync: "error"*/
+
+obj.sync();
+
+async(function() {
+    // ...
+});
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ allowAtRootLevel: true }` option
+
+::: incorrect
+
+```js
+/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
+
+function foo() {
+  var contents = fs.readFileSync(somePath).toString();
+}
+
+var bar = baz => fs.readFileSync(qux);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ allowAtRootLevel: true }` option
+
+::: correct
+
+```js
+/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
+
+fs.readFileSync(somePath).toString();
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow synchronous operations in your script, do not enable this rule.
diff --git a/eslint/docs/src/rules/no-tabs.md b/eslint/docs/src/rules/no-tabs.md
new file mode 100644 (file)
index 0000000..279e0c8
--- /dev/null
@@ -0,0 +1,78 @@
+---
+title: no-tabs
+layout: doc
+rule_type: layout
+---
+
+
+Some style guides don't allow the use of tab characters at all, including within comments.
+
+## Rule Details
+
+This rule looks for tabs anywhere inside a file: code, comments or anything else.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var a \t= 2;
+
+/**
+* \t\t it's a test function
+*/
+function test(){}
+
+var x = 1; // \t test
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+var a = 2;
+
+/**
+* it's a test function
+*/
+function test(){}
+
+var x = 1; // test
+```
+
+:::
+
+### Options
+
+This rule has an optional object option with the following properties:
+
+* `allowIndentationTabs` (default: false): If this is set to true, then the rule will not report tabs used for indentation.
+
+#### allowIndentationTabs
+
+Examples of **correct** code for this rule with the `allowIndentationTabs: true` option:
+
+::: correct
+
+```js
+/* eslint no-tabs: ["error", { allowIndentationTabs: true }] */
+
+function test() {
+\tdoSomething();
+}
+
+\t// comment with leading indentation tab
+```
+
+:::
+
+## When Not To Use It
+
+If you have established a standard where having tabs is fine, then you can disable this rule.
+
+## Compatibility
+
+* **JSCS**: [disallowTabs](https://jscs-dev.github.io/rule/disallowTabs)
diff --git a/eslint/docs/src/rules/no-template-curly-in-string.md b/eslint/docs/src/rules/no-template-curly-in-string.md
new file mode 100644 (file)
index 0000000..79f42e7
--- /dev/null
@@ -0,0 +1,45 @@
+---
+title: no-template-curly-in-string
+layout: doc
+rule_type: problem
+---
+
+
+ECMAScript 6 allows programmers to create strings containing variable or expressions using template literals, instead of string concatenation, by writing expressions like `${variable}` between two backtick quotes (\`). It can be easy to use the wrong quotes when wanting to use template literals, by writing `"${variable}"`, and end up with the literal value `"${variable}"` instead of a string containing the value of the injected expressions.
+
+## Rule Details
+
+This rule aims to warn when a regular string contains what looks like a template literal placeholder. It will warn when it finds a string containing the template literal placeholder (`${something}`) that uses either `"` or `'` for the quotes.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-template-curly-in-string: "error"*/
+"Hello ${name}!";
+'Hello ${name}!';
+"Time: ${12 * 60 * 60 * 1000}";
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-template-curly-in-string: "error"*/
+`Hello ${name}!`;
+`Time: ${12 * 60 * 60 * 1000}`;
+
+templateFunction`Hello ${name}`;
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
diff --git a/eslint/docs/src/rules/no-ternary.md b/eslint/docs/src/rules/no-ternary.md
new file mode 100644 (file)
index 0000000..7502c5b
--- /dev/null
@@ -0,0 +1,61 @@
+---
+title: no-ternary
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-nested-ternary
+- no-unneeded-ternary
+---
+
+
+The ternary operator is used to conditionally assign a value to a variable. Some believe that the use of ternary operators leads to unclear code.
+
+```js
+var foo = isBar ? baz : qux;
+```
+
+## Rule Details
+
+This rule disallows ternary operators.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-ternary: "error"*/
+
+var foo = isBar ? baz : qux;
+
+function quux() {
+  return foo ? bar() : baz();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-ternary: "error"*/
+
+var foo;
+
+if (isBar) {
+    foo = baz;
+} else {
+    foo = qux;
+}
+
+function quux() {
+    if (foo) {
+        return bar();
+    } else {
+        return baz();
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-this-before-super.md b/eslint/docs/src/rules/no-this-before-super.md
new file mode 100644 (file)
index 0000000..e6e26dd
--- /dev/null
@@ -0,0 +1,89 @@
+---
+title: no-this-before-super
+layout: doc
+rule_type: problem
+---
+
+
+
+In the constructor of derived classes, if `this`/`super` are used before `super()` calls, it raises a reference error.
+
+This rule checks `this`/`super` keywords in constructors, then reports those that are before `super()`.
+
+## Rule Details
+
+This rule is aimed to flag `this`/`super` keywords before `super()` callings.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-this-before-super: "error"*/
+/*eslint-env es6*/
+
+class A extends B {
+    constructor() {
+        this.a = 0;
+        super();
+    }
+}
+
+class A extends B {
+    constructor() {
+        this.foo();
+        super();
+    }
+}
+
+class A extends B {
+    constructor() {
+        super.foo();
+        super();
+    }
+}
+
+class A extends B {
+    constructor() {
+        super(this.foo());
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-this-before-super: "error"*/
+/*eslint-env es6*/
+
+class A {
+    constructor() {
+        this.a = 0; // OK, this class doesn't have an `extends` clause.
+    }
+}
+
+class A extends B {
+    constructor() {
+        super();
+        this.a = 0; // OK, this is after `super()`.
+    }
+}
+
+class A extends B {
+    foo() {
+        this.a = 0; // OK. this is not in a constructor.
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about using `this`/`super` before `super()` in constructors, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-throw-literal.md b/eslint/docs/src/rules/no-throw-literal.md
new file mode 100644 (file)
index 0000000..6f57e36
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: no-throw-literal
+layout: doc
+rule_type: suggestion
+---
+
+
+It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions.
+The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated.
+
+This rule restricts what can be thrown as an exception.  When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an `Error` object.
+
+## Rule Details
+
+This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-throw-literal: "error"*/
+/*eslint-env es6*/
+
+throw "error";
+
+throw 0;
+
+throw undefined;
+
+throw null;
+
+var err = new Error();
+throw "an " + err;
+// err is recast to a string literal
+
+var err = new Error();
+throw `${err}`
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-throw-literal: "error"*/
+
+throw new Error();
+
+throw new Error("error");
+
+var e = new Error("error");
+throw e;
+
+try {
+    throw new Error("error");
+} catch (e) {
+    throw e;
+}
+```
+
+:::
+
+## Known Limitations
+
+Due to the limits of static analysis, this rule cannot guarantee that you will only throw `Error` objects.
+
+Examples of **correct** code for this rule, but which do not throw an `Error` object:
+
+::: correct
+
+```js
+/*eslint no-throw-literal: "error"*/
+
+var err = "error";
+throw err;
+
+function foo(bar) {
+    console.log(bar);
+}
+throw foo("error");
+
+throw new String("error");
+
+var foo = {
+    bar: "error"
+};
+throw foo.bar;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-trailing-spaces.md b/eslint/docs/src/rules/no-trailing-spaces.md
new file mode 100644 (file)
index 0000000..831ab33
--- /dev/null
@@ -0,0 +1,85 @@
+---
+title: no-trailing-spaces
+layout: doc
+rule_type: layout
+---
+
+
+
+Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before check-in.
+
+## Rule Details
+
+This rule disallows trailing whitespace (spaces, tabs, and other Unicode whitespace characters) at the end of lines.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-trailing-spaces: "error"*/
+
+var foo = 0;//•••••
+var baz = 5;//••
+//•••••
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-trailing-spaces: "error"*/
+
+var foo = 0;
+var baz = 5;
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"skipBlankLines": false` (default) disallows trailing whitespace on empty lines
+* `"skipBlankLines": true` allows trailing whitespace on empty lines
+* `"ignoreComments": false` (default) disallows trailing whitespace in comment blocks
+* `"ignoreComments": true` allows trailing whitespace in comment blocks
+
+### skipBlankLines
+
+Examples of **correct** code for this rule with the `{ "skipBlankLines": true }` option:
+
+::: correct
+
+```js
+/*eslint no-trailing-spaces: ["error", { "skipBlankLines": true }]*/
+
+var foo = 0;
+var baz = 5;
+//•••••
+```
+
+:::
+
+### ignoreComments
+
+Examples of **correct** code for this rule with the `{ "ignoreComments": true }` option:
+
+::: correct
+
+```js
+/*eslint no-trailing-spaces: ["error", { "ignoreComments": true }]*/
+
+//foo•
+//•••••
+/**
+ *•baz
+ *••
+ *•bar
+ */
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-undef-init.md b/eslint/docs/src/rules/no-undef-init.md
new file mode 100644 (file)
index 0000000..9f36bc4
--- /dev/null
@@ -0,0 +1,151 @@
+---
+title: no-undef-init
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-undefined
+- no-void
+---
+
+
+
+In JavaScript, a variable that is declared and not initialized to any value automatically gets the value of `undefined`. For example:
+
+```js
+var foo;
+
+console.log(foo === undefined);     // true
+```
+
+It's therefore unnecessary to initialize a variable to `undefined`, such as:
+
+```js
+var foo = undefined;
+```
+
+It's considered a best practice to avoid initializing variables to `undefined`.
+
+## Rule Details
+
+This rule aims to eliminate `var` and `let` variable declarations that initialize to `undefined`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-undef-init: "error"*/
+
+var foo = undefined;
+let bar = undefined;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-undef-init: "error"*/
+
+var foo;
+let bar;
+```
+
+:::
+
+Please note that this rule does not check `const` declarations, destructuring patterns, function parameters, and class fields.
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-undef-init: "error"*/
+
+const foo = undefined;
+
+let { bar = undefined } = baz;
+
+[quux = undefined] = quuux;
+
+(foo = undefined) => {};
+
+class Foo {
+    bar = undefined;
+}
+```
+
+:::
+
+## When Not To Use It
+
+There is one situation where initializing to `undefined` behaves differently than omitting the initialization, and that's when a `var` declaration occurs inside of a loop. For example:
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+for (i = 0; i < 10; i++) {
+    var x = undefined;
+    console.log(x);
+    x = i;
+}
+```
+
+:::
+
+In this case, the `var x` is hoisted out of the loop, effectively creating:
+
+```js
+var x;
+
+for (i = 0; i < 10; i++) {
+    x = undefined;
+    console.log(x);
+    x = i;
+}
+```
+
+If you were to remove the initialization, then the behavior of the loop changes:
+
+```js
+for (i = 0; i < 10; i++) {
+    var x;
+    console.log(x);
+    x = i;
+}
+```
+
+This code is equivalent to:
+
+```js
+var x;
+
+for (i = 0; i < 10; i++) {
+    console.log(x);
+    x = i;
+}
+```
+
+This produces a different outcome than defining `var x = undefined` in the loop, as `x` is no longer reset to `undefined` each time through the loop.
+
+If you're using such an initialization inside of a loop, then you should disable this rule.
+
+Example of **correct** code for this rule, because it is disabled on a specific line:
+
+::: correct
+
+```js
+/*eslint no-undef-init: "error"*/
+
+for (i = 0; i < 10; i++) {
+    var x = undefined; // eslint-disable-line no-undef-init
+    console.log(x);
+    x = i;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-undef.md b/eslint/docs/src/rules/no-undef.md
new file mode 100644 (file)
index 0000000..94a7352
--- /dev/null
@@ -0,0 +1,143 @@
+---
+title: no-undef
+layout: doc
+rule_type: problem
+related_rules:
+- no-global-assign
+- no-redeclare
+---
+
+
+
+This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the `var` keyword in a `for` loop initializer).
+
+## Rule Details
+
+Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](../user-guide/configuring/language-options#using-configuration-files-1). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-undef: "error"*/
+
+var foo = someFunction();
+var bar = a + 1;
+```
+
+:::
+
+Examples of **correct** code for this rule with `global` declaration:
+
+::: correct
+
+```js
+/*global someFunction, a*/
+/*eslint no-undef: "error"*/
+
+var foo = someFunction();
+var bar = a + 1;
+```
+
+:::
+
+Note that this rule does not disallow assignments to read-only global variables.
+See [no-global-assign](no-global-assign) if you also want to disallow those assignments.
+
+This rule also does not disallow redeclarations of global variables.
+See [no-redeclare](no-redeclare) if you also want to disallow those redeclarations.
+
+## Options
+
+* `typeof` set to true will warn for variables used inside typeof check (Default false).
+
+### typeof
+
+Examples of **correct** code for the default `{ "typeof": false }` option:
+
+::: correct
+
+```js
+/*eslint no-undef: "error"*/
+
+if (typeof UndefinedIdentifier === "undefined") {
+    // do something ...
+}
+```
+
+:::
+
+You can use this option if you want to prevent `typeof` check on a variable which has not been declared.
+
+Examples of **incorrect** code for the `{ "typeof": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-undef: ["error", { "typeof": true }] */
+
+if(typeof a === "string"){}
+```
+
+:::
+
+Examples of **correct** code for the `{ "typeof": true }` option with `global` declaration:
+
+::: correct
+
+```js
+/*global a*/
+/*eslint no-undef: ["error", { "typeof": true }] */
+
+if(typeof a === "string"){}
+```
+
+:::
+
+## Environments
+
+For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in [Specifying Environments](../user-guide/configuring/language-options#specifying-environments).  A few examples are given below.
+
+### browser
+
+Examples of **correct** code for this rule with `browser` environment:
+
+::: correct
+
+```js
+/*eslint no-undef: "error"*/
+/*eslint-env browser*/
+
+setTimeout(function() {
+    alert("Hello");
+});
+```
+
+:::
+
+### Node.js
+
+Examples of **correct** code for this rule with `node` environment:
+
+::: correct
+
+```js
+/*eslint no-undef: "error"*/
+/*eslint-env node*/
+
+var fs = require("fs");
+module.exports = function() {
+    console.log(fs);
+};
+```
+
+:::
+
+## When Not To Use It
+
+If explicit declaration of global variables is not to your taste.
+
+## Compatibility
+
+This rule provides compatibility with treatment of global variables in [JSHint](http://jshint.com/) and [JSLint](http://www.jslint.com).
diff --git a/eslint/docs/src/rules/no-undefined.md b/eslint/docs/src/rules/no-undefined.md
new file mode 100644 (file)
index 0000000..978fc42
--- /dev/null
@@ -0,0 +1,87 @@
+---
+title: no-undefined
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-undef-init
+- no-void
+- no-shadow-restricted-names
+- no-global-assign
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined
+- https://javascriptweblog.wordpress.com/2010/08/16/understanding-undefined-and-preventing-referenceerrors/
+- https://es5.github.io/#x15.1.1.3
+---
+
+
+The `undefined` variable in JavaScript is actually a property of the global object. As such, in ECMAScript 3 it was possible to overwrite the value of `undefined`. While ECMAScript 5 disallows overwriting `undefined`, it's still possible to shadow `undefined`, such as:
+
+```js
+function doSomething(data) {
+    var undefined = "hi";
+
+    // doesn't do what you think it does
+    if (data === undefined) {
+        // ...
+    }
+
+}
+```
+
+Because `undefined` can be overwritten or shadowed, reading `undefined` can give an unexpected value. (This is not the case for `null`, which is a keyword that always produces the same value.) To guard against this, you can avoid all uses of `undefined`, which is what some style guides recommend and what this rule enforces. Those style guides then also recommend:
+
+* Variables that should be `undefined` are simply left uninitialized. (All uninitialized variables automatically get the value of `undefined` in JavaScript.)
+* Checking if a value is `undefined` should be done with `typeof`.
+* Using the `void` operator to generate the value of `undefined` if necessary.
+
+As an alternative, you can use the [no-global-assign](no-global-assign) and [no-shadow-restricted-names](no-shadow-restricted-names) rules to prevent `undefined` from being shadowed or assigned a different value. This ensures that `undefined` will always hold its original, expected value.
+
+## Rule Details
+
+This rule aims to eliminate the use of `undefined`, and as such, generates a warning whenever it is used.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-undefined: "error"*/
+
+var foo = undefined;
+
+var undefined = "foo";
+
+if (foo === undefined) {
+    // ...
+}
+
+function foo(undefined) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-undefined: "error"*/
+
+var foo = void 0;
+
+var Undefined = "foo";
+
+if (typeof foo === "undefined") {
+    // ...
+}
+
+global.undefined = "foo";
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow the use of `undefined` in your code, then you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-underscore-dangle.md b/eslint/docs/src/rules/no-underscore-dangle.md
new file mode 100644 (file)
index 0000000..f74beac
--- /dev/null
@@ -0,0 +1,212 @@
+---
+title: no-underscore-dangle
+layout: doc
+rule_type: suggestion
+---
+
+
+As far as naming conventions for identifiers go, dangling underscores may be the most polarizing in JavaScript. Dangling underscores are underscores at either the beginning or end of an identifier, such as:
+
+```js
+var _foo;
+```
+
+There is actually a long history of using dangling underscores to indicate "private" members of objects in JavaScript (though JavaScript doesn't have truly private members, this convention served as a warning). This began with SpiderMonkey adding nonstandard methods such as `__defineGetter__()`. The intent with the underscores was to make it obvious that this method was special in some way. Since that time, using a single underscore prefix has become popular as a way to indicate "private" members of objects.
+
+Whether or not you choose to allow dangling underscores in identifiers is purely a convention and has no effect on performance, readability, or complexity. It's purely a preference.
+
+## Rule Details
+
+This rule disallows dangling underscores in identifiers.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-underscore-dangle: "error"*/
+
+var foo_;
+var __proto__ = {};
+foo._bar();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-underscore-dangle: "error"*/
+
+var _ = require('underscore');
+var obj = _.contains(items, item);
+obj.__proto__ = {};
+var file = __filename;
+function foo(_bar) {};
+const foo = { onClick(_bar) {} };
+const foo = (_bar) => {};
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"allow"` allows specified identifiers to have dangling underscores
+* `"allowAfterThis": false` (default) disallows dangling underscores in members of the `this` object
+* `"allowAfterSuper": false` (default) disallows dangling underscores in members of the `super` object
+* `"allowAfterThisConstructor": false` (default) disallows dangling underscores in members of the `this.constructor` object
+* `"enforceInMethodNames": false` (default) allows dangling underscores in method names
+* `"enforceInClassFields": false` (default) allows dangling underscores in es2022 class fields names
+* `"allowFunctionParams": true` (default) allows dangling underscores in function parameter names
+
+### allow
+
+Examples of additional **correct** code for this rule with the `{ "allow": ["foo_", "_bar"] }` option:
+
+::: correct
+
+```js
+/*eslint no-underscore-dangle: ["error", { "allow": ["foo_", "_bar"] }]*/
+
+var foo_;
+foo._bar();
+```
+
+:::
+
+### allowAfterThis
+
+Examples of **correct** code for this rule with the `{ "allowAfterThis": true }` option:
+
+::: correct
+
+```js
+/*eslint no-underscore-dangle: ["error", { "allowAfterThis": true }]*/
+
+var a = this.foo_;
+this._bar();
+```
+
+:::
+
+### allowAfterSuper
+
+Examples of **correct** code for this rule with the `{ "allowAfterSuper": true }` option:
+
+::: correct
+
+```js
+/*eslint no-underscore-dangle: ["error", { "allowAfterSuper": true }]*/
+
+var a = super.foo_;
+super._bar();
+```
+
+:::
+
+### allowAfterThisConstructor
+
+Examples of **correct** code for this rule with the `{ "allowAfterThisConstructor": true }` option:
+
+::: correct
+
+```js
+/*eslint no-underscore-dangle: ["error", { "allowAfterThisConstructor": true }]*/
+
+var a = this.constructor.foo_;
+this.constructor._bar();
+```
+
+:::
+
+### enforceInMethodNames
+
+Examples of **incorrect** code for this rule with the `{ "enforceInMethodNames": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-underscore-dangle: ["error", { "enforceInMethodNames": true }]*/
+
+class Foo {
+  _bar() {}
+}
+
+class Foo {
+  bar_() {}
+}
+
+const o = {
+  _bar() {}
+};
+
+const o = {
+  bar_() = {}
+};
+```
+
+:::
+
+### enforceInClassFields
+
+Examples of **incorrect** code for this rule with the `{ "enforceInClassFields": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-underscore-dangle: ["error", { "enforceInClassFields": true }]*/
+
+class Foo {
+    _bar;
+}
+
+class Foo {
+    _bar = () => {};
+}
+
+class Foo {
+    bar_;
+}
+
+class Foo {
+    #_bar;
+}
+
+class Foo {
+    #bar_;
+}
+```
+
+:::
+
+### allowFunctionParams
+
+Examples of **incorrect** code for this rule with the `{ "allowFunctionParams": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-underscore-dangle: ["error", { "allowFunctionParams": false }]*/
+
+function foo (_bar) {}
+function foo (_bar = 0) {}
+function foo (..._bar) {}
+
+const foo = function onClick (_bar) {}
+const foo = function onClick (_bar = 0) {}
+const foo = function onClick (..._bar) {}
+
+const foo = (_bar) => {};
+const foo = (_bar = 0) => {};
+const foo = (..._bar) => {};
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow dangling underscores in identifiers, then you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-unexpected-multiline.md b/eslint/docs/src/rules/no-unexpected-multiline.md
new file mode 100644 (file)
index 0000000..6a51c23
--- /dev/null
@@ -0,0 +1,86 @@
+---
+title: no-unexpected-multiline
+layout: doc
+rule_type: problem
+related_rules:
+- func-call-spacing
+- semi
+- space-unary-ops
+---
+
+
+
+Semicolons are usually optional in JavaScript, because of automatic semicolon insertion (ASI). You can require or disallow semicolons with the [semi](./semi) rule.
+
+The rules for ASI are relatively straightforward: As once described by Isaac Schlueter, a newline character always ends a statement, just like a semicolon, **except** where one of the following is true:
+
+* The statement has an unclosed paren, array literal, or object literal or ends in some other way that is not a valid way to end a statement. (For instance, ending with `.` or `,`.)
+* The line is `--` or `++` (in which case it will decrement/increment the next token.)
+* It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{`
+* The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other binary operator that can only be found between two tokens in a single expression.
+
+In the exceptions where a newline does **not** end a statement, a typing mistake to omit a semicolon causes two unrelated consecutive lines to be interpreted as one expression. Especially for a coding style without semicolons, readers might overlook the mistake. Although syntactically correct, the code might throw exceptions when it is executed.
+
+## Rule Details
+
+This rule disallows confusing multiline expressions where a newline looks like it is ending a statement, but is not.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unexpected-multiline: "error"*/
+
+var foo = bar
+(1 || 2).baz();
+
+var hello = 'world'
+[1, 2, 3].forEach(addNumber);
+
+let x = function() {}
+`hello`
+
+let x = function() {}
+x
+`hello`
+
+let x = foo
+/regex/g.test(bar)
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unexpected-multiline: "error"*/
+
+var foo = bar;
+(1 || 2).baz();
+
+var foo = bar
+;(1 || 2).baz()
+
+var hello = 'world';
+[1, 2, 3].forEach(addNumber);
+
+var hello = 'world'
+void [1, 2, 3].forEach(addNumber);
+
+let x = function() {};
+`hello`
+
+let tag = function() {}
+tag `hello`
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are confident that you will not accidentally introduce code like this.
+
+Note that the patterns considered problems are **not** flagged by the [semi](semi) rule.
diff --git a/eslint/docs/src/rules/no-unmodified-loop-condition.md b/eslint/docs/src/rules/no-unmodified-loop-condition.md
new file mode 100644 (file)
index 0000000..f214c6c
--- /dev/null
@@ -0,0 +1,103 @@
+---
+title: no-unmodified-loop-condition
+layout: doc
+rule_type: problem
+---
+
+
+Variables in a loop condition often are modified in the loop.
+If not, it's possibly a mistake.
+
+```js
+while (node) {
+    doSomething(node);
+}
+```
+
+```js
+while (node) {
+    doSomething(node);
+    node = node.parent;
+}
+```
+
+## Rule Details
+
+This rule finds references which are inside of loop conditions, then checks the
+variables of those references are modified in the loop.
+
+If a reference is inside of a binary expression or a ternary expression, this rule checks the result of
+the expression instead.
+If a reference is inside of a dynamic expression (e.g. `CallExpression`,
+`YieldExpression`, ...), this rule ignores it.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unmodified-loop-condition: "error"*/
+
+var node = something;
+
+while (node) {
+    doSomething(node);
+}
+node = other;
+
+for (var j = 0; j < items.length; ++i) {
+    doSomething(items[j]);
+}
+
+while (node !== root) {
+    doSomething(node);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unmodified-loop-condition: "error"*/
+
+while (node) {
+    doSomething(node);
+    node = node.parent;
+}
+
+for (var j = 0; j < items.length; ++j) {
+    doSomething(items[j]);
+}
+
+// OK, the result of this binary expression is changed in this loop.
+while (node !== root) {
+    doSomething(node);
+    node = node.parent;
+}
+
+// OK, the result of this ternary expression is changed in this loop.
+while (node ? A : B) {
+    doSomething(node);
+    node = node.parent;
+}
+
+// A property might be a getter which has side effect...
+// Or "doSomething" can modify "obj.foo".
+while (obj.foo) {
+    doSomething(obj);
+}
+
+// A function call can return various values.
+while (check(obj)) {
+    doSomething(obj);
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notified about references inside of loop conditions, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-unneeded-ternary.md b/eslint/docs/src/rules/no-unneeded-ternary.md
new file mode 100644 (file)
index 0000000..e1b0ba2
--- /dev/null
@@ -0,0 +1,107 @@
+---
+title: no-unneeded-ternary
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-ternary
+- no-nested-ternary
+---
+
+
+
+It's a common mistake in JavaScript to use a conditional expression to select between two Boolean values instead of using ! to convert the test to a Boolean.
+Here are some examples:
+
+```js
+// Bad
+var isYes = answer === 1 ? true : false;
+
+// Good
+var isYes = answer === 1;
+
+// Bad
+var isNo = answer === 1 ? false : true;
+
+// Good
+var isNo = answer !== 1;
+```
+
+Another common mistake is using a single variable as both the conditional test and the consequent. In such cases, the logical `OR` can be used to provide the same functionality.
+Here is an example:
+
+```js
+// Bad
+foo(bar ? bar : 1);
+
+// Good
+foo(bar || 1);
+```
+
+## Rule Details
+
+This rule disallow ternary operators when simpler alternatives exist.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unneeded-ternary: "error"*/
+
+var a = x === 2 ? true : false;
+
+var a = x ? true : false;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unneeded-ternary: "error"*/
+
+var a = x === 2 ? "Yes" : "No";
+
+var a = x !== false;
+
+var a = x ? "Yes" : "No";
+
+var a = x ? y : x;
+
+f(x ? x : 1); // default assignment - would be disallowed if defaultAssignment option set to false. See option details below.
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"defaultAssignment": true` (default) allows the conditional expression as a default assignment pattern
+* `"defaultAssignment": false` disallows the conditional expression as a default assignment pattern
+
+### defaultAssignment
+
+When set to `true`, which it is by default, The defaultAssignment option allows expressions of the form `x ? x : expr` (where `x` is any identifier and `expr` is any expression).
+
+Examples of additional **incorrect** code for this rule with the `{ "defaultAssignment": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unneeded-ternary: ["error", { "defaultAssignment": false }]*/
+
+var a = x ? x : 1;
+
+f(x ? x : 1);
+```
+
+:::
+
+Note that `defaultAssignment: false` still allows expressions of the form `x ? expr : x` (where the identifier is on the right hand side of the ternary).
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with unnecessary complexity in conditional expressions.
diff --git a/eslint/docs/src/rules/no-unreachable-loop.md b/eslint/docs/src/rules/no-unreachable-loop.md
new file mode 100644 (file)
index 0000000..4f24e57
--- /dev/null
@@ -0,0 +1,209 @@
+---
+title: no-unreachable-loop
+layout: doc
+rule_type: problem
+related_rules:
+- no-unreachable
+- no-constant-condition
+- no-unmodified-loop-condition
+- for-direction
+---
+
+
+A loop that can never reach the second iteration is a possible error in the code.
+
+```js
+for (let i = 0; i < arr.length; i++) {
+    if (arr[i].name === myName) {
+        doSomething(arr[i]);
+        // break was supposed to be here
+    }
+    break;
+}
+```
+
+In rare cases where only one iteration (or at most one iteration) is intended behavior, the code should be refactored to use `if` conditionals instead of `while`, `do-while` and `for` loops. It's considered a best practice to avoid using loop constructs for such cases.
+
+## Rule Details
+
+This rule aims to detect and disallow loops that can have at most one iteration, by performing static code path analysis on loop bodies.
+
+In particular, this rule will disallow a loop with a body that exits the loop in all code paths. If all code paths in the loop's body will end with either a `break`, `return` or a `throw` statement, the second iteration of such loop is certainly unreachable, regardless of the loop's condition.
+
+This rule checks `while`, `do-while`, `for`, `for-in` and `for-of` loops. You can optionally disable checks for each of these constructs.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unreachable-loop: "error"*/
+
+while (foo) {
+    doSomething(foo);
+    foo = foo.parent;
+    break;
+}
+
+function verifyList(head) {
+    let item = head;
+    do {
+        if (verify(item)) {
+            return true;
+        } else {
+            return false;
+        }
+    } while (item);
+}
+
+function findSomething(arr) {
+    for (var i = 0; i < arr.length; i++) {
+        if (isSomething(arr[i])) {
+            return arr[i];
+        } else {
+            throw new Error("Doesn't exist.");
+        }
+    }
+}
+
+for (key in obj) {
+    if (key.startsWith("_")) {
+        break;
+    }
+    firstKey = key;
+    firstValue = obj[key];
+    break;
+}
+
+for (foo of bar) {
+    if (foo.id === id) {
+        doSomething(foo);
+    }
+    break;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unreachable-loop: "error"*/
+
+while (foo) {
+    doSomething(foo);
+    foo = foo.parent;
+}
+
+function verifyList(head) {
+    let item = head;
+    do {
+        if (verify(item)) {
+            item = item.next;
+        } else {
+            return false;
+        }
+    } while (item);
+
+    return true;
+}
+
+function findSomething(arr) {
+    for (var i = 0; i < arr.length; i++) {
+        if (isSomething(arr[i])) {
+            return arr[i];
+        }
+    }
+    throw new Error("Doesn't exist.");
+}
+
+for (key in obj) {
+    if (key.startsWith("_")) {
+        continue;
+    }
+    firstKey = key;
+    firstValue = obj[key];
+    break;
+}
+
+for (foo of bar) {
+    if (foo.id === id) {
+        doSomething(foo);
+        break;
+    }
+}
+```
+
+:::
+
+Please note that this rule is not designed to check loop conditions, and will not warn in cases such as the following examples.
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unreachable-loop: "error"*/
+
+do {
+    doSomething();
+} while (false)
+
+for (let i = 0; i < 1; i++) {
+    doSomething(i);
+}
+
+for (const a of [1]) {
+    doSomething(a);
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option, with one option:
+
+* `"ignore"` - an optional array of loop types that will be ignored by this rule.
+
+### ignore
+
+You can specify up to 5 different elements in the `"ignore"` array:
+
+* `"WhileStatement"` - to ignore all `while` loops.
+* `"DoWhileStatement"` - to ignore all `do-while` loops.
+* `"ForStatement"` - to ignore all `for` loops (does not apply to `for-in` and `for-of` loops).
+* `"ForInStatement"` - to ignore all `for-in` loops.
+* `"ForOfStatement"` - to ignore all `for-of` loops.
+
+Examples of **correct** code for this rule with the `"ignore"` option:
+
+::: correct
+
+```js
+/*eslint no-unreachable-loop: ["error", { "ignore": ["ForInStatement", "ForOfStatement"] }]*/
+
+for (var key in obj) {
+  hasEnumerableProperties = true;
+  break;
+}
+
+for (const a of b) break;
+```
+
+:::
+
+## Known Limitations
+
+Static code path analysis, in general, does not evaluate conditions. Due to this fact, this rule might miss reporting cases such as the following:
+
+```js
+for (let i = 0; i < 10; i++) {
+    doSomething(i);
+    if (true) {
+        break;
+    }
+}
+```
diff --git a/eslint/docs/src/rules/no-unreachable.md b/eslint/docs/src/rules/no-unreachable.md
new file mode 100644 (file)
index 0000000..456fea4
--- /dev/null
@@ -0,0 +1,163 @@
+---
+title: no-unreachable
+layout: doc
+rule_type: problem
+---
+
+
+
+Because the `return`, `throw`, `break`, and `continue` statements unconditionally exit a block of code, any statements after them cannot be executed. Unreachable statements are usually a mistake.
+
+```js
+function fn() {
+    x = 1;
+    return x;
+    x = 3; // this will never execute
+}
+```
+
+Another kind of mistake is defining instance fields in a subclass whose constructor doesn't call `super()`. Instance fields of a subclass are only added to the instance after `super()`. If there are no `super()` calls, their definitions are never applied and therefore are unreachable code.
+
+```js
+class C extends B {
+    #x; // this will never be added to instances
+
+    constructor() {
+        return {};
+    }
+}
+```
+
+## Rule Details
+
+This rule disallows unreachable code after `return`, `throw`, `continue`, and `break` statements. This rule also flags definitions of instance fields in subclasses whose constructors don't have `super()` calls.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unreachable: "error"*/
+
+function foo() {
+    return true;
+    console.log("done");
+}
+
+function bar() {
+    throw new Error("Oops!");
+    console.log("done");
+}
+
+while(value) {
+    break;
+    console.log("done");
+}
+
+throw new Error("Oops!");
+console.log("done");
+
+function baz() {
+    if (Math.random() < 0.5) {
+        return;
+    } else {
+        throw new Error();
+    }
+    console.log("done");
+}
+
+for (;;) {}
+console.log("done");
+```
+
+:::
+
+Examples of **correct** code for this rule, because of JavaScript function and variable hoisting:
+
+::: correct
+
+```js
+/*eslint no-unreachable: "error"*/
+
+function foo() {
+    return bar();
+    function bar() {
+        return 1;
+    }
+}
+
+function bar() {
+    return x;
+    var x;
+}
+
+switch (foo) {
+    case 1:
+        break;
+        var x;
+}
+```
+
+:::
+
+Examples of additional **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unreachable: "error"*/
+
+class C extends B {
+    #x; // unreachable
+    #y = 1; // unreachable
+    a; // unreachable
+    b = 1; // unreachable
+
+    constructor() {
+        return {};
+    }
+}
+```
+
+:::
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unreachable: "error"*/
+
+class D extends B {
+    #x;
+    #y = 1;
+    a;
+    b = 1;
+
+    constructor() {
+        super();
+    }
+}
+
+class E extends B {
+    #x;
+    #y = 1;
+    a;
+    b = 1;
+
+    // implicit constructor always calls `super()`
+}
+
+class F extends B {
+    static #x;
+    static #y = 1;
+    static a;
+    static b = 1;
+
+    constructor() {
+        return {};
+    }
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-unsafe-finally.md b/eslint/docs/src/rules/no-unsafe-finally.md
new file mode 100644 (file)
index 0000000..a2540a0
--- /dev/null
@@ -0,0 +1,170 @@
+---
+title: no-unsafe-finally
+layout: doc
+rule_type: problem
+---
+
+
+
+JavaScript suspends the control flow statements of `try` and `catch` blocks until the execution of `finally` block finishes. So, when `return`, `throw`, `break`, or `continue` is used in `finally`, control flow statements inside `try` and `catch` are overwritten, which is considered as unexpected behavior. Such as:
+
+```js
+// We expect this function to return 1;
+(() => {
+    try {
+        return 1; // 1 is returned but suspended until finally block ends
+    } catch(err) {
+        return 2;
+    } finally {
+        return 3; // 3 is returned before 1, which we did not expect
+    }
+})();
+
+// > 3
+```
+
+```js
+// We expect this function to throw an error, then return
+(() => {
+    try {
+        throw new Error("Try"); // error is thrown but suspended until finally block ends
+    } finally {
+        return 3; // 3 is returned before the error is thrown, which we did not expect
+    }
+})();
+
+// > 3
+```
+
+```js
+// We expect this function to throw Try(...) error from the catch block
+(() => {
+    try {
+        throw new Error("Try")
+    } catch(err) {
+        throw err; // The error thrown from try block is caught and rethrown
+    } finally {
+        throw new Error("Finally"); // Finally(...) is thrown, which we did not expect
+    }
+})();
+
+// > Uncaught Error: Finally(...)
+```
+
+```js
+// We expect this function to return 0 from try block.
+(() => {
+  label: try {
+    return 0; // 0 is returned but suspended until finally block ends
+  } finally {
+    break label; // It breaks out the try-finally block, before 0 is returned.
+  }
+  return 1;
+})();
+
+// > 1
+```
+
+## Rule Details
+
+This rule disallows `return`, `throw`, `break`, and `continue` statements inside `finally` blocks. It allows indirect usages, such as in `function` or `class` definitions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-finally: "error"*/
+let foo = function() {
+    try {
+        return 1;
+    } catch(err) {
+        return 2;
+    } finally {
+        return 3;
+    }
+};
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-finally: "error"*/
+let foo = function() {
+    try {
+        return 1;
+    } catch(err) {
+        return 2;
+    } finally {
+        throw new Error;
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unsafe-finally: "error"*/
+let foo = function() {
+    try {
+        return 1;
+    } catch(err) {
+        return 2;
+    } finally {
+        console.log("hola!");
+    }
+};
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-unsafe-finally: "error"*/
+let foo = function() {
+    try {
+        return 1;
+    } catch(err) {
+        return 2;
+    } finally {
+        let a = function() {
+            return "hola!";
+        }
+    }
+};
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint no-unsafe-finally: "error"*/
+let foo = function(a) {
+    try {
+        return 1;
+    } catch(err) {
+        return 2;
+    } finally {
+        switch(a) {
+            case 1: {
+                console.log("hola!")
+                break;
+            }
+        }
+    }
+};
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow control flow operations in `finally` blocks, you can turn this rule off.
diff --git a/eslint/docs/src/rules/no-unsafe-negation.md b/eslint/docs/src/rules/no-unsafe-negation.md
new file mode 100644 (file)
index 0000000..1d5a22a
--- /dev/null
@@ -0,0 +1,135 @@
+---
+title: no-unsafe-negation
+layout: doc
+rule_type: problem
+---
+
+
+
+
+
+Just as developers might type `-a + b` when they mean `-(a + b)` for the negative of a sum, they might type `!key in object` by mistake when they almost certainly mean `!(key in object)` to test that a key is not in an object. `!obj instanceof Ctor` is similar.
+
+## Rule Details
+
+This rule disallows negating the left operand of the following relational operators:
+
+* [`in` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in).
+* [`instanceof` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-negation: "error"*/
+
+if (!key in object) {
+    // operator precedence makes it equivalent to (!key) in object
+    // and type conversion makes it equivalent to (key ? "false" : "true") in object
+}
+
+if (!obj instanceof Ctor) {
+    // operator precedence makes it equivalent to (!obj) instanceof Ctor
+    // and it equivalent to always false since boolean values are not objects.
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unsafe-negation: "error"*/
+
+if (!(key in object)) {
+    // key is not in object
+}
+
+if (!(obj instanceof Ctor)) {
+    // obj is not an instance of Ctor
+}
+```
+
+:::
+
+### Exception
+
+For rare situations when negating the left operand is intended, this rule allows an exception.
+If the whole negation is explicitly wrapped in parentheses, the rule will not report a problem.
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unsafe-negation: "error"*/
+
+if ((!foo) in object) {
+    // allowed, because the negation is explicitly wrapped in parentheses
+    // it is equivalent to (foo ? "false" : "true") in object
+    // this is allowed as an exception for rare situations when that is the intended meaning
+}
+
+if(("" + !foo) in object) {
+    // you can also make the intention more explicit, with type conversion
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-negation: "error"*/
+
+if (!(foo) in object) {
+    // this is not an allowed exception
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"enforceForOrderingRelations": false` (default) allows negation of the left-hand side of ordering relational operators (`<`, `>`, `<=`, `>=`)
+* `"enforceForOrderingRelations": true` disallows negation of the left-hand side of ordering relational operators
+
+### enforceForOrderingRelations
+
+With this option set to `true` the rule is additionally enforced for:
+
+* `<` operator.
+* `>` operator.
+* `<=` operator.
+* `>=` operator.
+
+The purpose is to avoid expressions such as `! a < b` (which is equivalent to `(a ? 0 : 1) < b`) when what is really intended is `!(a < b)`.
+
+Examples of additional **incorrect** code for this rule with the `{ "enforceForOrderingRelations": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-negation: ["error", { "enforceForOrderingRelations": true }]*/
+
+if (! a < b) {}
+
+while (! a > b) {}
+
+foo = ! a <= b;
+
+foo = ! a >= b;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify unsafe logical negations, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-unsafe-optional-chaining.md b/eslint/docs/src/rules/no-unsafe-optional-chaining.md
new file mode 100644 (file)
index 0000000..1161acc
--- /dev/null
@@ -0,0 +1,173 @@
+---
+title: no-unsafe-optional-chaining
+layout: doc
+rule_type: problem
+---
+
+
+
+The optional chaining (`?.`) expression can short-circuit with a return value of `undefined`. Therefore, treating an evaluated optional chaining expression as a function, object, number, etc., can cause TypeError or unexpected results. For example:
+
+```js
+var obj = undefined;
+
+1 in obj?.foo;  // TypeError
+with (obj?.foo);  // TypeError
+for (bar of obj?.foo);  // TypeError
+bar instanceof obj?.foo;  // TypeError
+const { bar } = obj?.foo;  // TypeError
+```
+
+Also, parentheses limit the scope of short-circuiting in chains. For example:
+
+```js
+var obj = undefined;
+
+(obj?.foo)(); // TypeError
+(obj?.foo).bar; // TypeError
+```
+
+## Rule Details
+
+This rule aims to detect some cases where the use of optional chaining doesn't prevent runtime errors. In particular, it flags optional chaining expressions in positions where short-circuiting to `undefined` causes throwing a TypeError afterward.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-optional-chaining: "error"*/
+
+(obj?.foo)();
+
+(obj?.foo).bar;
+
+(foo?.()).bar;
+
+(foo?.()).bar();
+
+(obj?.foo ?? obj?.bar)();
+
+(foo || obj?.foo)();
+
+(obj?.foo && foo)();
+
+(foo ? obj?.foo : bar)();
+
+(foo, obj?.bar).baz;
+
+(obj?.foo)`template`;
+
+new (obj?.foo)();
+
+[...obj?.foo];
+
+bar(...obj?.foo);
+
+1 in obj?.foo;
+
+bar instanceof obj?.foo;
+
+for (bar of obj?.foo);
+
+const { bar } = obj?.foo;
+
+[{ bar } = obj?.foo] = [];
+
+with (obj?.foo);
+
+class A extends obj?.foo {}
+
+var a = class A extends obj?.foo {};
+
+async function foo () {
+    const { bar } = await obj?.foo;
+   (await obj?.foo)();
+   (await obj?.foo).bar;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unsafe-optional-chaining: "error"*/
+
+(obj?.foo)?.();
+
+obj?.foo();
+
+(obj?.foo ?? bar)();
+
+obj?.foo.bar;
+
+obj.foo?.bar;
+
+foo?.()?.bar;
+
+(obj?.foo ?? bar)`template`;
+
+new (obj?.foo ?? bar)();
+
+var baz = {...obj?.foo};
+
+const { bar } = obj?.foo || baz;
+
+async function foo () {
+  const { bar } = await obj?.foo || baz;
+   (await obj?.foo)?.();
+   (await obj?.foo)?.bar;
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `disallowArithmeticOperators`: Disallow arithmetic operations on optional chaining expressions (Default `false`). If this is `true`, this rule warns arithmetic operations on optional chaining expressions, which possibly result in `NaN`.
+
+### disallowArithmeticOperators
+
+With this option set to `true` the rule is enforced for:
+
+* Unary operators: `-`, `+`
+* Arithmetic operators: `+`, `-`, `/`, `*`, `%`, `**`
+* Assignment operators: `+=`, `-=`, `/=`, `*=`, `%=`, `**=`
+
+Examples of additional **incorrect** code for this rule with the `{ "disallowArithmeticOperators": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unsafe-optional-chaining: ["error", { "disallowArithmeticOperators": true }]*/
+
++obj?.foo;
+-obj?.foo;
+
+obj?.foo + bar;
+obj?.foo - bar;
+obj?.foo / bar;
+obj?.foo * bar;
+obj?.foo % bar;
+obj?.foo ** bar;
+
+baz += obj?.foo;
+baz -= obj?.foo;
+baz /= obj?.foo;
+baz *= obj?.foo;
+baz %= obj?.foo;
+baz **= obj?.foo;
+
+async function foo () {
+  +await obj?.foo;
+  await obj?.foo + bar;
+  baz += await obj?.foo;
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-unused-expressions.md b/eslint/docs/src/rules/no-unused-expressions.md
new file mode 100644 (file)
index 0000000..cc9f311
--- /dev/null
@@ -0,0 +1,279 @@
+---
+title: no-unused-expressions
+layout: doc
+rule_type: suggestion
+---
+
+
+An unused expression which has no effect on the state of the program indicates a logic error.
+
+For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. Sometimes, such unused expressions may be eliminated by some build tools in production environment, which possibly breaks application logic.
+
+## Rule Details
+
+This rule aims to eliminate unused expressions which have no effect on the state of the program.
+
+This rule does not apply to function calls or constructor calls with the `new` operator, because they could have *side effects* on the state of the program.
+
+```js
+var i = 0;
+function increment() { i += 1; }
+increment(); // return value is unused, but i changed as a side effect
+
+var nThings = 0;
+function Thing() { nThings += 1; }
+new Thing(); // constructed object is unused, but nThings changed as a side effect
+```
+
+This rule does not apply to directives (which are in the form of literal string expressions such as `"use strict";` at the beginning of a script, module, or function).
+
+Sequence expressions (those using a comma, such as `a = 1, b = 2`) are always considered unused unless their return value is assigned or used in a condition evaluation, or a function call is made with the sequence expression value.
+
+## Options
+
+This rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:
+
+* `allowShortCircuit` set to `true` will allow you to use short circuit evaluations in your expressions (Default: `false`).
+* `allowTernary` set to `true` will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: `false`).
+* `allowTaggedTemplates` set to `true` will enable you to use tagged template literals in your expressions (Default: `false`).
+* `enforceForJSX` set to `true` will flag unused JSX element expressions (Default: `false`).
+
+These options allow unused expressions *only if all* of the code paths either directly change the state (for example, assignment statement) or could have *side effects* (for example, function call).
+
+Examples of **incorrect** code for the default `{ "allowShortCircuit": false, "allowTernary": false }` options:
+
+::: incorrect
+
+```js
+/*eslint no-unused-expressions: "error"*/
+
+0
+
+if(0) 0
+
+{0}
+
+f(0), {}
+
+a && b()
+
+a, b()
+
+c = a, b;
+
+a() && function namedFunctionInExpressionContext () {f();}
+
+(function anIncompleteIIFE () {});
+
+injectGlobal`body{ color: red; }`
+
+```
+
+:::
+
+Examples of **correct** code for the default `{ "allowShortCircuit": false, "allowTernary": false }` options:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: "error"*/
+
+{} // In this context, this is a block statement, not an object literal
+
+{myLabel: someVar} // In this context, this is a block statement with a label and expression, not an object literal
+
+function namedFunctionDeclaration () {}
+
+(function aGenuineIIFE () {}());
+
+f()
+
+a = 0
+
+new C
+
+delete a.b
+
+void a
+```
+
+:::
+
+Note that one or more string expression statements (with or without semi-colons) will only be considered as unused if they are not in the beginning of a script, module, or function (alone and uninterrupted by other statements). Otherwise, they will be treated as part of a "directive prologue", a section potentially usable by JavaScript engines. This includes "strict mode" directives.
+
+Examples of **correct** code for this rule in regard to directives:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: "error"*/
+
+"use strict";
+"use asm"
+"use stricter";
+"use babel"
+"any other strings like this in the directive prologue";
+"this is still the directive prologue";
+
+function foo() {
+    "bar";
+}
+
+class Foo {
+    someMethod() {
+        "use strict";
+    }
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule in regard to directives:
+
+::: incorrect
+
+```js
+/*eslint no-unused-expressions: "error"*/
+
+doSomething();
+"use strict"; // this isn't in a directive prologue, because there is a non-directive statement before it
+
+function foo() {
+    "bar" + 1;
+}
+
+class Foo {
+    static {
+        "use strict"; // class static blocks do not have directive prologues
+    }
+}
+```
+
+:::
+
+### allowShortCircuit
+
+Examples of **incorrect** code for the `{ "allowShortCircuit": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
+
+a || b
+```
+
+:::
+
+Examples of **correct** code for the `{ "allowShortCircuit": true }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true }]*/
+
+a && b()
+a() || (b = c)
+```
+
+:::
+
+### allowTernary
+
+Examples of **incorrect** code for the `{ "allowTernary": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
+
+a ? b : 0
+a ? b : c()
+```
+
+:::
+
+Examples of **correct** code for the `{ "allowTernary": true }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowTernary": true }]*/
+
+a ? b() : c()
+a ? (b = c) : d()
+```
+
+:::
+
+### allowShortCircuit and allowTernary
+
+Examples of **correct** code for the `{ "allowShortCircuit": true, "allowTernary": true }` options:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]*/
+
+a ? b() || (c = d) : e()
+```
+
+:::
+
+### allowTaggedTemplates
+
+Examples of **incorrect** code for the `{ "allowTaggedTemplates": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
+
+`some untagged template string`;
+```
+
+:::
+
+Examples of **correct** code for the `{ "allowTaggedTemplates": true }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-expressions: ["error", { "allowTaggedTemplates": true }]*/
+
+tag`some tagged template string`;
+```
+
+:::
+
+### enforceForJSX
+
+JSX is most-commonly used in the React ecosystem, where it is compiled to `React.createElement` expressions. Though free from side-effects, these calls are not automatically flagged by the `no-unused-expression` rule. If you're using React, or any other side-effect-free JSX pragma, this option can be enabled to flag these expressions.
+
+Examples of **incorrect** code for the `{ "enforceForJSX": true }` option:
+
+::: incorrect
+
+```jsx
+/*eslint no-unused-expressions: ["error", { "enforceForJSX": true }]*/
+
+<MyComponent />;
+
+<></>;
+```
+
+:::
+
+Examples of **correct** code for the `{ "enforceForJSX": true }` option:
+
+::: correct
+
+```jsx
+/*eslint no-unused-expressions: ["error", { "enforceForJSX": true }]*/
+
+var myComponentPartial = <MyComponent />;
+
+var myFragment = <></>;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-unused-labels.md b/eslint/docs/src/rules/no-unused-labels.md
new file mode 100644 (file)
index 0000000..2b3ce7c
--- /dev/null
@@ -0,0 +1,82 @@
+---
+title: no-unused-labels
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-extra-label
+- no-labels
+- no-label-var
+---
+
+
+
+
+
+Labels that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring.
+
+```js
+OUTER_LOOP:
+for (const student of students) {
+    if (checkScores(student.scores)) {
+        continue;
+    }
+    doSomething(student);
+}
+```
+
+In this case, probably removing `OUTER_LOOP:` had been forgotten.
+Such labels take up space in the code and can lead to confusion by readers.
+
+## Rule Details
+
+This rule is aimed at eliminating unused labels.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unused-labels: "error"*/
+
+A: var foo = 0;
+
+B: {
+    foo();
+}
+
+C:
+for (let i = 0; i < 10; ++i) {
+    foo();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unused-labels: "error"*/
+
+A: {
+    if (foo()) {
+        break A;
+    }
+    bar();
+}
+
+B:
+for (let i = 0; i < 10; ++i) {
+    if (foo()) {
+        break B;
+    }
+    bar();
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unused labels, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/no-unused-private-class-members.md b/eslint/docs/src/rules/no-unused-private-class-members.md
new file mode 100644 (file)
index 0000000..bd4accb
--- /dev/null
@@ -0,0 +1,91 @@
+---
+title: no-unused-private-class-members
+layout: doc
+rule_type: problem
+---
+
+
+Private class members that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such class members take up space in the code and can lead to confusion by readers.
+
+## Rule Details
+
+This rule reports unused private class members.
+
+* A private field or method is considered to be unused if its value is never read.
+* A private accessor is considered to be unused if it is never accessed (read or write).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unused-private-class-members: "error"*/
+
+class Foo {
+    #unusedMember = 5;
+}
+
+class Foo {
+    #usedOnlyInWrite = 5;
+    method() {
+        this.#usedOnlyInWrite = 42;
+    }
+}
+
+class Foo {
+    #usedOnlyToUpdateItself = 5;
+    method() {
+        this.#usedOnlyToUpdateItself++;
+    }
+}
+
+class Foo {
+    #unusedMethod() {}
+}
+
+class Foo {
+    get #unusedAccessor() {}
+    set #unusedAccessor(value) {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unused-private-class-members: "error"*/
+
+class Foo {
+    #usedMember = 42;
+    method() {
+        return this.#usedMember;
+    }
+}
+
+class Foo {
+    #usedMethod() {
+        return 42;
+    }
+    anotherMethod() {
+        return this.#usedMethod();
+    }
+}
+
+class Foo {
+    get #usedAccessor() {}
+    set #usedAccessor(value) {}
+    
+    method() {
+        this.#usedAccessor = 42;
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unused private class members, you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-unused-vars.md b/eslint/docs/src/rules/no-unused-vars.md
new file mode 100644 (file)
index 0000000..8fd4b68
--- /dev/null
@@ -0,0 +1,401 @@
+---
+title: no-unused-vars
+layout: doc
+rule_type: problem
+---
+
+
+
+Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers.
+
+## Rule Details
+
+This rule is aimed at eliminating unused variables, functions, and function parameters.
+
+A variable `foo` is considered to be used if any of the following are true:
+
+* It is called (`foo()`) or constructed (`new foo()`)
+* It is read (`var bar = foo`)
+* It is passed into a function as an argument (`doSomething(foo)`)
+* It is read inside of a function that is passed to another function (`doSomething(function() { foo(); })`)
+
+A variable is *not* considered to be used if it is only ever declared (`var foo = 5`) or assigned to (`foo = 7`).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-unused-vars: "error"*/
+/*global some_unused_var*/
+
+// It checks variables you have defined as global
+some_unused_var = 42;
+
+var x;
+
+// Write-only variables are not considered as used.
+var y = 10;
+y = 5;
+
+// A read for a modification of itself is not considered as used.
+var z = 0;
+z = z + 1;
+
+// By default, unused arguments cause warnings.
+(function(foo) {
+    return 5;
+})();
+
+// Unused recursive functions also cause warnings.
+function fact(n) {
+    if (n < 2) return 1;
+    return n * fact(n - 1);
+}
+
+// When a function definition destructures an array, unused entries from the array also cause warnings.
+function getY([x, y]) {
+    return y;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: "error"*/
+
+var x = 10;
+alert(x);
+
+// foo is considered used here
+myFunc(function foo() {
+    // ...
+}.bind(this));
+
+(function(foo) {
+    return foo;
+})();
+
+var myFunc;
+myFunc = setTimeout(function() {
+    // myFunc is considered used
+    myFunc();
+}, 50);
+
+// Only the second argument from the destructured array is used.
+function getY([, y]) {
+    return y;
+}
+```
+
+:::
+
+### exported
+
+In environments outside of CommonJS or ECMAScript modules, you may use `var` to create a global variable that may be used by other scripts. You can use the `/* exported variableName */` comment block to indicate that this variable is being exported and therefore should not be considered unused.
+
+Note that `/* exported */` has no effect for any of the following:
+
+* when the environment is `node` or `commonjs`
+* when `parserOptions.sourceType` is `module`
+* when `ecmaFeatures.globalReturn` is `true`
+
+The line comment `// exported variableName` will not work as `exported` is not line-specific.
+
+Examples of **correct** code for `/* exported variableName */` operation:
+
+::: correct
+
+```js
+/* exported global_var */
+
+var global_var = 42;
+```
+
+:::
+
+## Options
+
+This rule takes one argument which can be a string or an object. The string settings are the same as those of the `vars` property (explained below).
+
+By default this rule is enabled with `all` option for variables and `after-used` for arguments.
+
+```json
+{
+    "rules": {
+        "no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
+    }
+}
+```
+
+### vars
+
+The `vars` option has two settings:
+
+* `all` checks all variables for usage, including those in the global scope. This is the default setting.
+* `local` checks only that locally-declared variables are used but will allow global variables to be unused.
+
+#### vars: local
+
+Examples of **correct** code for the `{ "vars": "local" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "vars": "local" }]*/
+/*global some_unused_var */
+
+some_unused_var = 42;
+```
+
+:::
+
+### varsIgnorePattern
+
+The `varsIgnorePattern` option specifies exceptions not to check for usage: variables whose names match a regexp pattern. For example, variables whose names contain `ignored` or `Ignored`.
+
+Examples of **correct** code for the `{ "varsIgnorePattern": "[iI]gnored" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "[iI]gnored" }]*/
+
+var firstVarIgnored = 1;
+var secondVar = 2;
+console.log(secondVar);
+```
+
+:::
+
+### args
+
+The `args` option has three settings:
+
+* `after-used` - unused positional arguments that occur before the last used argument will not be checked, but all named arguments and all positional arguments after the last used argument will be checked.
+* `all` - all named arguments must be used.
+* `none` - do not check arguments.
+
+#### args: after-used
+
+Examples of **incorrect** code for the default `{ "args": "after-used" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-vars: ["error", { "args": "after-used" }]*/
+
+// 2 errors, for the parameters after the last used parameter (bar)
+// "baz" is defined but never used
+// "qux" is defined but never used
+(function(foo, bar, baz, qux) {
+    return bar;
+})();
+```
+
+:::
+
+Examples of **correct** code for the default `{ "args": "after-used" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", {"args": "after-used"}]*/
+
+(function(foo, bar, baz, qux) {
+    return qux;
+})();
+```
+
+:::
+
+#### args: all
+
+Examples of **incorrect** code for the `{ "args": "all" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-vars: ["error", { "args": "all" }]*/
+
+// 2 errors
+// "foo" is defined but never used
+// "baz" is defined but never used
+(function(foo, bar, baz) {
+    return bar;
+})();
+```
+
+:::
+
+#### args: none
+
+Examples of **correct** code for the `{ "args": "none" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "args": "none" }]*/
+
+(function(foo, bar, baz) {
+    return bar;
+})();
+```
+
+:::
+
+### ignoreRestSiblings
+
+The `ignoreRestSiblings` option is a boolean (default: `false`). Using a [Rest Property](https://github.com/tc39/proposal-object-rest-spread) it is possible to "omit" properties from an object, but by default the sibling properties are marked as "unused". With this option enabled the rest property's siblings are ignored.
+
+Examples of **correct** code for the `{ "ignoreRestSiblings": true }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
+// 'foo' and 'bar' were ignored because they have a rest property sibling.
+var { foo, ...coords } = data;
+
+var bar;
+({ bar, ...coords } = data);
+```
+
+:::
+
+### argsIgnorePattern
+
+The `argsIgnorePattern` option specifies exceptions not to check for usage: arguments whose names match a regexp pattern. For example, variables whose names begin with an underscore.
+
+Examples of **correct** code for the `{ "argsIgnorePattern": "^_" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
+
+function foo(x, _y) {
+    return x + 1;
+}
+foo();
+```
+
+:::
+
+### destructuredArrayIgnorePattern
+
+The `destructuredArrayIgnorePattern` option specifies exceptions not to check for usage: elements of array destructuring patterns whose names match a regexp pattern. For example, variables whose names begin with an underscore.
+
+Examples of **correct** code for the `{ "destructuredArrayIgnorePattern": "^_" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "destructuredArrayIgnorePattern": "^_" }]*/
+
+const [a, _b, c] = ["a", "b", "c"];
+console.log(a+c);
+
+const { x: [_a, foo] } = bar;
+console.log(foo);
+
+function baz([_c, x]) {
+    x;
+}
+baz();
+
+function test({p: [_q, r]}) {
+    r;
+}
+test();
+
+let _m, n;
+foo.forEach(item => {
+    [_m, n] = item;
+    console.log(n);
+});
+
+let _o, p;
+_o = 1;
+[_o, p] = foo;
+p;
+```
+
+:::
+
+### caughtErrors
+
+The `caughtErrors` option is used for `catch` block arguments validation.
+
+It has two settings:
+
+* `none` - do not check error objects. This is the default setting.
+* `all` - all named arguments must be used.
+
+#### caughtErrors: none
+
+Not specifying this rule is equivalent of assigning it to `none`.
+
+Examples of **correct** code for the `{ "caughtErrors": "none" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "caughtErrors": "none" }]*/
+
+try {
+    //...
+} catch (err) {
+    console.error("errors");
+}
+```
+
+:::
+
+#### caughtErrors: all
+
+Examples of **incorrect** code for the `{ "caughtErrors": "all" }` option:
+
+::: incorrect
+
+```js
+/*eslint no-unused-vars: ["error", { "caughtErrors": "all" }]*/
+
+// 1 error
+// "err" is defined but never used
+try {
+    //...
+} catch (err) {
+    console.error("errors");
+}
+```
+
+:::
+
+### caughtErrorsIgnorePattern
+
+The `caughtErrorsIgnorePattern` option specifies exceptions not to check for usage: catch arguments whose names match a regexp pattern. For example, variables whose names begin with a string 'ignore'.
+
+Examples of **correct** code for the `{ "caughtErrorsIgnorePattern": "^ignore" }` option:
+
+::: correct
+
+```js
+/*eslint no-unused-vars: ["error", { "caughtErrorsIgnorePattern": "^ignore" }]*/
+
+try {
+    //...
+} catch (ignoreErr) {
+    console.error("errors");
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unused variables or function arguments, you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/no-use-before-define.md b/eslint/docs/src/rules/no-use-before-define.md
new file mode 100644 (file)
index 0000000..9c71d09
--- /dev/null
@@ -0,0 +1,353 @@
+---
+title: no-use-before-define
+layout: doc
+rule_type: problem
+---
+
+
+In JavaScript, prior to ES6, variable and function declarations are hoisted to the top of a scope, so it's possible to use identifiers before their formal declarations in code. This can be confusing and some believe it is best to always declare variables and functions before using them.
+
+In ES6, block-level bindings (`let` and `const`) introduce a "temporal dead zone" where a `ReferenceError` will be thrown with any attempt to access the variable before its declaration.
+
+## Rule Details
+
+This rule will warn when it encounters a reference to an identifier that has not yet been declared.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-use-before-define: "error"*/
+
+alert(a);
+var a = 10;
+
+f();
+function f() {}
+
+function g() {
+    return b;
+}
+var b = 1;
+
+{
+    alert(c);
+    let c = 1;
+}
+
+{
+    class C extends C {}
+}
+
+{
+    class C {
+        static x = "foo";
+        [C.x]() {}
+    }
+}
+
+{
+    const C = class {
+        static x = C;
+    }
+}
+
+{
+    const C = class {
+        static {
+            C.x = "foo";
+        }
+    }
+}
+
+export { foo };
+const foo = 1;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-use-before-define: "error"*/
+
+var a;
+a = 10;
+alert(a);
+
+function f() {}
+f(1);
+
+var b = 1;
+function g() {
+    return b;
+}
+
+{
+    let c;
+    c++;
+}
+
+{
+    class C {
+        static x = C;
+    }
+}
+
+{
+    const C = class C {
+        static x = C;
+    }
+}
+
+{
+    const C = class {
+        x = C;
+    }
+}
+
+{
+    const C = class C {
+        static {
+            C.x = "foo";
+        }
+    }
+}
+
+const foo = 1;
+export { foo };
+```
+
+:::
+
+## Options
+
+```json
+{
+    "no-use-before-define": ["error", {
+        "functions": true,
+        "classes": true,
+        "variables": true,
+        "allowNamedExports": false
+    }]
+}
+```
+
+* `functions` (`boolean`) -
+  The flag which shows whether or not this rule checks function declarations.
+  If this is `true`, this rule warns every reference to a function before the function declaration.
+  Otherwise, ignores those references.
+  Function declarations are hoisted, so it's safe.
+  Default is `true`.
+* `classes` (`boolean`) -
+  The flag which shows whether or not this rule checks class declarations of upper scopes.
+  If this is `true`, this rule warns every reference to a class before the class declaration.
+  Otherwise, ignores those references if the declaration is in upper function scopes.
+  Class declarations are not hoisted, so it might be danger.
+  Default is `true`.
+* `variables` (`boolean`) -
+  This flag determines whether or not the rule checks variable declarations in upper scopes.
+  If this is `true`, the rule warns every reference to a variable before the variable declaration.
+  Otherwise, the rule ignores a reference if the declaration is in an upper scope, while still reporting the reference if it's in the same scope as the declaration.
+  Default is `true`.
+* `allowNamedExports` (`boolean`) -
+  If this flag is set to `true`, the rule always allows references in `export {};` declarations.
+  These references are safe even if the variables are declared later in the code.
+  Default is `false`.
+
+This rule accepts `"nofunc"` string as an option.
+`"nofunc"` is the same as `{ "functions": false, "classes": true, "variables": true, "allowNamedExports": false }`.
+
+### functions
+
+Examples of **correct** code for the `{ "functions": false }` option:
+
+::: correct
+
+```js
+/*eslint no-use-before-define: ["error", { "functions": false }]*/
+
+f();
+function f() {}
+```
+
+:::
+
+This option allows references to function declarations. For function expressions and arrow functions, please see the [`variables`](#variables) option.
+
+### classes
+
+Examples of **incorrect** code for the `{ "classes": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-use-before-define: ["error", { "classes": false }]*/
+
+new A();
+class A {
+}
+
+{
+    class C extends C {}
+}
+
+{
+    class C extends D {}
+    class D {}
+}
+
+{
+    class C {
+        static x = "foo";
+        [C.x]() {}
+    }
+}
+
+{
+    class C {
+        static {
+            new D();
+        }
+    }
+    class D {}
+}
+```
+
+:::
+
+Examples of **correct** code for the `{ "classes": false }` option:
+
+::: correct
+
+```js
+/*eslint no-use-before-define: ["error", { "classes": false }]*/
+
+function foo() {
+    return new A();
+}
+
+class A {
+}
+```
+
+:::
+
+### variables
+
+Examples of **incorrect** code for the `{ "variables": false }` option:
+
+::: incorrect
+
+```js
+/*eslint no-use-before-define: ["error", { "variables": false }]*/
+
+console.log(foo);
+var foo = 1;
+
+f();
+const f = () => {};
+
+g();
+const g = function() {};
+
+{
+    const C = class {
+        static x = C;
+    }
+}
+
+{
+    const C = class {
+        static x = foo;
+    }
+    const foo = 1;
+}
+
+{
+    class C {
+        static {
+            this.x = foo;
+        }
+    }
+    const foo = 1;
+}
+```
+
+:::
+
+Examples of **correct** code for the `{ "variables": false }` option:
+
+::: correct
+
+```js
+/*eslint no-use-before-define: ["error", { "variables": false }]*/
+
+function baz() {
+    console.log(foo);
+}
+var foo = 1;
+
+const a = () => f();
+function b() { return f(); }
+const c = function() { return f(); }
+const f = () => {};
+
+const e = function() { return g(); }
+const g = function() {}
+
+{
+    const C = class {
+        x = foo;
+    }
+    const foo = 1;
+}
+```
+
+:::
+
+### allowNamedExports
+
+Examples of **correct** code for the `{ "allowNamedExports": true }` option:
+
+::: correct
+
+```js
+/*eslint no-use-before-define: ["error", { "allowNamedExports": true }]*/
+
+export { a, b, f, C };
+
+const a = 1;
+
+let b;
+
+function f () {}
+
+class C {}
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "allowNamedExports": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-use-before-define: ["error", { "allowNamedExports": true }]*/
+
+export default a;
+const a = 1;
+
+const b = c;
+export const c = 1;
+
+export function foo() {
+    return d;
+}
+const d = 1;
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-useless-backreference.md b/eslint/docs/src/rules/no-useless-backreference.md
new file mode 100644 (file)
index 0000000..e534ada
--- /dev/null
@@ -0,0 +1,144 @@
+---
+title: no-useless-backreference
+layout: doc
+rule_type: problem
+related_rules:
+- no-control-regex
+- no-empty-character-class
+- no-invalid-regexp
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
+---
+
+
+
+In JavaScript regular expressions, it's syntactically valid to define a backreference to a group that belongs to another alternative part of the pattern, a backreference to a group that appears after the backreference, a backreference to a group that contains that backreference, or a backreference to a group that is inside a negative lookaround. However, by the specification, in any of these cases the backreference always ends up matching only zero-length (the empty string), regardless of the context in which the backreference and the group appear.
+
+Backreferences that always successfully match zero-length and cannot match anything else are useless. They are basically ignored and can be removed without changing the behavior of the regular expression.
+
+```js
+var regex = /^(?:(a)|\1b)$/;
+
+regex.test("a"); // true
+regex.test("b"); // true!
+regex.test("ab"); // false
+
+var equivalentRegex = /^(?:(a)|b)$/;
+
+equivalentRegex.test("a"); // true
+equivalentRegex.test("b"); // true
+equivalentRegex.test("ab"); // false
+```
+
+Useless backreference is a possible error in the code. It usually indicates that the regular expression does not work as intended.
+
+## Rule Details
+
+This rule aims to detect and disallow the following backreferences in regular expression:
+
+* Backreference to a group that is in another alternative, e.g., `/(a)|\1b/`. In such constructed regular expression, the backreference is expected to match what's been captured in, at that point, a non-participating group.
+* Backreference to a group that appears later in the pattern, e.g., `/\1(a)/`. The group hasn't captured anything yet, and ECMAScript doesn't support forward references. Inside lookbehinds, which match backward, the opposite applies and this rule disallows backreference to a group that appears before in the same lookbehind, e.g., `/(?<=(a)\1)b/`.
+* Backreference to a group from within the same group, e.g., `/(\1)/`. Similar to the previous, the group hasn't captured anything yet, and ECMAScript doesn't support nested references.
+* Backreference to a group that is in a negative lookaround, if the backreference isn't in the same negative lookaround, e.g., `/a(?!(b)).\1/`. A negative lookaround (lookahead or lookbehind) succeeds only if its pattern cannot match, meaning that the group has failed.
+
+By the ECMAScript specification, all backreferences listed above are valid, always succeed to match zero-length, and cannot match anything else. Consequently, they don't produce parsing or runtime errors, but also don't affect the behavior of their regular expressions. They are syntactically valid but useless.
+
+This might be surprising to developers coming from other languages where some of these backreferences can be used in a meaningful way.
+
+```js
+// in some other languages, this pattern would successfully match "aab"
+
+/^(?:(a)(?=a)|\1b)+$/.test("aab"); // false
+```
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-backreference: "error"*/
+
+/^(?:(a)|\1b)$/; // reference to (a) into another alternative
+
+/^(?:(a)|b(?:c|\1))$/; // reference to (a) into another alternative
+
+/^(?:a|b(?:(c)|\1))$/; // reference to (c) into another alternative
+
+/\1(a)/; // forward reference to (a)
+
+RegExp('(a)\\2(b)'); // forward reference to (b)
+
+/(?:a)(b)\2(c)/; // forward reference to (c)
+
+/\k<foo>(?<foo>a)/; // forward reference to (?<foo>a)
+
+/(?<=(a)\1)b/; // backward reference to (a) from within the same lookbehind
+
+/(?<!(a)\1)b/; // backward reference to (a) from within the same lookbehind
+
+new RegExp('(\\1)'); // nested reference to (\1)
+
+/^((a)\1)$/; // nested reference to ((a)\1)
+
+/a(?<foo>(.)b\1)/; // nested reference to (?<foo>(.)b\1)
+
+/a(?!(b)).\1/; // reference to (b) into a negative lookahead
+
+/(?<!(a))b\1/; // reference to (a) into a negative lookbehind
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-backreference: "error"*/
+
+/^(?:(a)|(b)\2)$/; // reference to (b)
+
+/(a)\1/; // reference to (a)
+
+RegExp('(a)\\1(b)'); // reference to (a)
+
+/(a)(b)\2(c)/; // reference to (b)
+
+/(?<foo>a)\k<foo>/; // reference to (?<foo>a)
+
+/(?<=\1(a))b/; // reference to (a), correctly before the group as they're in the same lookbehind
+
+/(?<=(a))b\1/; // reference to (a), correctly after the group as the backreference isn't in the lookbehind
+
+new RegExp('(.)\\1'); // reference to (.)
+
+/^(?:(a)\1)$/; // reference to (a)
+
+/^((a)\2)$/; // reference to (a)
+
+/a(?<foo>(.)b\2)/; // reference to (.)
+
+/a(?!(b|c)\1)./; // reference to (b|c), correct as it's from within the same negative lookahead
+
+/(?<!\1(a))b/; // reference to (a), correct as it's from within the same negative lookbehind
+```
+
+:::
+
+Please note that this rule does not aim to detect and disallow a potentially erroneous use of backreference syntax in regular expressions, like the use in character classes or an attempt to reference a group that doesn't exist. Depending on the context, a `\1`...`\9` sequence that is not a syntactically valid backreference may produce syntax error, or be parsed as something else (e.g., as a legacy octal escape sequence).
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-backreference: "error"*/
+
+// comments describe behavior in a browser
+
+/^[\1](a)$/.test("\x01a"); // true. In a character class, \1 is treated as an octal escape sequence.
+/^\1$/.test("\x01"); // true. Since the group 1 doesn't exist, \1 is treated as an octal escape sequence.
+/^(a)\1\2$/.test("aa\x02"); // true. In this case, \1 is a backreference, \2 is an octal escape sequence.
+```
+
+:::
diff --git a/eslint/docs/src/rules/no-useless-call.md b/eslint/docs/src/rules/no-useless-call.md
new file mode 100644 (file)
index 0000000..65691d6
--- /dev/null
@@ -0,0 +1,92 @@
+---
+title: no-useless-call
+layout: doc
+rule_type: suggestion
+related_rules:
+- prefer-spread
+---
+
+
+The function invocation can be written by `Function.prototype.call()` and `Function.prototype.apply()`.
+But `Function.prototype.call()` and `Function.prototype.apply()` are slower than the normal function invocation.
+
+## Rule Details
+
+This rule is aimed to flag usage of `Function.prototype.call()` and `Function.prototype.apply()` that can be replaced with the normal function invocation.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-call: "error"*/
+
+// These are same as `foo(1, 2, 3);`
+foo.call(undefined, 1, 2, 3);
+foo.apply(undefined, [1, 2, 3]);
+foo.call(null, 1, 2, 3);
+foo.apply(null, [1, 2, 3]);
+
+// These are same as `obj.foo(1, 2, 3);`
+obj.foo.call(obj, 1, 2, 3);
+obj.foo.apply(obj, [1, 2, 3]);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-call: "error"*/
+
+// The `this` binding is different.
+foo.call(obj, 1, 2, 3);
+foo.apply(obj, [1, 2, 3]);
+obj.foo.call(null, 1, 2, 3);
+obj.foo.apply(null, [1, 2, 3]);
+obj.foo.call(otherObj, 1, 2, 3);
+obj.foo.apply(otherObj, [1, 2, 3]);
+
+// The argument list is variadic.
+// Those are warned by the `prefer-spread` rule.
+foo.apply(undefined, args);
+foo.apply(null, args);
+obj.foo.apply(obj, args);
+```
+
+:::
+
+## Known Limitations
+
+This rule compares code statically to check whether or not `thisArg` is changed.
+So if the code about `thisArg` is a dynamic expression, this rule cannot judge correctly.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-call: "error"*/
+
+a[i++].foo.call(a[i++], 1, 2, 3);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-call: "error"*/
+
+a[++i].foo.call(a[i], 1, 2, 3);
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary `.call()` and `.apply()`, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-catch.md b/eslint/docs/src/rules/no-useless-catch.md
new file mode 100644 (file)
index 0000000..ee53ab6
--- /dev/null
@@ -0,0 +1,70 @@
+---
+title: no-useless-catch
+layout: doc
+rule_type: suggestion
+---
+
+
+
+A `catch` clause that only rethrows the original error is redundant, and has no effect on the runtime behavior of the program. These redundant clauses can be a source of confusion and code bloat, so it's better to disallow these unnecessary `catch` clauses.
+
+## Rule Details
+
+This rule reports `catch` clauses that only `throw` the caught error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-catch: "error"*/
+
+try {
+  doSomethingThatMightThrow();
+} catch (e) {
+  throw e;
+}
+
+try {
+  doSomethingThatMightThrow();
+} catch (e) {
+  throw e;
+} finally {
+  cleanUp();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-catch: "error"*/
+
+try {
+  doSomethingThatMightThrow();
+} catch (e) {
+  doSomethingBeforeRethrow();
+  throw e;
+}
+
+try {
+  doSomethingThatMightThrow();
+} catch (e) {
+  handleError(e);
+}
+
+try {
+  doSomethingThatMightThrow();
+} finally {
+  cleanUp();
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary catch clauses, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-computed-key.md b/eslint/docs/src/rules/no-useless-computed-key.md
new file mode 100644 (file)
index 0000000..2516d19
--- /dev/null
@@ -0,0 +1,156 @@
+---
+title: no-useless-computed-key
+layout: doc
+rule_type: suggestion
+---
+
+
+
+It's unnecessary to use computed properties with literals such as:
+
+```js
+var foo = {["a"]: "b"};
+```
+
+The code can be rewritten as:
+
+```js
+var foo = {"a": "b"};
+```
+
+## Rule Details
+
+This rule disallows unnecessary usage of computed property keys.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-computed-key: "error"*/
+
+var a = { ['0']: 0 };
+var a = { ['0+1,234']: 0 };
+var a = { [0]: 0 };
+var a = { ['x']: 0 };
+var a = { ['x']() {} };
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-computed-key: "error"*/
+
+var c = { 'a': 0 };
+var c = { 0: 0 };
+var a = { x() {} };
+var c = { a: 0 };
+var c = { '0+1,234': 0 };
+```
+
+:::
+
+Examples of additional **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-computed-key: "error"*/
+
+var c = {
+    "__proto__": foo, // defines object's prototype
+
+    ["__proto__"]: bar // defines a property named "__proto__"
+};
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `enforceForClassMembers` set to `true` additionally applies this rule to class members (Default `false`).
+
+### enforceForClassMembers
+
+By default, this rule does not check class declarations and class expressions,
+as the default value for `enforceForClassMembers` is `false`.
+
+When `enforceForClassMembers` is set to `true`, the rule will also disallow unnecessary computed keys inside of class fields, class methods, class getters, and class setters.
+
+Examples of **incorrect** code for this rule with the `{ "enforceForClassMembers": true }` option:
+
+::: incorrect
+
+```js
+/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
+
+class Foo {
+    ["foo"] = "bar";
+
+    [0]() {}
+    ['a']() {}
+    get ['b']() {}
+    set ['c'](value) {}
+
+    static ["foo"] = "bar";
+
+    static ['a']() {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "enforceForClassMembers": true }` option:
+
+::: correct
+
+```js
+/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
+
+class Foo {
+    "foo" = "bar";
+
+    0() {}
+    'a'() {}
+    get 'b'() {}
+    set 'c'(value) {}
+
+    static "foo" = "bar";
+
+    static 'a'() {}
+}
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "enforceForClassMembers": true }` option:
+
+::: correct
+
+```js
+/*eslint no-useless-computed-key: ["error", { "enforceForClassMembers": true }]*/
+
+class Foo {
+    ["constructor"]; // instance field named "constructor"
+
+    "constructor"() {} // the constructor of this class
+
+    ["constructor"]() {} // method named "constructor"
+
+    static ["constructor"]; // static field named "constructor"
+
+    static ["prototype"]; // runtime error, it would be a parsing error without `[]`
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary computed property keys, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-concat.md b/eslint/docs/src/rules/no-useless-concat.md
new file mode 100644 (file)
index 0000000..63062a2
--- /dev/null
@@ -0,0 +1,64 @@
+---
+title: no-useless-concat
+layout: doc
+rule_type: suggestion
+---
+
+
+It's unnecessary to concatenate two strings together, such as:
+
+```js
+var foo = "a" + "b";
+```
+
+This code is likely the result of refactoring where a variable was removed from the concatenation (such as `"a" + b + "b"`). In such a case, the concatenation isn't important and the code can be rewritten as:
+
+```js
+var foo = "ab";
+```
+
+## Rule Details
+
+This rule aims to flag the concatenation of 2 literals when they could be combined into a single literal. Literals can be strings or template literals.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-concat: "error"*/
+/*eslint-env es6*/
+
+var a = `some` + `string`;
+
+// these are the same as "10"
+var a = '1' + '0';
+var a = '1' + `0`;
+var a = `1` + '0';
+var a = `1` + `0`;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-concat: "error"*/
+
+// when a non string is included
+var c = a + b;
+var c = '1' + a;
+var a = 1 + '1';
+var c = 1 - 2;
+// when the string concatenation is multiline
+var c = "foo" +
+    "bar";
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary string concatenation, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-constructor.md b/eslint/docs/src/rules/no-useless-constructor.md
new file mode 100644 (file)
index 0000000..b01a86d
--- /dev/null
@@ -0,0 +1,84 @@
+---
+title: no-useless-constructor
+layout: doc
+rule_type: suggestion
+---
+
+
+ES2015 provides a default class constructor if one is not specified. As such, it is unnecessary to provide an empty constructor or one that simply delegates into its parent class, as in the following examples:
+
+```js
+class A {
+    constructor () {
+    }
+}
+
+class B extends A {
+    constructor (value) {
+      super(value);
+    }
+}
+```
+
+## Rule Details
+
+This rule flags class constructors that can be safely removed without changing how the class works.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-constructor: "error"*/
+/*eslint-env es6*/
+
+class A {
+    constructor () {
+    }
+}
+
+class B extends A {
+    constructor (...args) {
+      super(...args);
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-constructor: "error"*/
+
+class A { }
+
+class A {
+    constructor () {
+        doSomething();
+    }
+}
+
+class B extends A {
+    constructor() {
+        super('foo');
+    }
+}
+
+class B extends A {
+    constructor() {
+        super();
+        doSomething();
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary constructors, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-escape.md b/eslint/docs/src/rules/no-useless-escape.md
new file mode 100644 (file)
index 0000000..46add21
--- /dev/null
@@ -0,0 +1,73 @@
+---
+title: no-useless-escape
+layout: doc
+rule_type: suggestion
+---
+
+
+
+
+
+Escaping non-special characters in strings, template literals, and regular expressions doesn't have any effect, as demonstrated in the following example:
+
+```js
+let foo = "hol\a"; // > foo = "hola"
+let bar = `${foo}\!`; // > bar = "hola!"
+let baz = /\:/ // same functionality with /:/
+```
+
+## Rule Details
+
+This rule flags escapes that can be safely removed without changing behavior.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-useless-escape: "error"*/
+
+"\'";
+'\"';
+"\#";
+"\e";
+`\"`;
+`\"${foo}\"`;
+`\#{foo}`;
+/\!/;
+/\@/;
+/[\[]/;
+/[a-z\-]/;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-useless-escape: "error"*/
+
+"\"";
+'\'';
+"\x12";
+"\u00a9";
+"\371";
+"xs\u2111";
+`\``;
+`\${${foo}}`;
+`$\{${foo}}`;
+/\\/g;
+/\t/g;
+/\w\$\*\^\./;
+/[[]/;
+/[\]]/;
+/[a-z-]/;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about unnecessary escapes, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/no-useless-rename.md b/eslint/docs/src/rules/no-useless-rename.md
new file mode 100644 (file)
index 0000000..73a5c79
--- /dev/null
@@ -0,0 +1,154 @@
+---
+title: no-useless-rename
+layout: doc
+rule_type: suggestion
+related_rules:
+- object-shorthand
+---
+
+
+
+ES2015 allows for the renaming of references in import and export statements as well as destructuring assignments. This gives programmers a concise syntax for performing these operations while renaming these references:
+
+```js
+import { foo as bar } from "baz";
+export { foo as bar };
+let { foo: bar } = baz;
+```
+
+With this syntax, it is possible to rename a reference to the same name. This is a completely redundant operation, as this is the same as not renaming at all. For example, this:
+
+```js
+import { foo as foo } from "bar";
+export { foo as foo };
+let { foo: foo } = bar;
+```
+
+is the same as:
+
+```js
+import { foo } from "bar";
+export { foo };
+let { foo } = bar;
+```
+
+## Rule Details
+
+This rule disallows the renaming of import, export, and destructured assignments to the same name.
+
+## Options
+
+This rule allows for more fine-grained control with the following options:
+
+* `ignoreImport`: When set to `true`, this rule does not check imports
+* `ignoreExport`: When set to `true`, this rule does not check exports
+* `ignoreDestructuring`: When set to `true`, this rule does not check destructuring assignments
+
+By default, all options are set to `false`:
+
+```json
+"no-useless-rename": ["error", {
+    "ignoreDestructuring": false,
+    "ignoreImport": false,
+    "ignoreExport": false
+}]
+```
+
+Examples of **incorrect** code for this rule by default:
+
+::: incorrect
+
+```js
+/*eslint no-useless-rename: "error"*/
+
+import { foo as foo } from "bar";
+import { "foo" as foo } from "bar";
+export { foo as foo };
+export { foo as "foo" };
+export { foo as foo } from "bar";
+export { "foo" as "foo" } from "bar";
+let { foo: foo } = bar;
+let { 'foo': foo } = bar;
+function foo({ bar: bar }) {}
+({ foo: foo }) => {}
+```
+
+:::
+
+Examples of **correct** code for this rule by default:
+
+::: correct
+
+```js
+/*eslint no-useless-rename: "error"*/
+
+import * as foo from "foo";
+import { foo } from "bar";
+import { foo as bar } from "baz";
+import { "foo" as bar } from "baz";
+
+export { foo };
+export { foo as bar };
+export { foo as "bar" };
+export { foo as bar } from "foo";
+export { "foo" as "bar" } from "foo";
+
+let { foo } = bar;
+let { foo: bar } = baz;
+let { [foo]: foo } = bar;
+
+function foo({ bar }) {}
+function foo({ bar: baz }) {}
+
+({ foo }) => {}
+({ foo: bar }) => {}
+```
+
+:::
+
+Examples of **correct** code for this rule with `{ ignoreImport: true }`:
+
+::: correct
+
+```js
+/*eslint no-useless-rename: ["error", { ignoreImport: true }]*/
+
+import { foo as foo } from "bar";
+```
+
+:::
+
+Examples of **correct** code for this rule with `{ ignoreExport: true }`:
+
+::: correct
+
+```js
+/*eslint no-useless-rename: ["error", { ignoreExport: true }]*/
+
+export { foo as foo };
+export { foo as foo } from "bar";
+```
+
+:::
+
+Examples of **correct** code for this rule with `{ ignoreDestructuring: true }`:
+
+::: correct
+
+```js
+/*eslint no-useless-rename: ["error", { ignoreDestructuring: true }]*/
+
+let { foo: foo } = bar;
+function foo({ bar: bar }) {}
+({ foo: foo }) => {}
+```
+
+:::
+
+## When Not To Use It
+
+You can safely disable this rule if you do not care about redundantly renaming import, export, and destructuring assignments.
+
+## Compatibility
+
+* **JSCS**: [disallowIdenticalDestructuringNames](https://jscs-dev.github.io/rule/disallowIdenticalDestructuringNames)
diff --git a/eslint/docs/src/rules/no-useless-return.md b/eslint/docs/src/rules/no-useless-return.md
new file mode 100644 (file)
index 0000000..fa82a2f
--- /dev/null
@@ -0,0 +1,97 @@
+---
+title: no-useless-return
+layout: doc
+rule_type: suggestion
+---
+
+
+
+A `return;` statement with nothing after it is redundant, and has no effect on the runtime behavior of a function. This can be confusing, so it's better to disallow these redundant statements.
+
+## Rule Details
+
+This rule aims to report redundant `return` statements.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint no-useless-return: "error" */
+
+function foo() { return; }
+
+function foo() {
+  doSomething();
+  return;
+}
+
+function foo() {
+  if (condition) {
+    bar();
+    return;
+  } else {
+    baz();
+  }
+}
+
+function foo() {
+  switch (bar) {
+    case 1:
+      doSomething();
+    default:
+      doSomethingElse();
+      return;
+  }
+}
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint no-useless-return: "error" */
+
+function foo() { return 5; }
+
+function foo() {
+  return doSomething();
+}
+
+function foo() {
+  if (condition) {
+    bar();
+    return;
+  } else {
+    baz();
+  }
+  qux();
+}
+
+function foo() {
+  switch (bar) {
+    case 1:
+      doSomething();
+      return;
+    default:
+      doSomethingElse();
+  }
+}
+
+function foo() {
+  for (const foo of bar) {
+    return;
+  }
+}
+
+```
+
+:::
+
+## When Not To Use It
+
+If you don't care about disallowing redundant return statements, you can turn off this rule.
diff --git a/eslint/docs/src/rules/no-var.md b/eslint/docs/src/rules/no-var.md
new file mode 100644 (file)
index 0000000..7ddd173
--- /dev/null
@@ -0,0 +1,62 @@
+---
+title: no-var
+layout: doc
+rule_type: suggestion
+---
+
+
+
+ECMAScript 6 allows programmers to create variables with block scope instead of function scope using the `let`
+and `const` keywords. Block scope is common in many other programming languages and helps programmers avoid mistakes
+such as:
+
+```js
+var count = people.length;
+var enoughFood = count > sandwiches.length;
+
+if (enoughFood) {
+    var count = sandwiches.length; // accidentally overriding the count variable
+    console.log("We have " + count + " sandwiches for everyone. Plenty for all!");
+}
+
+// our count variable is no longer accurate
+console.log("We have " + count + " people and " + sandwiches.length + " sandwiches!");
+```
+
+## Rule Details
+
+This rule is aimed at discouraging the use of `var` and encouraging the use of `const` or `let` instead.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-var: "error"*/
+
+var x = "y";
+var CONFIG = {};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-var: "error"*/
+/*eslint-env es6*/
+
+let x = "y";
+const CONFIG = {};
+```
+
+:::
+
+## When Not To Use It
+
+In addition to non-ES6 environments, existing JavaScript projects that are beginning to introduce ES6 into their
+codebase may not want to apply this rule if the cost of migrating from `var` to `let` is too costly.
diff --git a/eslint/docs/src/rules/no-void.md b/eslint/docs/src/rules/no-void.md
new file mode 100644 (file)
index 0000000..5f9d24d
--- /dev/null
@@ -0,0 +1,120 @@
+---
+title: no-void
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-undef-init
+- no-undefined
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void
+- https://oreilly.com/javascript/excerpts/javascript-good-parts/bad-parts.html
+---
+
+
+The `void` operator takes an operand and returns `undefined`: `void expression` will evaluate `expression` and return `undefined`. It can be used to ignore any side effects `expression` may produce:
+
+The common case of using `void` operator is to get a "pure" `undefined` value as prior to ES5 the `undefined` variable was mutable:
+
+```js
+// will always return undefined
+(function(){
+    return void 0;
+})();
+
+// will return 1 in ES3 and undefined in ES5+
+(function(){
+    undefined = 1;
+    return undefined;
+})();
+
+// will throw TypeError in ES5+
+(function(){
+    'use strict';
+    undefined = 1;
+})();
+```
+
+Another common case is to minify code as `void 0` is shorter than `undefined`:
+
+```js
+foo = void 0;
+foo = undefined;
+```
+
+When used with IIFE (immediately-invoked function expression), `void` can be used to force the function keyword to be treated as an expression instead of a declaration:
+
+```js
+var foo = 1;
+void function(){ foo = 1; }() // will assign foo a value of 1
++function(){ foo = 1; }() // same as above
+```
+
+```js
+function(){ foo = 1; }() // will throw SyntaxError
+```
+
+Some code styles prohibit `void` operator, marking it as non-obvious and hard to read.
+
+## Rule Details
+
+This rule aims to eliminate use of void operator.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-void: "error"*/
+
+void foo
+void someFunction();
+
+var foo = void bar();
+function baz() {
+    return void 0;
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `allowAsStatement` set to `true` allows the void operator to be used as a statement (Default `false`).
+
+### allowAsStatement
+
+When `allowAsStatement` is set to true, the rule will not error on cases that the void operator is used as a statement, i.e. when it's not used in an expression position, like in a variable assignment or a function return.
+
+Examples of **incorrect** code for `{ "allowAsStatement": true }`:
+
+::: incorrect
+
+```js
+/*eslint no-void: ["error", { "allowAsStatement": true }]*/
+
+var foo = void bar();
+function baz() {
+    return void 0;
+}
+```
+
+:::
+
+Examples of **correct** code for `{ "allowAsStatement": true }`:
+
+::: correct
+
+```js
+/*eslint no-void: ["error", { "allowAsStatement": true }]*/
+
+void foo;
+void someFunction();
+```
+
+:::
+
+## When Not To Use It
+
+If you intentionally use the `void` operator then you can disable this rule.
diff --git a/eslint/docs/src/rules/no-warning-comments.md b/eslint/docs/src/rules/no-warning-comments.md
new file mode 100644 (file)
index 0000000..e3f65af
--- /dev/null
@@ -0,0 +1,158 @@
+---
+title: no-warning-comments
+layout: doc
+rule_type: suggestion
+---
+
+
+Developers often add comments to code which is not complete or needs review. Most likely you want to fix or review the code, and then remove the comment, before you consider the code to be production ready.
+
+```js
+// TODO: do something
+// FIXME: this is not a good idea
+```
+
+## Rule Details
+
+This rule reports comments that include any of the predefined terms specified in its configuration.
+
+## Options
+
+This rule has an options object literal:
+
+* `"terms"`: optional array of terms to match. Defaults to `["todo", "fixme", "xxx"]`. Terms are matched case-insensitively and as whole words: `fix` would match `FIX` but not `fixing`. Terms can consist of multiple words: `really bad idea`.
+* `"location"`: optional string that configures where in your comments to check for matches. Defaults to `"start"`. The start is from the first non-decorative character, ignoring whitespace, new lines and characters specified in `decoration`. The other value is match `anywhere` in comments.
+* `"decoration"`: optional array of characters that are ignored at the start of a comment, when location is `"start"`. Defaults to `[]`. Any sequence of whitespace or the characters from this property are ignored. This option is ignored when location is `"anywhere"`.
+
+Example of **incorrect** code for the default `{ "terms": ["todo", "fixme", "xxx"], "location": "start" }` options:
+
+::: incorrect
+
+```js
+/*eslint no-warning-comments: "error"*/
+
+/*
+FIXME
+*/
+function callback(err, results) {
+  if (err) {
+    console.error(err);
+    return;
+  }
+  // TODO
+}
+```
+
+:::
+
+Example of **correct** code for the default `{ "terms": ["todo", "fixme", "xxx"], "location": "start" }` options:
+
+::: correct
+
+```js
+/*eslint no-warning-comments: "error"*/
+
+function callback(err, results) {
+  if (err) {
+    console.error(err);
+    return;
+  }
+  // NOT READY FOR PRIME TIME
+  // but too bad, it is not a predefined warning term
+}
+```
+
+:::
+
+### terms and location
+
+Examples of **incorrect** code for the `{ "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }` options:
+
+::: incorrect
+
+```js
+/*eslint no-warning-comments: ["error", { "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }]*/
+
+// TODO: this
+// todo: this too
+// Even this: TODO
+/*
+ * The same goes for this TODO comment
+ * Or a fixme
+ * as well as any other term
+ */
+```
+
+:::
+
+Examples of **correct** code for the `{ "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }` options:
+
+::: correct
+
+```js
+/*eslint no-warning-comments: ["error", { "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }]*/
+
+// This is to do
+// even not any other    term
+// any other terminal
+/*
+ * The same goes for block comments
+ * with any other interesting term
+ * or fix me this
+ */
+```
+
+:::
+
+### Decoration Characters
+
+Examples of **incorrect** code for the `{ "decoration": ["*"] }` options:
+
+::: incorrect
+
+```js
+/*eslint no-warning-comments: ["error", { "decoration": ["*"] }]*/
+
+//***** todo decorative asterisks are ignored *****//
+/**
+ * TODO new lines and asterisks are also ignored in block comments.
+ */
+```
+
+:::
+
+Examples of **incorrect** code for the `{ "decoration": ["/", "*"] }` options:
+
+::: incorrect
+
+```js
+/*eslint no-warning-comments: ["error", { "decoration": ["/", "*"] }]*/
+
+////// TODO decorative slashes and whitespace are ignored //////
+//***** todo decorative asterisks are also ignored *****//
+/**
+ * TODO new lines are also ignored in block comments.
+ */
+```
+
+:::
+
+Examples of **correct** code for the `{ "decoration": ["/", "*"] }` options:
+
+::: correct
+
+```js
+/*eslint no-warning-comments: ["error", { "decoration": ["/", "*"] }]*/
+
+//!TODO preceded by non-decoration character
+/**
+ *!TODO preceded by non-decoration character in a block comment
+ */
+```
+
+:::
+
+## When Not To Use It
+
+* If you have a large code base that was not developed with a policy to not use such warning terms, you might get hundreds of warnings / errors which might be counter-productive if you can't fix all of them (e.g. if you don't get the time to do it) as you might overlook other warnings / errors or get used to many of them and don't pay attention on it anymore.
+* Same reason as the point above: You shouldn't configure terms that are used very often (e.g. central parts of the native language used in your comments).
diff --git a/eslint/docs/src/rules/no-whitespace-before-property.md b/eslint/docs/src/rules/no-whitespace-before-property.md
new file mode 100644 (file)
index 0000000..d22e45b
--- /dev/null
@@ -0,0 +1,81 @@
+---
+title: no-whitespace-before-property
+layout: doc
+rule_type: layout
+---
+
+
+
+JavaScript allows whitespace between objects and their properties. However, inconsistent spacing can make code harder to read and can lead to errors.
+
+```js
+foo. bar .baz . quz
+```
+
+## Rule Details
+
+This rule disallows whitespace around the dot or before the opening bracket before properties of objects if they are on the same line. This rule allows whitespace when the object and property are on separate lines, as it is common to add newlines to longer chains of properties:
+
+```js
+foo
+  .bar()
+  .baz()
+  .qux()
+```
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-whitespace-before-property: "error"*/
+
+foo [bar]
+
+foo. bar
+
+foo .bar
+
+foo. bar. baz
+
+foo. bar()
+  .baz()
+
+foo
+  .bar(). baz()
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-whitespace-before-property: "error"*/
+
+foo.bar
+
+foo[bar]
+
+foo[ bar ]
+
+foo.bar.baz
+
+foo
+  .bar().baz()
+
+foo
+  .bar()
+  .baz()
+
+foo.
+  bar().
+  baz()
+```
+
+:::
+
+## When Not To Use It
+
+Turn this rule off if you do not care about allowing whitespace around the dot or before the opening bracket before properties of objects if they are on the same line.
diff --git a/eslint/docs/src/rules/no-with.md b/eslint/docs/src/rules/no-with.md
new file mode 100644 (file)
index 0000000..f72fbdb
--- /dev/null
@@ -0,0 +1,48 @@
+---
+title: no-with
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://web.archive.org/web/20200717110117/https://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/
+---
+
+
+
+The `with` statement is potentially problematic because it adds members of an object to the current scope, making it impossible to tell what a variable inside the block actually refers to.
+
+## Rule Details
+
+This rule disallows `with` statements.
+
+If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint no-with: "error"*/
+
+with (point) {
+    r = Math.sqrt(x * x + y * y); // is r a member of point?
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint no-with: "error"*/
+/*eslint-env es6*/
+
+const r = ({x, y}) => Math.sqrt(x * x + y * y);
+```
+
+:::
+
+## When Not To Use It
+
+If you intentionally use `with` statements then you can disable this rule.
diff --git a/eslint/docs/src/rules/no-wrap-func.md b/eslint/docs/src/rules/no-wrap-func.md
new file mode 100644 (file)
index 0000000..76a8406
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: no-wrap-func
+layout: doc
+
+---
+
+Disallows unnecessary parentheses around function expressions.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [no-extra-parens](no-extra-parens) rule. The `"functions"` option in the new rule is equivalent to the removed rule.
+
+Although it's possible to wrap functions in parentheses, this can be confusing when the code also contains immediately-invoked function expressions (IIFEs) since parentheses are often used to make this distinction. For example:
+
+```js
+var foo = (function() {
+    // IIFE
+}());
+
+var bar = (function() {
+    // not an IIFE
+});
+```
+
+## Rule Details
+
+This rule will raise a warning when it encounters a function expression wrapped in parentheses with no following invoking parentheses.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+var a = (function() {/*...*/});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+var a = function() {/*...*/};
+
+(function() {/*...*/})();
+```
+
+:::
diff --git a/eslint/docs/src/rules/nonblock-statement-body-position.md b/eslint/docs/src/rules/nonblock-statement-body-position.md
new file mode 100644 (file)
index 0000000..fc1189b
--- /dev/null
@@ -0,0 +1,186 @@
+---
+title: nonblock-statement-body-position
+layout: doc
+rule_type: layout
+further_reading:
+- https://jscs-dev.github.io/rule/requireNewlineBeforeSingleStatementsInIf
+---
+
+
+
+When writing `if`, `else`, `while`, `do-while`, and `for` statements, the body can be a single statement instead of a block. It can be useful to enforce a consistent location for these single statements.
+
+For example, some developers avoid writing code like this:
+
+```js
+if (foo)
+  bar();
+```
+
+If another developer attempts to add `baz();` to the `if` statement, they might mistakenly change the code to
+
+```js
+if (foo)
+  bar();
+  baz(); // this line is not in the `if` statement!
+```
+
+To avoid this issue, one might require all single-line `if` statements to appear directly after the conditional, without a linebreak:
+
+```js
+if (foo) bar();
+```
+
+## Rule Details
+
+This rule aims to enforce a consistent location for single-line statements.
+
+Note that this rule does not enforce the usage of single-line statements in general. If you would like to disallow single-line statements, use the [`curly`](/docs/rules/curly) rule instead.
+
+### Options
+
+This rule accepts a string option:
+
+* `"beside"` (default) disallows a newline before a single-line statement.
+* `"below"` requires a newline before a single-line statement.
+* `"any"` does not enforce the position of a single-line statement.
+
+Additionally, the rule accepts an optional object option with an `"overrides"` key. This can be used to specify a location for particular statements that override the default. For example:
+
+* `"beside", { "overrides": { "while": "below" } }` requires all single-line statements to appear on the same line as their parent, unless the parent is a `while` statement, in which case the single-line statement must not be on the same line.
+* `"below", { "overrides": { "do": "any" } }` disallows all single-line statements from appearing on the same line as their parent, unless the parent is a `do-while` statement, in which case the position of the single-line statement is not enforced.
+
+Examples of **incorrect** code for this rule with the default `"beside"` option:
+
+::: incorrect
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "beside"] */
+
+if (foo)
+  bar();
+else
+  baz();
+
+while (foo)
+  bar();
+
+for (let i = 1; i < foo; i++)
+  bar();
+
+do
+  bar();
+while (foo)
+
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"beside"` option:
+
+::: correct
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "beside"] */
+
+if (foo) bar();
+else baz();
+
+while (foo) bar();
+
+for (let i = 1; i < foo; i++) bar();
+
+do bar(); while (foo)
+
+if (foo) { // block statements are always allowed with this rule
+  bar();
+} else {
+  baz();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"below"` option:
+
+::: incorrect
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "below"] */
+
+if (foo) bar();
+else baz();
+
+while (foo) bar();
+
+for (let i = 1; i < foo; i++) bar();
+
+do bar(); while (foo)
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"below"` option:
+
+::: correct
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "below"] */
+
+if (foo)
+  bar();
+else
+  baz();
+
+while (foo)
+  bar();
+
+for (let i = 1; i < foo; i++)
+  bar();
+
+do
+  bar();
+while (foo)
+
+if (foo) {
+  // Although the second `if` statement is on the same line as the `else`, this is a very common
+  // pattern, so it's not checked by this rule.
+} else if (bar) {
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"beside", { "overrides": { "while": "below" } }` rule:
+
+::: incorrect
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "beside", { "overrides": { "while": "below" } }] */
+
+if (foo)
+  bar();
+
+while (foo) bar();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"beside", { "overrides": { "while": "below" } }` rule:
+
+::: correct
+
+```js
+/* eslint nonblock-statement-body-position: ["error", "beside", { "overrides": { "while": "below" } }] */
+
+if (foo) bar();
+
+while (foo)
+  bar();
+```
+
+:::
+
+## When Not To Use It
+
+If you're not concerned about consistent locations of single-line statements, you should not turn on this rule. You can also disable this rule if you're using the `"all"` option for the [`curly`](/docs/rules/curly) rule, because this will disallow single-line statements entirely.
diff --git a/eslint/docs/src/rules/object-curly-newline.md b/eslint/docs/src/rules/object-curly-newline.md
new file mode 100644 (file)
index 0000000..ece2fca
--- /dev/null
@@ -0,0 +1,607 @@
+---
+title: object-curly-newline
+layout: doc
+rule_type: layout
+related_rules:
+- comma-spacing
+- key-spacing
+- object-curly-spacing
+- object-property-newline
+---
+
+
+
+A number of style guides require or disallow line breaks inside of object braces and other tokens.
+
+## Rule Details
+
+This rule requires or disallows a line break between `{` and its following token, and between `}` and its preceding token of object literals or destructuring assignments.
+
+## Options
+
+This rule has either a string option:
+
+* `"always"` requires line breaks after opening and before closing braces
+* `"never"` disallows line breaks after opening and before closing braces
+
+Or an object option:
+
+* `"multiline": true` requires line breaks if there are line breaks inside properties or between properties. Otherwise, it disallows line breaks.
+* `"minProperties"` requires line breaks if the number of properties is at least the given integer. By default, an error will also be reported if an object contains linebreaks and has fewer properties than the given integer. However, the second behavior is disabled if the `consistent` option is set to `true`
+* `"consistent": true` (default) requires that either both curly braces, or neither, directly enclose newlines. Note that enabling this option will also change the behavior of the `minProperties` option. (See `minProperties` above for more information)
+
+You can specify different options for object literals, destructuring assignments, and named imports and exports:
+
+```json
+{
+    "object-curly-newline": ["error", {
+        "ObjectExpression": "always",
+        "ObjectPattern": { "multiline": true },
+        "ImportDeclaration": "never",
+        "ExportDeclaration": { "multiline": true, "minProperties": 3 }
+    }]
+}
+```
+
+* `"ObjectExpression"` configuration for object literals
+* `"ObjectPattern"` configuration for object patterns of destructuring assignments
+* `"ImportDeclaration"` configuration for named imports
+* `"ExportDeclaration"` configuration for named exports
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", "always"]*/
+/*eslint-env es6*/
+
+let a = {};
+let b = {foo: 1};
+let c = {foo: 1, bar: 2};
+let d = {foo: 1,
+    bar: 2};
+let e = {foo() {
+    dosomething();
+}};
+
+let {} = obj;
+let {f} = obj;
+let {g, h} = obj;
+let {i,
+    j} = obj;
+let {k = function() {
+    dosomething();
+}} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", "always"]*/
+/*eslint-env es6*/
+
+let a = {
+};
+let b = {
+    foo: 1
+};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {
+} = obj;
+let {
+    f
+} = obj;
+let {
+    g, h
+} = obj;
+let {
+    i,
+    j
+} = obj;
+let {
+    k = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", "never"]*/
+/*eslint-env es6*/
+
+let a = {
+};
+let b = {
+    foo: 1
+};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {
+} = obj;
+let {
+    f
+} = obj;
+let {
+    g, h
+} = obj;
+let {
+    i,
+    j
+} = obj;
+let {
+    k = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", "never"]*/
+/*eslint-env es6*/
+
+let a = {};
+let b = {foo: 1};
+let c = {foo: 1, bar: 2};
+let d = {foo: 1,
+    bar: 2};
+let e = {foo: function() {
+    dosomething();
+}};
+
+let {} = obj;
+let {f} = obj;
+let {g, h} = obj;
+let {i,
+    j} = obj;
+let {k = function() {
+    dosomething();
+}} = obj;
+```
+
+:::
+
+### multiline
+
+Examples of **incorrect** code for this rule with the `{ "multiline": true }` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", { "multiline": true }]*/
+/*eslint-env es6*/
+
+let a = {
+};
+let b = {
+    foo: 1
+};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {foo: 1,
+    bar: 2};
+let e = {foo: function() {
+    dosomething();
+}};
+
+let {
+} = obj;
+let {
+    f
+} = obj;
+let {
+    g, h
+} = obj;
+let {i,
+    j} = obj;
+let {k = function() {
+    dosomething();
+}} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "multiline": true }` option:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", { "multiline": true }]*/
+/*eslint-env es6*/
+
+let a = {};
+let b = {foo: 1};
+let c = {foo: 1, bar: 2};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {} = obj;
+let {f} = obj;
+let {g, h} = obj;
+let {
+    i,
+    j
+} = obj;
+let {
+    k = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+### minProperties
+
+Examples of **incorrect** code for this rule with the `{ "minProperties": 2 }` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", { "minProperties": 2 }]*/
+/*eslint-env es6*/
+
+let a = {
+};
+let b = {
+    foo: 1
+};
+let c = {foo: 1, bar: 2};
+let d = {foo: 1,
+    bar: 2};
+let e = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {
+} = obj;
+let {
+    f
+} = obj;
+let {g, h} = obj;
+let {i,
+    j} = obj;
+let {
+    k = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "minProperties": 2 }` option:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", { "minProperties": 2 }]*/
+/*eslint-env es6*/
+
+let a = {};
+let b = {foo: 1};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {foo: function() {
+    dosomething();
+}};
+
+let {} = obj;
+let {f} = obj;
+let {
+    g, h
+} = obj;
+let {
+    i,
+    j
+} = obj;
+let {k = function() {
+    dosomething();
+}} = obj;
+```
+
+:::
+
+### consistent
+
+Examples of **incorrect** code for this rule with the default `{ "consistent": true }` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", { "consistent": true }]*/
+/*eslint-env es6*/
+
+let a = {foo: 1
+};
+let b = {
+    foo: 1};
+let c = {foo: 1, bar: 2
+};
+let d = {
+    foo: 1, bar: 2};
+let e = {foo: function() {
+    dosomething();
+    }
+};
+let f = {
+    foo: function() {
+    dosomething();}};
+
+let {g
+} = obj;
+let {
+    h} = obj;
+let {i, j
+} = obj;
+let {k, l
+} = obj;
+let {
+    m, n} = obj;
+let {
+    o, p} = obj;
+let {q = function() {
+    dosomething();
+    }
+} = obj;
+let {
+    r = function() {
+        dosomething();
+    }} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `{ "consistent": true }` option:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", { "consistent": true }]*/
+/*eslint-env es6*/
+
+let empty1 = {};
+let empty2 = {
+};
+let a = {foo: 1};
+let b = {
+    foo: 1
+};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {foo: function() {dosomething();}};
+let f = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {} = obj;
+let {
+} = obj;
+let {g} = obj;
+let {
+    h
+} = obj;
+let {i, j} = obj;
+let {
+    k, l
+} = obj;
+let {m,
+    n} = obj;
+let {
+    o,
+    p
+} = obj;
+let {q = function() {dosomething();}} = obj;
+let {
+    r = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+### ObjectExpression and ObjectPattern
+
+Examples of **incorrect** code for this rule with the `{ "ObjectExpression": "always", "ObjectPattern": "never" }` options:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", { "ObjectExpression": "always", "ObjectPattern": "never" }]*/
+/*eslint-env es6*/
+
+let a = {};
+let b = {foo: 1};
+let c = {foo: 1, bar: 2};
+let d = {foo: 1,
+    bar: 2};
+let e = {foo: function() {
+    dosomething();
+}};
+
+let {
+} = obj;
+let {
+    f
+} = obj;
+let {
+    g, h
+} = obj;
+let {
+    i,
+    j
+} = obj;
+let {
+    k = function() {
+        dosomething();
+    }
+} = obj;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ObjectExpression": "always", "ObjectPattern": "never" }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", { "ObjectExpression": "always", "ObjectPattern": "never" }]*/
+/*eslint-env es6*/
+
+let a = {
+};
+let b = {
+    foo: 1
+};
+let c = {
+    foo: 1, bar: 2
+};
+let d = {
+    foo: 1,
+    bar: 2
+};
+let e = {
+    foo: function() {
+        dosomething();
+    }
+};
+
+let {} = obj;
+let {f} = obj;
+let {g, h} = obj;
+let {i,
+    j} = obj;
+let {k = function() {
+    dosomething();
+}} = obj;
+```
+
+:::
+
+### ImportDeclaration and ExportDeclaration
+
+Examples of **incorrect** code for this rule with the `{ "ImportDeclaration": "always", "ExportDeclaration": "never" }` options:
+
+::: incorrect
+
+```js
+/*eslint object-curly-newline: ["error", { "ImportDeclaration": "always", "ExportDeclaration": "never" }]*/
+/*eslint-env es6*/
+
+import {foo, bar} from 'foo-bar';
+import {foo as f, bar} from 'foo-bar';
+import {foo,
+    bar} from 'foo-bar';
+
+export {
+   foo,
+   bar
+};
+export {
+   foo as f,
+   bar
+} from 'foo-bar';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ImportDeclaration": "always", "ExportDeclaration": "never" }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-newline: ["error", { "ImportDeclaration": "always", "ExportDeclaration": "never" }]*/
+/*eslint-env es6*/
+
+import {
+    foo,
+    bar
+} from 'foo-bar';
+import {
+    foo, bar
+} from 'foo-bar';
+import {
+    foo as f,
+    bar
+} from 'foo-bar';
+
+export { foo, bar } from 'foo-bar';
+export { foo as f, bar } from 'foo-bar';
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce consistent line breaks after opening and before closing braces, then it's safe to disable this rule.
+
+## Compatibility
+
+* **JSCS**: [requirePaddingNewLinesInObjects](https://jscs-dev.github.io/rule/requirePaddingNewLinesInObjects)
+* **JSCS**: [disallowPaddingNewLinesInObjects](https://jscs-dev.github.io/rule/disallowPaddingNewLinesInObjects)
diff --git a/eslint/docs/src/rules/object-curly-spacing.md b/eslint/docs/src/rules/object-curly-spacing.md
new file mode 100644 (file)
index 0000000..2df4727
--- /dev/null
@@ -0,0 +1,192 @@
+---
+title: object-curly-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+- comma-spacing
+- computed-property-spacing
+- space-in-parens
+---
+
+
+
+While formatting preferences are very personal, a number of style guides require
+or disallow spaces between curly braces in the following situations:
+
+```js
+// simple object literals
+var obj = { foo: "bar" };
+
+// nested object literals
+var obj = { foo: { zoo: "bar" } };
+
+// destructuring assignment (EcmaScript 6)
+var { x, y } = y;
+
+// import/export declarations (EcmaScript 6)
+import { foo } from "bar";
+export { foo };
+```
+
+## Rule Details
+
+This rule enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"never"` (default) disallows spacing inside of braces
+* `"always"` requires spacing inside of braces (except `{}`)
+
+Object option:
+
+* `"arraysInObjects": true` requires spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to `never`)
+* `"arraysInObjects": false` disallows spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to `always`)
+* `"objectsInObjects": true` requires spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to `never`)
+* `"objectsInObjects": false` disallows spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to `always`)
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-spacing: ["error", "never"]*/
+
+var obj = { 'foo': 'bar' };
+var obj = {'foo': 'bar' };
+var obj = { baz: {'foo': 'qux'}, bar};
+var obj = {baz: { 'foo': 'qux'}, bar};
+var {x } = y;
+import { foo } from 'bar';
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "never"]*/
+
+var obj = {'foo': 'bar'};
+var obj = {'foo': {'bar': 'baz'}, 'qux': 'quxx'};
+var obj = {
+  'foo': 'bar'
+};
+var obj = {'foo': 'bar'
+};
+var obj = {
+  'foo':'bar'};
+var obj = {};
+var {x} = y;
+import {foo} from 'bar';
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint object-curly-spacing: ["error", "always"]*/
+
+var obj = {'foo': 'bar'};
+var obj = {'foo': 'bar' };
+var obj = { baz: {'foo': 'qux'}, bar};
+var obj = {baz: { 'foo': 'qux' }, bar};
+var obj = {'foo': 'bar'
+};
+var obj = {
+  'foo':'bar'};
+var {x} = y;
+import {foo } from 'bar';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "always"]*/
+
+var obj = {};
+var obj = { 'foo': 'bar' };
+var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
+var obj = {
+  'foo': 'bar'
+};
+var { x } = y;
+import { foo } from 'bar';
+```
+
+:::
+
+#### arraysInObjects
+
+Examples of additional **correct** code for this rule with the `"never", { "arraysInObjects": true }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "never", { "arraysInObjects": true }]*/
+
+var obj = {"foo": [ 1, 2 ] };
+var obj = {"foo": [ "baz", "bar" ] };
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `"always", { "arraysInObjects": false }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "always", { "arraysInObjects": false }]*/
+
+var obj = { "foo": [ 1, 2 ]};
+var obj = { "foo": [ "baz", "bar" ]};
+```
+
+:::
+
+#### objectsInObjects
+
+Examples of additional **correct** code for this rule with the `"never", { "objectsInObjects": true }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "never", { "objectsInObjects": true }]*/
+
+var obj = {"foo": {"baz": 1, "bar": 2} };
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `"always", { "objectsInObjects": false }` options:
+
+::: correct
+
+```js
+/*eslint object-curly-spacing: ["error", "always", { "objectsInObjects": false }]*/
+
+var obj = { "foo": { "baz": 1, "bar": 2 }};
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing between curly braces.
diff --git a/eslint/docs/src/rules/object-property-newline.md b/eslint/docs/src/rules/object-property-newline.md
new file mode 100644 (file)
index 0000000..314fa7b
--- /dev/null
@@ -0,0 +1,286 @@
+---
+title: object-property-newline
+layout: doc
+rule_type: layout
+related_rules:
+- brace-style
+- comma-dangle
+- key-spacing
+- object-curly-spacing
+---
+
+
+
+This rule permits you to restrict the locations of property specifications in object literals. You may prohibit any part of any property specification from appearing on the same line as any part of any other property specification. You may make this prohibition absolute, or, by invoking an object option, you may allow an exception, permitting an object literal to have all parts of all of its property specifications on a single line.
+
+## Rule Details
+
+### Motivations
+
+This rule makes it possible to ensure, as some style guides require, that property specifications appear on separate lines for better readability. For example, you can prohibit all of these:
+
+```js
+const newObject = {a: 1, b: [2, {a: 3, b: 4}]};
+const newObject = {
+    a: 1, b: [2, {a: 3, b: 4}]
+};
+const newObject = {
+    a: 1,
+    b: [2, {a: 3, b: 4}]
+};
+const newObject = {
+    a: 1,
+    b: [
+        2,
+        {a: 3, b: 4}
+    ]
+};
+
+```
+
+Instead of those, you can comply with the rule by writing
+
+```js
+const newObject = {
+    a: 1,
+    b: [2, {
+        a: 3,
+        b: 4
+    }]
+};
+```
+
+or
+
+```js
+const newObject = {
+    a: 1,
+    b: [
+        2,
+        {
+            a: 3,
+            b: 4
+        }
+    ]
+};
+```
+
+Another benefit of this rule is specificity of diffs when a property is changed:
+
+```diff
+// More specific
+ var obj = {
+     foo: "foo",
+-    bar: "bar",
++    bar: "bazz",
+     baz: "baz"
+ };
+```
+
+```diff
+// Less specific
+-var obj = { foo: "foo", bar: "bar", baz: "baz" };
++var obj = { foo: "foo", bar: "bazz", baz: "baz" };
+```
+
+### Optional Exception
+
+The rule offers one object option, `allowAllPropertiesOnSameLine` (a deprecated synonym is `allowMultiplePropertiesPerLine`). If you set it to `true`, object literals such as the first two above, with all property specifications on the same line, will be permitted, but one like
+
+```js
+const newObject = {
+    a: 'a.m.', b: 'p.m.',
+    c: 'daylight saving time'
+};
+
+```
+
+will be prohibited, because two properties, but not all properties, appear on the same line.
+
+### Notations
+
+This rule applies equally to all property specifications, regardless of notation, including:
+
+* `a: 1` (ES5)
+* `a` (ES2015 shorthand property)
+* ``[`prop${a}`]`` (ES2015 computed property name)
+
+Thus, the rule (without the optional exception) prohibits both of these:
+
+```js
+const newObject = {
+    a: 1, [
+        process.argv[4]
+    ]: '01'
+};
+const newObject = {
+    a: 1, [process.argv[4]]: '01'
+};
+```
+
+(This behavior differs from that of the JSCS rule cited below, which does not treat the leading `[` of a computed property name as part of that property specification. The JSCS rule prohibits the second of these formats but permits the first.)
+
+### Multiline Properties
+
+The rule prohibits the colocation on any line of at least 1 character of one property specification with at least 1 character of any other property specification. For example, the rule prohibits
+
+```js
+const newObject = {a: [
+    'Officiële website van de Europese Unie',
+    'Официален уебсайт на Европейския съюз'
+], b: 2};
+```
+
+because 1 character of the specification of `a` (i.e. the trailing `]` of its value) is on the same line as the specification of `b`.
+
+The optional exception does not excuse this case, because the entire collection of property specifications spans 4 lines, not 1.
+
+### Inter-property Delimiters
+
+The comma and any whitespace that delimit property specifications are not considered parts of them. Therefore, the rule permits both of these formats:
+
+```js
+const newFunction = multiplier => ({
+    a: 2 * multiplier,
+    b: 4 * multiplier,
+    c: 8 * multiplier
+});
+const newFunction = multiplier => ({
+    a: 2 * multiplier
+    , b: 4 * multiplier
+    , c: 8 * multiplier
+});
+```
+
+(This behavior differs from that of the JSCS rule cited below, which permits the first but prohibits the second format.)
+
+### --fix
+
+If this rule is invoked with the command-line `--fix` option, object literals that violate the rule are generally modified to comply with it. The modification in each case is to move a property specification to the next line whenever there is part or all of a previous property specification on the same line. For example,
+
+```js
+const newObject = {
+    a: 'a.m.', b: 'p.m.',
+    c: 'daylight saving time'
+};
+```
+
+is converted to
+
+```js
+const newObject = {
+    a: 'a.m.',
+b: 'p.m.',
+    c: 'daylight saving time'
+};
+```
+
+The modification does not depend on whether the object option is set to `true`. In other words, ESLint never collects all the property specifications onto a single line, even when the object option would permit that.
+
+ESLint does not correct a violation of this rule if a comment immediately precedes the second or subsequent property specification on a line, since ESLint cannot determine which line to put the comment onto.
+
+As illustrated above, the `--fix` option, applied to this rule, does not comply with other rules, such as `indent`, but, if those other rules are also in effect, the option applies them, too.
+
+## Examples
+
+Examples of **incorrect** code for this rule, with no object option or with `allowAllPropertiesOnSameLine` set to `false`:
+
+::: incorrect
+
+```js
+/*eslint object-property-newline: "error"*/
+
+const obj0 = { foo: "foo", bar: "bar", baz: "baz" };
+
+const obj1 = {
+    foo: "foo", bar: "bar", baz: "baz"
+};
+
+const obj2 = {
+    foo: "foo", bar: "bar",
+    baz: "baz"
+};
+
+const obj3 = {
+    [process.argv[3] ? "foo" : "bar"]: 0, baz: [
+        1,
+        2,
+        4,
+        8
+    ]
+};
+
+const a = "antidisestablishmentarianistically";
+const b = "yugoslavyalılaştırabildiklerimizdenmişsiniz";
+const obj4 = {a, b};
+
+const domain = process.argv[4];
+const obj5 = {
+    foo: "foo", [
+    domain.includes(":") ? "complexdomain" : "simpledomain"
+]: true};
+```
+
+:::
+
+Examples of **correct** code for this rule, with no object option or with `allowAllPropertiesOnSameLine` set to `false`:
+
+::: correct
+
+```js
+/*eslint object-property-newline: "error"*/
+
+const obj1 = {
+    foo: "foo",
+    bar: "bar",
+    baz: "baz"
+};
+
+const obj2 = {
+    foo: "foo"
+    , bar: "bar"
+    , baz: "baz"
+};
+
+const user = process.argv[2];
+const obj3 = {
+    user,
+    [process.argv[3] ? "foo" : "bar"]: 0,
+    baz: [
+        1,
+        2,
+        4,
+        8
+    ]
+};
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "allowAllPropertiesOnSameLine": true }` option:
+
+::: correct
+
+```js
+/*eslint object-property-newline: ["error", { "allowAllPropertiesOnSameLine": true }]*/
+
+const obj = { foo: "foo", bar: "bar", baz: "baz" };
+
+const obj2 = {
+    foo: "foo", bar: "bar", baz: "baz"
+};
+const user = process.argv[2];
+const obj3 = {
+    user, [process.argv[3] ? "foo" : "bar"]: 0, baz: [1, 2, 4, 8]
+};
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you want to decide, case-by-case, whether to place property specifications on separate lines.
+
+## Compatibility
+
+* **JSCS**: This rule provides partial compatibility with [requireObjectKeysOnNewLine](https://jscs-dev.github.io/rule/requireObjectKeysOnNewLine).
diff --git a/eslint/docs/src/rules/object-shorthand.md b/eslint/docs/src/rules/object-shorthand.md
new file mode 100644 (file)
index 0000000..0865126
--- /dev/null
@@ -0,0 +1,302 @@
+---
+title: object-shorthand
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-useless-rename
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer
+---
+
+
+
+ECMAScript 6 provides a concise form for defining object literal methods and properties. This
+syntax can make defining complex object literals much cleaner.
+
+Here are a few common examples using the ES5 syntax:
+
+```js
+// properties
+var foo = {
+    x: x,
+    y: y,
+    z: z,
+};
+
+// methods
+var foo = {
+    a: function() {},
+    b: function() {}
+};
+```
+
+Now here are ES6 equivalents:
+
+```js
+/*eslint-env es6*/
+
+// properties
+var foo = {x, y, z};
+
+// methods
+var foo = {
+    a() {},
+    b() {}
+};
+```
+
+## Rule Details
+
+This rule enforces the use of the shorthand syntax. This applies
+to all methods (including generators) defined in object literals and any
+properties defined where the key name matches name of the assigned variable.
+
+Each of the following properties would warn:
+
+```js
+/*eslint object-shorthand: "error"*/
+/*eslint-env es6*/
+
+var foo = {
+    w: function() {},
+    x: function *() {},
+    [y]: function() {},
+    z: z
+};
+```
+
+In that case the expected syntax would have been:
+
+```js
+/*eslint object-shorthand: "error"*/
+/*eslint-env es6*/
+
+var foo = {
+    w() {},
+    *x() {},
+    [y]() {},
+    z
+};
+```
+
+This rule does not flag arrow functions inside of object literals.
+The following will *not* warn:
+
+```js
+/*eslint object-shorthand: "error"*/
+/*eslint-env es6*/
+
+var foo = {
+    x: (y) => y
+};
+```
+
+## Options
+
+The rule takes an option which specifies when it should be applied. It can be set to one of the following values:
+
+* `"always"` (default) expects that the shorthand will be used whenever possible.
+* `"methods"` ensures the method shorthand is used (also applies to generators).
+* `"properties"` ensures the property shorthand is used (where the key and variable name match).
+* `"never"` ensures that no property or method shorthand is used in any object literal.
+* `"consistent"` ensures that either all shorthand or all long-form will be used in an object literal.
+* `"consistent-as-needed"` ensures that either all shorthand or all long-form will be used in an object literal, but ensures all shorthand whenever possible.
+
+You can set the option in configuration like this:
+
+```json
+{
+    "object-shorthand": ["error", "always"]
+}
+```
+
+Additionally, the rule takes an optional object configuration:
+
+* `"avoidQuotes": true` indicates that long-form syntax is preferred whenever the object key is a string literal (default: `false`). Note that this option can only be enabled when the string option is set to `"always"`, `"methods"`, or `"properties"`.
+* `"ignoreConstructors": true` can be used to prevent the rule from reporting errors for constructor functions. (By default, the rule treats constructors the same way as other functions.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`.
+* `"methodsIgnorePattern"` (`string`) for methods whose names match this regex pattern, the method shorthand will not be enforced. Note that this option can only be used when the string option is set to `"always"` or `"methods"`.
+* `"avoidExplicitReturnArrows": true` indicates that methods are preferred over explicit-return arrow functions for function properties. (By default, the rule allows either of these.) Note that this option can only be enabled when the string option is set to `"always"` or `"methods"`.
+
+### `avoidQuotes`
+
+```json
+{
+    "object-shorthand": ["error", "always", { "avoidQuotes": true }]
+}
+```
+
+Example of **incorrect** code for this rule with the `"always", { "avoidQuotes": true }` option:
+
+::: incorrect
+
+```js
+/*eslint object-shorthand: ["error", "always", { "avoidQuotes": true }]*/
+/*eslint-env es6*/
+
+var foo = {
+    "bar-baz"() {}
+};
+```
+
+:::
+
+Example of **correct** code for this rule with the `"always", { "avoidQuotes": true }` option:
+
+::: correct
+
+```js
+/*eslint object-shorthand: ["error", "always", { "avoidQuotes": true }]*/
+/*eslint-env es6*/
+
+var foo = {
+    "bar-baz": function() {},
+    "qux": qux
+};
+```
+
+:::
+
+### `ignoreConstructors`
+
+```json
+{
+    "object-shorthand": ["error", "always", { "ignoreConstructors": true }]
+}
+```
+
+Example of **correct** code for this rule with the `"always", { "ignoreConstructors": true }` option:
+
+::: correct
+
+```js
+/*eslint object-shorthand: ["error", "always", { "ignoreConstructors": true }]*/
+/*eslint-env es6*/
+
+var foo = {
+    ConstructorFunction: function() {}
+};
+```
+
+:::
+
+### `methodsIgnorePattern`
+
+Example of **correct** code for this rule with the `"always", { "methodsIgnorePattern": "^bar$" }` option:
+
+::: correct
+
+```js
+/*eslint object-shorthand: ["error", "always", { "methodsIgnorePattern": "^bar$" }]*/
+
+var foo = {
+    bar: function() {}
+};
+```
+
+:::
+
+### `avoidExplicitReturnArrows`
+
+```json
+{
+    "object-shorthand": ["error", "always", { "avoidExplicitReturnArrows": true }]
+}
+```
+
+Example of **incorrect** code for this rule with the `"always", { "avoidExplicitReturnArrows": true }` option:
+
+::: incorrect
+
+```js
+/*eslint object-shorthand: ["error", "always", { "avoidExplicitReturnArrows": true }]*/
+/*eslint-env es6*/
+
+var foo = {
+  foo: (bar, baz) => {
+    return bar + baz;
+  },
+
+  qux: (foobar) => {
+    return foobar * 2;
+  }
+};
+```
+
+:::
+
+Example of **correct** code for this rule with the `"always", { "avoidExplicitReturnArrows": true }` option:
+
+::: correct
+
+```js
+/*eslint object-shorthand: ["error", "always", { "avoidExplicitReturnArrows": true }]*/
+/*eslint-env es6*/
+
+var foo = {
+  foo(bar, baz) {
+    return bar + baz;
+  },
+
+  qux: foobar => foobar * 2
+};
+```
+
+:::
+
+Example of **incorrect** code for this rule with the `"consistent"` option:
+
+::: incorrect
+
+```js
+/*eslint object-shorthand: [2, "consistent"]*/
+/*eslint-env es6*/
+
+var foo = {
+    a,
+    b: "foo",
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+::: correct
+
+```js
+/*eslint object-shorthand: [2, "consistent"]*/
+/*eslint-env es6*/
+
+var foo = {
+    a: a,
+    b: "foo"
+};
+
+var bar = {
+    a,
+    b,
+};
+```
+
+:::
+
+Example of **incorrect** code with the `"consistent-as-needed"` option, which is very similar to `"consistent"`:
+
+::: incorrect
+
+```js
+/*eslint object-shorthand: [2, "consistent-as-needed"]*/
+/*eslint-env es6*/
+
+var foo = {
+    a: a,
+    b: b,
+};
+```
+
+:::
+
+## When Not To Use It
+
+Anyone not yet in an ES6 environment would not want to apply this rule. Others may find the terseness of the shorthand
+syntax harder to read and may not want to encourage it with this rule.
diff --git a/eslint/docs/src/rules/one-var-declaration-per-line.md b/eslint/docs/src/rules/one-var-declaration-per-line.md
new file mode 100644 (file)
index 0000000..46ee9ab
--- /dev/null
@@ -0,0 +1,109 @@
+---
+title: one-var-declaration-per-line
+layout: doc
+rule_type: suggestion
+related_rules:
+- one-var
+---
+
+
+
+Some developers declare multiple var statements on the same line:
+
+```js
+var foo, bar, baz;
+```
+
+Others prefer to declare one var per line.
+
+```js
+var foo,
+    bar,
+    baz;
+```
+
+Keeping to one of these styles across a project's codebase can help with maintaining code consistency.
+
+## Rule Details
+
+This rule enforces a consistent newlines around variable declarations. This rule ignores variable declarations inside `for` loop conditionals.
+
+## Options
+
+This rule has a single string option:
+
+* `"initializations"` (default) enforces a newline around variable initializations
+* `"always"` enforces a newline around variable declarations
+
+### initializations
+
+Examples of **incorrect** code for this rule with the default `"initializations"` option:
+
+::: incorrect
+
+```js
+/*eslint one-var-declaration-per-line: ["error", "initializations"]*/
+/*eslint-env es6*/
+
+var a, b, c = 0;
+
+let a,
+    b = 0, c;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"initializations"` option:
+
+::: correct
+
+```js
+/*eslint one-var-declaration-per-line: ["error", "initializations"]*/
+/*eslint-env es6*/
+
+var a, b;
+
+let a,
+    b;
+
+let a,
+    b = 0;
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint one-var-declaration-per-line: ["error", "always"]*/
+/*eslint-env es6*/
+
+var a, b;
+
+let a, b = 0;
+
+const a = 0, b = 0;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint one-var-declaration-per-line: ["error", "always"]*/
+/*eslint-env es6*/
+
+var a,
+    b;
+
+let a,
+    b = 0;
+```
+
+:::
diff --git a/eslint/docs/src/rules/one-var.md b/eslint/docs/src/rules/one-var.md
new file mode 100644 (file)
index 0000000..8d95633
--- /dev/null
@@ -0,0 +1,724 @@
+---
+title: one-var
+layout: doc
+rule_type: suggestion
+---
+
+
+
+Variables can be declared at any point in JavaScript code using `var`, `let`, or `const`. There are many styles and preferences related to the declaration of variables, and one of those is deciding on how many variable declarations should be allowed in a single function.
+
+There are two schools of thought in this regard:
+
+1. There should be just one variable declaration for all variables in the function. That declaration typically appears at the top of the function.
+1. You should use one variable declaration for each variable you want to define.
+
+For instance:
+
+```js
+// one variable declaration per function
+function foo() {
+    var bar, baz;
+}
+
+// multiple variable declarations per function
+function foo() {
+    var bar;
+    var baz;
+}
+```
+
+The single-declaration school of thought is based in pre-ECMAScript 6 behaviors, where there was no such thing as block scope, only function scope. Since all `var` statements are hoisted to the top of the function anyway, some believe that declaring all variables in a single declaration at the top of the function removes confusion around scoping rules.
+
+## Rule Details
+
+This rule enforces variables to be declared either together or separately per function ( for `var`) or block (for `let` and `const`) scope.
+
+## Options
+
+This rule has one option, which can be a string option or an object option.
+
+String option:
+
+* `"always"` (default) requires one variable declaration per scope
+* `"never"` requires multiple variable declarations per scope
+* `"consecutive"` allows multiple variable declarations per scope but requires consecutive variable declarations to be combined into a single declaration
+
+Object option:
+
+* `"var": "always"` requires one `var` declaration per function
+* `"var": "never"` requires multiple `var` declarations per function
+* `"var": "consecutive"` requires consecutive `var` declarations to be a single declaration
+* `"let": "always"` requires one `let` declaration per block
+* `"let": "never"` requires multiple `let` declarations per block
+* `"let": "consecutive"` requires consecutive `let` declarations to be a single declaration
+* `"const": "always"` requires one `const` declaration per block
+* `"const": "never"` requires multiple `const` declarations per block
+* `"const": "consecutive"` requires consecutive `const` declarations to be a single declaration
+* `"separateRequires": true` enforces `requires` to be separate from declarations
+
+Alternate object option:
+
+* `"initialized": "always"` requires one variable declaration for initialized variables per scope
+* `"initialized": "never"` requires multiple variable declarations for initialized variables per scope
+* `"initialized": "consecutive"` requires consecutive variable declarations for initialized variables to be a single declaration
+* `"uninitialized": "always"` requires one variable declaration for uninitialized variables per scope
+* `"uninitialized": "never"` requires multiple variable declarations for uninitialized variables per scope
+* `"uninitialized": "consecutive"` requires consecutive variable declarations for uninitialized variables to be a single declaration
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", "always"]*/
+
+function foo() {
+    var bar;
+    var baz;
+    let qux;
+    let norf;
+}
+
+function foo(){
+    const bar = false;
+    const baz = true;
+    let qux;
+    let norf;
+}
+
+function foo() {
+    var bar;
+
+    if (baz) {
+        var qux = true;
+    }
+}
+
+class C {
+    static {
+        var foo;
+        var bar;
+    }
+
+    static {
+        var foo;
+        if (bar) {
+            var baz = true;
+        }
+    }
+
+    static {
+        let foo;
+        let bar;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", "always"]*/
+
+function foo() {
+    var bar,
+        baz;
+    let qux,
+        norf;
+}
+
+function foo(){
+    const bar = true,
+        baz = false;
+    let qux,
+        norf;
+}
+
+function foo() {
+    var bar,
+        qux;
+
+    if (baz) {
+        qux = true;
+    }
+}
+
+function foo(){
+    let bar;
+
+    if (baz) {
+        let qux;
+    }
+}
+
+class C {
+    static {
+        var foo, bar;
+    }
+
+    static {
+        var foo, baz;
+        if (bar) {
+            baz = true;
+        }
+    }
+
+    static {
+        let foo, bar;
+    }
+
+    static {
+        let foo;
+        if (bar) {
+            let baz;
+        }
+    }
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", "never"]*/
+
+function foo() {
+    var bar,
+        baz;
+    const bar = true,
+        baz = false;
+}
+
+function foo() {
+    var bar,
+        qux;
+
+    if (baz) {
+        qux = true;
+    }
+}
+
+function foo(){
+    let bar = true,
+        baz = false;
+}
+
+class C {
+    static {
+        var foo, bar;
+        let baz, qux;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", "never"]*/
+
+function foo() {
+    var bar;
+    var baz;
+}
+
+function foo() {
+    var bar;
+
+    if (baz) {
+        var qux = true;
+    }
+}
+
+function foo() {
+    let bar;
+
+    if (baz) {
+        let qux = true;
+    }
+}
+
+class C {
+    static {
+        var foo;
+        var bar;
+        let baz;
+        let qux;
+    }
+}
+
+// declarations with multiple variables are allowed in for-loop initializers
+for (var i = 0, len = arr.length; i < len; i++) {
+    doSomething(arr[i]);
+}
+```
+
+:::
+
+### consecutive
+
+Examples of **incorrect** code for this rule with the `"consecutive"` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", "consecutive"]*/
+
+function foo() {
+    var bar;
+    var baz;
+}
+
+function foo(){
+    var bar = 1;
+    var baz = 2;
+
+    qux();
+
+    var qux = 3;
+    var quux;
+}
+
+class C {
+    static {
+        var foo;
+        var bar;
+        let baz;
+        let qux;
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consecutive"` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", "consecutive"]*/
+
+function foo() {
+    var bar,
+        baz;
+}
+
+function foo(){
+    var bar = 1,
+        baz = 2;
+
+    qux();
+
+    var qux = 3,
+        quux;
+}
+
+class C {
+    static {
+        var foo, bar;
+        let baz, qux;
+        doSomething();
+        let quux;
+        var quuux;
+    }
+}
+```
+
+:::
+
+### var, let, and const
+
+Examples of **incorrect** code for this rule with the `{ var: "always", let: "never", const: "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { var: "always", let: "never", const: "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar;
+    var baz;
+    let qux,
+        norf;
+}
+
+function foo() {
+    const bar = 1,
+          baz = 2;
+    let qux,
+        norf;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ var: "always", let: "never", const: "never" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { var: "always", let: "never", const: "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar,
+        baz;
+    let qux;
+    let norf;
+}
+
+function foo() {
+    const bar = 1;
+    const baz = 2;
+    let qux;
+    let norf;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ var: "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { var: "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar,
+        baz;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ var: "never" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { var: "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var bar,
+        baz;
+    const bar = 1; // `const` and `let` declarations are ignored if they are not specified
+    const baz = 2;
+    let qux;
+    let norf;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ separateRequires: true }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { separateRequires: true, var: "always" }]*/
+/*eslint-env node*/
+
+var foo = require("foo"),
+    bar = "bar";
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ separateRequires: true }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { separateRequires: true, var: "always" }]*/
+/*eslint-env node*/
+
+var foo = require("foo");
+var bar = "bar";
+```
+
+:::
+
+::: correct
+
+```js
+var foo = require("foo"),
+    bar = require("bar");
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ var: "never", let: "consecutive", const: "consecutive" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { var: "never", let: "consecutive", const: "consecutive" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    let a,
+        b;
+    let c;
+
+    var d,
+        e;
+}
+
+function foo() {
+    const a = 1,
+        b = 2;
+    const c = 3;
+
+    var d,
+        e;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ var: "never", let: "consecutive", const: "consecutive" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { var: "never", let: "consecutive", const: "consecutive" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    let a,
+        b;
+
+    var d;
+    var e;
+
+    let f;
+}
+
+function foo() {
+    const a = 1,
+          b = 2;
+
+    var c;
+    var d;
+
+    const e = 3;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ var: "consecutive" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { var: "consecutive" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var a;
+    var b;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ var: "consecutive" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { var: "consecutive" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var a,
+        b;
+    const c = 1; // `const` and `let` declarations are ignored if they are not specified
+    const d = 2;
+    let e;
+    let f;
+}
+```
+
+:::
+
+### initialized and uninitialized
+
+Examples of **incorrect** code for this rule with the `{ "initialized": "always", "uninitialized": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { "initialized": "always", "uninitialized": "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var a, b, c;
+    var foo = true;
+    var bar = false;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "initialized": "always", "uninitialized": "never" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { "initialized": "always", "uninitialized": "never" }]*/
+
+function foo() {
+    var a;
+    var b;
+    var c;
+    var foo = true,
+        bar = false;
+}
+
+for (let z of foo) {
+    doSomething(z);
+}
+
+let z;
+for (z of foo) {
+    doSomething(z);
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "initialized": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { "initialized": "never" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    var foo = true,
+        bar = false;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "initialized": "never" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { "initialized": "never" }]*/
+
+function foo() {
+    var foo = true;
+    var bar = false;
+    var a, b, c; // Uninitialized variables are ignored
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "initialized": "consecutive", "uninitialized": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { "initialized": "consecutive", "uninitialized": "never" }]*/
+
+function foo() {
+    var a = 1;
+    var b = 2;
+    var c,
+        d;
+    var e = 3;
+    var f = 4;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "initialized": "consecutive", "uninitialized": "never" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { "initialized": "consecutive", "uninitialized": "never" }]*/
+
+function foo() {
+    var a = 1,
+        b = 2;
+    var c;
+    var d;
+    var e = 3,
+        f = 4;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "initialized": "consecutive" }` option:
+
+::: incorrect
+
+```js
+/*eslint one-var: ["error", { "initialized": "consecutive" }]*/
+
+function foo() {
+    var a = 1;
+    var b = 2;
+
+    foo();
+
+    var c = 3;
+    var d = 4;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "initialized": "consecutive" }` option:
+
+::: correct
+
+```js
+/*eslint one-var: ["error", { "initialized": "consecutive" }]*/
+
+function foo() {
+    var a = 1,
+        b = 2;
+
+    foo();
+
+    var c = 3,
+        d = 4;
+}
+```
+
+:::
+
+## Compatibility
+
+* **JSHint**: This rule maps to the `onevar` JSHint rule, but allows `let` and `const` to be configured separately.
+* **JSCS**: This rule roughly maps to [disallowMultipleVarDecl](https://jscs-dev.github.io/rule/disallowMultipleVarDecl).
+* **JSCS**: This rule option `separateRequires` roughly maps to [requireMultipleVarDecl](https://jscs-dev.github.io/rule/requireMultipleVarDecl).
diff --git a/eslint/docs/src/rules/operator-assignment.md b/eslint/docs/src/rules/operator-assignment.md
new file mode 100644 (file)
index 0000000..c071b19
--- /dev/null
@@ -0,0 +1,106 @@
+---
+title: operator-assignment
+layout: doc
+rule_type: suggestion
+---
+
+
+
+JavaScript provides shorthand operators that combine variable assignment and some simple mathematical operations. For example, `x = x + 4` can be shortened to `x += 4`. The supported shorthand forms are as follows:
+
+```text
+ Shorthand | Separate
+-----------|------------
+ x += y    | x = x + y
+ x -= y    | x = x - y
+ x *= y    | x = x * y
+ x /= y    | x = x / y
+ x %= y    | x = x % y
+ x **= y   | x = x ** y
+ x <<= y   | x = x << y
+ x >>= y   | x = x >> y
+ x >>>= y  | x = x >>> y
+ x &= y    | x = x & y
+ x ^= y    | x = x ^ y
+ x |= y    | x = x | y
+```
+
+## Rule Details
+
+This rule requires or disallows assignment operator shorthand where possible.
+
+The rule applies to the operators listed in the above table. It does not report the logical assignment operators `&&=`, `||=`, and `??=` because their short-circuiting behavior is different from the other assignment operators.
+
+## Options
+
+This rule has a single string option:
+
+* `"always"` (default)  requires assignment operator shorthand where possible
+* `"never"` disallows assignment operator shorthand
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint operator-assignment: ["error", "always"]*/
+
+x = x + y;
+x = y * x;
+x[0] = x[0] / y;
+x.y = x.y << z;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint operator-assignment: ["error", "always"]*/
+
+x = y;
+x += y;
+x = y * z;
+x = (x * y) * z;
+x[0] /= y;
+x[foo()] = x[foo()] % 2;
+x = y + x; // `+` is not always commutative (e.g. x = "abc")
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint operator-assignment: ["error", "never"]*/
+
+x *= y;
+x ^= (y + z) / foo();
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint operator-assignment: ["error", "never"]*/
+
+x = x + y;
+x.y = x.y / a.b;
+```
+
+:::
+
+## When Not To Use It
+
+Use of operator assignment shorthand is a stylistic choice. Leaving this rule turned off would allow developers to choose which style is more readable on a case-by-case basis.
diff --git a/eslint/docs/src/rules/operator-linebreak.md b/eslint/docs/src/rules/operator-linebreak.md
new file mode 100644 (file)
index 0000000..3994cb4
--- /dev/null
@@ -0,0 +1,384 @@
+---
+title: operator-linebreak
+layout: doc
+rule_type: layout
+related_rules:
+- comma-style
+---
+
+
+
+When a statement is too long to fit on a single line, line breaks are generally inserted next to the operators separating expressions. The first style coming to mind would be to place the operator at the end of the line, following the English punctuation rules.
+
+```js
+var fullHeight = borderTop +
+                 innerHeight +
+                 borderBottom;
+```
+
+Some developers find that placing operators at the beginning of the line makes the code more readable.
+
+```js
+var fullHeight = borderTop
+               + innerHeight
+               + borderBottom;
+```
+
+## Rule Details
+
+This rule enforces a consistent linebreak style for operators.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"after"` requires linebreaks to be placed after the operator
+* `"before"` requires linebreaks to be placed before the operator
+* `"none"` disallows linebreaks on either side of the operator
+
+Object option:
+
+* `"overrides"` overrides the global setting for specified operators
+
+The default configuration is `"after", { "overrides": { "?": "before", ":": "before" } }`
+
+### after
+
+Examples of **incorrect** code for this rule with the `"after"` option:
+
+::: incorrect
+
+```js
+/*eslint operator-linebreak: ["error", "after"]*/
+
+foo = 1
++
+2;
+
+foo = 1
+    + 2;
+
+foo
+    = 5;
+
+if (someCondition
+    || otherCondition) {
+}
+
+answer = everything
+  ? 42
+  : foo;
+
+class Foo {
+    a
+        = 1;
+    [b]
+        = 2;
+    [c
+    ]
+        = 3;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"after"` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "after"]*/
+
+foo = 1 + 2;
+
+foo = 1 +
+      2;
+
+foo =
+    5;
+
+if (someCondition ||
+    otherCondition) {
+}
+
+answer = everything ?
+  42 :
+  foo;
+
+class Foo {
+    a =
+        1;
+    [b] =
+        2;
+    [c
+    ] =
+        3;
+    d = 4;
+}
+```
+
+:::
+
+### before
+
+Examples of **incorrect** code for this rule with the `"before"` option:
+
+::: incorrect
+
+```js
+/*eslint operator-linebreak: ["error", "before"]*/
+
+foo = 1 +
+      2;
+
+foo =
+    5;
+
+if (someCondition ||
+    otherCondition) {
+}
+
+answer = everything ?
+  42 :
+  foo;
+
+class Foo {
+    a =
+        1;
+    [b] =
+        2;
+    [c
+    ] =
+        3;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"before"` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "before"]*/
+
+foo = 1 + 2;
+
+foo = 1
+    + 2;
+
+foo
+    = 5;
+
+if (someCondition
+    || otherCondition) {
+}
+
+answer = everything
+  ? 42
+  : foo;
+
+class Foo {
+    a
+        = 1;
+    [b]
+        = 2;
+    [c
+    ]
+        = 3;
+    d = 4;
+}
+```
+
+:::
+
+### none
+
+Examples of **incorrect** code for this rule with the `"none"` option:
+
+::: incorrect
+
+```js
+/*eslint operator-linebreak: ["error", "none"]*/
+
+foo = 1 +
+      2;
+
+foo = 1
+    + 2;
+
+if (someCondition ||
+    otherCondition) {
+}
+
+if (someCondition
+    || otherCondition) {
+}
+
+answer = everything
+  ? 42
+  : foo;
+
+answer = everything ?
+  42 :
+  foo;
+
+class Foo {
+    a =
+        1;
+    [b] =
+        2;
+    [c
+    ] =
+        3;
+    d
+        = 4;
+    [e]
+        = 5;
+    [f
+    ]
+        = 6;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"none"` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "none"]*/
+
+foo = 1 + 2;
+
+foo = 5;
+
+if (someCondition || otherCondition) {
+}
+
+answer = everything ? 42 : foo;
+
+class Foo {
+    a = 1;
+    [b] = 2;
+    [c
+    ] = 3;
+    d = 4;
+    [e] = 5;
+    [f
+    ] = 6;
+}
+```
+
+:::
+
+### overrides
+
+Examples of additional **incorrect** code for this rule with the `{ "overrides": { "+=": "before" } }` option:
+
+::: incorrect
+
+```js
+/*eslint operator-linebreak: ["error", "after", { "overrides": { "+=": "before" } }]*/
+
+var thing = 'thing';
+thing +=
+  's';
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "overrides": { "+=": "before" } }` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "after", { "overrides": { "+=": "before" } }]*/
+
+var thing = 'thing';
+thing
+  += 's';
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `{ "overrides": { "?": "ignore", ":": "ignore" } }` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]*/
+
+answer = everything ?
+  42
+  : foo;
+
+answer = everything
+  ?
+  42
+  :
+  foo;
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the default `"after", { "overrides": { "?": "before", ":": "before" } }` option:
+
+::: incorrect
+
+```js
+/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "before", ":": "before" } }]*/
+
+foo = 1
++
+2;
+
+foo = 1
+    + 2;
+
+foo
+    = 5;
+
+if (someCondition
+    || otherCondition) {
+}
+
+answer = everything ?
+  42 :
+  foo;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"after", { "overrides": { "?": "before", ":": "before" } }` option:
+
+::: correct
+
+```js
+/*eslint operator-linebreak: ["error", "after", { "overrides": { "?": "before", ":": "before" } }]*/
+
+foo = 1 + 2;
+
+foo = 1 +
+      2;
+
+foo =
+    5;
+
+if (someCondition ||
+    otherCondition) {
+}
+
+answer = everything
+  ? 42
+  : foo;
+```
+
+:::
+
+## When Not To Use It
+
+If your project will not be using a common operator line break style, turn this rule off.
diff --git a/eslint/docs/src/rules/padded-blocks.md b/eslint/docs/src/rules/padded-blocks.md
new file mode 100644 (file)
index 0000000..faa5333
--- /dev/null
@@ -0,0 +1,556 @@
+---
+title: padded-blocks
+layout: doc
+rule_type: layout
+related_rules:
+- lines-between-class-members
+- padding-line-between-statements
+---
+
+
+
+Some style guides require block statements to start and end with blank lines. The goal is
+to improve readability by visually separating the block content and the surrounding code.
+
+```js
+if (a) {
+
+    b();
+
+}
+```
+
+Since it's good to have a consistent code style, you should either always write
+padded blocks or never do it.
+
+## Rule Details
+
+This rule enforces consistent empty line padding within blocks.
+
+## Options
+
+This rule has two options, the first one can be a string option or an object option.
+The second one is an object option, it can allow exceptions.
+
+### First option
+
+String option:
+
+* `"always"` (default) requires empty lines at the beginning and ending of block statements, function bodies, class static blocks, classes, and `switch` statements.
+* `"never"` disallows empty lines at the beginning and ending of block statements, function bodies, class static blocks, classes, and `switch` statements.
+
+Object option:
+
+* `"blocks"` require or disallow padding within block statements, function bodies, and class static blocks
+* `"classes"` require or disallow padding within classes
+* `"switches"` require or disallow padding within `switch` statements
+
+### Second option
+
+* `"allowSingleLineBlocks": true` allows single-line blocks
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", "always"]*/
+
+if (a) {
+    b();
+}
+
+if (a) { b(); }
+
+if (a)
+{
+    b();
+}
+
+if (a) {
+    b();
+
+}
+
+if (a) {
+    // comment
+    b();
+
+}
+
+class C {
+    static {
+        a();
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", "always"]*/
+
+if (a) {
+
+    b();
+
+}
+
+if (a)
+{
+
+    b();
+
+}
+
+if (a) {
+
+    // comment
+    b();
+
+}
+
+class C {
+
+    static {
+
+        a();
+
+    }
+
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", "never"]*/
+
+if (a) {
+
+    b();
+
+}
+
+if (a)
+{
+
+    b();
+
+}
+
+if (a) {
+
+    b();
+}
+
+if (a) {
+    b();
+
+}
+
+class C {
+
+    static {
+
+        a();
+
+    }
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", "never"]*/
+
+if (a) {
+    b();
+}
+
+if (a)
+{
+    b();
+}
+
+class C {
+    static {
+        a();
+    }
+}
+```
+
+:::
+
+### blocks
+
+Examples of **incorrect** code for this rule with the `{ "blocks": "always" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "blocks": "always" }]*/
+
+if (a) {
+    b();
+}
+
+if (a) { b(); }
+
+if (a)
+{
+    b();
+}
+
+if (a) {
+
+    b();
+}
+
+if (a) {
+    b();
+
+}
+
+if (a) {
+    // comment
+    b();
+
+}
+
+class C {
+
+    static {
+        a();
+    }
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "blocks": "always" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "blocks": "always" }]*/
+
+if (a) {
+
+    b();
+
+}
+
+if (a)
+{
+
+    b();
+
+}
+
+if (a) {
+
+    // comment
+    b();
+
+}
+
+class C {
+
+    static {
+
+        a();
+
+    }
+
+}
+
+class D {
+    static {
+
+        a();
+
+    }
+
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "blocks": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "blocks": "never" }]*/
+
+if (a) {
+
+    b();
+
+}
+
+if (a)
+{
+
+    b();
+
+}
+
+if (a) {
+
+    b();
+}
+
+if (a) {
+    b();
+
+}
+
+class C {
+    static {
+
+        a();
+
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "blocks": "never" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "blocks": "never" }]*/
+
+if (a) {
+    b();
+}
+
+if (a)
+{
+    b();
+}
+
+class C {
+    static {
+        a();
+    }
+}
+
+class D {
+
+    static {
+        a();
+    }
+
+}
+```
+
+:::
+
+### classes
+
+Examples of **incorrect** code for this rule with the `{ "classes": "always" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "classes": "always" }]*/
+
+class  A {
+    constructor(){
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "classes": "always" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "classes": "always" }]*/
+
+class  A {
+
+    constructor(){
+    }
+
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "classes": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "classes": "never" }]*/
+
+class  A {
+
+    constructor(){
+    }
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "classes": "never" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "classes": "never" }]*/
+
+class  A {
+    constructor(){
+    }
+}
+```
+
+:::
+
+### switches
+
+Examples of **incorrect** code for this rule with the `{ "switches": "always" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "switches": "always" }]*/
+
+switch (a) {
+    case 0: foo();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "switches": "always" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "switches": "always" }]*/
+
+switch (a) {
+
+    case 0: foo();
+
+}
+
+if (a) {
+    b();
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{ "switches": "never" }` option:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", { "switches": "never" }]*/
+
+switch (a) {
+
+    case 0: foo();
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "switches": "never" }` option:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", { "switches": "never" }]*/
+
+switch (a) {
+    case 0: foo();
+}
+
+if (a) {
+
+    b();
+
+}
+```
+
+:::
+
+### always + allowSingleLineBlocks
+
+Examples of **incorrect** code for this rule with the `"always", {"allowSingleLineBlocks": true}` options:
+
+::: incorrect
+
+```js
+/*eslint padded-blocks: ["error", "always", { allowSingleLineBlocks: true }]*/
+
+if (a) {
+    b();
+}
+
+if (a) {
+
+    b();
+}
+
+if (a) {
+    b();
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", {"allowSingleLineBlocks": true}` options:
+
+::: correct
+
+```js
+/*eslint padded-blocks: ["error", "always", { allowSingleLineBlocks: true }]*/
+
+if (a) { b(); }
+
+if (a) {
+
+    b();
+
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of padding within blocks.
diff --git a/eslint/docs/src/rules/padding-line-between-statements.md b/eslint/docs/src/rules/padding-line-between-statements.md
new file mode 100644 (file)
index 0000000..a66fa89
--- /dev/null
@@ -0,0 +1,332 @@
+---
+title: padding-line-between-statements
+layout: doc
+rule_type: layout
+---
+
+
+
+This rule requires or disallows blank lines between the given 2 kinds of statements.
+Properly blank lines help developers to understand the code.
+
+For example, the following configuration requires a blank line between a variable declaration and a `return` statement.
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: "var", next: "return" }
+]*/
+
+function foo() {
+    var a = 1;
+
+    return a;
+}
+```
+
+## Rule Details
+
+This rule does nothing if no configurations are provided.
+
+A configuration is an object which has 3 properties; `blankLine`, `prev` and `next`. For example, `{ blankLine: "always", prev: "var", next: "return" }` means "one or more blank lines are required between a variable declaration and a `return` statement."
+You can supply any number of configurations. If a statement pair matches multiple configurations, the last matched configuration will be used.
+
+```json
+{
+    "padding-line-between-statements": [
+        "error",
+        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
+        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
+        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
+        { "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
+        ...
+    ]
+}
+```
+
+* `LINEBREAK_TYPE` is one of the following.
+    * `"any"` just ignores the statement pair.
+    * `"never"` disallows blank lines.
+    * `"always"` requires one or more blank lines. Note it does not count lines that comments exist as blank lines.
+
+* `STATEMENT_TYPE` is one of the following, or an array of the following.
+    * `"*"` is wildcard. This matches any statements.
+    * `"block"` is lonely blocks.
+    * `"block-like"` is block like statements. This matches statements that the last token is the closing brace of blocks; e.g. `{ }`, `if (a) { }`, and `while (a) { }`. Also matches immediately invoked function expression statements.
+    * `"break"` is `break` statements.
+    * `"case"` is `case` clauses in `switch` statements.
+    * `"cjs-export"` is `export` statements of CommonJS; e.g. `module.exports = 0`, `module.exports.foo = 1`, and `exports.foo = 2`. This is a special case of assignment.
+    * `"cjs-import"` is `import` statements of CommonJS; e.g. `const foo = require("foo")`. This is a special case of variable declarations.
+    * `"class"` is `class` declarations.
+    * `"const"` is `const` variable declarations, both single-line and multiline.
+    * `"continue"` is `continue` statements.
+    * `"debugger"` is `debugger` statements.
+    * `"default"` is `default` clauses in `switch` statements.
+    * `"directive"` is directive prologues. This matches directives; e.g. `"use strict"`.
+    * `"do"` is `do-while` statements. This matches all statements that the first token is `do` keyword.
+    * `"empty"` is empty statements.
+    * `"export"` is `export` declarations.
+    * `"expression"` is expression statements.
+    * `"for"` is `for` loop families. This matches all statements that the first token is `for` keyword.
+    * `"function"` is function declarations.
+    * `"if"` is `if` statements.
+    * `"iife"` is immediately invoked function expression statements. This matches calls on a function expression, optionally prefixed with a unary operator.
+    * `"import"` is `import` declarations.
+    * `"let"` is `let` variable declarations, both single-line and multiline.
+    * `"multiline-block-like"` is block like statements. This is the same as `block-like` type, but only if the block is multiline.
+    * `"multiline-const"` is multiline `const` variable declarations.
+    * `"multiline-expression"` is expression statements. This is the same as `expression` type, but only if the statement is multiline.
+    * `"multiline-let"` is multiline `let` variable declarations.
+    * `"multiline-var"` is multiline `var` variable declarations.
+    * `"return"` is `return` statements.
+    * `"singleline-const"` is single-line `const` variable declarations.
+    * `"singleline-let"` is single-line `let` variable declarations.
+    * `"singleline-var"` is single-line `var` variable declarations.
+    * `"switch"` is `switch` statements.
+    * `"throw"` is `throw` statements.
+    * `"try"` is `try` statements.
+    * `"var"` is `var` variable declarations, both single-line and multiline.
+    * `"while"` is `while` loop statements.
+    * `"with"` is `with` statements.
+
+## Examples
+
+This configuration would require blank lines before all `return` statements, like the [newline-before-return](newline-before-return) rule.
+
+Examples of **incorrect** code for the `[{ blankLine: "always", prev: "*", next: "return" }]` configuration:
+
+::: incorrect
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: "*", next: "return" }
+]*/
+
+function foo() {
+    bar();
+    return;
+}
+```
+
+:::
+
+Examples of **correct** code for the `[{ blankLine: "always", prev: "*", next: "return" }]` configuration:
+
+::: correct
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: "*", next: "return" }
+]*/
+
+function foo() {
+    bar();
+
+    return;
+}
+
+function foo() {
+    return;
+}
+```
+
+:::
+
+----
+
+This configuration would require blank lines after every sequence of variable declarations, like the [newline-after-var](newline-after-var) rule.
+
+Examples of **incorrect** code for the `[{ blankLine: "always", prev: ["const", "let", "var"], next: "*"}, { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]}]` configuration:
+
+::: incorrect
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: ["const", "let", "var"], next: "*"},
+    { blankLine: "any",    prev: ["const", "let", "var"], next: ["const", "let", "var"]}
+]*/
+
+function foo() {
+    var a = 0;
+    bar();
+}
+
+function foo() {
+    let a = 0;
+    bar();
+}
+
+function foo() {
+    const a = 0;
+    bar();
+}
+
+class C {
+    static {
+        let a = 0;
+        bar();
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for the `[{ blankLine: "always", prev: ["const", "let", "var"], next: "*"}, { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]}]` configuration:
+
+::: correct
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: ["const", "let", "var"], next: "*"},
+    { blankLine: "any",    prev: ["const", "let", "var"], next: ["const", "let", "var"]}
+]*/
+
+function foo() {
+    var a = 0;
+    var b = 0;
+
+    bar();
+}
+
+function foo() {
+    let a = 0;
+    const b = 0;
+
+    bar();
+}
+
+function foo() {
+    const a = 0;
+    const b = 0;
+
+    bar();
+}
+
+class C {
+    static {
+        let a = 0;
+        let b = 0;
+
+        bar();
+    }
+}
+```
+
+:::
+
+----
+
+This configuration would require blank lines after all directive prologues, like the [lines-around-directive](lines-around-directive) rule.
+
+Examples of **incorrect** code for the `[{ blankLine: "always", prev: "directive", next: "*" }, { blankLine: "any", prev: "directive", next: "directive" }]` configuration:
+
+::: incorrect
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: "directive", next: "*" },
+    { blankLine: "any",    prev: "directive", next: "directive" }
+]*/
+
+"use strict";
+foo();
+```
+
+:::
+
+Examples of **correct** code for the `[{ blankLine: "always", prev: "directive", next: "*" }, { blankLine: "any", prev: "directive", next: "directive" }]` configuration:
+
+::: correct
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: "directive", next: "*" },
+    { blankLine: "any",    prev: "directive", next: "directive" }
+]*/
+
+"use strict";
+"use asm";
+
+foo();
+```
+
+:::
+
+----
+
+This configuration would require blank lines between clauses in `switch` statements.
+
+Examples of **incorrect** code for the `[{ blankLine: "always", prev: ["case", "default"], next: "*" }]` configuration:
+
+::: incorrect
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: ["case", "default"], next: "*" }
+]*/
+
+switch (foo) {
+    case 1:
+        bar();
+        break;
+    case 2:
+    case 3:
+        baz();
+        break;
+    default:
+        quux();
+}
+```
+
+:::
+
+Examples of **correct** code for the `[{ blankLine: "always", prev: ["case", "default"], next: "*" }]` configuration:
+
+::: correct
+
+```js
+/*eslint padding-line-between-statements: [
+    "error",
+    { blankLine: "always", prev: ["case", "default"], next: "*" }
+]*/
+
+switch (foo) {
+    case 1:
+        bar();
+        break;
+
+    case 2:
+
+    case 3:
+        baz();
+        break;
+
+    default:
+        quux();
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify warnings about linebreaks, then it's safe to disable this rule.
+
+## Compatibility
+
+* **JSCS:** [requirePaddingNewLineAfterVariableDeclaration](https://jscs-dev.github.io/rule/requirePaddingNewLineAfterVariableDeclaration)
+* **JSCS:** [requirePaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterBlocks)
+* **JSCS:** [disallowPaddingNewLinesAfterBlocks](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterBlocks)
+* **JSCS:** [requirePaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/requirePaddingNewLinesAfterUseStrict)
+* **JSCS:** [disallowPaddingNewLinesAfterUseStrict](https://jscs-dev.github.io/rule/disallowPaddingNewLinesAfterUseStrict)
+* **JSCS:** [requirePaddingNewLinesBeforeExport](https://jscs-dev.github.io/rule/requirePaddingNewLinesBeforeExport)
+* **JSCS:** [disallowPaddingNewLinesBeforeExport](https://jscs-dev.github.io/rule/disallowPaddingNewLinesBeforeExport)
+* **JSCS:** [requirePaddingNewlinesBeforeKeywords](https://jscs-dev.github.io/rule/requirePaddingNewlinesBeforeKeywords)
+* **JSCS:** [disallowPaddingNewlinesBeforeKeywords](https://jscs-dev.github.io/rule/disallowPaddingNewlinesBeforeKeywords)
diff --git a/eslint/docs/src/rules/prefer-arrow-callback.md b/eslint/docs/src/rules/prefer-arrow-callback.md
new file mode 100644 (file)
index 0000000..0534ccd
--- /dev/null
@@ -0,0 +1,104 @@
+---
+title: prefer-arrow-callback
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
+---
+
+
+
+Arrow functions can be an attractive alternative to function expressions for callbacks or function arguments.
+
+For example, arrow functions are automatically bound to their surrounding scope/context. This provides an alternative to the pre-ES6 standard of explicitly binding function expressions to achieve similar behavior.
+
+Additionally, arrow functions are:
+
+* less verbose, and easier to reason about.
+
+* bound lexically regardless of where or when they are invoked.
+
+## Rule Details
+
+This rule locates function expressions used as callbacks or function arguments. An error will be produced for any that could be replaced by an arrow function without changing the result.
+
+The following examples **will** be flagged:
+
+```js
+/* eslint prefer-arrow-callback: "error" */
+
+foo(function(a) { return a; }); // ERROR
+// prefer: foo(a => a)
+
+foo(function() { return this.a; }.bind(this)); // ERROR
+// prefer: foo(() => this.a)
+```
+
+Instances where an arrow function would not produce identical results will be ignored.
+
+The following examples **will not** be flagged:
+
+```js
+/* eslint prefer-arrow-callback: "error" */
+/* eslint-env es6 */
+
+// arrow function callback
+foo(a => a); // OK
+
+// generator as callback
+foo(function*() { yield; }); // OK
+
+// function expression not used as callback or function argument
+var foo = function foo(a) { return a; }; // OK
+
+// unbound function expression callback
+foo(function() { return this.a; }); // OK
+
+// recursive named function callback
+foo(function bar(n) { return n && n + bar(n - 1); }); // OK
+```
+
+## Options
+
+Access further control over this rule's behavior via an options object.
+
+Default: `{ allowNamedFunctions: false, allowUnboundThis: true }`
+
+### allowNamedFunctions
+
+By default `{ "allowNamedFunctions": false }`, this `boolean` option prohibits using named functions as callbacks or function arguments.
+
+Changing this value to `true` will reverse this option's behavior by allowing use of named functions without restriction.
+
+`{ "allowNamedFunctions": true }` **will not** flag the following example:
+
+```js
+/* eslint prefer-arrow-callback: [ "error", { "allowNamedFunctions": true } ] */
+
+foo(function bar() {});
+```
+
+### allowUnboundThis
+
+By default `{ "allowUnboundThis": true }`, this `boolean` option allows function expressions containing `this` to be used as callbacks, as long as the function in question has not been explicitly bound.
+
+When set to `false` this option prohibits the use of function expressions as callbacks or function arguments entirely, without exception.
+
+`{ "allowUnboundThis": false }` **will** flag the following examples:
+
+```js
+/* eslint prefer-arrow-callback: [ "error", { "allowUnboundThis": false } ] */
+/* eslint-env es6 */
+
+foo(function() { this.a; });
+
+foo(function() { (() => this); });
+
+someArray.map(function(item) { return this.doSomething(item); }, someObject);
+```
+
+## When Not To Use It
+
+* In environments that have not yet adopted ES6 language features (ES3/5).
+
+* In ES6+ environments that allow the use of function expressions when describing callbacks or function arguments.
diff --git a/eslint/docs/src/rules/prefer-const.md b/eslint/docs/src/rules/prefer-const.md
new file mode 100644 (file)
index 0000000..2892bea
--- /dev/null
@@ -0,0 +1,256 @@
+---
+title: prefer-const
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-var
+- no-use-before-define
+---
+
+
+
+If a variable is never reassigned, using the `const` declaration is better.
+
+`const` declaration tells readers, "this variable is never reassigned," reducing cognitive load and improving maintainability.
+
+## Rule Details
+
+This rule is aimed at flagging variables that are declared using `let` keyword, but never reassigned after the initial assignment.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-const: "error"*/
+
+// it's initialized and never reassigned.
+let a = 3;
+console.log(a);
+
+let a;
+a = 0;
+console.log(a);
+
+class C {
+    static {
+        let a;
+        a = 0;
+        console.log(a);
+    }
+}
+
+// `i` is redefined (not reassigned) on each loop step.
+for (let i in [1, 2, 3]) {
+    console.log(i);
+}
+
+// `a` is redefined (not reassigned) on each loop step.
+for (let a of [1, 2, 3]) {
+    console.log(a);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-const: "error"*/
+
+// using const.
+const a = 0;
+
+// it's never initialized.
+let a;
+console.log(a);
+
+// it's reassigned after initialized.
+let a;
+a = 0;
+a = 1;
+console.log(a);
+
+// it's initialized in a different block from the declaration.
+let a;
+if (true) {
+    a = 0;
+}
+console.log(a);
+
+// it's initialized in a different scope.
+let a;
+class C {
+    #x;
+    static {
+        a = obj => obj.#x;
+    }
+}
+
+// it's initialized at a place that we cannot write a variable declaration.
+let a;
+if (true) a = 0;
+console.log(a);
+
+// `i` gets a new binding each iteration
+for (const i in [1, 2, 3]) {
+  console.log(i);
+}
+
+// `a` gets a new binding each iteration
+for (const a of [1, 2, 3]) {
+  console.log(a);
+}
+
+// `end` is never reassigned, but we cannot separate the declarations without modifying the scope.
+for (let i = 0, end = 10; i < end; ++i) {
+    console.log(a);
+}
+
+// `predicate` is only assigned once but cannot be separately declared as `const`
+let predicate;
+[object.type, predicate] = foo();
+
+// `a` is only assigned once but cannot be separately declared as `const`
+let a;
+const b = {};
+({ a, c: b.c } = func());
+
+// suggest to use `no-var` rule.
+var b = 3;
+console.log(b);
+```
+
+:::
+
+## Options
+
+```json
+{
+    "prefer-const": ["error", {
+        "destructuring": "any",
+        "ignoreReadBeforeAssign": false
+    }]
+}
+```
+
+### destructuring
+
+The kind of the way to address variables in destructuring.
+There are 2 values:
+
+* `"any"` (default) - If any variables in destructuring should be `const`, this rule warns for those variables.
+* `"all"` - If all variables in destructuring should be `const`, this rule warns the variables. Otherwise, ignores them.
+
+Examples of **incorrect** code for the default `{"destructuring": "any"}` option:
+
+::: incorrect
+
+```js
+/*eslint prefer-const: "error"*/
+/*eslint-env es6*/
+
+let {a, b} = obj;    /*error 'b' is never reassigned, use 'const' instead.*/
+a = a + 1;
+```
+
+:::
+
+Examples of **correct** code for the default `{"destructuring": "any"}` option:
+
+::: correct
+
+```js
+/*eslint prefer-const: "error"*/
+/*eslint-env es6*/
+
+// using const.
+const {a: a0, b} = obj;
+const a = a0 + 1;
+
+// all variables are reassigned.
+let {a, b} = obj;
+a = a + 1;
+b = b + 1;
+```
+
+:::
+
+Examples of **incorrect** code for the `{"destructuring": "all"}` option:
+
+::: incorrect
+
+```js
+/*eslint prefer-const: ["error", {"destructuring": "all"}]*/
+/*eslint-env es6*/
+
+// all of `a` and `b` should be const, so those are warned.
+let {a, b} = obj;    /*error 'a' is never reassigned, use 'const' instead.
+                             'b' is never reassigned, use 'const' instead.*/
+```
+
+:::
+
+Examples of **correct** code for the `{"destructuring": "all"}` option:
+
+::: correct
+
+```js
+/*eslint prefer-const: ["error", {"destructuring": "all"}]*/
+/*eslint-env es6*/
+
+// 'b' is never reassigned, but all of `a` and `b` should not be const, so those are ignored.
+let {a, b} = obj;
+a = a + 1;
+```
+
+:::
+
+### ignoreReadBeforeAssign
+
+This is an option to avoid conflicting with `no-use-before-define` rule (without `"nofunc"` option).
+If `true` is specified, this rule will ignore variables that are read between the declaration and the first assignment.
+Default is `false`.
+
+Examples of **correct** code for the `{"ignoreReadBeforeAssign": true}` option:
+
+::: correct
+
+```js
+/*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": true}]*/
+/*eslint-env es6*/
+
+let timer;
+function initialize() {
+    if (foo()) {
+        clearInterval(timer);
+    }
+}
+timer = setInterval(initialize, 100);
+```
+
+:::
+
+Examples of **correct** code for the default `{"ignoreReadBeforeAssign": false}` option:
+
+::: correct
+
+```js
+/*eslint prefer-const: ["error", {"ignoreReadBeforeAssign": false}]*/
+/*eslint-env es6*/
+
+const timer = setInterval(initialize, 100);
+function initialize() {
+    if (foo()) {
+        clearInterval(timer);
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about variables that are never reassigned after initial assignment, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/prefer-destructuring.md b/eslint/docs/src/rules/prefer-destructuring.md
new file mode 100644 (file)
index 0000000..da9e358
--- /dev/null
@@ -0,0 +1,217 @@
+---
+title: prefer-destructuring
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
+- https://2ality.com/2015/01/es6-destructuring.html
+---
+
+
+
+With JavaScript ES6, a new syntax was added for creating variables from an array index or object property, called [destructuring](#further-reading).  This rule enforces usage of destructuring instead of accessing a property through a member expression.
+
+## Rule Details
+
+### Options
+
+This rule takes two sets of configuration objects. The first object parameter determines what types of destructuring the rule applies to.
+
+The two properties, `array` and `object`, can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.
+
+Alternatively, you can use separate configurations for different assignment types. It accepts 2 other keys instead of `array` and `object`.
+
+One key is `VariableDeclarator` and the other is `AssignmentExpression`, which can be used to control the destructuring requirement for each of those types independently. Each property accepts an object that accepts two properties, `array` and `object`, which can be used to control the destructuring requirement for each of `array` and `object` independently for variable declarations and assignment expressions.  By default, `array` and `object` are set to true for both `VariableDeclarator` and `AssignmentExpression`.
+
+The rule has a second object with a single key, `enforceForRenamedProperties`, which determines whether the `object` destructuring applies to renamed variables.
+
+**Note**: It is not possible to determine if a variable will be referring to an object or an array at runtime. This rule therefore guesses the assignment type by checking whether the key being accessed is an integer. This can lead to the following possibly confusing situations:
+
+* Accessing an object property whose key is an integer will fall under the category `array` destructuring.
+* Accessing an array element through a computed index will fall under the category `object` destructuring.
+
+The `--fix` option on the command line fixes only problems reported in variable declarations, and among them only those that fall under the category `object` destructuring. Furthermore, the name of the declared variable has to be the same as the name used for non-computed member access in the initializer. For example, `var foo = object.foo` can be automatically fixed by this rule. Problems that involve computed member access (e.g., `var foo = object[foo]`) or renamed properties (e.g., `var foo = object.bar`) are not automatically fixed.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```javascript
+// With `array` enabled
+var foo = array[0];
+
+// With `object` enabled
+var foo = object.foo;
+var foo = object['foo'];
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```javascript
+// With `array` enabled
+var [ foo ] = array;
+var foo = array[someIndex];
+
+// With `object` enabled
+var { foo } = object;
+
+var foo = object.bar;
+
+let foo;
+({ foo } = object);
+```
+
+:::
+
+Examples of **incorrect** code when `enforceForRenamedProperties` is enabled:
+
+::: incorrect
+
+```javascript
+var foo = object.bar;
+```
+
+:::
+
+Examples of **correct** code when `enforceForRenamedProperties` is enabled:
+
+::: correct
+
+```javascript
+var { bar: foo } = object;
+```
+
+:::
+
+Examples of additional **correct** code when `enforceForRenamedProperties` is enabled:
+
+::: correct
+
+```javascript
+class C {
+    #x;
+    foo() {
+        const bar = this.#x; // private identifiers are not allowed in destructuring
+    }
+}
+```
+
+:::
+
+An example configuration, with the defaults `array` and `object` filled in, looks like this:
+
+```json
+{
+  "rules": {
+    "prefer-destructuring": ["error", {
+      "array": true,
+      "object": true
+    }, {
+      "enforceForRenamedProperties": false
+    }]
+  }
+}
+```
+
+The two properties, `array` and `object`, which can be used to turn on or off the destructuring requirement for each of those types independently. By default, both are true.
+
+For example, the following configuration enforces only object destructuring, but not array destructuring:
+
+```json
+{
+  "rules": {
+    "prefer-destructuring": ["error", {"object": true, "array": false}]
+  }
+}
+```
+
+An example configuration, with the defaults `VariableDeclarator` and `AssignmentExpression` filled in, looks like this:
+
+```json
+{
+  "rules": {
+    "prefer-destructuring": ["error", {
+      "VariableDeclarator": {
+        "array": false,
+        "object": true
+      },
+      "AssignmentExpression": {
+        "array": true,
+        "object": true
+      }
+    }, {
+      "enforceForRenamedProperties": false
+    }]
+  }
+}
+```
+
+The two properties, `VariableDeclarator` and `AssignmentExpression`, which can be used to turn on or off the destructuring requirement for `array` and `object`. By default, all values are true.
+
+For example, the following configuration enforces object destructuring in variable declarations and enforces array destructuring in assignment expressions.
+
+```json
+{
+  "rules": {
+    "prefer-destructuring": ["error", {
+      "VariableDeclarator": {
+        "array": false,
+        "object": true
+      },
+      "AssignmentExpression": {
+        "array": true,
+        "object": false
+      }
+    }, {
+      "enforceForRenamedProperties": false
+    }]
+  }
+}
+
+```
+
+Examples of **correct** code when object destructuring in `VariableDeclarator` is enforced:
+
+::: correct
+
+```javascript
+/* eslint prefer-destructuring: ["error", {VariableDeclarator: {object: true}}] */
+var {bar: foo} = object;
+```
+
+:::
+
+Examples of **correct** code when array destructuring in `AssignmentExpression` is enforced:
+
+::: correct
+
+```javascript
+/* eslint prefer-destructuring: ["error", {AssignmentExpression: {array: true}}] */
+[bar] = array;
+```
+
+:::
+
+## When Not To Use It
+
+If you want to be able to access array indices or object properties directly, you can either configure the rule to your tastes or disable the rule entirely.
+
+Additionally, if you intend to access large array indices directly, like:
+
+```javascript
+var foo = array[100];
+```
+
+Then the `array` part of this rule is not recommended, as destructuring does not match this use case very well.
+
+Or for non-iterable 'array-like' objects:
+
+```javascript
+var $ = require('jquery');
+var foo = $('body')[0];
+var [bar] = $('body'); // fails with a TypeError
+```
diff --git a/eslint/docs/src/rules/prefer-exponentiation-operator.md b/eslint/docs/src/rules/prefer-exponentiation-operator.md
new file mode 100644 (file)
index 0000000..d29d467
--- /dev/null
@@ -0,0 +1,58 @@
+---
+title: prefer-exponentiation-operator
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation
+- https://bugs.chromium.org/p/v8/issues/detail?id=5848
+---
+
+
+
+Introduced in ES2016, the infix exponentiation operator `**` is an alternative for the standard `Math.pow` function.
+
+Infix notation is considered to be more readable and thus more preferable than the function notation.
+
+## Rule Details
+
+This rule disallows calls to `Math.pow` and suggests using the `**` operator instead.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-exponentiation-operator: "error"*/
+
+const foo = Math.pow(2, 8);
+
+const bar = Math.pow(a, b);
+
+let baz = Math.pow(a + b, c + d);
+
+let quux = Math.pow(-1, n);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-exponentiation-operator: "error"*/
+
+const foo = 2 ** 8;
+
+const bar = a ** b;
+
+let baz = (a + b) ** (c + d);
+
+let quux = (-1) ** n;
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used unless ES2016 is supported in your codebase.
diff --git a/eslint/docs/src/rules/prefer-named-capture-group.md b/eslint/docs/src/rules/prefer-named-capture-group.md
new file mode 100644 (file)
index 0000000..459e063
--- /dev/null
@@ -0,0 +1,60 @@
+---
+title: prefer-named-capture-group
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-invalid-regexp
+---
+
+
+## Rule Details
+
+With the landing of ECMAScript 2018, named capture groups can be used in regular expressions, which can improve their readability.
+This rule is aimed at using named capture groups instead of numbered capture groups in regular expressions:
+
+```js
+const regex = /(?<year>[0-9]{4})/;
+```
+
+Alternatively, if your intention is not to _capture_ the results, but only express the alternative, use a non-capturing group:
+
+```js
+const regex = /(?:cauli|sun)flower/;
+```
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-named-capture-group: "error"*/
+
+const foo = /(ba[rz])/;
+const bar = new RegExp('(ba[rz])');
+const baz = RegExp('(ba[rz])');
+
+foo.exec('bar')[1]; // Retrieve the group result.
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-named-capture-group: "error"*/
+
+const foo = /(?<id>ba[rz])/;
+const bar = new RegExp('(?<id>ba[rz])');
+const baz = RegExp('(?<id>ba[rz])');
+const xyz = /xyz(?:zy|abc)/;
+
+foo.exec('bar').groups.id; // Retrieve the group result.
+```
+
+:::
+
+## When Not To Use It
+
+If you are targeting ECMAScript 2017 and/or older environments, you should not use this rule, because this ECMAScript feature is only supported in ECMAScript 2018 and/or newer environments.
diff --git a/eslint/docs/src/rules/prefer-numeric-literals.md b/eslint/docs/src/rules/prefer-numeric-literals.md
new file mode 100644 (file)
index 0000000..33109f5
--- /dev/null
@@ -0,0 +1,71 @@
+---
+title: prefer-numeric-literals
+layout: doc
+rule_type: suggestion
+---
+
+
+
+The `parseInt()` and `Number.parseInt()` functions can be used to turn binary, octal, and hexadecimal strings into integers. As binary, octal, and hexadecimal literals are supported in ES6, this rule encourages use of those numeric literals instead of `parseInt()` or `Number.parseInt()`.
+
+```js
+0b111110111 === 503;
+0o767 === 503;
+```
+
+## Rule Details
+
+This rule disallows calls to `parseInt()` or `Number.parseInt()` if called with two arguments: a string; and a radix option of 2 (binary), 8 (octal), or 16 (hexadecimal).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-numeric-literals: "error"*/
+
+parseInt("111110111", 2) === 503;
+parseInt(`111110111`, 2) === 503;
+parseInt("767", 8) === 503;
+parseInt("1F7", 16) === 503;
+Number.parseInt("111110111", 2) === 503;
+Number.parseInt("767", 8) === 503;
+Number.parseInt("1F7", 16) === 503;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-numeric-literals: "error"*/
+/*eslint-env es6*/
+
+parseInt(1);
+parseInt(1, 3);
+Number.parseInt(1);
+Number.parseInt(1, 3);
+
+0b111110111 === 503;
+0o767 === 503;
+0x1F7 === 503;
+
+a[parseInt](1,2);
+
+parseInt(foo);
+parseInt(foo, 2);
+Number.parseInt(foo);
+Number.parseInt(foo, 2);
+```
+
+:::
+
+## When Not To Use It
+
+If you want to allow use of `parseInt()` or `Number.parseInt()` for binary, octal, or hexadecimal integers, or if you are not using ES6 (because binary and octal literals are not supported in ES5 and below), you may wish to disable this rule.
+
+## Compatibility
+
+* **JSCS**: [requireNumericLiterals](https://jscs-dev.github.io/rule/requireNumericLiterals)
diff --git a/eslint/docs/src/rules/prefer-object-has-own.md b/eslint/docs/src/rules/prefer-object-has-own.md
new file mode 100644 (file)
index 0000000..504847f
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: prefer-object-has-own
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
+---
+
+
+
+It is very common to write code like:
+
+```js
+if (Object.prototype.hasOwnProperty.call(object, "foo")) {
+  console.log("has property foo");
+}
+```
+
+This is a common practice because methods on `Object.prototype` can sometimes be unavailable or redefined (see the [no-prototype-builtins](no-prototype-builtins) rule).
+
+Introduced in ES2022, `Object.hasOwn()` is a shorter alternative to `Object.prototype.hasOwnProperty.call()`:
+
+```js
+if (Object.hasOwn(object, "foo")) {
+  console.log("has property foo")
+}
+```
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-object-has-own: "error"*/
+
+Object.prototype.hasOwnProperty.call(obj, "a");
+
+Object.hasOwnProperty.call(obj, "a");
+
+({}).hasOwnProperty.call(obj, "a");
+
+const hasProperty = Object.prototype.hasOwnProperty.call(object, property);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-object-has-own: "error"*/
+
+Object.hasOwn(obj, "a");
+
+const hasProperty = Object.hasOwn(object, property);
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used unless ES2022 is supported in your codebase.
diff --git a/eslint/docs/src/rules/prefer-object-spread.md b/eslint/docs/src/rules/prefer-object-spread.md
new file mode 100644 (file)
index 0000000..7b447e8
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: prefer-object-spread
+layout: doc
+rule_type: suggestion
+---
+
+
+
+When Object.assign is called using an object literal as the first argument, this rule requires using the object spread syntax instead. This rule also warns on cases where an `Object.assign` call is made using a single argument that is an object literal, in this case, the `Object.assign` call is not needed.
+
+Introduced in ES2018, object spread is a declarative alternative which may perform better than the more dynamic, imperative `Object.assign`.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-object-spread: "error"*/
+
+Object.assign({}, foo);
+
+Object.assign({}, {foo: 'bar'});
+
+Object.assign({ foo: 'bar'}, baz);
+
+Object.assign({}, baz, { foo: 'bar' });
+
+Object.assign({}, { ...baz });
+
+// Object.assign with a single argument that is an object literal
+Object.assign({});
+
+Object.assign({ foo: bar });
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-object-spread: "error"*/
+
+({ ...foo });
+
+({ ...baz, foo: 'bar' });
+
+// Any Object.assign call without an object literal as the first argument
+Object.assign(foo, { bar: baz });
+
+Object.assign(foo, bar);
+
+Object.assign(foo, { bar, baz });
+
+Object.assign(foo, { ...baz });
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used unless ES2018 is supported in your codebase.
diff --git a/eslint/docs/src/rules/prefer-promise-reject-errors.md b/eslint/docs/src/rules/prefer-promise-reject-errors.md
new file mode 100644 (file)
index 0000000..90164bd
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: prefer-promise-reject-errors
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-throw-literal
+further_reading:
+- http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error
+---
+
+
+It is considered good practice to only pass instances of the built-in `Error` object to the `reject()` function for user-defined errors in Promises. `Error` objects automatically store a stack trace, which can be used to debug an error by determining where it came from. If a Promise is rejected with a non-`Error` value, it can be difficult to determine where the rejection occurred.
+
+## Rule Details
+
+This rule aims to ensure that Promises are only rejected with `Error` objects.
+
+## Options
+
+This rule takes one optional object argument:
+
+* `allowEmptyReject: true` (`false` by default) allows calls to `Promise.reject()` with no arguments.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-promise-reject-errors: "error"*/
+
+Promise.reject("something bad happened");
+
+Promise.reject(5);
+
+Promise.reject();
+
+new Promise(function(resolve, reject) {
+  reject("something bad happened");
+});
+
+new Promise(function(resolve, reject) {
+  reject();
+});
+
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-promise-reject-errors: "error"*/
+
+Promise.reject(new Error("something bad happened"));
+
+Promise.reject(new TypeError("something bad happened"));
+
+new Promise(function(resolve, reject) {
+  reject(new Error("something bad happened"));
+});
+
+var foo = getUnknownValue();
+Promise.reject(foo);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `allowEmptyReject: true` option:
+
+::: correct
+
+```js
+/*eslint prefer-promise-reject-errors: ["error", {"allowEmptyReject": true}]*/
+
+Promise.reject();
+
+new Promise(function(resolve, reject) {
+  reject();
+});
+```
+
+:::
+
+## Known Limitations
+
+Due to the limits of static analysis, this rule cannot guarantee that you will only reject Promises with `Error` objects. While the rule will report cases where it can guarantee that the rejection reason is clearly not an `Error`, it will not report cases where there is uncertainty about whether a given reason is an `Error`. For more information on this caveat, see the [similar limitations](no-throw-literal#known-limitations) in the `no-throw-literal` rule.
+
+To avoid conflicts between rules, this rule does not report non-error values used in `throw` statements in async functions, even though these lead to Promise rejections. To lint for these cases, use the [`no-throw-literal`](no-throw-literal) rule.
+
+## When Not To Use It
+
+If you're using custom non-error values as Promise rejection reasons, you can turn off this rule.
diff --git a/eslint/docs/src/rules/prefer-reflect.md b/eslint/docs/src/rules/prefer-reflect.md
new file mode 100644 (file)
index 0000000..ea2ee7d
--- /dev/null
@@ -0,0 +1,454 @@
+---
+title: prefer-reflect
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-useless-call
+- prefer-spread
+- no-delete-var
+---
+
+
+This rule was **deprecated** in ESLint v3.9.0 and will not be replaced. The original intent of this rule now seems misguided as we have come to understand that `Reflect` methods are not actually intended to replace the `Object` counterparts the rule suggests, but rather exist as low-level primitives to be used with proxies in order to replicate the default behavior of various previously existing functionality.
+
+The ES6 Reflect API comes with a handful of methods which somewhat deprecate methods on old constructors:
+
+* [`Reflect.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.apply) effectively deprecates [`Function.prototype.apply`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.apply) and [`Function.prototype.call`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-function.prototype.call)
+* [`Reflect.deleteProperty`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.deleteproperty) effectively deprecates the [`delete` keyword](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-delete-operator-runtime-semantics-evaluation)
+* [`Reflect.getOwnPropertyDescriptor`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.getownpropertydescriptor) effectively deprecates [`Object.getOwnPropertyDescriptor`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.getownpropertydescriptor)
+* [`Reflect.getPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.getprototypeof) effectively deprecates [`Object.getPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.getprototypeof)
+* [`Reflect.setPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.setprototypeof) effectively deprecates [`Object.setPrototypeOf`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof)
+* [`Reflect.preventExtensions`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-reflect.preventextensions)  effectively deprecates [`Object.preventExtensions`](https://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.preventextensions)
+
+The prefer-reflect rule will flag usage of any older method, suggesting to instead use the newer Reflect version.
+
+## Rule Details
+
+## Options
+
+### Exceptions
+
+```js
+"prefer-reflect": [<enabled>, { "exceptions": [<...exceptions>] }]
+```
+
+The `exceptions` option allows you to pass an array of methods names you'd like to continue to use in the old style.
+
+For example if you wish to use all Reflect methods, except for `Function.prototype.apply` then your config would look like `prefer-reflect: [2, { "exceptions": ["apply"] }]`.
+
+If you want to use Reflect methods, but keep using the `delete` keyword, then your config would look like `prefer-reflect: [2, { "exceptions": ["delete"] }]`.
+
+These can be combined as much as you like. To make all methods exceptions (thereby rendering this rule useless), use `prefer-reflect: [2, { "exceptions": ["apply", "call", "defineProperty", "getOwnPropertyDescriptor", "getPrototypeOf", "setPrototypeOf", "isExtensible", "getOwnPropertyNames", "preventExtensions", "delete"] }]`
+
+### Reflect.apply
+
+Deprecates `Function.prototype.apply()` and `Function.prototype.call()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+myFunction.apply(undefined, args);
+myFunction.apply(null, args);
+obj.myMethod.apply(obj, args);
+obj.myMethod.apply(other, args);
+
+myFunction.call(undefined, arg);
+myFunction.call(null, arg);
+obj.myMethod.call(obj, arg);
+obj.myMethod.call(other, arg);
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.apply(myFunction, undefined, args);
+Reflect.apply(myFunction, null, args);
+Reflect.apply(obj.myMethod, obj, args);
+Reflect.apply(obj.myMethod, other, args);
+Reflect.apply(myFunction, undefined, [arg]);
+Reflect.apply(myFunction, null, [arg]);
+Reflect.apply(obj.myMethod, obj, [arg]);
+Reflect.apply(obj.myMethod, other, [arg]);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["apply"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["apply"] }]*/
+
+// in addition to Reflect.apply(...):
+myFunction.apply(undefined, args);
+myFunction.apply(null, args);
+obj.myMethod.apply(obj, args);
+obj.myMethod.apply(other, args);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["call"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["call"] }]*/
+
+// in addition to Reflect.apply(...):
+myFunction.call(undefined, arg);
+myFunction.call(null, arg);
+obj.myMethod.call(obj, arg);
+obj.myMethod.call(other, arg);
+```
+
+:::
+
+### Reflect.defineProperty
+
+Deprecates `Object.defineProperty()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.defineProperty({}, 'foo', {value: 1})
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.defineProperty({}, 'foo', {value: 1})
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["defineProperty"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["defineProperty"] }]*/
+
+Object.defineProperty({}, 'foo', {value: 1})
+Reflect.defineProperty({}, 'foo', {value: 1})
+```
+
+:::
+
+### Reflect.getOwnPropertyDescriptor
+
+Deprecates `Object.getOwnPropertyDescriptor()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.getOwnPropertyDescriptor({}, 'foo')
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.getOwnPropertyDescriptor({}, 'foo')
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["getOwnPropertyDescriptor"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["getOwnPropertyDescriptor"] }]*/
+
+Object.getOwnPropertyDescriptor({}, 'foo')
+Reflect.getOwnPropertyDescriptor({}, 'foo')
+```
+
+:::
+
+### Reflect.getPrototypeOf
+
+Deprecates `Object.getPrototypeOf()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.getPrototypeOf({}, 'foo')
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.getPrototypeOf({}, 'foo')
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["getPrototypeOf"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["getPrototypeOf"] }]*/
+
+Object.getPrototypeOf({}, 'foo')
+Reflect.getPrototypeOf({}, 'foo')
+```
+
+:::
+
+### Reflect.setPrototypeOf
+
+Deprecates `Object.setPrototypeOf()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.setPrototypeOf({}, Object.prototype)
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.setPrototypeOf({}, Object.prototype)
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["setPrototypeOf"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["setPrototypeOf"] }]*/
+
+Object.setPrototypeOf({}, Object.prototype)
+Reflect.setPrototypeOf({}, Object.prototype)
+```
+
+:::
+
+### Reflect.isExtensible
+
+Deprecates `Object.isExtensible`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.isExtensible({})
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.isExtensible({})
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["isExtensible"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["isExtensible"] }]*/
+
+Object.isExtensible({})
+Reflect.isExtensible({})
+```
+
+:::
+
+### Reflect.getOwnPropertyNames
+
+Deprecates `Object.getOwnPropertyNames()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.getOwnPropertyNames({})
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.getOwnPropertyNames({})
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["getOwnPropertyNames"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["getOwnPropertyNames"] }]*/
+
+Object.getOwnPropertyNames({})
+Reflect.getOwnPropertyNames({})
+```
+
+:::
+
+### Reflect.preventExtensions
+
+Deprecates `Object.preventExtensions()`
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Object.preventExtensions({})
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+Reflect.preventExtensions({})
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["preventExtensions"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["preventExtensions"] }]*/
+
+Object.preventExtensions({})
+Reflect.preventExtensions({})
+```
+
+:::
+
+### Reflect.deleteProperty
+
+Deprecates the `delete` keyword
+
+Examples of **incorrect** code for this rule when used without exceptions:
+
+::: incorrect
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+delete foo.bar; // deleting object property
+```
+
+:::
+
+Examples of **correct** code for this rule when used without exceptions:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: "error"*/
+
+delete bar; // deleting variable
+Reflect.deleteProperty(foo, 'bar');
+```
+
+:::
+
+Note: For a rule preventing deletion of variables, see [no-delete-var instead](no-delete-var)
+
+Examples of **correct** code for this rule with the `{ "exceptions": ["delete"] }` option:
+
+::: correct
+
+```js
+/*eslint prefer-reflect: ["error", { "exceptions": ["delete"] }]*/
+
+delete bar
+delete foo.bar
+Reflect.deleteProperty(foo, 'bar');
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+
+In ES2015 (ES6) or later, if you don't want to be notified about places where Reflect could be used, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/prefer-regex-literals.md b/eslint/docs/src/rules/prefer-regex-literals.md
new file mode 100644 (file)
index 0000000..ed477c5
--- /dev/null
@@ -0,0 +1,138 @@
+---
+title: prefer-regex-literals
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
+---
+
+
+
+There are two ways to create a regular expression:
+
+* Regular expression literals, e.g., `/abc/u`.
+* The `RegExp` constructor function, e.g., `new RegExp("abc", "u")` or `RegExp("abc", "u")`.
+
+The constructor function is particularly useful when you want to dynamically generate the pattern,
+because it takes string arguments.
+
+When using the constructor function with string literals, don't forget that the string escaping rules still apply.
+If you want to put a backslash in the pattern, you need to escape it in the string literal.
+Thus, the following are equivalent:
+
+```js
+new RegExp("^\\d\\.$");
+
+/^\d\.$/;
+
+// matches "0.", "1.", "2." ... "9."
+```
+
+In the above example, the regular expression literal is easier to read and reason about.
+Also, it's a common mistake to omit the extra `\` in the string literal, which would produce a completely different regular expression:
+
+```js
+new RegExp("^\d\.$");
+
+// equivalent to /^d.$/, matches "d1", "d2", "da", "db" ...
+```
+
+When a regular expression is known in advance, it is considered a best practice to avoid the string literal notation on top
+of the regular expression notation, and use regular expression literals instead of the constructor function.
+
+## Rule Details
+
+This rule disallows the use of the `RegExp` constructor function with string literals as its arguments.
+
+This rule also disallows the use of the `RegExp` constructor function with template literals without expressions
+and `String.raw` tagged template literals without expressions.
+
+The rule does not disallow all use of the `RegExp` constructor. It should be still used for
+dynamically generated regular expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-regex-literals: "error"*/
+
+new RegExp("abc");
+
+new RegExp("abc", "u");
+
+RegExp("abc");
+
+RegExp("abc", "u");
+
+new RegExp("\\d\\d\\.\\d\\d\\.\\d\\d\\d\\d");
+
+RegExp(`^\\d\\.$`);
+
+new RegExp(String.raw`^\d\.$`);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-regex-literals: "error"*/
+
+/abc/;
+
+/abc/u;
+
+/\d\d\.\d\d\.\d\d\d\d/;
+
+/^\d\.$/;
+
+// RegExp constructor is allowed for dynamically generated regular expressions
+
+new RegExp(pattern);
+
+RegExp("abc", flags);
+
+new RegExp(prefix + "abc");
+
+RegExp(`${prefix}abc`);
+
+new RegExp(String.raw`^\d\. ${suffix}`);
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `disallowRedundantWrapping` set to `true` additionally checks for unnecessarily wrapped regex literals (Default `false`).
+
+### `disallowRedundantWrapping`
+
+By default, this rule doesn’t check when a regex literal is unnecessarily wrapped in a `RegExp` constructor call. When the option `disallowRedundantWrapping` is set to `true`, the rule will also disallow such unnecessary patterns.
+
+Examples of `incorrect` code for `{ "disallowRedundantWrapping": true }`
+
+```js
+/*eslint prefer-regex-literals: ["error", {"disallowRedundantWrapping": true}]*/
+
+new RegExp(/abc/);
+
+new RegExp(/abc/, 'u');
+```
+
+Examples of `correct` code for `{ "disallowRedundantWrapping": true }`
+
+```js
+/*eslint prefer-regex-literals: ["error", {"disallowRedundantWrapping": true}]*/
+
+/abc/;
+
+/abc/u;
+
+new RegExp(/abc/, flags);
+```
diff --git a/eslint/docs/src/rules/prefer-rest-params.md b/eslint/docs/src/rules/prefer-rest-params.md
new file mode 100644 (file)
index 0000000..2c2f05c
--- /dev/null
@@ -0,0 +1,76 @@
+---
+title: prefer-rest-params
+layout: doc
+rule_type: suggestion
+related_rules:
+- prefer-spread
+---
+
+
+There are rest parameters in ES2015.
+We can use that feature for variadic functions instead of the `arguments` variable.
+
+`arguments` does not have methods of `Array.prototype`, so it's a bit of an inconvenience.
+
+## Rule Details
+
+This rule is aimed to flag usage of `arguments` variables.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-rest-params: "error"*/
+
+function foo() {
+    console.log(arguments);
+}
+
+function foo(action) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    action.apply(null, args);
+}
+
+function foo(action) {
+    var args = [].slice.call(arguments, 1);
+    action.apply(null, args);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-rest-params: "error"*/
+
+function foo(...args) {
+    console.log(args);
+}
+
+function foo(action, ...args) {
+    action.apply(null, args); // or `action(...args)`, related to the `prefer-spread` rule.
+}
+
+// Note: the implicit arguments can be overwritten.
+function foo(arguments) {
+    console.log(arguments); // This is the first argument.
+}
+function foo() {
+    var arguments = 0;
+    console.log(arguments); // This is a local variable.
+}
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+
+In ES2015 (ES6) or later, if you don't want to be notified about `arguments` variables, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/prefer-spread.md b/eslint/docs/src/rules/prefer-spread.md
new file mode 100644 (file)
index 0000000..6d6bc2b
--- /dev/null
@@ -0,0 +1,89 @@
+---
+title: prefer-spread
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-useless-call
+---
+
+
+Before ES2015, one must use `Function.prototype.apply()` to call variadic functions.
+
+```js
+var args = [1, 2, 3, 4];
+Math.max.apply(Math, args);
+```
+
+In ES2015, one can use spread syntax to call variadic functions.
+
+```js
+/*eslint-env es6*/
+
+var args = [1, 2, 3, 4];
+Math.max(...args);
+```
+
+## Rule Details
+
+This rule is aimed to flag usage of `Function.prototype.apply()` in situations where spread syntax could be used instead.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-spread: "error"*/
+
+foo.apply(undefined, args);
+foo.apply(null, args);
+obj.foo.apply(obj, args);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-spread: "error"*/
+
+// Using spread syntax
+foo(...args);
+obj.foo(...args);
+
+// The `this` binding is different.
+foo.apply(obj, args);
+obj.foo.apply(null, args);
+obj.foo.apply(otherObj, args);
+
+// The argument list is not variadic.
+// Those are warned by the `no-useless-call` rule.
+foo.apply(undefined, [1, 2, 3]);
+foo.apply(null, [1, 2, 3]);
+obj.foo.apply(obj, [1, 2, 3]);
+```
+
+:::
+
+Known limitations:
+
+This rule analyzes code statically to check whether or not the `this` argument is changed. So, if the `this` argument is computed in a dynamic expression, this rule cannot detect a violation.
+
+```js
+/*eslint prefer-spread: "error"*/
+
+// This warns.
+a[i++].foo.apply(a[i++], args);
+
+// This does not warn.
+a[++i].foo.apply(a[i], args);
+```
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+
+In ES2015 (ES6) or later, if you don't want to be notified about `Function.prototype.apply()` callings, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/prefer-template.md b/eslint/docs/src/rules/prefer-template.md
new file mode 100644 (file)
index 0000000..15a4c98
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: prefer-template
+layout: doc
+rule_type: suggestion
+related_rules:
+- no-useless-concat
+- quotes
+---
+
+
+
+In ES2015 (ES6), we can use template literals instead of string concatenation.
+
+```js
+var str = "Hello, " + name + "!";
+```
+
+```js
+/*eslint-env es6*/
+
+var str = `Hello, ${name}!`;
+```
+
+## Rule Details
+
+This rule is aimed to flag usage of `+` operators with strings.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint prefer-template: "error"*/
+
+var str = "Hello, " + name + "!";
+var str = "Time: " + (12 * 60 * 60 * 1000);
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint prefer-template: "error"*/
+/*eslint-env es6*/
+
+var str = "Hello World!";
+var str = `Hello, ${name}!`;
+var str = `Time: ${12 * 60 * 60 * 1000}`;
+
+// This is reported by `no-useless-concat`.
+var str = "Hello, " + "World!";
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+
+In ES2015 (ES6) or later, if you don't want to be notified about string concatenation, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/quote-props.md b/eslint/docs/src/rules/quote-props.md
new file mode 100644 (file)
index 0000000..f6a17e7
--- /dev/null
@@ -0,0 +1,320 @@
+---
+title: quote-props
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://kangax.github.io/compat-table/es5/#Reserved_words_as_property_names
+- https://mathiasbynens.be/notes/javascript-properties
+---
+
+
+
+Object literal property names can be defined in two ways: using literals or using strings. For example, these two objects are equivalent:
+
+```js
+var object1 = {
+    property: true
+};
+
+var object2 = {
+    "property": true
+};
+```
+
+In many cases, it doesn't matter if you choose to use an identifier instead of a string or vice-versa. Even so, you might decide to enforce a consistent style in your code.
+
+There are, however, some occasions when you must use quotes:
+
+1. If you are using an ECMAScript 3 JavaScript engine (such as IE8) and you want to use a keyword (such as `if`) as a property name. This restriction was removed in ECMAScript 5.
+2. You want to use a non-identifier character in your property name, such as having a property with a space like `"one two"`.
+
+Another example where quotes do matter is when using numeric literals as property keys:
+
+```js
+var object = {
+    1e2: 1,
+    100: 2
+};
+```
+
+This may look alright at first sight, but this code in fact throws a syntax error in ECMAScript 5 strict mode. This happens because `1e2` and `100` are coerced into strings before getting used as the property name. Both `String(1e2)` and `String(100)` happen to be equal to `"100"`, which causes the "Duplicate data property in object literal not allowed in strict mode" error. Issues like that can be tricky to debug, so some prefer to require quotes around all property names.
+
+## Rule Details
+
+This rule requires quotes around object literal property names.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"always"` (default) requires quotes around all object literal property names
+* `"as-needed"` disallows quotes around object literal property names that are not strictly required
+* `"consistent"` enforces a consistent quote style; in a given object, either all of the properties should be quoted, or none of the properties should be quoted
+* `"consistent-as-needed"` requires quotes around all object literal property names if any name strictly requires quotes, otherwise disallows quotes around object property names
+
+Object option:
+
+* `"keywords": true` requires quotes around language keywords used as object property names (only applies when using `as-needed` or `consistent-as-needed`)
+* `"unnecessary": true` (default) disallows quotes around object literal property names that are not strictly required (only applies when using `as-needed`)
+* `"unnecessary": false` allows quotes around object literal property names that are not strictly required (only applies when using `as-needed`)
+* `"numbers": true` requires quotes around numbers used as object property names (only applies when using `as-needed`)
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "always"]*/
+
+var object = {
+    foo: "bar",
+    baz: 42
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint quote-props: ["error", "always"]*/
+/*eslint-env es6*/
+
+var object1 = {
+    "foo": "bar",
+    "baz": 42,
+    "qux-lorem": true
+};
+
+var object2 = {
+    'foo': 'bar',
+    'baz': 42,
+    'qux-lorem': true
+};
+
+var object3 = {
+    foo() {
+        return;
+    }
+};
+```
+
+:::
+
+### as-needed
+
+Examples of **incorrect** code for this rule with the `"as-needed"` option:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "as-needed"]*/
+
+var object = {
+    "a": 0,
+    "0": 0,
+    "true": 0,
+    "null": 0
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"as-needed"` option:
+
+::: correct
+
+```js
+/*eslint quote-props: ["error", "as-needed"]*/
+/*eslint-env es6*/
+
+var object1 = {
+    "a-b": 0,
+    "0x0": 0,
+    "1e2": 0
+};
+
+var object2 = {
+    foo: 'bar',
+    baz: 42,
+    true: 0,
+    0: 0,
+    'qux-lorem': true
+};
+
+var object3 = {
+    foo() {
+        return;
+    }
+};
+```
+
+:::
+
+### consistent
+
+Examples of **incorrect** code for this rule with the `"consistent"` option:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "consistent"]*/
+
+var object1 = {
+    foo: "bar",
+    "baz": 42,
+    "qux-lorem": true
+};
+
+var object2 = {
+    'foo': 'bar',
+    baz: 42
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent"` option:
+
+::: correct
+
+```js
+/*eslint quote-props: ["error", "consistent"]*/
+
+var object1 = {
+    "foo": "bar",
+    "baz": 42,
+    "qux-lorem": true
+};
+
+var object2 = {
+    'foo': 'bar',
+    'baz': 42
+};
+
+var object3 = {
+    foo: 'bar',
+    baz: 42
+};
+```
+
+:::
+
+### consistent-as-needed
+
+Examples of **incorrect** code for this rule with the `"consistent-as-needed"` option:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "consistent-as-needed"]*/
+
+var object1 = {
+    foo: "bar",
+    "baz": 42,
+    "qux-lorem": true
+};
+
+var object2 = {
+    'foo': 'bar',
+    'baz': 42
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"consistent-as-needed"` option:
+
+::: correct
+
+```js
+/*eslint quote-props: ["error", "consistent-as-needed"]*/
+
+var object1 = {
+    "foo": "bar",
+    "baz": 42,
+    "qux-lorem": true
+};
+
+var object2 = {
+    foo: 'bar',
+    baz: 42
+};
+```
+
+:::
+
+### keywords
+
+Examples of additional **incorrect** code for this rule with the `"as-needed", { "keywords": true }` options:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "as-needed", { "keywords": true }]*/
+
+var x = {
+    while: 1,
+    volatile: "foo"
+};
+```
+
+:::
+
+Examples of additional **incorrect** code for this rule with the `"consistent-as-needed", { "keywords": true }` options:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "consistent-as-needed", { "keywords": true }]*/
+
+var x = {
+    "prop": 1,
+    "bar": "foo"
+};
+```
+
+:::
+
+### unnecessary
+
+Examples of additional **correct** code for this rule with the `"as-needed", { "unnecessary": false }` options:
+
+::: correct
+
+```js
+/*eslint quote-props: ["error", "as-needed", { "keywords": true, "unnecessary": false }]*/
+
+var x = {
+    "while": 1,
+    "foo": "bar"  // Would normally have caused a warning
+};
+```
+
+:::
+
+### numbers
+
+Examples of additional **incorrect** code for this rule with the `"as-needed", { "numbers": true }` options:
+
+::: incorrect
+
+```js
+/*eslint quote-props: ["error", "as-needed", { "numbers": true }]*/
+
+var x = {
+    100: 1
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't care if property names are consistently wrapped in quotes or not, and you don't target legacy ES3 environments, turn this rule off.
diff --git a/eslint/docs/src/rules/quotes.md b/eslint/docs/src/rules/quotes.md
new file mode 100644 (file)
index 0000000..afa65a1
--- /dev/null
@@ -0,0 +1,204 @@
+---
+title: quotes
+layout: doc
+rule_type: layout
+---
+
+
+
+JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:
+
+```js
+/*eslint-env es6*/
+
+var double = "double";
+var single = 'single';
+var backtick = `backtick`;    // ES6 only
+```
+
+Each of these lines creates a string and, in some cases, can be used interchangeably. The choice of how to define strings in a codebase is a stylistic one outside of template literals (which allow embedded of expressions to be interpreted).
+
+Many codebases require strings to be defined in a consistent manner.
+
+## Rule Details
+
+This rule enforces the consistent use of either backticks, double, or single quotes.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"double"` (default) requires the use of double quotes wherever possible
+* `"single"` requires the use of single quotes wherever possible
+* `"backtick"` requires the use of backticks wherever possible
+
+Object option:
+
+* `"avoidEscape": true` allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise
+* `"allowTemplateLiterals": true` allows strings to use backticks
+
+**Deprecated**: The object property `avoid-escape` is deprecated; please use the object property `avoidEscape` instead.
+
+### double
+
+Examples of **incorrect** code for this rule with the default `"double"` option:
+
+::: incorrect
+
+```js
+/*eslint quotes: ["error", "double"]*/
+
+var single = 'single';
+var unescaped = 'a string containing "double" quotes';
+var backtick = `back\ntick`; // you can use \n in single or double quoted strings
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"double"` option:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "double"]*/
+/*eslint-env es6*/
+
+var double = "double";
+var backtick = `back
+tick`;  // backticks are allowed due to newline
+var backtick = tag`backtick`; // backticks are allowed due to tag
+```
+
+:::
+
+### single
+
+Examples of **incorrect** code for this rule with the `"single"` option:
+
+::: incorrect
+
+```js
+/*eslint quotes: ["error", "single"]*/
+
+var double = "double";
+var unescaped = "a string containing 'single' quotes";
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"single"` option:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "single"]*/
+/*eslint-env es6*/
+
+var single = 'single';
+var backtick = `back${x}tick`; // backticks are allowed due to substitution
+```
+
+:::
+
+### backticks
+
+Examples of **incorrect** code for this rule with the `"backtick"` option:
+
+::: incorrect
+
+```js
+/*eslint quotes: ["error", "backtick"]*/
+
+var single = 'single';
+var double = "double";
+var unescaped = 'a string containing `backticks`';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"backtick"` option:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "backtick"]*/
+/*eslint-env es6*/
+
+var backtick = `backtick`;
+```
+
+:::
+
+### avoidEscape
+
+Examples of additional **correct** code for this rule with the `"double", { "avoidEscape": true }` options:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
+
+var single = 'a string containing "double" quotes';
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `"single", { "avoidEscape": true }` options:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "single", { "avoidEscape": true }]*/
+
+var double = "a string containing 'single' quotes";
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `"backtick", { "avoidEscape": true }` options:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "backtick", { "avoidEscape": true }]*/
+
+var double = "a string containing `backtick` quotes"
+```
+
+:::
+
+### allowTemplateLiterals
+
+Examples of additional **correct** code for this rule with the `"double", { "allowTemplateLiterals": true }` options:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "double", { "allowTemplateLiterals": true }]*/
+
+var double = "double";
+var double = `double`;
+```
+
+:::
+
+Examples of additional **correct** code for this rule with the `"single", { "allowTemplateLiterals": true }` options:
+
+::: correct
+
+```js
+/*eslint quotes: ["error", "single", { "allowTemplateLiterals": true }]*/
+
+var single = 'single';
+var single = `single`;
+```
+
+:::
+
+`{ "allowTemplateLiterals": false }` will not disallow the usage of all template literals. If you want to forbid any instance of template literals, use [no-restricted-syntax](no-restricted-syntax) and target the `TemplateLiteral` selector.
+
+## When Not To Use It
+
+If you do not need consistency in your string styles, you can safely disable this rule.
diff --git a/eslint/docs/src/rules/radix.md b/eslint/docs/src/rules/radix.md
new file mode 100644 (file)
index 0000000..de8b51a
--- /dev/null
@@ -0,0 +1,114 @@
+---
+title: radix
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://davidwalsh.name/parseint-radix
+---
+
+
+
+When using the `parseInt()` function it is common to omit the second argument, the radix, and let the function try to determine from the first argument what type of number it is. By default, `parseInt()` will autodetect decimal and hexadecimal (via `0x` prefix). Prior to ECMAScript 5, `parseInt()` also autodetected octal literals, which caused problems because many developers assumed a leading `0` would be ignored.
+
+This confusion led to the suggestion that you always use the radix parameter to `parseInt()` to eliminate unintended consequences. So instead of doing this:
+
+```js
+var num = parseInt("071");      // 57
+```
+
+Do this:
+
+```js
+var num = parseInt("071", 10);  // 71
+```
+
+ECMAScript 5 changed the behavior of `parseInt()` so that it no longer autodetects octal literals and instead treats them as decimal literals. However, the differences between hexadecimal and decimal interpretation of the first parameter causes many developers to continue using the radix parameter to ensure the string is interpreted in the intended way.
+
+On the other hand, if the code is targeting only ES5-compliant environments passing the radix `10` may be redundant. In such a case you might want to disallow using such a radix.
+
+## Rule Details
+
+This rule is aimed at preventing the unintended conversion of a string to a number of a different base than intended or at preventing the redundant `10` radix if targeting modern environments only.
+
+## Options
+
+There are two options for this rule:
+
+* `"always"` enforces providing a radix (default)
+* `"as-needed"` disallows providing the `10` radix
+
+### always
+
+Examples of **incorrect** code for the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint radix: "error"*/
+
+var num = parseInt("071");
+
+var num = parseInt(someValue);
+
+var num = parseInt("071", "abc");
+
+var num = parseInt("071", 37);
+
+var num = parseInt();
+```
+
+:::
+
+Examples of **correct** code for the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint radix: "error"*/
+
+var num = parseInt("071", 10);
+
+var num = parseInt("071", 8);
+
+var num = parseFloat(someValue);
+```
+
+:::
+
+### as-needed
+
+Examples of **incorrect** code for the `"as-needed"` option:
+
+::: incorrect
+
+```js
+/*eslint radix: ["error", "as-needed"]*/
+
+var num = parseInt("071", 10);
+
+var num = parseInt("071", "abc");
+
+var num = parseInt();
+```
+
+:::
+
+Examples of **correct** code for the `"as-needed"` option:
+
+::: correct
+
+```js
+/*eslint radix: ["error", "as-needed"]*/
+
+var num = parseInt("071");
+
+var num = parseInt("071", 8);
+
+var num = parseFloat(someValue);
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to enforce either presence or omission of the `10` radix value you can turn this rule off.
diff --git a/eslint/docs/src/rules/require-atomic-updates.md b/eslint/docs/src/rules/require-atomic-updates.md
new file mode 100644 (file)
index 0000000..fe0254d
--- /dev/null
@@ -0,0 +1,207 @@
+---
+title: require-atomic-updates
+layout: doc
+rule_type: problem
+---
+
+
+When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:
+
+```js
+let totalLength = 0;
+
+async function addLengthOfSinglePage(pageNum) {
+  totalLength += await getPageLength(pageNum);
+}
+
+Promise.all([addLengthOfSinglePage(1), addLengthOfSinglePage(2)]).then(() => {
+  console.log('The combined length of both pages is', totalLength);
+});
+```
+
+This code looks like it will sum the results of calling `getPageLength(1)` and `getPageLength(2)`, but in reality the final value of `totalLength` will only be the length of one of the two pages. The bug is in the statement `totalLength += await getPageLength(pageNum);`. This statement first reads an initial value of `totalLength`, then calls `getPageLength(pageNum)` and waits for that Promise to fulfill. Finally, it sets the value of `totalLength` to the sum of `await getPageLength(pageNum)` and the *initial* value of `totalLength`. If the `totalLength` variable is updated in a separate function call during the time that the `getPageLength(pageNum)` Promise is pending, that update will be lost because the new value is overwritten without being read.
+
+One way to fix this issue would be to ensure that `totalLength` is read at the same time as it's updated, like this:
+
+```js
+async function addLengthOfSinglePage(pageNum) {
+  const lengthOfThisPage = await getPageLength(pageNum);
+
+  totalLength += lengthOfThisPage;
+}
+```
+
+Another solution would be to avoid using a mutable variable reference at all:
+
+```js
+Promise.all([getPageLength(1), getPageLength(2)]).then(pageLengths => {
+  const totalLength = pageLengths.reduce((accumulator, length) => accumulator + length, 0);
+
+  console.log('The combined length of both pages is', totalLength);
+});
+```
+
+## Rule Details
+
+This rule aims to report assignments to variables or properties in cases where the assignments may be based on outdated values.
+
+### Variables
+
+This rule reports an assignment to a variable when it detects the following execution flow in a generator or async function:
+
+1. The variable is read.
+2. A `yield` or `await` pauses the function.
+3. After the function is resumed, a value is assigned to the variable from step 1.
+
+The assignment in step 3 is reported because it may be incorrectly resolved because the value of the variable from step 1 may have changed between steps 2 and 3. In particular, if the variable can be accessed from other execution contexts (for example, if it is not a local variable and therefore other functions can change it), the value of the variable may have changed elsewhere while the function was paused in step 2.
+
+Note that the rule does not report the assignment in step 3 in any of the following cases:
+
+* If the variable is read again between steps 2 and 3.
+* If the variable cannot be accessed while the function is paused (for example, if it's a local variable).
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint require-atomic-updates: error */
+
+let result;
+
+async function foo() {
+    result += await something;
+}
+
+async function bar() {
+    result = result + await something;
+}
+
+async function baz() {
+    result = result + doSomething(await somethingElse);
+}
+
+async function qux() {
+    if (!result) {
+        result = await initialize();
+    }
+}
+
+function* generator() {
+    result += yield;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint require-atomic-updates: error */
+
+let result;
+
+async function foobar() {
+    result = await something + result;
+}
+
+async function baz() {
+    const tmp = doSomething(await somethingElse);
+    result += tmp;
+}
+
+async function qux() {
+    if (!result) {
+        const tmp = await initialize();
+        if (!result) {
+            result = tmp;
+        }
+    }
+}
+
+async function quux() {
+    let localVariable = 0;
+    localVariable += await something;
+}
+
+function* generator() {
+    result = (yield) + result;
+}
+```
+
+:::
+
+### Properties
+
+This rule reports an assignment to a property through a variable when it detects the following execution flow in a generator or async function:
+
+1. The variable or object property is read.
+2. A `yield` or `await` pauses the function.
+3. After the function is resumed, a value is assigned to a property.
+
+This logic is similar to the logic for variables, but stricter because the property in step 3 doesn't have to be the same as the property in step 1. It is assumed that the flow depends on the state of the object as a whole.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/* eslint require-atomic-updates: error */
+
+async function foo(obj) {
+    if (!obj.done) {
+        obj.something = await getSomething();
+    }
+}
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/* eslint require-atomic-updates: error */
+
+async function foo(obj) {
+    if (!obj.done) {
+        const tmp = await getSomething();
+        if (!obj.done) {
+            obj.something = tmp;
+        }
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"allowProperties"`: When set to `true`, the rule does not report assignments to properties. Default is `false`.
+
+### allowProperties
+
+Example of **correct** code for this rule with the `{ "allowProperties": true }` option:
+
+::: correct
+
+```js
+/* eslint require-atomic-updates: ["error", { "allowProperties": true }] */
+
+async function foo(obj) {
+    if (!obj.done) {
+        obj.something = await getSomething();
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't use async or generator functions, you don't need to enable this rule.
diff --git a/eslint/docs/src/rules/require-await.md b/eslint/docs/src/rules/require-await.md
new file mode 100644 (file)
index 0000000..d311518
--- /dev/null
@@ -0,0 +1,97 @@
+---
+title: require-await
+layout: doc
+rule_type: suggestion
+related_rules:
+- require-yield
+---
+
+
+Asynchronous functions in JavaScript behave differently than other functions in two important ways:
+
+1. The return value is always a `Promise`.
+2. You can use the `await` operator inside of them.
+
+The primary reason to use asynchronous functions is typically to use the `await` operator, such as this:
+
+```js
+async function fetchData(processDataItem) {
+    const response = await fetch(DATA_URL);
+    const data = await response.json();
+
+    return data.map(processDataItem);
+}
+```
+
+Asynchronous functions that don't use `await` might not need to be asynchronous functions and could be the unintentional result of refactoring.
+
+Note: this rule ignores async generator functions. This is because generators yield rather than return a value and async generators might yield all the values of another async generator without ever actually needing to use await.
+
+## Rule Details
+
+This rule warns async functions which have no `await` expression.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint require-await: "error"*/
+
+async function foo() {
+    doSomething();
+}
+
+bar(async () => {
+    doSomething();
+});
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint require-await: "error"*/
+
+async function foo() {
+    await doSomething();
+}
+
+bar(async () => {
+    await doSomething();
+});
+
+function foo() {
+    doSomething();
+}
+
+bar(() => {
+    doSomething();
+});
+
+// Allow empty functions.
+async function noop() {}
+```
+
+:::
+
+## When Not To Use It
+
+Asynchronous functions are designed to work with promises such that throwing an error will cause a promise's rejection handler (such as `catch()`) to be called. For example:
+
+```js
+async function fail() {
+    throw new Error("Failure!");
+}
+
+fail().catch(error => {
+    console.log(error.message);
+});
+```
+
+In this case, the `fail()` function throws an error that is intended to be caught by the `catch()` handler assigned later. Converting the `fail()` function into a synchronous function would require the call to `fail()` to be refactored to use a `try-catch` statement instead of a promise.
+
+If you are throwing an error inside of an asynchronous function for this purpose, then you may want to disable this rule.
diff --git a/eslint/docs/src/rules/require-jsdoc.md b/eslint/docs/src/rules/require-jsdoc.md
new file mode 100644 (file)
index 0000000..4ff17df
--- /dev/null
@@ -0,0 +1,200 @@
+---
+title: require-jsdoc
+layout: doc
+rule_type: suggestion
+related_rules:
+- valid-jsdoc
+---
+
+
+This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
+
+[JSDoc](http://usejsdoc.org) is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:
+
+```js
+/**
+ * Adds two numbers together.
+ * @param {int} num1 The first number.
+ * @param {int} num2 The second number.
+ * @returns {int} The sum of the two numbers.
+ */
+function sum(num1, num2) {
+    return num1 + num2;
+}
+```
+
+Some style guides require JSDoc comments for all functions as a way of explaining function behavior.
+
+## Rule Details
+
+This rule requires JSDoc comments for specified nodes. Supported nodes:
+
+* `"FunctionDeclaration"`
+* `"ClassDeclaration"`
+* `"MethodDefinition"`
+* `"ArrowFunctionExpression"`
+* `"FunctionExpression"`
+
+## Options
+
+This rule has a single object option:
+
+* `"require"` requires JSDoc comments for the specified nodes
+
+Default option settings are:
+
+```json
+{
+    "require-jsdoc": ["error", {
+        "require": {
+            "FunctionDeclaration": true,
+            "MethodDefinition": false,
+            "ClassDeclaration": false,
+            "ArrowFunctionExpression": false,
+            "FunctionExpression": false
+        }
+    }]
+}
+```
+
+### require
+
+Examples of **incorrect** code for this rule with the `{ "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } }` option:
+
+::: incorrect
+
+```js
+/*eslint "require-jsdoc": ["error", {
+    "require": {
+        "FunctionDeclaration": true,
+        "MethodDefinition": true,
+        "ClassDeclaration": true,
+        "ArrowFunctionExpression": true,
+        "FunctionExpression": true
+    }
+}]*/
+
+function foo() {
+    return 10;
+}
+
+var foo = () => {
+    return 10;
+};
+
+class Foo {
+    bar() {
+        return 10;
+    }
+}
+
+var foo = function() {
+    return 10;
+};
+
+var foo = {
+    bar: function() {
+        return 10;
+    },
+
+    baz() {
+        return 10;
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } }` option:
+
+::: correct
+
+```js
+/*eslint "require-jsdoc": ["error", {
+    "require": {
+        "FunctionDeclaration": true,
+        "MethodDefinition": true,
+        "ClassDeclaration": true,
+        "ArrowFunctionExpression": true,
+        "FunctionExpression": true
+    }
+}]*/
+
+/**
+ * It returns 10
+ */
+function foo() {
+    return 10;
+}
+
+/**
+ * It returns test + 10
+ * @params {int} test - some number
+ * @returns {int} sum of test and 10
+ */
+var foo = (test) => {
+    return test + 10;
+}
+
+/**
+ * It returns 10
+ */
+var foo = () => {
+    return 10;
+}
+
+/**
+ * It returns 10
+ */
+var foo = function() {
+    return 10;
+}
+
+var array = [1,2,3];
+array.filter(function(item) {
+    return item > 2;
+});
+
+/**
+ * A class that can return the number 10
+ */
+class Foo {
+    /**
+    * It returns 10
+    */
+    bar() {
+        return 10;
+    }
+}
+
+/**
+ * It returns 10
+ */
+var foo = function() {
+    return 10;
+};
+
+var foo = {
+    /**
+    * It returns 10
+    */
+    bar: function() {
+        return 10;
+    },
+
+    /**
+    * It returns 10
+    */
+    baz() {
+        return 10;
+    }
+};
+
+setTimeout(() => {}, 10); // since it's an anonymous arrow function
+```
+
+:::
+
+## When Not To Use It
+
+If you do not require JSDoc for your functions, then you can leave this rule off.
diff --git a/eslint/docs/src/rules/require-unicode-regexp.md b/eslint/docs/src/rules/require-unicode-regexp.md
new file mode 100644 (file)
index 0000000..0efe1a8
--- /dev/null
@@ -0,0 +1,68 @@
+---
+title: require-unicode-regexp
+layout: doc
+rule_type: suggestion
+---
+
+
+RegExp `u` flag has two effects:
+
+1. **Make the regular expression handling UTF-16 surrogate pairs correctly.**
+
+    Especially, character range syntax gets the correct behavior.
+
+    ```js
+    /^[👍]$/.test("👍") //→ false
+    /^[👍]$/u.test("👍") //→ true
+    ```
+
+2. **Make the regular expression throwing syntax errors early as disabling [Annex B extensions](https://www.ecma-international.org/ecma-262/6.0/#sec-regular-expressions-patterns).**
+
+    Because of historical reason, JavaScript regular expressions are tolerant of syntax errors. For example, `/\w{1, 2/` is a syntax error, but JavaScript doesn't throw the error. It matches strings such as `"a{1, 2"` instead. Such a recovering logic is defined in Annex B.
+
+    The `u` flag disables the recovering logic Annex B defined. As a result, you can find errors early. This is similar to [the strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode).
+
+Therefore, the `u` flag lets us work better with regular expressions.
+
+## Rule Details
+
+This rule aims to enforce the use of `u` flag on regular expressions.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint require-unicode-regexp: error */
+
+const a = /aaa/
+const b = /bbb/gi
+const c = new RegExp("ccc")
+const d = new RegExp("ddd", "gi")
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint require-unicode-regexp: error */
+
+const a = /aaa/u
+const b = /bbb/giu
+const c = new RegExp("ccc", "u")
+const d = new RegExp("ddd", "giu")
+
+// This rule ignores RegExp calls if the flags could not be evaluated to a static value.
+function f(flags) {
+    return new RegExp("eee", flags)
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify regular expressions with no `u` flag, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/require-yield.md b/eslint/docs/src/rules/require-yield.md
new file mode 100644 (file)
index 0000000..ce3cbe8
--- /dev/null
@@ -0,0 +1,57 @@
+---
+title: require-yield
+layout: doc
+rule_type: suggestion
+related_rules:
+- require-await
+---
+
+
+
+## Rule Details
+
+This rule generates warnings for generator functions that do not have the `yield` keyword.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint require-yield: "error"*/
+/*eslint-env es6*/
+
+function* foo() {
+  return 10;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint require-yield: "error"*/
+/*eslint-env es6*/
+
+function* foo() {
+  yield 5;
+  return 10;
+}
+
+function foo() {
+  return 10;
+}
+
+// This rule does not warn on empty generator functions.
+function* foo() { }
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify generator functions that have no `yield` expression, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/rest-spread-spacing.md b/eslint/docs/src/rules/rest-spread-spacing.md
new file mode 100644 (file)
index 0000000..8850bea
--- /dev/null
@@ -0,0 +1,160 @@
+---
+title: rest-spread-spacing
+layout: doc
+rule_type: layout
+further_reading:
+- https://github.com/tc39/proposal-object-rest-spread
+---
+
+
+
+ES2015 introduced the rest and spread operators, which expand an iterable structure into its individual parts. Some examples of their usage are as follows:
+
+```js
+let numArr = [1, 2, 3];
+function add(a, b, c) {
+    return a + b + c;
+}
+add(...numArr); // -> 6
+
+let arr1 = [1, 2, 3];
+let arr2 = [4, 5, 6];
+arr1.push(...arr2); // -> [1, 2, 3, 4, 5, 6]
+
+let [a, b, ...arr] = [1, 2, 3, 4, 5];
+a; // -> 1
+b // -> 2
+arr; // ->  [3, 4, 5]
+
+function numArgs(...args) {
+  return args.length;
+}
+numArgs(a, b, c); // -> 3
+```
+
+In addition to the above, there is currently a proposal to add object rest and spread properties to the spec. They can be used as follows:
+
+```js
+
+let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
+x; // -> 1
+y; // -> 2
+z; // -> { a: 3, b: 4 }
+
+let n = { x, y, ...z };
+n; // -> { x: 1, y: 2, a: 3, b: 4 }
+```
+
+As with other operators, whitespace is allowed between the rest or spread operator and the expression it is operating on, which can lead to inconsistent spacing within a codebase.
+
+## Rule Details
+
+This rule aims to enforce consistent spacing between rest and spread operators and their expressions. The rule also supports object rest and spread properties in ES2018:
+
+```json
+{
+    "parserOptions": {
+        "ecmaVersion": 2018
+    }
+}
+```
+
+Please read the user guide's section on [configuring parser options](/docs/user-guide/configuring#specifying-parser-options) to learn more.
+
+## Options
+
+This rule takes one option: a string with the value of `"never"` or `"always"`. The default value is `"never"`.
+
+### "never"
+
+When using the default `"never"` option, whitespace is not allowed between spread operators and their expressions.
+
+```json
+rest-spread-spacing: ["error"]
+```
+
+or
+
+```json
+rest-spread-spacing: ["error", "never"]
+```
+
+Examples of **incorrect** code for this rule with `"never"`:
+
+::: incorrect
+
+```js
+/*eslint rest-spread-spacing: ["error", "never"]*/
+
+fn(... args)
+[... arr, 4, 5, 6]
+let [a, b, ... arr] = [1, 2, 3, 4, 5];
+function fn(... args) { console.log(args); }
+let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
+let n = { x, y, ... z };
+```
+
+:::
+
+Examples of **correct** code for this rule with `"never"`:
+
+::: correct
+
+```js
+/*eslint rest-spread-spacing: ["error", "never"]*/
+
+fn(...args)
+[...arr, 4, 5, 6]
+let [a, b, ...arr] = [1, 2, 3, 4, 5];
+function fn(...args) { console.log(args); }
+let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
+let n = { x, y, ...z };
+```
+
+:::
+
+### "always"
+
+When using the `"always"` option, whitespace is required between spread operators and their expressions.
+
+```json
+rest-spread-spacing: ["error", "always"]
+```
+
+Examples of **incorrect** code for this rule with `"always"`:
+
+::: incorrect
+
+```js
+/*eslint rest-spread-spacing:["error", "always"]*/
+
+fn(...args)
+[...arr, 4, 5, 6]
+let [a, b, ...arr] = [1, 2, 3, 4, 5];
+function fn(...args) { console.log(args); }
+let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
+let n = { x, y, ...z };
+```
+
+:::
+
+Examples of **correct** code for this rule with `"always"`:
+
+::: correct
+
+```js
+/*eslint rest-spread-spacing: ["error", "always"]*/
+
+fn(... args)
+[... arr, 4, 5, 6]
+let [a, b, ... arr] = [1, 2, 3, 4, 5];
+function fn(... args) { console.log(args); }
+let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
+let n = { x, y, ... z };
+```
+
+:::
+
+## When Not To Use It
+
+You can safely disable this rule if you do not care about enforcing consistent spacing between spread operators and their expressions.
diff --git a/eslint/docs/src/rules/semi-spacing.md b/eslint/docs/src/rules/semi-spacing.md
new file mode 100644 (file)
index 0000000..01b3c3f
--- /dev/null
@@ -0,0 +1,129 @@
+---
+title: semi-spacing
+layout: doc
+rule_type: layout
+related_rules:
+- semi
+- no-extra-semi
+- comma-spacing
+- block-spacing
+- space-in-parens
+---
+
+
+
+JavaScript allows you to place unnecessary spaces before or after a semicolon.
+
+Disallowing or enforcing space around a semicolon can improve the readability of your program.
+
+```js
+var a = "b" ;
+
+var c = "d";var e = "f";
+```
+
+## Rule Details
+
+This rule aims to enforce spacing around a semicolon. This rule prevents the use of spaces before a semicolon in expressions.
+
+This rule doesn't check spacing in the following cases:
+
+* The spacing after the semicolon if it is the first token in the line.
+
+* The spacing before the semicolon if it is after an opening parenthesis (`(` or `{`), or the spacing after the semicolon if it is before a closing parenthesis (`)` or `}`). That spacing is checked by `space-in-parens` or `block-spacing`.
+
+* The spacing around the semicolon in a for loop with an empty condition (`for(;;)`).
+
+## Options
+
+The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
+If `before` is `true`, space is enforced before semicolons and if it's `false`, space is disallowed before semicolons.
+If `after` is `true`, space is enforced after semicolons and if it's `false`, space is disallowed after semicolons.
+The `after` option will be only applied if a semicolon is not at the end of line.
+
+The default is `{"before": false, "after": true}`.
+
+```json
+    "semi-spacing": ["error", {"before": false, "after": true}]
+```
+
+### `{"before": false, "after": true}`
+
+This is the default option. It enforces spacing after semicolons and disallows spacing before semicolons.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint semi-spacing: "error"*/
+
+var foo ;
+var foo;var bar;
+throw new Error("error") ;
+while (a) { break ; }
+for (i = 0 ; i < 10 ; i++) {}
+for (i = 0;i < 10;i++) {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint semi-spacing: "error"*/
+
+var foo;
+var foo; var bar;
+throw new Error("error");
+while (a) { break; }
+for (i = 0; i < 10; i++) {}
+for (;;) {}
+if (true) {;}
+;foo();
+```
+
+:::
+
+### `{"before": true, "after": false}`
+
+This option enforces spacing before semicolons and disallows spacing after semicolons.
+
+Examples of **incorrect** code for this rule with the `{"before": true, "after": false}` option:
+
+::: incorrect
+
+```js
+/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
+
+var foo;
+var foo ; var bar;
+throw new Error("error");
+while (a) { break; }
+for (i = 0;i < 10;i++) {}
+for (i = 0; i < 10; i++) {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"before": true, "after": false}` option:
+
+::: correct
+
+```js
+/*eslint semi-spacing: ["error", { "before": true, "after": false }]*/
+
+var foo ;
+var foo ;var bar ;
+throw new Error("error") ;
+while (a) {break ;}
+for (i = 0 ;i < 10 ;i++) {}
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing before or after semicolons.
diff --git a/eslint/docs/src/rules/semi-style.md b/eslint/docs/src/rules/semi-style.md
new file mode 100644 (file)
index 0000000..0d82f30
--- /dev/null
@@ -0,0 +1,144 @@
+---
+title: semi-style
+layout: doc
+rule_type: layout
+related_rules:
+- no-extra-semi
+- semi
+- semi-spacing
+---
+
+
+
+Generally, semicolons are at the end of lines. However, in semicolon-less style, semicolons are at the beginning of lines. This rule enforces that semicolons are at the configured location.
+
+## Rule Details
+
+This rule reports line terminators around semicolons.
+
+This rule has an option.
+
+```json
+{
+    "semi-style": ["error", "last"],
+}
+```
+
+* `"last"` (Default) enforces that semicolons are at the end of statements.
+* `"first"` enforces that semicolons are at the beginning of statements. Semicolons of `for` loop heads (`for(a;b;c){}`) should be at the end of lines even if you use this option.
+
+Examples of **incorrect** code for this rule with `"last"` option:
+
+::: incorrect
+
+```js
+/*eslint semi-style: ["error", "last"]*/
+
+foo()
+;[1, 2, 3].forEach(bar)
+
+for (
+    var i = 0
+    ; i < 10
+    ; ++i
+) {
+    foo()
+}
+
+class C {
+    static {
+        foo()
+        ;bar()
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"last"` option:
+
+::: correct
+
+```js
+/*eslint semi-style: ["error", "last"]*/
+
+foo();
+[1, 2, 3].forEach(bar)
+
+for (
+    var i = 0;
+    i < 10;
+    ++i
+) {
+    foo()
+}
+
+class C {
+    static {
+        foo();
+        bar()
+    }
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with `"first"` option:
+
+::: incorrect
+
+```js
+/*eslint semi-style: ["error", "first"]*/
+
+foo();
+[1, 2, 3].forEach(bar)
+
+for (
+    var i = 0
+    ; i < 10
+    ; ++i
+) {
+    foo()
+}
+
+class C {
+    static {
+        foo();
+        bar()
+    }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"first"` option:
+
+::: correct
+
+```js
+/*eslint semi-style: ["error", "first"]*/
+
+foo()
+;[1, 2, 3].forEach(bar)
+
+for (
+    var i = 0;
+    i < 10;
+    ++i
+) {
+    foo()
+}
+
+class C {
+    static {
+        foo()
+        ;bar()
+    }
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify the location of semicolons, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/semi.md b/eslint/docs/src/rules/semi.md
new file mode 100644 (file)
index 0000000..be01835
--- /dev/null
@@ -0,0 +1,252 @@
+---
+title: semi
+layout: doc
+rule_type: layout
+related_rules:
+- no-extra-semi
+- no-unexpected-multiline
+- semi-spacing
+further_reading:
+- https://blog.izs.me/2010/12/an-open-letter-to-javascript-leaders-regarding/
+- https://web.archive.org/web/20200420230322/http://inimino.org/~inimino/blog/javascript_semicolons
+---
+
+
+
+JavaScript doesn't require semicolons at the end of each statement. In many cases, the JavaScript engine can determine that a semicolon should be in a certain spot and will automatically add it. This feature is known as **automatic semicolon insertion (ASI)** and is considered one of the more controversial features of JavaScript. For example, the following lines are both valid:
+
+```js
+var name = "ESLint"
+var website = "eslint.org";
+```
+
+On the first line, the JavaScript engine will automatically insert a semicolon, so this is not considered a syntax error. The JavaScript engine still knows how to interpret the line and knows that the line end indicates the end of the statement.
+
+In the debate over ASI, there are generally two schools of thought. The first is that we should treat ASI as if it didn't exist and always include semicolons manually. The rationale is that it's easier to always include semicolons than to try to remember when they are or are not required, and thus decreases the possibility of introducing an error.
+
+However, the ASI mechanism can sometimes be tricky to people who are using semicolons. For example, consider this code:
+
+```js
+return
+{
+    name: "ESLint"
+};
+```
+
+This may look like a `return` statement that returns an object literal, however, the JavaScript engine will interpret this code as:
+
+```js
+return;
+{
+    name: "ESLint";
+}
+```
+
+Effectively, a semicolon is inserted after the `return` statement, causing the code below it (a labeled literal inside a block) to be unreachable. This rule and the [no-unreachable](no-unreachable) rule will protect your code from such cases.
+
+On the other side of the argument are those who say that since semicolons are inserted automatically, they are optional and do not need to be inserted manually. However, the ASI mechanism can also be tricky to people who don't use semicolons. For example, consider this code:
+
+```js
+var globalCounter = { }
+
+(function () {
+    var n = 0
+    globalCounter.increment = function () {
+        return ++n
+    }
+})()
+```
+
+In this example, a semicolon will not be inserted after the first line, causing a run-time error (because an empty object is called as if it's a function). The [no-unexpected-multiline](no-unexpected-multiline) rule can protect your code from such cases.
+
+Although ASI allows for more freedom over your coding style, it can also make your code behave in an unexpected way, whether you use semicolons or not. Therefore, it is best to know when ASI takes place and when it does not, and have ESLint protect your code from these potentially unexpected cases. In short, as once described by Isaac Schlueter, a `\n` character always ends a statement (just like a semicolon) unless one of the following is true:
+
+1. The statement has an unclosed paren, array literal, or object literal or ends in some other way that is not a valid way to end a statement. (For instance, ending with `.` or `,`.)
+1. The line is `--` or `++` (in which case it will decrement/increment the next token.)
+1. It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{`
+1. The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other binary operator that can only be found between two tokens in a single expression.
+
+## Rule Details
+
+This rule enforces consistent use of semicolons.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"always"` (default) requires semicolons at the end of statements
+* `"never"` disallows semicolons as the end of statements (except to disambiguate statements beginning with `[`, `(`, `/`, `+`, or `-`)
+
+Object option (when `"always"`):
+
+* `"omitLastInOneLineBlock": true` ignores the last semicolon in a block in which its braces (and therefore the content of the block) are in the same line
+
+Object option (when `"never"`):
+
+* `"beforeStatementContinuationChars": "any"` (default) ignores semicolons (or lacking semicolon) at the end of statements if the next line starts with `[`, `(`, `/`, `+`, or `-`.
+* `"beforeStatementContinuationChars": "always"` requires semicolons at the end of statements if the next line starts with `[`, `(`, `/`, `+`, or `-`.
+* `"beforeStatementContinuationChars": "never"` disallows semicolons as the end of statements if it doesn't make ASI hazard even if the next line starts with `[`, `(`, `/`, `+`, or `-`.
+
+**Note:** `beforeStatementContinuationChars` does not apply to class fields because class fields are not statements.
+
+### always
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint semi: ["error", "always"]*/
+
+var name = "ESLint"
+
+object.method = function() {
+    // ...
+}
+
+class Foo {
+    bar = 1
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint semi: "error"*/
+
+var name = "ESLint";
+
+object.method = function() {
+    // ...
+};
+
+class Foo {
+    bar = 1;
+}
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint semi: ["error", "never"]*/
+
+var name = "ESLint";
+
+object.method = function() {
+    // ...
+};
+
+class Foo {
+    bar = 1;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint semi: ["error", "never"]*/
+
+var name = "ESLint"
+
+object.method = function() {
+    // ...
+}
+
+var name = "ESLint"
+
+;(function() {
+    // ...
+})()
+
+import a from "a"
+(function() {
+    // ...
+})()
+
+import b from "b"
+;(function() {
+    // ...
+})()
+
+class Foo {
+    bar = 1
+}
+```
+
+:::
+
+#### omitLastInOneLineBlock
+
+Examples of additional **correct** code for this rule with the `"always", { "omitLastInOneLineBlock": true }` options:
+
+::: correct
+
+```js
+/*eslint semi: ["error", "always", { "omitLastInOneLineBlock": true}] */
+
+if (foo) { bar() }
+
+if (foo) { bar(); baz() }
+
+function f() { bar(); baz() }
+
+class C {
+    foo() { bar(); baz() }
+
+    static { bar(); baz() }
+}
+```
+
+:::
+
+#### beforeStatementContinuationChars
+
+Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "always" }` options:
+
+::: incorrect
+
+```js
+/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "always"}] */
+import a from "a"
+
+(function() {
+    // ...
+})()
+```
+
+:::
+
+Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "never" }` options:
+
+::: incorrect
+
+```js
+/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "never"}] */
+import a from "a"
+
+;(function() {
+    // ...
+})()
+```
+
+:::
+
+## When Not To Use It
+
+If you do not want to enforce semicolon usage (or omission) in any particular way, then you can turn this rule off.
diff --git a/eslint/docs/src/rules/sort-imports.md b/eslint/docs/src/rules/sort-imports.md
new file mode 100644 (file)
index 0000000..d42bd97
--- /dev/null
@@ -0,0 +1,358 @@
+---
+title: sort-imports
+layout: doc
+rule_type: suggestion
+related_rules:
+- sort-keys
+- sort-vars
+---
+
+
+
+The import statement is used to import members (functions, objects or primitives) that have been exported from an external module. Using a specific member syntax:
+
+```js
+// single - Import single member.
+import myMember from "my-module.js";
+import {myOtherMember} from "my-other-module.js";
+
+// multiple - Import multiple members.
+import {foo, bar} from "my-module.js";
+
+// all - Import all members, where myModule contains all the exported bindings.
+import * as myModule from "my-module.js";
+```
+
+The import statement can also import a module without exported bindings. Used when the module does not export anything, but runs it own code or changes the global context object.
+
+```js
+// none - Import module without exported bindings.
+import "my-module.js"
+```
+
+When declaring multiple imports, a sorted list of import declarations make it easier for developers to read the code and find necessary imports later. This rule is purely a matter of style.
+
+## Rule Details
+
+This rule checks all import declarations and verifies that all imports are first sorted by the used member syntax and then alphabetically by the first member or alias name.
+
+The `--fix` option on the command line automatically fixes some problems reported by this rule: multiple members on a single line are automatically sorted (e.g. `import { b, a } from 'foo.js'` is corrected to `import { a, b } from 'foo.js'`), but multiple lines are not reordered.
+
+## Options
+
+This rule accepts an object with its properties as
+
+* `ignoreCase` (default: `false`)
+* `ignoreDeclarationSort` (default: `false`)
+* `ignoreMemberSort` (default: `false`)
+* `memberSyntaxSortOrder` (default: `["none", "all", "multiple", "single"]`); all 4 items must be present in the array, but you can change the order:
+    * `none` = import module without exported bindings.
+    * `all` = import all members provided by exported bindings.
+    * `multiple` = import multiple members.
+    * `single` = import single member.
+* `allowSeparatedGroups` (default: `false`)
+
+Default option settings are:
+
+```json
+{
+    "sort-imports": ["error", {
+        "ignoreCase": false,
+        "ignoreDeclarationSort": false,
+        "ignoreMemberSort": false,
+        "memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
+        "allowSeparatedGroups": false
+    }]
+}
+```
+
+## Examples
+
+### Default settings
+
+Examples of **correct** code for this rule when using default options:
+
+::: correct
+
+```js
+/*eslint sort-imports: "error"*/
+import 'module-without-export.js';
+import * as bar from 'bar.js';
+import * as foo from 'foo.js';
+import {alpha, beta} from 'alpha.js';
+import {delta, gamma} from 'delta.js';
+import a from 'baz.js';
+import {b} from 'qux.js';
+
+/*eslint sort-imports: "error"*/
+import a from 'foo.js';
+import b from 'bar.js';
+import c from 'baz.js';
+
+/*eslint sort-imports: "error"*/
+import 'foo.js'
+import * as bar from 'bar.js';
+import {a, b} from 'baz.js';
+import c from 'qux.js';
+import {d} from 'quux.js';
+
+/*eslint sort-imports: "error"*/
+import {a, b, c} from 'foo.js'
+```
+
+:::
+
+Examples of **incorrect** code for this rule when using default options:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: "error"*/
+import b from 'foo.js';
+import a from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import a from 'foo.js';
+import A from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import {b, c} from 'foo.js';
+import {a, b} from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import a from 'foo.js';
+import {b, c} from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import {a} from 'foo.js';
+import {b, c} from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import a from 'foo.js';
+import * as b from 'bar.js';
+
+/*eslint sort-imports: "error"*/
+import {b, a, c} from 'foo.js'
+```
+
+:::
+
+### `ignoreCase`
+
+When `true` the rule ignores the case-sensitivity of the imports local name.
+
+Examples of **incorrect** code for this rule with the `{ "ignoreCase": true }` option:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: ["error", { "ignoreCase": true }]*/
+
+import B from 'foo.js';
+import a from 'bar.js';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreCase": true }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "ignoreCase": true }]*/
+
+import a from 'foo.js';
+import B from 'bar.js';
+import c from 'baz.js';
+```
+
+:::
+
+Default is `false`.
+
+### `ignoreDeclarationSort`
+
+Ignores the sorting of import declaration statements.
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreDeclarationSort": false }` option:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: ["error", { "ignoreDeclarationSort": false }]*/
+import b from 'foo.js'
+import a from 'bar.js'
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreDeclarationSort": true }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
+import a from 'foo.js'
+import b from 'bar.js'
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
+import b from 'foo.js'
+import a from 'bar.js'
+```
+
+:::
+
+Default is `false`.
+
+### `ignoreMemberSort`
+
+Ignores the member sorting within a `multiple` member import declaration.
+
+Examples of **incorrect** code for this rule with the default `{ "ignoreMemberSort": false }` option:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: ["error", { "ignoreMemberSort": false }]*/
+import {b, a, c} from 'foo.js'
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "ignoreMemberSort": true }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "ignoreMemberSort": true }]*/
+import {b, a, c} from 'foo.js'
+```
+
+:::
+
+Default is `false`.
+
+### `memberSyntaxSortOrder`
+
+There are four different styles and the default member syntax sort order is:
+
+* `none` - import module without exported bindings.
+* `all` - import all members provided by exported bindings.
+* `multiple` - import multiple members.
+* `single` - import single member.
+
+All four options must be specified in the array, but you can customize their order.
+
+Examples of **incorrect** code for this rule with the default `{ "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] }` option:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: "error"*/
+import a from 'foo.js';
+import * as b from 'bar.js';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "memberSyntaxSortOrder": ['single', 'all', 'multiple', 'none'] }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "memberSyntaxSortOrder": ['single', 'all', 'multiple', 'none'] }]*/
+
+import a from 'foo.js';
+import * as b from 'bar.js';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "memberSyntaxSortOrder": ['all', 'single', 'multiple', 'none'] }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "memberSyntaxSortOrder": ['all', 'single', 'multiple', 'none'] }]*/
+
+import * as foo from 'foo.js';
+import z from 'zoo.js';
+import {a, b} from 'foo.js';
+```
+
+:::
+
+Default is `["none", "all", "multiple", "single"]`.
+
+### `allowSeparatedGroups`
+
+When `true` the rule checks the sorting of import declaration statements only for those that appear on consecutive lines.
+
+In other words, a blank line or a comment line or line with any other statement after an import declaration statement will reset the sorting of import declaration statements.
+
+Examples of **incorrect** code for this rule with the `{ "allowSeparatedGroups": true }` option:
+
+::: incorrect
+
+```js
+/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
+
+import b from 'foo.js';
+import c from 'bar.js';
+import a from 'baz.js';
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{ "allowSeparatedGroups": true }` option:
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
+
+import b from 'foo.js';
+import c from 'bar.js';
+
+import a from 'baz.js';
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
+
+import b from 'foo.js';
+import c from 'bar.js';
+// comment
+import a from 'baz.js';
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint sort-imports: ["error", { "allowSeparatedGroups": true }]*/
+
+import b from 'foo.js';
+import c from 'bar.js';
+quux();
+import a from 'baz.js';
+```
+
+:::
+
+Default is `false`.
+
+## When Not To Use It
+
+This rule is a formatting preference and not following it won't negatively affect the quality of your code. If alphabetizing imports isn't a part of your coding standards, then you can leave this rule disabled.
diff --git a/eslint/docs/src/rules/sort-keys.md b/eslint/docs/src/rules/sort-keys.md
new file mode 100644 (file)
index 0000000..4c90e6c
--- /dev/null
@@ -0,0 +1,394 @@
+---
+title: sort-keys
+layout: doc
+rule_type: suggestion
+related_rules:
+- sort-imports
+- sort-vars
+---
+
+
+When declaring multiple properties, some developers prefer to sort property names alphabetically to more easily find and/or diff necessary properties at a later time. Others feel that it adds complexity and becomes burden to maintain.
+
+## Rule Details
+
+This rule checks all property definitions of object expressions and verifies that all variables are sorted alphabetically.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: "error"*/
+/*eslint-env es6*/
+
+let obj = {a: 1, c: 3, b: 2};
+let obj = {a: 1, "c": 3, b: 2};
+
+// Case-sensitive by default.
+let obj = {a: 1, b: 2, C: 3};
+
+// Non-natural order by default.
+let obj = {1: a, 2: c, 10: b};
+
+// This rule checks computed properties which have a simple name as well.
+// Simple names are names which are expressed by an Identifier node or a Literal node.
+const S = Symbol("s")
+let obj = {a: 1, ["c"]: 3, b: 2};
+let obj = {a: 1, [S]: 3, b: 2};
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint sort-keys: "error"*/
+/*eslint-env es6*/
+
+let obj = {a: 1, b: 2, c: 3};
+let obj = {a: 1, "b": 2, c: 3};
+
+// Case-sensitive by default.
+let obj = {C: 3, a: 1, b: 2};
+
+// Non-natural order by default.
+let obj = {1: a, 10: b, 2: c};
+
+// This rule checks computed properties which have a simple name as well.
+let obj = {a: 1, ["b"]: 2, c: 3};
+let obj = {a: 1, [b]: 2, c: 3};
+
+// This rule ignores computed properties which have a non-simple name.
+let obj = {a: 1, [c + d]: 3, b: 2};
+let obj = {a: 1, ["c" + "d"]: 3, b: 2};
+let obj = {a: 1, [`${c}`]: 3, b: 2};
+let obj = {a: 1, [tag`c`]: 3, b: 2};
+
+// This rule does not report unsorted properties that are separated by a spread property.
+let obj = {b: 1, ...c, a: 2};
+```
+
+:::
+
+## Options
+
+```json
+{
+    "sort-keys": ["error", "asc", {"caseSensitive": true, "natural": false, "minKeys": 2}]
+}
+```
+
+The 1st option is `"asc"` or `"desc"`.
+
+* `"asc"` (default) - enforce properties to be in ascending order.
+* `"desc"` - enforce properties to be in descending order.
+
+The 2nd option is an object which has 3 properties.
+
+* `caseSensitive` - if `true`, enforce properties to be in case-sensitive order. Default is `true`.
+* `minKeys` - Specifies the minimum number of keys that an object should have in order for the object's unsorted keys to produce an error. Default is `2`, which means by default all objects with unsorted keys will result in lint errors.
+* `natural` - if `true`, enforce properties to be in natural order. Default is `false`. Natural Order compares strings containing combination of letters and numbers in the way a human being would sort. It basically sorts numerically, instead of sorting alphabetically. So the number 10 comes after the number 3 in Natural Sorting.
+* `allowLineSeparatedGroups` - if `true`, the rule allows to group object keys through line breaks. In other words, a blank line after a property will reset the sorting of keys. Default is `false`.
+
+Example for a list:
+
+With `natural` as true, the ordering would be
+1
+3
+6
+8
+10
+
+With `natural` as false, the ordering would be
+1
+10
+3
+6
+8
+
+### desc
+
+Examples of **incorrect** code for the `"desc"` option:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: ["error", "desc"]*/
+/*eslint-env es6*/
+
+let obj = {b: 2, c: 3, a: 1};
+let obj = {"b": 2, c: 3, a: 1};
+
+// Case-sensitive by default.
+let obj = {C: 1, b: 3, a: 2};
+
+// Non-natural order by default.
+let obj = {10: b, 2: c, 1: a};
+```
+
+:::
+
+Examples of **correct** code for the `"desc"` option:
+
+::: correct
+
+```js
+/*eslint sort-keys: ["error", "desc"]*/
+/*eslint-env es6*/
+
+let obj = {c: 3, b: 2, a: 1};
+let obj = {c: 3, "b": 2, a: 1};
+
+// Case-sensitive by default.
+let obj = {b: 3, a: 2, C: 1};
+
+// Non-natural order by default.
+let obj = {2: c, 10: b, 1: a};
+```
+
+:::
+
+### insensitive
+
+Examples of **incorrect** code for the `{caseSensitive: false}` option:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: ["error", "asc", {caseSensitive: false}]*/
+/*eslint-env es6*/
+
+let obj = {a: 1, c: 3, C: 4, b: 2};
+let obj = {a: 1, C: 3, c: 4, b: 2};
+```
+
+:::
+
+Examples of **correct** code for the `{caseSensitive: false}` option:
+
+::: correct
+
+```js
+/*eslint sort-keys: ["error", "asc", {caseSensitive: false}]*/
+/*eslint-env es6*/
+
+let obj = {a: 1, b: 2, c: 3, C: 4};
+let obj = {a: 1, b: 2, C: 3, c: 4};
+```
+
+:::
+
+### natural
+
+Examples of **incorrect** code for the `{natural: true}` option:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: ["error", "asc", {natural: true}]*/
+/*eslint-env es6*/
+
+let obj = {1: a, 10: c, 2: b};
+```
+
+:::
+
+Examples of **correct** code for the `{natural: true}` option:
+
+::: correct
+
+```js
+/*eslint sort-keys: ["error", "asc", {natural: true}]*/
+/*eslint-env es6*/
+
+let obj = {1: a, 2: b, 10: c};
+```
+
+:::
+
+### minKeys
+
+Examples of **incorrect** code for the `{minKeys: 4}` option:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: ["error", "asc", {minKeys: 4}]*/
+/*eslint-env es6*/
+
+// 4 keys
+let obj = {
+    b: 2,
+    a: 1, // not sorted correctly (should be 1st key)
+    c: 3,
+    d: 4,
+};
+
+// 5 keys
+let obj = {
+    2: 'a',
+    1: 'b', // not sorted correctly (should be 1st key)
+    3: 'c',
+    4: 'd',
+    5: 'e',
+};
+```
+
+:::
+
+Examples of **correct** code for the `{minKeys: 4}` option:
+
+::: correct
+
+```js
+/*eslint sort-keys: ["error", "asc", {minKeys: 4}]*/
+/*eslint-env es6*/
+
+// 3 keys
+let obj = {
+    b: 2,
+    a: 1,
+    c: 3,
+};
+
+// 2 keys
+let obj = {
+    2: 'b',
+    1: 'a',
+};
+```
+
+:::
+
+### allowLineSeparatedGroups
+
+Examples of **incorrect** code for the `{allowLineSeparatedGroups: true}` option:
+
+::: incorrect
+
+```js
+/*eslint sort-keys: ["error", "asc", {allowLineSeparatedGroups: true}]*/
+/*eslint-env es6*/
+
+let obj1 = {
+    b: 1,
+    c () {
+
+    },
+    a: 3
+}
+
+let obj2 = {
+    b: 1,
+    c: 2,
+
+    z () {
+
+    },
+    y: 3
+}
+
+let obj3 = {
+    b: 1,
+    c: 2,
+
+    z () {
+
+    },
+    // comment
+    y: 3,
+}
+
+let obj4 = {
+    b: 1
+    // comment before comma
+    , a: 2
+};
+```
+
+:::
+
+Examples of **correct** code for the `{allowLineSeparatedGroups: true}` option:
+
+::: correct
+
+```js
+/*eslint sort-keys: ["error", "asc", {allowLineSeparatedGroups: true}]*/
+/*eslint-env es6*/
+
+let obj = {
+    e: 1,
+    f: 2,
+    g: 3,
+
+    a: 4,
+    b: 5,
+    c: 6
+}
+
+let obj = {
+    b: 1,
+
+    // comment
+    a: 4,
+    c: 5,
+}
+
+let obj = {
+    c: 1,
+    d: 2,
+
+    b () {
+
+    }, 
+    e: 3,
+}
+
+let obj = {
+    c: 1,
+    d: 2,
+    // comment
+
+    // comment
+    b() {
+
+    },
+    e: 4
+}
+
+let obj = {
+    b,
+
+    [foo + bar]: 1,
+    a
+}
+
+let obj = {
+    b: 1
+    // comment before comma
+
+    ,
+    a: 2
+};
+
+var obj = {
+    b: 1,
+
+    a: 2,
+    ...z,
+    c: 3
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify about properties' order, then it's safe to disable this rule.
+
+## Compatibility
+
+* **JSCS:** [validateOrderInObjectKeys](https://jscs-dev.github.io/rule/validateOrderInObjectKeys)
diff --git a/eslint/docs/src/rules/sort-vars.md b/eslint/docs/src/rules/sort-vars.md
new file mode 100644 (file)
index 0000000..cc85f10
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: sort-vars
+layout: doc
+rule_type: suggestion
+related_rules:
+- sort-keys
+- sort-imports
+---
+
+
+
+When declaring multiple variables within the same block, some developers prefer to sort variable names alphabetically to be able to find necessary variable easier at the later time. Others feel that it adds complexity and becomes burden to maintain.
+
+## Rule Details
+
+This rule checks all variable declaration blocks and verifies that all variables are sorted alphabetically.
+The default configuration of the rule is case-sensitive.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint sort-vars: "error"*/
+
+var b, a;
+
+var a, B, c;
+
+var a, A;
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint sort-vars: "error"*/
+
+var a, b, c, d;
+
+var _a = 10;
+var _b = 20;
+
+var A, a;
+
+var B, a, c;
+```
+
+:::
+
+Alphabetical list is maintained starting from the first variable and excluding any that are considered problems. So the following code will produce two problems:
+
+```js
+/*eslint sort-vars: "error"*/
+
+var c, d, a, b;
+```
+
+But this one, will only produce one:
+
+```js
+/*eslint sort-vars: "error"*/
+
+var c, d, a, e;
+```
+
+## Options
+
+This rule has an object option:
+
+* `"ignoreCase": true` (default `false`) ignores the case-sensitivity of the variables order
+
+### ignoreCase
+
+Examples of **correct** code for this rule with the `{ "ignoreCase": true }` option:
+
+::: correct
+
+```js
+/*eslint sort-vars: ["error", { "ignoreCase": true }]*/
+
+var a, A;
+
+var a, B, c;
+```
+
+:::
+
+## When Not To Use It
+
+This rule is a formatting preference and not following it won't negatively affect the quality of your code. If you alphabetizing variables isn't a part of your coding standards, then you can leave this rule off.
diff --git a/eslint/docs/src/rules/space-after-function-name.md b/eslint/docs/src/rules/space-after-function-name.md
new file mode 100644 (file)
index 0000000..b90f316
--- /dev/null
@@ -0,0 +1,65 @@
+---
+title: space-after-function-name
+layout: doc
+
+---
+
+Enforces consistent spacing after name in function definitions.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [space-before-function-paren](space-before-function-paren) rule.
+
+Whitespace between a function name and its parameter list is optional.
+
+```js
+function withoutSpace(x) {
+    // ...
+}
+
+function withSpace (x) {
+    // ...
+}
+```
+
+Some style guides may require a consistent spacing for function names.
+
+## Rule Details
+
+This rule aims to enforce a consistent spacing after function names. It takes one argument. If it is `"always"` then all function names must be followed by at least one space. If `"never"` then there should be no spaces between the name and the parameter list. The default is `"never"`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+function foo (x) {
+    // ...
+}
+
+var x = function named (x) {};
+
+// When ["error", "always"]
+function bar(x) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+function foo(x) {
+    // ...
+}
+
+var x = function named(x) {};
+
+// When ["error", "always"]
+function bar (x) {
+    // ...
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/space-after-keywords.md b/eslint/docs/src/rules/space-after-keywords.md
new file mode 100644 (file)
index 0000000..ac619ed
--- /dev/null
@@ -0,0 +1,84 @@
+---
+title: space-after-keywords
+layout: doc
+
+---
+
+Enforces consistent spacing after keywords.
+
+(removed) This rule was **removed** in ESLint v2.0 and replaced by the [keyword-spacing](keyword-spacing) rule.
+
+(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
+
+Some style guides will require or disallow spaces following the certain keywords.
+
+```js
+if (condition) {
+    doSomething();
+} else {
+    doSomethingElse();
+}
+
+if(condition) {
+    doSomething();
+}else{
+    doSomethingElse();
+}
+```
+
+## Rule Details
+
+This rule will enforce consistency of spacing after the keywords `if`, `else`, `for`, `while`, `do`, `switch`, `try`, `catch`, `finally`, and `with`.
+
+This rule takes one argument. If it is `"always"` then the keywords must be followed by at least one space. If `"never"`
+then there should be no spaces following. The default is `"always"`.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint space-after-keywords: "error"*/
+
+if(a) {}
+
+if (a) {} else{}
+
+do{} while (a);
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint space-after-keywords: ["error", "never"]*/
+
+if (a) {}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint space-after-keywords: "error"*/
+
+if (a) {}
+
+if (a) {} else {}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint space-after-keywords: ["error", "never"]*/
+
+if(a) {}
+```
+
+:::
diff --git a/eslint/docs/src/rules/space-before-blocks.md b/eslint/docs/src/rules/space-before-blocks.md
new file mode 100644 (file)
index 0000000..de90dc0
--- /dev/null
@@ -0,0 +1,263 @@
+---
+title: space-before-blocks
+layout: doc
+rule_type: layout
+related_rules:
+- keyword-spacing
+- arrow-spacing
+- switch-colon-spacing
+- block-spacing
+- brace-style
+---
+
+
+
+Consistency is an important part of any style guide.
+While it is a personal preference where to put the opening brace of blocks,
+it should be consistent across a whole project.
+Having an inconsistent style distracts the reader from seeing the important parts of the code.
+
+## Rule Details
+
+This rule will enforce consistency of spacing before blocks. It is only applied on blocks that don’t begin on a new line.
+
+* This rule ignores spacing which is between `=>` and a block. The spacing is handled by the `arrow-spacing` rule.
+* This rule ignores spacing which is between a keyword and a block. The spacing is handled by the `keyword-spacing` rule.
+* This rule ignores spacing which is between `:` of a switch case and a block. The spacing is handled by the `switch-colon-spacing` rule.
+
+## Options
+
+This rule takes one argument. If it is `"always"` then blocks must always have at least one preceding space. If `"never"`
+then all blocks should never have any preceding space. If different spacing is desired for function
+blocks, keyword blocks and classes, an optional configuration object can be passed as the rule argument to
+configure the cases separately. If any value in the configuration object is `"off"`, then neither style will be enforced for blocks of that kind.
+
+( e.g. `{ "functions": "never", "keywords": "always", "classes": "always" }` )
+
+The default is `"always"`.
+
+### "always"
+
+Examples of **incorrect** code for this rule with the "always" option:
+
+::: incorrect
+
+```js
+/*eslint space-before-blocks: "error"*/
+
+if (a){
+    b();
+}
+
+function a(){}
+
+for (;;){
+    b();
+}
+
+try {} catch(a){}
+
+class Foo{
+  constructor(){}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint space-before-blocks: "error"*/
+
+if (a) {
+    b();
+}
+
+if (a) {
+    b();
+} else{ /*no error. this is checked by `keyword-spacing` rule.*/
+    c();
+}
+
+class C {
+    static{} /*no error. this is checked by `keyword-spacing` rule.*/
+}
+
+function a() {}
+
+for (;;) {
+    b();
+}
+
+try {} catch(a) {}
+```
+
+:::
+
+### "never"
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-blocks: ["error", "never"]*/
+
+if (a) {
+    b();
+}
+
+function a() {}
+
+for (;;) {
+    b();
+}
+
+try {} catch(a) {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint space-before-blocks: ["error", "never"]*/
+
+if (a){
+    b();
+}
+
+function a(){}
+
+for (;;){
+    b();
+}
+
+try{} catch(a){}
+
+class Foo{
+  constructor(){}
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule when configured `{ "functions": "never", "keywords": "always", "classes": "never" }`:
+
+::: incorrect
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "always", "classes": "never" }]*/
+/*eslint-env es6*/
+
+function a() {}
+
+try {} catch(a){}
+
+class Foo{
+  constructor() {}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule when configured `{ "functions": "never", "keywords": "always", "classes": "never" }`:
+
+::: correct
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "always", "classes": "never" }]*/
+/*eslint-env es6*/
+
+for (;;) {
+  // ...
+}
+
+describe(function(){
+  // ...
+});
+
+class Foo{
+  constructor(){}
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule when configured `{ "functions": "always", "keywords": "never", "classes": "never" }`:
+
+::: incorrect
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "always", "keywords": "never", "classes": "never" }]*/
+/*eslint-env es6*/
+
+function a(){}
+
+try {} catch(a) {}
+
+class Foo {
+  constructor(){}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule when configured `{ "functions": "always", "keywords": "never", "classes": "never" }`:
+
+::: correct
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "always", "keywords": "never", "classes": "never" }]*/
+/*eslint-env es6*/
+
+if (a){
+  b();
+}
+
+var a = function() {}
+
+class Foo{
+  constructor() {}
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule when configured `{ "functions": "never", "keywords": "never", "classes": "always" }`:
+
+::: incorrect
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "never", "classes": "always" }]*/
+/*eslint-env es6*/
+
+class Foo{
+  constructor(){}
+}
+```
+
+:::
+
+Examples of **correct** code for this rule when configured `{ "functions": "never", "keywords": "never", "classes": "always" }`:
+
+::: correct
+
+```js
+/*eslint space-before-blocks: ["error", { "functions": "never", "keywords": "never", "classes": "always" }]*/
+/*eslint-env es6*/
+
+class Foo {
+  constructor(){}
+}
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing before blocks.
diff --git a/eslint/docs/src/rules/space-before-function-paren.md b/eslint/docs/src/rules/space-before-function-paren.md
new file mode 100644 (file)
index 0000000..e141005
--- /dev/null
@@ -0,0 +1,412 @@
+---
+title: space-before-function-paren
+layout: doc
+rule_type: layout
+related_rules:
+- space-after-keywords
+- space-return-throw-case
+---
+
+
+
+When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example:
+
+```js
+function withoutSpace(x) {
+    // ...
+}
+
+function withSpace (x) {
+    // ...
+}
+
+var anonymousWithoutSpace = function() {};
+
+var anonymousWithSpace = function () {};
+```
+
+Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required.
+
+## Rule Details
+
+This rule aims to enforce consistent spacing before function parentheses and as such, will warn whenever whitespace doesn't match the preferences specified.
+
+## Options
+
+This rule has a string option or an object option:
+
+```js
+{
+    "space-before-function-paren": ["error", "always"],
+    // or
+    "space-before-function-paren": ["error", {
+        "anonymous": "always",
+        "named": "always",
+        "asyncArrow": "always"
+    }],
+}
+```
+
+* `always` (default) requires a space followed by the `(` of arguments.
+* `never` disallows any space followed by the `(` of arguments.
+
+The string option does not check async arrow function expressions for backward compatibility.
+
+You can also use a separate option for each type of function.
+Each of the following options can be set to `"always"`, `"never"`, or `"ignore"`. The default is `"always"`.
+
+* `anonymous` is for anonymous function expressions (e.g. `function () {}`).
+* `named` is for named function expressions (e.g. `function foo () {}`).
+* `asyncArrow` is for async arrow function expressions (e.g. `async () => {}`).
+
+### "always"
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-function-paren: "error"*/
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+var bar = function foo() {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+
+var foo = async() => 1
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint space-before-function-paren: "error"*/
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+var bar = function foo () {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+
+var foo = async () => 1
+```
+
+:::
+
+### "never"
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-function-paren: ["error", "never"]*/
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+var bar = function foo () {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+
+var foo = async () => 1
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint space-before-function-paren: ["error", "never"]*/
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+var bar = function foo() {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+
+var foo = async() => 1
+```
+
+:::
+
+### `{"anonymous": "always", "named": "never", "asyncArrow": "always"}`
+
+Examples of **incorrect** code for this rule with the `{"anonymous": "always", "named": "never", "asyncArrow": "always"}` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-function-paren: ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}]*/
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+
+var foo = async(a) => await a
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"anonymous": "always", "named": "never", "asyncArrow": "always"}` option:
+
+::: correct
+
+```js
+/*eslint space-before-function-paren: ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}]*/
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+
+var foo = async (a) => await a
+```
+
+:::
+
+### `{"anonymous": "never", "named": "always"}`
+
+Examples of **incorrect** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-function-paren: ["error", { "anonymous": "never", "named": "always" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
+
+::: correct
+
+```js
+/*eslint space-before-function-paren: ["error", { "anonymous": "never", "named": "always" }]*/
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+### `{"anonymous": "ignore", "named": "always"}`
+
+Examples of **incorrect** code for this rule with the `{"anonymous": "ignore", "named": "always"}` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-function-paren: ["error", { "anonymous": "ignore", "named": "always" }]*/
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"anonymous": "ignore", "named": "always"}` option:
+
+::: correct
+
+```js
+/*eslint space-before-function-paren: ["error", { "anonymous": "ignore", "named": "always" }]*/
+/*eslint-env es6*/
+
+var bar = function() {
+    // ...
+};
+
+var bar = function () {
+    // ...
+};
+
+function foo () {
+    // ...
+}
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing before function parenthesis.
diff --git a/eslint/docs/src/rules/space-before-function-parentheses.md b/eslint/docs/src/rules/space-before-function-parentheses.md
new file mode 100644 (file)
index 0000000..f60bd44
--- /dev/null
@@ -0,0 +1,296 @@
+---
+title: space-before-function-parentheses
+layout: doc
+
+related_rules:
+- space-after-keywords
+- space-return-throw-case
+---
+
+Enforces consistent spacing before opening parenthesis in function definitions.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [space-before-function-paren](space-before-function-paren) rule. The name of the rule changed from "parentheses" to "paren" for consistency with the names of other rules.
+
+When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example:
+
+```js
+function withoutSpace(x) {
+    // ...
+}
+
+function withSpace (x) {
+    // ...
+}
+
+var anonymousWithoutSpace = function() {};
+
+var anonymousWithSpace = function () {};
+```
+
+Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required.
+
+## Rule Details
+
+This rule aims to enforce consistent spacing before function parentheses and as such, will warn whenever whitespace doesn't match the preferences specified.
+
+This rule takes one argument. If it is `"always"`, which is the default option, all named functions and anonymous functions must have space before function parentheses. If `"never"` then all named functions and anonymous functions must not have space before function parentheses. If you want different spacing for named and anonymous functions you can pass a configuration object as the rule argument to configure those separately (e. g. `{"anonymous": "always", "named": "never"}`).
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+var bar = function foo() {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+var bar = function foo () {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+var bar = function foo () {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+var bar = function foo() {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{"anonymous": "always", "named": "never"}` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"anonymous": "always", "named": "never"}` option:
+
+::: correct
+
+```js
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+function foo() {
+    // ...
+}
+
+var bar = function () {
+    // ...
+};
+
+class Foo {
+    constructor() {
+        // ...
+    }
+}
+
+var foo = {
+    bar() {
+        // ...
+    }
+};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"anonymous": "never", "named": "always"}` option:
+
+::: correct
+
+```js
+/*eslint-env es6*/
+
+function foo () {
+    // ...
+}
+
+var bar = function() {
+    // ...
+};
+
+class Foo {
+    constructor () {
+        // ...
+    }
+}
+
+var foo = {
+    bar () {
+        // ...
+    }
+};
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing before function parenthesis.
diff --git a/eslint/docs/src/rules/space-before-keywords.md b/eslint/docs/src/rules/space-before-keywords.md
new file mode 100644 (file)
index 0000000..efd2b35
--- /dev/null
@@ -0,0 +1,134 @@
+---
+title: space-before-keywords
+layout: doc
+
+related_rules:
+- space-after-keywords
+- block-spacing
+- space-return-throw-case
+- space-unary-ops
+- space-infix-ops
+---
+
+Enforces consistent spacing before keywords.
+
+(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing) rule.
+
+(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
+
+Keywords are syntax elements of JavaScript, such as `function` and `if`. These identifiers have special meaning to the language and so often appear in a different color in code editors. As an important part of the language, style guides often refer to the spacing that should be used around keywords. For example, you might have a style guide that says keywords should be always be preceded by spaces, which would mean `if-else` statements must look like this:
+
+```js
+if (foo) {
+    // ...
+} else {
+    // ...
+}
+```
+
+Of course, you could also have a style guide that disallows spaces before keywords.
+
+## Rule Details
+
+This rule will enforce consistency of spacing before the keywords `if`, `else`, `for`,
+`while`, `do`, `switch`, `throw`, `try`, `catch`, `finally`, `with`, `break`, `continue`,
+`return`, `function`, `yield`, `class` and variable declarations (`let`, `const`, `var`)
+and label statements.
+
+This rule takes one argument: `"always"` or `"never"`. If `"always"` then the keywords
+must be preceded by at least one space. If `"never"` then no spaces will be allowed before
+the keywords `else`, `while` (do...while), `finally` and `catch`. The default value is `"always"`.
+
+This rule will allow keywords to be preceded by an opening curly brace (`{`). If you wish to alter
+this behavior, consider using the [block-spacing](block-spacing) rule.
+
+Examples of **incorrect** code for this rule with the default `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-keywords: ["error", "always"]*/
+/*eslint-env es6*/
+
+if (foo) {
+    // ...
+}else {}
+
+const foo = 'bar';let baz = 'qux';
+
+var foo =function bar () {}
+
+function bar() {
+    if (foo) {return; }
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"always"` option:
+
+::: correct
+
+```js
+/*eslint space-before-keywords: ["error", "always"]*/
+/*eslint-env es6*/
+
+if (foo) {
+    // ...
+} else {}
+
+(function() {})()
+
+<Foo onClick={function bar() {}} />
+
+for (let foo of ['bar', 'baz', 'qux']) {}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint space-before-keywords: ["error", "never"]*/
+
+if (foo) {
+    // ...
+} else {}
+
+do {
+
+}
+while (foo)
+
+try {} finally {}
+
+try {} catch(e) {}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint space-before-keywords: ["error", "never"]*/
+
+if (foo) {
+    // ...
+}else {}
+
+do {}while (foo)
+
+try {}finally {}
+
+try{}catch(e) {}
+```
+
+:::
+
+## When Not To Use It
+
+If you do not wish to enforce consistency on keyword spacing.
diff --git a/eslint/docs/src/rules/space-in-brackets.md b/eslint/docs/src/rules/space-in-brackets.md
new file mode 100644 (file)
index 0000000..bbd2216
--- /dev/null
@@ -0,0 +1,375 @@
+---
+title: space-in-brackets
+layout: doc
+
+related_rules:
+- array-bracket-spacing
+- object-curly-spacing
+- space-in-parens
+- computed-property-spacing
+---
+
+Enforces consistent spacing inside braces of object literals and brackets of array literals.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [object-curly-spacing](object-curly-spacing) and [array-bracket-spacing](array-bracket-spacing) rules.
+
+While formatting preferences are very personal, a number of style guides require or disallow spaces between brackets:
+
+```js
+var obj = { foo: 'bar' };
+var arr = [ 'foo', 'bar' ];
+foo[ 'bar' ];
+
+var obj = {foo: 'bar'};
+var arr = ['foo', 'bar'];
+foo['bar'];
+```
+
+## Rule Details
+
+This rule aims to maintain consistency around the spacing inside of square brackets, either by disallowing spaces inside of brackets between the brackets and other tokens or enforcing spaces. Brackets that are separated from the adjacent value by a new line are excepted from this rule, as this is a common pattern.  Object literals that are used as the first or last element in an array are also ignored.
+
+## Options
+
+There are two options for this rule:
+
+* `"always"` enforces a space inside of object and array literals
+* `"never"` enforces zero spaces inside of object and array literals (default)
+
+Depending on your coding conventions, you can choose either option by specifying it in your configuration:
+
+```json
+"space-in-brackets": ["error", "always"]
+```
+
+### "never"
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+foo[ 'bar' ];
+foo['bar' ];
+
+var arr = [ 'foo', 'bar' ];
+var arr = ['foo', 'bar' ];
+var arr = [ ['foo'], 'bar'];
+var arr = [[ 'foo' ], 'bar'];
+var arr = ['foo',
+  'bar'
+];
+
+var obj = { 'foo': 'bar' };
+var obj = {'foo': 'bar' };
+var obj = { baz: {'foo': 'qux'}, bar};
+var obj = {baz: { 'foo': 'qux' }, bar};
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+// When options are ["error", "never"]
+
+foo['bar'];
+foo[
+  'bar'
+];
+foo[
+  'bar'];
+
+var arr = [];
+var arr = ['foo', 'bar', 'baz'];
+var arr = [['foo'], 'bar', 'baz'];
+var arr = [
+  'foo',
+  'bar',
+  'baz'
+];
+
+var arr = [
+  'foo',
+  'bar'];
+
+var obj = {'foo': 'bar'};
+
+var obj = {'foo': {'bar': 'baz'}, 'qux': 'quxx'};
+
+var obj = {
+  'foo': 'bar'
+};
+var obj = {'foo': 'bar'
+};
+var obj = {
+  'foo':'bar'};
+
+var obj = {};
+```
+
+:::
+
+### "always"
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint-env es6*/
+
+foo['bar'];
+foo['bar' ];
+foo[ 'bar'];
+
+var arr = ['foo', 'bar'];
+var arr = ['foo', 'bar' ];
+var arr = [ ['foo'], 'bar' ];
+var arr = ['foo',
+  'bar'
+];
+
+var arr = [
+  'foo',
+  'bar'];
+
+var obj = {'foo': 'bar'};
+var obj = {'foo': 'bar' };
+var obj = { baz: {'foo': 'qux'}, bar};
+var obj = {baz: { 'foo': 'qux' }, bar};
+var obj = {'foo': 'bar'
+};
+
+var obj = {
+  'foo':'bar'};
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+foo[ 'bar' ];
+foo[
+  'bar'
+];
+
+var arr = [];
+var arr = [ 'foo', 'bar', 'baz' ];
+var arr = [ [ 'foo' ], 'bar', 'baz' ];
+
+var arr = [
+  'foo',
+  'bar',
+  'baz'
+];
+
+var obj = {};
+var obj = { 'foo': 'bar' };
+var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
+var obj = {
+  'foo': 'bar'
+};
+```
+
+:::
+
+Note that `"always"` has a special case where `{}` and `[]` are not considered problems.
+
+### Exceptions
+
+An object literal may be used as a third array item to specify spacing exceptions. These exceptions work in the context of the first option. That is, if `"always"` is set to enforce spacing and an exception is set to `false`, it will disallow spacing for cases matching the exception. Likewise, if `"never"` is set to disallow spacing and an exception is set to `true`, it will enforce spacing for cases matching the exception.
+
+You can add exceptions like so:
+
+In case of `"always"` option, set an exception to `false` to enable it:
+
+```json
+"space-in-brackets": ["error", "always", {
+  "singleValue": false,
+  "objectsInArrays": false,
+  "arraysInArrays": false,
+  "arraysInObjects": false,
+  "objectsInObjects": false,
+  "propertyName": false
+}]
+```
+
+In case of `"never"` option, set an exception to `true` to enable it:
+
+```json
+"space-in-brackets": ["error", "never", {
+  "singleValue": true,
+  "objectsInArrays": true,
+  "arraysInArrays": true,
+  "arraysInObjects": true,
+  "objectsInObjects": true,
+  "propertyName": true
+}]
+```
+
+The following exceptions are available:
+
+* `singleValue` sets the spacing of a single value inside of square brackets of an array.
+* `objectsInArrays` sets the spacings between the curly braces and square brackets of object literals that are the first or last element in an array.
+* `arraysInArrays` sets the spacing between the square brackets of array literals that are the first or last element in an array.
+* `arraysInObjects` sets the spacing between the square bracket and the curly brace of an array literal that is the last element in an object.
+* `objectsInObjects` sets the spacing between the curly brace of an object literal that is the last element in an object and the curly brace of the containing object.
+* `propertyName` sets the spacing in square brackets of computed member expressions.
+
+In each of the following examples, the `"always"` option is assumed.
+
+Examples of **incorrect** code for this rule when `"singleValue"` is set to `false`:
+
+::: incorrect
+
+```js
+var foo = [ 'foo' ];
+var foo = [ 'foo'];
+var foo = ['foo' ];
+var foo = [ 1 ];
+var foo = [ 1];
+var foo = [1 ];
+var foo = [ [ 1, 2 ] ];
+var foo = [ { 'foo': 'bar' } ];
+```
+
+:::
+
+Examples of **correct** code for this rule when `"singleValue"` is set to `false`:
+
+::: correct
+
+```js
+var foo = ['foo'];
+var foo = [1];
+var foo = [[ 1, 1 ]];
+var foo = [{ 'foo': 'bar' }];
+```
+
+:::
+
+Examples of **incorrect** code when `"objectsInArrays"` is set to `false`:
+
+::: incorrect
+
+```js
+var arr = [ { 'foo': 'bar' } ];
+var arr = [ {
+  'foo': 'bar'
+} ]
+```
+
+:::
+
+Examples of **correct** code when `"objectsInArrays"` is set to `false`:
+
+::: correct
+
+```js
+var arr = [{ 'foo': 'bar' }];
+var arr = [{
+  'foo': 'bar'
+}];
+```
+
+:::
+
+Examples of **incorrect** code when `"arraysInArrays"` is set to `false`:
+
+::: incorrect
+
+```js
+var arr = [ [ 1, 2 ], 2, 3, 4 ];
+var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];
+```
+
+:::
+
+Examples of **correct** code when `"arraysInArrays"` is set to `false`:
+
+::: correct
+
+```js
+var arr = [[ 1, 2 ], 2, 3, 4 ];
+var arr = [[ 1, 2 ], 2, [ 3, 4 ]];
+```
+
+:::
+
+Examples of **incorrect** code when `"arraysInObjects"` is set to `false`:
+
+::: incorrect
+
+```js
+var obj = { "foo": [ 1, 2 ] };
+var obj = { "foo": [ "baz", "bar" ] };
+```
+
+:::
+
+Examples of **correct** code when `"arraysInObjects"` is set to `false`:
+
+::: correct
+
+```js
+var obj = { "foo": [ 1, 2 ]};
+var obj = { "foo": [ "baz", "bar" ]};
+```
+
+:::
+
+Examples of **incorrect** code when `"objectsInObjects"` is set to `false`:
+
+::: incorrect
+
+```js
+var obj = { "foo": { "baz": 1, "bar": 2 } };
+var obj = { "foo": [ "baz", "bar" ], "qux": { "baz": 1, "bar": 2 } };
+```
+
+:::
+
+Examples of **correct** code when `"objectsInObjects"` is set to `false`:
+
+::: correct
+
+```js
+var obj = { "foo": { "baz": 1, "bar": 2 }};
+var obj = { "foo": [ "baz", "bar" ], "qux": { "baz": 1, "bar": 2 }};
+```
+
+:::
+
+Examples of **incorrect** code when `"propertyName"` is set to `false`:
+
+::: incorrect
+
+```js
+var foo = obj[ 1 ];
+var foo = obj[ bar ];
+```
+
+:::
+
+Examples of **correct** code when `"propertyName"` is set to `false`:
+
+::: correct
+
+```js
+var foo = obj[bar];
+var foo = obj[0, 1];
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing between brackets.
diff --git a/eslint/docs/src/rules/space-in-parens.md b/eslint/docs/src/rules/space-in-parens.md
new file mode 100644 (file)
index 0000000..5389637
--- /dev/null
@@ -0,0 +1,384 @@
+---
+title: space-in-parens
+layout: doc
+rule_type: layout
+related_rules:
+- array-bracket-spacing
+- object-curly-spacing
+- computed-property-spacing
+---
+
+
+
+Some style guides require or disallow spaces inside of parentheses:
+
+```js
+foo( 'bar' );
+var x = ( 1 + 2 ) * 3;
+
+foo('bar');
+var x = (1 + 2) * 3;
+```
+
+## Rule Details
+
+This rule will enforce consistent spacing directly inside of parentheses, by disallowing or requiring one or more spaces to the right of `(` and to the left of `)`.
+
+As long as you do not explicitly disallow empty parentheses using the `"empty"` exception , `()` will be allowed.
+
+## Options
+
+There are two options for this rule:
+
+* `"never"` (default) enforces zero spaces inside of parentheses
+* `"always"` enforces a space inside of parentheses
+
+Depending on your coding conventions, you can choose either option by specifying it in your configuration:
+
+```json
+"space-in-parens": ["error", "always"]
+```
+
+### "never"
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "never"]*/
+
+foo( );
+
+foo( 'bar');
+foo('bar' );
+foo( 'bar' );
+
+foo( /* bar */ );
+
+var foo = ( 1 + 2 ) * 3;
+( function () { return 'bar'; }() );
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "never"]*/
+
+foo();
+
+foo('bar');
+
+foo(/* bar */);
+
+var foo = (1 + 2) * 3;
+(function () { return 'bar'; }());
+```
+
+:::
+
+### "always"
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always"]*/
+
+foo( 'bar');
+foo('bar' );
+foo('bar');
+
+foo(/* bar */);
+
+var foo = (1 + 2) * 3;
+(function () { return 'bar'; }());
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always"]*/
+
+foo();
+foo( );
+
+foo( 'bar' );
+
+foo( /* bar */ );
+
+var foo = ( 1 + 2 ) * 3;
+( function () { return 'bar'; }() );
+```
+
+:::
+
+### Exceptions
+
+An object literal may be used as a third array item to specify exceptions, with the key `"exceptions"` and an array as the value. These exceptions work in the context of the first option. That is, if `"always"` is set to enforce spacing, then any "exception" will *disallow* spacing. Conversely, if `"never"` is set to disallow spacing, then any "exception" will *enforce* spacing.
+
+Note that this rule only enforces spacing within parentheses; it does not check spacing within curly or square brackets, but will enforce or disallow spacing of those brackets if and only if they are adjacent to an opening or closing parenthesis.
+
+The following exceptions are available: `["{}", "[]", "()", "empty"]`.
+
+### Empty Exception
+
+Empty parens exception and behavior:
+
+* `always` allows for both `()` and `( )`
+* `never` (default) requires `()`
+* `always` excepting `empty` requires `()`
+* `never` excepting `empty` requires `( )` (empty parens without a space is here forbidden)
+
+### Examples
+
+Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["{}"] }` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["{}"] }]*/
+
+foo({bar: 'baz'});
+foo(1, {bar: 'baz'});
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never", { "exceptions": ["{}"] }` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["{}"] }]*/
+
+foo( {bar: 'baz'} );
+foo(1, {bar: 'baz'} );
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["{}"] }` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}"] }]*/
+
+foo( {bar: 'baz'} );
+foo( 1, {bar: 'baz'} );
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "exceptions": ["{}"] }` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}"] }]*/
+
+foo({bar: 'baz'});
+foo( 1, {bar: 'baz'});
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["[]"] }` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["[]"] }]*/
+
+foo([bar, baz]);
+foo([bar, baz], 1);
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never", { "exceptions": ["[]"] }` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["[]"] }]*/
+
+foo( [bar, baz] );
+foo( [bar, baz], 1);
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["[]"] }` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["[]"] }]*/
+
+foo( [bar, baz] );
+foo( [bar, baz], 1 );
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "exceptions": ["[]"] }` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["[]"] }]*/
+
+foo([bar, baz]);
+foo([bar, baz], 1 );
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"never", { "exceptions": ["()"] }]` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["()"] }]*/
+
+foo((1 + 2));
+foo((1 + 2), 1);
+foo(bar());
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never", { "exceptions": ["()"] }]` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["()"] }]*/
+
+foo( (1 + 2) );
+foo( (1 + 2), 1);
+foo(bar() );
+```
+
+:::
+
+Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["()"] }]` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["()"] }]*/
+
+foo( ( 1 + 2 ) );
+foo( ( 1 + 2 ), 1 );
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "exceptions": ["()"] }]` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["()"] }]*/
+
+foo(( 1 + 2 ));
+foo(( 1 + 2 ), 1 );
+```
+
+:::
+
+The `"empty"` exception concerns empty parentheses, and works the same way as the other exceptions, inverting the first option.
+
+Example of **incorrect** code for this rule with the `"never", { "exceptions": ["empty"] }]` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["empty"] }]*/
+
+foo();
+```
+
+:::
+
+Example of **correct** code for this rule with the `"never", { "exceptions": ["empty"] }]` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "never", { "exceptions": ["empty"] }]*/
+
+foo( );
+```
+
+:::
+
+Example of **incorrect** code for this rule with the `"always", { "exceptions": ["empty"] }]` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["empty"] }]*/
+
+foo( );
+```
+
+:::
+
+Example of **correct** code for this rule with the `"always", { "exceptions": ["empty"] }]` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["empty"] }]*/
+
+foo();
+```
+
+:::
+
+You can include multiple entries in the `"exceptions"` array.
+
+Examples of **incorrect** code for this rule with the `"always", { "exceptions": ["{}", "[]"] }]` option:
+
+::: incorrect
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}", "[]"] }]*/
+
+bar( {bar:'baz'} );
+baz( 1, [1,2] );
+foo( {bar: 'baz'}, [1, 2] );
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always", { "exceptions": ["{}", "[]"] }]` option:
+
+::: correct
+
+```js
+/*eslint space-in-parens: ["error", "always", { "exceptions": ["{}", "[]"] }]*/
+
+bar({bar:'baz'});
+baz( 1, [1,2]);
+foo({bar: 'baz'}, [1, 2]);
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing between parentheses.
diff --git a/eslint/docs/src/rules/space-infix-ops.md b/eslint/docs/src/rules/space-infix-ops.md
new file mode 100644 (file)
index 0000000..856a87e
--- /dev/null
@@ -0,0 +1,93 @@
+---
+title: space-infix-ops
+layout: doc
+rule_type: layout
+---
+
+
+
+While formatting preferences are very personal, a number of style guides require spaces around operators, such as:
+
+```js
+var sum = 1 + 2;
+```
+
+Proponents of this rule believe that it makes code easier to read and can more easily highlight potential errors, such as:
+
+```js
+var sum = i+++2;
+```
+
+While this is valid JavaScript syntax, it is hard to determine what the author intended.
+
+## Rule Details
+
+This rule is aimed at ensuring there are spaces around infix operators.
+
+## Options
+
+This rule accepts a single options argument with the following defaults:
+
+```json
+"space-infix-ops": ["error", { "int32Hint": false }]
+```
+
+### `int32Hint`
+
+Set the `int32Hint` option to `true` (default is `false`) to allow write `a|0` without space.
+
+```js
+var foo = bar|0; // `foo` is forced to be signed 32 bit integer
+```
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint space-infix-ops: "error"*/
+/*eslint-env es6*/
+
+a+b
+
+a+ b
+
+a +b
+
+a?b:c
+
+const a={b:1};
+
+var {a=0}=bar;
+
+function foo(a=0) { }
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint space-infix-ops: "error"*/
+/*eslint-env es6*/
+
+a + b
+
+a       + b
+
+a ? b : c
+
+const a = {b:1};
+
+var {a = 0} = bar;
+
+function foo(a = 0) { }
+```
+
+:::
+
+## When Not To Use It
+
+You can turn this rule off if you are not concerned with the consistency of spacing around infix operators.
diff --git a/eslint/docs/src/rules/space-return-throw-case.md b/eslint/docs/src/rules/space-return-throw-case.md
new file mode 100644 (file)
index 0000000..898a4d6
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: space-return-throw-case
+layout: doc
+
+---
+
+Requires spaces after `return`, `throw`, and `case` keywords.
+
+(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing) rule.
+
+(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule.
+
+Require spaces following `return`, `throw`, and `case`.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint space-return-throw-case: "error"*/
+
+throw{a:0}
+
+function f(){ return-a; }
+
+switch(a){ case'a': break; }
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint space-return-throw-case: "error"*/
+
+throw {a: 0};
+
+function f(){ return -a; }
+
+switch(a){ case 'a': break; }
+```
+
+:::
diff --git a/eslint/docs/src/rules/space-unary-ops.md b/eslint/docs/src/rules/space-unary-ops.md
new file mode 100644 (file)
index 0000000..e775e9f
--- /dev/null
@@ -0,0 +1,178 @@
+---
+title: space-unary-ops
+layout: doc
+rule_type: layout
+---
+
+
+
+Some style guides require or disallow spaces before or after unary operators. This is mainly a stylistic issue, however, some JavaScript expressions can be written without spacing which makes it harder to read and maintain.
+
+## Rule Details
+
+This rule enforces consistency regarding the spaces after `words` unary operators and after/before `nonwords` unary operators.
+
+For `words` operators, this rule only applies when a space is not syntactically required. For instance, `delete obj.foo` requires the space and will not be considered by this rule. The equivalent `delete(obj.foo)` has an optional space (`delete (obj.foo)`), therefore this rule will apply to it.
+
+Examples of unary `words` operators:
+
+```js
+// new
+var joe = new Person();
+
+// delete
+var obj = {
+    foo: 'bar'
+};
+delete obj.foo;
+
+// typeof
+typeof {} // object
+
+// void
+void 0 // undefined
+```
+
+Examples of unary `nonwords` operators:
+
+```js
+if ([1,2,3].indexOf(1) !== -1) {};
+foo = --foo;
+bar = bar++;
+baz = !foo;
+qux = !!baz;
+```
+
+## Options
+
+This rule has three options:
+
+* `words` - applies to unary word operators such as: `new`, `delete`, `typeof`, `void`, `yield`
+* `nonwords` - applies to unary operators such as: `-`, `+`, `--`, `++`, `!`, `!!`
+* `overrides` - specifies overwriting usage of spacing for each
+  operator, word or non word. This is empty by default, but can be used
+  to enforce or disallow spacing around operators. For example:
+
+```js
+    "space-unary-ops": [
+        2, {
+          "words": true,
+          "nonwords": false,
+          "overrides": {
+            "new": false,
+            "++": true
+          }
+    }]
+```
+
+In this case, spacing will be disallowed after a `new` operator and required before/after a `++` operator.
+
+Examples of **incorrect** code for this rule with the default `{"words": true, "nonwords": false}` option:
+
+::: incorrect
+
+```js
+/*eslint space-unary-ops: "error"*/
+
+typeof!foo;
+
+void{foo:0};
+
+new[foo][0];
+
+delete(foo.bar);
+
+++ foo;
+
+foo --;
+
+- foo;
+
++ "3";
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint space-unary-ops: "error"*/
+/*eslint-env es6*/
+
+function *foo() {
+    yield(0)
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint space-unary-ops: "error"*/
+
+async function foo() {
+    await(bar);
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `{"words": true, "nonwords": false}` option:
+
+::: correct
+
+```js
+/*eslint space-unary-ops: "error"*/
+
+// Word unary operator "typeof" is followed by a whitespace.
+typeof !foo;
+
+// Word unary operator "void" is followed by a whitespace.
+void {foo:0};
+
+// Word unary operator "new" is followed by a whitespace.
+new [foo][0];
+
+// Word unary operator "delete" is followed by a whitespace.
+delete (foo.bar);
+
+// Unary operator "++" is not followed by whitespace.
+++foo;
+
+// Unary operator "--" is not preceded by whitespace.
+foo--;
+
+// Unary operator "-" is not followed by whitespace.
+-foo;
+
+// Unary operator "+" is not followed by whitespace.
++"3";
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint space-unary-ops: "error"*/
+/*eslint-env es6*/
+
+function *foo() {
+    yield (0)
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint space-unary-ops: "error"*/
+
+async function foo() {
+    await (bar);
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/space-unary-word-ops.md b/eslint/docs/src/rules/space-unary-word-ops.md
new file mode 100644 (file)
index 0000000..145141c
--- /dev/null
@@ -0,0 +1,73 @@
+---
+title: space-unary-word-ops
+layout: doc
+
+---
+
+Requires spaces after unary word operators.
+
+(removed) This rule was **removed** in ESLint v0.10.0 and **replaced** by the [space-unary-ops](space-unary-ops) rule.
+
+Require spaces following unary word operators.
+
+## Rule Details
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+typeof!a
+```
+
+:::
+
+::: incorrect
+
+```js
+void{a:0}
+```
+
+:::
+
+::: incorrect
+
+```js
+new[a][0]
+```
+
+:::
+
+::: incorrect
+
+```js
+delete(a.b)
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+delete a.b
+```
+
+:::
+
+::: correct
+
+```js
+new C
+```
+
+:::
+
+::: correct
+
+```js
+void 0
+```
+
+:::
diff --git a/eslint/docs/src/rules/spaced-comment.md b/eslint/docs/src/rules/spaced-comment.md
new file mode 100644 (file)
index 0000000..f9d6381
--- /dev/null
@@ -0,0 +1,390 @@
+---
+title: spaced-comment
+layout: doc
+rule_type: suggestion
+related_rules:
+- spaced-line-comment
+---
+
+
+
+Some style guides require or disallow a whitespace immediately after the initial `//` or `/*` of a comment.
+Whitespace after the `//` or `/*` makes it easier to read text in comments.
+On the other hand, commenting out code is easier without having to put a whitespace right after the `//` or `/*`.
+
+## Rule Details
+
+This rule will enforce consistency of spacing after the start of a comment `//` or `/*`. It also provides several
+exceptions for various documentation styles.
+
+## Options
+
+The rule takes two options.
+
+* The first is a string which be either `"always"` or `"never"`. The default is `"always"`.
+
+    * If `"always"` then the `//` or `/*` must be followed by at least one whitespace.
+
+    * If `"never"` then there should be no whitespace following.
+
+* This rule can also take a 2nd option, an object with any of the following keys: `"exceptions"` and `"markers"`.
+
+    * The `"exceptions"` value is an array of string patterns which are considered exceptions to the rule. The rule will not warn when the pattern starts from the beginning of the comment and repeats until the end of the line or `*/` if the comment is a single line comment.
+    Please note that exceptions are ignored if the first argument is `"never"`.
+
+    ```js
+    "spaced-comment": ["error", "always", { "exceptions": ["-", "+"] }]
+    ```
+
+    * The `"markers"` value is an array of string patterns which are considered markers for docblock-style comments,
+    such as an additional `/`, used to denote documentation read by doxygen, vsdoc, etc. which must have additional characters.
+    The `"markers"` array will apply regardless of the value of the first argument, e.g. `"always"` or `"never"`.
+
+    ```js
+    "spaced-comment": ["error", "always", { "markers": ["/"] }]
+    ```
+
+The difference between a marker and an exception is that a marker only appears at the beginning of the comment whereas
+exceptions can occur anywhere in the comment string.
+
+You can also define separate exceptions and markers for block and line comments. The `"block"` object can have an additional key `"balanced"`, a boolean that specifies if inline block comments should have balanced spacing. The default value is `false`.
+
+* If `"balanced": true` and `"always"` then the `/*` must be followed by at least one whitespace, and the `*/` must be preceded by at least one whitespace.
+
+* If `"balanced": true` and `"never"` then there should be no whitespace following `/*` or preceding `*/`.
+
+* If `"balanced": false` then balanced whitespace is not enforced.
+
+```json
+"spaced-comment": ["error", "always", {
+    "line": {
+        "markers": ["/"],
+        "exceptions": ["-", "+"]
+    },
+    "block": {
+        "markers": ["!"],
+        "exceptions": ["*"],
+        "balanced": true
+    }
+}]
+```
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint spaced-comment: ["error", "always"]*/
+
+//This is a comment with no whitespace at the beginning
+
+/*This is a comment with no whitespace at the beginning */
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "block": { "balanced": true } }] */
+/* This is a comment with whitespace at the beginning but not the end*/
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always"] */
+
+// This is a comment with a whitespace at the beginning
+
+/* This is a comment with a whitespace at the beginning */
+
+/*
+ * This is a comment with a whitespace at the beginning
+ */
+
+/*
+This comment has a newline
+*/
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always"] */
+
+/**
+* I am jsdoc
+*/
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint spaced-comment: ["error", "never"]*/
+
+// This is a comment with a whitespace at the beginning
+
+/* This is a comment with a whitespace at the beginning */
+
+/* \nThis is a comment with a whitespace at the beginning */
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint spaced-comment: ["error", "never", { "block": { "balanced": true } }]*/
+/*This is a comment with whitespace at the end */
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint spaced-comment: ["error", "never"]*/
+
+/*This is a comment with no whitespace at the beginning */
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint spaced-comment: ["error", "never"]*/
+
+/**
+* I am jsdoc
+*/
+```
+
+:::
+
+### exceptions
+
+Examples of **incorrect** code for this rule with the `"always"` option combined with `"exceptions"`:
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-"] } }] */
+
+//--------------
+// Comment block
+//--------------
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */
+
+//------++++++++
+// Comment block
+//------++++++++
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */
+
+/*------++++++++*/
+/* Comment block */
+/*------++++++++*/
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-+"] } }] */
+
+/*-+-+-+-+-+-+-+*/
+// Comment block
+/*-+-+-+-+-+-+-+*/
+```
+
+:::
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */
+
+/******** COMMENT *******/
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option combined with `"exceptions"`:
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "exceptions": ["-"] }] */
+
+//--------------
+// Comment block
+//--------------
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-"] } }] */
+
+//--------------
+// Comment block
+//--------------
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "exceptions": ["*"] }] */
+
+/****************
+ * Comment block
+ ****************/
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "exceptions": ["-+"] }] */
+
+//-+-+-+-+-+-+-+
+// Comment block
+//-+-+-+-+-+-+-+
+
+/*-+-+-+-+-+-+-+*/
+// Comment block
+/*-+-+-+-+-+-+-+*/
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-+"] } }] */
+
+/*-+-+-+-+-+-+-+*/
+// Comment block
+/*-+-+-+-+-+-+-+*/
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */
+
+/***************/
+
+/********
+COMMENT
+*******/
+```
+
+:::
+
+### markers
+
+Examples of **incorrect** code for this rule with the `"always"` option combined with `"markers"`:
+
+::: incorrect
+
+```js
+/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */
+
+///This is a comment with a marker but without whitespace
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint spaced-comment: ["error", "always", { "block": { "markers": ["!"], "balanced": true } }]*/
+/*! This is a comment with a marker but without whitespace at the end*/
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint spaced-comment: ["error", "never", { "block": { "markers": ["!"], "balanced": true } }]*/
+/*!This is a comment with a marker but with whitespace at the end */
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option combined with `"markers"`:
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */
+
+/// This is a comment with a marker
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint spaced-comment: ["error", "never", { "markers": ["!<"] }]*/
+
+//!<This is a line comment with a marker
+
+/*!<this is a block comment with a marker
+subsequent lines are ignored
+*/
+```
+
+:::
+
+::: correct
+
+```js
+/* eslint spaced-comment: ["error", "always", { "markers": ["global"] }] */
+
+/*global ABC*/
+```
+
+:::
diff --git a/eslint/docs/src/rules/spaced-line-comment.md b/eslint/docs/src/rules/spaced-line-comment.md
new file mode 100644 (file)
index 0000000..ca5a99f
--- /dev/null
@@ -0,0 +1,104 @@
+---
+title: spaced-line-comment
+layout: doc
+
+related_rules:
+- spaced-comment
+---
+
+Enforces consistent spacing after `//` in line comments.
+
+(removed) This rule was **removed** in ESLint v1.0 and **replaced** by the [spaced-comment](spaced-comment) rule.
+
+Some style guides require or disallow a whitespace immediately after the initial `//` of a line comment.
+Whitespace after the `//` makes it easier to read text in comments.
+On the other hand, commenting out code is easier without having to put a whitespace right after the `//`.
+
+## Rule Details
+
+This rule will enforce consistency of spacing after the start of a line comment `//`.
+
+This rule takes two arguments. If the first is `"always"` then the `//` must be followed by at least once whitespace.
+If `"never"` then there should be no whitespace following.
+The default is `"always"`.
+
+The second argument is an object with one key, `"exceptions"`.
+The value is an array of string patterns which are considered exceptions to the rule.
+It is important to note that the exceptions are ignored if the first argument is `"never"`.
+Exceptions cannot be mixed.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+// When ["never"]
+// This is a comment with a whitespace at the beginning
+```
+
+:::
+
+::: incorrect
+
+```js
+//When ["always"]
+//This is a comment with no whitespace at the beginning
+var foo = 5;
+```
+
+:::
+
+::: incorrect
+
+```js
+// When ["always",{"exceptions":["-","+"]}]
+//------++++++++
+// Comment block
+//------++++++++
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+// When ["always"]
+// This is a comment with a whitespace at the beginning
+var foo = 5;
+```
+
+:::
+
+::: correct
+
+```js
+//When ["never"]
+//This is a comment with no whitespace at the beginning
+var foo = 5;
+```
+
+:::
+
+::: correct
+
+```js
+// When ["always",{"exceptions":["-"]}]
+//--------------
+// Comment block
+//--------------
+```
+
+:::
+
+::: correct
+
+```js
+// When ["always",{"exceptions":["-+"]}]
+//-+-+-+-+-+-+-+
+// Comment block
+//-+-+-+-+-+-+-+
+```
+
+:::
diff --git a/eslint/docs/src/rules/strict.md b/eslint/docs/src/rules/strict.md
new file mode 100644 (file)
index 0000000..f811a60
--- /dev/null
@@ -0,0 +1,344 @@
+---
+title: strict
+layout: doc
+rule_type: suggestion
+---
+
+
+
+A strict mode directive is a `"use strict"` literal at the beginning of a script or function body. It enables strict mode semantics.
+
+When a directive occurs in global scope, strict mode applies to the entire script:
+
+```js
+"use strict";
+
+// strict mode
+
+function foo() {
+    // strict mode
+}
+```
+
+When a directive occurs at the beginning of a function body, strict mode applies only to that function, including all contained functions:
+
+```js
+function foo() {
+    "use strict";
+    // strict mode
+}
+
+function foo2() {
+    // not strict mode
+};
+
+(function() {
+    "use strict";
+    function bar() {
+        // strict mode
+    }
+}());
+```
+
+In the **CommonJS** module system, a hidden function wraps each module and limits the scope of a "global" strict mode directive.
+
+In **ECMAScript** modules, which always have strict mode semantics, the directives are unnecessary.
+
+## Rule Details
+
+This rule requires or disallows strict mode directives.
+
+This rule disallows strict mode directives, no matter which option is specified, if ESLint configuration specifies either of the following as [parser options](/docs/user-guide/configuring/language-options#specifying-parser-options):
+
+* `"sourceType": "module"` that is, files are **ECMAScript** modules
+* `"impliedStrict": true` property in the `ecmaFeatures` object
+
+This rule disallows strict mode directives, no matter which option is specified, in functions with non-simple parameter lists (for example, parameter lists with default parameter values) because that is a syntax error in **ECMAScript 2016** and later. See the examples of the [function](#function) option.
+
+This rule does not apply to class static blocks, no matter which option is specified, because class static blocks do not have directives. Therefore, a `"use strict"` statement in a class static block is not a directive, and will be reported by the [no-unused-expressions](no-unused-expressions) rule.
+
+The `--fix` option on the command line does not insert new `"use strict"` statements, but only removes unneeded statements.
+
+## Options
+
+This rule has a string option:
+
+* `"safe"` (default) corresponds either of the following options:
+    * `"global"` if ESLint considers a file to be a **CommonJS** module
+    * `"function"` otherwise
+* `"global"` requires one strict mode directive in the global scope (and disallows any other strict mode directives)
+* `"function"` requires one strict mode directive in each top-level function declaration or expression (and disallows any other strict mode directives)
+* `"never"` disallows strict mode directives
+
+### safe
+
+The `"safe"` option corresponds to the `"global"` option if ESLint considers a file to be a **Node.js** or **CommonJS** module because the configuration specifies either of the following:
+
+* `node` or `commonjs` [environments](/docs/user-guide/configuring/language-options#specifying-environments)
+* `"globalReturn": true` property in the `ecmaFeatures` object of [parser options](/docs/user-guide/configuring/language-options#specifying-parser-options)
+
+Otherwise the `"safe"` option corresponds to the `"function"` option. Note that if `"globalReturn": false` is explicitly specified in the configuration, the `"safe"` option will correspond to the `"function"` option regardless of the specified environment.
+
+### global
+
+Examples of **incorrect** code for this rule with the `"global"` option:
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "global"]*/
+
+function foo() {
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "global"]*/
+
+function foo() {
+    "use strict";
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "global"]*/
+
+"use strict";
+
+function foo() {
+    "use strict";
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"global"` option:
+
+::: correct
+
+```js
+/*eslint strict: ["error", "global"]*/
+
+"use strict";
+
+function foo() {
+}
+```
+
+:::
+
+### function
+
+This option ensures that all function bodies are strict mode code, while global code is not. Particularly if a build step concatenates multiple scripts, a strict mode directive in global code of one script could unintentionally enable strict mode in another script that was not intended to be strict code.
+
+Examples of **incorrect** code for this rule with the `"function"` option:
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "function"]*/
+
+"use strict";
+
+function foo() {
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "function"]*/
+
+function foo() {
+}
+
+(function() {
+    function bar() {
+        "use strict";
+    }
+}());
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "function"]*/
+/*eslint-env es6*/
+
+// Illegal "use strict" directive in function with non-simple parameter list.
+// This is a syntax error since ES2016.
+function foo(a = 1) {
+    "use strict";
+}
+
+// We cannot write "use strict" directive in this function.
+// So we have to wrap this function with a function with "use strict" directive.
+function foo(a = 1) {
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"function"` option:
+
+::: correct
+
+```js
+/*eslint strict: ["error", "function"]*/
+
+function foo() {
+    "use strict";
+}
+
+(function() {
+    "use strict";
+
+    function bar() {
+    }
+
+    function baz(a = 1) {
+    }
+}());
+
+var foo = (function() {
+    "use strict";
+
+    return function foo(a = 1) {
+    };
+}());
+```
+
+:::
+
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "never"]*/
+
+"use strict";
+
+function foo() {
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint strict: ["error", "never"]*/
+
+function foo() {
+    "use strict";
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+::: correct
+
+```js
+/*eslint strict: ["error", "never"]*/
+
+function foo() {
+}
+```
+
+:::
+
+### earlier default (removed)
+
+(removed) The default option (that is, no string option specified) for this rule was **removed** in ESLint v1.0. The `"function"` option is most similar to the removed option.
+
+This option ensures that all functions are executed in strict mode. A strict mode directive must be present in global code or in every top-level function declaration or expression. It does not concern itself with unnecessary strict mode directives in nested functions that are already strict, nor with multiple strict mode directives at the same level.
+
+Examples of **incorrect** code for this rule with the earlier default option which has been removed:
+
+::: incorrect
+
+```js
+// "strict": "error"
+
+function foo() {
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+// "strict": "error"
+
+(function() {
+    function bar() {
+        "use strict";
+    }
+}());
+```
+
+:::
+
+Examples of **correct** code for this rule with the earlier default option which has been removed:
+
+::: correct
+
+```js
+// "strict": "error"
+
+"use strict";
+
+function foo() {
+}
+```
+
+:::
+
+::: correct
+
+```js
+// "strict": "error"
+
+function foo() {
+    "use strict";
+}
+```
+
+:::
+
+::: correct
+
+```js
+// "strict": "error"
+
+(function() {
+    "use strict";
+    function bar() {
+        "use strict";
+    }
+}());
+```
+
+:::
+
+## When Not To Use It
+
+In a codebase that has both strict and non-strict code, either turn this rule off, or [selectively disable it](/docs/user-guide/configuring/rules#disabling-rules) where necessary. For example, functions referencing `arguments.callee` are invalid in strict mode. A [full list of strict mode differences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode#Differences_from_non-strict_to_strict) is available on MDN.
diff --git a/eslint/docs/src/rules/switch-colon-spacing.md b/eslint/docs/src/rules/switch-colon-spacing.md
new file mode 100644 (file)
index 0000000..6942aad
--- /dev/null
@@ -0,0 +1,101 @@
+---
+title: switch-colon-spacing
+layout: doc
+rule_type: layout
+---
+
+
+
+Spacing around colons improves readability of `case`/`default` clauses.
+
+## Rule Details
+
+This rule controls spacing around colons of `case` and `default` clauses in `switch` statements.
+This rule does the check only if the consecutive tokens exist on the same line.
+
+This rule has 2 options that are boolean value.
+
+```json
+{
+    "switch-colon-spacing": ["error", {"after": true, "before": false}]
+}
+```
+
+* `"after": true` (Default) requires one or more spaces after colons.
+* `"after": false` disallows spaces after colons.
+* `"before": true` requires one or more spaces before colons.
+* `"before": false` (Default) disallows before colons.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint switch-colon-spacing: "error"*/
+
+switch (a) {
+    case 0 :break;
+    default :foo();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint switch-colon-spacing: "error"*/
+
+switch (a) {
+    case 0: foo(); break;
+    case 1:
+        bar();
+        break;
+    default:
+        baz();
+        break;
+}
+```
+
+:::
+
+Examples of **incorrect** code for this rule with `{"after": false, "before": true}` option:
+
+::: incorrect
+
+```js
+/*eslint switch-colon-spacing: ["error", {"after": false, "before": true}]*/
+
+switch (a) {
+    case 0: break;
+    default: foo();
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `{"after": false, "before": true}` option:
+
+::: correct
+
+```js
+/*eslint switch-colon-spacing: ["error", {"after": false, "before": true}]*/
+
+switch (a) {
+    case 0 :foo(); break;
+    case 1 :
+        bar();
+        break;
+    default :
+        baz();
+        break;
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to notify spacing around colons of switch statements, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/symbol-description.md b/eslint/docs/src/rules/symbol-description.md
new file mode 100644 (file)
index 0000000..78e4e66
--- /dev/null
@@ -0,0 +1,68 @@
+---
+title: symbol-description
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-description
+---
+
+
+The `Symbol` function may have an optional description:
+
+```js
+var foo = Symbol("some description");
+
+var someString = "some description";
+var bar = Symbol(someString);
+```
+
+Using `description` promotes easier debugging: when a symbol is logged the description is used:
+
+```js
+var foo = Symbol("some description");
+
+> console.log(foo);
+// Symbol(some description)
+```
+
+It may facilitate identifying symbols when one is observed during debugging.
+
+## Rule Details
+
+This rules requires a description when creating symbols.
+
+## Examples
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint symbol-description: "error"*/
+/*eslint-env es6*/
+
+var foo = Symbol();
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint symbol-description: "error"*/
+/*eslint-env es6*/
+
+var foo = Symbol("some description");
+
+var someString = "some description";
+var bar = Symbol(someString);
+```
+
+:::
+
+## When Not To Use It
+
+This rule should not be used in ES3/5 environments.
+In addition, this rule can be safely turned off if you don't want to enforce presence of `description` when creating Symbols.
diff --git a/eslint/docs/src/rules/template-curly-spacing.md b/eslint/docs/src/rules/template-curly-spacing.md
new file mode 100644 (file)
index 0000000..f0079ee
--- /dev/null
@@ -0,0 +1,104 @@
+---
+title: template-curly-spacing
+layout: doc
+rule_type: layout
+---
+
+
+
+We can embed expressions in template strings with using a pair of `${` and `}`.
+
+This rule can force usage of spacing _within_ the curly brace pair according to style guides.
+
+```js
+let hello = `hello, ${people.name}!`;
+```
+
+## Rule Details
+
+This rule aims to maintain consistency around the spacing inside of template literals.
+
+## Options
+
+```json
+{
+    "template-curly-spacing": ["error", "never"]
+}
+```
+
+This rule has one option which has either `"never"` or `"always"` as value.
+
+* `"never"` (by default) - Disallows spaces inside of the curly brace pair.
+* `"always"` - Requires one or more spaces inside of the curly brace pair.
+
+## Examples
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint template-curly-spacing: "error"*/
+
+`hello, ${ people.name}!`;
+`hello, ${people.name }!`;
+
+`hello, ${ people.name }!`;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint template-curly-spacing: "error"*/
+
+`hello, ${people.name}!`;
+
+`hello, ${
+    people.name
+}!`;
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint template-curly-spacing: ["error", "always"]*/
+
+`hello, ${ people.name}!`;
+`hello, ${people.name }!`;
+
+`hello, ${people.name}!`;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint template-curly-spacing: ["error", "always"]*/
+
+`hello, ${ people.name }!`;
+
+`hello, ${
+    people.name
+}!`;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of spacing inside of template strings, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/template-tag-spacing.md b/eslint/docs/src/rules/template-tag-spacing.md
new file mode 100644 (file)
index 0000000..309474f
--- /dev/null
@@ -0,0 +1,94 @@
+---
+title: template-tag-spacing
+layout: doc
+rule_type: layout
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
+- https://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals
+---
+
+
+
+With ES6, it's possible to create functions called [tagged template literals](#further-reading) where the function parameters consist of a template literal's strings and expressions.
+
+When using tagged template literals, it's possible to insert whitespace between the tag function and the template literal. Since this whitespace is optional, the following lines are equivalent:
+
+```js
+let hello = func`Hello world`;
+let hello = func `Hello world`;
+```
+
+## Rule Details
+
+This rule aims to maintain consistency around the spacing between template tag functions and their template literals.
+
+## Options
+
+```json
+{
+    "template-tag-spacing": ["error", "never"]
+}
+```
+
+This rule has one option whose value can be set to `"never"` or `"always"`
+
+* `"never"` (default) - Disallows spaces between a tag function and its template literal.
+* `"always"` - Requires one or more spaces between a tag function and its template literal.
+
+## Examples
+
+### never
+
+Examples of **incorrect** code for this rule with the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint template-tag-spacing: "error"*/
+
+func `Hello world`;
+```
+
+:::
+
+Examples of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint template-tag-spacing: "error"*/
+
+func`Hello world`;
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint template-tag-spacing: ["error", "always"]*/
+
+func`Hello world`;
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint template-tag-spacing: ["error", "always"]*/
+
+func `Hello world`;
+```
+
+:::
+
+## When Not To Use It
+
+If you don't want to be notified about usage of spacing between tag functions and their template literals, then it's safe to disable this rule.
diff --git a/eslint/docs/src/rules/unicode-bom.md b/eslint/docs/src/rules/unicode-bom.md
new file mode 100644 (file)
index 0000000..1b8683c
--- /dev/null
@@ -0,0 +1,85 @@
+---
+title: unicode-bom
+layout: doc
+rule_type: layout
+---
+
+
+
+The Unicode Byte Order Mark (BOM) is used to specify whether code units are big
+endian or little endian. That is, whether the most significant or least
+significant bytes come first. UTF-8 does not require a BOM because byte ordering
+does not matter when characters are a single byte. Since UTF-8 is the dominant
+encoding of the web, we make `"never"` the default option.
+
+## Rule Details
+
+If the `"always"` option is used, this rule requires that files always begin
+with the Unicode BOM character U+FEFF. If `"never"` is used, files must never
+begin with U+FEFF.
+
+## Options
+
+This rule has a string option:
+
+* `"always"` files must begin with the Unicode BOM
+* `"never"` (default) files must not begin with the Unicode BOM
+
+### always
+
+Example of **correct** code for this rule with the `"always"` option:
+
+::: correct
+
+```js
+/*eslint unicode-bom: ["error", "always"]*/
+
+U+FEFF
+var abc;
+```
+
+:::
+
+Example of **incorrect** code for this rule with the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint unicode-bom: ["error", "always"]*/
+
+var abc;
+```
+
+:::
+
+### never
+
+Example of **correct** code for this rule with the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint unicode-bom: ["error", "never"]*/
+
+var abc;
+```
+
+:::
+
+Example of **incorrect** code for this rule with the `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint unicode-bom: ["error", "never"]*/
+
+U+FEFF
+var abc;
+```
+
+:::
+
+## When Not To Use It
+
+If you use some UTF-16 or UTF-32 files and you want to allow a file to
+optionally begin with a Unicode BOM, you should turn this rule off.
diff --git a/eslint/docs/src/rules/use-isnan.md b/eslint/docs/src/rules/use-isnan.md
new file mode 100644 (file)
index 0000000..e76dcb4
--- /dev/null
@@ -0,0 +1,283 @@
+---
+title: use-isnan
+layout: doc
+rule_type: problem
+---
+
+
+
+In JavaScript, `NaN` is a special value of the `Number` type. It's used to represent any of the "not-a-number" values represented by the double-precision 64-bit format as specified by the IEEE Standard for Binary Floating-Point Arithmetic.
+
+Because `NaN` is unique in JavaScript by not being equal to anything, including itself, the results of comparisons to `NaN` are confusing:
+
+* `NaN === NaN` or `NaN == NaN` evaluate to false
+* `NaN !== NaN` or `NaN != NaN` evaluate to true
+
+Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is `NaN`.
+
+## Rule Details
+
+This rule disallows comparisons to 'NaN'.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint use-isnan: "error"*/
+
+if (foo == NaN) {
+    // ...
+}
+
+if (foo != NaN) {
+    // ...
+}
+
+if (foo == Number.NaN) {
+    // ...
+}
+
+if (foo != Number.NaN) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint use-isnan: "error"*/
+
+if (isNaN(foo)) {
+    // ...
+}
+
+if (!isNaN(foo)) {
+    // ...
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option, with two options:
+
+* `"enforceForSwitchCase": true` (default) additionally disallows `case NaN` and `switch(NaN)` in `switch` statements.
+* `"enforceForIndexOf": true` additionally disallows the use of `indexOf` and `lastIndexOf` methods with `NaN`. Default is `false`, meaning that this rule by default does not warn about `indexOf(NaN)` or `lastIndexOf(NaN)` method calls.
+
+### enforceForSwitchCase
+
+The `switch` statement internally uses the `===` comparison to match the expression's value to a case clause.
+Therefore, it can never match `case NaN`. Also, `switch(NaN)` can never match a case clause.
+
+Examples of **incorrect** code for this rule with `"enforceForSwitchCase"` option set to `true` (default):
+
+::: incorrect
+
+```js
+/*eslint use-isnan: ["error", {"enforceForSwitchCase": true}]*/
+
+switch (foo) {
+    case NaN:
+        bar();
+        break;
+    case 1:
+        baz();
+        break;
+    // ...
+}
+
+switch (NaN) {
+    case a:
+        bar();
+        break;
+    case b:
+        baz();
+        break;
+    // ...
+}
+
+switch (foo) {
+    case Number.NaN:
+        bar();
+        break;
+    case 1:
+        baz();
+        break;
+    // ...
+}
+
+switch (Number.NaN) {
+    case a:
+        bar();
+        break;
+    case b:
+        baz();
+        break;
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for this rule with `"enforceForSwitchCase"` option set to `true` (default):
+
+::: correct
+
+```js
+/*eslint use-isnan: ["error", {"enforceForSwitchCase": true}]*/
+
+if (Number.isNaN(foo)) {
+    bar();
+} else {
+    switch (foo) {
+        case 1:
+            baz();
+            break;
+        // ...
+    }
+}
+
+if (Number.isNaN(a)) {
+    bar();
+} else if (Number.isNaN(b)) {
+    baz();
+} // ...
+```
+
+:::
+
+Examples of **correct** code for this rule with `"enforceForSwitchCase"` option set to `false`:
+
+::: correct
+
+```js
+/*eslint use-isnan: ["error", {"enforceForSwitchCase": false}]*/
+
+switch (foo) {
+    case NaN:
+        bar();
+        break;
+    case 1:
+        baz();
+        break;
+    // ...
+}
+
+switch (NaN) {
+    case a:
+        bar();
+        break;
+    case b:
+        baz();
+        break;
+    // ...
+}
+
+switch (foo) {
+    case Number.NaN:
+        bar();
+        break;
+    case 1:
+        baz();
+        break;
+    // ...
+}
+
+switch (Number.NaN) {
+    case a:
+        bar();
+        break;
+    case b:
+        baz();
+        break;
+    // ...
+}
+```
+
+:::
+
+### enforceForIndexOf
+
+The following methods internally use the `===` comparison to match the given value with an array element:
+
+* [`Array.prototype.indexOf`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.indexof)
+* [`Array.prototype.lastIndexOf`](https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.lastindexof)
+
+Therefore, for any array `foo`, `foo.indexOf(NaN)` and `foo.lastIndexOf(NaN)` will always return `-1`.
+
+Set `"enforceForIndexOf"` to `true` if you want this rule to report `indexOf(NaN)` and `lastIndexOf(NaN)` method calls.
+
+Examples of **incorrect** code for this rule with `"enforceForIndexOf"` option set to `true`:
+
+::: incorrect
+
+```js
+/*eslint use-isnan: ["error", {"enforceForIndexOf": true}]*/
+
+var hasNaN = myArray.indexOf(NaN) >= 0;
+
+var firstIndex = myArray.indexOf(NaN);
+
+var lastIndex = myArray.lastIndexOf(NaN);
+```
+
+:::
+
+Examples of **correct** code for this rule with `"enforceForIndexOf"` option set to `true`:
+
+::: correct
+
+```js
+/*eslint use-isnan: ["error", {"enforceForIndexOf": true}]*/
+
+function myIsNaN(val) {
+    return typeof val === "number" && isNaN(val);
+}
+
+function indexOfNaN(arr) {
+    for (var i = 0; i < arr.length; i++) {
+        if (myIsNaN(arr[i])) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+function lastIndexOfNaN(arr) {
+    for (var i = arr.length - 1; i >= 0; i--) {
+        if (myIsNaN(arr[i])) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+var hasNaN = myArray.some(myIsNaN);
+
+var hasNaN = indexOfNaN(myArray) >= 0;
+
+var firstIndex = indexOfNaN(myArray);
+
+var lastIndex = lastIndexOfNaN(myArray);
+
+// ES2015
+var hasNaN = myArray.some(Number.isNaN);
+
+// ES2015
+var firstIndex = myArray.findIndex(Number.isNaN);
+
+// ES2016
+var hasNaN = myArray.includes(NaN);
+```
+
+:::
+
+#### Known Limitations
+
+This option checks methods with the given names, *even if* the object which has the method is *not* an array.
diff --git a/eslint/docs/src/rules/valid-jsdoc.md b/eslint/docs/src/rules/valid-jsdoc.md
new file mode 100644 (file)
index 0000000..1eca97e
--- /dev/null
@@ -0,0 +1,439 @@
+---
+title: valid-jsdoc
+layout: doc
+rule_type: suggestion
+related_rules:
+- require-jsdoc
+further_reading:
+- https://jsdoc.app
+---
+
+
+
+This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
+
+[JSDoc](http://usejsdoc.org) generates application programming interface (API) documentation from specially-formatted comments in JavaScript code. For example, this is a JSDoc comment for a function:
+
+```js
+/**
+ * Add two numbers.
+ * @param {number} num1 The first number.
+ * @param {number} num2 The second number.
+ * @returns {number} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+```
+
+If comments are invalid because of typing mistakes, then documentation will be incomplete.
+
+If comments are inconsistent because they are not updated when function definitions are modified, then readers might become confused.
+
+## Rule Details
+
+This rule enforces valid and consistent JSDoc comments. It reports any of the following problems:
+
+* missing parameter tag: `@arg`, `@argument`, or `@param`
+* inconsistent order of parameter names in a comment compared to the function or method
+* missing return tag: `@return` or `@returns`
+* missing parameter or return type
+* missing parameter or return description
+* syntax error
+
+This rule does not report missing JSDoc comments for classes, functions, or methods.
+
+**Note:** This rule does not support all of the Google Closure documentation tool's use cases. As such, some code such as `(/**number*/ n => n * 2);` will be flagged as missing appropriate function JSDoc comments even though `/**number*/` is intended to be a type hint and not a documentation block for the function. We don't recommend using this rule if you use type hints in this way.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint valid-jsdoc: "error"*/
+
+// expected @param tag for parameter num1 but found num instead
+// missing @param tag for parameter num2
+// missing return type
+/**
+ * Add two numbers.
+ * @param {number} num The first number.
+ * @returns The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+
+// missing brace
+// missing @returns tag
+/**
+ * @param {string name Whom to greet.
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+
+// missing parameter type for num1
+// missing parameter description for num2
+/**
+ * Represents a sum.
+ * @constructor
+ * @param num1 The first number.
+ * @param {number} num2
+ */
+function sum(num1, num2) {
+    this.num1 = num1;
+    this.num2 = num2;
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: "error"*/
+/*eslint-env es6*/
+
+/**
+ * Add two numbers.
+ * @param {number} num1 The first number.
+ * @param {number} num2 The second number.
+ * @returns {number} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+
+// default options allow missing function description
+// return type `void` means the function has no `return` statement
+/**
+ * @param {string} name Whom to greet.
+ * @returns {void}
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+
+// @constructor tag allows missing @returns tag
+/**
+ * Represents a sum.
+ * @constructor
+ * @param {number} num1 The first number.
+ * @param {number} num2 The second number.
+ */
+function sum(num1, num2) {
+    this.num1 = num1;
+    this.num2 = num2;
+}
+
+// class constructor allows missing @returns tag
+/**
+ * Represents a sum.
+ */
+class Sum {
+    /**
+     * @param {number} num1 The first number.
+     * @param {number} num2 The second number.
+     */
+    constructor(num1, num2) {
+        this.num1 = num1;
+        this.num2 = num2;
+    }
+}
+
+// @abstract tag allows @returns tag without `return` statement
+class Widget {
+    /**
+    * When the state changes, does it affect the rendered appearance?
+    * @abstract
+    * @param {Object} state The new state of the widget.
+    * @returns {boolean} Is current appearance inconsistent with new state?
+    */
+    mustRender (state) {
+        throw new Error("Widget subclass did not implement mustRender");
+    }
+}
+
+// @override tag allows missing @param and @returns tags
+class WonderfulWidget extends Widget {
+    /**
+     * @override
+     */
+    mustRender (state) {
+        return state !== this.state; // shallow comparison
+    }
+}
+```
+
+:::
+
+## Options
+
+This rule has an object option:
+
+* `"prefer"` enforces consistent documentation tags specified by an object whose properties mean instead of key use value (for example, `"return": "returns"` means instead of `@return` use `@returns`)
+* `"preferType"` enforces consistent type strings specified by an object whose properties mean instead of key use value (for example, `"object": "Object"` means instead of `object` use `Object`)
+* `"requireReturn"` requires a return tag:
+    * `true` (default) **even if** the function or method does not have a `return` statement (this option value does not apply to constructors)
+    * `false` **if and only if** the function or method has a `return` statement or returns a value e.g. `async` function (this option value does apply to constructors)
+* `"requireReturnType": false` allows missing type in return tags
+* `"matchDescription"` specifies (as a string) a regular expression to match the description in each JSDoc comment (for example, `".+"` requires a description; this option does not apply to descriptions in parameter or return tags)
+* `"requireParamDescription": false` allows missing description in parameter tags
+* `"requireReturnDescription": false` allows missing description in return tags
+* `"requireParamType": false` allows missing type in parameter tags
+
+### prefer
+
+Examples of additional **incorrect** code for this rule with sample `"prefer": { "arg": "param", "argument": "param", "class": "constructor", "return": "returns", "virtual": "abstract" }` options:
+
+::: incorrect
+
+```js
+/*eslint valid-jsdoc: ["error", { "prefer": { "arg": "param", "argument": "param", "class": "constructor", "return": "returns", "virtual": "abstract" } }]*/
+/*eslint-env es6*/
+
+/**
+ * Add two numbers.
+ * @arg {int} num1 The first number.
+ * @arg {int} num2 The second number.
+ * @return {int} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+
+/**
+ * Represents a sum.
+ * @class
+ * @argument {number} num1 The first number.
+ * @argument {number} num2 The second number.
+ */
+function sum(num1, num2) {
+    this.num1 = num1;
+    this.num2 = num2;
+}
+
+class Widget {
+    /**
+     * When the state changes, does it affect the rendered appearance?
+     * @virtual
+     * @argument {Object} state The new state of the widget.
+     * @return {boolean} Is current appearance inconsistent with new state?
+     */
+    mustRender (state) {
+        throw new Error("Widget subclass did not implement mustRender");
+    }
+}
+```
+
+:::
+
+### preferType
+
+Examples of additional **incorrect** code for this rule with sample `"preferType": { "Boolean": "boolean", "Number": "number", "object": "Object", "String": "string" }` options:
+
+::: incorrect
+
+```js
+/*eslint valid-jsdoc: ["error", { "preferType": { "Boolean": "boolean", "Number": "number", "object": "Object", "String": "string" } }]*/
+/*eslint-env es6*/
+
+/**
+ * Add two numbers.
+ * @param {Number} num1 The first number.
+ * @param {Number} num2 The second number.
+ * @returns {Number} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+
+/**
+ * Output a greeting as a side effect.
+ * @param {String} name Whom to greet.
+ * @returns {void}
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+
+class Widget {
+    /**
+     * When the state changes, does it affect the rendered appearance?
+     * @abstract
+     * @param {object} state The new state of the widget.
+     * @returns {Boolean} Is current appearance inconsistent with new state?
+     */
+    mustRender (state) {
+        throw new Error("Widget subclass did not implement mustRender");
+    }
+}
+```
+
+:::
+
+### requireReturn
+
+Examples of additional **incorrect** code for this rule with the `"requireReturn": false` option:
+
+::: incorrect
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireReturn": false }]*/
+
+// unexpected @returns tag because function has no `return` statement
+/**
+ * @param {string} name Whom to greet.
+ * @returns {string} The greeting.
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+
+// add @abstract tag to allow @returns tag without `return` statement
+class Widget {
+    /**
+     * When the state changes, does it affect the rendered appearance?
+     * @param {Object} state The new state of the widget.
+     * @returns {boolean} Is current appearance inconsistent with new state?
+     */
+    mustRender (state) {
+        throw new Error("Widget subclass did not implement mustRender");
+    }
+}
+```
+
+:::
+
+Example of additional **correct** code for this rule with the `"requireReturn": false` option:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireReturn": false }]*/
+
+/**
+ * @param {string} name Whom to greet.
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+```
+
+:::
+
+### requireReturnType
+
+Example of additional **correct** code for this rule with the `"requireReturnType": false` option:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireReturnType": false }]*/
+
+/**
+ * Add two numbers.
+ * @param {number} num1 The first number.
+ * @param {number} num2 The second number.
+ * @returns The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+```
+
+:::
+
+### requireParamType
+
+Example of additional **correct** code for this rule with the `"requireParamType": false` option:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireParamType": false }]*/
+
+/**
+ * Add two numbers.
+ * @param num1 The first number.
+ * @param num2 The second number.
+ * @returns {number} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+```
+
+:::
+
+### matchDescription
+
+Example of additional **incorrect** code for this rule with a sample `"matchDescription": ".+"` option:
+
+::: incorrect
+
+```js
+/*eslint valid-jsdoc: ["error", { "matchDescription": ".+" }]*/
+
+// missing function description
+/**
+ * @param {string} name Whom to greet.
+ * @returns {void}
+ */
+function greet(name) {
+    console.log("Hello " + name);
+}
+```
+
+:::
+
+### requireParamDescription
+
+Example of additional **correct** code for this rule with the `"requireParamDescription": false` option:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireParamDescription": false }]*/
+
+/**
+ * Add two numbers.
+ * @param {int} num1
+ * @param {int} num2
+ * @returns {int} The sum of the two numbers.
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+```
+
+:::
+
+### requireReturnDescription
+
+Example of additional **correct** code for this rule with the `"requireReturnDescription": false` option:
+
+::: correct
+
+```js
+/*eslint valid-jsdoc: ["error", { "requireReturnDescription": false }]*/
+
+/**
+ * Add two numbers.
+ * @param {number} num1 The first number.
+ * @param {number} num2 The second number.
+ * @returns {number}
+ */
+function add(num1, num2) {
+    return num1 + num2;
+}
+```
+
+:::
+
+## When Not To Use It
+
+If you aren't using JSDoc, then you can safely turn this rule off.
diff --git a/eslint/docs/src/rules/valid-typeof.md b/eslint/docs/src/rules/valid-typeof.md
new file mode 100644 (file)
index 0000000..66f9724
--- /dev/null
@@ -0,0 +1,89 @@
+---
+title: valid-typeof
+layout: doc
+rule_type: problem
+further_reading:
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
+---
+
+
+
+
+
+For a vast majority of use cases, the result of the `typeof` operator is one of the following string literals: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, `"function"`, `"symbol"`, and `"bigint"`. It is usually a typing mistake to compare the result of a `typeof` operator to other string literals.
+
+## Rule Details
+
+This rule enforces comparing `typeof` expressions to valid string literals.
+
+## Options
+
+This rule has an object option:
+
+* `"requireStringLiterals": true` requires `typeof` expressions to only be compared to string literals or other `typeof` expressions, and disallows comparisons to any other value.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint valid-typeof: "error"*/
+
+typeof foo === "strnig"
+typeof foo == "undefimed"
+typeof bar != "nunber"
+typeof bar !== "fucntion"
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint valid-typeof: "error"*/
+
+typeof foo === "string"
+typeof bar == "undefined"
+typeof foo === baz
+typeof bar === typeof qux
+```
+
+:::
+
+Examples of **incorrect** code with the `{ "requireStringLiterals": true }` option:
+
+::: incorrect
+
+```js
+/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/
+
+typeof foo === undefined
+typeof bar == Object
+typeof baz === "strnig"
+typeof qux === "some invalid type"
+typeof baz === anotherVariable
+typeof foo == 5
+```
+
+:::
+
+Examples of **correct** code with the `{ "requireStringLiterals": true }` option:
+
+::: correct
+
+```js
+/*eslint valid-typeof: ["error", { "requireStringLiterals": true }]*/
+
+typeof foo === "undefined"
+typeof bar == "object"
+typeof baz === "string"
+typeof bar === typeof qux
+```
+
+:::
+
+## When Not To Use It
+
+You may want to turn this rule off if you will be using the `typeof` operator on host objects.
diff --git a/eslint/docs/src/rules/vars-on-top.md b/eslint/docs/src/rules/vars-on-top.md
new file mode 100644 (file)
index 0000000..9700600
--- /dev/null
@@ -0,0 +1,161 @@
+---
+title: vars-on-top
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
+- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting
+- https://danhough.com/blog/single-var-pattern-rant/
+- https://benalman.com/news/2012/05/multiple-var-statements-javascript/
+---
+
+
+The `vars-on-top` rule generates warnings when variable declarations are not used serially at the top of a function scope or the top of a program.
+By default variable declarations are always moved (“hoisted”) invisibly to the top of their containing scope by the JavaScript interpreter.
+This rule forces the programmer to represent that behavior by manually moving the variable declaration to the top of its containing scope.
+
+## Rule Details
+
+This rule aims to keep all variable declarations in the leading series of statements.
+Allowing multiple declarations helps promote maintainability and is thus allowed.
+
+Examples of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint vars-on-top: "error"*/
+
+// Variable declaration in a nested block, and a variable declaration after other statements:
+function doSomething() {
+    if (true) {
+        var first = true;
+    }
+    var second;
+}
+
+// Variable declaration in for initializer:
+function doSomething() {
+    for (var i=0; i<10; i++) {}
+}
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint vars-on-top: "error"*/
+
+// Variable declaration after other statements:
+f();
+var a;
+```
+
+:::
+
+::: incorrect
+
+```js
+/*eslint vars-on-top: "error"*/
+
+// Variables in class static blocks should be at the top of the static blocks.
+
+class C {
+
+    // Variable declaration in a nested block:
+    static {
+        if (something) {
+            var a = true;
+        }
+    }
+
+    // Variable declaration after other statements:
+    static {
+        f();
+        var a;
+    }
+
+}
+```
+
+:::
+
+Examples of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint vars-on-top: "error"*/
+
+function doSomething() {
+    var first;
+    var second; //multiple declarations are allowed at the top
+    if (true) {
+        first = true;
+    }
+}
+
+function doSomething() {
+    var i;
+    for (i=0; i<10; i++) {}
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint vars-on-top: "error"*/
+
+var a;
+f();
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint vars-on-top: "error"*/
+
+class C {
+
+    static {
+        var a;
+        if (something) {
+            a = true;
+        }
+    }
+
+    static {
+        var a;
+        f();
+    }
+
+}
+```
+
+:::
+
+::: correct
+
+```js
+/*eslint vars-on-top: "error"*/
+
+// Directives may precede variable declarations.
+"use strict";
+var a;
+f();
+
+// Comments can describe variables.
+function doSomething() {
+    // this is the first var.
+    var first;
+    // this is the second var.
+    var second
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/wrap-iife.md b/eslint/docs/src/rules/wrap-iife.md
new file mode 100644 (file)
index 0000000..22b3b9e
--- /dev/null
@@ -0,0 +1,146 @@
+---
+title: wrap-iife
+layout: doc
+rule_type: layout
+---
+
+
+
+You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration.
+
+```js
+// function expression could be unwrapped
+var x = function () { return { y: 1 };}();
+
+// function declaration must be wrapped
+function () { /* side effects */ }(); // SyntaxError
+```
+
+## Rule Details
+
+This rule requires all immediately-invoked function expressions to be wrapped in parentheses.
+
+## Options
+
+This rule has two options, a string option and an object option.
+
+String option:
+
+* `"outside"` enforces always wrapping the *call* expression. The default is `"outside"`.
+* `"inside"` enforces always wrapping the *function* expression.
+* `"any"` enforces always wrapping, but allows either style.
+
+Object option:
+
+* `"functionPrototypeMethods": true` additionally enforces wrapping function expressions invoked using `.call` and `.apply`. The default is `false`.
+
+### outside
+
+Examples of **incorrect** code for the default `"outside"` option:
+
+::: incorrect
+
+```js
+/*eslint wrap-iife: ["error", "outside"]*/
+
+var x = function () { return { y: 1 };}(); // unwrapped
+var x = (function () { return { y: 1 };})(); // wrapped function expression
+```
+
+:::
+
+Examples of **correct** code for the default `"outside"` option:
+
+::: correct
+
+```js
+/*eslint wrap-iife: ["error", "outside"]*/
+
+var x = (function () { return { y: 1 };}()); // wrapped call expression
+```
+
+:::
+
+### inside
+
+Examples of **incorrect** code for the `"inside"` option:
+
+::: incorrect
+
+```js
+/*eslint wrap-iife: ["error", "inside"]*/
+
+var x = function () { return { y: 1 };}(); // unwrapped
+var x = (function () { return { y: 1 };}()); // wrapped call expression
+```
+
+:::
+
+Examples of **correct** code for the `"inside"` option:
+
+::: correct
+
+```js
+/*eslint wrap-iife: ["error", "inside"]*/
+
+var x = (function () { return { y: 1 };})(); // wrapped function expression
+```
+
+:::
+
+### any
+
+Examples of **incorrect** code for the `"any"` option:
+
+::: incorrect
+
+```js
+/*eslint wrap-iife: ["error", "any"]*/
+
+var x = function () { return { y: 1 };}(); // unwrapped
+```
+
+:::
+
+Examples of **correct** code for the `"any"` option:
+
+::: correct
+
+```js
+/*eslint wrap-iife: ["error", "any"]*/
+
+var x = (function () { return { y: 1 };}()); // wrapped call expression
+var x = (function () { return { y: 1 };})(); // wrapped function expression
+```
+
+:::
+
+### functionPrototypeMethods
+
+Examples of **incorrect** code for this rule with the `"inside", { "functionPrototypeMethods": true }` options:
+
+::: incorrect
+
+```js
+/* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
+
+var x = function(){ foo(); }()
+var x = (function(){ foo(); }())
+var x = function(){ foo(); }.call(bar)
+var x = (function(){ foo(); }.call(bar))
+```
+
+:::
+
+Examples of **correct** code for this rule with the `"inside", { "functionPrototypeMethods": true }` options:
+
+::: correct
+
+```js
+/* eslint wrap-iife: [2, "inside", { functionPrototypeMethods: true }] */
+
+var x = (function(){ foo(); })()
+var x = (function(){ foo(); }).call(bar)
+```
+
+:::
diff --git a/eslint/docs/src/rules/wrap-regex.md b/eslint/docs/src/rules/wrap-regex.md
new file mode 100644 (file)
index 0000000..450a7d6
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: wrap-regex
+layout: doc
+rule_type: layout
+---
+
+
+
+When a regular expression is used in certain situations, it can end up looking like a division operator. For example:
+
+```js
+function a() {
+    return /foo/.test("bar");
+}
+```
+
+## Rule Details
+
+This is used to disambiguate the slash operator and facilitates more readable code.
+
+Example of **incorrect** code for this rule:
+
+::: incorrect
+
+```js
+/*eslint wrap-regex: "error"*/
+
+function a() {
+    return /foo/.test("bar");
+}
+```
+
+:::
+
+Example of **correct** code for this rule:
+
+::: correct
+
+```js
+/*eslint wrap-regex: "error"*/
+
+function a() {
+    return (/foo/).test("bar");
+}
+```
+
+:::
diff --git a/eslint/docs/src/rules/yield-star-spacing.md b/eslint/docs/src/rules/yield-star-spacing.md
new file mode 100644 (file)
index 0000000..3c4c43e
--- /dev/null
@@ -0,0 +1,114 @@
+---
+title: yield-star-spacing
+layout: doc
+rule_type: layout
+further_reading:
+- https://leanpub.com/understandinges6/read/#leanpub-auto-generators
+---
+
+
+
+## Rule Details
+
+This rule enforces spacing around the `*` in `yield*` expressions.
+
+## Options
+
+The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
+
+* `before` enforces spacing between the `yield` and the `*`.
+  If `true`, a space is required, otherwise spaces are disallowed.
+
+* `after` enforces spacing between the `*` and the argument.
+  If it is `true`, a space is required, otherwise spaces are disallowed.
+
+The default is `{"before": false, "after": true}`.
+
+```json
+"yield-star-spacing": ["error", {"before": true, "after": false}]
+```
+
+The option also has a string shorthand:
+
+* `{"before": false, "after": true}` → `"after"`
+* `{"before": true, "after": false}` → `"before"`
+* `{"before": true, "after": true}` → `"both"`
+* `{"before": false, "after": false}` → `"neither"`
+
+```json
+"yield-star-spacing": ["error", "after"]
+```
+
+## Examples
+
+### after
+
+Examples of **correct** code for this rule with the default `"after"` option:
+
+::: correct
+
+```js
+/*eslint yield-star-spacing: ["error", "after"]*/
+/*eslint-env es6*/
+
+function* generator() {
+  yield* other();
+}
+```
+
+:::
+
+### before
+
+Examples of **correct** code for this rule with the `"before"` option:
+
+::: correct
+
+```js
+/*eslint yield-star-spacing: ["error", "before"]*/
+/*eslint-env es6*/
+
+function *generator() {
+  yield *other();
+}
+```
+
+:::
+
+### both
+
+Examples of **correct** code for this rule with the `"both"` option:
+
+::: correct
+
+```js
+/*eslint yield-star-spacing: ["error", "both"]*/
+/*eslint-env es6*/
+
+function * generator() {
+  yield * other();
+}
+```
+
+:::
+
+### neither
+
+Examples of **correct** code for this rule with the `"neither"` option:
+
+::: correct
+
+```js
+/*eslint yield-star-spacing: ["error", "neither"]*/
+/*eslint-env es6*/
+
+function*generator() {
+  yield*other();
+}
+```
+
+:::
+
+## When Not To Use It
+
+If your project will not be using generators or you are not concerned with spacing consistency, you do not need this rule.
diff --git a/eslint/docs/src/rules/yoda.md b/eslint/docs/src/rules/yoda.md
new file mode 100644 (file)
index 0000000..60cf3e4
--- /dev/null
@@ -0,0 +1,215 @@
+---
+title: yoda
+layout: doc
+rule_type: suggestion
+further_reading:
+- https://en.wikipedia.org/wiki/Yoda_conditions
+- http://thomas.tuerke.net/on/design/?with=1249091668#msg1146181680
+---
+
+
+
+Yoda conditions are so named because the literal value of the condition comes first while the variable comes second. For example, the following is a Yoda condition:
+
+```js
+if ("red" === color) {
+    // ...
+}
+```
+
+This is called a Yoda condition because it reads as, "if red equals the color", similar to the way the Star Wars character Yoda speaks. Compare to the other way of arranging the operands:
+
+```js
+if (color === "red") {
+    // ...
+}
+```
+
+This typically reads, "if the color equals red", which is arguably a more natural way to describe the comparison.
+
+Proponents of Yoda conditions highlight that it is impossible to mistakenly use `=` instead of `==` because you cannot assign to a literal value. Doing so will cause a syntax error and you will be informed of the mistake early on. This practice was therefore very common in early programming where tools were not yet available.
+
+Opponents of Yoda conditions point out that tooling has made us better programmers because tools will catch the mistaken use of `=` instead of `==` (ESLint will catch this for you). Therefore, they argue, the utility of the pattern doesn't outweigh the readability hit the code takes while using Yoda conditions.
+
+## Rule Details
+
+This rule aims to enforce consistent style of conditions which compare a variable to a literal value.
+
+## Options
+
+This rule can take a string option:
+
+* If it is the default `"never"`, then comparisons must never be Yoda conditions.
+* If it is `"always"`, then the literal value must always come first.
+
+The default `"never"` option can have exception options in an object literal:
+
+* If the `"exceptRange"` property is `true`, the rule *allows* yoda conditions in range comparisons which are wrapped directly in parentheses, including the parentheses of an `if` or `while` condition. The default value is `false`. A *range* comparison tests whether a variable is inside or outside the range between two literal values.
+* If the `"onlyEquality"` property is `true`, the rule reports yoda conditions *only* for the equality operators `==` and `===`. The default value is `false`.
+
+The `onlyEquality` option allows a superset of the exceptions which `exceptRange` allows, thus both options are not useful together.
+
+### never
+
+Examples of **incorrect** code for the default `"never"` option:
+
+::: incorrect
+
+```js
+/*eslint yoda: "error"*/
+
+if ("red" === color) {
+    // ...
+}
+
+if (`red` === color) {
+    // ...
+}
+
+if (`red` === `${color}`) {
+    // ...
+}
+
+if (true == flag) {
+    // ...
+}
+
+if (5 > count) {
+    // ...
+}
+
+if (-1 < str.indexOf(substr)) {
+    // ...
+}
+
+if (0 <= x && x < 1) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for the default `"never"` option:
+
+::: correct
+
+```js
+/*eslint yoda: "error"*/
+
+if (5 & value) {
+    // ...
+}
+
+if (value === "red") {
+    // ...
+}
+
+if (value === `red`) {
+    // ...
+}
+
+if (`${value}` === `red`) {
+
+}
+```
+
+:::
+
+### exceptRange
+
+Examples of **correct** code for the `"never", { "exceptRange": true }` options:
+
+::: correct
+
+```js
+/*eslint yoda: ["error", "never", { "exceptRange": true }]*/
+
+function isReddish(color) {
+    return (color.hue < 60 || 300 < color.hue);
+}
+
+if (x < -1 || 1 < x) {
+    // ...
+}
+
+if (count < 10 && (0 <= rand && rand < 1)) {
+    // ...
+}
+
+if (`blue` < x && x < `green`) {
+    // ...
+}
+
+function howLong(arr) {
+    return (0 <= arr.length && arr.length < 10) ? "short" : "long";
+}
+```
+
+:::
+
+### onlyEquality
+
+Examples of **correct** code for the `"never", { "onlyEquality": true }` options:
+
+::: correct
+
+```js
+/*eslint yoda: ["error", "never", { "onlyEquality": true }]*/
+
+if (x < -1 || 9 < x) {
+}
+
+if (x !== 'foo' && 'bar' != x) {
+}
+
+if (x !== `foo` && `bar` != x) {
+}
+```
+
+:::
+
+### always
+
+Examples of **incorrect** code for the `"always"` option:
+
+::: incorrect
+
+```js
+/*eslint yoda: ["error", "always"]*/
+
+if (color == "blue") {
+    // ...
+}
+
+if (color == `blue`) {
+    // ...
+}
+```
+
+:::
+
+Examples of **correct** code for the `"always"` option:
+
+::: correct
+
+```js
+/*eslint yoda: ["error", "always"]*/
+
+if ("blue" == value) {
+    // ...
+}
+
+if (`blue` == value) {
+    // ...
+}
+
+if (`blue` == `${value}`) {
+    // ...
+}
+
+if (-1 < str.indexOf(substr)) {
+    // ...
+}
+```
+
+:::
diff --git a/eslint/docs/src/src.json b/eslint/docs/src/src.json
new file mode 100644 (file)
index 0000000..be7b616
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "permalink": "{{ page.filePathStem }}.html"
+}
diff --git a/eslint/docs/src/static/apple-touch-icon.png b/eslint/docs/src/static/apple-touch-icon.png
new file mode 100644 (file)
index 0000000..da15497
Binary files /dev/null and b/eslint/docs/src/static/apple-touch-icon.png differ
diff --git a/eslint/docs/src/static/favicon-32x32.png b/eslint/docs/src/static/favicon-32x32.png
new file mode 100644 (file)
index 0000000..670b0cc
Binary files /dev/null and b/eslint/docs/src/static/favicon-32x32.png differ
diff --git a/eslint/docs/src/static/favicon.ico b/eslint/docs/src/static/favicon.ico
new file mode 100644 (file)
index 0000000..ae3d4b8
Binary files /dev/null and b/eslint/docs/src/static/favicon.ico differ
diff --git a/eslint/docs/src/static/favicon.png b/eslint/docs/src/static/favicon.png
new file mode 100644 (file)
index 0000000..ee761fb
Binary files /dev/null and b/eslint/docs/src/static/favicon.png differ
diff --git a/eslint/docs/src/static/feed.njk b/eslint/docs/src/static/feed.njk
new file mode 100644 (file)
index 0000000..da59847
--- /dev/null
@@ -0,0 +1,39 @@
+---json
+{
+  "permalink": "feed.xml",
+  "eleventyExcludeFromCollections": true,
+  "metadata": {
+    "title": "ESLint Blog",
+    "subtitle": "feed description",
+    "url": "https://eslint.org/",
+    "feedUrl": "https://eslint.org.com/feed.xml",
+    "author": {
+      "name": "ESLint",
+      "email": ""
+    }
+  }
+}
+---
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+  <title>{{ metadata.title }}</title>
+  <subtitle>{{ metadata.subtitle }}</subtitle>
+  <link href="{{ metadata.feedUrl }}" rel="self"/>
+  <link href="{{ metadata.url }}"/>
+  <updated>{{ collections.blog | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
+  <id>{{ metadata.url }}</id>
+  <author>
+    <name>{{ metadata.author.name }}</name>
+    <email>{{ metadata.author.email }}</email>
+  </author>
+  {%- for post in collections.blog %}
+  {% set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset %}
+  <entry>
+    <title>{{ post.data.title }}</title>
+    <link href="{{ absolutePostUrl }}"/>
+    <updated>{{ post.date | dateToRfc3339 }}</updated>
+    <id>{{ absolutePostUrl }}</id>
+    <content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
+  </entry>
+  {%- endfor %}
+</feed>
diff --git a/eslint/docs/src/static/icon-192.png b/eslint/docs/src/static/icon-192.png
new file mode 100644 (file)
index 0000000..0aa62e2
Binary files /dev/null and b/eslint/docs/src/static/icon-192.png differ
diff --git a/eslint/docs/src/static/icon-512.png b/eslint/docs/src/static/icon-512.png
new file mode 100644 (file)
index 0000000..ee761fb
Binary files /dev/null and b/eslint/docs/src/static/icon-512.png differ
diff --git a/eslint/docs/src/static/icon.svg b/eslint/docs/src/static/icon.svg
new file mode 100644 (file)
index 0000000..c1024b1
--- /dev/null
@@ -0,0 +1 @@
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 294.825 258.982" xml:space="preserve"><style>@media (prefers-color-scheme:dark){path#outer{fill:#fff}path#inner{fill:#999}}</style><path fill="#8080F2" id="inner" d="m97.021 99.016 48.432-27.962c1.212-.7 2.706-.7 3.918 0l48.433 27.962a3.92 3.92 0 0 1 1.959 3.393v55.924a3.924 3.924 0 0 1-1.959 3.394l-48.433 27.962c-1.212.7-2.706.7-3.918 0l-48.432-27.962a3.92 3.92 0 0 1-1.959-3.394v-55.924a3.922 3.922 0 0 1 1.959-3.393"/><path fill="#4B32C3" id="outer" d="M273.336 124.488 215.469 23.816c-2.102-3.64-5.985-6.325-10.188-6.325H89.545c-4.204 0-8.088 2.685-10.19 6.325l-57.867 100.45c-2.102 3.641-2.102 8.236 0 11.877l57.867 99.847c2.102 3.64 5.986 5.501 10.19 5.501H205.28c4.203 0 8.087-1.805 10.188-5.446l57.867-100.01c2.104-3.639 2.104-7.907.001-11.547m-47.917 48.41c0 1.48-.891 2.849-2.174 3.59l-73.71 42.527a4.194 4.194 0 0 1-4.17 0l-73.767-42.527c-1.282-.741-2.179-2.109-2.179-3.59V87.843c0-1.481.884-2.849 2.167-3.59l73.707-42.527a4.185 4.185 0 0 1 4.168 0l73.772 42.527c1.283.741 2.186 2.109 2.186 3.59v85.055z"/></svg>
\ No newline at end of file
diff --git a/eslint/docs/src/static/manifest.webmanifest b/eslint/docs/src/static/manifest.webmanifest
new file mode 100644 (file)
index 0000000..a893e5b
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "icons": [
+    { "src": "/icon-192.png", "type": "image/png", "sizes": "192x192" },
+    { "src": "/icon-512.png", "type": "image/png", "sizes": "512x512" }
+  ]
+}
diff --git a/eslint/docs/src/static/robots.njk b/eslint/docs/src/static/robots.njk
new file mode 100644 (file)
index 0000000..a6bf247
--- /dev/null
@@ -0,0 +1,7 @@
+---
+layout: false
+permalink: robots.txt
+eleventyExcludeFromCollections: true
+---
+User-agent: *
+Disallow: /
diff --git a/eslint/docs/src/static/serviceworker.js b/eslint/docs/src/static/serviceworker.js
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eslint/docs/src/static/sitemap.njk b/eslint/docs/src/static/sitemap.njk
new file mode 100644 (file)
index 0000000..e92a4e5
--- /dev/null
@@ -0,0 +1,14 @@
+---
+permalink: /sitemap.xml
+eleventyExcludeFromCollections: true
+---
+<?xml version="1.0" encoding="utf-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+    {% for page in collections.all %}
+        <url>
+            <loc>{{ ["https://", site.hostname, page.url | url | prettyURL] | join }}</loc>
+            <lastmod>{{ page.date.toISOString() }}</lastmod>
+            <changefreq>{{ page.data.changeFreq if page.data.changeFreq else "weekly" }}</changefreq>
+        </url>
+    {% endfor %}
+</urlset>
diff --git a/eslint/docs/src/user-guide/command-line-interface.md b/eslint/docs/src/user-guide/command-line-interface.md
new file mode 100644 (file)
index 0000000..c8ddefe
--- /dev/null
@@ -0,0 +1,585 @@
+---
+title: Command Line Interface
+layout: doc
+eleventyNavigation:
+    key: command line interface
+    parent: user guide
+    title: Command Line Interface
+    order: 3
+
+---
+
+ESLint requires Node.js for installation. Follow the instructions in the [Getting Started Guide](getting-started) to install ESLint.
+
+Most users use [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) to run ESLint on the command line like this:
+
+```shell
+npx eslint [options] [file|dir|glob]*
+```
+
+Such as:
+
+```shell
+# Run on two files
+npx eslint file1.js file2.js
+
+# Run on multiple files
+npx eslint lib/**
+```
+
+Please note that when passing a glob as a parameter, it will be expanded by your shell. The results of the expansion can vary depending on your shell, and its configuration. If you want to use node `glob` syntax, you have to quote your parameter (using double quotes if you need it to run in Windows), as follows:
+
+```shell
+npx eslint "lib/**"
+```
+
+**Note:** You can also use alternative package managers such as [Yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/) to run ESLint. Please refer to your package manager's documentation for the correct syntax.
+
+## Options
+
+The command line utility has several options. You can view the options by running `npx eslint -h`.
+
+```text
+eslint [options] file.js [file.js] [dir]
+
+Basic configuration:
+  --no-eslintrc                   Disable use of configuration from .eslintrc.*
+  -c, --config path::String       Use this configuration, overriding .eslintrc.* config options if present
+  --env [String]                  Specify environments
+  --ext [String]                  Specify JavaScript file extensions
+  --global [String]               Define global variables
+  --parser String                 Specify the parser to be used
+  --parser-options Object         Specify parser options
+  --resolve-plugins-relative-to path::String  A folder where plugins should be resolved from, CWD by default
+
+Specifying rules and plugins:
+  --plugin [String]               Specify plugins
+  --rule Object                   Specify rules
+  --rulesdir [path::String]       Load additional rules from this directory. Deprecated: Use rules from plugins
+
+Fixing problems:
+  --fix                           Automatically fix problems
+  --fix-dry-run                   Automatically fix problems without saving the changes to the file system
+  --fix-type Array                Specify the types of fixes to apply (directive, problem, suggestion, layout)
+
+Ignoring files:
+  --ignore-path path::String      Specify path of ignore file
+  --no-ignore                     Disable use of ignore files and patterns
+  --ignore-pattern [String]       Pattern of files to ignore (in addition to those in .eslintignore)
+
+Using stdin:
+  --stdin                         Lint code provided on <STDIN> - default: false
+  --stdin-filename String         Specify filename to process STDIN as
+
+Handling warnings:
+  --quiet                         Report errors only - default: false
+  --max-warnings Int              Number of warnings to trigger nonzero exit code - default: -1
+
+Output:
+  -o, --output-file path::String  Specify file to write report to
+  -f, --format String             Use a specific output format - default: stylish
+  --color, --no-color             Force enabling/disabling of color
+
+Inline configuration comments:
+  --no-inline-config              Prevent comments from changing config or rules
+  --report-unused-disable-directives  Adds reported errors for unused eslint-disable directives
+
+Caching:
+  --cache                         Only check changed files - default: false
+  --cache-file path::String       Path to the cache file. Deprecated: use --cache-location - default: .eslintcache
+  --cache-location path::String   Path to the cache file or directory
+  --cache-strategy String         Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata
+
+Miscellaneous:
+  --init                          Run config initialization wizard - default: false
+  --env-info                      Output execution environment information - default: false
+  --no-error-on-unmatched-pattern  Prevent errors when pattern is unmatched
+  --exit-on-fatal-error           Exit with exit code 2 in case of fatal error - default: false
+  --debug                         Output debugging information
+  -h, --help                      Show help
+  -v, --version                   Output the version number
+  --print-config path::String     Print the configuration for the given file
+```
+
+Options that accept array values can be specified by repeating the option or with a comma-delimited list (other than `--ignore-pattern` which does not allow the second style).
+
+Example:
+
+```shell
+npx eslint --ext .jsx --ext .js lib/
+
+npx eslint --ext .jsx,.js lib/
+```
+
+### Basic configuration
+
+#### `--no-eslintrc`
+
+Disables use of configuration from `.eslintrc.*` and `package.json` files.
+
+Example:
+
+```shell
+npx eslint --no-eslintrc file.js
+```
+
+#### `-c`, `--config`
+
+This option allows you to specify an additional configuration file for ESLint (see [Configuring ESLint](configuring/) for more).
+
+Example:
+
+```shell
+npx eslint -c ~/my-eslint.json file.js
+```
+
+This example uses the configuration file at `~/my-eslint.json`.
+
+If `.eslintrc.*` and/or `package.json` files are also used for configuration (i.e., `--no-eslintrc` was not specified), the configurations will be merged. Options from this configuration file have precedence over the options from `.eslintrc.*` and `package.json` files.
+
+#### `--env`
+
+This option enables specific environments. Details about the global variables defined by each environment are available on the [Specifying Environments](configuring/language-options#specifying-environments) documentation. This option only enables environments; it does not disable environments set in other configuration files. To specify multiple environments, separate them using commas, or use the option multiple times.
+
+Examples:
+
+```shell
+npx eslint --env browser,node file.js
+npx eslint --env browser --env node file.js
+```
+
+#### `--ext`
+
+This option allows you to specify which file extensions ESLint will use when searching for target files in the directories you specify.
+By default, ESLint lints `*.js` files and the files that match the `overrides` entries of your configuration.
+
+Examples:
+
+```shell
+# Use only .ts extension
+npx eslint . --ext .ts
+
+# Use both .js and .ts
+npx eslint . --ext .js --ext .ts
+
+# Also use both .js and .ts
+npx eslint . --ext .js,.ts
+```
+
+**Note:** `--ext` is only used when the arguments are directories. If you use glob patterns or file names, then `--ext` is ignored.
+
+For example, `npx eslint lib/* --ext .js` will match all files within the `lib/` directory, regardless of extension.
+
+#### `--global`
+
+This option defines global variables so that they will not be flagged as undefined by the `no-undef` rule. Any specified global variables are assumed to be read-only by default, but appending `:true` to a variable's name ensures that `no-undef` will also allow writes. To specify multiple global variables, separate them using commas, or use the option multiple times.
+
+Examples:
+
+```shell
+npx eslint --global require,exports:true file.js
+npx eslint --global require --global exports:true
+```
+
+#### `--parser`
+
+This option allows you to specify a parser to be used by ESLint. By default, `espree` will be used.
+
+#### `--parser-options`
+
+This option allows you to specify parser options to be used by ESLint. Note that the available parser options are determined by the parser being used.
+
+Examples:
+
+```shell
+echo '3 ** 4' | npx eslint --stdin --parser-options=ecmaVersion:6 # will fail with a parsing error
+echo '3 ** 4' | npx eslint --stdin --parser-options=ecmaVersion:7 # succeeds, yay!
+```
+
+#### `--resolve-plugins-relative-to`
+
+Changes the folder where plugins are resolved from. By default, plugins are resolved from the current working directory. This option should be used when plugins were installed by someone other than the end user. It should be set to the project directory of the project that has a dependency on the necessary plugins. For example:
+
+* When using a config file that is located outside of the current project (with the `--config` flag), if the config uses plugins which are installed locally to itself, `--resolve-plugins-relative-to` should be set to the directory containing the config file.
+* If an integration has dependencies on ESLint and a set of plugins, and the tool invokes ESLint on behalf of the user with a preset configuration, the tool should set `--resolve-plugins-relative-to` to the top-level directory of the tool.
+
+### Specifying rules and plugins
+
+#### `--plugin`
+
+This option specifies a plugin to load. You can omit the prefix `eslint-plugin-` from the plugin name.
+
+Before using the plugin, you have to install it using npm.
+
+Examples:
+
+```shell
+npx eslint --plugin jquery file.js
+npx eslint --plugin eslint-plugin-mocha file.js
+```
+
+#### `--rule`
+
+This option specifies rules to be used. These rules will be merged with any rules specified with configuration files. (You can use `--no-eslintrc` to change that behavior.) To define multiple rules, separate them using commas, or use the option multiple times. The [levn](https://github.com/gkz/levn#levn--) format is used for specifying the rules.
+
+If the rule is defined within a plugin, you have to prefix the rule ID with the plugin name and a `/`.
+
+Examples:
+
+```shell
+npx eslint --rule 'quotes: [error, double]'
+npx eslint --rule 'guard-for-in: error' --rule 'brace-style: [error, 1tbs]'
+npx eslint --rule 'jquery/dollar-sign: error'
+```
+
+#### `--rulesdir`
+
+**Deprecated**: Use rules from plugins instead.
+
+This option allows you to specify another directory from which to load rules files. This allows you to dynamically load new rules at run time. This is useful when you have custom rules that aren't suitable for being bundled with ESLint.
+
+Example:
+
+```shell
+npx eslint --rulesdir my-rules/ file.js
+```
+
+The rules in your custom rules directory must follow the same format as bundled rules to work properly. You can also specify multiple locations for custom rules by including multiple `--rulesdir` options:
+
+```shell
+npx eslint --rulesdir my-rules/ --rulesdir my-other-rules/ file.js
+```
+
+Note that, as with core rules and plugin rules, you still need to enable the rules in configuration or via the `--rule` CLI option in order to actually run those rules during linting. Specifying a rules directory with `--rulesdir` does not automatically enable the rules within that directory.
+
+### Fixing problems
+
+#### `--fix`
+
+This option instructs ESLint to try to fix as many issues as possible. The fixes are made to the actual files themselves and only the remaining unfixed issues are output. Not all problems are fixable using this option, and the option does not work in these situations:
+
+1. This option throws an error when code is piped to ESLint.
+1. This option has no effect on code that uses a processor, unless the processor opts into allowing autofixes.
+
+If you want to fix code from `stdin` or otherwise want to get the fixes without actually writing them to the file, use the [`--fix-dry-run`](#--fix-dry-run) option.
+
+#### `--fix-dry-run`
+
+This option has the same effect as `--fix` with one difference: the fixes are not saved to the file system. This makes it possible to fix code from `stdin` (when used with the `--stdin` flag).
+
+Because the default formatter does not output the fixed code, you'll have to use another one (e.g. `json`) to get the fixes. Here's an example of this pattern:
+
+```shell
+getSomeText | npx eslint --stdin --fix-dry-run --format=json
+```
+
+This flag can be useful for integrations (e.g. editor plugins) which need to autofix text from the command line without saving it to the filesystem.
+
+#### `--fix-type`
+
+This option allows you to specify the type of fixes to apply when using either `--fix` or `--fix-dry-run`. The four types of fixes are:
+
+1. `problem` - fix potential errors in the code
+1. `suggestion` - apply fixes to the code that improve it
+1. `layout` - apply fixes that do not change the program structure (AST)
+1. `directive` - apply fixes to inline directives such as `// eslint-disable`
+
+You can specify one or more fix type on the command line. Here are some examples:
+
+```shell
+npx eslint --fix --fix-type suggestion .
+npx eslint --fix --fix-type suggestion --fix-type problem .
+npx eslint --fix --fix-type suggestion,layout .
+```
+
+This option is helpful if you are using another program to format your code but you would still like ESLint to apply other types of fixes.
+
+### Ignoring files
+
+#### `--ignore-path`
+
+This option allows you to specify the file to use as your `.eslintignore`. By default, ESLint looks in the current working directory for `.eslintignore`. You can override this behavior by providing a path to a different file.
+
+Example:
+
+```shell
+npx eslint --ignore-path tmp/.eslintignore file.js
+npx eslint --ignore-path .gitignore file.js
+```
+
+#### `--no-ignore`
+
+Disables excluding of files from `.eslintignore`, `--ignore-path`, `--ignore-pattern`, and `ignorePatterns` property in config files.
+
+Example:
+
+```shell
+npx eslint --no-ignore file.js
+```
+
+#### `--ignore-pattern`
+
+This option allows you to specify patterns of files to ignore (in addition to those in `.eslintignore`). You can repeat the option to provide multiple patterns. The supported syntax is the same as for `.eslintignore` [files](configuring/ignoring-code#the-eslintignore-file), which use the same patterns as the `.gitignore` [specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns.
+
+Example:
+
+```shell
+npx eslint --ignore-pattern '/lib/' --ignore-pattern '/src/vendor/*' .
+```
+
+### Using stdin
+
+#### `--stdin`
+
+This option tells ESLint to read and lint source code from STDIN instead of from files. You can use this to pipe code to ESLint.
+
+Example:
+
+```shell
+cat myfile.js | npx eslint --stdin
+```
+
+#### `--stdin-filename`
+
+This option allows you to specify a filename to process STDIN as. This is useful when processing files from STDIN and you have rules which depend on the filename.
+
+Example
+
+```shell
+cat myfile.js | npx eslint --stdin --stdin-filename=myfile.js
+```
+
+### Handling warnings
+
+#### `--quiet`
+
+This option allows you to disable reporting on warnings. If you enable this option, only errors are reported by ESLint.
+
+Example:
+
+```shell
+npx eslint --quiet file.js
+```
+
+#### `--max-warnings`
+
+This option allows you to specify a warning threshold, which can be used to force ESLint to exit with an error status if there are too many warning-level rule violations in your project.
+
+Normally, if ESLint runs and finds no errors (only warnings), it will exit with a success exit status. However, if `--max-warnings` is specified and the total warning count is greater than the specified threshold, ESLint will exit with an error status. Specifying a threshold of `-1` or omitting this option will prevent this behavior.
+
+Example:
+
+```shell
+npx eslint --max-warnings 10 file.js
+```
+
+### Output
+
+#### `-o`, `--output-file`
+
+Enable report to be written to a file.
+
+Example:
+
+```shell
+npx eslint -o ./test/test.html
+```
+
+When specified, the given format is output into the provided file name.
+
+#### `-f`, `--format`
+
+This option specifies the output format for the console. Possible formats are:
+
+* [checkstyle](formatters/#checkstyle)
+* [compact](formatters/#compact)
+* [html](formatters/#html)
+* [jslint-xml](formatters/#jslint-xml)
+* [json](formatters/#json)
+* [junit](formatters/#junit)
+* [stylish](formatters/#stylish) (the default)
+* [tap](formatters/#tap)
+* [unix](formatters/#unix)
+* [visualstudio](formatters/#visualstudio)
+
+Example:
+
+```shell
+npx eslint -f compact file.js
+```
+
+You can also use a custom formatter from the command line by specifying a path to the custom formatter file.
+
+Example:
+
+```shell
+npx eslint -f ./customformat.js file.js
+```
+
+An npm-installed formatter is resolved with or without `eslint-formatter-` prefix.
+
+Example:
+
+```shell
+npm install eslint-formatter-pretty
+
+npx eslint -f pretty file.js
+
+// equivalent:
+npx eslint -f eslint-formatter-pretty file.js
+```
+
+When specified, the given format is output to the console. If you'd like to save that output into a file, you can do so on the command line like so:
+
+```shell
+npx eslint -f compact file.js > results.txt
+```
+
+This saves the output into the `results.txt` file.
+
+#### `--color`, `--no-color`
+
+This option forces the enabling/disabling of colorized output. You can use this to override the default behavior, which is to enable colorized output unless no TTY is detected, such as when piping `eslint` through `cat` or `less`.
+
+Examples:
+
+```shell
+npx eslint --color file.js | cat
+npx eslint --no-color file.js
+```
+
+### Inline configuration comments
+
+#### `--no-inline-config`
+
+This option prevents inline comments like `/*eslint-disable*/` or
+`/*global foo*/` from having any effect. This allows you to set an ESLint
+config without files modifying it. All inline config comments are ignored, e.g.:
+
+* `/*eslint-disable*/`
+* `/*eslint-enable*/`
+* `/*global*/`
+* `/*eslint*/`
+* `/*eslint-env*/`
+* `// eslint-disable-line`
+* `// eslint-disable-next-line`
+
+Example:
+
+```shell
+npx eslint --no-inline-config file.js
+```
+
+#### `--report-unused-disable-directives`
+
+This option causes ESLint to report directive comments like `// eslint-disable-line` when no errors would have been reported on that line anyway. This can be useful to prevent future errors from unexpectedly being suppressed, by cleaning up old `eslint-disable` comments which are no longer applicable.
+
+**Warning**: When using this option, it is possible that new errors will start being reported whenever ESLint or custom rules are upgraded. For example, suppose a rule has a bug that causes it to report a false positive, and an `eslint-disable` comment is added to suppress the incorrect report. If the bug is then fixed in a patch release of ESLint, the `eslint-disable` comment will become unused since ESLint is no longer generating an incorrect report. This will result in a new reported error for the unused directive if the `report-unused-disable-directives` option is used.
+
+Example:
+
+```shell
+npx eslint --report-unused-disable-directives file.js
+```
+
+### Caching
+
+#### `--cache`
+
+Store the info about processed files in order to only operate on the changed ones. The cache is stored in `.eslintcache` by default. Enabling this option can dramatically improve ESLint's running time by ensuring that only changed files are linted.
+
+**Note:** If you run ESLint with `--cache` and then run ESLint without `--cache`, the `.eslintcache` file will be deleted. This is necessary because the results of the lint might change and make `.eslintcache` invalid. If you want to control when the cache file is deleted, then use `--cache-location` to specify an alternate location for the cache file.
+
+**Note:** Autofixed files are not placed in the cache. Subsequent linting that does not trigger an autofix will place it in the cache.
+
+#### `--cache-file`
+
+Path to the cache file. If none specified `.eslintcache` will be used. The file will be created in the directory where the `eslint` command is executed. **Deprecated**: Use `--cache-location` instead.
+
+#### `--cache-location`
+
+Path to the cache location. Can be a file or a directory. If no location is specified, `.eslintcache` will be used. In that case, the file will be created in the directory where the `eslint` command is executed.
+
+If a directory is specified, a cache file will be created inside the specified folder. The name of the file will be based on the hash of the current working directory (CWD). e.g.: `.cache_hashOfCWD`
+
+**Important note:** If the directory for the cache does not exist make sure you add a trailing `/` on \*nix systems or `\` in windows. Otherwise the path will be assumed to be a file.
+
+Example:
+
+```shell
+npx eslint "src/**/*.js" --cache --cache-location "/Users/user/.eslintcache/"
+```
+
+#### `--cache-strategy`
+
+Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. If no strategy is specified, `metadata` will be used.
+
+The `content` strategy can be useful in cases where the modification time of your files change even if their contents have not. For example, this can happen during git operations like git clone because git does not track file modification time.
+
+Example:
+
+```shell
+npx eslint "src/**/*.js" --cache --cache-strategy content
+```
+
+### Miscellaneous
+
+#### `--init`
+
+This option will run `npm init @eslint/config` to start config initialization wizard. It's designed to help new users quickly create .eslintrc file by answering a few questions, choosing a popular style guide.
+
+The resulting configuration file will be created in the current directory.
+
+#### `--env-info`
+
+This option outputs information about the execution environment, including the version of Node, npm, and local and global installations of ESLint. The ESLint team may ask for this information to help solve bugs.
+
+#### `--no-error-on-unmatched-pattern`
+
+This option prevents errors when a quoted glob pattern or `--ext` is unmatched. This will not prevent errors when your shell can't match a glob.
+
+#### `--exit-on-fatal-error`
+
+This option causes ESLint to exit with exit code 2 if one or more fatal parsing errors occur. Without this option, fatal parsing errors are reported as rule violations.
+
+#### `--debug`
+
+This option outputs debugging information to the console. This information is useful when you're seeing a problem and having a hard time pinpointing it. The ESLint team may ask for this debugging information to help solve bugs.
+Add this flag to an ESLint command line invocation in order to get extra debug information as the command is run (e.g. `npx eslint --debug test.js` and `npx eslint test.js --debug` are equivalent)
+
+#### `-h`, `--help`
+
+This option outputs the help menu, displaying all of the available options. All other options are ignored when this is present.
+
+#### `-v`, `--version`
+
+This option outputs the current ESLint version onto the console. All other options are ignored when this is present.
+
+#### `--print-config`
+
+This option outputs the configuration to be used for the file passed. When present, no linting is performed and only config-related options are valid.
+
+Example:
+
+```shell
+npx eslint --print-config file.js
+```
+
+## Ignoring files from linting
+
+ESLint supports `.eslintignore` files to exclude files from the linting process when ESLint operates on a directory. Files given as individual CLI arguments will be exempt from exclusion. The `.eslintignore` file is a plain text file containing one pattern per line. It can be located in any of the target directory's ancestors; it will affect files in its containing directory as well as all sub-directories. Here's a simple example of a `.eslintignore` file:
+
+```text
+temp.js
+**/vendor/*.js
+```
+
+A more detailed breakdown of supported patterns and directories ESLint ignores by default can be found in [Ignoring Code](configuring/ignoring-code).
+
+## Exit codes
+
+When linting files, ESLint will exit with one of the following exit codes:
+
+* `0`: Linting was successful and there are no linting errors. If the `--max-warnings` flag is set to `n`, the number of linting warnings is at most `n`.
+* `1`: Linting was successful and there is at least one linting error, or there are more linting warnings than allowed by the `--max-warnings` option.
+* `2`: Linting was unsuccessful due to a configuration problem or an internal error.
diff --git a/eslint/docs/src/user-guide/configuring/configuration-files-new.md b/eslint/docs/src/user-guide/configuring/configuration-files-new.md
new file mode 100644 (file)
index 0000000..87844f5
--- /dev/null
@@ -0,0 +1,565 @@
+---
+title: Configuration Files (New)
+layout: doc
+eleventyNavigation:
+    key: configuration files
+    parent: configuring
+    title: Configuration Files (New)
+    order: 1
+
+---
+
+::: warning
+This is an experimental feature. To opt-in, place a `eslint.config.js` file in the root of your project. If you are using the API, you can use the configuration system described on this page by using the `FlatESLint` class, the `FlatRuleTester` class, or by setting `configType: "flat"` in the `Linter` class.
+:::
+
+## Configuration File
+
+The ESLint configuration file is named `eslint.config.js` and should be placed in the root directory of your project and export an array of configuration objects. Here's an example:
+
+```js
+export default [
+    {
+        rules: {
+            semi: "error",
+            "prefer-const": "error"
+        }
+    }
+]
+```
+
+Here, the configuration array contains just one configuration object. The configuration object enables two rules: `semi` and `prefer-const`. These rules will be applied to all of the files ESLint processes using this config file.
+
+## Configuration Objects
+
+Each configuration object contains all of the information ESLint needs to execute on a set of files. Each configuration object is made up of these properties:
+
+* `files` - An array of glob patterns indicating the files that the configuration object should apply to. If not specified, the configuration object applies to all files.
+* `ignores` - An array of glob patterns indicating the files that the configuration object should not apply to. If not specified, the configuration object applies to all files matched by `files`.
+* `languageOptions` - An object containing settings related to how JavaScript is configured for linting.
+    * `ecmaVersion` - The version of ECMAScript to support. May be any year (i.e., `2022`) or version (i.e., `5`). Set to `"latest"` for the most recent supported version. (default: `"latest"`)
+    * `sourceType` - The type of JavaScript source code. Possible values are `"script"` for traditional script files, `"module"` for ECMAScript modules (ESM), and `"commonjs"` for CommonJS files. (default: `"module"` for `.js` and `.mjs` files; `"commonjs"` for `.cjs` files)
+    * `globals` - An object specifying additional objects that should be added to the global scope during linting.
+    * `parser` - Either an object containing a `parse()` method or a string indicating the name of a parser inside of a plugin (i.e., `"pluginName/parserName"`). (default: `"@/espree"`)
+    * `parserOptions` - An object specifying additional options that are passed directly to the `parser()` method on the parser. The available options are parser-dependent.
+* `linterOptions` - An object containing settings related to the linting process.
+    * `noInlineConfig` - A Boolean value indicating if inline configuration is allowed.
+    * `reportUnusedDisableDirectives` - A Boolean value indicating if unused disable directives should be tracked and reported.
+* `processor` - Either an object containing `preprocess()` and `postprocess()` methods or a string indicating the name of a processor inside of a plugin (i.e., `"pluginName/processorName"`).
+* `plugins` - An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
+* `rules` - An object containing the configured rules. When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
+* `settings` - An object containing name-value pairs of information that should be available to all rules.
+
+### Specifying `files` and `ignores`
+
+::: tip
+Patterns specified in `files` and `ignores` use [`minimatch`](https://www.npmjs.com/package/minimatch) syntax and are evaluated relative to the location of the `eslint.config.js` file.
+:::
+
+You can use a combination of `files` and `ignores` to determine which files should apply the configuration object and which should not. By default, ESLint matches `**/*.js`, `**/*.cjs`, and `**/*.mjs`. Because config objects that don't specify `files` or `ignores` apply to all files that have been matched by any other configuration object, by default config objects will apply to any JavaScript files passed to ESLint. For example:
+
+```js
+export default [
+    {
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+With this configuration, the `semi` rule is enabled for all files that match the default files in ESLint. So if you pass `example.js` to ESLint, the `semi` rule will be applied. If you pass a non-JavaScript file, like `example.txt`, the `semi` rule will not be applied because there are no other configuration objects that match that filename. (ESLint will output an error message letting you know that the file was ignored due to missing configuration.)
+
+#### Excluding files with `ignores`
+
+You can limit which files a configuration object applies to by specifying a combination of `files` and `ignores` patterns. For example, you may want certain rules to apply only to files in your `src` directory, like this:
+
+```js
+export default [
+    {   
+        files: ["src/**/*.js"],
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+Here, only the JavaScript files in the `src` directory will have the `semi` rule applied. If you run ESLint on files in another directory, this configuration object will be skipped. By adding `ignores`, you can also remove some of the files in `src` from this configuration object:
+
+```js
+export default [
+    {   
+        files: ["src/**/*.js"],
+        ignores: ["**/*.config.js"],
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+This configuration object matches all JavaScript files in the `src` directory except those that end with `.config.js`. You can also use negation patterns in `ignores` to exclude files from the ignore patterns, such as:
+
+```js
+export default [
+    {   
+        files: ["src/**/*.js"],
+        ignores: ["**/*.config.js", "!**/eslint.config.js"],
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+Here, the configuration object excludes files ending with `.config.js` except for `eslint.config.js`. That file will still have `semi` applied.
+
+If `ignores` is used without `files` and any other setting, then the configuration object applies to all files except the ones specified in `ignores`, for example:
+
+```js
+export default [
+    {   
+        ignores: ["**/*.config.js"],
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+This configuration object applies to all files except those ending with `.config.js`. Effectively, this is like having `files` set to `**/*`. In general, it's a good idea to always include `files` if you are specifying `ignores`.
+
+#### Globally ignoring files with `ignores`
+
+If `ignores` is used without any other keys in the configuration object, then the patterns act as additional global ignores, similar to those found in `.eslintignore`. Here's an example:
+
+```js
+export default [
+    {   
+        ignores: [".config/*"]
+    }
+];
+```
+
+This configuration specifies that all of the files in the `.config` directory should be ignored. This pattern is added after the patterns found in `.eslintignore`.
+
+#### Cascading configuration objects
+
+When more than one configuration object matches a given filename, the configuration objects are merged with later objects overriding previous objects when there is a conflict. For example:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        languageOptions: {
+            globals: {
+                MY_CUSTOM_GLOBAL: "readonly"
+            }
+        }   
+    },
+    {   
+        files: ["tests/**/*.js"],
+        languageOptions: {
+            globals: {
+                it: "readonly",
+                describe: "readonly"
+            }
+        }   
+    }
+];
+```
+
+Using this configuration, all JavaScript files define a custom global object defined called `MY_CUSTOM_GLOBAL` while those JavaScript files in the `tests` directory have `it` and `describe` defined as global objects in addition to `MY_CUSTOM_GLOBAL`. For any JavaScript file in the tests directory, both configuration objects are applied, so `languageOptions.globals` are merged to create a final result.
+
+### Configuring linter options
+
+Options specific to the linting process can be configured using the `linterOptions` object. These effect how linting proceeds and does not affect how the source code of the file is interpreted.
+
+#### Disabling inline configuration
+
+Inline configuration is implemented using an `/*eslint*/` comment, such as `/*eslint semi: error*/`. You can disallow inline configuration by setting `noInlineConfig` to `true`. When enabled, all inline configuration is ignored. Here's an example:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        linterOptions: {
+            noInlineConfig: true
+        }
+    }
+];
+```
+
+#### Reporting unused disable directives
+
+Disable directives such as `/*eslint-disable*/` and `/*eslint-disable-next-line*/` are used to disable ESLint rules around certain portions of code. As code changes, it's possible for these directives to no longer be needed because the code has changed in such a way that the rule will no longer be triggered. You can enable reporting of these unused disable directives by setting the `reportUnusedDisableDirectives` option to `true`, as in this example:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        linterOptions: {
+            reportUnusedDisableDirectives: true
+        }
+    }
+];
+```
+
+By default, unused disable directives are reported as warnings. You can change this setting using the `--report-unused-disable-directives` command line option.
+
+### Configuring language options
+
+Options specific to how ESLint evaluates your JavaScript code can be configured using the `languageOptions` object.
+
+#### Configuring the JavaScript version
+
+To configure the version of JavaScript (ECMAScript) that ESLint uses to evaluate your JavaScript, use the `ecmaVersion` property. This property determines which global variables and syntax are valid in your code and can be set to the version number (such as `6`), the year number (such as `2022`), or `"latest"` (for the most recent version that ESLint supports). By default, `ecmaVersion` is set to `"latest"` and it's recommended to keep this default unless you need to ensure that your JavaScript code is evaluated as an older version. For example, some older runtimes might only allow ECMAScript 5, in which case you can configure ESLint like this:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        languageOptions: {
+            ecmaVersion: 5
+        }
+    }
+];
+```
+
+#### Configuring the JavaScript source type
+
+ESLint can evaluate your code in one of three ways:
+
+1. ECMAScript module (ESM) - Your code has a module scope and is run in strict mode.
+1. CommonJS - Your code has a top-level function scope and runs in nonstrict mode.
+1. Script - Your code has a shared global scope and runs in nonstrict mode.
+
+You can specify which of these modes your code is intended to run in by specifying the `sourceType` property. This property can be set to `"module"`, `"commonjs"`, or `"script"`. By default, `sourceType` is set to `"module"` for `.js` and `.mjs` files and is set to `"commonjs"` for `.cjs` files. Here's an example:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        languageOptions: {
+            sourceType: "script"
+        }
+    }
+];
+```
+
+#### Configuring a custom parser and its options
+
+In many cases, you can use the default parser that ESLint ships with for parsing your JavaScript code. You can optionally override the default parser by using the `parser` property. The `parser` property can be either a string in the format `"pluginName/parserName"` (indicating to retrieve the parser from a plugin) or an object containing either a `parse()` method or a `parseForESLint()` method. For example, you can use the [`@babel/eslint-parser`](https://www.npmjs.com/package/@babel/eslint-parser) package to allow ESLint to parse experimental syntax:
+
+```js
+import babelParser from "@babel/eslint-parser";
+
+export default [
+    {
+        files: ["**/*.js", "**/*.mjs"],
+        languageOptions: {
+            parser: babelParser
+        }
+    }
+];
+```
+
+This configuration ensures that the Babel parser, rather than the default, will be used to parse all files ending with `.js` and `.mjs`.
+
+You can also pass options directly to the custom parser by using the `parserOptions` property. This property is an object whose name-value pairs are specific to the parser that you are using. For the Babel parser, you might pass in options like this:
+
+```js
+import babelParser from "@babel/eslint-parser";
+
+export default [
+    {
+        files: ["**/*.js", "**/*.mjs"],
+        languageOptions: {
+            parser: babelParser,
+            parserOptions: {
+                requireConfigFile: false,
+                babelOptions: {
+                    babelrc: false,
+                    configFile: false,
+                    // your babel options
+                    presets: ["@babel/preset-env"],
+                }
+            }
+        }
+    }
+];
+```
+
+#### Configuring global variables
+
+To configure global variables inside of a configuration object, set the `globals` configuration property to an object containing keys named for each of the global variables you want to use. For each global variable key, set the corresponding value equal to `"writable"` to allow the variable to be overwritten or `"readonly"` to disallow overwriting. For example:
+
+```js
+export default [
+    {
+        files: ["**/*.js"],
+        languageOptions: {
+            globals: {
+                var1: "writable",
+                var2: "readonly"
+            }
+        }
+    }
+];
+```
+
+These examples allow `var1` to be overwritten in your code, but disallow it for `var2`.
+
+Globals can be disabled with the string `"off"`. For example, in an environment where most ES2015 globals are available but `Promise` is unavailable, you might use this config:
+
+```js
+export default [
+    {
+        languageOptions: {
+            globals: {
+                Promise: "off"
+            }
+        }
+    }
+];
+```
+
+For historical reasons, the boolean value `false` and the string value `"readable"` are equivalent to `"readonly"`. Similarly, the boolean value `true` and the string value `"writeable"` are equivalent to `"writable"`. However, the use of older values is deprecated.
+
+### Using plugins in your configuration
+
+Plugins are used to share rules, processors, configurations, parsers, and more across ESLint projects. Plugins are specified in a configuration object using the `plugins` key, which is an object where the name of the plugin is the property name and the value is the plugin object itself. Here's an example:
+
+```js
+import jsdoc from "eslint-plugin-jsdoc";
+
+export default [
+    {
+        files: ["**/*.js"],
+        plugins: {
+            jsdoc: jsdoc
+        }
+        rules: {
+            "jsdoc/require-description": "error",
+            "jsdoc/check-values": "error"
+        }  
+    }
+];
+```
+
+In this configuration, the JSDoc plugin is defined to have the name `jsdoc`. The prefix `jsdoc/` in each rule name indicates that the rule is coming from the plugin with that name rather than from ESLint itself.
+
+Because the name of the plugin and the plugin object are both `jsdoc`, you can also shorten the configuration to this:
+
+```js
+import jsdoc from "eslint-plugin-jsdoc";
+
+export default [
+    {
+        files: ["**/*.js"],
+        plugins: {
+            jsdoc
+        }
+        rules: {
+            "jsdoc/require-description": "error",
+            "jsdoc/check-values": "error"
+        }  
+    }
+];
+```
+
+While this is the most common convention, you don't need to use the same name that the plugin prescribes. You can specify any prefix that you'd like, such as:
+
+```js
+import jsdoc from "eslint-plugin-jsdoc";
+
+export default [
+    {
+        files: ["**/*.js"],
+        plugins: {
+            jsd: jsdoc
+        }
+        rules: {
+            "jsd/require-description": "error",
+            "jsd/check-values": "error"
+        }  
+    }
+];
+```
+
+This configuration object uses `jsd` as the prefix plugin instead of `jsdoc`.
+
+### Using processors
+
+Processors allow ESLint to transform text into pieces of code that ESLint can lint. You can specify the processor to use for a given file type by defining a `processor` property that contains either the processor name in the format `"pluginName/processorName"` to reference a processor in a plugin or an object containing both a `preprocess()` and a `postprocess()` method. For example, to extract JavaScript code blocks from a Markdown file, you might add this to your configuration:
+
+```js
+import markdown from "eslint-plugin-markdown";
+
+export default [
+    {
+        files: ["**/*.md"],
+        plugins: {
+            markdown
+        },
+        processor: "markdown/markdown"
+        settings: {
+            sharedData: "Hello"
+        }
+    }
+];
+```
+
+This configuration object specifies that there is a processor called `"markdown"` contained in the plugin named `"markdown"` and will apply the processor to all files ending with `.md`.
+
+Processors may make named code blocks that function as filenames in configuration objects, such as `0.js` and `1.js`. ESLint handles such a named code block as a child of the original file. You can specify additional configuration objects for named code blocks. For example, the following disables the `strict` rule for the named code blocks which end with `.js` in markdown files.
+
+```js
+import markdown from "eslint-plugin-markdown";
+
+export default [
+    {
+        files: ["**/*.md"],
+        plugins: {
+            markdown
+        },
+        processor: "markdown/markdown"
+        settings: {
+            sharedData: "Hello"
+        }
+    },
+
+    // applies only to code blocks
+    {
+        files: ["**/*.md/*.js"],
+        rules: {
+            strict: "off"
+        }
+    }
+];
+```
+
+### Configuring rules
+
+You can configure any number of rules in a configuration object by add a `rules` property containing an object with your rule configurations. The names in this object are the names of the rules and the values are the configurations for each of those rules. Here's an example:
+
+```js
+export default [
+    {
+        rules: {
+            semi: "error"
+        }
+    }
+];
+```
+
+This configuration object specifies that the [`semi`](/docs/latest/rules/semi) rule should be enabled with a severity of `"error"`. You can also provide options to a rule by specifying an array where the first item is the severity and each item after that is an option for the rule. For example, you can switch the `semi` rule to disallow semicolons by passing `"never"` as an option:
+
+```js
+export default [
+    {
+        rules: {
+            semi: ["error", "never"]
+        }
+    }
+];
+```
+
+Each rule specifies its own options and can be any valid JSON data type. Please check the documentation for the rule you want to configure for more information about its available options.
+
+#### Rule severities
+
+There are three possible severities you can specify for a rule
+
+* `"error"` (or `2`) - the reported problem should be treated as an error. When using the ESLint CLI, errors cause the CLI to exit with a nonzero code.
+* `"warn"` (or `1`) - the reported problem should be treated as a warning. When using the ESLint CLI, warnings are reported but do not change the exit code. If only errors are reported, the exit code will be 0.
+* `"off"` (or `0`) - the rule should be turned off completely.
+
+#### Rule configuration cascade
+
+When more than one configuration object specifies the same rule, the rule configuration is merged with the later object taking precedence over any previous objects. For example:
+
+```js
+export default [
+    {
+        rules: {
+            semi: ["error", "never"]
+        }
+    },
+    {
+        rules: {
+            semi: ["warn", "always"]
+        }
+    }
+];
+```
+
+Using this configuration, the final rule configuration for `semi` is `["warn", "always"]` because it appears last in the array. The array indicates that the configuration is for the severity and any options. You can change just the severity by defining only a string or number, as in this example:
+
+```js
+export default [
+    {
+        rules: {
+            semi: ["error", "never"]
+        }
+    },
+    {
+        rules: {
+            semi: "warn"
+        }
+    }
+];
+```
+
+Here, the second configuration object only overrides the severity, so the final configuration for `semi` is `["warn", "never"]`.
+
+### Configuring shared settings
+
+ESLint supports adding shared settings into configuration files. Plugins use `settings` to specify information that should be shared across all of its rules. You can add a `settings` object to a configuration object and it will be supplied to every rule being executed. This may be useful if you are adding custom rules and want them to have access to the same information. Here's an example:
+
+```js
+export default [
+    {
+        settings: {
+            sharedData: "Hello"
+        }
+    }
+];
+```
+
+### Using predefined configurations
+
+ESLint has two predefined configurations:
+
+* `eslint:recommended` - enables the rules that ESLint recommends everyone use to avoid potential errors
+* `eslint:all` - enables all of the rules shipped with ESLint
+
+To include these predefined configurations, you can insert the string values into the returned array and then make any modifications to other properties in subsequent configuration objects:
+
+```js
+export default [
+    "eslint:recommended",
+    {
+        rules: {
+            semi: ["warn", "always"]
+        }
+    }
+];
+```
+
+Here, the `eslint:recommended` predefined configuration is applied first and then another configuration object adds the desired configuration for `semi`.
+
+## Configuration File Resolution
+
+When ESLint is run on the command line, it first checks the current working directory for `eslint.config.js`, and if not found, will look to the next parent directory for the file. This search continues until either the file is found or the root directory is reached.
+
+You can prevent this search for `eslint.config.js` by using the `-c` or `--config--file` option on the command line to specify an alternate configuration file, such as:
+
+```shell
+npx eslint -c some-other-file.js **/*.js
+```
+
+In this case, ESLint will not search for `eslint.config.js` and will instead use `some-other-file.js`.
+
+Each configuration file exports one or more configuration object. A configuration object
diff --git a/eslint/docs/src/user-guide/configuring/configuration-files.md b/eslint/docs/src/user-guide/configuring/configuration-files.md
new file mode 100644 (file)
index 0000000..75b6d40
--- /dev/null
@@ -0,0 +1,446 @@
+---
+title: Configuration Files
+layout: doc
+eleventyNavigation:
+    key: configuration files
+    parent: configuring
+    title: Configuration Files
+    order: 1
+
+---
+
+## Configuration File Formats
+
+ESLint supports configuration files in several formats:
+
+* **JavaScript** - use `.eslintrc.js` and export an object containing your configuration.
+* **JavaScript (ESM)** - use `.eslintrc.cjs` when running ESLint in JavaScript packages that specify `"type":"module"` in their `package.json`. Note that ESLint does not support ESM configuration at this time.
+* **YAML** - use `.eslintrc.yaml` or `.eslintrc.yml` to define the configuration structure.
+* **JSON** - use `.eslintrc.json` to define the configuration structure. ESLint's JSON files also allow JavaScript-style comments.
+* **package.json** - create an `eslintConfig` property in your `package.json` file and define your configuration there.
+
+If there are multiple configuration files in the same directory, ESLint will only use one. The priority order is as follows:
+
+1. `.eslintrc.js`
+1. `.eslintrc.cjs`
+1. `.eslintrc.yaml`
+1. `.eslintrc.yml`
+1. `.eslintrc.json`
+1. `package.json`
+
+## Using Configuration Files
+
+There are two ways to use configuration files.
+
+The first way to use configuration files is via `.eslintrc.*` and `package.json` files. ESLint will automatically look for them in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (`/`), the home directory of the current user (`~/`), or when `root: true` is specified. See [Cascading and Hierarchy](#cascading-and-hierarchy) below for more details on this. Configuration files can be useful when you want different configurations for different parts of a project or when you want others to be able to use ESLint directly without needing to remember to pass in the configuration file.
+
+The second way to use configuration files is to save the file wherever you would like and pass its location to the CLI using the `--config` option, such as:
+
+```shell
+eslint -c myconfig.json myfiletotest.js
+```
+
+If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use [`--no-eslintrc`](https://eslint.org/docs/user-guide/command-line-interface#--no-eslintrc) along with the [`-c`](https://eslint.org/docs/user-guide/command-line-interface#-c---config) flag.
+
+Here's an example JSON configuration file that uses the `typescript-eslint` parser to support TypeScript syntax:
+
+```json
+{
+    "root": true,
+    "extends": [
+        "eslint:recommended",
+        "plugin:@typescript-eslint/recommended"
+    ],
+    "parser": "@typescript-eslint/parser",
+    "parserOptions": { "project": ["./tsconfig.json"] },
+    "plugins": [
+        "@typescript-eslint"
+    ],
+    "rules": {
+        "@typescript-eslint/strict-boolean-expressions": [
+            2,
+            {
+                "allowString" : false,
+                "allowNumber" : false
+            }
+        ]
+    },
+    "ignorePatterns": ["src/**/*.test.ts", "src/frontend/generated/*"]
+}
+```
+
+### Comments in configuration files
+
+Both the JSON and YAML configuration file formats support comments (package.json files should not include them). You can use JavaScript-style comments for JSON files and YAML-style comments for YAML files. ESLint safely ignores comments in configuration files. This allows your configuration files to be more human-friendly.
+
+For JavaScript-style comments:
+
+```js
+{
+    "env": {
+        "browser": true
+    },
+    "rules": {
+        // Override our default settings just for this directory
+        "eqeqeq": "warn",
+        "strict": "off"
+    }
+}
+```
+
+For YAML-style comments:
+
+```yaml
+env:
+    browser: true
+rules:
+    # Override default settings
+    eqeqeq: warn
+    strict: off
+```
+
+## Adding Shared Settings
+
+ESLint supports adding shared settings into configuration files. Plugins use `settings` to specify information that should be shared across all of its rules. You can add `settings` object to ESLint configuration file and it will be supplied to every rule being executed. This may be useful if you are adding custom rules and want them to have access to the same information and be easily configurable.
+
+In JSON:
+
+```json
+{
+    "settings": {
+        "sharedData": "Hello"
+    }
+}
+```
+
+And in YAML:
+
+```yaml
+---
+  settings:
+    sharedData: "Hello"
+```
+
+## Cascading and Hierarchy
+
+When using `.eslintrc.*` and `package.json` files for configuration, you can take advantage of configuration cascading. Suppose you have the following structure:
+
+```text
+your-project
+├── .eslintrc.json
+├── lib
+│ └── source.js
+└─┬ tests
+  ├── .eslintrc.json
+  └── test.js
+```
+
+The configuration cascade works based on the location of the file being linted. If there is a `.eslintrc` file in the same directory as the file being linted, then that configuration takes precedence. ESLint then searches up the directory structure, merging any `.eslintrc` files it finds along the way until reaching either a `.eslintrc` file with `root: true` or the root directory.
+
+In the same way, if there is a `package.json` file in the root directory with an `eslintConfig` field, the configuration it describes will apply to all subdirectories beneath it, but the configuration described by the `.eslintrc` file in the `tests/` directory will override it where there are conflicting specifications.
+
+```text
+your-project
+├── package.json
+├── lib
+│ └── source.js
+└─┬ tests
+  ├── .eslintrc.json
+  └── test.js
+```
+
+If there is a `.eslintrc` and a `package.json` file found in the same directory, `.eslintrc` will take priority and `package.json` file will not be used.
+
+By default, ESLint will look for configuration files in all parent folders up to the root directory. This can be useful if you want all of your projects to follow a certain convention, but can sometimes lead to unexpected results. To limit ESLint to a specific project, place `"root": true` inside the `.eslintrc.*` file or `eslintConfig` field of the `package.json` file or in the `.eslintrc.*` file at your project's root level. ESLint will stop looking in parent folders once it finds a configuration with `"root": true`.
+
+```js
+{
+    "root": true
+}
+```
+
+And in YAML:
+
+```yaml
+---
+  root: true
+```
+
+For example, consider `projectA` which has `"root": true` set in the `.eslintrc` file in the `lib/` directory.  In this case, while linting `main.js`, the configurations within `lib/` will be used, but the `.eslintrc` file in `projectA/` will not.
+
+```text
+home
+└── user
+    └── projectA
+        ├── .eslintrc.json  <- Not used
+        └── lib
+            ├── .eslintrc.json  <- { "root": true }
+            └── main.js
+```
+
+The complete configuration hierarchy, from highest to lowest precedence, is as follows:
+
+1. Inline configuration
+    1. `/*eslint-disable*/` and `/*eslint-enable*/`
+    1. `/*global*/`
+    1. `/*eslint*/`
+    1. `/*eslint-env*/`
+1. Command line options (or CLIEngine equivalents):
+    1. `--global`
+    1. `--rule`
+    1. `--env`
+    1. `-c`, `--config`
+1. Project-level configuration:
+    1. `.eslintrc.*` or `package.json` file in the same directory as the linted file
+    1. Continue searching for `.eslintrc.*` and `package.json` files in ancestor directories up to and including the root directory or until a config with `"root": true` is found.
+
+Please note that the [home directory of the current user on your preferred operating system](https://nodejs.org/api/os.html#os_os_homedir) (`~/`) is also considered a root directory in this context and searching for configuration files will stop there as well. And with the [removal of support for Personal Configuration Files](https://eslint.org/docs/user-guide/configuring/configuration-files#personal-configuration-files-deprecated) from the 8.0.0 release forward, configuration files present in that directory will be ignored.
+
+## Extending Configuration Files
+
+A configuration file, once extended, can inherit all the traits of another configuration file (including rules, plugins, and language options) and modify all the options. As a result, there are three configurations, as defined below:
+
+* Base config: the configuration that is extended.
+* Derived config: the configuration that extends the base configuration.
+* Resulting actual config: the result of merging the derived configuration into the base configuration.
+
+The `extends` property value is either:
+
+* a string that specifies a configuration (either a path to a config file, the name of a shareable config, `eslint:recommended`, or `eslint:all`)
+* an array of strings where each additional configuration extends the preceding configurations
+
+ESLint extends configurations recursively, so a base configuration can also have an `extends` property. Relative paths and shareable config names in an `extends` property are resolved from the location of the config file where they appear.
+
+The `eslint-config-` prefix can be omitted from the configuration name. For example, `airbnb` resolves as `eslint-config-airbnb`.
+
+The `rules` property can do any of the following to extend (or override) the set of rules:
+
+* enable additional rules
+* change an inherited rule's severity without changing its options:
+    * Base config: `"eqeqeq": ["error", "allow-null"]`
+    * Derived config: `"eqeqeq": "warn"`
+    * Resulting actual config: `"eqeqeq": ["warn", "allow-null"]`
+* override options for rules from base configurations:
+    * Base config: `"quotes": ["error", "single", "avoid-escape"]`
+    * Derived config: `"quotes": ["error", "single"]`
+    * Resulting actual config: `"quotes": ["error", "single"]`
+* override options for rules given as object from base configurations:
+    * Base config: `"max-lines": ["error", { "max": 200, "skipBlankLines": true, "skipComments": true }]`
+    * Derived config: `"max-lines": ["error", { "max": 100 }]`
+    * Resulting actual config: `"max-lines": ["error", { "max": 100 }]` where `skipBlankLines` and `skipComments` default to `false`
+
+### Using a shareable configuration package
+
+A [sharable configuration](https://eslint.org/docs/developer-guide/shareable-configs) is an npm package that exports a configuration object. Make sure that you have installed the package in your project root directory, so that ESLint can require it.
+
+The `extends` property value can omit the `eslint-config-` prefix of the package name.
+
+The `npm init @eslint/config` command can create a configuration so you can extend a popular style guide (for example, `eslint-config-standard`).
+
+Example of a configuration file in YAML format:
+
+```yaml
+extends: standard
+rules:
+  comma-dangle:
+    - error
+    - always
+  no-empty: warn
+```
+
+### Using `eslint:recommended`
+
+Using `"eslint:recommended"` in the `extends` property enables a subset of core rules that report common problems (these rules are identified with a checkmark (recommended) on the [rules page](https://eslint.org/docs/rules/)).
+
+Here's an example of extending `eslint:recommended` and overriding some of the set configuration options:
+
+Example of a configuration file in JavaScript format:
+
+```js
+module.exports = {
+    "extends": "eslint:recommended",
+    "rules": {
+        // enable additional rules
+        "indent": ["error", 4],
+        "linebreak-style": ["error", "unix"],
+        "quotes": ["error", "double"],
+        "semi": ["error", "always"],
+
+        // override configuration set by extending "eslint:recommended"
+        "no-empty": "warn",
+        "no-cond-assign": ["error", "always"],
+
+        // disable rules from base configurations
+         "for-direction": "off",
+    }
+}
+```
+
+### Using a configuration from a plugin
+
+A [plugin](https://eslint.org/docs/developer-guide/working-with-plugins) is an npm package that can add various extensions to ESLint. A plugin can perform numerous functions, including but not limited to adding new rules and exporting [shareable configurations](https://eslint.org/docs/developer-guide/working-with-plugins#configs-in-plugins). Make sure the package has been installed in a directory where ESLint can require it.
+
+The `plugins` [property value](./plugins#configuring-plugins) can omit the `eslint-plugin-` prefix of the package name.
+
+The `extends` property value can consist of:
+
+* `plugin:`
+* the package name (from which you can omit the prefix, for example, `react` is short for `eslint-plugin-react`)
+* `/`
+* the configuration name (for example, `recommended`)
+
+Example of a configuration file in JSON format:
+
+```json
+{
+    "plugins": [
+        "react"
+    ],
+    "extends": [
+        "eslint:recommended",
+        "plugin:react/recommended"
+    ],
+    "rules": {
+       "react/no-set-state": "off"
+    }
+}
+```
+
+### Using a configuration file
+
+The `extends` property value can be an absolute or relative path to a base [configuration file](#using-configuration-files). ESLint resolves a relative path to a base configuration file relative to the configuration file that uses it.
+
+Example of a configuration file in JSON format:
+
+```json
+{
+    "extends": [
+        "./node_modules/coding-standard/eslintDefaults.js",
+        "./node_modules/coding-standard/.eslintrc-es6",
+        "./node_modules/coding-standard/.eslintrc-jsx"
+    ],
+    "rules": {
+        "eqeqeq": "warn"
+    }
+}
+```
+
+### Using `"eslint:all"`
+
+The `extends` property value can be `"eslint:all"` to enable all core rules in the currently installed version of ESLint. The set of core rules can change at any minor or major version of ESLint.
+
+**Important:** This configuration is **not recommended for production use** because it changes with every minor and major version of ESLint. Use it at your own risk.
+
+You might enable all core rules as a shortcut to explore rules and options while you decide on the configuration for a project, especially if you rarely override options or disable rules. The default options for rules are not endorsements by ESLint (for example, the default option for the [`quotes`](https://eslint.org/docs/rules/quotes) rule does not mean double quotes are better than single quotes).
+
+If your configuration extends `eslint:all`, after you upgrade to a newer major or minor version of ESLint, review the reported problems before you use the `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix), so you know if a new fixable rule will make changes to the code.
+
+Example of a configuration file in JavaScript format:
+
+```js
+module.exports = {
+    "extends": "eslint:all",
+    "rules": {
+        // override default options
+        "comma-dangle": ["error", "always"],
+        "indent": ["error", 2],
+        "no-cond-assign": ["error", "always"],
+
+        // disable now, but enable in the future
+        "one-var": "off", // ["error", "never"]
+
+        // disable
+        "init-declarations": "off",
+        "no-console": "off",
+        "no-inline-comments": "off",
+    }
+}
+```
+
+## Configuration Based on Glob Patterns
+
+<b>v4.1.0+.</b> Sometimes a more fine-controlled configuration is necessary, for example, if the configuration for files within the same directory has to be different. Therefore you can provide configurations under the `overrides` key that will only apply to files that match specific glob patterns, using the same format you would pass on the command line (e.g., `app/**/*.test.js`).
+
+Glob patterns in overrides use [minimatch syntax](https://github.com/isaacs/minimatch).
+
+### How do overrides work?
+
+It is possible to override settings based on file glob patterns in your configuration by using the `overrides` key. An example of using the `overrides` key is as follows:
+
+In your `.eslintrc.json`:
+
+```json
+{
+  "rules": {
+    "quotes": ["error", "double"]
+  },
+
+  "overrides": [
+    {
+      "files": ["bin/*.js", "lib/*.js"],
+      "excludedFiles": "*.test.js",
+      "rules": {
+        "quotes": ["error", "single"]
+      }
+    }
+  ]
+}
+```
+
+Here is how overrides work in a configuration file:
+
+* The patterns are applied against the file path relative to the directory of the config file. For example, if your config file has the path `/Users/john/workspace/any-project/.eslintrc.js` and the file you want to lint has the path `/Users/john/workspace/any-project/lib/util.js`, then the pattern provided in `.eslintrc.js` will be executed against the relative path `lib/util.js`.
+* Glob pattern overrides have higher precedence than the regular configuration in the same config file. Multiple overrides within the same config are applied in order. That is, the last override block in a config file always has the highest precedence.
+* A glob specific configuration works almost the same as any other ESLint config. Override blocks can contain any configuration options that are valid in a regular config, with the exception of `root` and `ignorePatterns`.
+    * A glob specific configuration can have an `extends` setting, but the `root` property in the extended configs is ignored. The `ignorePatterns` property in the extended configs is used only for the files the glob specific configuration matched.
+    * Nested `overrides` setting will be applied only if the glob patterns of both of the parent config and the child config matched. This is the same when the extended configs have an `overrides` setting.
+* Multiple glob patterns can be provided within a single override block. A file must match at least one of the supplied patterns for the configuration to apply.
+* Override blocks can also specify patterns to exclude from matches. If a file matches any of the excluded patterns, the configuration won't apply.
+
+### Relative glob patterns
+
+```txt
+project-root
+├── app
+│   ├── lib
+│   │   ├── foo.js
+│   │   ├── fooSpec.js
+│   ├── components
+│   │   ├── bar.js
+│   │   ├── barSpec.js
+│   ├── .eslintrc.json
+├── server
+│   ├── server.js
+│   ├── serverSpec.js
+├── .eslintrc.json
+```
+
+The config in `app/.eslintrc.json` defines the glob pattern `**/*Spec.js`. This pattern is relative to the base directory of `app/.eslintrc.json`. So, this pattern would match `app/lib/fooSpec.js` and `app/components/barSpec.js` but **NOT** `server/serverSpec.js`. If you defined the same pattern in the `.eslintrc.json` file within in the `project-root` folder, it would match all three of the `*Spec` files.
+
+If a config is provided via the `--config` CLI option, the glob patterns in the config are relative to the current working directory rather than the base directory of the given config. For example, if `--config configs/.eslintrc.json` is present, the glob patterns in the config are relative to `.` rather than `./configs`.
+
+### Specifying target files to lint
+
+If you specified directories with CLI (e.g., `eslint lib`), ESLint searches target files in the directory to lint. The target files are `*.js` or the files that match any of `overrides` entries (but exclude entries that are any of `files` end with `*`).
+
+If you specified the [`--ext`](https://eslint.org/docs/user-guide/command-line-interface#ext) command line option along with directories, the target files are only the files that have specified file extensions regardless of `overrides` entries.
+
+## Personal Configuration Files (deprecated)
+
+⚠️ **This feature has been deprecated**. This feature will be removed in the 8.0.0 release. If you want to continue to use personal configuration files, please use the [`--config` CLI option](https://eslint.org/docs/user-guide/command-line-interface#-c---config). For more information regarding this decision, please see [RFC 28](https://github.com/eslint/rfcs/pull/28) and [RFC 32](https://github.com/eslint/rfcs/pull/32).
+
+`~/` refers to [the home directory of the current user on your preferred operating system](https://nodejs.org/api/os.html#os_os_homedir). The personal configuration file being referred to here is `~/.eslintrc.*` file, which is currently handled differently than other configuration files.
+
+### How does ESLint find personal configuration files?
+
+If `eslint` could not find any configuration file in the project, `eslint` loads `~/.eslintrc.*` file.
+
+If `eslint` could find configuration files in the project, `eslint` ignores `~/.eslintrc.*` file even if it's in an ancestor directory of the project directory.
+
+### How do personal configuration files behave?
+
+`~/.eslintrc.*` files behave similarly to regular configuration files, with some exceptions:
+
+`~/.eslintrc.*` files load shareable configs and custom parsers from `~/node_modules/` – similarly to `require()` – in the user's home directory. Please note that it doesn't load global-installed packages.
+
+`~/.eslintrc.*` files load plugins from `$CWD/node_modules` by default in order to identify plugins uniquely. If you want to use plugins with `~/.eslintrc.*` files, plugins must be installed locally per project. Alternatively, you can use the [`--resolve-plugins-relative-to` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--resolve-plugins-relative-to) to change the location from which ESLint loads plugins.
diff --git a/eslint/docs/src/user-guide/configuring/ignoring-code.md b/eslint/docs/src/user-guide/configuring/ignoring-code.md
new file mode 100644 (file)
index 0000000..c41422c
--- /dev/null
@@ -0,0 +1,169 @@
+---
+title: Ignoring Code
+layout: doc
+eleventyNavigation:
+    key: ignoring code
+    parent: configuring
+    title: Ignoring Code
+    order: 5
+
+---
+
+## `ignorePatterns` in Config Files
+
+You can tell ESLint to ignore specific files and directories using `ignorePatterns` in your config files. `ignorePatterns` patterns follow the same rules as `.eslintignore`. Please see the [the `.eslintignore` file documentation](./ignoring-code#the-eslintignore-file) to learn more.
+
+```json
+{
+    "ignorePatterns": ["temp.js", "**/vendor/*.js"],
+    "rules": {
+        //...
+    }
+}
+```
+
+* Glob patterns in `ignorePatterns` are relative to the directory that the config file is placed in.
+* You cannot write `ignorePatterns` property under `overrides` property.
+* Patterns defined in `.eslintignore` take precedence over the `ignorePatterns` property of config files.
+
+If a glob pattern starts with `/`, the pattern is relative to the base directory of the config file. For example, `/foo.js` in `lib/.eslintrc.json` matches to `lib/foo.js` but not `lib/subdir/foo.js`.
+
+If a config is provided via the `--config` CLI option, the ignore patterns that start with `/` in the config are relative to the current working directory rather than the base directory of the given config. For example, if `--config configs/.eslintrc.json` is present, the ignore patterns in the config are relative to `.` rather than `./configs`.
+
+## The `.eslintignore` File
+
+You can tell ESLint to ignore specific files and directories by creating an `.eslintignore` file in your project's root directory. The `.eslintignore` file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting. For example, the following will omit all JavaScript files:
+
+```text
+**/*.js
+```
+
+When ESLint is run, it looks in the current working directory to find an `.eslintignore` file before determining which files to lint. If this file is found, then those preferences are applied when traversing directories. Only one `.eslintignore` file can be used at a time, so `.eslintignore` files other than the one in the current working directory will not be used.
+
+Globs are matched using [node-ignore](https://github.com/kaelzhang/node-ignore), so a number of features are available:
+
+* Lines beginning with `#` are treated as comments and do not affect the ignore patterns.
+* Paths are relative to the current working directory. This is also true of paths passed in via the `--ignore-pattern` [command](../command-line-interface#--ignore-pattern).
+* Lines preceded by `!` are negated patterns that re-include a pattern that was ignored by an earlier pattern.
+* Ignore patterns behave according to the `.gitignore` [specification](https://git-scm.com/docs/gitignore).
+
+Of particular note is that like `.gitignore` files, all paths used as patterns for both `.eslintignore` and `--ignore-pattern` must use forward slashes as their path separators.
+
+```text
+# Valid
+/root/src/*.js
+
+# Invalid
+\root\src\*.js
+```
+
+Please see [`.gitignore`](https://git-scm.com/docs/gitignore)'s specification for further examples of valid syntax.
+
+In addition to any patterns in the `.eslintignore` file, ESLint always follows a couple of implicit ignore rules even if the `--no-ignore` flag is passed. The implicit rules are as follows:
+
+* `node_modules/` is ignored.
+* dot-files (except for `.eslintrc.*`), as well as dot-folders and their contents, are ignored.
+
+There are also some exceptions to these rules:
+
+* If the path to lint is a glob pattern or directory path and contains a dot-folder, all dot-files and dot-folders will be linted. This includes dot-files and dot-folders that are buried deeper in the directory structure.
+
+  For example, `eslint .config/` will lint all dot-folders and dot-files in the `.config` directory, including immediate children as well as children that are deeper in the directory structure.
+
+* If the path to lint is a specific file path and the `--no-ignore` flag has been passed, ESLint will lint the file regardless of the implicit ignore rules.
+
+  For example, `eslint .config/my-config-file.js --no-ignore` will cause `my-config-file.js` to be linted. It should be noted that the same command without the `--no-ignore` line will not lint the `my-config-file.js` file.
+
+* Allowlist and denylist rules specified via `--ignore-pattern` or `.eslintignore` are prioritized above implicit ignore rules.
+
+  For example, in this scenario, `.build/test.js` is the desired file to allowlist. Because all dot-folders and their children are ignored by default, `.build` must first be allowlisted so that eslint becomes aware of its children. Then, `.build/test.js` must be explicitly allowlisted, while the rest of the content is denylisted. This is done with the following `.eslintignore` file:
+
+  ```text
+  # Allowlist 'test.js' in the '.build' folder
+  # But do not allow anything else in the '.build' folder to be linted
+  !.build
+  .build/*
+  !.build/test.js
+  ```
+
+  The following `--ignore-pattern` is also equivalent:
+
+  ```shell
+  eslint --ignore-pattern '!.build' --ignore-pattern '.build/*' --ignore-pattern '!.build/test.js' parent-folder/
+  ```
+
+## Using an Alternate File
+
+If you'd prefer to use a different file than the `.eslintignore` in the current working directory, you can specify it on the command line using the `--ignore-path` option. For example, you can use `.jshintignore` file because it has the same format:
+
+```shell
+eslint --ignore-path .jshintignore file.js
+```
+
+You can also use your `.gitignore` file:
+
+```shell
+eslint --ignore-path .gitignore file.js
+```
+
+Any file that follows the standard ignore file format can be used. Keep in mind that specifying `--ignore-path` means that any existing `.eslintignore` file will not be used. Note that globbing rules in `.eslintignore` follow those of `.gitignore`.
+
+## Using eslintIgnore in package.json
+
+If an `.eslintignore` file is not found and an alternate file is not specified, ESLint will look in package.json for an `eslintIgnore` key to check for files to ignore.
+
+```json
+{
+    "name": "mypackage",
+    "version": "0.0.1",
+    "eslintConfig": {
+        "env": {
+            "browser": true,
+            "node": true
+        }
+    },
+    "eslintIgnore": ["hello.js", "world.js"]
+}
+```
+
+## Ignored File Warnings
+
+When you pass directories to ESLint, files and directories are silently ignored. If you pass a specific file to ESLint, then you will see a warning indicating that the file was skipped. For example, suppose you have an `.eslintignore` file that looks like this:
+
+```text
+foo.js
+```
+
+And then you run:
+
+```shell
+eslint foo.js
+```
+
+You'll see this warning:
+
+```text
+foo.js
+  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
+
+✖ 1 problem (0 errors, 1 warning)
+```
+
+This message occurs because ESLint is unsure if you wanted to actually lint the file or not. As the message indicates, you can use `--no-ignore` to omit using the ignore rules.
+
+Consider another scenario where you may want to run ESLint on a specific dot-file or dot-folder, but have forgotten to specifically allow those files in your `.eslintignore` file. You would run something like this:
+
+```shell
+eslint .config/foo.js
+```
+
+You would see this warning:
+
+```text
+.config/foo.js
+  0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override
+
+✖ 1 problem (0 errors, 1 warning)
+```
+
+This message occurs because, normally, this file would be ignored by ESLint's implicit ignore rules (as mentioned above). A negated ignore rule in your `.eslintignore` file would override the implicit rule and reinclude this file for linting. Additionally, in this specific case, `--no-ignore` could be used to lint the file as well.
diff --git a/eslint/docs/src/user-guide/configuring/index.md b/eslint/docs/src/user-guide/configuring/index.md
new file mode 100644 (file)
index 0000000..2eaad9c
--- /dev/null
@@ -0,0 +1,61 @@
+---
+title: Configuring ESLint
+layout: doc
+eleventyNavigation:
+    key: configuring
+    parent: user guide
+    title: Configuring
+    order: 2
+
+---
+
+ESLint is designed to be flexible and configurable for your use case. You can turn off every rule and run only with basic syntax validation or mix and match the bundled rules and your custom rules to fit the needs of your project. There are two primary ways to configure ESLint:
+
+1. **Configuration Comments** - use JavaScript comments to embed configuration information directly into a file.
+2. **Configuration Files** - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of a [`.eslintrc.*`](./configuration-files#configuration-file-formats) file or an `eslintConfig` field in a [`package.json`](https://docs.npmjs.com/files/package.json) file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the [command line](../command-line-interface).
+
+Here are some of the options that you can configure in ESLint:
+
+* [**Environments**](./language-options#specifying-environments) - which environments your script is designed to run in. Each environment brings with it a certain set of predefined global variables.
+* [**Globals**](./language-options#specifying-globals) - the additional global variables your script accesses during execution.
+* [**Rules**](rules) - which rules are enabled and at what error level.
+* [**Plugins**](plugins) - which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
+
+All of these options give you fine-grained control over how ESLint treats your code.
+
+## Table of Contents
+
+[**Configuration Files**](configuration-files)
+
+* [Configuration File Formats](./configuration-files#configuration-file-formats)
+* [Using Configuration Files](./configuration-files#using-configuration-files)
+* [Adding Shared Settings](./configuration-files#adding-shared-settings)
+* [Cascading and Hierarchy](./configuration-files#cascading-and-hierarchy)
+* [Extending Configuration Files](./configuration-files#extending-configuration-files)
+* [Configuration Based on Glob Patterns](./configuration-files#configuration-based-on-glob-patterns)
+* [Personal Configuration Files](./configuration-files#personal-configuration-files-deprecated)
+
+[**Language Options**](language-options)
+
+* [Specifying Environments](./language-options#specifying-environments)
+* [Specifying Globals](./language-options#specifying-globals)
+* [Specifying Parser Options](./language-options#specifying-parser-options)
+
+[**Rules**](rules)
+
+* [Configuring Rules](./rules#configuring-rules)
+* [Disabling Rules](./rules#disabling-rules)
+
+[**Plugins**](plugins)
+
+* [Specifying Parser](./plugins#specifying-parser)
+* [Specifying Processor](./plugins#specifying-processor)
+* [Configuring Plugins](./plugins#configuring-plugins)
+
+[**Ignoring Code**](ignoring-code)
+
+* [`ignorePatterns` in Config Files](./ignoring-code#ignorepatterns-in-config-files)
+* [The `.eslintignore` File](./ignoring-code#the-eslintignore-file)
+* [Using an Alternate File](./ignoring-code#using-an-alternate-file)
+* [Using eslintIgnore in package.json](./ignoring-code#using-eslintignore-in-packagejson)
+* [Ignored File Warnings](./ignoring-code#ignored-file-warnings)
diff --git a/eslint/docs/src/user-guide/configuring/language-options.md b/eslint/docs/src/user-guide/configuring/language-options.md
new file mode 100644 (file)
index 0000000..1ec3233
--- /dev/null
@@ -0,0 +1,222 @@
+---
+title: Language Options
+layout: doc
+eleventyNavigation:
+    key: configuring language options
+    parent: configuring
+    title: Configuring Language Options
+    order: 2
+
+---
+
+## Specifying Environments
+
+An environment provides predefined global variables. The available environments are:
+
+* `browser` - browser global variables.
+* `node` - Node.js global variables and Node.js scoping.
+* `commonjs` - CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).
+* `shared-node-browser` - Globals common to both Node.js and Browser.
+* `es6` - enable all ECMAScript 6 features except for modules (this automatically sets the `ecmaVersion` parser option to 6).
+* `es2016` - adds all ECMAScript 2016 globals and automatically sets the `ecmaVersion` parser option to 7.
+* `es2017` - adds all ECMAScript 2017 globals and automatically sets the `ecmaVersion` parser option to 8.
+* `es2018` - adds all ECMAScript 2018 globals and automatically sets the `ecmaVersion` parser option to 9.
+* `es2019` - adds all ECMAScript 2019 globals and automatically sets the `ecmaVersion` parser option to 10.
+* `es2020` - adds all ECMAScript 2020 globals and automatically sets the `ecmaVersion` parser option to 11.
+* `es2021` - adds all ECMAScript 2021 globals and automatically sets the `ecmaVersion` parser option to 12.
+* `es2022` - adds all ECMAScript 2022 globals and automatically sets the `ecmaVersion` parser option to 13.
+* `worker` - web workers global variables.
+* `amd` - defines `require()` and `define()` as global variables as per the [amd](https://github.com/amdjs/amdjs-api/wiki/AMD) spec.
+* `mocha` - adds all of the Mocha testing global variables.
+* `jasmine` - adds all of the Jasmine testing global variables for version 1.3 and 2.0.
+* `jest` - Jest global variables.
+* `phantomjs` - PhantomJS global variables.
+* `protractor` - Protractor global variables.
+* `qunit` - QUnit global variables.
+* `jquery` - jQuery global variables.
+* `prototypejs` - Prototype.js global variables.
+* `shelljs` - ShellJS global variables.
+* `meteor` - Meteor global variables.
+* `mongo` - MongoDB global variables.
+* `applescript` - AppleScript global variables.
+* `nashorn` - Java 8 Nashorn global variables.
+* `serviceworker` - Service Worker global variables.
+* `atomtest` - Atom test helper globals.
+* `embertest` - Ember test helper globals.
+* `webextensions` - WebExtensions globals.
+* `greasemonkey` - GreaseMonkey globals.
+
+These environments are not mutually exclusive, so you can define more than one at a time.
+
+Environments can be specified inside of a file, in configuration files or using the `--env` [command line](../command-line-interface) flag.
+
+### Using configuration comments
+
+To specify environments using a comment inside of your JavaScript file, use the following format:
+
+```js
+/* eslint-env node, mocha */
+```
+
+This enables Node.js and Mocha environments.
+
+### Using configuration files
+
+To specify environments in a configuration file, use the `env` key and specify which environments you want to enable by setting each to `true`. For example, the following enables the browser and Node.js environments:
+
+```json
+{
+    "env": {
+        "browser": true,
+        "node": true
+    }
+}
+```
+
+Or in a `package.json` file
+
+```json
+{
+    "name": "mypackage",
+    "version": "0.0.1",
+    "eslintConfig": {
+        "env": {
+            "browser": true,
+            "node": true
+        }
+    }
+}
+```
+
+And in YAML:
+
+```yaml
+---
+  env:
+    browser: true
+    node: true
+```
+
+### Using a plugin
+
+If you want to use an environment from a plugin, be sure to specify the plugin name in the `plugins` array and then use the unprefixed plugin name, followed by a slash, followed by the environment name. For example:
+
+```json
+{
+    "plugins": ["example"],
+    "env": {
+        "example/custom": true
+    }
+}
+```
+
+Or in a `package.json` file
+
+```json
+{
+    "name": "mypackage",
+    "version": "0.0.1",
+    "eslintConfig": {
+        "plugins": ["example"],
+        "env": {
+            "example/custom": true
+        }
+    }
+}
+```
+
+## Specifying Globals
+
+Some of ESLint's core rules rely on knowledge of the global variables available to your code at runtime. Since these can vary greatly between different environments as well as be modified at runtime, ESLint makes no assumptions about what global variables exist in your execution environment. If you would like to use rules that require knowledge of what global variables are available, you can define global variables in your configuration file or by using configuration comments in your source code.
+
+### Using configuration comments
+
+To specify globals using a comment inside of your JavaScript file, use the following format:
+
+```js
+/* global var1, var2 */
+```
+
+This defines two global variables, `var1` and `var2`. If you want to optionally specify that these global variables can be written to (rather than only being read), then you can set each with a `"writable"` flag:
+
+```js
+/* global var1:writable, var2:writable */
+```
+
+### Using configuration files
+
+To configure global variables inside of a configuration file, set the `globals` configuration property to an object containing keys named for each of the global variables you want to use. For each global variable key, set the corresponding value equal to `"writable"` to allow the variable to be overwritten or `"readonly"` to disallow overwriting. For example:
+
+```json
+{
+    "globals": {
+        "var1": "writable",
+        "var2": "readonly"
+    }
+}
+```
+
+And in YAML:
+
+```yaml
+---
+  globals:
+    var1: writable
+    var2: readonly
+```
+
+These examples allow `var1` to be overwritten in your code, but disallow it for `var2`.
+
+Globals can be disabled with the string `"off"`. For example, in an environment where most ES2015 globals are available but `Promise` is unavailable, you might use this config:
+
+```json
+{
+    "env": {
+        "es6": true
+    },
+    "globals": {
+        "Promise": "off"
+    }
+}
+```
+
+For historical reasons, the boolean value `false` and the string value `"readable"` are equivalent to `"readonly"`. Similarly, the boolean value `true` and the string value `"writeable"` are equivalent to `"writable"`. However, the use of older values is deprecated.
+
+## Specifying Parser Options
+
+ESLint allows you to specify the JavaScript language options you want to support. By default, ESLint expects ECMAScript 5 syntax. You can override that setting to enable support for other ECMAScript versions as well as JSX by using parser options.
+
+Please note that supporting JSX syntax is not the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) if you are using React and want React semantics.
+By the same token, supporting ES6 syntax is not the same as supporting new ES6 globals (e.g., new types such as
+`Set`).
+For ES6 syntax, use `{ "parserOptions": { "ecmaVersion": 6 } }`; for new ES6 global variables, use `{ "env":
+{ "es6": true } }`. `{ "env": { "es6": true } }` enables ES6 syntax automatically, but `{ "parserOptions": { "ecmaVersion": 6 } }` does not enable ES6 globals automatically.
+
+Parser options are set in your `.eslintrc.*` file by using the `parserOptions` property. The available options are:
+
+* `ecmaVersion` - set to 3, 5 (default), 6, 7, 8, 9, 10, 11, 12, 13, or 14 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), or 2023 (same as 14) to use the year-based naming. You can also set "latest" to use the most recently supported version.
+* `sourceType` - set to `"script"` (default) or `"module"` if your code is in ECMAScript modules.
+* `allowReserved` - allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
+* `ecmaFeatures` - an object indicating which additional language features you'd like to use:
+    * `globalReturn` - allow `return` statements in the global scope
+    * `impliedStrict` - enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater)
+    * `jsx` - enable [JSX](https://facebook.github.io/jsx/)
+
+Here's an example `.eslintrc.json` file:
+
+```json
+{
+    "parserOptions": {
+        "ecmaVersion": "latest",
+        "sourceType": "module",
+        "ecmaFeatures": {
+            "jsx": true
+        }
+    },
+    "rules": {
+        "semi": "error"
+    }
+}
+```
+
+Setting parser options helps ESLint determine what is a parsing error. All language options are `false` by default.
diff --git a/eslint/docs/src/user-guide/configuring/plugins.md b/eslint/docs/src/user-guide/configuring/plugins.md
new file mode 100644 (file)
index 0000000..12eef7e
--- /dev/null
@@ -0,0 +1,181 @@
+---
+title: Plugins
+layout: doc
+eleventyNavigation:
+    key: configuring plugins
+    parent: configuring
+    title: Configuring Plugins
+    order: 4
+
+---
+
+## Specifying Parser
+
+By default, ESLint uses [Espree](https://github.com/eslint/espree) as its parser. You can optionally specify that a different parser should be used in your configuration file so long as the parser meets the following requirements:
+
+1. It must be a Node module loadable from the config file where the parser is used. Usually, this means you should install the parser package separately using npm.
+1. It must conform to the [parser interface](../../developer-guide/working-with-custom-parsers).
+
+Note that even with these compatibilities, there are no guarantees that an external parser will work correctly with ESLint and ESLint will not fix bugs related to incompatibilities with other parsers.
+
+To indicate the npm module to use as your parser, specify it using the `parser` option in your `.eslintrc` file. For example, the following specifies to use Esprima instead of Espree:
+
+```json
+{
+    "parser": "esprima",
+    "rules": {
+        "semi": "error"
+    }
+}
+```
+
+The following parsers are compatible with ESLint:
+
+* [Esprima](https://www.npmjs.com/package/esprima)
+* [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) - A wrapper around the [Babel](https://babeljs.io) parser that makes it compatible with ESLint.
+* [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser) - A parser that converts TypeScript into an ESTree-compatible form so it can be used in ESLint.
+
+Note when using a custom parser, the `parserOptions` configuration property is still required for ESLint to work properly with features not in ECMAScript 5 by default. Parsers are all passed `parserOptions` and may or may not use them to determine which features to enable.
+
+## Specifying Processor
+
+Plugins may provide processors. Processors can extract JavaScript code from other kinds of files, then let ESLint lint the JavaScript code or processors can convert JavaScript code in preprocessing for some purpose.
+
+To specify processors in a configuration file, use the `processor` key with the concatenated string of a plugin name and a processor name by a slash. For example, the following enables the processor `a-processor` that the plugin `a-plugin` provided:
+
+```json
+{
+    "plugins": ["a-plugin"],
+    "processor": "a-plugin/a-processor"
+}
+```
+
+To specify processors for specific kinds of files, use the combination of the `overrides` key and the `processor` key. For example, the following uses the processor `a-plugin/markdown` for `*.md` files.
+
+```json
+{
+    "plugins": ["a-plugin"],
+    "overrides": [
+        {
+            "files": ["*.md"],
+            "processor": "a-plugin/markdown"
+        }
+    ]
+}
+```
+
+Processors may make named code blocks such as `0.js` and `1.js`. ESLint handles such a named code block as a child file of the original file. You can specify additional configurations for named code blocks in the `overrides` section of the config. For example, the following disables the `strict` rule for the named code blocks which end with `.js` in markdown files.
+
+```json
+{
+    "plugins": ["a-plugin"],
+    "overrides": [
+        {
+            "files": ["*.md"],
+            "processor": "a-plugin/markdown"
+        },
+        {
+            "files": ["**/*.md/*.js"],
+            "rules": {
+                "strict": "off"
+            }
+        }
+    ]
+}
+```
+
+ESLint checks the file path of named code blocks then ignores those if any `overrides` entry didn't match the file path. Be sure to add an `overrides` entry if you want to lint named code blocks other than `*.js`.
+
+## Configuring Plugins
+
+ESLint supports the use of third-party plugins. Before using the plugin, you have to install it using npm.
+
+To configure plugins inside of a configuration file, use the `plugins` key, which contains a list of plugin names. The `eslint-plugin-` prefix can be omitted from the plugin name.
+
+```json
+{
+    "plugins": [
+        "plugin1",
+        "eslint-plugin-plugin2"
+    ]
+}
+```
+
+And in YAML:
+
+```yaml
+---
+  plugins:
+    - plugin1
+    - eslint-plugin-plugin2
+```
+
+**Notes:**
+
+1. Plugins are resolved relative to the config file. In other words, ESLint will load the plugin as a user would obtain by running `require('eslint-plugin-pluginname')` in the config file.
+2. Plugins in the base configuration (loaded by `extends` setting) are relative to the derived config file. For example, if `./.eslintrc` has `extends: ["foo"]` and the `eslint-config-foo` has `plugins: ["bar"]`, ESLint finds the `eslint-plugin-bar` from `./node_modules/` (rather than `./node_modules/eslint-config-foo/node_modules/`) or ancestor directories. Thus every plugin in the config file and base configurations is resolved uniquely.
+
+### Naming convention
+
+#### Include a plugin
+
+The `eslint-plugin-` prefix can be omitted for non-scoped packages
+
+```js
+{
+    // ...
+    "plugins": [
+        "jquery", // means eslint-plugin-jquery
+    ]
+    // ...
+}
+```
+
+The same rule does apply to scoped packages:
+
+```js
+{
+    // ...
+    "plugins": [
+        "@jquery/jquery", // means @jquery/eslint-plugin-jquery
+        "@foobar" // means @foobar/eslint-plugin
+    ]
+    // ...
+}
+```
+
+#### Use a plugin
+
+When using rules, environments or configs defined by plugins, they must be referenced following the convention:
+
+* `eslint-plugin-foo` → `foo/a-rule`
+* `@foo/eslint-plugin` → `@foo/a-config`
+* `@foo/eslint-plugin-bar` → `@foo/bar/a-environment`
+
+For example:
+
+```js
+{
+    // ...
+    "plugins": [
+        "jquery",   // eslint-plugin-jquery
+        "@foo/foo", // @foo/eslint-plugin-foo
+        "@bar"      // @bar/eslint-plugin
+    ],
+    "extends": [
+        "plugin:@foo/foo/recommended",
+        "plugin:@bar/recommended"
+    ],
+    "rules": {
+        "jquery/a-rule": "error",
+        "@foo/foo/some-rule": "error",
+        "@bar/another-rule": "error"
+    },
+    "env": {
+        "jquery/jquery": true,
+        "@foo/foo/env-foo": true,
+        "@bar/env-bar": true,
+    }
+    // ...
+}
+```
diff --git a/eslint/docs/src/user-guide/configuring/rules.md b/eslint/docs/src/user-guide/configuring/rules.md
new file mode 100644 (file)
index 0000000..e504a53
--- /dev/null
@@ -0,0 +1,292 @@
+---
+title: Rules
+layout: doc
+eleventyNavigation:
+    key: configuring rules
+    parent: configuring
+    title: Configuring Rules
+    order: 3
+
+---
+
+## Configuring Rules
+
+ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values:
+
+* `"off"` or `0` - turn the rule off
+* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
+* `"error"` or `2` - turn the rule on as an error (exit code is 1 when triggered)
+
+### Using configuration comments
+
+To configure rules inside of a file using configuration comments, use a comment in the following format:
+
+```js
+/* eslint eqeqeq: "off", curly: "error" */
+```
+
+In this example, [`eqeqeq`](../../rules/eqeqeq) is turned off and [`curly`](../../rules/curly) is turned on as an error. You can also use the numeric equivalent for the rule severity:
+
+```js
+/* eslint eqeqeq: 0, curly: 2 */
+```
+
+This example is the same as the last example, only it uses the numeric codes instead of the string values. The `eqeqeq` rule is off and the `curly` rule is set to be an error.
+
+If a rule has additional options, you can specify them using array literal syntax, such as:
+
+```js
+/* eslint quotes: ["error", "double"], curly: 2 */
+```
+
+This comment specifies the "double" option for the [`quotes`](../../rules/quotes) rule. The first item in the array is always the rule severity (number or string).
+
+Configuration comments can include descriptions to explain why the comment is necessary. The description must occur after the configuration and is separated from the configuration by two or more consecutive `-` characters. For example:
+
+```js
+/* eslint eqeqeq: "off", curly: "error" -- Here's a description about why this configuration is necessary. */
+```
+
+```js
+/* eslint eqeqeq: "off", curly: "error"
+    --------
+    Here's a description about why this configuration is necessary. */
+```
+
+```js
+/* eslint eqeqeq: "off", curly: "error"
+ * --------
+ * This will not work due to the line above starting with a '*' character.
+ */
+```
+
+### Using configuration files
+
+To configure rules inside of a configuration file, use the `rules` key along with an error level and any options you want to use. For example:
+
+```json
+{
+    "rules": {
+        "eqeqeq": "off",
+        "curly": "error",
+        "quotes": ["error", "double"]
+    }
+}
+```
+
+And in YAML:
+
+```yaml
+---
+rules:
+  eqeqeq: off
+  curly: error
+  quotes:
+    - error
+    - double
+```
+
+To configure a rule which is defined within a plugin you have to prefix the rule ID with the plugin name and a `/`. For example:
+
+```json
+{
+    "plugins": [
+        "plugin1"
+    ],
+    "rules": {
+        "eqeqeq": "off",
+        "curly": "error",
+        "quotes": ["error", "double"],
+        "plugin1/rule1": "error"
+    }
+}
+```
+
+And in YAML:
+
+```yaml
+---
+plugins:
+  - plugin1
+rules:
+  eqeqeq: 0
+  curly: error
+  quotes:
+    - error
+    - "double"
+  plugin1/rule1: error
+```
+
+In these configuration files, the rule `plugin1/rule1` comes from the plugin named `plugin1`. You can also use this format with configuration comments, such as:
+
+```js
+/* eslint "plugin1/rule1": "error" */
+```
+
+**Note:** When specifying rules from plugins, make sure to omit `eslint-plugin-`. ESLint uses only the unprefixed name internally to locate rules.
+
+## Disabling Rules
+
+### Using configuration comments
+
+To temporarily disable rule warnings in your file, use block comments in the following format:
+
+```js
+/* eslint-disable */
+
+alert('foo');
+
+/* eslint-enable */
+```
+
+You can also disable or enable warnings for specific rules:
+
+```js
+/* eslint-disable no-alert, no-console */
+
+alert('foo');
+console.log('bar');
+
+/* eslint-enable no-alert, no-console */
+```
+
+**Note:** `/* eslint-enable */` without any specific rules listed will cause all disabled rules to be re-enabled.
+
+To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file:
+
+```js
+/* eslint-disable */
+
+alert('foo');
+```
+
+You can also disable or enable specific rules for an entire file:
+
+```js
+/* eslint-disable no-alert */
+
+alert('foo');
+```
+
+To ensure that a rule is never applied (regardless of any future enable/disable lines):
+
+```js
+/* eslint no-alert: "off" */
+
+alert('foo');
+```
+
+To disable all rules on a specific line, use a line or block comment in one of the following formats:
+
+```js
+alert('foo'); // eslint-disable-line
+
+// eslint-disable-next-line
+alert('foo');
+
+/* eslint-disable-next-line */
+alert('foo');
+
+alert('foo'); /* eslint-disable-line */
+```
+
+To disable a specific rule on a specific line:
+
+```js
+alert('foo'); // eslint-disable-line no-alert
+
+// eslint-disable-next-line no-alert
+alert('foo');
+
+alert('foo'); /* eslint-disable-line no-alert */
+
+/* eslint-disable-next-line no-alert */
+alert('foo');
+```
+
+To disable multiple rules on a specific line:
+
+```js
+alert('foo'); // eslint-disable-line no-alert, quotes, semi
+
+// eslint-disable-next-line no-alert, quotes, semi
+alert('foo');
+
+alert('foo'); /* eslint-disable-line no-alert, quotes, semi */
+
+/* eslint-disable-next-line no-alert, quotes, semi */
+alert('foo');
+
+/* eslint-disable-next-line
+  no-alert,
+  quotes,
+  semi
+*/
+alert('foo');
+```
+
+All of the above methods also work for plugin rules. For example, to disable `eslint-plugin-example`'s `rule-name` rule, combine the plugin's name (`example`) and the rule's name (`rule-name`) into `example/rule-name`:
+
+```js
+foo(); // eslint-disable-line example/rule-name
+foo(); /* eslint-disable-line example/rule-name */
+```
+
+Configuration comments can include descriptions to explain why the comment is necessary. The description must come after the configuration and needs to be separated from the configuration by two or more consecutive `-` characters. For example:
+
+```js
+// eslint-disable-next-line no-console -- Here's a description about why this configuration is necessary.
+console.log('hello');
+
+/* eslint-disable-next-line no-console --
+ * Here's a very long description about why this configuration is necessary
+ * along with some additional information
+**/
+console.log('hello');
+```
+
+**Note:** Comments that disable warnings for a portion of a file tell ESLint not to report rule violations for the disabled code. ESLint still parses the entire file, however, so disabled code still needs to be syntactically valid JavaScript.
+
+### Using configuration files
+
+To disable rules inside of a configuration file for a group of files, use the `overrides` key along with a `files` key. For example:
+
+```json
+{
+  "rules": {...},
+  "overrides": [
+    {
+      "files": ["*-test.js","*.spec.js"],
+      "rules": {
+        "no-unused-expressions": "off"
+      }
+    }
+  ]
+}
+```
+
+### Disabling Inline Comments
+
+To disable all inline config comments, use the `noInlineConfig` setting. For example:
+
+```json
+{
+  "rules": {...},
+  "noInlineConfig": true
+}
+```
+
+This setting is similar to [--no-inline-config](../command-line-interface#--no-inline-config) CLI option.
+
+#### Report unused `eslint-disable` comments
+
+To report unused `eslint-disable` comments, use the `reportUnusedDisableDirectives` setting. For example:
+
+```json
+{
+  "rules": {...},
+  "reportUnusedDisableDirectives": true
+}
+```
+
+This setting is similar to [--report-unused-disable-directives](../command-line-interface#--report-unused-disable-directives) CLI option, but doesn't fail linting (reports as `"warn"` severity).
diff --git a/eslint/docs/src/user-guide/formatters/html-formatter-example.html b/eslint/docs/src/user-guide/formatters/html-formatter-example.html
new file mode 100644 (file)
index 0000000..9efd6e1
--- /dev/null
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="UTF-8">
+        <title>ESLint Report</title>
+        <link rel="icon" type="image/png" sizes="any" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAHaAAAB2gGFomX7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABD1JREFUWMPFl11sk2UUx3/nbYtjxS1MF7MLMTECMgSTtSSyrQkLhAj7UBPnDSEGoxegGzMwojhXVpmTAA5iYpSoMQa8GBhFOrMFk03buei6yRAlcmOM0SEmU9d90b19jxcM1o5+sGnsc/e+z/l6ztf/HFFVMnns6QieeOCHBePGsHM+wrOtvLG2C4WRVDSSygNV7sCjlspxwDnPB44aols/DXk+mbMBmx/6OseITF1CuOtfevkPh2Uu+/jbdX8lujSScRlT5r7/QDlAfsRmfzmpnkQ/H3H13gf6bBrBn1uqK8WylgEnU8eZmk1repbfchJG1TyKyIKEwuBHFd3lD3naY3O1siiwXsVoBV2VgM1ht/QQUJk2ByqKghsQziYQ8ifKgexIXmuyzC4r67Y7R+xPAfuB/Nn3Cpva+0s7khpQVtZtd4bt51BWxtBYAiciprG7c7D4SixzU9PYalDL6110Ifb/w8W9eY7JqFeFHbO8fPGyLHwwFHJNJTSgwtVTB9oaw9BlQ+tO93vOxypoaQnfEYlI43SeCHDC4TDq9+51/h5fxr33q0ZfV9g04wat9Q943rjJgCp3952W2i8Bi6eDvdsfKj0cK/DYMRyXL4/sUJUmIHd2zYMezsvLaamp4WpcWN3BXSiHpuMwbGbZlnZ8tXY4rgosy+G7oRwQ0cAsd28YGgqfU5UjCZQDLALxDg+Hv/P5Rqvj4hwrS8izXzWb4spwc1GgENFnkpWRzxeuB+ssUHgLdb9UVdt8vpGdKQpze7n7y1U3DBChNRUuqOo9c+0+qpKKxyZqtAIYla7gY4JszAAQri93BSsMRZoyBcUC+w3Q3AyOA4sNhAOZ0q7Iq0b2vUNvK5zPgP+/H8+Zetdoa6uOikhdGurxebwvJY8Iz3V1rTMNAH+opEuQj5KTT/qA1yC+wyUjBm12OidaUtCcPNNX2h0Hx2JG69VulANZAJZJwfU7rzd/FHixuXniTdM0m4GtSQT7bTartqEh9yfImUEzkwKZmTwmo5a5JwkYBfcDL01/RkR5y8iWhtPBknB8ZxwtU9UjwOrrKCeizzc25nTGg1F/turEHoU9wMLpDvWKf8DTmNCAKnd/tqUTF4ElMXJ+A5rWDJS+41WsGWzALhJ+ErBWrLj9g+pqojHxlXJX8HGUg0BsR/x1yhxf3jm4cSzpQFLp6tmi6PEE7g1ZhtZ91ufpSZUAFa6gC+UoQslNaSmypT1U8mHKiUgEKS8KfgF4EpYunFI16tsHin+OG0LcgQK7yj7g6cSzpva2D3hKVNG0Y3mVO1BkqfSlmJrHBQ4uvM12gJHc6ETW8HZVfMRmXvyxxNC1Z/o839zyXlDuCr4nsC11J+MXueaVJWn6yPv+/pJtc9oLTNN4AeTvNGByd3rlhE2x9s5pLwDoHCy+grDzWmOZ95lUtLYj5Bma126Y8eX0/zj/ADxGyViSg4BXAAAAAElFTkSuQmCC">
+        <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMjk0LjgyNSAyNTguOTgyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPg0KPHBhdGggZmlsbD0nIzgwODBGMicgZD0nTTk3LjAyMSw5OS4wMTZsNDguNDMyLTI3Ljk2MmMxLjIxMi0wLjcsMi43MDYtMC43LDMuOTE4LDBsNDguNDMzLDI3Ljk2MiBjMS4yMTEsMC43LDEuOTU5LDEuOTkzLDEuOTU5LDMuMzkzdjU1LjkyNGMwLDEuMzk5LTAuNzQ4LDIuNjkzLTEuOTU5LDMuMzk0bC00OC40MzMsMjcuOTYyYy0xLjIxMiwwLjctMi43MDYsMC43LTMuOTE4LDAgbC00OC40MzItMjcuOTYyYy0xLjIxMi0wLjctMS45NTktMS45OTQtMS45NTktMy4zOTR2LTU1LjkyNEM5NS4wNjMsMTAxLjAwOSw5NS44MSw5OS43MTYsOTcuMDIxLDk5LjAxNicvPg0KPHBhdGggZmlsbD0nIzRCMzJDMycgZD0nTTI3My4zMzYsMTI0LjQ4OEwyMTUuNDY5LDIzLjgxNmMtMi4xMDItMy42NC01Ljk4NS02LjMyNS0xMC4xODgtNi4zMjVIODkuNTQ1IGMtNC4yMDQsMC04LjA4OCwyLjY4NS0xMC4xOSw2LjMyNWwtNTcuODY3LDEwMC40NWMtMi4xMDIsMy42NDEtMi4xMDIsOC4yMzYsMCwxMS44NzdsNTcuODY3LDk5Ljg0NyBjMi4xMDIsMy42NCw1Ljk4Niw1LjUwMSwxMC4xOSw1LjUwMWgxMTUuNzM1YzQuMjAzLDAsOC4wODctMS44MDUsMTAuMTg4LTUuNDQ2bDU3Ljg2Ny0xMDAuMDEgQzI3NS40MzksMTMyLjM5NiwyNzUuNDM5LDEyOC4xMjgsMjczLjMzNiwxMjQuNDg4IE0yMjUuNDE5LDE3Mi44OThjMCwxLjQ4LTAuODkxLDIuODQ5LTIuMTc0LDMuNTlsLTczLjcxLDQyLjUyNyBjLTEuMjgyLDAuNzQtMi44ODgsMC43NC00LjE3LDBsLTczLjc2Ny00Mi41MjdjLTEuMjgyLTAuNzQxLTIuMTc5LTIuMTA5LTIuMTc5LTMuNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
+        <style>
+            body {
+                font-family:Arial, "Helvetica Neue", Helvetica, sans-serif;
+                font-size:16px;
+                font-weight:normal;
+                margin:0;
+                padding:0;
+                color:#333
+            }
+            #overview {
+                padding:20px 30px
+            }
+            td, th {
+                padding:5px 10px
+            }
+            h1 {
+                margin:0
+            }
+            table {
+                margin:30px;
+                width:calc(100% - 60px);
+                max-width:1000px;
+                border-radius:5px;
+                border:1px solid #ddd;
+                border-spacing:0px;
+            }
+            th {
+                font-weight:400;
+                font-size:medium;
+                text-align:left;
+                cursor:pointer
+            }
+            td.clr-1, td.clr-2, th span {
+                font-weight:700
+            }
+            th span {
+                float:right;
+                margin-left:20px
+            }
+            th span:after {
+                content:"";
+                clear:both;
+                display:block
+            }
+            tr:last-child td {
+                border-bottom:none
+            }
+            tr td:first-child, tr td:last-child {
+                color:#9da0a4
+            }
+            #overview.bg-0, tr.bg-0 th {
+                color:#468847;
+                background:#dff0d8;
+                border-bottom:1px solid #d6e9c6
+            }
+            #overview.bg-1, tr.bg-1 th {
+                color:#f0ad4e;
+                background:#fcf8e3;
+                border-bottom:1px solid #fbeed5
+            }
+            #overview.bg-2, tr.bg-2 th {
+                color:#b94a48;
+                background:#f2dede;
+                border-bottom:1px solid #eed3d7
+            }
+            td {
+                border-bottom:1px solid #ddd
+            }
+            td.clr-1 {
+                color:#f0ad4e
+            }
+            td.clr-2 {
+                color:#b94a48
+            }
+            td a {
+                color:#3a33d1;
+                text-decoration:none
+            }
+            td a:hover {
+                color:#272296;
+                text-decoration:underline
+            }
+        </style>
+    </head>
+    <body>
+        <div id="overview" class="bg-2">
+            <h1>ESLint Report</h1>
+            <div>
+                <span>9 problems (5 errors, 4 warnings)</span> - Generated on Mon Sep 12 2022 01:24:39 GMT-0400 (Eastern Daylight Time)
+            </div>
+        </div>
+        <table>
+            <tbody>
+                <tr class="bg-2" data-group="f-0">
+    <th colspan="4">
+        [+] /var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js
+        <span>9 problems (5 errors, 4 warnings)</span>
+    </th>
+</tr>
+<tr style="display:none" class="f-0">
+    <td>1:10</td>
+    <td class="clr-2">Error</td>
+    <td>&#39;addOne&#39; is defined but never used.</td>
+    <td>
+        <a href="" target="_blank" rel="noopener noreferrer">no-unused-vars</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>2:9</td>
+    <td class="clr-2">Error</td>
+    <td>Use the isNaN function to compare with NaN.</td>
+    <td>
+        <a href="" target="_blank" rel="noopener noreferrer">use-isnan</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>3:16</td>
+    <td class="clr-2">Error</td>
+    <td>Unexpected space before unary operator &#39;++&#39;.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/space-unary-ops" target="_blank" rel="noopener noreferrer">space-unary-ops</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>3:20</td>
+    <td class="clr-1">Warning</td>
+    <td>Missing semicolon.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/semi" target="_blank" rel="noopener noreferrer">semi</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>4:12</td>
+    <td class="clr-1">Warning</td>
+    <td>Unnecessary &#39;else&#39; after &#39;return&#39;.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/no-else-return" target="_blank" rel="noopener noreferrer">no-else-return</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>5:1</td>
+    <td class="clr-1">Warning</td>
+    <td>Expected indentation of 8 spaces but found 6.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/indent" target="_blank" rel="noopener noreferrer">indent</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>5:7</td>
+    <td class="clr-2">Error</td>
+    <td>Function &#39;addOne&#39; expected a return value.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/consistent-return" target="_blank" rel="noopener noreferrer">consistent-return</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>5:13</td>
+    <td class="clr-1">Warning</td>
+    <td>Missing semicolon.</td>
+    <td>
+        <a href="https://eslint.org/docs/rules/semi" target="_blank" rel="noopener noreferrer">semi</a>
+    </td>
+</tr>
+
+<tr style="display:none" class="f-0">
+    <td>7:2</td>
+    <td class="clr-2">Error</td>
+    <td>Unnecessary semicolon.</td>
+    <td>
+        <a href="" target="_blank" rel="noopener noreferrer">no-extra-semi</a>
+    </td>
+</tr>
+
+            </tbody>
+        </table>
+        <script type="text/javascript">
+            var groups = document.querySelectorAll("tr[data-group]");
+            for (i = 0; i < groups.length; i++) {
+                groups[i].addEventListener("click", function() {
+                    var inGroup = document.getElementsByClassName(this.getAttribute("data-group"));
+                    this.innerHTML = (this.innerHTML.indexOf("+") > -1) ? this.innerHTML.replace("+", "-") : this.innerHTML.replace("-", "+");
+                    for (var j = 0; j < inGroup.length; j++) {
+                        inGroup[j].style.display = (inGroup[j].style.display !== "none") ? "none" : "table-row";
+                    }
+                });
+            }
+        </script>
+    </body>
+</html>
diff --git a/eslint/docs/src/user-guide/formatters/index.md b/eslint/docs/src/user-guide/formatters/index.md
new file mode 100644 (file)
index 0000000..074b04a
--- /dev/null
@@ -0,0 +1,243 @@
+---
+title: Formatters
+layout: doc
+eleventyNavigation:
+    key: formatters
+    parent: user guide
+    title: Formatters
+    order: 5
+edit_link: https://github.com/eslint/eslint/edit/main/templates/formatter-examples.md.ejs
+---
+
+ESLint comes with several built-in formatters to control the appearance of the linting results, and supports third-party formatters as well.
+
+You can specify a formatter using the `--format` or `-f` flag on the command line. For example, `--format json` uses the `json` formatter.
+
+The built-in formatter options are:
+
+* [checkstyle](#checkstyle)
+* [compact](#compact)
+* [html](#html)
+* [jslint-xml](#jslint-xml)
+* [json-with-metadata](#json-with-metadata)
+* [json](#json)
+* [junit](#junit)
+* [stylish](#stylish)
+* [tap](#tap)
+* [unix](#unix)
+* [visualstudio](#visualstudio)
+
+## Example Source
+
+Examples of each formatter were created from linting `fullOfProblems.js` using the `.eslintrc` configuration shown below.
+
+### `fullOfProblems.js`
+
+```js
+function addOne(i) {
+    if (i != NaN) {
+        return i ++
+    } else {
+      return
+    }
+};
+```
+
+### `.eslintrc`:
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "consistent-return": 2,
+        "indent"           : [1, 4],
+        "no-else-return"   : 1,
+        "semi"             : [1, "always"],
+        "space-unary-ops"  : 2
+    }
+}
+```
+
+## Output Examples
+
+### checkstyle
+
+```text
+&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&lt;checkstyle version=&#34;4.3&#34;&gt;&lt;file name=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js&#34;&gt;&lt;error line=&#34;1&#34; column=&#34;10&#34; severity=&#34;error&#34; message=&#34;&amp;apos;addOne&amp;apos; is defined but never used. (no-unused-vars)&#34; source=&#34;eslint.rules.no-unused-vars&#34; /&gt;&lt;error line=&#34;2&#34; column=&#34;9&#34; severity=&#34;error&#34; message=&#34;Use the isNaN function to compare with NaN. (use-isnan)&#34; source=&#34;eslint.rules.use-isnan&#34; /&gt;&lt;error line=&#34;3&#34; column=&#34;16&#34; severity=&#34;error&#34; message=&#34;Unexpected space before unary operator &amp;apos;++&amp;apos;. (space-unary-ops)&#34; source=&#34;eslint.rules.space-unary-ops&#34; /&gt;&lt;error line=&#34;3&#34; column=&#34;20&#34; severity=&#34;warning&#34; message=&#34;Missing semicolon. (semi)&#34; source=&#34;eslint.rules.semi&#34; /&gt;&lt;error line=&#34;4&#34; column=&#34;12&#34; severity=&#34;warning&#34; message=&#34;Unnecessary &amp;apos;else&amp;apos; after &amp;apos;return&amp;apos;. (no-else-return)&#34; source=&#34;eslint.rules.no-else-return&#34; /&gt;&lt;error line=&#34;5&#34; column=&#34;1&#34; severity=&#34;warning&#34; message=&#34;Expected indentation of 8 spaces but found 6. (indent)&#34; source=&#34;eslint.rules.indent&#34; /&gt;&lt;error line=&#34;5&#34; column=&#34;7&#34; severity=&#34;error&#34; message=&#34;Function &amp;apos;addOne&amp;apos; expected a return value. (consistent-return)&#34; source=&#34;eslint.rules.consistent-return&#34; /&gt;&lt;error line=&#34;5&#34; column=&#34;13&#34; severity=&#34;warning&#34; message=&#34;Missing semicolon. (semi)&#34; source=&#34;eslint.rules.semi&#34; /&gt;&lt;error line=&#34;7&#34; column=&#34;2&#34; severity=&#34;error&#34; message=&#34;Unnecessary semicolon. (no-extra-semi)&#34; source=&#34;eslint.rules.no-extra-semi&#34; /&gt;&lt;/file&gt;&lt;/checkstyle&gt;
+```
+
+### compact
+
+```text
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 1, col 10, Error - &#39;addOne&#39; is defined but never used. (no-unused-vars)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 3, col 16, Error - Unexpected space before unary operator &#39;++&#39;. (space-unary-ops)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 3, col 20, Warning - Missing semicolon. (semi)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 4, col 12, Warning - Unnecessary &#39;else&#39; after &#39;return&#39;. (no-else-return)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 7, Error - Function &#39;addOne&#39; expected a return value. (consistent-return)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 5, col 13, Warning - Missing semicolon. (semi)
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js: line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi)
+
+9 problems
+```
+
+### html
+
+<iframe src="html-formatter-example.html" width="100%" height="460px"></iframe>
+
+### jslint-xml
+
+```text
+&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&lt;jslint&gt;&lt;file name=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js&#34;&gt;&lt;issue line=&#34;1&#34; char=&#34;10&#34; evidence=&#34;&#34; reason=&#34;&amp;apos;addOne&amp;apos; is defined but never used. (no-unused-vars)&#34; /&gt;&lt;issue line=&#34;2&#34; char=&#34;9&#34; evidence=&#34;&#34; reason=&#34;Use the isNaN function to compare with NaN. (use-isnan)&#34; /&gt;&lt;issue line=&#34;3&#34; char=&#34;16&#34; evidence=&#34;&#34; reason=&#34;Unexpected space before unary operator &amp;apos;++&amp;apos;. (space-unary-ops)&#34; /&gt;&lt;issue line=&#34;3&#34; char=&#34;20&#34; evidence=&#34;&#34; reason=&#34;Missing semicolon. (semi)&#34; /&gt;&lt;issue line=&#34;4&#34; char=&#34;12&#34; evidence=&#34;&#34; reason=&#34;Unnecessary &amp;apos;else&amp;apos; after &amp;apos;return&amp;apos;. (no-else-return)&#34; /&gt;&lt;issue line=&#34;5&#34; char=&#34;1&#34; evidence=&#34;&#34; reason=&#34;Expected indentation of 8 spaces but found 6. (indent)&#34; /&gt;&lt;issue line=&#34;5&#34; char=&#34;7&#34; evidence=&#34;&#34; reason=&#34;Function &amp;apos;addOne&amp;apos; expected a return value. (consistent-return)&#34; /&gt;&lt;issue line=&#34;5&#34; char=&#34;13&#34; evidence=&#34;&#34; reason=&#34;Missing semicolon. (semi)&#34; /&gt;&lt;issue line=&#34;7&#34; char=&#34;2&#34; evidence=&#34;&#34; reason=&#34;Unnecessary semicolon. (no-extra-semi)&#34; /&gt;&lt;/file&gt;&lt;/jslint&gt;
+```
+
+### json-with-metadata
+
+```text
+{&#34;results&#34;:[{&#34;filePath&#34;:&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js&#34;,&#34;messages&#34;:[{&#34;ruleId&#34;:&#34;no-unused-vars&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;&#39;addOne&#39; is defined but never used.&#34;,&#34;line&#34;:1,&#34;column&#34;:10,&#34;nodeType&#34;:&#34;Identifier&#34;,&#34;messageId&#34;:&#34;unusedVar&#34;,&#34;endLine&#34;:1,&#34;endColumn&#34;:16},{&#34;ruleId&#34;:&#34;use-isnan&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Use the isNaN function to compare with NaN.&#34;,&#34;line&#34;:2,&#34;column&#34;:9,&#34;nodeType&#34;:&#34;BinaryExpression&#34;,&#34;messageId&#34;:&#34;comparisonWithNaN&#34;,&#34;endLine&#34;:2,&#34;endColumn&#34;:17},{&#34;ruleId&#34;:&#34;space-unary-ops&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Unexpected space before unary operator &#39;++&#39;.&#34;,&#34;line&#34;:3,&#34;column&#34;:16,&#34;nodeType&#34;:&#34;UpdateExpression&#34;,&#34;messageId&#34;:&#34;unexpectedBefore&#34;,&#34;endLine&#34;:3,&#34;endColumn&#34;:20,&#34;fix&#34;:{&#34;range&#34;:[57,58],&#34;text&#34;:&#34;&#34;}},{&#34;ruleId&#34;:&#34;semi&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Missing semicolon.&#34;,&#34;line&#34;:3,&#34;column&#34;:20,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingSemi&#34;,&#34;endLine&#34;:4,&#34;endColumn&#34;:1,&#34;fix&#34;:{&#34;range&#34;:[60,60],&#34;text&#34;:&#34;;&#34;}},{&#34;ruleId&#34;:&#34;no-else-return&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Unnecessary &#39;else&#39; after &#39;return&#39;.&#34;,&#34;line&#34;:4,&#34;column&#34;:12,&#34;nodeType&#34;:&#34;BlockStatement&#34;,&#34;messageId&#34;:&#34;unexpected&#34;,&#34;endLine&#34;:6,&#34;endColumn&#34;:6,&#34;fix&#34;:{&#34;range&#34;:[0,94],&#34;text&#34;:&#34;function addOne(i) {\n    if (i != NaN) {\n        return i ++\n    } \n      return\n    \n}&#34;}},{&#34;ruleId&#34;:&#34;indent&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Expected indentation of 8 spaces but found 6.&#34;,&#34;line&#34;:5,&#34;column&#34;:1,&#34;nodeType&#34;:&#34;Keyword&#34;,&#34;messageId&#34;:&#34;wrongIndentation&#34;,&#34;endLine&#34;:5,&#34;endColumn&#34;:7,&#34;fix&#34;:{&#34;range&#34;:[74,80],&#34;text&#34;:&#34;        &#34;}},{&#34;ruleId&#34;:&#34;consistent-return&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Function &#39;addOne&#39; expected a return value.&#34;,&#34;line&#34;:5,&#34;column&#34;:7,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingReturnValue&#34;,&#34;endLine&#34;:5,&#34;endColumn&#34;:13},{&#34;ruleId&#34;:&#34;semi&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Missing semicolon.&#34;,&#34;line&#34;:5,&#34;column&#34;:13,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingSemi&#34;,&#34;endLine&#34;:6,&#34;endColumn&#34;:1,&#34;fix&#34;:{&#34;range&#34;:[86,86],&#34;text&#34;:&#34;;&#34;}},{&#34;ruleId&#34;:&#34;no-extra-semi&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Unnecessary semicolon.&#34;,&#34;line&#34;:7,&#34;column&#34;:2,&#34;nodeType&#34;:&#34;EmptyStatement&#34;,&#34;messageId&#34;:&#34;unexpected&#34;,&#34;endLine&#34;:7,&#34;endColumn&#34;:3,&#34;fix&#34;:{&#34;range&#34;:[93,95],&#34;text&#34;:&#34;}&#34;}}],&#34;suppressedMessages&#34;:[],&#34;errorCount&#34;:5,&#34;fatalErrorCount&#34;:0,&#34;warningCount&#34;:4,&#34;fixableErrorCount&#34;:2,&#34;fixableWarningCount&#34;:4,&#34;source&#34;:&#34;function addOne(i) {\n    if (i != NaN) {\n        return i ++\n    } else {\n      return\n    }\n};&#34;}],&#34;metadata&#34;:{&#34;rulesMeta&#34;:{&#34;no-else-return&#34;:{&#34;type&#34;:&#34;suggestion&#34;,&#34;docs&#34;:{&#34;description&#34;:&#34;Disallow `else` blocks after `return` statements in `if` statements&#34;,&#34;recommended&#34;:false,&#34;url&#34;:&#34;https://eslint.org/docs/rules/no-else-return&#34;},&#34;schema&#34;:[{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;allowElseIf&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:true}},&#34;additionalProperties&#34;:false}],&#34;fixable&#34;:&#34;code&#34;,&#34;messages&#34;:{&#34;unexpected&#34;:&#34;Unnecessary &#39;else&#39; after &#39;return&#39;.&#34;}},&#34;indent&#34;:{&#34;type&#34;:&#34;layout&#34;,&#34;docs&#34;:{&#34;description&#34;:&#34;Enforce consistent indentation&#34;,&#34;recommended&#34;:false,&#34;url&#34;:&#34;https://eslint.org/docs/rules/indent&#34;},&#34;fixable&#34;:&#34;whitespace&#34;,&#34;schema&#34;:[{&#34;oneOf&#34;:[{&#34;enum&#34;:[&#34;tab&#34;]},{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0}]},{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;SwitchCase&#34;:{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0,&#34;default&#34;:0},&#34;VariableDeclarator&#34;:{&#34;oneOf&#34;:[{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;var&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;let&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;const&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]}},&#34;additionalProperties&#34;:false}]},&#34;outerIIFEBody&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;off&#34;]}]},&#34;MemberExpression&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;off&#34;]}]},&#34;FunctionDeclaration&#34;:{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;parameters&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;body&#34;:{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0}},&#34;additionalProperties&#34;:false},&#34;FunctionExpression&#34;:{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;parameters&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;body&#34;:{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0}},&#34;additionalProperties&#34;:false},&#34;StaticBlock&#34;:{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;body&#34;:{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0}},&#34;additionalProperties&#34;:false},&#34;CallExpression&#34;:{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;arguments&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]}},&#34;additionalProperties&#34;:false},&#34;ArrayExpression&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;ObjectExpression&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;ImportDeclaration&#34;:{&#34;oneOf&#34;:[{&#34;type&#34;:&#34;integer&#34;,&#34;minimum&#34;:0},{&#34;enum&#34;:[&#34;first&#34;,&#34;off&#34;]}]},&#34;flatTernaryExpressions&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:false},&#34;offsetTernaryExpressions&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:false},&#34;ignoredNodes&#34;:{&#34;type&#34;:&#34;array&#34;,&#34;items&#34;:{&#34;type&#34;:&#34;string&#34;,&#34;not&#34;:{&#34;pattern&#34;:&#34;:exit$&#34;}}},&#34;ignoreComments&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:false}},&#34;additionalProperties&#34;:false}],&#34;messages&#34;:{&#34;wrongIndentation&#34;:&#34;Expected indentation of {{expected}} but found {{actual}}.&#34;}},&#34;space-unary-ops&#34;:{&#34;type&#34;:&#34;layout&#34;,&#34;docs&#34;:{&#34;description&#34;:&#34;Enforce consistent spacing before or after unary operators&#34;,&#34;recommended&#34;:false,&#34;url&#34;:&#34;https://eslint.org/docs/rules/space-unary-ops&#34;},&#34;fixable&#34;:&#34;whitespace&#34;,&#34;schema&#34;:[{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;words&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:true},&#34;nonwords&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:false},&#34;overrides&#34;:{&#34;type&#34;:&#34;object&#34;,&#34;additionalProperties&#34;:{&#34;type&#34;:&#34;boolean&#34;}}},&#34;additionalProperties&#34;:false}],&#34;messages&#34;:{&#34;unexpectedBefore&#34;:&#34;Unexpected space before unary operator &#39;{{operator}}&#39;.&#34;,&#34;unexpectedAfter&#34;:&#34;Unexpected space after unary operator &#39;{{operator}}&#39;.&#34;,&#34;unexpectedAfterWord&#34;:&#34;Unexpected space after unary word operator &#39;{{word}}&#39;.&#34;,&#34;wordOperator&#34;:&#34;Unary word operator &#39;{{word}}&#39; must be followed by whitespace.&#34;,&#34;operator&#34;:&#34;Unary operator &#39;{{operator}}&#39; must be followed by whitespace.&#34;,&#34;beforeUnaryExpressions&#34;:&#34;Space is required before unary expressions &#39;{{token}}&#39;.&#34;}},&#34;semi&#34;:{&#34;type&#34;:&#34;layout&#34;,&#34;docs&#34;:{&#34;description&#34;:&#34;Require or disallow semicolons instead of ASI&#34;,&#34;recommended&#34;:false,&#34;url&#34;:&#34;https://eslint.org/docs/rules/semi&#34;},&#34;fixable&#34;:&#34;code&#34;,&#34;schema&#34;:{&#34;anyOf&#34;:[{&#34;type&#34;:&#34;array&#34;,&#34;items&#34;:[{&#34;enum&#34;:[&#34;never&#34;]},{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;beforeStatementContinuationChars&#34;:{&#34;enum&#34;:[&#34;always&#34;,&#34;any&#34;,&#34;never&#34;]}},&#34;additionalProperties&#34;:false}],&#34;minItems&#34;:0,&#34;maxItems&#34;:2},{&#34;type&#34;:&#34;array&#34;,&#34;items&#34;:[{&#34;enum&#34;:[&#34;always&#34;]},{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;omitLastInOneLineBlock&#34;:{&#34;type&#34;:&#34;boolean&#34;}},&#34;additionalProperties&#34;:false}],&#34;minItems&#34;:0,&#34;maxItems&#34;:2}]},&#34;messages&#34;:{&#34;missingSemi&#34;:&#34;Missing semicolon.&#34;,&#34;extraSemi&#34;:&#34;Extra semicolon.&#34;}},&#34;consistent-return&#34;:{&#34;type&#34;:&#34;suggestion&#34;,&#34;docs&#34;:{&#34;description&#34;:&#34;Require `return` statements to either always or never specify values&#34;,&#34;recommended&#34;:false,&#34;url&#34;:&#34;https://eslint.org/docs/rules/consistent-return&#34;},&#34;schema&#34;:[{&#34;type&#34;:&#34;object&#34;,&#34;properties&#34;:{&#34;treatUndefinedAsUnspecified&#34;:{&#34;type&#34;:&#34;boolean&#34;,&#34;default&#34;:false}},&#34;additionalProperties&#34;:false}],&#34;messages&#34;:{&#34;missingReturn&#34;:&#34;Expected to return a value at the end of {{name}}.&#34;,&#34;missingReturnValue&#34;:&#34;{{name}} expected a return value.&#34;,&#34;unexpectedReturnValue&#34;:&#34;{{name}} expected no return value.&#34;}}}}}
+```
+
+### json
+
+```text
+[{&#34;filePath&#34;:&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js&#34;,&#34;messages&#34;:[{&#34;ruleId&#34;:&#34;no-unused-vars&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;&#39;addOne&#39; is defined but never used.&#34;,&#34;line&#34;:1,&#34;column&#34;:10,&#34;nodeType&#34;:&#34;Identifier&#34;,&#34;messageId&#34;:&#34;unusedVar&#34;,&#34;endLine&#34;:1,&#34;endColumn&#34;:16},{&#34;ruleId&#34;:&#34;use-isnan&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Use the isNaN function to compare with NaN.&#34;,&#34;line&#34;:2,&#34;column&#34;:9,&#34;nodeType&#34;:&#34;BinaryExpression&#34;,&#34;messageId&#34;:&#34;comparisonWithNaN&#34;,&#34;endLine&#34;:2,&#34;endColumn&#34;:17},{&#34;ruleId&#34;:&#34;space-unary-ops&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Unexpected space before unary operator &#39;++&#39;.&#34;,&#34;line&#34;:3,&#34;column&#34;:16,&#34;nodeType&#34;:&#34;UpdateExpression&#34;,&#34;messageId&#34;:&#34;unexpectedBefore&#34;,&#34;endLine&#34;:3,&#34;endColumn&#34;:20,&#34;fix&#34;:{&#34;range&#34;:[57,58],&#34;text&#34;:&#34;&#34;}},{&#34;ruleId&#34;:&#34;semi&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Missing semicolon.&#34;,&#34;line&#34;:3,&#34;column&#34;:20,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingSemi&#34;,&#34;endLine&#34;:4,&#34;endColumn&#34;:1,&#34;fix&#34;:{&#34;range&#34;:[60,60],&#34;text&#34;:&#34;;&#34;}},{&#34;ruleId&#34;:&#34;no-else-return&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Unnecessary &#39;else&#39; after &#39;return&#39;.&#34;,&#34;line&#34;:4,&#34;column&#34;:12,&#34;nodeType&#34;:&#34;BlockStatement&#34;,&#34;messageId&#34;:&#34;unexpected&#34;,&#34;endLine&#34;:6,&#34;endColumn&#34;:6,&#34;fix&#34;:{&#34;range&#34;:[0,94],&#34;text&#34;:&#34;function addOne(i) {\n    if (i != NaN) {\n        return i ++\n    } \n      return\n    \n}&#34;}},{&#34;ruleId&#34;:&#34;indent&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Expected indentation of 8 spaces but found 6.&#34;,&#34;line&#34;:5,&#34;column&#34;:1,&#34;nodeType&#34;:&#34;Keyword&#34;,&#34;messageId&#34;:&#34;wrongIndentation&#34;,&#34;endLine&#34;:5,&#34;endColumn&#34;:7,&#34;fix&#34;:{&#34;range&#34;:[74,80],&#34;text&#34;:&#34;        &#34;}},{&#34;ruleId&#34;:&#34;consistent-return&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Function &#39;addOne&#39; expected a return value.&#34;,&#34;line&#34;:5,&#34;column&#34;:7,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingReturnValue&#34;,&#34;endLine&#34;:5,&#34;endColumn&#34;:13},{&#34;ruleId&#34;:&#34;semi&#34;,&#34;severity&#34;:1,&#34;message&#34;:&#34;Missing semicolon.&#34;,&#34;line&#34;:5,&#34;column&#34;:13,&#34;nodeType&#34;:&#34;ReturnStatement&#34;,&#34;messageId&#34;:&#34;missingSemi&#34;,&#34;endLine&#34;:6,&#34;endColumn&#34;:1,&#34;fix&#34;:{&#34;range&#34;:[86,86],&#34;text&#34;:&#34;;&#34;}},{&#34;ruleId&#34;:&#34;no-extra-semi&#34;,&#34;severity&#34;:2,&#34;message&#34;:&#34;Unnecessary semicolon.&#34;,&#34;line&#34;:7,&#34;column&#34;:2,&#34;nodeType&#34;:&#34;EmptyStatement&#34;,&#34;messageId&#34;:&#34;unexpected&#34;,&#34;endLine&#34;:7,&#34;endColumn&#34;:3,&#34;fix&#34;:{&#34;range&#34;:[93,95],&#34;text&#34;:&#34;}&#34;}}],&#34;suppressedMessages&#34;:[],&#34;errorCount&#34;:5,&#34;fatalErrorCount&#34;:0,&#34;warningCount&#34;:4,&#34;fixableErrorCount&#34;:2,&#34;fixableWarningCount&#34;:4,&#34;source&#34;:&#34;function addOne(i) {\n    if (i != NaN) {\n        return i ++\n    } else {\n      return\n    }\n};&#34;}]
+```
+
+### junit
+
+```text
+&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;
+&lt;testsuites&gt;
+&lt;testsuite package=&#34;org.eslint&#34; time=&#34;0&#34; tests=&#34;9&#34; errors=&#34;9&#34; name=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js&#34;&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.no-unused-vars&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;&amp;apos;addOne&amp;apos; is defined but never used.&#34;&gt;&lt;![CDATA[line 1, col 10, Error - &amp;apos;addOne&amp;apos; is defined but never used. (no-unused-vars)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.use-isnan&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Use the isNaN function to compare with NaN.&#34;&gt;&lt;![CDATA[line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.space-unary-ops&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Unexpected space before unary operator &amp;apos;++&amp;apos;.&#34;&gt;&lt;![CDATA[line 3, col 16, Error - Unexpected space before unary operator &amp;apos;++&amp;apos;. (space-unary-ops)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.semi&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Missing semicolon.&#34;&gt;&lt;![CDATA[line 3, col 20, Warning - Missing semicolon. (semi)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.no-else-return&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Unnecessary &amp;apos;else&amp;apos; after &amp;apos;return&amp;apos;.&#34;&gt;&lt;![CDATA[line 4, col 12, Warning - Unnecessary &amp;apos;else&amp;apos; after &amp;apos;return&amp;apos;. (no-else-return)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.indent&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Expected indentation of 8 spaces but found 6.&#34;&gt;&lt;![CDATA[line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.consistent-return&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Function &amp;apos;addOne&amp;apos; expected a return value.&#34;&gt;&lt;![CDATA[line 5, col 7, Error - Function &amp;apos;addOne&amp;apos; expected a return value. (consistent-return)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.semi&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Missing semicolon.&#34;&gt;&lt;![CDATA[line 5, col 13, Warning - Missing semicolon. (semi)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;testcase time=&#34;0&#34; name=&#34;org.eslint.no-extra-semi&#34; classname=&#34;/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems&#34;&gt;&lt;failure message=&#34;Unnecessary semicolon.&#34;&gt;&lt;![CDATA[line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi)]]&gt;&lt;/failure&gt;&lt;/testcase&gt;
+&lt;/testsuite&gt;
+&lt;/testsuites&gt;
+
+```
+
+### stylish
+
+```text
+
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js
+  1:10  error    &#39;addOne&#39; is defined but never used            no-unused-vars
+  2:9   error    Use the isNaN function to compare with NaN    use-isnan
+  3:16  error    Unexpected space before unary operator &#39;++&#39;   space-unary-ops
+  3:20  warning  Missing semicolon                             semi
+  4:12  warning  Unnecessary &#39;else&#39; after &#39;return&#39;             no-else-return
+  5:1   warning  Expected indentation of 8 spaces but found 6  indent
+  5:7   error    Function &#39;addOne&#39; expected a return value     consistent-return
+  5:13  warning  Missing semicolon                             semi
+  7:2   error    Unnecessary semicolon                         no-extra-semi
+
+✖ 9 problems (5 errors, 4 warnings)
+  2 errors and 4 warnings potentially fixable with the `--fix` option.
+
+```
+
+### tap
+
+```text
+TAP version 13
+1..1
+not ok 1 - /var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js
+  ---
+  message: &#39;&#39;&#39;addOne&#39;&#39; is defined but never used.&#39;
+  severity: error
+  data:
+    line: 1
+    column: 10
+    ruleId: no-unused-vars
+  messages:
+    - message: Use the isNaN function to compare with NaN.
+      severity: error
+      data:
+        line: 2
+        column: 9
+        ruleId: use-isnan
+    - message: Unexpected space before unary operator &#39;++&#39;.
+      severity: error
+      data:
+        line: 3
+        column: 16
+        ruleId: space-unary-ops
+    - message: Missing semicolon.
+      severity: warning
+      data:
+        line: 3
+        column: 20
+        ruleId: semi
+    - message: Unnecessary &#39;else&#39; after &#39;return&#39;.
+      severity: warning
+      data:
+        line: 4
+        column: 12
+        ruleId: no-else-return
+    - message: Expected indentation of 8 spaces but found 6.
+      severity: warning
+      data:
+        line: 5
+        column: 1
+        ruleId: indent
+    - message: Function &#39;addOne&#39; expected a return value.
+      severity: error
+      data:
+        line: 5
+        column: 7
+        ruleId: consistent-return
+    - message: Missing semicolon.
+      severity: warning
+      data:
+        line: 5
+        column: 13
+        ruleId: semi
+    - message: Unnecessary semicolon.
+      severity: error
+      data:
+        line: 7
+        column: 2
+        ruleId: no-extra-semi
+  ...
+
+```
+
+### unix
+
+```text
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:1:10: &#39;addOne&#39; is defined but never used. [Error/no-unused-vars]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:2:9: Use the isNaN function to compare with NaN. [Error/use-isnan]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:3:16: Unexpected space before unary operator &#39;++&#39;. [Error/space-unary-ops]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:3:20: Missing semicolon. [Warning/semi]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:4:12: Unnecessary &#39;else&#39; after &#39;return&#39;. [Warning/no-else-return]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:1: Expected indentation of 8 spaces but found 6. [Warning/indent]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:7: Function &#39;addOne&#39; expected a return value. [Error/consistent-return]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:5:13: Missing semicolon. [Warning/semi]
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js:7:2: Unnecessary semicolon. [Error/no-extra-semi]
+
+9 problems
+```
+
+### visualstudio
+
+```text
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(1,10): error no-unused-vars : &#39;addOne&#39; is defined but never used.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(2,9): error use-isnan : Use the isNaN function to compare with NaN.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(3,16): error space-unary-ops : Unexpected space before unary operator &#39;++&#39;.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(3,20): warning semi : Missing semicolon.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(4,12): warning no-else-return : Unnecessary &#39;else&#39; after &#39;return&#39;.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,1): warning indent : Expected indentation of 8 spaces but found 6.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,7): error consistent-return : Function &#39;addOne&#39; expected a return value.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(5,13): warning semi : Missing semicolon.
+/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js(7,2): error no-extra-semi : Unnecessary semicolon.
+
+9 problems
+```
diff --git a/eslint/docs/src/user-guide/getting-started.md b/eslint/docs/src/user-guide/getting-started.md
new file mode 100644 (file)
index 0000000..675e94f
--- /dev/null
@@ -0,0 +1,83 @@
+---
+title: Getting Started with ESLint
+layout: doc
+eleventyNavigation:
+    key: getting started 
+    parent: user guide
+    title: Getting Started
+    order: 1
+
+---
+
+ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs. In many ways, it is similar to JSLint and JSHint with a few exceptions:
+
+* ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing.
+* ESLint uses an AST to evaluate patterns in code.
+* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
+
+## Installation and Usage
+
+Prerequisites: [Node.js](https://nodejs.org/en/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
+
+You can install and configure ESLint using this command:
+
+```shell
+npm init @eslint/config
+```
+
+**Note:** `npm init @eslint/config` assumes you have a `package.json` file already. If you don't, make sure to run `npm init` or `yarn init` beforehand.
+
+After that, you can run ESLint on any file or directory like this:
+
+```shell
+npx eslint yourfile.js
+
+# or
+
+yarn run eslint yourfile.js
+```
+
+It is also possible to install ESLint globally rather than locally (using `npm install eslint --global`). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case.
+
+## Configuration
+
+**Note:** If you are coming from a version before 1.0.0 please see the [migration guide](migrating-to-1.0.0).
+
+After running `npm init @eslint/config`, you'll have a `.eslintrc.{js,yml,json}` file in your directory. In it, you'll see some rules configured like this:
+
+```json
+{
+    "rules": {
+        "semi": ["error", "always"],
+        "quotes": ["error", "double"]
+    }
+}
+```
+
+The names `"semi"` and `"quotes"` are the names of [rules](/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:
+
+* `"off"` or `0` - turn the rule off
+* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
+* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
+
+The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](configuring/)).
+
+Your `.eslintrc.{js,yml,json}` configuration file will also include the line:
+
+```json
+{
+    "extends": "eslint:recommended"
+}
+```
+
+Because of this line, all of the rules marked "(recommended)" on the [rules page](/docs/rules) will be turned on.  Alternatively, you can use configurations that others have created by searching for "eslint-config" on [npmjs.com](https://www.npmjs.com/search?q=eslint-config).  ESLint will not lint your code unless you extend from a shared configuration or explicitly turn rules on in your configuration.
+
+---
+
+## Next Steps
+
+* Learn about [advanced configuration](configuring/) of ESLint.
+* Get familiar with the [command line options](command-line-interface).
+* Explore [ESLint integrations](integrations) into other tools like editors, build systems, and more.
+* Can't find just the right rule?  Make your own [custom rule](/docs/developer-guide/working-with-rules).
+* Make ESLint even better by [contributing](/docs/developer-guide/contributing/).
diff --git a/eslint/docs/src/user-guide/index.md b/eslint/docs/src/user-guide/index.md
new file mode 100644 (file)
index 0000000..3b26ee5
--- /dev/null
@@ -0,0 +1,47 @@
+---
+title: User Guide
+layout: doc
+eleventyNavigation:
+    key: user guide
+    title: User Guide
+    order: 1
+---
+
+This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../developer-guide/).
+
+## [Getting Started](getting-started)
+
+Want to skip ahead and just start using ESLint? This section gives a high-level overview of installation, setup, and configuration options.
+
+## [Rules](../rules/)
+
+ESLint has a lot of rules that you can configure to fine-tune it to your project. This section is an exhaustive list of every rule and link to each rule's documentation.
+
+## [Configuring](configuring/)
+
+Once you've got ESLint running, you'll probably want to adjust the configuration to better suit your project. This section explains all the different ways you can configure ESLint.
+
+## [Command Line Interface](command-line-interface)
+
+There are a lot of command line flags for ESLint and this section explains what they do.
+
+## [Integrations](integrations)
+
+Wondering if ESLint will work with your favorite editor or build system? This section has a list of all known integrations (submitted by their authors).
+
+## [Rule Deprecation](rule-deprecation)
+
+The ESLint team is committed to making upgrading as easy and painless as possible. This section outlines the guidelines the team has set in place for the deprecation of rules in future releases.
+
+## Migrating
+
+If you were using a prior version of ESLint, you can get help with the transition by reading:
+
+* [migrating-to-1.0.0](migrating-to-1.0.0)
+* [migrating-to-2.0.0](migrating-to-2.0.0)
+* [migrating-to-3.0.0](migrating-to-3.0.0)
+* [migrating-to-4.0.0](migrating-to-4.0.0)
+* [migrating-to-5.0.0](migrating-to-5.0.0)
+* [migrating-to-6.0.0](migrating-to-6.0.0)
+* [migrating-to-7.0.0](migrating-to-7.0.0)
+* [migrating-to-8.0.0](migrating-to-8.0.0)
diff --git a/eslint/docs/src/user-guide/integrations.md b/eslint/docs/src/user-guide/integrations.md
new file mode 100644 (file)
index 0000000..5d73484
--- /dev/null
@@ -0,0 +1,75 @@
+---
+title: Integrations
+layout: doc
+eleventyNavigation:
+    key: integrations
+    parent: user guide
+    title: Integrations
+    order: 6
+
+---
+
+## Editors
+
+* Sublime Text 3:
+    * [SublimeLinter-eslint](https://github.com/roadhump/SublimeLinter-eslint)
+    * [Build Next](https://github.com/albertosantini/sublimetext-buildnext)
+* Vim:
+    * [ALE](https://github.com/w0rp/ale)
+    * [Syntastic](https://github.com/vim-syntastic/syntastic/tree/master/syntax_checkers/javascript)
+* Emacs: [Flycheck](http://www.flycheck.org/) supports ESLint with the [javascript-eslint](http://www.flycheck.org/en/latest/languages.html#javascript) checker.
+* Eclipse Orion: ESLint is the [default linter](https://dev.eclipse.org/mhonarc/lists/orion-dev/msg02718.html)
+* Eclipse IDE: [Tern ESLint linter](https://github.com/angelozerr/tern.java/wiki/Tern-Linter-ESLint)
+* TextMate 2:
+    * [eslint.tmbundle](https://github.com/ryanfitzer/eslint.tmbundle)
+    * [javascript-eslint.tmbundle](https://github.com/natesilva/javascript-eslint.tmbundle)
+* Atom:
+    * [linter-eslint](https://atom.io/packages/linter-eslint)
+    * [fast-eslint-8](https://atom.io/packages/fast-eslint-8)
+* IntelliJ IDEA, WebStorm, PhpStorm, PyCharm, RubyMine, and other JetBrains IDEs: [How to use ESLint](https://www.jetbrains.com/help/webstorm/eslint.html)
+* Visual Studio Code: [ESLint Extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
+* Brackets: Included and [Brackets ESLint](https://github.com/brackets-userland/brackets-eslint)
+
+## Build tools
+
+* Grunt: [grunt-eslint](https://www.npmjs.com/package/grunt-eslint)
+* Gulp: [gulp-eslint](https://www.npmjs.com/package/gulp-eslint)
+* Mimosa: [mimosa-eslint](https://www.npmjs.com/package/mimosa-eslint)
+* Broccoli: [broccoli-eslint](https://www.npmjs.com/package/broccoli-eslint)
+* Browserify: [eslintify](https://www.npmjs.com/package/eslintify)
+* Webpack: [eslint-webpack-plugin](https://www.npmjs.com/package/eslint-webpack-plugin)
+* Rollup: [@rollup/plugin-eslint](https://www.npmjs.com/package/@rollup/plugin-eslint)
+* Ember-cli: [ember-cli-eslint](https://www.npmjs.com/package/ember-cli-eslint)
+* Sails.js: [sails-hook-lint](https://www.npmjs.com/package/sails-hook-lint), [sails-eslint](https://www.npmjs.com/package/sails-eslint)
+* Start: [@start/plugin-lib-eslint](https://www.npmjs.com/package/@start/plugin-lib-eslint)
+* Brunch: [eslint-brunch](https://www.npmjs.com/package/eslint-brunch)
+
+## Command Line Tools
+
+* [ESLint Watch](https://www.npmjs.com/package/eslint-watch)
+* [Code Climate CLI](https://github.com/codeclimate/codeclimate)
+* [ESLint Nibble](https://github.com/IanVS/eslint-nibble)
+
+## Source Control
+
+* [Git Precommit Hook](https://coderwall.com/p/zq8jlq/eslint-pre-commit-hook)
+* [Git pre-commit hook that only lints staged changes](https://gist.github.com/dahjelle/8ddedf0aebd488208a9a7c829f19b9e8)
+* [overcommit Git hook manager](https://github.com/brigade/overcommit)
+* [Mega-Linter](https://nvuillam.github.io/mega-linter): Linters aggregator for CI, [embedding eslint](https://nvuillam.github.io/mega-linter/descriptors/javascript_eslint/)
+
+## Testing
+
+* Mocha.js: [mocha-eslint](https://www.npmjs.com/package/mocha-eslint)
+
+## External ESLint rules
+
+* [AngularJS](https://github.com/Gillespie59/eslint-plugin-angular)
+* [BackboneJS](https://github.com/ilyavolodin/eslint-plugin-backbone)
+* [Jasmine](https://github.com/tlvince/eslint-plugin-jasmine)
+* [React](https://github.com/yannickcr/eslint-plugin-react)
+
+… and many more published on npm with the [eslintplugin](https://www.npmjs.com/browse/keyword/eslintplugin) keyword.
+
+## Other Integration Lists
+
+You can find a curated list of other popular integrations for ESLint in the [awesome-eslint](https://github.com/dustinspecker/awesome-eslint) GitHub repository.
diff --git a/eslint/docs/src/user-guide/migrating-from-jscs.md b/eslint/docs/src/user-guide/migrating-from-jscs.md
new file mode 100644 (file)
index 0000000..bcb0761
--- /dev/null
@@ -0,0 +1,173 @@
+---
+title: Migrating from JSCS
+layout: doc
+
+---
+
+In April 2016, we [announced](https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) that the JSCS project was shutting down and the JSCS team would be joining the ESLint team. This guide is intended to help those who are using JSCS to migrate their settings and projects to use ESLint. We've tried to automate as much of the conversion as possible, but there are some manual changes that are needed.
+
+## Terminology
+
+Before beginning the process of migrating to ESLint, it's helpful to understand some of the terminology that ESLint uses and how it relates to terminology that JSCS uses.
+
+* **Configuration File** - In JSCS, the configuration file is `.jscsrc`, `.jscsrc.json`, `.jscsrc.yaml`, or `.jscsrs.js`. In ESLint, the configuration file can be `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc.js` (there is also a deprecated `.eslintrc` file format).
+* **Presets** - In JSCS, there were numerous predefined configurations shipped directly within JSCS. ESLint ships with just one predefined configuration (`eslint:recommended`) that has no style rules enabled. However, ESLint does support [shareable configs](https://eslint.org/docs/developer-guide/shareable-configs). Shareable configs are configurations that are published on their own to npm and there are shareable configs available for almost all of the JSCS presets (see [the "Converting Presets" section](#converting-presets) below). Additionally, the `preset` option in a configuration file is the equivalent of the ESLint `extends` option.
+
+## Convert Configuration Files Using Polyjuice
+
+[Polyjuice](https://github.com/brenolf/polyjuice) is a utility for converting JSCS (and JSHint) configuration files into ESLint configuration files automatically. It understands the equivalent rules from each utility and will automatically output an ESLint configuration file that is a good approximation of your existing JSCS file.
+
+To install Polyjuice:
+
+```shell
+npm install -g polyjuice
+```
+
+Polyjuice works with JSON configuration files, so if you're using a JavaScript or YAML JSCS configuration file, you should first convert it into a JSON configuration file.
+
+To convert your configuration file, pass in the location of your `.jscs.json` file using the `--jscs` flag:
+
+```shell
+polyjuice --jscs .jscsrc.json > .eslintrc.json
+```
+
+This creates a `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.
+
+If you have multiple `.jscsrc.json` files, you can pass them all and Polyjuice will combine them into one `.eslintrc.json` file:
+
+```shell
+polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
+```
+
+**Note:** Polyjuice does a good job of creating a reasonable ESLint configuration from your JSCS configuration, but it may not be 100%. You may still see different warnings than you saw with JSCS, and so you may need to further modify your configuration after using Polyjuice. This is especially true if you're using inline comments to enable/disable certain rules in JSCS (you'll need to manually convert those to use ESLint-style comments instead, [see "Disabling Rules Inline"](#disabling-rules-inline) later in this page).
+
+### Creating a New Configuration From Scratch
+
+If you don't want to convert your JSCS configuration directly into an ESLint configuration, then you can use ESLint's built-in wizard to get you started. Just run:
+
+```shell
+npm init @eslint/config
+```
+
+You'll be guided through a series of questions that will help you setup a basic configuration file to get you started.
+
+## Converting Presets
+
+There are shareable configs available for most JSCS presets. The equivalent shareable configs for each JSCS preset are listed in the following table:
+
+| **JSCS Preset** | **ESLint Shareable Config** |
+|-----------------|-----------------------------|
+| `airbnb`        | [`eslint-config-airbnb-base`](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) |
+| `crockford`        | (not available) |
+| `google`        | [`eslint-config-google`](https://github.com/google/eslint-config-google) |
+| `grunt`        | [`eslint-config-grunt`](https://github.com/markelog/eslint-config-grunt) |
+| `idiomatic`        | [`eslint-config-idiomatic`](https://github.com/jamespamplin/eslint-config-idiomatic) |
+| `jquery`        | [`eslint-config-jquery`](https://github.com/jquery/eslint-config-jquery) |
+| `mdcs`        | [`eslint-config-mdcs`](https://github.com/zz85/mrdoobapproves) |
+| `node-style-guide`        | [`eslint-config-node-style-guide`](https://github.com/pdehaan/eslint-config-node-style-guide) |
+| `wikimedia`        | [`eslint-config-wikimedia`](https://github.com/wikimedia/eslint-config-wikimedia) |
+| `wordpress`        | [`eslint-config-wordpress`](https://github.com/WordPress-Coding-Standards/eslint-config-wordpress) |
+
+As an example, suppose that you are using the `airbnb` preset, so your `.jscsrc` file looks like this:
+
+```json
+{
+    "preset": "airbnb"
+}
+```
+
+In order to get the same functionality in ESLint, you would first need to install the `eslint-config-airbnb` shareable config package:
+
+```shell
+npm install eslint-config-airbnb-base --save-dev
+```
+
+And then you would modify your configuration file like this:
+
+```json
+{
+    "extends": "airbnb-base"
+}
+```
+
+ESLint sees `"airbnb-base"` and will look for `eslint-config-airbnb-base` (to save you some typing).
+
+## Disabling Rules Inline
+
+Both JSCS and ESLint use comments inside of files to disable rules around certain parts of your code. The following table lists out the JSCS inline configuration comments and their ESLint equivalents.
+
+| **Description** | **JSCS Comment** | **ESLint Comment** |
+|-----------------|------------------|--------------------|
+| Disable all rules | `// jscs:disable` or `/* jscs:disable */` | `/* eslint-disable */` |
+| Enable all rules | `// jscs:enable` or `/* jscs:enable */` | `/* eslint-enable */` |
+| Disable one rule | `// jscs:disable ruleName` or `/* jscs:disable ruleName */` | `/* eslint-disable rule-name */` |
+| Enable one rule | `// jscs:enable ruleName` or `/* jscs:enable ruleName */` | `/* eslint-enable rule-name */` |
+| Disable multiple rules | `// jscs:disable ruleName1, ruleName2` or `/* jscs:disable ruleName1, ruleName2 */` | `/* eslint-disable rule-name1, rule-name2 */` |
+| Enable multiple rules | `// jscs:enable ruleName1, ruleName2` or `/* jscs:enable ruleName1, ruleName2 */` | `/* eslint-enable rule-name1, rule-name2 */` |
+| Disable one rule on single line | `// jscs:ignore ruleName` | `// eslint-disable-line rule-name` |
+
+## Command Line Options
+
+Both JSCS and ESLint have command line arguments corresponding to many of their configuration options. The following are the ESLint equivalents of JSCS command line options.
+
+### `--fix`
+
+JSCS uses the `--fix` option to apply automatic fixes to code:
+
+```shell
+jscs --fix file.js
+```
+
+ESLint has the same option:
+
+```shell
+eslint --fix file.js
+```
+
+### `--auto-configure`
+
+The JSCS `--auto-configure` option created a configuration based on what it found in a given file:
+
+```shell
+jscs --auto-configure file.js
+```
+
+In ESLint, there's a similar option when you use `--init`. Just select "Inspect your JavaScript file(s)":
+
+```shell
+eslint --init
+? How would you like to configure ESLint? (Use arrow keys)
+> Answer questions about your style
+  Use a popular style guide
+  Inspect your JavaScript file(s)
+```
+
+## `--config`, `-c`
+
+JSCS allows you to specify a configuration file to use on the command line using either `--config` or `-c`, such as:
+
+```shell
+jscs --config myconfig.json file.js
+jscs -c myconfig.json file.js
+```
+
+Both flags are also supported by ESLint:
+
+```shell
+eslint --config myconfig.json file.js
+eslint -c myconfig.json file.js
+```
+
+## Piping Code Into ESLint
+
+In JSCS, you can pipe code in like this:
+
+```shell
+cat file.js | jscs
+```
+
+In ESLint, you can also pipe in code, but you need to use the `--stdin` flag:
+
+```shell
+cat file.js | eslint --stdin
+```
diff --git a/eslint/docs/src/user-guide/migrating-to-1.0.0.md b/eslint/docs/src/user-guide/migrating-to-1.0.0.md
new file mode 100644 (file)
index 0000000..70bdb5b
--- /dev/null
@@ -0,0 +1,213 @@
+---
+title: Migrating to v1.0.0
+layout: doc
+
+---
+
+ESLint v1.0.0 is the first major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading.
+
+## All Rules Off by Default
+
+The most important difference in v1.0.0 is that all rules are off by default. We made this change after numerous requests to allow turning off the default rules from within configuration files. While that wasn't technically feasible, it was feasible to have all rules off by default and then re-enable rules in configuration files using `extends`. As such, we've made the `--reset` behavior the default and removed this command line option.
+
+When using `--init`, your configuration file will automatically include the following line:
+
+```json
+{
+    "extends": "eslint:recommended"
+}
+```
+
+This setting mimics some of the default behavior from 0.x, but not all. If you don't want to use any of the recommended rules, you can delete this line.
+
+**To address:** If you are currently using `--reset`, then you should stop passing `--reset` on the command line; no other changes are necessary. If you are not using `--reset`, then you should review your configuration to determine which rules should be on by default. You can partially restore some of the default behavior by adding the following to your configuration file:
+
+The `"eslint:recommended"` configuration contains many of the same default rule settings from 0.x, but not all. These rules are no longer on by default, so you should review your settings to ensure they are still as you expect:
+
+* [no-alert](https://eslint.org/docs/rules/no-alert)
+* [no-array-constructor](https://eslint.org/docs/rules/no-array-constructor)
+* [no-caller](https://eslint.org/docs/rules/no-caller)
+* [no-catch-shadow](https://eslint.org/docs/rules/no-catch-shadow)
+* [no-empty-label](https://eslint.org/docs/rules/no-empty-label)
+* [no-eval](https://eslint.org/docs/rules/no-eval)
+* [no-extend-native](https://eslint.org/docs/rules/no-extend-native)
+* [no-extra-bind](https://eslint.org/docs/rules/no-extra-bind)
+* [no-extra-strict](https://eslint.org/docs/rules/no-extra-strict)
+* [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval)
+* [no-iterator](https://eslint.org/docs/rules/no-iterator)
+* [no-label-var](https://eslint.org/docs/rules/no-label-var)
+* [no-labels](https://eslint.org/docs/rules/no-labels)
+* [no-lone-blocks](https://eslint.org/docs/rules/no-lone-blocks)
+* [no-loop-func](https://eslint.org/docs/rules/no-loop-func)
+* [no-multi-spaces](https://eslint.org/docs/rules/no-multi-spaces)
+* [no-multi-str](https://eslint.org/docs/rules/no-multi-str)
+* [no-native-reassign](https://eslint.org/docs/rules/no-native-reassign)
+* [no-new](https://eslint.org/docs/rules/no-new)
+* [no-new-func](https://eslint.org/docs/rules/no-new-func)
+* [no-new-object](https://eslint.org/docs/rules/no-new-object)
+* [no-new-wrappers](https://eslint.org/docs/rules/no-new-wrappers)
+* [no-octal-escape](https://eslint.org/docs/rules/no-octal-escape)
+* [no-process-exit](https://eslint.org/docs/rules/no-process-exit)
+* [no-proto](https://eslint.org/docs/rules/no-proto)
+* [no-return-assign](https://eslint.org/docs/rules/no-return-assign)
+* [no-script-url](https://eslint.org/docs/rules/no-script-url)
+* [no-sequences](https://eslint.org/docs/rules/no-sequences)
+* [no-shadow](https://eslint.org/docs/rules/no-shadow)
+* [no-shadow-restricted-names](https://eslint.org/docs/rules/no-shadow-restricted-names)
+* [no-spaced-func](https://eslint.org/docs/rules/no-spaced-func)
+* [no-trailing-spaces](https://eslint.org/docs/rules/no-trailing-spaces)
+* [no-undef-init](https://eslint.org/docs/rules/no-undef-init)
+* [no-underscore-dangle](https://eslint.org/docs/rules/no-underscore-dangle)
+* [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions)
+* [no-use-before-define](https://eslint.org/docs/rules/no-use-before-define)
+* [no-with](https://eslint.org/docs/rules/no-with)
+* [no-wrap-func](https://eslint.org/docs/rules/no-wrap-func)
+* [camelcase](https://eslint.org/docs/rules/camelcase)
+* [comma-spacing](https://eslint.org/docs/rules/comma-spacing)
+* [consistent-return](https://eslint.org/docs/rules/consistent-return)
+* [curly](https://eslint.org/docs/rules/curly)
+* [dot-notation](https://eslint.org/docs/rules/dot-notation)
+* [eol-last](https://eslint.org/docs/rules/eol-last)
+* [eqeqeq](https://eslint.org/docs/rules/eqeqeq)
+* [key-spacing](https://eslint.org/docs/rules/key-spacing)
+* [new-cap](https://eslint.org/docs/rules/new-cap)
+* [new-parens](https://eslint.org/docs/rules/new-parens)
+* [quotes](https://eslint.org/docs/rules/quotes)
+* [semi](https://eslint.org/docs/rules/semi)
+* [semi-spacing](https://eslint.org/docs/rules/semi-spacing)
+* [space-infix-ops](https://eslint.org/docs/rules/space-infix-ops)
+* [space-return-throw-case](https://eslint.org/docs/rules/space-return-throw-case)
+* [space-unary-ops](https://eslint.org/docs/rules/space-unary-ops)
+* [strict](https://eslint.org/docs/rules/strict)
+* [yoda](https://eslint.org/docs/rules/yoda)
+
+See also: the [full diff](https://github.com/eslint/eslint/commit/e3e9dbd9876daf4bdeb4e15f8a76a9d5e6e03e39#diff-b01a5cfd9361ca9280a460fd6bb8edbbL1) where the defaults were changed.
+
+Here's a configuration file with the closest equivalent of the old defaults:
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "no-alert": 2,
+        "no-array-constructor": 2,
+        "no-caller": 2,
+        "no-catch-shadow": 2,
+        "no-empty-label": 2,
+        "no-eval": 2,
+        "no-extend-native": 2,
+        "no-extra-bind": 2,
+        "no-implied-eval": 2,
+        "no-iterator": 2,
+        "no-label-var": 2,
+        "no-labels": 2,
+        "no-lone-blocks": 2,
+        "no-loop-func": 2,
+        "no-multi-spaces": 2,
+        "no-multi-str": 2,
+        "no-native-reassign": 2,
+        "no-new": 2,
+        "no-new-func": 2,
+        "no-new-object": 2,
+        "no-new-wrappers": 2,
+        "no-octal-escape": 2,
+        "no-process-exit": 2,
+        "no-proto": 2,
+        "no-return-assign": 2,
+        "no-script-url": 2,
+        "no-sequences": 2,
+        "no-shadow": 2,
+        "no-shadow-restricted-names": 2,
+        "no-spaced-func": 2,
+        "no-trailing-spaces": 2,
+        "no-undef-init": 2,
+        "no-underscore-dangle": 2,
+        "no-unused-expressions": 2,
+        "no-use-before-define": 2,
+        "no-with": 2,
+        "camelcase": 2,
+        "comma-spacing": 2,
+        "consistent-return": 2,
+        "curly": [2, "all"],
+        "dot-notation": [2, { "allowKeywords": true }],
+        "eol-last": 2,
+        "no-extra-parens": [2, "functions"],
+        "eqeqeq": 2,
+        "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+        "new-cap": 2,
+        "new-parens": 2,
+        "quotes": [2, "double"],
+        "semi": 2,
+        "semi-spacing": [2, {"before": false, "after": true}],
+        "space-infix-ops": 2,
+        "space-return-throw-case": 2,
+        "space-unary-ops": [2, { "words": true, "nonwords": false }],
+        "strict": [2, "function"],
+        "yoda": [2, "never"]
+    }
+}
+```
+
+## Removed Rules
+
+Over the past several releases, we have been deprecating rules and introducing new rules to take their place. The following is a list of the removed rules and their replacements:
+
+* [generator-star](https://eslint.org/docs/rules/generator-star) is replaced by [generator-star-spacing](https://eslint.org/docs/rules/generator-star-spacing)
+* [global-strict](https://eslint.org/docs/rules/global-strict) is replaced by [strict](https://eslint.org/docs/rules/strict)
+* [no-comma-dangle](https://eslint.org/docs/rules/no-comma-dangle) is replaced by [comma-dangle](https://eslint.org/docs/rules/comma-dangle)
+* [no-empty-class](https://eslint.org/docs/rules/no-empty-class) is replaced by [no-empty-character-class](https://eslint.org/docs/rules/no-empty-character-class)
+* [no-extra-strict](https://eslint.org/docs/rules/no-extra-strict) is replaced by [strict](https://eslint.org/docs/rules/strict)
+* [no-reserved-keys](https://eslint.org/docs/rules/no-reserved-keys) is replaced by [quote-props](https://eslint.org/docs/rules/quote-props)
+* [no-space-before-semi](https://eslint.org/docs/rules/no-space-before-semi) is replaced by [semi-spacing](https://eslint.org/docs/rules/semi-spacing)
+* [no-wrap-func](https://eslint.org/docs/rules/no-wrap-func) is replaced by [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens)
+* [space-after-function-name](https://eslint.org/docs/rules/space-after-function-name) is replaced by [space-before-function-paren](https://eslint.org/docs/rules/space-before-function-paren)
+* [space-before-function-parentheses](https://eslint.org/docs/rules/space-before-function-parentheses) is replaced by [space-before-function-paren](https://eslint.org/docs/rules/space-before-function-paren)
+* [space-in-brackets](https://eslint.org/docs/rules/space-in-brackets) is replaced by[object-curly-spacing](https://eslint.org/docs/rules/object-curly-spacing) and [array-bracket-spacing](https://eslint.org/docs/rules/array-bracket-spacing)
+* [space-unary-word-ops](https://eslint.org/docs/rules/space-unary-word-ops) is replaced by [space-unary-ops](https://eslint.org/docs/rules/space-unary-ops)
+* [spaced-line-comment](https://eslint.org/docs/rules/spaced-line-comment) is replaced by [spaced-comment](https://eslint.org/docs/rules/spaced-comment)
+
+**To address:** You'll need to update your rule configurations to use the new rules. ESLint v1.0.0 will also warn you when you're using a rule that has been removed and will suggest the replacement rules. Hopefully, this will result in few surprises during the upgrade process.
+
+## Column Numbers are 1-based
+
+From the beginning, ESLint has reported errors using 0-based columns because that's what Esprima, and later Espree, reported. However, most tools and editors use 1-based columns, which made for some tricky integrations with ESLint. In v1.0.0, we've switched over to reporting errors using 1-based columns to fall into line with the tools developers use everyday.
+
+**To address:** If you've created an editor integration, or a tool that had to correct the column number, you'll need to update to just pass through the column number from ESLint. Otherwise, no change is necessary.
+
+## No Longer Exporting cli
+
+In 0.x, the `cli` object was exported for use by external tools. It was later deprecated in favor of `CLIEngine`. In v1.0.0, we are no longer exporting `cli` as it should not be used by external tools. This will break existing tools that make use of it.
+
+**To address:** If you are using the exported `cli` object, switch to using `CLIEngine` instead.
+
+## Deprecating eslint-tester
+
+The `eslint-tester` module, which has long been the primary tester for ESLint rules, has now been moved into the `eslint` module. This was the result of a difficult relationship between these two modules that created circular dependencies and was causing a lot of problems in rule tests. Moving the tester into the `eslint` module fixed a lot of those issues.
+
+The replacement for `eslint-tester` is called `RuleTester`. It's a simplified version of `ESLintTester` that's designed to work with any testing framework. This object is exposed by the package.
+
+**To address:** Convert all of your rule tests to use `RuleTester`. If you have this as a test using `ESLintTester`:
+
+```js
+var eslint = require("../../../lib/eslint"),
+    ESLintTester = require("eslint-tester");
+
+var eslintTester = new ESLintTester(eslint);
+eslintTester.addRuleTest("lib/rules/your-rule", {
+    valid: [],
+    invalid: []
+});
+```
+
+Then you can change to:
+
+```js
+var rule = require("../../../lib/rules/your-rule"),
+    RuleTester = require("eslint").RuleTester;
+
+var ruleTester = new RuleTester();
+ruleTester.run("your-rule", rule, {
+    valid: [],
+    invalid: []
+});
+```
diff --git a/eslint/docs/src/user-guide/migrating-to-2.0.0.md b/eslint/docs/src/user-guide/migrating-to-2.0.0.md
new file mode 100644 (file)
index 0000000..974e89f
--- /dev/null
@@ -0,0 +1,360 @@
+---
+title: Migrating to v2.0.0
+layout: doc
+
+---
+
+ESLint v2.0.0 is the second major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and 1.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading.
+
+**Important:** If you are upgrading from 0.x, please refer to [Migrating to 1.0.0](./migrating-to-1.0.0) as your starting point.
+
+## Rule Schema Changes
+
+Due to a quirk in the way rule schemas worked, it was possible that you'd need to account for the rule severity (0, 1, or 2) in a rule schema if the options were sufficiently complex. That would result in a schema such as:
+
+```js
+module.exports = {
+    "type": "array",
+    "items": [
+        {
+            "enum": [0, 1, 2]
+        },
+        {
+            "enum": ["always", "never"]
+        }
+    ],
+    "minItems": 1,
+    "maxItems": 2
+};
+```
+
+This was confusing to rule developers as it seemed that rules shouldn't be in charge of validating their own severity. In 2.0.0, rules no longer need to check their own severity.
+
+**To address:** If you are exporting a rule schema that checks severity, you need to make several changes:
+
+1. Remove the severity from the schema
+1. Adjust `minItems` from 1 to 0
+1. Adjust `maxItems` by subtracting 1
+
+Here's what the schema from above looks like when properly converted:
+
+```js
+module.exports = {
+    "type": "array",
+    "items": [
+        {
+            "enum": ["always", "never"]
+        }
+    ],
+    "minItems": 0,
+    "maxItems": 1
+};
+```
+
+## Removed Rules
+
+The following rules have been deprecated with new rules created to take their place. The following is a list of the removed rules and their replacements:
+
+* [no-arrow-condition](https://eslint.org/docs/rules/no-arrow-condition) is replaced by a combination of [no-confusing-arrow](https://eslint.org/docs/rules/no-confusing-arrow) and [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition). Turn on both of these rules to get the same functionality as `no-arrow-condition`.
+* [no-empty-label](https://eslint.org/docs/rules/no-empty-label) is replaced by [no-labels](https://eslint.org/docs/rules/no-labels) with `{"allowLoop": true, "allowSwitch": true}` option.
+* [space-after-keywords](https://eslint.org/docs/rules/space-after-keywords) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
+* [space-before-keywords](https://eslint.org/docs/rules/space-before-keywords) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
+* [space-return-throw-case](https://eslint.org/docs/rules/space-return-throw-case) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
+
+**To address:** You'll need to update your rule configurations to use the new rules. ESLint v2.0.0 will also warn you when you're using a rule that has been removed and will suggest the replacement rules. Hopefully, this will result in few surprises during the upgrade process.
+
+## Configuration Cascading Changes
+
+Prior to 2.0.0, if a directory contained both an `.eslintrc` file and a `package.json` file with ESLint configuration information, the settings from the two files would be merged together. In 2.0.0, only the settings from the `.eslintrc.*` file are used and the ones in `package.json` are ignored when both are present. Otherwise, `package.json` can still be used with ESLint configuration, but only if no other `.eslintrc.*` files are present.
+
+**To address:** If you have both an `.eslintrc.*` and `package.json` with ESLint configuration information in the same directory, combine your configurations into just one of those files.
+
+## Built-In Global Variables
+
+Prior to 2.0.0, new global variables that were standardized as part of ES6 such as `Promise`, `Map`, `Set`, and `Symbol` were included in the built-in global environment. This could lead to potential issues when, for example, `no-undef` permitted use of the `Promise` constructor even in ES5 code where promises are unavailable. In 2.0.0, the built-in environment only includes the standard ES5 global variables, and the new ES6 global variables have been moved to the `es6` environment.
+
+**To address:** If you are writing ES6 code, enable the `es6` environment if you have not already done so:
+
+```js
+// In your .eslintrc
+{
+    env: {
+        es6: true
+    }
+}
+
+// Or in a configuration comment
+/*eslint-env es6*/
+```
+
+## Language Options
+
+Prior to 2.0.0, the way to enable language options was by using `ecmaFeatures` in your configuration. In 2.0.0:
+
+* The `ecmaFeatures` property is now under a top-level `parserOptions` property.
+* All ECMAScript 6 `ecmaFeatures` flags have been removed in favor of a `ecmaVersion` property under `parserOptions` that can be set to 3, 5 (default), or 6.
+* The `ecmaFeatures.modules` flag has been replaced by a `sourceType` property under `parserOptions` which can be set to `"script"` (default) or `"module"` for ES6 modules.
+
+**To address:** If you are using any ECMAScript 6 feature flags in `ecmaFeatures`, you'll need to use `ecmaVersion: 6` instead. The ECMAScript 6 feature flags are:
+
+* `arrowFunctions` - enable [arrow functions](https://leanpub.com/understandinges6/read#leanpub-auto-arrow-functions)
+* `binaryLiterals` - enable [binary literals](https://leanpub.com/understandinges6/read#leanpub-auto-octal-and-binary-literals)
+* `blockBindings` - enable `let` and `const` (aka [block bindings](https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings))
+* `classes` - enable classes
+* `defaultParams` - enable [default function parameters](https://leanpub.com/understandinges6/read/#leanpub-auto-default-parameters)
+* `destructuring` - enable [destructuring](https://leanpub.com/understandinges6/read#leanpub-auto-destructuring-assignment)
+* `forOf` - enable [`for-of` loops](https://leanpub.com/understandinges6/read#leanpub-auto-iterables-and-for-of)
+* `generators` - enable [generators](https://leanpub.com/understandinges6/read#leanpub-auto-generators)
+* `modules` - enable modules and global strict mode
+* `objectLiteralComputedProperties` - enable [computed object literal property names](https://leanpub.com/understandinges6/read#leanpub-auto-computed-property-names)
+* `objectLiteralDuplicateProperties` - enable [duplicate object literal properties](https://leanpub.com/understandinges6/read#leanpub-auto-duplicate-object-literal-properties) in strict mode
+* `objectLiteralShorthandMethods` - enable [object literal shorthand methods](https://leanpub.com/understandinges6/read#leanpub-auto-method-initializer-shorthand)
+* `objectLiteralShorthandProperties` - enable [object literal shorthand properties](https://leanpub.com/understandinges6/read#leanpub-auto-property-initializer-shorthand)
+* `octalLiterals` - enable [octal literals](https://leanpub.com/understandinges6/read#leanpub-auto-octal-and-binary-literals)
+* `regexUFlag` - enable the [regular expression `u` flag](https://leanpub.com/understandinges6/read#leanpub-auto-the-regular-expression-u-flag)
+* `regexYFlag` - enable the [regular expression `y` flag](https://leanpub.com/understandinges6/read#leanpub-auto-the-regular-expression-y-flag)
+* `restParams` - enable the [rest parameters](https://leanpub.com/understandinges6/read#leanpub-auto-rest-parameters)
+* `spread` - enable the [spread operator](https://leanpub.com/understandinges6/read#leanpub-auto-the-spread-operator) for arrays
+* `superInFunctions` - enable `super` references inside of functions
+* `templateStrings` - enable [template strings](https://leanpub.com/understandinges6/read/#leanpub-auto-template-strings)
+* `unicodeCodePointEscapes` - enable [code point escapes](https://leanpub.com/understandinges6/read/#leanpub-auto-escaping-non-bmp-characters)
+
+If you're using any of these flags, such as:
+
+```js
+{
+    ecmaFeatures: {
+        arrowFunctions: true
+    }
+}
+```
+
+Then you should enable ES6 using `ecmaVersion`:
+
+```js
+{
+    parserOptions: {
+        ecmaVersion: 6
+    }
+}
+```
+
+If you're using any non-ES6 flags in `ecmaFeatures`, you need to move those inside of `parserOptions`. For instance:
+
+```js
+{
+    ecmaFeatures: {
+        jsx: true
+    }
+}
+```
+
+Then you should move `ecmaFeatures` under `parserOptions`:
+
+```js
+{
+    parserOptions: {
+        ecmaFeatures: {
+            jsx: true
+        }
+    }
+}
+```
+
+If you were using `ecmaFeatures.modules` to enable ES6 module support like this:
+
+```js
+{
+    ecmaFeatures: {
+        modules: true
+    }
+}
+```
+
+```js
+{
+    parserOptions: {
+        sourceType: "module"
+    }
+}
+```
+
+Additionally, if you are using `context.ecmaFeatures` inside of your rules, then you'll need to update your code in the following ways:
+
+1. If you're using an ES6 feature flag such as `context.ecmaFeatures.blockBindings`, rewrite to check for `context.parserOptions.ecmaVersion > 5`.
+1. If you're using `context.ecmaFeatures.modules`, rewrite to check that the `sourceType` property of the Program node is `"module"`.
+1. If you're using a non-ES6 feature flag such as `context.ecmaFeatures.jsx`, rewrite to check for `context.parserOptions.ecmaFeatures.jsx`.
+
+If you have a plugin with rules and you are using RuleTester, then you also need to update the options you pass for rules that use `ecmaFeatures`. For example:
+
+```js
+var ruleTester = new RuleTester();
+ruleTester.run("no-var", rule, {
+    valid: [
+        {
+            code: "let x;",
+            parserOptions: { ecmaVersion: 6 }
+        }
+    ]
+});
+```
+
+If you're not using `ecmaFeatures` in your configuration or your custom/plugin rules and tests, then no change is needed.
+
+## New Rules in `"eslint:recommended"`
+
+```json
+{
+    "extends": "eslint:recommended"
+}
+```
+
+In 2.0.0, the following 11 rules were added to `"eslint:recommended"`.
+
+* [constructor-super](https://eslint.org/docs/rules/constructor-super)
+* [no-case-declarations](https://eslint.org/docs/rules/no-case-declarations)
+* [no-class-assign](https://eslint.org/docs/rules/no-class-assign)
+* [no-const-assign](https://eslint.org/docs/rules/no-const-assign)
+* [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members)
+* [no-empty-pattern](https://eslint.org/docs/rules/no-empty-pattern)
+* [no-new-symbol](https://eslint.org/docs/rules/no-new-symbol)
+* [no-self-assign](https://eslint.org/docs/rules/no-self-assign)
+* [no-this-before-super](https://eslint.org/docs/rules/no-this-before-super)
+* [no-unexpected-multiline](https://eslint.org/docs/rules/no-unexpected-multiline)
+* [no-unused-labels](https://eslint.org/docs/rules/no-unused-labels)
+
+**To address:** If you don't want to be notified by those rules, you can simply disable those rules.
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "no-case-declarations": 0,
+        "no-class-assign": 0,
+        "no-const-assign": 0,
+        "no-dupe-class-members": 0,
+        "no-empty-pattern": 0,
+        "no-new-symbol": 0,
+        "no-self-assign": 0,
+        "no-this-before-super": 0,
+        "no-unexpected-multiline": 0,
+        "no-unused-labels": 0,
+        "constructor-super": 0
+    }
+}
+```
+
+## Scope Analysis Changes
+
+We found some bugs in our scope analysis that needed to be addressed. Specifically, we were not properly accounting for global variables in all the ways they are defined.
+
+Originally, `Variable` objects and `Reference` objects refer each other:
+
+* `Variable#references` property is an array of `Reference` objects which are referencing the variable.
+* `Reference#resolved` property is a `Variable` object which are referenced.
+
+But until 1.x, the following variables and references had the wrong value (empty) in those properties:
+
+* `var` declarations in the global.
+* `function` declarations in the global.
+* Variables defined in config files.
+* Variables defined in `/* global */` comments.
+
+Now, those variables and references have correct values in these properties.
+
+`Scope#through` property has references where `Reference#resolved` is `null`. So as a result of this change, the value of `Scope#through` property was changed also.
+
+**To address:** If you are using `Scope#through` to find references of a built-in global variable, you need to make several changes.
+
+For example, this is how you might locate the `window` global variable in 1.x:
+
+```js
+var globalScope = context.getScope();
+globalScope.through.forEach(function(reference) {
+    if (reference.identifier.name === "window") {
+        checkForWindow(reference);
+    }
+});
+```
+
+This was a roundabout way to find the variable because it was added after the fact by ESLint. The `window` variable was in `Scope#through` because the definition couldn't be found.
+
+In 2.0.0, `window` is no longer located in `Scope#through` because we have added back the correct declaration. That means you can reference the `window` object (or any other global object) directly. So the previous example would change to this:
+
+```js
+var globalScope = context.getScope();
+var variable = globalScope.set.get("window");
+if (variable) {
+    variable.references.forEach(checkForWindow);
+}
+```
+
+Further Reading: <https://estools.github.io/escope/>
+
+## Default Changes When Using `eslint:recommended`
+
+This will affect you if you are extending from `eslint:recommended`, and are enabling [`no-multiple-empty-lines`] or [`func-style`] with only a severity, such as:
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "no-multiple-empty-lines": 2,
+        "func-style": 2
+    }
+}
+```
+
+The rule `no-multiple-empty-lines` has no default exceptions, but in ESLint `1.x`, a default from `eslint:recommended` was applied such that a maximum of two empty lines would be permitted.
+
+The rule `func-style` has a default configuration of `"expression"`, but in ESLint `1.x`, `eslint:recommended` defaulted it to `"declaration"`.
+
+ESLint 2.0.0 removes these conflicting defaults, and so you may begin seeing linting errors related to these rules.
+
+**To address:** If you would like to maintain the previous behavior, update your configuration for `no-multiple-empty-lines` by adding `{"max": 2}`, and change `func-style` to `"declaration"`. For example:
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "no-multiple-empty-lines": [2, {"max": 2}],
+        "func-style": [2, "declaration"]
+    }
+}
+```
+
+[`no-multiple-empty-lines`]: ../rules/no-multiple-empty-lines
+[`func-style`]: ../rules/func-style
+
+## SourceCode constructor (Node API) changes
+
+`SourceCode` constructor got to handle Unicode BOM.
+If the first argument `text` has BOM, `SourceCode` constructor sets `true` to `this.hasBOM` and strips BOM from the text.
+
+```js
+var SourceCode = require("eslint").SourceCode;
+
+var code = new SourceCode("\uFEFFvar foo = bar;", ast);
+
+assert(code.hasBOM === true);
+assert(code.text === "var foo = bar;");
+```
+
+So the second argument `ast` also should be parsed from stripped text.
+
+**To address:** If you are using `SourceCode` constructor in your code, please parse the source code after it stripped BOM:
+
+```js
+var ast = yourParser.parse(text.replace(/^\uFEFF/, ""), options);
+var sourceCode = new SourceCode(text, ast);
+```
+
+## Rule Changes
+
+* [`strict`](../rules/strict) - defaults to `"safe"` (previous default was `"function"`)
+
+## Plugins No Longer Have Default Configurations
+
+Prior to v2.0.0, plugins could specify a `rulesConfig` for the plugin. The `rulesConfig` would automatically be applied whenever someone uses the plugin, which is the opposite of what ESLint does in every other situation (where nothing is on by default). To bring plugins behavior in line, we have removed support for `rulesConfig` in plugins.
+
+**To address:** If you are using a plugin in your configuration file, you will need to manually enable the plugin rules in the configuration file.
diff --git a/eslint/docs/src/user-guide/migrating-to-3.0.0.md b/eslint/docs/src/user-guide/migrating-to-3.0.0.md
new file mode 100644 (file)
index 0000000..ab31a4c
--- /dev/null
@@ -0,0 +1,85 @@
+---
+title: Migrating to v3.0.0
+layout: doc
+
+---
+
+ESLint v3.0.0 is the third major version release. We have made several breaking changes in this release, however, we believe the changes to be small enough that they should not require significant changes for ESLint users. This guide is intended to walk you through the changes.
+
+## Dropping Support for Node.js < 4
+
+With ESLint v3.0.0, we are dropping support for Node.js versions prior to 4. Node.js 0.10 and 0.12 are in [maintenance mode](https://github.com/nodejs/Release) and Node.js 4 is the current LTS version. If you are using an older version of Node.js, we recommend upgrading to at least Node.js 4 as soon as possible. If you are unable to upgrade to Node.js 4 or higher, then we recommend continuing to use ESLint v2.x until you are ready to upgrade Node.js.
+
+**Important:** We will not be updating the ESLint v2.x versions going forward. All bug fixes and enhancements will land in ESLint v3.x.
+
+## Requiring Configuration to Run
+
+ESLint v3.0.0 now requires that you use a configuration to run. A configuration can be any of the following:
+
+1. A `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc` file either in your project or home directory.
+2. Configuration options passed on the command line using `--rule` (or to CLIEngine using `rules`).
+3. A configuration file passed on the command line using `-c` (or to CLIEngine using `configFile`).
+4. A base configuration is provided to CLIEngine using the `baseConfig` option.
+
+If ESLint can't find a configuration, then it will throw an error and ask you to provide one.
+
+This change was made to help new ESLint users who are frequently confused that ESLint does nothing by default besides reporting parser errors. We anticipate this change will have minimal impact on most established users because you're more likely to have configuration files already.
+
+**To Address:** You should be sure to use a configuration whenever you run ESLint. However, you can still run ESLint without a configuration by passing the `--no-eslintrc` option on the command line or setting the `useEslintrc` option to `false` for `CLIEngine`.
+
+To create a new configuration, use `eslint --init`.
+
+## Changes to `"eslint:recommended"`
+
+```json
+{
+    "extends": "eslint:recommended"
+}
+```
+
+In 3.0.0, the following rules were added to `"eslint:recommended"`:
+
+* [`no-unsafe-finally`](https://eslint.org/docs/rules/no-unsafe-finally) helps catch `finally` clauses that may not behave as you think.
+* [`no-native-reassign`](https://eslint.org/docs/rules/no-native-reassign) was previously part of `no-undef`, but was split out because it didn't make sense as part of another rule. The `no-native-reassign` rule warns whenever you try to overwrite a read-only global variable.
+* [`require-yield`](https://eslint.org/docs/rules/require-yield) helps to identify generator functions that do not have the `yield` keyword.
+
+The following rules were removed from `"eslint:recommended"`:
+
+* [`comma-dangle`](https://eslint.org/docs/rules/comma-dangle) used to be recommended because Internet Explorer 8 and earlier threw a syntax error when it found a dangling comma on object literal properties. However, [Internet Explorer 8 was end-of-lifed](https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support) in January 2016 and all other active browsers allow dangling commas. As such, we consider dangling commas to now be a stylistic issue instead of a possible error.
+
+The following rules were modified:
+
+* [`complexity`](https://eslint.org/docs/rules/complexity) used to have a hardcoded default of 11 in `eslint:recommended` that would be used if you turned the rule on without specifying a maximum. The default is now 20. The rule actually always had a default of 20, but `eslint:recommended` was overriding it by mistake.
+
+**To address:** If you want to mimic how `eslint:recommended` worked in v2.x, you can use the following:
+
+```json
+{
+    "extends": "eslint:recommended",
+    "rules": {
+        "no-unsafe-finally": "off",
+        "no-native-reassign": "off",
+        "complexity": ["off", 11],
+        "comma-dangle": "error",
+        "require-yield": "error"
+    }
+}
+```
+
+## Changes to `CLIEngine#executeOnText()`
+
+The `CLIEngine#executeOnText()` method has changed to work more like `CLIEngine#executeOnFiles()`. In v2.x, `CLIEngine#executeOnText()` warned about ignored files by default and didn't have a way to opt-out of those warnings whereas `CLIEngine#executeOnFiles()` did not warn about ignored files by default and allowed you to opt-in to warning about them. The `CLIEngine#executeOnText()` method now also does not warn about ignored files by default and allows you to opt-in with a new, third argument (a boolean, `true` to warn about ignored files and `false` to not warn).
+
+**To address:** If you are currently using `CLIEngine#executeOnText()` in your project like this:
+
+```js
+var result = engine.executeOnText(text, filename);
+```
+
+You can get the equivalent behavior using this:
+
+```js
+var result = engine.executeOnText(text, filename, true);
+```
+
+If you do not want ignored file warnings output to the console, you can omit the third argument or pass `false`.
diff --git a/eslint/docs/src/user-guide/migrating-to-4.0.0.md b/eslint/docs/src/user-guide/migrating-to-4.0.0.md
new file mode 100644 (file)
index 0000000..e96b8ac
--- /dev/null
@@ -0,0 +1,230 @@
+---
+title: Migrating to v4.0.0
+layout: doc
+
+---
+
+ESLint v4.0.0 is the fourth major version release. We have made several breaking changes in this release; however, we expect that most of the changes will only affect a very small percentage of users. This guide is intended to walk you through the changes.
+
+The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
+
+## Breaking changes for users
+
+1. [New rules have been added to `eslint:recommended`](#eslint-recommended-changes)
+1. [The `indent` rule is more strict](#indent-rewrite)
+1. [Unrecognized properties in config files now cause a fatal error](#config-validation)
+1. [.eslintignore patterns are now resolved from the location of the file](#eslintignore-patterns)
+1. [The `padded-blocks` rule is more strict by default](#padded-blocks-defaults)
+1. [The `space-before-function-paren` rule is more strict by default](#space-before-function-paren-defaults)
+1. [The `no-multi-spaces` rule is more strict by default](#no-multi-spaces-eol-comments)
+1. [References to scoped plugins in config files are now required to include the scope](#scoped-plugin-resolution)
+
+## Breaking changes for plugin/custom rule developers
+
+1. [`RuleTester` now validates properties of test cases](#rule-tester-validation)
+1. [AST nodes no longer have comment properties](#comment-attachment)
+1. [`LineComment` and `BlockComment` events will no longer be emitted during AST traversal](#event-comments)
+1. [Shebangs are now returned from comment APIs](#shebangs)
+
+## Breaking changes for integration developers
+
+1. [The `global` property in the `linter.verify()` API is no longer supported](#global-property)
+1. [More report messages now have full location ranges](#report-locations)
+1. [Some exposed APIs are now ES2015 classes](#exposed-es2015-classes)
+
+---
+
+## <a name="eslint-recommended-changes"></a> `eslint:recommended` changes
+
+Two new rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
+
+* [`no-compare-neg-zero`](/docs/rules/no-compare-neg-zero) disallows comparisons to `-0`
+* [`no-useless-escape`](/docs/rules/no-useless-escape) disallows uselessly-escaped characters in strings and regular expressions
+
+**To address:** To mimic the `eslint:recommended` behavior from 3.x, you can disable these rules in a config file:
+
+```json
+{
+  "extends": "eslint:recommended",
+
+  "rules": {
+    "no-compare-neg-zero": "off",
+    "no-useless-escape": "off"
+  }
+}
+```
+
+## <a name="indent-rewrite"></a> The `indent` rule is more strict
+
+Previously, the [`indent`](/docs/rules/indent) rule was fairly lenient about checking indentation; there were many code patterns where indentation was not validated by the rule. This caused confusion for users, because they were accidentally writing code with incorrect indentation, and they expected ESLint to catch the issues.
+
+In 4.0.0, the `indent` rule has been rewritten. The new version of the rule will report some indentation errors that the old version of the rule did not catch. Additionally, the indentation of `MemberExpression` nodes, function parameters, and function arguments will now be checked by default (it was previously ignored by default for backwards compatibility).
+
+To make the upgrade process easier, we've introduced the [`indent-legacy`](/docs/rules/indent-legacy) rule as a snapshot of the `indent` rule from 3.x. If you run into issues from the `indent` rule when you upgrade, you should be able to use the `indent-legacy` rule to replicate the 3.x behavior. However, the `indent-legacy` rule is deprecated and will not receive bugfixes or improvements in the future, so you should eventually switch back to the `indent` rule.
+
+**To address:** We recommend upgrading without changing your `indent` configuration, and fixing any new indentation errors that appear in your codebase. However, if you want to mimic how the `indent` rule worked in 3.x, you can update your configuration:
+
+```js
+{
+  rules: {
+    indent: "off",
+    "indent-legacy": "error" // replace this with your previous `indent` configuration
+  }
+}
+```
+
+## <a name="config-validation"></a> Unrecognized properties in config files now cause a fatal error
+
+When creating a config, users sometimes make typos or misunderstand how the config is supposed to be structured. Previously, ESLint did not validate the properties of a config file, so a typo in a config could be very tedious to debug. Starting in 4.0.0, ESLint will raise an error if a property in a config file is unrecognized or has the wrong type.
+
+**To address:** If you see a config validation error after upgrading, verify that your config doesn't contain any typos. If you are using an unrecognized property, you should be able to remove it from your config to restore the previous behavior.
+
+## <a name="eslintignore-patterns"></a> .eslintignore patterns are now resolved from the location of the file
+
+Due to a bug, glob patterns in an `.eslintignore` file were previously resolved from the current working directory of the process, rather than the location of the `.eslintignore` file. Starting in 4.0, patterns in an `.eslintignore` file will be resolved from the `.eslintignore` file's location.
+
+**To address:** If you use an `.eslintignore` file and you frequently run ESLint from somewhere other than the project root, it's possible that the patterns will be matched differently. You should update the patterns in the `.eslintignore` file to ensure they are relative to the file, not to the working directory.
+
+## <a name="padded-blocks-defaults"></a> The `padded-blocks` rule is more strict by default
+
+By default, the [`padded-blocks`](/docs/rules/padded-blocks) rule will now enforce padding in class bodies and switch statements. Previously, the rule would ignore these cases unless the user opted into enforcing them.
+
+**To address:** If this change results in more linting errors in your codebase, you should fix them or reconfigure the rule.
+
+## <a name="space-before-function-paren-defaults"></a> The `space-before-function-paren` rule is more strict by default
+
+By default, the [`space-before-function-paren`](/docs/rules/space-before-function-paren) rule will now enforce spacing for async arrow functions. Previously, the rule would ignore these cases unless the user opted into enforcing them.
+
+**To address:** To mimic the default config from 3.x, you can use:
+
+```json
+{
+  "rules": {
+    "space-before-function-paren": ["error", {
+      "anonymous": "always",
+      "named": "always",
+      "asyncArrow": "ignore"
+    }]
+  }
+}
+```
+
+## <a name="no-multi-spaces-eol-comments"></a> The `no-multi-spaces` rule is more strict by default
+
+By default, the [`no-multi-spaces`](/docs/rules/no-multi-spaces) rule will now disallow multiple spaces before comments at the end of a line. Previously, the rule did not check this case.
+
+**To address:** To mimic the default config from 3.x, you can use:
+
+```json
+{
+  "rules": {
+    "no-multi-spaces": ["error", {"ignoreEOLComments": true}]
+  }
+}
+```
+
+## <a name="scoped-plugin-resolution"></a> References to scoped plugins in config files are now required to include the scope
+
+In 3.x, there was a bug where references to scoped NPM packages as plugins in config files could omit the scope. For example, in 3.x the following config was legal:
+
+```json
+{
+  "plugins": [
+    "@my-organization/foo"
+  ],
+  "rules": {
+    "foo/some-rule": "error"
+  }
+}
+```
+
+In other words, it was possible to reference a rule from a scoped plugin (such as `foo/some-rule`) without explicitly stating the `@my-organization` scope. This was a bug because it could lead to ambiguous rule references if there was also an unscoped plugin called `eslint-plugin-foo` loaded at the same time.
+
+To avoid this ambiguity, in 4.0 references to scoped plugins must include the scope. The config from above should be fixed to:
+
+```json
+{
+  "plugins": [
+    "@my-organization/foo"
+  ],
+  "rules": {
+    "@my-organization/foo/some-rule": "error"
+  }
+}
+```
+
+**To address:** If you reference a scoped NPM package as a plugin in a config file, be sure to include the scope wherever you reference it.
+
+---
+
+## <a name="rule-tester-validation"></a> `RuleTester` now validates properties of test cases
+
+Starting in 4.0, the `RuleTester` utility will validate properties of test case objects, and an error will be thrown if an unknown property is encountered. This change was added because we found that it was relatively common for developers to make typos in rule tests, often invalidating the assertions that the test cases were trying to make.
+
+**To address:** If your tests for custom rules have extra properties, you should remove those properties.
+
+## <a name="comment-attachment"></a> AST Nodes no longer have comment properties
+
+Prior to 4.0, ESLint required parsers to implement comment attachment, a process where AST nodes would gain additional properties corresponding to their leading and trailing comments in the source file. This made it difficult for users to develop custom parsers, because they would have to replicate the confusing comment attachment semantics required by ESLint.
+
+In 4.0, we have moved away from the concept of comment attachment and have moved all comment handling logic into ESLint itself. This should make it easier to develop custom parsers, but it also means that AST nodes will no longer have `leadingComments` and `trailingComments` properties. Conceptually, rule authors can now think of comments in the context of tokens rather than AST nodes.
+
+**To address:** If you have a custom rule that depends on the `leadingComments` or `trailingComments` properties of an AST node, you can now use `sourceCode.getCommentsBefore()` and `sourceCode.getCommentsAfter()` instead, respectively.
+
+Additionally, the `sourceCode` object now also has `sourceCode.getCommentsInside()` (which returns all the comments inside a node), `sourceCode.getAllComments()` (which returns all the comments in the file), and allows comments to be accessed through various other token iterator methods (such as `getTokenBefore()` and `getTokenAfter()`) with the `{ includeComments: true }` option.
+
+For rule authors concerned about supporting ESLint v3.0 in addition to v4.0, the now deprecated `sourceCode.getComments()` is still available and will work for both versions.
+
+Finally, please note that the following `SourceCode` methods have been deprecated and will be removed in a future version of ESLint:
+
+* `getComments()` - replaced by `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()`
+* `getTokenOrCommentBefore()` - replaced by `getTokenBefore()` with the `{ includeComments: true }` option
+* `getTokenOrCommentAfter()` - replaced by `getTokenAfter()` with the `{ includeComments: true }` option
+
+## <a name="event-comments"></a> `LineComment` and `BlockComment` events will no longer be emitted during AST traversal
+
+Starting in 4.0, `LineComment` and `BlockComments` events will not be emitted during AST traversal. There are two reasons for this:
+
+* This behavior was relying on comment attachment happening at the parser level, which does not happen anymore, to ensure that all comments would be accounted for
+* Thinking of comments in the context of tokens is more predictable and easier to reason about than thinking about comment tokens in the context of AST nodes
+
+**To address:** Instead of relying on `LineComment` and `BlockComment`, rules can now use `sourceCode.getAllComments()` to get all comments in a file. To check all comments of a specific type, rules can use the following pattern:
+
+```js
+sourceCode.getAllComments().filter(comment => comment.type === "Line");
+sourceCode.getAllComments().filter(comment => comment.type === "Block");
+```
+
+## <a name="shebangs"></a> Shebangs are now returned from comment APIs
+
+Prior to 4.0, shebang comments in a source file would not appear in the output of `sourceCode.getAllComments()` or `sourceCode.getComments()`, but they would appear in the output of `sourceCode.getTokenOrCommentBefore` as line comments. This inconsistency led to some confusion for rule developers.
+
+In 4.0, shebang comments are treated as comment tokens of type `Shebang` and will be returned by any `SourceCode` method that returns comments. The goal of this change is to make working with shebang comments more consistent with how other tokens are handled.
+
+**To address:** If you have a custom rule that performs operations on comments, some additional logic might be required to ensure that shebang comments are correctly handled or filtered out:
+
+```js
+sourceCode.getAllComments().filter(comment => comment.type !== "Shebang");
+```
+
+---
+
+## <a name="global-property"></a> The `global` property in the `linter.verify()` API is no longer supported
+
+Previously, the `linter.verify()` API accepted a `global` config option, which was a synonym for the documented `globals` property. The `global` option was never documented or officially supported, and did not work in config files. It has been removed in 4.0.
+
+**To address:** If you were using the `global` property, please use the `globals` property instead, which does the same thing.
+
+## <a name="report-locations"></a> More report messages now have full location ranges
+
+Starting in 3.1.0, rules have been able to specify the *end* location of a reported problem, in addition to the start location, by explicitly specifying an end location in the `report` call. This is useful for tools like editor integrations, which can use the range to precisely display where a reported problem occurs. Starting in 4.0, if a *node* is reported rather than a location, the end location of the range will automatically be inferred from the end location of the node. As a result, many more reported problems will have end locations.
+
+This is not expected to cause breakage. However, it will likely result in larger report locations than before. For example, if a rule reports the root node of the AST, the reported problem's range will be the entire program. In some integrations, this could result in a poor user experience (e.g. if the entire program is highlighted to indicate an error).
+
+**To address:** If you have an integration that deals with the ranges of reported problems, make sure you handle large report ranges in a user-friendly way.
+
+## <a name="exposed-es2015-classes"></a> Some exposed APIs are now ES2015 classes
+
+The `CLIEngine`, `SourceCode`, and `RuleTester` modules from ESLint's Node.js API are now ES2015 classes. This will not break any documented behavior, but it does have some observable effects (for example, the methods on `CLIEngine.prototype` are now non-enumerable).
+
+**To address:** If you rely on enumerating the methods of ESLint's Node.js APIs, use a function that can also access non-enumerable properties such as `Object.getOwnPropertyNames`.
diff --git a/eslint/docs/src/user-guide/migrating-to-5.0.0.md b/eslint/docs/src/user-guide/migrating-to-5.0.0.md
new file mode 100644 (file)
index 0000000..36db7d4
--- /dev/null
@@ -0,0 +1,274 @@
+---
+title: Migrating to v5.0.0
+layout: doc
+
+---
+
+ESLint v5.0.0 is the fifth major version release. We have made a few breaking changes in this release, but we expect that most users will be able to upgrade without any modifications to their build. This guide is intended to walk you through the breaking changes.
+
+The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
+
+## Breaking changes for users
+
+1. [Node.js 4 is no longer supported](#drop-node-4)
+1. [New rules have been added to `eslint:recommended`](#eslint-recommended-changes)
+1. [The `experimentalObjectRestSpread` option has been deprecated](#experimental-object-rest-spread)
+1. [Linting nonexistent files from the command line is now a fatal error](#nonexistent-files)
+1. [The default options for some rules have changed](#rule-default-changes)
+1. [Deprecated globals have been removed from the `node`, `browser`, and `jest` environments](#deprecated-globals)
+1. [Empty files are now linted](#empty-files)
+1. [Plugins in scoped packages are now resolvable in configs](#scoped-plugins)
+1. [Multi-line `eslint-disable-line` directives are now reported as problems](#multiline-directives)
+
+## Breaking changes for plugin/custom rule developers
+
+1. [The `parent` property of AST nodes is now set before rules start running](#parent-before-rules)
+1. [When using the default parser, spread operators now have type `SpreadElement`](#spread-operators)
+1. [When using the default parser, rest operators now have type `RestElement`](#rest-operators)
+1. [When using the default parser, text nodes in JSX elements now have type `JSXText`](#jsx-text-nodes)
+1. [The `context.getScope()` method now returns more proper scopes](#context-get-scope)
+1. [The `_linter` property on rule context objects has been removed](#no-context-linter)
+1. [`RuleTester` now uses strict equality checks in its assertions](#rule-tester-equality)
+1. [Rules are now required to provide messages along with reports](#required-report-messages)
+
+## Breaking changes for integration developers
+
+1. [The `source` property is no longer available on individual linting messages](#source-property)
+1. [Fatal errors now result in an exit code of 2](#exit-code-two)
+1. [The `eslint.linter` property is now non-enumerable](#non-enumerable-linter)
+
+---
+
+## <a name="drop-node-4"></a> Node.js 4 is no longer supported
+
+As of April 30th, 2018, Node.js 4 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v5. We now support the following versions of Node.js:
+
+* Node.js 6 (6.14.0 and above)
+* Node.js 8 (8.10.0 and above)
+* Anything above Node.js 9.10.0
+
+**To address:** Make sure you upgrade to at least Node.js 6 when using ESLint v5. If you are unable to upgrade, we recommend continuing to use ESLint v4.x until you are able to upgrade Node.js.
+
+## <a name="eslint-recommended-changes"/> `eslint:recommended` changes
+
+Two new rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
+
+* [`for-direction`](/docs/rules/for-direction) enforces that a `for` loop update clause moves the counter in the right direction.
+* [`getter-return`](/docs/rules/getter-return) enforces that a `return` statement is present in property getters.
+
+**To address:** To mimic the `eslint:recommended` behavior from 4.x, you can disable these rules in a config file:
+
+```json
+{
+  "extends": "eslint:recommended",
+
+  "rules": {
+    "for-direction": "off",
+    "getter-return": "off"
+  }
+}
+```
+
+## <a name="experimental-object-rest-spread"></a> The `experimentalObjectRestSpread` option has been deprecated
+
+Previously, when using the default parser it was possible to use the `experimentalObjectRestSpread` option to enable support for [rest/spread properties](https://developers.google.com/web/updates/2017/06/object-rest-spread), as follows:
+
+```json
+{
+  "parserOptions": {
+    "ecmaFeatures": {
+      "experimentalObjectRestSpread": true
+    }
+  }
+}
+```
+
+Object rest/spread is now an official part of the JavaScript language, so our support for it is no longer experimental. In both ESLint v4 and ESLint v5, object rest/spread can now be enabled with the `"ecmaVersion": 2018` option:
+
+```json
+{
+  "parserOptions": {
+    "ecmaVersion": 2018
+  }
+}
+```
+
+Note that this also enables parsing for other features from ES2018, such as [async iteration](https://github.com/tc39/proposal-async-iteration). When using ESLint v5 with the default parser, it is no longer possible to toggle syntax support for object rest/spread independently of other features.
+
+For compatibility, ESLint v5 will treat `ecmaFeatures: { experimentalObjectRestSpread: true }` as an alias for `ecmaVersion: 2018` when the former is found in a config file. As a result, if you use object rest/spread, your code should still parse successfully with ESLint v5. However, note that this alias will be removed in ESLint v6.
+
+**To address:** If you use the `experimentalObjectRestSpread` option, you should be able to upgrade to ESLint v5 without any changes, but you will encounter a deprecation warning. To avoid the warning, use `ecmaVersion: 2018` in your config file rather than `ecmaFeatures: { experimentalObjectRestSpread: true }`. If you would like to disallow the use of other ES2018 features, consider using rules such as [`no-restricted-syntax`](/docs/rules/no-restricted-syntax).
+
+## <a name="nonexistent-files"></a> Linting nonexistent files from the command line is now a fatal error
+
+Previous versions of ESLint silently ignored any nonexistent files and globs provided on the command line:
+
+```bash
+eslint nonexistent-file.js 'nonexistent-folder/**/*.js' # exits without any errors in ESLint v4
+```
+
+Many users found this behavior confusing, because if they made a typo in a filename, ESLint would appear to lint that file successfully while actually not linting anything.
+
+ESLint v5 will report a fatal error when either of the following conditions is met:
+
+* A file provided on the command line does not exist
+* A glob or folder provided on the command line does not match any lintable files
+
+Note that this also affects the [`CLIEngine.executeOnFiles()`](https://eslint.org/docs/developer-guide/nodejs-api#cliengineexecuteonfiles) API.
+
+**To address:** If you encounter an error about missing files after upgrading to ESLint v5, you may want to double-check that there are no typos in the paths you provide to ESLint. To make the error go away, you can simply remove the given files or globs from the list of arguments provided to ESLint on the command line.
+
+If you use a boilerplate generator that relies on this behavior (e.g. to generate a script that runs `eslint tests/` in a new project before any test files are actually present), you can work around this issue by adding a dummy file that matches the given pattern (e.g. an empty `tests/index.js` file).
+
+## <a name="rule-default-changes"></a> The default options for some rules have changed
+
+* The default options for the [`object-curly-newline`](/docs/rules/object-curly-newline) rule have changed from `{ multiline: true }` to `{ consistent: true }`.
+* The default options object for the [`no-self-assign`](/docs/rules/no-self-assign) rule has changed from `{ props: false }` to `{ props: true }`.
+
+**To address:** To restore the rule behavior from ESLint v4, you can update your config file to include the previous options:
+
+```json
+{
+  "rules": {
+    "object-curly-newline": ["error", { "multiline": true }],
+    "no-self-assign": ["error", { "props": false }]
+  }
+}
+```
+
+## <a name="deprecated-globals"></a> Deprecated globals have been removed from the `node`, `browser`, and `jest` environments
+
+Some global variables have been deprecated or removed for code running in Node.js, browsers, and Jest. (For example, browsers used to expose an `SVGAltGlyphElement` global variable to JavaScript code, but this global has been removed from web standards and is no longer present in browsers.) As a result, we have removed these globals from the corresponding `eslint` environments, so use of these globals will trigger an error when using rules such as [`no-undef`](/docs/rules/no-undef).
+
+**To address:** If you use deprecated globals in the `node`, `browser`, or `jest` environments, you can add a `globals` section to your configuration to re-enable any globals you need. For example:
+
+```json
+{
+  "env": {
+    "browser": true
+  },
+  "globals": {
+    "SVGAltGlyphElement": false
+  }
+}
+```
+
+## <a name="empty-files"></a> Empty files are now linted
+
+ESLint v4 had a special behavior when linting files that only contain whitespace: it would skip running the parser and rules, and it would always return zero errors. This led to some confusion for users and rule authors, particularly when writing tests for rules. (When writing a stylistic rule, rule authors would occasionally write a test where the source code only contained whitespace, to ensure that the rule behaved correctly when no applicable code was found. However, a test like this would actually not run the rule at all, so an aspect of the rule would end up untested.)
+
+ESLint v5 treats whitespace-only files the same way as all other files: it parses them and runs enabled rules on them as appropriate. This could lead to additional linting problems if you use a custom rule that reports errors on empty files.
+
+**To address:** If you have an empty file in your project and you don't want it to be linted, consider adding it to an [`.eslintignore` file](/docs/user-guide/configuring#ignoring-files-and-directories).
+
+If you have a custom rule, you should make sure it handles empty files appropriately. (In most cases, no changes should be necessary.)
+
+## <a name="scoped-plugins"></a> Plugins in scoped packages are now resolvable in configs
+
+When ESLint v5 encounters a plugin name in a config starting with `@`, the plugin will be resolved as a [scoped npm package](https://docs.npmjs.com/misc/scope). For example, if a config contains `"plugins": ["@foo"]`, ESLint v5 will attempt to load a package called `@foo/eslint-plugin`. (On the other hand, ESLint v4 would attempt to load a package called `eslint-plugin-@foo`.) This is a breaking change because users might have been relying on ESLint finding a package at `node_modules/eslint-plugin-@foo`. However, we think it is unlikely that many users were relying on this behavior, because packages published to npm cannot contain an `@` character in the middle.
+
+**To address:** If you rely on ESLint loading a package like `eslint-config-@foo`, consider renaming the package to something else.
+
+## <a name="multiline-directives"></a> Multi-line `eslint-disable-line` directives are now reported as problems
+
+`eslint-disable-line` and `eslint-disable-next-line` directive comments are only allowed to span a single line. For example, the following directive comment is invalid:
+
+```js
+alert('foo'); /* eslint-disable-line
+   no-alert */ alert('bar');
+
+// (which line is the rule disabled on?)
+```
+
+Previously, ESLint would ignore these malformed directive comments. ESLint v5 will report an error when it sees a problem like this, so that the issue can be more easily corrected.
+
+**To address:** If you see new reported errors as a result of this change, ensure that your `eslint-disable-line` directives only span a single line. Note that "block comments" (delimited by `/* */`) are still allowed to be used for directives, provided that the block comments do not contain linebreaks.
+
+---
+
+## <a name="parent-before-rules"></a> The `parent` property of AST nodes is now set before rules start running
+
+Previously, ESLint would set the `parent` property on each AST node immediately before running rule listeners for that node. This caused some confusion for rule authors, because the `parent` property would not initially be present on any nodes, and it was sometimes necessary to complicate the structure of a rule to ensure that the `parent` property of a given node would be available when needed.
+
+In ESLint v5, the `parent` property is set on all AST nodes before any rules have access to the AST. This makes it easier to write some rules, because the `parent` property is always available rather than being mutated behind the scenes. However, as a side-effect of having `parent` properties, the AST object has a circular structure the first time a rule sees it (previously, it only had a circular structure after the first rule listeners were called). As a result, a custom rule that enumerates all properties of a node in order to traverse the AST might now loop forever or run out of memory if it does not check for cycles properly.
+
+**To address:** If you have written a custom rule that enumerates all properties of an AST node, consider excluding the `parent` property or implementing cycle detection to ensure that you obtain the correct result.
+
+## <a name="spread-operators"></a> When using the default parser, spread operators now have type `SpreadElement`
+
+Previously, when parsing JS code like `const foo = {...data}` with the `experimentalObjectRestSpread` option enabled, the default parser would generate an `ExperimentalSpreadProperty` node type for the `...data` spread element.
+
+In ESLint v5, the default parser will now always give the `...data` AST node the `SpreadElement` type, even if the (now deprecated) [`experimentalObjectRestSpread`](#experimental-object-rest-spread) option is enabled. This makes the AST compliant with the current ESTree spec.
+
+**To address:** If you have written a custom rule that relies on spread operators having the `ExperimentalSpreadProperty` type, you should update it to also work with spread operators that have the `SpreadElement` type.
+
+## <a name="rest-operators"></a> When using the default parser, rest operators now have type `RestElement`
+
+Previously, when parsing JS code like `const {foo, ...rest} = data` with the `experimentalObjectRestSpread` option enabled, the default parser would generate an `ExperimentalRestProperty` node type for the `...data` rest element.
+
+In ESLint v5, the default parser will now always give the `...data` AST node the `RestElement` type, even if the (now deprecated) [`experimentalObjectRestSpread`](#experimental-object-rest-spread) option is enabled. This makes the AST compliant with the current ESTree spec.
+
+**To address:** If you have written a custom rule that relies on rest operators having the `ExperimentalRestProperty` type, you should update it to also work with rest operators that have the `RestElement` type.
+
+## <a name="jsx-text-nodes"></a> When using the default parser, text nodes in JSX elements now have type `JSXText`
+
+When parsing JSX code like `<a>foo</a>`, the default parser will now give the `foo` AST node the `JSXText` type, rather than the `Literal` type. This makes the AST compliant with a recent update to the JSX spec.
+
+**To address:** If you have written a custom rule that relies on text nodes in JSX elements having the `Literal` type, you should update it to also work with nodes that have the `JSXText` type.
+
+## <a name="context-get-scope"></a> The `context.getScope()` method now returns more proper scopes
+
+Previously, the `context.getScope()` method changed its behavior based on the `parserOptions.ecmaVersion` property. However, this could cause confusing behavior when using a parser that doesn't respond to the `ecmaVersion` option, such as `babel-eslint`.
+
+Additionally, `context.getScope()` incorrectly returned the parent scope of the proper scope on `CatchClause` (in ES5), `ForStatement` (in ≧ES2015), `ForInStatement` (in ≧ES2015), `ForOfStatement`, and `WithStatement` nodes.
+
+In ESLint v5, the `context.getScope()` method has the same behavior regardless of `parserOptions.ecmaVersion` and returns the proper scope. See [the documentation](../developer-guide/working-with-rules#contextgetscope) for more details on which scopes are returned.
+
+**To address:** If you have written a custom rule that uses the `context.getScope()` method in node handlers, you may need to update it to account for the modified scope information.
+
+## <a name="no-context-linter"></a> The `_linter` property on rule context objects has been removed
+
+Previously, rule context objects had an undocumented `_linter` property, which was used internally within ESLint to process reports from rules. Some rules used this property to achieve functionality that was not intended to be possible for rules. For example, several plugins used the `_linter` property in a rule to monitor reports from other rules, for the purpose of checking for unused `/* eslint-disable */` directive comments. Although this functionality was useful for users, it could also cause stability problems for projects using ESLint. For example, an upgrade to a rule in one plugin could unexpectedly cause a rule in another plugin to start reporting errors.
+
+The `_linter` property has been removed in ESLint v5.0, so it is no longer possible to implement rules with this functionality. However, the [`--report-unused-disable-directives`](/docs/user-guide/command-line-interface#--report-unused-disable-directives) CLI flag can be used to flag unused directive comments.
+
+## <a name="rule-tester-equality"></a> `RuleTester` now uses strict equality checks in its assertions
+
+Previously, `RuleTester` used loose equality when making some of its assertions. For example, if a rule produced the string `"7"` as a result of autofixing, `RuleTester` would allow the number `7` in an `output` assertion, rather than the string `"7"`. In ESLint v5, comparisons from `RuleTester` use strict equality, so an assertion like this will no longer pass.
+
+**To address:** If you use `RuleTester` to write tests for your custom rules, make sure the expected values in your assertions are strictly equal to the actual values.
+
+## <a name="required-report-messages"></a> Rules are now required to provide messages along with reports
+
+Previously, it was possible for rules to report AST nodes without providing a report message. This was not intended behavior, and as a result the default formatter would crash if a rule omitted a message. However, it was possible to avoid a crash when using a non-default formatter, such as `json`.
+
+In ESLint v5, reporting a problem without providing a message always results in an error.
+
+**To address:** If you have written a custom rule that reports a problem without providing a message, update it to provide a message along with the report.
+
+---
+
+## <a name="source-property"></a> The `source` property is no longer available on individual linting messages
+
+As announced in [October 2016](/blog/2016/10/eslint-v3.8.0-released#additional-property-on-linting-results), the `source` property has been removed from individual lint message objects.
+
+**To address:** If you have a formatter or integration which relies on using the `source` property on individual linting messages, you should update it to use the `source` property on file results objects instead.
+
+## <a name="exit-code-two"></a> Fatal errors now result in an exit code of 2
+
+When using ESLint v4, both of the following scenarios resulted in an exit code of 1 when running ESLint on the command line:
+
+* Linting completed successfully, but there are some linting errors
+* Linting was unsuccessful due to a fatal error (e.g. an invalid config file)
+
+As a result, it was difficult for an integration to distinguish between the two cases to determine whether it should try to extract linting results from the output.
+
+In ESLint v5, an unsuccessful linting run due to a fatal error will result in an exit code of 2, rather than 1.
+
+**To address:** If you have an integration that detects all problems with linting runs by checking whether the exit code is equal to 1, update it to check whether the exit code is nonzero instead.
+
+## <a name="non-enumerable-linter"></a> The `eslint.linter` property is now non-enumerable
+
+When using ESLint's Node.js API, the [`linter`](/docs/developer-guide/nodejs-api#linter-1) property is now non-enumerable. Note that the `linter` property was deprecated in ESLint v4 in favor of the [`Linter`](/docs/developer-guide/nodejs-api#linter) property.
+
+**To address:** If you rely on enumerating all the properties of the `eslint` object, use something like `Object.getOwnPropertyNames` to ensure that non-enumerable keys are captured.
diff --git a/eslint/docs/src/user-guide/migrating-to-6.0.0.md b/eslint/docs/src/user-guide/migrating-to-6.0.0.md
new file mode 100644 (file)
index 0000000..84c74e4
--- /dev/null
@@ -0,0 +1,334 @@
+---
+title: Migrating to v6.0.0
+layout: doc
+
+---
+
+ESLint v6.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
+
+The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
+
+## Breaking changes for users
+
+1. [Node.js 6 is no longer supported](#drop-node-6)
+1. [`eslint:recommended` has been updated](#eslint-recommended-changes)
+1. [Plugins and shareable configs are no longer affected by ESLint's location](#package-loading-simplification)
+1. [The default parser now validates options more strictly](#espree-validation)
+1. [Rule configuration are validated more strictly](#rule-config-validating)
+1. [The `no-redeclare` rule is now more strict by default](#no-redeclare-updates)
+1. [The `comma-dangle` rule is now more strict by default](#comma-dangle-updates)
+1. [The `no-confusing-arrow` rule is now more lenient by default](#no-confusing-arrow-updates)
+1. [Overrides in a config file can now match dotfiles](#overrides-dotfiles)
+1. [Overrides in an extended config file can now be overridden by a parent config file](#overrides-precedence)
+1. [Configuration values for globals are now validated](#globals-validation)
+1. [The deprecated `experimentalObjectRestSpread` option has been removed](#experimental-object-rest-spread)
+1. [User-provided regular expressions in rule options are parsed with the unicode flag](#unicode-regexes)
+
+## Breaking changes for plugin/custom rule developers
+
+1. [Plugin authors may need to update installation instructions](#plugin-documentation)
+1. [`RuleTester` now validates against invalid `default` keywords in rule schemas](#rule-tester-defaults)
+1. [`RuleTester` now requires an absolute path on `parser` option](#rule-tester-parser)
+1. [The `eslintExplicitGlobalComment` scope analysis property has been removed](#eslintExplicitGlobalComment)
+
+## Breaking changes for integration developers
+
+1. [Plugins and shareable configs are no longer affected by ESLint's location](#package-loading-simplification)
+1. [`Linter` no longer tries to load missing parsers from the filesystem](#linter-parsers)
+
+---
+
+## <a name="drop-node-6"></a> Node.js 6 is no longer supported
+
+As of April 2019, Node.js 6 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v6. We now support the following versions of Node.js:
+
+* Node.js 8 (8.10.0 and above)
+* Node.js 10 (10.13.0 and above)
+* Anything above Node.js 11.10.1
+
+**To address:** Make sure you upgrade to at least Node.js 8 when using ESLint v6. If you are unable to upgrade, we recommend continuing to use ESLint v5.x until you are able to upgrade Node.js.
+
+**Related issue(s):** [eslint/eslint#11546](https://github.com/eslint/eslint/issues/11456)
+
+## <a name="eslint-recommended-changes"></a> `eslint:recommended` has been updated
+
+The following rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
+
+* [`no-async-promise-executor`](https://eslint.org/docs/rules/no-async-promise-executor) disallows using an `async` function as the argument to the `Promise` constructor, which is usually a bug.
+* [`no-misleading-character-class`](https://eslint.org/docs/rules/no-misleading-character-class) reports character classes in regular expressions that might not behave as expected.
+* [`no-prototype-builtins`](https://eslint.org/docs/rules/no-prototype-builtins) reports method calls like `foo.hasOwnProperty("bar")` (which are a frequent source of bugs), and suggests that they be replaced with `Object.prototype.hasOwnProperty.call(foo, "bar")` instead.
+* [`no-shadow-restricted-names`](https://eslint.org/docs/rules/no-shadow-restricted-names) disallows shadowing variables like `undefined` (e.g. with code like `let undefined = 5;`), since is likely to confuse readers.
+* [`no-useless-catch`](https://eslint.org/docs/rules/no-useless-catch) reports `catch` clauses that are redundant and can be removed from the code without changing its behavior.
+* [`no-with`](https://eslint.org/docs/rules/no-with) disallows use of the [`with` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with), which can make code difficult to understand and cause compatibility problems.
+* [`require-atomic-updates`](https://eslint.org/docs/rules/require-atomic-updates) reports race condition bugs that can occur when reassigning variables in async functions.
+
+Additionally, the following rule has been *removed* from `eslint:recommended`:
+
+* [`no-console`](https://eslint.org/docs/rules/no-console) disallows calling functions like `console.log`. While this rule is useful in many cases (e.g. to avoid inadvertently leaving debugging statements in production code), it is not as broadly applicable as the other rules in `eslint:recommended`, and it was a source of false positives in cases where `console.log` is acceptable (e.g. in CLI applications).
+
+Finally, in ESLint v5 `eslint:recommended` would explicitly disable all core rules that were not considered "recommended". This could cause confusing behavior if `eslint:recommended` was loaded after another config, since `eslint:recommended` would have the effect of turning off some rules. In ESLint v6, `eslint:recommended` has no effect on non-recommended rules.
+
+**To address:** To mimic the `eslint:recommended` behavior from 5.x, you can explicitly disable/enable rules in a config file as follows:
+
+```json
+{
+  "extends": "eslint:recommended",
+
+  "rules": {
+    "no-async-promise-executor": "off",
+    "no-misleading-character-class": "off",
+    "no-prototype-builtins": "off",
+    "no-shadow-restricted-names": "off",
+    "no-useless-catch": "off",
+    "no-with": "off",
+    "require-atomic-updates": "off",
+
+    "no-console": "error"
+  }
+}
+```
+
+In rare cases (if you were relying on the previous behavior where `eslint:recommended` disables core rules), you might need to disable additional rules to restore the previous behavior.
+
+**Related issue(s):** [eslint/eslint#10768](https://github.com/eslint/eslint/issues/10768), [eslint/eslint#10873](https://github.com/eslint/eslint/issues/10873)
+
+## <a name="package-loading-simplification"></a> Plugins and shareable configs are no longer affected by ESLint's location
+
+Previously, ESLint loaded plugins relative to the location of the ESLint package itself. As a result, we suggested that users with global ESLint installations should also install plugins globally, and users with local ESLint installations should install plugins locally. However, due to a design bug, this strategy caused ESLint to randomly fail to load plugins and shareable configs under certain circumstances, particularly when using package management tools like [`lerna`](https://github.com/lerna/lerna) and [Yarn Plug n' Play](https://yarnpkg.com/lang/en/docs/pnp/).
+
+As a rule of thumb: With ESLint v6, plugins should always be installed locally, even if ESLint was installed globally. More precisely, ESLint v6 resolves plugins relative to the end user's project by default, and always resolves shareable configs and parsers relative to the location of the config file that imports them.
+
+**To address:** If you use a global installation of ESLint (e.g. installed with `npm install eslint --global`) along with plugins, you should install those plugins locally in the projects where you run ESLint. If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.
+
+If you use a config file located outside of a local project (with the `--config` flag), consider installing the plugins as dependencies of that config file, and setting the [`--resolve-plugins-relative-to`](./command-line-interface#--resolve-plugins-relative-to) flag to the location of the config file.
+
+**Related issue(s):** [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
+
+## <a name="espree-validation"></a> The default parser now validates options more strictly
+
+`espree`, the default parser used by ESLint, will now raise an error in the following cases:
+
+* The `ecmaVersion` parser option is set to something other than a number, such as the string `"2015"`. (Previously, a non-number option would simply be ignored.)
+* The `sourceType: "module"` parser option is set while `ecmaVersion` is set to `5` or left unspecified. (Previously, setting `sourceType: "module"` would implicitly cause `ecmaVersion` to be set to a minimum of 2015, which could be surprising.)
+* The `sourceType` is set to anything other than `"script"` or `"module"`.
+
+**To address:** If your config sets `ecmaVersion` to something other than a number, you can restore the previous behavior by removing `ecmaVersion`. (However, you may want to double-check that your config is actually working as expected.) If your config sets `parserOptions: { sourceType: "module" }` without also setting `parserOptions.ecmaVersion`, you should add `parserOptions: { ecmaVersion: 2015 }` to restore the previous behavior.
+
+**Related issue(s):** [eslint/eslint#9687](https://github.com/eslint/eslint/issues/9687), [eslint/espree#384](https://github.com/eslint/espree/issues/384)
+
+## <a name="rule-config-validating"></a> Rule configuration are validated more strictly
+
+To catch config errors earlier, ESLint v6 will report a linting error if you are trying to configure a non-existent rule.
+
+config | ESLint v5 | ESLint v6
+------------- | ------------- | -------------
+`/*eslint-enable foo*/`  | no error | linting error
+`/*eslint-disable(-line) foo*/`  | no error | linting error
+`/*eslint foo: 0*/` | no error | linting error
+`{rules: {foo: 0}}` | no error | no error
+`{rules: {foo: 1}` | linting warning | linting error
+
+**To address:** You can remove the non-existent rule in your (inline) config.
+
+**Related issue(s):** [eslint/eslint#9505](https://github.com/eslint/eslint/issues/9505)
+
+## <a name="no-redeclare-updates"></a> The `no-redeclare` rule is now more strict by default
+
+The default options for the [`no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule have changed from `{ builtinGlobals: false }` to `{ builtinGlobals: true }`. Additionally, the `no-redeclare` rule will now report an error for globals enabled by comments like `/* global foo */` if those globals were already enabled through configuration anyway.
+
+**To address:**
+
+To restore the previous options for the rule, you can configure it as follows:
+
+```json
+{
+  "rules": {
+    "no-redeclare": ["error", { "builtinGlobals": false }]
+  }
+}
+```
+
+Additionally, if you see new errors for `global` comments in your code, you should remove those comments.
+
+**Related issue(s):** [eslint/eslint#11370](https://github.com/eslint/eslint/issues/11370), [eslint/eslint#11405](https://github.com/eslint/eslint/issues/11405)
+
+## <a name="comma-dangle-updates"></a> The `comma-dangle` rule is now more strict by default
+
+Previously, the [`comma-dangle`](https://eslint.org/docs/rules/comma-dangle) rule would ignore trailing function arguments and parameters, unless explicitly configured to check for function commas. In ESLint v6, function commas are treated the same way as other types of trailing commas.
+
+**To address:** You can restore the previous default behavior of the rule with:
+
+```json
+{
+  "rules": {
+    "comma-dangle": ["error", {
+        "arrays": "never",
+        "objects": "never",
+        "imports": "never",
+        "exports": "never",
+        "functions": "ignore"
+    }]
+  }
+}
+```
+
+To restore the previous behavior of a string option like `"always-multiline"`, replace `"never"` with `"always-multiline"` in the example above.
+
+**Related issue(s):** [eslint/eslint#11502](https://github.com/eslint/eslint/issues/11502)
+
+## <a name="no-confusing-arrow-updates"></a> The `no-confusing-arrow` rule is now more lenient by default
+
+The default options for the [`no-confusing-arrow`](https://eslint.org/docs/rules/no-confusing-arrow) rule have changed from `{ allowParens: false }` to `{ allowParens: true }`.
+
+**To address:** You can restore the previous default behavior of the rule with:
+
+```json
+{
+  "rules": {
+    "no-confusing-arrow": ["error", { "allowParens": false }]
+  }
+}
+```
+
+**Related issue(s):** [eslint/eslint#11503](https://github.com/eslint/eslint/issues/11503)
+
+## <a name="overrides-dotfiles"></a> Overrides in a config file can now match dotfiles
+
+Due to a bug, the glob patterns in a `files` list in an `overrides` section of a config file would never match dotfiles, making it impossible to have overrides apply to files starting with a dot. This bug has been fixed in ESLint v6.
+
+**To address:** If you don't want dotfiles to be matched by an override, consider adding something like `excludedFiles: [".*"]` to that `overrides` section. See the [documentation](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) for more details.
+
+**Related issue(s):** [eslint/eslint#11201](https://github.com/eslint/eslint/issues/11201)
+
+## <a name="overrides-precedence"></a> Overrides in an extended config file can now be overridden by a parent config file
+
+Due to a bug, it was previously the case that an `overrides` block in a shareable config had precedence over the top level of a parent config. For example, with the following config setup, the `semi` rule would end up enabled even though it was explicitly disabled in the end user's config:
+
+```js
+// .eslintrc.js
+module.exports = {
+  extends: ["foo"],
+  rules: {
+    semi: "off"
+  }
+};
+```
+
+```js
+// eslint-config-foo/index.js
+module.exports = {
+  overrides: {
+    files: ["*.js"],
+    rules: {
+      semi: "error"
+    }
+  }
+};
+```
+
+In ESLint v6.0.0, a parent config always has precedence over extended configs, even with `overrides` blocks.
+
+**To address:** We expect the impact of this issue to be very low because most shareable configs don't use `overrides` blocks. However, if you use a shareable config with `overrides` blocks, you might encounter a change in behavior due to something that is explicitly specified in your config but was inactive until now. If you would rather inherit the behavior from the shareable config, simply remove the corresponding entry from your own config. (In the example above, the previous behavior could be restored by removing `semi: "off"` from `.eslintrc.js`.)
+
+**Related issue(s):** [eslint/eslint#11510](https://github.com/eslint/eslint/issues/11510)
+
+## <a name="globals-validation"></a> Configuration values for globals are now validated
+
+Previously, when configuring a set of global variables with an object, it was possible to use anything as the values of the object. An unknown value would be treated the same as `"writable"`.
+
+```js
+// .eslintrc.js
+module.exports = {
+  globals: {
+    foo: "readonly",
+    bar: "writable",
+    baz: "hello!" // ???
+  }
+};
+```
+
+With this change, any unknown values in a `globals` object result in a config validation error.
+
+**To address:** If you see config validation errors related to globals after updating, ensure that all values configured for globals are either `readonly`, `writable`, or `off`. (ESLint also accepts some alternate spellings and variants for compatibility.)
+
+## <a name="experimental-object-rest-spread"></a> The deprecated `experimentalObjectRestSpread` option has been removed
+
+Previously, when using the default parser, a config could use the `experimentalObjectRestSpread` option to enable parsing support for object rest/spread properties:
+
+```json
+{
+  "parserOptions": {
+    "ecmaFeatures": {
+      "experimentalObjectRestSpread": true
+    }
+  }
+}
+```
+
+Since ESLint v5, `ecmaFeatures: { experimentalObjectRestSpread: true }` has been equivalent to `ecmaVersion: 2018`, and has also emitted a deprecation warning. In ESLint v6, the `experimentalObjectRestSpread` feature has been removed entirely and has no effect. If your config was relying on `experimentalObjectRestSpread` to enable ES2018 parsing, you might start seeing parsing errors for recent syntax.
+
+**To address:** If you use the `experimentalObjectRestSpread` option, you should change your config to contain this instead:
+
+```json
+{
+  "parserOptions": {
+    "ecmaVersion": 2018
+  }
+}
+```
+
+If you're not sure which config file needs to be updated, it may be useful to run ESLint v5 and look at what config file is mentioned in the deprecation warning.
+
+**Related issue(s):** [eslint/eslint#9990](https://github.com/eslint/eslint/issues/9990)
+
+## <a name="unicode-regexes"></a> User-provided regular expressions in rule options are parsed with the unicode flag
+
+Rules like [`max-len`](/docs/rules/max-len) accept a string option which is interpreted as a regular expression. In ESLint v6.0.0, these regular expressions are interpreted with the [unicode flag](https://mathiasbynens.be/notes/es6-unicode-regex), which should exhibit more reasonable behavior when matching characters like astral symbols. Unicode regexes also validate escape sequences more strictly than non-unicode regexes.
+
+**To address:** If you get rule option validation errors after upgrading, ensure that any regular expressions in your rule options have no invalid escape sequences.
+
+**Related issue(s):** [eslint/eslint#11423](https://github.com/eslint/eslint/issues/11423)
+
+---
+
+## <a name="plugin-documentation"></a> Plugin authors may need to update installation instructions
+
+If you maintain a plugin and provide installation instructions, you should ensure that the installation instructions are up to date with the [user-facing changes to how plugins are loaded](#package-loading-simplification). In particular, if your plugin was generated with the [`generator-eslint`](https://github.com/eslint/generator-eslint) package, it likely contains outdated instructions for how to use the plugin with global ESLint installations.
+
+**Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
+
+## <a name="rule-tester-defaults"></a> `RuleTester` now validates against invalid `default` keywords in rule schemas
+
+In some cases, rule schemas can use the `default` keyword to automatically specify default values for rule options. However, the `default` keyword is only effective in certain schema locations, and is ignored elsewhere, which creates a risk of bugs if a rule incorrectly expects a default value to be provided as a rule option. In ESLint v6.0.0, `RuleTester` will raise an error if a rule has an invalid `default` keyword in its schema.
+
+**To address:** If `RuleTester` starts reporting an error about an invalid default, you can remove the `default` property at the indicated location in your rule schema, and the rule will behave the same way. (If this happens, you might also want to verify that the rule behaves correctly when no option value is provided in that location.)
+
+**Related issue(s):** [eslint/eslint#11473](https://github.com/eslint/eslint/issues/11473)
+
+## <a name="rule-tester-parser"></a> `RuleTester` now requires an absolute path on `parser` option
+
+To use custom parsers in tests, we could use `parser` property with a package name or file path. However, if a package name was given, it's unclear where the tester should load the parser package from because the tester doesn't know which files are running the tester. In ESLint v6.0.0, `RuleTester` disallows `parser` property with a package name.
+
+**To address:** If you use `parser` property with package names in test cases, update it with `require.resolve()` function to resolve the package name to the absolute path to the package.
+
+**Related issue(s):** [eslint/eslint#11728](https://github.com/eslint/eslint/issues/11728), [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
+
+## <a name="eslintExplicitGlobalComment"></a> The `eslintExplicitGlobalComment` scope analysis property has been removed
+
+Previously, ESLint would add an `eslintExplicitGlobalComment` property to `Variable` objects in scope analysis to indicate that a variable was introduced as a result of a `/* global */` comment. This property was undocumented, and the ESLint team was unable to find any usage of the property outside of ESLint core. The property has been removed in ESLint v6, and replaced with the `eslintExplicitGlobalComments` property, which can contain a list of all `/* global */` comments if a variable was declared with more than one of them.
+
+**To address:** If you maintain a rule that uses the `eslintExplicitGlobalComment` property, update it to use the `eslintExplicitGlobalComments` property as a list instead.
+
+**Related issue(s):** [eslint/rfcs#17](https://github.com/eslint/rfcs/pull/17)
+
+---
+
+## <a name="linter-parsers"></a> `Linter` no longer tries to load missing parsers from the filesystem
+
+Previously, when linting code with a parser that had not been previously defined, the `Linter` API would attempt to load the parser from the filesystem. However, this behavior was confusing because `Linter` never access the filesystem in any other cases, and it was difficult to ensure that the correct parser would be found when loading the parser from the filesystem.
+
+In ESLint v6, `Linter` will no longer perform any filesystem operations, including loading parsers.
+
+**To address:** If you're using `Linter` with a custom parser, use [`Linter#defineParser`](https://eslint.org/docs/developer-guide/nodejs-api#linterdefineparser) to explicitly define the parser before linting any code.
+
+**Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
diff --git a/eslint/docs/src/user-guide/migrating-to-7.0.0.md b/eslint/docs/src/user-guide/migrating-to-7.0.0.md
new file mode 100644 (file)
index 0000000..9e2a702
--- /dev/null
@@ -0,0 +1,236 @@
+---
+title: Migrating to v7.0.0
+layout: doc
+
+---
+
+ESLint v7.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
+
+The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
+
+## Table of Content
+
+### Breaking changes for users
+
+* [Node.js 8 is no longer supported](#drop-node-8)
+* [Lint files matched by `overrides[].files` by default](#additional-lint-targets)
+* [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change)
+* [The place where ESLint loads plugins from is changed](#plugin-loading-change)
+* [Runtime deprecation warnings for `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files)
+* [Default ignore patterns have changed](#default-ignore-patterns)
+* [Description in directive comments](#description-in-directive-comments)
+* [Node.js/CommonJS rules are deprecated](#deprecate-node-rules)
+* [Several rules have been updated to cover more cases](#rules-strict)
+* [`eslint:recommended` has been updated](#eslint-recommended)
+
+### Breaking changes for plugin developers
+
+* [Node.js 8 is no longer supported](#drop-node-8)
+* [Lint files matched by `overrides[].files` by default](#additional-lint-targets)
+* [Plugin resolution has been updated](#plugin-loading-change)
+* [Additional validation added to the `RuleTester` class](#rule-tester-strict)
+
+### Breaking changes for integration developers
+
+* [Node.js 8 is no longer supported](#drop-node-8)
+* [Plugin resolution has been updated](#plugin-loading-change)
+* [The `CLIEngine` class has been deprecated](#deprecate-cliengine)
+
+---
+
+## <a name="drop-node-8"></a> Node.js 8 is no longer supported
+
+Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release. ESLint now supports the following versions of Node.js:
+
+* Node.js 10 (`10.12.0` and above)
+* Node.js 12 and above
+
+**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint v7.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js.
+
+**Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700)
+
+## <a name="additional-lint-targets"></a> Lint files matched by `overrides[].files` by default
+
+Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default if you give directories like `eslint src`.
+
+ESLint v7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present,
+
+```yml
+# .eslintrc.yml
+extends: my-config-js
+overrides:
+  - files: "*.ts"
+    extends: my-config-ts
+```
+
+then running `eslint src` would check both `*.js` and `*.ts` files in the `src` directory.
+
+**To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js`  if you are using `overrides` but only want to lint files that have a `.js` extension.
+
+If you maintain plugins that check files with extensions other than `.js`, this feature will allow you to check these files by default by configuring an `overrides` setting in your `recommended` preset.
+
+**Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md), [#12677](https://github.com/eslint/eslint/pull/12677)
+
+## <a name="base-path-change"></a> The base path of `overrides` and `ignorePatterns` has changed when using the `--config`/`--ignore-path` options
+
+Up until now, ESLint has resolved the following paths relative to the directory path of the _entry_ configuration file:
+
+* Configuration files (`.eslintrc.*`)
+    * relative paths in the `overrides[].files` setting
+    * relative paths in the `overrides[].excludedFiles` setting
+    * paths which start with `/` in the `ignorePatterns` setting
+* Ignore files (`.eslintignore`)
+    * paths which start with `/`
+
+Starting in ESLint v7.0.0, configuration files and ignore files passed to ESLint using the `--config path/to/a-config` and `--ignore-path path/to/a-ignore` CLI flags, respectively, will resolve from the current working directory rather than the file location. This allows for users to utilize shared plugins without having to install them directly in their project.
+
+**To address:** Update the affected paths if you are using a configuration or ignore file via the `--config` or `--ignore-path` CLI options.
+
+**Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md), [#12887](https://github.com/eslint/eslint/pull/12887)
+
+## <a name="plugin-loading-change"></a> Plugin resolution has been updated
+
+In previous versions, ESLint resolved all plugins from the current working directory by default.
+
+Starting in ESLint v7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file.
+
+This will not change anything in most cases. If a configuration file in a subdirectory has `plugins` defined, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found).
+
+This means that if you are using a config file from a shared location via `--config` option, the plugins that the config file declare will be loaded from the shared config file location.
+
+**To address:** Ensure that plugins are installed in a place that can be resolved relative to your configuration file or use `--resolve-plugins-relative-to .` to override this change.
+
+**Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md), [#12922](https://github.com/eslint/eslint/pull/12922)
+
+## <a name="runtime-deprecation-on-personal-config-files"></a> Runtime deprecation warnings for `~/.eslintrc.*` config files
+
+Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint v7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations:
+
+1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`.
+1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`.
+
+**To address:** Remove `~/.eslintrc.*` configuration files and add a `.eslintrc.*` configuration file to your project. Alternatively, use the `--config` option to use shared config files.
+
+**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678)
+
+## <a name="default-ignore-patterns"></a> Default ignore patterns have changed
+
+Up until now, ESLint has ignored the following files by default:
+
+* Dotfiles (`.*`)
+* `node_modules` in the current working directory (`/node_modules/*`)
+* `bower_components` in the current working directory (`/bower_components/*`)
+
+ESLint v7.0.0 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. Therefore, the new default ignore patterns are:
+
+* Dotfiles except `.eslintrc.*` (`.*` but not `.eslintrc.*`)
+* `node_modules` (`/**/node_modules/*`)
+
+**To address:** Modify your `.eslintignore` or the `ignorePatterns` property of your config file if you don't want to lint `bower_components/*` and `.eslintrc.js`.
+
+**Related issue(s):** [RFC51](https://github.com/eslint/rfcs/blob/master/designs/2019-update-default-ignore-patterns/README.md), [#12888](https://github.com/eslint/eslint/pull/12888)
+
+## <a name="description-in-directive-comments"></a> Descriptions in directive comments
+
+In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary.
+
+To allow for the colocation of comments that provide context with the directive, ESLint v7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--` surrounded by whitespace. For example:
+
+```js
+// eslint-disable-next-line a-rule, another-rule -- those are buggy!!
+```
+
+**To address:** If you have `--` surrounded by whitespace in directive comments, consider moving it into your configuration file.
+
+**Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md), [#12699](https://github.com/eslint/eslint/pull/12699)
+
+## <a name="deprecate-node-rules"></a> Node.js/CommonJS rules have been deprecated
+
+The ten Node.js/CommonJS rules in core have been deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin.
+
+**To address:** As per [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead.
+
+| Deprecated Rules                                                             | Replacement                                                                                                                     |
+| :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
+| [callback-return](https://eslint.org/docs/rules/callback-return)             | [node/callback-return](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/callback-return.md)             |
+| [global-require](https://eslint.org/docs/rules/global-require)               | [node/global-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/global-require.md)               |
+| [handle-callback-err](https://eslint.org/docs/rules/handle-callback-err)     | [node/handle-callback-err](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/handle-callback-err.md)     |
+| [no-mixed-requires](https://eslint.org/docs/rules/no-mixed-requires)         | [node/no-mixed-requires](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-mixed-requires.md)         |
+| [no-new-require](https://eslint.org/docs/rules/no-new-require)               | [node/no-new-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-new-require.md)               |
+| [no-path-concat](https://eslint.org/docs/rules/no-path-concat)               | [node/no-path-concat](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md)               |
+| [no-process-env](https://eslint.org/docs/rules/no-process-env)               | [node/no-process-env](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-env.md)               |
+| [no-process-exit](https://eslint.org/docs/rules/no-process-exit)             | [node/no-process-exit](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-exit.md)             |
+| [no-restricted-modules](https://eslint.org/docs/rules/no-restricted-modules) | [node/no-restricted-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-restricted-require.md) |
+| [no-sync](https://eslint.org/docs/rules/no-sync)                             | [node/no-sync](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-sync.md)                             |
+
+**Related issue(s):** [#12898](https://github.com/eslint/eslint/pull/12898)
+
+## <a name="rules-strict"></a> Several rules have been updated to cover more cases
+
+Several rules have been enhanced and now report additional errors:
+
+* [accessor-pairs](https://eslint.org/docs/rules/accessor-pairs) rule now recognizes class members by default.
+* [array-callback-return](https://eslint.org/docs/rules/array-callback-return) rule now recognizes `flatMap` method.
+* [computed-property-spacing](https://eslint.org/docs/rules/computed-property-spacing) rule now recognizes class members by default.
+* [func-names](https://eslint.org/docs/rules/func-names) rule now recognizes function declarations in default exports.
+* [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens) rule now recognizes parentheses in assignment targets.
+* [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys for static class members.
+* [no-magic-numbers](https://eslint.org/docs/rules/no-magic-numbers) rule now recognizes bigint literals.
+* [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers for the second parameter of `parseInt()`.
+* [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default.
+* [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals.
+
+**To address:** Fix errors or disable these rules.
+
+**Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919)
+
+## <a name="eslint-recommended"></a> `eslint:recommended` has been updated
+
+Three new rules have been enabled in the `eslint:recommended` preset.
+
+* [no-dupe-else-if](https://eslint.org/docs/rules/no-dupe-else-if)
+* [no-import-assign](https://eslint.org/docs/rules/no-import-assign)
+* [no-setter-return](https://eslint.org/docs/rules/no-setter-return)
+
+**To address:** Fix errors or disable these rules.
+
+**Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920)
+
+## <a name="rule-tester-strict"></a> Additional validation added to the `RuleTester` class
+
+The `RuleTester` now validates the following:
+
+* It fails test cases if the rule under test uses the non-standard `node.start` or `node.end` properties. Rules should use `node.range` instead.
+* It fails test cases if the rule under test provides an autofix but a test case doesn't have an `output` property. Add an `output` property to test cases to test the rule's autofix functionality.
+* It fails test cases if any unknown properties are found in the objects in the `errors` property.
+
+**To address:** Modify your rule or test case if existing test cases fail.
+
+**Related issue(s):** [RFC25](https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md), [#12096](https://github.com/eslint/eslint/pull/12096), [#12955](https://github.com/eslint/eslint/pull/12955)
+
+## <a name="deprecate-cliengine"></a> The `CLIEngine` class has been deprecated
+
+The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class).
+
+The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shareable configs/parsers/plugins/formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version.
+
+**To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts:
+
+| `CLIEngine`                                  | `ESLint`                           |
+| :------------------------------------------- | :--------------------------------- |
+| `executeOnFiles(patterns)`                   | `lintFiles(patterns)`              |
+| `executeOnText(text, filePath, warnIgnored)` | `lintText(text, options)`          |
+| `getFormatter(name)`                         | `loadFormatter(name)`              |
+| `getConfigForFile(filePath)`                 | `calculateConfigForFile(filePath)` |
+| `isPathIgnored(filePath)`                    | `isPathIgnored(filePath)`          |
+| `static outputFixes(results)`                | `static outputFixes(results)`      |
+| `static getErrorResults(results)`            | `static getErrorResults(results)`  |
+| `static getFormatter(name)`                  | (removed ※1)                       |
+| `addPlugin(pluginId, definition)`            | the `plugins` constructor option   |
+| `getRules()`                                 | (not implemented yet)              |
+| `resolveFileGlobPatterns()`                  | (removed ※2)                       |
+
+* ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method.
+* ※2 Since ESLint 6, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete.
+
+**Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939)
diff --git a/eslint/docs/src/user-guide/migrating-to-8.0.0.md b/eslint/docs/src/user-guide/migrating-to-8.0.0.md
new file mode 100644 (file)
index 0000000..2b263e4
--- /dev/null
@@ -0,0 +1,309 @@
+---
+title: Migrating to v8.0.0
+layout: doc
+eleventyNavigation:
+    key: migrating to v8
+    parent: user guide
+    title: Migrating to v8.x
+    order: 6
+
+---
+
+ESLint v8.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
+
+The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
+
+## Table of Contents
+
+### Breaking changes for users
+
+* [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
+* [Removed `codeframe` and `table` formatters](#removed-formatters)
+* [`comma-dangle` rule schema is stricter](#comma-dangle)
+* [Unused disable directives are now fixable](#directives)
+* [`eslint:recommended` has been updated](#eslint-recommended)
+
+### Breaking changes for plugin developers
+
+* [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
+* [Rules require `meta.hasSuggestions` to provide suggestions](#suggestions)
+* [Rules require `meta.fixable` to provide fixes](#fixes)
+* [`SourceCode#getComments()` fails in `RuleTester`](#get-comments)
+* [Changes to shorthand property AST format](#ast-format)
+
+### Breaking changes for integration developers
+
+* [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
+* [The `CLIEngine` class has been removed](#remove-cliengine)
+* [The `linter` object has been removed](#remove-linter)
+* [The `/lib` entrypoint has been removed](#remove-lib)
+
+---
+
+## <a name="drop-old-node"></a> Node.js 10, 13, and 15 are no longer supported
+
+Node.js 10, 13, 15 all reached end of life either in 2020 or early 2021. ESLint is officially dropping support for these versions of Node.js starting with ESLint v8.0.0. ESLint now supports the following versions of Node.js:
+
+* Node.js 12.22 and above
+* Node.js 14 and above
+* Node.js 16 and above
+
+**To address:** Make sure you upgrade to at least Node.js `12.22.0` when using ESLint v8.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 7 until you are able to upgrade Node.js.
+
+**Related issue(s):** [#14023](https://github.com/eslint/eslint/issues/14023)
+
+## <a name="removed-formatters"></a> Removed `codeframe` and `table` formatters
+
+ESLint v8.0.0 has removed the `codeframe` and `table` formatters from the core. These formatters required dependencies that weren't used anywhere else in ESLint, and removing them allows us to reduce the size of ESLint, allowing for faster installation.
+
+**To address:** If you are using the `codeframe` or `table` formatters, you'll need to install the standalone [`eslint-formatter-codeframe`](https://github.com/fregante/eslint-formatter-codeframe) or [`eslint-formatter-table`](https://github.com/fregante/eslint-formatter-table) packages, respectively, to be able to use them in ESLint v8.0.0.
+
+**Related issue(s):** [#14277](https://github.com/eslint/eslint/issues/14277), [#14316](https://github.com/eslint/eslint/pull/14316)
+
+## <a name="comma-dangle"></a> `comma-dangle` rule schema is stricter
+
+In ESLint v7.0.0, the `comma-dangle` rule could be configured like this without error:
+
+```json
+{
+    "rules": {
+        "comma-dangle": ["error", "never", { "arrays": "always" }]
+    }
+}
+```
+
+With this configuration, the rule would ignore the third element in the array because only the second element is read. In ESLint v8.0.0, this configuration will cause ESLint to throw an error.
+
+**To address:** Change your rule configuration so that there are only two elements in the array, and the second element is either a string or an object, such as:
+
+```json
+{
+    "comma-dangle": ["error", "never"],
+}
+```
+
+or
+
+```json
+{
+    "comma-dangle": ["error", {
+        "arrays": "never",
+        "objects": "never",
+        "imports": "never",
+        "exports": "never",
+        "functions": "never"
+    }]
+}
+```
+
+**Related issue(s):** [#13739](https://github.com/eslint/eslint/issues/13739)
+
+## <a name="directives"></a> Unused disable directives are now fixable
+
+In ESLint v7.0.0, using both `--report-unused-disable-directives` and `--fix` on the command line would fix only rules but leave unused disable directives in place. In ESLint v8.0.0, this combination of command-line options will result in the unused disable directives being removed.
+
+**To address:** If you are using `--report-unused-disable-directives` and `--fix` together on the command line, and you don't want unused disable directives to be removed, add `--fix-type problem,suggestion,layout` as a command line option.
+
+**Related issue(s):** [#11815](https://github.com/eslint/eslint/issues/11815)
+
+## <a name="eslint-recommended"></a> `eslint:recommended` has been updated
+
+Four new rules have been enabled in the `eslint:recommended` preset.
+
+* [`no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision)
+* [`no-nonoctal-decimal-escape`](https://eslint.org/docs/rules/no-nonoctal-decimal-escape)
+* [`no-unsafe-optional-chaining`](https://eslint.org/docs/rules/no-unsafe-optional-chaining)
+* [`no-useless-backreference`](https://eslint.org/docs/rules/no-useless-backreference)
+
+**To address:** Fix errors or disable these rules.
+
+**Related issue(s):** [#14673](https://github.com/eslint/eslint/issues/14673)
+
+## <a name="suggestions"></a> Rules require `meta.hasSuggestions` to provide suggestions
+
+In ESLint v7.0.0, rules that [provided suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) did not need to let ESLint know. In v8.0.0, rules providing suggestions need to set their `meta.hasSuggestions` to `true`. This informs ESLint that the rule intends to provide suggestions. Without this property, any attempt to provide a suggestion will result in an error.
+
+**To address:** If your rule provides suggestions, add `meta.hasSuggestions` to the object, such as:
+
+```js
+module.exports = {
+    meta: {
+        hasSuggestions: true
+    },
+    create(context) {
+        // your rule
+    }
+};
+```
+
+The [eslint-plugin/require-meta-has-suggestions](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-has-suggestions.md) rule can automatically fix and enforce that your rules are properly specifying `meta.hasSuggestions`.
+
+**Related issue(s):** [#14312](https://github.com/eslint/eslint/issues/14312)
+
+## <a name="fixes"></a> Rules require `meta.fixable` to provide fixes
+
+In ESLint v7.0.0, rules that were written as a function (rather than object) were able to provide fixes. In ESLint v8.0.0, only rules written as an object are allowed to provide fixes and must have a `meta.fixable` property set to either `"code"` or `"whitespace"`.
+
+**To address:** If your rule makes fixes and is written as a function, such as:
+
+```js
+module.exports = function(context) {
+    // your rule
+};
+```
+
+Then rewrite your rule in this format:
+
+```js
+module.exports = {
+    meta: {
+        fixable: "code" // or "whitespace"
+    },
+    create(context) {
+        // your rule
+    }
+};
+```
+
+The [eslint-plugin/require-meta-fixable](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-fixable.md) rule can automatically fix and enforce that your rules are properly specifying `meta.fixable`.
+
+The [eslint-plugin/prefer-object-rule](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-object-rule.md) rule can automatically fix and enforce that your rules are written with the object format instead of the deprecated function format.
+
+See the [rule documentation](https://eslint.org/docs/developer-guide/working-with-rules) for more information on writing rules.
+
+**Related issue(s):** [#13349](https://github.com/eslint/eslint/issues/13349)
+
+## <a name="get-comments"></a> `SourceCode#getComments()` fails in `RuleTester`
+
+Back in ESLint v4.0.0, we deprecated `SourceCode#getComments()`, but we neglected to remove it. Rather than removing it completely in v8.0.0, we are taking the intermediate step of updating `RuleTester` to fail when `SourceCode#getComments()` is used inside of a rule. As such, all existing rules will continue to work, but when the developer runs tests for the rule there will be a failure.
+
+The `SourceCode#getComments()` method will be removed in v9.0.0.
+
+**To address:** If your rule uses `SourceCode#getComments()`, please use [`SourceCode#getCommentsBefore()`, `SourceCode#getCommentsAfter()`, or `SourceCode#getCommentsInside()`](https://eslint.org/docs/developer-guide/working-with-rules#sourcecodegetcommentsbefore-sourcecodegetcommentsafter-and-sourcecodegetcommentsinside).
+
+**Related issue(s):** [#14744](https://github.com/eslint/eslint/issues/14744)
+
+## <a name="ast-format"></a> Changes to shorthand property AST format
+
+ESLint v8.0.0 includes an upgrade to Espree v8.0.0 to support new syntax. This Espree upgrade, in turn, contains an upgrade to Acorn v8.0.0, which changed how shorthand properties were represented in the AST. Here's an example:
+
+```js
+const version = 8;
+const x = {
+    version
+};
+```
+
+This code creates a property node that looks like this:
+
+```json
+{
+    "type": "Property",
+    "method": false,
+    "shorthand": true,
+    "computed": false,
+    "key": {
+        "type": "Identifier",
+        "name": "version"
+    },
+    "kind": "init",
+    "value": {
+        "type": "Identifier",
+        "name": "version"
+    }
+}
+```
+
+Note that both the `key` and the `value` properties contain the same information. Prior to Acorn v8.0.0 (and therefore prior to ESLint v8.0.0), these two nodes were represented by the same object, so you could use `===` to determine if they represented the same node, such as:
+
+```js
+// true in ESLint v7.x, false in ESLint v8.0.0
+if (propertyNode.key === propertyNode.value) {
+    // do something
+}
+```
+
+In ESLint v8.0.0 (via Acorn v8.0.0), the key and value are now separate objects and therefore no longer equivalent.
+
+**To address:** If your rule makes a comparison between the key and value of a shorthand object literal property to determine if they are the same node, you'll need to change your code in one of two ways:
+
+1. Use `propertyNode.shorthand` to determine if the property is a shorthand property node.
+1. Use the `range` property of each node to determine if the key and value occupy the same location.
+
+**Related issue(s):** [#14591](https://github.com/eslint/eslint/pull/14591#issuecomment-887733070)
+
+## <a name="remove-cliengine"></a> The `CLIEngine` class has been removed
+
+The `CLIEngine` class has been removed and replaced by the [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class).
+
+**To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts:
+
+| `CLIEngine`                                  | `ESLint`                           |
+| :------------------------------------------- | :--------------------------------- |
+| `executeOnFiles(patterns)`                   | `lintFiles(patterns)`              |
+| `executeOnText(text, filePath, warnIgnored)` | `lintText(text, options)`          |
+| `getFormatter(name)`                         | `loadFormatter(name)`              |
+| `getConfigForFile(filePath)`                 | `calculateConfigForFile(filePath)` |
+| `isPathIgnored(filePath)`                    | `isPathIgnored(filePath)`          |
+| `static outputFixes(results)`                | `static outputFixes(results)`      |
+| `static getErrorResults(results)`            | `static getErrorResults(results)`  |
+| `static getFormatter(name)`                  | (removed ※1)                      |
+| `addPlugin(pluginId, definition)`            | the `plugins` constructor option   |
+| `getRules()`                                 | (removed ※2)                      |
+| `resolveFileGlobPatterns()`                  | (removed ※3)                      |
+
+* ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method.
+* ※2 The `CLIEngine#getRules()` method had side effects and so was removed. If you were using `CLIEngine#getRules()` to retrieve meta information about rules based on linting results, use `ESLint#getRulesMetaForResults()` instead. If you were using `CLIEngine#getRules()` to retrieve all built-in rules, import `builtinRules` from `eslint/use-at-your-own-risk` for an unsupported API that allows access to internal rules.
+* ※3 Since ESLint v6.0.0, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete.
+
+**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
+
+## <a name="remove-linter"></a> The `linter` object has been removed
+
+The deprecated `linter` object has been removed from the ESLint package in v8.0.0.
+
+**To address:** If you are using the `linter` object, such as:
+
+```js
+const { linter } = require("eslint");
+```
+
+Change your code to this:
+
+```js
+const { Linter } = require("eslint");
+const linter = new Linter();
+```
+
+**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
+
+## <a name="remove-lib"></a> The `/lib` entrypoint has been removed
+
+Beginning in v8.0.0, ESLint is strictly defining its public API. Previously, you could reach into individual files such as `require("eslint/lib/rules/semi")` and this is no longer allowed. There are a limited number of existing APIs that are now available through the `/use-at-your-own-risk` entrypoint for backwards compatibility, but these APIs are not formally supported and may break or disappear at any point in time.
+
+**To address:** If you are accessing rules directly through the `/lib` entrypoint, such as:
+
+```js
+const rule = require("eslint/lib/rules/semi");
+```
+
+Change your code to this:
+
+```js
+const { builtinRules } = require("eslint/use-at-your-own-risk");
+const rule = builtinRules.get("semi");
+```
+
+If you are accessing `FileEnumerator` directly through the `/lib` entrypoint, such as:
+
+```js
+const { FileEnumerator } = require("eslint/lib/cli-engine/file-enumerator");
+```
+
+Change your code to this:
+
+```js
+const { FileEnumerator } = require("eslint/use-at-your-own-risk");
+```
+
+**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
diff --git a/eslint/docs/src/user-guide/rule-deprecation.md b/eslint/docs/src/user-guide/rule-deprecation.md
new file mode 100644 (file)
index 0000000..7766b55
--- /dev/null
@@ -0,0 +1,17 @@
+---
+title: Rule Deprecation
+layout: doc
+
+---
+
+Balancing the trade-offs of improving a tool and the frustration these changes can cause is a difficult task. One key area in which this affects our users is in the removal of rules.
+
+The ESLint team is committed to making upgrading as easy and painless as possible. To that end, the team has agreed upon the following set of guidelines for deprecating rules in the future. The goal of these guidelines is to allow for improvements and changes to be made without breaking existing configurations.
+
+* Rules will never be removed from ESLint.
+* Rules will be deprecated as needed, and marked as such in all documentation.
+* After a rule has been deprecated, the team will no longer do any work on it. This includes bug fixes, enhancements, and updates to the rule's documentation. Issues and pull requests related to deprecated rule will not be accepted and will be closed.
+
+Since deprecated rules will never be removed, you can continue to use them indefinitely if they are working for you. However, keep in mind that deprecated rules will effectively be unmaintained.
+
+We hope that by following these guidelines we will be able to continue improving and working to make ESLint the best tool it can be while causing as little disruption to our users as possible during the process.
diff --git a/eslint/docs/user-guide/README.md b/eslint/docs/user-guide/README.md
deleted file mode 100644 (file)
index 1fcb0df..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# User Guide
-
-This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../developer-guide).
-
-## [Getting Started](getting-started.md)
-
-Want to skip ahead and just start using ESLint? This section gives a high-level overview of installation, setup, and configuration options.
-
-## [Rules](../rules)
-
-ESLint has a lot of rules that you can configure to fine-tune it to your project. This section is an exhaustive list of every rule and link to each rule's documentation.
-
-## [Configuring](configuring/)
-
-Once you've got ESLint running, you'll probably want to adjust the configuration to better suit your project. This section explains all the different ways you can configure ESLint.
-
-## [Command Line Interface](command-line-interface.md)
-
-There are a lot of command line flags for ESLint and this section explains what they do.
-
-## [Integrations](integrations.md)
-
-Wondering if ESLint will work with your favorite editor or build system? This section has a list of all known integrations (submitted by their authors).
-
-## [Rule Deprecation](rule-deprecation.md)
-
-The ESLint team is committed to making upgrading as easy and painless as possible. This section outlines the guidelines the team has set in place for the deprecation of rules in future releases.
-
-## Migrating
-
-If you were using a prior version of ESLint, you can get help with the transition by reading:
-
-- [migrating-to-1.0.0](migrating-to-1.0.0.md)
-- [migrating-to-2.0.0](migrating-to-2.0.0.md)
-- [migrating-to-3.0.0](migrating-to-3.0.0.md)
-- [migrating-to-4.0.0](migrating-to-4.0.0.md)
-- [migrating-to-5.0.0](migrating-to-5.0.0.md)
-- [migrating-to-6.0.0](migrating-to-6.0.0.md)
-- [migrating-to-7.0.0](migrating-to-7.0.0.md)
diff --git a/eslint/docs/user-guide/command-line-interface.md b/eslint/docs/user-guide/command-line-interface.md
deleted file mode 100644 (file)
index 6f350d4..0000000
+++ /dev/null
@@ -1,512 +0,0 @@
-# Command Line Interface
-
-To run ESLint on Node.js, you must have npm installed. If npm is not installed, follow the instructions here: <https://www.npmjs.com/>
-
-Once npm is installed, run the following
-
-    npm i -g eslint
-
-This installs the ESLint CLI from the npm repository. To run ESLint, use the following format:
-
-    eslint [options] [file|dir|glob]*
-
-Such as:
-
-    eslint file1.js file2.js
-
-or:
-
-    eslint lib/**
-
-Please note that when passing a glob as a parameter, it will be expanded by your shell. The results of the expansion can vary depending on your shell, and its configuration. If you want to use node `glob` syntax, you have to quote your parameter (using double quotes if you need it to run in Windows), as follows:
-
-    eslint "lib/**"
-
-## Options
-
-The command line utility has several options. You can view the options by running `eslint -h`.
-
-```text
-eslint [options] file.js [file.js] [dir]
-
-Basic configuration:
-  --no-eslintrc                   Disable use of configuration from .eslintrc.*
-  -c, --config path::String       Use this configuration, overriding .eslintrc.* config options if present
-  --env [String]                  Specify environments
-  --ext [String]                  Specify JavaScript file extensions
-  --global [String]               Define global variables
-  --parser String                 Specify the parser to be used
-  --parser-options Object         Specify parser options
-  --resolve-plugins-relative-to path::String  A folder where plugins should be resolved from, CWD by default
-
-Specifying rules and plugins:
-  --plugin [String]               Specify plugins
-  --rule Object                   Specify rules
-  --rulesdir [path::String]       Load additional rules from this directory. Deprecated: Use rules from plugins
-
-Fixing problems:
-  --fix                           Automatically fix problems
-  --fix-dry-run                   Automatically fix problems without saving the changes to the file system
-  --fix-type Array                Specify the types of fixes to apply (directive, problem, suggestion, layout)
-
-Ignoring files:
-  --ignore-path path::String      Specify path of ignore file
-  --no-ignore                     Disable use of ignore files and patterns
-  --ignore-pattern [String]       Pattern of files to ignore (in addition to those in .eslintignore)
-
-Using stdin:
-  --stdin                         Lint code provided on <STDIN> - default: false
-  --stdin-filename String         Specify filename to process STDIN as
-
-Handling warnings:
-  --quiet                         Report errors only - default: false
-  --max-warnings Int              Number of warnings to trigger nonzero exit code - default: -1
-
-Output:
-  -o, --output-file path::String  Specify file to write report to
-  -f, --format String             Use a specific output format - default: stylish
-  --color, --no-color             Force enabling/disabling of color
-
-Inline configuration comments:
-  --no-inline-config              Prevent comments from changing config or rules
-  --report-unused-disable-directives  Adds reported errors for unused eslint-disable directives
-
-Caching:
-  --cache                         Only check changed files - default: false
-  --cache-file path::String       Path to the cache file. Deprecated: use --cache-location - default: .eslintcache
-  --cache-location path::String   Path to the cache file or directory
-  --cache-strategy String         Strategy to use for detecting changed files in the cache - either: metadata or content - default: metadata
-
-Miscellaneous:
-  --init                          Run config initialization wizard - default: false
-  --env-info                      Output execution environment information - default: false
-  --no-error-on-unmatched-pattern  Prevent errors when pattern is unmatched
-  --exit-on-fatal-error           Exit with exit code 2 in case of fatal error - default: false
-  --debug                         Output debugging information
-  -h, --help                      Show help
-  -v, --version                   Output the version number
-  --print-config path::String     Print the configuration for the given file
-```
-
-Options that accept array values can be specified by repeating the option or with a comma-delimited list (other than `--ignore-pattern` which does not allow the second style).
-
-Example:
-
-    eslint --ext .jsx --ext .js lib/
-
-    eslint --ext .jsx,.js lib/
-
-### Basic configuration
-
-#### `--no-eslintrc`
-
-Disables use of configuration from `.eslintrc.*` and `package.json` files.
-
-Example:
-
-    eslint --no-eslintrc file.js
-
-#### `-c`, `--config`
-
-This option allows you to specify an additional configuration file for ESLint (see [Configuring ESLint](configuring) for more).
-
-Example:
-
-    eslint -c ~/my-eslint.json file.js
-
-This example uses the configuration file at `~/my-eslint.json`.
-
-If `.eslintrc.*` and/or `package.json` files are also used for configuration (i.e., `--no-eslintrc` was not specified), the configurations will be merged. Options from this configuration file have precedence over the options from `.eslintrc.*` and `package.json` files.
-
-#### `--env`
-
-This option enables specific environments. Details about the global variables defined by each environment are available on the [Specifying Environments](configuring/language-options.md#specifying-environments) documentation. This option only enables environments; it does not disable environments set in other configuration files. To specify multiple environments, separate them using commas, or use the option multiple times.
-
-Examples:
-
-    eslint --env browser,node file.js
-    eslint --env browser --env node file.js
-
-#### `--ext`
-
-This option allows you to specify which file extensions ESLint will use when searching for target files in the directories you specify.
-By default, ESLint lints `*.js` files and the files that match the `overrides` entries of your configuration.
-
-Examples:
-
-    # Use only .ts extension
-    eslint . --ext .ts
-
-    # Use both .js and .ts
-    eslint . --ext .js --ext .ts
-
-    # Also use both .js and .ts
-    eslint . --ext .js,.ts
-
-**Note:** `--ext` is only used when the arguments are directories. If you use glob patterns or file names, then `--ext` is ignored.
-
-For example, `eslint lib/* --ext .js` will match all files within the `lib/` directory, regardless of extension.
-
-#### `--global`
-
-This option defines global variables so that they will not be flagged as undefined by the `no-undef` rule. Any specified global variables are assumed to be read-only by default, but appending `:true` to a variable's name ensures that `no-undef` will also allow writes. To specify multiple global variables, separate them using commas, or use the option multiple times.
-
-Examples:
-
-    eslint --global require,exports:true file.js
-    eslint --global require --global exports:true
-
-#### `--parser`
-
-This option allows you to specify a parser to be used by ESLint. By default, `espree` will be used.
-
-#### `--parser-options`
-
-This option allows you to specify parser options to be used by ESLint. Note that the available parser options are determined by the parser being used.
-
-Examples:
-
-    echo '3 ** 4' | eslint --stdin --parser-options=ecmaVersion:6 # will fail with a parsing error
-    echo '3 ** 4' | eslint --stdin --parser-options=ecmaVersion:7 # succeeds, yay!
-
-#### `--resolve-plugins-relative-to`
-
-Changes the folder where plugins are resolved from. By default, plugins are resolved from the current working directory. This option should be used when plugins were installed by someone other than the end user. It should be set to the project directory of the project that has a dependency on the necessary plugins. For example:
-
-* When using a config file that is located outside of the current project (with the `--config` flag), if the config uses plugins which are installed locally to itself, `--resolve-plugins-relative-to` should be set to the directory containing the config file.
-* If an integration has dependencies on ESLint and a set of plugins, and the tool invokes ESLint on behalf of the user with a preset configuration, the tool should set `--resolve-plugins-relative-to` to the top-level directory of the tool.
-
-### Specifying rules and plugins
-
-#### `--plugin`
-
-This option specifies a plugin to load. You can omit the prefix `eslint-plugin-` from the plugin name.
-
-Before using the plugin, you have to install it using npm.
-
-Examples:
-
-    eslint --plugin jquery file.js
-    eslint --plugin eslint-plugin-mocha file.js
-
-#### `--rule`
-
-This option specifies rules to be used. These rules will be merged with any rules specified with configuration files. (You can use `--no-eslintrc` to change that behavior.) To define multiple rules, separate them using commas, or use the option multiple times. The [levn](https://github.com/gkz/levn#levn--) format is used for specifying the rules.
-
-If the rule is defined within a plugin, you have to prefix the rule ID with the plugin name and a `/`.
-
-Examples:
-
-    eslint --rule 'quotes: [error, double]'
-    eslint --rule 'guard-for-in: error' --rule 'brace-style: [error, 1tbs]'
-    eslint --rule 'jquery/dollar-sign: error'
-
-#### `--rulesdir`
-
-**Deprecated**: Use rules from plugins instead.
-
-This option allows you to specify another directory from which to load rules files. This allows you to dynamically load new rules at run time. This is useful when you have custom rules that aren't suitable for being bundled with ESLint.
-
-Example:
-
-    eslint --rulesdir my-rules/ file.js
-
-The rules in your custom rules directory must follow the same format as bundled rules to work properly. You can also specify multiple locations for custom rules by including multiple `--rulesdir` options:
-
-    eslint --rulesdir my-rules/ --rulesdir my-other-rules/ file.js
-
-Note that, as with core rules and plugin rules, you still need to enable the rules in configuration or via the `--rule` CLI option in order to actually run those rules during linting. Specifying a rules directory with `--rulesdir` does not automatically enable the rules within that directory.
-
-### Fixing problems
-
-#### `--fix`
-
-This option instructs ESLint to try to fix as many issues as possible. The fixes are made to the actual files themselves and only the remaining unfixed issues are output. Not all problems are fixable using this option, and the option does not work in these situations:
-
-1. This option throws an error when code is piped to ESLint.
-1. This option has no effect on code that uses a processor, unless the processor opts into allowing autofixes.
-
-If you want to fix code from `stdin` or otherwise want to get the fixes without actually writing them to the file, use the [`--fix-dry-run`](#--fix-dry-run) option.
-
-#### `--fix-dry-run`
-
-This option has the same effect as `--fix` with one difference: the fixes are not saved to the file system. This makes it possible to fix code from `stdin` (when used with the `--stdin` flag).
-
-Because the default formatter does not output the fixed code, you'll have to use another one (e.g. `json`) to get the fixes. Here's an example of this pattern:
-
-```sh
-getSomeText | eslint --stdin --fix-dry-run --format=json
-```
-
-This flag can be useful for integrations (e.g. editor plugins) which need to autofix text from the command line without saving it to the filesystem.
-
-#### `--fix-type`
-
-This option allows you to specify the type of fixes to apply when using either `--fix` or `--fix-dry-run`. The four types of fixes are:
-
-1. `problem` - fix potential errors in the code
-1. `suggestion` - apply fixes to the code that improve it
-1. `layout` - apply fixes that do not change the program structure (AST)
-1. `directive` - apply fixes to inline directives such as `// eslint-disable`
-
-You can specify one or more fix type on the command line. Here are some examples:
-
-```sh
-eslint --fix --fix-type suggestion .
-eslint --fix --fix-type suggestion --fix-type problem .
-eslint --fix --fix-type suggestion,layout .
-```
-
-This option is helpful if you are using another program to format your code but you would still like ESLint to apply other types of fixes.
-
-### Ignoring files
-
-#### `--ignore-path`
-
-This option allows you to specify the file to use as your `.eslintignore`. By default, ESLint looks in the current working directory for `.eslintignore`. You can override this behavior by providing a path to a different file.
-
-Example:
-
-    eslint --ignore-path tmp/.eslintignore file.js
-    eslint --ignore-path .gitignore file.js
-
-#### `--no-ignore`
-
-Disables excluding of files from `.eslintignore`, `--ignore-path`, `--ignore-pattern`, and `ignorePatterns` property in config files.
-
-Example:
-
-    eslint --no-ignore file.js
-
-#### `--ignore-pattern`
-
-This option allows you to specify patterns of files to ignore (in addition to those in `.eslintignore`). You can repeat the option to provide multiple patterns. The supported syntax is the same as for `.eslintignore` [files](configuring/ignoring-code.md#the-eslintignore-file), which use the same patterns as the `.gitignore` [specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns.
-
-Example:
-
-    eslint --ignore-pattern '/lib/' --ignore-pattern '/src/vendor/*' .
-
-### Using stdin
-
-#### `--stdin`
-
-This option tells ESLint to read and lint source code from STDIN instead of from files. You can use this to pipe code to ESLint.
-
-Example:
-
-    cat myfile.js | eslint --stdin
-
-#### `--stdin-filename`
-
-This option allows you to specify a filename to process STDIN as. This is useful when processing files from STDIN and you have rules which depend on the filename.
-
-Example
-
-    cat myfile.js | eslint --stdin --stdin-filename=myfile.js
-
-### Handling warnings
-
-#### `--quiet`
-
-This option allows you to disable reporting on warnings. If you enable this option, only errors are reported by ESLint.
-
-Example:
-
-    eslint --quiet file.js
-
-#### `--max-warnings`
-
-This option allows you to specify a warning threshold, which can be used to force ESLint to exit with an error status if there are too many warning-level rule violations in your project.
-
-Normally, if ESLint runs and finds no errors (only warnings), it will exit with a success exit status. However, if `--max-warnings` is specified and the total warning count is greater than the specified threshold, ESLint will exit with an error status. Specifying a threshold of `-1` or omitting this option will prevent this behavior.
-
-Example:
-
-    eslint --max-warnings 10 file.js
-
-### Output
-
-#### `-o`, `--output-file`
-
-Enable report to be written to a file.
-
-Example:
-
-    eslint -o ./test/test.html
-
-When specified, the given format is output into the provided file name.
-
-#### `-f`, `--format`
-
-This option specifies the output format for the console. Possible formats are:
-
-* [checkstyle](formatters.md/#checkstyle)
-* [compact](formatters.md/#compact)
-* [html](formatters.md/#html)
-* [jslint-xml](formatters.md/#jslint-xml)
-* [json](formatters.md/#json)
-* [junit](formatters.md/#junit)
-* [stylish](formatters.md/#stylish) (the default)
-* [tap](formatters.md/#tap)
-* [unix](formatters.md/#unix)
-* [visualstudio](formatters.md/#visualstudio)
-
-Example:
-
-    eslint -f compact file.js
-
-You can also use a custom formatter from the command line by specifying a path to the custom formatter file.
-
-Example:
-
-    eslint -f ./customformat.js file.js
-
-An npm-installed formatter is resolved with or without `eslint-formatter-` prefix.
-
-Example:
-
-    npm install eslint-formatter-pretty
-
-    eslint -f pretty file.js
-
-    // equivalent:
-    eslint -f eslint-formatter-pretty file.js
-
-When specified, the given format is output to the console. If you'd like to save that output into a file, you can do so on the command line like so:
-
-    eslint -f compact file.js > results.txt
-
-This saves the output into the `results.txt` file.
-
-#### `--color`, `--no-color`
-
-This option forces the enabling/disabling of colorized output. You can use this to override the default behavior, which is to enable colorized output unless no TTY is detected, such as when piping `eslint` through `cat` or `less`.
-
-Examples:
-
-    eslint --color file.js | cat
-    eslint --no-color file.js
-
-### Inline configuration comments
-
-#### `--no-inline-config`
-
-This option prevents inline comments like `/*eslint-disable*/` or
-`/*global foo*/` from having any effect. This allows you to set an ESLint
-config without files modifying it. All inline config comments are ignored, e.g.:
-
-* `/*eslint-disable*/`
-* `/*eslint-enable*/`
-* `/*global*/`
-* `/*eslint*/`
-* `/*eslint-env*/`
-* `// eslint-disable-line`
-* `// eslint-disable-next-line`
-
-Example:
-
-    eslint --no-inline-config file.js
-
-#### `--report-unused-disable-directives`
-
-This option causes ESLint to report directive comments like `// eslint-disable-line` when no errors would have been reported on that line anyway. This can be useful to prevent future errors from unexpectedly being suppressed, by cleaning up old `eslint-disable` comments which are no longer applicable.
-
-**Warning**: When using this option, it is possible that new errors will start being reported whenever ESLint or custom rules are upgraded. For example, suppose a rule has a bug that causes it to report a false positive, and an `eslint-disable` comment is added to suppress the incorrect report. If the bug is then fixed in a patch release of ESLint, the `eslint-disable` comment will become unused since ESLint is no longer generating an incorrect report. This will result in a new reported error for the unused directive if the `report-unused-disable-directives` option is used.
-
-Example:
-
-    eslint --report-unused-disable-directives file.js
-
-### Caching
-
-#### `--cache`
-
-Store the info about processed files in order to only operate on the changed ones. The cache is stored in `.eslintcache` by default. Enabling this option can dramatically improve ESLint's running time by ensuring that only changed files are linted.
-
-**Note:** If you run ESLint with `--cache` and then run ESLint without `--cache`, the `.eslintcache` file will be deleted. This is necessary because the results of the lint might change and make `.eslintcache` invalid. If you want to control when the cache file is deleted, then use `--cache-location` to specify an alternate location for the cache file.
-
-**Note:** Autofixed files are not placed in the cache. Subsequent linting that does not trigger an autofix will place it in the cache.
-
-#### `--cache-file`
-
-Path to the cache file. If none specified `.eslintcache` will be used. The file will be created in the directory where the `eslint` command is executed. **Deprecated**: Use `--cache-location` instead.
-
-#### `--cache-location`
-
-Path to the cache location. Can be a file or a directory. If no location is specified, `.eslintcache` will be used. In that case, the file will be created in the directory where the `eslint` command is executed.
-
-If a directory is specified, a cache file will be created inside the specified folder. The name of the file will be based on the hash of the current working directory (CWD). e.g.: `.cache_hashOfCWD`
-
-**Important note:** If the directory for the cache does not exist make sure you add a trailing `/` on \*nix systems or `\` in windows. Otherwise the path will be assumed to be a file.
-
-Example:
-
-    eslint "src/**/*.js" --cache --cache-location "/Users/user/.eslintcache/"
-
-#### `--cache-strategy`
-
-Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. If no strategy is specified, `metadata` will be used.
-
-The `content` strategy can be useful in cases where the modification time of your files change even if their contents have not. For example, this can happen during git operations like git clone because git does not track file modification time.
-
-Example:
-
-    eslint "src/**/*.js" --cache --cache-strategy content
-
-### Miscellaneous
-
-#### `--init`
-
-This option will start config initialization wizard. It's designed to help new users quickly create .eslintrc file by answering a few questions, choosing a popular style guide, or inspecting your source files and attempting to automatically generate a suitable configuration.
-
-The resulting configuration file will be created in the current directory.
-
-#### `--env-info`
-
-This option outputs information about the execution environment, including the version of Node, npm, and local and global installations of ESLint. The ESLint team may ask for this information to help solve bugs.
-
-#### `--no-error-on-unmatched-pattern`
-
-This option prevents errors when a quoted glob pattern or `--ext` is unmatched. This will not prevent errors when your shell can't match a glob.
-
-#### `--exit-on-fatal-error`
-
-This option causes ESLint to exit with exit code 2 if one or more fatal parsing errors occur. Without this option, fatal parsing errors are reported as rule violations.
-
-#### `--debug`
-
-This option outputs debugging information to the console. This information is useful when you're seeing a problem and having a hard time pinpointing it. The ESLint team may ask for this debugging information to help solve bugs.
-Add this flag to an ESLint command line invocation in order to get extra debug information as the command is run (e.g. `eslint --debug test.js` and `eslint test.js --debug` are equivalent)
-
-#### `-h`, `--help`
-
-This option outputs the help menu, displaying all of the available options. All other options are ignored when this is present.
-
-#### `-v`, `--version`
-
-This option outputs the current ESLint version onto the console. All other options are ignored when this is present.
-
-#### `--print-config`
-
-This option outputs the configuration to be used for the file passed. When present, no linting is performed and only config-related options are valid.
-
-Example:
-
-    eslint --print-config file.js
-
-## Ignoring files from linting
-
-ESLint supports `.eslintignore` files to exclude files from the linting process when ESLint operates on a directory. Files given as individual CLI arguments will be exempt from exclusion. The `.eslintignore` file is a plain text file containing one pattern per line. It can be located in any of the target directory's ancestors; it will affect files in its containing directory as well as all sub-directories. Here's a simple example of a `.eslintignore` file:
-
-    temp.js
-    **/vendor/*.js
-
-A more detailed breakdown of supported patterns and directories ESLint ignores by default can be found in [Ignoring Code](configuring/ignoring-code.md).
-
-## Exit codes
-
-When linting files, ESLint will exit with one of the following exit codes:
-
-* `0`: Linting was successful and there are no linting errors. If the `--max-warnings` flag is set to `n`, the number of linting warnings is at most `n`.
-* `1`: Linting was successful and there is at least one linting error, or there are more linting warnings than allowed by the `--max-warnings` option.
-* `2`: Linting was unsuccessful due to a configuration problem or an internal error.
diff --git a/eslint/docs/user-guide/configuring/README.md b/eslint/docs/user-guide/configuring/README.md
deleted file mode 100644 (file)
index 2d22421..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Configuring ESLint
-
-ESLint is designed to be flexible and configurable for your use case. You can turn off every rule and run only with basic syntax validation or mix and match the bundled rules and your custom rules to fit the needs of your project. There are two primary ways to configure ESLint:
-
-1. **Configuration Comments** - use JavaScript comments to embed configuration information directly into a file.
-1. **Configuration Files** - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of an [`.eslintrc.*`](./configuration-files.md#configuration-file-formats) file or an `eslintConfig` field in a [`package.json`](https://docs.npmjs.com/files/package.json) file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the [command line](https://eslint.org/docs/user-guide/command-line-interface).
-
-Here are some of the options that you can configure in ESLint:
-
-* [**Environments**](./language-options.md#specifying-environments) - which environments your script is designed to run in. Each environment brings with it a certain set of predefined global variables.
-* [**Globals**](./language-options.md#specifying-globals) - the additional global variables your script accesses during execution.
-* [**Rules**](rules.md) - which rules are enabled and at what error level.
-* [**Plugins**](plugins.md) - which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
-
-All of these options give you fine-grained control over how ESLint treats your code.
-
-## Table of Contents
-
-[**Configuration Files**](configuration-files.md)
-
-* [Configuration File Formats](./configuration-files.md#configuration-file-formats)
-* [Using Configuration Files](./configuration-files.md#using-configuration-files)
-* [Adding Shared Settings](./configuration-files.md#adding-shared-settings)
-* [Cascading and Hierarchy](./configuration-files.md#cascading-and-hierarchy)
-* [Extending Configuration Files](./configuration-files.md#extending-configuration-files)
-* [Configuration Based on Glob Patterns](./configuration-files.md#configuration-based-on-glob-patterns)
-* [Personal Configuration Files](./configuration-files.md#personal-configuration-files-deprecated)
-
-[**Language Options**](language-options.md)
-
-* [Specifying Environments](./language-options.md#specifying-environments)
-* [Specifying Globals](./language-options.md#specifying-globals)
-* [Specifying Parser Options](./language-options.md#specifying-parser-options)
-
-[**Rules**](rules.md)
-
-* [Configuring Rules](./rules.md#configuring-rules)
-* [Disabling Rules](./rules.md#disabling-rules)
-
-[**Plugins**](plugins.md)
-
-* [Specifying Parser](./plugins.md#specifying-parser)
-* [Specifying Processor](./plugins.md#specifying-processor)
-* [Configuring Plugins](./plugins.md#configuring-plugins)
-
-[**Ignoring Code**](ignoring-code.md)
-
-* [`ignorePatterns` in Config Files](./ignoring-code.md#ignorepatterns-in-config-files)
-* [The `.eslintignore` File](./ignoring-code.md#the-eslintignore-file)
-* [Using an Alternate File](./ignoring-code.md#using-an-alternate-file)
-* [Using eslintIgnore in package.json](./ignoring-code.md#using-eslintignore-in-packagejson)
-* [Ignored File Warnings](./ignoring-code.md#ignored-file-warnings)
diff --git a/eslint/docs/user-guide/configuring/configuration-files.md b/eslint/docs/user-guide/configuring/configuration-files.md
deleted file mode 100644 (file)
index b1fded2..0000000
+++ /dev/null
@@ -1,439 +0,0 @@
-# Configuration Files
-
-* [Configuration File Formats](#configuration-file-formats)
-* [Using Configuration Files](#using-configuration-files)
-* [Adding Shared Settings](#adding-shared-settings)
-* [Cascading and Hierarchy](#cascading-and-hierarchy)
-* [Extending Configuration Files](#extending-configuration-files)
-* [Configuration Based on Glob Patterns](#configuration-based-on-glob-patterns)
-* [Personal Configuration Files](#personal-configuration-files-deprecated)
-
-## Configuration File Formats
-
-ESLint supports configuration files in several formats:
-
-* **JavaScript** - use `.eslintrc.js` and export an object containing your configuration.
-* **JavaScript (ESM)** - use `.eslintrc.cjs` when running ESLint in JavaScript packages that specify `"type":"module"` in their `package.json`. Note that ESLint does not support ESM configuration at this time.
-* **YAML** - use `.eslintrc.yaml` or `.eslintrc.yml` to define the configuration structure.
-* **JSON** - use `.eslintrc.json` to define the configuration structure. ESLint's JSON files also allow JavaScript-style comments.
-* **package.json** - create an `eslintConfig` property in your `package.json` file and define your configuration there.
-
-If there are multiple configuration files in the same directory, ESLint will only use one. The priority order is as follows:
-
-1. `.eslintrc.js`
-1. `.eslintrc.cjs`
-1. `.eslintrc.yaml`
-1. `.eslintrc.yml`
-1. `.eslintrc.json`
-1. `package.json`
-
-## Using Configuration Files
-
-There are two ways to use configuration files.
-
-The first way to use configuration files is via `.eslintrc.*` and `package.json` files. ESLint will automatically look for them in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (unless `root: true` is specified). Configuration files can be useful when you want different configurations for different parts of a project or when you want others to be able to use ESLint directly without needing to remember to pass in the configuration file.
-
-The second way to use configuration files is to save the file wherever you would like and pass its location to the CLI using the `--config` option, such as:
-
-    eslint -c myconfig.json myfiletotest.js
-
-If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use [`--no-eslintrc`](https://eslint.org/docs/user-guide/command-line-interface#--no-eslintrc) along with the [`-c`](https://eslint.org/docs/user-guide/command-line-interface#-c---config) flag.
-
-Here's an example JSON configuration file that uses the `typescript-eslint` parser to support TypeScript syntax:
-
-```json
-{
-    "root": true,
-    "extends": [
-        "eslint:recommended",
-        "plugin:@typescript-eslint/recommended"
-    ],
-    "parser": "@typescript-eslint/parser",
-    "parserOptions": { "project": ["./tsconfig.json"] },
-    "plugins": [
-        "@typescript-eslint"
-    ],
-    "rules": {
-        "@typescript-eslint/strict-boolean-expressions": [
-            2,
-            {
-                "allowString" : false,
-                "allowNumber" : false
-            }
-        ]
-    },
-    "ignorePatterns": ["src/**/*.test.ts", "src/frontend/generated/*"]
-}
-```
-
-### Comments in configuration files
-
-Both the JSON and YAML configuration file formats support comments (package.json files should not include them). You can use JavaScript-style comments for JSON files and YAML-style comments for YAML files. ESLint safely ignores comments in configuration files. This allows your configuration files to be more human-friendly.
-
-For JavaScript-style comments:
-
-```js
-{
-    "env": {
-        "browser": true
-    },
-    "rules": {
-        // Override our default settings just for this directory
-        "eqeqeq": "warn",
-        "strict": "off"
-    }
-}
-```
-
-For YAML-style comments:
-
-```yaml
-env:
-    browser: true
-rules:
-    # Override default settings
-    eqeqeq: warn
-    strict: off
-```
-
-## Adding Shared Settings
-
-ESLint supports adding shared settings into configuration files. Plugins use `settings` to specify information that should be shared across all of its rules. You can add `settings` object to ESLint configuration file and it will be supplied to every rule being executed. This may be useful if you are adding custom rules and want them to have access to the same information and be easily configurable.
-
-In JSON:
-
-```json
-{
-    "settings": {
-        "sharedData": "Hello"
-    }
-}
-```
-
-And in YAML:
-
-```yaml
----
-  settings:
-    sharedData: "Hello"
-```
-
-## Cascading and Hierarchy
-
-When using `.eslintrc.*` and `package.json` files for configuration, you can take advantage of configuration cascading. Suppose you have the following structure:
-
-```text
-your-project
-├── .eslintrc.json
-├── lib
-│ └── source.js
-└─┬ tests
-  ├── .eslintrc.json
-  └── test.js
-```
-
-The configuration cascade works based on the location of the file being linted. If there is a `.eslintrc` file in the same directory as the file being linted, then that configuration takes precedence. ESLint then searches up the directory structure, merging any `.eslintrc` files it finds along the way until reaching either a `.eslintrc` file with `root: true` or the root directory.
-
-In the same way, if there is a `package.json` file in the root directory with an `eslintConfig` field, the configuration it describes will apply to all subdirectories beneath it, but the configuration described by the `.eslintrc` file in the `tests/` directory will override it where there are conflicting specifications.
-
-```text
-your-project
-├── package.json
-├── lib
-│ └── source.js
-└─┬ tests
-  ├── .eslintrc.json
-  └── test.js
-```
-
-If there is an `.eslintrc` and a `package.json` file found in the same directory, `.eslintrc` will take priority and `package.json` file will not be used.
-
-By default, ESLint will look for configuration files in all parent folders up to the root directory. This can be useful if you want all of your projects to follow a certain convention, but can sometimes lead to unexpected results. To limit ESLint to a specific project, place `"root": true` inside the `.eslintrc.*` file or `eslintConfig` field of the `package.json` file or in the `.eslintrc.*` file at your project's root level. ESLint will stop looking in parent folders once it finds a configuration with `"root": true`.
-
-```js
-{
-    "root": true
-}
-```
-
-And in YAML:
-
-```yaml
----
-  root: true
-```
-
-For example, consider `projectA` which has `"root": true` set in the `.eslintrc` file in the `lib/` directory.  In this case, while linting `main.js`, the configurations within `lib/` will be used, but the `.eslintrc` file in `projectA/` will not.
-
-```text
-home
-└── user
-    └── projectA
-        ├── .eslintrc.json  <- Not used
-        └── lib
-            ├── .eslintrc.json  <- { "root": true }
-            └── main.js
-```
-
-The complete configuration hierarchy, from highest to lowest precedence, is as follows:
-
-1. Inline configuration
-    1. `/*eslint-disable*/` and `/*eslint-enable*/`
-    1. `/*global*/`
-    1. `/*eslint*/`
-    1. `/*eslint-env*/`
-1. Command line options (or CLIEngine equivalents):
-    1. `--global`
-    1. `--rule`
-    1. `--env`
-    1. `-c`, `--config`
-1. Project-level configuration:
-    1. `.eslintrc.*` or `package.json` file in the same directory as the linted file
-    1. Continue searching for `.eslintrc.*` and `package.json` files in ancestor directories up to and including the root directory or until a config with `"root": true` is found.
-
-## Extending Configuration Files
-
-A configuration file, once extended, can inherit all the traits of another configuration file (including rules, plugins, and language options) and modify all the options. As a result, there are three configurations, as defined below:
-
-* Base config: the configuration that is extended.
-* Derived config: the configuration that extends the base configuration.
-* Resulting actual config: the result of merging the derived configuration into the base configuration.
-
-The `extends` property value is either:
-
-* a string that specifies a configuration (either a path to a config file, the name of a shareable config, `eslint:recommended`, or `eslint:all`)
-* an array of strings where each additional configuration extends the preceding configurations
-
-ESLint extends configurations recursively, so a base configuration can also have an `extends` property. Relative paths and shareable config names in an `extends` property are resolved from the location of the config file where they appear.
-
-The `eslint-config-` prefix can be omitted from the configuration name. For example, `airbnb` resolves as `eslint-config-airbnb`.
-
-The `rules` property can do any of the following to extend (or override) the set of rules:
-
-* enable additional rules
-* change an inherited rule's severity without changing its options:
-    * Base config: `"eqeqeq": ["error", "allow-null"]`
-    * Derived config: `"eqeqeq": "warn"`
-    * Resulting actual config: `"eqeqeq": ["warn", "allow-null"]`
-* override options for rules from base configurations:
-    * Base config: `"quotes": ["error", "single", "avoid-escape"]`
-    * Derived config: `"quotes": ["error", "single"]`
-    * Resulting actual config: `"quotes": ["error", "single"]`
-* override options for rules given as object from base configurations:
-    * Base config: `"max-lines": ["error", { "max": 200, "skipBlankLines": true, "skipComments": true }]`
-    * Derived config: `"max-lines": ["error", { "max": 100 }]`
-    * Resulting actual config: `"max-lines": ["error", { "max": 100 }]` where `skipBlankLines` and `skipComments` default to `false`
-
-### Using a shareable configuration package
-
-A [sharable configuration](https://eslint.org/docs/developer-guide/shareable-configs) is an npm package that exports a configuration object. Make sure that you have installed the package in your project root directory, so that ESLint can require it.
-
-The `extends` property value can omit the `eslint-config-` prefix of the package name.
-
-The `eslint --init` command can create a configuration so you can extend a popular style guide (for example, `eslint-config-standard`).
-
-Example of a configuration file in YAML format:
-
-```yaml
-extends: standard
-rules:
-  comma-dangle:
-    - error
-    - always
-  no-empty: warn
-```
-
-### Using `eslint:recommended`
-
-Using `"eslint:recommended"` in the `extends` property enables a subset of core rules that report common problems (these rules are identified with a checkmark (recommended) on the [rules page](https://eslint.org/docs/rules/)).
-
-Here's an example of extending `eslint:recommended` and overriding some of the set configuration options:
-
-Example of a configuration file in JavaScript format:
-
-```js
-module.exports = {
-    "extends": "eslint:recommended",
-    "rules": {
-        // enable additional rules
-        "indent": ["error", 4],
-        "linebreak-style": ["error", "unix"],
-        "quotes": ["error", "double"],
-        "semi": ["error", "always"],
-
-        // override configuration set by extending "eslint:recommended"
-        "no-empty": "warn",
-        "no-cond-assign": ["error", "always"],
-
-        // disable rules from base configurations
-         "for-direction": "off",
-    }
-}
-```
-
-### Using a configuration from a plugin
-
-A [plugin](https://eslint.org/docs/developer-guide/working-with-plugins) is an npm package that can add various extensions to ESLint. A plugin can perform numerous functions, including but not limited to adding new rules and exporting [shareable configurations](https://eslint.org/docs/developer-guide/working-with-plugins#configs-in-plugins). Make sure the package has been installed in a directory where ESLint can require it.
-
-The `plugins` [property value](./plugins.md#configuring-plugins) can omit the `eslint-plugin-` prefix of the package name.
-
-The `extends` property value can consist of:
-
-* `plugin:`
-* the package name (from which you can omit the prefix, for example, `react` is short for `eslint-plugin-react`)
-* `/`
-* the configuration name (for example, `recommended`)
-
-Example of a configuration file in JSON format:
-
-```json
-{
-    "plugins": [
-        "react"
-    ],
-    "extends": [
-        "eslint:recommended",
-        "plugin:react/recommended"
-    ],
-    "rules": {
-       "react/no-set-state": "off"
-    }
-}
-```
-
-### Using a configuration file
-
-The `extends` property value can be an absolute or relative path to a base [configuration file](#using-configuration-files). ESLint resolves a relative path to a base configuration file relative to the configuration file that uses it.
-
-Example of a configuration file in JSON format:
-
-```json
-{
-    "extends": [
-        "./node_modules/coding-standard/eslintDefaults.js",
-        "./node_modules/coding-standard/.eslintrc-es6",
-        "./node_modules/coding-standard/.eslintrc-jsx"
-    ],
-    "rules": {
-        "eqeqeq": "warn"
-    }
-}
-```
-
-### Using `"eslint:all"`
-
-The `extends` property value can be `"eslint:all"` to enable all core rules in the currently installed version of ESLint. The set of core rules can change at any minor or major version of ESLint.
-
-**Important:** This configuration is **not recommended for production use** because it changes with every minor and major version of ESLint. Use it at your own risk.
-
-You might enable all core rules as a shortcut to explore rules and options while you decide on the configuration for a project, especially if you rarely override options or disable rules. The default options for rules are not endorsements by ESLint (for example, the default option for the [`quotes`](https://eslint.org/docs/rules/quotes) rule does not mean double quotes are better than single quotes).
-
-If your configuration extends `eslint:all`, after you upgrade to a newer major or minor version of ESLint, review the reported problems before you use the `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix), so you know if a new fixable rule will make changes to the code.
-
-Example of a configuration file in JavaScript format:
-
-```js
-module.exports = {
-    "extends": "eslint:all",
-    "rules": {
-        // override default options
-        "comma-dangle": ["error", "always"],
-        "indent": ["error", 2],
-        "no-cond-assign": ["error", "always"],
-
-        // disable now, but enable in the future
-        "one-var": "off", // ["error", "never"]
-
-        // disable
-        "init-declarations": "off",
-        "no-console": "off",
-        "no-inline-comments": "off",
-    }
-}
-```
-
-## Configuration Based on Glob Patterns
-
-<b>v4.1.0+.</b> Sometimes a more fine-controlled configuration is necessary, for example, if the configuration for files within the same directory has to be different. Therefore you can provide configurations under the `overrides` key that will only apply to files that match specific glob patterns, using the same format you would pass on the command line (e.g., `app/**/*.test.js`).
-
-### How do overrides work?
-
-It is possible to override settings based on file glob patterns in your configuration by using the `overrides` key. An example of using the `overrides` key is as follows:
-
-In your `.eslintrc.json`:
-
-```json
-{
-  "rules": {
-    "quotes": ["error", "double"]
-  },
-
-  "overrides": [
-    {
-      "files": ["bin/*.js", "lib/*.js"],
-      "excludedFiles": "*.test.js",
-      "rules": {
-        "quotes": ["error", "single"]
-      }
-    }
-  ]
-}
-```
-
-Here is how overrides work in a configuration file:
-
-* The patterns are applied against the file path relative to the directory of the config file. For example, if your config file has the path `/Users/john/workspace/any-project/.eslintrc.js` and the file you want to lint has the path `/Users/john/workspace/any-project/lib/util.js`, then the pattern provided in `.eslintrc.js` will be executed against the relative path `lib/util.js`.
-* Glob pattern overrides have higher precedence than the regular configuration in the same config file. Multiple overrides within the same config are applied in order. That is, the last override block in a config file always has the highest precedence.
-* A glob specific configuration works almost the same as any other ESLint config. Override blocks can contain any configuration options that are valid in a regular config, with the exception of `root` and `ignorePatterns`.
-    * A glob specific configuration can have an `extends` setting, but the `root` property in the extended configs is ignored. The `ignorePatterns` property in the extended configs is used only for the files the glob specific configuration matched.
-    * Nested `overrides` setting will be applied only if the glob patterns of both of the parent config and the child config matched. This is the same when the extended configs have an `overrides` setting.
-* Multiple glob patterns can be provided within a single override block. A file must match at least one of the supplied patterns for the configuration to apply.
-* Override blocks can also specify patterns to exclude from matches. If a file matches any of the excluded patterns, the configuration won't apply.
-
-### Relative glob patterns
-
-```pt
-project-root
-├── app
-│   ├── lib
-│   │   ├── foo.js
-│   │   ├── fooSpec.js
-│   ├── components
-│   │   ├── bar.js
-│   │   ├── barSpec.js
-│   ├── .eslintrc.json
-├── server
-│   ├── server.js
-│   ├── serverSpec.js
-├── .eslintrc.json
-```
-
-The config in `app/.eslintrc.json` defines the glob pattern `**/*Spec.js`. This pattern is relative to the base directory of `app/.eslintrc.json`. So, this pattern would match `app/lib/fooSpec.js` and `app/components/barSpec.js` but **NOT** `server/serverSpec.js`. If you defined the same pattern in the `.eslintrc.json` file within in the `project-root` folder, it would match all three of the `*Spec` files.
-
-If a config is provided via the `--config` CLI option, the glob patterns in the config are relative to the current working directory rather than the base directory of the given config. For example, if `--config configs/.eslintrc.json` is present, the glob patterns in the config are relative to `.` rather than `./configs`.
-
-### Specifying target files to lint
-
-If you specified directories with CLI (e.g., `eslint lib`), ESLint searches target files in the directory to lint. The target files are `*.js` or the files that match any of `overrides` entries (but exclude entries that are any of `files` end with `*`).
-
-If you specified the [`--ext`](https://eslint.org/docs/user-guide/command-line-interface#ext) command line option along with directories, the target files are only the files that have specified file extensions regardless of `overrides` entries.
-
-## Personal Configuration Files (deprecated)
-
-⚠️ **This feature has been deprecated**. This feature will be removed in the 8.0.0 release. If you want to continue to use personal configuration files, please use the [`--config` CLI option](https://eslint.org/docs/user-guide/command-line-interface#-c---config). For more information regarding this decision, please see [RFC 28](https://github.com/eslint/rfcs/pull/28) and [RFC 32](https://github.com/eslint/rfcs/pull/32).
-
-`~/` refers to [the home directory of the current user on your preferred operating system](https://nodejs.org/api/os.html#os_os_homedir). The personal configuration file being referred to here is `~/.eslintrc.*` file, which is currently handled differently than other configuration files.
-
-### How does ESLint find personal configuration files?
-
-If `eslint` could not find any configuration file in the project, `eslint` loads `~/.eslintrc.*` file.
-
-If `eslint` could find configuration files in the project, `eslint` ignores `~/.eslintrc.*` file even if it's in an ancestor directory of the project directory.
-
-### How do personal configuration files behave?
-
-`~/.eslintrc.*` files behave similarly to regular configuration files, with some exceptions:
-
-`~/.eslintrc.*` files load shareable configs and custom parsers from `~/node_modules/` – similarly to `require()` – in the user's home directory. Please note that it doesn't load global-installed packages.
-
-`~/.eslintrc.*` files load plugins from `$CWD/node_modules` by default in order to identify plugins uniquely. If you want to use plugins with `~/.eslintrc.*` files, plugins must be installed locally per project. Alternatively, you can use the [`--resolve-plugins-relative-to` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--resolve-plugins-relative-to) to change the location from which ESLint loads plugins.
diff --git a/eslint/docs/user-guide/configuring/ignoring-code.md b/eslint/docs/user-guide/configuring/ignoring-code.md
deleted file mode 100644 (file)
index 35c2d25..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-# Ignoring Code
-
-* [`ignorePatterns` in Config Files](#ignorepatterns-in-config-files)
-* [The `.eslintignore` File](#the-eslintignore-file)
-* [Using an Alternate File](#using-an-alternate-file)
-* [Using eslintIgnore in package.json](#using-eslintignore-in-packagejson)
-* [Ignored File Warnings](#ignored-file-warnings)
-
-## `ignorePatterns` in Config Files
-
-You can tell ESLint to ignore specific files and directories using `ignorePatterns` in your config files. `ignorePatterns` patterns follow the same rules as `.eslintignore`. Please see the [the `.eslintignore` file documentation](./ignoring-code.md#the-eslintignore-file) to learn more.
-
-```json
-{
-    "ignorePatterns": ["temp.js", "**/vendor/*.js"],
-    "rules": {
-        //...
-    }
-}
-```
-
-* Glob patterns in `ignorePatterns` are relative to the directory that the config file is placed in.
-* You cannot write `ignorePatterns` property under `overrides` property.
-* Patterns defined in `.eslintignore` take precedence over the `ignorePatterns` property of config files.
-
-If a glob pattern starts with `/`, the pattern is relative to the base directory of the config file. For example, `/foo.js` in `lib/.eslintrc.json` matches to `lib/foo.js` but not `lib/subdir/foo.js`.
-
-If a config is provided via the `--config` CLI option, the ignore patterns that start with `/` in the config are relative to the current working directory rather than the base directory of the given config. For example, if `--config configs/.eslintrc.json` is present, the ignore patterns in the config are relative to `.` rather than `./configs`.
-
-## The `.eslintignore` File
-
-You can tell ESLint to ignore specific files and directories by creating an `.eslintignore` file in your project's root directory. The `.eslintignore` file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting. For example, the following will omit all JavaScript files:
-
-```text
-**/*.js
-```
-
-When ESLint is run, it looks in the current working directory to find an `.eslintignore` file before determining which files to lint. If this file is found, then those preferences are applied when traversing directories. Only one `.eslintignore` file can be used at a time, so `.eslintignore` files other than the one in the current working directory will not be used.
-
-Globs are matched using [node-ignore](https://github.com/kaelzhang/node-ignore), so a number of features are available:
-
-* Lines beginning with `#` are treated as comments and do not affect the ignore patterns.
-* Paths are relative to the current working directory. This is also true of paths passed in via the `--ignore-pattern` [command](https://eslint.org/docs/user-guide/command-line-interface#--ignore-pattern).
-* Lines preceded by `!` are negated patterns that re-include a pattern that was ignored by an earlier pattern.
-* Ignore patterns behave according to the `.gitignore` [specification](https://git-scm.com/docs/gitignore).
-
-Of particular note is that like `.gitignore` files, all paths used as patterns for both `.eslintignore` and `--ignore-pattern` must use forward slashes as their path separators.
-
-```text
-# Valid
-/root/src/*.js
-
-# Invalid
-\root\src\*.js
-```
-
-Please see [`.gitignore`](https://git-scm.com/docs/gitignore)'s specification for further examples of valid syntax.
-
-In addition to any patterns in the `.eslintignore` file, ESLint always follows a couple of implicit ignore rules even if the `--no-ignore` flag is passed. The implicit rules are as follows:
-
-* `node_modules/` is ignored.
-* dot-files (except for `.eslintrc.*`), as well as dot-folders and their contents, are ignored.
-
-There are also some exceptions to these rules:
-
-* If the path to lint is a glob pattern or directory path and contains a dot-folder, all dot-files and dot-folders will be linted. This includes dot-files and dot-folders that are buried deeper in the directory structure.
-
-  For example, `eslint .config/` will lint all dot-folders and dot-files in the `.config` directory, including immediate children as well as children that are deeper in the directory structure.
-
-* If the path to lint is a specific file path and the `--no-ignore` flag has been passed, ESLint will lint the file regardless of the implicit ignore rules.
-
-  For example, `eslint .config/my-config-file.js --no-ignore` will cause `my-config-file.js` to be linted. It should be noted that the same command without the `--no-ignore` line will not lint the `my-config-file.js` file.
-
-* Allowlist and denylist rules specified via `--ignore-pattern` or `.eslintignore` are prioritized above implicit ignore rules.
-
-  For example, in this scenario, `.build/test.js` is the desired file to allowlist. Because all dot-folders and their children are ignored by default, `.build` must first be allowlisted so that eslint becomes aware of its children. Then, `.build/test.js` must be explicitly allowlisted, while the rest of the content is denylisted. This is done with the following `.eslintignore` file:
-
-  ```text
-  # Allowlist 'test.js' in the '.build' folder
-  # But do not allow anything else in the '.build' folder to be linted
-  !.build
-  .build/*
-  !.build/test.js
-  ```
-
-  The following `--ignore-pattern` is also equivalent:
-
-      eslint --ignore-pattern '!.build' --ignore-pattern '.build/*' --ignore-pattern '!.build/test.js' parent-folder/
-
-## Using an Alternate File
-
-If you'd prefer to use a different file than the `.eslintignore` in the current working directory, you can specify it on the command line using the `--ignore-path` option. For example, you can use `.jshintignore` file because it has the same format:
-
-    eslint --ignore-path .jshintignore file.js
-
-You can also use your `.gitignore` file:
-
-    eslint --ignore-path .gitignore file.js
-
-Any file that follows the standard ignore file format can be used. Keep in mind that specifying `--ignore-path` means that any existing `.eslintignore` file will not be used. Note that globbing rules in `.eslintignore` follow those of `.gitignore`.
-
-## Using eslintIgnore in package.json
-
-If an `.eslintignore` file is not found and an alternate file is not specified, ESLint will look in package.json for an `eslintIgnore` key to check for files to ignore.
-
-    {
-      "name": "mypackage",
-      "version": "0.0.1",
-      "eslintConfig": {
-          "env": {
-              "browser": true,
-              "node": true
-          }
-      },
-      "eslintIgnore": ["hello.js", "world.js"]
-    }
-
-## Ignored File Warnings
-
-When you pass directories to ESLint, files and directories are silently ignored. If you pass a specific file to ESLint, then you will see a warning indicating that the file was skipped. For example, suppose you have an `.eslintignore` file that looks like this:
-
-```text
-foo.js
-```
-
-And then you run:
-
-    eslint foo.js
-
-You'll see this warning:
-
-```text
-foo.js
-  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
-
-✖ 1 problem (0 errors, 1 warning)
-```
-
-This message occurs because ESLint is unsure if you wanted to actually lint the file or not. As the message indicates, you can use `--no-ignore` to omit using the ignore rules.
-
-Consider another scenario where you may want to run ESLint on a specific dot-file or dot-folder, but have forgotten to specifically allow those files in your `.eslintignore` file. You would run something like this:
-
-    eslint .config/foo.js
-
-You would see this warning:
-
-```text
-.config/foo.js
-  0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override
-
-✖ 1 problem (0 errors, 1 warning)
-```
-
-This message occurs because, normally, this file would be ignored by ESLint's implicit ignore rules (as mentioned above). A negated ignore rule in your `.eslintignore` file would override the implicit rule and reinclude this file for linting. Additionally, in this specific case, `--no-ignore` could be used to lint the file as well.
diff --git a/eslint/docs/user-guide/configuring/language-options.md b/eslint/docs/user-guide/configuring/language-options.md
deleted file mode 100644 (file)
index d44959d..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-# Language Options
-
-* [Specifying Environments](#specifying-environments)
-* [Specifying Globals](#specifying-globals)
-* [Specifying Parser Options](#specifying-parser-options)
-
-## Specifying Environments
-
-An environment provides predefined global variables. The available environments are:
-
-* `browser` - browser global variables.
-* `node` - Node.js global variables and Node.js scoping.
-* `commonjs` - CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).
-* `shared-node-browser` - Globals common to both Node.js and Browser.
-* `es6` - enable all ECMAScript 6 features except for modules (this automatically sets the `ecmaVersion` parser option to 6).
-* `es2017` - adds all ECMAScript 2017 globals and automatically sets the `ecmaVersion` parser option to 8.
-* `es2020` - adds all ECMAScript 2020 globals and automatically sets the `ecmaVersion` parser option to 11.
-* `es2021` - adds all ECMAScript 2021 globals and automatically sets the `ecmaVersion` parser option to 12.
-* `worker` - web workers global variables.
-* `amd` - defines `require()` and `define()` as global variables as per the [amd](https://github.com/amdjs/amdjs-api/wiki/AMD) spec.
-* `mocha` - adds all of the Mocha testing global variables.
-* `jasmine` - adds all of the Jasmine testing global variables for version 1.3 and 2.0.
-* `jest` - Jest global variables.
-* `phantomjs` - PhantomJS global variables.
-* `protractor` - Protractor global variables.
-* `qunit` - QUnit global variables.
-* `jquery` - jQuery global variables.
-* `prototypejs` - Prototype.js global variables.
-* `shelljs` - ShellJS global variables.
-* `meteor` - Meteor global variables.
-* `mongo` - MongoDB global variables.
-* `applescript` - AppleScript global variables.
-* `nashorn` - Java 8 Nashorn global variables.
-* `serviceworker` - Service Worker global variables.
-* `atomtest` - Atom test helper globals.
-* `embertest` - Ember test helper globals.
-* `webextensions` - WebExtensions globals.
-* `greasemonkey` - GreaseMonkey globals.
-
-These environments are not mutually exclusive, so you can define more than one at a time.
-
-Environments can be specified inside of a file, in configuration files or using the `--env` [command line](https://eslint.org/docs/user-guide/command-line-interface) flag.
-
-### Using configuration comments
-
-To specify environments using a comment inside of your JavaScript file, use the following format:
-
-```js
-/* eslint-env node, mocha */
-```
-
-This enables Node.js and Mocha environments.
-
-### Using configuration files
-
-To specify environments in a configuration file, use the `env` key and specify which environments you want to enable by setting each to `true`. For example, the following enables the browser and Node.js environments:
-
-```json
-{
-    "env": {
-        "browser": true,
-        "node": true
-    }
-}
-```
-
-Or in a `package.json` file
-
-```json
-{
-    "name": "mypackage",
-    "version": "0.0.1",
-    "eslintConfig": {
-        "env": {
-            "browser": true,
-            "node": true
-        }
-    }
-}
-```
-
-And in YAML:
-
-```yaml
----
-  env:
-    browser: true
-    node: true
-```
-
-### Using a plugin
-
-If you want to use an environment from a plugin, be sure to specify the plugin name in the `plugins` array and then use the unprefixed plugin name, followed by a slash, followed by the environment name. For example:
-
-```json
-{
-    "plugins": ["example"],
-    "env": {
-        "example/custom": true
-    }
-}
-```
-
-Or in a `package.json` file
-
-```json
-{
-    "name": "mypackage",
-    "version": "0.0.1",
-    "eslintConfig": {
-        "plugins": ["example"],
-        "env": {
-            "example/custom": true
-        }
-    }
-}
-```
-
-## Specifying Globals
-
-Some of ESLint's core rules rely on knowledge of the global variables available to your code at runtime. Since these can vary greatly between different environments as well as be modified at runtime, ESLint makes no assumptions about what global variables exist in your execution environment. If you would like to use rules that require knowledge of what global variables are available, you can define global variables in your configuration file or by using configuration comments in your source code.
-
-### Using configuration comments
-
-To specify globals using a comment inside of your JavaScript file, use the following format:
-
-```js
-/* global var1, var2 */
-```
-
-This defines two global variables, `var1` and `var2`. If you want to optionally specify that these global variables can be written to (rather than only being read), then you can set each with a `"writable"` flag:
-
-```js
-/* global var1:writable, var2:writable */
-```
-
-### Using configuration files
-
-To configure global variables inside of a configuration file, set the `globals` configuration property to an object containing keys named for each of the global variables you want to use. For each global variable key, set the corresponding value equal to `"writable"` to allow the variable to be overwritten or `"readonly"` to disallow overwriting. For example:
-
-```json
-{
-    "globals": {
-        "var1": "writable",
-        "var2": "readonly"
-    }
-}
-```
-
-And in YAML:
-
-```yaml
----
-  globals:
-    var1: writable
-    var2: readonly
-```
-
-These examples allow `var1` to be overwritten in your code, but disallow it for `var2`.
-
-Globals can be disabled with the string `"off"`. For example, in an environment where most ES2015 globals are available but `Promise` is unavailable, you might use this config:
-
-```json
-{
-    "env": {
-        "es6": true
-    },
-    "globals": {
-        "Promise": "off"
-    }
-}
-```
-
-For historical reasons, the boolean value `false` and the string value `"readable"` are equivalent to `"readonly"`. Similarly, the boolean value `true` and the string value `"writeable"` are equivalent to `"writable"`. However, the use of older values is deprecated.
-
-## Specifying Parser Options
-
-ESLint allows you to specify the JavaScript language options you want to support. By default, ESLint expects ECMAScript 5 syntax. You can override that setting to enable support for other ECMAScript versions as well as JSX by using parser options.
-
-Please note that supporting JSX syntax is not the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) if you are using React and want React semantics.
-By the same token, supporting ES6 syntax is not the same as supporting new ES6 globals (e.g., new types such as
-`Set`).
-For ES6 syntax, use `{ "parserOptions": { "ecmaVersion": 6 } }`; for new ES6 global variables, use `{ "env":
-{ "es6": true } }`. `{ "env": { "es6": true } }` enables ES6 syntax automatically, but `{ "parserOptions": { "ecmaVersion": 6 } }` does not enable ES6 globals automatically.
-
-Parser options are set in your `.eslintrc.*` file by using the `parserOptions` property. The available options are:
-
-* `ecmaVersion` - set to 3, 5 (default), 6, 7, 8, 9, 10, 11, 12, or 13 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), or 2022 (same as 13) to use the year-based naming. You can also set "latest" to use the most recently supported version.
-* `sourceType` - set to `"script"` (default) or `"module"` if your code is in ECMAScript modules.
-* `allowReserved` - allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
-* `ecmaFeatures` - an object indicating which additional language features you'd like to use:
-    * `globalReturn` - allow `return` statements in the global scope
-    * `impliedStrict` - enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater)
-    * `jsx` - enable [JSX](https://facebook.github.io/jsx/)
-
-Here's an example `.eslintrc.json` file:
-
-```json
-{
-    "parserOptions": {
-        "ecmaVersion": "latest",
-        "sourceType": "module",
-        "ecmaFeatures": {
-            "jsx": true
-        }
-    },
-    "rules": {
-        "semi": "error"
-    }
-}
-```
-
-Setting parser options helps ESLint determine what is a parsing error. All language options are `false` by default.
diff --git a/eslint/docs/user-guide/configuring/plugins.md b/eslint/docs/user-guide/configuring/plugins.md
deleted file mode 100644 (file)
index 9d2c929..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-# Plugins
-
-* [Specifying Parser](#specifying-parser)
-* [Specifying Processor](#specifying-processor)
-* [Configuring Plugins](#configuring-plugins)
-
-## Specifying Parser
-
-By default, ESLint uses [Espree](https://github.com/eslint/espree) as its parser. You can optionally specify that a different parser should be used in your configuration file so long as the parser meets the following requirements:
-
-1. It must be a Node module loadable from the config file where the parser is used. Usually, this means you should install the parser package separately using npm.
-1. It must conform to the [parser interface](https://eslint.org/docs/developer-guide/working-with-custom-parsers).
-
-Note that even with these compatibilities, there are no guarantees that an external parser will work correctly with ESLint and ESLint will not fix bugs related to incompatibilities with other parsers.
-
-To indicate the npm module to use as your parser, specify it using the `parser` option in your `.eslintrc` file. For example, the following specifies to use Esprima instead of Espree:
-
-```json
-{
-    "parser": "esprima",
-    "rules": {
-        "semi": "error"
-    }
-}
-```
-
-The following parsers are compatible with ESLint:
-
-* [Esprima](https://www.npmjs.com/package/esprima)
-* [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) - A wrapper around the [Babel](https://babeljs.io) parser that makes it compatible with ESLint.
-* [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser) - A parser that converts TypeScript into an ESTree-compatible form so it can be used in ESLint.
-
-Note when using a custom parser, the `parserOptions` configuration property is still required for ESLint to work properly with features not in ECMAScript 5 by default. Parsers are all passed `parserOptions` and may or may not use them to determine which features to enable.
-
-## Specifying Processor
-
-Plugins may provide processors. Processors can extract JavaScript code from other kinds of files, then let ESLint lint the JavaScript code or processors can convert JavaScript code in preprocessing for some purpose.
-
-To specify processors in a configuration file, use the `processor` key with the concatenated string of a plugin name and a processor name by a slash. For example, the following enables the processor `a-processor` that the plugin `a-plugin` provided:
-
-```json
-{
-    "plugins": ["a-plugin"],
-    "processor": "a-plugin/a-processor"
-}
-```
-
-To specify processors for specific kinds of files, use the combination of the `overrides` key and the `processor` key. For example, the following uses the processor `a-plugin/markdown` for `*.md` files.
-
-```json
-{
-    "plugins": ["a-plugin"],
-    "overrides": [
-        {
-            "files": ["*.md"],
-            "processor": "a-plugin/markdown"
-        }
-    ]
-}
-```
-
-Processors may make named code blocks such as `0.js` and `1.js`. ESLint handles such a named code block as a child file of the original file. You can specify additional configurations for named code blocks in the `overrides` section of the config. For example, the following disables the `strict` rule for the named code blocks which end with `.js` in markdown files.
-
-```json
-{
-    "plugins": ["a-plugin"],
-    "overrides": [
-        {
-            "files": ["*.md"],
-            "processor": "a-plugin/markdown"
-        },
-        {
-            "files": ["**/*.md/*.js"],
-            "rules": {
-                "strict": "off"
-            }
-        }
-    ]
-}
-```
-
-ESLint checks the file path of named code blocks then ignores those if any `overrides` entry didn't match the file path. Be sure to add an `overrides` entry if you want to lint named code blocks other than `*.js`.
-
-## Configuring Plugins
-
-ESLint supports the use of third-party plugins. Before using the plugin, you have to install it using npm.
-
-To configure plugins inside of a configuration file, use the `plugins` key, which contains a list of plugin names. The `eslint-plugin-` prefix can be omitted from the plugin name.
-
-```json
-{
-    "plugins": [
-        "plugin1",
-        "eslint-plugin-plugin2"
-    ]
-}
-```
-
-And in YAML:
-
-```yaml
----
-  plugins:
-    - plugin1
-    - eslint-plugin-plugin2
-```
-
-**Notes:**
-
-1. Plugins are resolved relative to the config file. In other words, ESLint will load the plugin as a user would obtain by running `require('eslint-plugin-pluginname')` in the config file.
-2. Plugins in the base configuration (loaded by `extends` setting) are relative to the derived config file. For example, if `./.eslintrc` has `extends: ["foo"]` and the `eslint-config-foo` has `plugins: ["bar"]`, ESLint finds the `eslint-plugin-bar` from `./node_modules/` (rather than `./node_modules/eslint-config-foo/node_modules/`) or ancestor directories. Thus every plugin in the config file and base configurations is resolved uniquely.
-
-### Naming convention
-
-#### Include a plugin
-
-The `eslint-plugin-` prefix can be omitted for non-scoped packages
-
-```js
-{
-    // ...
-    "plugins": [
-        "jquery", // means eslint-plugin-jquery
-    ]
-    // ...
-}
-```
-
-The same rule does apply to scoped packages:
-
-```js
-{
-    // ...
-    "plugins": [
-        "@jquery/jquery", // means @jquery/eslint-plugin-jquery
-        "@foobar" // means @foobar/eslint-plugin
-    ]
-    // ...
-}
-```
-
-#### Use a plugin
-
-When using rules, environments or configs defined by plugins, they must be referenced following the convention:
-
-* `eslint-plugin-foo` → `foo/a-rule`
-* `@foo/eslint-plugin` → `@foo/a-config`
-* `@foo/eslint-plugin-bar` → `@foo/bar/a-environment`
-
-For example:
-
-```js
-{
-    // ...
-    "plugins": [
-        "jquery",   // eslint-plugin-jquery
-        "@foo/foo", // @foo/eslint-plugin-foo
-        "@bar"      // @bar/eslint-plugin
-    ],
-    "extends": [
-        "plugin:@foo/foo/recommended",
-        "plugin:@bar/recommended"
-    ],
-    "rules": {
-        "jquery/a-rule": "error",
-        "@foo/foo/some-rule": "error",
-        "@bar/another-rule": "error"
-    },
-    "env": {
-        "jquery/jquery": true,
-        "@foo/foo/env-foo": true,
-        "@bar/env-bar": true,
-    }
-    // ...
-}
-```
diff --git a/eslint/docs/user-guide/configuring/rules.md b/eslint/docs/user-guide/configuring/rules.md
deleted file mode 100644 (file)
index 4f45b4a..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-# Rules
-
-* [Configuring Rules](#configuring-rules)
-* [Disabling Rules](#disabling-rules)
-
-## Configuring Rules
-
-ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values:
-
-* `"off"` or `0` - turn the rule off
-* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
-* `"error"` or `2` - turn the rule on as an error (exit code is 1 when triggered)
-
-### Using configuration comments
-
-To configure rules inside of a file using configuration comments, use a comment in the following format:
-
-```js
-/* eslint eqeqeq: "off", curly: "error" */
-```
-
-In this example, [`eqeqeq`](https://eslint.org/docs/rules/eqeqeq) is turned off and [`curly`](https://eslint.org/docs/rules/curly) is turned on as an error. You can also use the numeric equivalent for the rule severity:
-
-```js
-/* eslint eqeqeq: 0, curly: 2 */
-```
-
-This example is the same as the last example, only it uses the numeric codes instead of the string values. The `eqeqeq` rule is off and the `curly` rule is set to be an error.
-
-If a rule has additional options, you can specify them using array literal syntax, such as:
-
-```js
-/* eslint quotes: ["error", "double"], curly: 2 */
-```
-
-This comment specifies the "double" option for the [`quotes`](https://eslint.org/docs/rules/quotes) rule. The first item in the array is always the rule severity (number or string).
-
-Configuration comments can include descriptions to explain why the comment is necessary. The description must occur after the configuration and is separated from the configuration by two or more consecutive `-` characters. For example:
-
-```js
-/* eslint eqeqeq: "off", curly: "error" -- Here's a description about why this configuration is necessary. */
-```
-
-```js
-/* eslint eqeqeq: "off", curly: "error"
-    --------
-    Here's a description about why this configuration is necessary. */
-```
-
-```js
-/* eslint eqeqeq: "off", curly: "error"
- * --------
- * This will not work due to the line above starting with a '*' character.
- */
-```
-
-### Using configuration files
-
-To configure rules inside of a configuration file, use the `rules` key along with an error level and any options you want to use. For example:
-
-```json
-{
-    "rules": {
-        "eqeqeq": "off",
-        "curly": "error",
-        "quotes": ["error", "double"]
-    }
-}
-```
-
-And in YAML:
-
-```yaml
----
-rules:
-  eqeqeq: off
-  curly: error
-  quotes:
-    - error
-    - double
-```
-
-To configure a rule which is defined within a plugin you have to prefix the rule ID with the plugin name and a `/`. For example:
-
-```json
-{
-    "plugins": [
-        "plugin1"
-    ],
-    "rules": {
-        "eqeqeq": "off",
-        "curly": "error",
-        "quotes": ["error", "double"],
-        "plugin1/rule1": "error"
-    }
-}
-```
-
-And in YAML:
-
-```yaml
----
-plugins:
-  - plugin1
-rules:
-  eqeqeq: 0
-  curly: error
-  quotes:
-    - error
-    - "double"
-  plugin1/rule1: error
-```
-
-In these configuration files, the rule `plugin1/rule1` comes from the plugin named `plugin1`. You can also use this format with configuration comments, such as:
-
-```js
-/* eslint "plugin1/rule1": "error" */
-```
-
-**Note:** When specifying rules from plugins, make sure to omit `eslint-plugin-`. ESLint uses only the unprefixed name internally to locate rules.
-
-## Disabling Rules
-
-### Using configuration comments
-
-To temporarily disable rule warnings in your file, use block comments in the following format:
-
-```js
-/* eslint-disable */
-
-alert('foo');
-
-/* eslint-enable */
-```
-
-You can also disable or enable warnings for specific rules:
-
-```js
-/* eslint-disable no-alert, no-console */
-
-alert('foo');
-console.log('bar');
-
-/* eslint-enable no-alert, no-console */
-```
-
-To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file:
-
-```js
-/* eslint-disable */
-
-alert('foo');
-```
-
-You can also disable or enable specific rules for an entire file:
-
-```js
-/* eslint-disable no-alert */
-
-alert('foo');
-```
-
-To disable all rules on a specific line, use a line or block comment in one of the following formats:
-
-```js
-alert('foo'); // eslint-disable-line
-
-// eslint-disable-next-line
-alert('foo');
-
-/* eslint-disable-next-line */
-alert('foo');
-
-alert('foo'); /* eslint-disable-line */
-```
-
-To disable a specific rule on a specific line:
-
-```js
-alert('foo'); // eslint-disable-line no-alert
-
-// eslint-disable-next-line no-alert
-alert('foo');
-
-alert('foo'); /* eslint-disable-line no-alert */
-
-/* eslint-disable-next-line no-alert */
-alert('foo');
-```
-
-To disable multiple rules on a specific line:
-
-```js
-alert('foo'); // eslint-disable-line no-alert, quotes, semi
-
-// eslint-disable-next-line no-alert, quotes, semi
-alert('foo');
-
-alert('foo'); /* eslint-disable-line no-alert, quotes, semi */
-
-/* eslint-disable-next-line no-alert, quotes, semi */
-alert('foo');
-```
-
-All of the above methods also work for plugin rules. For example, to disable `eslint-plugin-example`'s `rule-name` rule, combine the plugin's name (`example`) and the rule's name (`rule-name`) into `example/rule-name`:
-
-```js
-foo(); // eslint-disable-line example/rule-name
-foo(); /* eslint-disable-line example/rule-name */
-```
-
-Configuration comments can include descriptions to explain why the comment is necessary. The description must come after the configuration and needs to be separated from the configuration by two or more consecutive `-` characters. For example:
-
-```js
-// eslint-disable-next-line no-console -- Here's a description about why this configuration is necessary.
-console.log('hello');
-```
-
-**Note:** Comments that disable warnings for a portion of a file tell ESLint not to report rule violations for the disabled code. ESLint still parses the entire file, however, so disabled code still needs to be syntactically valid JavaScript.
-
-### Using configuration files
-
-To disable rules inside of a configuration file for a group of files, use the `overrides` key along with a `files` key. For example:
-
-```json
-{
-  "rules": {...},
-  "overrides": [
-    {
-      "files": ["*-test.js","*.spec.js"],
-      "rules": {
-        "no-unused-expressions": "off"
-      }
-    }
-  ]
-}
-```
-
-### Disabling Inline Comments
-
-To disable all inline config comments, use the `noInlineConfig` setting. For example:
-
-```json
-{
-  "rules": {...},
-  "noInlineConfig": true
-}
-```
-
-This setting is similar to [--no-inline-config](https://eslint.org/docs/user-guide/command-line-interface#--no-inline-config) CLI option.
-
-#### Report unused `eslint-disable` comments
-
-To report unused `eslint-disable` comments, use the `reportUnusedDisableDirectives` setting. For example:
-
-```json
-{
-  "rules": {...},
-  "reportUnusedDisableDirectives": true
-}
-```
-
-This setting is similar to [--report-unused-disable-directives](https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives) CLI option, but doesn't fail linting (reports as `"warn"` severity).
diff --git a/eslint/docs/user-guide/getting-started.md b/eslint/docs/user-guide/getting-started.md
deleted file mode 100644 (file)
index cf808dd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# Getting Started with ESLint
-
-ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs. In many ways, it is similar to JSLint and JSHint with a few exceptions:
-
-* ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing.
-* ESLint uses an AST to evaluate patterns in code.
-* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
-
-## Installation and Usage
-
-Prerequisites: [Node.js](https://nodejs.org/en/) (`^12.22.0`, `^14.17.0`, or `>=16.0.0`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
-
-You can install ESLint using npm or yarn:
-
-```sh
-npm install eslint --save-dev
-
-# or
-
-yarn add eslint --dev
-```
-
-You should then set up a configuration file, and the easiest way to do that is to use the `--init` flag:
-
-```sh
-$ npx eslint --init
-
-# or
-
-$ yarn run eslint --init
-```
-
-**Note:** `--init` assumes you have a `package.json` file already. If you don't, make sure to run `npm init` or `yarn init` beforehand.
-
-After that, you can run ESLint on any file or directory like this:
-
-```sh
-$ npx eslint yourfile.js
-
-# or
-
-$ yarn run eslint yourfile.js
-```
-
-It is also possible to install ESLint globally rather than locally (using `npm install eslint --global`). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case.
-
-## Configuration
-
-**Note:** If you are coming from a version before 1.0.0 please see the [migration guide](migrating-to-1.0.0.md).
-
-After running `eslint --init`, you'll have a `.eslintrc.{js,yml,json}` file in your directory. In it, you'll see some rules configured like this:
-
-```json
-{
-    "rules": {
-        "semi": ["error", "always"],
-        "quotes": ["error", "double"]
-    }
-}
-```
-
-The names `"semi"` and `"quotes"` are the names of [rules](/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:
-
-* `"off"` or `0` - turn the rule off
-* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
-* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
-
-The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](configuring/)).
-
-Your `.eslintrc.{js,yml,json}` configuration file will also include the line:
-
-```json
-{
-    "extends": "eslint:recommended"
-}
-```
-
-Because of this line, all of the rules marked "(recommended)" on the [rules page](/docs/rules) will be turned on.  Alternatively, you can use configurations that others have created by searching for "eslint-config" on [npmjs.com](https://www.npmjs.com/search?q=eslint-config).  ESLint will not lint your code unless you extend from a shared configuration or explicitly turn rules on in your configuration.
-
----
-
-## Next Steps
-
-* Learn about [advanced configuration](configuring/) of ESLint.
-* Get familiar with the [command line options](command-line-interface.md).
-* Explore [ESLint integrations](integrations.md) into other tools like editors, build systems, and more.
-* Can't find just the right rule?  Make your own [custom rule](/docs/developer-guide/working-with-rules.md).
-* Make ESLint even better by [contributing](/docs/developer-guide/contributing/).
diff --git a/eslint/docs/user-guide/integrations.md b/eslint/docs/user-guide/integrations.md
deleted file mode 100644 (file)
index f7680be..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# Integrations
-
-## Editors
-
-* Sublime Text 3:
-    * [SublimeLinter-eslint](https://github.com/roadhump/SublimeLinter-eslint)
-    * [Build Next](https://github.com/albertosantini/sublimetext-buildnext)
-* Vim:
-    * [ALE](https://github.com/w0rp/ale)
-    * [Syntastic](https://github.com/vim-syntastic/syntastic/tree/master/syntax_checkers/javascript)
-* Emacs: [Flycheck](http://www.flycheck.org/) supports ESLint with the [javascript-eslint](http://www.flycheck.org/en/latest/languages.html#javascript) checker.
-* Eclipse Orion: ESLint is the [default linter](https://dev.eclipse.org/mhonarc/lists/orion-dev/msg02718.html)
-* Eclipse IDE: [Tern ESLint linter](https://github.com/angelozerr/tern.java/wiki/Tern-Linter-ESLint)
-* TextMate 2:
-    * [eslint.tmbundle](https://github.com/ryanfitzer/eslint.tmbundle)
-    * [javascript-eslint.tmbundle](https://github.com/natesilva/javascript-eslint.tmbundle)
-* Atom: [linter-eslint](https://atom.io/packages/linter-eslint)
-* IntelliJ IDEA, WebStorm, PhpStorm, PyCharm, RubyMine, and other JetBrains IDEs: [How to use ESLint](https://www.jetbrains.com/help/webstorm/eslint.html)
-* Visual Studio Code: [ESLint Extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
-* Brackets: Included and [Brackets ESLint](https://github.com/brackets-userland/brackets-eslint)
-
-## Build tools
-
-* Grunt: [grunt-eslint](https://www.npmjs.com/package/grunt-eslint)
-* Gulp: [gulp-eslint](https://www.npmjs.com/package/gulp-eslint)
-* Mimosa: [mimosa-eslint](https://www.npmjs.com/package/mimosa-eslint)
-* Broccoli: [broccoli-eslint](https://www.npmjs.com/package/broccoli-eslint)
-* Browserify: [eslintify](https://www.npmjs.com/package/eslintify)
-* Webpack: [eslint-webpack-plugin](https://www.npmjs.com/package/eslint-webpack-plugin)
-* Rollup: [@rollup/plugin-eslint](https://www.npmjs.com/package/@rollup/plugin-eslint)
-* Ember-cli: [ember-cli-eslint](https://www.npmjs.com/package/ember-cli-eslint)
-* Sails.js: [sails-hook-lint](https://www.npmjs.com/package/sails-hook-lint), [sails-eslint](https://www.npmjs.com/package/sails-eslint)
-* Start: [@start/plugin-lib-eslint](https://www.npmjs.com/package/@start/plugin-lib-eslint)
-* Brunch: [eslint-brunch](https://www.npmjs.com/package/eslint-brunch)
-
-## Command Line Tools
-
-* [ESLint Watch](https://www.npmjs.com/package/eslint-watch)
-* [Code Climate CLI](https://github.com/codeclimate/codeclimate)
-* [ESLint Nibble](https://github.com/IanVS/eslint-nibble)
-
-## Source Control
-
-* [Git Precommit Hook](https://coderwall.com/p/zq8jlq/eslint-pre-commit-hook)
-* [Git pre-commit hook that only lints staged changes](https://gist.github.com/dahjelle/8ddedf0aebd488208a9a7c829f19b9e8)
-* [overcommit Git hook manager](https://github.com/brigade/overcommit)
-* [Mega-Linter](https://nvuillam.github.io/mega-linter): Linters aggregator for CI, [embedding eslint](https://nvuillam.github.io/mega-linter/descriptors/javascript_eslint/)
-
-## Testing
-
-* Mocha.js: [mocha-eslint](https://www.npmjs.com/package/mocha-eslint)
-
-## External ESLint rules
-
-* [AngularJS](https://github.com/Gillespie59/eslint-plugin-angular)
-* [BackboneJS](https://github.com/ilyavolodin/eslint-plugin-backbone)
-* [Jasmine](https://github.com/tlvince/eslint-plugin-jasmine)
-* [React](https://github.com/yannickcr/eslint-plugin-react)
-
-… and many more published on npm with the [eslintplugin](https://www.npmjs.com/browse/keyword/eslintplugin) keyword.
-
-## Other Integration Lists
-
-You can find a curated list of other popular integrations for ESLint in the [awesome-eslint](https://github.com/dustinspecker/awesome-eslint) GitHub repository.
diff --git a/eslint/docs/user-guide/migrating-from-jscs.md b/eslint/docs/user-guide/migrating-from-jscs.md
deleted file mode 100644 (file)
index e05ee70..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-# Migrating from JSCS
-
-In April 2016, we [announced](https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) that the JSCS project was shutting down and the JSCS team would be joining the ESLint team. This guide is intended to help those who are using JSCS to migrate their settings and projects to use ESLint. We've tried to automate as much of the conversion as possible, but there are some manual changes that are needed.
-
-## Terminology
-
-Before beginning the process of migrating to ESLint, it's helpful to understand some of the terminology that ESLint uses and how it relates to terminology that JSCS uses.
-
-* **Configuration File** - In JSCS, the configuration file is `.jscsrc`, `.jscsrc.json`, `.jscsrc.yaml`, or `.jscsrs.js`. In ESLint, the configuration file can be `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc.js` (there is also a deprecated `.eslintrc` file format).
-* **Presets** - In JSCS, there were numerous predefined configurations shipped directly within JSCS. ESLint ships with just one predefined configuration (`eslint:recommended`) that has no style rules enabled. However, ESLint does support [shareable configs](https://eslint.org/docs/developer-guide/shareable-configs). Shareable configs are configurations that are published on their own to npm and there are shareable configs available for almost all of the JSCS presets (see the "Converting Presets" section below). Additionally, the "preset" option in a configuration file is the equivalent of the ESLint "extends" option.
-
-## Convert Configuration Files Using Polyjuice
-
-[Polyjuice](https://github.com/brenolf/polyjuice) is a utility for converting JSCS (and JSHint) configuration files into ESLint configuration files automatically. It understands the equivalent rules from each utility and will automatically output an ESLint configuration file that is a good approximation of your existing JSCS file.
-
-To install Polyjuice:
-
-```sh
-$ npm install -g polyjuice
-```
-
-Polyjuice works with JSON configuration files, so if you're using a JavaScript or YAML JSCS configuration file, you should first convert it into a JSON configuration file.
-
-To convert your configuration file, pass in the location of your `.jscs.json` file using the `--jscs` flag:
-
-```sh
-$ polyjuice --jscs .jscsrc.json > .eslintrc.json
-```
-
-This creates a `.eslintrc.json` with the equivalent rules from `.jscsrc.json`.
-
-If you have multiple `.jscsrc.json` files, you can pass them all and Polyjuice will combine them into one `.eslintrc.json` file:
-
-```sh
-$ polyjuice --jscs .jscsrc.json ./foo/.jscsrc.json > .eslintrc.json
-```
-
-**Note:** Polyjuice does a good job of creating a reasonable ESLint configuration from your JSCS configuration, but it may not be 100%. You may still see different warnings than you saw with JSCS, and so you may need to further modify your configuration after using Polyjuice. This is especially true if you're using inline comments to enable/disable certain rules in JSCS (you'll need to manually convert those to use ESLint-style comments instead, see "Disabling Rules Inline" later in this page).
-
-### Creating a New Configuration From Scratch
-
-If you don't want to convert your JSCS configuration directly into an ESLint configuration, then you can use ESLint's built-in wizard to get you started. Just run:
-
-```sh
-$ eslint --init
-```
-
-You'll be guided through a series of questions that will help you setup a basic configuration file to get you started.
-
-## Converting Presets
-
-There are shareable configs available for most JSCS presets. The equivalent shareable configs for each JSCS preset are listed in the following table:
-
-| **JSCS Preset** | **ESLint Shareable Config** |
-|-----------------|-----------------------------|
-| `airbnb`        | [`eslint-config-airbnb-base`](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) |
-| `crockford`        | (not available) |
-| `google`        | [`eslint-config-google`](https://github.com/google/eslint-config-google) |
-| `grunt`        | [`eslint-config-grunt`](https://github.com/markelog/eslint-config-grunt) |
-| `idiomatic`        | [`eslint-config-idiomatic`](https://github.com/jamespamplin/eslint-config-idiomatic) |
-| `jquery`        | [`eslint-config-jquery`](https://github.com/jquery/eslint-config-jquery) |
-| `mdcs`        | [`eslint-config-mdcs`](https://github.com/zz85/mrdoobapproves) |
-| `node-style-guide`        | [`eslint-config-node-style-guide`](https://github.com/pdehaan/eslint-config-node-style-guide) |
-| `wikimedia`        | [`eslint-config-wikimedia`](https://github.com/wikimedia/eslint-config-wikimedia) |
-| `wordpress`        | [`eslint-config-wordpress`](https://github.com/WordPress-Coding-Standards/eslint-config-wordpress) |
-
-As an example, suppose that you are using the `airbnb` preset, so your `.jscsrc` file looks like this:
-
-```json
-{
-    "preset": "airbnb"
-}
-```
-
-In order to get the same functionality in ESLint, you would first need to install the `eslint-config-airbnb` shareable config package:
-
-```sh
-$ npm install eslint-config-airbnb-base --save-dev
-```
-
-And then you would modify your configuration file like this:
-
-```json
-{
-    "extends": "airbnb-base"
-}
-```
-
-ESLint sees `"airbnb-base"` and will look for `eslint-config-airbnb-base` (to save you some typing).
-
-## Disabling Rules Inline
-
-Both JSCS and ESLint use comments inside of files to disable rules around certain parts of your code. The following table lists out the JSCS inline configuration comments and their ESLint equivalents.
-
-| **Description** | **JSCS Comment** | **ESLint Comment** |
-|-----------------|------------------|--------------------|
-| Disable all rules | `// jscs:disable` or `/* jscs:disable */` | `/* eslint-disable */` |
-| Enable all rules | `// jscs:enable` or `/* jscs:enable */` | `/* eslint-enable */` |
-| Disable one rule | `// jscs:disable ruleName` or `/* jscs:disable ruleName */` | `/* eslint-disable rule-name */` |
-| Enable one rule | `// jscs:enable ruleName` or `/* jscs:enable ruleName */` | `/* eslint-enable rule-name */` |
-| Disable multiple rules | `// jscs:disable ruleName1, ruleName2` or `/* jscs:disable ruleName1, ruleName2 */` | `/* eslint-disable rule-name1, rule-name2 */` |
-| Enable multiple rules | `// jscs:enable ruleName1, ruleName2` or `/* jscs:enable ruleName1, ruleName2 */` | `/* eslint-enable rule-name1, rule-name2 */` |
-| Disable one rule on single line | `// jscs:ignore ruleName` | `// eslint-disable-line rule-name` |
-
-## Command Line Options
-
-Both JSCS and ESLint have command line arguments corresponding to many of their configuration options. The following are the ESLint equivalents of JSCS command line options.
-
-### `--fix`
-
-JSCS uses the `--fix` option to apply automatic fixes to code:
-
-```sh
-$ jscs --fix file.js
-```
-
-ESLint has the same option:
-
-```sh
-$ eslint --fix file.js
-```
-
-### `--auto-configure`
-
-The JSCS `--auto-configure` option created a configuration based on what it found in a given file:
-
-```sh
-$ jscs --auto-configure file.js
-```
-
-In ESLint, there's a similar option when you use `--init`. Just select "Inspect your JavaScript file(s)":
-
-```sh
-$ eslint --init
-? How would you like to configure ESLint? (Use arrow keys)
-> Answer questions about your style
-  Use a popular style guide
-  Inspect your JavaScript file(s)
-```
-
-## `--config`, `-c`
-
-JSCS allows you to specify a configuration file to use on the command line using either `--config` or `-c`, such as:
-
-```sh
-$ jscs --config myconfig.json file.js
-$ jscs -c myconfig.json file.js
-```
-
-Both flags are also supported by ESLint:
-
-```sh
-$ eslint --config myconfig.json file.js
-$ eslint -c myconfig.json file.js
-```
-
-## Piping Code Into ESLint
-
-In JSCS, you can pipe code in like this:
-
-```sh
-$ cat file.js | jscs
-```
-
-In ESLint, you can also pipe in code, but you need to use the `--stdin` flag:
-
-```sh
-$ cat file.js | eslint --stdin
-```
diff --git a/eslint/docs/user-guide/migrating-to-1.0.0.md b/eslint/docs/user-guide/migrating-to-1.0.0.md
deleted file mode 100644 (file)
index 637e305..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-# Migrating to v1.0.0
-
-ESLint v1.0.0 is the first major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading.
-
-## All Rules Off by Default
-
-The most important difference in v1.0.0 is that all rules are off by default. We made this change after numerous requests to allow turning off the default rules from within configuration files. While that wasn't technically feasible, it was feasible to have all rules off by default and then re-enable rules in configuration files using `extends`. As such, we've made the `--reset` behavior the default and removed this command line option.
-
-When using `--init`, your configuration file will automatically include the following line:
-
-```json
-{
-    "extends": "eslint:recommended"
-}
-```
-
-This setting mimics some of the default behavior from 0.x, but not all. If you don't want to use any of the recommended rules, you can delete this line.
-
-**To address:** If you are currently using `--reset`, then you should stop passing `--reset` on the command line; no other changes are necessary. If you are not using `--reset`, then you should review your configuration to determine which rules should be on by default. You can partially restore some of the default behavior by adding the following to your configuration file:
-
-The `"eslint:recommended"` configuration contains many of the same default rule settings from 0.x, but not all. These rules are no longer on by default, so you should review your settings to ensure they are still as you expect:
-
-* [no-alert](https://eslint.org/docs/rules/no-alert)
-* [no-array-constructor](https://eslint.org/docs/rules/no-array-constructor)
-* [no-caller](https://eslint.org/docs/rules/no-caller)
-* [no-catch-shadow](https://eslint.org/docs/rules/no-catch-shadow)
-* [no-empty-label](https://eslint.org/docs/rules/no-empty-label)
-* [no-eval](https://eslint.org/docs/rules/no-eval)
-* [no-extend-native](https://eslint.org/docs/rules/no-extend-native)
-* [no-extra-bind](https://eslint.org/docs/rules/no-extra-bind)
-* [no-extra-strict](https://eslint.org/docs/rules/no-extra-strict)
-* [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval)
-* [no-iterator](https://eslint.org/docs/rules/no-iterator)
-* [no-label-var](https://eslint.org/docs/rules/no-label-var)
-* [no-labels](https://eslint.org/docs/rules/no-labels)
-* [no-lone-blocks](https://eslint.org/docs/rules/no-lone-blocks)
-* [no-loop-func](https://eslint.org/docs/rules/no-loop-func)
-* [no-multi-spaces](https://eslint.org/docs/rules/no-multi-spaces)
-* [no-multi-str](https://eslint.org/docs/rules/no-multi-str)
-* [no-native-reassign](https://eslint.org/docs/rules/no-native-reassign)
-* [no-new](https://eslint.org/docs/rules/no-new)
-* [no-new-func](https://eslint.org/docs/rules/no-new-func)
-* [no-new-object](https://eslint.org/docs/rules/no-new-object)
-* [no-new-wrappers](https://eslint.org/docs/rules/no-new-wrappers)
-* [no-octal-escape](https://eslint.org/docs/rules/no-octal-escape)
-* [no-process-exit](https://eslint.org/docs/rules/no-process-exit)
-* [no-proto](https://eslint.org/docs/rules/no-proto)
-* [no-return-assign](https://eslint.org/docs/rules/no-return-assign)
-* [no-script-url](https://eslint.org/docs/rules/no-script-url)
-* [no-sequences](https://eslint.org/docs/rules/no-sequences)
-* [no-shadow](https://eslint.org/docs/rules/no-shadow)
-* [no-shadow-restricted-names](https://eslint.org/docs/rules/no-shadow-restricted-names)
-* [no-spaced-func](https://eslint.org/docs/rules/no-spaced-func)
-* [no-trailing-spaces](https://eslint.org/docs/rules/no-trailing-spaces)
-* [no-undef-init](https://eslint.org/docs/rules/no-undef-init)
-* [no-underscore-dangle](https://eslint.org/docs/rules/no-underscore-dangle)
-* [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions)
-* [no-use-before-define](https://eslint.org/docs/rules/no-use-before-define)
-* [no-with](https://eslint.org/docs/rules/no-with)
-* [no-wrap-func](https://eslint.org/docs/rules/no-wrap-func)
-* [camelcase](https://eslint.org/docs/rules/camelcase)
-* [comma-spacing](https://eslint.org/docs/rules/comma-spacing)
-* [consistent-return](https://eslint.org/docs/rules/consistent-return)
-* [curly](https://eslint.org/docs/rules/curly)
-* [dot-notation](https://eslint.org/docs/rules/dot-notation)
-* [eol-last](https://eslint.org/docs/rules/eol-last)
-* [eqeqeq](https://eslint.org/docs/rules/eqeqeq)
-* [key-spacing](https://eslint.org/docs/rules/key-spacing)
-* [new-cap](https://eslint.org/docs/rules/new-cap)
-* [new-parens](https://eslint.org/docs/rules/new-parens)
-* [quotes](https://eslint.org/docs/rules/quotes)
-* [semi](https://eslint.org/docs/rules/semi)
-* [semi-spacing](https://eslint.org/docs/rules/semi-spacing)
-* [space-infix-ops](https://eslint.org/docs/rules/space-infix-ops)
-* [space-return-throw-case](https://eslint.org/docs/rules/space-return-throw-case)
-* [space-unary-ops](https://eslint.org/docs/rules/space-unary-ops)
-* [strict](https://eslint.org/docs/rules/strict)
-* [yoda](https://eslint.org/docs/rules/yoda)
-
-See also: the [full diff](https://github.com/eslint/eslint/commit/e3e9dbd9876daf4bdeb4e15f8a76a9d5e6e03e39#diff-b01a5cfd9361ca9280a460fd6bb8edbbL1) where the defaults were changed.
-
-Here's a configuration file with the closest equivalent of the old defaults:
-
-```json
-{
-    "extends": "eslint:recommended",
-    "rules": {
-        "no-alert": 2,
-        "no-array-constructor": 2,
-        "no-caller": 2,
-        "no-catch-shadow": 2,
-        "no-empty-label": 2,
-        "no-eval": 2,
-        "no-extend-native": 2,
-        "no-extra-bind": 2,
-        "no-implied-eval": 2,
-        "no-iterator": 2,
-        "no-label-var": 2,
-        "no-labels": 2,
-        "no-lone-blocks": 2,
-        "no-loop-func": 2,
-        "no-multi-spaces": 2,
-        "no-multi-str": 2,
-        "no-native-reassign": 2,
-        "no-new": 2,
-        "no-new-func": 2,
-        "no-new-object": 2,
-        "no-new-wrappers": 2,
-        "no-octal-escape": 2,
-        "no-process-exit": 2,
-        "no-proto": 2,
-        "no-return-assign": 2,
-        "no-script-url": 2,
-        "no-sequences": 2,
-        "no-shadow": 2,
-        "no-shadow-restricted-names": 2,
-        "no-spaced-func": 2,
-        "no-trailing-spaces": 2,
-        "no-undef-init": 2,
-        "no-underscore-dangle": 2,
-        "no-unused-expressions": 2,
-        "no-use-before-define": 2,
-        "no-with": 2,
-        "camelcase": 2,
-        "comma-spacing": 2,
-        "consistent-return": 2,
-        "curly": [2, "all"],
-        "dot-notation": [2, { "allowKeywords": true }],
-        "eol-last": 2,
-        "no-extra-parens": [2, "functions"],
-        "eqeqeq": 2,
-        "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
-        "new-cap": 2,
-        "new-parens": 2,
-        "quotes": [2, "double"],
-        "semi": 2,
-        "semi-spacing": [2, {"before": false, "after": true}],
-        "space-infix-ops": 2,
-        "space-return-throw-case": 2,
-        "space-unary-ops": [2, { "words": true, "nonwords": false }],
-        "strict": [2, "function"],
-        "yoda": [2, "never"]
-    }
-}
-```
-
-## Removed Rules
-
-Over the past several releases, we have been deprecating rules and introducing new rules to take their place. The following is a list of the removed rules and their replacements:
-
-* [generator-star](https://eslint.org/docs/rules/generator-star) is replaced by [generator-star-spacing](https://eslint.org/docs/rules/generator-star-spacing)
-* [global-strict](https://eslint.org/docs/rules/global-strict) is replaced by [strict](https://eslint.org/docs/rules/strict)
-* [no-comma-dangle](https://eslint.org/docs/rules/no-comma-dangle) is replaced by [comma-dangle](https://eslint.org/docs/rules/comma-dangle)
-* [no-empty-class](https://eslint.org/docs/rules/no-empty-class) is replaced by [no-empty-character-class](https://eslint.org/docs/rules/no-empty-character-class)
-* [no-extra-strict](https://eslint.org/docs/rules/no-extra-strict) is replaced by [strict](https://eslint.org/docs/rules/strict)
-* [no-reserved-keys](https://eslint.org/docs/rules/no-reserved-keys) is replaced by [quote-props](https://eslint.org/docs/rules/quote-props)
-* [no-space-before-semi](https://eslint.org/docs/rules/no-space-before-semi) is replaced by [semi-spacing](https://eslint.org/docs/rules/semi-spacing)
-* [no-wrap-func](https://eslint.org/docs/rules/no-wrap-func) is replaced by [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens)
-* [space-after-function-name](https://eslint.org/docs/rules/space-after-function-name) is replaced by [space-before-function-paren](https://eslint.org/docs/rules/space-before-function-paren)
-* [space-before-function-parentheses](https://eslint.org/docs/rules/space-before-function-parentheses) is replaced by [space-before-function-paren](https://eslint.org/docs/rules/space-before-function-paren)
-* [space-in-brackets](https://eslint.org/docs/rules/space-in-brackets) is replaced by[object-curly-spacing](https://eslint.org/docs/rules/object-curly-spacing) and [array-bracket-spacing](https://eslint.org/docs/rules/array-bracket-spacing)
-* [space-unary-word-ops](https://eslint.org/docs/rules/space-unary-word-ops) is replaced by [space-unary-ops](https://eslint.org/docs/rules/space-unary-ops)
-* [spaced-line-comment](https://eslint.org/docs/rules/spaced-line-comment) is replaced by [spaced-comment](https://eslint.org/docs/rules/spaced-comment)
-
-**To address:** You'll need to update your rule configurations to use the new rules. ESLint v1.0.0 will also warn you when you're using a rule that has been removed and will suggest the replacement rules. Hopefully, this will result in few surprises during the upgrade process.
-
-## Column Numbers are 1-based
-
-From the beginning, ESLint has reported errors using 0-based columns because that's what Esprima, and later Espree, reported. However, most tools and editors use 1-based columns, which made for some tricky integrations with ESLint. In v1.0.0, we've switched over to reporting errors using 1-based columns to fall into line with the tools developers use everyday.
-
-**To address:** If you've created an editor integration, or a tool that had to correct the column number, you'll need to update to just pass through the column number from ESLint. Otherwise, no change is necessary.
-
-## No Longer Exporting cli
-
-In 0.x, the `cli` object was exported for use by external tools. It was later deprecated in favor of `CLIEngine`. In v1.0.0, we are no longer exporting `cli` as it should not be used by external tools. This will break existing tools that make use of it.
-
-**To address:** If you are using the exported `cli` object, switch to using `CLIEngine` instead.
-
-## Deprecating eslint-tester
-
-The `eslint-tester` module, which has long been the primary tester for ESLint rules, has now been moved into the `eslint` module. This was the result of a difficult relationship between these two modules that created circular dependencies and was causing a lot of problems in rule tests. Moving the tester into the `eslint` module fixed a lot of those issues.
-
-The replacement for `eslint-tester` is called `RuleTester`. It's a simplified version of `ESLintTester` that's designed to work with any testing framework. This object is exposed by the package.
-
-**To address:** Convert all of your rule tests to use `RuleTester`. If you have this as a test using `ESLintTester`:
-
-```js
-var eslint = require("../../../lib/eslint"),
-    ESLintTester = require("eslint-tester");
-
-var eslintTester = new ESLintTester(eslint);
-eslintTester.addRuleTest("lib/rules/your-rule", {
-    valid: [],
-    invalid: []
-});
-```
-
-Then you can change to:
-
-```js
-var rule = require("../../../lib/rules/your-rule"),
-    RuleTester = require("eslint").RuleTester;
-
-var ruleTester = new RuleTester();
-ruleTester.run("your-rule", rule, {
-    valid: [],
-    invalid: []
-});
-```
diff --git a/eslint/docs/user-guide/migrating-to-2.0.0.md b/eslint/docs/user-guide/migrating-to-2.0.0.md
deleted file mode 100644 (file)
index c5f50b3..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-# Migrating to v2.0.0
-
-ESLint v2.0.0 is the second major version release. As a result, there are some significant changes between how ESLint worked during its life in 0.x and 1.x and how it will work going forward. These changes are the direct result of feedback from the ESLint community of users and were not made without due consideration for the upgrade path. We believe that these changes make ESLint even better, and while some work is necessary to upgrade, we hope the pain of this upgrade is small enough that you will see the benefit of upgrading.
-
-**Important:** If you are upgrading from 0.x, please refer to [Migrating to 1.0.0](./migrating-to-1.0.0) as your starting point.
-
-## Rule Schema Changes
-
-Due to a quirk in the way rule schemas worked, it was possible that you'd need to account for the rule severity (0, 1, or 2) in a rule schema if the options were sufficiently complex. That would result in a schema such as:
-
-```js
-module.exports = {
-    "type": "array",
-    "items": [
-        {
-            "enum": [0, 1, 2]
-        },
-        {
-            "enum": ["always", "never"]
-        }
-    ],
-    "minItems": 1,
-    "maxItems": 2
-};
-```
-
-This was confusing to rule developers as it seemed that rules shouldn't be in charge of validating their own severity. In 2.0.0, rules no longer need to check their own severity.
-
-**To address:** If you are exporting a rule schema that checks severity, you need to make several changes:
-
-1. Remove the severity from the schema
-1. Adjust `minItems` from 1 to 0
-1. Adjust `maxItems` by subtracting 1
-
-Here's what the schema from above looks like when properly converted:
-
-```js
-module.exports = {
-    "type": "array",
-    "items": [
-        {
-            "enum": ["always", "never"]
-        }
-    ],
-    "minItems": 0,
-    "maxItems": 1
-};
-```
-
-## Removed Rules
-
-The following rules have been deprecated with new rules created to take their place. The following is a list of the removed rules and their replacements:
-
-* [no-arrow-condition](https://eslint.org/docs/rules/no-arrow-condition) is replaced by a combination of [no-confusing-arrow](https://eslint.org/docs/rules/no-confusing-arrow) and [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition). Turn on both of these rules to get the same functionality as `no-arrow-condition`.
-* [no-empty-label](https://eslint.org/docs/rules/no-empty-label) is replaced by [no-labels](https://eslint.org/docs/rules/no-labels) with `{"allowLoop": true, "allowSwitch": true}` option.
-* [space-after-keywords](https://eslint.org/docs/rules/space-after-keywords) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
-* [space-before-keywords](https://eslint.org/docs/rules/space-before-keywords) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
-* [space-return-throw-case](https://eslint.org/docs/rules/space-return-throw-case) is replaced by [keyword-spacing](https://eslint.org/docs/rules/keyword-spacing).
-
-**To address:** You'll need to update your rule configurations to use the new rules. ESLint v2.0.0 will also warn you when you're using a rule that has been removed and will suggest the replacement rules. Hopefully, this will result in few surprises during the upgrade process.
-
-## Configuration Cascading Changes
-
-Prior to 2.0.0, if a directory contained both an `.eslintrc` file and a `package.json` file with ESLint configuration information, the settings from the two files would be merged together. In 2.0.0, only the settings from the `.eslintrc.*` file are used and the ones in `package.json` are ignored when both are present. Otherwise, `package.json` can still be used with ESLint configuration, but only if no other `.eslintrc.*` files are present.
-
-**To address:** If you have both an `.eslintrc.*` and `package.json` with ESLint configuration information in the same directory, combine your configurations into just one of those files.
-
-## Built-In Global Variables
-
-Prior to 2.0.0, new global variables that were standardized as part of ES6 such as `Promise`, `Map`, `Set`, and `Symbol` were included in the built-in global environment. This could lead to potential issues when, for example, `no-undef` permitted use of the `Promise` constructor even in ES5 code where promises are unavailable. In 2.0.0, the built-in environment only includes the standard ES5 global variables, and the new ES6 global variables have been moved to the `es6` environment.
-
-**To address:** If you are writing ES6 code, enable the `es6` environment if you have not already done so:
-
-```js
-// In your .eslintrc
-{
-    env: {
-        es6: true
-    }
-}
-
-// Or in a configuration comment
-/*eslint-env es6*/
-```
-
-## Language Options
-
-Prior to 2.0.0, the way to enable language options was by using `ecmaFeatures` in your configuration. In 2.0.0:
-
-* The `ecmaFeatures` property is now under a top-level `parserOptions` property.
-* All ECMAScript 6 `ecmaFeatures` flags have been removed in favor of a `ecmaVersion` property under `parserOptions` that can be set to 3, 5 (default), or 6.
-* The `ecmaFeatures.modules` flag has been replaced by a `sourceType` property under `parserOptions` which can be set to `"script"` (default) or `"module"` for ES6 modules.
-
-**To address:** If you are using any ECMAScript 6 feature flags in `ecmaFeatures`, you'll need to use `ecmaVersion: 6` instead. The ECMAScript 6 feature flags are:
-
-* `arrowFunctions` - enable [arrow functions](https://leanpub.com/understandinges6/read#leanpub-auto-arrow-functions)
-* `binaryLiterals` - enable [binary literals](https://leanpub.com/understandinges6/read#leanpub-auto-octal-and-binary-literals)
-* `blockBindings` - enable `let` and `const` (aka [block bindings](https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings))
-* `classes` - enable classes
-* `defaultParams` - enable [default function parameters](https://leanpub.com/understandinges6/read/#leanpub-auto-default-parameters)
-* `destructuring` - enable [destructuring](https://leanpub.com/understandinges6/read#leanpub-auto-destructuring-assignment)
-* `forOf` - enable [`for-of` loops](https://leanpub.com/understandinges6/read#leanpub-auto-iterables-and-for-of)
-* `generators` - enable [generators](https://leanpub.com/understandinges6/read#leanpub-auto-generators)
-* `modules` - enable modules and global strict mode
-* `objectLiteralComputedProperties` - enable [computed object literal property names](https://leanpub.com/understandinges6/read#leanpub-auto-computed-property-names)
-* `objectLiteralDuplicateProperties` - enable [duplicate object literal properties](https://leanpub.com/understandinges6/read#leanpub-auto-duplicate-object-literal-properties) in strict mode
-* `objectLiteralShorthandMethods` - enable [object literal shorthand methods](https://leanpub.com/understandinges6/read#leanpub-auto-method-initializer-shorthand)
-* `objectLiteralShorthandProperties` - enable [object literal shorthand properties](https://leanpub.com/understandinges6/read#leanpub-auto-property-initializer-shorthand)
-* `octalLiterals` - enable [octal literals](https://leanpub.com/understandinges6/read#leanpub-auto-octal-and-binary-literals)
-* `regexUFlag` - enable the [regular expression `u` flag](https://leanpub.com/understandinges6/read#leanpub-auto-the-regular-expression-u-flag)
-* `regexYFlag` - enable the [regular expression `y` flag](https://leanpub.com/understandinges6/read#leanpub-auto-the-regular-expression-y-flag)
-* `restParams` - enable the [rest parameters](https://leanpub.com/understandinges6/read#leanpub-auto-rest-parameters)
-* `spread` - enable the [spread operator](https://leanpub.com/understandinges6/read#leanpub-auto-the-spread-operator) for arrays
-* `superInFunctions` - enable `super` references inside of functions
-* `templateStrings` - enable [template strings](https://leanpub.com/understandinges6/read/#leanpub-auto-template-strings)
-* `unicodeCodePointEscapes` - enable [code point escapes](https://leanpub.com/understandinges6/read/#leanpub-auto-escaping-non-bmp-characters)
-
-If you're using any of these flags, such as:
-
-```js
-{
-    ecmaFeatures: {
-        arrowFunctions: true
-    }
-}
-```
-
-Then you should enable ES6 using `ecmaVersion`:
-
-```js
-{
-    parserOptions: {
-        ecmaVersion: 6
-    }
-}
-```
-
-If you're using any non-ES6 flags in `ecmaFeatures`, you need to move those inside of `parserOptions`. For instance:
-
-```js
-{
-    ecmaFeatures: {
-        jsx: true
-    }
-}
-```
-
-Then you should move `ecmaFeatures` under `parserOptions`:
-
-```js
-{
-    parserOptions: {
-        ecmaFeatures: {
-            jsx: true
-        }
-    }
-}
-```
-
-If you were using `ecmaFeatures.modules` to enable ES6 module support like this:
-
-```js
-{
-    ecmaFeatures: {
-        modules: true
-    }
-}
-```
-
-```js
-{
-    parserOptions: {
-        sourceType: "module"
-    }
-}
-```
-
-Additionally, if you are using `context.ecmaFeatures` inside of your rules, then you'll need to update your code in the following ways:
-
-1. If you're using an ES6 feature flag such as `context.ecmaFeatures.blockBindings`, rewrite to check for `context.parserOptions.ecmaVersion > 5`.
-1. If you're using `context.ecmaFeatures.modules`, rewrite to check that the `sourceType` property of the Program node is `"module"`.
-1. If you're using a non-ES6 feature flag such as `context.ecmaFeatures.jsx`, rewrite to check for `context.parserOptions.ecmaFeatures.jsx`.
-
-If you have a plugin with rules and you are using RuleTester, then you also need to update the options you pass for rules that use `ecmaFeatures`. For example:
-
-```js
-var ruleTester = new RuleTester();
-ruleTester.run("no-var", rule, {
-    valid: [
-        {
-            code: "let x;",
-            parserOptions: { ecmaVersion: 6 }
-        }
-    ]
-});
-```
-
-If you're not using `ecmaFeatures` in your configuration or your custom/plugin rules and tests, then no change is needed.
-
-## New Rules in `"eslint:recommended"`
-
-```json
-{
-    "extends": "eslint:recommended"
-}
-```
-
-In 2.0.0, the following 11 rules were added to `"eslint:recommended"`.
-
-* [constructor-super](https://eslint.org/docs/rules/constructor-super)
-* [no-case-declarations](https://eslint.org/docs/rules/no-case-declarations)
-* [no-class-assign](https://eslint.org/docs/rules/no-class-assign)
-* [no-const-assign](https://eslint.org/docs/rules/no-const-assign)
-* [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members)
-* [no-empty-pattern](https://eslint.org/docs/rules/no-empty-pattern)
-* [no-new-symbol](https://eslint.org/docs/rules/no-new-symbol)
-* [no-self-assign](https://eslint.org/docs/rules/no-self-assign)
-* [no-this-before-super](https://eslint.org/docs/rules/no-this-before-super)
-* [no-unexpected-multiline](https://eslint.org/docs/rules/no-unexpected-multiline)
-* [no-unused-labels](https://eslint.org/docs/rules/no-unused-labels)
-
-**To address:** If you don't want to be notified by those rules, you can simply disable those rules.
-
-```json
-{
-    "extends": "eslint:recommended",
-    "rules": {
-        "no-case-declarations": 0,
-        "no-class-assign": 0,
-        "no-const-assign": 0,
-        "no-dupe-class-members": 0,
-        "no-empty-pattern": 0,
-        "no-new-symbol": 0,
-        "no-self-assign": 0,
-        "no-this-before-super": 0,
-        "no-unexpected-multiline": 0,
-        "no-unused-labels": 0,
-        "constructor-super": 0
-    }
-}
-```
-
-## Scope Analysis Changes
-
-We found some bugs in our scope analysis that needed to be addressed. Specifically, we were not properly accounting for global variables in all the ways they are defined.
-
-Originally, `Variable` objects and `Reference` objects refer each other:
-
-* `Variable#references` property is an array of `Reference` objects which are referencing the variable.
-* `Reference#resolved` property is a `Variable` object which are referenced.
-
-But until 1.x, the following variables and references had the wrong value (empty) in those properties:
-
-* `var` declarations in the global.
-* `function` declarations in the global.
-* Variables defined in config files.
-* Variables defined in `/* global */` comments.
-
-Now, those variables and references have correct values in these properties.
-
-`Scope#through` property has references where `Reference#resolved` is `null`. So as a result of this change, the value of `Scope#through` property was changed also.
-
-**To address:** If you are using `Scope#through` to find references of a built-in global variable, you need to make several changes.
-
-For example, this is how you might locate the `window` global variable in 1.x:
-
-```js
-var globalScope = context.getScope();
-globalScope.through.forEach(function(reference) {
-    if (reference.identifier.name === "window") {
-        checkForWindow(reference);
-    }
-});
-```
-
-This was a roundabout way to find the variable because it was added after the fact by ESLint. The `window` variable was in `Scope#through` because the definition couldn't be found.
-
-In 2.0.0, `window` is no longer located in `Scope#through` because we have added back the correct declaration. That means you can reference the `window` object (or any other global object) directly. So the previous example would change to this:
-
-```js
-var globalScope = context.getScope();
-var variable = globalScope.set.get("window");
-if (variable) {
-    variable.references.forEach(checkForWindow);
-}
-```
-
-Further Reading: <https://estools.github.io/escope/>
-
-## Default Changes When Using `eslint:recommended`
-
-This will affect you if you are extending from `eslint:recommended`, and are enabling [`no-multiple-empty-lines`] or [`func-style`] with only a severity, such as:
-
-```json
-{
-    "extends": "eslint:recommended",
-    "rules": {
-        "no-multiple-empty-lines": 2,
-        "func-style": 2
-    }
-}
-```
-
-The rule `no-multiple-empty-lines` has no default exceptions, but in ESLint `1.x`, a default from `eslint:recommended` was applied such that a maximum of two empty lines would be permitted.
-
-The rule `func-style` has a default configuration of `"expression"`, but in ESLint `1.x`, `eslint:recommended` defaulted it to `"declaration"`.
-
-ESLint 2.0.0 removes these conflicting defaults, and so you may begin seeing linting errors related to these rules.
-
-**To address:**  If you would like to maintain the previous behavior, update your configuration for `no-multiple-empty-lines` by adding `{"max": 2}`, and change `func-style` to `"declaration"`. For example:
-
-```json
-{
-    "extends": "eslint:recommended",
-    "rules": {
-        "no-multiple-empty-lines": [2, {"max": 2}],
-        "func-style": [2, "declaration"]
-    }
-}
-```
-
-[`no-multiple-empty-lines`]: ../rules/no-multiple-empty-lines
-[`func-style`]: ../rules/func-style
-
-## SourceCode constructor (Node API) changes
-
-`SourceCode` constructor got to handle Unicode BOM.
-If the first argument `text` has BOM, `SourceCode` constructor sets `true` to `this.hasBOM` and strips BOM from the text.
-
-```js
-var SourceCode = require("eslint").SourceCode;
-
-var code = new SourceCode("\uFEFFvar foo = bar;", ast);
-
-assert(code.hasBOM === true);
-assert(code.text === "var foo = bar;");
-```
-
-So the second argument `ast` also should be parsed from stripped text.
-
-**To address:** If you are using `SourceCode` constructor in your code, please parse the source code after it stripped BOM:
-
-```js
-var ast = yourParser.parse(text.replace(/^\uFEFF/, ""), options);
-var sourceCode = new SourceCode(text, ast);
-```
-
-## Rule Changes
-
-* [`strict`](../rules/strict.md) - defaults to `"safe"` (previous default was `"function"`)
-
-## Plugins No Longer Have Default Configurations
-
-Prior to v2.0.0, plugins could specify a `rulesConfig` for the plugin. The `rulesConfig` would automatically be applied whenever someone uses the plugin, which is the opposite of what ESLint does in every other situation (where nothing is on by default). To bring plugins behavior in line, we have removed support for `rulesConfig` in plugins.
-
-**To address:** If you are using a plugin in your configuration file, you will need to manually enable the plugin rules in the configuration file.
diff --git a/eslint/docs/user-guide/migrating-to-3.0.0.md b/eslint/docs/user-guide/migrating-to-3.0.0.md
deleted file mode 100644 (file)
index af19c76..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-# Migrating to v3.0.0
-
-ESLint v3.0.0 is the third major version release. We have made several breaking changes in this release, however, we believe the changes to be small enough that they should not require significant changes for ESLint users. This guide is intended to walk you through the changes.
-
-## Dropping Support for Node.js < 4
-
-With ESLint v3.0.0, we are dropping support for Node.js versions prior to 4. Node.js 0.10 and 0.12 are in [maintenance mode](https://github.com/nodejs/Release) and Node.js 4 is the current LTS version. If you are using an older version of Node.js, we recommend upgrading to at least Node.js 4 as soon as possible. If you are unable to upgrade to Node.js 4 or higher, then we recommend continuing to use ESLint v2.x until you are ready to upgrade Node.js.
-
-**Important:** We will not be updating the ESLint v2.x versions going forward. All bug fixes and enhancements will land in ESLint v3.x.
-
-## Requiring Configuration to Run
-
-ESLint v3.0.0 now requires that you use a configuration to run. A configuration can be any of the following:
-
-1. A `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc` file either in your project or home directory.
-2. Configuration options passed on the command line using `--rule` (or to CLIEngine using `rules`).
-3. A configuration file passed on the command line using `-c` (or to CLIEngine using `configFile`).
-4. A base configuration is provided to CLIEngine using the `baseConfig` option.
-
-If ESLint can't find a configuration, then it will throw an error and ask you to provide one.
-
-This change was made to help new ESLint users who are frequently confused that ESLint does nothing by default besides reporting parser errors. We anticipate this change will have minimal impact on most established users because you're more likely to have configuration files already.
-
-**To Address:** You should be sure to use a configuration whenever you run ESLint. However, you can still run ESLint without a configuration by passing the `--no-eslintrc` option on the command line or setting the `useEslintrc` option to `false` for `CLIEngine`.
-
-To create a new configuration, use `eslint --init`.
-
-## Changes to `"eslint:recommended"`
-
-```json
-{
-    "extends": "eslint:recommended"
-}
-```
-
-In 3.0.0, the following rules were added to `"eslint:recommended"`:
-
-* [`no-unsafe-finally`](https://eslint.org/docs/rules/no-unsafe-finally) helps catch `finally` clauses that may not behave as you think.
-* [`no-native-reassign`](https://eslint.org/docs/rules/no-native-reassign) was previously part of `no-undef`, but was split out because it didn't make sense as part of another rule. The `no-native-reassign` rule warns whenever you try to overwrite a read-only global variable.
-* [`require-yield`](https://eslint.org/docs/rules/require-yield) helps to identify generator functions that do not have the `yield` keyword.
-
-The following rules were removed from `"eslint:recommended"`:
-
-* [`comma-dangle`](https://eslint.org/docs/rules/comma-dangle) used to be recommended because Internet Explorer 8 and earlier threw a syntax error when it found a dangling comma on object literal properties. However, [Internet Explorer 8 was end-of-lifed](https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support) in January 2016 and all other active browsers allow dangling commas. As such, we consider dangling commas to now be a stylistic issue instead of a possible error.
-
-The following rules were modified:
-
-* [`complexity`](https://eslint.org/docs/rules/complexity) used to have a hardcoded default of 11 in `eslint:recommended` that would be used if you turned the rule on without specifying a maximum. The default is now 20. The rule actually always had a default of 20, but `eslint:recommended` was overriding it by mistake.
-
-**To address:** If you want to mimic how `eslint:recommended` worked in v2.x, you can use the following:
-
-```json
-{
-    "extends": "eslint:recommended",
-    "rules": {
-        "no-unsafe-finally": "off",
-        "no-native-reassign": "off",
-        "complexity": ["off", 11],
-        "comma-dangle": "error",
-        "require-yield": "error"
-    }
-}
-```
-
-## Changes to `CLIEngine#executeOnText()`
-
-The `CLIEngine#executeOnText()` method has changed to work more like `CLIEngine#executeOnFiles()`. In v2.x, `CLIEngine#executeOnText()` warned about ignored files by default and didn't have a way to opt-out of those warnings whereas `CLIEngine#executeOnFiles()` did not warn about ignored files by default and allowed you to opt-in to warning about them. The `CLIEngine#executeOnText()` method now also does not warn about ignored files by default and allows you to opt-in with a new, third argument (a boolean, `true` to warn about ignored files and `false` to not warn).
-
-**To address:** If you are currently using `CLIEngine#executeOnText()` in your project like this:
-
-```js
-var result = engine.executeOnText(text, filename);
-```
-
-You can get the equivalent behavior using this:
-
-```js
-var result = engine.executeOnText(text, filename, true);
-```
-
-If you do not want ignored file warnings output to the console, you can omit the third argument or pass `false`.
diff --git a/eslint/docs/user-guide/migrating-to-4.0.0.md b/eslint/docs/user-guide/migrating-to-4.0.0.md
deleted file mode 100644 (file)
index 8f78291..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-# Migrating to v4.0.0
-
-ESLint v4.0.0 is the fourth major version release. We have made several breaking changes in this release; however, we expect that most of the changes will only affect a very small percentage of users. This guide is intended to walk you through the changes.
-
-The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
-
-## Breaking changes for users
-
-1. [New rules have been added to `eslint:recommended`](#eslint-recommended-changes)
-1. [The `indent` rule is more strict](#indent-rewrite)
-1. [Unrecognized properties in config files now cause a fatal error](#config-validation)
-1. [.eslintignore patterns are now resolved from the location of the file](#eslintignore-patterns)
-1. [The `padded-blocks` rule is more strict by default](#padded-blocks-defaults)
-1. [The `space-before-function-paren` rule is more strict by default](#space-before-function-paren-defaults)
-1. [The `no-multi-spaces` rule is more strict by default](#no-multi-spaces-eol-comments)
-1. [References to scoped plugins in config files are now required to include the scope](#scoped-plugin-resolution)
-
-## Breaking changes for plugin/custom rule developers
-
-1. [`RuleTester` now validates properties of test cases](#rule-tester-validation)
-1. [AST nodes no longer have comment properties](#comment-attachment)
-1. [`LineComment` and `BlockComment` events will no longer be emitted during AST traversal](#event-comments)
-1. [Shebangs are now returned from comment APIs](#shebangs)
-
-## Breaking changes for integration developers
-
-1. [The `global` property in the `linter.verify()` API is no longer supported](#global-property)
-1. [More report messages now have full location ranges](#report-locations)
-1. [Some exposed APIs are now ES2015 classes](#exposed-es2015-classes)
-
----
-
-## <a name="eslint-recommended-changes"></a> `eslint:recommended` changes
-
-Two new rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
-
-* [`no-compare-neg-zero`](/docs/rules/no-compare-neg-zero) disallows comparisons to `-0`
-* [`no-useless-escape`](/docs/rules/no-useless-escape) disallows uselessly-escaped characters in strings and regular expressions
-
-**To address:** To mimic the `eslint:recommended` behavior from 3.x, you can disable these rules in a config file:
-
-```json
-{
-  "extends": "eslint:recommended",
-
-  "rules": {
-    "no-compare-neg-zero": "off",
-    "no-useless-escape": "off"
-  }
-}
-```
-
-## <a name="indent-rewrite"></a> The `indent` rule is more strict
-
-Previously, the [`indent`](/docs/rules/indent) rule was fairly lenient about checking indentation; there were many code patterns where indentation was not validated by the rule. This caused confusion for users, because they were accidentally writing code with incorrect indentation, and they expected ESLint to catch the issues.
-
-In 4.0.0, the `indent` rule has been rewritten. The new version of the rule will report some indentation errors that the old version of the rule did not catch. Additionally, the indentation of `MemberExpression` nodes, function parameters, and function arguments will now be checked by default (it was previously ignored by default for backwards compatibility).
-
-To make the upgrade process easier, we've introduced the [`indent-legacy`](/docs/rules/indent-legacy) rule as a snapshot of the `indent` rule from 3.x. If you run into issues from the `indent` rule when you upgrade, you should be able to use the `indent-legacy` rule to replicate the 3.x behavior. However, the `indent-legacy` rule is deprecated and will not receive bugfixes or improvements in the future, so you should eventually switch back to the `indent` rule.
-
-**To address:** We recommend upgrading without changing your `indent` configuration, and fixing any new indentation errors that appear in your codebase. However, if you want to mimic how the `indent` rule worked in 3.x, you can update your configuration:
-
-```js
-{
-  rules: {
-    indent: "off",
-    "indent-legacy": "error" // replace this with your previous `indent` configuration
-  }
-}
-```
-
-## <a name="config-validation"></a> Unrecognized properties in config files now cause a fatal error
-
-When creating a config, users sometimes make typos or misunderstand how the config is supposed to be structured. Previously, ESLint did not validate the properties of a config file, so a typo in a config could be very tedious to debug. Starting in 4.0.0, ESLint will raise an error if a property in a config file is unrecognized or has the wrong type.
-
-**To address:** If you see a config validation error after upgrading, verify that your config doesn't contain any typos. If you are using an unrecognized property, you should be able to remove it from your config to restore the previous behavior.
-
-## <a name="eslintignore-patterns"></a> .eslintignore patterns are now resolved from the location of the file
-
-Due to a bug, glob patterns in an `.eslintignore` file were previously resolved from the current working directory of the process, rather than the location of the `.eslintignore` file. Starting in 4.0, patterns in an `.eslintignore` file will be resolved from the `.eslintignore` file's location.
-
-**To address:** If you use an `.eslintignore` file and you frequently run ESLint from somewhere other than the project root, it's possible that the patterns will be matched differently. You should update the patterns in the `.eslintignore` file to ensure they are relative to the file, not to the working directory.
-
-## <a name="padded-blocks-defaults"></a> The `padded-blocks` rule is more strict by default
-
-By default, the [`padded-blocks`](/docs/rules/padded-blocks) rule will now enforce padding in class bodies and switch statements. Previously, the rule would ignore these cases unless the user opted into enforcing them.
-
-**To address:** If this change results in more linting errors in your codebase, you should fix them or reconfigure the rule.
-
-## <a name="space-before-function-paren-defaults"></a> The `space-before-function-paren` rule is more strict by default
-
-By default, the [`space-before-function-paren`](/docs/rules/space-before-function-paren) rule will now enforce spacing for async arrow functions. Previously, the rule would ignore these cases unless the user opted into enforcing them.
-
-**To address:** To mimic the default config from 3.x, you can use:
-
-```json
-{
-  "rules": {
-    "space-before-function-paren": ["error", {
-      "anonymous": "always",
-      "named": "always",
-      "asyncArrow": "ignore"
-    }]
-  }
-}
-```
-
-## <a name="no-multi-spaces-eol-comments"></a> The `no-multi-spaces` rule is more strict by default
-
-By default, the [`no-multi-spaces`](/docs/rules/no-multi-spaces) rule will now disallow multiple spaces before comments at the end of a line. Previously, the rule did not check this case.
-
-**To address:** To mimic the default config from 3.x, you can use:
-
-```json
-{
-  "rules": {
-    "no-multi-spaces": ["error", {"ignoreEOLComments": true}]
-  }
-}
-```
-
-## <a name="scoped-plugin-resolution"></a> References to scoped plugins in config files are now required to include the scope
-
-In 3.x, there was a bug where references to scoped NPM packages as plugins in config files could omit the scope. For example, in 3.x the following config was legal:
-
-```json
-{
-  "plugins": [
-    "@my-organization/foo"
-  ],
-  "rules": {
-    "foo/some-rule": "error"
-  }
-}
-```
-
-In other words, it was possible to reference a rule from a scoped plugin (such as `foo/some-rule`) without explicitly stating the `@my-organization` scope. This was a bug because it could lead to ambiguous rule references if there was also an unscoped plugin called `eslint-plugin-foo` loaded at the same time.
-
-To avoid this ambiguity, in 4.0 references to scoped plugins must include the scope. The config from above should be fixed to:
-
-```json
-{
-  "plugins": [
-    "@my-organization/foo"
-  ],
-  "rules": {
-    "@my-organization/foo/some-rule": "error"
-  }
-}
-```
-
-**To address:** If you reference a scoped NPM package as a plugin in a config file, be sure to include the scope wherever you reference it.
-
----
-
-## <a name="rule-tester-validation"></a> `RuleTester` now validates properties of test cases
-
-Starting in 4.0, the `RuleTester` utility will validate properties of test case objects, and an error will be thrown if an unknown property is encountered. This change was added because we found that it was relatively common for developers to make typos in rule tests, often invalidating the assertions that the test cases were trying to make.
-
-**To address:** If your tests for custom rules have extra properties, you should remove those properties.
-
-## <a name="comment-attachment"></a> AST Nodes no longer have comment properties
-
-Prior to 4.0, ESLint required parsers to implement comment attachment, a process where AST nodes would gain additional properties corresponding to their leading and trailing comments in the source file. This made it difficult for users to develop custom parsers, because they would have to replicate the confusing comment attachment semantics required by ESLint.
-
-In 4.0, we have moved away from the concept of comment attachment and have moved all comment handling logic into ESLint itself. This should make it easier to develop custom parsers, but it also means that AST nodes will no longer have `leadingComments` and `trailingComments` properties. Conceptually, rule authors can now think of comments in the context of tokens rather than AST nodes.
-
-**To address:** If you have a custom rule that depends on the `leadingComments` or `trailingComments` properties of an AST node, you can now use `sourceCode.getCommentsBefore()` and `sourceCode.getCommentsAfter()` instead, respectively.
-
-Additionally, the `sourceCode` object now also has `sourceCode.getCommentsInside()` (which returns all the comments inside a node), `sourceCode.getAllComments()` (which returns all the comments in the file), and allows comments to be accessed through various other token iterator methods (such as `getTokenBefore()` and `getTokenAfter()`) with the `{ includeComments: true }` option.
-
-For rule authors concerned about supporting ESLint v3.0 in addition to v4.0, the now deprecated `sourceCode.getComments()` is still available and will work for both versions.
-
-Finally, please note that the following `SourceCode` methods have been deprecated and will be removed in a future version of ESLint:
-
-* `getComments()` - replaced by `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()`
-* `getTokenOrCommentBefore()` - replaced by `getTokenBefore()` with the `{ includeComments: true }` option
-* `getTokenOrCommentAfter()` - replaced by `getTokenAfter()` with the `{ includeComments: true }` option
-
-## <a name="event-comments"></a> `LineComment` and `BlockComment` events will no longer be emitted during AST traversal
-
-Starting in 4.0, `LineComment` and `BlockComments` events will not be emitted during AST traversal. There are two reasons for this:
-
-* This behavior was relying on comment attachment happening at the parser level, which does not happen anymore, to ensure that all comments would be accounted for
-* Thinking of comments in the context of tokens is more predictable and easier to reason about than thinking about comment tokens in the context of AST nodes
-
-**To address:** Instead of relying on `LineComment` and `BlockComment`, rules can now use `sourceCode.getAllComments()` to get all comments in a file. To check all comments of a specific type, rules can use the following pattern:
-
-```js
-sourceCode.getAllComments().filter(comment => comment.type === "Line");
-sourceCode.getAllComments().filter(comment => comment.type === "Block");
-```
-
-## <a name="shebangs"></a> Shebangs are now returned from comment APIs
-
-Prior to 4.0, shebang comments in a source file would not appear in the output of `sourceCode.getAllComments()` or `sourceCode.getComments()`, but they would appear in the output of `sourceCode.getTokenOrCommentBefore` as line comments. This inconsistency led to some confusion for rule developers.
-
-In 4.0, shebang comments are treated as comment tokens of type `Shebang` and will be returned by any `SourceCode` method that returns comments. The goal of this change is to make working with shebang comments more consistent with how other tokens are handled.
-
-**To address:** If you have a custom rule that performs operations on comments, some additional logic might be required to ensure that shebang comments are correctly handled or filtered out:
-
-```js
-sourceCode.getAllComments().filter(comment => comment.type !== "Shebang");
-```
-
----
-
-## <a name="global-property"></a> The `global` property in the `linter.verify()` API is no longer supported
-
-Previously, the `linter.verify()` API accepted a `global` config option, which was a synonym for the documented `globals` property. The `global` option was never documented or officially supported, and did not work in config files. It has been removed in 4.0.
-
-**To address:** If you were using the `global` property, please use the `globals` property instead, which does the same thing.
-
-## <a name="report-locations"></a> More report messages now have full location ranges
-
-Starting in 3.1.0, rules have been able to specify the *end* location of a reported problem, in addition to the start location, by explicitly specifying an end location in the `report` call. This is useful for tools like editor integrations, which can use the range to precisely display where a reported problem occurs. Starting in 4.0, if a *node* is reported rather than a location, the end location of the range will automatically be inferred from the end location of the node. As a result, many more reported problems will have end locations.
-
-This is not expected to cause breakage. However, it will likely result in larger report locations than before. For example, if a rule reports the root node of the AST, the reported problem's range will be the entire program. In some integrations, this could result in a poor user experience (e.g. if the entire program is highlighted to indicate an error).
-
-**To address:** If you have an integration that deals with the ranges of reported problems, make sure you handle large report ranges in a user-friendly way.
-
-## <a name="exposed-es2015-classes"></a> Some exposed APIs are now ES2015 classes
-
-The `CLIEngine`, `SourceCode`, and `RuleTester` modules from ESLint's Node.js API are now ES2015 classes. This will not break any documented behavior, but it does have some observable effects (for example, the methods on `CLIEngine.prototype` are now non-enumerable).
-
-**To address:** If you rely on enumerating the methods of ESLint's Node.js APIs, use a function that can also access non-enumerable properties such as `Object.getOwnPropertyNames`.
diff --git a/eslint/docs/user-guide/migrating-to-5.0.0.md b/eslint/docs/user-guide/migrating-to-5.0.0.md
deleted file mode 100644 (file)
index 3729631..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-# Migrating to v5.0.0
-
-ESLint v5.0.0 is the fifth major version release. We have made a few breaking changes in this release, but we expect that most users will be able to upgrade without any modifications to their build. This guide is intended to walk you through the breaking changes.
-
-The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
-
-## Breaking changes for users
-
-1. [Node.js 4 is no longer supported](#drop-node-4)
-1. [New rules have been added to `eslint:recommended`](#eslint-recommended-changes)
-1. [The `experimentalObjectRestSpread` option has been deprecated](#experimental-object-rest-spread)
-1. [Linting nonexistent files from the command line is now a fatal error](#nonexistent-files)
-1. [The default options for some rules have changed](#rule-default-changes)
-1. [Deprecated globals have been removed from the `node`, `browser`, and `jest` environments](#deprecated-globals)
-1. [Empty files are now linted](#empty-files)
-1. [Plugins in scoped packages are now resolvable in configs](#scoped-plugins)
-1. [Multi-line `eslint-disable-line` directives are now reported as problems](#multiline-directives)
-
-## Breaking changes for plugin/custom rule developers
-
-1. [The `parent` property of AST nodes is now set before rules start running](#parent-before-rules)
-1. [When using the default parser, spread operators now have type `SpreadElement`](#spread-operators)
-1. [When using the default parser, rest operators now have type `RestElement`](#rest-operators)
-1. [When using the default parser, text nodes in JSX elements now have type `JSXText`](#jsx-text-nodes)
-1. [The `context.getScope()` method now returns more proper scopes](#context-get-scope)
-1. [The `_linter` property on rule context objects has been removed](#no-context-linter)
-1. [`RuleTester` now uses strict equality checks in its assertions](#rule-tester-equality)
-1. [Rules are now required to provide messages along with reports](#required-report-messages)
-
-## Breaking changes for integration developers
-
-1. [The `source` property is no longer available on individual linting messages](#source-property)
-1. [Fatal errors now result in an exit code of 2](#exit-code-two)
-1. [The `eslint.linter` property is now non-enumerable](#non-enumerable-linter)
-
----
-
-## <a name="drop-node-4"></a> Node.js 4 is no longer supported
-
-As of April 30th, 2018, Node.js 4 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v5. We now support the following versions of Node.js:
-
-* Node.js 6 (6.14.0 and above)
-* Node.js 8 (8.10.0 and above)
-* Anything above Node.js 9.10.0
-
-**To address:** Make sure you upgrade to at least Node.js 6 when using ESLint v5. If you are unable to upgrade, we recommend continuing to use ESLint v4.x until you are able to upgrade Node.js.
-
-## <a name="eslint-recommended-changes"/> `eslint:recommended` changes
-
-Two new rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
-
-* [`for-direction`](/docs/rules/for-direction) enforces that a `for` loop update clause moves the counter in the right direction.
-* [`getter-return`](/docs/rules/getter-return) enforces that a `return` statement is present in property getters.
-
-**To address:** To mimic the `eslint:recommended` behavior from 4.x, you can disable these rules in a config file:
-
-```json
-{
-  "extends": "eslint:recommended",
-
-  "rules": {
-    "for-direction": "off",
-    "getter-return": "off"
-  }
-}
-```
-
-## <a name="experimental-object-rest-spread"></a> The `experimentalObjectRestSpread` option has been deprecated
-
-Previously, when using the default parser it was possible to use the `experimentalObjectRestSpread` option to enable support for [rest/spread properties](https://developers.google.com/web/updates/2017/06/object-rest-spread), as follows:
-
-```json
-{
-  "parserOptions": {
-    "ecmaFeatures": {
-      "experimentalObjectRestSpread": true
-    }
-  }
-}
-```
-
-Object rest/spread is now an official part of the JavaScript language, so our support for it is no longer experimental. In both ESLint v4 and ESLint v5, object rest/spread can now be enabled with the `"ecmaVersion": 2018` option:
-
-```json
-{
-  "parserOptions": {
-    "ecmaVersion": 2018
-  }
-}
-```
-
-Note that this also enables parsing for other features from ES2018, such as [async iteration](https://github.com/tc39/proposal-async-iteration). When using ESLint v5 with the default parser, it is no longer possible to toggle syntax support for object rest/spread independently of other features.
-
-For compatibility, ESLint v5 will treat `ecmaFeatures: { experimentalObjectRestSpread: true }` as an alias for `ecmaVersion: 2018` when the former is found in a config file. As a result, if you use object rest/spread, your code should still parse successfully with ESLint v5. However, note that this alias will be removed in ESLint v6.
-
-**To address:** If you use the `experimentalObjectRestSpread` option, you should be able to upgrade to ESLint v5 without any changes, but you will encounter a deprecation warning. To avoid the warning, use `ecmaVersion: 2018` in your config file rather than `ecmaFeatures: { experimentalObjectRestSpread: true }`. If you would like to disallow the use of other ES2018 features, consider using rules such as [`no-restricted-syntax`](/docs/rules/no-restricted-syntax).
-
-## <a name="nonexistent-files"></a> Linting nonexistent files from the command line is now a fatal error
-
-Previous versions of ESLint silently ignored any nonexistent files and globs provided on the command line:
-
-```bash
-$ eslint nonexistent-file.js 'nonexistent-folder/**/*.js' # exits without any errors in ESLint v4
-```
-
-Many users found this behavior confusing, because if they made a typo in a filename, ESLint would appear to lint that file successfully while actually not linting anything.
-
-ESLint v5 will report a fatal error when either of the following conditions is met:
-
-* A file provided on the command line does not exist
-* A glob or folder provided on the command line does not match any lintable files
-
-Note that this also affects the [`CLIEngine.executeOnFiles()`](https://eslint.org/docs/developer-guide/nodejs-api#cliengineexecuteonfiles) API.
-
-**To address:** If you encounter an error about missing files after upgrading to ESLint v5, you may want to double-check that there are no typos in the paths you provide to ESLint. To make the error go away, you can simply remove the given files or globs from the list of arguments provided to ESLint on the command line.
-
-If you use a boilerplate generator that relies on this behavior (e.g. to generate a script that runs `eslint tests/` in a new project before any test files are actually present), you can work around this issue by adding a dummy file that matches the given pattern (e.g. an empty `tests/index.js` file).
-
-## <a name="rule-default-changes"></a> The default options for some rules have changed
-
-* The default options for the [`object-curly-newline`](/docs/rules/object-curly-newline) rule have changed from `{ multiline: true }` to `{ consistent: true }`.
-* The default options object for the [`no-self-assign`](/docs/rules/no-self-assign) rule has changed from `{ props: false }` to `{ props: true }`.
-
-**To address:** To restore the rule behavior from ESLint v4, you can update your config file to include the previous options:
-
-```json
-{
-  "rules": {
-    "object-curly-newline": ["error", { "multiline": true }],
-    "no-self-assign": ["error", { "props": false }]
-  }
-}
-```
-
-## <a name="deprecated-globals"></a> Deprecated globals have been removed from the `node`, `browser`, and `jest` environments
-
-Some global variables have been deprecated or removed for code running in Node.js, browsers, and Jest. (For example, browsers used to expose an `SVGAltGlyphElement` global variable to JavaScript code, but this global has been removed from web standards and is no longer present in browsers.) As a result, we have removed these globals from the corresponding `eslint` environments, so use of these globals will trigger an error when using rules such as [`no-undef`](/docs/rules/no-undef).
-
-**To address:** If you use deprecated globals in the `node`, `browser`, or `jest` environments, you can add a `globals` section to your configuration to re-enable any globals you need. For example:
-
-```json
-{
-  "env": {
-    "browser": true
-  },
-  "globals": {
-    "SVGAltGlyphElement": false
-  }
-}
-```
-
-## <a name="empty-files"></a> Empty files are now linted
-
-ESLint v4 had a special behavior when linting files that only contain whitespace: it would skip running the parser and rules, and it would always return zero errors. This led to some confusion for users and rule authors, particularly when writing tests for rules. (When writing a stylistic rule, rule authors would occasionally write a test where the source code only contained whitespace, to ensure that the rule behaved correctly when no applicable code was found. However, a test like this would actually not run the rule at all, so an aspect of the rule would end up untested.)
-
-ESLint v5 treats whitespace-only files the same way as all other files: it parses them and runs enabled rules on them as appropriate. This could lead to additional linting problems if you use a custom rule that reports errors on empty files.
-
-**To address:** If you have an empty file in your project and you don't want it to be linted, consider adding it to an [`.eslintignore` file](/docs/user-guide/configuring#ignoring-files-and-directories).
-
-If you have a custom rule, you should make sure it handles empty files appropriately. (In most cases, no changes should be necessary.)
-
-## <a name="scoped-plugins"></a> Plugins in scoped packages are now resolvable in configs
-
-When ESLint v5 encounters a plugin name in a config starting with `@`, the plugin will be resolved as a [scoped npm package](https://docs.npmjs.com/misc/scope). For example, if a config contains `"plugins": ["@foo"]`, ESLint v5 will attempt to load a package called `@foo/eslint-plugin`. (On the other hand, ESLint v4 would attempt to load a package called `eslint-plugin-@foo`.) This is a breaking change because users might have been relying on ESLint finding a package at `node_modules/eslint-plugin-@foo`. However, we think it is unlikely that many users were relying on this behavior, because packages published to npm cannot contain an `@` character in the middle.
-
-**To address:** If you rely on ESLint loading a package like `eslint-config-@foo`, consider renaming the package to something else.
-
-## <a name="multiline-directives"></a> Multi-line `eslint-disable-line` directives are now reported as problems
-
-`eslint-disable-line` and `eslint-disable-next-line` directive comments are only allowed to span a single line. For example, the following directive comment is invalid:
-
-```js
-alert('foo'); /* eslint-disable-line
-   no-alert */ alert('bar');
-
-// (which line is the rule disabled on?)
-```
-
-Previously, ESLint would ignore these malformed directive comments. ESLint v5 will report an error when it sees a problem like this, so that the issue can be more easily corrected.
-
-**To address:** If you see new reported errors as a result of this change, ensure that your `eslint-disable-line` directives only span a single line. Note that "block comments" (delimited by `/* */`) are still allowed to be used for directives, provided that the block comments do not contain linebreaks.
-
----
-
-## <a name="parent-before-rules"></a> The `parent` property of AST nodes is now set before rules start running
-
-Previously, ESLint would set the `parent` property on each AST node immediately before running rule listeners for that node. This caused some confusion for rule authors, because the `parent` property would not initially be present on any nodes, and it was sometimes necessary to complicate the structure of a rule to ensure that the `parent` property of a given node would be available when needed.
-
-In ESLint v5, the `parent` property is set on all AST nodes before any rules have access to the AST. This makes it easier to write some rules, because the `parent` property is always available rather than being mutated behind the scenes. However, as a side-effect of having `parent` properties, the AST object has a circular structure the first time a rule sees it (previously, it only had a circular structure after the first rule listeners were called). As a result, a custom rule that enumerates all properties of a node in order to traverse the AST might now loop forever or run out of memory if it does not check for cycles properly.
-
-**To address:** If you have written a custom rule that enumerates all properties of an AST node, consider excluding the `parent` property or implementing cycle detection to ensure that you obtain the correct result.
-
-## <a name="spread-operators"></a> When using the default parser, spread operators now have type `SpreadElement`
-
-Previously, when parsing JS code like `const foo = {...data}` with the `experimentalObjectRestSpread` option enabled, the default parser would generate an `ExperimentalSpreadProperty` node type for the `...data` spread element.
-
-In ESLint v5, the default parser will now always give the `...data` AST node the `SpreadElement` type, even if the (now deprecated) [`experimentalObjectRestSpread`](#experimental-object-rest-spread) option is enabled. This makes the AST compliant with the current ESTree spec.
-
-**To address:** If you have written a custom rule that relies on spread operators having the `ExperimentalSpreadProperty` type, you should update it to also work with spread operators that have the `SpreadElement` type.
-
-## <a name="rest-operators"></a> When using the default parser, rest operators now have type `RestElement`
-
-Previously, when parsing JS code like `const {foo, ...rest} = data` with the `experimentalObjectRestSpread` option enabled, the default parser would generate an `ExperimentalRestProperty` node type for the `...data` rest element.
-
-In ESLint v5, the default parser will now always give the `...data` AST node the `RestElement` type, even if the (now deprecated) [`experimentalObjectRestSpread`](#experimental-object-rest-spread) option is enabled. This makes the AST compliant with the current ESTree spec.
-
-**To address:** If you have written a custom rule that relies on rest operators having the `ExperimentalRestProperty` type, you should update it to also work with rest operators that have the `RestElement` type.
-
-## <a name="jsx-text-nodes"></a> When using the default parser, text nodes in JSX elements now have type `JSXText`
-
-When parsing JSX code like `<a>foo</a>`, the default parser will now give the `foo` AST node the `JSXText` type, rather than the `Literal` type. This makes the AST compliant with a recent update to the JSX spec.
-
-**To address:** If you have written a custom rule that relies on text nodes in JSX elements having the `Literal` type, you should update it to also work with nodes that have the `JSXText` type.
-
-## <a name="context-get-scope"></a> The `context.getScope()` method now returns more proper scopes
-
-Previously, the `context.getScope()` method changed its behavior based on the `parserOptions.ecmaVersion` property. However, this could cause confusing behavior when using a parser that doesn't respond to the `ecmaVersion` option, such as `babel-eslint`.
-
-Additionally, `context.getScope()` incorrectly returned the parent scope of the proper scope on `CatchClause` (in ES5), `ForStatement` (in ≧ES2015), `ForInStatement` (in ≧ES2015), `ForOfStatement`, and `WithStatement` nodes.
-
-In ESLint v5, the `context.getScope()` method has the same behavior regardless of `parserOptions.ecmaVersion` and returns the proper scope. See [the documentation](../developer-guide/working-with-rules#contextgetscope) for more details on which scopes are returned.
-
-**To address:** If you have written a custom rule that uses the `context.getScope()` method in node handlers, you may need to update it to account for the modified scope information.
-
-## <a name="no-context-linter"></a> The `_linter` property on rule context objects has been removed
-
-Previously, rule context objects had an undocumented `_linter` property, which was used internally within ESLint to process reports from rules. Some rules used this property to achieve functionality that was not intended to be possible for rules. For example, several plugins used the `_linter` property in a rule to monitor reports from other rules, for the purpose of checking for unused `/* eslint-disable */` directive comments. Although this functionality was useful for users, it could also cause stability problems for projects using ESLint. For example, an upgrade to a rule in one plugin could unexpectedly cause a rule in another plugin to start reporting errors.
-
-The `_linter` property has been removed in ESLint v5.0, so it is no longer possible to implement rules with this functionality. However, the [`--report-unused-disable-directives`](/docs/user-guide/command-line-interface#--report-unused-disable-directives) CLI flag can be used to flag unused directive comments.
-
-## <a name="rule-tester-equality"></a> `RuleTester` now uses strict equality checks in its assertions
-
-Previously, `RuleTester` used loose equality when making some of its assertions. For example, if a rule produced the string `"7"` as a result of autofixing, `RuleTester` would allow the number `7` in an `output` assertion, rather than the string `"7"`. In ESLint v5, comparisons from `RuleTester` use strict equality, so an assertion like this will no longer pass.
-
-**To address:** If you use `RuleTester` to write tests for your custom rules, make sure the expected values in your assertions are strictly equal to the actual values.
-
-## <a name="required-report-messages"></a> Rules are now required to provide messages along with reports
-
-Previously, it was possible for rules to report AST nodes without providing a report message. This was not intended behavior, and as a result the default formatter would crash if a rule omitted a message. However, it was possible to avoid a crash when using a non-default formatter, such as `json`.
-
-In ESLint v5, reporting a problem without providing a message always results in an error.
-
-**To address:** If you have written a custom rule that reports a problem without providing a message, update it to provide a message along with the report.
-
----
-
-## <a name="source-property"></a> The `source` property is no longer available on individual linting messages
-
-As announced in [October 2016](/blog/2016/10/eslint-v3.8.0-released#additional-property-on-linting-results), the `source` property has been removed from individual lint message objects.
-
-**To address:** If you have a formatter or integration which relies on using the `source` property on individual linting messages, you should update it to use the `source` property on file results objects instead.
-
-## <a name="exit-code-two"></a> Fatal errors now result in an exit code of 2
-
-When using ESLint v4, both of the following scenarios resulted in an exit code of 1 when running ESLint on the command line:
-
-* Linting completed successfully, but there are some linting errors
-* Linting was unsuccessful due to a fatal error (e.g. an invalid config file)
-
-As a result, it was difficult for an integration to distinguish between the two cases to determine whether it should try to extract linting results from the output.
-
-In ESLint v5, an unsuccessful linting run due to a fatal error will result in an exit code of 2, rather than 1.
-
-**To address:** If you have an integration that detects all problems with linting runs by checking whether the exit code is equal to 1, update it to check whether the exit code is nonzero instead.
-
-## <a name="non-enumerable-linter"></a> The `eslint.linter` property is now non-enumerable
-
-When using ESLint's Node.js API, the [`linter`](/docs/developer-guide/nodejs-api#linter-1) property is now non-enumerable. Note that the `linter` property was deprecated in ESLint v4 in favor of the [`Linter`](/docs/developer-guide/nodejs-api#linter) property.
-
-**To address:** If you rely on enumerating all the properties of the `eslint` object, use something like `Object.getOwnPropertyNames` to ensure that non-enumerable keys are captured.
diff --git a/eslint/docs/user-guide/migrating-to-6.0.0.md b/eslint/docs/user-guide/migrating-to-6.0.0.md
deleted file mode 100644 (file)
index 225cc4c..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-# Migrating to v6.0.0
-
-ESLint v6.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
-
-The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
-
-## Breaking changes for users
-
-1. [Node.js 6 is no longer supported](#drop-node-6)
-1. [`eslint:recommended` has been updated](#eslint-recommended-changes)
-1. [Plugins and shareable configs are no longer affected by ESLint's location](#package-loading-simplification)
-1. [The default parser now validates options more strictly](#espree-validation)
-1. [Rule configuration are validated more strictly](#rule-config-validating)
-1. [The `no-redeclare` rule is now more strict by default](#no-redeclare-updates)
-1. [The `comma-dangle` rule is now more strict by default](#comma-dangle-updates)
-1. [The `no-confusing-arrow` rule is now more lenient by default](#no-confusing-arrow-updates)
-1. [Overrides in a config file can now match dotfiles](#overrides-dotfiles)
-1. [Overrides in an extended config file can now be overridden by a parent config file](#overrides-precedence)
-1. [Configuration values for globals are now validated](#globals-validation)
-1. [The deprecated `experimentalObjectRestSpread` option has been removed](#experimental-object-rest-spread)
-1. [User-provided regular expressions in rule options are parsed with the unicode flag](#unicode-regexes)
-
-## Breaking changes for plugin/custom rule developers
-
-1. [Plugin authors may need to update installation instructions](#plugin-documentation)
-1. [`RuleTester` now validates against invalid `default` keywords in rule schemas](#rule-tester-defaults)
-1. [`RuleTester` now requires an absolute path on `parser` option](#rule-tester-parser)
-1. [The `eslintExplicitGlobalComment` scope analysis property has been removed](#eslintExplicitGlobalComment)
-
-## Breaking changes for integration developers
-
-1. [Plugins and shareable configs are no longer affected by ESLint's location](#package-loading-simplification)
-1. [`Linter` no longer tries to load missing parsers from the filesystem](#linter-parsers)
-
----
-
-## <a name="drop-node-6"></a> Node.js 6 is no longer supported
-
-As of April 2019, Node.js 6 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v6. We now support the following versions of Node.js:
-
-* Node.js 8 (8.10.0 and above)
-* Node.js 10 (10.13.0 and above)
-* Anything above Node.js 11.10.1
-
-**To address:** Make sure you upgrade to at least Node.js 8 when using ESLint v6. If you are unable to upgrade, we recommend continuing to use ESLint v5.x until you are able to upgrade Node.js.
-
-**Related issue(s):** [eslint/eslint#11546](https://github.com/eslint/eslint/issues/11456)
-
-## <a name="eslint-recommended-changes"></a> `eslint:recommended` has been updated
-
-The following rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
-
-* [`no-async-promise-executor`](https://eslint.org/docs/rules/no-async-promise-executor) disallows using an `async` function as the argument to the `Promise` constructor, which is usually a bug.
-* [`no-misleading-character-class`](https://eslint.org/docs/rules/no-misleading-character-class) reports character classes in regular expressions that might not behave as expected.
-* [`no-prototype-builtins`](https://eslint.org/docs/rules/no-prototype-builtins) reports method calls like `foo.hasOwnProperty("bar")` (which are a frequent source of bugs), and suggests that they be replaced with `Object.prototype.hasOwnProperty.call(foo, "bar")` instead.
-* [`no-shadow-restricted-names`](https://eslint.org/docs/rules/no-shadow-restricted-names) disallows shadowing variables like `undefined` (e.g. with code like `let undefined = 5;`), since is likely to confuse readers.
-* [`no-useless-catch`](https://eslint.org/docs/rules/no-useless-catch) reports `catch` clauses that are redundant and can be removed from the code without changing its behavior.
-* [`no-with`](https://eslint.org/docs/rules/no-with) disallows use of the [`with` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with), which can make code difficult to understand and cause compatibility problems.
-* [`require-atomic-updates`](https://eslint.org/docs/rules/require-atomic-updates) reports race condition bugs that can occur when reassigning variables in async functions.
-
-Additionally, the following rule has been *removed* from `eslint:recommended`:
-
-* [`no-console`](https://eslint.org/docs/rules/no-console) disallows calling functions like `console.log`. While this rule is useful in many cases (e.g. to avoid inadvertently leaving debugging statements in production code), it is not as broadly applicable as the other rules in `eslint:recommended`, and it was a source of false positives in cases where `console.log` is acceptable (e.g. in CLI applications).
-
-Finally, in ESLint v5 `eslint:recommended` would explicitly disable all core rules that were not considered "recommended". This could cause confusing behavior if `eslint:recommended` was loaded after another config, since `eslint:recommended` would have the effect of turning off some rules. In ESLint v6, `eslint:recommended` has no effect on non-recommended rules.
-
-**To address:** To mimic the `eslint:recommended` behavior from 5.x, you can explicitly disable/enable rules in a config file as follows:
-
-```json
-{
-  "extends": "eslint:recommended",
-
-  "rules": {
-    "no-async-promise-executor": "off",
-    "no-misleading-character-class": "off",
-    "no-prototype-builtins": "off",
-    "no-shadow-restricted-names": "off",
-    "no-useless-catch": "off",
-    "no-with": "off",
-    "require-atomic-updates": "off",
-
-    "no-console": "error"
-  }
-}
-```
-
-In rare cases (if you were relying on the previous behavior where `eslint:recommended` disables core rules), you might need to disable additional rules to restore the previous behavior.
-
-**Related issue(s):** [eslint/eslint#10768](https://github.com/eslint/eslint/issues/10768), [eslint/eslint#10873](https://github.com/eslint/eslint/issues/10873)
-
-## <a name="package-loading-simplification"></a> Plugins and shareable configs are no longer affected by ESLint's location
-
-Previously, ESLint loaded plugins relative to the location of the ESLint package itself. As a result, we suggested that users with global ESLint installations should also install plugins globally, and users with local ESLint installations should install plugins locally. However, due to a design bug, this strategy caused ESLint to randomly fail to load plugins and shareable configs under certain circumstances, particularly when using package management tools like [`lerna`](https://github.com/lerna/lerna) and [Yarn Plug n' Play](https://yarnpkg.com/lang/en/docs/pnp/).
-
-As a rule of thumb: With ESLint v6, plugins should always be installed locally, even if ESLint was installed globally. More precisely, ESLint v6 resolves plugins relative to the end user's project by default, and always resolves shareable configs and parsers relative to the location of the config file that imports them.
-
-**To address:** If you use a global installation of ESLint (e.g. installed with `npm install eslint --global`) along with plugins, you should install those plugins locally in the projects where you run ESLint. If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.
-
-If you use a config file located outside of a local project (with the `--config` flag), consider installing the plugins as dependencies of that config file, and setting the [`--resolve-plugins-relative-to`](./command-line-interface#--resolve-plugins-relative-to) flag to the location of the config file.
-
-**Related issue(s):** [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
-
-## <a name="espree-validation"></a> The default parser now validates options more strictly
-
-`espree`, the default parser used by ESLint, will now raise an error in the following cases:
-
-* The `ecmaVersion` parser option is set to something other than a number, such as the string `"2015"`. (Previously, a non-number option would simply be ignored.)
-* The `sourceType: "module"` parser option is set while `ecmaVersion` is set to `5` or left unspecified. (Previously, setting `sourceType: "module"` would implicitly cause `ecmaVersion` to be set to a minimum of 2015, which could be surprising.)
-* The `sourceType` is set to anything other than `"script"` or `"module"`.
-
-**To address:** If your config sets `ecmaVersion` to something other than a number, you can restore the previous behavior by removing `ecmaVersion`. (However, you may want to double-check that your config is actually working as expected.) If your config sets `parserOptions: { sourceType: "module" }` without also setting `parserOptions.ecmaVersion`, you should add `parserOptions: { ecmaVersion: 2015 }` to restore the previous behavior.
-
-**Related issue(s):** [eslint/eslint#9687](https://github.com/eslint/eslint/issues/9687), [eslint/espree#384](https://github.com/eslint/espree/issues/384)
-
-## <a name="rule-config-validating"></a> Rule configuration are validated more strictly
-
-To catch config errors earlier, ESLint v6 will report a linting error if you are trying to configure a non-existent rule.
-
-config | ESLint v5 | ESLint v6
-------------- | ------------- | -------------
-`/*eslint-enable foo*/`  | no error | linting error
-`/*eslint-disable(-line) foo*/`  | no error | linting error
-`/*eslint foo: 0*/` | no error | linting error
-`{rules: {foo: 0}}` | no error | no error
-`{rules: {foo: 1}` | linting warning | linting error
-
-**To address:** You can remove the non-existent rule in your (inline) config.
-
-**Related issue(s):** [eslint/eslint#9505](https://github.com/eslint/eslint/issues/9505)
-
-## <a name="no-redeclare-updates"></a> The `no-redeclare` rule is now more strict by default
-
-The default options for the [`no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule have changed from `{ builtinGlobals: false }` to `{ builtinGlobals: true }`. Additionally, the `no-redeclare` rule will now report an error for globals enabled by comments like `/* global foo */` if those globals were already enabled through configuration anyway.
-
-**To address:**
-
-To restore the previous options for the rule, you can configure it as follows:
-
-```json
-{
-  "rules": {
-    "no-redeclare": ["error", { "builtinGlobals": false }]
-  }
-}
-```
-
-Additionally, if you see new errors for `global` comments in your code, you should remove those comments.
-
-**Related issue(s):** [eslint/eslint#11370](https://github.com/eslint/eslint/issues/11370), [eslint/eslint#11405](https://github.com/eslint/eslint/issues/11405)
-
-## <a name="comma-dangle-updates"></a> The `comma-dangle` rule is now more strict by default
-
-Previously, the [`comma-dangle`](https://eslint.org/docs/rules/comma-dangle) rule would ignore trailing function arguments and parameters, unless explicitly configured to check for function commas. In ESLint v6, function commas are treated the same way as other types of trailing commas.
-
-**To address:** You can restore the previous default behavior of the rule with:
-
-```json
-{
-  "rules": {
-    "comma-dangle": ["error", {
-        "arrays": "never",
-        "objects": "never",
-        "imports": "never",
-        "exports": "never",
-        "functions": "ignore"
-    }]
-  }
-}
-```
-
-To restore the previous behavior of a string option like `"always-multiline"`, replace `"never"` with `"always-multiline"` in the example above.
-
-**Related issue(s):** [eslint/eslint#11502](https://github.com/eslint/eslint/issues/11502)
-
-## <a name="no-confusing-arrow-updates"></a> The `no-confusing-arrow` rule is now more lenient by default
-
-The default options for the [`no-confusing-arrow`](https://eslint.org/docs/rules/no-confusing-arrow) rule have changed from `{ allowParens: false }` to `{ allowParens: true }`.
-
-**To address:** You can restore the previous default behavior of the rule with:
-
-```json
-{
-  "rules": {
-    "no-confusing-arrow": ["error", { "allowParens": false }]
-  }
-}
-```
-
-**Related issue(s):** [eslint/eslint#11503](https://github.com/eslint/eslint/issues/11503)
-
-## <a name="overrides-dotfiles"></a> Overrides in a config file can now match dotfiles
-
-Due to a bug, the glob patterns in a `files` list in an `overrides` section of a config file would never match dotfiles, making it impossible to have overrides apply to files starting with a dot. This bug has been fixed in ESLint v6.
-
-**To address:** If you don't want dotfiles to be matched by an override, consider adding something like `excludedFiles: [".*"]` to that `overrides` section. See the [documentation](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) for more details.
-
-**Related issue(s):** [eslint/eslint#11201](https://github.com/eslint/eslint/issues/11201)
-
-## <a name="overrides-precedence"></a> Overrides in an extended config file can now be overridden by a parent config file
-
-Due to a bug, it was previously the case that an `overrides` block in a shareable config had precedence over the top level of a parent config. For example, with the following config setup, the `semi` rule would end up enabled even though it was explicitly disabled in the end user's config:
-
-```js
-// .eslintrc.js
-module.exports = {
-  extends: ["foo"],
-  rules: {
-    semi: "off"
-  }
-};
-```
-
-```js
-// eslint-config-foo/index.js
-module.exports = {
-  overrides: {
-    files: ["*.js"],
-    rules: {
-      semi: "error"
-    }
-  }
-};
-```
-
-In ESLint v6.0.0, a parent config always has precedence over extended configs, even with `overrides` blocks.
-
-**To address:** We expect the impact of this issue to be very low because most shareable configs don't use `overrides` blocks. However, if you use a shareable config with `overrides` blocks, you might encounter a change in behavior due to something that is explicitly specified in your config but was inactive until now. If you would rather inherit the behavior from the shareable config, simply remove the corresponding entry from your own config. (In the example above, the previous behavior could be restored by removing `semi: "off"` from `.eslintrc.js`.)
-
-**Related issue(s):** [eslint/eslint#11510](https://github.com/eslint/eslint/issues/11510)
-
-## <a name="globals-validation"></a> Configuration values for globals are now validated
-
-Previously, when configuring a set of global variables with an object, it was possible to use anything as the values of the object. An unknown value would be treated the same as `"writable"`.
-
-```js
-// .eslintrc.js
-module.exports = {
-  globals: {
-    foo: "readonly",
-    bar: "writable",
-    baz: "hello!" // ???
-  }
-};
-```
-
-With this change, any unknown values in a `globals` object result in a config validation error.
-
-**To address:** If you see config validation errors related to globals after updating, ensure that all values configured for globals are either `readonly`, `writable`, or `off`. (ESLint also accepts some alternate spellings and variants for compatibility.)
-
-## <a name="experimental-object-rest-spread"></a> The deprecated `experimentalObjectRestSpread` option has been removed
-
-Previously, when using the default parser, a config could use the `experimentalObjectRestSpread` option to enable parsing support for object rest/spread properties:
-
-```json
-{
-  "parserOptions": {
-    "ecmaFeatures": {
-      "experimentalObjectRestSpread": true
-    }
-  }
-}
-```
-
-Since ESLint v5, `ecmaFeatures: { experimentalObjectRestSpread: true }` has been equivalent to `ecmaVersion: 2018`, and has also emitted a deprecation warning. In ESLint v6, the `experimentalObjectRestSpread` feature has been removed entirely and has no effect. If your config was relying on `experimentalObjectRestSpread` to enable ES2018 parsing, you might start seeing parsing errors for recent syntax.
-
-**To address:** If you use the `experimentalObjectRestSpread` option, you should change your config to contain this instead:
-
-```json
-{
-  "parserOptions": {
-    "ecmaVersion": 2018
-  }
-}
-```
-
-If you're not sure which config file needs to be updated, it may be useful to run ESLint v5 and look at what config file is mentioned in the deprecation warning.
-
-**Related issue(s):** [eslint/eslint#9990](https://github.com/eslint/eslint/issues/9990)
-
-## <a name="unicode-regexes"></a> User-provided regular expressions in rule options are parsed with the unicode flag
-
-Rules like [`max-len`](/docs/rules/max-len) accept a string option which is interpreted as a regular expression. In ESLint v6.0.0, these regular expressions are interpreted with the [unicode flag](https://mathiasbynens.be/notes/es6-unicode-regex), which should exhibit more reasonable behavior when matching characters like astral symbols. Unicode regexes also validate escape sequences more strictly than non-unicode regexes.
-
-**To address:** If you get rule option validation errors after upgrading, ensure that any regular expressions in your rule options have no invalid escape sequences.
-
-**Related issue(s):** [eslint/eslint#11423](https://github.com/eslint/eslint/issues/11423)
-
----
-
-## <a name="plugin-documentation"></a> Plugin authors may need to update installation instructions
-
-If you maintain a plugin and provide installation instructions, you should ensure that the installation instructions are up to date with the [user-facing changes to how plugins are loaded](#package-loading-simplification). In particular, if your plugin was generated with the [`generator-eslint`](https://github.com/eslint/generator-eslint) package, it likely contains outdated instructions for how to use the plugin with global ESLint installations.
-
-**Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
-
-## <a name="rule-tester-defaults"></a> `RuleTester` now validates against invalid `default` keywords in rule schemas
-
-In some cases, rule schemas can use the `default` keyword to automatically specify default values for rule options. However, the `default` keyword is only effective in certain schema locations, and is ignored elsewhere, which creates a risk of bugs if a rule incorrectly expects a default value to be provided as a rule option. In ESLint v6.0.0, `RuleTester` will raise an error if a rule has an invalid `default` keyword in its schema.
-
-**To address:** If `RuleTester` starts reporting an error about an invalid default, you can remove the `default` property at the indicated location in your rule schema, and the rule will behave the same way. (If this happens, you might also want to verify that the rule behaves correctly when no option value is provided in that location.)
-
-**Related issue(s):** [eslint/eslint#11473](https://github.com/eslint/eslint/issues/11473)
-
-## <a name="rule-tester-parser"></a> `RuleTester` now requires an absolute path on `parser` option
-
-To use custom parsers in tests, we could use `parser` property with a package name or file path. However, if a package name was given, it's unclear where the tester should load the parser package from because the tester doesn't know which files are running the tester. In ESLint v6.0.0, `RuleTester` disallows `parser` property with a package name.
-
-**To address:** If you use `parser` property with package names in test cases, update it with `require.resolve()` function to resolve the package name to the absolute path to the package.
-
-**Related issue(s):** [eslint/eslint#11728](https://github.com/eslint/eslint/issues/11728), [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
-
-## <a name="eslintExplicitGlobalComment"></a> The `eslintExplicitGlobalComment` scope analysis property has been removed
-
-Previously, ESLint would add an `eslintExplicitGlobalComment` property to `Variable` objects in scope analysis to indicate that a variable was introduced as a result of a `/* global */` comment. This property was undocumented, and the ESLint team was unable to find any usage of the property outside of ESLint core. The property has been removed in ESLint v6, and replaced with the `eslintExplicitGlobalComments` property, which can contain a list of all `/* global */` comments if a variable was declared with more than one of them.
-
-**To address:** If you maintain a rule that uses the `eslintExplicitGlobalComment` property, update it to use the `eslintExplicitGlobalComments` property as a list instead.
-
-**Related issue(s):** [eslint/rfcs#17](https://github.com/eslint/rfcs/pull/17)
-
----
-
-## <a name="linter-parsers"></a> `Linter` no longer tries to load missing parsers from the filesystem
-
-Previously, when linting code with a parser that had not been previously defined, the `Linter` API would attempt to load the parser from the filesystem. However, this behavior was confusing because `Linter` never access the filesystem in any other cases, and it was difficult to ensure that the correct parser would be found when loading the parser from the filesystem.
-
-In ESLint v6, `Linter` will no longer perform any filesystem operations, including loading parsers.
-
-**To address:** If you're using `Linter` with a custom parser, use [`Linter#defineParser`](https://eslint.org/docs/developer-guide/nodejs-api#linterdefineparser) to explicitly define the parser before linting any code.
-
-**Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
diff --git a/eslint/docs/user-guide/migrating-to-7.0.0.md b/eslint/docs/user-guide/migrating-to-7.0.0.md
deleted file mode 100644 (file)
index 2a640a7..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-# Migrating to v7.0.0
-
-ESLint v7.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
-
-The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
-
-## Table of Content
-
-### Breaking changes for users
-
-- [Node.js 8 is no longer supported](#drop-node-8)
-- [Lint files matched by `overrides[].files` by default](#additional-lint-targets)
-- [The base path of `overrides` and `ignorePatterns` is changed if the config file is given by the `--config`/`--ignore-path` options](#base-path-change)
-- [The place where ESLint loads plugins from is changed](#plugin-loading-change)
-- [Runtime deprecation warnings for `~/.eslintrc.*` config files](#runtime-deprecation-on-personal-config-files)
-- [Default ignore patterns have changed](#default-ignore-patterns)
-- [Description in directive comments](#description-in-directive-comments)
-- [Node.js/CommonJS rules are deprecated](#deprecate-node-rules)
-- [Several rules have been updated to cover more cases](#rules-strict)
-- [`eslint:recommended` has been updated](#eslint-recommended)
-
-### Breaking changes for plugin developers
-
-- [Node.js 8 is no longer supported](#drop-node-8)
-- [Lint files matched by `overrides[].files` by default](#additional-lint-targets)
-- [Plugin resolution has been updated](#plugin-loading-change)
-- [Additional validation added to the `RuleTester` class](#rule-tester-strict)
-
-### Breaking changes for integration developers
-
-- [Node.js 8 is no longer supported](#drop-node-8)
-- [Plugin resolution has been updated](#plugin-loading-change)
-- [The `CLIEngine` class has been deprecated](#deprecate-cliengine)
-
----
-
-## <a name="drop-node-8"></a> Node.js 8 is no longer supported
-
-Node.js 8 reached EOL in December 2019, and we are officially dropping support for it in this release. ESLint now supports the following versions of Node.js:
-
-- Node.js 10 (`10.12.0` and above)
-- Node.js 12 and above
-
-**To address:** Make sure you upgrade to at least Node.js `10.12.0` when using ESLint v7.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 6 until you are able to upgrade Node.js.
-
-**Related issue(s):** [RFC44](https://github.com/eslint/rfcs/blob/master/designs/2019-drop-node8/README.md), [#12700](https://github.com/eslint/eslint/pull/12700)
-
-## <a name="additional-lint-targets"></a> Lint files matched by `overrides[].files` by default
-
-Previously to v7.0.0, ESLint would only lint files with a `.js` extension by default if you give directories like `eslint src`.
-
-ESLint v7.0.0 will now additionally lint files with other extensions (`.ts`, `.vue`, etc.) if the extension is explicitly matched by an `overrides[].files` entry. This will allow for users to lint files that don't end with `*.js` to be linted without having to use the `--ext` command line flag, as well as allow shared configuration authors to enable linting of these files without additional overhead for the end user. Please note that patterns that end with `*` are exempt from this behavior and will behave as they did previously. For example, if the following config file is present,
-
-```yml
-# .eslintrc.yml
-extends: my-config-js
-overrides:
-  - files: "*.ts"
-    extends: my-config-ts
-```
-
-then running `eslint src` would check both `*.js` and `*.ts` files in the `src` directory.
-
-**To address:** Using the `--ext` CLI option will override this new behavior. Run ESLint with `--ext .js`  if you are using `overrides` but only want to lint files that have a `.js` extension.
-
-If you maintain plugins that check files with extensions other than `.js`, this feature will allow you to check these files by default by configuring an `overrides` setting in your `recommended` preset.
-
-**Related issue(s):** [RFC20](https://github.com/eslint/rfcs/blob/master/designs/2019-additional-lint-targets/README.md), [#12677](https://github.com/eslint/eslint/pull/12677)
-
-## <a name="base-path-change"></a> The base path of `overrides` and `ignorePatterns` has changed when using the `--config`/`--ignore-path` options
-
-Up until now, ESLint has resolved the following paths relative to the directory path of the _entry_ configuration file:
-
-- Configuration files (`.eslintrc.*`)
-    - relative paths in the `overrides[].files` setting
-    - relative paths in the `overrides[].excludedFiles` setting
-    - paths which start with `/` in the `ignorePatterns` setting
-- Ignore files (`.eslintignore`)
-    - paths which start with `/`
-
-Starting in ESLint v7.0.0, configuration files and ignore files passed to ESLint using the `--config path/to/a-config` and `--ignore-path path/to/a-ignore` CLI flags, respectively, will resolve from the current working directory rather than the file location. This allows for users to utilize shared plugins without having to install them directly in their project.
-
-**To address:** Update the affected paths if you are using a configuration or ignore file via the `--config` or `--ignore-path` CLI options.
-
-**Related issue(s):** [RFC37](https://github.com/eslint/rfcs/blob/master/designs/2019-changing-base-path-in-config-files-that-cli-options-specify/README.md), [#12887](https://github.com/eslint/eslint/pull/12887)
-
-## <a name="plugin-loading-change"></a> Plugin resolution has been updated
-
-In previous versions, ESLint resolved all plugins from the current working directory by default.
-
-Starting in ESLint v7.0.0, `plugins` are resolved relative to the directory path of the _entry_ configuration file.
-
-This will not change anything in most cases. If a configuration file in a subdirectory has `plugins` defined, the plugins will be loaded from the subdirectory (or ancestor directories that include the current working directory if not found).
-
-This means that if you are using a config file from a shared location via `--config` option, the plugins that the config file declare will be loaded from the shared config file location.
-
-**To address:** Ensure that plugins are installed in a place that can be resolved relative to your configuration file or use `--resolve-plugins-relative-to .` to override this change.
-
-**Related issue(s):** [RFC47](https://github.com/eslint/rfcs/blob/master/designs/2019-plugin-loading-improvement/README.md), [#12922](https://github.com/eslint/eslint/pull/12922)
-
-## <a name="runtime-deprecation-on-personal-config-files"></a> Runtime deprecation warnings for `~/.eslintrc.*` config files
-
-Personal config files have been deprecated since [v6.7.0](https://eslint.org/blog/2019/11/eslint-v6.7.0-released). ESLint v7.0.0 will start printing runtime deprecation warnings. It will print a warning for the following situations:
-
-1. When a project does not have a configuration file present and ESLint loads configuration from `~/.eslintrc.*`.
-1. When a project has a configuration file and ESLint ignored a `~/.eslintrc.*` configuration file. This occurs when the `$HOME` directory is an ancestor directory of the project and the project's configuration files doesn't contain `root:true`.
-
-**To address:** Remove `~/.eslintrc.*` configuration files and add a `.eslintrc.*` configuration file to your project. Alternatively, use the `--config` option to use shared config files.
-
-**Related issue(s):** [RFC32](https://github.com/eslint/rfcs/tree/master/designs/2019-deprecating-personal-config/README.md), [#12678](https://github.com/eslint/eslint/pull/12678)
-
-## <a name="default-ignore-patterns"></a> Default ignore patterns have changed
-
-Up until now, ESLint has ignored the following files by default:
-
-- Dotfiles (`.*`)
-- `node_modules` in the current working directory (`/node_modules/*`)
-- `bower_components` in the current working directory (`/bower_components/*`)
-
-ESLint v7.0.0 ignores `node_modules/*` of subdirectories as well, but no longer ignores `bower_components/*` and `.eslintrc.js`. Therefore, the new default ignore patterns are:
-
-- Dotfiles except `.eslintrc.*` (`.*` but not `.eslintrc.*`)
-- `node_modules` (`/**/node_modules/*`)
-
-**To address:** Modify your `.eslintignore` or the `ignorePatterns` property of your config file if you don't want to lint `bower_components/*` and `.eslintrc.js`.
-
-**Related issue(s):** [RFC51](https://github.com/eslint/rfcs/blob/master/designs/2019-update-default-ignore-patterns/README.md), [#12888](https://github.com/eslint/eslint/pull/12888)
-
-## <a name="description-in-directive-comments"></a> Descriptions in directive comments
-
-In older version of ESLint, there was no convenient way to indicate why a directive comment – such as `/*eslint-disable*/` – was necessary.
-
-To allow for the colocation of comments that provide context with the directive, ESLint v7.0.0 adds the ability to append arbitrary text in directive comments by ignoring text following `--` surrounded by whitespace. For example:
-
-```js
-// eslint-disable-next-line a-rule, another-rule -- those are buggy!!
-```
-
-**To address:** If you have `--` surrounded by whitespace in directive comments, consider moving it into your configuration file.
-
-**Related issue(s):** [RFC33](https://github.com/eslint/rfcs/blob/master/designs/2019-description-in-directive-comments/README.md), [#12699](https://github.com/eslint/eslint/pull/12699)
-
-## <a name="deprecate-node-rules"></a> Node.js/CommonJS rules have been deprecated
-
-The ten Node.js/CommonJS rules in core have been deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin.
-
-**To address:** As per [our deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead.
-
-| Deprecated Rules                                                             | Replacement                                                                                                                     |
-| :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
-| [callback-return](https://eslint.org/docs/rules/callback-return)             | [node/callback-return](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/callback-return.md)             |
-| [global-require](https://eslint.org/docs/rules/global-require)               | [node/global-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/global-require.md)               |
-| [handle-callback-err](https://eslint.org/docs/rules/handle-callback-err)     | [node/handle-callback-err](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/handle-callback-err.md)     |
-| [no-mixed-requires](https://eslint.org/docs/rules/no-mixed-requires)         | [node/no-mixed-requires](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-mixed-requires.md)         |
-| [no-new-require](https://eslint.org/docs/rules/no-new-require)               | [node/no-new-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-new-require.md)               |
-| [no-path-concat](https://eslint.org/docs/rules/no-path-concat)               | [node/no-path-concat](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md)               |
-| [no-process-env](https://eslint.org/docs/rules/no-process-env)               | [node/no-process-env](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-env.md)               |
-| [no-process-exit](https://eslint.org/docs/rules/no-process-exit)             | [node/no-process-exit](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-process-exit.md)             |
-| [no-restricted-modules](https://eslint.org/docs/rules/no-restricted-modules) | [node/no-restricted-require](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-restricted-require.md) |
-| [no-sync](https://eslint.org/docs/rules/no-sync)                             | [node/no-sync](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-sync.md)                             |
-
-**Related issue(s):** [#12898](https://github.com/eslint/eslint/pull/12898)
-
-## <a name="rules-strict"></a> Several rules have been updated to cover more cases
-
-Several rules have been enhanced and now report additional errors:
-
-- [accessor-pairs](https://eslint.org/docs/rules/accessor-pairs) rule now recognizes class members by default.
-- [array-callback-return](https://eslint.org/docs/rules/array-callback-return) rule now recognizes `flatMap` method.
-- [computed-property-spacing](https://eslint.org/docs/rules/computed-property-spacing) rule now recognizes class members by default.
-- [func-names](https://eslint.org/docs/rules/func-names) rule now recognizes function declarations in default exports.
-- [no-extra-parens](https://eslint.org/docs/rules/no-extra-parens) rule now recognizes parentheses in assignment targets.
-- [no-dupe-class-members](https://eslint.org/docs/rules/no-dupe-class-members) rule now recognizes computed keys for static class members.
-- [no-magic-numbers](https://eslint.org/docs/rules/no-magic-numbers) rule now recognizes bigint literals.
-- [radix](https://eslint.org/docs/rules/radix) rule now recognizes invalid numbers for the second parameter of `parseInt()`.
-- [use-isnan](https://eslint.org/docs/rules/use-isnan) rule now recognizes class members by default.
-- [yoda](https://eslint.org/docs/rules/yoda) rule now recognizes bigint literals.
-
-**To address:** Fix errors or disable these rules.
-
-**Related issue(s):** [#12490](https://github.com/eslint/eslint/pull/12490), [#12608](https://github.com/eslint/eslint/pull/12608), [#12670](https://github.com/eslint/eslint/pull/12670), [#12701](https://github.com/eslint/eslint/pull/12701), [#12765](https://github.com/eslint/eslint/pull/12765), [#12837](https://github.com/eslint/eslint/pull/12837), [#12913](https://github.com/eslint/eslint/pull/12913), [#12915](https://github.com/eslint/eslint/pull/12915), [#12919](https://github.com/eslint/eslint/pull/12919)
-
-## <a name="eslint-recommended"></a> `eslint:recommended` has been updated
-
-Three new rules have been enabled in the `eslint:recommended` preset.
-
-- [no-dupe-else-if](https://eslint.org/docs/rules/no-dupe-else-if)
-- [no-import-assign](https://eslint.org/docs/rules/no-import-assign)
-- [no-setter-return](https://eslint.org/docs/rules/no-setter-return)
-
-**To address:** Fix errors or disable these rules.
-
-**Related issue(s):** [#12920](https://github.com/eslint/eslint/pull/12920)
-
-## <a name="rule-tester-strict"></a> Additional validation added to the `RuleTester` class
-
-The `RuleTester` now validates the following:
-
-- It fails test cases if the rule under test uses the non-standard `node.start` or `node.end` properties. Rules should use `node.range` instead.
-- It fails test cases if the rule under test provides an autofix but a test case doesn't have an `output` property. Add an `output` property to test cases to test the rule's autofix functionality.
-- It fails test cases if any unknown properties are found in the objects in the `errors` property.
-
-**To address:** Modify your rule or test case if existing test cases fail.
-
-**Related issue(s):** [RFC25](https://github.com/eslint/rfcs/blob/master/designs/2019-rule-tester-improvements/README.md), [#12096](https://github.com/eslint/eslint/pull/12096), [#12955](https://github.com/eslint/eslint/pull/12955)
-
-## <a name="deprecate-cliengine"></a> The `CLIEngine` class has been deprecated
-
-The [`CLIEngine` class](https://eslint.org/docs/developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class).
-
-The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shareable configs/parsers/plugins/formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version.
-
-**To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts:
-
-| `CLIEngine`                                  | `ESLint`                           |
-| :------------------------------------------- | :--------------------------------- |
-| `executeOnFiles(patterns)`                   | `lintFiles(patterns)`              |
-| `executeOnText(text, filePath, warnIgnored)` | `lintText(text, options)`          |
-| `getFormatter(name)`                         | `loadFormatter(name)`              |
-| `getConfigForFile(filePath)`                 | `calculateConfigForFile(filePath)` |
-| `isPathIgnored(filePath)`                    | `isPathIgnored(filePath)`          |
-| `static outputFixes(results)`                | `static outputFixes(results)`      |
-| `static getErrorResults(results)`            | `static getErrorResults(results)`  |
-| `static getFormatter(name)`                  | (removed ※1)                       |
-| `addPlugin(pluginId, definition)`            | the `plugins` constructor option   |
-| `getRules()`                                 | (not implemented yet)              |
-| `resolveFileGlobPatterns()`                  | (removed ※2)                       |
-
-- ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method.
-- ※2 Since ESLint 6, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete.
-
-**Related issue(s):** [RFC40](https://github.com/eslint/rfcs/blob/master/designs/2019-move-to-async-api/README.md), [#12939](https://github.com/eslint/eslint/pull/12939)
diff --git a/eslint/docs/user-guide/migrating-to-8.0.0.md b/eslint/docs/user-guide/migrating-to-8.0.0.md
deleted file mode 100644 (file)
index 444ac12..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-# Migrating to v8.0.0
-
-ESLint v8.0.0 is a major release of ESLint. We have made a few breaking changes in this release. This guide is intended to walk you through the breaking changes.
-
-The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
-
-## Table of Contents
-
-### Breaking changes for users
-
-- [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
-- [Removed `codeframe` and `table` formatters](#removed-formatters)
-- [`comma-dangle` rule schema is stricter](#comma-dangle)
-- [Unused disable directives are now fixable](#directives)
-- [`eslint:recommended` has been updated](#eslint-recommended)
-
-### Breaking changes for plugin developers
-
-- [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
-- [Rules require `meta.hasSuggestions` to provide suggestions](#suggestions)
-- [Rules require `meta.fixable` to provide fixes](#fixes)
-- [`SourceCode#getComments()` fails in `RuleTester`](#get-comments)
-- [Changes to shorthand property AST format](#ast-format)
-
-### Breaking changes for integration developers
-
-- [Node.js 10, 13, and 15 are no longer supported](#drop-old-node)
-- [The `CLIEngine` class has been removed](#remove-cliengine)
-- [The `linter` object has been removed](#remove-linter)
-- [The `/lib` entrypoint has been removed](#remove-lib)
-
----
-
-## <a name="drop-old-node"></a> Node.js 10, 13, and 15 are no longer supported
-
-Node.js 10, 13, 15 all reached end of life either in 2020 or early 2021. ESLint is officially dropping support for these versions of Node.js starting with ESLint v8.0.0. ESLint now supports the following versions of Node.js:
-
-- Node.js 12.22 and above
-- Node.js 14 and above
-- Node.js 16 and above
-
-**To address:** Make sure you upgrade to at least Node.js `12.22.0` when using ESLint v8.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint 7 until you are able to upgrade Node.js.
-
-**Related issue(s):** [#14023](https://github.com/eslint/eslint/issues/14023)
-
-## <a name="removed-formatters"></a> Removed `codeframe` and `table` formatters
-
-ESLint v8.0.0 has removed the `codeframe` and `table` formatters from the core. These formatters required dependencies that weren't used anywhere else in ESLint, and removing them allows us to reduce the size of ESLint, allowing for faster installation.
-
-**To address:** If you are using the `codeframe` or `table` formatters, you'll need to install the standalone [`eslint-formatter-codeframe`](https://github.com/fregante/eslint-formatter-codeframe) or [`eslint-formatter-table`](https://github.com/fregante/eslint-formatter-table) packages, respectively, to be able to use them in ESLint v8.0.0.
-
-**Related issue(s):** [#14277](https://github.com/eslint/eslint/issues/14277), [#14316](https://github.com/eslint/eslint/pull/14316)
-
-## <a name="comma-dangle"></a> `comma-dangle` rule schema is stricter
-
-In ESLint v7.0.0, the `comma-dangle` rule could be configured like this without error:
-
-```json
-{
-    "rules": {
-        "comma-dangle": ["error", "never", { "arrays": "always" }]
-    }
-}
-```
-
-With this configuration, the rule would ignore the third element in the array because only the second element is read. In ESLint v8.0.0, this configuration will cause ESLint to throw an error.
-
-**To address:** Change your rule configuration so that there are only two elements in the array, and the second element is either a string or an object, such as:
-
-```jsonc
-{
-    "comma-dangle": ["error", "never"],
-    // or
-    "comma-dangle": ["error", {
-        "arrays": "never",
-        "objects": "never",
-        "imports": "never",
-        "exports": "never",
-        "functions": "never"
-    }]
-}
-```
-
-**Related issue(s):** [#13739](https://github.com/eslint/eslint/issues/13739)
-
-## <a name="directives"></a> Unused disable directives are now fixable
-
-In ESLint v7.0.0, using both `--report-unused-disable-directives` and `--fix` on the command line would fix only rules but leave unused disable directives in place. In ESLint v8.0.0, this combination of command-line options will result in the unused disable directives being removed.
-
-**To address:** If you are using `--report-unused-disable-directives` and `--fix` together on the command line, and you don't want unused disable directives to be removed, add `--fix-type problem,suggestion,layout` as a command line option.
-
-**Related issue(s):** [#11815](https://github.com/eslint/eslint/issues/11815)
-
-## <a name="eslint-recommended"></a> `eslint:recommended` has been updated
-
-Four new rules have been enabled in the `eslint:recommended` preset.
-
-- [`no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision)
-- [`no-nonoctal-decimal-escape`](https://eslint.org/docs/rules/no-nonoctal-decimal-escape)
-- [`no-unsafe-optional-chaining`](https://eslint.org/docs/rules/no-unsafe-optional-chaining)
-- [`no-useless-backreference`](https://eslint.org/docs/rules/no-useless-backreference)
-
-**To address:** Fix errors or disable these rules.
-
-**Related issue(s):** [#14673](https://github.com/eslint/eslint/issues/14673)
-
-## <a name="suggestions"></a> Rules require `meta.hasSuggestions` to provide suggestions
-
-In ESLint v7.0.0, rules that [provided suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) did not need to let ESLint know. In v8.0.0, rules providing suggestions need to set their `meta.hasSuggestions` to `true`. This informs ESLint that the rule intends to provide suggestions. Without this property, any attempt to provide a suggestion will result in an error.
-
-**To address:** If your rule provides suggestions, add `meta.hasSuggestions` to the object, such as:
-
-```js
-module.exports = {
-    meta: {
-        hasSuggestions: true
-    },
-    create(context) {
-        // your rule
-    }
-};
-```
-
-The [eslint-plugin/require-meta-has-suggestions](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-has-suggestions.md) rule can automatically fix and enforce that your rules are properly specifying `meta.hasSuggestions`.
-
-**Related issue(s):** [#14312](https://github.com/eslint/eslint/issues/14312)
-
-## <a name="fixes"></a> Rules require `meta.fixable` to provide fixes
-
-In ESLint v7.0.0, rules that were written as a function (rather than object) were able to provide fixes. In ESLint v8.0.0, only rules written as an object are allowed to provide fixes and must have a `meta.fixable` property set to either `"code"` or `"whitespace"`.
-
-**To address:** If your rule makes fixes and is written as a function, such as:
-
-```js
-module.exports = function(context) {
-    // your rule
-};
-```
-
-Then rewrite your rule in this format:
-
-```js
-module.exports = {
-    meta: {
-        fixable: "code" // or "whitespace"
-    },
-    create(context) {
-        // your rule
-    }
-};
-```
-
-The [eslint-plugin/require-meta-fixable](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-fixable.md) rule can automatically fix and enforce that your rules are properly specifying `meta.fixable`.
-
-The [eslint-plugin/prefer-object-rule](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-object-rule.md) rule can automatically fix and enforce that your rules are written with the object format instead of the deprecated function format.
-
-See the [rule documentation](https://eslint.org/docs/developer-guide/working-with-rules) for more information on writing rules.
-
-**Related issue(s):** [#13349](https://github.com/eslint/eslint/issues/13349)
-
-## <a name="get-comments"></a> `SourceCode#getComments()` fails in `RuleTester`
-
-Back in ESLint v4.0.0, we deprecated `SourceCode#getComments()`, but we neglected to remove it. Rather than removing it completely in v8.0.0, we are taking the intermediate step of updating `RuleTester` to fail when `SourceCode#getComments()` is used inside of a rule. As such, all existing rules will continue to work, but when the developer runs tests for the rule there will be a failure.
-
-The `SourceCode#getComments()` method will be removed in v9.0.0.
-
-**To address:** If your rule uses `SourceCode#getComments()`, please use [`SourceCode#getCommentsBefore()`, `SourceCode#getCommentsAfter()`, or `SourceCode#getCommentsInside()`](https://eslint.org/docs/developer-guide/working-with-rules#sourcecodegetcommentsbefore-sourcecodegetcommentsafter-and-sourcecodegetcommentsinside).
-
-**Related issue(s):** [#14744](https://github.com/eslint/eslint/issues/14744)
-
-## <a name="ast-format"></a> Changes to shorthand property AST format
-
-ESLint v8.0.0 includes an upgrade to Espree v8.0.0 to support new syntax. This Espree upgrade, in turn, contains an upgrade to Acorn v8.0.0, which changed how shorthand properties were represented in the AST. Here's an example:
-
-```js
-const version = 8;
-const x = {
-    version
-};
-```
-
-This code creates a property node that looks like this:
-
-```json
-{
-    "type": "Property",
-    "method": false,
-    "shorthand": true,
-    "computed": false,
-    "key": {
-        "type": "Identifier",
-        "name": "version"
-    },
-    "kind": "init",
-    "value": {
-        "type": "Identifier",
-        "name": "version"
-    }
-}
-```
-
-Note that both the `key` and the `value` properties contain the same information. Prior to Acorn v8.0.0 (and therefore prior to ESLint v8.0.0), these two nodes were represented by the same object, so you could use `===` to determine if they represented the same node, such as:
-
-```js
-// true in ESLint v7.x, false in ESLint v8.0.0
-if (propertyNode.key === propertyNode.value) {
-    // do something
-}
-```
-
-In ESLint v8.0.0 (via Acorn v8.0.0), the key and value are now separate objects and therefore no longer equivalent.
-
-**To address:** If your rule makes a comparison between the key and value of a shorthand object literal property to determine if they are the same node, you'll need to change your code in one of two ways:
-
-1. Use `propertyNode.shorthand` to determine if the property is a shorthand property node.
-1. Use the `range` property of each node to determine if the key and value occupy the same location.
-
-**Related issue(s):** [#14591](https://github.com/eslint/eslint/pull/14591#issuecomment-887733070)
-
-## <a name="remove-cliengine"></a> The `CLIEngine` class has been removed
-
-The `CLIEngine` class has been removed and replaced by the [`ESLint` class](https://eslint.org/docs/developer-guide/nodejs-api#eslint-class).
-
-**To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts:
-
-| `CLIEngine`                                  | `ESLint`                           |
-| :------------------------------------------- | :--------------------------------- |
-| `executeOnFiles(patterns)`                   | `lintFiles(patterns)`              |
-| `executeOnText(text, filePath, warnIgnored)` | `lintText(text, options)`          |
-| `getFormatter(name)`                         | `loadFormatter(name)`              |
-| `getConfigForFile(filePath)`                 | `calculateConfigForFile(filePath)` |
-| `isPathIgnored(filePath)`                    | `isPathIgnored(filePath)`          |
-| `static outputFixes(results)`                | `static outputFixes(results)`      |
-| `static getErrorResults(results)`            | `static getErrorResults(results)`  |
-| `static getFormatter(name)`                  | (removed ※1)                      |
-| `addPlugin(pluginId, definition)`            | the `plugins` constructor option   |
-| `getRules()`                                 | (removed ※2)                      |
-| `resolveFileGlobPatterns()`                  | (removed ※3)                      |
-
-- ※1 The `engine.getFormatter()` method currently returns the object of loaded packages as-is, which made it difficult to add new features to formatters for backward compatibility reasons. The new `eslint.loadFormatter()` method returns an adapter object that wraps the object of loaded packages, to ease the process of adding new features. Additionally, the adapter object has access to the `ESLint` instance to calculate default data (using loaded plugin rules to make `rulesMeta`, for example). As a result, the `ESLint` class only implements an instance version of the `loadFormatter()` method.
-- ※2 The `CLIEngine#getRules()` method had side effects and so was removed. If you were using `CLIEngine#getRules()` to retrieve meta information about rules based on linting results, use `ESLint#getRulesMetaForResults()` instead. If you were using `CLIEngine#getRules()` to retrieve all built-in rules, import `builtinRules` from `eslint/use-at-your-own-risk` for an unsupported API that allows access to internal rules.
-- ※3 Since ESLint v6.0.0, ESLint uses different logic from the `resolveFileGlobPatterns()` method to iterate files, making this method obsolete.
-
-**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
-
-## <a name="remove-linter"></a> The `linter` object has been removed
-
-The deprecated `linter` object has been removed from the ESLint package in v8.0.0.
-
-**To address:** If you are using the `linter` object, such as:
-
-```js
-const { linter } = require("eslint");
-```
-
-Change your code to this:
-
-```js
-const { Linter } = require("eslint");
-const linter = new Linter();
-```
-
-**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
-
-## <a name="remove-lib"></a> The `/lib` entrypoint has been removed
-
-Beginning in v8.0.0, ESLint is strictly defining its public API. Previously, you could reach into individual files such as `require("eslint/lib/rules/semi")` and this is no longer allowed. There are a limited number of existing APIs that are now available through the `/use-at-your-own-risk` entrypoint for backwards compatibility, but these APIs are not formally supported and may break or disappear at any point in time.
-
-**To address:** If you are accessing rules directly through the `/lib` entrypoint, such as:
-
-```js
-const rule = require("eslint/lib/rules/semi");
-```
-
-Change your code to this:
-
-```js
-const { builtinRules } = require("eslint/use-at-your-own-risk");
-const rule = builtinRules.get("semi");
-```
-
-If you are accessing `FileEnumerator` directly through the `/lib` entrypoint, such as:
-
-```js
-const { FileEnumerator } = require("eslint/lib/cli-engine/file-enumerator");
-```
-
-Change your code to this:
-
-```js
-const { FileEnumerator } = require("eslint/use-at-your-own-risk");
-```
-
-**Related issue(s):** [RFC80](https://github.com/eslint/rfcs/tree/main/designs/2021-package-exports), [#14716](https://github.com/eslint/eslint/pull/14716), [#13654](https://github.com/eslint/eslint/issues/13654)
diff --git a/eslint/docs/user-guide/rule-deprecation.md b/eslint/docs/user-guide/rule-deprecation.md
deleted file mode 100644 (file)
index e306916..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Rule Deprecation
-
-Balancing the trade-offs of improving a tool and the frustration these changes can cause is a difficult task. One key area in which this affects our users is in the removal of rules.
-
-The ESLint team is committed to making upgrading as easy and painless as possible. To that end, the team has agreed upon the following set of guidelines for deprecating rules in the future. The goal of these guidelines is to allow for improvements and changes to be made without breaking existing configurations.
-
-* Rules will never be removed from ESLint.
-* Rules will be deprecated as needed, and marked as such in all documentation.
-* After a rule has been deprecated, the team will no longer do any work on it. This includes bug fixes, enhancements, and updates to the rule's documentation. Issues and pull requests related to deprecated rule will not be accepted and will be closed.
-
-Since deprecated rules will never be removed, you can continue to use them indefinitely if they are working for you. However, keep in mind that deprecated rules will effectively be unmaintained.
-
-We hope that by following these guidelines we will be able to continue improving and working to make ESLint the best tool it can be while causing as little disruption to our users as possible during the process.
diff --git a/eslint/eslint.config.js b/eslint/eslint.config.js
new file mode 100644 (file)
index 0000000..2156ebe
--- /dev/null
@@ -0,0 +1,231 @@
+/**
+ * @fileoverview ESLint configuration file
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+/*
+ * IMPORTANT!
+ *
+ * Any changes made to this file must also be made to .eslintrc.js.
+ *
+ * Internally, ESLint is using the eslint.config.js file to lint itself.
+ * The .eslintrc.js file is needed too, because:
+ *
+ * 1. There are tests that expect .eslintrc.js to be present to actually run.
+ * 2. ESLint VS Code extension expects eslintrc config files to be
+ *    present to work correctly.
+ *
+ * Once we no longer need to support both eslintrc and flat config, we will
+ * remove .eslintrc.js.
+ */
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const path = require("path");
+const internalPlugin = require("eslint-plugin-internal-rules");
+const eslintPlugin = require("eslint-plugin-eslint-plugin");
+const { FlatCompat } = require("@eslint/eslintrc");
+const globals = require("globals");
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+const compat = new FlatCompat({
+    baseDirectory: __dirname
+});
+
+const INTERNAL_FILES = {
+    CLI_ENGINE_PATTERN: "lib/cli-engine/**/*",
+    LINTER_PATTERN: "lib/linter/**/*",
+    RULE_TESTER_PATTERN: "lib/rule-tester/**/*",
+    RULES_PATTERN: "lib/rules/**/*",
+    SOURCE_CODE_PATTERN: "lib/source-code/**/*"
+};
+
+/**
+ * Resolve an absolute path or glob pattern.
+ * @param {string} pathOrPattern the path or glob pattern.
+ * @returns {string} The resolved path or glob pattern.
+ */
+function resolveAbsolutePath(pathOrPattern) {
+    return path.resolve(__dirname, pathOrPattern);
+}
+
+/**
+ * Create an array of `no-restricted-require` entries for ESLint's core files.
+ * @param {string} [pattern] The glob pattern to create the entries for.
+ * @returns {Object[]} The array of `no-restricted-require` entries.
+ */
+function createInternalFilesPatterns(pattern = null) {
+    return Object.values(INTERNAL_FILES)
+        .filter(p => p !== pattern)
+        .map(p => ({
+            name: [
+
+                // Disallow all children modules.
+                resolveAbsolutePath(p),
+
+                // Allow the main `index.js` module.
+                `!${resolveAbsolutePath(p.replace(/\*\*\/\*$/u, "index.js"))}`
+            ]
+        }));
+}
+
+module.exports = [
+    ...compat.extends("eslint"),
+    {
+        plugins: {
+            "internal-rules": internalPlugin,
+            "eslint-plugin": eslintPlugin
+        },
+        languageOptions: {
+            ecmaVersion: "latest"
+        },
+
+        /*
+         * it fixes eslint-plugin-jsdoc's reports: "Invalid JSDoc tag name "template" jsdoc/check-tag-names"
+         * refs: https://github.com/gajus/eslint-plugin-jsdoc#check-tag-names
+         */
+        settings: {
+            jsdoc: {
+                mode: "typescript"
+            }
+        },
+        rules: {
+            "internal-rules/multiline-comment-style": "error"
+        }
+    },
+    {
+        files: ["tools/*.js"],
+        rules: {
+            "no-console": "off"
+        }
+    },
+    {
+        files: ["lib/rules/*", "tools/internal-rules/*"],
+        ignores: ["**/index.js"],
+        rules: {
+            ...eslintPlugin.configs["rules-recommended"].rules,
+            "eslint-plugin/no-missing-message-ids": "error",
+            "eslint-plugin/no-unused-message-ids": "error",
+            "eslint-plugin/prefer-message-ids": "error",
+            "eslint-plugin/prefer-placeholders": "error",
+            "eslint-plugin/prefer-replace-text": "error",
+            "eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
+            "eslint-plugin/require-meta-docs-description": ["error", { pattern: "^(Enforce|Require|Disallow)" }],
+            "internal-rules/no-invalid-meta": "error"
+        }
+    },
+    {
+        files: ["lib/rules/*"],
+        ignores: ["index.js"],
+        rules: {
+            "eslint-plugin/require-meta-docs-url": ["error", { pattern: "https://eslint.org/docs/rules/{{name}}" }]
+        }
+    },
+    {
+        files: ["tests/lib/rules/*", "tests/tools/internal-rules/*"],
+        rules: {
+            ...eslintPlugin.configs["tests-recommended"].rules,
+            "eslint-plugin/prefer-output-null": "error",
+            "eslint-plugin/test-case-property-ordering": "error",
+            "eslint-plugin/test-case-shorthand-strings": "error"
+        }
+    },
+    {
+        files: ["tests/**/*.js"],
+        languageOptions: {
+            globals: {
+                ...globals.mocha
+            }
+        },
+        rules: {
+            "no-restricted-syntax": ["error", {
+                selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
+                message: "`assert.doesNotThrow()` should be replaced with a comment next to the code."
+            }]
+        }
+    },
+
+    // Restrict relative path imports
+    {
+        files: ["lib/*"],
+        ignores: ["lib/unsupported-api.js"],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns()
+            ]]
+        }
+    },
+    {
+        files: [INTERNAL_FILES.CLI_ENGINE_PATTERN],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(INTERNAL_FILES.CLI_ENGINE_PATTERN)
+            ]]
+        }
+    },
+    {
+        files: [INTERNAL_FILES.LINTER_PATTERN],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(INTERNAL_FILES.LINTER_PATTERN),
+                "fs",
+                resolveAbsolutePath("lib/cli-engine/index.js"),
+                resolveAbsolutePath("lib/rule-tester/index.js")
+            ]]
+        }
+    },
+    {
+        files: [INTERNAL_FILES.RULES_PATTERN],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(INTERNAL_FILES.RULES_PATTERN),
+                "fs",
+                resolveAbsolutePath("lib/cli-engine/index.js"),
+                resolveAbsolutePath("lib/linter/index.js"),
+                resolveAbsolutePath("lib/rule-tester/index.js"),
+                resolveAbsolutePath("lib/source-code/index.js")
+            ]]
+        }
+    },
+    {
+        files: ["lib/shared/**/*"],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(),
+                resolveAbsolutePath("lib/cli-engine/index.js"),
+                resolveAbsolutePath("lib/linter/index.js"),
+                resolveAbsolutePath("lib/rule-tester/index.js"),
+                resolveAbsolutePath("lib/source-code/index.js")
+            ]]
+        }
+    },
+    {
+        files: [INTERNAL_FILES.SOURCE_CODE_PATTERN],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(INTERNAL_FILES.SOURCE_CODE_PATTERN),
+                "fs",
+                resolveAbsolutePath("lib/cli-engine/index.js"),
+                resolveAbsolutePath("lib/linter/index.js"),
+                resolveAbsolutePath("lib/rule-tester/index.js"),
+                resolveAbsolutePath("lib/rules/index.js")
+            ]]
+        }
+    },
+    {
+        files: [INTERNAL_FILES.RULE_TESTER_PATTERN],
+        rules: {
+            "n/no-restricted-require": ["error", [
+                ...createInternalFilesPatterns(INTERNAL_FILES.RULE_TESTER_PATTERN),
+                resolveAbsolutePath("lib/cli-engine/index.js")
+            ]]
+        }
+    }
+];
index e3647018d26fa3f829022515cf17ade3465d4ece..fdc66198809c9162b4fb735e007994e4f60b5f6a 100644 (file)
@@ -51,10 +51,12 @@ const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]);
 /** @typedef {import("../shared/types").ConfigData} ConfigData */
 /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
 /** @typedef {import("../shared/types").LintMessage} LintMessage */
+/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
 /** @typedef {import("../shared/types").ParserOptions} ParserOptions */
 /** @typedef {import("../shared/types").Plugin} Plugin */
 /** @typedef {import("../shared/types").RuleConf} RuleConf */
 /** @typedef {import("../shared/types").Rule} Rule */
+/** @typedef {import("../shared/types").FormatterFunction} FormatterFunction */
 /** @typedef {ReturnType<CascadingConfigArrayFactory.getConfigArrayForFile>} ConfigArray */
 /** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
 
@@ -91,7 +93,9 @@ const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]);
  * @typedef {Object} LintResult
  * @property {string} filePath The path to the file that was linted.
  * @property {LintMessage[]} messages All of the messages for the result.
+ * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result.
  * @property {number} errorCount Number of errors for the result.
+ * @property {number} fatalErrorCount Number of fatal errors for the result.
  * @property {number} warningCount Number of warnings for the result.
  * @property {number} fixableErrorCount Number of fixable errors for the result.
  * @property {number} fixableWarningCount Number of fixable warnings for the result.
@@ -104,6 +108,7 @@ const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]);
  * @typedef {Object} LintReport
  * @property {LintResult[]} results All of the result.
  * @property {number} errorCount Number of errors for the result.
+ * @property {number} fatalErrorCount Number of fatal errors for the result.
  * @property {number} warningCount Number of warnings for the result.
  * @property {number} fixableErrorCount Number of fixable errors for the result.
  * @property {number} fixableWarningCount Number of fixable warnings for the result.
@@ -261,6 +266,7 @@ function verifyText({
     const result = {
         filePath,
         messages,
+        suppressedMessages: linter.getSuppressedMessages(),
         ...calculateStatsPerFile(messages)
     };
 
@@ -307,7 +313,9 @@ function createIgnoreResult(filePath, baseDir) {
                 message
             }
         ],
+        suppressedMessages: [],
         errorCount: 0,
+        fatalErrorCount: 0,
         warningCount: 1,
         fixableErrorCount: 0,
         fixableWarningCount: 0
@@ -358,9 +366,7 @@ function *iterateRuleDeprecationWarnings(usedConfigArrays) {
 
     // Flatten used configs.
     /** @type {ExtractedConfig[]} */
-    const configs = [].concat(
-        ...usedConfigArrays.map(getUsedExtractedConfigs)
-    );
+    const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs);
 
     // Traverse rule configs.
     for (const config of configs) {
@@ -408,7 +414,7 @@ function isErrorMessage(message) {
  * a directory or looks like a directory (ends in `path.sep`), in which case the file
  * name will be the `cacheFile/.cache_hashOfCWD`
  *
- * if cacheFile points to a file or looks like a file then in will just use that file
+ * if cacheFile points to a file or looks like a file then it will just use that file
  * @param {string} cacheFile The name of file to be used to store the cache
  * @param {string} cwd Current working directory
  * @returns {string} the resolved path to the cache file
@@ -609,8 +615,8 @@ class CLIEngine {
             useEslintrc: options.useEslintrc,
             builtInRules,
             loadRules,
-            eslintRecommendedPath: path.resolve(__dirname, "../../conf/eslint-recommended.js"),
-            eslintAllPath: path.resolve(__dirname, "../../conf/eslint-all.js")
+            getEslintRecommendedConfig: () => require("../../conf/eslint-recommended.js"),
+            getEslintAllConfig: () => require("../../conf/eslint-all.js")
         });
         const fileEnumerator = new FileEnumerator({
             configArrayFactory,
@@ -680,11 +686,13 @@ class CLIEngine {
 
         results.forEach(result => {
             const filteredMessages = result.messages.filter(isErrorMessage);
+            const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage);
 
             if (filteredMessages.length > 0) {
                 filtered.push({
                     ...result,
                     messages: filteredMessages,
+                    suppressedMessages: filteredSuppressedMessages,
                     errorCount: filteredMessages.length,
                     warningCount: 0,
                     fixableErrorCount: result.fixableErrorCount,
@@ -993,7 +1001,7 @@ class CLIEngine {
      * @param {string} [format] The name of the format to load or the path to a
      *      custom formatter.
      * @throws {any} As may be thrown by requiring of formatter
-     * @returns {(Function|null)} The formatter function or null if the `format` is not a string.
+     * @returns {(FormatterFunction|null)} The formatter function or null if the `format` is not a string.
      */
     getFormatter(format) {
 
@@ -1013,7 +1021,7 @@ class CLIEngine {
             let formatterPath;
 
             // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
-            if (!namespace && normalizedFormatName.indexOf("/") > -1) {
+            if (!namespace && normalizedFormatName.includes("/")) {
                 formatterPath = path.resolve(cwd, normalizedFormatName);
             } else {
                 try {
index f1442d150b844dda52a56a12ed390ee60e280dd7..b65d0a206926190aee79ea4fbc4c5a75940d8bd8 100644 (file)
@@ -122,7 +122,8 @@ function statSafeSync(filePath) {
     try {
         return fs.statSync(filePath);
     } catch (error) {
-        /* istanbul ignore next */
+
+        /* c8 ignore next */
         if (error.code !== "ENOENT") {
             throw error;
         }
@@ -141,7 +142,8 @@ function readdirSafeSync(directoryPath) {
     try {
         return fs.readdirSync(directoryPath, { withFileTypes: true });
     } catch (error) {
-        /* istanbul ignore next */
+
+        /* c8 ignore next */
         if (error.code !== "ENOENT") {
             throw error;
         }
@@ -215,8 +217,8 @@ class FileEnumerator {
         cwd = process.cwd(),
         configArrayFactory = new CascadingConfigArrayFactory({
             cwd,
-            eslintRecommendedPath: path.resolve(__dirname, "../../conf/eslint-recommended.js"),
-            eslintAllPath: path.resolve(__dirname, "../../conf/eslint-all.js")
+            getEslintRecommendedConfig: () => require("../../conf/eslint-recommended.js"),
+            getEslintAllConfig: () => require("../../conf/eslint-all.js")
         }),
         extensions = null,
         globInputPaths = true,
index e28996f6cd2f427658509661c4391b465f9aa761..6e40bbe16b7f03f42842ef9d77078d4b0bb6e32a 100644 (file)
@@ -39,6 +39,8 @@ function pageTemplate(it) {
     <head>
         <meta charset="UTF-8">
         <title>ESLint Report</title>
+        <link rel="icon" type="image/png" sizes="any" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAHaAAAB2gGFomX7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABD1JREFUWMPFl11sk2UUx3/nbYtjxS1MF7MLMTECMgSTtSSyrQkLhAj7UBPnDSEGoxegGzMwojhXVpmTAA5iYpSoMQa8GBhFOrMFk03buei6yRAlcmOM0SEmU9d90b19jxcM1o5+sGnsc/e+z/l6ztf/HFFVMnns6QieeOCHBePGsHM+wrOtvLG2C4WRVDSSygNV7sCjlspxwDnPB44aols/DXk+mbMBmx/6OseITF1CuOtfevkPh2Uu+/jbdX8lujSScRlT5r7/QDlAfsRmfzmpnkQ/H3H13gf6bBrBn1uqK8WylgEnU8eZmk1repbfchJG1TyKyIKEwuBHFd3lD3naY3O1siiwXsVoBV2VgM1ht/QQUJk2ByqKghsQziYQ8ifKgexIXmuyzC4r67Y7R+xPAfuB/Nn3Cpva+0s7khpQVtZtd4bt51BWxtBYAiciprG7c7D4SixzU9PYalDL6110Ifb/w8W9eY7JqFeFHbO8fPGyLHwwFHJNJTSgwtVTB9oaw9BlQ+tO93vOxypoaQnfEYlI43SeCHDC4TDq9+51/h5fxr33q0ZfV9g04wat9Q943rjJgCp3952W2i8Bi6eDvdsfKj0cK/DYMRyXL4/sUJUmIHd2zYMezsvLaamp4WpcWN3BXSiHpuMwbGbZlnZ8tXY4rgosy+G7oRwQ0cAsd28YGgqfU5UjCZQDLALxDg+Hv/P5Rqvj4hwrS8izXzWb4spwc1GgENFnkpWRzxeuB+ssUHgLdb9UVdt8vpGdKQpze7n7y1U3DBChNRUuqOo9c+0+qpKKxyZqtAIYla7gY4JszAAQri93BSsMRZoyBcUC+w3Q3AyOA4sNhAOZ0q7Iq0b2vUNvK5zPgP+/H8+Zetdoa6uOikhdGurxebwvJY8Iz3V1rTMNAH+opEuQj5KTT/qA1yC+wyUjBm12OidaUtCcPNNX2h0Hx2JG69VulANZAJZJwfU7rzd/FHixuXniTdM0m4GtSQT7bTartqEh9yfImUEzkwKZmTwmo5a5JwkYBfcDL01/RkR5y8iWhtPBknB8ZxwtU9UjwOrrKCeizzc25nTGg1F/turEHoU9wMLpDvWKf8DTmNCAKnd/tqUTF4ElMXJ+A5rWDJS+41WsGWzALhJ+ErBWrLj9g+pqojHxlXJX8HGUg0BsR/x1yhxf3jm4cSzpQFLp6tmi6PEE7g1ZhtZ91ufpSZUAFa6gC+UoQslNaSmypT1U8mHKiUgEKS8KfgF4EpYunFI16tsHin+OG0LcgQK7yj7g6cSzpva2D3hKVNG0Y3mVO1BkqfSlmJrHBQ4uvM12gJHc6ETW8HZVfMRmXvyxxNC1Z/o839zyXlDuCr4nsC11J+MXueaVJWn6yPv+/pJtc9oLTNN4AeTvNGByd3rlhE2x9s5pLwDoHCy+grDzWmOZ95lUtLYj5Bma126Y8eX0/zj/ADxGyViSg4BXAAAAAElFTkSuQmCC">
+        <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMjk0LjgyNSAyNTguOTgyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPg0KPHBhdGggZmlsbD0nIzgwODBGMicgZD0nTTk3LjAyMSw5OS4wMTZsNDguNDMyLTI3Ljk2MmMxLjIxMi0wLjcsMi43MDYtMC43LDMuOTE4LDBsNDguNDMzLDI3Ljk2MiBjMS4yMTEsMC43LDEuOTU5LDEuOTkzLDEuOTU5LDMuMzkzdjU1LjkyNGMwLDEuMzk5LTAuNzQ4LDIuNjkzLTEuOTU5LDMuMzk0bC00OC40MzMsMjcuOTYyYy0xLjIxMiwwLjctMi43MDYsMC43LTMuOTE4LDAgbC00OC40MzItMjcuOTYyYy0xLjIxMi0wLjctMS45NTktMS45OTQtMS45NTktMy4zOTR2LTU1LjkyNEM5NS4wNjMsMTAxLjAwOSw5NS44MSw5OS43MTYsOTcuMDIxLDk5LjAxNicvPg0KPHBhdGggZmlsbD0nIzRCMzJDMycgZD0nTTI3My4zMzYsMTI0LjQ4OEwyMTUuNDY5LDIzLjgxNmMtMi4xMDItMy42NC01Ljk4NS02LjMyNS0xMC4xODgtNi4zMjVIODkuNTQ1IGMtNC4yMDQsMC04LjA4OCwyLjY4NS0xMC4xOSw2LjMyNWwtNTcuODY3LDEwMC40NWMtMi4xMDIsMy42NDEtMi4xMDIsOC4yMzYsMCwxMS44NzdsNTcuODY3LDk5Ljg0NyBjMi4xMDIsMy42NCw1Ljk4Niw1LjUwMSwxMC4xOSw1LjUwMWgxMTUuNzM1YzQuMjAzLDAsOC4wODctMS44MDUsMTAuMTg4LTUuNDQ2bDU3Ljg2Ny0xMDAuMDEgQzI3NS40MzksMTMyLjM5NiwyNzUuNDM5LDEyOC4xMjgsMjczLjMzNiwxMjQuNDg4IE0yMjUuNDE5LDE3Mi44OThjMCwxLjQ4LTAuODkxLDIuODQ5LTIuMTc0LDMuNTlsLTczLjcxLDQyLjUyNyBjLTEuMjgyLDAuNzQtMi44ODgsMC43NC00LjE3LDBsLTczLjc2Ny00Mi41MjdjLTEuMjgyLTAuNzQxLTIuMTc5LTIuMTA5LTIuMTc5LTMuNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
         <style>
             body {
                 font-family:Arial, "Helvetica Neue", Helvetica, sans-serif;
@@ -149,7 +151,7 @@ function pageTemplate(it) {
         </script>
     </body>
 </html>
-`.trimLeft();
+`.trimStart();
 }
 
 /**
@@ -220,7 +222,7 @@ function messageTemplate(it) {
         <a href="${ruleUrl ? ruleUrl : ""}" target="_blank" rel="noopener noreferrer">${ruleId ? ruleId : ""}</a>
     </td>
 </tr>
-`.trimLeft();
+`.trimStart();
 }
 
 /**
@@ -278,7 +280,7 @@ function resultTemplate(it) {
         <span>${encodeHTML(summary)}</span>
     </th>
 </tr>
-`.trimLeft();
+`.trimStart();
 }
 
 /**
index 3304d429debe85e07621eb96da2e80a96c309f69..e36eb74badaad7166f0b3c6880b7d9b02ad6f803 100644 (file)
@@ -36,7 +36,7 @@ const invalidCacheStrategyErrorMessage = `Cache strategy must be one of: ${valid
  */
 function isValidCacheStrategy(cacheStrategy) {
     return (
-        validCacheStrategies.indexOf(cacheStrategy) !== -1
+        validCacheStrategies.includes(cacheStrategy)
     );
 }
 
index f09d143d2557851d307047875fe9862616f2a12b..2fca65c1908b04820ac9d43e877a1bb0d146a55c 100644 (file)
@@ -6,7 +6,7 @@
 "use strict";
 
 /*
- * The CLI object should *not* call process.exit() directly. It should only return
+ * NOTE: The CLI object should *not* call process.exit() directly. It should only return
  * exit codes. This allows other programs to use the CLI object and still control
  * when the program exits.
  */
@@ -19,9 +19,14 @@ const fs = require("fs"),
     path = require("path"),
     { promisify } = require("util"),
     { ESLint } = require("./eslint"),
-    CLIOptions = require("./options"),
+    { FlatESLint } = require("./eslint/flat-eslint"),
+    createCLIOptions = require("./options"),
     log = require("./shared/logging"),
     RuntimeInfo = require("./shared/runtime-info");
+const { Legacy: { naming } } = require("@eslint/eslintrc");
+const { findFlatConfigFile } = require("./eslint/flat-eslint");
+const { gitignoreToMinimatch } = require("@humanwhocodes/gitignore-to-minimatch");
+const { ModuleImporter } = require("@humanwhocodes/module-importer");
 
 const debug = require("debug")("eslint:cli");
 
@@ -54,17 +59,20 @@ function quietFixPredicate(message) {
 }
 
 /**
- * Translates the CLI options into the options expected by the CLIEngine.
+ * Translates the CLI options into the options expected by the ESLint constructor.
  * @param {ParsedCLIOptions} cliOptions The CLI options to translate.
- * @returns {ESLintOptions} The options object for the CLIEngine.
+ * @param {"flat"|"eslintrc"} [configType="eslintrc"] The format of the
+ *      config to generate.
+ * @returns {Promise<ESLintOptions>} The options object for the ESLint constructor.
  * @private
  */
-function translateOptions({
+async function translateOptions({
     cache,
     cacheFile,
     cacheLocation,
     cacheStrategy,
     config,
+    configLookup,
     env,
     errorOnUnmatchedPattern,
     eslintrc,
@@ -85,19 +93,66 @@ function translateOptions({
     resolvePluginsRelativeTo,
     rule,
     rulesdir
-}) {
-    return {
-        allowInlineConfig: inlineConfig,
-        cache,
-        cacheLocation: cacheLocation || cacheFile,
-        cacheStrategy,
-        errorOnUnmatchedPattern,
-        extensions: ext,
-        fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true),
-        fixTypes: fixType,
-        ignore,
-        ignorePath,
-        overrideConfig: {
+}, configType) {
+
+    let overrideConfig, overrideConfigFile;
+    const importer = new ModuleImporter();
+
+    if (configType === "flat") {
+        overrideConfigFile = (typeof config === "string") ? config : !configLookup;
+        if (overrideConfigFile === false) {
+            overrideConfigFile = void 0;
+        }
+
+        let globals = {};
+
+        if (global) {
+            globals = global.reduce((obj, name) => {
+                if (name.endsWith(":true")) {
+                    obj[name.slice(0, -5)] = "writable";
+                } else {
+                    obj[name] = "readonly";
+                }
+                return obj;
+            }, globals);
+        }
+
+        overrideConfig = [{
+            languageOptions: {
+                globals,
+                parserOptions: parserOptions || {}
+            },
+            rules: rule ? rule : {}
+        }];
+
+        if (parser) {
+            overrideConfig[0].languageOptions.parser = await importer.import(parser);
+        }
+
+        if (plugin) {
+            const plugins = {};
+
+            for (const pluginName of plugin) {
+
+                const shortName = naming.getShorthandName(pluginName, "eslint-plugin");
+                const longName = naming.normalizePackageName(pluginName, "eslint-plugin");
+
+                plugins[shortName] = await importer.import(longName);
+            }
+
+            overrideConfig[0].plugins = plugins;
+        }
+
+        if (ignorePattern) {
+            overrideConfig.push({
+                ignores: ignorePattern.map(gitignoreToMinimatch)
+            });
+        }
+
+    } else {
+        overrideConfigFile = config;
+
+        overrideConfig = {
             env: env && env.reduce((obj, name) => {
                 obj[name] = true;
                 return obj;
@@ -115,13 +170,32 @@ function translateOptions({
             parserOptions,
             plugins: plugin,
             rules: rule
-        },
-        overrideConfigFile: config,
-        reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0,
-        resolvePluginsRelativeTo,
-        rulePaths: rulesdir,
-        useEslintrc: eslintrc
+        };
+    }
+
+    const options = {
+        allowInlineConfig: inlineConfig,
+        cache,
+        cacheLocation: cacheLocation || cacheFile,
+        cacheStrategy,
+        errorOnUnmatchedPattern,
+        fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true),
+        fixTypes: fixType,
+        ignore,
+        ignorePath,
+        overrideConfig,
+        overrideConfigFile,
+        reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0
     };
+
+    if (configType !== "flat") {
+        options.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
+        options.rulePaths = rulesdir;
+        options.useEslintrc = eslintrc;
+        options.extensions = ext;
+    }
+
+    return options;
 }
 
 /**
@@ -218,19 +292,34 @@ const cli = {
      * Executes the CLI based on an array of arguments that is passed in.
      * @param {string|Array|Object} args The arguments to process.
      * @param {string} [text] The text to lint (used for TTY).
+     * @param {boolean} [allowFlatConfig] Whether or not to allow flat config.
      * @returns {Promise<number>} The exit code for the operation.
      */
-    async execute(args, text) {
+    async execute(args, text, allowFlatConfig) {
         if (Array.isArray(args)) {
             debug("CLI args: %o", args.slice(2));
         }
 
+        /*
+         * Before doing anything, we need to see if we are using a
+         * flat config file. If so, then we need to change the way command
+         * line args are parsed. This is temporary, and when we fully
+         * switch to flat config we can remove this logic.
+         */
+
+        const usingFlatConfig = allowFlatConfig && !!(await findFlatConfigFile(process.cwd()));
+
+        debug("Using flat config?", usingFlatConfig);
+
+        const CLIOptions = createCLIOptions(usingFlatConfig);
+
         /** @type {ParsedCLIOptions} */
         let options;
 
         try {
             options = CLIOptions.parse(args);
         } catch (error) {
+            debug("Error parsing CLI options:", error.message);
             log.error(error.message);
             return 2;
         }
@@ -251,6 +340,7 @@ const cli = {
                 log.info(RuntimeInfo.environment());
                 return 0;
             } catch (err) {
+                debug("Error retrieving environment info");
                 log.error(err.message);
                 return 2;
             }
@@ -266,7 +356,9 @@ const cli = {
                 return 2;
             }
 
-            const engine = new ESLint(translateOptions(options));
+            const engine = usingFlatConfig
+                ? new FlatESLint(await translateOptions(options, "flat"))
+                : new ESLint(await translateOptions(options));
             const fileConfig =
                 await engine.calculateConfigForFile(options.printConfig);
 
@@ -289,7 +381,9 @@ const cli = {
             return 2;
         }
 
-        const engine = new ESLint(translateOptions(options));
+        const ActiveESLint = usingFlatConfig ? FlatESLint : ESLint;
+
+        const engine = new ActiveESLint(await translateOptions(options, usingFlatConfig ? "flat" : "eslintrc"));
         let results;
 
         if (useStdin) {
@@ -303,14 +397,14 @@ const cli = {
 
         if (options.fix) {
             debug("Fix mode enabled - applying fixes");
-            await ESLint.outputFixes(results);
+            await ActiveESLint.outputFixes(results);
         }
 
         let resultsToPrint = results;
 
         if (options.quiet) {
             debug("Quiet mode enabled - filtering out warnings");
-            resultsToPrint = ESLint.getErrorResults(resultsToPrint);
+            resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint);
         }
 
         if (await printResults(engine, resultsToPrint, options.format, options.outputFile)) {
index a655a6d83ca08ba019091279bc1b61e634725569..c48551a4f2a07b6d2416ecb5287a97de5cbd473e 100644 (file)
@@ -15,7 +15,6 @@ const Rules = require("../rules");
 // Helpers
 //-----------------------------------------------------------------------------
 
-
 exports.defaultConfig = [
     {
         plugins: {
@@ -41,21 +40,31 @@ exports.defaultConfig = [
                 })
             }
         },
-        ignores: [
-            "**/node_modules/**",
-            ".git/**"
-        ],
         languageOptions: {
-            ecmaVersion: "latest",
             sourceType: "module",
+            ecmaVersion: "latest",
             parser: "@/espree",
             parserOptions: {}
         }
     },
+
+    // default ignores are listed here
+    {
+        ignores: [
+            "**/node_modules/**",
+            ".git/**"
+        ]
+    },
+
+    // intentionally empty config to ensure these files are globbed by default
+    {
+        files: ["**/*.js", "**/*.mjs"]
+    },
     {
         files: ["**/*.cjs"],
         languageOptions: {
-            sourceType: "commonjs"
+            sourceType: "commonjs",
+            ecmaVersion: "latest"
         }
     }
 ];
index c06fd92a383809cf8faacd980c83f1c63b639796..ad8986f516ef9c936fc3d006c55f4a5b247df98d 100644 (file)
@@ -14,7 +14,6 @@ const { flatConfigSchema } = require("./flat-config-schema");
 const { RuleValidator } = require("./rule-validator");
 const { defaultConfig } = require("./default-config");
 const recommendedConfig = require("../../conf/eslint-recommended");
-const allConfig = require("../../conf/eslint-all");
 
 //-----------------------------------------------------------------------------
 // Helpers
@@ -37,6 +36,8 @@ function splitPluginIdentifier(identifier) {
     };
 }
 
+const originalBaseConfig = Symbol("originalBaseConfig");
+
 //-----------------------------------------------------------------------------
 // Exports
 //-----------------------------------------------------------------------------
@@ -49,16 +50,40 @@ class FlatConfigArray extends ConfigArray {
     /**
      * Creates a new instance.
      * @param {*[]} configs An array of configuration information.
-     * @param {{basePath: string, baseConfig: FlatConfig}} options The options
+     * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options
      *      to use for the config array instance.
      */
-    constructor(configs, { basePath, baseConfig = defaultConfig } = {}) {
+    constructor(configs, {
+        basePath,
+        shouldIgnore = true,
+        baseConfig = defaultConfig
+    } = {}) {
         super(configs, {
             basePath,
             schema: flatConfigSchema
         });
 
-        this.unshift(...baseConfig);
+        if (baseConfig[Symbol.iterator]) {
+            this.unshift(...baseConfig);
+        } else {
+            this.unshift(baseConfig);
+        }
+
+        /**
+         * The baes config used to build the config array.
+         * @type {Array<FlatConfig>}
+         */
+        this[originalBaseConfig] = baseConfig;
+        Object.defineProperty(this, originalBaseConfig, { writable: false });
+
+        /**
+         * Determines if `ignores` fields should be honored.
+         * If true, then all `ignores` fields are honored.
+         * if false, then only `ignores` fields in the baseConfig are honored.
+         * @type {boolean}
+         */
+        this.shouldIgnore = shouldIgnore;
+        Object.defineProperty(this, "shouldIgnore", { writable: false });
     }
 
     /* eslint-disable class-methods-use-this -- Desired as instance method */
@@ -75,7 +100,30 @@ class FlatConfigArray extends ConfigArray {
         }
 
         if (config === "eslint:all") {
-            return allConfig;
+
+            /*
+             * Load `eslint-all.js` here instead of at the top level to avoid loading all rule modules
+             * when it isn't necessary. `eslint-all.js` reads `meta` of rule objects to filter out deprecated ones,
+             * so requiring `eslint-all.js` module loads all rule modules as a consequence.
+             */
+            return require("../../conf/eslint-all");
+        }
+
+        /*
+         * If `shouldIgnore` is false, we remove any ignore patterns specified
+         * in the config so long as it's not a default config and it doesn't
+         * have a `files` entry.
+         */
+        if (
+            !this.shouldIgnore &&
+            !this[originalBaseConfig].includes(config) &&
+            config.ignores &&
+            !config.files
+        ) {
+            /* eslint-disable-next-line no-unused-vars -- need to strip off other keys */
+            const { ignores, ...otherKeys } = config;
+
+            return otherKeys;
         }
 
         return config;
@@ -91,31 +139,72 @@ class FlatConfigArray extends ConfigArray {
     [ConfigArraySymbol.finalizeConfig](config) {
 
         const { plugins, languageOptions, processor } = config;
+        let parserName, processorName;
+        let invalidParser = false,
+            invalidProcessor = false;
 
         // Check parser value
-        if (languageOptions && languageOptions.parser && typeof languageOptions.parser === "string") {
-            const { pluginName, objectName: parserName } = splitPluginIdentifier(languageOptions.parser);
+        if (languageOptions && languageOptions.parser) {
+            if (typeof languageOptions.parser === "string") {
+                const { pluginName, objectName: localParserName } = splitPluginIdentifier(languageOptions.parser);
 
-            if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[parserName]) {
-                throw new TypeError(`Key "parser": Could not find "${parserName}" in plugin "${pluginName}".`);
-            }
+                parserName = languageOptions.parser;
+
+                if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[localParserName]) {
+                    throw new TypeError(`Key "parser": Could not find "${localParserName}" in plugin "${pluginName}".`);
+                }
 
-            languageOptions.parser = plugins[pluginName].parsers[parserName];
+                languageOptions.parser = plugins[pluginName].parsers[localParserName];
+            } else {
+                invalidParser = true;
+            }
         }
 
         // Check processor value
-        if (processor && typeof processor === "string") {
-            const { pluginName, objectName: processorName } = splitPluginIdentifier(processor);
+        if (processor) {
+            if (typeof processor === "string") {
+                const { pluginName, objectName: localProcessorName } = splitPluginIdentifier(processor);
 
-            if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[processorName]) {
-                throw new TypeError(`Key "processor": Could not find "${processorName}" in plugin "${pluginName}".`);
-            }
+                processorName = processor;
 
-            config.processor = plugins[pluginName].processors[processorName];
+                if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[localProcessorName]) {
+                    throw new TypeError(`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`);
+                }
+
+                config.processor = plugins[pluginName].processors[localProcessorName];
+            } else {
+                invalidProcessor = true;
+            }
         }
 
         ruleValidator.validate(config);
 
+        // apply special logic for serialization into JSON
+        /* eslint-disable object-shorthand -- shorthand would change "this" value */
+        Object.defineProperty(config, "toJSON", {
+            value: function() {
+
+                if (invalidParser) {
+                    throw new Error("Caching is not supported when parser is an object.");
+                }
+
+                if (invalidProcessor) {
+                    throw new Error("Caching is not supported when processor is an object.");
+                }
+
+                return {
+                    ...this,
+                    plugins: Object.keys(plugins),
+                    languageOptions: {
+                        ...languageOptions,
+                        parser: parserName
+                    },
+                    processor: processorName
+                };
+            }
+        });
+        /* eslint-enable object-shorthand -- ok to enable now */
+
         return config;
     }
     /* eslint-enable class-methods-use-this -- Desired as instance method */
index 778f12925e1b64f1f4c91284ae20775c61dcb486..e00c56434cd5b4a0d51df120ee075028a4bfb3fa 100644 (file)
@@ -20,7 +20,14 @@ function parseRuleId(ruleId) {
 
     // distinguish between core rules and plugin rules
     if (ruleId.includes("/")) {
-        pluginName = ruleId.slice(0, ruleId.lastIndexOf("/"));
+
+        // mimic scoped npm packages
+        if (ruleId.startsWith("@")) {
+            pluginName = ruleId.slice(0, ruleId.lastIndexOf("/"));
+        } else {
+            pluginName = ruleId.slice(0, ruleId.indexOf("/"));
+        }
+
         ruleName = ruleId.slice(pluginName.length + 1);
     } else {
         pluginName = "@";
@@ -47,6 +54,7 @@ function getRuleFromConfig(ruleId, config) {
     const plugin = config.plugins && config.plugins[pluginName];
     let rule = plugin && plugin.rules && plugin.rules[ruleName];
 
+
     // normalize function rules into objects
     if (rule && typeof rule === "function") {
         rule = {
@@ -57,11 +65,47 @@ function getRuleFromConfig(ruleId, config) {
     return rule;
 }
 
+/**
+ * Gets a complete options schema for a rule.
+ * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object
+ * @returns {Object} JSON Schema for the rule's options.
+ */
+function getRuleOptionsSchema(rule) {
+
+    if (!rule) {
+        return null;
+    }
+
+    const schema = rule.schema || rule.meta && rule.meta.schema;
+
+    if (Array.isArray(schema)) {
+        if (schema.length) {
+            return {
+                type: "array",
+                items: schema,
+                minItems: 0,
+                maxItems: schema.length
+            };
+        }
+        return {
+            type: "array",
+            minItems: 0,
+            maxItems: 0
+        };
+
+    }
+
+    // Given a full schema, leave it alone
+    return schema || null;
+}
+
+
 //-----------------------------------------------------------------------------
 // Exports
 //-----------------------------------------------------------------------------
 
 module.exports = {
     parseRuleId,
-    getRuleFromConfig
+    getRuleFromConfig,
+    getRuleOptionsSchema
 };
index 9172f93568812cccc56af9a679bda4b5710f13a1..0b5858fb30f38bdcff0191485d34656d8f277dfe 100644 (file)
 //-----------------------------------------------------------------------------
 
 const ajv = require("../shared/ajv")();
-const { parseRuleId, getRuleFromConfig } = require("./flat-config-helpers");
+const {
+    parseRuleId,
+    getRuleFromConfig,
+    getRuleOptionsSchema
+} = require("./flat-config-helpers");
 const ruleReplacements = require("../../conf/replacements.json");
 
 //-----------------------------------------------------------------------------
@@ -61,40 +65,6 @@ function throwRuleNotFoundError({ pluginName, ruleName }, config) {
     throw new TypeError(errorMessage);
 }
 
-/**
- * Gets a complete options schema for a rule.
- * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object
- * @returns {Object} JSON Schema for the rule's options.
- */
-function getRuleOptionsSchema(rule) {
-
-    if (!rule) {
-        return null;
-    }
-
-    const schema = rule.schema || rule.meta && rule.meta.schema;
-
-    if (Array.isArray(schema)) {
-        if (schema.length) {
-            return {
-                type: "array",
-                items: schema,
-                minItems: 0,
-                maxItems: schema.length
-            };
-        }
-        return {
-            type: "array",
-            minItems: 0,
-            maxItems: 0
-        };
-
-    }
-
-    // Given a full schema, leave it alone
-    return schema || null;
-}
-
 //-----------------------------------------------------------------------------
 // Exports
 //-----------------------------------------------------------------------------
index 6274772ad856a4adb4c7046212b01abe0ddfc622..9a3bd66e4874790c56c16509c218af22172ab9af 100644 (file)
@@ -32,12 +32,14 @@ const { version } = require("../../package.json");
 /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
 /** @typedef {import("../shared/types").ConfigData} ConfigData */
 /** @typedef {import("../shared/types").LintMessage} LintMessage */
+/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
 /** @typedef {import("../shared/types").Plugin} Plugin */
 /** @typedef {import("../shared/types").Rule} Rule */
+/** @typedef {import("../shared/types").LintResult} LintResult */
 
 /**
  * The main formatter object.
- * @typedef Formatter
+ * @typedef LoadedFormatter
  * @property {function(LintResult[]): string | Promise<string>} format format function.
  */
 
@@ -73,20 +75,6 @@ const { version } = require("../../package.json");
  * @property {Object} definition The plugin definition.
  */
 
-/**
- * A linting result.
- * @typedef {Object} LintResult
- * @property {string} filePath The path to the file that was linted.
- * @property {LintMessage[]} messages All of the messages for the result.
- * @property {number} errorCount Number of errors for the result.
- * @property {number} warningCount Number of warnings for the result.
- * @property {number} fixableErrorCount Number of fixable errors for the result.
- * @property {number} fixableWarningCount Number of fixable warnings for the result.
- * @property {string} [source] The source code of the file that was linted.
- * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible.
- * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules.
- */
-
 /**
  * Private members for the `ESLint` instance.
  * @typedef {Object} ESLintPrivateMembers
@@ -116,9 +104,9 @@ function isNonEmptyString(x) {
 }
 
 /**
- * Check if a given value is an array of non-empty stringss or not.
+ * Check if a given value is an array of non-empty strings or not.
  * @param {any} x The value to check.
- * @returns {boolean} `true` if `x` is an array of non-empty stringss.
+ * @returns {boolean} `true` if `x` is an array of non-empty strings.
  */
 function isArrayOfNonEmptyString(x) {
     return Array.isArray(x) && x.every(isNonEmptyString);
@@ -525,6 +513,9 @@ class ESLint {
             for (const { ruleId } of result.messages) {
                 resultRuleIds.add(ruleId);
             }
+            for (const { ruleId } of result.suppressedMessages) {
+                resultRuleIds.add(ruleId);
+            }
         }
 
         // create a map of all rules in the results
@@ -608,12 +599,12 @@ class ESLint {
      * The following values are allowed:
      * - `undefined` ... Load `stylish` builtin formatter.
      * - A builtin formatter name ... Load the builtin formatter.
-     * - A thirdparty formatter name:
+     * - A third-party formatter name:
      *   - `foo` → `eslint-formatter-foo`
      *   - `@foo` → `@foo/eslint-formatter`
      *   - `@foo/bar` → `@foo/eslint-formatter-bar`
      * - A file path ... Load the file.
-     * @returns {Promise<Formatter>} A promise resolving to the formatter object.
+     * @returns {Promise<LoadedFormatter>} A promise resolving to the formatter object.
      * This promise will be rejected if the given formatter was not found or not
      * a function.
      */
@@ -633,7 +624,7 @@ class ESLint {
 
             /**
              * The main formatter method.
-             * @param {LintResults[]} results The lint results to format.
+             * @param {LintResult[]} results The lint results to format.
              * @returns {string | Promise<string>} The formatted lint results.
              */
             format(results) {
diff --git a/eslint/lib/eslint/flat-eslint.js b/eslint/lib/eslint/flat-eslint.js
new file mode 100644 (file)
index 0000000..e436c46
--- /dev/null
@@ -0,0 +1,1176 @@
+/**
+ * @fileoverview Main class using flat config
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+// Note: Node.js 12 does not support fs/promises.
+const fs = require("fs").promises;
+const path = require("path");
+const findUp = require("find-up");
+const { version } = require("../../package.json");
+const { Linter } = require("../linter");
+const { getRuleFromConfig } = require("../config/flat-config-helpers");
+const { gitignoreToMinimatch } = require("@humanwhocodes/gitignore-to-minimatch");
+const {
+    Legacy: {
+        ConfigOps: {
+            getRuleSeverity
+        },
+        ModuleResolver,
+        naming
+    }
+} = require("@eslint/eslintrc");
+
+const {
+    fileExists,
+    findFiles,
+    getCacheFile,
+
+    isNonEmptyString,
+    isArrayOfNonEmptyString,
+
+    createIgnoreResult,
+    isErrorMessage,
+
+    processOptions
+} = require("./eslint-helpers");
+const { pathToFileURL } = require("url");
+const { FlatConfigArray } = require("../config/flat-config-array");
+const LintResultCache = require("../cli-engine/lint-result-cache");
+
+/*
+ * This is necessary to allow overwriting writeFile for testing purposes.
+ * We can just use fs/promises once we drop Node.js 12 support.
+ */
+
+//------------------------------------------------------------------------------
+// Typedefs
+//------------------------------------------------------------------------------
+
+// For VSCode IntelliSense
+/** @typedef {import("../shared/types").ConfigData} ConfigData */
+/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
+/** @typedef {import("../shared/types").LintMessage} LintMessage */
+/** @typedef {import("../shared/types").ParserOptions} ParserOptions */
+/** @typedef {import("../shared/types").Plugin} Plugin */
+/** @typedef {import("../shared/types").RuleConf} RuleConf */
+/** @typedef {import("../shared/types").Rule} Rule */
+/** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
+
+/**
+ * The options with which to configure the ESLint instance.
+ * @typedef {Object} FlatESLintOptions
+ * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments.
+ * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance
+ * @property {boolean} [cache] Enable result caching.
+ * @property {string} [cacheLocation] The cache file to use instead of .eslintcache.
+ * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files.
+ * @property {string} [cwd] The value to use for the current working directory.
+ * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`.
+ * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean.
+ * @property {string[]} [fixTypes] Array of rule types to apply fixes for.
+ * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file.
+ * @property {boolean} [ignore] False disables use of .eslintignore.
+ * @property {string} [ignorePath] The ignore file to use instead of .eslintignore.
+ * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to .eslintignore.
+ * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance
+ * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy;
+ *      doesn't do any config file lookup when `true`; considered to be a config filename
+ *      when a string.
+ * @property {Record<string,Plugin>} [plugins] An array of plugin implementations.
+ * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives.
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const FLAT_CONFIG_FILENAME = "eslint.config.js";
+const debug = require("debug")("eslint:flat-eslint");
+const removedFormatters = new Set(["table", "codeframe"]);
+const privateMembers = new WeakMap();
+
+/**
+ * It will calculate the error and warning count for collection of messages per file
+ * @param {LintMessage[]} messages Collection of messages
+ * @returns {Object} Contains the stats
+ * @private
+ */
+function calculateStatsPerFile(messages) {
+    return messages.reduce((stat, message) => {
+        if (message.fatal || message.severity === 2) {
+            stat.errorCount++;
+            if (message.fatal) {
+                stat.fatalErrorCount++;
+            }
+            if (message.fix) {
+                stat.fixableErrorCount++;
+            }
+        } else {
+            stat.warningCount++;
+            if (message.fix) {
+                stat.fixableWarningCount++;
+            }
+        }
+        return stat;
+    }, {
+        errorCount: 0,
+        fatalErrorCount: 0,
+        warningCount: 0,
+        fixableErrorCount: 0,
+        fixableWarningCount: 0
+    });
+}
+
+/**
+ * It will calculate the error and warning count for collection of results from all files
+ * @param {LintResult[]} results Collection of messages from all the files
+ * @returns {Object} Contains the stats
+ * @private
+ */
+function calculateStatsPerRun(results) {
+    return results.reduce((stat, result) => {
+        stat.errorCount += result.errorCount;
+        stat.fatalErrorCount += result.fatalErrorCount;
+        stat.warningCount += result.warningCount;
+        stat.fixableErrorCount += result.fixableErrorCount;
+        stat.fixableWarningCount += result.fixableWarningCount;
+        return stat;
+    }, {
+        errorCount: 0,
+        fatalErrorCount: 0,
+        warningCount: 0,
+        fixableErrorCount: 0,
+        fixableWarningCount: 0
+    });
+}
+
+/**
+ * Loads global ignore patterns from an ignore file (usually .eslintignore).
+ * @param {string} filePath The filename to load.
+ * @returns {ignore} A function encapsulating the ignore patterns.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+async function loadIgnoreFilePatterns(filePath) {
+    debug(`Loading ignore file: ${filePath}`);
+
+    try {
+        const ignoreFileText = await fs.readFile(filePath, { encoding: "utf8" });
+
+        return ignoreFileText
+            .split(/\r?\n/gu)
+            .filter(line => line.trim() !== "" && !line.startsWith("#"));
+
+    } catch (e) {
+        debug(`Error reading ignore file: ${filePath}`);
+        e.message = `Cannot read ignore file: ${filePath}\nError: ${e.message}`;
+        throw e;
+    }
+}
+
+/**
+ * Create rulesMeta object.
+ * @param {Map<string,Rule>} rules a map of rules from which to generate the object.
+ * @returns {Object} metadata for all enabled rules.
+ */
+function createRulesMeta(rules) {
+    return Array.from(rules).reduce((retVal, [id, rule]) => {
+        retVal[id] = rule.meta;
+        return retVal;
+    }, {});
+}
+
+/** @type {WeakMap<ExtractedConfig, DeprecatedRuleInfo[]>} */
+const usedDeprecatedRulesCache = new WeakMap();
+
+/**
+ * Create used deprecated rule list.
+ * @param {CLIEngine} eslint The CLIEngine instance.
+ * @param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
+ * @returns {DeprecatedRuleInfo[]} The used deprecated rule list.
+ */
+function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) {
+    const {
+        configs,
+        options: { cwd }
+    } = privateMembers.get(eslint);
+    const filePath = path.isAbsolute(maybeFilePath)
+        ? maybeFilePath
+        : path.join(cwd, "__placeholder__.js");
+    const config = configs.getConfig(filePath);
+
+    // Most files use the same config, so cache it.
+    if (config && !usedDeprecatedRulesCache.has(config)) {
+        const retv = [];
+
+        if (config.rules) {
+            for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
+                if (getRuleSeverity(ruleConf) === 0) {
+                    continue;
+                }
+                const rule = getRuleFromConfig(ruleId, config);
+                const meta = rule && rule.meta;
+
+                if (meta && meta.deprecated) {
+                    retv.push({ ruleId, replacedBy: meta.replacedBy || [] });
+                }
+            }
+        }
+
+
+        usedDeprecatedRulesCache.set(config, Object.freeze(retv));
+    }
+
+    return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]);
+}
+
+/**
+ * Processes the linting results generated by a CLIEngine linting report to
+ * match the ESLint class's API.
+ * @param {CLIEngine} eslint The CLIEngine instance.
+ * @param {CLIEngineLintReport} report The CLIEngine linting report to process.
+ * @returns {LintResult[]} The processed linting results.
+ */
+function processLintReport(eslint, { results }) {
+    const descriptor = {
+        configurable: true,
+        enumerable: true,
+        get() {
+            return getOrFindUsedDeprecatedRules(eslint, this.filePath);
+        }
+    };
+
+    for (const result of results) {
+        Object.defineProperty(result, "usedDeprecatedRules", descriptor);
+    }
+
+    return results;
+}
+
+/**
+ * An Array.prototype.sort() compatible compare function to order results by their file path.
+ * @param {LintResult} a The first lint result.
+ * @param {LintResult} b The second lint result.
+ * @returns {number} An integer representing the order in which the two results should occur.
+ */
+function compareResultsByFilePath(a, b) {
+    if (a.filePath < b.filePath) {
+        return -1;
+    }
+
+    if (a.filePath > b.filePath) {
+        return 1;
+    }
+
+    return 0;
+}
+
+/**
+ * Searches from the current working directory up until finding the
+ * given flat config filename.
+ * @param {string} cwd The current working directory to search from.
+ * @returns {Promise<string|null>} The filename if found or `null` if not.
+ */
+function findFlatConfigFile(cwd) {
+    return findUp(
+        FLAT_CONFIG_FILENAME,
+        { cwd }
+    );
+}
+
+/**
+ * Load the config array from the given filename.
+ * @param {string} filePath The filename to load from.
+ * @param {Object} options Options to help load the config file.
+ * @param {string} options.basePath The base path for the config array.
+ * @param {boolean} options.shouldIgnore Whether to honor ignore patterns.
+ * @returns {Promise<FlatConfigArray>} The config array loaded from the config file.
+ */
+async function loadFlatConfigFile(filePath, { basePath, shouldIgnore }) {
+    debug(`Loading config from ${filePath}`);
+
+    const fileURL = pathToFileURL(filePath);
+
+    debug(`Config file URL is ${fileURL}`);
+
+    const module = await import(fileURL);
+
+    return new FlatConfigArray(module.default, {
+        basePath,
+        shouldIgnore
+    });
+}
+
+/**
+ * Calculates the config array for this run based on inputs.
+ * @param {FlatESLint} eslint The instance to create the config array for.
+ * @param {import("./eslint").ESLintOptions} options The ESLint instance options.
+ * @returns {FlatConfigArray} The config array for `eslint``.
+ */
+async function calculateConfigArray(eslint, {
+    cwd,
+    overrideConfig,
+    configFile,
+    ignore: shouldIgnore,
+    ignorePath,
+    ignorePatterns
+}) {
+
+    // check for cached instance
+    const slots = privateMembers.get(eslint);
+
+    if (slots.configs) {
+        return slots.configs;
+    }
+
+    // determine where to load config file from
+    let configFilePath;
+    let basePath = cwd;
+
+    if (typeof configFile === "string") {
+        debug(`Override config file path is ${configFile}`);
+        configFilePath = path.resolve(cwd, configFile);
+    } else if (configFile !== false) {
+        debug("Searching for eslint.config.js");
+        configFilePath = await findFlatConfigFile(cwd);
+
+        if (!configFilePath) {
+            throw new Error("Could not find config file.");
+        }
+
+        basePath = path.resolve(path.dirname(configFilePath));
+    }
+
+    // load config array
+    let configs;
+
+    if (configFilePath) {
+        configs = await loadFlatConfigFile(configFilePath, {
+            basePath,
+            shouldIgnore
+        });
+    } else {
+        configs = new FlatConfigArray([], { basePath, shouldIgnore });
+    }
+
+    // add in any configured defaults
+    configs.push(...slots.defaultConfigs);
+
+    let allIgnorePatterns = [];
+    let ignoreFilePath;
+
+    // load ignore file if necessary
+    if (shouldIgnore) {
+        if (ignorePath) {
+            ignoreFilePath = path.resolve(cwd, ignorePath);
+            allIgnorePatterns = await loadIgnoreFilePatterns(ignoreFilePath);
+        } else {
+            ignoreFilePath = path.resolve(cwd, ".eslintignore");
+
+            // no error if .eslintignore doesn't exist`
+            if (fileExists(ignoreFilePath)) {
+                allIgnorePatterns = await loadIgnoreFilePatterns(ignoreFilePath);
+            }
+        }
+    }
+
+    // append command line ignore patterns
+    if (ignorePatterns) {
+        if (typeof ignorePatterns === "string") {
+            allIgnorePatterns.push(ignorePatterns);
+        } else {
+            allIgnorePatterns.push(...ignorePatterns);
+        }
+    }
+
+    /*
+     * If the config file basePath is different than the cwd, then
+     * the ignore patterns won't work correctly. Here, we adjust the
+     * ignore pattern to include the correct relative path. Patterns
+     * loaded from ignore files are always relative to the cwd, whereas
+     * the config file basePath can be an ancestor of the cwd.
+     */
+    if (basePath !== cwd && allIgnorePatterns.length) {
+
+        const relativeIgnorePath = path.relative(basePath, cwd);
+
+        allIgnorePatterns = allIgnorePatterns.map(pattern => {
+            const negated = pattern.startsWith("!");
+            const basePattern = negated ? pattern.slice(1) : pattern;
+
+            /*
+             * Ignore patterns are considered relative to a directory
+             * when the pattern contains a slash in a position other
+             * than the last character. If that's the case, we need to
+             * add the relative ignore path to the current pattern to
+             * get the correct behavior. Otherwise, no change is needed.
+             */
+            if (!basePattern.includes("/") || basePattern.endsWith("/")) {
+                return pattern;
+            }
+
+            return (negated ? "!" : "") +
+                path.posix.join(relativeIgnorePath, basePattern);
+        });
+    }
+
+    if (allIgnorePatterns.length) {
+
+        /*
+         * Ignore patterns are added to the end of the config array
+         * so they can override default ignores.
+         */
+        configs.push({
+            ignores: allIgnorePatterns.map(gitignoreToMinimatch)
+        });
+    }
+
+    if (overrideConfig) {
+        if (Array.isArray(overrideConfig)) {
+            configs.push(...overrideConfig);
+        } else {
+            configs.push(overrideConfig);
+        }
+    }
+
+    await configs.normalize();
+
+    // cache the config array for this instance
+    slots.configs = configs;
+
+    return configs;
+}
+
+/**
+ * Processes an source code using ESLint.
+ * @param {Object} config The config object.
+ * @param {string} config.text The source code to verify.
+ * @param {string} config.cwd The path to the current working directory.
+ * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses `<text>`.
+ * @param {FlatConfigArray} config.configs The config.
+ * @param {boolean} config.fix If `true` then it does fix.
+ * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments.
+ * @param {boolean} config.reportUnusedDisableDirectives If `true` then it reports unused `eslint-disable` comments.
+ * @param {Linter} config.linter The linter instance to verify.
+ * @returns {LintResult} The result of linting.
+ * @private
+ */
+function verifyText({
+    text,
+    cwd,
+    filePath: providedFilePath,
+    configs,
+    fix,
+    allowInlineConfig,
+    reportUnusedDisableDirectives,
+    linter
+}) {
+    const filePath = providedFilePath || "<text>";
+
+    debug(`Lint ${filePath}`);
+
+    /*
+     * Verify.
+     * `config.extractConfig(filePath)` requires an absolute path, but `linter`
+     * doesn't know CWD, so it gives `linter` an absolute path always.
+     */
+    const filePathToVerify = filePath === "<text>" ? path.join(cwd, "__placeholder__.js") : filePath;
+    const { fixed, messages, output } = linter.verifyAndFix(
+        text,
+        configs,
+        {
+            allowInlineConfig,
+            filename: filePathToVerify,
+            fix,
+            reportUnusedDisableDirectives,
+
+            /**
+             * Check if the linter should adopt a given code block or not.
+             * @param {string} blockFilename The virtual filename of a code block.
+             * @returns {boolean} `true` if the linter should adopt the code block.
+             */
+            filterCodeBlock(blockFilename) {
+                return configs.isExplicitMatch(blockFilename);
+            }
+        }
+    );
+
+    // Tweak and return.
+    const result = {
+        filePath: filePath === "<text>" ? filePath : path.resolve(filePath),
+        messages,
+        suppressedMessages: linter.getSuppressedMessages(),
+        ...calculateStatsPerFile(messages)
+    };
+
+    if (fixed) {
+        result.output = output;
+    }
+
+    if (
+        result.errorCount + result.warningCount > 0 &&
+        typeof result.output === "undefined"
+    ) {
+        result.source = text;
+    }
+
+    return result;
+}
+
+/**
+ * Checks whether a message's rule type should be fixed.
+ * @param {LintMessage} message The message to check.
+ * @param {FlatConfig} config The config for the file that generated the message.
+ * @param {string[]} fixTypes An array of fix types to check.
+ * @returns {boolean} Whether the message should be fixed.
+ */
+function shouldMessageBeFixed(message, config, fixTypes) {
+    if (!message.ruleId) {
+        return fixTypes.has("directive");
+    }
+
+    const rule = message.ruleId && getRuleFromConfig(message.ruleId, config);
+
+    return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type));
+}
+
+/**
+ * Collect used deprecated rules.
+ * @param {Array<FlatConfig>} configs The configs to evaluate.
+ * @returns {IterableIterator<DeprecatedRuleInfo>} Used deprecated rules.
+ */
+function *iterateRuleDeprecationWarnings(configs) {
+    const processedRuleIds = new Set();
+
+    for (const config of configs) {
+        for (const [ruleId, ruleConfig] of Object.entries(config.rules)) {
+
+            // Skip if it was processed.
+            if (processedRuleIds.has(ruleId)) {
+                continue;
+            }
+            processedRuleIds.add(ruleId);
+
+            // Skip if it's not used.
+            if (!getRuleSeverity(ruleConfig)) {
+                continue;
+            }
+            const rule = getRuleFromConfig(ruleId, config);
+
+            // Skip if it's not deprecated.
+            if (!(rule && rule.meta && rule.meta.deprecated)) {
+                continue;
+            }
+
+            // This rule was used and deprecated.
+            yield {
+                ruleId,
+                replacedBy: rule.meta.replacedBy || []
+            };
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+// Main API
+//-----------------------------------------------------------------------------
+
+/**
+ * Primary Node.js API for ESLint.
+ */
+class FlatESLint {
+
+    /**
+     * Creates a new instance of the main ESLint API.
+     * @param {FlatESLintOptions} options The options for this instance.
+     */
+    constructor(options = {}) {
+
+        const defaultConfigs = [];
+        const processedOptions = processOptions(options);
+        const linter = new Linter({
+            cwd: processedOptions.cwd,
+            configType: "flat"
+        });
+
+        const cacheFilePath = getCacheFile(
+            processedOptions.cacheLocation,
+            processedOptions.cwd
+        );
+
+        const lintResultCache = processedOptions.cache
+            ? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy)
+            : null;
+
+        privateMembers.set(this, {
+            options: processedOptions,
+            linter,
+            cacheFilePath,
+            lintResultCache,
+            defaultConfigs,
+            defaultIgnores: () => false,
+            configs: null
+        });
+
+        /**
+         * If additional plugins are passed in, add that to the default
+         * configs for this instance.
+         */
+        if (options.plugins) {
+
+            const plugins = {};
+
+            for (const [pluginName, plugin] of Object.entries(options.plugins)) {
+                plugins[naming.getShorthandName(pluginName, "eslint-plugin")] = plugin;
+            }
+
+            defaultConfigs.push({
+                plugins
+            });
+        }
+
+    }
+
+    /**
+     * The version text.
+     * @type {string}
+     */
+    static get version() {
+        return version;
+    }
+
+    /**
+     * Outputs fixes from the given results to files.
+     * @param {LintResult[]} results The lint results.
+     * @returns {Promise<void>} Returns a promise that is used to track side effects.
+     */
+    static async outputFixes(results) {
+        if (!Array.isArray(results)) {
+            throw new Error("'results' must be an array");
+        }
+
+        await Promise.all(
+            results
+                .filter(result => {
+                    if (typeof result !== "object" || result === null) {
+                        throw new Error("'results' must include only objects");
+                    }
+                    return (
+                        typeof result.output === "string" &&
+                        path.isAbsolute(result.filePath)
+                    );
+                })
+                .map(r => fs.writeFile(r.filePath, r.output))
+        );
+    }
+
+    /**
+     * Returns results that only contains errors.
+     * @param {LintResult[]} results The results to filter.
+     * @returns {LintResult[]} The filtered results.
+     */
+    static getErrorResults(results) {
+        const filtered = [];
+
+        results.forEach(result => {
+            const filteredMessages = result.messages.filter(isErrorMessage);
+            const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage);
+
+            if (filteredMessages.length > 0) {
+                filtered.push({
+                    ...result,
+                    messages: filteredMessages,
+                    suppressedMessages: filteredSuppressedMessages,
+                    errorCount: filteredMessages.length,
+                    warningCount: 0,
+                    fixableErrorCount: result.fixableErrorCount,
+                    fixableWarningCount: 0
+                });
+            }
+        });
+
+        return filtered;
+    }
+
+    /**
+     * Returns meta objects for each rule represented in the lint results.
+     * @param {LintResult[]} results The results to fetch rules meta for.
+     * @returns {Object} A mapping of ruleIds to rule meta objects.
+     * @throws {TypeError} When the results object wasn't created from this ESLint instance.
+     * @throws {TypeError} When a plugin or rule is missing.
+     */
+    getRulesMetaForResults(results) {
+
+        const resultRules = new Map();
+
+        // short-circuit simple case
+        if (results.length === 0) {
+            return resultRules;
+        }
+
+        const { configs } = privateMembers.get(this);
+
+        /*
+         * We can only accurately return rules meta information for linting results if the
+         * results were created by this instance. Otherwise, the necessary rules data is
+         * not available. So if the config array doesn't already exist, just throw an error
+         * to let the user know we can't do anything here.
+         */
+        if (!configs) {
+            throw new TypeError("Results object was not created from this ESLint instance.");
+        }
+
+        for (const result of results) {
+
+            /*
+             * Normalize filename for <text>.
+             */
+            const filePath = result.filePath === "<text>"
+                ? "__placeholder__.js" : result.filePath;
+
+            /*
+             * All of the plugin and rule information is contained within the
+             * calculated config for the given file.
+             */
+            const config = configs.getConfig(filePath);
+            const allMessages = result.messages.concat(result.suppressedMessages);
+
+            for (const { ruleId } of allMessages) {
+                const rule = getRuleFromConfig(ruleId, config);
+
+                // ensure the rule exists
+                if (!rule) {
+                    throw new TypeError(`Could not find the rule "${ruleId}".`);
+                }
+
+                resultRules.set(ruleId, rule);
+            }
+        }
+
+        return createRulesMeta(resultRules);
+    }
+
+    /**
+     * Executes the current configuration on an array of file and directory names.
+     * @param {string|string[]} patterns An array of file and directory names.
+     * @returns {Promise<LintResult[]>} The results of linting the file patterns given.
+     */
+    async lintFiles(patterns) {
+        if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) {
+            throw new Error("'patterns' must be a non-empty string or an array of non-empty strings");
+        }
+
+        const {
+            cacheFilePath,
+            lintResultCache,
+            linter,
+            options: eslintOptions
+        } = privateMembers.get(this);
+        const configs = await calculateConfigArray(this, eslintOptions);
+        const {
+            allowInlineConfig,
+            cache,
+            cwd,
+            fix,
+            fixTypes,
+            reportUnusedDisableDirectives,
+            globInputPaths,
+            errorOnUnmatchedPattern
+        } = eslintOptions;
+        const startTime = Date.now();
+        const usedConfigs = [];
+        const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
+
+        // Delete cache file; should this be done here?
+        if (!cache && cacheFilePath) {
+            debug(`Deleting cache file at ${cacheFilePath}`);
+
+            try {
+                await fs.unlink(cacheFilePath);
+            } catch (error) {
+                const errorCode = error && error.code;
+
+                // Ignore errors when no such file exists or file system is read only (and cache file does not exist)
+                if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !(await fs.exists(cacheFilePath)))) {
+                    throw error;
+                }
+            }
+        }
+
+        const filePaths = await findFiles({
+            patterns: typeof patterns === "string" ? [patterns] : patterns,
+            cwd,
+            globInputPaths,
+            configs,
+            errorOnUnmatchedPattern
+        });
+
+        debug(`${filePaths.length} files found in: ${Date.now() - startTime}ms`);
+
+        /*
+         * Because we need to process multiple files, including reading from disk,
+         * it is most efficient to start by reading each file via promises so that
+         * they can be done in parallel. Then, we can lint the returned text. This
+         * ensures we are waiting the minimum amount of time in between lints.
+         */
+        const results = await Promise.all(
+
+            filePaths.map(({ filePath, ignored }) => {
+
+                /*
+                 * If a filename was entered that matches an ignore
+                 * pattern, then notify the user.
+                 */
+                if (ignored) {
+                    return createIgnoreResult(filePath, cwd);
+                }
+
+                const config = configs.getConfig(filePath);
+
+                /*
+                 * Sometimes a file found through a glob pattern will
+                 * be ignored. In this case, `config` will be undefined
+                 * and we just silently ignore the file.
+                 */
+                if (!config) {
+                    return void 0;
+                }
+
+                /*
+                 * Store used configs for:
+                 * - this method uses to collect used deprecated rules.
+                 * - `--fix-type` option uses to get the loaded rule's meta data.
+                 */
+                if (!usedConfigs.includes(config)) {
+                    usedConfigs.push(config);
+                }
+
+                // Skip if there is cached result.
+                if (lintResultCache) {
+                    const cachedResult =
+                        lintResultCache.getCachedLintResults(filePath, config);
+
+                    if (cachedResult) {
+                        const hadMessages =
+                            cachedResult.messages &&
+                            cachedResult.messages.length > 0;
+
+                        if (hadMessages && fix) {
+                            debug(`Reprocessing cached file to allow autofix: ${filePath}`);
+                        } else {
+                            debug(`Skipping file since it hasn't changed: ${filePath}`);
+                            return cachedResult;
+                        }
+                    }
+                }
+
+
+                // set up fixer for fixtypes if necessary
+                let fixer = fix;
+
+                if (fix && fixTypesSet) {
+
+                    // save original value of options.fix in case it's a function
+                    const originalFix = (typeof fix === "function")
+                        ? fix : () => true;
+
+                    fixer = message => shouldMessageBeFixed(message, config, fixTypesSet) && originalFix(message);
+                }
+
+                return fs.readFile(filePath, "utf8")
+                    .then(text => {
+
+                        // do the linting
+                        const result = verifyText({
+                            text,
+                            filePath,
+                            configs,
+                            cwd,
+                            fix: fixer,
+                            allowInlineConfig,
+                            reportUnusedDisableDirectives,
+                            linter
+                        });
+
+                        /*
+                         * Store the lint result in the LintResultCache.
+                         * NOTE: The LintResultCache will remove the file source and any
+                         * other properties that are difficult to serialize, and will
+                         * hydrate those properties back in on future lint runs.
+                         */
+                        if (lintResultCache) {
+                            lintResultCache.setCachedLintResults(filePath, config, result);
+                        }
+
+                        return result;
+                    });
+
+            })
+        );
+
+        // Persist the cache to disk.
+        if (lintResultCache) {
+            lintResultCache.reconcile();
+        }
+
+        let usedDeprecatedRules;
+        const finalResults = results.filter(result => !!result);
+
+        return processLintReport(this, {
+            results: finalResults,
+            ...calculateStatsPerRun(finalResults),
+
+            // Initialize it lazily because CLI and `ESLint` API don't use it.
+            get usedDeprecatedRules() {
+                if (!usedDeprecatedRules) {
+                    usedDeprecatedRules = Array.from(
+                        iterateRuleDeprecationWarnings(usedConfigs)
+                    );
+                }
+                return usedDeprecatedRules;
+            }
+        });
+    }
+
+    /**
+     * Executes the current configuration on text.
+     * @param {string} code A string of JavaScript code to lint.
+     * @param {Object} [options] The options.
+     * @param {string} [options.filePath] The path to the file of the source code.
+     * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path.
+     * @returns {Promise<LintResult[]>} The results of linting the string of code given.
+     */
+    async lintText(code, options = {}) {
+
+        // Parameter validation
+
+        if (typeof code !== "string") {
+            throw new Error("'code' must be a string");
+        }
+
+        if (typeof options !== "object") {
+            throw new Error("'options' must be an object, null, or undefined");
+        }
+
+        // Options validation
+
+        const {
+            filePath,
+            warnIgnored = false,
+            ...unknownOptions
+        } = options || {};
+
+        const unknownOptionKeys = Object.keys(unknownOptions);
+
+        if (unknownOptionKeys.length > 0) {
+            throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`);
+        }
+
+        if (filePath !== void 0 && !isNonEmptyString(filePath)) {
+            throw new Error("'options.filePath' must be a non-empty string or undefined");
+        }
+
+        if (typeof warnIgnored !== "boolean") {
+            throw new Error("'options.warnIgnored' must be a boolean or undefined");
+        }
+
+        // Now we can get down to linting
+
+        const {
+            linter,
+            options: eslintOptions
+        } = privateMembers.get(this);
+        const configs = await calculateConfigArray(this, eslintOptions);
+        const {
+            allowInlineConfig,
+            cwd,
+            fix,
+            reportUnusedDisableDirectives
+        } = eslintOptions;
+        const results = [];
+        const startTime = Date.now();
+        const resolvedFilename = path.resolve(cwd, filePath || "__placeholder__.js");
+        let config;
+
+        // Clear the last used config arrays.
+        if (resolvedFilename && await this.isPathIgnored(resolvedFilename)) {
+            if (warnIgnored) {
+                results.push(createIgnoreResult(resolvedFilename, cwd));
+            }
+        } else {
+
+            // TODO: Needed?
+            config = configs.getConfig(resolvedFilename);
+
+            // Do lint.
+            results.push(verifyText({
+                text: code,
+                filePath: resolvedFilename.endsWith("__placeholder__.js") ? "<text>" : resolvedFilename,
+                configs,
+                cwd,
+                fix,
+                allowInlineConfig,
+                reportUnusedDisableDirectives,
+                linter
+            }));
+        }
+
+        debug(`Linting complete in: ${Date.now() - startTime}ms`);
+        let usedDeprecatedRules;
+
+        return processLintReport(this, {
+            results,
+            ...calculateStatsPerRun(results),
+
+            // Initialize it lazily because CLI and `ESLint` API don't use it.
+            get usedDeprecatedRules() {
+                if (!usedDeprecatedRules) {
+                    usedDeprecatedRules = Array.from(
+                        iterateRuleDeprecationWarnings(config)
+                    );
+                }
+                return usedDeprecatedRules;
+            }
+        });
+
+    }
+
+    /**
+     * Returns the formatter representing the given formatter name.
+     * @param {string} [name] The name of the formatter to load.
+     * The following values are allowed:
+     * - `undefined` ... Load `stylish` builtin formatter.
+     * - A builtin formatter name ... Load the builtin formatter.
+     * - A thirdparty formatter name:
+     *   - `foo` → `eslint-formatter-foo`
+     *   - `@foo` → `@foo/eslint-formatter`
+     *   - `@foo/bar` → `@foo/eslint-formatter-bar`
+     * - A file path ... Load the file.
+     * @returns {Promise<Formatter>} A promise resolving to the formatter object.
+     * This promise will be rejected if the given formatter was not found or not
+     * a function.
+     */
+    async loadFormatter(name = "stylish") {
+        if (typeof name !== "string") {
+            throw new Error("'name' must be a string");
+        }
+
+        // replace \ with / for Windows compatibility
+        const normalizedFormatName = name.replace(/\\/gu, "/");
+        const namespace = naming.getNamespaceFromTerm(normalizedFormatName);
+
+        // grab our options
+        const { cwd } = privateMembers.get(this).options;
+
+
+        let formatterPath;
+
+        // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
+        if (!namespace && normalizedFormatName.includes("/")) {
+            formatterPath = path.resolve(cwd, normalizedFormatName);
+        } else {
+            try {
+                const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter");
+
+                // TODO: This is pretty dirty...would be nice to clean up at some point.
+                formatterPath = ModuleResolver.resolve(npmFormat, path.join(cwd, "__placeholder__.js"));
+            } catch {
+                formatterPath = path.resolve(__dirname, "../", "cli-engine", "formatters", `${normalizedFormatName}.js`);
+            }
+        }
+
+        let formatter;
+
+        try {
+            formatter = (await import(pathToFileURL(formatterPath))).default;
+        } catch (ex) {
+
+            // check for formatters that have been removed
+            if (removedFormatters.has(name)) {
+                ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``;
+            } else {
+                ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`;
+            }
+
+            throw ex;
+        }
+
+
+        if (typeof formatter !== "function") {
+            throw new TypeError(`Formatter must be a function, but got a ${typeof formatter}.`);
+        }
+
+        const eslint = this;
+
+        return {
+
+            /**
+             * The main formatter method.
+             * @param {LintResults[]} results The lint results to format.
+             * @returns {string} The formatted lint results.
+             */
+            format(results) {
+                let rulesMeta = null;
+
+                results.sort(compareResultsByFilePath);
+
+                return formatter(results, {
+                    cwd,
+                    get rulesMeta() {
+                        if (!rulesMeta) {
+                            rulesMeta = eslint.getRulesMetaForResults(results);
+                        }
+
+                        return rulesMeta;
+                    }
+                });
+            }
+        };
+    }
+
+    /**
+     * Returns a configuration object for the given file based on the CLI options.
+     * This is the same logic used by the ESLint CLI executable to determine
+     * configuration for each file it processes.
+     * @param {string} filePath The path of the file to retrieve a config object for.
+     * @returns {Promise<ConfigData|undefined>} A configuration object for the file
+     *      or `undefined` if there is no configuration data for the object.
+     */
+    async calculateConfigForFile(filePath) {
+        if (!isNonEmptyString(filePath)) {
+            throw new Error("'filePath' must be a non-empty string");
+        }
+        const options = privateMembers.get(this).options;
+        const absolutePath = path.resolve(options.cwd, filePath);
+        const configs = await calculateConfigArray(this, options);
+
+        return configs.getConfig(absolutePath);
+    }
+
+    /**
+     * Checks if a given path is ignored by ESLint.
+     * @param {string} filePath The path of the file to check.
+     * @returns {Promise<boolean>} Whether or not the given path is ignored.
+     */
+    async isPathIgnored(filePath) {
+        const config = await this.calculateConfigForFile(filePath);
+
+        return config === void 0;
+    }
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = {
+    FlatESLint,
+    findFlatConfigFile
+};
index c9185ee0eba0a550d31c073b97df8fc7d41e1a13..017b768ecd03ca5b1b03f10dbff39877ad6859b1 100644 (file)
@@ -1,7 +1,9 @@
 "use strict";
 
 const { ESLint } = require("./eslint");
+const { FlatESLint } = require("./flat-eslint");
 
 module.exports = {
-    ESLint
+    ESLint,
+    FlatESLint
 };
diff --git a/eslint/lib/init/autoconfig.js b/eslint/lib/init/autoconfig.js
deleted file mode 100644 (file)
index ea25234..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-/**
- * @fileoverview Used for creating a suggested configuration based on project code.
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const equal = require("fast-deep-equal"),
-    recConfig = require("../../conf/eslint-recommended"),
-    {
-        Legacy: {
-            ConfigOps
-        }
-    } = require("@eslint/eslintrc"),
-    { Linter } = require("../linter"),
-    configRule = require("./config-rule");
-
-const debug = require("debug")("eslint:autoconfig");
-const linter = new Linter();
-
-//------------------------------------------------------------------------------
-// Data
-//------------------------------------------------------------------------------
-
-const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only
-    RECOMMENDED_CONFIG_NAME = "eslint:recommended";
-
-//------------------------------------------------------------------------------
-// Private
-//------------------------------------------------------------------------------
-
-/**
- * Information about a rule configuration, in the context of a Registry.
- * @typedef {Object}     registryItem
- * @property {ruleConfig} config A valid configuration for the rule
- * @property {number} specificity The number of elements in the ruleConfig array
- * @property {number} errorCount The number of errors encountered when linting with the config
- */
-
-/**
- * This callback is used to measure execution status in a progress bar
- * @callback progressCallback
- * @param {number} The total number of times the callback will be called.
- */
-
-/**
- * Create registryItems for rules
- * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items
- * @returns {Object} registryItems for each rule in provided rulesConfig
- */
-function makeRegistryItems(rulesConfig) {
-    return Object.keys(rulesConfig).reduce((accumulator, ruleId) => {
-        accumulator[ruleId] = rulesConfig[ruleId].map(config => ({
-            config,
-            specificity: config.length || 1,
-            errorCount: void 0
-        }));
-        return accumulator;
-    }, {});
-}
-
-/**
- * Creates an object in which to store rule configs and error counts
- *
- * Unless a rulesConfig is provided at construction, the registry will not contain
- * any rules, only methods.  This will be useful for building up registries manually.
- *
- * Registry class
- */
-class Registry {
-
-    /**
-     * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations
-     */
-    constructor(rulesConfig) {
-        this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {};
-    }
-
-    /**
-     * Populate the registry with core rule configs.
-     *
-     * It will set the registry's `rule` property to an object having rule names
-     * as keys and an array of registryItems as values.
-     * @returns {void}
-     */
-    populateFromCoreRules() {
-        const rulesConfig = configRule.createCoreRuleConfigs(/* noDeprecated = */ true);
-
-        this.rules = makeRegistryItems(rulesConfig);
-    }
-
-    /**
-     * Creates sets of rule configurations which can be used for linting
-     * and initializes registry errors to zero for those configurations (side effect).
-     *
-     * This combines as many rules together as possible, such that the first sets
-     * in the array will have the highest number of rules configured, and later sets
-     * will have fewer and fewer, as not all rules have the same number of possible
-     * configurations.
-     *
-     * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS.
-     * @returns {Object[]} "rules" configurations to use for linting
-     */
-    buildRuleSets() {
-        let idx = 0;
-        const ruleIds = Object.keys(this.rules),
-            ruleSets = [];
-
-        /**
-         * Add a rule configuration from the registry to the ruleSets
-         *
-         * This is broken out into its own function so that it doesn't need to be
-         * created inside of the while loop.
-         * @param {string} rule The ruleId to add.
-         * @returns {void}
-         */
-        const addRuleToRuleSet = function(rule) {
-
-            /*
-             * This check ensures that there is a rule configuration and that
-             * it has fewer than the max combinations allowed.
-             * If it has too many configs, we will only use the most basic of
-             * the possible configurations.
-             */
-            const hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS);
-
-            if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) {
-
-                /*
-                 * If the rule has too many possible combinations, only take
-                 * simple ones, avoiding objects.
-                 */
-                if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") {
-                    return;
-                }
-
-                ruleSets[idx] = ruleSets[idx] || {};
-                ruleSets[idx][rule] = this.rules[rule][idx].config;
-
-                /*
-                 * Initialize errorCount to zero, since this is a config which
-                 * will be linted.
-                 */
-                this.rules[rule][idx].errorCount = 0;
-            }
-        }.bind(this);
-
-        while (ruleSets.length === idx) {
-            ruleIds.forEach(addRuleToRuleSet);
-            idx += 1;
-        }
-
-        return ruleSets;
-    }
-
-    /**
-     * Remove all items from the registry with a non-zero number of errors
-     *
-     * Note: this also removes rule configurations which were not linted
-     * (meaning, they have an undefined errorCount).
-     * @returns {void}
-     */
-    stripFailingConfigs() {
-        const ruleIds = Object.keys(this.rules),
-            newRegistry = new Registry();
-
-        newRegistry.rules = Object.assign({}, this.rules);
-        ruleIds.forEach(ruleId => {
-            const errorFreeItems = newRegistry.rules[ruleId].filter(registryItem => (registryItem.errorCount === 0));
-
-            if (errorFreeItems.length > 0) {
-                newRegistry.rules[ruleId] = errorFreeItems;
-            } else {
-                delete newRegistry.rules[ruleId];
-            }
-        });
-
-        return newRegistry;
-    }
-
-    /**
-     * Removes rule configurations which were not included in a ruleSet
-     * @returns {void}
-     */
-    stripExtraConfigs() {
-        const ruleIds = Object.keys(this.rules),
-            newRegistry = new Registry();
-
-        newRegistry.rules = Object.assign({}, this.rules);
-        ruleIds.forEach(ruleId => {
-            newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(registryItem => (typeof registryItem.errorCount !== "undefined"));
-        });
-
-        return newRegistry;
-    }
-
-    /**
-     * Creates a registry of rules which had no error-free configs.
-     * The new registry is intended to be analyzed to determine whether its rules
-     * should be disabled or set to warning.
-     * @returns {Registry} A registry of failing rules.
-     */
-    getFailingRulesRegistry() {
-        const ruleIds = Object.keys(this.rules),
-            failingRegistry = new Registry();
-
-        ruleIds.forEach(ruleId => {
-            const failingConfigs = this.rules[ruleId].filter(registryItem => (registryItem.errorCount > 0));
-
-            if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) {
-                failingRegistry.rules[ruleId] = failingConfigs;
-            }
-        });
-
-        return failingRegistry;
-    }
-
-    /**
-     * Create an eslint config for any rules which only have one configuration
-     * in the registry.
-     * @returns {Object} An eslint config with rules section populated
-     */
-    createConfig() {
-        const ruleIds = Object.keys(this.rules),
-            config = { rules: {} };
-
-        ruleIds.forEach(ruleId => {
-            if (this.rules[ruleId].length === 1) {
-                config.rules[ruleId] = this.rules[ruleId][0].config;
-            }
-        });
-
-        return config;
-    }
-
-    /**
-     * Return a cloned registry containing only configs with a desired specificity
-     * @param {number} specificity Only keep configs with this specificity
-     * @returns {Registry} A registry of rules
-     */
-    filterBySpecificity(specificity) {
-        const ruleIds = Object.keys(this.rules),
-            newRegistry = new Registry();
-
-        newRegistry.rules = Object.assign({}, this.rules);
-        ruleIds.forEach(ruleId => {
-            newRegistry.rules[ruleId] = this.rules[ruleId].filter(registryItem => (registryItem.specificity === specificity));
-        });
-
-        return newRegistry;
-    }
-
-    /**
-     * Lint SourceCodes against all configurations in the registry, and record results
-     * @param {Object[]} sourceCodes SourceCode objects for each filename
-     * @param {Object} config ESLint config object
-     * @param {progressCallback} [cb] Optional callback for reporting execution status
-     * @returns {Registry} New registry with errorCount populated
-     */
-    lintSourceCode(sourceCodes, config, cb) {
-        let lintedRegistry = new Registry();
-
-        lintedRegistry.rules = Object.assign({}, this.rules);
-
-        const ruleSets = lintedRegistry.buildRuleSets();
-
-        lintedRegistry = lintedRegistry.stripExtraConfigs();
-
-        debug("Linting with all possible rule combinations");
-
-        const filenames = Object.keys(sourceCodes);
-        const totalFilesLinting = filenames.length * ruleSets.length;
-
-        filenames.forEach(filename => {
-            debug(`Linting file: ${filename}`);
-
-            let ruleSetIdx = 0;
-
-            ruleSets.forEach(ruleSet => {
-                const lintConfig = Object.assign({}, config, { rules: ruleSet });
-                const lintResults = linter.verify(sourceCodes[filename], lintConfig);
-
-                lintResults.forEach(result => {
-
-                    /*
-                     * It is possible that the error is from a configuration comment
-                     * in a linted file, in which case there may not be a config
-                     * set in this ruleSetIdx.
-                     * (https://github.com/eslint/eslint/issues/5992)
-                     * (https://github.com/eslint/eslint/issues/7860)
-                     */
-                    if (
-                        lintedRegistry.rules[result.ruleId] &&
-                        lintedRegistry.rules[result.ruleId][ruleSetIdx]
-                    ) {
-                        lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1;
-                    }
-                });
-
-                ruleSetIdx += 1;
-
-                if (cb) {
-                    cb(totalFilesLinting); // eslint-disable-line node/callback-return -- End of function
-                }
-            });
-
-            // Deallocate for GC
-            sourceCodes[filename] = null;
-        });
-
-        return lintedRegistry;
-    }
-}
-
-/**
- * Extract rule configuration into eslint:recommended where possible.
- *
- * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and
- * only the rules which have configurations different from the recommended config.
- * @param {Object} config config object
- * @returns {Object} config object using `"extends": ["eslint:recommended"]`
- */
-function extendFromRecommended(config) {
-    const newConfig = Object.assign({}, config);
-
-    ConfigOps.normalizeToStrings(newConfig);
-
-    const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId]));
-
-    recRules.forEach(ruleId => {
-        if (equal(recConfig.rules[ruleId], newConfig.rules[ruleId])) {
-            delete newConfig.rules[ruleId];
-        }
-    });
-    newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME);
-    return newConfig;
-}
-
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-module.exports = {
-    Registry,
-    extendFromRecommended
-};
diff --git a/eslint/lib/init/config-file.js b/eslint/lib/init/config-file.js
deleted file mode 100644 (file)
index 9eb10fa..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * @fileoverview Helper to locate and load configuration files.
- * @author Nicholas C. Zakas
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const fs = require("fs"),
-    path = require("path"),
-    stringify = require("json-stable-stringify-without-jsonify");
-
-const debug = require("debug")("eslint:config-file");
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Determines sort order for object keys for json-stable-stringify
- *
- * see: https://github.com/samn/json-stable-stringify#cmp
- * @param {Object} a The first comparison object ({key: akey, value: avalue})
- * @param {Object} b The second comparison object ({key: bkey, value: bvalue})
- * @returns {number} 1 or -1, used in stringify cmp method
- */
-function sortByKey(a, b) {
-    return a.key > b.key ? 1 : -1;
-}
-
-//------------------------------------------------------------------------------
-// Private
-//------------------------------------------------------------------------------
-
-/**
- * Writes a configuration file in JSON format.
- * @param {Object} config The configuration object to write.
- * @param {string} filePath The filename to write to.
- * @returns {void}
- * @private
- */
-function writeJSONConfigFile(config, filePath) {
-    debug(`Writing JSON config file: ${filePath}`);
-
-    const content = `${stringify(config, { cmp: sortByKey, space: 4 })}\n`;
-
-    fs.writeFileSync(filePath, content, "utf8");
-}
-
-/**
- * Writes a configuration file in YAML format.
- * @param {Object} config The configuration object to write.
- * @param {string} filePath The filename to write to.
- * @returns {void}
- * @private
- */
-function writeYAMLConfigFile(config, filePath) {
-    debug(`Writing YAML config file: ${filePath}`);
-
-    // lazy load YAML to improve performance when not used
-    const yaml = require("js-yaml");
-
-    const content = yaml.dump(config, { sortKeys: true });
-
-    fs.writeFileSync(filePath, content, "utf8");
-}
-
-/**
- * Writes a configuration file in JavaScript format.
- * @param {Object} config The configuration object to write.
- * @param {string} filePath The filename to write to.
- * @throws {Error} If an error occurs linting the config file contents.
- * @returns {void}
- * @private
- */
-function writeJSConfigFile(config, filePath) {
-    debug(`Writing JS config file: ${filePath}`);
-
-    let contentToWrite;
-    const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};\n`;
-
-    try {
-        const { CLIEngine } = require("../cli-engine");
-        const linter = new CLIEngine({
-            baseConfig: config,
-            fix: true,
-            useEslintrc: false
-        });
-        const report = linter.executeOnText(stringifiedContent);
-
-        contentToWrite = report.results[0].output || stringifiedContent;
-    } catch (e) {
-        debug("Error linting JavaScript config file, writing unlinted version");
-        const errorMessage = e.message;
-
-        contentToWrite = stringifiedContent;
-        e.message = "An error occurred while generating your JavaScript config file. ";
-        e.message += "A config file was still generated, but the config file itself may not follow your linting rules.";
-        e.message += `\nError: ${errorMessage}`;
-        throw e;
-    } finally {
-        fs.writeFileSync(filePath, contentToWrite, "utf8");
-    }
-}
-
-/**
- * Writes a configuration file.
- * @param {Object} config The configuration object to write.
- * @param {string} filePath The filename to write to.
- * @returns {void}
- * @throws {Error} When an unknown file type is specified.
- * @private
- */
-function write(config, filePath) {
-    switch (path.extname(filePath)) {
-        case ".js":
-        case ".cjs":
-            writeJSConfigFile(config, filePath);
-            break;
-
-        case ".json":
-            writeJSONConfigFile(config, filePath);
-            break;
-
-        case ".yaml":
-        case ".yml":
-            writeYAMLConfigFile(config, filePath);
-            break;
-
-        default:
-            throw new Error("Can't write to unknown file type.");
-    }
-}
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-module.exports = {
-    write
-};
diff --git a/eslint/lib/init/config-initializer.js b/eslint/lib/init/config-initializer.js
deleted file mode 100644 (file)
index 3c244b7..0000000
+++ /dev/null
@@ -1,709 +0,0 @@
-/**
- * @fileoverview Config initialization wizard.
- * @author Ilya Volodin
- */
-
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const util = require("util"),
-    path = require("path"),
-    fs = require("fs"),
-    enquirer = require("enquirer"),
-    ProgressBar = require("progress"),
-    semver = require("semver"),
-    espree = require("espree"),
-    recConfig = require("../../conf/eslint-recommended"),
-    {
-        Legacy: {
-            ConfigOps,
-            naming
-        }
-    } = require("@eslint/eslintrc"),
-    log = require("../shared/logging"),
-    ModuleResolver = require("../shared/relative-module-resolver"),
-    autoconfig = require("./autoconfig.js"),
-    ConfigFile = require("./config-file"),
-    npmUtils = require("./npm-utils"),
-    { getSourceCodeOfFiles } = require("./source-code-utils");
-
-const debug = require("debug")("eslint:config-initializer");
-
-//------------------------------------------------------------------------------
-// Private
-//------------------------------------------------------------------------------
-
-/* istanbul ignore next: hard to test fs function */
-/**
- * Create .eslintrc file in the current working directory
- * @param {Object} config object that contains user's answers
- * @param {string} format The file format to write to.
- * @returns {void}
- */
-function writeFile(config, format) {
-
-    // default is .js
-    let extname = ".js";
-
-    if (format === "YAML") {
-        extname = ".yml";
-    } else if (format === "JSON") {
-        extname = ".json";
-    } else if (format === "JavaScript") {
-        const pkgJSONPath = npmUtils.findPackageJson();
-
-        if (pkgJSONPath) {
-            const pkgJSONContents = JSON.parse(fs.readFileSync(pkgJSONPath, "utf8"));
-
-            if (pkgJSONContents.type === "module") {
-                extname = ".cjs";
-            }
-        }
-    }
-
-    const installedESLint = config.installedESLint;
-
-    delete config.installedESLint;
-
-    ConfigFile.write(config, `./.eslintrc${extname}`);
-    log.info(`Successfully created .eslintrc${extname} file in ${process.cwd()}`);
-
-    if (installedESLint) {
-        log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.");
-    }
-}
-
-/**
- * Get the peer dependencies of the given module.
- * This adds the gotten value to cache at the first time, then reuses it.
- * In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow.
- * @param {string} moduleName The module name to get.
- * @returns {Object} The peer dependencies of the given module.
- * This object is the object of `peerDependencies` field of `package.json`.
- * Returns null if npm was not found.
- */
-function getPeerDependencies(moduleName) {
-    let result = getPeerDependencies.cache.get(moduleName);
-
-    if (!result) {
-        log.info(`Checking peerDependencies of ${moduleName}`);
-
-        result = npmUtils.fetchPeerDependencies(moduleName);
-        getPeerDependencies.cache.set(moduleName, result);
-    }
-
-    return result;
-}
-getPeerDependencies.cache = new Map();
-
-/**
- * Return necessary plugins, configs, parsers, etc. based on the config
- * @param {Object} config config object
- * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint.
- * @returns {string[]} An array of modules to be installed.
- */
-function getModulesList(config, installESLint) {
-    const modules = {};
-
-    // Create a list of modules which should be installed based on config
-    if (config.plugins) {
-        for (const plugin of config.plugins) {
-            const moduleName = naming.normalizePackageName(plugin, "eslint-plugin");
-
-            modules[moduleName] = "latest";
-        }
-    }
-    if (config.extends) {
-        const extendList = Array.isArray(config.extends) ? config.extends : [config.extends];
-
-        for (const extend of extendList) {
-            if (extend.startsWith("eslint:") || extend.startsWith("plugin:")) {
-                continue;
-            }
-            const moduleName = naming.normalizePackageName(extend, "eslint-config");
-
-            modules[moduleName] = "latest";
-            Object.assign(
-                modules,
-                getPeerDependencies(`${moduleName}@latest`)
-            );
-        }
-    }
-
-    const parser = config.parser || (config.parserOptions && config.parserOptions.parser);
-
-    if (parser) {
-        modules[parser] = "latest";
-    }
-
-    if (installESLint === false) {
-        delete modules.eslint;
-    } else {
-        const installStatus = npmUtils.checkDevDeps(["eslint"]);
-
-        // Mark to show messages if it's new installation of eslint.
-        if (installStatus.eslint === false) {
-            log.info("Local ESLint installation not found.");
-            modules.eslint = modules.eslint || "latest";
-            config.installedESLint = true;
-        }
-    }
-
-    return Object.keys(modules).map(name => `${name}@${modules[name]}`);
-}
-
-/**
- * Set the `rules` of a config by examining a user's source code
- *
- * Note: This clones the config object and returns a new config to avoid mutating
- * the original config parameter.
- * @param {Object} answers answers received from enquirer
- * @param {Object} config config object
- * @throws {Error} If source code retrieval fails or source code file count is 0.
- * @returns {Object} config object with configured rules
- */
-function configureRules(answers, config) {
-    const BAR_TOTAL = 20,
-        BAR_SOURCE_CODE_TOTAL = 4,
-        newConfig = Object.assign({}, config),
-        disabledConfigs = {};
-    let sourceCodes,
-        registry;
-
-    // Set up a progress bar, as this process can take a long time
-    const bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", {
-        width: 30,
-        total: BAR_TOTAL
-    });
-
-    bar.tick(0); // Shows the progress bar
-
-    // Get the SourceCode of all chosen files
-    const patterns = answers.patterns.split(/[\s]+/u);
-
-    try {
-        sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, total => {
-            bar.tick((BAR_SOURCE_CODE_TOTAL / total));
-        });
-    } catch (e) {
-        log.info("\n");
-        throw e;
-    }
-    const fileQty = Object.keys(sourceCodes).length;
-
-    if (fileQty === 0) {
-        log.info("\n");
-        throw new Error("Automatic Configuration failed.  No files were able to be parsed.");
-    }
-
-    // Create a registry of rule configs
-    registry = new autoconfig.Registry();
-    registry.populateFromCoreRules();
-
-    // Lint all files with each rule config in the registry
-    registry = registry.lintSourceCode(sourceCodes, newConfig, total => {
-        bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning
-    });
-    debug(`\nRegistry: ${util.inspect(registry.rules, { depth: null })}`);
-
-    // Create a list of recommended rules, because we don't want to disable them
-    const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId]));
-
-    // Find and disable rules which had no error-free configuration
-    const failingRegistry = registry.getFailingRulesRegistry();
-
-    Object.keys(failingRegistry.rules).forEach(ruleId => {
-
-        // If the rule is recommended, set it to error, otherwise disable it
-        disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0;
-    });
-
-    // Now that we know which rules to disable, strip out configs with errors
-    registry = registry.stripFailingConfigs();
-
-    /*
-     * If there is only one config that results in no errors for a rule, we should use it.
-     * createConfig will only add rules that have one configuration in the registry.
-     */
-    const singleConfigs = registry.createConfig().rules;
-
-    /*
-     * The "sweet spot" for number of options in a config seems to be two (severity plus one option).
-     * Very often, a third option (usually an object) is available to address
-     * edge cases, exceptions, or unique situations. We will prefer to use a config with
-     * specificity of two.
-     */
-    const specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules;
-
-    // Maybe a specific combination using all three options works
-    const specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules;
-
-    // If all else fails, try to use the default (severity only)
-    const defaultConfigs = registry.filterBySpecificity(1).createConfig().rules;
-
-    // Combine configs in reverse priority order (later take precedence)
-    newConfig.rules = Object.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs);
-
-    // Make sure progress bar has finished (floating point rounding)
-    bar.update(BAR_TOTAL);
-
-    // Log out some stats to let the user know what happened
-    const finalRuleIds = Object.keys(newConfig.rules);
-    const totalRules = finalRuleIds.length;
-    const enabledRules = finalRuleIds.filter(ruleId => (newConfig.rules[ruleId] !== 0)).length;
-    const resultMessage = [
-        `\nEnabled ${enabledRules} out of ${totalRules}`,
-        `rules based on ${fileQty}`,
-        `file${(fileQty === 1) ? "." : "s."}`
-    ].join(" ");
-
-    log.info(resultMessage);
-
-    ConfigOps.normalizeToStrings(newConfig);
-    return newConfig;
-}
-
-/**
- * process user's answers and create config object
- * @param {Object} answers answers received from enquirer
- * @returns {Object} config object
- */
-function processAnswers(answers) {
-    let config = {
-        rules: {},
-        env: {},
-        parserOptions: {},
-        extends: []
-    };
-
-    config.parserOptions.ecmaVersion = espree.latestEcmaVersion;
-    config.env.es2021 = true;
-
-    // set the module type
-    if (answers.moduleType === "esm") {
-        config.parserOptions.sourceType = "module";
-    } else if (answers.moduleType === "commonjs") {
-        config.env.commonjs = true;
-    }
-
-    // add in browser and node environments if necessary
-    answers.env.forEach(env => {
-        config.env[env] = true;
-    });
-
-    // add in library information
-    if (answers.framework === "react") {
-        config.parserOptions.ecmaFeatures = {
-            jsx: true
-        };
-        config.plugins = ["react"];
-        config.extends.push("plugin:react/recommended");
-    } else if (answers.framework === "vue") {
-        config.plugins = ["vue"];
-        config.extends.push("plugin:vue/essential");
-    }
-
-    if (answers.typescript) {
-        if (answers.framework === "vue") {
-            config.parserOptions.parser = "@typescript-eslint/parser";
-        } else {
-            config.parser = "@typescript-eslint/parser";
-        }
-
-        if (Array.isArray(config.plugins)) {
-            config.plugins.push("@typescript-eslint");
-        } else {
-            config.plugins = ["@typescript-eslint"];
-        }
-    }
-
-    // setup rules based on problems/style enforcement preferences
-    if (answers.purpose === "problems") {
-        config.extends.unshift("eslint:recommended");
-    } else if (answers.purpose === "style") {
-        if (answers.source === "prompt") {
-            config.extends.unshift("eslint:recommended");
-            config.rules.indent = ["error", answers.indent];
-            config.rules.quotes = ["error", answers.quotes];
-            config.rules["linebreak-style"] = ["error", answers.linebreak];
-            config.rules.semi = ["error", answers.semi ? "always" : "never"];
-        } else if (answers.source === "auto") {
-            config = configureRules(answers, config);
-            config = autoconfig.extendFromRecommended(config);
-        }
-    }
-    if (answers.typescript && config.extends.includes("eslint:recommended")) {
-        config.extends.push("plugin:@typescript-eslint/recommended");
-    }
-
-    // normalize extends
-    if (config.extends.length === 0) {
-        delete config.extends;
-    } else if (config.extends.length === 1) {
-        config.extends = config.extends[0];
-    }
-
-    ConfigOps.normalizeToStrings(config);
-    return config;
-}
-
-/**
- * Get the version of the local ESLint.
- * @returns {string|null} The version. If the local ESLint was not found, returns null.
- */
-function getLocalESLintVersion() {
-    try {
-        const eslintPath = ModuleResolver.resolve("eslint", path.join(process.cwd(), "__placeholder__.js"));
-        const eslint = require(eslintPath);
-
-        return eslint.linter.version || null;
-    } catch {
-        return null;
-    }
-}
-
-/**
- * Get the shareable config name of the chosen style guide.
- * @param {Object} answers The answers object.
- * @returns {string} The shareable config name.
- */
-function getStyleGuideName(answers) {
-    if (answers.styleguide === "airbnb" && answers.framework !== "react") {
-        return "airbnb-base";
-    }
-    return answers.styleguide;
-}
-
-/**
- * Check whether the local ESLint version conflicts with the required version of the chosen shareable config.
- * @param {Object} answers The answers object.
- * @returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config.
- */
-function hasESLintVersionConflict(answers) {
-
-    // Get the local ESLint version.
-    const localESLintVersion = getLocalESLintVersion();
-
-    if (!localESLintVersion) {
-        return false;
-    }
-
-    // Get the required range of ESLint version.
-    const configName = getStyleGuideName(answers);
-    const moduleName = `eslint-config-${configName}@latest`;
-    const peerDependencies = getPeerDependencies(moduleName) || {};
-    const requiredESLintVersionRange = peerDependencies.eslint;
-
-    if (!requiredESLintVersionRange) {
-        return false;
-    }
-
-    answers.localESLintVersion = localESLintVersion;
-    answers.requiredESLintVersionRange = requiredESLintVersionRange;
-
-    // Check the version.
-    if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) {
-        answers.installESLint = false;
-        return false;
-    }
-
-    return true;
-}
-
-/**
- * Install modules.
- * @param {string[]} modules Modules to be installed.
- * @returns {void}
- */
-function installModules(modules) {
-    log.info(`Installing ${modules.join(", ")}`);
-    npmUtils.installSyncSaveDev(modules);
-}
-
-/* istanbul ignore next: no need to test enquirer */
-/**
- * Ask user to install modules.
- * @param {string[]} modules Array of modules to be installed.
- * @param {boolean} packageJsonExists Indicates if package.json is existed.
- * @returns {Promise<void>} Answer that indicates if user wants to install.
- */
-function askInstallModules(modules, packageJsonExists) {
-
-    // If no modules, do nothing.
-    if (modules.length === 0) {
-        return Promise.resolve();
-    }
-
-    log.info("The config that you've selected requires the following dependencies:\n");
-    log.info(modules.join(" "));
-    return enquirer.prompt([
-        {
-            type: "toggle",
-            name: "executeInstallation",
-            message: "Would you like to install them now with npm?",
-            enabled: "Yes",
-            disabled: "No",
-            initial: 1,
-            skip() {
-                return !(modules.length && packageJsonExists);
-            },
-            result(input) {
-                return this.skipped ? null : input;
-            }
-        }
-    ]).then(({ executeInstallation }) => {
-        if (executeInstallation) {
-            installModules(modules);
-        }
-    });
-}
-
-/* istanbul ignore next: no need to test enquirer */
-/**
- * Ask use a few questions on command prompt
- * @returns {Promise<void>} The promise with the result of the prompt
- */
-function promptUser() {
-
-    return enquirer.prompt([
-        {
-            type: "select",
-            name: "purpose",
-            message: "How would you like to use ESLint?",
-
-            // The returned number matches the name value of nth in the choices array.
-            initial: 1,
-            choices: [
-                { message: "To check syntax only", name: "syntax" },
-                { message: "To check syntax and find problems", name: "problems" },
-                { message: "To check syntax, find problems, and enforce code style", name: "style" }
-            ]
-        },
-        {
-            type: "select",
-            name: "moduleType",
-            message: "What type of modules does your project use?",
-            initial: 0,
-            choices: [
-                { message: "JavaScript modules (import/export)", name: "esm" },
-                { message: "CommonJS (require/exports)", name: "commonjs" },
-                { message: "None of these", name: "none" }
-            ]
-        },
-        {
-            type: "select",
-            name: "framework",
-            message: "Which framework does your project use?",
-            initial: 0,
-            choices: [
-                { message: "React", name: "react" },
-                { message: "Vue.js", name: "vue" },
-                { message: "None of these", name: "none" }
-            ]
-        },
-        {
-            type: "toggle",
-            name: "typescript",
-            message: "Does your project use TypeScript?",
-            enabled: "Yes",
-            disabled: "No",
-            initial: 0
-        },
-        {
-            type: "multiselect",
-            name: "env",
-            message: "Where does your code run?",
-            hint: "(Press <space> to select, <a> to toggle all, <i> to invert selection)",
-            initial: 0,
-            choices: [
-                { message: "Browser", name: "browser" },
-                { message: "Node", name: "node" }
-            ]
-        },
-        {
-            type: "select",
-            name: "source",
-            message: "How would you like to define a style for your project?",
-            choices: [
-                { message: "Use a popular style guide", name: "guide" },
-                { message: "Answer questions about your style", name: "prompt" },
-                { message: "Inspect your JavaScript file(s)", name: "auto" }
-            ],
-            skip() {
-                return this.state.answers.purpose !== "style";
-            },
-            result(input) {
-                return this.skipped ? null : input;
-            }
-        },
-        {
-            type: "select",
-            name: "styleguide",
-            message: "Which style guide do you want to follow?",
-            choices: [
-                { message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" },
-                { message: "Standard: https://github.com/standard/standard", name: "standard" },
-                { message: "Google: https://github.com/google/eslint-config-google", name: "google" },
-                { message: "XO: https://github.com/xojs/eslint-config-xo", name: "xo" }
-            ],
-            skip() {
-                this.state.answers.packageJsonExists = npmUtils.checkPackageJson();
-                return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists);
-            },
-            result(input) {
-                return this.skipped ? null : input;
-            }
-        },
-        {
-            type: "input",
-            name: "patterns",
-            message: "Which file(s), path(s), or glob(s) should be examined?",
-            skip() {
-                return this.state.answers.source !== "auto";
-            },
-            validate(input) {
-                if (!this.skipped && input.trim().length === 0 && input.trim() !== ",") {
-                    return "You must tell us what code to examine. Try again.";
-                }
-                return true;
-            }
-        },
-        {
-            type: "select",
-            name: "format",
-            message: "What format do you want your config file to be in?",
-            initial: 0,
-            choices: ["JavaScript", "YAML", "JSON"]
-        },
-        {
-            type: "toggle",
-            name: "installESLint",
-            message() {
-                const { answers } = this.state;
-                const verb = semver.ltr(answers.localESLintVersion, answers.requiredESLintVersionRange)
-                    ? "upgrade"
-                    : "downgrade";
-
-                return `The style guide "${answers.styleguide}" requires eslint@${answers.requiredESLintVersionRange}. You are currently using eslint@${answers.localESLintVersion}.\n  Do you want to ${verb}?`;
-            },
-            enabled: "Yes",
-            disabled: "No",
-            initial: 1,
-            skip() {
-                return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists && hasESLintVersionConflict(this.state.answers));
-            },
-            result(input) {
-                return this.skipped ? null : input;
-            }
-        }
-    ]).then(earlyAnswers => {
-
-        // early exit if no style guide is necessary
-        if (earlyAnswers.purpose !== "style") {
-            const config = processAnswers(earlyAnswers);
-            const modules = getModulesList(config);
-
-            return askInstallModules(modules, earlyAnswers.packageJsonExists)
-                .then(() => writeFile(config, earlyAnswers.format));
-        }
-
-        // early exit if you are using a style guide
-        if (earlyAnswers.source === "guide") {
-            if (!earlyAnswers.packageJsonExists) {
-                log.info("A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again.");
-                return void 0;
-            }
-            if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) {
-                log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`);
-            }
-            if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") {
-                earlyAnswers.styleguide = "airbnb-base";
-            }
-
-            const config = processAnswers(earlyAnswers);
-
-            if (Array.isArray(config.extends)) {
-                config.extends.push(earlyAnswers.styleguide);
-            } else if (config.extends) {
-                config.extends = [config.extends, earlyAnswers.styleguide];
-            } else {
-                config.extends = [earlyAnswers.styleguide];
-            }
-
-            const modules = getModulesList(config);
-
-            return askInstallModules(modules, earlyAnswers.packageJsonExists)
-                .then(() => writeFile(config, earlyAnswers.format));
-
-        }
-
-        if (earlyAnswers.source === "auto") {
-            const combinedAnswers = Object.assign({}, earlyAnswers);
-            const config = processAnswers(combinedAnswers);
-            const modules = getModulesList(config);
-
-            return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format));
-        }
-
-        // continue with the style questions otherwise...
-        return enquirer.prompt([
-            {
-                type: "select",
-                name: "indent",
-                message: "What style of indentation do you use?",
-                initial: 0,
-                choices: [{ message: "Tabs", name: "tab" }, { message: "Spaces", name: 4 }]
-            },
-            {
-                type: "select",
-                name: "quotes",
-                message: "What quotes do you use for strings?",
-                initial: 0,
-                choices: [{ message: "Double", name: "double" }, { message: "Single", name: "single" }]
-            },
-            {
-                type: "select",
-                name: "linebreak",
-                message: "What line endings do you use?",
-                initial: 0,
-                choices: [{ message: "Unix", name: "unix" }, { message: "Windows", name: "windows" }]
-            },
-            {
-                type: "toggle",
-                name: "semi",
-                message: "Do you require semicolons?",
-                enabled: "Yes",
-                disabled: "No",
-                initial: 1
-            }
-        ]).then(answers => {
-            const totalAnswers = Object.assign({}, earlyAnswers, answers);
-
-            const config = processAnswers(totalAnswers);
-            const modules = getModulesList(config);
-
-            return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format));
-        });
-    });
-}
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-const init = {
-    getModulesList,
-    hasESLintVersionConflict,
-    installModules,
-    processAnswers,
-    writeFile,
-    /* istanbul ignore next */initializeConfig() {
-        return promptUser();
-    }
-};
-
-module.exports = init;
diff --git a/eslint/lib/init/config-rule.js b/eslint/lib/init/config-rule.js
deleted file mode 100644 (file)
index 131e84a..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-/**
- * @fileoverview Create configurations for a rule
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const builtInRules = require("../rules");
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Wrap all of the elements of an array into arrays.
- * @param {*[]} xs Any array.
- * @returns {Array[]} An array of arrays.
- */
-function explodeArray(xs) {
-    return xs.reduce((accumulator, x) => {
-        accumulator.push([x]);
-        return accumulator;
-    }, []);
-}
-
-/**
- * Mix two arrays such that each element of the second array is concatenated
- * onto each element of the first array.
- *
- * For example:
- * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]]
- * @param {Array} arr1 The first array to combine.
- * @param {Array} arr2 The second array to combine.
- * @returns {Array} A mixture of the elements of the first and second arrays.
- */
-function combineArrays(arr1, arr2) {
-    const res = [];
-
-    if (arr1.length === 0) {
-        return explodeArray(arr2);
-    }
-    if (arr2.length === 0) {
-        return explodeArray(arr1);
-    }
-    arr1.forEach(x1 => {
-        arr2.forEach(x2 => {
-            res.push([].concat(x1, x2));
-        });
-    });
-    return res;
-}
-
-/**
- * Group together valid rule configurations based on object properties
- *
- * e.g.:
- * groupByProperty([
- *     {before: true},
- *     {before: false},
- *     {after: true},
- *     {after: false}
- * ]);
- *
- * will return:
- * [
- *     [{before: true}, {before: false}],
- *     [{after: true}, {after: false}]
- * ]
- * @param {Object[]} objects Array of objects, each with one property/value pair
- * @returns {Array[]} Array of arrays of objects grouped by property
- */
-function groupByProperty(objects) {
-    const groupedObj = objects.reduce((accumulator, obj) => {
-        const prop = Object.keys(obj)[0];
-
-        accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj];
-        return accumulator;
-    }, {});
-
-    return Object.keys(groupedObj).map(prop => groupedObj[prop]);
-}
-
-
-//------------------------------------------------------------------------------
-// Private
-//------------------------------------------------------------------------------
-
-/**
- * Configuration settings for a rule.
- *
- * A configuration can be a single number (severity), or an array where the first
- * element in the array is the severity, and is the only required element.
- * Configs may also have one or more additional elements to specify rule
- * configuration or options.
- * @typedef {Array|number} ruleConfig
- * @param {number} 0 The rule's severity (0, 1, 2).
- */
-
-/**
- * Object whose keys are rule names and values are arrays of valid ruleConfig items
- * which should be linted against the target source code to determine error counts.
- * (a ruleConfigSet.ruleConfigs).
- *
- * e.g. rulesConfig = {
- *     "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]],
- *     "no-console": [2]
- * }
- * @typedef rulesConfig
- */
-
-
-/**
- * Create valid rule configurations by combining two arrays,
- * with each array containing multiple objects each with a
- * single property/value pair and matching properties.
- *
- * e.g.:
- * combinePropertyObjects(
- *     [{before: true}, {before: false}],
- *     [{after: true}, {after: false}]
- * );
- *
- * will return:
- * [
- *     {before: true, after: true},
- *     {before: true, after: false},
- *     {before: false, after: true},
- *     {before: false, after: false}
- * ]
- * @param {Object[]} objArr1 Single key/value objects, all with the same key
- * @param {Object[]} objArr2 Single key/value objects, all with another key
- * @returns {Object[]} Combined objects for each combination of input properties and values
- */
-function combinePropertyObjects(objArr1, objArr2) {
-    const res = [];
-
-    if (objArr1.length === 0) {
-        return objArr2;
-    }
-    if (objArr2.length === 0) {
-        return objArr1;
-    }
-    objArr1.forEach(obj1 => {
-        objArr2.forEach(obj2 => {
-            const combinedObj = {};
-            const obj1Props = Object.keys(obj1);
-            const obj2Props = Object.keys(obj2);
-
-            obj1Props.forEach(prop1 => {
-                combinedObj[prop1] = obj1[prop1];
-            });
-            obj2Props.forEach(prop2 => {
-                combinedObj[prop2] = obj2[prop2];
-            });
-            res.push(combinedObj);
-        });
-    });
-    return res;
-}
-
-/**
- * Creates a new instance of a rule configuration set
- *
- * A rule configuration set is an array of configurations that are valid for a
- * given rule.  For example, the configuration set for the "semi" rule could be:
- *
- * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]]
- *
- * Rule configuration set class
- */
-class RuleConfigSet {
-
-    /**
-     * @param {ruleConfig[]} configs Valid rule configurations
-     */
-    constructor(configs) {
-
-        /**
-         * Stored valid rule configurations for this instance
-         * @type {Array}
-         */
-        this.ruleConfigs = configs || [];
-    }
-
-    /**
-     * Add a severity level to the front of all configs in the instance.
-     * This should only be called after all configs have been added to the instance.
-     * @returns {void}
-     */
-    addErrorSeverity() {
-        const severity = 2;
-
-        this.ruleConfigs = this.ruleConfigs.map(config => {
-            config.unshift(severity);
-            return config;
-        });
-
-        // Add a single config at the beginning consisting of only the severity
-        this.ruleConfigs.unshift(severity);
-    }
-
-    /**
-     * Add rule configs from an array of strings (schema enums)
-     * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"])
-     * @returns {void}
-     */
-    addEnums(enums) {
-        this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums));
-    }
-
-    /**
-     * Add rule configurations from a schema object
-     * @param {Object} obj Schema item with type === "object"
-     * @returns {boolean} true if at least one schema for the object could be generated, false otherwise
-     */
-    addObject(obj) {
-        const objectConfigSet = {
-            objectConfigs: [],
-            add(property, values) {
-                for (let idx = 0; idx < values.length; idx++) {
-                    const optionObj = {};
-
-                    optionObj[property] = values[idx];
-                    this.objectConfigs.push(optionObj);
-                }
-            },
-
-            combine() {
-                this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []);
-            }
-        };
-
-        /*
-         * The object schema could have multiple independent properties.
-         * If any contain enums or booleans, they can be added and then combined
-         */
-        Object.keys(obj.properties).forEach(prop => {
-            if (obj.properties[prop].enum) {
-                objectConfigSet.add(prop, obj.properties[prop].enum);
-            }
-            if (obj.properties[prop].type && obj.properties[prop].type === "boolean") {
-                objectConfigSet.add(prop, [true, false]);
-            }
-        });
-        objectConfigSet.combine();
-
-        if (objectConfigSet.objectConfigs.length > 0) {
-            this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs));
-            return true;
-        }
-
-        return false;
-    }
-}
-
-/**
- * Generate valid rule configurations based on a schema object
- * @param {Object} schema A rule's schema object
- * @returns {Array[]} Valid rule configurations
- */
-function generateConfigsFromSchema(schema) {
-    const configSet = new RuleConfigSet();
-
-    if (Array.isArray(schema)) {
-        for (const opt of schema) {
-            if (opt.enum) {
-                configSet.addEnums(opt.enum);
-            } else if (opt.type && opt.type === "object") {
-                if (!configSet.addObject(opt)) {
-                    break;
-                }
-
-            // TODO (IanVS): support oneOf
-            } else {
-
-                // If we don't know how to fill in this option, don't fill in any of the following options.
-                break;
-            }
-        }
-    }
-    configSet.addErrorSeverity();
-    return configSet.ruleConfigs;
-}
-
-/**
- * Generate possible rule configurations for all of the core rules
- * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not.
- * @returns {rulesConfig} Hash of rule names and arrays of possible configurations
- */
-function createCoreRuleConfigs(noDeprecated = false) {
-    return Array.from(builtInRules).reduce((accumulator, [id, rule]) => {
-        const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema;
-        const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated;
-
-        if (noDeprecated && isDeprecated) {
-            return accumulator;
-        }
-
-        accumulator[id] = generateConfigsFromSchema(schema);
-        return accumulator;
-    }, {});
-}
-
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-module.exports = {
-    generateConfigsFromSchema,
-    createCoreRuleConfigs
-};
diff --git a/eslint/lib/init/npm-utils.js b/eslint/lib/init/npm-utils.js
deleted file mode 100644 (file)
index 4a8efe9..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * @fileoverview Utility for executing npm commands.
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const fs = require("fs"),
-    spawn = require("cross-spawn"),
-    path = require("path"),
-    log = require("../shared/logging");
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Find the closest package.json file, starting at process.cwd (by default),
- * and working up to root.
- * @param {string} [startDir=process.cwd()] Starting directory
- * @returns {string} Absolute path to closest package.json file
- */
-function findPackageJson(startDir) {
-    let dir = path.resolve(startDir || process.cwd());
-
-    do {
-        const pkgFile = path.join(dir, "package.json");
-
-        if (!fs.existsSync(pkgFile) || !fs.statSync(pkgFile).isFile()) {
-            dir = path.join(dir, "..");
-            continue;
-        }
-        return pkgFile;
-    } while (dir !== path.resolve(dir, ".."));
-    return null;
-}
-
-//------------------------------------------------------------------------------
-// Private
-//------------------------------------------------------------------------------
-
-/**
- * Install node modules synchronously and save to devDependencies in package.json
- * @param {string|string[]} packages Node module or modules to install
- * @returns {void}
- */
-function installSyncSaveDev(packages) {
-    const packageList = Array.isArray(packages) ? packages : [packages];
-    const npmProcess = spawn.sync("npm", ["i", "--save-dev"].concat(packageList), { stdio: "inherit" });
-    const error = npmProcess.error;
-
-    if (error && error.code === "ENOENT") {
-        const pluralS = packageList.length > 1 ? "s" : "";
-
-        log.error(`Could not execute npm. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`);
-    }
-}
-
-/**
- * Fetch `peerDependencies` of the given package by `npm show` command.
- * @param {string} packageName The package name to fetch peerDependencies.
- * @returns {Object} Gotten peerDependencies. Returns null if npm was not found.
- */
-function fetchPeerDependencies(packageName) {
-    const npmProcess = spawn.sync(
-        "npm",
-        ["show", "--json", packageName, "peerDependencies"],
-        { encoding: "utf8" }
-    );
-
-    const error = npmProcess.error;
-
-    if (error && error.code === "ENOENT") {
-        return null;
-    }
-    const fetchedText = npmProcess.stdout.trim();
-
-    return JSON.parse(fetchedText || "{}");
-
-
-}
-
-/**
- * Check whether node modules are include in a project's package.json.
- * @param {string[]} packages Array of node module names
- * @param {Object} opt Options Object
- * @param {boolean} opt.dependencies Set to true to check for direct dependencies
- * @param {boolean} opt.devDependencies Set to true to check for development dependencies
- * @param {boolean} opt.startdir Directory to begin searching from
- * @throws {Error} If cannot find valid `package.json` file.
- * @returns {Object} An object whose keys are the module names
- *                                        and values are booleans indicating installation.
- */
-function check(packages, opt) {
-    const deps = new Set();
-    const pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson();
-    let fileJson;
-
-    if (!pkgJson) {
-        throw new Error("Could not find a package.json file. Run 'npm init' to create one.");
-    }
-
-    try {
-        fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8"));
-    } catch (e) {
-        const error = new Error(e);
-
-        error.messageTemplate = "failed-to-read-json";
-        error.messageData = {
-            path: pkgJson,
-            message: e.message
-        };
-        throw error;
-    }
-
-    ["dependencies", "devDependencies"].forEach(key => {
-        if (opt[key] && typeof fileJson[key] === "object") {
-            Object.keys(fileJson[key]).forEach(dep => deps.add(dep));
-        }
-    });
-
-    return packages.reduce((status, pkg) => {
-        status[pkg] = deps.has(pkg);
-        return status;
-    }, {});
-}
-
-/**
- * Check whether node modules are included in the dependencies of a project's
- * package.json.
- *
- * Convenience wrapper around check().
- * @param {string[]} packages Array of node modules to check.
- * @param {string} rootDir The directory containing a package.json
- * @returns {Object} An object whose keys are the module names
- *                               and values are booleans indicating installation.
- */
-function checkDeps(packages, rootDir) {
-    return check(packages, { dependencies: true, startDir: rootDir });
-}
-
-/**
- * Check whether node modules are included in the devDependencies of a project's
- * package.json.
- *
- * Convenience wrapper around check().
- * @param {string[]} packages Array of node modules to check.
- * @returns {Object} An object whose keys are the module names
- *                               and values are booleans indicating installation.
- */
-function checkDevDeps(packages) {
-    return check(packages, { devDependencies: true });
-}
-
-/**
- * Check whether package.json is found in current path.
- * @param {string} [startDir] Starting directory
- * @returns {boolean} Whether a package.json is found in current path.
- */
-function checkPackageJson(startDir) {
-    return !!findPackageJson(startDir);
-}
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-module.exports = {
-    installSyncSaveDev,
-    fetchPeerDependencies,
-    findPackageJson,
-    checkDeps,
-    checkDevDeps,
-    checkPackageJson
-};
diff --git a/eslint/lib/init/source-code-utils.js b/eslint/lib/init/source-code-utils.js
deleted file mode 100644 (file)
index 08c20e5..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * @fileoverview Tools for obtaining SourceCode objects.
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const { CLIEngine } = require("../cli-engine");
-
-/*
- * This is used for:
- *
- * 1. Enumerate target file because we have not expose such a API on `CLIEngine`
- *    (https://github.com/eslint/eslint/issues/11222).
- * 2. Create `SourceCode` instances. Because we don't have any function which
- *    instantiate `SourceCode` so it needs to take the created `SourceCode`
- *    instance out after linting.
- *
- * TODO1: Expose the API that enumerates target files.
- * TODO2: Extract the creation logic of `SourceCode` from `Linter` class.
- */
-const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require -- Todo
-
-const debug = require("debug")("eslint:source-code-utils");
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Get the SourceCode object for a single file
- * @param {string} filename The fully resolved filename to get SourceCode from.
- * @param {Object} engine A CLIEngine.
- * @throws {Error} Upon fatal errors from execution.
- * @returns {Array} Array of the SourceCode object representing the file
- *                                and fatal error message.
- */
-function getSourceCodeOfFile(filename, engine) {
-    debug("getting sourceCode of", filename);
-    const results = engine.executeOnFiles([filename]);
-
-    if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) {
-        const msg = results.results[0].messages[0];
-
-        throw new Error(`(${filename}:${msg.line}:${msg.column}) ${msg.message}`);
-    }
-
-    // TODO: extract the logic that creates source code objects to `SourceCode#parse(text, options)` or something like.
-    const { linter } = getCLIEngineInternalSlots(engine);
-    const sourceCode = linter.getSourceCode();
-
-    return sourceCode;
-}
-
-//------------------------------------------------------------------------------
-// Public Interface
-//------------------------------------------------------------------------------
-
-
-/**
- * This callback is used to measure execution status in a progress bar
- * @callback progressCallback
- * @param {number} The total number of times the callback will be called.
- */
-
-/**
- * Gets the SourceCode of a single file, or set of files.
- * @param {string[]|string} patterns A filename, directory name, or glob, or an array of them
- * @param {Object} options A CLIEngine options object. If not provided, the default cli options will be used.
- * @param {progressCallback} callback Callback for reporting execution status
- * @returns {Object} The SourceCode of all processed files.
- */
-function getSourceCodeOfFiles(patterns, options, callback) {
-    const sourceCodes = {};
-    const globPatternsList = typeof patterns === "string" ? [patterns] : patterns;
-    const engine = new CLIEngine({ ...options, rules: {} });
-
-    // TODO: make file iteration as a public API and use it.
-    const { fileEnumerator } = getCLIEngineInternalSlots(engine);
-    const filenames =
-        Array.from(fileEnumerator.iterateFiles(globPatternsList))
-            .filter(entry => !entry.ignored)
-            .map(entry => entry.filePath);
-
-    if (filenames.length === 0) {
-        debug(`Did not find any files matching pattern(s): ${globPatternsList}`);
-    }
-
-    filenames.forEach(filename => {
-        const sourceCode = getSourceCodeOfFile(filename, engine);
-
-        if (sourceCode) {
-            debug("got sourceCode of", filename);
-            sourceCodes[filename] = sourceCode;
-        }
-        if (callback) {
-            callback(filenames.length); // eslint-disable-line node/callback-return -- End of function
-        }
-    });
-
-    return sourceCodes;
-}
-
-module.exports = {
-    getSourceCodeOfFiles
-};
index e5f2e528ef86ea9f77d8c1292cb30510c4d76994..459c859119656150ad3fe4b2baed817fee154460 100644 (file)
@@ -43,7 +43,7 @@ function groupByParentComment(directives) {
  * Creates removal details for a set of directives within the same comment.
  * @param {Directive[]} directives Unused directives to be removed.
  * @param {Token} commentToken The backing Comment token.
- * @returns {{ description, fix, position }[]} Details for later creation of output Problems.
+ * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
  */
 function createIndividualDirectivesRemoval(directives, commentToken) {
 
@@ -66,7 +66,7 @@ function createIndividualDirectivesRemoval(directives, commentToken) {
     const listText = commentToken.value
         .slice(listStartOffset) // remove directive name and all whitespace before the list
         .split(/\s-{2,}\s/u)[0] // remove `-- comment`, if it exists
-        .trimRight(); // remove all whitespace after the list
+        .trimEnd(); // remove all whitespace after the list
 
     /*
      * We can assume that `listText` contains multiple elements.
@@ -138,7 +138,7 @@ function createIndividualDirectivesRemoval(directives, commentToken) {
                 ],
                 text: ""
             },
-            position: directive.unprocessedDirective
+            unprocessedDirective: directive.unprocessedDirective
         };
     });
 }
@@ -147,7 +147,7 @@ function createIndividualDirectivesRemoval(directives, commentToken) {
  * Creates a description of deleting an entire unused disable comment.
  * @param {Directive[]} directives Unused directives to be removed.
  * @param {Token} commentToken The backing Comment token.
- * @returns {{ description, fix, position }} Details for later creation of an output Problem.
+ * @returns {{ description, fix, unprocessedDirective }} Details for later creation of an output Problem.
  */
 function createCommentRemoval(directives, commentToken) {
     const { range } = commentToken;
@@ -161,14 +161,14 @@ function createCommentRemoval(directives, commentToken) {
             range,
             text: " "
         },
-        position: directives[0].unprocessedDirective
+        unprocessedDirective: directives[0].unprocessedDirective
     };
 }
 
 /**
  * Parses details from directives to create output Problems.
  * @param {Directive[]} allDirectives Unused directives to be removed.
- * @returns {{ description, fix, position }[]} Details for later creation of output Problems.
+ * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
  */
 function processUnusedDisableDirectives(allDirectives) {
     const directiveGroups = groupByParentComment(allDirectives);
@@ -197,62 +197,52 @@ function processUnusedDisableDirectives(allDirectives) {
  * for the exported function, except that `reportUnusedDisableDirectives` is not supported
  * (this function always reports unused disable directives).
  * @returns {{problems: Problem[], unusedDisableDirectives: Problem[]}} An object with a list
- * of filtered problems and unused eslint-disable directives
+ * of problems (including suppressed ones) and unused eslint-disable directives
  */
 function applyDirectives(options) {
     const problems = [];
-    let nextDirectiveIndex = 0;
-    let currentGlobalDisableDirective = null;
-    const disabledRuleMap = new Map();
-
-    // enabledRules is only used when there is a current global disable directive.
-    const enabledRules = new Set();
     const usedDisableDirectives = new Set();
 
     for (const problem of options.problems) {
+        let disableDirectivesForProblem = [];
+        let nextDirectiveIndex = 0;
+
         while (
             nextDirectiveIndex < options.directives.length &&
             compareLocations(options.directives[nextDirectiveIndex], problem) <= 0
         ) {
             const directive = options.directives[nextDirectiveIndex++];
 
-            switch (directive.type) {
-                case "disable":
-                    if (directive.ruleId === null) {
-                        currentGlobalDisableDirective = directive;
-                        disabledRuleMap.clear();
-                        enabledRules.clear();
-                    } else if (currentGlobalDisableDirective) {
-                        enabledRules.delete(directive.ruleId);
-                        disabledRuleMap.set(directive.ruleId, directive);
-                    } else {
-                        disabledRuleMap.set(directive.ruleId, directive);
-                    }
-                    break;
-
-                case "enable":
-                    if (directive.ruleId === null) {
-                        currentGlobalDisableDirective = null;
-                        disabledRuleMap.clear();
-                    } else if (currentGlobalDisableDirective) {
-                        enabledRules.add(directive.ruleId);
-                        disabledRuleMap.delete(directive.ruleId);
-                    } else {
-                        disabledRuleMap.delete(directive.ruleId);
-                    }
-                    break;
-
-                // no default
+            if (directive.ruleId === null || directive.ruleId === problem.ruleId) {
+                switch (directive.type) {
+                    case "disable":
+                        disableDirectivesForProblem.push(directive);
+                        break;
+
+                    case "enable":
+                        disableDirectivesForProblem = [];
+                        break;
+
+                    // no default
+                }
             }
         }
 
-        if (disabledRuleMap.has(problem.ruleId)) {
-            usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId));
-        } else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) {
-            usedDisableDirectives.add(currentGlobalDisableDirective);
-        } else {
-            problems.push(problem);
+        if (disableDirectivesForProblem.length > 0) {
+            const suppressions = disableDirectivesForProblem.map(directive => ({
+                kind: "directive",
+                justification: directive.unprocessedDirective.justification
+            }));
+
+            if (problem.suppressions) {
+                problem.suppressions = problem.suppressions.concat(suppressions);
+            } else {
+                problem.suppressions = suppressions;
+                usedDisableDirectives.add(disableDirectivesForProblem[disableDirectivesForProblem.length - 1]);
+            }
         }
+
+        problems.push(problem);
     }
 
     const unusedDisableDirectivesToReport = options.directives
@@ -261,30 +251,35 @@ function applyDirectives(options) {
     const processed = processUnusedDisableDirectives(unusedDisableDirectivesToReport);
 
     const unusedDisableDirectives = processed
-        .map(({ description, fix, position }) => ({
-            ruleId: null,
-            message: description
-                ? `Unused eslint-disable directive (no problems were reported from ${description}).`
-                : "Unused eslint-disable directive (no problems were reported).",
-            line: position.line,
-            column: position.column,
-            severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
-            nodeType: null,
-            ...options.disableFixes ? {} : { fix }
-        }));
+        .map(({ description, fix, unprocessedDirective }) => {
+            const { parentComment, type, line, column } = unprocessedDirective;
+
+            return {
+                ruleId: null,
+                message: description
+                    ? `Unused eslint-disable directive (no problems were reported from ${description}).`
+                    : "Unused eslint-disable directive (no problems were reported).",
+                line: type === "disable-next-line" ? parentComment.commentToken.loc.start.line : line,
+                column: type === "disable-next-line" ? parentComment.commentToken.loc.start.column + 1 : column,
+                severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
+                nodeType: null,
+                ...options.disableFixes ? {} : { fix }
+            };
+        });
 
     return { problems, unusedDisableDirectives };
 }
 
 /**
  * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list
- * of reported problems, determines which problems should be reported.
+ * of reported problems, adds the suppression information to the problems.
  * @param {Object} options Information about directives and problems
  * @param {{
  *      type: ("disable"|"enable"|"disable-line"|"disable-next-line"),
  *      ruleId: (string|null),
  *      line: number,
- *      column: number
+ *      column: number,
+ *      justification: string
  * }} options.directives Directive comments found in the file, with one-based columns.
  * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable
  * comment for two different rules is represented as two directives).
@@ -292,8 +287,8 @@ function applyDirectives(options) {
  * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns.
  * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives
  * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties.
- * @returns {{ruleId: (string|null), line: number, column: number}[]}
- * A list of reported problems that were not disabled by the directive comments.
+ * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]}
+ * An object with a list of reported problems, the suppressed of which contain the suppression information.
  */
 module.exports = ({ directives, disableFixes, problems, reportUnusedDisableDirectives = "off" }) => {
     const blockDirectives = directives
index fad559a2ad23e1fcc52775cd8124c995051ac807..fd2726a9937a75feb1bb060cc27f0c4f1049b14e 100644 (file)
@@ -88,10 +88,10 @@ class CodePathSegment {
             }
         });
 
-        /* istanbul ignore if */
+        /* c8 ignore start */
         if (debug.enabled) {
             this.internal.nodes = [];
-        }
+        }/* c8 ignore stop */
     }
 
     /**
@@ -100,7 +100,7 @@ class CodePathSegment {
      * @returns {boolean} `true` if the segment is coming from the end of a loop.
      */
     isLoopedPrevSegment(segment) {
-        return this.internal.loopedPrevSegments.indexOf(segment) !== -1;
+        return this.internal.loopedPrevSegments.includes(segment);
     }
 
     /**
index 118f70a170756bf42cd881b7bb1f957e346dd4a9..d187297d32b0d3a10d5491efea474d618fe20fe8 100644 (file)
@@ -33,7 +33,7 @@ function addToReturnedOrThrown(dest, others, all, segments) {
         const segment = segments[i];
 
         dest.push(segment);
-        if (others.indexOf(segment) === -1) {
+        if (!others.includes(segment)) {
             all.push(segment);
         }
     }
@@ -59,7 +59,7 @@ function getContinueContext(state, label) {
         context = context.upper;
     }
 
-    /* istanbul ignore next: foolproof (syntax error) */
+    /* c8 ignore next */
     return null;
 }
 
@@ -79,7 +79,7 @@ function getBreakContext(state, label) {
         context = context.upper;
     }
 
-    /* istanbul ignore next: foolproof (syntax error) */
+    /* c8 ignore next */
     return null;
 }
 
@@ -433,7 +433,7 @@ class CodePathState {
                  */
                 return context;
 
-            /* istanbul ignore next */
+            /* c8 ignore next */
             default:
                 throw new Error("unreachable");
         }
@@ -1030,7 +1030,7 @@ class CodePathState {
                 };
                 break;
 
-            /* istanbul ignore next */
+            /* c8 ignore next */
             default:
                 throw new Error(`unknown type: "${type}"`);
         }
@@ -1095,7 +1095,7 @@ class CodePathState {
                 );
                 break;
 
-            /* istanbul ignore next */
+            /* c8 ignore next */
             default:
                 throw new Error("unreachable");
         }
@@ -1392,11 +1392,12 @@ class CodePathState {
 
         const context = getBreakContext(this, label);
 
-        /* istanbul ignore else: foolproof (syntax error) */
+
         if (context) {
             context.brokenForkContext.add(forkContext.head);
         }
 
+        /* c8 ignore next */
         forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
     }
 
@@ -1417,7 +1418,6 @@ class CodePathState {
 
         const context = getContinueContext(this, label);
 
-        /* istanbul ignore else: foolproof (syntax error) */
         if (context) {
             if (context.continueDestSegments) {
                 makeLooped(this, forkContext.head, context.continueDestSegments);
index 0e666277094355801feda17e4f6cfe5b15d048fc..a028ca69481c09a71c2a8e86a3a99315a9ff08bf 100644 (file)
@@ -212,7 +212,7 @@ class CodePath {
                 }
 
                 // Reset the flag of skipping if all branches have been skipped.
-                if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) {
+                if (skippedSegment && segment.prevSegments.includes(skippedSegment)) {
                     skippedSegment = null;
                 }
                 visited[segment.id] = true;
index ca64862db32cea6db0358d0db18f418900ab4763..e06b6cde5f1db03ffe39d17861534da699c0ef2b 100644 (file)
@@ -20,7 +20,7 @@ const debug = require("debug")("eslint:code-path");
  * @param {CodePathSegment} segment A segment to get.
  * @returns {string} Id of the segment.
  */
-/* istanbul ignore next */
+/* c8 ignore next */
 function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring
     return segment.id + (segment.reachable ? "" : "!");
 }
@@ -67,7 +67,7 @@ module.exports = {
      * @param {boolean} leaving A flag whether or not it's leaving
      * @returns {void}
      */
-    dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) {
+    dumpState: !debug.enabled ? debug : /* c8 ignore next */ function(node, state, leaving) {
         for (let i = 0; i < state.currentSegments.length; ++i) {
             const segInternal = state.currentSegments[i].internal;
 
@@ -98,7 +98,7 @@ module.exports = {
      * @see http://www.graphviz.org
      * @see http://www.webgraphviz.com
      */
-    dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) {
+    dumpDot: !debug.enabled ? debug : /* c8 ignore next */ function(codePath) {
         let text =
             "\n" +
             "digraph {\n" +
index 83787a4ea5a85f86b385f7ebdf27420dea861e92..b580104e1ac263af324b7329c0ff737aeea399fb 100644 (file)
@@ -33,10 +33,10 @@ class IdGenerator {
     next() {
         this.n = 1 + this.n | 0;
 
-        /* istanbul ignore if */
+        /* c8 ignore start */
         if (this.n < 0) {
             this.n = 1;
-        }
+        }/* c8 ignore stop */
 
         return this.prefix + this.n;
     }
index b88c5e6c850929873e64b3b64a87c480647ca501..643de8f2d312a7e08c5690a06cbcd455108e96f8 100644 (file)
@@ -131,8 +131,7 @@ module.exports = class ConfigCommentParser {
 
         const items = {};
 
-        // Collapse whitespace around commas
-        string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => {
+        string.split(",").forEach(name => {
             const trimmedName = name.trim();
 
             if (trimmedName) {
index f897b8ddb8c011e53885d6e9a272cf54b3b3e77a..a29ce9237928e9972317f885c817c289bd30c2df 100644 (file)
@@ -59,6 +59,7 @@ const globals = require("../../conf/globals");
 /** @typedef {import("../shared/types").Environment} Environment */
 /** @typedef {import("../shared/types").GlobalConf} GlobalConf */
 /** @typedef {import("../shared/types").LintMessage} LintMessage */
+/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
 /** @typedef {import("../shared/types").ParserOptions} ParserOptions */
 /** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */
 /** @typedef {import("../shared/types").Processor} Processor */
@@ -77,6 +78,7 @@ const globals = require("../../conf/globals");
  * @property {number} line The line number
  * @property {number} column The column number
  * @property {(string|null)} ruleId The rule ID
+ * @property {string} justification The justification of directive
  */
 
 /**
@@ -84,6 +86,7 @@ const globals = require("../../conf/globals");
  * @typedef {Object} LinterInternalSlots
  * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used.
  * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used.
+ * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced.
  * @property {Map<string, Parser>} parserMap The loaded parsers.
  * @property {Rules} ruleMap The loaded rules.
  */
@@ -287,11 +290,12 @@ function createLintingProblem(options) {
  * @param {token} options.commentToken The Comment token
  * @param {string} options.value The value after the directive in the comment
  * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`)
+ * @param {string} options.justification The justification of the directive
  * @param {function(string): {create: Function}} options.ruleMapper A map from rule IDs to defined rules
  * @returns {Object} Directives and problems from the comment
  */
 function createDisableDirectives(options) {
-    const { commentToken, type, value, ruleMapper } = options;
+    const { commentToken, type, value, justification, ruleMapper } = options;
     const ruleIds = Object.keys(commentParser.parseListConfig(value));
     const directiveRules = ruleIds.length ? ruleIds : [null];
     const result = {
@@ -305,7 +309,25 @@ function createDisableDirectives(options) {
 
         // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
         if (ruleId === null || !!ruleMapper(ruleId)) {
-            result.directives.push({ parentComment, type, line: commentToken.loc.start.line, column: commentToken.loc.start.column + 1, ruleId });
+            if (type === "disable-next-line") {
+                result.directives.push({
+                    parentComment,
+                    type,
+                    line: commentToken.loc.end.line,
+                    column: commentToken.loc.end.column + 1,
+                    ruleId,
+                    justification
+                });
+            } else {
+                result.directives.push({
+                    parentComment,
+                    type,
+                    line: commentToken.loc.start.line,
+                    column: commentToken.loc.start.column + 1,
+                    ruleId,
+                    justification
+                });
+            }
         } else {
             result.directiveProblems.push(createLintingProblem({ ruleId, loc: commentToken.loc }));
         }
@@ -314,26 +336,34 @@ function createDisableDirectives(options) {
 }
 
 /**
- * Remove the ignored part from a given directive comment and trim it.
- * @param {string} value The comment text to strip.
- * @returns {string} The stripped text.
+ * Extract the directive and the justification from a given directive comment and trim them.
+ * @param {string} value The comment text to extract.
+ * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification.
  */
-function stripDirectiveComment(value) {
-    return value.split(/\s-{2,}\s/u)[0].trim();
+function extractDirectiveComment(value) {
+    const match = /\s-{2,}\s/u.exec(value);
+
+    if (!match) {
+        return { directivePart: value.trim(), justificationPart: "" };
+    }
+
+    const directive = value.slice(0, match.index).trim();
+    const justification = value.slice(match.index + match[0].length).trim();
+
+    return { directivePart: directive, justificationPart: justification };
 }
 
 /**
  * Parses comments in file to extract file-specific config of rules, globals
  * and environments and merges them with global config; also code blocks
  * where reporting is disabled or enabled and merges them with reporting config.
- * @param {string} filename The file being checked.
  * @param {ASTNode} ast The top node of the AST.
  * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
  * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from.
  * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}}
  * A collection of the directive comments that were found, along with any problems that occurred when parsing
  */
-function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
+function getDirectiveComments(ast, ruleMapper, warnInlineConfig) {
     const configuredRules = {};
     const enabledGlobals = Object.create(null);
     const exportedVariables = {};
@@ -344,8 +374,9 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
     });
 
     ast.comments.filter(token => token.type !== "Shebang").forEach(comment => {
-        const trimmedCommentText = stripDirectiveComment(comment.value);
-        const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText);
+        const { directivePart, justificationPart } = extractDirectiveComment(comment.value);
+
+        const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(directivePart);
 
         if (!match) {
             return;
@@ -369,7 +400,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
             return;
         }
 
-        if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) {
+        if (directiveText === "eslint-disable-line" && comment.loc.start.line !== comment.loc.end.line) {
             const message = `${directiveText} comment should not span multiple lines.`;
 
             problems.push(createLintingProblem({
@@ -380,7 +411,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
             return;
         }
 
-        const directiveValue = trimmedCommentText.slice(match.index + directiveText.length);
+        const directiveValue = directivePart.slice(match.index + directiveText.length);
 
         switch (directiveText) {
             case "eslint-disable":
@@ -388,7 +419,7 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
             case "eslint-disable-next-line":
             case "eslint-disable-line": {
                 const directiveType = directiveText.slice("eslint-".length);
-                const options = { commentToken: comment, type: directiveType, value: directiveValue, ruleMapper };
+                const options = { commentToken: comment, type: directiveType, value: directiveValue, justification: justificationPart, ruleMapper };
                 const { directives, directiveProblems } = createDisableDirectives(options);
 
                 disableDirectives.push(...directives);
@@ -545,7 +576,7 @@ function findEslintEnv(text) {
         if (match[0].endsWith("*/")) {
             retv = Object.assign(
                 retv || {},
-                commentParser.parseListConfig(stripDirectiveComment(match[1]))
+                commentParser.parseListConfig(extractDirectiveComment(match[1]).directivePart)
             );
         }
     }
@@ -769,14 +800,21 @@ function parse(text, languageOptions, filePath) {
      * problem that ESLint identified just like any other.
      */
     try {
+        debug("Parsing:", filePath);
         const parseResult = (typeof parser.parseForESLint === "function")
             ? parser.parseForESLint(textToParse, parserOptions)
             : { ast: parser.parse(textToParse, parserOptions) };
+
+        debug("Parsing successful:", filePath);
         const ast = parseResult.ast;
         const parserServices = parseResult.services || {};
         const visitorKeys = parseResult.visitorKeys || evk.KEYS;
+
+        debug("Scope analysis:", filePath);
         const scopeManager = parseResult.scopeManager || analyzeScope(ast, languageOptions, visitorKeys);
 
+        debug("Scope analysis successful:", filePath);
+
         return {
             success: true,
 
@@ -1063,7 +1101,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO
             )
         );
 
-        const ruleListeners = createRuleListeners(rule, ruleContext);
+        const ruleListeners = timing.enabled ? timing.time(ruleId, createRuleListeners)(rule, ruleContext) : createRuleListeners(rule, ruleContext);
 
         /**
          * Include `ruleId` in error logs
@@ -1081,6 +1119,10 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO
             };
         }
 
+        if (typeof ruleListeners === "undefined" || ruleListeners === null) {
+            throw new Error(`The create() function for rule '${ruleId}' did not return an object.`);
+        }
+
         // add all the selectors from the rule as listeners
         Object.keys(ruleListeners).forEach(selector => {
             const ruleListener = timing.enabled
@@ -1220,6 +1262,7 @@ class Linter {
             cwd: normalizeCwd(cwd),
             lastConfigArray: null,
             lastSourceCode: null,
+            lastSuppressedMessages: [],
             configType, // TODO: Remove after flat config conversion
             parserMap: new Map([["espree", espree]]),
             ruleMap: new Rules()
@@ -1243,7 +1286,7 @@ class Linter {
      * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything.
      * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
      * @throws {Error} If during rule execution.
-     * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
      */
     _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) {
         const slots = internalSlotsMap.get(this);
@@ -1332,7 +1375,7 @@ class Linter {
 
         const sourceCode = slots.lastSourceCode;
         const commentDirectives = options.allowInlineConfig
-            ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig)
+            ? getDirectiveComments(sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig)
             : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] };
 
         // augment global scope with declared global variables
@@ -1425,11 +1468,11 @@ class Linter {
                     configArray.normalizeSync();
                 }
 
-                return this._verifyWithFlatConfigArray(textOrSourceCode, configArray, options, true);
+                return this._distinguishSuppressedMessages(this._verifyWithFlatConfigArray(textOrSourceCode, configArray, options, true));
             }
 
             if (typeof config.extractConfig === "function") {
-                return this._verifyWithConfigArray(textOrSourceCode, config, options);
+                return this._distinguishSuppressedMessages(this._verifyWithConfigArray(textOrSourceCode, config, options));
             }
         }
 
@@ -1443,9 +1486,9 @@ class Linter {
          * So we cannot apply multiple processors.
          */
         if (options.preprocess || options.postprocess) {
-            return this._verifyWithProcessor(textOrSourceCode, config, options);
+            return this._distinguishSuppressedMessages(this._verifyWithProcessor(textOrSourceCode, config, options));
         }
-        return this._verifyWithoutProcessors(textOrSourceCode, config, options);
+        return this._distinguishSuppressedMessages(this._verifyWithoutProcessors(textOrSourceCode, config, options));
     }
 
     /**
@@ -1454,7 +1497,7 @@ class Linter {
      * @param {FlatConfig} config The config array.
      * @param {VerifyOptions&ProcessorOptions} options The options.
      * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
-     * @returns {LintMessage[]} The found problems.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
      */
     _verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options, configForRecursive) {
         const filename = options.filename || "<input>";
@@ -1467,7 +1510,31 @@ class Linter {
             options.filterCodeBlock ||
             (blockFilename => blockFilename.endsWith(".js"));
         const originalExtname = path.extname(filename);
-        const messageLists = preprocess(text, filenameToExpose).map((block, i) => {
+
+        let blocks;
+
+        try {
+            blocks = preprocess(text, filenameToExpose);
+        } catch (ex) {
+
+            // If the message includes a leading line number, strip it:
+            const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;
+
+            debug("%s\n%s", message, ex.stack);
+
+            return [
+                {
+                    ruleId: null,
+                    fatal: true,
+                    severity: 2,
+                    message,
+                    line: ex.lineNumber,
+                    column: ex.column
+                }
+            ];
+        }
+
+        const messageLists = blocks.map((block, i) => {
             debug("A code block was found: %o", block.filename || "(unnamed)");
 
             // Keep the legacy behavior.
@@ -1511,7 +1578,7 @@ class Linter {
      * @param {FlatConfig} providedConfig An ESLintConfig instance to configure everything.
      * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
      * @throws {Error} If during rule execution.
-     * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
      */
     _verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) {
         const slots = internalSlotsMap.get(this);
@@ -1541,6 +1608,11 @@ class Linter {
             ...languageOptions.globals
         };
 
+        // double check that there is a parser to avoid mysterious error messages
+        if (!languageOptions.parser) {
+            throw new TypeError(`No parser specified for ${options.filename}`);
+        }
+
         // Espree expects this information to be passed in
         if (isEspree(languageOptions.parser)) {
             const parserOptions = languageOptions.parserOptions;
@@ -1593,7 +1665,6 @@ class Linter {
         const sourceCode = slots.lastSourceCode;
         const commentDirectives = options.allowInlineConfig
             ? getDirectiveComments(
-                options.filename,
                 sourceCode.ast,
                 ruleId => getRuleFromConfig(ruleId, config),
                 options.warnInlineConfig
@@ -1661,7 +1732,7 @@ class Linter {
      * @param {string|SourceCode} textOrSourceCode The source code.
      * @param {ConfigArray} configArray The config array.
      * @param {VerifyOptions&ProcessorOptions} options The options.
-     * @returns {LintMessage[]} The found problems.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
      */
     _verifyWithConfigArray(textOrSourceCode, configArray, options) {
         debug("With ConfigArray: %s", options.filename);
@@ -1698,18 +1769,30 @@ class Linter {
      * @param {VerifyOptions&ProcessorOptions} options The options.
      * @param {boolean} [firstCall=false] Indicates if this is being called directly
      *      from verify(). (TODO: Remove once eslintrc is removed.)
-     * @returns {LintMessage[]} The found problems.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
      */
     _verifyWithFlatConfigArray(textOrSourceCode, configArray, options, firstCall = false) {
         debug("With flat config: %s", options.filename);
 
         // we need a filename to match configs against
-        const filename = options.filename || "<input>";
+        const filename = options.filename || "__placeholder__.js";
 
         // Store the config array in order to get plugin envs and rules later.
         internalSlotsMap.get(this).lastConfigArray = configArray;
         const config = configArray.getConfig(filename);
 
+        if (!config) {
+            return [
+                {
+                    ruleId: null,
+                    severity: 1,
+                    message: `No matching configuration found for ${filename}.`,
+                    line: 0,
+                    column: 0
+                }
+            ];
+        }
+
         // Verify.
         if (config.processor) {
             debug("Apply the processor: %o", config.processor);
@@ -1738,7 +1821,7 @@ class Linter {
      * @param {ConfigData|ExtractedConfig} config The config array.
      * @param {VerifyOptions&ProcessorOptions} options The options.
      * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
-     * @returns {LintMessage[]} The found problems.
+     * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
      */
     _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) {
         const filename = options.filename || "<input>";
@@ -1746,13 +1829,36 @@ class Linter {
         const physicalFilename = options.physicalFilename || filenameToExpose;
         const text = ensureText(textOrSourceCode);
         const preprocess = options.preprocess || (rawText => [rawText]);
-
         const postprocess = options.postprocess || (messagesList => messagesList.flat());
         const filterCodeBlock =
             options.filterCodeBlock ||
             (blockFilename => blockFilename.endsWith(".js"));
         const originalExtname = path.extname(filename);
-        const messageLists = preprocess(text, filenameToExpose).map((block, i) => {
+
+        let blocks;
+
+        try {
+            blocks = preprocess(text, filenameToExpose);
+        } catch (ex) {
+
+            // If the message includes a leading line number, strip it:
+            const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;
+
+            debug("%s\n%s", message, ex.stack);
+
+            return [
+                {
+                    ruleId: null,
+                    fatal: true,
+                    severity: 2,
+                    message,
+                    line: ex.lineNumber,
+                    column: ex.column
+                }
+            ];
+        }
+
+        const messageLists = blocks.map((block, i) => {
             debug("A code block was found: %o", block.filename || "(unnamed)");
 
             // Keep the legacy behavior.
@@ -1790,6 +1896,30 @@ class Linter {
         return postprocess(messageLists, filenameToExpose);
     }
 
+    /**
+     * Given a list of reported problems, distinguish problems between normal messages and suppressed messages.
+     * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages.
+     * @param {Problem[]} problems A list of reported problems.
+     * @returns {LintMessage[]} A list of LintMessage.
+     */
+    _distinguishSuppressedMessages(problems) {
+        const messages = [];
+        const suppressedMessages = [];
+        const slots = internalSlotsMap.get(this);
+
+        for (const problem of problems) {
+            if (problem.suppressions) {
+                suppressedMessages.push(problem);
+            } else {
+                messages.push(problem);
+            }
+        }
+
+        slots.lastSuppressedMessages = suppressedMessages;
+
+        return messages;
+    }
+
     /**
      * Gets the SourceCode object representing the parsed source.
      * @returns {SourceCode} The SourceCode object.
@@ -1798,6 +1928,14 @@ class Linter {
         return internalSlotsMap.get(this).lastSourceCode;
     }
 
+    /**
+     * Gets the list of SuppressedLintMessage produced in the last running.
+     * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage
+     */
+    getSuppressedMessages() {
+        return internalSlotsMap.get(this).lastSuppressedMessages;
+    }
+
     /**
      * Defines a new linting rule.
      * @param {string} ruleId A unique rule identifier
index c9ab01ec64906721a36e6904f99b041ff3a312e5..1076ff25887cbebf34c7489418d2692f8fa98d4e 100644 (file)
@@ -9,7 +9,7 @@
 // Helpers
 //------------------------------------------------------------------------------
 
-/* istanbul ignore next */
+/* c8 ignore next */
 /**
  * Align the string to left
  * @param {string} str string to evaluate
@@ -22,7 +22,7 @@ function alignLeft(str, len, ch) {
     return str + new Array(len - str.length + 1).join(ch || " ");
 }
 
-/* istanbul ignore next */
+/* c8 ignore next */
 /**
  * Align the string to right
  * @param {string} str string to evaluate
@@ -64,7 +64,7 @@ function getListSize() {
     return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE;
 }
 
-/* istanbul ignore next */
+/* c8 ignore next */
 /**
  * display the data
  * @param {Object} data Data object to be displayed
@@ -119,7 +119,7 @@ function display(data) {
     console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function
 }
 
-/* istanbul ignore next */
+/* c8 ignore next */
 module.exports = (function() {
 
     const data = Object.create(null);
@@ -138,10 +138,11 @@ module.exports = (function() {
 
         return function(...args) {
             let t = process.hrtime();
+            const result = fn(...args);
 
-            fn(...args);
             t = process.hrtime(t);
             data[key] += t[0] * 1e3 + t[1] / 1e6;
+            return result;
         };
     }
 
index 6d06e3ddce1d500859f3437d0995e7d32f8c3875..0d95f2a635470aa0b5c3c2c97655449caa095970 100644 (file)
@@ -63,261 +63,309 @@ const optionator = require("optionator");
 //------------------------------------------------------------------------------
 
 // exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
-module.exports = optionator({
-    prepend: "eslint [options] file.js [file.js] [dir]",
-    defaults: {
-        concatRepeatedArrays: true,
-        mergeRepeatedObjects: true
-    },
-    options: [
-        {
-            heading: "Basic configuration"
-        },
-        {
+
+/**
+ * Creates the CLI options for ESLint.
+ * @param {boolean} usingFlatConfig Indicates if flat config is being used.
+ * @returns {Object} The opinionator instance.
+ */
+module.exports = function(usingFlatConfig) {
+
+    let lookupFlag;
+
+    if (usingFlatConfig) {
+        lookupFlag = {
+            option: "config-lookup",
+            type: "Boolean",
+            default: "true",
+            description: "Disable look up for eslint.config.js"
+        };
+    } else {
+        lookupFlag = {
             option: "eslintrc",
             type: "Boolean",
             default: "true",
             description: "Disable use of configuration from .eslintrc.*"
-        },
-        {
-            option: "config",
-            alias: "c",
-            type: "path::String",
-            description: "Use this configuration, overriding .eslintrc.* config options if present"
-        },
-        {
+        };
+    }
+
+    let envFlag;
+
+    if (!usingFlatConfig) {
+        envFlag = {
             option: "env",
             type: "[String]",
             description: "Specify environments"
-        },
-        {
+        };
+    }
+
+    let extFlag;
+
+    if (!usingFlatConfig) {
+        extFlag = {
             option: "ext",
             type: "[String]",
             description: "Specify JavaScript file extensions"
-        },
-        {
-            option: "global",
-            type: "[String]",
-            description: "Define global variables"
-        },
-        {
-            option: "parser",
-            type: "String",
-            description: "Specify the parser to be used"
-        },
-        {
-            option: "parser-options",
-            type: "Object",
-            description: "Specify parser options"
-        },
-        {
+        };
+    }
+
+    let resolvePluginsFlag;
+
+    if (!usingFlatConfig) {
+        resolvePluginsFlag = {
             option: "resolve-plugins-relative-to",
             type: "path::String",
             description: "A folder where plugins should be resolved from, CWD by default"
-        },
-        {
-            heading: "Specifying rules and plugins"
-        },
-        {
-            option: "plugin",
-            type: "[String]",
-            description: "Specify plugins"
-        },
-        {
-            option: "rule",
-            type: "Object",
-            description: "Specify rules"
-        },
-        {
+        };
+    }
+
+    let rulesDirFlag;
+
+    if (!usingFlatConfig) {
+        rulesDirFlag = {
             option: "rulesdir",
             type: "[path::String]",
             description: "Load additional rules from this directory. Deprecated: Use rules from plugins"
-        },
-        {
-            heading: "Fixing problems"
-        },
-        {
-            option: "fix",
-            type: "Boolean",
-            default: false,
-            description: "Automatically fix problems"
-        },
-        {
-            option: "fix-dry-run",
-            type: "Boolean",
-            default: false,
-            description: "Automatically fix problems without saving the changes to the file system"
-        },
-        {
-            option: "fix-type",
-            type: "Array",
-            description: "Specify the types of fixes to apply (directive, problem, suggestion, layout)"
-        },
-        {
-            heading: "Ignoring files"
-        },
-        {
-            option: "ignore-path",
-            type: "path::String",
-            description: "Specify path of ignore file"
-        },
-        {
-            option: "ignore",
-            type: "Boolean",
-            default: "true",
-            description: "Disable use of ignore files and patterns"
-        },
-        {
-            option: "ignore-pattern",
-            type: "[String]",
-            description: "Pattern of files to ignore (in addition to those in .eslintignore)",
-            concatRepeatedArrays: [true, {
-                oneValuePerFlag: true
-            }]
-        },
-        {
-            heading: "Using stdin"
-        },
-        {
-            option: "stdin",
-            type: "Boolean",
-            default: "false",
-            description: "Lint code provided on <STDIN>"
-        },
-        {
-            option: "stdin-filename",
-            type: "String",
-            description: "Specify filename to process STDIN as"
-        },
-        {
-            heading: "Handling warnings"
-        },
-        {
-            option: "quiet",
-            type: "Boolean",
-            default: "false",
-            description: "Report errors only"
-        },
-        {
-            option: "max-warnings",
-            type: "Int",
-            default: "-1",
-            description: "Number of warnings to trigger nonzero exit code"
-        },
-        {
-            heading: "Output"
-        },
-        {
-            option: "output-file",
-            alias: "o",
-            type: "path::String",
-            description: "Specify file to write report to"
-        },
-        {
-            option: "format",
-            alias: "f",
-            type: "String",
-            default: "stylish",
-            description: "Use a specific output format"
-        },
-        {
-            option: "color",
-            type: "Boolean",
-            alias: "no-color",
-            description: "Force enabling/disabling of color"
-        },
-        {
-            heading: "Inline configuration comments"
-        },
-        {
-            option: "inline-config",
-            type: "Boolean",
-            default: "true",
-            description: "Prevent comments from changing config or rules"
-        },
-        {
-            option: "report-unused-disable-directives",
-            type: "Boolean",
-            default: void 0,
-            description: "Adds reported errors for unused eslint-disable directives"
-        },
-        {
-            heading: "Caching"
-        },
-        {
-            option: "cache",
-            type: "Boolean",
-            default: "false",
-            description: "Only check changed files"
-        },
-        {
-            option: "cache-file",
-            type: "path::String",
-            default: ".eslintcache",
-            description: "Path to the cache file. Deprecated: use --cache-location"
-        },
-        {
-            option: "cache-location",
-            type: "path::String",
-            description: "Path to the cache file or directory"
-        },
-        {
-            option: "cache-strategy",
-            dependsOn: ["cache"],
-            type: "String",
-            default: "metadata",
-            enum: ["metadata", "content"],
-            description: "Strategy to use for detecting changed files in the cache"
-        },
-        {
-            heading: "Miscellaneous"
-        },
-        {
-            option: "init",
-            type: "Boolean",
-            default: "false",
-            description: "Run config initialization wizard"
-        },
-        {
-            option: "env-info",
-            type: "Boolean",
-            default: "false",
-            description: "Output execution environment information"
-        },
-        {
-            option: "error-on-unmatched-pattern",
-            type: "Boolean",
-            default: "true",
-            description: "Prevent errors when pattern is unmatched"
-        },
-        {
-            option: "exit-on-fatal-error",
-            type: "Boolean",
-            default: "false",
-            description: "Exit with exit code 2 in case of fatal error"
-        },
-        {
-            option: "debug",
-            type: "Boolean",
-            default: false,
-            description: "Output debugging information"
-        },
-        {
-            option: "help",
-            alias: "h",
-            type: "Boolean",
-            description: "Show help"
-        },
-        {
-            option: "version",
-            alias: "v",
-            type: "Boolean",
-            description: "Output the version number"
-        },
-        {
-            option: "print-config",
-            type: "path::String",
-            description: "Print the configuration for the given file"
-        }
-    ]
-});
+        };
+    }
+
+    return optionator({
+        prepend: "eslint [options] file.js [file.js] [dir]",
+        defaults: {
+            concatRepeatedArrays: true,
+            mergeRepeatedObjects: true
+        },
+        options: [
+            {
+                heading: "Basic configuration"
+            },
+            lookupFlag,
+            {
+                option: "config",
+                alias: "c",
+                type: "path::String",
+                description: usingFlatConfig
+                    ? "Use this configuration instead of eslint.config.js"
+                    : "Use this configuration, overriding .eslintrc.* config options if present"
+            },
+            envFlag,
+            extFlag,
+            {
+                option: "global",
+                type: "[String]",
+                description: "Define global variables"
+            },
+            {
+                option: "parser",
+                type: "String",
+                description: "Specify the parser to be used"
+            },
+            {
+                option: "parser-options",
+                type: "Object",
+                description: "Specify parser options"
+            },
+            resolvePluginsFlag,
+            {
+                heading: "Specifying rules and plugins"
+            },
+            {
+                option: "plugin",
+                type: "[String]",
+                description: "Specify plugins"
+            },
+            {
+                option: "rule",
+                type: "Object",
+                description: "Specify rules"
+            },
+            rulesDirFlag,
+            {
+                heading: "Fixing problems"
+            },
+            {
+                option: "fix",
+                type: "Boolean",
+                default: false,
+                description: "Automatically fix problems"
+            },
+            {
+                option: "fix-dry-run",
+                type: "Boolean",
+                default: false,
+                description: "Automatically fix problems without saving the changes to the file system"
+            },
+            {
+                option: "fix-type",
+                type: "Array",
+                description: "Specify the types of fixes to apply (directive, problem, suggestion, layout)"
+            },
+            {
+                heading: "Ignoring files"
+            },
+            {
+                option: "ignore-path",
+                type: "path::String",
+                description: "Specify path of ignore file"
+            },
+            {
+                option: "ignore",
+                type: "Boolean",
+                default: "true",
+                description: "Disable use of ignore files and patterns"
+            },
+            {
+                option: "ignore-pattern",
+                type: "[String]",
+                description: "Pattern of files to ignore (in addition to those in .eslintignore)",
+                concatRepeatedArrays: [true, {
+                    oneValuePerFlag: true
+                }]
+            },
+            {
+                heading: "Using stdin"
+            },
+            {
+                option: "stdin",
+                type: "Boolean",
+                default: "false",
+                description: "Lint code provided on <STDIN>"
+            },
+            {
+                option: "stdin-filename",
+                type: "String",
+                description: "Specify filename to process STDIN as"
+            },
+            {
+                heading: "Handling warnings"
+            },
+            {
+                option: "quiet",
+                type: "Boolean",
+                default: "false",
+                description: "Report errors only"
+            },
+            {
+                option: "max-warnings",
+                type: "Int",
+                default: "-1",
+                description: "Number of warnings to trigger nonzero exit code"
+            },
+            {
+                heading: "Output"
+            },
+            {
+                option: "output-file",
+                alias: "o",
+                type: "path::String",
+                description: "Specify file to write report to"
+            },
+            {
+                option: "format",
+                alias: "f",
+                type: "String",
+                default: "stylish",
+                description: "Use a specific output format"
+            },
+            {
+                option: "color",
+                type: "Boolean",
+                alias: "no-color",
+                description: "Force enabling/disabling of color"
+            },
+            {
+                heading: "Inline configuration comments"
+            },
+            {
+                option: "inline-config",
+                type: "Boolean",
+                default: "true",
+                description: "Prevent comments from changing config or rules"
+            },
+            {
+                option: "report-unused-disable-directives",
+                type: "Boolean",
+                default: void 0,
+                description: "Adds reported errors for unused eslint-disable directives"
+            },
+            {
+                heading: "Caching"
+            },
+            {
+                option: "cache",
+                type: "Boolean",
+                default: "false",
+                description: "Only check changed files"
+            },
+            {
+                option: "cache-file",
+                type: "path::String",
+                default: ".eslintcache",
+                description: "Path to the cache file. Deprecated: use --cache-location"
+            },
+            {
+                option: "cache-location",
+                type: "path::String",
+                description: "Path to the cache file or directory"
+            },
+            {
+                option: "cache-strategy",
+                dependsOn: ["cache"],
+                type: "String",
+                default: "metadata",
+                enum: ["metadata", "content"],
+                description: "Strategy to use for detecting changed files in the cache"
+            },
+            {
+                heading: "Miscellaneous"
+            },
+            {
+                option: "init",
+                type: "Boolean",
+                default: "false",
+                description: "Run config initialization wizard"
+            },
+            {
+                option: "env-info",
+                type: "Boolean",
+                default: "false",
+                description: "Output execution environment information"
+            },
+            {
+                option: "error-on-unmatched-pattern",
+                type: "Boolean",
+                default: "true",
+                description: "Prevent errors when pattern is unmatched"
+            },
+            {
+                option: "exit-on-fatal-error",
+                type: "Boolean",
+                default: "false",
+                description: "Exit with exit code 2 in case of fatal error"
+            },
+            {
+                option: "debug",
+                type: "Boolean",
+                default: false,
+                description: "Output debugging information"
+            },
+            {
+                option: "help",
+                alias: "h",
+                type: "Boolean",
+                description: "Show help"
+            },
+            {
+                option: "version",
+                alias: "v",
+                type: "Boolean",
+                description: "Output the version number"
+            },
+            {
+                option: "print-config",
+                type: "path::String",
+                description: "Print the configuration for the given file"
+            }
+        ].filter(value => !!value)
+    });
+};
diff --git a/eslint/lib/rule-tester/flat-rule-tester.js b/eslint/lib/rule-tester/flat-rule-tester.js
new file mode 100644 (file)
index 0000000..f915924
--- /dev/null
@@ -0,0 +1,1042 @@
+/**
+ * @fileoverview Mocha/Jest test wrapper
+ * @author Ilya Volodin
+ */
+"use strict";
+
+/* globals describe, it -- Mocha globals */
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const
+    assert = require("assert"),
+    util = require("util"),
+    equal = require("fast-deep-equal"),
+    Traverser = require("../shared/traverser"),
+    { getRuleOptionsSchema } = require("../config/flat-config-helpers"),
+    { Linter, SourceCodeFixer, interpolate } = require("../linter");
+const { FlatConfigArray } = require("../config/flat-config-array");
+const { defaultConfig } = require("../config/default-config");
+
+const ajv = require("../shared/ajv")({ strictDefaults: true });
+
+const parserSymbol = Symbol.for("eslint.RuleTester.parser");
+const { SourceCode } = require("../source-code");
+const { ConfigArraySymbol } = require("@humanwhocodes/config-array");
+
+//------------------------------------------------------------------------------
+// Typedefs
+//------------------------------------------------------------------------------
+
+/** @typedef {import("../shared/types").Parser} Parser */
+/** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */
+
+/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
+/**
+ * A test case that is expected to pass lint.
+ * @typedef {Object} ValidTestCase
+ * @property {string} [name] Name for the test case.
+ * @property {string} code Code for the test case.
+ * @property {any[]} [options] Options for the test case.
+ * @property {LanguageOptions} [languageOptions] The language options to use in the test case.
+ * @property {{ [name: string]: any }} [settings] Settings for the test case.
+ * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames.
+ * @property {boolean} [only] Run only this test case or the subset of test cases with this property.
+ */
+
+/**
+ * A test case that is expected to fail lint.
+ * @typedef {Object} InvalidTestCase
+ * @property {string} [name] Name for the test case.
+ * @property {string} code Code for the test case.
+ * @property {number | Array<TestCaseError | string | RegExp>} errors Expected errors.
+ * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
+ * @property {any[]} [options] Options for the test case.
+ * @property {{ [name: string]: any }} [settings] Settings for the test case.
+ * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames.
+ * @property {LanguageOptions} [languageOptions] The language options to use in the test case.
+ * @property {boolean} [only] Run only this test case or the subset of test cases with this property.
+ */
+
+/**
+ * A description of a reported error used in a rule tester test.
+ * @typedef {Object} TestCaseError
+ * @property {string | RegExp} [message] Message.
+ * @property {string} [messageId] Message ID.
+ * @property {string} [type] The type of the reported AST node.
+ * @property {{ [name: string]: string }} [data] The data used to fill the message template.
+ * @property {number} [line] The 1-based line number of the reported start location.
+ * @property {number} [column] The 1-based column number of the reported start location.
+ * @property {number} [endLine] The 1-based line number of the reported end location.
+ * @property {number} [endColumn] The 1-based column number of the reported end location.
+ */
+/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
+
+//------------------------------------------------------------------------------
+// Private Members
+//------------------------------------------------------------------------------
+
+/*
+ * testerDefaultConfig must not be modified as it allows to reset the tester to
+ * the initial default configuration
+ */
+const testerDefaultConfig = { rules: {} };
+
+/*
+ * RuleTester uses this config as its default. This can be overwritten via
+ * setDefaultConfig().
+ */
+let sharedDefaultConfig = { rules: {} };
+
+/*
+ * List every parameters possible on a test case that are not related to eslint
+ * configuration
+ */
+const RuleTesterParameters = [
+    "name",
+    "code",
+    "filename",
+    "options",
+    "errors",
+    "output",
+    "only"
+];
+
+/*
+ * All allowed property names in error objects.
+ */
+const errorObjectParameters = new Set([
+    "message",
+    "messageId",
+    "data",
+    "type",
+    "line",
+    "column",
+    "endLine",
+    "endColumn",
+    "suggestions"
+]);
+const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`;
+
+/*
+ * All allowed property names in suggestion objects.
+ */
+const suggestionObjectParameters = new Set([
+    "desc",
+    "messageId",
+    "data",
+    "output"
+]);
+const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`;
+
+const hasOwnProperty = Function.call.bind(Object.hasOwnProperty);
+
+/**
+ * Clones a given value deeply.
+ * Note: This ignores `parent` property.
+ * @param {any} x A value to clone.
+ * @returns {any} A cloned value.
+ */
+function cloneDeeplyExcludesParent(x) {
+    if (typeof x === "object" && x !== null) {
+        if (Array.isArray(x)) {
+            return x.map(cloneDeeplyExcludesParent);
+        }
+
+        const retv = {};
+
+        for (const key in x) {
+            if (key !== "parent" && hasOwnProperty(x, key)) {
+                retv[key] = cloneDeeplyExcludesParent(x[key]);
+            }
+        }
+
+        return retv;
+    }
+
+    return x;
+}
+
+/**
+ * Freezes a given value deeply.
+ * @param {any} x A value to freeze.
+ * @returns {void}
+ */
+function freezeDeeply(x) {
+    if (typeof x === "object" && x !== null) {
+        if (Array.isArray(x)) {
+            x.forEach(freezeDeeply);
+        } else {
+            for (const key in x) {
+                if (key !== "parent" && hasOwnProperty(x, key)) {
+                    freezeDeeply(x[key]);
+                }
+            }
+        }
+        Object.freeze(x);
+    }
+}
+
+/**
+ * Replace control characters by `\u00xx` form.
+ * @param {string} text The text to sanitize.
+ * @returns {string} The sanitized text.
+ */
+function sanitize(text) {
+    if (typeof text !== "string") {
+        return "";
+    }
+    return text.replace(
+        /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls
+        c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}`
+    );
+}
+
+/**
+ * Define `start`/`end` properties as throwing error.
+ * @param {string} objName Object name used for error messages.
+ * @param {ASTNode} node The node to define.
+ * @returns {void}
+ */
+function defineStartEndAsError(objName, node) {
+    Object.defineProperties(node, {
+        start: {
+            get() {
+                throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`);
+            },
+            configurable: true,
+            enumerable: false
+        },
+        end: {
+            get() {
+                throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`);
+            },
+            configurable: true,
+            enumerable: false
+        }
+    });
+}
+
+
+/**
+ * Define `start`/`end` properties of all nodes of the given AST as throwing error.
+ * @param {ASTNode} ast The root node to errorize `start`/`end` properties.
+ * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast.
+ * @returns {void}
+ */
+function defineStartEndAsErrorInTree(ast, visitorKeys) {
+    Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") });
+    ast.tokens.forEach(defineStartEndAsError.bind(null, "token"));
+    ast.comments.forEach(defineStartEndAsError.bind(null, "token"));
+}
+
+/**
+ * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes.
+ * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties.
+ * @param {Parser} parser Parser object.
+ * @returns {Parser} Wrapped parser object.
+ */
+function wrapParser(parser) {
+
+    if (typeof parser.parseForESLint === "function") {
+        return {
+            [parserSymbol]: parser,
+            parseForESLint(...args) {
+                const ret = parser.parseForESLint(...args);
+
+                defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys);
+                return ret;
+            }
+        };
+    }
+
+    return {
+        [parserSymbol]: parser,
+        parse(...args) {
+            const ast = parser.parse(...args);
+
+            defineStartEndAsErrorInTree(ast);
+            return ast;
+        }
+    };
+}
+
+/**
+ * Function to replace `SourceCode.prototype.getComments`.
+ * @returns {void}
+ * @throws {Error} Deprecation message.
+ */
+function getCommentsDeprecation() {
+    throw new Error(
+        "`SourceCode#getComments()` is deprecated and will be removed in a future major version. Use `getCommentsBefore()`, `getCommentsAfter()`, and `getCommentsInside()` instead."
+    );
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+// default separators for testing
+const DESCRIBE = Symbol("describe");
+const IT = Symbol("it");
+const IT_ONLY = Symbol("itOnly");
+
+/**
+ * This is `it` default handler if `it` don't exist.
+ * @this {Mocha}
+ * @param {string} text The description of the test case.
+ * @param {Function} method The logic of the test case.
+ * @throws {Error} Any error upon execution of `method`.
+ * @returns {any} Returned value of `method`.
+ */
+function itDefaultHandler(text, method) {
+    try {
+        return method.call(this);
+    } catch (err) {
+        if (err instanceof assert.AssertionError) {
+            err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`;
+        }
+        throw err;
+    }
+}
+
+/**
+ * This is `describe` default handler if `describe` don't exist.
+ * @this {Mocha}
+ * @param {string} text The description of the test case.
+ * @param {Function} method The logic of the test case.
+ * @returns {any} Returned value of `method`.
+ */
+function describeDefaultHandler(text, method) {
+    return method.call(this);
+}
+
+/**
+ * Mocha test wrapper.
+ */
+class FlatRuleTester {
+
+    /**
+     * Creates a new instance of RuleTester.
+     * @param {Object} [testerConfig] Optional, extra configuration for the tester
+     */
+    constructor(testerConfig = {}) {
+
+        /**
+         * The configuration to use for this tester. Combination of the tester
+         * configuration and the default configuration.
+         * @type {Object}
+         */
+        this.testerConfig = [
+            sharedDefaultConfig,
+            testerConfig,
+            { rules: { "rule-tester/validate-ast": "error" } }
+        ];
+
+        this.linter = new Linter({ configType: "flat" });
+    }
+
+    /**
+     * Set the configuration to use for all future tests
+     * @param {Object} config the configuration to use.
+     * @throws {TypeError} If non-object config.
+     * @returns {void}
+     */
+    static setDefaultConfig(config) {
+        if (typeof config !== "object") {
+            throw new TypeError("FlatRuleTester.setDefaultConfig: config must be an object");
+        }
+        sharedDefaultConfig = config;
+
+        // Make sure the rules object exists since it is assumed to exist later
+        sharedDefaultConfig.rules = sharedDefaultConfig.rules || {};
+    }
+
+    /**
+     * Get the current configuration used for all tests
+     * @returns {Object} the current configuration
+     */
+    static getDefaultConfig() {
+        return sharedDefaultConfig;
+    }
+
+    /**
+     * Reset the configuration to the initial configuration of the tester removing
+     * any changes made until now.
+     * @returns {void}
+     */
+    static resetDefaultConfig() {
+        sharedDefaultConfig = {
+            rules: {
+                ...testerDefaultConfig.rules
+            }
+        };
+    }
+
+
+    /*
+     * If people use `mocha test.js --watch` command, `describe` and `it` function
+     * instances are different for each execution. So `describe` and `it` should get fresh instance
+     * always.
+     */
+    static get describe() {
+        return (
+            this[DESCRIBE] ||
+            (typeof describe === "function" ? describe : describeDefaultHandler)
+        );
+    }
+
+    static set describe(value) {
+        this[DESCRIBE] = value;
+    }
+
+    static get it() {
+        return (
+            this[IT] ||
+            (typeof it === "function" ? it : itDefaultHandler)
+        );
+    }
+
+    static set it(value) {
+        this[IT] = value;
+    }
+
+    /**
+     * Adds the `only` property to a test to run it in isolation.
+     * @param {string | ValidTestCase | InvalidTestCase} item A single test to run by itself.
+     * @returns {ValidTestCase | InvalidTestCase} The test with `only` set.
+     */
+    static only(item) {
+        if (typeof item === "string") {
+            return { code: item, only: true };
+        }
+
+        return { ...item, only: true };
+    }
+
+    static get itOnly() {
+        if (typeof this[IT_ONLY] === "function") {
+            return this[IT_ONLY];
+        }
+        if (typeof this[IT] === "function" && typeof this[IT].only === "function") {
+            return Function.bind.call(this[IT].only, this[IT]);
+        }
+        if (typeof it === "function" && typeof it.only === "function") {
+            return Function.bind.call(it.only, it);
+        }
+
+        if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") {
+            throw new Error(
+                "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" +
+                "See https://eslint.org/docs/developer-guide/nodejs-api#customizing-ruletester for more."
+            );
+        }
+        if (typeof it === "function") {
+            throw new Error("The current test framework does not support exclusive tests with `only`.");
+        }
+        throw new Error("To use `only`, use RuleTester with a test framework that provides `it.only()` like Mocha.");
+    }
+
+    static set itOnly(value) {
+        this[IT_ONLY] = value;
+    }
+
+
+    /**
+     * Adds a new rule test to execute.
+     * @param {string} ruleName The name of the rule to run.
+     * @param {Function} rule The rule to test.
+     * @param {{
+     *   valid: (ValidTestCase | string)[],
+     *   invalid: InvalidTestCase[]
+     * }} test The collection of tests to run.
+     * @throws {TypeError|Error} If non-object `test`, or if a required
+     * scenario of the given type is missing.
+     * @returns {void}
+     */
+    run(ruleName, rule, test) {
+
+        const testerConfig = this.testerConfig,
+            requiredScenarios = ["valid", "invalid"],
+            scenarioErrors = [],
+            linter = this.linter,
+            ruleId = `rule-to-test/${ruleName}`;
+
+        if (!test || typeof test !== "object") {
+            throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`);
+        }
+
+        requiredScenarios.forEach(scenarioType => {
+            if (!test[scenarioType]) {
+                scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`);
+            }
+        });
+
+        if (scenarioErrors.length > 0) {
+            throw new Error([
+                `Test Scenarios for rule ${ruleName} is invalid:`
+            ].concat(scenarioErrors).join("\n"));
+        }
+
+        const baseConfig = [
+            {
+                plugins: {
+
+                    // copy root plugin over
+                    "@": {
+
+                        /*
+                         * Parsers are wrapped to detect more errors, so this needs
+                         * to be a new object for each call to run(), otherwise the
+                         * parsers will be wrapped multiple times.
+                         */
+                        parsers: {
+                            ...defaultConfig[0].plugins["@"].parsers
+                        },
+
+                        /*
+                         * The rules key on the default plugin is a proxy to lazy-load
+                         * just the rules that are needed. So, don't create a new object
+                         * here, just use the default one to keep that performance
+                         * enhancement.
+                         */
+                        rules: defaultConfig[0].plugins["@"].rules
+                    },
+                    "rule-to-test": {
+                        rules: {
+                            [ruleName]: Object.assign({}, rule, {
+
+                                // Create a wrapper rule that freezes the `context` properties.
+                                create(context) {
+                                    freezeDeeply(context.options);
+                                    freezeDeeply(context.settings);
+                                    freezeDeeply(context.parserOptions);
+
+                                    // freezeDeeply(context.languageOptions);
+
+                                    return (typeof rule === "function" ? rule : rule.create)(context);
+                                }
+                            })
+                        }
+                    }
+                },
+                languageOptions: {
+                    ...defaultConfig[0].languageOptions
+                }
+            },
+            ...defaultConfig.slice(1)
+        ];
+
+        /**
+         * Run the rule for the given item
+         * @param {string|Object} item Item to run the rule against
+         * @throws {Error} If an invalid schema.
+         * @returns {Object} Eslint run result
+         * @private
+         */
+        function runRuleForItem(item) {
+            const configs = new FlatConfigArray(testerConfig, { baseConfig });
+
+            /*
+             * Modify the returned config so that the parser is wrapped to catch
+             * access of the start/end properties. This method is called just
+             * once per code snippet being tested, so each test case gets a clean
+             * parser.
+             */
+            configs[ConfigArraySymbol.finalizeConfig] = function(...args) {
+
+                // can't do super here :(
+                const proto = Object.getPrototypeOf(this);
+                const calculatedConfig = proto[ConfigArraySymbol.finalizeConfig].apply(this, args);
+
+                // wrap the parser to catch start/end property access
+                calculatedConfig.languageOptions.parser = wrapParser(calculatedConfig.languageOptions.parser);
+                return calculatedConfig;
+            };
+
+            let code, filename, output, beforeAST, afterAST;
+
+            if (typeof item === "string") {
+                code = item;
+            } else {
+                code = item.code;
+
+                /*
+                 * Assumes everything on the item is a config except for the
+                 * parameters used by this tester
+                 */
+                const itemConfig = { ...item };
+
+                for (const parameter of RuleTesterParameters) {
+                    delete itemConfig[parameter];
+                }
+
+                // wrap any parsers
+                if (itemConfig.languageOptions && itemConfig.languageOptions.parser) {
+
+                    const parser = itemConfig.languageOptions.parser;
+
+                    if (parser && typeof parser !== "object") {
+                        throw new Error("Parser must be an object with a parse() or parseForESLint() method.");
+                    }
+
+                }
+
+                /*
+                 * Create the config object from the tester config and this item
+                 * specific configurations.
+                 */
+                configs.push(itemConfig);
+            }
+
+            if (item.filename) {
+                filename = item.filename;
+            }
+
+            let ruleConfig = 1;
+
+            if (hasOwnProperty(item, "options")) {
+                assert(Array.isArray(item.options), "options must be an array");
+                ruleConfig = [1, ...item.options];
+            }
+
+            configs.push({
+                rules: {
+                    [ruleId]: ruleConfig
+                }
+            });
+
+            const schema = getRuleOptionsSchema(rule);
+
+            /*
+             * Setup AST getters.
+             * The goal is to check whether or not AST was modified when
+             * running the rule under test.
+             */
+            configs.push({
+                plugins: {
+                    "rule-tester": {
+                        rules: {
+                            "validate-ast"() {
+                                return {
+                                    Program(node) {
+                                        beforeAST = cloneDeeplyExcludesParent(node);
+                                    },
+                                    "Program:exit"(node) {
+                                        afterAST = node;
+                                    }
+                                };
+                            }
+                        }
+                    }
+                }
+            });
+
+            if (schema) {
+                ajv.validateSchema(schema);
+
+                if (ajv.errors) {
+                    const errors = ajv.errors.map(error => {
+                        const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
+
+                        return `\t${field}: ${error.message}`;
+                    }).join("\n");
+
+                    throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
+                }
+
+                /*
+                 * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"),
+                 * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling
+                 * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result,
+                 * the schema is compiled here separately from checking for `validateSchema` errors.
+                 */
+                try {
+                    ajv.compile(schema);
+                } catch (err) {
+                    throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`);
+                }
+            }
+
+            // Verify the code.
+            const { getComments } = SourceCode.prototype;
+            let messages;
+
+            // check for validation errors
+            try {
+                configs.normalizeSync();
+                configs.getConfig("test.js");
+            } catch (error) {
+                error.message = `ESLint configuration in rule-tester is invalid: ${error.message}`;
+                throw error;
+            }
+
+            try {
+                SourceCode.prototype.getComments = getCommentsDeprecation;
+                messages = linter.verify(code, configs, filename);
+            } finally {
+                SourceCode.prototype.getComments = getComments;
+            }
+
+            const fatalErrorMessage = messages.find(m => m.fatal);
+
+            assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`);
+
+            // Verify if autofix makes a syntax error or not.
+            if (messages.some(m => m.fix)) {
+                output = SourceCodeFixer.applyFixes(code, messages).output;
+                const errorMessageInFix = linter.verify(output, configs, filename).find(m => m.fatal);
+
+                assert(!errorMessageInFix, [
+                    "A fatal parsing error occurred in autofix.",
+                    `Error: ${errorMessageInFix && errorMessageInFix.message}`,
+                    "Autofix output:",
+                    output
+                ].join("\n"));
+            } else {
+                output = code;
+            }
+
+            return {
+                messages,
+                output,
+                beforeAST,
+                afterAST: cloneDeeplyExcludesParent(afterAST)
+            };
+        }
+
+        /**
+         * Check if the AST was changed
+         * @param {ASTNode} beforeAST AST node before running
+         * @param {ASTNode} afterAST AST node after running
+         * @returns {void}
+         * @private
+         */
+        function assertASTDidntChange(beforeAST, afterAST) {
+            if (!equal(beforeAST, afterAST)) {
+                assert.fail("Rule should not modify AST.");
+            }
+        }
+
+        /**
+         * Check if the template is valid or not
+         * all valid cases go through this
+         * @param {string|Object} item Item to run the rule against
+         * @returns {void}
+         * @private
+         */
+        function testValidTemplate(item) {
+            const code = typeof item === "object" ? item.code : item;
+
+            assert.ok(typeof code === "string", "Test case must specify a string value for 'code'");
+            if (item.name) {
+                assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
+            }
+
+            const result = runRuleForItem(item);
+            const messages = result.messages;
+
+            assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s",
+                messages.length,
+                util.inspect(messages)));
+
+            assertASTDidntChange(result.beforeAST, result.afterAST);
+        }
+
+        /**
+         * Asserts that the message matches its expected value. If the expected
+         * value is a regular expression, it is checked against the actual
+         * value.
+         * @param {string} actual Actual value
+         * @param {string|RegExp} expected Expected value
+         * @returns {void}
+         * @private
+         */
+        function assertMessageMatches(actual, expected) {
+            if (expected instanceof RegExp) {
+
+                // assert.js doesn't have a built-in RegExp match function
+                assert.ok(
+                    expected.test(actual),
+                    `Expected '${actual}' to match ${expected}`
+                );
+            } else {
+                assert.strictEqual(actual, expected);
+            }
+        }
+
+        /**
+         * Check if the template is invalid or not
+         * all invalid cases go through this.
+         * @param {string|Object} item Item to run the rule against
+         * @returns {void}
+         * @private
+         */
+        function testInvalidTemplate(item) {
+            assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'");
+            if (item.name) {
+                assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
+            }
+            assert.ok(item.errors || item.errors === 0,
+                `Did not specify errors for an invalid test of ${ruleName}`);
+
+            if (Array.isArray(item.errors) && item.errors.length === 0) {
+                assert.fail("Invalid cases must have at least one error");
+            }
+
+            const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages");
+            const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null;
+
+            const result = runRuleForItem(item);
+            const messages = result.messages;
+
+            if (typeof item.errors === "number") {
+
+                if (item.errors === 0) {
+                    assert.fail("Invalid cases must have 'error' value greater than 0");
+                }
+
+                assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s",
+                    item.errors,
+                    item.errors === 1 ? "" : "s",
+                    messages.length,
+                    util.inspect(messages)));
+            } else {
+                assert.strictEqual(
+                    messages.length, item.errors.length, util.format(
+                        "Should have %d error%s but had %d: %s",
+                        item.errors.length,
+                        item.errors.length === 1 ? "" : "s",
+                        messages.length,
+                        util.inspect(messages)
+                    )
+                );
+
+                const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleId);
+
+                for (let i = 0, l = item.errors.length; i < l; i++) {
+                    const error = item.errors[i];
+                    const message = messages[i];
+
+                    assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested");
+
+                    if (typeof error === "string" || error instanceof RegExp) {
+
+                        // Just an error message.
+                        assertMessageMatches(message.message, error);
+                    } else if (typeof error === "object" && error !== null) {
+
+                        /*
+                         * Error object.
+                         * This may have a message, messageId, data, node type, line, and/or
+                         * column.
+                         */
+
+                        Object.keys(error).forEach(propertyName => {
+                            assert.ok(
+                                errorObjectParameters.has(propertyName),
+                                `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.`
+                            );
+                        });
+
+                        if (hasOwnProperty(error, "message")) {
+                            assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'.");
+                            assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'.");
+                            assertMessageMatches(message.message, error.message);
+                        } else if (hasOwnProperty(error, "messageId")) {
+                            assert.ok(
+                                ruleHasMetaMessages,
+                                "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'."
+                            );
+                            if (!hasOwnProperty(rule.meta.messages, error.messageId)) {
+                                assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`);
+                            }
+                            assert.strictEqual(
+                                message.messageId,
+                                error.messageId,
+                                `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.`
+                            );
+                            if (hasOwnProperty(error, "data")) {
+
+                                /*
+                                 *  if data was provided, then directly compare the returned message to a synthetic
+                                 *  interpolated message using the same message ID and data provided in the test.
+                                 *  See https://github.com/eslint/eslint/issues/9890 for context.
+                                 */
+                                const unformattedOriginalMessage = rule.meta.messages[error.messageId];
+                                const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data);
+
+                                assert.strictEqual(
+                                    message.message,
+                                    rehydratedMessage,
+                                    `Hydrated message "${rehydratedMessage}" does not match "${message.message}"`
+                                );
+                            }
+                        }
+
+                        assert.ok(
+                            hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true,
+                            "Error must specify 'messageId' if 'data' is used."
+                        );
+
+                        if (error.type) {
+                            assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`);
+                        }
+
+                        if (hasOwnProperty(error, "line")) {
+                            assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`);
+                        }
+
+                        if (hasOwnProperty(error, "column")) {
+                            assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`);
+                        }
+
+                        if (hasOwnProperty(error, "endLine")) {
+                            assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`);
+                        }
+
+                        if (hasOwnProperty(error, "endColumn")) {
+                            assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`);
+                        }
+
+                        if (hasOwnProperty(error, "suggestions")) {
+
+                            // Support asserting there are no suggestions
+                            if (!error.suggestions || (Array.isArray(error.suggestions) && error.suggestions.length === 0)) {
+                                if (Array.isArray(message.suggestions) && message.suggestions.length > 0) {
+                                    assert.fail(`Error should have no suggestions on error with message: "${message.message}"`);
+                                }
+                            } else {
+                                assert.strictEqual(Array.isArray(message.suggestions), true, `Error should have an array of suggestions. Instead received "${message.suggestions}" on error with message: "${message.message}"`);
+                                assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`);
+
+                                error.suggestions.forEach((expectedSuggestion, index) => {
+                                    assert.ok(
+                                        typeof expectedSuggestion === "object" && expectedSuggestion !== null,
+                                        "Test suggestion in 'suggestions' array must be an object."
+                                    );
+                                    Object.keys(expectedSuggestion).forEach(propertyName => {
+                                        assert.ok(
+                                            suggestionObjectParameters.has(propertyName),
+                                            `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.`
+                                        );
+                                    });
+
+                                    const actualSuggestion = message.suggestions[index];
+                                    const suggestionPrefix = `Error Suggestion at index ${index} :`;
+
+                                    if (hasOwnProperty(expectedSuggestion, "desc")) {
+                                        assert.ok(
+                                            !hasOwnProperty(expectedSuggestion, "data"),
+                                            `${suggestionPrefix} Test should not specify both 'desc' and 'data'.`
+                                        );
+                                        assert.strictEqual(
+                                            actualSuggestion.desc,
+                                            expectedSuggestion.desc,
+                                            `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.`
+                                        );
+                                    }
+
+                                    if (hasOwnProperty(expectedSuggestion, "messageId")) {
+                                        assert.ok(
+                                            ruleHasMetaMessages,
+                                            `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.`
+                                        );
+                                        assert.ok(
+                                            hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId),
+                                            `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.`
+                                        );
+                                        assert.strictEqual(
+                                            actualSuggestion.messageId,
+                                            expectedSuggestion.messageId,
+                                            `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.`
+                                        );
+                                        if (hasOwnProperty(expectedSuggestion, "data")) {
+                                            const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId];
+                                            const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data);
+
+                                            assert.strictEqual(
+                                                actualSuggestion.desc,
+                                                rehydratedDesc,
+                                                `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".`
+                                            );
+                                        }
+                                    } else {
+                                        assert.ok(
+                                            !hasOwnProperty(expectedSuggestion, "data"),
+                                            `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.`
+                                        );
+                                    }
+
+                                    if (hasOwnProperty(expectedSuggestion, "output")) {
+                                        const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output;
+
+                                        assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`);
+                                    }
+                                });
+                            }
+                        }
+                    } else {
+
+                        // Message was an unexpected type
+                        assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`);
+                    }
+                }
+            }
+
+            if (hasOwnProperty(item, "output")) {
+                if (item.output === null) {
+                    assert.strictEqual(
+                        result.output,
+                        item.code,
+                        "Expected no autofixes to be suggested"
+                    );
+                } else {
+                    assert.strictEqual(result.output, item.output, "Output is incorrect.");
+                }
+            } else {
+                assert.strictEqual(
+                    result.output,
+                    item.code,
+                    "The rule fixed the code. Please add 'output' property."
+                );
+            }
+
+            assertASTDidntChange(result.beforeAST, result.afterAST);
+        }
+
+        /*
+         * This creates a mocha test suite and pipes all supplied info through
+         * one of the templates above.
+         */
+        this.constructor.describe(ruleName, () => {
+            this.constructor.describe("valid", () => {
+                test.valid.forEach(valid => {
+                    this.constructor[valid.only ? "itOnly" : "it"](
+                        sanitize(typeof valid === "object" ? valid.name || valid.code : valid),
+                        () => {
+                            testValidTemplate(valid);
+                        }
+                    );
+                });
+            });
+
+            this.constructor.describe("invalid", () => {
+                test.invalid.forEach(invalid => {
+                    this.constructor[invalid.only ? "itOnly" : "it"](
+                        sanitize(invalid.name || invalid.code),
+                        () => {
+                            testInvalidTemplate(invalid);
+                        }
+                    );
+                });
+            });
+        });
+    }
+}
+
+FlatRuleTester[DESCRIBE] = FlatRuleTester[IT] = FlatRuleTester[IT_ONLY] = null;
+
+module.exports = FlatRuleTester;
index 7f590a5ea70995e81d19b123e08ac043032bdc17..2af272bd25b358da37d64c665a66680f05e90b3f 100644 (file)
@@ -4,7 +4,7 @@
  */
 "use strict";
 
-/* eslint-env mocha -- Mocha wrapper */
+/* globals describe, it -- Mocha globals */
 
 /*
  * This is a wrapper around mocha to allow for DRY unittests for eslint
@@ -216,6 +216,9 @@ function freezeDeeply(x) {
  * @returns {string} The sanitized text.
  */
 function sanitize(text) {
+    if (typeof text !== "string") {
+        return "";
+    }
     return text.replace(
         /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls
         c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}`
@@ -302,6 +305,36 @@ function getCommentsDeprecation() {
     );
 }
 
+/**
+ * Emit a deprecation warning if function-style format is being used.
+ * @param {string} ruleName Name of the rule.
+ * @returns {void}
+ */
+function emitLegacyRuleAPIWarning(ruleName) {
+    if (!emitLegacyRuleAPIWarning[`warned-${ruleName}`]) {
+        emitLegacyRuleAPIWarning[`warned-${ruleName}`] = true;
+        process.emitWarning(
+            `"${ruleName}" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/developer-guide/working-with-rules`,
+            "DeprecationWarning"
+        );
+    }
+}
+
+/**
+ * Emit a deprecation warning if rule has options but is missing the "meta.schema" property
+ * @param {string} ruleName Name of the rule.
+ * @returns {void}
+ */
+function emitMissingSchemaWarning(ruleName) {
+    if (!emitMissingSchemaWarning[`warned-${ruleName}`]) {
+        emitMissingSchemaWarning[`warned-${ruleName}`] = true;
+        process.emitWarning(
+            `"${ruleName}" rule has options but is missing the "meta.schema" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas`,
+            "DeprecationWarning"
+        );
+    }
+}
+
 //------------------------------------------------------------------------------
 // Public Interface
 //------------------------------------------------------------------------------
@@ -518,6 +551,9 @@ class RuleTester {
             ].concat(scenarioErrors).join("\n"));
         }
 
+        if (typeof rule === "function") {
+            emitLegacyRuleAPIWarning(ruleName);
+        }
 
         linter.defineRule(ruleName, Object.assign({}, rule, {
 
@@ -575,6 +611,15 @@ class RuleTester {
 
             if (hasOwnProperty(item, "options")) {
                 assert(Array.isArray(item.options), "options must be an array");
+                if (
+                    item.options.length > 0 &&
+                    typeof rule === "object" &&
+                    (
+                        !rule.meta || (rule.meta && (typeof rule.meta.schema === "undefined" || rule.meta.schema === null))
+                    )
+                ) {
+                    emitMissingSchemaWarning(ruleName);
+                }
                 config.rules[ruleName] = [1].concat(item.options);
             } else {
                 config.rules[ruleName] = 1;
@@ -691,6 +736,13 @@ class RuleTester {
          * @private
          */
         function testValidTemplate(item) {
+            const code = typeof item === "object" ? item.code : item;
+
+            assert.ok(typeof code === "string", "Test case must specify a string value for 'code'");
+            if (item.name) {
+                assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
+            }
+
             const result = runRuleForItem(item);
             const messages = result.messages;
 
@@ -731,6 +783,10 @@ class RuleTester {
          * @private
          */
         function testInvalidTemplate(item) {
+            assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'");
+            if (item.name) {
+                assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
+            }
             assert.ok(item.errors || item.errors === 0,
                 `Did not specify errors for an invalid test of ${ruleName}`);
 
@@ -963,10 +1019,10 @@ class RuleTester {
          * This creates a mocha test suite and pipes all supplied info through
          * one of the templates above.
          */
-        RuleTester.describe(ruleName, () => {
-            RuleTester.describe("valid", () => {
+        this.constructor.describe(ruleName, () => {
+            this.constructor.describe("valid", () => {
                 test.valid.forEach(valid => {
-                    RuleTester[valid.only ? "itOnly" : "it"](
+                    this.constructor[valid.only ? "itOnly" : "it"](
                         sanitize(typeof valid === "object" ? valid.name || valid.code : valid),
                         () => {
                             testValidTemplate(valid);
@@ -975,9 +1031,9 @@ class RuleTester {
                 });
             });
 
-            RuleTester.describe("invalid", () => {
+            this.constructor.describe("invalid", () => {
                 test.invalid.forEach(invalid => {
-                    RuleTester[invalid.only ? "itOnly" : "it"](
+                    this.constructor[invalid.only ? "itOnly" : "it"](
                         sanitize(invalid.name || invalid.code),
                         () => {
                             testInvalidTemplate(invalid);
index 2fcf1535290352c61952c1d332f5aef34f402dea..112d0ddb8c1176dcad498aa10d8e7195ef5ff734 100644 (file)
@@ -140,7 +140,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce getter and setter pairs in objects and classes",
+            description: "Enforce getter and setter pairs in objects and classes",
             recommended: false,
             url: "https://eslint.org/docs/rules/accessor-pairs"
         },
@@ -299,12 +299,12 @@ module.exports = {
          * @private
          */
         function checkPropertyDescriptor(node) {
-            const namesToCheck = node.properties
+            const namesToCheck = new Set(node.properties
                 .filter(p => p.type === "Property" && p.kind === "init" && !p.computed)
-                .map(({ key }) => key.name);
+                .map(({ key }) => key.name));
 
-            const hasGetter = namesToCheck.includes("get");
-            const hasSetter = namesToCheck.includes("set");
+            const hasGetter = namesToCheck.has("get");
+            const hasSetter = namesToCheck.has("set");
 
             if (checkSetWithoutGet && hasSetter && !hasGetter) {
                 report(node, "missingGetter");
index 0beb138c4e2e79d846285842de00fe467b24ecf1..deeae818fb54de49bf38fb0e954f5a92052b9216 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce linebreaks after opening and before closing array brackets",
+            description: "Enforce linebreaks after opening and before closing array brackets",
             recommended: false,
             url: "https://eslint.org/docs/rules/array-bracket-newline"
         },
index e4912ec17a1a1289854693e2493695fbebf104bd..5e7cea9ba587c2c7b105d52154a5d800d6651bd2 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing inside array brackets",
+            description: "Enforce consistent spacing inside array brackets",
             recommended: false,
             url: "https://eslint.org/docs/rules/array-bracket-spacing"
         },
index fba414c1ef4f50f4ea56c1591af18517c67be08f..7d4a56464331a3d3b993679584c506b5da5c19b9 100644 (file)
@@ -125,7 +125,7 @@ function getArrayMethodName(node) {
         }
     }
 
-    /* istanbul ignore next: unreachable */
+    /* c8 ignore next */
     return null;
 }
 
@@ -139,7 +139,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "enforce `return` statements in callbacks of array methods",
+            description: "Enforce `return` statements in callbacks of array methods",
             recommended: false,
             url: "https://eslint.org/docs/rules/array-callback-return"
         },
index 77f5fc9e9ce72f73167ac8d089250964ad1c4dbd..c762755bd8383ce99fbbb621967e732a9699a97d 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce line breaks after each array element",
+            description: "Enforce line breaks after each array element",
             recommended: false,
             url: "https://eslint.org/docs/rules/array-element-newline"
         },
index 7a141b0d788a15d0bc49107711bdfcb203736088..8bb9e8c4ffa84156e794890170c635f9d0d16ff3 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require braces around arrow function bodies",
+            description: "Require braces around arrow function bodies",
             recommended: false,
             url: "https://eslint.org/docs/rules/arrow-body-style"
         },
index 779ab6fe9c9c2aaf081f3a4c63e3359a1cb58897..05012fc37b7f81efdee4cc61510092fef78f3e59 100644 (file)
@@ -33,7 +33,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require parentheses around arrow function arguments",
+            description: "Require parentheses around arrow function arguments",
             recommended: false,
             url: "https://eslint.org/docs/rules/arrow-parens"
         },
index 9fdcdd58ba70ad397f16f1c7ed7d4a7a7a93a7b5..2dcc175da06b166387febdcacdb6804c75eeff21 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before and after the arrow in arrow functions",
+            description: "Enforce consistent spacing before and after the arrow in arrow functions",
             recommended: false,
             url: "https://eslint.org/docs/rules/arrow-spacing"
         },
index 3a277863ef2e708d73cc6797e5f58102aff6a484..731d06d0f3b2a818ddf168d4c0524cf33265ea0c 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce the use of variables within the scope they are defined",
+            description: "Enforce the use of variables within the scope they are defined",
             recommended: false,
             url: "https://eslint.org/docs/rules/block-scoped-var"
         },
index 53303a9b0041cb145f07a9f65abca5e0ffefb5ec..9fbf1594c47d8bea84540e17422cf5c027fd37ca 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow or enforce spaces inside of blocks after opening block and before closing block",
+            description: "Disallow or enforce spaces inside of blocks after opening block and before closing block",
             recommended: false,
             url: "https://eslint.org/docs/rules/block-spacing"
         },
index f4adb9490ebdf69a2837a6ce8ac94cb90ff13c14..52d89201b9e0870fce8c9d7c809f2f733da5f5d5 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent brace style for blocks",
+            description: "Enforce consistent brace style for blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/brace-style"
         },
index 532faee45187ca005cbf22f9295f8a9e66301260..fe5b649b582f5f6dfebed1057a3a5dfd5243e7ab 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `return` statements after callbacks",
+            description: "Require `return` statements after callbacks",
             recommended: false,
             url: "https://eslint.org/docs/rules/callback-return"
         },
@@ -53,7 +53,7 @@ module.exports = {
             if (!node.parent) {
                 return null;
             }
-            if (types.indexOf(node.parent.type) === -1) {
+            if (!types.includes(node.parent.type)) {
                 return findClosestParentOfType(node.parent, types);
             }
             return node.parent;
@@ -87,7 +87,7 @@ module.exports = {
          * @returns {boolean} Whether or not this function matches our callback name.
          */
         function isCallback(node) {
-            return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1;
+            return containsOnlyIdentifiers(node.callee) && callbacks.includes(sourceCode.getText(node.callee));
         }
 
         /**
index 61dd062edea4ecb31ddb29d7fad4437c09b0f284..ee1b6bf598d31e89f09252b8e066574a91a25009 100644 (file)
@@ -5,6 +5,12 @@
 
 "use strict";
 
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
@@ -15,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce camelcase naming convention",
+            description: "Enforce camelcase naming convention",
             recommended: false,
             url: "https://eslint.org/docs/rules/camelcase"
         },
@@ -140,7 +146,7 @@ module.exports = {
 
         /**
          * Checks if a given binding identifier uses the original name as-is.
-         * - If it's in object destructuring, the original name is its property name.
+         * - If it's in object destructuring or object expression, the original name is its property name.
          * - If it's in import declaration, the original name is its exported name.
          * @param {ASTNode} node The `Identifier` node to check.
          * @returns {boolean} `true` if the identifier uses the original name as-is.
@@ -155,7 +161,7 @@ module.exports = {
             switch (parent.type) {
                 case "Property":
                     return (
-                        parent.parent.type === "ObjectPattern" &&
+                        (parent.parent.type === "ObjectPattern" || parent.parent.type === "ObjectExpression") &&
                         parent.value === valueNode &&
                         !parent.computed &&
                         parent.key.type === "Identifier" &&
@@ -165,7 +171,7 @@ module.exports = {
                 case "ImportSpecifier":
                     return (
                         parent.local === node &&
-                        parent.imported.name === localName
+                        astUtils.getModuleExportName(parent.imported) === localName
                     );
 
                 default:
index 6ea87a70a814edfc3dd079b93767dbc53052ab30..ba798d428580b2aa1c60f90fa6859b78562e1bd5 100644 (file)
@@ -105,7 +105,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce or disallow capitalization of the first letter of a comment",
+            description: "Enforce or disallow capitalization of the first letter of a comment",
             recommended: false,
             url: "https://eslint.org/docs/rules/capitalized-comments"
         },
@@ -185,7 +185,7 @@ module.exports = {
 
             return Boolean(
                 previousTokenOrComment &&
-                ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1
+                ["Block", "Line"].includes(previousTokenOrComment.type)
             );
         }
 
index 1af6084ed8be783c4b8a638fcafb670ac02cab0f..05a915867c37282cee428ca2d69b41dd31942a6c 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce that class methods utilize `this`",
+            description: "Enforce that class methods utilize `this`",
             recommended: false,
             url: "https://eslint.org/docs/rules/class-methods-use-this"
         },
index 232b27cb39cf7d9394e2157aace9d84720d76fb0..9518da90e9e5ec5048ae4048a3c712284f72022b 100644 (file)
@@ -76,7 +76,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow trailing commas",
+            description: "Require or disallow trailing commas",
             recommended: false,
             url: "https://eslint.org/docs/rules/comma-dangle"
         },
@@ -243,8 +243,18 @@ module.exports = {
                     node: lastItem,
                     loc: trailingToken.loc,
                     messageId: "unexpected",
-                    fix(fixer) {
-                        return fixer.remove(trailingToken);
+                    *fix(fixer) {
+                        yield fixer.remove(trailingToken);
+
+                        /*
+                         * Extend the range of the fix to include surrounding tokens to ensure
+                         * that the element after which the comma is removed stays _last_.
+                         * This intentionally makes conflicts in fix ranges with rules that may be
+                         * adding or removing elements in the same autofix pass.
+                         * https://github.com/eslint/eslint/issues/15660
+                         */
+                        yield fixer.insertTextBefore(sourceCode.getTokenBefore(trailingToken), "");
+                        yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), "");
                     }
                 });
             }
@@ -282,8 +292,18 @@ module.exports = {
                         end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end)
                     },
                     messageId: "missing",
-                    fix(fixer) {
-                        return fixer.insertTextAfter(trailingToken, ",");
+                    *fix(fixer) {
+                        yield fixer.insertTextAfter(trailingToken, ",");
+
+                        /*
+                         * Extend the range of the fix to include surrounding tokens to ensure
+                         * that the element after which the comma is inserted stays _last_.
+                         * This intentionally makes conflicts in fix ranges with rules that may be
+                         * adding or removing elements in the same autofix pass.
+                         * https://github.com/eslint/eslint/issues/15660
+                         */
+                        yield fixer.insertTextBefore(trailingToken, "");
+                        yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), "");
                     }
                 });
             }
index 23a517528149833b48d0fce1820c328b446ffbf2..76d5dc46b9c8f17721a8346257b1d81059c22583 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before and after commas",
+            description: "Enforce consistent spacing before and after commas",
             recommended: false,
             url: "https://eslint.org/docs/rules/comma-spacing"
         },
@@ -103,38 +103,6 @@ module.exports = {
             });
         }
 
-        /**
-         * Validates the spacing around a comma token.
-         * @param {Object} tokens The tokens to be validated.
-         * @param {Token} tokens.comma The token representing the comma.
-         * @param {Token} [tokens.left] The last token before the comma.
-         * @param {Token} [tokens.right] The first token after the comma.
-         * @param {Token|ASTNode} reportItem The item to use when reporting an error.
-         * @returns {void}
-         * @private
-         */
-        function validateCommaItemSpacing(tokens, reportItem) {
-            if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) &&
-                    (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma))
-            ) {
-                report(reportItem, "before", tokens.left);
-            }
-
-            if (tokens.right && astUtils.isClosingParenToken(tokens.right)) {
-                return;
-            }
-
-            if (tokens.right && !options.after && tokens.right.type === "Line") {
-                return;
-            }
-
-            if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) &&
-                    (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right))
-            ) {
-                report(reportItem, "after", tokens.right);
-            }
-        }
-
         /**
          * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list.
          * @param {ASTNode} node An ArrayExpression or ArrayPattern node.
@@ -172,18 +140,44 @@ module.exports = {
                         return;
                     }
 
-                    if (token && token.type === "JSXText") {
-                        return;
-                    }
-
                     const previousToken = tokensAndComments[i - 1];
                     const nextToken = tokensAndComments[i + 1];
 
-                    validateCommaItemSpacing({
-                        comma: token,
-                        left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.includes(token) ? null : previousToken,
-                        right: astUtils.isCommaToken(nextToken) ? null : nextToken
-                    }, token);
+                    if (
+                        previousToken &&
+                        !astUtils.isCommaToken(previousToken) && // ignore spacing between two commas
+
+                        /*
+                         * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions).
+                         * In addition to spacing between two commas, this can also ignore:
+                         *
+                         *   - Spacing after `[` (controlled by array-bracket-spacing)
+                         *       Example: [ , ]
+                         *                 ^
+                         *   - Spacing after a comment (for backwards compatibility, this was possibly unintentional)
+                         *       Example: [a, /* * / ,]
+                         *                          ^
+                         */
+                        !commaTokensToIgnore.includes(token) &&
+
+                        astUtils.isTokenOnSameLine(previousToken, token) &&
+                        options.before !== sourceCode.isSpaceBetweenTokens(previousToken, token)
+                    ) {
+                        report(token, "before", previousToken);
+                    }
+
+                    if (
+                        nextToken &&
+                        !astUtils.isCommaToken(nextToken) && // ignore spacing between two commas
+                        !astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens
+                        !astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing
+                        !astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing
+                        !(!options.after && nextToken.type === "Line") && // special case, allow space before line comment
+                        astUtils.isTokenOnSameLine(token, nextToken) &&
+                        options.after !== sourceCode.isSpaceBetweenTokens(token, nextToken)
+                    ) {
+                        report(token, "after", nextToken);
+                    }
                 });
             },
             ArrayExpression: addNullElementsToIgnoreList,
index cbcbe3ae15b0b16eabfeda9bb78c95f628980d44..4969f59d7ef981d61a309c936ca02f093a47e964 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent comma style",
+            description: "Enforce consistent comma style",
             recommended: false,
             url: "https://eslint.org/docs/rules/comma-style"
         },
index b2355556af9d24f824bd82de5211fa317c61675f..541d3a9bb9ad3cf5c50c301e59cf20fd0881dd7d 100644 (file)
@@ -23,7 +23,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum cyclomatic complexity allowed in a program",
+            description: "Enforce a maximum cyclomatic complexity allowed in a program",
             recommended: false,
             url: "https://eslint.org/docs/rules/complexity"
         },
index 4850a8b651ffe99b2a4c24123abf8cc45e87a6f4..3d033fc00bd9acc796013b6fd78c3641863f0fb4 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing inside computed property brackets",
+            description: "Enforce consistent spacing inside computed property brackets",
             recommended: false,
             url: "https://eslint.org/docs/rules/computed-property-spacing"
         },
index fffb4357b65b7ad72c52c06afc99780e90622021..f0072974d11de6db60fbca0e54297959cfdf9a2b 100644 (file)
@@ -46,7 +46,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `return` statements to either always or never specify values",
+            description: "Require `return` statements to either always or never specify values",
             recommended: false,
             url: "https://eslint.org/docs/rules/consistent-return"
         },
index a613f992d7a22287ef1990d43bf04ec10a4c7d8c..947873b8e4a75b62d13db698a27000e14b7998b4 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce consistent naming when capturing the current execution context",
+            description: "Enforce consistent naming when capturing the current execution context",
             recommended: false,
             url: "https://eslint.org/docs/rules/consistent-this"
         },
@@ -65,7 +65,7 @@ module.exports = {
         function checkAssignment(node, name, value) {
             const isThis = value.type === "ThisExpression";
 
-            if (aliases.indexOf(name) !== -1) {
+            if (aliases.includes(name)) {
                 if (!isThis || node.operator && node.operator !== "=") {
                     reportBadAssignment(node, name);
                 }
index defdb91d69dba34dd558f63d9fb21c5c2243ca89..fff658471b0dce82aacb5c0ec30217277e7d4aec 100644 (file)
@@ -122,7 +122,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "require `super()` calls in constructors",
+            description: "Require `super()` calls in constructors",
             recommended: true,
             url: "https://eslint.org/docs/rules/constructor-super"
         },
index 29e73953da6f4694156d0fadcc983bf429a469e5..7b5d140fe66b443dc5f451e722d270b878215e71 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce consistent brace style for all control statements",
+            description: "Enforce consistent brace style for all control statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/curly"
         },
index 34be2894e410473eeb0c949ab9b54807e5a75ad6..313a0d8c904e2338867b59459aa5bc68e46e83f1 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce default clauses in switch statements to be last",
+            description: "Enforce default clauses in switch statements to be last",
             recommended: false,
             url: "https://eslint.org/docs/rules/default-case-last"
         },
index 6ce238529d069fabe6f6b368097f5f05bdddc688..f28de1af906fb49eb68d57abb1d2e7d7cc5b6668 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `default` cases in `switch` statements",
+            description: "Require `default` cases in `switch` statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/default-case"
         },
index ea12a2a558a05b8a9e759919b72446814def9f36..61df5f6d2eb6fc92416c624e4c5bf572f5d446f4 100644 (file)
@@ -11,7 +11,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce default parameters to be last",
+            description: "Enforce default parameters to be last",
             recommended: false,
             url: "https://eslint.org/docs/rules/default-param-last"
         },
index 9dea4f25cf78249b702ac185612068573f07a716..36b50b284cfe9998f6b0642452a50feea79f3fff 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent newlines before and after dots",
+            description: "Enforce consistent newlines before and after dots",
             recommended: false,
             url: "https://eslint.org/docs/rules/dot-location"
         },
index 6f6b5166f76438f3f733d733affff0a89f0292d8..5f6e818cb49040652cbc183117693aa2937104ee 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce dot notation whenever possible",
+            description: "Enforce dot notation whenever possible",
             recommended: false,
             url: "https://eslint.org/docs/rules/dot-notation"
         },
@@ -76,7 +76,7 @@ module.exports = {
         function checkComputedProperty(node, value) {
             if (
                 validIdentifier.test(value) &&
-                (allowKeywords || keywords.indexOf(String(value)) === -1) &&
+                (allowKeywords || !keywords.includes(String(value))) &&
                 !(allowPattern && allowPattern.test(value))
             ) {
                 const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``;
@@ -142,7 +142,7 @@ module.exports = {
                     !allowKeywords &&
                     !node.computed &&
                     node.property.type === "Identifier" &&
-                    keywords.indexOf(String(node.property.name)) !== -1
+                    keywords.includes(String(node.property.name))
                 ) {
                     context.report({
                         node: node.property,
index 393b934125ea8cbc51c51551fa98db893e527451..fb87971fc733588ef1e495e54abefb74600415b1 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow newline at the end of files",
+            description: "Require or disallow newline at the end of files",
             recommended: false,
             url: "https://eslint.org/docs/rules/eol-last"
         },
index b5d784dad6e61b001a0837b4535f7eba871aca47..b3990e214d0214e928e71a6a92513f7e87a1ec71 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require the use of `===` and `!==`",
+            description: "Require the use of `===` and `!==`",
             recommended: false,
             url: "https://eslint.org/docs/rules/eqeqeq"
         },
index d3d825a5766132ab643d1fcdc56ced0a4452b15f..7df3d7e48028194670b3ff8e75eabaf15e8ce1c9 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "enforce \"for\" loop update clause moving the counter in the right direction.",
+            description: "Enforce \"for\" loop update clause moving the counter in the right direction.",
             recommended: true,
             url: "https://eslint.org/docs/rules/for-direction"
         },
index 0391d99c76323e088980dda34621c5af8cde31e9..fec6763a2cdf809e5d5d15d8b941e62fb09d4884 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow spacing between function identifiers and their invocations",
+            description: "Require or disallow spacing between function identifiers and their invocations",
             recommended: false,
             url: "https://eslint.org/docs/rules/func-call-spacing"
         },
index 9cee5fe019ac0c6a4c7b964d79ce0eb0feeefe6e..391b2a2783639e4fabbe6dff9112e2a8252af1e4 100644 (file)
@@ -74,7 +74,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require function names to match the name of the variable or property to which they are assigned",
+            description: "Require function names to match the name of the variable or property to which they are assigned",
             recommended: false,
             url: "https://eslint.org/docs/rules/func-name-matching"
         },
index c7b2072e177d34169f28bfb931feb1e5f9347ef9..ee4664592f267d5695ccaea9cf5196dac2a98f67 100644 (file)
@@ -30,7 +30,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow named `function` expressions",
+            description: "Require or disallow named `function` expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/func-names"
         },
index f71574890c8916fa048471f6f48cb707478eeae6..0e1ba9fab0e7822870b859ff4d0abaa604777670 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce the consistent use of either `function` declarations or expressions",
+            description: "Enforce the consistent use of either `function` declarations or expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/func-style"
         },
index f3cfeee703aa530ceb6ff8fa9f3d31cbf3f21843..46610914622d237af033f13fa4ac23b743c87ae3 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce line breaks between arguments of a function call",
+            description: "Enforce line breaks between arguments of a function call",
             recommended: false,
             url: "https://eslint.org/docs/rules/function-call-argument-newline"
         },
index ed94fad460cefa524c5603223b5bfeb593a72775..e61d17be60322643a9c4ba80bbba01203c762eae 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent line breaks inside function parentheses",
+            description: "Enforce consistent line breaks inside function parentheses",
             recommended: false,
             url: "https://eslint.org/docs/rules/function-paren-newline"
         },
@@ -183,7 +183,7 @@ module.exports = {
         /**
          * Gets the left paren and right paren tokens of a node.
          * @param {ASTNode} node The node with parens
-         * @throws {TypeError} Unexecpted node type.
+         * @throws {TypeError} Unexpected node type.
          * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
          * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression
          * with a single parameter)
@@ -191,10 +191,13 @@ module.exports = {
         function getParenTokens(node) {
             switch (node.type) {
                 case "NewExpression":
-                    if (!node.arguments.length && !(
-                        astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) &&
-                        astUtils.isClosingParenToken(sourceCode.getLastToken(node))
-                    )) {
+                    if (!node.arguments.length &&
+                        !(
+                            astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) &&
+                            astUtils.isClosingParenToken(sourceCode.getLastToken(node)) &&
+                            node.callee.range[1] < node.range[1]
+                        )
+                    ) {
 
                         // If the NewExpression does not have parens (e.g. `new Foo`), return null.
                         return null;
@@ -227,9 +230,13 @@ module.exports = {
                         return null;
                     }
 
+                    const rightParen = node.params.length
+                        ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken)
+                        : sourceCode.getTokenAfter(firstToken);
+
                     return {
                         leftParen: firstToken,
-                        rightParen: sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken)
+                        rightParen
                     };
                 }
 
index 28e81013fcb95ef11db343deeb51c7ab37d81e75..d32b21fff5c54f6a6909367363f7757122d8aa17 100644 (file)
@@ -31,7 +31,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing around `*` operators in generator functions",
+            description: "Enforce consistent spacing around `*` operators in generator functions",
             recommended: false,
             url: "https://eslint.org/docs/rules/generator-star-spacing"
         },
index 03cfce2cf1abc918d9b785579a359862d019a75c..5209ab1504bd48bcccf34e5a95159fecb46ecc83 100644 (file)
@@ -35,7 +35,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "enforce `return` statements in getters",
+            description: "Enforce `return` statements in getters",
             recommended: true,
             url: "https://eslint.org/docs/rules/getter-return"
         },
index f00ca9bf6dd6d83c1980ad57af5e18e6abeda638..ceb0a8e8415448fdf6e664d034678364dbe9fb5d 100644 (file)
@@ -6,7 +6,7 @@
 
 "use strict";
 
-const ACCEPTABLE_PARENTS = [
+const ACCEPTABLE_PARENTS = new Set([
     "AssignmentExpression",
     "VariableDeclarator",
     "MemberExpression",
@@ -16,7 +16,7 @@ const ACCEPTABLE_PARENTS = [
     "Program",
     "VariableDeclaration",
     "ChainExpression"
-];
+]);
 
 /**
  * Finds the eslint-scope reference in the given scope.
@@ -28,10 +28,11 @@ function findReference(scope, node) {
     const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
             reference.identifier.range[1] === node.range[1]);
 
-    /* istanbul ignore else: correctly returns null */
     if (references.length === 1) {
         return references[0];
     }
+
+    /* c8 ignore next */
     return null;
 
 }
@@ -58,7 +59,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `require()` calls to be placed at top-level module scope",
+            description: "Require `require()` calls to be placed at top-level module scope",
             recommended: false,
             url: "https://eslint.org/docs/rules/global-require"
         },
@@ -75,7 +76,7 @@ module.exports = {
                 const currentScope = context.getScope();
 
                 if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) {
-                    const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1);
+                    const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.has(parent.type));
 
                     if (!isGoodRequire) {
                         context.report({ node, messageId: "unexpected" });
index 0fe6f91e4db0fac4e8359671a01402c4225ad8f9..21374be21011f888b0ffca451142d76b3341b722 100644 (file)
@@ -96,7 +96,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require grouped accessor pairs in object literals and classes",
+            description: "Require grouped accessor pairs in object literals and classes",
             recommended: false,
             url: "https://eslint.org/docs/rules/grouped-accessor-pairs"
         },
index 1c52af7d4cde20a8c7bfb80f65401e96678e611e..3b99143fe214d0ff7a8e2970bf312afb0fbdf217 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `for-in` loops to include an `if` statement",
+            description: "Require `for-in` loops to include an `if` statement",
             recommended: false,
             url: "https://eslint.org/docs/rules/guard-for-in"
         },
index f370407743a502d2d54ff79aac7a16d583f7e316..5189564b668357d18a0faee7df5c13e5991e4d4c 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require error handling in callbacks",
+            description: "Require error handling in callbacks",
             recommended: false,
             url: "https://eslint.org/docs/rules/handle-callback-err"
         },
index f7e04ae73765f9913d60b8ee8448677716f02814..5ea61e94f69f24e624dfb2814e3d4d7ecaf3bc52 100644 (file)
@@ -119,7 +119,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified identifiers",
+            description: "Disallow specified identifiers",
             recommended: false,
             url: "https://eslint.org/docs/rules/id-blacklist"
         },
index a0b1f416f46db46055928e4c40f8dfa5e565ada1..fe0a0b50bd2c4811a32aa32daa07ab6bd6473b4e 100644 (file)
@@ -99,7 +99,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified identifiers",
+            description: "Disallow specified identifiers",
             recommended: false,
             url: "https://eslint.org/docs/rules/id-denylist"
         },
index 3701c66e347a7287321da25d25d743ca7ff9305f..99f833fc73b4dfd79e6a68c8d97c41288664fef1 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce minimum and maximum identifier lengths",
+            description: "Enforce minimum and maximum identifier lengths",
             recommended: false,
             url: "https://eslint.org/docs/rules/id-length"
         },
index bcc07a8e372e675601391607c0b7c2f799f593e6..ec87af18d5b7670623efa14ed4a6ab9ed0aca7c4 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require identifiers to match a specified regular expression",
+            description: "Require identifiers to match a specified regular expression",
             recommended: false,
             url: "https://eslint.org/docs/rules/id-match"
         },
@@ -67,6 +67,8 @@ module.exports = {
             onlyDeclarations = !!options.onlyDeclarations,
             ignoreDestructuring = !!options.ignoreDestructuring;
 
+        let globalScope;
+
         //--------------------------------------------------------------------------
         // Helpers
         //--------------------------------------------------------------------------
@@ -77,6 +79,19 @@ module.exports = {
         const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]);
         const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]);
 
+        /**
+         * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
+         * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
+         * @param {ASTNode} node `Identifier` node to check.
+         * @returns {boolean} `true` if the node is a reference to a global variable.
+         */
+        function isReferenceToGlobalVariable(node) {
+            const variable = globalScope.set.get(node.name);
+
+            return variable && variable.defs.length === 0 &&
+                variable.references.some(ref => ref.identifier === node);
+        }
+
         /**
          * Checks if a string matches the provided pattern
          * @param {string} name The string to check.
@@ -155,11 +170,19 @@ module.exports = {
 
         return {
 
+            Program() {
+                globalScope = context.getScope();
+            },
+
             Identifier(node) {
                 const name = node.name,
                     parent = node.parent,
                     effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent;
 
+                if (isReferenceToGlobalVariable(node)) {
+                    return;
+                }
+
                 if (parent.type === "MemberExpression") {
 
                     if (!checkProperties) {
@@ -188,6 +211,17 @@ module.exports = {
                         }
                     }
 
+                // For https://github.com/eslint/eslint/issues/15123
+                } else if (
+                    parent.type === "Property" &&
+                    parent.parent.type === "ObjectExpression" &&
+                    parent.key === node &&
+                    !parent.computed
+                ) {
+                    if (checkProperties && isInvalid(name)) {
+                        report(node);
+                    }
+
                 /*
                  * Properties have their own rules, and
                  * AssignmentPattern nodes can be treated like Properties:
@@ -216,7 +250,7 @@ module.exports = {
                     }
 
                     // never check properties or always ignore destructuring
-                    if (!checkProperties || (ignoreDestructuring && isInsideObjectPattern(node))) {
+                    if ((!checkProperties && !parent.computed) || (ignoreDestructuring && isInsideObjectPattern(node))) {
                         return;
                     }
 
index 71b2437eef83bc7e71fd21dfe0f77b0575bafbe3..c765960267f7da64e9bf0798e3de4f5d94fd3d66 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce the location of arrow function bodies",
+            description: "Enforce the location of arrow function bodies",
             recommended: false,
             url: "https://eslint.org/docs/rules/implicit-arrow-linebreak"
         },
index bd61f6f843121bfe5a919657a5c37fcff4261fe3..d4793bd6360bf906e4a992b0c3f7f0aeac4cee39 100644 (file)
@@ -18,15 +18,15 @@ const astUtils = require("./utils/ast-utils");
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
-
-/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */
+// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway.
+/* c8 ignore next */
 /** @type {import('../shared/types').Rule} */
 module.exports = {
     meta: {
         type: "layout",
 
         docs: {
-            description: "enforce consistent indentation",
+            description: "Enforce consistent indentation",
             recommended: false,
             url: "https://eslint.org/docs/rules/indent-legacy"
         },
@@ -212,10 +212,10 @@ module.exports = {
             if (context.options[0] === "tab") {
                 indentSize = 1;
                 indentType = "tab";
-            } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") {
+            } else /* c8 ignore start */ if (typeof context.options[0] === "number") {
                 indentSize = context.options[0];
                 indentType = "space";
-            }
+            }/* c8 ignore stop */
 
             if (context.options[1]) {
                 const opts = context.options[1];
@@ -753,7 +753,7 @@ module.exports = {
                             if (typeof options.CallExpression.arguments === "number") {
                                 nodeIndent += options.CallExpression.arguments * indentSize;
                             } else if (options.CallExpression.arguments === "first") {
-                                if (parent.arguments.indexOf(node) !== -1) {
+                                if (parent.arguments.includes(node)) {
                                     nodeIndent = parent.arguments[0].loc.start.column;
                                 }
                             } else {
@@ -840,7 +840,7 @@ module.exports = {
                 "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement"
             ];
 
-            if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) {
+            if (node.parent && statementsWithProperties.includes(node.parent.type) && isNodeBodyBlock(node)) {
                 indent = getNodeIndent(node.parent).goodChar;
             } else if (node.parent && node.parent.type === "CatchClause") {
                 indent = getNodeIndent(node.parent.parent).goodChar;
index 6152bc561f9a818971b7d357efd566bdca272e34..cda02035a1deb9e07cf9ac188ff076b4089b8181 100644 (file)
@@ -12,7 +12,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-const createTree = require("functional-red-black-tree");
+const { OrderedMap } = require("js-sdsl");
 
 const astUtils = require("./utils/ast-utils");
 
@@ -135,7 +135,8 @@ class BinarySearchTree {
      * Creates an empty tree
      */
     constructor() {
-        this._rbTree = createTree();
+        this._orderedMap = new OrderedMap();
+        this._orderedMapEnd = this._orderedMap.end();
     }
 
     /**
@@ -145,13 +146,7 @@ class BinarySearchTree {
      * @returns {void}
      */
     insert(key, value) {
-        const iterator = this._rbTree.find(key);
-
-        if (iterator.valid) {
-            this._rbTree = iterator.update(value);
-        } else {
-            this._rbTree = this._rbTree.insert(key, value);
-        }
+        this._orderedMap.setElement(key, value);
     }
 
     /**
@@ -160,9 +155,13 @@ class BinarySearchTree {
      * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists.
      */
     findLe(key) {
-        const iterator = this._rbTree.le(key);
+        const iterator = this._orderedMap.reverseLowerBound(key);
+
+        if (iterator.equals(this._orderedMapEnd)) {
+            return {};
+        }
 
-        return iterator && { key: iterator.key, value: iterator.value };
+        return { key: iterator.pointer[0], value: iterator.pointer[1] };
     }
 
     /**
@@ -177,11 +176,20 @@ class BinarySearchTree {
         if (start === end) {
             return;
         }
-        const iterator = this._rbTree.ge(start);
+        const iterator = this._orderedMap.lowerBound(start);
 
-        while (iterator.valid && iterator.key < end) {
-            this._rbTree = this._rbTree.remove(iterator.key);
-            iterator.next();
+        if (iterator.equals(this._orderedMapEnd)) {
+            return;
+        }
+
+        if (end > this._orderedMap.back()[0]) {
+            while (!iterator.equals(this._orderedMapEnd)) {
+                this._orderedMap.eraseElementByIterator(iterator);
+            }
+        } else {
+            while (iterator.pointer[0] < end) {
+                this._orderedMap.eraseElementByIterator(iterator);
+            }
         }
     }
 }
@@ -500,7 +508,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent indentation",
+            description: "Enforce consistent indentation",
             recommended: false,
             url: "https://eslint.org/docs/rules/indent"
         },
@@ -796,7 +804,7 @@ module.exports = {
             let statement = node.parent && node.parent.parent;
 
             while (
-                statement.type === "UnaryExpression" && ["!", "~", "+", "-"].indexOf(statement.operator) > -1 ||
+                statement.type === "UnaryExpression" && ["!", "~", "+", "-"].includes(statement.operator) ||
                 statement.type === "AssignmentExpression" ||
                 statement.type === "LogicalExpression" ||
                 statement.type === "SequenceExpression" ||
@@ -916,18 +924,6 @@ module.exports = {
                 }
 
                 offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1);
-
-                /*
-                 * For blockless nodes with semicolon-first style, don't indent the semicolon.
-                 * e.g.
-                 * if (foo) bar()
-                 * ; [1, 2, 3].map(foo)
-                 */
-                const lastToken = sourceCode.getLastToken(node);
-
-                if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) {
-                    offsets.setDesiredOffset(lastToken, lastParentToken, 0);
-                }
             }
         }
 
@@ -1223,7 +1219,7 @@ module.exports = {
                 }
             },
 
-            "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body),
+            "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": node => addBlocklessNodeIndent(node.body),
 
             ExportNamedDeclaration(node) {
                 if (node.declaration === null) {
@@ -1271,6 +1267,50 @@ module.exports = {
                 }
             },
 
+            /*
+             * For blockless nodes with semicolon-first style, don't indent the semicolon.
+             * e.g.
+             * if (foo)
+             *     bar()
+             * ; [1, 2, 3].map(foo)
+             *
+             * Traversal into the node sets indentation of the semicolon, so we need to override it on exit.
+             */
+            ":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(node) {
+                let nodesToCheck;
+
+                if (node.type === "IfStatement") {
+                    nodesToCheck = [node.consequent];
+                    if (node.alternate) {
+                        nodesToCheck.push(node.alternate);
+                    }
+                } else {
+                    nodesToCheck = [node.body];
+                }
+
+                for (const nodeToCheck of nodesToCheck) {
+                    const lastToken = sourceCode.getLastToken(nodeToCheck);
+
+                    if (astUtils.isSemicolonToken(lastToken)) {
+                        const tokenBeforeLast = sourceCode.getTokenBefore(lastToken);
+                        const tokenAfterLast = sourceCode.getTokenAfter(lastToken);
+
+                        // override indentation of `;` only if its line looks like a semicolon-first style line
+                        if (
+                            !astUtils.isTokenOnSameLine(tokenBeforeLast, lastToken) &&
+                            tokenAfterLast &&
+                            astUtils.isTokenOnSameLine(lastToken, tokenAfterLast)
+                        ) {
+                            offsets.setDesiredOffset(
+                                lastToken,
+                                sourceCode.getFirstToken(node),
+                                0
+                            );
+                        }
+                    }
+                }
+            },
+
             ImportDeclaration(node) {
                 if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) {
                     const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken);
index ed322a4120af134a85831bdfd04e5624aaa82d76..aef47f5cadcf9e6101ba8c4a95dc67cb41d13166 100644 (file)
@@ -103,6 +103,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
     "no-confusing-arrow": () => require("./no-confusing-arrow"),
     "no-console": () => require("./no-console"),
     "no-const-assign": () => require("./no-const-assign"),
+    "no-constant-binary-expression": () => require("./no-constant-binary-expression"),
     "no-constant-condition": () => require("./no-constant-condition"),
     "no-constructor-return": () => require("./no-constructor-return"),
     "no-continue": () => require("./no-continue"),
@@ -255,6 +256,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
     "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"),
     "prefer-named-capture-group": () => require("./prefer-named-capture-group"),
     "prefer-numeric-literals": () => require("./prefer-numeric-literals"),
+    "prefer-object-has-own": () => require("./prefer-object-has-own"),
     "prefer-object-spread": () => require("./prefer-object-spread"),
     "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"),
     "prefer-reflect": () => require("./prefer-reflect"),
index d952b8925ed33504c2bd0c0264a8056a317fcc8e..b2ddf64fb4b78e974534170dff3af328d1a2c1c9 100644 (file)
@@ -48,7 +48,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow initialization in variable declarations",
+            description: "Require or disallow initialization in variable declarations",
             recommended: false,
             url: "https://eslint.org/docs/rules/init-declarations"
         },
index a0cdfaa62bedb89038a2d8e0ed76095cd6317625..6745bb64b368edb220bd4cbfd35f67d61b60ae1c 100644 (file)
@@ -42,7 +42,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce the consistent use of either double or single quotes in JSX attributes",
+            description: "Enforce the consistent use of either double or single quotes in JSX attributes",
             recommended: false,
             url: "https://eslint.org/docs/rules/jsx-quotes"
         },
@@ -70,7 +70,7 @@ module.exports = {
          * @public
          */
         function usesExpectedQuotes(node) {
-            return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote);
+            return node.value.includes(setting.quote) || astUtils.isSurroundedBy(node.raw, setting.quote);
         }
 
         return {
index ce8bad5bb354901bd022caab83176b75bd37848d..b764b7282ef8312ec33052ba83b42332176897ed 100644 (file)
@@ -9,6 +9,9 @@
 //------------------------------------------------------------------------------
 
 const astUtils = require("./utils/ast-utils");
+const GraphemeSplitter = require("grapheme-splitter");
+
+const splitter = new GraphemeSplitter();
 
 //------------------------------------------------------------------------------
 // Helpers
@@ -139,7 +142,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing between keys and values in object literal properties",
+            description: "Enforce consistent spacing between keys and values in object literal properties",
             recommended: false,
             url: "https://eslint.org/docs/rules/key-spacing"
         },
@@ -508,7 +511,7 @@ module.exports = {
             const startToken = sourceCode.getFirstToken(property);
             const endToken = getLastTokenBeforeColon(property.key);
 
-            return endToken.range[1] - startToken.range[0];
+            return splitter.countGraphemes(sourceCode.getText().slice(startToken.range[0], endToken.range[1]));
         }
 
         /**
index 956fc42656d17662383553819a4e1cc25bbdc91d..59a500f5bfc272362208ff7f3dda7ae8709ad969 100644 (file)
@@ -67,7 +67,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before and after keywords",
+            description: "Enforce consistent spacing before and after keywords",
             recommended: false,
             url: "https://eslint.org/docs/rules/keyword-spacing"
         },
@@ -469,6 +469,7 @@ module.exports = {
                 const asToken = sourceCode.getTokenBefore(node.exported);
 
                 checkSpacingBefore(asToken, PREV_TOKEN_M);
+                checkSpacingAfter(asToken, NEXT_TOKEN_M);
             }
 
             if (node.source) {
@@ -479,6 +480,35 @@ module.exports = {
             }
         }
 
+        /**
+         * Reports `as` keyword of a given node if usage of spacing around this
+         * keyword is invalid.
+         * @param {ASTNode} node An `ImportSpecifier` node to check.
+         * @returns {void}
+         */
+        function checkSpacingForImportSpecifier(node) {
+            if (node.imported.range[0] !== node.local.range[0]) {
+                const asToken = sourceCode.getTokenBefore(node.local);
+
+                checkSpacingBefore(asToken, PREV_TOKEN_M);
+            }
+        }
+
+        /**
+         * Reports `as` keyword of a given node if usage of spacing around this
+         * keyword is invalid.
+         * @param {ASTNode} node An `ExportSpecifier` node to check.
+         * @returns {void}
+         */
+        function checkSpacingForExportSpecifier(node) {
+            if (node.local.range[0] !== node.exported.range[0]) {
+                const asToken = sourceCode.getTokenBefore(node.exported);
+
+                checkSpacingBefore(asToken, PREV_TOKEN_M);
+                checkSpacingAfter(asToken, NEXT_TOKEN_M);
+            }
+        }
+
         /**
          * Reports `as` keyword of a given node if usage of spacing around this
          * keyword is invalid.
@@ -588,6 +618,8 @@ module.exports = {
             YieldExpression: checkSpacingBeforeFirstToken,
 
             // Others
+            ImportSpecifier: checkSpacingForImportSpecifier,
+            ExportSpecifier: checkSpacingForExportSpecifier,
             ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier,
             MethodDefinition: checkSpacingForProperty,
             PropertyDefinition: checkSpacingForProperty,
index 9ce2831dec6d620a30d096ceffac86e723e0d6c8..0631ebe6f32e444522a7863fc0ac9aa24af1a748 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce position of line comments",
+            description: "Enforce position of line comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/line-comment-position"
         },
index 483788aa6ef3de7e6c61822032c14c33de42b576..a5dc39d7967ac1b1431169c079c91292e3c471f3 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent linebreak style",
+            description: "Enforce consistent linebreak style",
             recommended: false,
             url: "https://eslint.org/docs/rules/linebreak-style"
         },
index 74df09b01bd2b4838d9d7e9bb072b3d9755b42b4..bd7d1cd26623e34952e6f7ee3423fc1e4e93b3c9 100644 (file)
@@ -55,7 +55,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require empty lines around comments",
+            description: "Require empty lines around comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/lines-around-comment"
         },
@@ -141,7 +141,7 @@ module.exports = {
             comments = sourceCode.getAllComments(),
             commentLines = getCommentLineNums(comments),
             emptyLines = getEmptyLineNums(lines),
-            commentAndEmptyLines = commentLines.concat(emptyLines);
+            commentAndEmptyLines = new Set(commentLines.concat(emptyLines));
 
         /**
          * Returns whether or not comments are on lines starting with or ending with code
@@ -231,9 +231,15 @@ module.exports = {
             const parent = getParentNodeOfToken(token);
 
             if (parent && isParentNodeType(parent, nodeType)) {
-                const parentStartNodeOrToken = parent.type === "StaticBlock"
-                    ? sourceCode.getFirstToken(parent, { skip: 1 }) // opening brace of the static block
-                    : parent;
+                let parentStartNodeOrToken = parent;
+
+                if (parent.type === "StaticBlock") {
+                    parentStartNodeOrToken = sourceCode.getFirstToken(parent, { skip: 1 }); // opening brace of the static block
+                } else if (parent.type === "SwitchStatement") {
+                    parentStartNodeOrToken = sourceCode.getTokenAfter(parent.discriminant, {
+                        filter: astUtils.isOpeningBraceToken
+                    }); // opening brace of the switch statement
+                }
 
                 return token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1;
             }
@@ -264,7 +270,8 @@ module.exports = {
                 isCommentAtParentStart(token, "ClassBody") ||
                 isCommentAtParentStart(token, "BlockStatement") ||
                 isCommentAtParentStart(token, "StaticBlock") ||
-                isCommentAtParentStart(token, "SwitchCase")
+                isCommentAtParentStart(token, "SwitchCase") ||
+                isCommentAtParentStart(token, "SwitchStatement")
             );
         }
 
@@ -393,7 +400,7 @@ module.exports = {
             const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true });
 
             // check for newline before
-            if (!exceptionStartAllowed && before && !commentAndEmptyLines.includes(prevLineNum) &&
+            if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(prevLineNum) &&
                     !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) {
                 const lineStart = token.range[0] - token.loc.start.column;
                 const range = [lineStart, lineStart];
@@ -408,7 +415,7 @@ module.exports = {
             }
 
             // check for newline after
-            if (!exceptionEndAllowed && after && !commentAndEmptyLines.includes(nextLineNum) &&
+            if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(nextLineNum) &&
                     !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) {
                 context.report({
                     node: token,
index 21884f162e8031d20209a415757f990b39e3e559..816efc979b78cda4883d5bee2fa50ccdc91119e6 100644 (file)
@@ -18,7 +18,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow newlines around directives",
+            description: "Require or disallow newlines around directives",
             recommended: false,
             url: "https://eslint.org/docs/rules/lines-around-directive"
         },
index 1d6b7e7693eadc49a73c4bee3e66cdfc0de15146..26357aa3dde716201e4cad738375e46164530e8c 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow an empty line between class members",
+            description: "Require or disallow an empty line between class members",
             recommended: false,
             url: "https://eslint.org/docs/rules/lines-between-class-members"
         },
index 2157bebe4a9add3553024a8612960aace5a24eb5..0bd626fe6e88db0f3ace6a795fe787d98fc3b9bd 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum number of classes per file",
+            description: "Enforce a maximum number of classes per file",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-classes-per-file"
         },
index 8006ffdef75634af55af5015865a45a7cf453888..6b428ced7635738de8b25a0250591f5e028aa0f3 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum depth that blocks can be nested",
+            description: "Enforce a maximum depth that blocks can be nested",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-depth"
         },
index d05559e5baf2efb2606e7e9a88c1ea86da69d17d..0d3b2af7026c1b6a55bfb76b2972a737499131fb 100644 (file)
@@ -69,7 +69,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce a maximum line length",
+            description: "Enforce a maximum line length",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-len"
         },
index c1b945ca11abeb2926b0240d5e841810a8efc6a1..fad646cc0c31c7c9391648822a2b858b11ddabb1 100644 (file)
@@ -71,7 +71,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum number of lines of code in a function",
+            description: "Enforce a maximum number of lines of code in a function",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-lines-per-function"
         },
@@ -80,7 +80,7 @@ module.exports = {
             OPTIONS_OR_INTEGER_SCHEMA
         ],
         messages: {
-            exceed: "{{name}} has exceeded the limit of lines allowed by {{linesExceed}}. Maximum allowed number of lines per function is {{maxLines}}."
+            exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}."
         }
     },
 
@@ -170,26 +170,18 @@ module.exports = {
                 return;
             }
             let lineCount = 0;
-            let comments = 0;
-            let blankLines = 0;
 
             for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
                 const line = lines[i];
 
                 if (skipComments) {
                     if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) {
-                        if (lineCount <= maxLines) {
-                            comments++;
-                        }
                         continue;
                     }
                 }
 
                 if (skipBlankLines) {
                     if (line.match(/^\s*$/u)) {
-                        if (lineCount <= maxLines) {
-                            blankLines++;
-                        }
                         continue;
                     }
                 }
@@ -199,21 +191,11 @@ module.exports = {
 
             if (lineCount > maxLines) {
                 const name = upperCaseFirst(astUtils.getFunctionNameWithKind(funcNode));
-                const linesExceed = lineCount - maxLines;
-
-                const loc = {
-                    start: {
-                        line: node.loc.start.line + maxLines + (comments + blankLines),
-                        column: 0
-                    },
-                    end: node.loc.end
-                };
 
                 context.report({
                     node,
-                    loc,
                     messageId: "exceed",
-                    data: { name, linesExceed, maxLines }
+                    data: { name, lineCount, maxLines }
                 });
             }
         }
index 31fc657a63c16e273f6fc4d8a5bd3df8ba040f76..d0e5bad3b2b722b76a7e6f406ca54047dd3f8156 100644 (file)
@@ -34,7 +34,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum number of lines per file",
+            description: "Enforce a maximum number of lines per file",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-lines"
         },
@@ -159,10 +159,10 @@ module.exports = {
                 if (skipComments) {
                     const comments = sourceCode.getAllComments();
 
-                    const commentLines = comments.flatMap(getLinesWithoutCode);
+                    const commentLines = new Set(comments.flatMap(getLinesWithoutCode));
 
                     lines = lines.filter(
-                        l => !commentLines.includes(l.lineNumber)
+                        l => !commentLines.has(l.lineNumber)
                     );
                 }
 
index 0d43050779068c457e908aa0aafae9114f6b95c6..3764d5dee959933a4db0616f2ef18e7a1744ae72 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum depth that callbacks can be nested",
+            description: "Enforce a maximum depth that callbacks can be nested",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-nested-callbacks"
         },
index 72379d217d69c976d2d06f0bfcb63324c7d617e8..8de1ab44b8ab548ddf1e7e57657b9a5dcf5a4c6b 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum number of parameters in function definitions",
+            description: "Enforce a maximum number of parameters in function definitions",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-params"
         },
index 61b508cf6cde2611ce7f3afddf80fa910b6ce728..ada9cf0fe5ef40d2a6bac8cf4a6a2de6e5e82a96 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce a maximum number of statements allowed per line",
+            description: "Enforce a maximum number of statements allowed per line",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-statements-per-line"
         },
index ac117e92e725930b452350872d26f52bef9091db..c598b1059d07ddb51feec0b3b88feeba74150a93 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a maximum number of statements allowed in function blocks",
+            description: "Enforce a maximum number of statements allowed in function blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/max-statements"
         },
@@ -126,7 +126,7 @@ module.exports = {
 
             /*
              * This rule does not apply to class static blocks, but we have to track them so
-             * that stataments in them do not count as statements in the enclosing function.
+             * that statements in them do not count as statements in the enclosing function.
              */
             if (node.type === "StaticBlock") {
                 return;
index 7985bc86270b8d757b9695338ea2fa2dfc14ef50..68cd666532dc30f8d629a97d71e946d75078ebb0 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce a particular style for multiline comments",
+            description: "Enforce a particular style for multiline comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/multiline-comment-style"
         },
index 91aa5a1003116ff0b67f518630fce400bc94a77c..62c84bbfed851b964dafbca1004e97c9f5babec6 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce newlines between operands of ternary expressions",
+            description: "Enforce newlines between operands of ternary expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/multiline-ternary"
         },
index 466cfd4c58590926bebc8bc8046aa20229324f58..7e0b21eafb65b04b4e37fa25c0bfcdd1fc08b3f4 100644 (file)
@@ -39,10 +39,10 @@ const CAPS_ALLOWED = [
  */
 function checkArray(obj, key, fallback) {
 
-    /* istanbul ignore if */
+    /* c8 ignore start */
     if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) {
         throw new TypeError(`${key}, if provided, must be an Array`);
-    }
+    }/* c8 ignore stop */
     return obj[key] || fallback;
 }
 
@@ -82,7 +82,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require constructor names to begin with a capital letter",
+            description: "Require constructor names to begin with a capital letter",
             recommended: false,
             url: "https://eslint.org/docs/rules/new-cap"
         },
index 8ee4a2e1d19361a51a3971862c4cbb40da67f975..f5a98a45d4de8297d5d81083da6b2c5be434ed04 100644 (file)
@@ -25,7 +25,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce or disallow parentheses when invoking a constructor with no arguments",
+            description: "Enforce or disallow parentheses when invoking a constructor with no arguments",
             recommended: false,
             url: "https://eslint.org/docs/rules/new-parens"
         },
index e519a3afb6becb882d6e5c2e80db1a1ab1a4ba06..2b4d85846569190696678624975409f019bac70c 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow an empty line after variable declarations",
+            description: "Require or disallow an empty line after variable declarations",
             recommended: false,
             url: "https://eslint.org/docs/rules/newline-after-var"
         },
index f4aa5166f0e8d19d5b5b6ea6ddd284f76bdf99d8..007d94273631ab574a58953337e66df02a400ba8 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require an empty line before `return` statements",
+            description: "Require an empty line before `return` statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/newline-before-return"
         },
@@ -47,7 +47,7 @@ module.exports = {
         function isPrecededByTokens(node, testTokens) {
             const tokenBefore = sourceCode.getTokenBefore(node);
 
-            return testTokens.some(token => tokenBefore.value === token);
+            return testTokens.includes(tokenBefore.value);
         }
 
         /**
index 818bf703d2b7454f7303ed8defa4144a653ae0f2..83844a52b352eb1b48dd06837ef4f45ef8fe8316 100644 (file)
@@ -18,7 +18,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require a newline after each call in a method chain",
+            description: "Require a newline after each call in a method chain",
             recommended: false,
             url: "https://eslint.org/docs/rules/newline-per-chained-call"
         },
index c6f7ddf38db1a3f50e86671a601bbd94ae00a77d..ba0125c877b03022b0451f49d576a6eea916d482 100644 (file)
@@ -88,7 +88,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `alert`, `confirm`, and `prompt`",
+            description: "Disallow the use of `alert`, `confirm`, and `prompt`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-alert"
         },
index 02e6114dadc8f37e69833e73725d177a14224e23..93b79abfd89c5aebd0c2f5d50250a11838457d72 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `Array` constructors",
+            description: "Disallow `Array` constructors",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-array-constructor"
         },
index f940f152e3cecdb877870655dda09d98a670cbdc..52c51862feb7721e6afb58cf9a16863374d3dafd 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow using an async function as a Promise executor",
+            description: "Disallow using an async function as a Promise executor",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-async-promise-executor"
         },
index 3aea39a16b9f3eecd0509dec36ea6ae36c993553..905a793c830377d66978d493bf40d822e6d8e391 100644 (file)
@@ -59,7 +59,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow `await` inside of loops",
+            description: "Disallow `await` inside of loops",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-await-in-loop"
         },
index 1de1619bffa8a01883fa85aea4e4ebadd3aa04a3..172ea046bbe1c0958503ac791b227ddc4b66b0e7 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow bitwise operators",
+            description: "Disallow bitwise operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-bitwise"
         },
@@ -76,7 +76,7 @@ module.exports = {
          * @returns {boolean} Whether or not the node has a bitwise operator.
          */
         function hasBitwiseOperator(node) {
-            return BITWISE_OPERATORS.indexOf(node.operator) !== -1;
+            return BITWISE_OPERATORS.includes(node.operator);
         }
 
         /**
@@ -85,7 +85,7 @@ module.exports = {
          * @returns {boolean} Whether or not the node has a bitwise operator.
          */
         function allowedOperator(node) {
-            return allowed.indexOf(node.operator) !== -1;
+            return allowed.includes(node.operator);
         }
 
         /**
index 678d7032ab447bca31463a3656477f3e4d72fb2c..930039288156d4cb690f1eb3bcbedad7a64baea0 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow use of the `Buffer()` constructor",
+            description: "Disallow use of the `Buffer()` constructor",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-buffer-constructor"
         },
index a6ad94f2fe6a6667095b6070bdc1b8286db02234..884a02bdcf69a312b30329f5f900e539bc577d4b 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `arguments.caller` or `arguments.callee`",
+            description: "Disallow the use of `arguments.caller` or `arguments.callee`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-caller"
         },
index d722f0cf58422f6ad153fddb05fc735e9af89650..6557ba3a03d45bb80e5f0feaa3aff76685546153 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow lexical declarations in case clauses",
+            description: "Disallow lexical declarations in case clauses",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-case-declarations"
         },
index d09c91349680cf7c1c272757998c9deb9206d2c2..49f1ba9649b7e910a0b2a7d56aaa21edad277c7b 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
+            description: "Disallow `catch` clause parameters from shadowing variables in the outer scope",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-catch-shadow"
         },
index f679d4263e860e5d0cd8d84aebf22fedd7361fce..32e48e21188d824dd007613f8726e69efb0e4ad0 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow reassigning class members",
+            description: "Disallow reassigning class members",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-class-assign"
         },
index fb56b99c58b3db4e011cfdaae66aae7fed75c643..9715c2f0f37226c70a21ac5ccb480e5bcbc6c080 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow comparing against -0",
+            description: "Disallow comparing against -0",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-compare-neg-zero"
         },
index 30d5b3bdaee9600aeca91d23738394953a637ced..59efb341f09ea664cfdc29fbcaa3781651593b77 100644 (file)
@@ -34,7 +34,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow assignment operators in conditional expressions",
+            description: "Disallow assignment operators in conditional expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-cond-assign"
         },
index 7b736c1972821d75dee1dff327c92acd2567588d..d2b6641b74fdbc98bb38e86280eb7ec809231662 100644 (file)
@@ -31,7 +31,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow arrow functions where they could be confused with comparisons",
+            description: "Disallow arrow functions where they could be confused with comparisons",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-confusing-arrow"
         },
@@ -41,7 +41,8 @@ module.exports = {
         schema: [{
             type: "object",
             properties: {
-                allowParens: { type: "boolean", default: true }
+                allowParens: { type: "boolean", default: true },
+                onlyOneSimpleParam: { type: "boolean", default: false }
             },
             additionalProperties: false
         }],
@@ -54,6 +55,7 @@ module.exports = {
     create(context) {
         const config = context.options[0] || {};
         const allowParens = config.allowParens || (config.allowParens === void 0);
+        const onlyOneSimpleParam = config.onlyOneSimpleParam;
         const sourceCode = context.getSourceCode();
 
 
@@ -65,7 +67,9 @@ module.exports = {
         function checkArrowFunc(node) {
             const body = node.body;
 
-            if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) {
+            if (isConditional(body) &&
+                !(allowParens && astUtils.isParenthesised(sourceCode, body)) &&
+                !(onlyOneSimpleParam && !(node.params.length === 1 && node.params[0].type === "Identifier"))) {
                 context.report({
                     node,
                     messageId: "confusing",
index c0802e23dc7240cf76b86aedfb7b015ece63949d..bad6b6f4ee8295aea2ced1bab0688b1e530e3edf 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `console`",
+            description: "Disallow the use of `console`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-console"
         },
@@ -72,7 +72,7 @@ module.exports = {
         function isAllowed(node) {
             const propertyName = astUtils.getStaticPropertyName(node);
 
-            return propertyName && allowed.indexOf(propertyName) !== -1;
+            return propertyName && allowed.includes(propertyName);
         }
 
         /**
index b5f7c37a98f6df25da0322cb2635d165dc975b97..55e40c8849f05356603199a0975b0702837fc98f 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow reassigning `const` variables",
+            description: "Disallow reassigning `const` variables",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-const-assign"
         },
diff --git a/eslint/lib/rules/no-constant-binary-expression.js b/eslint/lib/rules/no-constant-binary-expression.js
new file mode 100644 (file)
index 0000000..dccfa2f
--- /dev/null
@@ -0,0 +1,500 @@
+/**
+ * @fileoverview Rule to flag constant comparisons and logical expressions that always/never short circuit
+ * @author Jordan Eldredge <https://jordaneldredge.com>
+ */
+
+"use strict";
+
+const globals = require("globals");
+const { isNullLiteral, isConstant, isReferenceToGlobalVariable, isLogicalAssignmentOperator } = require("./utils/ast-utils");
+
+const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|", "^", "&", "**", "<<", ">>", ">>>"]);
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Test if an AST node has a statically knowable constant nullishness. Meaning,
+ * it will always resolve to a constant value of either: `null`, `undefined`
+ * or not `null` _or_ `undefined`. An expression that can vary between those
+ * three states at runtime would return `false`.
+ * @param {Scope} scope The scope in which the node was found.
+ * @param {ASTNode} node The AST node being tested.
+ * @returns {boolean} Does `node` have constant nullishness?
+ */
+function hasConstantNullishness(scope, node) {
+    switch (node.type) {
+        case "ObjectExpression": // Objects are never nullish
+        case "ArrayExpression": // Arrays are never nullish
+        case "ArrowFunctionExpression": // Functions never nullish
+        case "FunctionExpression": // Functions are never nullish
+        case "ClassExpression": // Classes are never nullish
+        case "NewExpression": // Objects are never nullish
+        case "Literal": // Nullish, or non-nullish, literals never change
+        case "TemplateLiteral": // A string is never nullish
+        case "UpdateExpression": // Numbers are never nullish
+        case "BinaryExpression": // Numbers, strings, or booleans are never nullish
+            return true;
+        case "CallExpression": {
+            if (node.callee.type !== "Identifier") {
+                return false;
+            }
+            const functionName = node.callee.name;
+
+            return (functionName === "Boolean" || functionName === "String" || functionName === "Number") &&
+                isReferenceToGlobalVariable(scope, node.callee);
+        }
+        case "AssignmentExpression":
+            if (node.operator === "=") {
+                return hasConstantNullishness(scope, node.right);
+            }
+
+            /*
+             * Handling short-circuiting assignment operators would require
+             * walking the scope. We won't attempt that (for now...) /
+             */
+            if (isLogicalAssignmentOperator(node.operator)) {
+                return false;
+            }
+
+            /*
+             * The remaining assignment expressions all result in a numeric or
+             * string (non-nullish) value:
+             *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
+             */
+
+            return true;
+        case "UnaryExpression":
+
+            /*
+             * "void" Always returns `undefined`
+             * "typeof" All types are strings, and thus non-nullish
+             * "!" Boolean is never nullish
+             * "delete" Returns a boolean, which is never nullish
+             * Math operators always return numbers or strings, neither of which
+             * are non-nullish "+", "-", "~"
+             */
+
+            return true;
+        case "SequenceExpression": {
+            const last = node.expressions[node.expressions.length - 1];
+
+            return hasConstantNullishness(scope, last);
+        }
+        case "Identifier":
+            return node.name === "undefined" && isReferenceToGlobalVariable(scope, node);
+        case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
+        case "JSXFragment":
+            return false;
+        default:
+            return false;
+    }
+}
+
+/**
+ * Test if an AST node is a boolean value that never changes. Specifically we
+ * test for:
+ * 1. Literal booleans (`true` or `false`)
+ * 2. Unary `!` expressions with a constant value
+ * 3. Constant booleans created via the `Boolean` global function
+ * @param {Scope} scope The scope in which the node was found.
+ * @param {ASTNode} node The node to test
+ * @returns {boolean} Is `node` guaranteed to be a boolean?
+ */
+function isStaticBoolean(scope, node) {
+    switch (node.type) {
+        case "Literal":
+            return typeof node.value === "boolean";
+        case "CallExpression":
+            return node.callee.type === "Identifier" && node.callee.name === "Boolean" &&
+              isReferenceToGlobalVariable(scope, node.callee) &&
+              (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true));
+        case "UnaryExpression":
+            return node.operator === "!" && isConstant(scope, node.argument, true);
+        default:
+            return false;
+    }
+}
+
+
+/**
+ * Test if an AST node will always give the same result when compared to a
+ * boolean value. Note that comparison to boolean values is different than
+ * truthiness.
+ * https://262.ecma-international.org/5.1/#sec-11.9.3
+ *
+ * Javascript `==` operator works by converting the boolean to `1` (true) or
+ * `+0` (false) and then checks the values `==` equality to that number.
+ * @param {Scope} scope The scope in which node was found.
+ * @param {ASTNode} node The node to test.
+ * @returns {boolean} Will `node` always coerce to the same boolean value?
+ */
+function hasConstantLooseBooleanComparison(scope, node) {
+    switch (node.type) {
+        case "ObjectExpression":
+        case "ClassExpression":
+
+            /**
+             * In theory objects like:
+             *
+             * `{toString: () => a}`
+             * `{valueOf: () => a}`
+             *
+             * Or a classes like:
+             *
+             * `class { static toString() { return a } }`
+             * `class { static valueOf() { return a } }`
+             *
+             * Are not constant verifiably when `inBooleanPosition` is
+             * false, but it's an edge case we've opted not to handle.
+             */
+            return true;
+        case "ArrayExpression": {
+            const nonSpreadElements = node.elements.filter(e =>
+
+                // Elements can be `null` in sparse arrays: `[,,]`;
+                e !== null && e.type !== "SpreadElement");
+
+
+            /*
+             * Possible future direction if needed: We could check if the
+             * single value would result in variable boolean comparison.
+             * For now we will err on the side of caution since `[x]` could
+             * evaluate to `[0]` or `[1]`.
+             */
+            return node.elements.length === 0 || nonSpreadElements.length > 1;
+        }
+        case "ArrowFunctionExpression":
+        case "FunctionExpression":
+            return true;
+        case "UnaryExpression":
+            if (node.operator === "void" || // Always returns `undefined`
+                node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1.
+            ) {
+                return true;
+            }
+            if (node.operator === "!") {
+                return isConstant(scope, node.argument, true);
+            }
+
+            /*
+             * We won't try to reason about +, -, ~, or delete
+             * In theory, for the mathematical operators, we could look at the
+             * argument and try to determine if it coerces to a constant numeric
+             * value.
+             */
+            return false;
+        case "NewExpression": // Objects might have custom `.valueOf` or `.toString`.
+            return false;
+        case "CallExpression": {
+            if (node.callee.type === "Identifier" &&
+                node.callee.name === "Boolean" &&
+                isReferenceToGlobalVariable(scope, node.callee)
+            ) {
+                return node.arguments.length === 0 || isConstant(scope, node.arguments[0], true);
+            }
+            return false;
+        }
+        case "Literal": // True or false, literals never change
+            return true;
+        case "Identifier":
+            return node.name === "undefined" && isReferenceToGlobalVariable(scope, node);
+        case "TemplateLiteral":
+
+            /*
+             * In theory we could try to check if the quasi are sufficient to
+             * prove that the expression will always be true, but it would be
+             * tricky to get right. For example: `000.${foo}000`
+             */
+            return node.expressions.length === 0;
+        case "AssignmentExpression":
+            if (node.operator === "=") {
+                return hasConstantLooseBooleanComparison(scope, node.right);
+            }
+
+            /*
+             * Handling short-circuiting assignment operators would require
+             * walking the scope. We won't attempt that (for now...)
+             *
+             * The remaining assignment expressions all result in a numeric or
+             * string (non-nullish) values which could be truthy or falsy:
+             *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
+             */
+            return false;
+        case "SequenceExpression": {
+            const last = node.expressions[node.expressions.length - 1];
+
+            return hasConstantLooseBooleanComparison(scope, last);
+        }
+        case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
+        case "JSXFragment":
+            return false;
+        default:
+            return false;
+    }
+}
+
+
+/**
+ * Test if an AST node will always give the same result when _strictly_ compared
+ * to a boolean value. This can happen if the expression can never be boolean, or
+ * if it is always the same boolean value.
+ * @param {Scope} scope The scope in which the node was found.
+ * @param {ASTNode} node The node to test
+ * @returns {boolean} Will `node` always give the same result when compared to a
+ * static boolean value?
+ */
+function hasConstantStrictBooleanComparison(scope, node) {
+    switch (node.type) {
+        case "ObjectExpression": // Objects are not booleans
+        case "ArrayExpression": // Arrays are not booleans
+        case "ArrowFunctionExpression": // Functions are not booleans
+        case "FunctionExpression":
+        case "ClassExpression": // Classes are not booleans
+        case "NewExpression": // Objects are not booleans
+        case "TemplateLiteral": // Strings are not booleans
+        case "Literal": // True, false, or not boolean, literals never change.
+        case "UpdateExpression": // Numbers are not booleans
+            return true;
+        case "BinaryExpression":
+            return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator);
+        case "UnaryExpression": {
+            if (node.operator === "delete") {
+                return false;
+            }
+            if (node.operator === "!") {
+                return isConstant(scope, node.argument, true);
+            }
+
+            /*
+             * The remaining operators return either strings or numbers, neither
+             * of which are boolean.
+             */
+            return true;
+        }
+        case "SequenceExpression": {
+            const last = node.expressions[node.expressions.length - 1];
+
+            return hasConstantStrictBooleanComparison(scope, last);
+        }
+        case "Identifier":
+            return node.name === "undefined" && isReferenceToGlobalVariable(scope, node);
+        case "AssignmentExpression":
+            if (node.operator === "=") {
+                return hasConstantStrictBooleanComparison(scope, node.right);
+            }
+
+            /*
+             * Handling short-circuiting assignment operators would require
+             * walking the scope. We won't attempt that (for now...)
+             */
+            if (isLogicalAssignmentOperator(node.operator)) {
+                return false;
+            }
+
+            /*
+             * The remaining assignment expressions all result in either a number
+             * or a string, neither of which can ever be boolean.
+             */
+            return true;
+        case "CallExpression": {
+            if (node.callee.type !== "Identifier") {
+                return false;
+            }
+            const functionName = node.callee.name;
+
+            if (
+                (functionName === "String" || functionName === "Number") &&
+                isReferenceToGlobalVariable(scope, node.callee)
+            ) {
+                return true;
+            }
+            if (functionName === "Boolean" && isReferenceToGlobalVariable(scope, node.callee)) {
+                return (
+                    node.arguments.length === 0 || isConstant(scope, node.arguments[0], true));
+            }
+            return false;
+        }
+        case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
+        case "JSXFragment":
+            return false;
+        default:
+            return false;
+    }
+}
+
+/**
+ * Test if an AST node will always result in a newly constructed object
+ * @param {Scope} scope The scope in which the node was found.
+ * @param {ASTNode} node The node to test
+ * @returns {boolean} Will `node` always be new?
+ */
+function isAlwaysNew(scope, node) {
+    switch (node.type) {
+        case "ObjectExpression":
+        case "ArrayExpression":
+        case "ArrowFunctionExpression":
+        case "FunctionExpression":
+        case "ClassExpression":
+            return true;
+        case "NewExpression": {
+            if (node.callee.type !== "Identifier") {
+                return false;
+            }
+
+            /*
+             * All the built-in constructors are always new, but
+             * user-defined constructors could return a sentinel
+             * object.
+             *
+             * Catching these is especially useful for primitive constructures
+             * which return boxed values, a surprising gotcha' in JavaScript.
+             */
+            return Object.hasOwnProperty.call(globals.builtin, node.callee.name) &&
+              isReferenceToGlobalVariable(scope, node.callee);
+        }
+        case "Literal":
+
+            // Regular expressions are objects, and thus always new
+            return typeof node.regex === "object";
+        case "SequenceExpression": {
+            const last = node.expressions[node.expressions.length - 1];
+
+            return isAlwaysNew(scope, last);
+        }
+        case "AssignmentExpression":
+            if (node.operator === "=") {
+                return isAlwaysNew(scope, node.right);
+            }
+            return false;
+        case "ConditionalExpression":
+            return isAlwaysNew(scope, node.consequent) && isAlwaysNew(scope, node.alternate);
+        case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
+        case "JSXFragment":
+            return false;
+        default:
+            return false;
+    }
+}
+
+/**
+ * Checks whether or not a node is `null` or `undefined`. Similar to the one
+ * found in ast-utils.js, but this one correctly handles the edge case that
+ * `undefined` has been redefined.
+ * @param {Scope} scope Scope in which the expression was found.
+ * @param {ASTNode} node A node to check.
+ * @returns {boolean} Whether or not the node is a `null` or `undefined`.
+ * @public
+ */
+function isNullOrUndefined(scope, node) {
+    return (
+        isNullLiteral(node) ||
+        (node.type === "Identifier" && node.name === "undefined" && isReferenceToGlobalVariable(scope, node)) ||
+        (node.type === "UnaryExpression" && node.operator === "void")
+    );
+}
+
+
+/**
+ * Checks if one operand will cause the result to be constant.
+ * @param {Scope} scope Scope in which the expression was found.
+ * @param {ASTNode} a One side of the expression
+ * @param {ASTNode} b The other side of the expression
+ * @param {string} operator The binary expression operator
+ * @returns {ASTNode | null} The node which will cause the expression to have a constant result.
+ */
+function findBinaryExpressionConstantOperand(scope, a, b, operator) {
+    if (operator === "==" || operator === "!=") {
+        if (
+            (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b)) ||
+            (isStaticBoolean(scope, a) && hasConstantLooseBooleanComparison(scope, b))
+        ) {
+            return b;
+        }
+    } else if (operator === "===" || operator === "!==") {
+        if (
+            (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b)) ||
+            (isStaticBoolean(scope, a) && hasConstantStrictBooleanComparison(scope, b))
+        ) {
+            return b;
+        }
+    }
+    return null;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+/** @type {import('../shared/types').Rule} */
+module.exports = {
+    meta: {
+        type: "problem",
+        docs: {
+            description: "Disallow expressions where the operation doesn't affect the value",
+            recommended: false,
+            url: "https://eslint.org/docs/rules/no-constant-binary-expression"
+        },
+        schema: [],
+        messages: {
+            constantBinaryOperand: "Unexpected constant binary expression. Compares constantly with the {{otherSide}}-hand side of the `{{operator}}`.",
+            constantShortCircuit: "Unexpected constant {{property}} on the left-hand side of a `{{operator}}` expression.",
+            alwaysNew: "Unexpected comparison to newly constructed object. These two values can never be equal.",
+            bothAlwaysNew: "Unexpected comparison of two newly constructed objects. These two values can never be equal."
+        }
+    },
+
+    create(context) {
+        return {
+            LogicalExpression(node) {
+                const { operator, left } = node;
+                const scope = context.getScope();
+
+                if ((operator === "&&" || operator === "||") && isConstant(scope, left, true)) {
+                    context.report({ node: left, messageId: "constantShortCircuit", data: { property: "truthiness", operator } });
+                } else if (operator === "??" && hasConstantNullishness(scope, left)) {
+                    context.report({ node: left, messageId: "constantShortCircuit", data: { property: "nullishness", operator } });
+                }
+            },
+            BinaryExpression(node) {
+                const scope = context.getScope();
+                const { right, left, operator } = node;
+                const rightConstantOperand = findBinaryExpressionConstantOperand(scope, left, right, operator);
+                const leftConstantOperand = findBinaryExpressionConstantOperand(scope, right, left, operator);
+
+                if (rightConstantOperand) {
+                    context.report({ node: rightConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "left" } });
+                } else if (leftConstantOperand) {
+                    context.report({ node: leftConstantOperand, messageId: "constantBinaryOperand", data: { operator, otherSide: "right" } });
+                } else if (operator === "===" || operator === "!==") {
+                    if (isAlwaysNew(scope, left)) {
+                        context.report({ node: left, messageId: "alwaysNew" });
+                    } else if (isAlwaysNew(scope, right)) {
+                        context.report({ node: right, messageId: "alwaysNew" });
+                    }
+                } else if (operator === "==" || operator === "!=") {
+
+                    /*
+                     * If both sides are "new", then both sides are objects and
+                     * therefore they will be compared by reference even with `==`
+                     * equality.
+                     */
+                    if (isAlwaysNew(scope, left) && isAlwaysNew(scope, right)) {
+                        context.report({ node: left, messageId: "bothAlwaysNew" });
+                    }
+                }
+
+            }
+
+            /*
+             * In theory we could handle short-circuiting assignment operators,
+             * for some constant values, but that would require walking the
+             * scope to find the value of the variable being assigned. This is
+             * dependant on https://github.com/eslint/eslint/issues/13776
+             *
+             * AssignmentExpression() {},
+             */
+        };
+    }
+};
index 0bcb31931e4205bbd695cb46bb4512b32a42b428..2ef687f6dca7ebd83d865896ebc7c80e98c619de 100644 (file)
@@ -5,6 +5,8 @@
 
 "use strict";
 
+const { isConstant } = require("./utils/ast-utils");
+
 //------------------------------------------------------------------------------
 // Helpers
 //------------------------------------------------------------------------------
@@ -19,7 +21,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow constant expressions in conditions",
+            description: "Disallow constant expressions in conditions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-constant-condition"
         },
@@ -53,155 +55,6 @@ module.exports = {
         // Helpers
         //--------------------------------------------------------------------------
 
-        /**
-         * Returns literal's value converted to the Boolean type
-         * @param {ASTNode} node any `Literal` node
-         * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy,
-         *  `null` when it cannot be determined.
-         */
-        function getBooleanValue(node) {
-            if (node.value === null) {
-
-                /*
-                 * it might be a null literal or bigint/regex literal in unsupported environments .
-                 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral
-                 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral
-                 */
-
-                if (node.raw === "null") {
-                    return false;
-                }
-
-                // regex is always truthy
-                if (typeof node.regex === "object") {
-                    return true;
-                }
-
-                return null;
-            }
-
-            return !!node.value;
-        }
-
-        /**
-         * Checks if a branch node of LogicalExpression short circuits the whole condition
-         * @param {ASTNode} node The branch of main condition which needs to be checked
-         * @param {string} operator The operator of the main LogicalExpression.
-         * @returns {boolean} true when condition short circuits whole condition
-         */
-        function isLogicalIdentity(node, operator) {
-            switch (node.type) {
-                case "Literal":
-                    return (operator === "||" && getBooleanValue(node) === true) ||
-                           (operator === "&&" && getBooleanValue(node) === false);
-
-                case "UnaryExpression":
-                    return (operator === "&&" && node.operator === "void");
-
-                case "LogicalExpression":
-
-                    /*
-                     * handles `a && false || b`
-                     * `false` is an identity element of `&&` but not `||`
-                     */
-                    return operator === node.operator &&
-                             (
-                                 isLogicalIdentity(node.left, operator) ||
-                                 isLogicalIdentity(node.right, operator)
-                             );
-
-                case "AssignmentExpression":
-                    return ["||=", "&&="].includes(node.operator) &&
-                        operator === node.operator.slice(0, -1) &&
-                        isLogicalIdentity(node.right, operator);
-
-                // no default
-            }
-            return false;
-        }
-
-        /**
-         * Checks if a node has a constant truthiness value.
-         * @param {ASTNode} node The AST node to check.
-         * @param {boolean} inBooleanPosition `false` if checking branch of a condition.
-         *  `true` in all other cases
-         * @returns {Bool} true when node's truthiness is constant
-         * @private
-         */
-        function isConstant(node, inBooleanPosition) {
-
-            // node.elements can return null values in the case of sparse arrays ex. [,]
-            if (!node) {
-                return true;
-            }
-            switch (node.type) {
-                case "Literal":
-                case "ArrowFunctionExpression":
-                case "FunctionExpression":
-                case "ObjectExpression":
-                case "ClassExpression":
-                    return true;
-                case "TemplateLiteral":
-                    return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) ||
-                        node.expressions.every(exp => isConstant(exp, inBooleanPosition));
-
-                case "ArrayExpression": {
-                    if (node.parent.type === "BinaryExpression" && node.parent.operator === "+") {
-                        return node.elements.every(element => isConstant(element, false));
-                    }
-                    return true;
-                }
-
-                case "UnaryExpression":
-                    if (
-                        node.operator === "void" ||
-                        node.operator === "typeof" && inBooleanPosition
-                    ) {
-                        return true;
-                    }
-
-                    if (node.operator === "!") {
-                        return isConstant(node.argument, true);
-                    }
-
-                    return isConstant(node.argument, false);
-
-                case "BinaryExpression":
-                    return isConstant(node.left, false) &&
-                            isConstant(node.right, false) &&
-                            node.operator !== "in";
-
-                case "LogicalExpression": {
-                    const isLeftConstant = isConstant(node.left, inBooleanPosition);
-                    const isRightConstant = isConstant(node.right, inBooleanPosition);
-                    const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator));
-                    const isRightShortCircuit = (inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator));
-
-                    return (isLeftConstant && isRightConstant) ||
-                        isLeftShortCircuit ||
-                        isRightShortCircuit;
-                }
-                case "NewExpression":
-                    return inBooleanPosition;
-                case "AssignmentExpression":
-                    if (node.operator === "=") {
-                        return isConstant(node.right, inBooleanPosition);
-                    }
-
-                    if (["||=", "&&="].includes(node.operator) && inBooleanPosition) {
-                        return isLogicalIdentity(node.right, node.operator.slice(0, -1));
-                    }
-
-                    return false;
-
-                case "SequenceExpression":
-                    return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition);
-
-                // no default
-            }
-            return false;
-        }
-
         /**
          * Tracks when the given node contains a constant condition.
          * @param {ASTNode} node The AST node to check.
@@ -209,7 +62,7 @@ module.exports = {
          * @private
          */
         function trackConstantConditionLoop(node) {
-            if (node.test && isConstant(node.test, true)) {
+            if (node.test && isConstant(context.getScope(), node.test, true)) {
                 loopsInCurrentScope.add(node);
             }
         }
@@ -234,7 +87,7 @@ module.exports = {
          * @private
          */
         function reportIfConstant(node) {
-            if (node.test && isConstant(node.test, true)) {
+            if (node.test && isConstant(context.getScope(), node.test, true)) {
                 context.report({ node: node.test, messageId: "unexpected" });
             }
         }
index f8a717c75e5261fe384bf6d94719fd7087786e36..911a32abcae552879f01d9aec9e76ef22b2a7589 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow returning value from constructor",
+            description: "Disallow returning value from constructor",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-constructor-return"
         },
index 8658a7984bb6bb9e77f6160e33bb4894e64a1dbf..80381fc3f84e6fe4251b23213a314620e8e66621 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `continue` statements",
+            description: "Disallow `continue` statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-continue"
         },
index 04f3449fb1931e0e140a6734c20ccd8ff0eae967..ba108437257440ec60ff1bc2b4b8629926725bb6 100644 (file)
@@ -30,10 +30,12 @@ const collector = new (class {
         }
     }
 
-    collectControlChars(regexpStr) {
+    collectControlChars(regexpStr, flags) {
+        const uFlag = typeof flags === "string" && flags.includes("u");
+
         try {
             this._source = regexpStr;
-            this._validator.validatePattern(regexpStr); // Call onCharacter hook
+            this._validator.validatePattern(regexpStr, void 0, void 0, uFlag); // Call onCharacter hook
         } catch {
 
             // Ignore syntax errors in RegExp.
@@ -52,7 +54,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow control characters in regular expressions",
+            description: "Disallow control characters in regular expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-control-regex"
         },
@@ -68,13 +70,15 @@ module.exports = {
 
         /**
          * Get the regex expression
-         * @param {ASTNode} node node to evaluate
-         * @returns {RegExp|null} Regex if found else null
+         * @param {ASTNode} node `Literal` node to evaluate
+         * @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal
+         * or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined,
+         * the `flags` property will be `null`.
          * @private
          */
-        function getRegExpPattern(node) {
+        function getRegExp(node) {
             if (node.regex) {
-                return node.regex.pattern;
+                return node.regex;
             }
             if (typeof node.value === "string" &&
                 (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") &&
@@ -82,7 +86,15 @@ module.exports = {
                 node.parent.callee.name === "RegExp" &&
                 node.parent.arguments[0] === node
             ) {
-                return node.value;
+                const pattern = node.value;
+                const flags =
+                    node.parent.arguments.length > 1 &&
+                    node.parent.arguments[1].type === "Literal" &&
+                    typeof node.parent.arguments[1].value === "string"
+                        ? node.parent.arguments[1].value
+                        : null;
+
+                return { pattern, flags };
             }
 
             return null;
@@ -90,10 +102,11 @@ module.exports = {
 
         return {
             Literal(node) {
-                const pattern = getRegExpPattern(node);
+                const regExp = getRegExp(node);
 
-                if (pattern) {
-                    const controlCharacters = collector.collectControlChars(pattern);
+                if (regExp) {
+                    const { pattern, flags } = regExp;
+                    const controlCharacters = collector.collectControlChars(pattern, flags);
 
                     if (controlCharacters.length > 0) {
                         context.report({
index e62db1b7393b1afef75ae675ffecf8bf04bfafdd..3b88079a0fb89c9896073611e5053a3ae5bec84a 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow the use of `debugger`",
+            description: "Disallow the use of `debugger`",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-debugger"
         },
index 1d1c710b0982008e7b89bb2a1cb0ee7a6a6a1bde..41021bd46a7b99e32287e5654d9c0e2d3c5a91e8 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow deleting variables",
+            description: "Disallow deleting variables",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-delete-var"
         },
index 175f6c20104d3ad2e794370cf84244e0bdd68d94..dd1c5782a58940bb449bc50fff9020033edd3f0c 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow division operators explicitly at the beginning of regular expressions",
+            description: "Disallow division operators explicitly at the beginning of regular expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-div-regex"
         },
index 13090e19a87e28068c10b41ba315508152a64ac1..faf253793ecb7959d4d02535468fc6a54669dbc1 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate arguments in `function` definitions",
+            description: "Disallow duplicate arguments in `function` definitions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-dupe-args"
         },
index ae61f164ca9218a2d7a9dd49c391c0e4fb43b9c2..8eca7878a4628e648dcbdf621c58a6c0ffceec6d 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate class members",
+            description: "Disallow duplicate class members",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-dupe-class-members"
         },
index 1e1d549185d72b575d5d3e4b8bfde6d7c143dccb..49db5ec7c6c824315dd229d8ef3eebaa728f41bb 100644 (file)
@@ -52,7 +52,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate conditions in if-else-if chains",
+            description: "Disallow duplicate conditions in if-else-if chains",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-dupe-else-if"
         },
index dac13cf9e098c28353a14bc6459829738d46d03c..65c34bc5fd1eb53c10f13f5e6037c9fff9b9220e 100644 (file)
@@ -88,7 +88,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate keys in object literals",
+            description: "Disallow duplicate keys in object literals",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-dupe-keys"
         },
index a0c0b31308b0e891d70484e25926472fd48256f8..d436afdd00731b9954fc956cd80228d8050c7694 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate case labels",
+            description: "Disallow duplicate case labels",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-duplicate-case"
         },
index 947bb30c2e175a887f38ab7feae5ad2518183257..619e2588e91c366a51427f5c6d96ea4fc0e53cd8 100644 (file)
@@ -233,7 +233,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow duplicate module imports",
+            description: "Disallow duplicate module imports",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-duplicate-imports"
         },
index 3662fc8c6e727da69fa4cdec22c3b2433691a420..d1da3aa49cb4ff5817b7a750de627b96c4bb53cf 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `else` blocks after `return` statements in `if` statements",
+            description: "Disallow `else` blocks after `return` statements in `if` statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-else-return"
         },
index f75f59191aae40820394b1c5a52177059ffe6683..2d294f4bded54935f0546ae957461be09699fe58 100644 (file)
@@ -30,7 +30,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow empty character classes in regular expressions",
+            description: "Disallow empty character classes in regular expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-empty-character-class"
         },
index 6e73d63b98a4fc5f027c3e71eecc33aca4e85d9c..4c9daa931e269944c7a022516b80d709626d4bf7 100644 (file)
@@ -95,7 +95,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow empty functions",
+            description: "Disallow empty functions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-empty-function"
         },
@@ -144,7 +144,7 @@ module.exports = {
                 filter: astUtils.isCommentToken
             });
 
-            if (allowed.indexOf(kind) === -1 &&
+            if (!allowed.includes(kind) &&
                 node.body.type === "BlockStatement" &&
                 node.body.body.length === 0 &&
                 innerComments.length === 0
index 2de575fcf0849f26c58f83526bc579bff7220151..5a497f039720d3faf74e62a6bc8f8444b7bdcdfc 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow empty destructuring patterns",
+            description: "Disallow empty destructuring patterns",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-empty-pattern"
         },
index f04ee2cb3209cc7b7088bf699f6215b7199ce47c..459140a2e7057481092db32f6e5f95e4b66629fc 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow empty block statements",
+            description: "Disallow empty block statements",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-empty"
         },
index b693737126d62c20511062f7880314704b5a4f16..9a886803dc5196cd875fc68602805347da4806d9 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `null` comparisons without type-checking operators",
+            description: "Disallow `null` comparisons without type-checking operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-eq-null"
         },
index ae6d71b80c99e3460f6ac61eefa21b57d7934514..03f7b1f691c16e9f4a73908511e1378403e3cdd3 100644 (file)
@@ -43,7 +43,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `eval()`",
+            description: "Disallow the use of `eval()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-eval"
         },
@@ -72,21 +72,25 @@ module.exports = {
         let funcInfo = null;
 
         /**
-         * Pushs a variable scope (Program or Function) information to the stack.
+         * Pushs a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack.
+         * Top-level scopes are handled separately.
          *
          * This is used in order to check whether or not `this` binding is a
          * reference to the global object.
-         * @param {ASTNode} node A node of the scope. This is one of Program,
-         *      FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression.
+         * @param {ASTNode} node A node of the scope.
+         *      For functions, this is one of FunctionDeclaration, FunctionExpression.
+         *      For class static blocks, this is StaticBlock.
+         *      For class field initializers, this can be any node that is PropertyDefinition#value.
          * @returns {void}
          */
-        function enterVarScope(node) {
+        function enterThisScope(node) {
             const strict = context.getScope().isStrict;
 
             funcInfo = {
                 upper: funcInfo,
                 node,
                 strict,
+                isTopLevelOfScript: false,
                 defaultThis: false,
                 initialized: strict
             };
@@ -96,7 +100,7 @@ module.exports = {
          * Pops a variable scope from the stack.
          * @returns {void}
          */
-        function exitVarScope() {
+        function exitThisScope() {
             funcInfo = funcInfo.upper;
         }
 
@@ -222,12 +226,14 @@ module.exports = {
                     strict =
                         scope.isStrict ||
                         node.sourceType === "module" ||
-                        (features.globalReturn && scope.childScopes[0].isStrict);
+                        (features.globalReturn && scope.childScopes[0].isStrict),
+                    isTopLevelOfScript = node.sourceType !== "module" && !features.globalReturn;
 
                 funcInfo = {
                     upper: null,
                     node,
                     strict,
+                    isTopLevelOfScript,
                     defaultThis: true,
                     initialized: true
                 };
@@ -236,21 +242,19 @@ module.exports = {
             "Program:exit"() {
                 const globalScope = context.getScope();
 
-                exitVarScope();
+                exitThisScope();
                 reportAccessingEval(globalScope);
                 reportAccessingEvalViaGlobalObject(globalScope);
             },
 
-            FunctionDeclaration: enterVarScope,
-            "FunctionDeclaration:exit": exitVarScope,
-            FunctionExpression: enterVarScope,
-            "FunctionExpression:exit": exitVarScope,
-            ArrowFunctionExpression: enterVarScope,
-            "ArrowFunctionExpression:exit": exitVarScope,
-            "PropertyDefinition > *.value": enterVarScope,
-            "PropertyDefinition > *.value:exit": exitVarScope,
-            StaticBlock: enterVarScope,
-            "StaticBlock:exit": exitVarScope,
+            FunctionDeclaration: enterThisScope,
+            "FunctionDeclaration:exit": exitThisScope,
+            FunctionExpression: enterThisScope,
+            "FunctionExpression:exit": exitThisScope,
+            "PropertyDefinition > *.value": enterThisScope,
+            "PropertyDefinition > *.value:exit": exitThisScope,
+            StaticBlock: enterThisScope,
+            "StaticBlock:exit": exitThisScope,
 
             ThisExpression(node) {
                 if (!isMember(node.parent, "eval")) {
@@ -269,7 +273,8 @@ module.exports = {
                     );
                 }
 
-                if (!funcInfo.strict && funcInfo.defaultThis) {
+                // `this` at the top level of scripts always refers to the global object
+                if (funcInfo.isTopLevelOfScript || (!funcInfo.strict && funcInfo.defaultThis)) {
 
                     // `this.eval` is possible built-in `eval`.
                     report(node.parent);
index 3db14206b0b3fefccb269b761a8eca49f1671a7f..4c77b1128adbbdb17a3e382ee26741d7beaca025 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow reassigning exceptions in `catch` clauses",
+            description: "Disallow reassigning exceptions in `catch` clauses",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-ex-assign"
         },
index 771200f26f7579c01570ad3d54c5bcc292a5e70c..52c6bd3110331e9988b507580702406a01efd4ca 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow extending native types",
+            description: "Disallow extending native types",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-extend-native"
         },
index 561cb1a33f8591226f0712f83a24d5d527432b7c..caf6d8b1f80e6df0167aa95f5a4e76075bdee0b9 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary calls to `.bind()`",
+            description: "Disallow unnecessary calls to `.bind()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-extra-bind"
         },
index f45ac616ed907721201a57eb4f1851595e6f80b2..45252fee0e90ad6ad8679f733312ac2db1a92917 100644 (file)
@@ -24,7 +24,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary boolean casts",
+            description: "Disallow unnecessary boolean casts",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-extra-boolean-cast"
         },
@@ -51,13 +51,13 @@ module.exports = {
         const sourceCode = context.getSourceCode();
 
         // Node types which have a test which will coerce values to booleans.
-        const BOOLEAN_NODE_TYPES = [
+        const BOOLEAN_NODE_TYPES = new Set([
             "IfStatement",
             "DoWhileStatement",
             "WhileStatement",
             "ConditionalExpression",
             "ForStatement"
-        ];
+        ]);
 
         /**
          * Check if a node is a Boolean function or constructor.
@@ -95,7 +95,7 @@ module.exports = {
                 (isBooleanFunctionOrConstructorCall(node.parent) &&
                 node === node.parent.arguments[0]) ||
 
-                (BOOLEAN_NODE_TYPES.indexOf(node.parent.type) !== -1 &&
+                (BOOLEAN_NODE_TYPES.has(node.parent.type) &&
                     node === node.parent.test) ||
 
                 // !<bool>
@@ -188,7 +188,7 @@ module.exports = {
                     }
                     return precedence(node) <= precedence(parent);
 
-                /* istanbul ignore next */
+                /* c8 ignore next */
                 default:
                     throw new Error(`Unexpected parent type: ${parent.type}`);
             }
index 9186a9faca127f4405fcf8b7c055e2fe63ede4b0..bda3dd0efb00fc4634bad93437d60587d4f34fc4 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary labels",
+            description: "Disallow unnecessary labels",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-extra-label"
         },
index 5b54ae26fe3e50d12054898337c301d0d55f2502..246a5a0d5e1e6fa581e7efd176536ee74671e1cc 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow unnecessary parentheses",
+            description: "Disallow unnecessary parentheses",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-extra-parens"
         },
@@ -634,10 +634,10 @@ module.exports = {
 
                 currentNode = currentNode.parent;
 
-                /* istanbul ignore if */
+                /* c8 ignore start */
                 if (currentNode === null) {
                     throw new Error("Nodes are not in the ancestor-descendant relationship.");
-                }
+                }/* c8 ignore stop */
 
                 path.push(currentNode);
             }
index 89d9fce57f05760521108d0c7e2d9764abaa4a82..c61ad37dce8df63df4d503873154cebb2859d4ae 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary semicolons",
+            description: "Disallow unnecessary semicolons",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-extra-semi"
         },
@@ -98,7 +98,7 @@ module.exports = {
                         "WithStatement"
                     ];
 
-                if (allowedParentTypes.indexOf(parent.type) === -1) {
+                if (!allowedParentTypes.includes(parent.type)) {
                     report(node);
                 }
             },
index f3b7c8554ad7b232d3805dba4877b25c7977d2f1..536aa213f8a3f2c7e879b5b3dd5e2456212c4c76 100644 (file)
@@ -64,7 +64,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow fallthrough of `case` statements",
+            description: "Disallow fallthrough of `case` statements",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-fallthrough"
         },
@@ -76,6 +76,10 @@ module.exports = {
                     commentPattern: {
                         type: "string",
                         default: ""
+                    },
+                    allowEmptyCase: {
+                        type: "boolean",
+                        default: false
                     }
                 },
                 additionalProperties: false
@@ -91,6 +95,7 @@ module.exports = {
         const options = context.options[0] || {};
         let currentCodePath = null;
         const sourceCode = context.getSourceCode();
+        const allowEmptyCase = options.allowEmptyCase || false;
 
         /*
          * We need to use leading comments of the next SwitchCase node because
@@ -104,7 +109,6 @@ module.exports = {
         } else {
             fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT;
         }
-
         return {
             onCodePathStart(codePath) {
                 currentCodePath = codePath;
@@ -119,7 +123,8 @@ module.exports = {
                  * Checks whether or not there is a fallthrough comment.
                  * And reports the previous fallthrough node if that does not exist.
                  */
-                if (fallthroughCase && !hasFallthroughComment(fallthroughCase, node, context, fallthroughCommentPattern)) {
+
+                if (fallthroughCase && (!hasFallthroughComment(fallthroughCase, node, context, fallthroughCommentPattern))) {
                     context.report({
                         messageId: node.test ? "case" : "default",
                         node
@@ -137,7 +142,7 @@ module.exports = {
                  * And allows empty cases and the last case.
                  */
                 if (currentCodePath.currentSegments.some(isReachable) &&
-                    (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) &&
+                    (node.consequent.length > 0 || (!allowEmptyCase && hasBlankLinesBetween(node, nextToken))) &&
                     node.parent.cases[node.parent.cases.length - 1] !== node) {
                     fallthroughCase = node;
                 }
index 8831bb824d07ce092ce57b65e2b355397bb45426..cce50bf9dadb8554148111afc770bbe60786eb8b 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow leading or trailing decimal points in numeric literals",
+            description: "Disallow leading or trailing decimal points in numeric literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-floating-decimal"
         },
index 04a7dd370551a502f01b6fb95e9042db972be3fc..2c8fa6a8e08e09117625bc2ed91315fe9a00ef8c 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow reassigning `function` declarations",
+            description: "Disallow reassigning `function` declarations",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-func-assign"
         },
index 340c6c798c39fb13e905badc43bcd56b523395fd..9f2f0ee3642f47545d7e6a4e28b7a37ae3fdf98e 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow assignments to native objects or read-only global variables",
+            description: "Disallow assignments to native objects or read-only global variables",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-global-assign"
         },
@@ -78,7 +78,7 @@ module.exports = {
          * @returns {void}
          */
         function checkVariable(variable) {
-            if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) {
+            if (variable.writeable === false && !exceptions.includes(variable.name)) {
                 variable.references.forEach(checkReference);
             }
         }
index f646093f55581b7450dca85a5d5f97d42bcaba8c..c2367715d9da7d8b702355db5de3412cea1bb0f1 100644 (file)
@@ -30,9 +30,9 @@ function parseOptions(options) {
 }
 
 /**
- * Checks whether or not a node is a double logical nigating.
+ * Checks whether or not a node is a double logical negating.
  * @param {ASTNode} node An UnaryExpression node to check.
- * @returns {boolean} Whether or not the node is a double logical nigating.
+ * @returns {boolean} Whether or not the node is a double logical negating.
  */
 function isDoubleLogicalNegating(node) {
     return (
@@ -173,7 +173,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow shorthand type conversions",
+            description: "Disallow shorthand type conversions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-implicit-coercion"
         },
@@ -257,7 +257,7 @@ module.exports = {
                 let operatorAllowed;
 
                 // !!foo
-                operatorAllowed = options.allow.indexOf("!!") >= 0;
+                operatorAllowed = options.allow.includes("!!");
                 if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) {
                     const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`;
 
@@ -265,7 +265,7 @@ module.exports = {
                 }
 
                 // ~foo.indexOf(bar)
-                operatorAllowed = options.allow.indexOf("~") >= 0;
+                operatorAllowed = options.allow.includes("~");
                 if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) {
 
                     // `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case.
@@ -276,7 +276,7 @@ module.exports = {
                 }
 
                 // +foo
-                operatorAllowed = options.allow.indexOf("+") >= 0;
+                operatorAllowed = options.allow.includes("+");
                 if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) {
                     const recommendation = `Number(${sourceCode.getText(node.argument)})`;
 
@@ -289,7 +289,7 @@ module.exports = {
                 let operatorAllowed;
 
                 // 1 * foo
-                operatorAllowed = options.allow.indexOf("*") >= 0;
+                operatorAllowed = options.allow.includes("*");
                 const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node);
 
                 if (nonNumericOperand) {
@@ -299,7 +299,7 @@ module.exports = {
                 }
 
                 // "" + foo
-                operatorAllowed = options.allow.indexOf("+") >= 0;
+                operatorAllowed = options.allow.includes("+");
                 if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) {
                     const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`;
 
@@ -310,7 +310,7 @@ module.exports = {
             AssignmentExpression(node) {
 
                 // foo += ""
-                const operatorAllowed = options.allow.indexOf("+") >= 0;
+                const operatorAllowed = options.allow.includes("+");
 
                 if (!operatorAllowed && options.string && isAppendEmptyString(node)) {
                     const code = sourceCode.getText(getNonEmptyOperand(node));
index 5dd6aa71acd86231dccc465ee2c9247b2c17c055..934630ea0708d61c91c49aba8cc2f78fd7cd44da 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow declarations in the global scope",
+            description: "Disallow declarations in the global scope",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-implicit-globals"
         },
index 38de5b31ccc377c0be7b5f22bc1f88eae93c5e0d..44f146171aa0276191517a4c975f5c1b833b1d67 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `eval()`-like methods",
+            description: "Disallow the use of `eval()`-like methods",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-implied-eval"
         },
index 385386e9a4379072e10e72cc77c835fde08a9f32..fc104fe6c46b69cb365bf84381892b31678ad6a3 100644 (file)
@@ -180,7 +180,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow assigning to imported bindings",
+            description: "Disallow assigning to imported bindings",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-import-assign"
         },
index 2ed7feb46b839d84c8ad3cfb4922894edf2cf028..366f567f67095d57dcd7d3c4adb9a8f978164f62 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow inline comments after code",
+            description: "Disallow inline comments after code",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-inline-comments"
         },
index 3b0feb71a3faa45718431394eff5ab2b1bfdd46c..932816641e090bf71e21ec5d79a2a070ae339f47 100644 (file)
@@ -48,7 +48,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow variable or `function` declarations in nested blocks",
+            description: "Disallow variable or `function` declarations in nested blocks",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-inner-declarations"
         },
index 92ac5125e60a29b9295523b47b935ddef89b8307..0f1d9c7bedc696183e2ac66a4a3b3ad2eab64c2c 100644 (file)
@@ -23,7 +23,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow invalid regular expression strings in `RegExp` constructors",
+            description: "Disallow invalid regular expression strings in `RegExp` constructors",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-invalid-regexp"
         },
index 5f9b9f871ecf6b9d1b0d3518e00906b58924655b..b9cb43af5d7c2d9a31869d68e9953ba228ebd21e 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects.
+ * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`.
  * @author Toru Nagashima
  */
 
 
 const astUtils = require("./utils/ast-utils");
 
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Determines if the given code path is a code path with lexical `this` binding.
+ * That is, if `this` within the code path refers to `this` of surrounding code path.
+ * @param {CodePath} codePath Code path.
+ * @param {ASTNode} node Node that started the code path.
+ * @returns {boolean} `true` if it is a code path with lexical `this` binding.
+ */
+function isCodePathWithLexicalThis(codePath, node) {
+    return codePath.origin === "function" && node.type === "ArrowFunctionExpression";
+}
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
@@ -21,7 +36,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `this` keywords outside of classes or class-like objects",
+            description: "Disallow use of `this` in contexts where the value of `this` is `undefined`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-invalid-this"
         },
@@ -72,71 +87,53 @@ module.exports = {
             return current;
         };
 
-        /**
-         * Pushs new checking context into the stack.
-         *
-         * The checking context is not initialized yet.
-         * Because most functions don't have `this` keyword.
-         * When `this` keyword was found, the checking context is initialized.
-         * @param {ASTNode} node A function node that was entered.
-         * @returns {void}
-         */
-        function enterFunction(node) {
-
-            // `this` can be invalid only under strict mode.
-            stack.push({
-                init: !context.getScope().isStrict,
-                node,
-                valid: true
-            });
-        }
+        return {
 
-        /**
-         * Pops the current checking context from the stack.
-         * @returns {void}
-         */
-        function exitFunction() {
-            stack.pop();
-        }
+            onCodePathStart(codePath, node) {
+                if (isCodePathWithLexicalThis(codePath, node)) {
+                    return;
+                }
 
-        return {
+                if (codePath.origin === "program") {
+                    const scope = context.getScope();
+                    const features = context.parserOptions.ecmaFeatures || {};
+
+                    // `this` at the top level of scripts always refers to the global object
+                    stack.push({
+                        init: true,
+                        node,
+                        valid: !(
+                            node.sourceType === "module" ||
+                            (features.globalReturn && scope.childScopes[0].isStrict)
+                        )
+                    });
 
-            /*
-             * `this` is invalid only under strict mode.
-             * Modules is always strict mode.
-             */
-            Program(node) {
-                const scope = context.getScope(),
-                    features = context.parserOptions.ecmaFeatures || {};
+                    return;
+                }
 
+                /*
+                 * `init: false` means that `valid` isn't determined yet.
+                 * Most functions don't use `this`, and the calculation for `valid`
+                 * is relatively costly, so we'll calculate it lazily when the first
+                 * `this` within the function is traversed. A special case are non-strict
+                 * functions, because `this` refers to the global object and therefore is
+                 * always valid, so we can set `init: true` right away.
+                 */
                 stack.push({
-                    init: true,
+                    init: !context.getScope().isStrict,
                     node,
-                    valid: !(
-                        scope.isStrict ||
-                        node.sourceType === "module" ||
-                        (features.globalReturn && scope.childScopes[0].isStrict)
-                    )
+                    valid: true
                 });
             },
 
-            "Program:exit"() {
+            onCodePathEnd(codePath, node) {
+                if (isCodePathWithLexicalThis(codePath, node)) {
+                    return;
+                }
+
                 stack.pop();
             },
 
-            FunctionDeclaration: enterFunction,
-            "FunctionDeclaration:exit": exitFunction,
-            FunctionExpression: enterFunction,
-            "FunctionExpression:exit": exitFunction,
-
-            // Field initializers are implicit functions.
-            "PropertyDefinition > *.value": enterFunction,
-            "PropertyDefinition > *.value:exit": exitFunction,
-
-            // Class static blocks are implicit functions.
-            StaticBlock: enterFunction,
-            "StaticBlock:exit": exitFunction,
-
             // Reports if `this` of the current context is invalid.
             ThisExpression(node) {
                 const current = stack.getCurrent();
index 65c4d67285cb1b2959175c7d56cd5208719dcf3f..d1646c7b8a16e3427a2848459ec6864f07054cfe 100644 (file)
@@ -31,7 +31,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow irregular whitespace",
+            description: "Disallow irregular whitespace",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-irregular-whitespace"
         },
index d11267286c808cfbe73e91002cbeb36640222ab1..3550c7b111b43c85bfd973f294ba36bd9d595820 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of the `__iterator__` property",
+            description: "Disallow the use of the `__iterator__` property",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-iterator"
         },
index 50211811ac80f12ddde0a8010a593c8d536a909f..a07d283f522b5ed33ca13b409893397df16ec396 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow labels that share a name with a variable",
+            description: "Disallow labels that share a name with a variable",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-label-var"
         },
index 2e79f378a9bf1e39d189c4a6083e4e068bd6a3dc..7257307f0cd8a41a2843e09eae14d6a6fc3548d3 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow labeled statements",
+            description: "Disallow labeled statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-labels"
         },
@@ -98,7 +98,7 @@ module.exports = {
                 info = info.upper;
             }
 
-            /* istanbul ignore next: syntax error */
+            /* c8 ignore next */
             return "other";
         }
 
index f9fe9514dd7f64d07f4afd33e7162d150d8236f8..eb97f958c3c13efa5b58cbedfc2ed97f06540b79 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary nested blocks",
+            description: "Disallow unnecessary nested blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-lone-blocks"
         },
@@ -91,7 +91,7 @@ module.exports = {
         };
 
         // ES6: report blocks without block-level bindings, or that's only child of another block
-        if (context.parserOptions.ecmaVersion >= 6) {
+        if (context.languageOptions.ecmaVersion >= 2015) {
             ruleDef = {
                 BlockStatement(node) {
                     if (isLoneBlock(node)) {
index 9abd4650b561984457c4779a87a0ae9985a716b0..0774b9fa30fceb7f8e035d5f38fe420bf68ebe25 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `if` statements as the only statement in `else` blocks",
+            description: "Disallow `if` statements as the only statement in `else` blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-lonely-if"
         },
index c5460616dc13cc9e1090d496528d3e943730d58e..f81a71336800a8cdec1a56e0d0a59212f342efea 100644 (file)
@@ -125,7 +125,7 @@ function isSafe(loopNode, reference) {
      * The reference is every reference of the upper scope's variable we are
      * looking now.
      *
-     * It's safeafe if the reference matches one of the following condition.
+     * It's safe if the reference matches one of the following condition.
      * - is readonly.
      * - doesn't exist inside a local function and after the border.
      * @param {eslint-scope.Reference} upperRef A reference to check.
@@ -154,7 +154,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow function declarations that contain unsafe references inside loop statements",
+            description: "Disallow function declarations that contain unsafe references inside loop statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-loop-func"
         },
index fefc7b768fe9bca5d5d7a8a1684bc4ab7b2efa60..6dc6d864dcdf9931632af7324f55cf8cc79a9f93 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow literal numbers that lose precision",
+            description: "Disallow literal numbers that lose precision",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-loss-of-precision"
         },
index dfcd593ecbef51df46605332ac4ee0546cc8ab65..9b08588155652f372a3f1928b8352d2fa9e64079 100644 (file)
@@ -32,7 +32,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow magic numbers",
+            description: "Disallow magic numbers",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-magic-numbers"
         },
@@ -80,7 +80,7 @@ module.exports = {
         const config = context.options[0] || {},
             detectObjects = !!config.detectObjects,
             enforceConst = !!config.enforceConst,
-            ignore = (config.ignore || []).map(normalizeIgnoreValue),
+            ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)),
             ignoreArrayIndexes = !!config.ignoreArrayIndexes,
             ignoreDefaultValues = !!config.ignoreDefaultValues;
 
@@ -92,7 +92,7 @@ module.exports = {
          * @returns {boolean} true if the value is ignored
          */
         function isIgnoredValue(value) {
-            return ignore.indexOf(value) !== -1;
+            return ignore.has(value);
         }
 
         /**
@@ -209,7 +209,7 @@ module.exports = {
                         });
                     }
                 } else if (
-                    okTypes.indexOf(parent.type) === -1 ||
+                    !okTypes.includes(parent.type) ||
                     (parent.type === "AssignmentExpression" && parent.left.type === "Identifier")
                 ) {
                     context.report({
index 94b28784a1032f2a0ea8851544ca1b90224c4d05..667d066e81c7eabe0528338789124084a8b65301 100644 (file)
@@ -4,13 +4,16 @@
 "use strict";
 
 const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils");
-const { RegExpParser, visitRegExpAST } = require("regexpp");
+const { RegExpValidator, RegExpParser, visitRegExpAST } = require("regexpp");
 const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode");
+const astUtils = require("./utils/ast-utils.js");
 
 //------------------------------------------------------------------------------
 // Helpers
 //------------------------------------------------------------------------------
 
+const REGEXPP_LATEST_ECMA_VERSION = 2022;
+
 /**
  * Iterate character sequences of a given nodes.
  *
@@ -104,11 +107,13 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow characters which are made with multiple code points in character class syntax",
+            description: "Disallow characters which are made with multiple code points in character class syntax",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-misleading-character-class"
         },
 
+        hasSuggestions: true,
+
         schema: [],
 
         messages: {
@@ -116,10 +121,12 @@ module.exports = {
             combiningClass: "Unexpected combined character in character class.",
             emojiModifier: "Unexpected modified Emoji in character class.",
             regionalIndicatorSymbol: "Unexpected national flag in character class.",
-            zwj: "Unexpected joined character sequence in character class."
+            zwj: "Unexpected joined character sequence in character class.",
+            suggestUnicodeFlag: "Add unicode 'u' flag to regex."
         }
     },
     create(context) {
+        const sourceCode = context.getSourceCode();
         const parser = new RegExpParser();
 
         /**
@@ -127,17 +134,10 @@ module.exports = {
          * @param {Node} node The node to report.
          * @param {string} pattern The regular expression pattern to verify.
          * @param {string} flags The flags of the regular expression.
+         * @param {Function} unicodeFixer Fixer for missing "u" flag.
          * @returns {void}
          */
-        function verify(node, pattern, flags) {
-            const has = {
-                surrogatePairWithoutUFlag: false,
-                combiningClass: false,
-                variationSelector: false,
-                emojiModifier: false,
-                regionalIndicatorSymbol: false,
-                zwj: false
-            };
+        function verify(node, pattern, flags, unicodeFixer) {
             let patternNode;
 
             try {
@@ -153,26 +153,75 @@ module.exports = {
                 return;
             }
 
+            const foundKinds = new Set();
+
             visitRegExpAST(patternNode, {
                 onCharacterClassEnter(ccNode) {
                     for (const chars of iterateCharacterSequence(ccNode.elements)) {
                         for (const kind of kinds) {
-                            has[kind] = has[kind] || hasCharacterSequence[kind](chars);
+                            if (hasCharacterSequence[kind](chars)) {
+                                foundKinds.add(kind);
+                            }
                         }
                     }
                 }
             });
 
-            for (const kind of kinds) {
-                if (has[kind]) {
-                    context.report({ node, messageId: kind });
+            for (const kind of foundKinds) {
+                let suggest;
+
+                if (kind === "surrogatePairWithoutUFlag") {
+                    suggest = [{
+                        messageId: "suggestUnicodeFlag",
+                        fix: unicodeFixer
+                    }];
                 }
+
+                context.report({
+                    node,
+                    messageId: kind,
+                    suggest
+                });
             }
         }
 
+        /**
+         * Checks if the given regular expression pattern would be valid with the `u` flag.
+         * @param {string} pattern The regular expression pattern to verify.
+         * @returns {boolean} `true` if the pattern would be valid with the `u` flag.
+         * `false` if the pattern would be invalid with the `u` flag or the configured
+         * ecmaVersion doesn't support the `u` flag.
+         */
+        function isValidWithUnicodeFlag(pattern) {
+            const { ecmaVersion } = context.parserOptions;
+
+            // ecmaVersion is unknown or it doesn't support the 'u' flag
+            if (typeof ecmaVersion !== "number" || ecmaVersion <= 5) {
+                return false;
+            }
+
+            const validator = new RegExpValidator({
+                ecmaVersion: Math.min(ecmaVersion + 2009, REGEXPP_LATEST_ECMA_VERSION)
+            });
+
+            try {
+                validator.validatePattern(pattern, void 0, void 0, /* uFlag = */ true);
+            } catch {
+                return false;
+            }
+
+            return true;
+        }
+
         return {
             "Literal[regex]"(node) {
-                verify(node, node.regex.pattern, node.regex.flags);
+                verify(node, node.regex.pattern, node.regex.flags, fixer => {
+                    if (!isValidWithUnicodeFlag(node.regex.pattern)) {
+                        return null;
+                    }
+
+                    return fixer.insertTextAfter(node, "u");
+                });
             },
             "Program"() {
                 const scope = context.getScope();
@@ -191,7 +240,31 @@ module.exports = {
                     const flags = getStringIfConstant(flagsNode, scope);
 
                     if (typeof pattern === "string") {
-                        verify(node, pattern, flags || "");
+                        verify(node, pattern, flags || "", fixer => {
+
+                            if (!isValidWithUnicodeFlag(pattern)) {
+                                return null;
+                            }
+
+                            if (node.arguments.length === 1) {
+                                const penultimateToken = sourceCode.getLastToken(node, { skip: 1 }); // skip closing parenthesis
+
+                                return fixer.insertTextAfter(
+                                    penultimateToken,
+                                    astUtils.isCommaToken(penultimateToken)
+                                        ? ' "u",'
+                                        : ', "u"'
+                                );
+                            }
+
+                            if ((flagsNode.type === "Literal" && typeof flagsNode.value === "string") || flagsNode.type === "TemplateLiteral") {
+                                const range = [flagsNode.range[0], flagsNode.range[1] - 1];
+
+                                return fixer.insertTextAfterRange(range, "u");
+                            }
+
+                            return null;
+                        });
                     }
                 }
             }
index c75d01147c9030d81f3085ea848f0f63b709493b..cb6e9363c15801545784a8b3bd0a1c35bc4e5299 100644 (file)
@@ -64,7 +64,7 @@ function normalizeOptions(options = {}) {
  * @returns {boolean} `true` if such group existed.
  */
 function includesBothInAGroup(groups, left, right) {
-    return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1);
+    return groups.some(group => group.includes(left) && group.includes(right));
 }
 
 /**
@@ -88,7 +88,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow mixed binary operators",
+            description: "Disallow mixed binary operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-mixed-operators"
         },
index 5e05cf7a72adcb86595444b19ada95bb9b47b1de..4e97057441601ff825a65ca36a867c5f90512fc6 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `require` calls to be mixed with regular variable declarations",
+            description: "Disallow `require` calls to be mixed with regular variable declarations",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-mixed-requires"
         },
@@ -160,7 +160,7 @@ module.exports = {
                 return REQ_COMPUTED;
             }
 
-            if (BUILTIN_MODULES.indexOf(arg.value) !== -1) {
+            if (BUILTIN_MODULES.includes(arg.value)) {
 
                 // "var fs = require('fs');"
                 return REQ_CORE;
index f82a352caa4f33caecba9721b3b3b0f1caf57c12..b2d5a040b843b9fd56ae45a7272c2b5b9dd46b27 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow mixed spaces and tabs for indentation",
+            description: "Disallow mixed spaces and tabs for indentation",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs"
         },
index be4d41f33d6a30919308c88d69779808a0cf3d18..392b33ffd2d0c26ccf486eba77b8e395fac7b1ef 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow use of chained assignment expressions",
+            description: "Disallow use of chained assignment expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-multi-assign"
         },
index e37aae0a16e9e1656c3b2c3cc44b8117fe095ce2..d8d3c6509ccaf48f7a83c65ec22adf8a3ea705c0 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow multiple spaces",
+            description: "Disallow multiple spaces",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-multi-spaces"
         },
@@ -56,7 +56,7 @@ module.exports = {
         const options = context.options[0] || {};
         const ignoreEOLComments = options.ignoreEOLComments;
         const exceptions = Object.assign({ Property: true }, options.exceptions);
-        const hasExceptions = Object.keys(exceptions).filter(key => exceptions[key]).length > 0;
+        const hasExceptions = Object.keys(exceptions).some(key => exceptions[key]);
 
         /**
          * Formats value of given comment token for error message by truncating its length.
index 6a17d581b98fa1060ba3d803e6c4f8f5f09788d4..c4400f45ee6574f3c5a3c326b4769d8dd8e9afd7 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow multiline strings",
+            description: "Disallow multiline strings",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-multi-str"
         },
index d012303cc33a1a3917371a85d2b2fc9040cde89f..e8b0f9859c0316c261db45914316c38f08ee0d06 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow multiple empty lines",
+            description: "Disallow multiple empty lines",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-multiple-empty-lines"
         },
index 1814a5b3c5b6ccbd11b74a9e8d6db6ae014c3b2b..634fea93308d5e6a7cdee5a0b2e5d6ab84187367 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow assignments to native objects or read-only global variables",
+            description: "Disallow assignments to native objects or read-only global variables",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-native-reassign"
         },
@@ -81,7 +81,7 @@ module.exports = {
          * @returns {void}
          */
         function checkVariable(variable) {
-            if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) {
+            if (variable.writeable === false && !exceptions.includes(variable.name)) {
                 variable.references.forEach(checkReference);
             }
         }
index a2870137f57ef551e2032a103c583633a101e080..387617767fa51731217ce3650f635439e19c985e 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow negated conditions",
+            description: "Disallow negated conditions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-negated-condition"
         },
index 95ab58a080f598f59482f9cf0d6b8daa362fb79b..975a8d75cb1cb8e5d67df7652e8578b0bc8daa34 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow negating the left operand in `in` expressions",
+            description: "Disallow negating the left operand in `in` expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-negated-in-lhs"
         },
index c87875e40400f72b9988804ca821d189003157ad..fe97823416b72356dc55f6f13661a242b48bab6e 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow nested ternary expressions",
+            description: "Disallow nested ternary expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-nested-ternary"
         },
index 3b5994335194eb8bffaf8967a6c5fdfbdba6a9d8..4759f380b29f5ebfeb00a6311443683654bad3c4 100644 (file)
@@ -27,7 +27,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `new` operators with the `Function` object",
+            description: "Disallow `new` operators with the `Function` object",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-new-func"
         },
index 1a5784df24d6a7bd895e0fee05ed90d204a2df4d..4dbe8db736503da458a57e59ca3263fcaa92caef 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `Object` constructors",
+            description: "Disallow `Object` constructors",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-new-object"
         },
@@ -29,7 +29,7 @@ module.exports = {
         schema: [],
 
         messages: {
-            preferLiteral: "The object literal notation {} is preferrable."
+            preferLiteral: "The object literal notation {} is preferable."
         }
     },
 
index 5dadf6c2538e9563f5ee5119814d246179335a6d..63ca057b7413546a87ef74216782c2470934e01e 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `new` operators with calls to `require`",
+            description: "Disallow `new` operators with calls to `require`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-new-require"
         },
index 6acfca94358c4fd287a6837b7b5fcccd34941d04..534201c0ba662d35cad116693eed83a7a199089c 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow `new` operators with the `Symbol` object",
+            description: "Disallow `new` operators with the `Symbol` object",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-new-symbol"
         },
index 4667d581f654472d8fa91dd590b9f654af0c356d..ff44efc59305b4769ebc5ca8eda7d021304a5887 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
+            description: "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-new-wrappers"
         },
@@ -34,7 +34,7 @@ module.exports = {
             NewExpression(node) {
                 const wrapperObjects = ["String", "Number", "Boolean"];
 
-                if (wrapperObjects.indexOf(node.callee.name) > -1) {
+                if (wrapperObjects.includes(node.callee.name)) {
                     context.report({
                         node,
                         messageId: "noConstructor",
index 5b0976534d6e3d411f2905abf0b2d84c12a61636..c434505758890d623598091e5de104a287c34d26 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `new` operators outside of assignments or comparisons",
+            description: "Disallow `new` operators outside of assignments or comparisons",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-new"
         },
index 3edd269faeb33deb1c263296dbcb631ecba06de9..63e2264b33a62c78da276912259fd05b49dcdbb2 100644 (file)
@@ -30,7 +30,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `\\8` and `\\9` escape sequences in string literals",
+            description: "Disallow `\\8` and `\\9` escape sequences in string literals",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-nonoctal-decimal-escape"
         },
index 667ba69d80310996f6e1782762e36348249c6c01..86355d85d36aad34aa91cd32ef24f7a9fbc31433 100644 (file)
@@ -43,7 +43,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow calling global object properties as functions",
+            description: "Disallow calling global object properties as functions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-obj-calls"
         },
index 9ac56ab7bea8a52e10f562b98bb96e88d2a24039..81a8a74cddb7ed30fcc6f42ed071204134c1d19a 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow octal escape sequences in string literals",
+            description: "Disallow octal escape sequences in string literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-octal-escape"
         },
index 44df45fdacda79b115ad562a201fe01d2f2d34dd..eec56919f1eb7d36a5f3e22426cef86b278d70f4 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow octal literals",
+            description: "Disallow octal literals",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-octal"
         },
@@ -23,7 +23,7 @@ module.exports = {
         schema: [],
 
         messages: {
-            noOcatal: "Octal literals should not be used."
+            noOctal: "Octal literals should not be used."
         }
     },
 
@@ -35,7 +35,7 @@ module.exports = {
                 if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) {
                     context.report({
                         node,
-                        messageId: "noOcatal"
+                        messageId: "noOctal"
                     });
                 }
             }
index 87a6b70238247ec21be78cbd78662f77217cf7b7..f89435c867576f7a44cabe44d214c045b59cbc9a 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow reassigning `function` parameters",
+            description: "Disallow reassigning `function` parameters",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-param-reassign"
         },
index 8d570a3778f3d318cbd24576b619b0b49248fe49..8502c511ed903c572936e95b1688671ff3bdccd8 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow string concatenation with `__dirname` and `__filename`",
+            description: "Disallow string concatenation with `__dirname` and `__filename`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-path-concat"
         },
index 2565da43231a254c1182c4b48aa040f5fe6a347b..cda6b05bfa855afe6f2eea573e3b0872ee8b31db 100644 (file)
@@ -51,7 +51,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the unary operators `++` and `--`",
+            description: "Disallow the unary operators `++` and `--`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-plusplus"
         },
index f7c2c718fd04cb7d546bfd225a1802e92448ef99..5db7c94b13b6f35fd396a6156b5a1c40ae269988 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `process.env`",
+            description: "Disallow the use of `process.env`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-process-env"
         },
index 251044b31c91c57d3696fd013f7d1537fc451b66..ca3ecfe6f5fc10e91a002457e1f9b098d73fb846 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `process.exit()`",
+            description: "Disallow the use of `process.exit()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-process-exit"
         },
index e40d4bcb3f52bd30828eb9e14e0d6718a1c62f63..caa195ffa07e5e55599c4e28c26b92d2a181e73e 100644 (file)
@@ -69,7 +69,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow returning values from Promise executor functions",
+            description: "Disallow returning values from Promise executor functions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-promise-executor-return"
         },
index e6659e59c6bc274288b9b51c5d9940e348ce5606..771d206a88d2e1e874736e19b23c0436a1b39dab 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of the `__proto__` property",
+            description: "Disallow the use of the `__proto__` property",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-proto"
         },
index ae736981e71865edf16ad053e184e842d31ecddb..ea2763396d06c27295c19d3712d7720c2b5419d5 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow calling some `Object.prototype` methods directly on objects",
+            description: "Disallow calling some `Object.prototype` methods directly on objects",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-prototype-builtins"
         },
@@ -33,11 +33,11 @@ module.exports = {
     },
 
     create(context) {
-        const DISALLOWED_PROPS = [
+        const DISALLOWED_PROPS = new Set([
             "hasOwnProperty",
             "isPrototypeOf",
             "propertyIsEnumerable"
-        ];
+        ]);
 
         /**
          * Reports if a disallowed property is used in a CallExpression
@@ -54,7 +54,7 @@ module.exports = {
 
             const propName = astUtils.getStaticPropertyName(callee);
 
-            if (propName !== null && DISALLOWED_PROPS.indexOf(propName) > -1) {
+            if (propName !== null && DISALLOWED_PROPS.has(propName)) {
                 context.report({
                     messageId: "prototypeBuildIn",
                     loc: callee.property.loc,
index cc71a61234954fdbdcb8f02a87febddbb21cf2c8..59749cb6643456aa64973e326942cb3b38ee067b 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow variable redeclaration",
+            description: "Disallow variable redeclaration",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-redeclare"
         },
index 400c72b5027a8aeb6761ba6e77979b154b032f9f..6d74aabe2632b34a24f3a18904d222dda34ca4b2 100644 (file)
@@ -39,7 +39,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow multiple spaces in regular expressions",
+            description: "Disallow multiple spaces in regular expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-regex-spaces"
         },
index 775e505d846c213223b152a5c550bcbf919dddcb..d99e8928209b9115289ff8389156e2c8b8984fa3 100644 (file)
@@ -5,6 +5,12 @@
 
 "use strict";
 
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
@@ -15,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified names in exports",
+            description: "Disallow specified names in exports",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-exports"
         },
@@ -44,12 +50,12 @@ module.exports = {
         const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports);
 
         /**
-         * Checks and reports given exported identifier.
-         * @param {ASTNode} node exported `Identifier` node to check.
+         * Checks and reports given exported name.
+         * @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
          * @returns {void}
          */
         function checkExportedName(node) {
-            const name = node.name;
+            const name = astUtils.getModuleExportName(node);
 
             if (restrictedNames.has(name)) {
                 context.report({
index 09d347890ca89fc391a9212558543b30c53c175f..b666238382dec8b1e61361674ee335372a25cb68 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified global variables",
+            description: "Disallow specified global variables",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-globals"
         },
index 6813037f13a4ca901163521eb799b005b27696fb..f4838679efcf6d13b5602d815409753ffa642d49 100644 (file)
@@ -4,6 +4,12 @@
  */
 "use strict";
 
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
@@ -52,6 +58,14 @@ const arrayOfStringsOrObjectPatterns = {
             items: {
                 type: "object",
                 properties: {
+                    importNames: {
+                        type: "array",
+                        items: {
+                            type: "string"
+                        },
+                        minItems: 1,
+                        uniqueItems: true
+                    },
                     group: {
                         type: "array",
                         items: {
@@ -63,6 +77,9 @@ const arrayOfStringsOrObjectPatterns = {
                     message: {
                         type: "string",
                         minLength: 1
+                    },
+                    caseSensitive: {
+                        type: "boolean"
                     }
                 },
                 additionalProperties: false,
@@ -79,7 +96,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified modules when loaded by `import`",
+            description: "Disallow specified modules when loaded by `import`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-imports"
         },
@@ -93,6 +110,14 @@ module.exports = {
             // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
             patternWithCustomMessage: "'{{importSource}}' import is restricted from being used by a pattern. {{customMessage}}",
 
+            patternAndImportName: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern.",
+            // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
+            patternAndImportNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}",
+
+            patternAndEverything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern.",
+            // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
+            patternAndEverythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}",
+
             everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.",
             // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
             everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}",
@@ -142,10 +167,19 @@ module.exports = {
         }, {});
 
         // Handle patterns too, either as strings or groups
-        const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || [];
-        const restrictedPatternGroups = restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string"
-            ? [{ matcher: ignore().add(restrictedPatterns) }]
-            : restrictedPatterns.map(({ group, message }) => ({ matcher: ignore().add(group), customMessage: message }));
+        let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || [];
+
+        // standardize to array of objects if we have an array of strings
+        if (restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string") {
+            restrictedPatterns = [{ group: restrictedPatterns }];
+        }
+
+        // relative paths are supported for this rule
+        const restrictedPatternGroups = restrictedPatterns.map(({ group, message, caseSensitive, importNames }) => ({
+            matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group),
+            customMessage: message,
+            importNames
+        }));
 
         // if no imports are restricted we don't need to check
         if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) {
@@ -217,20 +251,68 @@ module.exports = {
         /**
          * Report a restricted path specifically for patterns.
          * @param {node} node representing the restricted path reference
-         * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails
+         * @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure,
+         * and any restricted import names that have been specified in the config
+         * @param {Map<string,Object[]>} importNames Map of import names that are being imported
          * @returns {void}
          * @private
          */
-        function reportPathForPatterns(node, group) {
+        function reportPathForPatterns(node, group, importNames) {
             const importSource = node.source.value.trim();
 
-            context.report({
-                node,
-                messageId: group.customMessage ? "patternWithCustomMessage" : "patterns",
-                data: {
-                    importSource,
-                    customMessage: group.customMessage
+            const customMessage = group.customMessage;
+            const restrictedImportNames = group.importNames;
+
+            /*
+             * If we are not restricting to any specific import names and just the pattern itself,
+             * report the error and move on
+             */
+            if (!restrictedImportNames) {
+                context.report({
+                    node,
+                    messageId: customMessage ? "patternWithCustomMessage" : "patterns",
+                    data: {
+                        importSource,
+                        customMessage
+                    }
+                });
+                return;
+            }
+
+            if (importNames.has("*")) {
+                const specifierData = importNames.get("*")[0];
+
+                context.report({
+                    node,
+                    messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything",
+                    loc: specifierData.loc,
+                    data: {
+                        importSource,
+                        importNames: restrictedImportNames,
+                        customMessage
+                    }
+                });
+            }
+
+            restrictedImportNames.forEach(importName => {
+                if (!importNames.has(importName)) {
+                    return;
                 }
+
+                const specifiers = importNames.get(importName);
+
+                specifiers.forEach(specifier => {
+                    context.report({
+                        node,
+                        messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName",
+                        loc: specifier.loc,
+                        data: {
+                            importSource,
+                            customMessage,
+                            importName
+                        }
+                    });
+                });
             });
         }
 
@@ -269,12 +351,12 @@ module.exports = {
                     } else if (specifier.type === "ImportNamespaceSpecifier") {
                         name = "*";
                     } else if (specifier.imported) {
-                        name = specifier.imported.name;
+                        name = astUtils.getModuleExportName(specifier.imported);
                     } else if (specifier.local) {
-                        name = specifier.local.name;
+                        name = astUtils.getModuleExportName(specifier.local);
                     }
 
-                    if (name) {
+                    if (typeof name === "string") {
                         if (importNames.has(name)) {
                             importNames.get(name).push(specifierData);
                         } else {
@@ -287,7 +369,7 @@ module.exports = {
             checkRestrictedPathAndReport(importSource, importNames, node);
             restrictedPatternGroups.forEach(group => {
                 if (isRestrictedPattern(importSource, group)) {
-                    reportPathForPatterns(node, group);
+                    reportPathForPatterns(node, group, importNames);
                 }
             });
         }
index 26e75ef81a21d35f80426c09f2f7bc6b8b4c80a0..c37694f90461f9b4933c67bab0265bd5097a4004 100644 (file)
@@ -49,7 +49,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified modules when loaded by `require`",
+            description: "Disallow specified modules when loaded by `require`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-modules"
         },
@@ -103,7 +103,8 @@ module.exports = {
             return {};
         }
 
-        const ig = ignore().add(restrictedPatterns);
+        // relative paths are supported for this rule
+        const ig = ignore({ allowRelativePaths: true }).add(restrictedPatterns);
 
 
         /**
index 1e8c7a89aedae70c2140efc0e8fb57daea65d65b..7c03498563f6e405f833c85aa1c97efdf8307053 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow certain properties on certain objects",
+            description: "Disallow certain properties on certain objects",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-properties"
         },
index 713d1157c4d692ebead1cad978ebde16d0f72825..76369cfd539e62d5f8a22c8a5c38f5a9c64aefbf 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified syntax",
+            description: "Disallow specified syntax",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-restricted-syntax"
         },
index 4fd7a3ddba587fc96cd16f7d4243012f867d9fbb..ccaf2c1c158a23640af5cc6c2ea7d21f0354e78e 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow assignment operators in `return` statements",
+            description: "Disallow assignment operators in `return` statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-return-assign"
         },
index 191bf42dcf98eeac3e2e69f0697b369aa076c570..3007c8c877d6a04568851b4950029f3682881d32 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary `return await`",
+            description: "Disallow unnecessary `return await`",
 
             recommended: false,
 
index 0eef25418402c02b0e62e3a52d4bffaf00959e0b..41479006ee92737eb1f282e6124ffcc07ecdfe75 100644 (file)
@@ -18,7 +18,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `javascript:` urls",
+            description: "Disallow `javascript:` urls",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-script-url"
         },
index d9e261dfaae0c302d42361bec4d4a67de8a3867b..348ee8dfc5fd1c72b9a513873d2d06644b0aecbd 100644 (file)
@@ -130,7 +130,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow assignments where both sides are exactly the same",
+            description: "Disallow assignments where both sides are exactly the same",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-self-assign"
         },
@@ -174,7 +174,7 @@ module.exports = {
 
         return {
             AssignmentExpression(node) {
-                if (node.operator === "=") {
+                if (["=", "&&=", "||=", "??="].includes(node.operator)) {
                     eachSelfAssignment(node.left, node.right, props, report);
                 }
             }
index c3512895e13474e421909daa2d4c55a4d40c12b6..dab0db4b9174845cda8f29002f5e0797a4e466d0 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow comparisons where both sides are exactly the same",
+            description: "Disallow comparisons where both sides are exactly the same",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-self-compare"
         },
index 376aec3798805af89417c716db3449ad5a222b0d..2c0c27c3feabb7180187f69d2d2d4271cdb57308 100644 (file)
@@ -29,7 +29,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow comma operators",
+            description: "Disallow comma operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-sequences"
         },
index 7204e5c0c4d5c457fed566baea2b75aabe93e193..25e8f1428b257577794b463946946848d05871d7 100644 (file)
@@ -142,7 +142,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow returning values from setters",
+            description: "Disallow returning values from setters",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-setter-return"
         },
index 52620e58d1c1c1ec804e9c457e4371f042084c01..a7d6d00f1645fceb8a570166429116ea3d7dea13 100644 (file)
@@ -27,7 +27,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow identifiers from shadowing restricted names",
+            description: "Disallow identifiers from shadowing restricted names",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-shadow-restricted-names"
         },
index bd619235ab9c59d4682066a95079e8c920c90c24..3af9354ebd7de1dd4afaa93024431b5e97b28136 100644 (file)
 
 const astUtils = require("./utils/ast-utils");
 
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const FUNC_EXPR_NODE_TYPES = new Set(["ArrowFunctionExpression", "FunctionExpression"]);
+const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]);
+const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;
+const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
@@ -21,7 +30,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow variable declarations from shadowing variables declared in the outer scope",
+            description: "Disallow variable declarations from shadowing variables declared in the outer scope",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-shadow"
         },
@@ -37,7 +46,8 @@ module.exports = {
                         items: {
                             type: "string"
                         }
-                    }
+                    },
+                    ignoreOnInitialization: { type: "boolean", default: false }
                 },
                 additionalProperties: false
             }
@@ -54,16 +64,116 @@ module.exports = {
         const options = {
             builtinGlobals: context.options[0] && context.options[0].builtinGlobals,
             hoist: (context.options[0] && context.options[0].hoist) || "functions",
-            allow: (context.options[0] && context.options[0].allow) || []
+            allow: (context.options[0] && context.options[0].allow) || [],
+            ignoreOnInitialization: context.options[0] && context.options[0].ignoreOnInitialization
         };
 
+        /**
+         * Checks whether or not a given location is inside of the range of a given node.
+         * @param {ASTNode} node An node to check.
+         * @param {number} location A location to check.
+         * @returns {boolean} `true` if the location is inside of the range of the node.
+         */
+        function isInRange(node, location) {
+            return node && node.range[0] <= location && location <= node.range[1];
+        }
+
+        /**
+         * Searches from the current node through its ancestry to find a matching node.
+         * @param {ASTNode} node a node to get.
+         * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not.
+         * @returns {ASTNode|null} the matching node.
+         */
+        function findSelfOrAncestor(node, match) {
+            let currentNode = node;
+
+            while (currentNode && !match(currentNode)) {
+                currentNode = currentNode.parent;
+            }
+            return currentNode;
+        }
+
+        /**
+         * Finds function's outer scope.
+         * @param {Scope} scope Function's own scope.
+         * @returns {Scope} Function's outer scope.
+         */
+        function getOuterScope(scope) {
+            const upper = scope.upper;
+
+            if (upper.type === "function-expression-name") {
+                return upper.upper;
+            }
+            return upper;
+        }
+
+        /**
+         * Checks if a variable and a shadowedVariable have the same init pattern ancestor.
+         * @param {Object} variable a variable to check.
+         * @param {Object} shadowedVariable a shadowedVariable to check.
+         * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor.
+         */
+        function isInitPatternNode(variable, shadowedVariable) {
+            const outerDef = shadowedVariable.defs[0];
+
+            if (!outerDef) {
+                return false;
+            }
+
+            const { variableScope } = variable.scope;
+
+
+            if (!(FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) && getOuterScope(variableScope) === shadowedVariable.scope)) {
+                return false;
+            }
+
+            const fun = variableScope.block;
+            const { parent } = fun;
+
+            const callExpression = findSelfOrAncestor(
+                parent,
+                node => CALL_EXPR_NODE_TYPE.has(node.type)
+            );
+
+            if (!callExpression) {
+                return false;
+            }
+
+            let node = outerDef.name;
+            const location = callExpression.range[1];
+
+            while (node) {
+                if (node.type === "VariableDeclarator") {
+                    if (isInRange(node.init, location)) {
+                        return true;
+                    }
+                    if (FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
+                        isInRange(node.parent.parent.right, location)
+                    ) {
+                        return true;
+                    }
+                    break;
+                } else if (node.type === "AssignmentPattern") {
+                    if (isInRange(node.right, location)) {
+                        return true;
+                    }
+                } else if (SENTINEL_TYPE.test(node.type)) {
+                    break;
+                }
+
+                node = node.parent;
+            }
+
+            return false;
+        }
+
         /**
          * Check if variable name is allowed.
          * @param {ASTNode} variable The variable to check.
          * @returns {boolean} Whether or not the variable name is allowed.
          */
         function isAllowed(variable) {
-            return options.allow.indexOf(variable.name) !== -1;
+            return options.allow.includes(variable.name);
         }
 
         /**
@@ -99,11 +209,11 @@ module.exports = {
 
             return (
                 outer &&
-                inner &&
-                outer[0] < inner[0] &&
-                inner[1] < outer[1] &&
-                ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
-                outerScope === innerScope.upper
+                 inner &&
+                 outer[0] < inner[0] &&
+                 inner[1] < outer[1] &&
+                 ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
+                 outerScope === innerScope.upper
             );
         }
 
@@ -154,11 +264,11 @@ module.exports = {
 
             return (
                 inner &&
-                outer &&
-                inner[1] < outer[0] &&
+                 outer &&
+                 inner[1] < outer[0] &&
 
-                // Excepts FunctionDeclaration if is {"hoist":"function"}.
-                (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration")
+                 // Excepts FunctionDeclaration if is {"hoist":"function"}.
+                 (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration")
             );
         }
 
@@ -175,8 +285,8 @@ module.exports = {
 
                 // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration.
                 if (variable.identifiers.length === 0 ||
-                    isDuplicatedClassNameVariable(variable) ||
-                    isAllowed(variable)
+                     isDuplicatedClassNameVariable(variable) ||
+                     isAllowed(variable)
                 ) {
                     continue;
                 }
@@ -185,9 +295,10 @@ module.exports = {
                 const shadowed = astUtils.getVariableByName(scope.upper, variable.name);
 
                 if (shadowed &&
-                    (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) &&
-                    !isOnInitializer(variable, shadowed) &&
-                    !(options.hoist !== "all" && isInTdz(variable, shadowed))
+                      (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) &&
+                      !isOnInitializer(variable, shadowed) &&
+                      !(options.ignoreOnInitialization && isInitPatternNode(variable, shadowed)) &&
+                      !(options.hoist !== "all" && isInTdz(variable, shadowed))
                 ) {
                     const location = getDeclaredLocation(shadowed);
                     const messageId = location.global ? "noShadowGlobal" : "noShadow";
index 1d2994333e125e13c578c1eef655e5f23131d35d..97e2da06b0f75c95ec42b1c960f4f6402df8e762 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow spacing between function identifiers and their applications (deprecated)",
+            description: "Disallow spacing between function identifiers and their applications (deprecated)",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-spaced-func"
         },
index c95bc203c4a96ca895506f2a77c7c6233f5ea8ce..0e95fe4af7baf2ba5d26e76dd7bca92b6a82f36f 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow sparse arrays",
+            description: "Disallow sparse arrays",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-sparse-arrays"
         },
@@ -37,7 +37,7 @@ module.exports = {
 
             ArrayExpression(node) {
 
-                const emptySpot = node.elements.indexOf(null) > -1;
+                const emptySpot = node.elements.includes(null);
 
                 if (emptySpot) {
                     context.report({ node, messageId: "unexpectedSparseArray" });
index 3536d9f2a39a9b70bffeced6739ce71e570fc22e..71360c6bd3238fa41f5ac9ecacf977a4537a7fce 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow synchronous methods",
+            description: "Disallow synchronous methods",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-sync"
         },
index 9758b850be161ab3cae8257210f30f104e8c2630..1b4834e09a73e6eefb3f2f7b622e9989007a8a5c 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow all tabs",
+            description: "Disallow all tabs",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-tabs"
         },
index 1901460f3d22631d6da74c616b3b719c1387cfeb..4f4e9ee17e9c346cb64d4c025dd6e65fed4e97a7 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow template literal placeholder syntax in regular strings",
+            description: "Disallow template literal placeholder syntax in regular strings",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-template-curly-in-string"
         },
index b0dc626832bc2e3a7d83ad1271d0d75e7be21c41..a185808a69adbc976594ea675eda7825775e4149 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow ternary operators",
+            description: "Disallow ternary operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-ternary"
         },
index 929eded2443324755b16c6d0e07364e85bd0244a..b4e48e8626498afc65cd15d9c80178ff2d41cb4f 100644 (file)
@@ -40,7 +40,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow `this`/`super` before calling `super()` in constructors",
+            description: "Disallow `this`/`super` before calling `super()` in constructors",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-this-before-super"
         },
index c670ed9e5e1cbbbef97ebfc627fbbc6a4078d999..3656c83a3ffb38ef8c42b251150e71f4cfaab840 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow throwing literals as exceptions",
+            description: "Disallow throwing literals as exceptions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-throw-literal"
         },
index 9e720ad32e8f2d624540b228a6836ad265cfbdd7..a02a880e1d6179636218b4a3aef0471e96c4ed71 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow trailing whitespace at the end of lines",
+            description: "Disallow trailing whitespace at the end of lines",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-trailing-spaces"
         },
index 2c2204cf0fe2d27ca7932f932ce5566d0de28fc1..2cb1c3f3710169ae1190f397de4d73c9a5309846 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow initializing variables to `undefined`",
+            description: "Disallow initializing variables to `undefined`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-undef-init"
         },
index f65903245c8d6c54ed0fd8c9e9a83848863038c7..e920ce6c28885f323bd629a92602bd764210f49a 100644 (file)
@@ -29,7 +29,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments",
+            description: "Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-undef"
         },
index de396d889c0e27901004e670689ab3a388d2d496..e006320b5223696bd0c206423748d357b12ecca6 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `undefined` as an identifier",
+            description: "Disallow the use of `undefined` as an identifier",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-undefined"
         },
index 0ab41feb03c22f2677f50db056cc6cec46bb6f5d..eb3e404a66d70d9f48ce56b9611415d563b9de29 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow dangling underscores in identifiers",
+            description: "Disallow dangling underscores in identifiers",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-underscore-dangle"
         },
@@ -49,6 +49,10 @@ module.exports = {
                     allowFunctionParams: {
                         type: "boolean",
                         default: true
+                    },
+                    enforceInClassFields: {
+                        type: "boolean",
+                        default: false
                     }
                 },
                 additionalProperties: false
@@ -68,6 +72,7 @@ module.exports = {
         const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false;
         const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false;
         const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false;
+        const enforceInClassFields = typeof options.enforceInClassFields !== "undefined" ? options.enforceInClassFields : false;
         const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true;
 
         //-------------------------------------------------------------------------
@@ -81,7 +86,7 @@ module.exports = {
          * @private
          */
         function isAllowed(identifier) {
-            return ALLOWED_VARIABLES.some(ident => ident === identifier);
+            return ALLOWED_VARIABLES.includes(identifier);
         }
 
         /**
@@ -261,6 +266,30 @@ module.exports = {
             }
         }
 
+        /**
+         * Check if a class field has a dangling underscore
+         * @param {ASTNode} node node to evaluate
+         * @returns {void}
+         * @private
+         */
+        function checkForDanglingUnderscoreInClassField(node) {
+            const identifier = node.key.name;
+
+            if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) &&
+                enforceInClassFields &&
+                !isAllowed(identifier)) {
+                context.report({
+                    node,
+                    messageId: "unexpectedUnderscore",
+                    data: {
+                        identifier: node.key.type === "PrivateIdentifier"
+                            ? `#${identifier}`
+                            : identifier
+                    }
+                });
+            }
+        }
+
         //--------------------------------------------------------------------------
         // Public API
         //--------------------------------------------------------------------------
@@ -270,7 +299,7 @@ module.exports = {
             VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
             MemberExpression: checkForDanglingUnderscoreInMemberExpression,
             MethodDefinition: checkForDanglingUnderscoreInMethod,
-            PropertyDefinition: checkForDanglingUnderscoreInMethod,
+            PropertyDefinition: checkForDanglingUnderscoreInClassField,
             Property: checkForDanglingUnderscoreInMethod,
             FunctionExpression: checkForDanglingUnderscoreInFunction,
             ArrowFunctionExpression: checkForDanglingUnderscoreInFunction
index 60d8f3164cd9f0e2f7c573dd446ff698f0f60f1c..2ca6731bc676ae9914e2949932d6083abf7bd780 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow confusing multiline expressions",
+            description: "Disallow confusing multiline expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unexpected-multiline"
         },
index 5b8da26f2d21cdcbf6145356c678df4e50ab0af3..12f61e98e6a1c0e751bfa6ee182a691881c2133c 100644 (file)
@@ -162,7 +162,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow unmodified loop conditions",
+            description: "Disallow unmodified loop conditions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-unmodified-loop-condition"
         },
index e00d5270a2aa05d02da3b2a54a73380052b9ae01..c193282fa70314f111ca7708cbfc8f918c5dc832 100644 (file)
@@ -29,7 +29,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow ternary operators when simpler alternatives exist",
+            description: "Disallow ternary operators when simpler alternatives exist",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-unneeded-ternary"
         },
index f100263308fad66c4d61e9276cce5070f109dab3..c42c922e0c4b8893ad6a835ba7bd55f1c5a21c9b 100644 (file)
@@ -59,7 +59,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow loops with a body that allows only one iteration",
+            description: "Disallow loops with a body that allows only one iteration",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-unreachable-loop"
         },
index 4dda51f11b9a9a0949cde786740bd845c5173b11..dea86815aac5b98180b4f95dc76a6d5732f9658f 100644 (file)
@@ -111,7 +111,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
+            description: "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unreachable"
         },
index 26c05eab8b08250fb72f50ad9ec10c91c4305c3e..80adb0fea4678b4e12a95ff40f7910541519e052 100644 (file)
@@ -24,7 +24,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow control flow statements in `finally` blocks",
+            description: "Disallow control flow statements in `finally` blocks",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unsafe-finally"
         },
index 057b1742acc05812ddb72e7289f52baaf54c81cd..5dd150f878806a5dd76327e0f3dc48974b921530 100644 (file)
@@ -52,7 +52,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow negating the left operand of relational operators",
+            description: "Disallow negating the left operand of relational operators",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unsafe-negation"
         },
index 8556ccbd79dc2cce53fa1afc26cf72f134e35120..99139078198686d8331e9cdb7c5d341181c56649 100644 (file)
@@ -24,7 +24,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow use of optional chaining in contexts where the `undefined` value is not allowed",
+            description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining"
         },
index 68a7ebd5e00cea045e8ff53b4091102b9ab4c608..d34d5844d97f6a080c8dcd41d1371980d58c2a6e 100644 (file)
@@ -30,7 +30,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unused expressions",
+            description: "Disallow unused expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-unused-expressions"
         },
@@ -124,7 +124,7 @@ module.exports = {
              */
             return (parent.type === "Program" || parent.type === "BlockStatement" &&
                     (/Function/u.test(grandparent.type))) &&
-                    directives(parent).indexOf(node) >= 0;
+                    directives(parent).includes(node);
         }
 
         /**
index f309dd12b1253ccd11540fb04ef2be4c9bacecd6..305226a4df2e928d8c1deed69cbccb24f9506ba4 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unused labels",
+            description: "Disallow unused labels",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unused-labels"
         },
index 754c36002eb94a1a966ce6cf376768c6fe8269dc..e62a9ed596822a4f7d2c65bb894fb3d24b81c359 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow unused private class members",
+            description: "Disallow unused private class members",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-unused-private-class-members"
         },
index eaf7a8b912e427b6a8d248ced9ff64b533eec602..778889a7676f97763e67a8f05c99717aa161f3d7 100644 (file)
@@ -33,7 +33,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow unused variables",
+            description: "Disallow unused variables",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-unused-vars"
         },
@@ -67,6 +67,9 @@ module.exports = {
                             },
                             caughtErrorsIgnorePattern: {
                                 type: "string"
+                            },
+                            destructuredArrayIgnorePattern: {
+                                type: "string"
                             }
                         },
                         additionalProperties: false
@@ -114,6 +117,10 @@ module.exports = {
                 if (firstOption.caughtErrorsIgnorePattern) {
                     config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u");
                 }
+
+                if (firstOption.destructuredArrayIgnorePattern) {
+                    config.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, "u");
+                }
             }
         }
 
@@ -155,7 +162,14 @@ module.exports = {
          * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
          */
         function getAssignedMessageData(unusedVar) {
-            const additional = config.varsIgnorePattern ? `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}` : "";
+            const def = unusedVar.defs[0];
+            let additional = "";
+
+            if (config.destructuredArrayIgnorePattern && def && def.name.parent.type === "ArrayPattern") {
+                additional = `. Allowed unused elements of array destructuring patterns must match ${config.destructuredArrayIgnorePattern.toString()}`;
+            } else if (config.varsIgnorePattern) {
+                additional = `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}`;
+            }
 
             return {
                 varName: unusedVar.name,
@@ -245,7 +259,7 @@ module.exports = {
             let scope = ref.from;
 
             while (scope) {
-                if (nodes.indexOf(scope.block) >= 0) {
+                if (nodes.includes(scope.block)) {
                     return true;
                 }
 
@@ -470,12 +484,12 @@ module.exports = {
         }
 
         /**
-         * Determine if an identifier is used either in for-in loops.
+         * Determine if an identifier is used either in for-in or for-of loops.
          * @param {Reference} ref The reference to check.
          * @returns {boolean} whether reference is used in the for-in loops
          * @private
          */
-        function isForInRef(ref) {
+        function isForInOfRef(ref) {
             let target = ref.identifier.parent;
 
 
@@ -484,7 +498,7 @@ module.exports = {
                 target = target.parent.parent;
             }
 
-            if (target.type !== "ForInStatement") {
+            if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") {
                 return false;
             }
 
@@ -517,7 +531,7 @@ module.exports = {
             let rhsNode = null;
 
             return variable.references.some(ref => {
-                if (isForInRef(ref)) {
+                if (isForInOfRef(ref)) {
                     return true;
                 }
 
@@ -584,6 +598,19 @@ module.exports = {
 
                     if (def) {
                         const type = def.type;
+                        const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === "ArrayPattern");
+
+                        // skip elements of array destructuring patterns
+                        if (
+                            (
+                                def.name.parent.type === "ArrayPattern" ||
+                                refUsedInArrayPatterns
+                            ) &&
+                            config.destructuredArrayIgnorePattern &&
+                            config.destructuredArrayIgnorePattern.test(def.name.name)
+                        ) {
+                            continue;
+                        }
 
                         // skip catch variables
                         if (type === "CatchClause") {
index 07d035c431ff1255039b401841afadd1ff642016..592c083589c671e7c9276f09955437134f592523 100644 (file)
@@ -21,6 +21,7 @@ function parseOptions(options) {
     let functions = true;
     let classes = true;
     let variables = true;
+    let allowNamedExports = false;
 
     if (typeof options === "string") {
         functions = (options !== "nofunc");
@@ -28,9 +29,10 @@ function parseOptions(options) {
         functions = options.functions !== false;
         classes = options.classes !== false;
         variables = options.variables !== false;
+        allowNamedExports = !!options.allowNamedExports;
     }
 
-    return { functions, classes, variables };
+    return { functions, classes, variables, allowNamedExports };
 }
 
 /**
@@ -224,7 +226,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow the use of variables before they are defined",
+            description: "Disallow the use of variables before they are defined",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-use-before-define"
         },
@@ -240,7 +242,8 @@ module.exports = {
                         properties: {
                             functions: { type: "boolean" },
                             classes: { type: "boolean" },
-                            variables: { type: "boolean" }
+                            variables: { type: "boolean" },
+                            allowNamedExports: { type: "boolean" }
                         },
                         additionalProperties: false
                     }
@@ -273,6 +276,16 @@ module.exports = {
                 return false;
             }
 
+            const { identifier } = reference;
+
+            if (
+                options.allowNamedExports &&
+                identifier.parent.type === "ExportSpecifier" &&
+                identifier.parent.local === identifier
+            ) {
+                return false;
+            }
+
             const variable = reference.resolved;
 
             if (!variable || variable.defs.length === 0) {
index 1a09988b80956e2dac4ec416aa1a464eaa4f7134..f23535bc359d964ad32738923edaee54b92e68b3 100644 (file)
@@ -64,7 +64,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow useless backreferences in regular expressions",
+            description: "Disallow useless backreferences in regular expressions",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-useless-backreference"
         },
index 8c57cd5cc9a8769388060087605a7205e95ac116..2d3ae4e84aeed60d384e541ea9fa49974c610d2e 100644 (file)
@@ -55,7 +55,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary calls to `.call()` and `.apply()`",
+            description: "Disallow unnecessary calls to `.call()` and `.apply()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-call"
         },
index 325a2e58117188573dd06f2d7f93a0bdffe95398..36c356ecb4265fa2a19b5062434d33d7117e5073 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary `catch` clauses",
+            description: "Disallow unnecessary `catch` clauses",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-useless-catch"
         },
index 7ebbe09de26bb70b5f00cc7c6f8e3d5ba47acd25..f7f12179b7bd8c5ec3a4291a7f9fb10ed6322212 100644 (file)
@@ -74,7 +74,7 @@ function hasUselessComputedKey(node) {
 
             return value !== "constructor";
 
-        /* istanbul ignore next */
+        /* c8 ignore next */
         default:
             throw new Error(`Unexpected node type: ${node.type}`);
     }
@@ -91,7 +91,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary computed property keys in objects and classes",
+            description: "Disallow unnecessary computed property keys in objects and classes",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-computed-key"
         },
index 36ca84f90cbacfd1242b36ea697c5a8f74a89e75..26c5206df365a98ebe5d10b7e42ed8c09d438d0e 100644 (file)
@@ -70,7 +70,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary concatenation of literals or template literals",
+            description: "Disallow unnecessary concatenation of literals or template literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-concat"
         },
index 6512c8b1fefbf980886517cf7cb5140a003df688..38c3bc3a05cde0de99c94724d9f5b04734125c87 100644 (file)
@@ -138,7 +138,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary constructors",
+            description: "Disallow unnecessary constructors",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-constructor"
         },
index 123bc5b8a0169c419948ee083262d4b1be79e97a..2046a148a17fd1d5f3a4bbc9f45f7700259d11fa 100644 (file)
@@ -84,7 +84,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow unnecessary escape characters",
+            description: "Disallow unnecessary escape characters",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-useless-escape"
         },
index 616ec2a43cc631ef13040d7dcb317578567ff849..908605f74cbae549c38a9ff3b1c3efccd0cc1792 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow renaming import, export, and destructured assignments to the same name",
+            description: "Disallow renaming import, export, and destructured assignments to the same name",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-rename"
         },
@@ -132,8 +132,10 @@ module.exports = {
                 return;
             }
 
-            if (node.imported.name === node.local.name &&
-                    node.imported.range[0] !== node.local.range[0]) {
+            if (
+                node.imported.range[0] !== node.local.range[0] &&
+                astUtils.getModuleExportName(node.imported) === node.local.name
+            ) {
                 reportError(node, node.imported, "Import");
             }
         }
@@ -148,8 +150,10 @@ module.exports = {
                 return;
             }
 
-            if (node.local.name === node.exported.name &&
-                    node.local.range[0] !== node.exported.range[0]) {
+            if (
+                node.local.range[0] !== node.exported.range[0] &&
+                astUtils.getModuleExportName(node.local) === astUtils.getModuleExportName(node.exported)
+            ) {
                 reportError(node, node.local, "Export");
             }
 
index 0baa6b2942d1721f261d7ebea0835b2bf77e4b8d..be8d4dfd3a52b4df4611d2d837cf0b497ae35396 100644 (file)
@@ -67,7 +67,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow redundant return statements",
+            description: "Disallow redundant return statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-useless-return"
         },
index 83a1f62eb6f952aeae489c482ad38654b4277a88..cfb64efafcceb560ff8cc7ac137b3318300d485c 100644 (file)
@@ -90,7 +90,7 @@ function getScopeNode(node) {
         }
     }
 
-    /* istanbul ignore next : unreachable */
+    /* c8 ignore next */
     return null;
 }
 
@@ -185,7 +185,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `let` or `const` instead of `var`",
+            description: "Require `let` or `const` instead of `var`",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-var"
         },
index 8631caf70cf96e27b80e2df03b6e5de97b73f9d3..15c4730612d6170f6763d0193ef1ef9d449957a3 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `void` operators",
+            description: "Disallow `void` operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-void"
         },
index 5f3ea21d7d0e867e285a3d0e7fc5cf77b9fa9098..9754f50880b3725dba190c0a12c3d027cb0890c4 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow specified warning terms in comments",
+            description: "Disallow specified warning terms in comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-warning-comments"
         },
@@ -37,6 +37,15 @@ module.exports = {
                     },
                     location: {
                         enum: ["start", "anywhere"]
+                    },
+                    decoration: {
+                        type: "array",
+                        items: {
+                            type: "string",
+                            pattern: "^\\S$"
+                        },
+                        minItems: 1,
+                        uniqueItems: true
                     }
                 },
                 additionalProperties: false
@@ -53,6 +62,7 @@ module.exports = {
             configuration = context.options[0] || {},
             warningTerms = configuration.terms || ["todo", "fixme", "xxx"],
             location = configuration.location || "start",
+            decoration = [...configuration.decoration || []].join(""),
             selfConfigRegEx = /\bno-warning-comments\b/u;
 
         /**
@@ -64,59 +74,54 @@ module.exports = {
          */
         function convertToRegExp(term) {
             const escaped = escapeRegExp(term);
-            const wordBoundary = "\\b";
-            const eitherOrWordBoundary = `|${wordBoundary}`;
-            let prefix;
+            const escapedDecoration = escapeRegExp(decoration);
 
             /*
-             * If the term ends in a word character (a-z0-9_), ensure a word
-             * boundary at the end, so that substrings do not get falsely
-             * matched. eg "todo" in a string such as "mastodon".
-             * If the term ends in a non-word character, then \b won't match on
-             * the boundary to the next non-word character, which would likely
-             * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`.
-             * In these cases, use no bounding match. Same applies for the
-             * prefix, handled below.
+             * When matching at the start, ignore leading whitespace, and
+             * there's no need to worry about word boundaries.
+             *
+             * These expressions for the prefix and suffix are designed as follows:
+             * ^   handles any terms at the beginning of a comment.
+             *     e.g. terms ["TODO"] matches `//TODO something`
+             * $   handles any terms at the end of a comment
+             *     e.g. terms ["TODO"] matches `// something TODO`
+             * \b  handles terms preceded/followed by word boundary
+             *     e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX`
+             *          terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix`
+             *
+             * For location start:
+             * [\s]* handles optional leading spaces
+             *     e.g. terms ["TODO"] matches `//    TODO something`
+             * [\s\*]* (where "\*" is the escaped string of decoration)
+             *     handles optional leading spaces or decoration characters (for "start" location only)
+             *     e.g. terms ["TODO"] matches `/**** TODO something ... `
              */
-            const suffix = /\w$/u.test(term) ? "\\b" : "";
+            const wordBoundary = "\\b";
 
-            if (location === "start") {
+            let prefix = "";
 
-                /*
-                 * When matching at the start, ignore leading whitespace, and
-                 * there's no need to worry about word boundaries.
-                 */
-                prefix = "^\\s*";
+            if (location === "start") {
+                prefix = `^[\\s${escapedDecoration}]*`;
             } else if (/^\w/u.test(term)) {
                 prefix = wordBoundary;
-            } else {
-                prefix = "";
             }
 
-            if (location === "start") {
-
-                /*
-                 * For location "start" the regex should be
-                 * ^\s*TERM\b.  This checks the word boundary
-                 * at the beginning of the comment.
-                 */
-                return new RegExp(prefix + escaped + suffix, "iu");
-            }
+            const suffix = /\w$/u.test(term) ? wordBoundary : "";
+            const flags = "iu"; // Case-insensitive with Unicode case folding.
 
             /*
-             * For location "anywhere" the regex should be
-             * \bTERM\b|\bTERM\b, this checks the entire comment
-             * for the term.
+             * For location "start", the typical regex is:
+             *   /^[\s]*ESCAPED_TERM\b/iu.
+             * Or if decoration characters are specified (e.g. "*"), then any of
+             * those characters may appear in any order at the start:
+             *   /^[\s\*]*ESCAPED_TERM\b/iu.
+             *
+             * For location "anywhere" the typical regex is
+             *   /\bESCAPED_TERM\b/iu
+             *
+             * If it starts or ends with non-word character, the prefix and suffix are empty, respectively.
              */
-            return new RegExp(
-                prefix +
-                    escaped +
-                    suffix +
-                    eitherOrWordBoundary +
-                    term +
-                    wordBoundary,
-                "iu"
-            );
+            return new RegExp(`${prefix}${escaped}${suffix}`, flags);
         }
 
         const warningRegExps = warningTerms.map(convertToRegExp);
index 95e920f27ea9bc7c777d83a3acdccf9a2c86a5a7..67323816f85bbeae9242668d9baf276e25beb3ce 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "disallow whitespace before properties",
+            description: "Disallow whitespace before properties",
             recommended: false,
             url: "https://eslint.org/docs/rules/no-whitespace-before-property"
         },
index fc93f199f87ac036038454710f2c246b6d67a257..33de68d9c05ec39e9c9f78f454f739b50b50b6b7 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `with` statements",
+            description: "Disallow `with` statements",
             recommended: true,
             url: "https://eslint.org/docs/rules/no-with"
         },
index c177cf34cee880c4c8aa6c6942088f2bc8052924..cefecf302a6944100f7eb9e6c0fc5fc4bb35b12c 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce the location of single-line statements",
+            description: "Enforce the location of single-line statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/nonblock-statement-body-position"
         },
index e052cd86493f3840f93e3f40a81a0c373c6c3656..2f8004918a96e419c2c7eadadc305791c6908fa6 100644 (file)
@@ -150,7 +150,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent line breaks after opening and before closing braces",
+            description: "Enforce consistent line breaks after opening and before closing braces",
             recommended: false,
             url: "https://eslint.org/docs/rules/object-curly-newline"
         },
index 9122da3ef3dbfca28f46cd02d74bc1d64f27003f..d6a8e5956aeb434fc4cd3423e5cdf3cd7f54c6e1 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing inside braces",
+            description: "Enforce consistent spacing inside braces",
             recommended: false,
             url: "https://eslint.org/docs/rules/object-curly-spacing"
         },
index dac084c3f651d17d4b5f719a50fbabe6e9124d39..bc079a16f45929872ff3baeac1a8ccd8af4b965c 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce placing object properties on separate lines",
+            description: "Enforce placing object properties on separate lines",
             recommended: false,
             url: "https://eslint.org/docs/rules/object-property-newline"
         },
index aa03450d0719095a6f523c330aeea10806eaea10..b755aea3f484275a6ef215ad6b48087e538d066b 100644 (file)
@@ -28,7 +28,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow method and property shorthand syntax for object literals",
+            description: "Require or disallow method and property shorthand syntax for object literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/object-shorthand"
         },
@@ -78,6 +78,9 @@ module.exports = {
                                 ignoreConstructors: {
                                     type: "boolean"
                                 },
+                                methodsIgnorePattern: {
+                                    type: "string"
+                                },
                                 avoidQuotes: {
                                     type: "boolean"
                                 },
@@ -115,6 +118,9 @@ module.exports = {
 
         const PARAMS = context.options[1] || {};
         const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors;
+        const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern
+            ? new RegExp(PARAMS.methodsIgnorePattern, "u")
+            : null;
         const AVOID_QUOTES = PARAMS.avoidQuotes;
         const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows;
         const sourceCode = context.getSourceCode();
@@ -457,6 +463,15 @@ module.exports = {
                     if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) {
                         return;
                     }
+
+                    if (METHODS_IGNORE_PATTERN) {
+                        const propertyName = astUtils.getStaticPropertyName(node);
+
+                        if (propertyName !== null && METHODS_IGNORE_PATTERN.test(propertyName)) {
+                            return;
+                        }
+                    }
+
                     if (AVOID_QUOTES && isStringLiteral(node.key)) {
                         return;
                     }
index 440146b92c1c65abef4d0a102793045f8a4fc193..65be0929e715c852a710da9abee8c9cf85487859 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow newlines around variable declarations",
+            description: "Require or disallow newlines around variable declarations",
             recommended: false,
             url: "https://eslint.org/docs/rules/one-var-declaration-per-line"
         },
index 1818c02e6e14156a5c42460fe7488299406e9277..a8e2a1de05ab925d950356a20c7b78f8beea0c09 100644 (file)
@@ -34,7 +34,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce variables to be declared either together or separately in functions",
+            description: "Enforce variables to be declared either together or separately in functions",
             recommended: false,
             url: "https://eslint.org/docs/rules/one-var"
         },
index d200811634c65e6e26744cedaba0b508c7ab7855..ed9cb963bf282aec98a515104d6d7f70959fea66 100644 (file)
@@ -22,7 +22,7 @@ const astUtils = require("./utils/ast-utils");
  *     shorthand form.
  */
 function isCommutativeOperatorWithShorthand(operator) {
-    return ["*", "&", "^", "|"].indexOf(operator) >= 0;
+    return ["*", "&", "^", "|"].includes(operator);
 }
 
 /**
@@ -33,7 +33,7 @@ function isCommutativeOperatorWithShorthand(operator) {
  *     a shorthand form.
  */
 function isNonCommutativeOperatorWithShorthand(operator) {
-    return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].indexOf(operator) >= 0;
+    return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator);
 }
 
 //------------------------------------------------------------------------------
@@ -63,7 +63,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow assignment operator shorthand where possible",
+            description: "Require or disallow assignment operator shorthand where possible",
             recommended: false,
             url: "https://eslint.org/docs/rules/operator-assignment"
         },
@@ -76,8 +76,8 @@ module.exports = {
 
         fixable: "code",
         messages: {
-            replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}=).",
-            unexpected: "Unexpected operator assignment ({{operator}}=) shorthand."
+            replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}).",
+            unexpected: "Unexpected operator assignment ({{operator}}) shorthand."
         }
     },
 
@@ -109,11 +109,13 @@ module.exports = {
             const operator = expr.operator;
 
             if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) {
+                const replacementOperator = `${operator}=`;
+
                 if (astUtils.isSameReference(left, expr.left, true)) {
                     context.report({
                         node,
                         messageId: "replaced",
-                        data: { operator },
+                        data: { operator: replacementOperator },
                         fix(fixer) {
                             if (canBeFixed(left) && canBeFixed(expr.left)) {
                                 const equalsToken = getOperatorToken(node);
@@ -126,7 +128,7 @@ module.exports = {
                                     return null;
                                 }
 
-                                return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`);
+                                return fixer.replaceText(node, `${leftText}${replacementOperator}${rightText}`);
                             }
                             return null;
                         }
@@ -141,7 +143,7 @@ module.exports = {
                     context.report({
                         node,
                         messageId: "replaced",
-                        data: { operator }
+                        data: { operator: replacementOperator }
                     });
                 }
             }
index a04f85bdea96ba16690ebb08cad6f79204bb17b9..03b603e75843db37eb7d141bad9c6c17baedfabf 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent linebreak style for operators",
+            description: "Enforce consistent linebreak style for operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/operator-linebreak"
         },
index 336adac9a02f199c6fbd79737e30e1c55ef4712b..bc194283dea1b5de4c6d510a39826339a1224d63 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow padding within blocks",
+            description: "Require or disallow padding within blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/padded-blocks"
         },
@@ -186,7 +186,7 @@ module.exports = {
                 case "ClassBody":
                     return options.classes;
 
-                /* istanbul ignore next */
+                /* c8 ignore next */
                 default:
                     throw new Error("unreachable");
             }
index fe5d304dd5b6130a09d28a0336f70c8e22ba2bfb..9d730bffcd9025470eba1abddaa982faad6e8751 100644 (file)
@@ -431,7 +431,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow padding lines between statements",
+            description: "Require or disallow padding lines between statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/padding-line-between-statements"
         },
@@ -450,8 +450,7 @@ module.exports = {
                             type: "array",
                             items: { enum: Object.keys(StatementTypes) },
                             minItems: 1,
-                            uniqueItems: true,
-                            additionalItems: false
+                            uniqueItems: true
                         }
                     ]
                 }
@@ -466,8 +465,7 @@ module.exports = {
                 },
                 additionalProperties: false,
                 required: ["blankLine", "prev", "next"]
-            },
-            additionalItems: false
+            }
         },
 
         messages: {
index 55a098a60979ce2c8086e3d21e8a590cbc0b9d76..8af7161a0f98c838d20e9118707f58127eec27fd 100644 (file)
@@ -53,7 +53,7 @@ function getVariableOfArguments(scope) {
         }
     }
 
-    /* istanbul ignore next */
+    /* c8 ignore next */
     return null;
 }
 
@@ -126,7 +126,7 @@ function getCallbackInfo(node) {
         parent = parent.parent;
     }
 
-    /* istanbul ignore next */
+    /* c8 ignore next */
     throw new Error("unreachable");
 }
 
@@ -151,7 +151,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require using arrow functions for callbacks",
+            description: "Require using arrow functions for callbacks",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-arrow-callback"
         },
index 190860019d8e8f78d7bd83d7b8f7a6a0050136ec..e3d2db7aeb952a9665c881ff0488ccfc3ec4c28b 100644 (file)
@@ -60,7 +60,7 @@ function canBecomeVariableDeclaration(identifier) {
  */
 function isOuterVariableInDestructing(name, initScope) {
 
-    if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) {
+    if (initScope.through.some(ref => ref.resolved && ref.resolved.name === name)) {
         return true;
     }
 
@@ -332,7 +332,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `const` declarations for variables that are never reassigned after declared",
+            description: "Require `const` declarations for variables that are never reassigned after declared",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-const"
         },
@@ -446,7 +446,19 @@ module.exports = {
 
                         reportCount += nodesToReport.length;
 
-                        shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length);
+                        let totalDeclarationsCount = 0;
+
+                        varDeclParent.declarations.forEach(declaration => {
+                            if (declaration.id.type === "ObjectPattern") {
+                                totalDeclarationsCount += declaration.id.properties.length;
+                            } else if (declaration.id.type === "ArrayPattern") {
+                                totalDeclarationsCount += declaration.id.elements.length;
+                            } else {
+                                totalDeclarationsCount += 1;
+                            }
+                        });
+
+                        shouldFix = shouldFix && (reportCount === totalDeclarationsCount);
                     }
                 }
 
index 1f68313d6b178d0ee02ceaa6abbbd2decc2fb24c..fdf46f65f59b72c6ac0d68387251278d7fa5b8c2 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require destructuring from arrays and/or objects",
+            description: "Require destructuring from arrays and/or objects",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-destructuring"
         },
index a291e8dec151648333588b279081237d9f7bbc70..fec5319723e44d757104747098341f77fd682cc3 100644 (file)
@@ -90,7 +90,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow the use of `Math.pow` in favor of the `**` operator",
+            description: "Disallow the use of `Math.pow` in favor of the `**` operator",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-exponentiation-operator"
         },
index cff2d8f45d270a70fa95da5439f54a22d9151c7c..1a13ffa858292d327bd4d97f7e1bac3122fd749d 100644 (file)
@@ -33,7 +33,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce using named capture group in regular expression",
+            description: "Enforce using named capture group in regular expression",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-named-capture-group"
         },
index 53a515368960fc74765491661b25c49d19b8402a..5f70158126c9613563d6542549f6923ec701d29f 100644 (file)
@@ -45,7 +45,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
+            description: "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-numeric-literals"
         },
diff --git a/eslint/lib/rules/prefer-object-has-own.js b/eslint/lib/rules/prefer-object-has-own.js
new file mode 100644 (file)
index 0000000..023d0a6
--- /dev/null
@@ -0,0 +1,112 @@
+/**
+ * @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
+ * @author Nitin Kumar
+ * @author Gautam Arora
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks if the given node is considered to be an access to a property of `Object.prototype`.
+ * @param {ASTNode} node `MemberExpression` node to evaluate.
+ * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node).
+ */
+function hasLeftHandObject(node) {
+
+    /*
+     * ({}).hasOwnProperty.call(obj, prop) - `true`
+     * ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty
+     */
+    if (node.object.type === "ObjectExpression" && node.object.properties.length === 0) {
+        return true;
+    }
+
+    const objectNodeToCheck = node.object.type === "MemberExpression" && astUtils.getStaticPropertyName(node.object) === "prototype" ? node.object.object : node.object;
+
+    if (objectNodeToCheck.type === "Identifier" && objectNodeToCheck.name === "Object") {
+        return true;
+    }
+
+    return false;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+/** @type {import('../shared/types').Rule} */
+module.exports = {
+    meta: {
+        type: "suggestion",
+        docs: {
+            description:
+                "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
+            recommended: false,
+            url: "https://eslint.org/docs/rules/prefer-object-has-own"
+        },
+        schema: [],
+        messages: {
+            useHasOwn: "Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'."
+        },
+        fixable: "code"
+    },
+    create(context) {
+        return {
+            CallExpression(node) {
+                if (!(node.callee.type === "MemberExpression" && node.callee.object.type === "MemberExpression")) {
+                    return;
+                }
+
+                const calleePropertyName = astUtils.getStaticPropertyName(node.callee);
+                const objectPropertyName = astUtils.getStaticPropertyName(node.callee.object);
+                const isObject = hasLeftHandObject(node.callee.object);
+
+                // check `Object` scope
+                const scope = context.getScope();
+                const variable = astUtils.getVariableByName(scope, "Object");
+
+                if (
+                    calleePropertyName === "call" &&
+                    objectPropertyName === "hasOwnProperty" &&
+                    isObject &&
+                    variable && variable.scope.type === "global"
+                ) {
+                    context.report({
+                        node,
+                        messageId: "useHasOwn",
+                        fix(fixer) {
+                            const sourceCode = context.getSourceCode();
+
+                            if (sourceCode.getCommentsInside(node.callee).length > 0) {
+                                return null;
+                            }
+
+                            const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true });
+
+                            // for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
+                            if (
+                                tokenJustBeforeNode &&
+                                tokenJustBeforeNode.range[1] === node.callee.range[0] &&
+                                !astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn")
+                            ) {
+                                return fixer.replaceText(node.callee, " Object.hasOwn");
+                            }
+
+                            return fixer.replaceText(node.callee, "Object.hasOwn");
+                        }
+                    });
+                }
+            }
+        };
+    }
+};
index b63474ef2bd376de77ba9b7ca46bc1be4f1d7000..08192001a2b8d7decdadd5694060ba27994d9346 100644 (file)
@@ -247,7 +247,7 @@ module.exports = {
 
         docs: {
             description:
-                "disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.",
+                "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-object-spread"
         },
index 60e72f451019f8e2f439e006ee5a105622fadd17..bd7bdcbf5b7b86a3da03b30237e67cec36632725 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require using Error objects as Promise rejection reasons",
+            description: "Require using Error objects as Promise rejection reasons",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-promise-reject-errors"
         },
index 1367a1848df9e27cbe249d7b21c81f0d9fcecc7f..68ffa88b35244110857902c653d8e32a5cd363ea 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `Reflect` methods where applicable",
+            description: "Require `Reflect` methods where applicable",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-reflect"
         },
@@ -106,7 +106,7 @@ module.exports = {
                 const methodName = (node.callee.property || {}).name;
                 const isReflectCall = (node.callee.object || {}).name === "Reflect";
                 const hasReflectSubstitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName);
-                const userConfiguredException = exceptions.indexOf(methodName) !== -1;
+                const userConfiguredException = exceptions.includes(methodName);
 
                 if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) {
                     report(node, existingNames[methodName], reflectSubstitutes[methodName]);
@@ -115,7 +115,7 @@ module.exports = {
             UnaryExpression(node) {
                 const isDeleteOperator = node.operator === "delete";
                 const targetsIdentifier = node.argument.type === "Identifier";
-                const userConfiguredException = exceptions.indexOf("delete") !== -1;
+                const userConfiguredException = exceptions.includes("delete");
 
                 if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) {
                     report(node, "the delete keyword", "Reflect.deleteProperty");
index afd6a01398e72d3cffaeec4e7566e9e5d5076eca..f30eddbf8c503a9c91cd6e8965ddaf88930aedeb 100644 (file)
 
 const astUtils = require("./utils/ast-utils");
 const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils");
+const { RegExpValidator, visitRegExpAST, RegExpParser } = require("regexpp");
+const { canTokensBeAdjacent } = require("./utils/ast-utils");
 
 //------------------------------------------------------------------------------
 // Helpers
 //------------------------------------------------------------------------------
 
+const REGEXPP_LATEST_ECMA_VERSION = 2022;
+
 /**
  * Determines whether the given node is a string literal.
  * @param {ASTNode} node Node to check.
@@ -43,6 +47,71 @@ function isStaticTemplateLiteral(node) {
     return node.type === "TemplateLiteral" && node.expressions.length === 0;
 }
 
+const validPrecedingTokens = new Set([
+    "(",
+    ";",
+    "[",
+    ",",
+    "=",
+    "+",
+    "*",
+    "-",
+    "?",
+    "~",
+    "%",
+    "**",
+    "!",
+    "typeof",
+    "instanceof",
+    "&&",
+    "||",
+    "??",
+    "return",
+    "...",
+    "delete",
+    "void",
+    "in",
+    "<",
+    ">",
+    "<=",
+    ">=",
+    "==",
+    "===",
+    "!=",
+    "!==",
+    "<<",
+    ">>",
+    ">>>",
+    "&",
+    "|",
+    "^",
+    ":",
+    "{",
+    "=>",
+    "*=",
+    "<<=",
+    ">>=",
+    ">>>=",
+    "^=",
+    "|=",
+    "&=",
+    "??=",
+    "||=",
+    "&&=",
+    "**=",
+    "+=",
+    "-=",
+    "/=",
+    "%=",
+    "/",
+    "do",
+    "break",
+    "continue",
+    "debugger",
+    "case",
+    "throw"
+]);
+
 
 //------------------------------------------------------------------------------
 // Rule Definition
@@ -54,11 +123,13 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow use of the `RegExp` constructor in favor of regular expression literals",
+            description: "Disallow use of the `RegExp` constructor in favor of regular expression literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-regex-literals"
         },
 
+        hasSuggestions: true,
+
         schema: [
             {
                 type: "object",
@@ -74,6 +145,7 @@ module.exports = {
 
         messages: {
             unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.",
+            replaceWithLiteral: "Replace with an equivalent regular expression literal.",
             unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
             unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor."
         }
@@ -81,6 +153,7 @@ module.exports = {
 
     create(context) {
         const [{ disallowRedundantWrapping = false } = {}] = context.options;
+        const sourceCode = context.getSourceCode();
 
         /**
          * Determines whether the given identifier node is a reference to a global variable.
@@ -107,6 +180,27 @@ module.exports = {
                 isStaticTemplateLiteral(node.quasi);
         }
 
+        /**
+         * Gets the value of a string
+         * @param {ASTNode} node The node to get the string of.
+         * @returns {string|null} The value of the node.
+         */
+        function getStringValue(node) {
+            if (isStringLiteral(node)) {
+                return node.value;
+            }
+
+            if (isStaticTemplateLiteral(node)) {
+                return node.quasis[0].value.cooked;
+            }
+
+            if (isStringRawTaggedStaticTemplateLiteral(node)) {
+                return node.quasi.quasis[0].value.raw;
+            }
+
+            return null;
+        }
+
         /**
          * Determines whether the given node is considered to be a static string by the logic of this rule.
          * @param {ASTNode} node Node to check.
@@ -152,6 +246,53 @@ module.exports = {
             return false;
         }
 
+        /**
+         * Returns a ecmaVersion compatible for regexpp.
+         * @param {any} ecmaVersion The ecmaVersion to convert.
+         * @returns {import("regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp.
+         */
+        function getRegexppEcmaVersion(ecmaVersion) {
+            if (typeof ecmaVersion !== "number" || ecmaVersion <= 5) {
+                return 5;
+            }
+            return Math.min(ecmaVersion + 2009, REGEXPP_LATEST_ECMA_VERSION);
+        }
+
+        /**
+         * Makes a character escaped or else returns null.
+         * @param {string} character The character to escape.
+         * @returns {string} The resulting escaped character.
+         */
+        function resolveEscapes(character) {
+            switch (character) {
+                case "\n":
+                case "\\\n":
+                    return "\\n";
+
+                case "\r":
+                case "\\\r":
+                    return "\\r";
+
+                case "\t":
+                case "\\\t":
+                    return "\\t";
+
+                case "\v":
+                case "\\\v":
+                    return "\\v";
+
+                case "\f":
+                case "\\\f":
+                    return "\\f";
+
+                case "/":
+                    return "\\/";
+
+                default:
+                    return null;
+            }
+        }
+
         return {
             Program() {
                 const scope = context.getScope();
@@ -171,7 +312,82 @@ module.exports = {
                             context.report({ node, messageId: "unexpectedRedundantRegExp" });
                         }
                     } else if (hasOnlyStaticStringArguments(node)) {
-                        context.report({ node, messageId: "unexpectedRegExp" });
+                        let regexContent = getStringValue(node.arguments[0]);
+                        let noFix = false;
+                        let flags;
+
+                        if (node.arguments[1]) {
+                            flags = getStringValue(node.arguments[1]);
+                        }
+
+                        const regexppEcmaVersion = getRegexppEcmaVersion(context.parserOptions.ecmaVersion);
+                        const RegExpValidatorInstance = new RegExpValidator({ ecmaVersion: regexppEcmaVersion });
+
+                        try {
+                            RegExpValidatorInstance.validatePattern(regexContent, 0, regexContent.length, flags ? flags.includes("u") : false);
+                            if (flags) {
+                                RegExpValidatorInstance.validateFlags(flags);
+                            }
+                        } catch {
+                            noFix = true;
+                        }
+
+                        const tokenBefore = sourceCode.getTokenBefore(node);
+
+                        if (tokenBefore && !validPrecedingTokens.has(tokenBefore.value)) {
+                            noFix = true;
+                        }
+
+                        if (!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.><?,'"|:;]*$/u.test(regexContent)) {
+                            noFix = true;
+                        }
+
+                        if (sourceCode.getCommentsInside(node).length > 0) {
+                            noFix = true;
+                        }
+
+                        if (regexContent && !noFix) {
+                            let charIncrease = 0;
+
+                            const ast = new RegExpParser({ ecmaVersion: regexppEcmaVersion }).parsePattern(regexContent, 0, regexContent.length, flags ? flags.includes("u") : false);
+
+                            visitRegExpAST(ast, {
+                                onCharacterEnter(characterNode) {
+                                    const escaped = resolveEscapes(characterNode.raw);
+
+                                    if (escaped) {
+                                        regexContent =
+                                            regexContent.slice(0, characterNode.start + charIncrease) +
+                                            escaped +
+                                            regexContent.slice(characterNode.end + charIncrease);
+
+                                        if (characterNode.raw.length === 1) {
+                                            charIncrease += 1;
+                                        }
+                                    }
+                                }
+                            });
+                        }
+
+                        const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`;
+
+                        context.report({
+                            node,
+                            messageId: "unexpectedRegExp",
+                            suggest: noFix ? [] : [{
+                                messageId: "replaceWithLiteral",
+                                fix(fixer) {
+                                    const tokenAfter = sourceCode.getTokenAfter(node);
+
+                                    return fixer.replaceText(
+                                        node,
+                                        (tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") +
+                                            newRegExpValue +
+                                            (tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : "")
+                                    );
+                                }
+                            }]
+                        });
                     }
                 }
             }
index 371a28964f2739e5d560771ce40a192684e4715e..14b9ae55a4b8bc4dc50a482b9a5939ebc8e79073 100644 (file)
@@ -30,7 +30,7 @@ function getVariableOfArguments(scope) {
         }
     }
 
-    /* istanbul ignore next : unreachable */
+    /* c8 ignore next */
     return null;
 }
 
@@ -65,7 +65,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require rest parameters instead of `arguments`",
+            description: "Require rest parameters instead of `arguments`",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-rest-params"
         },
index c5f9e1e6cbf674b665e4bb95746d5407429aa931..c8909fc0612a6bf2360d3fe0d73a5708944b4e0e 100644 (file)
@@ -49,7 +49,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require spread operators instead of `.apply()`",
+            description: "Require spread operators instead of `.apply()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-spread"
         },
index 953155d8f982470c4f2d6f78dc18353a7ecfe348..167c187db6f70e3893410ab18197ed19f6b88018 100644 (file)
@@ -128,7 +128,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require template literals instead of string concatenation",
+            description: "Require template literals instead of string concatenation",
             recommended: false,
             url: "https://eslint.org/docs/rules/prefer-template"
         },
@@ -188,7 +188,7 @@ module.exports = {
                 return sourceCode.getText(currentNode);
             }
 
-            if (isConcatenation(currentNode) && hasStringLiteral(currentNode) && hasNonStringLiteral(currentNode)) {
+            if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) {
                 const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+");
                 const textBeforePlus = getTextBetween(currentNode.left, plusSign);
                 const textAfterPlus = getTextBetween(plusSign, currentNode.right);
index e57ad6eea294f719f317d32afa66a473a09aea6b..db9423978bb3808691b7362907e7c9689236c786 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require quotes around object literal property names",
+            description: "Require quotes around object literal property names",
             recommended: false,
             url: "https://eslint.org/docs/rules/quote-props"
         },
@@ -95,7 +95,7 @@ module.exports = {
          * @returns {boolean} `true` if it is an ES3 token.
          */
         function isKeyword(tokenStr) {
-            return keywords.indexOf(tokenStr) >= 0;
+            return keywords.includes(tokenStr);
         }
 
         /**
@@ -108,7 +108,7 @@ module.exports = {
          */
         function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) {
             return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length &&
-                (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 ||
+                (["Identifier", "Keyword", "Null", "Boolean"].includes(tokens[0].type) ||
                 (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value));
         }
 
index a9960961edf242060ae22ab63b2eab8ca337d228..ab7b38b90bfb081b0e39b2c1e55adaf4e9524bbe 100644 (file)
@@ -80,7 +80,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce the consistent use of either backticks, double, or single quotes",
+            description: "Enforce the consistent use of either backticks, double, or single quotes",
             recommended: false,
             url: "https://eslint.org/docs/rules/quotes"
         },
@@ -223,9 +223,20 @@ module.exports = {
                 // ModuleSpecifier.
                 case "ImportDeclaration":
                 case "ExportNamedDeclaration":
-                case "ExportAllDeclaration":
                     return parent.source === node;
 
+                // ModuleExportName or ModuleSpecifier.
+                case "ExportAllDeclaration":
+                    return parent.exported === node || parent.source === node;
+
+                // ModuleExportName.
+                case "ImportSpecifier":
+                    return parent.imported === node;
+
+                // ModuleExportName.
+                case "ExportSpecifier":
+                    return parent.local === node || parent.exported === node;
+
                 // Others don't allow.
                 default:
                     return false;
@@ -272,7 +283,7 @@ module.exports = {
                         astUtils.isSurroundedBy(rawVal, settings.quote);
 
                     if (!isValid && avoidEscape) {
-                        isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0;
+                        isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.includes(settings.quote);
                     }
 
                     if (!isValid) {
index f83c762c11d39788c390a4d277f45a75ca0b8492..0618d9844ad295aa78c4b1748780c9a236a2efc9 100644 (file)
@@ -80,7 +80,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce the consistent use of the radix argument when using `parseInt()`",
+            description: "Enforce the consistent use of the radix argument when using `parseInt()`",
             recommended: false,
             url: "https://eslint.org/docs/rules/radix"
         },
index 4dbd48dfc585a4d1f4ae24c3b1d6f4221dbef82c..7a5f822ab28c9ab055e737b9c2a5bf79f135f2c8 100644 (file)
@@ -171,7 +171,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
+            description: "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
             recommended: false,
             url: "https://eslint.org/docs/rules/require-atomic-updates"
         },
index 1b17de0e197556440199552cf23fdbfe8fb4a0de..1add2552e58043a85c748dbea6f05285ddd918dc 100644 (file)
@@ -34,7 +34,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "disallow async functions which have no `await` expression",
+            description: "Disallow async functions which have no `await` expression",
             recommended: false,
             url: "https://eslint.org/docs/rules/require-await"
         },
index 169b6f524139cb4cfa819e658c3bd94a6067f5dd..755f6df5fee3a9a7f8658558582b5f57788fd964 100644 (file)
@@ -11,7 +11,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require JSDoc comments",
+            description: "Require JSDoc comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/require-jsdoc"
         },
index 577ae6cf8271d114f6b005bd5692e62ea1544864..4236af6db4775e671325df2f5fee7326acded264 100644 (file)
@@ -26,7 +26,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce the use of `u` flag on RegExp",
+            description: "Enforce the use of `u` flag on RegExp",
             recommended: false,
             url: "https://eslint.org/docs/rules/require-unicode-regexp"
         },
index aba06140672d6a6058e776c45b4733ebb309155d..b3f1341136aad1601ebbc949b43dc5f0a039b24e 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require generator functions to contain `yield`",
+            description: "Require generator functions to contain `yield`",
             recommended: true,
             url: "https://eslint.org/docs/rules/require-yield"
         },
@@ -68,7 +68,6 @@ module.exports = {
             // Increases the count of `yield` keyword.
             YieldExpression() {
 
-                /* istanbul ignore else */
                 if (stack.length > 0) {
                     stack[stack.length - 1] += 1;
                 }
index ace1ec521415ab031cd8c1e636b3a68884d13610..17f9aa0c3c5ea6cb0cd70e63e73d49c3bdcab772 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce spacing between rest and spread operators and their expressions",
+            description: "Enforce spacing between rest and spread operators and their expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/rest-spread-spacing"
         },
index 4f0afbb11a3db4f030348db6096f02c21b9e921c..875cb62443d1da025f411165cd4fcab6d96682f4 100644 (file)
@@ -17,7 +17,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before and after semicolons",
+            description: "Enforce consistent spacing before and after semicolons",
             recommended: false,
             url: "https://eslint.org/docs/rules/semi-spacing"
         },
index 7952a9adff1632ca279d4db40ca089dea3b94388..424858b4ba125dab71b70d70d28d6180c37d8254 100644 (file)
@@ -73,7 +73,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce location of semicolons",
+            description: "Enforce location of semicolons",
             recommended: false,
             url: "https://eslint.org/docs/rules/semi-style"
         },
index 86ff8d74ee12d7aa2a6003da738e5f9c923c49a4..1e49273c2e9617237e58b6726e25bcf8a506b174 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow semicolons instead of ASI",
+            description: "Require or disallow semicolons instead of ASI",
             recommended: false,
             url: "https://eslint.org/docs/rules/semi"
         },
index 13cb63681cb8a66de1b84b4a775dab56dc706129..bfb0765baa5e6fa28c5a5a072659ec227ae3d924 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce sorted import declarations within modules",
+            description: "Enforce sorted import declarations within modules",
             recommended: false,
             url: "https://eslint.org/docs/rules/sort-imports"
         },
index 2fc19635271759f83446c6dd359af2cb3922e2c3..1523ab751a0094d291827cdd6a7c871a3139527e 100644 (file)
@@ -81,7 +81,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require object keys to be sorted",
+            description: "Require object keys to be sorted",
             recommended: false,
             url: "https://eslint.org/docs/rules/sort-keys"
         },
@@ -105,6 +105,10 @@ module.exports = {
                         type: "integer",
                         minimum: 2,
                         default: 2
+                    },
+                    allowLineSeparatedGroups: {
+                        type: "boolean",
+                        default: false
                     }
                 },
                 additionalProperties: false
@@ -124,17 +128,21 @@ module.exports = {
         const insensitive = options && options.caseSensitive === false;
         const natural = options && options.natural;
         const minKeys = options && options.minKeys;
+        const allowLineSeparatedGroups = options && options.allowLineSeparatedGroups || false;
         const isValidOrder = isValidOrders[
             order + (insensitive ? "I" : "") + (natural ? "N" : "")
         ];
 
         // The stack to save the previous property's name for each object literals.
         let stack = null;
+        const sourceCode = context.getSourceCode();
 
         return {
             ObjectExpression(node) {
                 stack = {
                     upper: stack,
+                    prevNode: null,
+                    prevBlankLine: false,
                     prevName: null,
                     numKeys: node.properties.length
                 };
@@ -159,10 +167,45 @@ module.exports = {
                 const numKeys = stack.numKeys;
                 const thisName = getPropertyName(node);
 
+                // Get tokens between current node and previous node
+                const tokens = stack.prevNode && sourceCode
+                    .getTokensBetween(stack.prevNode, node, { includeComments: true });
+
+                let isBlankLineBetweenNodes = stack.prevBlankLine;
+
+                if (tokens) {
+
+                    // check blank line between tokens
+                    tokens.forEach((token, index) => {
+                        const previousToken = tokens[index - 1];
+
+                        if (previousToken && (token.loc.start.line - previousToken.loc.end.line > 1)) {
+                            isBlankLineBetweenNodes = true;
+                        }
+                    });
+
+                    // check blank line between the current node and the last token
+                    if (!isBlankLineBetweenNodes && (node.loc.start.line - tokens[tokens.length - 1].loc.end.line > 1)) {
+                        isBlankLineBetweenNodes = true;
+                    }
+
+                    // check blank line between the first token and the previous node
+                    if (!isBlankLineBetweenNodes && (tokens[0].loc.start.line - stack.prevNode.loc.end.line > 1)) {
+                        isBlankLineBetweenNodes = true;
+                    }
+                }
+
+                stack.prevNode = node;
+
                 if (thisName !== null) {
                     stack.prevName = thisName;
                 }
 
+                if (allowLineSeparatedGroups && isBlankLineBetweenNodes) {
+                    stack.prevBlankLine = thisName === null;
+                    return;
+                }
+
                 if (prevName === null || thisName === null || numKeys < minKeys) {
                     return;
                 }
index 8246558c5478f7d94ba296be412a2497d95f5b01..ec0718ee578c742c3f3dedad3da7c94acf7d36c5 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require variables within the same declaration block to be sorted",
+            description: "Require variables within the same declaration block to be sorted",
             recommended: false,
             url: "https://eslint.org/docs/rules/sort-vars"
         },
index 5cc7266654f5fc75a64fba44d303264fd0ba7dc9..ffd33ddcaeac5afaf13b7b021e45b4df917393ce 100644 (file)
@@ -40,7 +40,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before blocks",
+            description: "Enforce consistent spacing before blocks",
             recommended: false,
             url: "https://eslint.org/docs/rules/space-before-blocks"
         },
index fdd45be241d4645f6d73c4e9e26fba5dfae32456..b56ac3c52c7aaa96debf527962368ae8c0e87f33 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before `function` definition opening parenthesis",
+            description: "Enforce consistent spacing before `function` definition opening parenthesis",
             recommended: false,
             url: "https://eslint.org/docs/rules/space-before-function-paren"
         },
index 1509d600f1d58dbce096504505398b3924b8ba44..42d9bb58e7e4ca4f914949499ae3410bc67e5e72 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing inside parentheses",
+            description: "Enforce consistent spacing inside parentheses",
             recommended: false,
             url: "https://eslint.org/docs/rules/space-in-parens"
         },
index c526b7e2b0a40669a3f01768b581fa6b72af47b8..141c269df6b0fce4af7594cb579898f7892bbf77 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require spacing around infix operators",
+            description: "Require spacing around infix operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/space-infix-ops"
         },
index 04487c49e0d8c62bba7f80a765a10c9ca3057cf2..1d9141d2b97fae7b37ec880e73a65568b5df93cf 100644 (file)
@@ -20,7 +20,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce consistent spacing before or after unary operators",
+            description: "Enforce consistent spacing before or after unary operators",
             recommended: false,
             url: "https://eslint.org/docs/rules/space-unary-ops"
         },
index 674c13cf3807ec6378544ec3324bd85589fe9885..6aedeae871d7ba98579e758ef972500e2f80cae6 100644 (file)
@@ -39,7 +39,7 @@ function escapeAndRepeat(s) {
 function parseMarkersOption(markers) {
 
     // `*` is a marker for JSDoc comments.
-    if (markers.indexOf("*") === -1) {
+    if (!markers.includes("*")) {
         return markers.concat("*");
     }
 
@@ -152,7 +152,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce consistent spacing after the `//` or `/*` in a comment",
+            description: "Enforce consistent spacing after the `//` or `/*` in a comment",
             recommended: false,
             url: "https://eslint.org/docs/rules/spaced-comment"
         },
index 0ea1da5677ed6daaa8e2790e0fa9e0895a7a8327..e677c95e71739dc96c37a74e9ce287c823222895 100644 (file)
@@ -69,7 +69,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require or disallow strict mode directives",
+            description: "Require or disallow strict mode directives",
             recommended: false,
             url: "https://eslint.org/docs/rules/strict"
         },
index cd2ca7018d284f9747e5b0ff833011aaca7981b1..c1df496fd9407d73d220ed962d30289b9475fa8a 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "enforce spacing around colons of switch statements",
+            description: "Enforce spacing around colons of switch statements",
             recommended: false,
             url: "https://eslint.org/docs/rules/switch-colon-spacing"
         },
index 07bb8cd27355fe60aca7d32a0c7c71e72254f0a0..1c8a364986c8e26bd73450056967b6e59fcfebdc 100644 (file)
@@ -22,7 +22,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require symbol descriptions",
+            description: "Require symbol descriptions",
             recommended: false,
             url: "https://eslint.org/docs/rules/symbol-description"
         },
index c842b76a41f38bacc35e24b42322566459c64fef..35d4bbab4d789c311f7b0dafbbee03b45ac1bae8 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow spacing around embedded expressions of template strings",
+            description: "Require or disallow spacing around embedded expressions of template strings",
             recommended: false,
             url: "https://eslint.org/docs/rules/template-curly-spacing"
         },
index fa1a613b8949057fd9a2a6175cc99f3b96792735..3140fa0eed77d50e8d1e0c6850497924819d03e4 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow spacing between template tags and their literals",
+            description: "Require or disallow spacing between template tags and their literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/template-tag-spacing"
         },
index d480f1bcdc8575406f61589ed81eb5a900825431..482d3bbf50b34e2f40a372ae01338da66045fa90 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow Unicode byte order mark (BOM)",
+            description: "Require or disallow Unicode byte order mark (BOM)",
             recommended: false,
             url: "https://eslint.org/docs/rules/unicode-bom"
         },
index 92903500c183366e6326d4a23e9498e7343b23c5..219d695374e16ab6f18fad8d8875b8552ca8d049 100644 (file)
@@ -37,7 +37,7 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "require calls to `isNaN()` when checking for `NaN`",
+            description: "Require calls to `isNaN()` when checking for `NaN`",
             recommended: true,
             url: "https://eslint.org/docs/rules/use-isnan"
         },
index 16d7b81157148349b277868918ed57e4f31ee6ab..f4a18cff78320f7a5d60fca37aa07cd422d008db 100644 (file)
@@ -32,6 +32,7 @@ const thisTagPattern = /^[\s*]*@this/mu;
 
 
 const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u;
+const ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u;
 const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]);
 
 // A set of node types that can contain a list of statements
@@ -769,6 +770,222 @@ function getSwitchCaseColonToken(node, sourceCode) {
     return sourceCode.getFirstToken(node, 1);
 }
 
+/**
+ * Gets ESM module export name represented by the given node.
+ * @param {ASTNode} node `Identifier` or string `Literal` node in a position
+ * that represents a module export name:
+ *   - `ImportSpecifier#imported`
+ *   - `ExportSpecifier#local` (if it is a re-export from another module)
+ *   - `ExportSpecifier#exported`
+ *   - `ExportAllDeclaration#exported`
+ * @returns {string} The module export name.
+ */
+function getModuleExportName(node) {
+    if (node.type === "Identifier") {
+        return node.name;
+    }
+
+    // string literal
+    return node.value;
+}
+
+/**
+ * Returns literal's value converted to the Boolean type
+ * @param {ASTNode} node any `Literal` node
+ * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy,
+ *  `null` when it cannot be determined.
+ */
+function getBooleanValue(node) {
+    if (node.value === null) {
+
+        /*
+         * it might be a null literal or bigint/regex literal in unsupported environments .
+         * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral
+         * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral
+         */
+
+        if (node.raw === "null") {
+            return false;
+        }
+
+        // regex is always truthy
+        if (typeof node.regex === "object") {
+            return true;
+        }
+
+        return null;
+    }
+
+    return !!node.value;
+}
+
+/**
+ * Checks if a branch node of LogicalExpression short circuits the whole condition
+ * @param {ASTNode} node The branch of main condition which needs to be checked
+ * @param {string} operator The operator of the main LogicalExpression.
+ * @returns {boolean} true when condition short circuits whole condition
+ */
+function isLogicalIdentity(node, operator) {
+    switch (node.type) {
+        case "Literal":
+            return (operator === "||" && getBooleanValue(node) === true) ||
+                  (operator === "&&" && getBooleanValue(node) === false);
+
+        case "UnaryExpression":
+            return (operator === "&&" && node.operator === "void");
+
+        case "LogicalExpression":
+
+            /*
+             * handles `a && false || b`
+             * `false` is an identity element of `&&` but not `||`
+             */
+            return operator === node.operator &&
+                    (
+                        isLogicalIdentity(node.left, operator) ||
+                        isLogicalIdentity(node.right, operator)
+                    );
+
+        case "AssignmentExpression":
+            return ["||=", "&&="].includes(node.operator) &&
+               operator === node.operator.slice(0, -1) &&
+               isLogicalIdentity(node.right, operator);
+
+       // no default
+    }
+    return false;
+}
+
+/**
+ * Checks if an identifier is a reference to a global variable.
+ * @param {Scope} scope The scope in which the identifier is referenced.
+ * @param {ASTNode} node An identifier node to check.
+ * @returns {boolean} `true` if the identifier is a reference to a global variable.
+ */
+function isReferenceToGlobalVariable(scope, node) {
+    const reference = scope.references.find(ref => ref.identifier === node);
+
+    return Boolean(
+        reference &&
+            reference.resolved &&
+            reference.resolved.scope.type === "global" &&
+            reference.resolved.defs.length === 0
+    );
+}
+
+
+/**
+ * Checks if a  node has a constant truthiness value.
+ * @param {Scope} scope Scope in which the node appears.
+ * @param {ASTNode} node The AST node to check.
+ * @param {boolean} inBooleanPosition `true` if checking the test of a
+ * condition. `false` in all other cases. When `false`, checks if -- for
+ * both string and number -- if coerced to that type, the value will
+ * be constant.
+ * @returns {boolean} true when node's truthiness is constant
+ * @private
+ */
+function isConstant(scope, node, inBooleanPosition) {
+
+    // node.elements can return null values in the case of sparse arrays ex. [,]
+    if (!node) {
+        return true;
+    }
+    switch (node.type) {
+        case "Literal":
+        case "ArrowFunctionExpression":
+        case "FunctionExpression":
+            return true;
+        case "ClassExpression":
+        case "ObjectExpression":
+
+            /**
+             * In theory objects like:
+             *
+             * `{toString: () => a}`
+             * `{valueOf: () => a}`
+             *
+             * Or a classes like:
+             *
+             * `class { static toString() { return a } }`
+             * `class { static valueOf() { return a } }`
+             *
+             * Are not constant verifiably when `inBooleanPosition` is
+             * false, but it's an edge case we've opted not to handle.
+             */
+            return true;
+        case "TemplateLiteral":
+            return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) ||
+                        node.expressions.every(exp => isConstant(scope, exp, false));
+
+        case "ArrayExpression": {
+            if (!inBooleanPosition) {
+                return node.elements.every(element => isConstant(scope, element, false));
+            }
+            return true;
+        }
+
+        case "UnaryExpression":
+            if (
+                node.operator === "void" ||
+                        node.operator === "typeof" && inBooleanPosition
+            ) {
+                return true;
+            }
+
+            if (node.operator === "!") {
+                return isConstant(scope, node.argument, true);
+            }
+
+            return isConstant(scope, node.argument, false);
+
+        case "BinaryExpression":
+            return isConstant(scope, node.left, false) &&
+                            isConstant(scope, node.right, false) &&
+                            node.operator !== "in";
+
+        case "LogicalExpression": {
+            const isLeftConstant = isConstant(scope, node.left, inBooleanPosition);
+            const isRightConstant = isConstant(scope, node.right, inBooleanPosition);
+            const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator));
+            const isRightShortCircuit = (inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator));
+
+            return (isLeftConstant && isRightConstant) ||
+                        isLeftShortCircuit ||
+                        isRightShortCircuit;
+        }
+        case "NewExpression":
+            return inBooleanPosition;
+        case "AssignmentExpression":
+            if (node.operator === "=") {
+                return isConstant(scope, node.right, inBooleanPosition);
+            }
+
+            if (["||=", "&&="].includes(node.operator) && inBooleanPosition) {
+                return isLogicalIdentity(node.right, node.operator.slice(0, -1));
+            }
+
+            return false;
+
+        case "SequenceExpression":
+            return isConstant(scope, node.expressions[node.expressions.length - 1], inBooleanPosition);
+        case "SpreadElement":
+            return isConstant(scope, node.argument, inBooleanPosition);
+        case "CallExpression":
+            if (node.callee.type === "Identifier" && node.callee.name === "Boolean") {
+                if (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)) {
+                    return isReferenceToGlobalVariable(scope, node.callee);
+                }
+            }
+            return false;
+        case "Identifier":
+            return node.name === "undefined" && isReferenceToGlobalVariable(scope, node);
+
+                // no default
+    }
+    return false;
+}
+
 //------------------------------------------------------------------------------
 // Public Interface
 //------------------------------------------------------------------------------
@@ -889,12 +1106,8 @@ module.exports = {
         const comment = node.value.trim();
 
         return (
-            node.type === "Line" && comment.indexOf("eslint-") === 0 ||
-            node.type === "Block" && (
-                comment.indexOf("global ") === 0 ||
-                comment.indexOf("eslint ") === 0 ||
-                comment.indexOf("eslint-") === 0
-            )
+            node.type === "Line" && comment.startsWith("eslint-") ||
+            node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment)
         );
     },
 
@@ -1137,7 +1350,7 @@ module.exports = {
             }
         }
 
-        /* istanbul ignore next */
+        /* c8 ignore next */
         return true;
     },
 
@@ -1765,7 +1978,7 @@ module.exports = {
             if (comments.length) {
                 const lastComment = comments[comments.length - 1];
 
-                if (lastComment.range[0] > leftToken.range[0]) {
+                if (!leftToken || lastComment.range[0] > leftToken.range[0]) {
                     leftToken = lastComment;
                 }
             }
@@ -1773,7 +1986,13 @@ module.exports = {
             leftToken = leftValue;
         }
 
-        if (leftToken.type === "Shebang") {
+        /*
+         * If a hashbang comment was passed as a token object from SourceCode,
+         * its type will be "Shebang" because of the way ESLint itself handles hashbangs.
+         * If a hashbang comment was passed in a string and then tokenized in this function,
+         * its type will be "Hashbang" because of the way Espree tokenizes hashbangs.
+         */
+        if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") {
             return false;
         }
 
@@ -1794,7 +2013,7 @@ module.exports = {
             if (comments.length) {
                 const firstComment = comments[0];
 
-                if (firstComment.range[0] < rightToken.range[0]) {
+                if (!rightToken || firstComment.range[0] < rightToken.range[0]) {
                     rightToken = firstComment;
                 }
             }
@@ -1886,6 +2105,7 @@ module.exports = {
         return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString);
     },
 
+    isReferenceToGlobalVariable,
     isLogicalExpression,
     isCoalesceExpression,
     isMixedLogicalAndCoalesceExpressions,
@@ -1898,5 +2118,7 @@ module.exports = {
     equalLiteralValue,
     isSameReference,
     isLogicalAssignmentOperator,
-    getSwitchCaseColonToken
+    getSwitchCaseColonToken,
+    getModuleExportName,
+    isConstant
 };
index c118e033dd875a3d739b825a49d71978876922b3..25be39fdd516b556599189d3c80d436bf64c07b0 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "enforce valid JSDoc comments",
+            description: "Enforce valid JSDoc comments",
             recommended: false,
             url: "https://eslint.org/docs/rules/valid-jsdoc"
         },
@@ -405,7 +405,7 @@ module.exports = {
                             loc: getAbsoluteRange(jsdocNode, param),
                             data: { name: param.name }
                         });
-                    } else if (param.name.indexOf(".") === -1) {
+                    } else if (!param.name.includes(".")) {
                         paramTagsByName[param.name] = param;
                     }
                 });
index 6046358123351355da518fa820634f40ad5fd8f2..908d5725e224c695464dfbbc3c388c74f4913a99 100644 (file)
@@ -14,11 +14,13 @@ module.exports = {
         type: "problem",
 
         docs: {
-            description: "enforce comparing `typeof` expressions against valid strings",
+            description: "Enforce comparing `typeof` expressions against valid strings",
             recommended: true,
             url: "https://eslint.org/docs/rules/valid-typeof"
         },
 
+        hasSuggestions: true,
+
         schema: [
             {
                 type: "object",
@@ -33,17 +35,33 @@ module.exports = {
         ],
         messages: {
             invalidValue: "Invalid typeof comparison value.",
-            notString: "Typeof comparisons should be to string literals."
+            notString: "Typeof comparisons should be to string literals.",
+            suggestString: 'Use `"{{type}}"` instead of `{{type}}`.'
         }
     },
 
     create(context) {
 
-        const VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"],
-            OPERATORS = ["==", "===", "!=", "!=="];
+        const VALID_TYPES = new Set(["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"]),
+            OPERATORS = new Set(["==", "===", "!=", "!=="]);
 
         const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals;
 
+        let globalScope;
+
+        /**
+         * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
+         * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
+         * @param {ASTNode} node `Identifier` node to check.
+         * @returns {boolean} `true` if the node is a reference to a global variable.
+         */
+        function isReferenceToGlobalVariable(node) {
+            const variable = globalScope.set.get(node.name);
+
+            return variable && variable.defs.length === 0 &&
+                variable.references.some(ref => ref.identifier === node);
+        }
+
         /**
          * Determines whether a node is a typeof expression.
          * @param {ASTNode} node The node
@@ -59,19 +77,37 @@ module.exports = {
 
         return {
 
+            Program() {
+                globalScope = context.getScope();
+            },
+
             UnaryExpression(node) {
                 if (isTypeofExpression(node)) {
                     const parent = context.getAncestors().pop();
 
-                    if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) {
+                    if (parent.type === "BinaryExpression" && OPERATORS.has(parent.operator)) {
                         const sibling = parent.left === node ? parent.right : parent.left;
 
                         if (sibling.type === "Literal" || sibling.type === "TemplateLiteral" && !sibling.expressions.length) {
                             const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked;
 
-                            if (VALID_TYPES.indexOf(value) === -1) {
+                            if (!VALID_TYPES.has(value)) {
                                 context.report({ node: sibling, messageId: "invalidValue" });
                             }
+                        } else if (sibling.type === "Identifier" && sibling.name === "undefined" && isReferenceToGlobalVariable(sibling)) {
+                            context.report({
+                                node: sibling,
+                                messageId: requireStringLiterals ? "notString" : "invalidValue",
+                                suggest: [
+                                    {
+                                        messageId: "suggestString",
+                                        data: { type: "undefined" },
+                                        fix(fixer) {
+                                            return fixer.replaceText(sibling, '"undefined"');
+                                        }
+                                    }
+                                ]
+                            });
                         } else if (requireStringLiterals && !isTypeofExpression(sibling)) {
                             context.report({ node: sibling, messageId: "notString" });
                         }
index 09e9932b4ca5a8aa808be129615bac856185f0ad..99e2b4ac0dd181bb7d1b86a4c583c5c1b9f3ec58 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: "require `var` declarations be placed at the top of their containing scope",
+            description: "Require `var` declarations be placed at the top of their containing scope",
             recommended: false,
             url: "https://eslint.org/docs/rules/vars-on-top"
         },
index 8523796722a18730c1c622777f0a83c33c41069c..4c2c9275d879cf7bdccedc1b30fb9f148dfd3b2b 100644 (file)
@@ -43,7 +43,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require parentheses around immediate `function` invocations",
+            description: "Require parentheses around immediate `function` invocations",
             recommended: false,
             url: "https://eslint.org/docs/rules/wrap-iife"
         },
index b10f2ec53bd8d87eb0606355cab05570606cbf1c..b24d36025ed55fed598053294cb36de440ed3485 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require parenthesis around regex literals",
+            description: "Require parenthesis around regex literals",
             recommended: false,
             url: "https://eslint.org/docs/rules/wrap-regex"
         },
index 884a3a4ed01601da4ad3070d5da590e984073a64..c2e07aaaa22c79b141dcc92564f0d8b100a47afa 100644 (file)
@@ -15,7 +15,7 @@ module.exports = {
         type: "layout",
 
         docs: {
-            description: "require or disallow spacing around the `*` in `yield*` expressions",
+            description: "Require or disallow spacing around the `*` in `yield*` expressions",
             recommended: false,
             url: "https://eslint.org/docs/rules/yield-star-spacing"
         },
index f491f756d5463d2e6da49f1af4a56ca4273c31c7..eb9a32ad5c3001609c0afb7636725a0af368b9e5 100644 (file)
@@ -39,7 +39,7 @@ function isEqualityOperator(operator) {
  * @returns {boolean} Whether the operator is used in range tests.
  */
 function isRangeTestOperator(operator) {
-    return ["<", "<="].indexOf(operator) >= 0;
+    return ["<", "<="].includes(operator);
 }
 
 /**
@@ -121,7 +121,7 @@ module.exports = {
         type: "suggestion",
 
         docs: {
-            description: 'require or disallow "Yoda" conditions',
+            description: 'Require or disallow "Yoda" conditions',
             recommended: false,
             url: "https://eslint.org/docs/rules/yoda"
         },
index 1a0501ab057a1123c3ae956b7372bf2771bd7679..d09cafb07fe13f502d60cb02c2c5f3b7ef9bf584 100644 (file)
@@ -17,14 +17,7 @@ const path = require("path");
 // Definitions for deprecation warnings.
 const deprecationWarningMessages = {
     ESLINT_LEGACY_ECMAFEATURES:
-        "The 'ecmaFeatures' config file property is deprecated and has no effect.",
-    ESLINT_PERSONAL_CONFIG_LOAD:
-        "'~/.eslintrc.*' config files have been deprecated. " +
-        "Please use a config file per project or the '--config' option.",
-    ESLINT_PERSONAL_CONFIG_SUPPRESS:
-        "'~/.eslintrc.*' config files have been deprecated. " +
-        "Please remove it or add 'root:true' to the config files in your " +
-        "projects in order to avoid loading '~/.eslintrc.*' accidentally."
+        "The 'ecmaFeatures' config file property is deprecated and has no effect."
 };
 
 const sourceFileErrorCache = new Set();
index 7f06a74e1423ca2bcec07bee5d6ee411109ed530..fd5e8a648e1c253a909ce09812c383061497bfe1 100644 (file)
@@ -7,7 +7,7 @@
 
 /* eslint no-console: "off" -- Logging util */
 
-/* istanbul ignore next */
+/* c8 ignore next */
 module.exports = {
 
     /**
index ab59207a6b116432a2d86e036e0737b3ce8817ba..60f9f1d6afe9e2945c2a3d25d76552121876abf7 100644 (file)
@@ -21,7 +21,7 @@ module.exports = {};
 /**
  * @typedef {Object} ParserOptions
  * @property {EcmaFeatures} [ecmaFeatures] The optional features.
- * @property {3|5|6|7|8|9|10|11|12|13|2015|2016|2017|2018|2019|2020|2021|2022} [ecmaVersion] The ECMAScript version (or revision number).
+ * @property {3|5|6|7|8|9|10|11|12|13|14|2015|2016|2017|2018|2019|2020|2021|2022|2023} [ecmaVersion] The ECMAScript version (or revision number).
  * @property {"script"|"module"} [sourceType] The source code type.
  * @property {boolean} [allowReserved] Allowing the use of reserved words as identifiers in ES3.
  */
@@ -105,6 +105,21 @@ module.exports = {};
  * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions.
  */
 
+/**
+ * @typedef {Object} SuppressedLintMessage
+ * @property {number|undefined} column The 1-based column number.
+ * @property {number} [endColumn] The 1-based column number of the end location.
+ * @property {number} [endLine] The 1-based line number of the end location.
+ * @property {boolean} fatal If `true` then this is a fatal error.
+ * @property {{range:[number,number], text:string}} [fix] Information for autofix.
+ * @property {number|undefined} line The 1-based line number.
+ * @property {string} message The error message.
+ * @property {string|null} ruleId The ID of the rule which makes this message.
+ * @property {0|1|2} severity The severity of this message.
+ * @property {Array<{kind: string, justification: string}>} suppressions The suppression info.
+ * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions.
+ */
+
 /**
  * @typedef {Object} SuggestionResult
  * @property {string} desc A short description.
@@ -121,7 +136,6 @@ module.exports = {};
 
 /**
  * @typedef {Object} RuleMetaDocs
- * @property {string} category The category of the rule.
  * @property {string} description The description of the rule.
  * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset.
  * @property {string} url The URL of the rule documentation.
@@ -132,6 +146,7 @@ module.exports = {};
  * @property {boolean} [deprecated] If `true` then the rule has been deprecated.
  * @property {RuleMetaDocs} docs The document information of the rule.
  * @property {"code"|"whitespace"} [fixable] The autofix type.
+ * @property {boolean} [hasSuggestions] If `true` then the rule provides suggestions.
  * @property {Record<string,string>} [messages] The messages the rule reports.
  * @property {string[]} [replacedBy] The IDs of the alternative rules.
  * @property {Array|Object} schema The option schema of the rule.
@@ -158,3 +173,27 @@ module.exports = {};
  * @property {string} ruleId The rule ID.
  * @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
  */
+
+/**
+ * A linting result.
+ * @typedef {Object} LintResult
+ * @property {string} filePath The path to the file that was linted.
+ * @property {LintMessage[]} messages All of the messages for the result.
+ * @property {SuppressedLintMessage[]} suppressedMessages All of the suppressed messages for the result.
+ * @property {number} errorCount Number of errors for the result.
+ * @property {number} fatalErrorCount Number of fatal errors for the result.
+ * @property {number} warningCount Number of warnings for the result.
+ * @property {number} fixableErrorCount Number of fixable errors for the result.
+ * @property {number} fixableWarningCount Number of fixable warnings for the result.
+ * @property {string} [source] The source code of the file that was linted.
+ * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible.
+ * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules.
+ */
+
+/**
+ * A formatter function.
+ * @callback FormatterFunction
+ * @param {LintResult[]} results The list of linting results.
+ * @param {{cwd: string, rulesMeta: Record<string, RuleMeta>}} [context] A context object.
+ * @returns {string | Promise<string>} Formatted text.
+ */
index 494762acdfae334791280ef03c18a5861c0224a7..0b726006e8e30b729ff514482775054b1192803d 100644 (file)
@@ -69,7 +69,7 @@ module.exports = class Cursor {
      * @returns {boolean} `true` if the next token exists.
      * @abstract
      */
-    /* istanbul ignore next */
+    /* c8 ignore next */
     moveNext() { // eslint-disable-line class-methods-use-this -- Unused
         throw new Error("Not implemented.");
     }
index 110b35a47a4e5579b2fc9bef9a544cc55c300a41..c1daf54d6aebc191b196cdd49db7213f2ac17049 100644 (file)
@@ -12,6 +12,8 @@
 //-----------------------------------------------------------------------------
 
 const { FileEnumerator } = require("./cli-engine/file-enumerator");
+const { FlatESLint } = require("./eslint/flat-eslint");
+const FlatRuleTester = require("./rule-tester/flat-rule-tester");
 
 //-----------------------------------------------------------------------------
 // Exports
@@ -19,5 +21,7 @@ const { FileEnumerator } = require("./cli-engine/file-enumerator");
 
 module.exports = {
     builtinRules: require("./rules"),
+    FlatESLint,
+    FlatRuleTester,
     FileEnumerator
 };
index d85828d36e7b6682cab1b861fe9a8562fe429148..70877a4d823e3643ff10637fcc77b8c3b2b579be 100644 (file)
@@ -12,5 +12,5 @@ If you do want to lint these files, try the following solutions:
 
 * Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored.
 * Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument.
-`.trimLeft();
+`.trimStart();
 };
index db8a5c64b9f3d07d73bd3196b9fc8730c3196a98..5b3498fcda408ba025d3caf60d42b6ed132884c7 100644 (file)
@@ -9,5 +9,5 @@ ESLint couldn't find the config "${configName}" to extend from. Please check tha
 The config "${configName}" was referenced from the config file in "${importerName}".
 
 If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
-`.trimLeft();
+`.trimStart();
 };
index 5114de30980140a3e04c8797fcf5d1f346cac907..e7c6cb58759f61757e91599c352f169af4b8227d 100644 (file)
@@ -7,5 +7,5 @@ module.exports = function(it) {
 Failed to read JSON file at ${path}:
 
 ${message}
-`.trimLeft();
+`.trimStart();
 };
index 26a5d57eff7a547b4f24f3b800434f4aa9a866e4..1a62fcf96b9ef6603e13b3d860b8543f5af56fc9 100644 (file)
@@ -6,5 +6,5 @@ module.exports = function(it) {
     return `
 No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
 Please check for typing mistakes in the pattern.
-`.trimLeft();
+`.trimStart();
 };
index 1042143f9fd771882e5cce0e5054f53a7a9e11ae..9860410a60292d3d78369238d4100df155eb9962 100644 (file)
@@ -6,10 +6,10 @@ module.exports = function(it) {
     return `
 ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
 
-    eslint --init
+    npm init @eslint/config
 
 ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory.
 
 If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help
-`.trimLeft();
+`.trimStart();
 };
index 7913576f000e3e07b4a264fc3d5f6c21bc1b2f96..8b471d4a3366a68d417f1f8143d13f573416679b 100644 (file)
@@ -12,5 +12,5 @@ module.exports = function(it) {
 "${configName}" was referenced from the config file in "${importerName}".
 
 If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
-`.trimLeft();
+`.trimStart();
 };
index f58c78ceb3811d9ec7fdf5b5cdf537c97cfd7556..0b7d34e3aa5f850e4e37053dc7f98664ddbf188f 100644 (file)
@@ -15,5 +15,5 @@ It's likely that the plugin isn't installed correctly. Try reinstalling by runni
 The plugin "${pluginName}" was referenced from the config file in "${importerName}".
 
 If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
-`.trimLeft();
+`.trimStart();
 };
index 6a5d571dd3760804f31b5309456af5641e05bcd7..f65bdaaf7704c03f3ee9ff231d00007566334b8d 100644 (file)
@@ -4,5 +4,5 @@ module.exports = function() {
     return `
 The '--print-config' CLI option requires a path to a source code file rather than a directory.
 See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config
-`.trimLeft();
+`.trimStart();
 };
index 4ce49ca3a4e3f43d902c753612fcbad27f45e442..8a801bcec6f8250b31dc9e6fc2d53c07cd3a0629 100644 (file)
@@ -7,5 +7,5 @@ module.exports = function(it) {
 ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name.
 
 If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
-`.trimLeft();
+`.trimStart();
 };
index 82cc50e84eee4eaa99086862fd646aa129f98f2d..d002a6023fe8578532149c6b27d79ae77bcb9de5 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "eslint",
-  "version": "8.4.0",
+  "version": "8.23.1",
   "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
   "description": "An AST-based pattern checker for JavaScript.",
   "bin": {
@@ -16,7 +16,9 @@
     "test": "node Makefile.js test",
     "test:cli": "mocha",
     "lint": "node Makefile.js lint",
+    "lint:docsjs": "node Makefile.js lintDocsJS",
     "fix": "node Makefile.js lint -- fix",
+    "fix:docsjs": "node Makefile.js lintDocsJS -- fix",
     "fuzz": "node Makefile.js fuzz",
     "generate-release": "node Makefile.js generateRelease",
     "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha",
     "publish-release": "node Makefile.js publishRelease",
     "gensite": "node Makefile.js gensite",
     "webpack": "node Makefile.js webpack",
-    "perf": "node Makefile.js perf"
+    "perf": "node Makefile.js perf",
+    "docs:update-links": "node tools/fetch-docs-links.js"
   },
   "gitHooks": {
     "pre-commit": "lint-staged"
   },
   "lint-staged": {
     "*.js": "eslint --fix",
-    "*.md": "markdownlint"
+    "*.md": "markdownlint --fix",
+    "docs/src/rules/*.md": [
+      "node tools/fetch-docs-links.js",
+      "git add docs/src/_data/further_reading_links.json"
+    ],
+    "docs/**/*.svg": "npx svgo -r --multipass"
   },
   "files": [
     "LICENSE",
   "homepage": "https://eslint.org",
   "bugs": "https://github.com/eslint/eslint/issues/",
   "dependencies": {
-    "@eslint/eslintrc": "^1.0.5",
-    "@humanwhocodes/config-array": "^0.9.2",
+    "@eslint/eslintrc": "^1.3.2",
+    "@humanwhocodes/config-array": "^0.10.4",
+    "@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
+    "@humanwhocodes/module-importer": "^1.0.1",
     "ajv": "^6.10.0",
     "chalk": "^4.0.0",
     "cross-spawn": "^7.0.2",
     "debug": "^4.3.2",
     "doctrine": "^3.0.0",
-    "enquirer": "^2.3.5",
     "escape-string-regexp": "^4.0.0",
-    "eslint-scope": "^7.1.0",
+    "eslint-scope": "^7.1.1",
     "eslint-utils": "^3.0.0",
-    "eslint-visitor-keys": "^3.1.0",
-    "espree": "^9.2.0",
+    "eslint-visitor-keys": "^3.3.0",
+    "espree": "^9.4.0",
     "esquery": "^1.4.0",
     "esutils": "^2.0.2",
     "fast-deep-equal": "^3.1.3",
     "file-entry-cache": "^6.0.1",
-    "functional-red-black-tree": "^1.0.1",
+    "find-up": "^5.0.0",
     "glob-parent": "^6.0.1",
-    "globals": "^13.6.0",
-    "ignore": "^4.0.6",
+    "globals": "^13.15.0",
+    "globby": "^11.1.0",
+    "grapheme-splitter": "^1.0.4",
+    "ignore": "^5.2.0",
     "import-fresh": "^3.0.0",
     "imurmurhash": "^0.1.4",
     "is-glob": "^4.0.0",
+    "js-sdsl": "^4.1.4",
     "js-yaml": "^4.1.0",
     "json-stable-stringify-without-jsonify": "^1.0.1",
     "levn": "^0.4.1",
     "lodash.merge": "^4.6.2",
-    "minimatch": "^3.0.4",
+    "minimatch": "^3.1.2",
     "natural-compare": "^1.4.0",
     "optionator": "^0.9.1",
-    "progress": "^2.0.0",
     "regexpp": "^3.2.0",
-    "semver": "^7.2.1",
     "strip-ansi": "^6.0.1",
     "strip-json-comments": "^3.1.0",
-    "text-table": "^0.2.0",
-    "v8-compile-cache": "^2.0.3"
+    "text-table": "^0.2.0"
   },
   "devDependencies": {
     "@babel/core": "^7.4.3",
     "@babel/preset-env": "^7.4.3",
     "babel-loader": "^8.0.5",
+    "c8": "^7.12.0",
     "chai": "^4.0.1",
     "cheerio": "^0.22.0",
     "common-tags": "^1.8.0",
     "core-js": "^3.1.3",
-    "dateformat": "^4.5.1",
     "ejs": "^3.0.2",
     "eslint": "file:.",
     "eslint-config-eslint": "file:packages/eslint-config-eslint",
     "eslint-plugin-eslint-comments": "^3.2.0",
-    "eslint-plugin-eslint-plugin": "^4.0.1",
+    "eslint-plugin-eslint-plugin": "^4.4.0",
     "eslint-plugin-internal-rules": "file:tools/internal-rules",
-    "eslint-plugin-jsdoc": "^37.0.0",
-    "eslint-plugin-node": "^11.1.0",
+    "eslint-plugin-jsdoc": "^38.1.6",
+    "eslint-plugin-n": "^15.2.4",
+    "eslint-plugin-unicorn": "^42.0.0",
     "eslint-release": "^3.2.0",
     "eslump": "^3.0.0",
     "esprima": "^4.0.1",
+    "fast-glob": "^3.2.11",
     "fs-teardown": "^0.1.3",
     "glob": "^7.1.6",
+    "got": "^11.8.3",
+    "gray-matter": "^4.0.3",
     "jsdoc": "^3.5.5",
     "karma": "^6.1.1",
     "karma-chrome-launcher": "^3.1.0",
     "karma-webpack": "^5.0.0",
     "lint-staged": "^11.0.0",
     "load-perf": "^0.2.0",
-    "markdownlint": "^0.24.0",
-    "markdownlint-cli": "^0.30.0",
+    "markdownlint": "^0.25.1",
+    "markdownlint-cli": "^0.31.1",
+    "marked": "^4.0.8",
     "memfs": "^3.0.1",
+    "metascraper": "^5.25.7",
+    "metascraper-description": "^5.25.7",
+    "metascraper-image": "^5.29.3",
+    "metascraper-logo": "^5.25.7",
+    "metascraper-logo-favicon": "^5.25.7",
+    "metascraper-title": "^5.25.7",
     "mocha": "^8.3.2",
     "mocha-junit-reporter": "^2.0.0",
     "node-polyfill-webpack-plugin": "^1.0.3",
     "npm-license": "^0.3.3",
-    "nyc": "^15.0.1",
+    "pirates": "^4.0.5",
+    "progress": "^2.0.3",
     "proxyquire": "^2.0.1",
-    "puppeteer": "^9.1.1",
+    "puppeteer": "^13.7.0",
     "recast": "^0.20.4",
     "regenerator-runtime": "^0.13.2",
+    "semver": "^7.3.5",
     "shelljs": "^0.8.2",
     "sinon": "^11.0.0",
     "temp": "^0.9.0",
index 37be7ec5eb11950425ea6290cf3654e57c564fa2..2d73ee127fe3c441d10bd0ba29fb9814684ac35f 100644 (file)
@@ -2,11 +2,14 @@
 layout: post
 title: ESLint v<%- version %> released
 teaser: "We just pushed ESLint v<%- version %>, which is a <%- type %> release upgrade of ESLint. This release <% if (type !== "patch") { %>adds some new features and <% } %>fixes several bugs found in the previous release.<% if (type === "major") { %> This release also has some breaking changes, so please read the following closely.<% } %>"
+image: release-notes-<%- type %>.png
+draft: true
+authors:
+  - eslintbot
 categories:
   - Release Notes
 tags:
-  - release
-  - <%- type %>
+  - Release
 ---
 
 <%
index b5583957f670822a4ccb68083f97abb44f3fbd9d..6dae9d79002c5f9866cf6d381286dea69fa0d925 100644 (file)
@@ -1,8 +1,13 @@
 ---
-title: Documentation
+title: Formatters
 layout: doc
+eleventyNavigation:
+    key: formatters
+    parent: user guide
+    title: Formatters
+    order: 5
+edit_link: https://github.com/eslint/eslint/edit/main/templates/formatter-examples.md.ejs
 ---
-# ESLint Formatters
 
 ESLint comes with several built-in formatters to control the appearance of the linting results, and supports third-party formatters as well.
 
@@ -50,10 +55,12 @@ function addOne(i) {
 
 ### <%= formatterName %>
 <% if (formatterName !== "html") { -%>
-```
-<%- formatterResults[formatterName].result %>
+
+```text
+<%= formatterResults[formatterName].result %>
 ```
 <% } else {-%>
+
 <iframe src="html-formatter-example.html" width="100%" height="460px"></iframe>
 <% } -%>
 <% }) -%>
diff --git a/eslint/tests/_utils/test-lazy-loading-rules.js b/eslint/tests/_utils/test-lazy-loading-rules.js
new file mode 100644 (file)
index 0000000..34e1986
--- /dev/null
@@ -0,0 +1,66 @@
+/**
+ * @fileoverview Tests lazy-loading of core rules
+ * @author Milos Djermanovic
+ */
+
+/*
+ * This module should be run as a child process, with `fork()`,
+ * because it is important to run this test with a separate, clean Node process
+ * in order to add hooks before any of the ESLint modules is loaded.
+ */
+
+"use strict";
+
+const path = require("path");
+const assert = require("assert");
+const { addHook } = require("pirates");
+
+const {
+    dir: rulesDirectoryPath,
+    name: rulesDirectoryIndexFilename
+} = path.parse(require.resolve("../../lib/rules"));
+
+// Show full stack trace. The default 10 is usually not enough to find the root cause of this problem.
+Error.stackTraceLimit = Infinity;
+
+const [cwd, pattern, usedRulesCommaSeparated] = process.argv.slice(2);
+
+assert.ok(cwd, "cwd argument isn't provided");
+assert.ok(pattern, "pattern argument isn't provided");
+assert.ok(usedRulesCommaSeparated, "used rules argument isn't provided");
+
+const usedRules = usedRulesCommaSeparated.split(",");
+
+// `require()` hook
+addHook(
+    (_code, filename) => {
+        throw new Error(`Unexpected attempt to load unused rule ${filename}`);
+    },
+    {
+
+        // returns `true` if the hook (the function passed in as the first argument) should be called for this filename
+        matcher(filename) {
+            const { dir, name } = path.parse(filename);
+
+            if (dir === rulesDirectoryPath && ![rulesDirectoryIndexFilename, ...usedRules].includes(name)) {
+                return true;
+            }
+
+            return false;
+        }
+
+    }
+);
+
+/*
+ * Everything related to loading any ESLint modules should be in this IIFE
+ */
+(async () => {
+    const { ESLint } = require("../..");
+    const eslint = new ESLint({ cwd });
+
+    await eslint.lintFiles([pattern]);
+})().catch(({ message, stack }) => {
+    process.send({ message, stack });
+    process.exit(1); // eslint-disable-line n/no-process-exit -- this is a child process
+});
index 38f132b583964b1895713942a8cf8241ac732efd..848dba146713152e178b13f1f5b7ee50a60c0dfd 100644 (file)
@@ -82,7 +82,7 @@ describe("bin/eslint.js", () => {
 
     describe("reading from stdin", () => {
         it("has exit code 0 if no linting errors are reported", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc"]);
+            const child = runESLint(["--stdin", "--no-config-lookup"]);
 
             child.stdin.write("var foo = bar;\n");
             child.stdin.end();
@@ -92,7 +92,7 @@ describe("bin/eslint.js", () => {
         it("has exit code 0 if no linting errors are reported", () => {
             const child = runESLint([
                 "--stdin",
-                "--no-eslintrc",
+                "--no-config-lookup",
                 "--rule",
                 "{'no-extra-semi': 2}",
                 "--fix-dry-run",
@@ -104,6 +104,7 @@ describe("bin/eslint.js", () => {
                 {
                     filePath: "<text>",
                     messages: [],
+                    suppressedMessages: [],
                     errorCount: 0,
                     fatalErrorCount: 0,
                     warningCount: 0,
@@ -127,7 +128,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 1 if a syntax error is thrown", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc"]);
+            const child = runESLint(["--stdin", "--no-config-lookup"]);
 
             child.stdin.write("This is not valid JS syntax.\n");
             child.stdin.end();
@@ -135,7 +136,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 2 if a syntax error is thrown when exit-on-fatal-error is true", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc", "--exit-on-fatal-error"]);
+            const child = runESLint(["--stdin", "--no-config-lookup", "--exit-on-fatal-error"]);
 
             child.stdin.write("This is not valid JS syntax.\n");
             child.stdin.end();
@@ -143,7 +144,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 1 if a linting error occurs", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc", "--rule", "semi:2"]);
+            const child = runESLint(["--stdin", "--no-config-lookup", "--rule", "semi:2"]);
 
             child.stdin.write("var foo = bar // <-- no semicolon\n");
             child.stdin.end();
@@ -181,7 +182,7 @@ describe("bin/eslint.js", () => {
         );
 
         it("successfully reads from an asynchronous pipe", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc"]);
+            const child = runESLint(["--stdin", "--no-config-lookup"]);
 
             child.stdin.write("var foo = bar;\n");
             return new Promise(resolve => setTimeout(resolve, 300)).then(() => {
@@ -193,7 +194,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("successfully handles more than 4k data via stdin", () => {
-            const child = runESLint(["--stdin", "--no-eslintrc"]);
+            const child = runESLint(["--stdin", "--no-config-lookup"]);
             const large = fs.createReadStream(path.join(__dirname, "../bench/large.js"), "utf8");
 
             large.pipe(child.stdin);
@@ -204,9 +205,9 @@ describe("bin/eslint.js", () => {
 
     describe("running on files", () => {
         it("has exit code 0 if no linting errors occur", () => assertExitCode(runESLint(["bin/eslint.js"]), 0));
-        it("has exit code 0 if a linting warning is reported", () => assertExitCode(runESLint(["bin/eslint.js", "--env", "es2021", "--no-eslintrc", "--rule", "semi: [1, never]"]), 0));
-        it("has exit code 1 if a linting error is reported", () => assertExitCode(runESLint(["bin/eslint.js", "--env", "es2021", "--no-eslintrc", "--rule", "semi: [2, never]"]), 1));
-        it("has exit code 1 if a syntax error is thrown", () => assertExitCode(runESLint(["README.md"]), 1));
+        it("has exit code 0 if a linting warning is reported", () => assertExitCode(runESLint(["bin/eslint.js", "--no-config-lookup", "--rule", "semi: [1, never]"]), 0));
+        it("has exit code 1 if a linting error is reported", () => assertExitCode(runESLint(["bin/eslint.js", "--no-config-lookup", "--rule", "semi: [2, never]"]), 1));
+        it("has exit code 1 if a syntax error is thrown", () => assertExitCode(runESLint(["tests/fixtures/exit-on-fatal-error/fatal-error.js", "--no-ignore"]), 1));
     });
 
     describe("automatically fixing files", () => {
@@ -221,7 +222,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 0 and fixes a file if all rules can be fixed", () => {
-            const child = runESLint(["--fix", "--no-eslintrc", "--no-ignore", tempFilePath]);
+            const child = runESLint(["--fix", "--no-config-lookup", "--no-ignore", tempFilePath]);
             const exitCodeAssertion = assertExitCode(child, 0);
             const outputFileAssertion = awaitExit(child).then(() => {
                 assert.strictEqual(fs.readFileSync(tempFilePath).toString(), expectedFixedText);
@@ -231,7 +232,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 0, fixes errors in a file, and does not report or fix warnings if --quiet and --fix are used", () => {
-            const child = runESLint(["--fix", "--quiet", "--no-eslintrc", "--no-ignore", tempFilePath]);
+            const child = runESLint(["--fix", "--quiet", "--no-config-lookup", "--no-ignore", tempFilePath]);
             const exitCodeAssertion = assertExitCode(child, 0);
             const stdoutAssertion = getOutput(child).then(output => assert.strictEqual(output.stdout, ""));
             const outputFileAssertion = awaitExit(child).then(() => {
@@ -242,7 +243,7 @@ describe("bin/eslint.js", () => {
         });
 
         it("has exit code 1 and fixes a file if not all rules can be fixed", () => {
-            const child = runESLint(["--fix", "--no-eslintrc", "--no-ignore", "--rule", "max-len: [2, 10]", tempFilePath]);
+            const child = runESLint(["--fix", "--no-config-lookup", "--no-ignore", "--rule", "max-len: [2, 10]", tempFilePath]);
             const exitCodeAssertion = assertExitCode(child, 1);
             const outputFileAssertion = awaitExit(child).then(() => {
                 assert.strictEqual(fs.readFileSync(tempFilePath).toString(), expectedFixedText);
@@ -259,7 +260,7 @@ describe("bin/eslint.js", () => {
     describe("cache files", () => {
         const CACHE_PATH = ".temp-eslintcache";
         const SOURCE_PATH = "tests/fixtures/cache/src/test-file.js";
-        const ARGS_WITHOUT_CACHE = ["--no-eslintrc", "--no-ignore", SOURCE_PATH, "--cache-location", CACHE_PATH];
+        const ARGS_WITHOUT_CACHE = ["--no-config-lookup", "--no-ignore", SOURCE_PATH, "--cache-location", CACHE_PATH];
         const ARGS_WITH_CACHE = ARGS_WITHOUT_CACHE.concat("--cache");
 
         describe("when no cache file exists", () => {
@@ -387,40 +388,10 @@ describe("bin/eslint.js", () => {
         });
 
         it("prints the error message pointing to line of code", () => {
-            const invalidConfig = path.join(__dirname, "../fixtures/bin/.eslintrc.yml");
-            const child = runESLint(["--no-ignore", invalidConfig]);
-            const exitCodeAssertion = assertExitCode(child, 2);
-            const outputAssertion = getOutput(child).then(output => {
-                assert.strictEqual(output.stdout, "");
-                assert.match(
-                    output.stderr,
-                    /: bad indentation of a mapping entry \(\d+:\d+\)/u // a part of the error message from `js-yaml` dependency
-                );
-            });
-
-            return Promise.all([exitCodeAssertion, outputAssertion]);
-        });
-    });
-
+            const invalidConfig = path.join(__dirname, "../fixtures/bin/eslint.config.js");
+            const child = runESLint(["--no-ignore", "-c", invalidConfig]);
 
-    describe("emitting a warning for ecmaFeatures", () => {
-        it("does not emit a warning when it does not find an ecmaFeatures option", () => {
-            const child = runESLint(["Makefile.js"]);
-
-            const exitCodePromise = assertExitCode(child, 0);
-            const outputPromise = getOutput(child).then(output => assert.strictEqual(output.stderr, ""));
-
-            return Promise.all([exitCodePromise, outputPromise]);
-        });
-        it("emits a warning when it finds an ecmaFeatures option", () => {
-            const child = runESLint(["-c", "tests/fixtures/config-file/ecma-features/.eslintrc.yml", "Makefile.js"]);
-
-            const exitCodePromise = assertExitCode(child, 0);
-            const outputPromise = getOutput(child).then(output => {
-                assert.include(output.stderr, "The 'ecmaFeatures' config file property is deprecated and has no effect.");
-            });
-
-            return Promise.all([exitCodePromise, outputPromise]);
+            return assertExitCode(child, 2);
         });
     });
 
diff --git a/eslint/tests/fixtures/autoconfig/source-with-comments.js b/eslint/tests/fixtures/autoconfig/source-with-comments.js
deleted file mode 100644 (file)
index d2e3bf9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* eslint semi: [2, "never"] */
-/* eslint import/extensions: 2 */
-
-var foo = 42;
-var baz = "baz";
-var bar = '"no-escape"';
diff --git a/eslint/tests/fixtures/autoconfig/source.js b/eslint/tests/fixtures/autoconfig/source.js
deleted file mode 100644 (file)
index 0c126ba..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var foo = 42;
-var baz = "baz";
-var bar = '"no-escape"';
diff --git a/eslint/tests/fixtures/bin/eslint.config.js b/eslint/tests/fixtures/bin/eslint.config.js
new file mode 100644 (file)
index 0000000..bbaa759
--- /dev/null
@@ -0,0 +1,5 @@
+// intentionally invalid JavaScript
+rules:
+  semi: error
+yoda: error
+  quotes: error
diff --git a/eslint/tests/fixtures/cli-engine/deprecated-rule-config/eslint.config.js b/eslint/tests/fixtures/cli-engine/deprecated-rule-config/eslint.config.js
new file mode 100644 (file)
index 0000000..eb9b7f0
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        "indent-legacy": "error"
+    }
+};
diff --git a/eslint/tests/fixtures/config-hierarchy/broken/add-conf.js b/eslint/tests/fixtures/config-hierarchy/broken/add-conf.js
new file mode 100644 (file)
index 0000000..75c3292
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        semi: [1, "never"]
+    }
+};
diff --git a/eslint/tests/fixtures/config-hierarchy/broken/override-conf.js b/eslint/tests/fixtures/config-hierarchy/broken/override-conf.js
new file mode 100644 (file)
index 0000000..6287d08
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        quotes: 0;
+    }
+};
diff --git a/eslint/tests/fixtures/config-initializer/lib/doubleQuotes.js b/eslint/tests/fixtures/config-initializer/lib/doubleQuotes.js
deleted file mode 100644 (file)
index 1cd4a2a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var foo = "doubleQuotes";
diff --git a/eslint/tests/fixtures/config-initializer/lib/no-semi.js b/eslint/tests/fixtures/config-initializer/lib/no-semi.js
deleted file mode 100644 (file)
index bf10b1c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var name = "ESLint"
diff --git a/eslint/tests/fixtures/config-initializer/new-es-features/new-es-features.js b/eslint/tests/fixtures/config-initializer/new-es-features/new-es-features.js
deleted file mode 100644 (file)
index c3e03fc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-async function fn() {
-    await Promise.resolve();
-}
diff --git a/eslint/tests/fixtures/config-initializer/parse-error/parse-error.js b/eslint/tests/fixtures/config-initializer/parse-error/parse-error.js
deleted file mode 100644 (file)
index 90bd920..0000000
+++ /dev/null
@@ -1 +0,0 @@
-+;
diff --git a/eslint/tests/fixtures/config-initializer/singleQuotes.js b/eslint/tests/fixtures/config-initializer/singleQuotes.js
deleted file mode 100644 (file)
index db1e01f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var foo = 'singleQuotes';
diff --git a/eslint/tests/fixtures/config-initializer/tests/console-log.js b/eslint/tests/fixtures/config-initializer/tests/console-log.js
deleted file mode 100644 (file)
index 929e82a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-console.log("I'm a log");
diff --git a/eslint/tests/fixtures/config-initializer/tests/doubleQuotes.js b/eslint/tests/fixtures/config-initializer/tests/doubleQuotes.js
deleted file mode 100644 (file)
index 1cd4a2a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var foo = "doubleQuotes";
diff --git a/eslint/tests/fixtures/configurations/env-browser.js b/eslint/tests/fixtures/configurations/env-browser.js
new file mode 100644 (file)
index 0000000..a99c570
--- /dev/null
@@ -0,0 +1,11 @@
+module.exports = {
+    languageOptions: {
+        globals: {
+            window: false
+        }
+    },
+    rules: {
+        "no-alert": 0,
+        "no-undef": 2
+    }
+};
diff --git a/eslint/tests/fixtures/configurations/env-node.js b/eslint/tests/fixtures/configurations/env-node.js
new file mode 100644 (file)
index 0000000..27d5fe7
--- /dev/null
@@ -0,0 +1,13 @@
+module.exports = {
+    languageOptions: {
+        globals: {
+            __dirname: false,
+            console: false
+        },
+        sourceType: "commonjs"
+    },
+    rules: {
+        "no-console": 0,
+        "no-undef": 2
+    }
+};
diff --git a/eslint/tests/fixtures/configurations/es6.js b/eslint/tests/fixtures/configurations/es6.js
new file mode 100644 (file)
index 0000000..975beb2
--- /dev/null
@@ -0,0 +1,7 @@
+module.exports = {
+    languageOptions: {
+        parserOptions: {
+            ecmaVersion: 6
+        }
+    }
+};
diff --git a/eslint/tests/fixtures/configurations/plugins-with-prefix.js b/eslint/tests/fixtures/configurations/plugins-with-prefix.js
new file mode 100644 (file)
index 0000000..4241114
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    "rules": {
+        "example/example-rule": 1
+    }
+};
diff --git a/eslint/tests/fixtures/configurations/processors.js b/eslint/tests/fixtures/configurations/processors.js
new file mode 100644 (file)
index 0000000..e8bcce3
--- /dev/null
@@ -0,0 +1,12 @@
+module.exports = {
+    "plugins": [
+        "processor",
+        "example"
+    ],
+
+    "rules": {
+        "no-console": 2,
+        "no-unused-vars": 2,
+        "example/example-rule": 1
+    }
+}
diff --git a/eslint/tests/fixtures/configurations/quotes-error.js b/eslint/tests/fixtures/configurations/quotes-error.js
new file mode 100644 (file)
index 0000000..bbf45f0
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        quotes: [2, "double"]
+    }
+};
diff --git a/eslint/tests/fixtures/configurations/semi-error.js b/eslint/tests/fixtures/configurations/semi-error.js
new file mode 100644 (file)
index 0000000..2dcc0b1
--- /dev/null
@@ -0,0 +1,6 @@
+module.exports = {
+    rules: {
+        semi: 1,
+        strict: 0
+    }
+};
diff --git a/eslint/tests/fixtures/eslint.config.js b/eslint/tests/fixtures/eslint.config.js
new file mode 100644 (file)
index 0000000..2d9e084
--- /dev/null
@@ -0,0 +1,6 @@
+
+module.exports = {
+    rules: {
+        strict: 0
+    }
+};
diff --git a/eslint/tests/fixtures/ignored-paths/.eslintignoreForNegationTest b/eslint/tests/fixtures/ignored-paths/.eslintignoreForNegationTest
new file mode 100644 (file)
index 0000000..d1cc10c
--- /dev/null
@@ -0,0 +1 @@
+undef.js
diff --git a/eslint/tests/fixtures/ignored-paths/.eslintignoreWithEscapedBrackets b/eslint/tests/fixtures/ignored-paths/.eslintignoreWithEscapedBrackets
new file mode 100644 (file)
index 0000000..4cc03e6
--- /dev/null
@@ -0,0 +1,3 @@
+brackets/\[index.js
+brackets/index\].js
+brackets/\[index\].js
diff --git a/eslint/tests/fixtures/ignored-paths/brackets/[index.js b/eslint/tests/fixtures/ignored-paths/brackets/[index.js
new file mode 100644 (file)
index 0000000..9b2b301
--- /dev/null
@@ -0,0 +1 @@
+/* content is not necessary */
diff --git a/eslint/tests/fixtures/ignored-paths/brackets/[index].js b/eslint/tests/fixtures/ignored-paths/brackets/[index].js
new file mode 100644 (file)
index 0000000..9b2b301
--- /dev/null
@@ -0,0 +1 @@
+/* content is not necessary */
diff --git a/eslint/tests/fixtures/ignored-paths/brackets/index.js b/eslint/tests/fixtures/ignored-paths/brackets/index.js
new file mode 100644 (file)
index 0000000..9b2b301
--- /dev/null
@@ -0,0 +1 @@
+/* content is not necessary */
diff --git a/eslint/tests/fixtures/ignored-paths/brackets/index].js b/eslint/tests/fixtures/ignored-paths/brackets/index].js
new file mode 100644 (file)
index 0000000..9b2b301
--- /dev/null
@@ -0,0 +1 @@
+/* content is not necessary */
diff --git a/eslint/tests/fixtures/lazy-loading-rules/.eslintrc.js b/eslint/tests/fixtures/lazy-loading-rules/.eslintrc.js
new file mode 100644 (file)
index 0000000..fc65002
--- /dev/null
@@ -0,0 +1,6 @@
+module.exports = {
+    root: true,
+    rules: {
+        semi: 2
+    }
+};
diff --git a/eslint/tests/fixtures/lazy-loading-rules/foo.js b/eslint/tests/fixtures/lazy-loading-rules/foo.js
new file mode 100644 (file)
index 0000000..9b2b301
--- /dev/null
@@ -0,0 +1 @@
+/* content is not necessary */
diff --git a/eslint/tests/fixtures/max-warnings/eslint.config.js b/eslint/tests/fixtures/max-warnings/eslint.config.js
new file mode 100644 (file)
index 0000000..8ad137c
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        quotes: [1, "single"]
+    }
+};
diff --git a/eslint/tests/fixtures/parsers/arrow-parens/identifer-type.js b/eslint/tests/fixtures/parsers/arrow-parens/identifer-type.js
deleted file mode 100644 (file)
index 747cd16..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-"use strict";
-
-// (a: T) => a
-
-exports.parse = () => ({
-    type: "Program",
-    start: 0,
-    end: 11,
-    loc: {
-        start: {
-            line: 1,
-            column: 0
-        },
-        end: {
-            line: 1,
-            column: 11
-        }
-    },
-    sourceType: "module",
-    body: [
-        {
-            type: "ExpressionStatement",
-            start: 0,
-            end: 11,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 0
-                },
-                end: {
-                    line: 1,
-                    column: 11
-                }
-            },
-            expression: {
-                type: "ArrowFunctionExpression",
-                start: 0,
-                end: 11,
-                loc: {
-                    start: {
-                        line: 1,
-                        column: 0
-                    },
-                    end: {
-                        line: 1,
-                        column: 11
-                    }
-                },
-                id: null,
-                generator: false,
-                expression: true,
-                async: false,
-                params: [
-                    {
-                        type: "Identifier",
-                        start: 1,
-                        end: 2,
-                        loc: {
-                            start: {
-                                line: 1,
-                                column: 1
-                            },
-                            end: {
-                                line: 1,
-                                column: 2
-                            }
-                        },
-                        name: "a",
-                        typeAnnotation: {
-                            type: "TypeAnnotation",
-                            start: 2,
-                            end: 5,
-                            loc: {
-                                start: {
-                                    line: 1,
-                                    column: 2
-                                },
-                                end: {
-                                    line: 1,
-                                    column: 5
-                                }
-                            },
-                            typeAnnotation: {
-                                type: "GenericTypeAnnotation",
-                                start: 4,
-                                end: 5,
-                                loc: {
-                                    start: {
-                                        line: 1,
-                                        column: 4
-                                    },
-                                    end: {
-                                        line: 1,
-                                        column: 5
-                                    }
-                                },
-                                typeParameters: null,
-                                id: {
-                                    type: "Identifier",
-                                    start: 4,
-                                    end: 5,
-                                    loc: {
-                                        start: {
-                                            line: 1,
-                                            column: 4
-                                        },
-                                        end: {
-                                            line: 1,
-                                            column: 5
-                                        }
-                                    },
-                                    name: "T",
-                                    range: [
-                                        4,
-                                        5
-                                    ],
-                                    _babelType: "Identifier"
-                                },
-                                range: [
-                                    4,
-                                    5
-                                ],
-                                _babelType: "GenericTypeAnnotation"
-                            },
-                            range: [
-                                2,
-                                5
-                            ],
-                            _babelType: "TypeAnnotation"
-                        },
-                        range: [
-                            1,
-                            2
-                        ],
-                        _babelType: "Identifier"
-                    }
-                ],
-                body: {
-                    type: "Identifier",
-                    start: 10,
-                    end: 11,
-                    loc: {
-                        start: {
-                            line: 1,
-                            column: 10
-                        },
-                        end: {
-                            line: 1,
-                            column: 11
-                        }
-                    },
-                    name: "a",
-                    range: [
-                        10,
-                        11
-                    ],
-                    _babelType: "Identifier"
-                },
-                range: [
-                    0,
-                    11
-                ],
-                _babelType: "ArrowFunctionExpression"
-            },
-            range: [
-                0,
-                11
-            ],
-            _babelType: "ExpressionStatement"
-        }
-    ],
-    tokens: [
-        {
-            type: "Punctuator",
-            value: "(",
-            start: 0,
-            end: 1,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 0
-                },
-                end: {
-                    line: 1,
-                    column: 1
-                }
-            },
-            range: [
-                0,
-                1
-            ]
-        },
-        {
-            type: "Identifier",
-            value: "a",
-            start: 1,
-            end: 2,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 1
-                },
-                end: {
-                    line: 1,
-                    column: 2
-                }
-            },
-            range: [
-                1,
-                2
-            ]
-        },
-        {
-            type: "Punctuator",
-            value: ":",
-            start: 2,
-            end: 3,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 2
-                },
-                end: {
-                    line: 1,
-                    column: 3
-                }
-            },
-            range: [
-                2,
-                3
-            ]
-        },
-        {
-            type: "Identifier",
-            value: "T",
-            start: 4,
-            end: 5,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 4
-                },
-                end: {
-                    line: 1,
-                    column: 5
-                }
-            },
-            range: [
-                4,
-                5
-            ]
-        },
-        {
-            type: "Punctuator",
-            value: ")",
-            start: 5,
-            end: 6,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 5
-                },
-                end: {
-                    line: 1,
-                    column: 6
-                }
-            },
-            range: [
-                5,
-                6
-            ]
-        },
-        {
-            type: "Punctuator",
-            value: "=>",
-            start: 7,
-            end: 9,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 7
-                },
-                end: {
-                    line: 1,
-                    column: 9
-                }
-            },
-            range: [
-                7,
-                9
-            ]
-        },
-        {
-            type: "Identifier",
-            value: "a",
-            start: 10,
-            end: 11,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 10
-                },
-                end: {
-                    line: 1,
-                    column: 11
-                }
-            },
-            range: [
-                10,
-                11
-            ]
-        },
-        {
-            type: {
-                label: "eof",
-                beforeExpr: false,
-                startsExpr: false,
-                rightAssociative: false,
-                isLoop: false,
-                isAssign: false,
-                prefix: false,
-                postfix: false,
-                binop: null,
-                updateContext: null
-            },
-            start: 11,
-            end: 11,
-            loc: {
-                start: {
-                    line: 1,
-                    column: 11
-                },
-                end: {
-                    line: 1,
-                    column: 11
-                }
-            },
-            range: [
-                11,
-                11
-            ]
-        }
-    ],
-    comments: [],
-    range: [
-        0,
-        11
-    ]
-});
diff --git a/eslint/tests/fixtures/parsers/arrow-parens/identifier-type.js b/eslint/tests/fixtures/parsers/arrow-parens/identifier-type.js
new file mode 100644 (file)
index 0000000..747cd16
--- /dev/null
@@ -0,0 +1,349 @@
+"use strict";
+
+// (a: T) => a
+
+exports.parse = () => ({
+    type: "Program",
+    start: 0,
+    end: 11,
+    loc: {
+        start: {
+            line: 1,
+            column: 0
+        },
+        end: {
+            line: 1,
+            column: 11
+        }
+    },
+    sourceType: "module",
+    body: [
+        {
+            type: "ExpressionStatement",
+            start: 0,
+            end: 11,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 1,
+                    column: 11
+                }
+            },
+            expression: {
+                type: "ArrowFunctionExpression",
+                start: 0,
+                end: 11,
+                loc: {
+                    start: {
+                        line: 1,
+                        column: 0
+                    },
+                    end: {
+                        line: 1,
+                        column: 11
+                    }
+                },
+                id: null,
+                generator: false,
+                expression: true,
+                async: false,
+                params: [
+                    {
+                        type: "Identifier",
+                        start: 1,
+                        end: 2,
+                        loc: {
+                            start: {
+                                line: 1,
+                                column: 1
+                            },
+                            end: {
+                                line: 1,
+                                column: 2
+                            }
+                        },
+                        name: "a",
+                        typeAnnotation: {
+                            type: "TypeAnnotation",
+                            start: 2,
+                            end: 5,
+                            loc: {
+                                start: {
+                                    line: 1,
+                                    column: 2
+                                },
+                                end: {
+                                    line: 1,
+                                    column: 5
+                                }
+                            },
+                            typeAnnotation: {
+                                type: "GenericTypeAnnotation",
+                                start: 4,
+                                end: 5,
+                                loc: {
+                                    start: {
+                                        line: 1,
+                                        column: 4
+                                    },
+                                    end: {
+                                        line: 1,
+                                        column: 5
+                                    }
+                                },
+                                typeParameters: null,
+                                id: {
+                                    type: "Identifier",
+                                    start: 4,
+                                    end: 5,
+                                    loc: {
+                                        start: {
+                                            line: 1,
+                                            column: 4
+                                        },
+                                        end: {
+                                            line: 1,
+                                            column: 5
+                                        }
+                                    },
+                                    name: "T",
+                                    range: [
+                                        4,
+                                        5
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                range: [
+                                    4,
+                                    5
+                                ],
+                                _babelType: "GenericTypeAnnotation"
+                            },
+                            range: [
+                                2,
+                                5
+                            ],
+                            _babelType: "TypeAnnotation"
+                        },
+                        range: [
+                            1,
+                            2
+                        ],
+                        _babelType: "Identifier"
+                    }
+                ],
+                body: {
+                    type: "Identifier",
+                    start: 10,
+                    end: 11,
+                    loc: {
+                        start: {
+                            line: 1,
+                            column: 10
+                        },
+                        end: {
+                            line: 1,
+                            column: 11
+                        }
+                    },
+                    name: "a",
+                    range: [
+                        10,
+                        11
+                    ],
+                    _babelType: "Identifier"
+                },
+                range: [
+                    0,
+                    11
+                ],
+                _babelType: "ArrowFunctionExpression"
+            },
+            range: [
+                0,
+                11
+            ],
+            _babelType: "ExpressionStatement"
+        }
+    ],
+    tokens: [
+        {
+            type: "Punctuator",
+            value: "(",
+            start: 0,
+            end: 1,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 1,
+                    column: 1
+                }
+            },
+            range: [
+                0,
+                1
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "a",
+            start: 1,
+            end: 2,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 1
+                },
+                end: {
+                    line: 1,
+                    column: 2
+                }
+            },
+            range: [
+                1,
+                2
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ":",
+            start: 2,
+            end: 3,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 2
+                },
+                end: {
+                    line: 1,
+                    column: 3
+                }
+            },
+            range: [
+                2,
+                3
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "T",
+            start: 4,
+            end: 5,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 4
+                },
+                end: {
+                    line: 1,
+                    column: 5
+                }
+            },
+            range: [
+                4,
+                5
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ")",
+            start: 5,
+            end: 6,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 5
+                },
+                end: {
+                    line: 1,
+                    column: 6
+                }
+            },
+            range: [
+                5,
+                6
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "=>",
+            start: 7,
+            end: 9,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 7
+                },
+                end: {
+                    line: 1,
+                    column: 9
+                }
+            },
+            range: [
+                7,
+                9
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "a",
+            start: 10,
+            end: 11,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 10
+                },
+                end: {
+                    line: 1,
+                    column: 11
+                }
+            },
+            range: [
+                10,
+                11
+            ]
+        },
+        {
+            type: {
+                label: "eof",
+                beforeExpr: false,
+                startsExpr: false,
+                rightAssociative: false,
+                isLoop: false,
+                isAssign: false,
+                prefix: false,
+                postfix: false,
+                binop: null,
+                updateContext: null
+            },
+            start: 11,
+            end: 11,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 11
+                },
+                end: {
+                    line: 1,
+                    column: 11
+                }
+            },
+            range: [
+                11,
+                11
+            ]
+        }
+    ],
+    comments: [],
+    range: [
+        0,
+        11
+    ]
+});
diff --git a/eslint/tests/fixtures/parsers/function-paren-newline/arrow-function-return-type.js b/eslint/tests/fixtures/parsers/function-paren-newline/arrow-function-return-type.js
new file mode 100644 (file)
index 0000000..dbd9d48
--- /dev/null
@@ -0,0 +1,660 @@
+"use strict";
+
+/**
+ * Parser: @typescript-eslint/parser@5.10.1
+ * Source code:
+ * const method6 = (
+ *   abc: number,
+ *   def: () => void,
+ * ): [
+ *  string,
+ *  () => void
+ * ] => [`a${abc}`, def];
+ * method6(3, () => {});
+ */
+
+ exports.parse = () => ({
+  type: "Program",
+  body: [
+      {
+          type: "VariableDeclaration",
+          declarations: [
+              {
+                  type: "VariableDeclarator",
+                  id: {
+                      type: "Identifier",
+                      name: "method6",
+                      range: [6, 13],
+                      loc: {
+                          start: { line: 1, column: 6 },
+                          end: { line: 1, column: 13 },
+                      },
+                  },
+                  init: {
+                      type: "ArrowFunctionExpression",
+                      generator: false,
+                      id: null,
+                      params: [
+                          {
+                              type: "Identifier",
+                              name: "abc",
+                              range: [20, 31],
+                              loc: {
+                                  start: { line: 2, column: 2 },
+                                  end: { line: 2, column: 13 },
+                              },
+                              typeAnnotation: {
+                                  type: "TSTypeAnnotation",
+                                  loc: {
+                                      start: { line: 2, column: 5 },
+                                      end: { line: 2, column: 13 },
+                                  },
+                                  range: [23, 31],
+                                  typeAnnotation: {
+                                      type: "TSNumberKeyword",
+                                      range: [25, 31],
+                                      loc: {
+                                          start: { line: 2, column: 7 },
+                                          end: { line: 2, column: 13 },
+                                      },
+                                  },
+                              },
+                          },
+                          {
+                              type: "Identifier",
+                              name: "def",
+                              range: [35, 50],
+                              loc: {
+                                  start: { line: 3, column: 2 },
+                                  end: { line: 3, column: 17 },
+                              },
+                              typeAnnotation: {
+                                  type: "TSTypeAnnotation",
+                                  loc: {
+                                      start: { line: 3, column: 5 },
+                                      end: { line: 3, column: 17 },
+                                  },
+                                  range: [38, 50],
+                                  typeAnnotation: {
+                                      type: "TSFunctionType",
+                                      params: [],
+                                      range: [40, 50],
+                                      loc: {
+                                          start: { line: 3, column: 7 },
+                                          end: { line: 3, column: 17 },
+                                      },
+                                      returnType: {
+                                          type: "TSTypeAnnotation",
+                                          loc: {
+                                              start: { line: 3, column: 10 },
+                                              end: { line: 3, column: 17 },
+                                          },
+                                          range: [43, 50],
+                                          typeAnnotation: {
+                                              type: "TSVoidKeyword",
+                                              range: [46, 50],
+                                              loc: {
+                                                  start: {
+                                                      line: 3,
+                                                      column: 13,
+                                                  },
+                                                  end: {
+                                                      line: 3,
+                                                      column: 17,
+                                                  },
+                                              },
+                                          },
+                                      },
+                                  },
+                              },
+                          },
+                      ],
+                      body: {
+                          type: "ArrayExpression",
+                          elements: [
+                              {
+                                  type: "TemplateLiteral",
+                                  quasis: [
+                                      {
+                                          type: "TemplateElement",
+                                          value: { raw: "a", cooked: "a" },
+                                          tail: false,
+                                          range: [86, 90],
+                                          loc: {
+                                              start: { line: 7, column: 6 },
+                                              end: { line: 7, column: 10 },
+                                          },
+                                      },
+                                      {
+                                          type: "TemplateElement",
+                                          value: { raw: "", cooked: "" },
+                                          tail: true,
+                                          range: [93, 95],
+                                          loc: {
+                                              start: { line: 7, column: 13 },
+                                              end: { line: 7, column: 15 },
+                                          },
+                                      },
+                                  ],
+                                  expressions: [
+                                      {
+                                          type: "Identifier",
+                                          name: "abc",
+                                          range: [90, 93],
+                                          loc: {
+                                              start: { line: 7, column: 10 },
+                                              end: { line: 7, column: 13 },
+                                          },
+                                      },
+                                  ],
+                                  range: [86, 95],
+                                  loc: {
+                                      start: { line: 7, column: 6 },
+                                      end: { line: 7, column: 15 },
+                                  },
+                              },
+                              {
+                                  type: "Identifier",
+                                  name: "def",
+                                  range: [97, 100],
+                                  loc: {
+                                      start: { line: 7, column: 17 },
+                                      end: { line: 7, column: 20 },
+                                  },
+                              },
+                          ],
+                          range: [85, 101],
+                          loc: {
+                              start: { line: 7, column: 5 },
+                              end: { line: 7, column: 21 },
+                          },
+                      },
+                      async: false,
+                      expression: true,
+                      range: [16, 101],
+                      loc: {
+                          start: { line: 1, column: 16 },
+                          end: { line: 7, column: 21 },
+                      },
+                      returnType: {
+                          type: "TSTypeAnnotation",
+                          loc: {
+                              start: { line: 4, column: 1 },
+                              end: { line: 7, column: 1 },
+                          },
+                          range: [53, 81],
+                          typeAnnotation: {
+                              type: "TSTupleType",
+                              elementTypes: [
+                                  {
+                                      type: "TSStringKeyword",
+                                      range: [59, 65],
+                                      loc: {
+                                          start: { line: 5, column: 2 },
+                                          end: { line: 5, column: 8 },
+                                      },
+                                  },
+                                  {
+                                      type: "TSFunctionType",
+                                      params: [],
+                                      range: [69, 79],
+                                      loc: {
+                                          start: { line: 6, column: 2 },
+                                          end: { line: 6, column: 12 },
+                                      },
+                                      returnType: {
+                                          type: "TSTypeAnnotation",
+                                          loc: {
+                                              start: { line: 6, column: 5 },
+                                              end: { line: 6, column: 12 },
+                                          },
+                                          range: [72, 79],
+                                          typeAnnotation: {
+                                              type: "TSVoidKeyword",
+                                              range: [75, 79],
+                                              loc: {
+                                                  start: {
+                                                      line: 6,
+                                                      column: 8,
+                                                  },
+                                                  end: {
+                                                      line: 6,
+                                                      column: 12,
+                                                  },
+                                              },
+                                          },
+                                      },
+                                  },
+                              ],
+                              range: [55, 81],
+                              loc: {
+                                  start: { line: 4, column: 3 },
+                                  end: { line: 7, column: 1 },
+                              },
+                          },
+                      },
+                  },
+                  range: [6, 101],
+                  loc: {
+                      start: { line: 1, column: 6 },
+                      end: { line: 7, column: 21 },
+                  },
+              },
+          ],
+          kind: "const",
+          range: [0, 102],
+          loc: {
+              start: { line: 1, column: 0 },
+              end: { line: 7, column: 22 },
+          },
+      },
+      {
+          type: "ExpressionStatement",
+          expression: {
+              type: "CallExpression",
+              callee: {
+                  type: "Identifier",
+                  name: "method6",
+                  range: [103, 110],
+                  loc: {
+                      start: { line: 8, column: 0 },
+                      end: { line: 8, column: 7 },
+                  },
+              },
+              arguments: [
+                  {
+                      type: "Literal",
+                      value: 3,
+                      raw: "3",
+                      range: [111, 112],
+                      loc: {
+                          start: { line: 8, column: 8 },
+                          end: { line: 8, column: 9 },
+                      },
+                  },
+                  {
+                      type: "ArrowFunctionExpression",
+                      generator: false,
+                      id: null,
+                      params: [],
+                      body: {
+                          type: "BlockStatement",
+                          body: [],
+                          range: [120, 122],
+                          loc: {
+                              start: { line: 8, column: 17 },
+                              end: { line: 8, column: 19 },
+                          },
+                      },
+                      async: false,
+                      expression: false,
+                      range: [114, 122],
+                      loc: {
+                          start: { line: 8, column: 11 },
+                          end: { line: 8, column: 19 },
+                      },
+                  },
+              ],
+              optional: false,
+              range: [103, 123],
+              loc: {
+                  start: { line: 8, column: 0 },
+                  end: { line: 8, column: 20 },
+              },
+          },
+          range: [103, 124],
+          loc: {
+              start: { line: 8, column: 0 },
+              end: { line: 8, column: 21 },
+          },
+      },
+  ],
+  sourceType: "script",
+  range: [0, 125],
+  loc: { start: { line: 1, column: 0 }, end: { line: 9, column: 0 } },
+  tokens: [
+      {
+          type: "Keyword",
+          value: "const",
+          range: [0, 5],
+          loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 5 } },
+      },
+      {
+          type: "Identifier",
+          value: "method6",
+          range: [6, 13],
+          loc: {
+              start: { line: 1, column: 6 },
+              end: { line: 1, column: 13 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "=",
+          range: [14, 15],
+          loc: {
+              start: { line: 1, column: 14 },
+              end: { line: 1, column: 15 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "(",
+          range: [16, 17],
+          loc: {
+              start: { line: 1, column: 16 },
+              end: { line: 1, column: 17 },
+          },
+      },
+      {
+          type: "Identifier",
+          value: "abc",
+          range: [20, 23],
+          loc: { start: { line: 2, column: 2 }, end: { line: 2, column: 5 } },
+      },
+      {
+          type: "Punctuator",
+          value: ":",
+          range: [23, 24],
+          loc: { start: { line: 2, column: 5 }, end: { line: 2, column: 6 } },
+      },
+      {
+          type: "Identifier",
+          value: "number",
+          range: [25, 31],
+          loc: {
+              start: { line: 2, column: 7 },
+              end: { line: 2, column: 13 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ",",
+          range: [31, 32],
+          loc: {
+              start: { line: 2, column: 13 },
+              end: { line: 2, column: 14 },
+          },
+      },
+      {
+          type: "Identifier",
+          value: "def",
+          range: [35, 38],
+          loc: { start: { line: 3, column: 2 }, end: { line: 3, column: 5 } },
+      },
+      {
+          type: "Punctuator",
+          value: ":",
+          range: [38, 39],
+          loc: { start: { line: 3, column: 5 }, end: { line: 3, column: 6 } },
+      },
+      {
+          type: "Punctuator",
+          value: "(",
+          range: [40, 41],
+          loc: { start: { line: 3, column: 7 }, end: { line: 3, column: 8 } },
+      },
+      {
+          type: "Punctuator",
+          value: ")",
+          range: [41, 42],
+          loc: { start: { line: 3, column: 8 }, end: { line: 3, column: 9 } },
+      },
+      {
+          type: "Punctuator",
+          value: "=>",
+          range: [43, 45],
+          loc: {
+              start: { line: 3, column: 10 },
+              end: { line: 3, column: 12 },
+          },
+      },
+      {
+          type: "Keyword",
+          value: "void",
+          range: [46, 50],
+          loc: {
+              start: { line: 3, column: 13 },
+              end: { line: 3, column: 17 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ",",
+          range: [50, 51],
+          loc: {
+              start: { line: 3, column: 17 },
+              end: { line: 3, column: 18 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ")",
+          range: [52, 53],
+          loc: { start: { line: 4, column: 0 }, end: { line: 4, column: 1 } },
+      },
+      {
+          type: "Punctuator",
+          value: ":",
+          range: [53, 54],
+          loc: { start: { line: 4, column: 1 }, end: { line: 4, column: 2 } },
+      },
+      {
+          type: "Punctuator",
+          value: "[",
+          range: [55, 56],
+          loc: { start: { line: 4, column: 3 }, end: { line: 4, column: 4 } },
+      },
+      {
+          type: "Identifier",
+          value: "string",
+          range: [59, 65],
+          loc: { start: { line: 5, column: 2 }, end: { line: 5, column: 8 } },
+      },
+      {
+          type: "Punctuator",
+          value: ",",
+          range: [65, 66],
+          loc: { start: { line: 5, column: 8 }, end: { line: 5, column: 9 } },
+      },
+      {
+          type: "Punctuator",
+          value: "(",
+          range: [69, 70],
+          loc: { start: { line: 6, column: 2 }, end: { line: 6, column: 3 } },
+      },
+      {
+          type: "Punctuator",
+          value: ")",
+          range: [70, 71],
+          loc: { start: { line: 6, column: 3 }, end: { line: 6, column: 4 } },
+      },
+      {
+          type: "Punctuator",
+          value: "=>",
+          range: [72, 74],
+          loc: { start: { line: 6, column: 5 }, end: { line: 6, column: 7 } },
+      },
+      {
+          type: "Keyword",
+          value: "void",
+          range: [75, 79],
+          loc: {
+              start: { line: 6, column: 8 },
+              end: { line: 6, column: 12 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "]",
+          range: [80, 81],
+          loc: { start: { line: 7, column: 0 }, end: { line: 7, column: 1 } },
+      },
+      {
+          type: "Punctuator",
+          value: "=>",
+          range: [82, 84],
+          loc: { start: { line: 7, column: 2 }, end: { line: 7, column: 4 } },
+      },
+      {
+          type: "Punctuator",
+          value: "[",
+          range: [85, 86],
+          loc: { start: { line: 7, column: 5 }, end: { line: 7, column: 6 } },
+      },
+      {
+          type: "Template",
+          value: "`a${",
+          range: [86, 90],
+          loc: {
+              start: { line: 7, column: 6 },
+              end: { line: 7, column: 10 },
+          },
+      },
+      {
+          type: "Identifier",
+          value: "abc",
+          range: [90, 93],
+          loc: {
+              start: { line: 7, column: 10 },
+              end: { line: 7, column: 13 },
+          },
+      },
+      {
+          type: "Template",
+          value: "}`",
+          range: [93, 95],
+          loc: {
+              start: { line: 7, column: 13 },
+              end: { line: 7, column: 15 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ",",
+          range: [95, 96],
+          loc: {
+              start: { line: 7, column: 15 },
+              end: { line: 7, column: 16 },
+          },
+      },
+      {
+          type: "Identifier",
+          value: "def",
+          range: [97, 100],
+          loc: {
+              start: { line: 7, column: 17 },
+              end: { line: 7, column: 20 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "]",
+          range: [100, 101],
+          loc: {
+              start: { line: 7, column: 20 },
+              end: { line: 7, column: 21 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ";",
+          range: [101, 102],
+          loc: {
+              start: { line: 7, column: 21 },
+              end: { line: 7, column: 22 },
+          },
+      },
+      {
+          type: "Identifier",
+          value: "method6",
+          range: [103, 110],
+          loc: { start: { line: 8, column: 0 }, end: { line: 8, column: 7 } },
+      },
+      {
+          type: "Punctuator",
+          value: "(",
+          range: [110, 111],
+          loc: { start: { line: 8, column: 7 }, end: { line: 8, column: 8 } },
+      },
+      {
+          type: "Numeric",
+          value: "3",
+          range: [111, 112],
+          loc: { start: { line: 8, column: 8 }, end: { line: 8, column: 9 } },
+      },
+      {
+          type: "Punctuator",
+          value: ",",
+          range: [112, 113],
+          loc: {
+              start: { line: 8, column: 9 },
+              end: { line: 8, column: 10 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "(",
+          range: [114, 115],
+          loc: {
+              start: { line: 8, column: 11 },
+              end: { line: 8, column: 12 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ")",
+          range: [115, 116],
+          loc: {
+              start: { line: 8, column: 12 },
+              end: { line: 8, column: 13 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "=>",
+          range: [117, 119],
+          loc: {
+              start: { line: 8, column: 14 },
+              end: { line: 8, column: 16 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "{",
+          range: [120, 121],
+          loc: {
+              start: { line: 8, column: 17 },
+              end: { line: 8, column: 18 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: "}",
+          range: [121, 122],
+          loc: {
+              start: { line: 8, column: 18 },
+              end: { line: 8, column: 19 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ")",
+          range: [122, 123],
+          loc: {
+              start: { line: 8, column: 19 },
+              end: { line: 8, column: 20 },
+          },
+      },
+      {
+          type: "Punctuator",
+          value: ";",
+          range: [123, 124],
+          loc: {
+              start: { line: 8, column: 20 },
+              end: { line: 8, column: 21 },
+          },
+      },
+  ],
+  comments: [],
+});
diff --git a/eslint/tests/fixtures/rules/eslint.js b/eslint/tests/fixtures/rules/eslint.js
new file mode 100644 (file)
index 0000000..aff3e58
--- /dev/null
@@ -0,0 +1,10 @@
+module.exports = {
+    languageOptions: {
+        "globals": {
+            "test": true
+        }
+    },
+    "rules": {
+        "custom-rule": 1
+    }
+};
diff --git a/eslint/tests/fixtures/rules/missing-rule.js b/eslint/tests/fixtures/rules/missing-rule.js
new file mode 100644 (file)
index 0000000..39a8c00
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = {
+    rules: {
+        "missing-rule": 1
+    }
+};
diff --git a/eslint/tests/fixtures/shallow-glob/eslint.config.js b/eslint/tests/fixtures/shallow-glob/eslint.config.js
new file mode 100644 (file)
index 0000000..211719d
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = [
+    {
+        files: ["subdir/*.js"]
+    }
+];
diff --git a/eslint/tests/fixtures/shallow-glob/subdir/broken.js b/eslint/tests/fixtures/shallow-glob/subdir/broken.js
new file mode 100644 (file)
index 0000000..d280fee
--- /dev/null
@@ -0,0 +1 @@
+module.exports = /* intentional syntax error */
diff --git a/eslint/tests/fixtures/shallow-glob/subdir/subsubdir/broken.js b/eslint/tests/fixtures/shallow-glob/subdir/subsubdir/broken.js
new file mode 100644 (file)
index 0000000..2e1fe2e
--- /dev/null
@@ -0,0 +1 @@
+function( {}   // intentional syntax error
diff --git a/eslint/tests/fixtures/shallow-glob/subdir/subsubdir/plain.jsx b/eslint/tests/fixtures/shallow-glob/subdir/subsubdir/plain.jsx
new file mode 100644 (file)
index 0000000..e901f01
--- /dev/null
@@ -0,0 +1 @@
+foo;
diff --git a/eslint/tests/fixtures/shallow-glob/target-dir/passing.js b/eslint/tests/fixtures/shallow-glob/target-dir/passing.js
new file mode 100644 (file)
index 0000000..ec01c2c
--- /dev/null
@@ -0,0 +1 @@
+module.exports = true;
index 831d4a06ca734c3274589ff51918ef45dd91e8a2..a7a80f1f16f83acc16d8a6df65f1154742bc2d72 100644 (file)
@@ -9,30 +9,36 @@
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    return {
-        "Program": function(node) {
-            node.body.push({
-                "type": "Identifier",
-                "name": "modified",
-                "range": [0, 8],
-                "loc": {
-                    "start": {
-                        "line": 1,
-                        "column": 0
-                    },
-                    "end": {
-                        "line": 1,
-                        "column": 8
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: []
+    },
+    create(context) {
+        return {
+            "Program": function(node) {
+                node.body.push({
+                    "type": "Identifier",
+                    "name": "modified",
+                    "range": [0, 8],
+                    "loc": {
+                        "start": {
+                            "line": 1,
+                            "column": 0
+                        },
+                        "end": {
+                            "line": 1,
+                            "column": 8
+                        }
                     }
-                }
-            });
-        },
+                });
+            },
 
-        "Identifier": function(node) {
-            if (node.name === "bar") {
-                context.report({message: "error", node: node});
+            "Identifier": function(node) {
+                if (node.name === "bar") {
+                    context.report({message: "error", node: node});
+                }
             }
-        }
-    };
+        };
+    },
 };
index f093b191c3cce4235c630f488f106bba9dc2bae1..7c7c0c87939b46c46a2314c6e5c6dfd67d2e8e07 100644 (file)
@@ -9,30 +9,36 @@
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    return {
-        "Program:exit": function(node) {
-            node.body.push({
-                "type": "Identifier",
-                "name": "modified",
-                "range": [0, 8],
-                "loc": {
-                    "start": {
-                        "line": 1,
-                        "column": 0
-                    },
-                    "end": {
-                        "line": 1,
-                        "column": 8
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: []
+    },
+    create(context) {
+        return {
+            "Program:exit": function(node) {
+                node.body.push({
+                    "type": "Identifier",
+                    "name": "modified",
+                    "range": [0, 8],
+                    "loc": {
+                        "start": {
+                            "line": 1,
+                            "column": 0
+                        },
+                        "end": {
+                            "line": 1,
+                            "column": 8
+                        }
                     }
-                }
-            });
-        },
+                });
+            },
 
-        "Identifier": function(node) {
-            if (node.name === "bar") {
-                context.report({message: "error", node: node});
+            "Identifier": function(node) {
+                if (node.name === "bar") {
+                    context.report({message: "error", node: node});
+                }
             }
-        }
-    };
+        };
+    },
 };
index 82a7c48ffc5aada46f92e4e2f3b090216c03bc19..45f46a662e49982f1e4ea3211b6f2ba10adeb353 100644 (file)
@@ -9,14 +9,20 @@
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    return {
-        "Identifier": function(node) {
-            node.name += "!";
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: []
+    },
+    create(context) {
+        return {
+            "Identifier": function(node) {
+                node.name += "!";
 
-            if (node.name === "bar!") {
-                context.report({message: "error", node: node});
+                if (node.name === "bar!") {
+                    context.report({message: "error", node: node});
+                }
             }
-        }
-    };
+        };
+    },
 };
index 0d57cb6cd7b68adbc286bcfb258b03a639754eaa..dc6e869888e0fbc7ef5a60dd9f459db9eec838ae 100644 (file)
@@ -3,20 +3,24 @@
  * @author Nicholas C. Zakas
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-
-    "use strict";
-
-    return {
-        "CallExpression": function(node) {
-            if (node.callee.name === "eval") {
-                context.report(node, "eval sucks.");
-            }
-        }
-    };
-
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [],
+    },
+    create(context) {
+        return {
+            CallExpression: function (node) {
+                if (node.callee.name === "eval") {
+                    context.report(node, "eval sucks.");
+                }
+            },
+        };
+    },
 };
index 4c2e7015cbbbeba71a7b1bdccd15b8c30c0676c1..d1eb2ad71996ebbcd088ad26e13b5ee3f84f4284 100644 (file)
@@ -3,20 +3,28 @@
  * @author Mathias Schreck
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    var config = context.options[0];
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [{
+            type: "boolean"
+        }]
+    },
+    create(context) {
+        var config = context.options[0];
 
-    return {
-        "Program": function(node) {
-            if (config === true) {
-                context.report(node, "Invalid args");
+        return {
+            "Program": function(node) {
+                if (config === true) {
+                    context.report(node, "Invalid args");
+                }
             }
-        }
-    };
+        };
+    }
 };
index fdf290dc62e1dcfd73de75eab8d8aa7e1ce742f1..affe38053abce908cff9faa408cf1ade3d5d5330 100644 (file)
@@ -3,26 +3,26 @@
  * @author Brandon Mills
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    var config = context.options[0];
-
-    return {
-        "Program": function(node) {
-            if (config) {
-                context.report(node, "Expected nothing.");
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [{
+            "enum": []
+        }]
+    },
+    create(context) {
+        return {
+            "Program": function(node) {
+                if (config) {
+                    context.report(node, "Expected nothing.");
+                }
             }
-        }
-    };
+        };
+    },
 };
-
-module.exports.schema = [
-    {
-        "enum": []
-    }
-];
index 2a9f65e21616a9593d309d3d421f378e40f55d01..7876f25305bf531d02c02479fe91a09f973f7785 100644 (file)
@@ -3,26 +3,27 @@
  * @author Brandon Mills
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    var config = context.options[0];
-
-    return {
-        "Program": function(node) {
-            if (config && config !== "foo") {
-                context.report(node, "Expected foo.");
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [{
+            "enum": ["foo"]
+        }]
+    },
+    create(context) {
+        const config = context.options[0];
+        return {
+            "Program": function(node) {
+                if (config && config !== "foo") {
+                    context.report(node, "Expected foo.");
+                }
             }
-        }
-    };
+        };
+    },
 };
-
-module.exports.schema = [
-    {
-        "enum": ["foo"]
-    }
-];
index 752c41f0dbfe96ee16a7ebda883566b78f03bfd2..b3cde25735294e681220318def4024d43dd36863 100644 (file)
@@ -3,18 +3,24 @@
  * @author Stefan Lau
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    return {
-        "Program": function(node) {
-            if (context.getFilename() === '<input>') {
-                context.report(node, "Filename test was not defined.");
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: []
+    },
+    create(context) {
+        return {
+            "Program": function(node) {
+                if (context.getFilename() === '<input>') {
+                    context.report(node, "Filename test was not defined.");
+                }
             }
-        }
-    };
+        };
+    }
 };
index b5fa4c3bf929f6744e242de400a80ca0fa1b8fe1..6703cc621007782d5fa74dce9e2925b8c1d42379 100644 (file)
@@ -7,21 +7,27 @@
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
+"use strict";
 
-    return {
-        "Program": function(node) {
-            var globals = context.getScope().variables.map(function (variable) {
-                return variable.name;
-            });
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [],
+    },
+    create(context) {
+        return {
+            "Program": function(node) {
+                var globals = context.getScope().variables.map(function (variable) {
+                    return variable.name;
+                });
 
-            if (globals.indexOf("test") === -1) {
-                context.report(node, "Global variable test was not defined.");
+                if (globals.indexOf("test") === -1) {
+                    context.report(node, "Global variable test was not defined.");
+                }
+                if (globals.indexOf("foo") !== -1) {
+                    context.report(node, "Global variable foo should not be used.");
+                }
             }
-            if (globals.indexOf("foo") !== -1) {
-                context.report(node, "Global variable foo should not be used.");
-            }
-        }
-    };
+        };
+    },
 };
index 07ecfa7bca6c6f8900af8eff2292d26d250f6f18..a67ebc23ff52e2f83b68ec44f037fd4bbf90f5d6 100644 (file)
@@ -3,18 +3,27 @@
  * @author Ilya Volodin
  */
 
+"use strict";
+
 //------------------------------------------------------------------------------
 // Rule Definition
 //------------------------------------------------------------------------------
 
-module.exports = function(context) {
-    "use strict";
-
-    return {
-        "Program": function(node) {
-            if (!context.settings || !context.settings.test) {
-                context.report(node, "Global settings test was not defined.");
-            }
-        }
-    };
+module.exports = {
+    meta: {
+        type: "problem",
+        schema: [],
+    },
+    create(context) {
+        return {
+            Program: function (node) {
+                if (!context.settings || !context.settings.test) {
+                    context.report(
+                        node,
+                        "Global settings test was not defined."
+                    );
+                }
+            },
+        };
+    },
 };
index 5841f15bfa13d4421cf68532663a772408b3a63a..96a410fe78a793845ec767085684f22999a28e52 100644 (file)
 "use strict";
 
 module.exports = {
-
     meta: {
-        fixable: "code"
+        fixable: "code",
+        schema: []
     },
-
     create(context) {
-
         var sourceCode = context.getSourceCode();
 
         return {
index 2ba4839baf60b6c2b2b6713615cf1a0b8cd04ed6..9cd5593c8b3e896c9b5911d8cb386d0265ab7f20 100644 (file)
@@ -158,6 +158,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[4].ruleId, "eol-last");
             assert.strictEqual(report.results[0].fixableErrorCount, 3);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report the total and per file warnings when using local cwd .eslintrc", () => {
@@ -187,6 +188,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[4].ruleId, "eol-last");
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 3);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report one message when using specific config file", () => {
@@ -210,6 +212,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].errorCount, 1);
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].warningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report the filename when passed in", () => {
@@ -222,6 +225,7 @@ describe("CLIEngine", () => {
             const report = engine.executeOnText("var foo = 'bar';", "test.js");
 
             assert.strictEqual(report.results[0].filePath, getFixturePath("test.js"));
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return a warning when given a filename by --stdin-filename in excluded files list if warnIgnored is true", () => {
@@ -235,6 +239,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.errorCount, 0);
             assert.strictEqual(report.warningCount, 1);
+            assert.strictEqual(report.fatalErrorCount, 0);
             assert.strictEqual(report.fixableErrorCount, 0);
             assert.strictEqual(report.fixableWarningCount, 0);
             assert.strictEqual(report.results[0].filePath, getFixturePath("passing.js"));
@@ -243,8 +248,10 @@ describe("CLIEngine", () => {
             assert.isUndefined(report.results[0].messages[0].output);
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should not return a warning when given a filename by --stdin-filename in excluded files list if warnIgnored is false", () => {
@@ -291,6 +298,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[0].ruleId, "no-undef");
             assert.strictEqual(report.results[0].messages[0].severity, 2);
             assert.isUndefined(report.results[0].messages[0].output);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return a message and fixed text when in fix mode", () => {
@@ -312,6 +320,7 @@ describe("CLIEngine", () => {
                     {
                         filePath: getFixturePath("passing.js"),
                         messages: [],
+                        suppressedMessages: [],
                         errorCount: 0,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -341,6 +350,7 @@ describe("CLIEngine", () => {
             const expectedOutput = fs.readFileSync(outputPath, "utf8");
 
             assert.strictEqual(report.results[0].output, expectedOutput);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("correctly autofixes return-conflicting-fixes", () => {
@@ -355,6 +365,7 @@ describe("CLIEngine", () => {
             const expectedOutput = fs.readFileSync(outputPath, "utf8");
 
             assert.strictEqual(report.results[0].output, expectedOutput);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         describe("Fix Types", () => {
@@ -523,6 +534,7 @@ describe("CLIEngine", () => {
                                 nodeType: "Identifier"
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -568,6 +580,7 @@ describe("CLIEngine", () => {
                                 column: 19
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 1,
@@ -612,6 +625,7 @@ describe("CLIEngine", () => {
                                 column: 10
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 1,
@@ -702,6 +716,7 @@ describe("CLIEngine", () => {
                                 column: 19
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 1,
@@ -733,6 +748,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, getFixturePath("node_modules/passing.js"));
             assert.strictEqual(report.results[0].messages[0].message, expectedMsg);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         // @scope for @scope/eslint-plugin
@@ -762,6 +778,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.filePath, getFixturePath("plugin-shorthand/basic/index.js"));
                 assert.strictEqual(report.messages[0].ruleId, "@scope/rule");
                 assert.strictEqual(report.messages[0].message, "OK");
+                assert.strictEqual(report.suppressedMessages.length, 0);
             });
 
             it("should resolve 'extends:[\"plugin:@scope/recommended\"]' to 'node_modules/@scope/eslint-plugin'.", () => {
@@ -771,6 +788,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.filePath, getFixturePath("plugin-shorthand/extends/index.js"));
                 assert.strictEqual(report.messages[0].ruleId, "@scope/rule");
                 assert.strictEqual(report.messages[0].message, "OK");
+                assert.strictEqual(report.suppressedMessages.length, 0);
             });
         });
         it("should warn when deprecated rules are found in a config", () => {
@@ -786,6 +804,7 @@ describe("CLIEngine", () => {
                 report.usedDeprecatedRules,
                 [{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
             );
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
     });
 
@@ -807,7 +826,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 1);
             assert.strictEqual(report.results[0].messages[0].message, "Parsing error: Boom!");
-
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a config file and a valid file", () => {
@@ -822,6 +841,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should handle multiple patterns with overlapping files", () => {
@@ -835,7 +855,9 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[1].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a config file and a valid file and espree as parser", () => {
@@ -852,6 +874,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a config file and a valid file and esprima as parser", () => {
@@ -865,6 +888,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should throw an error when given a config file and a valid file and invalid parser", () => {
@@ -888,6 +912,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should fall back to defaults when extensions is set to an empty array", () => {
@@ -911,6 +936,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].warningCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a directory with a .js and a .js2 file", () => {
@@ -926,6 +952,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a '**' pattern with a .js and a .js2 file", () => {
@@ -941,6 +968,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should resolve globs when 'globInputPaths' option is true", () => {
@@ -955,6 +983,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should not resolve globs when 'globInputPaths' option is false", () => {
@@ -982,9 +1011,11 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages[0].message, expectedMsg);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report on globs with explicit inclusion of dotfiles, even though ignored by default", () => {
@@ -1003,6 +1034,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].warningCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should not check default ignored files without --no-ignore flag", () => {
@@ -1045,9 +1077,11 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages[0].message, expectedMsg);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         // https://github.com/eslint/eslint/issues/12873
@@ -1066,9 +1100,11 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages[0].message, expectedMsg);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should check .hidden files if they are passed explicitly with --no-ignore flag", () => {
@@ -1090,6 +1126,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should check .hidden files if they are unignored with an --ignore-pattern", () => {
@@ -1112,6 +1149,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should report zero messages when given a pattern with a .js and a .js2 file", () => {
@@ -1126,7 +1164,9 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 2);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[1].suppressedMessages.length, 0);
         });
 
         it("should return one error message when given a config with rules with options and severity level set to error", () => {
@@ -1149,6 +1189,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].warningCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 1);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return 3 messages when given a config file and a directory of 3 valid files", () => {
@@ -1172,30 +1213,35 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             assert.strictEqual(path.relative(fixturePath, report.results[1].filePath), "broken.js");
             assert.strictEqual(report.results[1].errorCount, 0);
             assert.strictEqual(report.results[1].warningCount, 0);
             assert.strictEqual(report.results[1].fixableErrorCount, 0);
             assert.strictEqual(report.results[1].fixableWarningCount, 0);
             assert.strictEqual(report.results[1].messages.length, 0);
+            assert.strictEqual(report.results[1].suppressedMessages.length, 0);
             assert.strictEqual(path.relative(fixturePath, report.results[2].filePath), "cwd.js");
             assert.strictEqual(report.results[2].errorCount, 0);
             assert.strictEqual(report.results[2].warningCount, 0);
             assert.strictEqual(report.results[2].fixableErrorCount, 0);
             assert.strictEqual(report.results[2].fixableWarningCount, 0);
             assert.strictEqual(report.results[2].messages.length, 0);
+            assert.strictEqual(report.results[2].suppressedMessages.length, 0);
             assert.strictEqual(path.relative(fixturePath, report.results[3].filePath), "simple.js");
             assert.strictEqual(report.results[3].errorCount, 0);
             assert.strictEqual(report.results[3].warningCount, 0);
             assert.strictEqual(report.results[3].fixableErrorCount, 0);
             assert.strictEqual(report.results[3].fixableWarningCount, 0);
             assert.strictEqual(report.results[3].messages.length, 0);
+            assert.strictEqual(report.results[3].suppressedMessages.length, 0);
             assert.strictEqual(path.relative(fixturePath, report.results[4].filePath), path.join("test", "simple.js"));
             assert.strictEqual(report.results[4].errorCount, 0);
             assert.strictEqual(report.results[4].warningCount, 0);
             assert.strictEqual(report.results[4].fixableErrorCount, 0);
             assert.strictEqual(report.results[4].fixableWarningCount, 0);
             assert.strictEqual(report.results[4].messages.length, 0);
+            assert.strictEqual(report.results[4].suppressedMessages.length, 0);
         });
 
 
@@ -1252,6 +1298,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when given a config with environment set to browser", () => {
@@ -1265,6 +1312,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when given an option to set environment to browser", () => {
@@ -1282,6 +1330,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when given a config with environment set to Node.js", () => {
@@ -1295,6 +1344,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should not return results from previous call when calling more than once", () => {
@@ -1317,11 +1367,13 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages.length, 1);
             assert.strictEqual(report.results[0].messages[0].ruleId, "semi");
             assert.strictEqual(report.results[0].messages[0].severity, 2);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
 
             report = engine.executeOnFiles([passFilePath]);
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, passFilePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
 
         });
 
@@ -1375,6 +1427,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].warningCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         // https://github.com/eslint/eslint/issues/3812
@@ -1415,6 +1468,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.errorCount, 0);
             assert.strictEqual(report.warningCount, 1);
+            assert.strictEqual(report.fatalErrorCount, 0);
             assert.strictEqual(report.fixableErrorCount, 0);
             assert.strictEqual(report.fixableWarningCount, 0);
             assert.strictEqual(report.results[0].filePath, filePath);
@@ -1422,8 +1476,10 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
             assert.strictEqual(report.results[0].fixableErrorCount, 0);
             assert.strictEqual(report.results[0].fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return two messages when given a file in excluded files list while ignore is off", () => {
@@ -1446,6 +1502,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[0].severity, 2);
             assert.strictEqual(report.results[0].messages[1].ruleId, "no-undef");
             assert.strictEqual(report.results[0].messages[1].severity, 2);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when executing a file with a shebang", () => {
@@ -1458,6 +1515,7 @@ describe("CLIEngine", () => {
 
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should give a warning when loading a custom rule that doesn't exist", () => {
@@ -1474,8 +1532,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[0].ruleId, "missing-rule");
             assert.strictEqual(report.results[0].messages[0].severity, 2);
             assert.strictEqual(report.results[0].messages[0].message, "Definition for rule 'missing-rule' was not found.");
-
-
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should throw an error when loading a bad custom rule", () => {
@@ -1510,6 +1567,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages.length, 2);
             assert.strictEqual(report.results[0].messages[0].ruleId, "custom-rule");
             assert.strictEqual(report.results[0].messages[0].severity, 1);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should load custom rule from the provided cwd", () => {
@@ -1531,6 +1589,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages.length, 2);
             assert.strictEqual(report.results[0].messages[0].ruleId, "custom-rule");
             assert.strictEqual(report.results[0].messages[0].severity, 1);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return messages when multiple custom rules match a file", () => {
@@ -1555,6 +1614,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results[0].messages[0].severity, 2);
             assert.strictEqual(report.results[0].messages[1].ruleId, "no-strings");
             assert.strictEqual(report.results[0].messages[1].severity, 2);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when executing without useEslintrc flag", () => {
@@ -1571,6 +1631,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, filePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when executing without useEslintrc flag in Node.js environment", () => {
@@ -1588,6 +1649,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, filePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages when executing with base-config flag set to false", () => {
@@ -1605,6 +1667,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, filePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages and ignore .eslintrc files when executing with no-eslintrc flag", () => {
@@ -1622,6 +1685,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, filePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should return zero messages and ignore package.json files when executing with no-eslintrc flag", () => {
@@ -1639,6 +1703,7 @@ describe("CLIEngine", () => {
             assert.strictEqual(report.results.length, 1);
             assert.strictEqual(report.results[0].filePath, filePath);
             assert.strictEqual(report.results[0].messages.length, 0);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should warn when deprecated rules are configured", () => {
@@ -1662,6 +1727,7 @@ describe("CLIEngine", () => {
                     { ruleId: "valid-jsdoc", replacedBy: [] }
                 ]
             );
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should not warn when deprecated rules are not configured", () => {
@@ -1674,6 +1740,7 @@ describe("CLIEngine", () => {
             const report = engine.executeOnFiles(["lib/cli*.js"]);
 
             assert.deepStrictEqual(report.usedDeprecatedRules, []);
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         it("should warn when deprecated rules are found in a config", () => {
@@ -1689,6 +1756,7 @@ describe("CLIEngine", () => {
                 report.usedDeprecatedRules,
                 [{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
             );
+            assert.strictEqual(report.results[0].suppressedMessages.length, 0);
         });
 
         describe("Fix Mode", () => {
@@ -1727,6 +1795,7 @@ describe("CLIEngine", () => {
                     {
                         filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/multipass.js")),
                         messages: [],
+                        suppressedMessages: [],
                         errorCount: 0,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1737,6 +1806,7 @@ describe("CLIEngine", () => {
                     {
                         filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/ok.js")),
                         messages: [],
+                        suppressedMessages: [],
                         errorCount: 0,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1758,6 +1828,7 @@ describe("CLIEngine", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1780,6 +1851,7 @@ describe("CLIEngine", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1837,6 +1909,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // No default configuration rules - conf/environments.js (/*eslint-env node*/)
@@ -1852,6 +1925,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - first level .eslintrc
@@ -1865,6 +1939,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - first level .eslintrc
@@ -1893,6 +1968,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 2);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - second level .eslintrc
@@ -1908,6 +1984,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "no-console");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - third level .eslintrc
@@ -1923,6 +2000,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - first level package.json
@@ -1938,6 +2016,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - second level package.json
@@ -1951,6 +2030,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - third level package.json
@@ -1966,6 +2046,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 2);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Project configuration - .eslintrc overrides package.json in same directory
@@ -1981,6 +2062,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 2);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --config with first level .eslintrc
@@ -1999,6 +2081,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages[0].severity, 2);
                 assert.strictEqual(report.results[0].messages[1].ruleId, "semi");
                 assert.strictEqual(report.results[0].messages[1].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --config with first level .eslintrc
@@ -2013,6 +2096,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --config with second level .eslintrc
@@ -2031,6 +2115,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
                 assert.strictEqual(report.results[0].messages[1].ruleId, "semi");
                 assert.strictEqual(report.results[0].messages[1].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --config with second level .eslintrc
@@ -2047,6 +2132,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "no-console");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --config with first level .eslintrc
@@ -2061,6 +2147,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 0);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --rule with --config and first level .eslintrc
@@ -2080,6 +2167,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             // Command line configuration - --rule with --config and first level .eslintrc
@@ -2099,6 +2187,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "quotes");
                 assert.strictEqual(report.results[0].messages[0].severity, 1);
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
         });
@@ -2116,6 +2205,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "example/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should return two messages when executing with config file that specifies a plugin with namespace", () => {
@@ -2130,6 +2220,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "@eslint/example/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should return two messages when executing with config file that specifies a plugin without prefix", () => {
@@ -2144,6 +2235,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "example/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should return two messages when executing with config file that specifies a plugin without prefix and with namespace", () => {
@@ -2158,6 +2250,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "@eslint/example/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should return two messages when executing with cli option that specifies a plugin", () => {
@@ -2173,6 +2266,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "example/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should return two messages when executing with cli option that specifies preloaded plugin", () => {
@@ -2196,6 +2290,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 2);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "test/example-rule");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
 
             it("should load plugins from the `loadPluginsRelativeTo` directory, if specified", () => {
@@ -2214,6 +2309,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].ruleId, "with-rules/rule1");
                 assert.strictEqual(report.results[0].messages[0].message, "Rule report from plugin");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3171,6 +3267,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(ret.results.length, 1);
                 assert.strictEqual(ret.results[0].messages.length, 1);
                 assert.strictEqual(ret.results[0].messages[0].ruleId, "no-unused-vars");
+                assert.strictEqual(ret.results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3208,6 +3305,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(results.length, 1);
                 assert.deepStrictEqual(results[0].messages, []);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3307,6 +3405,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results.length, 1);
                 assert.deepStrictEqual(results[0].messages, []);
                 assert.deepStrictEqual(results[0].output, "fixed;");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3381,6 +3480,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages.length, 1);
                 assert.strictEqual(results[0].messages[0].ruleId, "semi");
                 assert.strictEqual(results[0].messages[0].line, 2);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             it("should fix only JavaScript blocks if '--ext' was not given.", async () => {
@@ -3407,6 +3507,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(results.length, 1);
                 assert.strictEqual(results[0].messages.length, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
                 assert.strictEqual(results[0].output, unIndent`
                     \`\`\`js
                     console.log("hello");${/* ← fixed */""}
@@ -3450,6 +3551,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages[0].line, 2);
                 assert.strictEqual(results[0].messages[1].ruleId, "semi"); // JS block in HTML block
                 assert.strictEqual(results[0].messages[1].line, 7);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             it("should fix HTML blocks as well with multiple processors if '--ext' option was given.", async () => {
@@ -3476,6 +3578,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(results.length, 1);
                 assert.strictEqual(results[0].messages.length, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
                 assert.strictEqual(results[0].output, unIndent`
                     \`\`\`js
                     console.log("hello");${/* ← fixed */""}
@@ -3526,6 +3629,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages[0].ruleId, "semi"); // JS Block in HTML Block
                 assert.strictEqual(results[0].messages[0].line, 7);
                 assert.strictEqual(results[0].messages[0].fix, void 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
                 assert.strictEqual(results[0].output, unIndent`
                     \`\`\`js
                     console.log("hello");${/* ← fixed */""}
@@ -3588,6 +3692,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages[0].line, 2);
                 assert.strictEqual(results[0].messages[1].ruleId, "no-console");
                 assert.strictEqual(results[0].messages[1].line, 7);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             it("should use the same config as one which has 'processor' property in order to lint blocks in HTML if the processor was legacy style.", async () => {
@@ -3637,6 +3742,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages[1].line, 7);
                 assert.strictEqual(results[0].messages[2].ruleId, "no-console");
                 assert.strictEqual(results[0].messages[2].line, 10);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             it("should throw an error if invalid processor was specified.", async () => {
@@ -3700,6 +3806,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(results[0].messages[0].line, 2);
                 assert.strictEqual(results[0].messages[1].ruleId, "semi"); // JS block in HTML block
                 assert.strictEqual(results[0].messages[1].line, 7);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3838,6 +3945,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(report.results.length, 1);
                 assert.strictEqual(report.results[0].messages.length, 1);
                 assert.strictEqual(report.results[0].messages[0].message, "ok");
+                assert.strictEqual(report.results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3930,6 +4038,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].message, "'/*globals*/' has no effect because you have 'noInlineConfig' setting in your config (.eslintrc.yml).");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             it("should show the config file what the 'noInlineConfig' came from.", async () => {
@@ -3952,6 +4061,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].message, "'/*globals*/' has no effect because you have 'noInlineConfig' setting in your config (.eslintrc.yml » eslint-config-foo).");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -3985,6 +4095,7 @@ describe("CLIEngine", () => {
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].severity, 1);
                 assert.strictEqual(messages[0].message, "Unused eslint-disable directive (no problems were reported from 'eqeqeq').");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
 
             describe("the runtime option overrides config files.", () => {
@@ -4009,6 +4120,7 @@ describe("CLIEngine", () => {
                     const messages = results[0].messages;
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
                 });
 
                 it("should warn unused 'eslint-disable' comments as error if 'reportUnusedDisableDirectives=error' was given in runtime.", async () => {
@@ -4034,6 +4146,7 @@ describe("CLIEngine", () => {
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].severity, 2);
                     assert.strictEqual(messages[0].message, "Unused eslint-disable directive (no problems were reported from 'eqeqeq').");
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
                 });
             });
         });
@@ -4069,6 +4182,7 @@ describe("CLIEngine", () => {
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-console");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
             });
         });
 
@@ -4783,6 +4897,17 @@ describe("CLIEngine", () => {
             assert.strictEqual(errorResults[0].messages[3].severity, 2);
             assert.strictEqual(errorResults[0].messages[4].ruleId, "eol-last");
             assert.strictEqual(errorResults[0].messages[4].severity, 2);
+            assert.lengthOf(errorResults[0].suppressedMessages, 0);
+        });
+
+        it("should report no error messages when looking for errors only", () => {
+            process.chdir(originalDir);
+            const engine = new CLIEngine();
+
+            const report = engine.executeOnText("var foo = 'bar'; // eslint-disable-line strict, no-var, no-unused-vars, quotes, eol-last -- justification");
+            const errorResults = CLIEngine.getErrorResults(report.results);
+
+            assert.lengthOf(errorResults, 0);
         });
 
         it("should not mutate passed report.results parameter", () => {
@@ -4799,6 +4924,24 @@ describe("CLIEngine", () => {
             assert.lengthOf(report.results[0].messages, reportResultsLength);
         });
 
+        it("should report no suppressed error messages when looking for errors only", () => {
+            process.chdir(originalDir);
+            const engine = new CLIEngine({
+                rules: {
+                    quotes: [1, "double"],
+                    "no-var": 2
+                }
+            });
+
+            const report = engine.executeOnText("var foo = 'bar'; // eslint-disable-line quotes -- justification\n");
+            const errorResults = CLIEngine.getErrorResults(report.results);
+
+            assert.lengthOf(report.results[0].messages, 3);
+            assert.lengthOf(report.results[0].suppressedMessages, 1);
+            assert.lengthOf(errorResults[0].messages, 3);
+            assert.lengthOf(errorResults[0].suppressedMessages, 0);
+        });
+
         it("should report a warningCount of 0 when looking for errors only", () => {
 
             process.chdir(originalDir);
@@ -4824,12 +4967,14 @@ describe("CLIEngine", () => {
             assert.lengthOf(report.results, 1);
             assert.strictEqual(report.errorCount, 0);
             assert.strictEqual(report.warningCount, 1);
+            assert.strictEqual(report.fatalErrorCount, 0);
             assert.strictEqual(report.fixableErrorCount, 0);
             assert.strictEqual(report.fixableWarningCount, 0);
             assert.strictEqual(report.results[0].errorCount, 0);
             assert.strictEqual(report.results[0].warningCount, 1);
-            assert.strictEqual(report.fixableErrorCount, 0);
-            assert.strictEqual(report.fixableWarningCount, 0);
+            assert.strictEqual(report.results[0].fatalErrorCount, 0);
+            assert.strictEqual(report.results[0].fixableErrorCount, 0);
+            assert.strictEqual(report.results[0].fixableWarningCount, 0);
         });
 
         it("should return source code of file in the `source` property", () => {
@@ -4944,9 +5089,9 @@ describe("CLIEngine", () => {
         });
 
         it("should expose the list of plugin rules", () => {
-            const engine = new CLIEngine({ plugins: ["node"] });
+            const engine = new CLIEngine({ plugins: ["n"] });
 
-            assert(engine.getRules().has("node/no-deprecated-api"), "node/no-deprecated-api is present");
+            assert(engine.getRules().has("n/no-deprecated-api"), "n/no-deprecated-api is present");
         });
 
         it("should expose the list of rules from a preloaded plugin", () => {
@@ -4954,7 +5099,7 @@ describe("CLIEngine", () => {
                 plugins: ["foo"]
             }, {
                 preloadedPlugins: {
-                    foo: require("eslint-plugin-node")
+                    foo: require("eslint-plugin-n")
                 }
             });
 
@@ -5109,10 +5254,11 @@ describe("CLIEngine", () => {
             const eslintCLI = new CLIEngine(config);
 
             const report = eslintCLI.executeOnText(code);
-            const messages = report.results[0].messages;
+            const { messages, suppressedMessages } = report.results[0];
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation by default", () => {
@@ -5137,9 +5283,11 @@ describe("CLIEngine", () => {
             const eslintCLI = new CLIEngine(config);
 
             const report = eslintCLI.executeOnText(code);
-            const messages = report.results[0].messages;
+            const { messages, suppressedMessages } = report.results[0];
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
         });
 
     });
@@ -5168,6 +5316,7 @@ describe("CLIEngine", () => {
                                     nodeType: null
                                 }
                             ],
+                            suppressedMessages: [],
                             errorCount: 1,
                             warningCount: 0,
                             fatalErrorCount: 0,
@@ -5187,7 +5336,7 @@ describe("CLIEngine", () => {
         });
     });
 
-    describe("when retreiving version number", () => {
+    describe("when retrieving version number", () => {
         it("should return current version number", () => {
             const eslintCLI = require("../../../lib/cli-engine").CLIEngine;
             const version = eslintCLI.version;
@@ -6249,6 +6398,7 @@ describe("CLIEngine", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         source: "a == b",
                         warningCount: 0,
                         fatalErrorCount: 0
@@ -6273,6 +6423,7 @@ describe("CLIEngine", () => {
                         fixableErrorCount: 0,
                         fixableWarningCount: 0,
                         messages: [],
+                        suppressedMessages: [],
                         warningCount: 0,
                         fatalErrorCount: 0
                     }
@@ -6320,6 +6471,7 @@ describe("CLIEngine", () => {
                         fixableErrorCount: 0,
                         fixableWarningCount: 0,
                         messages: [],
+                        suppressedMessages: [],
                         warningCount: 0,
                         fatalErrorCount: 0
                     }
@@ -6355,6 +6507,7 @@ describe("CLIEngine", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         source: "a == b",
                         warningCount: 0,
                         fatalErrorCount: 0
index a1de4cd2161f3bc734d1b75feb3e4ef265c60c33..2ccf15e73d15175bceb81abef03f3d6565e81ef1 100644 (file)
@@ -550,7 +550,7 @@ describe("FileEnumerator", () => {
         const files = {
             "file.js": "",
             ".eslintrc.json": JSON.stringify({
-                extends: ["eslint:recommended"]
+                extends: ["eslint:recommended", "eslint:all"]
             })
         };
         const { prepare, cleanup, getPath } = createCustomTeardown({ cwd: root, files });
index 59ff0eaf7a417ab8c710a7ea4ee679f13b05bed7..a58a8c910fccb8dac3e1895b45ad302ec3593621 100644 (file)
@@ -49,9 +49,10 @@ describe("cli", () => {
      * Verify that ESLint class receives correct opts via await cli.execute().
      * @param {string} cmd CLI command.
      * @param {Object} opts Options hash that should match that received by ESLint class.
+     * @param {string} configType The config type to work with.
      * @returns {void}
      */
-    async function verifyESLintOpts(cmd, opts) {
+    async function verifyESLintOpts(cmd, opts, configType) {
 
         // create a fake ESLint class to test with
         const fakeESLint = sinon.mock().withExactArgs(sinon.match(opts));
@@ -62,10 +63,11 @@ describe("cli", () => {
 
         const localCLI = proxyquire("../../lib/cli", {
             "./eslint": { ESLint: fakeESLint },
+            "./flat-eslint": { FlatESLint: fakeESLint, findFlatConfigFile: () => null },
             "./shared/logging": log
         });
 
-        await localCLI.execute(cmd);
+        await localCLI.execute(cmd, null, configType === "flat");
         sinon.verifyAndRestore();
     }
 
@@ -105,1123 +107,1237 @@ describe("cli", () => {
         sh.rm("-r", fixtureDir);
     });
 
-    describe("execute()", () => {
-        it("should return error when text with incorrect quotes is passed as argument", async () => {
-            const configFile = getFixturePath("configurations", "quotes-error.json");
-            const result = await cli.execute(`-c ${configFile}`, "var foo = 'bar';");
+    ["eslintrc", "flat"].forEach(configType => {
 
-            assert.strictEqual(result, 1);
-        });
+        const useFlatConfig = configType === "flat";
 
-        it("should not print debug info when passed the empty string as text", async () => {
-            const result = await cli.execute(["--stdin", "--no-eslintrc"], "");
+        describe("execute()", () => {
 
-            assert.strictEqual(result, 0);
-            assert.isTrue(log.info.notCalled);
-        });
+            it(`should return error when text with incorrect quotes is passed as argument with configType:${configType}`, async () => {
+                const configFile = getFixturePath("configurations", "quotes-error.js");
+                const result = await cli.execute(`-c ${configFile} --stdin --stdin-filename foo.js`, "var foo = 'bar';", useFlatConfig);
 
-        it("should return no error when --ext .js2 is specified", async () => {
-            const filePath = getFixturePath("files");
-            const result = await cli.execute(`--ext .js2 ${filePath}`);
+                assert.strictEqual(result, 1);
+            });
 
-            assert.strictEqual(result, 0);
-        });
+            it(`should not print debug info when passed the empty string as text with configType:${configType}`, async () => {
+                const flag = useFlatConfig ? "--no-config-lookup" : "--no-eslintrc";
+                const result = await cli.execute(["--stdin", flag, "--stdin-filename", "foo.js"], "", useFlatConfig);
 
-        it("should exit with console error when passed unsupported arguments", async () => {
-            const filePath = getFixturePath("files");
-            const result = await cli.execute(`--blah --another ${filePath}`);
+                assert.strictEqual(result, 0);
+                assert.isTrue(log.info.notCalled);
+            });
+
+            it(`should exit with console error when passed unsupported arguments with configType:${configType}`, async () => {
+                const filePath = getFixturePath("files");
+                const result = await cli.execute(`--blah --another ${filePath}`, null, useFlatConfig);
+
+                assert.strictEqual(result, 2);
+            });
 
-            assert.strictEqual(result, 2);
         });
 
-    });
+        describe("when given a config with rules with options and severity level set to error", () => {
 
-    describe("when given a config file", () => {
-        it("should load the specified config file", async () => {
-            const configPath = getFixturePath(".eslintrc");
-            const filePath = getFixturePath("passing.js");
+            const originalCwd = process.cwd;
 
-            await cli.execute(`--config ${configPath} ${filePath}`);
-        });
-    });
+            beforeEach(() => {
+                process.cwd = () => getFixturePath();
+            });
 
-    describe("when there is a local config file", () => {
-        const code = "lib/cli.js";
+            afterEach(() => {
+                process.cwd = originalCwd;
+            });
+
+            it(`should exit with an error status (1) with configType:${configType}`, async () => {
+                const configPath = getFixturePath("configurations", "quotes-error.js");
+                const filePath = getFixturePath("single-quoted.js");
+                const code = `--no-ignore --config ${configPath} ${filePath}`;
 
-        it("should load the local config file", async () => {
+                const exitStatus = await cli.execute(code, null, useFlatConfig);
 
-            // Mock CWD
-            process.eslintCwd = getFixturePath("configurations", "single-quotes");
+                assert.strictEqual(exitStatus, 1);
+            });
+        });
 
-            await cli.execute(code);
+        describe("when given a config file and a directory of files", () => {
+            it(`should load and execute without error with configType:${configType}`, async () => {
+                const configPath = getFixturePath("configurations", "semi-error.js");
+                const filePath = getFixturePath("formatters");
+                const code = `--config ${configPath} ${filePath}`;
+                const exitStatus = await cli.execute(code, null, useFlatConfig);
 
-            process.eslintCwd = null;
+                assert.strictEqual(exitStatus, 0);
+            });
         });
-    });
 
-    describe("when given a config with rules with options and severity level set to error", () => {
-        it("should exit with an error status (1)", async () => {
-            const configPath = getFixturePath("configurations", "quotes-error.json");
-            const filePath = getFixturePath("single-quoted.js");
-            const code = `--no-ignore --config ${configPath} ${filePath}`;
+        describe("when there is a local config file", () => {
+
+            it(`should load the local config file with configType:${configType}`, async () => {
+                await cli.execute("lib/cli.js", null, useFlatConfig);
+            });
 
-            const exitStatus = await cli.execute(code);
+            if (useFlatConfig) {
+                it(`should load the local config file with glob pattern and configType:${configType}`, async () => {
+                    await cli.execute("lib/cli*.js", null, useFlatConfig);
+                });
+            }
 
-            assert.strictEqual(exitStatus, 1);
+            // only works on Windows
+            if (os.platform() === "win32") {
+                it(`should load the local config file with Windows slashes glob pattern and configType:${configType}`, async () => {
+                    await cli.execute("lib\\cli*.js", null, useFlatConfig);
+                });
+            }
         });
-    });
 
-    describe("when given a config file and a directory of files", () => {
-        it("should load and execute without error", async () => {
-            const configPath = getFixturePath("configurations", "semi-error.json");
-            const filePath = getFixturePath("formatters");
-            const code = `--config ${configPath} ${filePath}`;
+        describe("Formatters", () => {
 
-            const exitStatus = await cli.execute(code);
+            describe("when given a valid built-in formatter name", () => {
+                it(`should execute without any errors with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("passing.js");
+                    const flag = useFlatConfig ? "--no-config-lookup" : "--no-eslintrc";
+                    const exit = await cli.execute(`${flag} -f checkstyle ${filePath}`, null, useFlatConfig);
 
-            assert.strictEqual(exitStatus, 0);
-        });
-    });
+                    assert.strictEqual(exit, 0);
+                });
+            });
 
-    describe("when given a config with environment set to browser", () => {
-        it("should execute without any errors", async () => {
-            const configPath = getFixturePath("configurations", "env-browser.json");
-            const filePath = getFixturePath("globals-browser.js");
-            const code = `--config ${configPath} ${filePath}`;
+            describe("when given a valid built-in formatter name that uses rules meta.", () => {
+
+                const originalCwd = process.cwd;
+
+                beforeEach(() => {
+                    process.cwd = () => getFixturePath();
+                });
+
+                afterEach(() => {
+                    process.cwd = originalCwd;
+                });
+
+                it(`should execute without any errors with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("passing.js");
+                    const flag = useFlatConfig ? "--no-config-lookup" : "--no-eslintrc";
+                    const exit = await cli.execute(`--no-ignore -f json-with-metadata ${filePath} ${flag}`, null, useFlatConfig);
+
+                    assert.strictEqual(exit, 0);
+
+                    /*
+                     * Note: There is a behavior difference between eslintrc and flat config
+                     * when using formatters. For eslintrc, rulesMeta always contains every
+                     * rule that was loaded during the last run; for flat config, rulesMeta
+                     * only contains meta data for the rules that triggered messages in the
+                     * results. (Flat config uses ESLint#getRulesMetaForResults().)
+                     */
+
+                    // Check metadata.
+                    const { metadata } = JSON.parse(log.info.args[0][0]);
+                    const expectedMetadata = {
+                        cwd: process.cwd(),
+                        rulesMeta: useFlatConfig ? {} : Array.from(BuiltinRules).reduce((obj, [ruleId, rule]) => {
+                            obj[ruleId] = rule.meta;
+                            return obj;
+                        }, {})
+                    };
+
+                    assert.deepStrictEqual(metadata, expectedMetadata);
+                });
+            });
 
-            const exit = await cli.execute(code);
+            describe("when given an invalid built-in formatter name", () => {
+                it(`should execute with error: with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("passing.js");
+                    const exit = await cli.execute(`-f fakeformatter ${filePath}`);
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+                    assert.strictEqual(exit, 2);
+                });
+            });
 
-    describe("when given a config with environment set to Node.js", () => {
-        it("should execute without any errors", async () => {
-            const configPath = getFixturePath("configurations", "env-node.json");
-            const filePath = getFixturePath("globals-node.js");
-            const code = `--config ${configPath} ${filePath}`;
+            describe("when given a valid formatter path", () => {
+                it(`should execute without any errors with configType:${configType}`, async () => {
+                    const formatterPath = getFixturePath("formatters", "simple.js");
+                    const filePath = getFixturePath("passing.js");
+                    const exit = await cli.execute(`-f ${formatterPath} ${filePath}`);
 
-            const exit = await cli.execute(code);
+                    assert.strictEqual(exit, 0);
+                });
+            });
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+            describe("when given an invalid formatter path", () => {
+                it(`should execute with error with configType:${configType}`, async () => {
+                    const formatterPath = getFixturePath("formatters", "file-does-not-exist.js");
+                    const filePath = getFixturePath("passing.js");
+                    const exit = await cli.execute(`-f ${formatterPath} ${filePath}`, null, useFlatConfig);
 
-    describe("when given a config with environment set to Nashorn", () => {
-        it("should execute without any errors", async () => {
-            const configPath = getFixturePath("configurations", "env-nashorn.json");
-            const filePath = getFixturePath("globals-nashorn.js");
-            const code = `--config ${configPath} ${filePath}`;
+                    assert.strictEqual(exit, 2);
+                });
+            });
 
-            const exit = await cli.execute(code);
+            describe("when given an async formatter path", () => {
+                it(`should execute without any errors with configType:${configType}`, async () => {
+                    const formatterPath = getFixturePath("formatters", "async.js");
+                    const filePath = getFixturePath("passing.js");
+                    const exit = await cli.execute(`-f ${formatterPath} ${filePath}`);
 
-            assert.strictEqual(exit, 0);
+                    assert.strictEqual(log.info.getCall(0).args[0], "from async formatter");
+                    assert.strictEqual(exit, 0);
+                });
+            });
         });
-    });
 
-    describe("when given a config with environment set to WebExtensions", () => {
-        it("should execute without any errors", async () => {
-            const configPath = getFixturePath("configurations", "env-webextensions.json");
-            const filePath = getFixturePath("globals-webextensions.js");
-            const code = `--config ${configPath} ${filePath}`;
+        describe("Exit Codes", () => {
 
-            const exit = await cli.execute(code);
+            const originalCwd = process.cwd;
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+            beforeEach(() => {
+                process.cwd = () => getFixturePath();
+            });
 
-    describe("when given a valid built-in formatter name", () => {
-        it("should execute without any errors", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f checkstyle ${filePath}`);
+            afterEach(() => {
+                process.cwd = originalCwd;
+            });
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+            describe("when executing a file with a lint error", () => {
 
-    describe("when given a valid built-in formatter name that uses rules meta.", () => {
-        it("should execute without any errors", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f json-with-metadata ${filePath} --no-eslintrc`);
+                it(`should exit with error with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("undef.js");
+                    const code = `--no-ignore --rule no-undef:2 ${filePath}`;
 
-            assert.strictEqual(exit, 0);
+                    const exit = await cli.execute(code, null, useFlatConfig);
 
-            // Check metadata.
-            const { metadata } = JSON.parse(log.info.args[0][0]);
-            const expectedMetadata = {
-                cwd: process.cwd(),
-                rulesMeta: Array.from(BuiltinRules).reduce((obj, [ruleId, rule]) => {
-                    obj[ruleId] = rule.meta;
-                    return obj;
-                }, {})
-            };
+                    assert.strictEqual(exit, 1);
+                });
+            });
 
-            assert.deepStrictEqual(metadata, expectedMetadata);
-        });
-    });
+            describe("when using --fix-type without --fix or --fix-dry-run", () => {
+                it(`should exit with error with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("passing.js");
+                    const code = `--fix-type suggestion ${filePath}`;
 
-    describe("when given an invalid built-in formatter name", () => {
-        it("should execute with error", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f fakeformatter ${filePath}`);
+                    const exit = await cli.execute(code, null, useFlatConfig);
 
-            assert.strictEqual(exit, 2);
-        });
-    });
+                    assert.strictEqual(exit, 2);
+                });
+            });
 
-    describe("when given a valid formatter path", () => {
-        it("should execute without any errors", async () => {
-            const formatterPath = getFixturePath("formatters", "simple.js");
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f ${formatterPath} ${filePath}`);
+            describe("when executing a file with a syntax error", () => {
+                it(`should exit with error with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("syntax-error.js");
+                    const exit = await cli.execute(`--no-ignore ${filePath}`, null, useFlatConfig);
+
+                    assert.strictEqual(exit, 1);
+                });
+            });
 
-            assert.strictEqual(exit, 0);
         });
-    });
 
-    describe("when given an invalid formatter path", () => {
-        it("should execute with error", async () => {
-            const formatterPath = getFixturePath("formatters", "file-does-not-exist.js");
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f ${formatterPath} ${filePath}`);
+        describe("when calling execute more than once", () => {
 
-            assert.strictEqual(exit, 2);
-        });
-    });
+            const originalCwd = process.cwd;
 
-    describe("when given an async formatter path", () => {
-        it("should execute without any errors", async () => {
-            const formatterPath = getFixturePath("formatters", "async.js");
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`-f ${formatterPath} ${filePath}`);
+            beforeEach(() => {
+                process.cwd = () => getFixturePath();
+            });
 
-            assert.strictEqual(log.info.getCall(0).args[0], "from async formatter");
-            assert.strictEqual(exit, 0);
-        });
-    });
+            afterEach(() => {
+                process.cwd = originalCwd;
+            });
 
-    describe("when executing a file with a lint error", () => {
-        it("should exit with error", async () => {
-            const filePath = getFixturePath("undef.js");
-            const code = `--no-ignore --rule no-undef:2 ${filePath}`;
+            it(`should not print the results from previous execution with configType:${configType}`, async () => {
+                const filePath = getFixturePath("missing-semicolon.js");
+                const passingPath = getFixturePath("passing.js");
 
-            const exit = await cli.execute(code);
+                await cli.execute(`--no-ignore --rule semi:2 ${filePath}`, null, useFlatConfig);
 
-            assert.strictEqual(exit, 1);
-        });
-    });
+                assert.isTrue(log.info.called, "Log should have been called.");
 
-    describe("when using --fix-type without --fix or --fix-dry-run", () => {
-        it("should exit with error", async () => {
-            const filePath = getFixturePath("passing.js");
-            const code = `--fix-type suggestion ${filePath}`;
+                log.info.resetHistory();
 
-            const exit = await cli.execute(code);
+                await cli.execute(`--no-ignore --rule semi:2 ${passingPath}`, null, useFlatConfig);
+                assert.isTrue(log.info.notCalled);
 
-            assert.strictEqual(exit, 2);
+            });
         });
-    });
 
-    describe("when executing a file with a syntax error", () => {
-        it("should exit with error", async () => {
-            const filePath = getFixturePath("syntax-error.js");
-            const exit = await cli.execute(`--no-ignore ${filePath}`);
-
-            assert.strictEqual(exit, 1);
+        describe("when executing with version flag", () => {
+            it(`should print out current version with configType:${configType}`, async () => {
+                assert.strictEqual(await cli.execute("-v", null, useFlatConfig), 0);
+                assert.strictEqual(log.info.callCount, 1);
+            });
         });
-    });
 
-    describe("when calling execute more than once", () => {
-        it("should not print the results from previous execution", async () => {
-            const filePath = getFixturePath("missing-semicolon.js");
-            const passingPath = getFixturePath("passing.js");
+        describe("when executing with env-info flag", () => {
 
-            await cli.execute(`--no-ignore --rule semi:2 ${filePath}`);
+            it(`should print out environment information with configType:${configType}`, async () => {
+                assert.strictEqual(await cli.execute("--env-info", null, useFlatConfig), 0);
+                assert.strictEqual(log.info.callCount, 1);
+            });
 
-            assert.isTrue(log.info.called, "Log should have been called.");
+            describe("With error condition", () => {
 
-            log.info.resetHistory();
+                beforeEach(() => {
+                    RuntimeInfo.environment = sinon.stub().throws("There was an error!");
+                });
 
-            await cli.execute(`--no-ignore --rule semi:2 ${passingPath}`);
-            assert.isTrue(log.info.notCalled);
+                afterEach(() => {
+                    RuntimeInfo.environment = sinon.stub();
+                });
 
-        });
-    });
+                it(`should print error message and return error code with configType:${configType}`, async () => {
+
+                    assert.strictEqual(await cli.execute("--env-info", null, useFlatConfig), 2);
+                    assert.strictEqual(log.error.callCount, 1);
+                });
+            });
 
-    describe("when executing with version flag", () => {
-        it("should print out current version", async () => {
-            assert.strictEqual(await cli.execute("-v"), 0);
-            assert.strictEqual(log.info.callCount, 1);
         });
-    });
 
-    describe("when executing with env-info flag", () => {
-        it("should print out environment information", async () => {
-            assert.strictEqual(await cli.execute("--env-info"), 0);
-            assert.strictEqual(log.info.callCount, 1);
+        describe("when executing with help flag", () => {
+            it(`should print out help with configType:${configType}`, async () => {
+                assert.strictEqual(await cli.execute("-h", null, useFlatConfig), 0);
+                assert.strictEqual(log.info.callCount, 1);
+            });
         });
 
-        it("should print error message and return error code", async () => {
-            RuntimeInfo.environment.throws("There was an error!");
+        describe("when executing a file with a shebang", () => {
+            it(`should execute without error with configType:${configType}`, async () => {
+                const filePath = getFixturePath("shebang.js");
+                const flag = useFlatConfig ? "--no-config-lookup" : "--no-eslintrc";
+                const exit = await cli.execute(`${flag} --no-ignore ${filePath}`, null, useFlatConfig);
 
-            assert.strictEqual(await cli.execute("--env-info"), 2);
-            assert.strictEqual(log.error.callCount, 1);
+                assert.strictEqual(exit, 0);
+            });
         });
-    });
 
-    describe("when executing without no-error-on-unmatched-pattern flag", () => {
-        it("should throw an error on unmatched glob pattern", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const globPattern = "*.js3";
+        describe("FixtureDir Dependent Tests", () => {
 
-            await stdAssert.rejects(async () => {
-                await cli.execute(`"${filePath}/${globPattern}"`);
-            }, new Error(`No files matching '${filePath}/${globPattern}' were found.`));
-        });
+            const originalCwd = process.cwd;
 
-        it("should throw an error on unmatched --ext", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const extension = ".js3";
+            beforeEach(() => {
+                process.cwd = () => getFixturePath();
+            });
 
-            await stdAssert.rejects(async () => {
-                await cli.execute(`--ext ${extension} ${filePath}`);
-            }, `No files matching '${filePath}' were found`);
-        });
-    });
+            afterEach(() => {
+                process.cwd = originalCwd;
+            });
 
-    describe("when executing with no-error-on-unmatched-pattern flag", () => {
-        it("should not throw an error on unmatched node glob syntax patterns", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern "${filePath}/*.js3"`);
+            describe("when executing with global flag", () => {
 
-            assert.strictEqual(exit, 0);
-        });
+                it(`should default defined variables to read-only with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("undef.js");
+                    const exit = await cli.execute(`--global baz,bat --no-ignore --rule no-global-assign:2 ${filePath}`, null, useFlatConfig);
 
-        it("should not throw an error on unmatched --ext", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern --ext .js3 ${filePath}`);
+                    assert.isTrue(log.info.calledOnce);
+                    assert.strictEqual(exit, 1);
+                });
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+                it(`should allow defining writable global variables with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("undef.js");
+                    const exit = await cli.execute(`--global baz:false,bat:true --no-ignore ${filePath}`, null, useFlatConfig);
 
-    describe("when executing with no-error-on-unmatched-pattern flag and multiple patterns", () => {
-        it("should not throw an error on multiple unmatched node glob syntax patterns", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern ${filePath}/*.js3 ${filePath}/*.js4`);
+                    assert.isTrue(log.info.notCalled);
+                    assert.strictEqual(exit, 0);
+                });
 
-            assert.strictEqual(exit, 0);
-        });
+                it(`should allow defining variables with multiple flags with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("undef.js");
+                    const exit = await cli.execute(`--global baz --global bat:true --no-ignore ${filePath}`);
 
-        it("should still throw an error on when a matched pattern has lint errors", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern ${filePath}/*.js3 ${filePath}/*.js`);
+                    assert.isTrue(log.info.notCalled);
+                    assert.strictEqual(exit, 0);
+                });
+            });
 
-            assert.strictEqual(exit, 1);
-        });
-    });
 
-    describe("when executing with no-error-on-unmatched-pattern flag and multiple --ext arguments", () => {
-        it("should not throw an error on multiple unmatched --ext arguments", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern --ext .js3 --ext .js4 ${filePath}`);
+            describe("when supplied with rule flag and severity level set to error", () => {
 
-            assert.strictEqual(exit, 0);
-        });
 
-        it("should still throw an error on when a matched pattern has lint errors", async () => {
-            const filePath = getFixturePath("unmatched-patterns");
-            const exit = await cli.execute(`--no-error-on-unmatched-pattern --ext .js3 --ext .js ${filePath}`);
+                it(`should exit with an error status (2) with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("single-quoted.js");
+                    const code = `--no-ignore --rule 'quotes: [2, double]' ${filePath}`;
+                    const exitStatus = await cli.execute(code, null, useFlatConfig);
 
-            assert.strictEqual(exit, 1);
-        });
-    });
+                    assert.strictEqual(exitStatus, 1);
+                });
+            });
 
-    describe("when executing with help flag", () => {
-        it("should print out help", async () => {
-            assert.strictEqual(await cli.execute("-h"), 0);
-            assert.strictEqual(log.info.callCount, 1);
-        });
-    });
+            describe("when the quiet option is enabled", () => {
 
-    describe("when given a directory with eslint excluded files in the directory", () => {
-        it("should throw an error and not process any files", async () => {
-            const ignorePath = getFixturePath(".eslintignore");
-            const filePath = getFixturePath("cli");
+                it(`should only print error with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("single-quoted.js");
+                    const cliArgs = `--no-ignore --quiet  -f compact --rule 'quotes: [2, double]' --rule 'no-unused-vars: 1' ${filePath}`;
 
-            await stdAssert.rejects(async () => {
-                await cli.execute(`--ignore-path ${ignorePath} ${filePath}`);
-            }, new Error(`All files matched by '${filePath}' are ignored.`));
-        });
-    });
+                    await cli.execute(cliArgs, null, useFlatConfig);
 
-    describe("when given a file in excluded files list", () => {
-        it("should not process the file", async () => {
-            const ignorePath = getFixturePath(".eslintignore");
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`--ignore-path ${ignorePath} ${filePath}`);
+                    sinon.assert.calledOnce(log.info);
 
-            // a warning about the ignored file
-            assert.isTrue(log.info.called);
-            assert.strictEqual(exit, 0);
-        });
+                    const formattedOutput = log.info.firstCall.args[0];
 
-        it("should process the file when forced", async () => {
-            const ignorePath = getFixturePath(".eslintignore");
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`--ignore-path ${ignorePath} --no-ignore ${filePath}`);
+                    assert.include(formattedOutput, "Error");
+                    assert.notInclude(formattedOutput, "Warning");
+                });
 
-            // no warnings
-            assert.isFalse(log.info.called);
-            assert.strictEqual(exit, 0);
-        });
-    });
+                it(`should print nothing if there are no errors with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("single-quoted.js");
+                    const cliArgs = `--quiet  -f compact --rule 'quotes: [1, double]' --rule 'no-unused-vars: 1' ${filePath}`;
 
-    describe("when given a pattern to ignore", () => {
-        it("should not process any files", async () => {
-            const ignoredFile = getFixturePath("cli/syntax-error.js");
-            const filePath = getFixturePath("cli/passing.js");
-            const exit = await cli.execute(`--ignore-pattern cli/ ${ignoredFile} ${filePath}`);
+                    await cli.execute(cliArgs, null, useFlatConfig);
 
-            // warnings about the ignored files
-            assert.isTrue(log.info.called);
-            assert.strictEqual(exit, 0);
-        });
-    });
+                    sinon.assert.notCalled(log.info);
+                });
+            });
 
-    describe("when given patterns to ignore", () => {
-        it("should not process any matching files", async () => {
-            const ignorePaths = ["a", "b"];
 
-            const cmd = ignorePaths.map(ignorePath => `--ignore-pattern ${ignorePath}`).concat(".").join(" ");
+            describe("no-error-on-unmatched-pattern flag", () => {
 
-            const opts = {
-                overrideConfig: {
-                    ignorePatterns: ignorePaths
-                }
-            };
+                describe("when executing without no-error-on-unmatched-pattern flag", () => {
+                    it(`should throw an error on unmatched glob pattern with configType:${configType}`, async () => {
+                        let filePath = getFixturePath("unmatched-patterns");
+                        const globPattern = "unmatched*.js";
 
-            await verifyESLintOpts(cmd, opts);
-        });
-    });
+                        if (useFlatConfig) {
+                            filePath = filePath.replace(/\\/gu, "/");
+                        }
 
-    describe("when executing a file with a shebang", () => {
-        it("should execute without error", async () => {
-            const filePath = getFixturePath("shebang.js");
-            const exit = await cli.execute(`--no-ignore ${filePath}`);
+                        await stdAssert.rejects(async () => {
+                            await cli.execute(`"${filePath}/${globPattern}"`, null, useFlatConfig);
+                        }, new Error(`No files matching '${filePath}/${globPattern}' were found.`));
+                    });
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+                });
 
-    describe("when loading a custom rule", () => {
-        it("should return an error when rule isn't found", async () => {
-            const rulesPath = getFixturePath("rules", "wrong");
-            const configPath = getFixturePath("rules", "eslint.json");
-            const filePath = getFixturePath("rules", "test", "test-custom-rule.js");
-            const code = `--rulesdir ${rulesPath} --config ${configPath} --no-ignore ${filePath}`;
+                describe("when executing with no-error-on-unmatched-pattern flag", () => {
+                    it(`should not throw an error on unmatched node glob syntax patterns with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("unmatched-patterns");
+                        const exit = await cli.execute(`--no-error-on-unmatched-pattern "${filePath}/unmatched*.js"`, null, useFlatConfig);
 
-            await stdAssert.rejects(async () => {
-                const exit = await cli.execute(code);
+                        assert.strictEqual(exit, 0);
+                    });
+                });
 
-                assert.strictEqual(exit, 2);
-            }, /Error while loading rule 'custom-rule': Boom!/u);
-        });
+                describe("when executing with no-error-on-unmatched-pattern flag and multiple patterns", () => {
+                    it(`should not throw an error on multiple unmatched node glob syntax patterns with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("unmatched-patterns/js3");
+                        const exit = await cli.execute(`--no-error-on-unmatched-pattern ${filePath}/unmatched1*.js ${filePath}/unmatched2*.js`, null, useFlatConfig);
 
-        it("should return a warning when rule is matched", async () => {
-            const rulesPath = getFixturePath("rules");
-            const configPath = getFixturePath("rules", "eslint.json");
-            const filePath = getFixturePath("rules", "test", "test-custom-rule.js");
-            const code = `--rulesdir ${rulesPath} --config ${configPath} --no-ignore ${filePath}`;
+                        assert.strictEqual(exit, 0);
+                    });
 
-            await cli.execute(code);
+                    it(`should still throw an error on when a matched pattern has lint errors with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("unmatched-patterns");
+                        const exit = await cli.execute(`--no-ignore --no-error-on-unmatched-pattern ${filePath}/unmatched1*.js ${filePath}/failing.js`, null, useFlatConfig);
 
-            assert.isTrue(log.info.calledOnce);
-            assert.isTrue(log.info.neverCalledWith(""));
-        });
+                        assert.strictEqual(exit, 1);
+                    });
+                });
 
-        it("should return warnings from multiple rules in different directories", async () => {
-            const rulesPath = getFixturePath("rules", "dir1");
-            const rulesPath2 = getFixturePath("rules", "dir2");
-            const configPath = getFixturePath("rules", "multi-rulesdirs.json");
-            const filePath = getFixturePath("rules", "test-multi-rulesdirs.js");
-            const code = `--rulesdir ${rulesPath} --rulesdir ${rulesPath2} --config ${configPath} --no-ignore ${filePath}`;
-            const exit = await cli.execute(code);
-
-            const call = log.info.getCall(0);
-
-            assert.isTrue(log.info.calledOnce);
-            assert.isTrue(call.args[0].indexOf("String!") > -1);
-            assert.isTrue(call.args[0].indexOf("Literal!") > -1);
-            assert.isTrue(call.args[0].indexOf("2 problems") > -1);
-            assert.isTrue(log.info.neverCalledWith(""));
-            assert.strictEqual(exit, 1);
-        });
+            });
 
+            describe("Parser Options", () => {
 
-    });
+                describe("when given parser options", () => {
+                    it(`should exit with error if parser options are invalid with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("passing.js");
+                        const exit = await cli.execute(`--no-ignore --parser-options test111 ${filePath}`, null, useFlatConfig);
 
-    describe("when executing with no-eslintrc flag", () => {
-        it("should ignore a local config file", async () => {
-            const filePath = getFixturePath("eslintrc", "quotes.js");
-            const exit = await cli.execute(`--no-eslintrc --no-ignore ${filePath}`);
+                        assert.strictEqual(exit, 2);
+                    });
 
-            assert.isTrue(log.info.notCalled);
-            assert.strictEqual(exit, 0);
-        });
-    });
+                    it(`should exit with no error if parser is valid with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("passing.js");
+                        const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:6 ${filePath}`, null, useFlatConfig);
 
-    describe("when executing without no-eslintrc flag", () => {
-        it("should load a local config file", async () => {
-            const filePath = getFixturePath("eslintrc", "quotes.js");
-            const exit = await cli.execute(`--no-ignore ${filePath}`);
+                        assert.strictEqual(exit, 0);
+                    });
 
-            assert.isTrue(log.info.calledOnce);
-            assert.strictEqual(exit, 1);
-        });
-    });
+                    it(`should exit with an error on ecmaVersion 7 feature in ecmaVersion 6 with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("passing-es7.js");
+                        const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:6 ${filePath}`, null, useFlatConfig);
 
-    describe("when executing without env flag", () => {
-        it("should not define environment-specific globals", async () => {
-            const files = [
-                getFixturePath("globals-browser.js"),
-                getFixturePath("globals-node.js")
-            ];
+                        assert.strictEqual(exit, 1);
+                    });
 
-            await cli.execute(`--no-eslintrc --config ./conf/eslint-recommended.js --no-ignore ${files.join(" ")}`);
+                    it(`should exit with no error on ecmaVersion 7 feature in ecmaVersion 7 with configType:${configType}`, async () => {
+                        const filePath = getFixturePath("passing-es7.js");
+                        const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:7 ${filePath}`, null, useFlatConfig);
 
-            assert.strictEqual(log.info.args[0][0].split("\n").length, 10);
-        });
-    });
+                        assert.strictEqual(exit, 0);
+                    });
 
-    describe("when executing with global flag", () => {
-        it("should default defined variables to read-only", async () => {
-            const filePath = getFixturePath("undef.js");
-            const exit = await cli.execute(`--global baz,bat --no-ignore --rule no-global-assign:2 ${filePath}`);
+                    it(`should exit with no error on ecmaVersion 7 feature with config ecmaVersion 6 and command line ecmaVersion 7 with configType:${configType}`, async () => {
+                        const configPath = useFlatConfig
+                            ? getFixturePath("configurations", "es6.js")
+                            : getFixturePath("configurations", "es6.json");
+                        const filePath = getFixturePath("passing-es7.js");
+                        const exit = await cli.execute(`--no-ignore --config ${configPath} --parser-options=ecmaVersion:7 ${filePath}`, null, useFlatConfig);
 
-            assert.isTrue(log.info.calledOnce);
-            assert.strictEqual(exit, 1);
-        });
+                        assert.strictEqual(exit, 0);
+                    });
+                });
+            });
 
-        it("should allow defining writable global variables", async () => {
-            const filePath = getFixturePath("undef.js");
-            const exit = await cli.execute(`--global baz:false,bat:true --no-ignore ${filePath}`);
+            describe("when given the max-warnings flag", () => {
 
-            assert.isTrue(log.info.notCalled);
-            assert.strictEqual(exit, 0);
-        });
+                let filePath, configFilePath;
 
-        it("should allow defining variables with multiple flags", async () => {
-            const filePath = getFixturePath("undef.js");
-            const exit = await cli.execute(`--global baz --global bat:true --no-ignore ${filePath}`);
+                before(() => {
+                    filePath = getFixturePath("max-warnings/six-warnings.js");
+                    configFilePath = getFixturePath(useFlatConfig ? "max-warnings/eslint.config.js" : "max-warnings/.eslintrc");
+                });
 
-            assert.isTrue(log.info.notCalled);
-            assert.strictEqual(exit, 0);
-        });
-    });
+                it(`should not change exit code if warning count under threshold with configType:${configType}`, async () => {
+                    const exitCode = await cli.execute(`--no-ignore --max-warnings 10 ${filePath} -c ${configFilePath}`, null, useFlatConfig);
 
-    describe("when supplied with rule flag and severity level set to error", () => {
-        it("should exit with an error status (2)", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const code = `--no-ignore --rule 'quotes: [2, double]' ${filePath}`;
-            const exitStatus = await cli.execute(code);
+                    assert.strictEqual(exitCode, 0);
+                });
 
-            assert.strictEqual(exitStatus, 1);
-        });
-    });
+                it(`should exit with exit code 1 if warning count exceeds threshold with configType:${configType}`, async () => {
+                    const exitCode = await cli.execute(`--no-ignore --max-warnings 5 ${filePath} -c ${configFilePath}`, null, useFlatConfig);
 
-    describe("when the quiet option is enabled", () => {
+                    assert.strictEqual(exitCode, 1);
+                    assert.ok(log.error.calledOnce);
+                    assert.include(log.error.getCall(0).args[0], "ESLint found too many warnings");
+                });
 
-        it("should only print error", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const cliArgs = `--no-ignore --quiet  -f compact --rule 'quotes: [2, double]' --rule 'no-unused-vars: 1' ${filePath}`;
+                it(`should exit with exit code 1 without printing warnings if the quiet option is enabled and warning count exceeds threshold with configType:${configType}`, async () => {
+                    const exitCode = await cli.execute(`--no-ignore --quiet --max-warnings 5 ${filePath} -c ${configFilePath}`, null, useFlatConfig);
 
-            await cli.execute(cliArgs);
+                    assert.strictEqual(exitCode, 1);
+                    assert.ok(log.error.calledOnce);
+                    assert.include(log.error.getCall(0).args[0], "ESLint found too many warnings");
+                    assert.ok(log.info.notCalled); // didn't print warnings
+                });
 
-            sinon.assert.calledOnce(log.info);
+                it(`should not change exit code if warning count equals threshold with configType:${configType}`, async () => {
+                    const exitCode = await cli.execute(`--no-ignore --max-warnings 6 ${filePath} -c ${configFilePath}`, null, useFlatConfig);
 
-            const formattedOutput = log.info.firstCall.args[0];
+                    assert.strictEqual(exitCode, 0);
+                });
 
-            assert.include(formattedOutput, "Error");
-            assert.notInclude(formattedOutput, "Warning");
-        });
+                it(`should not change exit code if flag is not specified and there are warnings with configType:${configType}`, async () => {
+                    const exitCode = await cli.execute(`-c ${configFilePath} ${filePath}`, null, useFlatConfig);
 
-        it("should print nothing if there are no errors", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const cliArgs = `--quiet  -f compact --rule 'quotes: [1, double]' --rule 'no-unused-vars: 1' ${filePath}`;
+                    assert.strictEqual(exitCode, 0);
+                });
+            });
 
-            await cli.execute(cliArgs);
+            describe("when given the exit-on-fatal-error flag", () => {
+                it(`should not change exit code if no fatal errors are reported with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("exit-on-fatal-error", "no-fatal-error.js");
+                    const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`, null, useFlatConfig);
 
-            sinon.assert.notCalled(log.info);
-        });
-    });
+                    assert.strictEqual(exitCode, 0);
+                });
 
-    describe("when supplied with report output file path", () => {
-        afterEach(() => {
-            sh.rm("-rf", "tests/output");
-        });
+                it(`should exit with exit code 1 if no fatal errors are found, but rule violations are found with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("exit-on-fatal-error", "no-fatal-error-rule-violation.js");
+                    const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`, null, useFlatConfig);
 
-        it("should write the file and create dirs if they don't exist", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output/eslint-output.txt ${filePath}`;
+                    assert.strictEqual(exitCode, 1);
+                });
 
-            await cli.execute(code);
+                it(`should exit with exit code 2 if fatal error is found with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("exit-on-fatal-error", "fatal-error.js");
+                    const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`, null, useFlatConfig);
 
-            assert.include(fs.readFileSync("tests/output/eslint-output.txt", "utf8"), filePath);
-            assert.isTrue(log.info.notCalled);
-        });
+                    assert.strictEqual(exitCode, 2);
+                });
 
-        it("should return an error if the path is a directory", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output ${filePath}`;
+                it(`should exit with exit code 2 if fatal error is found in any file with configType:${configType}`, async () => {
+                    const filePath = getFixturePath("exit-on-fatal-error");
+                    const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`, null, useFlatConfig);
 
-            fs.mkdirSync("tests/output");
+                    assert.strictEqual(exitCode, 2);
+                });
 
-            const exit = await cli.execute(code);
 
-            assert.strictEqual(exit, 2);
-            assert.isTrue(log.info.notCalled);
-            assert.isTrue(log.error.calledOnce);
-        });
+            });
 
-        it("should return an error if the path could not be written to", async () => {
-            const filePath = getFixturePath("single-quoted.js");
-            const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output/eslint-output.txt ${filePath}`;
 
-            fs.writeFileSync("tests/output", "foo");
+            describe("Ignores", () => {
+
+                describe("when given a directory with eslint excluded files in the directory", () => {
+                    it(`should throw an error and not process any files with configType:${configType}`, async () => {
+                        const ignorePath = getFixturePath(".eslintignore");
+                        const filePath = getFixturePath("cli");
+                        const expectedMessage = useFlatConfig
+                            ? `All files matched by '${filePath.replace(/\\/gu, "/")}/**/*.js' are ignored.`
+                            : `All files matched by '${filePath}' are ignored.`;
+
+                        await stdAssert.rejects(async () => {
+                            await cli.execute(`--ignore-path ${ignorePath} ${filePath}`, null, useFlatConfig);
+                        }, new Error(expectedMessage));
+                    });
+                });
+
+                describe("when given a file in excluded files list", () => {
+                    it(`should not process the file with configType:${configType}`, async () => {
+                        const ignorePath = getFixturePath(".eslintignore");
+                        const filePath = getFixturePath("passing.js");
+                        const exit = await cli.execute(`--ignore-path ${ignorePath} ${filePath}`, null, useFlatConfig);
+
+                        // a warning about the ignored file
+                        assert.isTrue(log.info.called);
+                        assert.strictEqual(exit, 0);
+                    });
+
+                    it(`should process the file when forced with configType:${configType}`, async () => {
+                        const ignorePath = getFixturePath(".eslintignore");
+                        const filePath = getFixturePath("passing.js");
+                        const exit = await cli.execute(`--ignore-path ${ignorePath} --no-ignore ${filePath}`, null, useFlatConfig);
+
+                        // no warnings
+                        assert.isFalse(log.info.called);
+                        assert.strictEqual(exit, 0);
+                    });
+                });
+
+                describe("when given a pattern to ignore", () => {
+                    it(`should not process any files with configType:${configType}`, async () => {
+                        const ignoredFile = getFixturePath("cli/syntax-error.js");
+                        const filePath = getFixturePath("cli/passing.js");
+                        const exit = await cli.execute(`--ignore-pattern cli/ ${ignoredFile} ${filePath}`, null, useFlatConfig);
+
+                        // warnings about the ignored files
+                        assert.isTrue(log.info.called);
+                        assert.strictEqual(exit, 0);
+                    });
+                });
 
-            const exit = await cli.execute(code);
+            });
 
-            assert.strictEqual(exit, 2);
-            assert.isTrue(log.info.notCalled);
-            assert.isTrue(log.error.calledOnce);
         });
-    });
 
-    describe("when supplied with a plugin", () => {
-        it("should pass plugins to ESLint", async () => {
-            const examplePluginName = "eslint-plugin-example";
 
-            await verifyESLintOpts(`--no-ignore --plugin ${examplePluginName} foo.js`, {
-                overrideConfig: {
-                    plugins: [examplePluginName]
-                }
-            });
-        });
+        describe("when given a parser name", () => {
 
-    });
+            it(`should exit with a fatal error if parser is invalid with configType:${configType}`, async () => {
+                const filePath = getFixturePath("passing.js");
 
-    describe("when supplied with a plugin-loading path", () => {
-        it("should pass the option to ESLint", async () => {
-            const examplePluginDirPath = "foo/bar";
+                await stdAssert.rejects(async () => await cli.execute(`--no-ignore --parser test111 ${filePath}`, null, useFlatConfig), "Cannot find module 'test111'");
+            });
+
+            it(`should exit with no error if parser is valid with configType:${configType}`, async () => {
+                const filePath = getFixturePath("passing.js");
+                const flag = useFlatConfig ? "--no-config-lookup" : "--no-eslintrc";
+                const exit = await cli.execute(`${flag} --no-ignore --parser espree ${filePath}`, null, useFlatConfig);
 
-            await verifyESLintOpts(`--resolve-plugins-relative-to ${examplePluginDirPath} foo.js`, {
-                resolvePluginsRelativeTo: examplePluginDirPath
+                assert.strictEqual(exit, 0);
             });
+
         });
-    });
 
-    describe("when given an parser name", () => {
-        it("should exit with a fatal error if parser is invalid", async () => {
-            const filePath = getFixturePath("passing.js");
+        describe("when supplied with report output file path", () => {
+            afterEach(() => {
+                sh.rm("-rf", "tests/output");
+            });
 
-            await stdAssert.rejects(async () => await cli.execute(`--no-ignore --parser test111 ${filePath}`), "Cannot find module 'test111'");
-        });
+            it(`should write the file and create dirs if they don't exist with configType:${configType}`, async () => {
+                const filePath = getFixturePath("single-quoted.js");
+                const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output/eslint-output.txt ${filePath}`;
 
-        it("should exit with no error if parser is valid", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`--no-ignore --parser espree ${filePath}`);
+                await cli.execute(code, null, useFlatConfig);
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+                assert.include(fs.readFileSync("tests/output/eslint-output.txt", "utf8"), filePath);
+                assert.isTrue(log.info.notCalled);
+            });
 
-    describe("when given parser options", () => {
-        it("should exit with error if parser options are invalid", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`--no-ignore --parser-options test111 ${filePath}`);
+            it(`should return an error if the path is a directory with configType:${configType}`, async () => {
+                const filePath = getFixturePath("single-quoted.js");
+                const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output ${filePath}`;
 
-            assert.strictEqual(exit, 2);
-        });
+                fs.mkdirSync("tests/output");
 
-        it("should exit with no error if parser is valid", async () => {
-            const filePath = getFixturePath("passing.js");
-            const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:6 ${filePath}`);
+                const exit = await cli.execute(code, null, useFlatConfig);
 
-            assert.strictEqual(exit, 0);
-        });
+                assert.strictEqual(exit, 2);
+                assert.isTrue(log.info.notCalled);
+                assert.isTrue(log.error.calledOnce);
+            });
 
-        it("should exit with an error on ecmaVersion 7 feature in ecmaVersion 6", async () => {
-            const filePath = getFixturePath("passing-es7.js");
-            const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:6 ${filePath}`);
+            it(`should return an error if the path could not be written to with configType:${configType}`, async () => {
+                const filePath = getFixturePath("single-quoted.js");
+                const code = `--no-ignore --rule 'quotes: [1, double]' --o tests/output/eslint-output.txt ${filePath}`;
 
-            assert.strictEqual(exit, 1);
-        });
+                fs.writeFileSync("tests/output", "foo");
 
-        it("should exit with no error on ecmaVersion 7 feature in ecmaVersion 7", async () => {
-            const filePath = getFixturePath("passing-es7.js");
-            const exit = await cli.execute(`--no-ignore --parser-options=ecmaVersion:7 ${filePath}`);
+                const exit = await cli.execute(code, null, useFlatConfig);
 
-            assert.strictEqual(exit, 0);
+                assert.strictEqual(exit, 2);
+                assert.isTrue(log.info.notCalled);
+                assert.isTrue(log.error.calledOnce);
+            });
         });
 
-        it("should exit with no error on ecmaVersion 7 feature with config ecmaVersion 6 and command line ecmaVersion 7", async () => {
-            const configPath = getFixturePath("configurations", "es6.json");
-            const filePath = getFixturePath("passing-es7.js");
-            const exit = await cli.execute(`--no-ignore --config ${configPath} --parser-options=ecmaVersion:7 ${filePath}`);
+        describe("when passed --no-inline-config", () => {
+            let localCLI;
 
-            assert.strictEqual(exit, 0);
-        });
-    });
+            afterEach(() => {
+                sinon.verifyAndRestore();
+            });
 
-    describe("when given the max-warnings flag", () => {
-        it("should not change exit code if warning count under threshold", async () => {
-            const filePath = getFixturePath("max-warnings");
-            const exitCode = await cli.execute(`--no-ignore --max-warnings 10 ${filePath}`);
+            it(`should pass allowInlineConfig:false to ESLint when --no-inline-config is used with configType:${configType}`, async () => {
+
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ allowInlineConfig: false }));
+
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns([{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 2,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 1,
+                    warningCount: 0
+                }]);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.stub();
+
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
+                    "./shared/logging": log
+                });
+
+                await localCLI.execute("--no-inline-config .", null, useFlatConfig);
+            });
 
-            assert.strictEqual(exitCode, 0);
-        });
+            it(`should not error and allowInlineConfig should be true by default with configType:${configType}`, async () => {
 
-        it("should exit with exit code 1 if warning count exceeds threshold", async () => {
-            const filePath = getFixturePath("max-warnings");
-            const exitCode = await cli.execute(`--no-ignore --max-warnings 5 ${filePath}`);
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ allowInlineConfig: true }));
 
-            assert.strictEqual(exitCode, 1);
-            assert.ok(log.error.calledOnce);
-            assert.include(log.error.getCall(0).args[0], "ESLint found too many warnings");
-        });
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.stub();
 
-        it("should exit with exit code 1 without printing warnings if the quiet option is enabled and warning count exceeds threshold", async () => {
-            const filePath = getFixturePath("max-warnings");
-            const exitCode = await cli.execute(`--no-ignore --quiet --max-warnings 5 ${filePath}`);
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
+                    "./shared/logging": log
+                });
 
-            assert.strictEqual(exitCode, 1);
-            assert.ok(log.error.calledOnce);
-            assert.include(log.error.getCall(0).args[0], "ESLint found too many warnings");
-            assert.ok(log.info.notCalled); // didn't print warnings
-        });
+                const exitCode = await localCLI.execute(".", null, useFlatConfig);
 
-        it("should not change exit code if warning count equals threshold", async () => {
-            const filePath = getFixturePath("max-warnings");
-            const exitCode = await cli.execute(`--no-ignore --max-warnings 6 ${filePath}`);
+                assert.strictEqual(exitCode, 0);
+
+            });
 
-            assert.strictEqual(exitCode, 0);
         });
 
-        it("should not change exit code if flag is not specified and there are warnings", async () => {
-            const filePath = getFixturePath("max-warnings");
-            const exitCode = await cli.execute(filePath);
+        describe("when passed --fix", () => {
+            let localCLI;
 
-            assert.strictEqual(exitCode, 0);
-        });
-    });
+            afterEach(() => {
+                sinon.verifyAndRestore();
+            });
 
-    describe("when given the exit-on-fatal-error flag", () => {
-        it("should not change exit code if no fatal errors are reported", async () => {
-            const filePath = getFixturePath("exit-on-fatal-error", "no-fatal-error.js");
-            const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`);
+            it(`should pass fix:true to ESLint when executing on files with configType:${configType}`, async () => {
 
-            assert.strictEqual(exitCode, 0);
-        });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
 
-        it("should exit with exit code 1 if no fatal errors are found, but rule violations are found", async () => {
-            const filePath = getFixturePath("exit-on-fatal-error", "no-fatal-error-rule-violation.js");
-            const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`);
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.mock().once();
 
-            assert.strictEqual(exitCode, 1);
-        });
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
+                    "./shared/logging": log
+                });
 
-        it("should exit with exit code 2 if fatal error is found", async () => {
-            const filePath = getFixturePath("exit-on-fatal-error", "fatal-error.js");
-            const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`);
+                const exitCode = await localCLI.execute("--fix .", null, useFlatConfig);
 
-            assert.strictEqual(exitCode, 2);
-        });
+                assert.strictEqual(exitCode, 0);
 
-        it("should exit with exit code 2 if fatal error is found in any file", async () => {
-            const filePath = getFixturePath("exit-on-fatal-error");
-            const exitCode = await cli.execute(`--no-ignore --exit-on-fatal-error ${filePath}`);
+            });
 
-            assert.strictEqual(exitCode, 2);
-        });
 
+            it(`should rewrite files when in fix mode with configType:${configType}`, async () => {
 
-    });
+                const report = [{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 2,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 1,
+                    warningCount: 0
+                }];
 
-    describe("when passed --no-inline-config", () => {
-        let localCLI;
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
 
-        afterEach(() => {
-            sinon.verifyAndRestore();
-        });
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.mock().withExactArgs(report);
 
-        it("should pass allowInlineConfig:false to ESLint when --no-inline-config is used", async () => {
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ allowInlineConfig: false }));
+                    "./shared/logging": log
+                });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns([{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 2,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 1,
-                warningCount: 0
-            }]);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.stub();
+                const exitCode = await localCLI.execute("--fix .", null, useFlatConfig);
+
+                assert.strictEqual(exitCode, 1);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
             });
 
-            await localCLI.execute("--no-inline-config .");
-        });
+            it(`should provide fix predicate and rewrite files when in fix mode and quiet mode with configType:${configType}`, async () => {
 
-        it("should not error and allowInlineConfig should be true by default", async () => {
+                const report = [{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 1,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 0,
+                    warningCount: 1
+                }];
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ allowInlineConfig: true }));
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: sinon.match.func }));
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.stub();
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.getErrorResults = sinon.stub().returns([]);
+                fakeESLint.outputFixes = sinon.mock().withExactArgs(report);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
-            });
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            const exitCode = await localCLI.execute(".");
+                    "./shared/logging": log
+                });
 
-            assert.strictEqual(exitCode, 0);
+                const exitCode = await localCLI.execute("--fix --quiet .", null, useFlatConfig);
 
-        });
+                assert.strictEqual(exitCode, 0);
 
-    });
+            });
 
-    describe("when passed --fix", () => {
-        let localCLI;
+            it(`should not call ESLint and return 2 when executing on text with configType:${configType}`, async () => {
 
-        afterEach(() => {
-            sinon.verifyAndRestore();
-        });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().never();
 
-        it("should pass fix:true to ESLint when executing on files", async () => {
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+                    "./shared/logging": log
+                });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.mock().once();
+                const exitCode = await localCLI.execute("--fix .", "foo = bar;", null, useFlatConfig);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.strictEqual(exitCode, 2);
             });
 
-            const exitCode = await localCLI.execute("--fix .");
+        });
 
-            assert.strictEqual(exitCode, 0);
+        describe("when passed --fix-dry-run", () => {
+            let localCLI;
 
-        });
+            afterEach(() => {
+                sinon.verifyAndRestore();
+            });
 
+            it(`should pass fix:true to ESLint when executing on files with configType:${configType}`, async () => {
 
-        it("should rewrite files when in fix mode", async () => {
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
 
-            const report = [{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 2,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 1,
-                warningCount: 0
-            }];
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.mock().never();
+
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+                    "./shared/logging": log
+                });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.mock().withExactArgs(report);
+                const exitCode = await localCLI.execute("--fix-dry-run .", null, useFlatConfig);
+
+                assert.strictEqual(exitCode, 0);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
             });
 
-            const exitCode = await localCLI.execute("--fix .");
+            it(`should pass fixTypes to ESLint when --fix-type is passed with configType:${configType}`, async () => {
 
-            assert.strictEqual(exitCode, 1);
+                const expectedESLintOptions = {
+                    fix: true,
+                    fixTypes: ["suggestion"]
+                };
 
-        });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match(expectedESLintOptions));
 
-        it("should provide fix predicate and rewrite files when in fix mode and quiet mode", async () => {
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.stub();
 
-            const report = [{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 1,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 0,
-                warningCount: 1
-            }];
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: sinon.match.func }));
+                    "./shared/logging": log
+                });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.getErrorResults = sinon.stub().returns([]);
-            fakeESLint.outputFixes = sinon.mock().withExactArgs(report);
+                const exitCode = await localCLI.execute("--fix-dry-run --fix-type suggestion .", null, useFlatConfig);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.strictEqual(exitCode, 0);
             });
 
-            const exitCode = await localCLI.execute("--fix --quiet .");
+            it(`should not rewrite files when in fix-dry-run mode with configType:${configType}`, async () => {
 
-            assert.strictEqual(exitCode, 0);
+                const report = [{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 2,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 1,
+                    warningCount: 0
+                }];
 
-        });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.mock().never();
+
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-        it("should not call ESLint and return 2 when executing on text", async () => {
+                    "./shared/logging": log
+                });
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().never();
+                const exitCode = await localCLI.execute("--fix-dry-run .", null, useFlatConfig);
+
+                assert.strictEqual(exitCode, 1);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
             });
 
-            const exitCode = await localCLI.execute("--fix .", "foo = bar;");
+            it(`should provide fix predicate when in fix-dry-run mode and quiet mode with configType:${configType}`, async () => {
 
-            assert.strictEqual(exitCode, 2);
-        });
+                const report = [{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 1,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 0,
+                    warningCount: 1
+                }];
 
-    });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: sinon.match.func }));
 
-    describe("when passed --fix-dry-run", () => {
-        let localCLI;
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.getErrorResults = sinon.stub().returns([]);
+                fakeESLint.outputFixes = sinon.mock().never();
 
-        afterEach(() => {
-            sinon.verifyAndRestore();
-        });
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-        it("should pass fix:true to ESLint when executing on files", async () => {
+                    "./shared/logging": log
+                });
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+                const exitCode = await localCLI.execute("--fix-dry-run --quiet .", null, useFlatConfig);
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.mock().never();
+                assert.strictEqual(exitCode, 0);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
             });
 
-            const exitCode = await localCLI.execute("--fix-dry-run .");
+            it(`should allow executing on text with configType:${configType}`, async () => {
 
-            assert.strictEqual(exitCode, 0);
+                const report = [{
+                    filePath: "./foo.js",
+                    output: "bar",
+                    messages: [
+                        {
+                            severity: 2,
+                            message: "Fake message"
+                        }
+                    ],
+                    errorCount: 1,
+                    warningCount: 0
+                }];
 
-        });
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
 
-        it("should pass fixTypes to ESLint when --fix-type is passed", async () => {
+                Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
+                sinon.stub(fakeESLint.prototype, "lintText").returns(report);
+                sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
+                fakeESLint.outputFixes = sinon.mock().never();
 
-            const expectedESLintOptions = {
-                fix: true,
-                fixTypes: ["suggestion"]
-            };
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match(expectedESLintOptions));
+                    "./shared/logging": log
+                });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns([]);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.stub();
+                const exitCode = await localCLI.execute("--fix-dry-run .", "foo = bar;", useFlatConfig);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.strictEqual(exitCode, 1);
             });
 
-            const exitCode = await localCLI.execute("--fix-dry-run --fix-type suggestion .");
+            it(`should not call ESLint and return 2 when used with --fix with configType:${configType}`, async () => {
+
+                // create a fake ESLint class to test with
+                const fakeESLint = sinon.mock().never();
+
+                localCLI = proxyquire("../../lib/cli", {
+                    "./eslint": { ESLint: fakeESLint },
+                    "./eslint/flat-eslint": { ESLint: fakeESLint, findFlatConfigFile: () => null },
+
+                    "./shared/logging": log
+                });
 
-            assert.strictEqual(exitCode, 0);
+                const exitCode = await localCLI.execute("--fix --fix-dry-run .", "foo = bar;", useFlatConfig);
+
+                assert.strictEqual(exitCode, 2);
+            });
         });
 
-        it("should not rewrite files when in fix-dry-run mode", async () => {
+        describe("when passing --print-config", () => {
+            it(`should print out the configuration with configType:${configType}`, async () => {
+                const filePath = getFixturePath("xxxx");
 
-            const report = [{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 2,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 1,
-                warningCount: 0
-            }];
+                const exitCode = await cli.execute(`--print-config ${filePath}`, null, useFlatConfig);
+
+                assert.isTrue(log.info.calledOnce);
+                assert.strictEqual(exitCode, 0);
+            });
+
+            it(`should error if any positional file arguments are passed with configType:${configType}`, async () => {
+                const filePath1 = getFixturePath("files", "bar.js");
+                const filePath2 = getFixturePath("files", "foo.js");
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+                const exitCode = await cli.execute(`--print-config ${filePath1} ${filePath2}`, null, useFlatConfig);
+
+                assert.isTrue(log.info.notCalled);
+                assert.isTrue(log.error.calledOnce);
+                assert.strictEqual(exitCode, 2);
+            });
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.mock().never();
+            it(`should error out when executing on text with configType:${configType}`, async () => {
+                const exitCode = await cli.execute("--print-config=myFile.js", "foo = bar;", useFlatConfig);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.isTrue(log.info.notCalled);
+                assert.isTrue(log.error.calledOnce);
+                assert.strictEqual(exitCode, 2);
             });
+        });
+
+        // ---------
+    });
 
-            const exitCode = await localCLI.execute("--fix-dry-run .");
 
-            assert.strictEqual(exitCode, 1);
+    describe("when given a config file", () => {
+        it("should load the specified config file", async () => {
+            const configPath = getFixturePath(".eslintrc");
+            const filePath = getFixturePath("passing.js");
 
+            await cli.execute(`--config ${configPath} ${filePath}`);
         });
+    });
 
-        it("should provide fix predicate when in fix-dry-run mode and quiet mode", async () => {
 
-            const report = [{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 1,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 0,
-                warningCount: 1
-            }];
+    describe("eslintrc Only", () => {
+
+        describe("Environments", () => {
+
+            describe("when given a config with environment set to browser", () => {
+                it("should execute without any errors", async () => {
+                    const configPath = getFixturePath("configurations", "env-browser.json");
+                    const filePath = getFixturePath("globals-browser.js");
+                    const code = `--config ${configPath} ${filePath}`;
+
+                    const exit = await cli.execute(code);
+
+                    assert.strictEqual(exit, 0);
+                });
+            });
+
+            describe("when given a config with environment set to Node.js", () => {
+                it("should execute without any errors", async () => {
+                    const configPath = getFixturePath("configurations", "env-node.json");
+                    const filePath = getFixturePath("globals-node.js");
+                    const code = `--config ${configPath} ${filePath}`;
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: sinon.match.func }));
+                    const exit = await cli.execute(code);
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintFiles").returns(report);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.getErrorResults = sinon.stub().returns([]);
-            fakeESLint.outputFixes = sinon.mock().never();
+                    assert.strictEqual(exit, 0);
+                });
+            });
+
+            describe("when given a config with environment set to Nashorn", () => {
+                it("should execute without any errors", async () => {
+                    const configPath = getFixturePath("configurations", "env-nashorn.json");
+                    const filePath = getFixturePath("globals-nashorn.js");
+                    const code = `--config ${configPath} ${filePath}`;
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                    const exit = await cli.execute(code);
+
+                    assert.strictEqual(exit, 0);
+                });
             });
 
-            const exitCode = await localCLI.execute("--fix-dry-run --quiet .");
+            describe("when given a config with environment set to WebExtensions", () => {
+                it("should execute without any errors", async () => {
+                    const configPath = getFixturePath("configurations", "env-webextensions.json");
+                    const filePath = getFixturePath("globals-webextensions.js");
+                    const code = `--config ${configPath} ${filePath}`;
 
-            assert.strictEqual(exitCode, 0);
+                    const exit = await cli.execute(code);
 
+                    assert.strictEqual(exit, 0);
+                });
+            });
         });
 
-        it("should allow executing on text", async () => {
+        describe("when loading a custom rule", () => {
+            it("should return an error when rule isn't found", async () => {
+                const rulesPath = getFixturePath("rules", "wrong");
+                const configPath = getFixturePath("rules", "eslint.json");
+                const filePath = getFixturePath("rules", "test", "test-custom-rule.js");
+                const code = `--rulesdir ${rulesPath} --config ${configPath} --no-ignore ${filePath}`;
 
-            const report = [{
-                filePath: "./foo.js",
-                output: "bar",
-                messages: [
-                    {
-                        severity: 2,
-                        message: "Fake message"
-                    }
-                ],
-                errorCount: 1,
-                warningCount: 0
-            }];
+                await stdAssert.rejects(async () => {
+                    const exit = await cli.execute(code);
+
+                    assert.strictEqual(exit, 2);
+                }, /Error while loading rule 'custom-rule': Boom!/u);
+            });
+
+            it("should return a warning when rule is matched", async () => {
+                const rulesPath = getFixturePath("rules");
+                const configPath = getFixturePath("rules", "eslint.json");
+                const filePath = getFixturePath("rules", "test", "test-custom-rule.js");
+                const code = `--rulesdir ${rulesPath} --config ${configPath} --no-ignore ${filePath}`;
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().withExactArgs(sinon.match({ fix: true }));
+                await cli.execute(code);
 
-            Object.defineProperties(fakeESLint.prototype, Object.getOwnPropertyDescriptors(ESLint.prototype));
-            sinon.stub(fakeESLint.prototype, "lintText").returns(report);
-            sinon.stub(fakeESLint.prototype, "loadFormatter").returns({ format: () => "done" });
-            fakeESLint.outputFixes = sinon.mock().never();
+                assert.isTrue(log.info.calledOnce);
+                assert.isTrue(log.info.neverCalledWith(""));
+            });
+
+            it("should return warnings from multiple rules in different directories", async () => {
+                const rulesPath = getFixturePath("rules", "dir1");
+                const rulesPath2 = getFixturePath("rules", "dir2");
+                const configPath = getFixturePath("rules", "multi-rulesdirs.json");
+                const filePath = getFixturePath("rules", "test-multi-rulesdirs.js");
+                const code = `--rulesdir ${rulesPath} --rulesdir ${rulesPath2} --config ${configPath} --no-ignore ${filePath}`;
+                const exit = await cli.execute(code);
+
+                const call = log.info.getCall(0);
 
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.isTrue(log.info.calledOnce);
+                assert.isTrue(call.args[0].includes("String!"));
+                assert.isTrue(call.args[0].includes("Literal!"));
+                assert.isTrue(call.args[0].includes("2 problems"));
+                assert.isTrue(log.info.neverCalledWith(""));
+                assert.strictEqual(exit, 1);
             });
 
-            const exitCode = await localCLI.execute("--fix-dry-run .", "foo = bar;");
 
-            assert.strictEqual(exitCode, 1);
         });
 
-        it("should not call ESLint and return 2 when used with --fix", async () => {
+        describe("when executing with no-eslintrc flag", () => {
+            it("should ignore a local config file", async () => {
+                const filePath = getFixturePath("eslintrc", "quotes.js");
+                const exit = await cli.execute(`--no-eslintrc --no-ignore ${filePath}`);
 
-            // create a fake ESLint class to test with
-            const fakeESLint = sinon.mock().never();
-
-            localCLI = proxyquire("../../lib/cli", {
-                "./eslint": { ESLint: fakeESLint },
-                "./shared/logging": log
+                assert.isTrue(log.info.notCalled);
+                assert.strictEqual(exit, 0);
             });
+        });
 
-            const exitCode = await localCLI.execute("--fix --fix-dry-run .", "foo = bar;");
+        describe("when executing without no-eslintrc flag", () => {
+            it("should load a local config file", async () => {
+                const filePath = getFixturePath("eslintrc", "quotes.js");
+                const exit = await cli.execute(`--no-ignore ${filePath}`);
 
-            assert.strictEqual(exitCode, 2);
+                assert.isTrue(log.info.calledOnce);
+                assert.strictEqual(exit, 1);
+            });
         });
-    });
 
-    describe("when passing --print-config", () => {
-        it("should print out the configuration", async () => {
-            const filePath = getFixturePath("xxxx");
+        describe("when executing without env flag", () => {
+            it("should not define environment-specific globals", async () => {
+                const files = [
+                    getFixturePath("globals-browser.js"),
+                    getFixturePath("globals-node.js")
+                ];
 
-            const exitCode = await cli.execute(`--print-config ${filePath}`);
+                await cli.execute(`--no-eslintrc --config ./conf/eslint-recommended.js --no-ignore ${files.join(" ")}`);
 
-            assert.isTrue(log.info.calledOnce);
-            assert.strictEqual(exitCode, 0);
+                assert.strictEqual(log.info.args[0][0].split("\n").length, 10);
+            });
         });
 
-        it("should error if any positional file arguments are passed", async () => {
-            const filePath1 = getFixturePath("files", "bar.js");
-            const filePath2 = getFixturePath("files", "foo.js");
 
-            const exitCode = await cli.execute(`--print-config ${filePath1} ${filePath2}`);
+        describe("when supplied with a plugin", () => {
+            it("should pass plugins to ESLint", async () => {
+                const examplePluginName = "eslint-plugin-example";
+
+                await verifyESLintOpts(`--no-ignore --plugin ${examplePluginName} foo.js`, {
+                    overrideConfig: {
+                        plugins: [examplePluginName]
+                    }
+                });
+            });
 
-            assert.isTrue(log.info.notCalled);
-            assert.isTrue(log.error.calledOnce);
-            assert.strictEqual(exitCode, 2);
         });
 
-        it("should error out when executing on text", async () => {
-            const exitCode = await cli.execute("--print-config=myFile.js", "foo = bar;");
+        describe("when supplied with a plugin-loading path", () => {
+            it("should pass the option to ESLint", async () => {
+                const examplePluginDirPath = "foo/bar";
 
-            assert.isTrue(log.info.notCalled);
-            assert.isTrue(log.error.calledOnce);
-            assert.strictEqual(exitCode, 2);
+                await verifyESLintOpts(`--resolve-plugins-relative-to ${examplePluginDirPath} foo.js`, {
+                    resolvePluginsRelativeTo: examplePluginDirPath
+                });
+            });
         });
+
+
     });
 
+
 });
index 64cad9409cf5b6700167ecdec7083bd14cdd24e1..675257ee8ec80ecb54f41b96911360e9955003f9 100644 (file)
@@ -13,12 +13,14 @@ const { FlatConfigArray } = require("../../../lib/config/flat-config-array");
 const assert = require("chai").assert;
 const allConfig = require("../../../conf/eslint-all");
 const recommendedConfig = require("../../../conf/eslint-recommended");
+const stringify = require("json-stable-stringify-without-jsonify");
 
 //-----------------------------------------------------------------------------
 // Helpers
 //-----------------------------------------------------------------------------
 
 const baseConfig = {
+    files: ["**/*.js"],
     plugins: {
         "@": {
             rules: {
@@ -77,7 +79,6 @@ const baseConfig = {
  */
 function createFlatConfigArray(configs) {
     return new FlatConfigArray(configs, {
-        basePath: __dirname,
         baseConfig: [baseConfig]
     });
 }
@@ -143,8 +144,26 @@ function normalizeRuleConfig(rulesConfig) {
 
 describe("FlatConfigArray", () => {
 
+    it("should allow noniterable baseConfig objects", () => {
+        const base = {
+            languageOptions: {
+                parserOptions: {
+                    foo: true
+                }
+            }
+        };
+
+        const configs = new FlatConfigArray([], {
+            baseConfig: base
+        });
+
+        // should not throw error
+        configs.normalizeSync();
+    });
+
     it("should not reuse languageOptions.parserOptions across configs", () => {
         const base = [{
+            files: ["**/*.js"],
             languageOptions: {
                 parserOptions: {
                     foo: true
@@ -153,7 +172,6 @@ describe("FlatConfigArray", () => {
         }];
 
         const configs = new FlatConfigArray([], {
-            basePath: __dirname,
             baseConfig: base
         });
 
@@ -165,10 +183,81 @@ describe("FlatConfigArray", () => {
         assert.notStrictEqual(base[0].languageOptions.parserOptions, config.languageOptions.parserOptions, "parserOptions should be new object");
     });
 
+    describe("Serialization of configs", () => {
+        it("should convert config into normalized JSON object", () => {
+
+            const configs = new FlatConfigArray([{
+                plugins: {
+                    a: {},
+                    b: {}
+                }
+            }]);
+
+            configs.normalizeSync();
+
+            const config = configs.getConfig("foo.js");
+            const expected = {
+                plugins: ["@", "a", "b"],
+                languageOptions: {
+                    ecmaVersion: "latest",
+                    sourceType: "module",
+                    parser: "@/espree",
+                    parserOptions: {}
+                },
+                processor: void 0
+            };
+            const actual = config.toJSON();
+
+            assert.deepStrictEqual(actual, expected);
+
+            assert.strictEqual(stringify(actual), stringify(expected));
+        });
+
+        it("should throw an error when config with parser object is normalized", () => {
+
+            const configs = new FlatConfigArray([{
+                languageOptions: {
+                    parser: {
+                        parse() { /* empty */ }
+                    }
+                }
+            }]);
+
+            configs.normalizeSync();
+
+            const config = configs.getConfig("foo.js");
+
+            assert.throws(() => {
+                config.toJSON();
+            }, /Caching is not supported/u);
+
+        });
+
+        it("should throw an error when config with processor object is normalized", () => {
+
+            const configs = new FlatConfigArray([{
+                processor: {
+                    preprocess() { /* empty */ },
+                    postprocess() { /* empty */ }
+                }
+            }]);
+
+            configs.normalizeSync();
+
+            const config = configs.getConfig("foo.js");
+
+            assert.throws(() => {
+                config.toJSON();
+            }, /Caching is not supported/u);
+
+        });
+
+
+    });
 
     describe("Special configs", () => {
         it("eslint:recommended is replaced with an actual config", async () => {
-            const configs = new FlatConfigArray(["eslint:recommended"], { basePath: __dirname });
+            const configs = new FlatConfigArray(["eslint:recommended"]);
 
             await configs.normalize();
             const config = configs.getConfig("foo.js");
@@ -177,7 +266,7 @@ describe("FlatConfigArray", () => {
         });
 
         it("eslint:all is replaced with an actual config", async () => {
-            const configs = new FlatConfigArray(["eslint:all"], { basePath: __dirname });
+            const configs = new FlatConfigArray(["eslint:all"]);
 
             await configs.normalize();
             const config = configs.getConfig("foo.js");
@@ -1442,7 +1531,7 @@ describe("FlatConfigArray", () => {
                 },
                 {
                     plugins: {
-                        "foo/baz/boom": {
+                        "@foo/baz/boom": {
                             rules: {
                                 bang: {}
                             }
@@ -1451,13 +1540,13 @@ describe("FlatConfigArray", () => {
                     rules: {
                         foo: ["error"],
                         bar: 0,
-                        "foo/baz/boom/bang": "error"
+                        "@foo/baz/boom/bang": "error"
                     }
                 }
             ], {
                 plugins: {
                     ...baseConfig.plugins,
-                    "foo/baz/boom": {
+                    "@foo/baz/boom": {
                         rules: {
                             bang: {}
                         }
@@ -1466,7 +1555,7 @@ describe("FlatConfigArray", () => {
                 rules: {
                     foo: [2, "always"],
                     bar: [0],
-                    "foo/baz/boom/bang": [2]
+                    "@foo/baz/boom/bang": [2]
                 }
             }));
 
diff --git a/eslint/tests/lib/config/flat-config-helpers.js b/eslint/tests/lib/config/flat-config-helpers.js
new file mode 100644 (file)
index 0000000..004fb82
--- /dev/null
@@ -0,0 +1,102 @@
+/**
+ * @fileoverview Tests for FlatConfigArray
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const {
+    parseRuleId,
+    getRuleFromConfig
+} = require("../../../lib/config/flat-config-helpers");
+const assert = require("chai").assert;
+
+//-----------------------------------------------------------------------------
+// Tests
+//-----------------------------------------------------------------------------
+
+describe("Config Helpers", () => {
+
+
+    describe("parseRuleId()", () => {
+
+        it("should return plugin name and rule name for core rule", () => {
+            const result = parseRuleId("foo");
+
+            assert.deepStrictEqual(result, {
+                pluginName: "@",
+                ruleName: "foo"
+            });
+        });
+
+        it("should return plugin name and rule name with a/b format", () => {
+            const result = parseRuleId("test/foo");
+
+            assert.deepStrictEqual(result, {
+                pluginName: "test",
+                ruleName: "foo"
+            });
+        });
+
+        it("should return plugin name and rule name with a/b/c format", () => {
+            const result = parseRuleId("node/no-unsupported-features/es-builtins");
+
+            assert.deepStrictEqual(result, {
+                pluginName: "node",
+                ruleName: "no-unsupported-features/es-builtins"
+            });
+        });
+
+        it("should return plugin name and rule name with @a/b/c format", () => {
+            const result = parseRuleId("@test/foo/bar");
+
+            assert.deepStrictEqual(result, {
+                pluginName: "@test/foo",
+                ruleName: "bar"
+            });
+        });
+    });
+
+    describe("getRuleFromConfig", () => {
+        it("should retrieve rule from plugin in config", () => {
+            const rule = {};
+            const config = {
+                plugins: {
+                    test: {
+                        rules: {
+                            one: rule
+                        }
+                    }
+                }
+            };
+
+            const result = getRuleFromConfig("test/one", config);
+
+            assert.strictEqual(result, rule);
+
+        });
+
+        it("should retrieve rule from core in config", () => {
+            const rule = {};
+            const config = {
+                plugins: {
+                    "@": {
+                        rules: {
+                            semi: rule
+                        }
+                    }
+                }
+            };
+
+            const result = getRuleFromConfig("semi", config);
+
+            assert.strictEqual(result, rule);
+
+        });
+    });
+
+});
diff --git a/eslint/tests/lib/eslint/eslint.config.js b/eslint/tests/lib/eslint/eslint.config.js
new file mode 100644 (file)
index 0000000..6b389dc
--- /dev/null
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = {
+    rules: {
+        quotes: 2,
+        "no-var": 2,
+        "eol-last": 2,
+        strict: 2,
+        "no-unused-vars": 2
+    }
+};
index 4e140f7fe0fd25d0aceccdb99a71d803e1fd4086..74f26cfa8968e38517c1a10cdd4e876747cf6fe8 100644 (file)
@@ -27,6 +27,7 @@ const {
 const hash = require("../../../lib/cli-engine/hash");
 const { unIndent, createCustomTeardown } = require("../../_utils");
 const coreRules = require("../../../lib/rules");
+const childProcess = require("child_process");
 
 //------------------------------------------------------------------------------
 // Tests
@@ -324,6 +325,7 @@ describe("ESLint", () => {
             assert.strictEqual(results[0].messages[0].output, void 0);
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
             assert.strictEqual(results[0].fixableErrorCount, 0);
             assert.strictEqual(results[0].fixableWarningCount, 0);
             assert.strictEqual(results[0].usedDeprecatedRules.length, 0);
@@ -399,6 +401,7 @@ describe("ESLint", () => {
                 {
                     filePath: getFixturePath("passing.js"),
                     messages: [],
+                    suppressedMessages: [],
                     errorCount: 0,
                     warningCount: 0,
                     fatalErrorCount: 0,
@@ -410,6 +413,55 @@ describe("ESLint", () => {
             ]);
         });
 
+        it("should use eslint:recommended rules when eslint:recommended configuration is specified", async () => {
+            eslint = new ESLint({
+                useEslintrc: false,
+                overrideConfig: {
+                    extends: ["eslint:recommended"]
+                },
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "file.js" };
+            const results = await eslint.lintText("foo ()", options);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 1);
+            assert.strictEqual(results[0].messages[0].ruleId, "no-undef");
+            assert.strictEqual(results[0].messages[0].severity, 2);
+        });
+
+        it("should use eslint:all rules when eslint:all configuration is specified", async () => {
+            eslint = new ESLint({
+                useEslintrc: false,
+                overrideConfig: {
+                    extends: ["eslint:all"]
+                },
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "file.js" };
+            const results = await eslint.lintText("foo ()", options);
+
+            assert.strictEqual(results.length, 1);
+
+            const { messages } = results[0];
+
+            // Some rules that should report errors in the given code. Not all, as we don't want to update this test when we add new rules.
+            const expectedRules = ["no-undef", "semi", "func-call-spacing"];
+
+            expectedRules.forEach(ruleId => {
+                const messageFromRule = messages.find(message => message.ruleId === ruleId);
+
+                assert.ok(
+                    typeof messageFromRule === "object" && messageFromRule !== null, // LintMessage object
+                    `Expected a message from rule '${ruleId}'`
+                );
+                assert.strictEqual(messageFromRule.severity, 2);
+            });
+
+        });
+
         it("correctly autofixes semicolon-conflicting-fixes", async () => {
             eslint = new ESLint({
                 cwd: path.join(fixtureDir, ".."),
@@ -600,6 +652,7 @@ describe("ESLint", () => {
                             nodeType: "Identifier"
                         }
                     ],
+                    suppressedMessages: [],
                     errorCount: 1,
                     warningCount: 0,
                     fatalErrorCount: 0,
@@ -640,6 +693,7 @@ describe("ESLint", () => {
                             column: 19
                         }
                     ],
+                    suppressedMessages: [],
                     errorCount: 1,
                     warningCount: 0,
                     fatalErrorCount: 1,
@@ -679,6 +733,7 @@ describe("ESLint", () => {
                             column: 10
                         }
                     ],
+                    suppressedMessages: [],
                     errorCount: 1,
                     warningCount: 0,
                     fatalErrorCount: 1,
@@ -767,6 +822,7 @@ describe("ESLint", () => {
                             column: 19
                         }
                     ],
+                    suppressedMessages: [],
                     errorCount: 1,
                     warningCount: 0,
                     fatalErrorCount: 1,
@@ -1044,6 +1100,7 @@ describe("ESLint", () => {
             assert.strictEqual(results.length, 1);
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
             assert.strictEqual(results[0].fixableErrorCount, 0);
             assert.strictEqual(results[0].fixableWarningCount, 0);
             assert.strictEqual(results[0].messages[0].message, expectedMsg);
@@ -1105,6 +1162,7 @@ describe("ESLint", () => {
             assert.strictEqual(results.length, 1);
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
             assert.strictEqual(results[0].fixableErrorCount, 0);
             assert.strictEqual(results[0].fixableWarningCount, 0);
             assert.strictEqual(results[0].messages[0].message, expectedMsg);
@@ -1127,6 +1185,7 @@ describe("ESLint", () => {
             assert.strictEqual(results.length, 1);
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
             assert.strictEqual(results[0].fixableErrorCount, 0);
             assert.strictEqual(results[0].fixableWarningCount, 0);
             assert.strictEqual(results[0].messages[0].message, expectedMsg);
@@ -1387,6 +1446,21 @@ describe("ESLint", () => {
             }, /All files matched by '\.\/tests\/fixtures\/cli-engine\/' are ignored\./u);
         });
 
+        // https://github.com/eslint/eslint/issues/15642
+        it("should ignore files that are ignored by patterns with escaped brackets", async () => {
+            eslint = new ESLint({
+                ignorePath: getFixturePath("ignored-paths", ".eslintignoreWithEscapedBrackets"),
+                useEslintrc: false,
+                cwd: getFixturePath("ignored-paths")
+            });
+
+            // Only `brackets/index.js` should be linted. Other files in `brackets/` should be ignored.
+            const results = await eslint.lintFiles(["brackets/*.js"]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, getFixturePath("ignored-paths", "brackets", "index.js"));
+        });
+
         it("should throw an error when all given files are ignored via ignore-pattern", async () => {
             eslint = new ESLint({
                 overrideConfig: {
@@ -1413,6 +1487,7 @@ describe("ESLint", () => {
             assert.strictEqual(results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
             assert.strictEqual(results[0].fixableErrorCount, 0);
             assert.strictEqual(results[0].fixableWarningCount, 0);
         });
@@ -1681,6 +1756,7 @@ describe("ESLint", () => {
                     {
                         filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/multipass.js")),
                         messages: [],
+                        suppressedMessages: [],
                         errorCount: 0,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1692,6 +1768,7 @@ describe("ESLint", () => {
                     {
                         filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/ok.js")),
                         messages: [],
+                        suppressedMessages: [],
                         errorCount: 0,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1714,6 +1791,7 @@ describe("ESLint", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -1737,6 +1815,7 @@ describe("ESLint", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -4613,6 +4692,28 @@ describe("ESLint", () => {
 
                 assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "negation", "unignore.js")));
             });
+
+            // https://github.com/eslint/eslint/issues/15642
+            it("should correctly handle patterns with escaped brackets", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", ".eslintignoreWithEscapedBrackets");
+                const engine = new ESLint({ ignorePath, cwd });
+
+                const subdir = "brackets";
+
+                assert(
+                    !await engine.isPathIgnored(getFixturePath("ignored-paths", subdir, "index.js")),
+                    `'${subdir}/index.js' should not be ignored`
+                );
+
+                for (const filename of ["[index.js", "index].js", "[index].js"]) {
+                    assert(
+                        await engine.isPathIgnored(getFixturePath("ignored-paths", subdir, filename)),
+                        `'${subdir}/${filename}' should be ignored`
+                    );
+                }
+
+            });
         });
 
         describe("with --ignore-path option and --ignore-pattern option", () => {
@@ -4822,6 +4923,9 @@ describe("ESLint", () => {
             assert.strictEqual(results.length, 1);
             assert.strictEqual(results[0].errorCount, 0);
             assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
+            assert.strictEqual(results[0].fixableErrorCount, 0);
+            assert.strictEqual(results[0].fixableWarningCount, 0);
         });
 
         it("should return source code of file in the `source` property", async () => {
@@ -4886,6 +4990,22 @@ describe("ESLint", () => {
             assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
         });
 
+        it("should return one rule meta when there is a suppressed linting error", async () => {
+            const engine = new ESLint({
+                useEslintrc: false,
+                overrideConfig: {
+                    rules: {
+                        semi: 2
+                    }
+                }
+            });
+
+            const results = await engine.lintText("a // eslint-disable-line semi");
+            const rulesMeta = engine.getRulesMetaForResults(results);
+
+            assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
+        });
+
         it("should return multiple rule meta when there are multiple linting errors", async () => {
             const engine = new ESLint({
                 useEslintrc: false,
@@ -4905,16 +5025,16 @@ describe("ESLint", () => {
         });
 
         it("should return multiple rule meta when there are multiple linting errors from a plugin", async () => {
-            const nodePlugin = require("eslint-plugin-node");
+            const nodePlugin = require("eslint-plugin-n");
             const engine = new ESLint({
                 useEslintrc: false,
                 plugins: {
                     node: nodePlugin
                 },
                 overrideConfig: {
-                    plugins: ["node"],
+                    plugins: ["n"],
                     rules: {
-                        "node/no-new-require": 2,
+                        "n/no-new-require": 2,
                         semi: 2,
                         quotes: [2, "double"]
                     }
@@ -4927,7 +5047,7 @@ describe("ESLint", () => {
             assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
             assert.strictEqual(rulesMeta.quotes, coreRules.get("quotes").meta);
             assert.strictEqual(
-                rulesMeta["node/no-new-require"],
+                rulesMeta["n/no-new-require"],
                 nodePlugin.rules["no-new-require"].meta
             );
         });
@@ -5078,6 +5198,7 @@ describe("ESLint", () => {
                                 nodeType: null
                             }
                         ],
+                        suppressedMessages: [],
                         errorCount: 1,
                         warningCount: 0,
                         fatalErrorCount: 0,
@@ -5091,7 +5212,7 @@ describe("ESLint", () => {
         });
     });
 
-    describe("when retreiving version number", () => {
+    describe("when retrieving version number", () => {
         it("should return current version number", () => {
             const eslintCLI = require("../../../lib/eslint").ESLint;
             const version = eslintCLI.version;
@@ -6133,6 +6254,7 @@ describe("ESLint", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         source: "a == b",
                         usedDeprecatedRules: [],
                         warningCount: 0,
@@ -6158,6 +6280,7 @@ describe("ESLint", () => {
                         fixableErrorCount: 0,
                         fixableWarningCount: 0,
                         messages: [],
+                        suppressedMessages: [],
                         usedDeprecatedRules: [],
                         warningCount: 0,
                         fatalErrorCount: 0
@@ -6206,6 +6329,7 @@ describe("ESLint", () => {
                         fixableErrorCount: 0,
                         fixableWarningCount: 0,
                         messages: [],
+                        suppressedMessages: [],
                         usedDeprecatedRules: [],
                         warningCount: 0,
                         fatalErrorCount: 0
@@ -6242,6 +6366,7 @@ describe("ESLint", () => {
                                 severity: 2
                             }
                         ],
+                        suppressedMessages: [],
                         source: "a == b",
                         usedDeprecatedRules: [],
                         warningCount: 0,
@@ -6656,4 +6781,45 @@ describe("ESLint", () => {
             });
         });
     });
+
+    describe("loading rules", () => {
+        it("should not load unused core rules", done => {
+            let calledDone = false;
+
+            const cwd = getFixturePath("lazy-loading-rules");
+            const pattern = "foo.js";
+            const usedRules = ["semi"];
+
+            const forkedProcess = childProcess.fork(
+                path.join(__dirname, "../../_utils/test-lazy-loading-rules.js"),
+                [cwd, pattern, String(usedRules)]
+            );
+
+            // this is an error message
+            forkedProcess.on("message", ({ message, stack }) => {
+                if (calledDone) {
+                    return;
+                }
+                calledDone = true;
+
+                const error = new Error(message);
+
+                error.stack = stack;
+                done(error);
+            });
+
+            forkedProcess.on("exit", exitCode => {
+                if (calledDone) {
+                    return;
+                }
+                calledDone = true;
+
+                if (exitCode === 0) {
+                    done();
+                } else {
+                    done(new Error("Forked process exited with a non-zero exit code"));
+                }
+            });
+        });
+    });
 });
diff --git a/eslint/tests/lib/eslint/flat-eslint.js b/eslint/tests/lib/eslint/flat-eslint.js
new file mode 100644 (file)
index 0000000..c69cba4
--- /dev/null
@@ -0,0 +1,4746 @@
+/**
+ * @fileoverview Tests for the ESLint class.
+ * @author Kai Cataldo
+ * @author Toru Nagashima
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const assert = require("assert");
+const fs = require("fs");
+const fsp = fs.promises;
+const os = require("os");
+const path = require("path");
+const escapeStringRegExp = require("escape-string-regexp");
+const fCache = require("file-entry-cache");
+const sinon = require("sinon");
+const proxyquire = require("proxyquire").noCallThru().noPreserveCache();
+const shell = require("shelljs");
+const hash = require("../../../lib/cli-engine/hash");
+const { unIndent, createCustomTeardown } = require("../../_utils");
+const coreRules = require("../../../lib/rules");
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+describe("FlatESLint", () => {
+    const examplePluginName = "eslint-plugin-example";
+    const examplePluginNameWithNamespace = "@eslint/eslint-plugin-example";
+    const examplePlugin = {
+        rules: {
+            "example-rule": require("../../fixtures/rules/custom-rule"),
+            "make-syntax-error": require("../../fixtures/rules/make-syntax-error-rule")
+        }
+    };
+    const examplePreprocessorName = "eslint-plugin-processor";
+    const originalDir = process.cwd();
+    const fixtureDir = path.resolve(fs.realpathSync(os.tmpdir()), "eslint/fixtures");
+
+    /** @type {import("../../../lib/flat-eslint").FlatESLint} */
+    let FlatESLint;
+
+    /**
+     * Returns the path inside of the fixture directory.
+     * @param {...string} args file path segments.
+     * @returns {string} The path inside the fixture directory.
+     * @private
+     */
+    function getFixturePath(...args) {
+        const filepath = path.join(fixtureDir, ...args);
+
+        try {
+            return fs.realpathSync(filepath);
+        } catch {
+            return filepath;
+        }
+    }
+
+    /**
+     * Create the ESLint object by mocking some of the plugins
+     * @param {Object} options options for ESLint
+     * @returns {ESLint} engine object
+     * @private
+     */
+    function eslintWithPlugins(options) {
+        return new FlatESLint({
+            ...options,
+            plugins: {
+                [examplePluginName]: examplePlugin,
+                [examplePluginNameWithNamespace]: examplePlugin,
+                [examplePreprocessorName]: require("../../fixtures/processors/custom-processor")
+            }
+        });
+    }
+
+    // copy into clean area so as not to get "infected" by this project's .eslintrc files
+    before(function() {
+
+        /*
+         * GitHub Actions Windows and macOS runners occasionally exhibit
+         * extremely slow filesystem operations, during which copying fixtures
+         * exceeds the default test timeout, so raise it just for this hook.
+         * Mocha uses `this` to set timeouts on an individual hook level.
+         */
+        this.timeout(60 * 1000); // eslint-disable-line no-invalid-this -- Mocha API
+        shell.mkdir("-p", fixtureDir);
+        shell.cp("-r", "./tests/fixtures/.", fixtureDir);
+    });
+
+    beforeEach(() => {
+        ({ FlatESLint } = require("../../../lib/eslint/flat-eslint"));
+    });
+
+    after(() => {
+        shell.rm("-r", fixtureDir);
+    });
+
+    describe("ESLint constructor function", () => {
+        it("the default value of 'options.cwd' should be the current working directory.", async () => {
+            process.chdir(__dirname);
+            try {
+                const engine = new FlatESLint();
+                const results = await engine.lintFiles("eslint.js");
+
+                assert.strictEqual(path.dirname(results[0].filePath), __dirname);
+            } finally {
+                process.chdir(originalDir);
+            }
+        });
+
+        // https://github.com/eslint/eslint/issues/2380
+        it("should not modify baseConfig when format is specified", () => {
+            const customBaseConfig = { root: true };
+
+            new FlatESLint({ baseConfig: customBaseConfig }); // eslint-disable-line no-new -- Check for argument side effects
+
+            assert.deepStrictEqual(customBaseConfig, { root: true });
+        });
+
+        it("should throw readable messages if removed options are present", () => {
+            assert.throws(
+                () => new FlatESLint({
+                    cacheFile: "",
+                    configFile: "",
+                    envs: [],
+                    globals: [],
+                    ignorePattern: [],
+                    parser: "",
+                    parserOptions: {},
+                    rules: {},
+                    plugins: []
+                }),
+                new RegExp(escapeStringRegExp([
+                    "Invalid Options:",
+                    "- Unknown options: cacheFile, configFile, envs, globals, ignorePattern, parser, parserOptions, rules"
+                ].join("\n")), "u")
+            );
+        });
+
+        it("should throw readable messages if wrong type values are given to options", () => {
+            assert.throws(
+                () => new FlatESLint({
+                    allowInlineConfig: "",
+                    baseConfig: "",
+                    cache: "",
+                    cacheLocation: "",
+                    cwd: "foo",
+                    errorOnUnmatchedPattern: "",
+                    fix: "",
+                    fixTypes: ["xyz"],
+                    globInputPaths: "",
+                    ignore: "",
+                    ignorePath: "",
+                    overrideConfig: "",
+                    overrideConfigFile: "",
+                    plugins: "",
+                    reportUnusedDisableDirectives: ""
+                }),
+                new RegExp(escapeStringRegExp([
+                    "Invalid Options:",
+                    "- 'allowInlineConfig' must be a boolean.",
+                    "- 'baseConfig' must be an object or null.",
+                    "- 'cache' must be a boolean.",
+                    "- 'cacheLocation' must be a non-empty string.",
+                    "- 'cwd' must be an absolute path.",
+                    "- 'errorOnUnmatchedPattern' must be a boolean.",
+                    "- 'fix' must be a boolean or a function.",
+                    "- 'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\".",
+                    "- 'globInputPaths' must be a boolean.",
+                    "- 'ignore' must be a boolean.",
+                    "- 'ignorePath' must be a non-empty string or null.",
+                    "- 'overrideConfig' must be an object or null.",
+                    "- 'overrideConfigFile' must be a non-empty string, null, or true.",
+                    "- 'plugins' must be an object or null.",
+                    "- 'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."
+                ].join("\n")), "u")
+            );
+        });
+
+        it("should throw readable messages if 'plugins' option contains empty key", () => {
+            assert.throws(
+                () => new FlatESLint({
+                    plugins: {
+                        "eslint-plugin-foo": {},
+                        "eslint-plugin-bar": {},
+                        "": {}
+                    }
+                }),
+                new RegExp(escapeStringRegExp([
+                    "Invalid Options:",
+                    "- 'plugins' must not include an empty string."
+                ].join("\n")), "u")
+            );
+        });
+    });
+
+    describe("lintText()", () => {
+        let eslint;
+
+        it("should report the total and per file errors when using local cwd eslint.config.js", async () => {
+            eslint = new FlatESLint({
+                cwd: __dirname
+            });
+
+            const results = await eslint.lintText("var foo = 'bar';");
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 4);
+            assert.strictEqual(results[0].messages[0].ruleId, "no-var");
+            assert.strictEqual(results[0].messages[1].ruleId, "no-unused-vars");
+            assert.strictEqual(results[0].messages[2].ruleId, "quotes");
+            assert.strictEqual(results[0].messages[3].ruleId, "eol-last");
+            assert.strictEqual(results[0].fixableErrorCount, 3);
+            assert.strictEqual(results[0].fixableWarningCount, 0);
+            assert.strictEqual(results[0].usedDeprecatedRules.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report the total and per file warnings when using local cwd .eslintrc", async () => {
+            eslint = new FlatESLint({
+                overrideConfig: {
+                    rules: {
+                        quotes: 1,
+                        "no-var": 1,
+                        "eol-last": 1,
+                        "no-unused-vars": 1
+                    }
+                },
+                overrideConfigFile: true
+            });
+            const results = await eslint.lintText("var foo = 'bar';");
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 4);
+            assert.strictEqual(results[0].messages[0].ruleId, "no-var");
+            assert.strictEqual(results[0].messages[1].ruleId, "no-unused-vars");
+            assert.strictEqual(results[0].messages[2].ruleId, "quotes");
+            assert.strictEqual(results[0].messages[3].ruleId, "eol-last");
+            assert.strictEqual(results[0].fixableErrorCount, 0);
+            assert.strictEqual(results[0].fixableWarningCount, 3);
+            assert.strictEqual(results[0].usedDeprecatedRules.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report one message when using specific config file", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: "fixtures/configurations/quotes-error.js",
+                cwd: getFixturePath("..")
+            });
+            const results = await eslint.lintText("var foo = 'bar';");
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 1);
+            assert.strictEqual(results[0].messages[0].ruleId, "quotes");
+            assert.strictEqual(results[0].messages[0].output, void 0);
+            assert.strictEqual(results[0].errorCount, 1);
+            assert.strictEqual(results[0].fixableErrorCount, 1);
+            assert.strictEqual(results[0].warningCount, 0);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
+            assert.strictEqual(results[0].usedDeprecatedRules.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report the filename when passed in", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "test.js" };
+            const results = await eslint.lintText("var foo = 'bar';", options);
+
+            assert.strictEqual(results[0].filePath, getFixturePath("test.js"));
+        });
+
+        it("should return a warning when given a filename by --stdin-filename in excluded files list if warnIgnored is true", async () => {
+            eslint = new FlatESLint({
+                ignorePath: getFixturePath(".eslintignore"),
+                cwd: getFixturePath(".."),
+                overrideConfigFile: "fixtures/eslint.config.js"
+            });
+
+            const options = { filePath: "fixtures/passing.js", warnIgnored: true };
+            const results = await eslint.lintText("var bar = foo;", options);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, getFixturePath("passing.js"));
+            assert.strictEqual(results[0].messages[0].severity, 1);
+            assert.strictEqual(results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
+            assert.strictEqual(results[0].messages[0].output, void 0);
+            assert.strictEqual(results[0].errorCount, 0);
+            assert.strictEqual(results[0].warningCount, 1);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
+            assert.strictEqual(results[0].fixableErrorCount, 0);
+            assert.strictEqual(results[0].fixableWarningCount, 0);
+            assert.strictEqual(results[0].usedDeprecatedRules.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should not return a warning when given a filename by --stdin-filename in excluded files list if warnIgnored is false", async () => {
+            eslint = new FlatESLint({
+                ignorePath: getFixturePath(".eslintignore"),
+                cwd: getFixturePath(".."),
+                overrideConfigFile: "fixtures/eslint.config.js"
+            });
+            const options = {
+                filePath: "fixtures/passing.js",
+                warnIgnored: false
+            };
+
+            // intentional parsing error
+            const results = await eslint.lintText("va r bar = foo;", options);
+
+            // should not report anything because the file is ignored
+            assert.strictEqual(results.length, 0);
+        });
+
+        it("should suppress excluded file warnings by default", async () => {
+            eslint = new FlatESLint({
+                ignorePath: getFixturePath(".eslintignore"),
+                cwd: getFixturePath(".."),
+                overrideConfigFile: "fixtures/eslint.config.js"
+            });
+            const options = { filePath: "fixtures/passing.js" };
+            const results = await eslint.lintText("var bar = foo;", options);
+
+            // should not report anything because there are no errors
+            assert.strictEqual(results.length, 0);
+        });
+
+        it("should return a message when given a filename by --stdin-filename in excluded files list and ignore is off", async () => {
+            eslint = new FlatESLint({
+                ignorePath: "fixtures/.eslintignore",
+                cwd: getFixturePath(".."),
+                ignore: false,
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        "no-undef": 2
+                    }
+                }
+            });
+            const options = { filePath: "fixtures/passing.js" };
+            const results = await eslint.lintText("var bar = foo;", options);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, getFixturePath("passing.js"));
+            assert.strictEqual(results[0].messages[0].ruleId, "no-undef");
+            assert.strictEqual(results[0].messages[0].severity, 2);
+            assert.strictEqual(results[0].messages[0].output, void 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return a message and fixed text when in fix mode", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 2
+                    }
+                },
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "passing.js" };
+            const results = await eslint.lintText("var bar = foo", options);
+
+            assert.deepStrictEqual(results, [
+                {
+                    filePath: getFixturePath("passing.js"),
+                    messages: [],
+                    suppressedMessages: [],
+                    errorCount: 0,
+                    warningCount: 0,
+                    fatalErrorCount: 0,
+                    fixableErrorCount: 0,
+                    fixableWarningCount: 0,
+                    output: "var bar = foo;",
+                    usedDeprecatedRules: []
+                }
+            ]);
+        });
+
+        it("should return a message and omit fixed text when in fix mode and fixes aren't done", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        "no-undef": 2
+                    }
+                },
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "passing.js" };
+            const results = await eslint.lintText("var bar = foo", options);
+
+            assert.deepStrictEqual(results, [
+                {
+                    filePath: getFixturePath("passing.js"),
+                    messages: [
+                        {
+                            ruleId: "no-undef",
+                            severity: 2,
+                            messageId: "undef",
+                            message: "'foo' is not defined.",
+                            line: 1,
+                            column: 11,
+                            endLine: 1,
+                            endColumn: 14,
+                            nodeType: "Identifier"
+                        }
+                    ],
+                    suppressedMessages: [],
+                    errorCount: 1,
+                    warningCount: 0,
+                    fatalErrorCount: 0,
+                    fixableErrorCount: 0,
+                    fixableWarningCount: 0,
+                    source: "var bar = foo",
+                    usedDeprecatedRules: []
+                }
+            ]);
+        });
+
+        it("should not delete code if there is a syntax error after trying to autofix.", async () => {
+            eslint = eslintWithPlugins({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        "example/make-syntax-error": "error"
+                    }
+                },
+                ignore: false,
+                cwd: getFixturePath(".")
+            });
+            const options = { filePath: "test.js" };
+            const results = await eslint.lintText("var bar = foo", options);
+
+            assert.deepStrictEqual(results, [
+                {
+                    filePath: getFixturePath("test.js"),
+                    messages: [
+                        {
+                            ruleId: null,
+                            fatal: true,
+                            severity: 2,
+                            message: "Parsing error: Unexpected token is",
+                            line: 1,
+                            column: 19
+                        }
+                    ],
+                    suppressedMessages: [],
+                    errorCount: 1,
+                    warningCount: 0,
+                    fatalErrorCount: 1,
+                    fixableErrorCount: 0,
+                    fixableWarningCount: 0,
+                    output: "var bar = foothis is a syntax error.",
+                    usedDeprecatedRules: []
+                }
+            ]);
+        });
+
+        it("should not crash even if there are any syntax error since the first time.", async () => {
+            eslint = eslintWithPlugins({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        "example/make-syntax-error": "error"
+                    }
+                },
+                ignore: false,
+                cwd: getFixturePath()
+            });
+            const options = { filePath: "test.js" };
+            const results = await eslint.lintText("var bar =", options);
+
+            assert.deepStrictEqual(results, [
+                {
+                    filePath: getFixturePath("test.js"),
+                    messages: [
+                        {
+                            ruleId: null,
+                            fatal: true,
+                            severity: 2,
+                            message: "Parsing error: Unexpected token",
+                            line: 1,
+                            column: 10
+                        }
+                    ],
+                    suppressedMessages: [],
+                    errorCount: 1,
+                    warningCount: 0,
+                    fatalErrorCount: 1,
+                    fixableErrorCount: 0,
+                    fixableWarningCount: 0,
+                    source: "var bar =",
+                    usedDeprecatedRules: []
+                }
+            ]);
+        });
+
+        it("should return source code of file in `source` property when errors are present", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { semi: 2 }
+                }
+            });
+            const results = await eslint.lintText("var foo = 'bar'");
+
+            assert.strictEqual(results[0].source, "var foo = 'bar'");
+        });
+
+        it("should return source code of file in `source` property when warnings are present", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { semi: 1 }
+                }
+            });
+            const results = await eslint.lintText("var foo = 'bar'");
+
+            assert.strictEqual(results[0].source, "var foo = 'bar'");
+        });
+
+
+        it("should not return a `source` property when no errors or warnings are present", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { semi: 2 }
+                }
+            });
+            const results = await eslint.lintText("var foo = 'bar';");
+
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].source, void 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should not return a `source` property when fixes are applied", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 2,
+                        "no-unused-vars": 2
+                    }
+                }
+            });
+            const results = await eslint.lintText("var msg = 'hi' + foo\n");
+
+            assert.strictEqual(results[0].source, void 0);
+            assert.strictEqual(results[0].output, "var msg = 'hi' + foo;\n");
+        });
+
+        it("should return a `source` property when a parsing error has occurred", async () => {
+            eslint = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { semi: 2 }
+                }
+            });
+            const results = await eslint.lintText("var bar = foothis is a syntax error.\n return bar;");
+
+            assert.deepStrictEqual(results, [
+                {
+                    filePath: "<text>",
+                    messages: [
+                        {
+                            ruleId: null,
+                            fatal: true,
+                            severity: 2,
+                            message: "Parsing error: Unexpected token is",
+                            line: 1,
+                            column: 19
+                        }
+                    ],
+                    suppressedMessages: [],
+                    errorCount: 1,
+                    warningCount: 0,
+                    fatalErrorCount: 1,
+                    fixableErrorCount: 0,
+                    fixableWarningCount: 0,
+                    source: "var bar = foothis is a syntax error.\n return bar;",
+                    usedDeprecatedRules: []
+                }
+            ]);
+        });
+
+        // https://github.com/eslint/eslint/issues/5547
+        it("should respect default ignore rules (ignoring node_modules), even with --no-ignore", async () => {
+            eslint = new FlatESLint({
+                cwd: getFixturePath(),
+                ignore: false
+            });
+            const results = await eslint.lintText("var bar = foo;", { filePath: "node_modules/passing.js", warnIgnored: true });
+            const expectedMsg = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override.";
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, getFixturePath("node_modules/passing.js"));
+            assert.strictEqual(results[0].messages[0].message, expectedMsg);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should warn when deprecated rules are found in a config", async () => {
+            eslint = new FlatESLint({
+                cwd: originalDir,
+                overrideConfigFile: "tests/fixtures/cli-engine/deprecated-rule-config/eslint.config.js"
+            });
+            const [result] = await eslint.lintText("foo");
+
+            assert.deepStrictEqual(
+                result.usedDeprecatedRules,
+                [{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
+            );
+        });
+
+        it("should throw if non-string value is given to 'code' parameter", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintText(100), /'code' must be a string/u);
+        });
+
+        it("should throw if non-object value is given to 'options' parameter", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintText("var a = 0", "foo.js"), /'options' must be an object, null, or undefined/u);
+        });
+
+        it("should throw if 'options' argument contains unknown key", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintText("var a = 0", { filename: "foo.js" }), /'options' must not include the unknown option\(s\): filename/u);
+        });
+
+        it("should throw if non-string value is given to 'options.filePath' option", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintText("var a = 0", { filePath: "" }), /'options.filePath' must be a non-empty string or undefined/u);
+        });
+
+        it("should throw if non-boolean value is given to 'options.warnIgnored' option", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintText("var a = 0", { warnIgnored: "" }), /'options.warnIgnored' must be a boolean or undefined/u);
+        });
+    });
+
+    describe("lintFiles()", () => {
+
+        /** @type {InstanceType<import("../../../lib/eslint").ESLint>} */
+        let eslint;
+
+        it("should use correct parser when custom parser is specified", async () => {
+            const filePath = path.resolve(__dirname, "../../fixtures/configurations/parser/custom.js");
+
+            eslint = new FlatESLint({
+                cwd: originalDir,
+                ignore: false,
+                overrideConfigFile: true,
+                overrideConfig: {
+                    languageOptions: {
+                        parser: require(filePath)
+                    }
+                }
+            });
+
+            const results = await eslint.lintFiles([filePath]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 1);
+            assert.strictEqual(results[0].messages[0].message, "Parsing error: Boom!");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report zero messages when given a config file and a valid file", async () => {
+            eslint = new FlatESLint({
+                cwd: originalDir,
+                overrideConfigFile: "eslint.config.js"
+            });
+            const results = await eslint.lintFiles(["lib/**/cli*.js"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should handle multiple patterns with overlapping files", async () => {
+            eslint = new FlatESLint({
+                cwd: originalDir,
+                overrideConfigFile: "eslint.config.js"
+            });
+            const results = await eslint.lintFiles(["lib/**/cli*.js", "lib/cli.?s", "lib/{cli,cli-engine/cli-engine}.js"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report zero messages when given a config file and a valid file and espree as parser", async () => {
+            eslint = new FlatESLint({
+                overrideConfig: {
+                    languageOptions: {
+                        parser: require("espree"),
+                        parserOptions: {
+                            ecmaVersion: 2021
+                        }
+                    }
+                },
+                overrideConfigFile: true
+            });
+            const results = await eslint.lintFiles(["lib/cli.js"]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report zero messages when given a config file and a valid file and esprima as parser", async () => {
+            eslint = new FlatESLint({
+                overrideConfig: {
+                    languageOptions: {
+                        parser: require("esprima")
+                    }
+                },
+                overrideConfigFile: true,
+                ignore: false
+            });
+            const results = await eslint.lintFiles(["tests/fixtures/passing.js"]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should throw an error when given a config file and a valid file and invalid parser", async () => {
+            eslint = new FlatESLint({
+                overrideConfig: {
+                    languageOptions: {
+                        parser: "test11"
+                    }
+                },
+                overrideConfigFile: true
+            });
+
+            await assert.rejects(async () => await eslint.lintFiles(["lib/cli.js"]), /Expected string in the form "pluginName\/objectName" but found "test11"/u);
+        });
+
+        it("should report zero messages when given a directory with a .js2 file", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: getFixturePath("eslint.config.js"),
+                overrideConfig: {
+                    files: ["**/*.js2"]
+                }
+            });
+            const results = await eslint.lintFiles([getFixturePath("files/foo.js2")]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should report zero messages when given a directory with a .js and a .js2 file", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath(".."),
+                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                overrideConfigFile: getFixturePath("eslint.config.js")
+            });
+            const results = await eslint.lintFiles(["fixtures/files/"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        // https://github.com/eslint/eslint/issues/16260
+        describe("Globbing based on configs", () => {
+            it("should report zero messages when given a directory with a .js and config file specifying a subdirectory", async () => {
+                eslint = new FlatESLint({
+                    ignore: false,
+                    cwd: getFixturePath("shallow-glob")
+                });
+                const results = await eslint.lintFiles(["target-dir"]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should glob for .jsx file in a subdirectory of the passed-in directory and not glob for any other patterns", async () => {
+                eslint = new FlatESLint({
+                    ignore: false,
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        files: ["subdir/**/*.jsx", "target-dir/*.js"],
+                        languageOptions: {
+                            parserOptions: {
+                                jsx: true
+                            }
+                        }
+                    },
+                    cwd: getFixturePath("shallow-glob")
+                });
+                const results = await eslint.lintFiles(["subdir/subsubdir"]);
+
+                assert.strictEqual(results.length, 2);
+                assert.strictEqual(results[0].messages.length, 1);
+                assert(results[0].messages[0].fatal, "Fatal error expected.");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+                assert.strictEqual(results[1].messages.length, 0);
+                assert.strictEqual(results[1].suppressedMessages.length, 0);
+            });
+
+            it("should glob for all files in subdir when passed-in on the command line with a partial matching glob", async () => {
+                eslint = new FlatESLint({
+                    ignore: false,
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        files: ["s*/subsubdir/*.jsx", "target-dir/*.js"],
+                        languageOptions: {
+                            parserOptions: {
+                                jsx: true
+                            }
+                        }
+                    },
+                    cwd: getFixturePath("shallow-glob")
+                });
+                const results = await eslint.lintFiles(["subdir"]);
+
+                assert.strictEqual(results.length, 3);
+                assert.strictEqual(results[0].messages.length, 1);
+                assert(results[0].messages[0].fatal, "Fatal error expected.");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+                assert.strictEqual(results[1].messages.length, 1);
+                assert(results[0].messages[0].fatal, "Fatal error expected.");
+                assert.strictEqual(results[1].suppressedMessages.length, 0);
+                assert.strictEqual(results[2].messages.length, 0);
+                assert.strictEqual(results[2].suppressedMessages.length, 0);
+            });
+        });
+
+        it("should report zero messages when given a '**' pattern with a .js and a .js2 file", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                overrideConfigFile: getFixturePath("eslint.config.js")
+
+            });
+            const results = await eslint.lintFiles(["fixtures/files/*"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+            assert.strictEqual(results[1].suppressedMessages.length, 0);
+        });
+
+        it("should resolve globs when 'globInputPaths' option is true", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath(".."),
+                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                overrideConfigFile: getFixturePath("eslint.config.js")
+
+            });
+            const results = await eslint.lintFiles(["fixtures/files/*"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+            assert.strictEqual(results[1].suppressedMessages.length, 0);
+        });
+
+        // only works on a Windows machine
+        if (os.platform() === "win32") {
+
+            it("should resolve globs with Windows slashes when 'globInputPaths' option is true", async () => {
+                eslint = new FlatESLint({
+                    ignore: false,
+                    cwd: getFixturePath(".."),
+                    overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                    overrideConfigFile: getFixturePath("eslint.config.js")
+
+                });
+                const results = await eslint.lintFiles(["fixtures\\files\\*"]);
+
+                assert.strictEqual(results.length, 2);
+                assert.strictEqual(results[0].messages.length, 0);
+                assert.strictEqual(results[1].messages.length, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+                assert.strictEqual(results[1].suppressedMessages.length, 0);
+            });
+
+        }
+
+
+        it("should not resolve globs when 'globInputPaths' option is false", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath(".."),
+                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                overrideConfigFile: true,
+                globInputPaths: false
+            });
+
+            await assert.rejects(async () => {
+                await eslint.lintFiles(["fixtures/files/*"]);
+            }, /No files matching 'fixtures\/files\/\*' were found \(glob was disabled\)\./u);
+        });
+
+        describe("Ignoring Files", () => {
+
+            it("should report on all files passed explicitly, even if ignored by default", async () => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath("cli-engine")
+                });
+                const results = await eslint.lintFiles(["node_modules/foo.js"]);
+                const expectedMsg = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override.";
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].errorCount, 0);
+                assert.strictEqual(results[0].warningCount, 1);
+                assert.strictEqual(results[0].fatalErrorCount, 0);
+                assert.strictEqual(results[0].fixableErrorCount, 0);
+                assert.strictEqual(results[0].fixableWarningCount, 0);
+                assert.strictEqual(results[0].messages[0].message, expectedMsg);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should report on globs with explicit inclusion of dotfiles", async () => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath("cli-engine"),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: {
+                            quotes: [2, "single"]
+                        }
+                    }
+                });
+                const results = await eslint.lintFiles(["hidden/.hiddenfolder/*.js"]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].errorCount, 1);
+                assert.strictEqual(results[0].warningCount, 0);
+                assert.strictEqual(results[0].fatalErrorCount, 0);
+                assert.strictEqual(results[0].fixableErrorCount, 1);
+                assert.strictEqual(results[0].fixableWarningCount, 0);
+            });
+
+            it("should ignore node_modules files when using ignore file", async () => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath("cli-engine"),
+                    overrideConfigFile: true
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["node_modules"]);
+                }, /All files matched by 'node_modules\/\*\*\/\*.js' are ignored\./u);
+            });
+
+            // https://github.com/eslint/eslint/issues/5547
+            it("should ignore node_modules files even with ignore: false", async () => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath("cli-engine"),
+                    ignore: false
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["node_modules"]);
+                }, /All files matched by 'node_modules\/\*\*\/\*\.js' are ignored\./u);
+            });
+
+            it("should throw an error when given a directory with all eslint excluded files in the directory", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath(".eslintignore")
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles([getFixturePath("./cli-engine/")]);
+                }, /All files matched by '.*?cli-engine[\\/]\*\*[\\/]\*\.js' are ignored/u);
+            });
+
+            it("should throw an error when all given files are ignored", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath(".eslintignore")
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["tests/fixtures/cli-engine/"]);
+                }, /All files matched by 'tests\/fixtures\/cli-engine\/\*\*\/\*\.js' are ignored\./u);
+            });
+
+            it("should throw an error when all given files are ignored even with a `./` prefix", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath(".eslintignore")
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["./tests/fixtures/cli-engine/"]);
+                }, /All files matched by 'tests\/fixtures\/cli-engine\/\*\*\/\*\.js' are ignored\./u);
+            });
+
+            // https://github.com/eslint/eslint/issues/3788
+            it("should ignore one-level down node_modules when ignore file has 'node_modules/' in it", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath("cli-engine", "nested_node_modules", ".eslintignore"),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: {
+                            quotes: [2, "double"]
+                        }
+                    },
+                    cwd: getFixturePath("cli-engine", "nested_node_modules")
+                });
+                const results = await eslint.lintFiles(["."]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].errorCount, 0);
+                assert.strictEqual(results[0].warningCount, 0);
+                assert.strictEqual(results[0].fatalErrorCount, 0);
+                assert.strictEqual(results[0].fixableErrorCount, 0);
+                assert.strictEqual(results[0].fixableWarningCount, 0);
+            });
+
+            // https://github.com/eslint/eslint/issues/3812
+            it("should ignore all files and throw an error when fixtures/ is in ignore file", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath("cli-engine/.eslintignore2"),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: {
+                            quotes: [2, "double"]
+                        }
+                    }
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["./tests/fixtures/cli-engine/"]);
+                }, /All files matched by 'tests\/fixtures\/cli-engine\/\*\*\/\*\.js' are ignored\./u);
+            });
+
+            it("should throw an error when all given files are ignored via ignore-pattern", async () => {
+                eslint = new FlatESLint({
+                    overrideConfig: {
+                        ignorePatterns: "tests/fixtures/single-quoted.js"
+                    }
+                });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["tests/fixtures/*-quoted.js"]);
+                }, /All files matched by 'tests\/fixtures\/\*-quoted\.js' are ignored\./u);
+            });
+
+            it("should return a warning when an explicitly given file is ignored", async () => {
+                eslint = new FlatESLint({
+                    ignorePath: getFixturePath(".eslintignore"),
+                    cwd: getFixturePath()
+                });
+                const filePath = getFixturePath("passing.js");
+                const results = await eslint.lintFiles([filePath]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].filePath, filePath);
+                assert.strictEqual(results[0].messages[0].severity, 1);
+                assert.strictEqual(results[0].messages[0].message, "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override.");
+                assert.strictEqual(results[0].errorCount, 0);
+                assert.strictEqual(results[0].warningCount, 1);
+                assert.strictEqual(results[0].fatalErrorCount, 0);
+                assert.strictEqual(results[0].fixableErrorCount, 0);
+                assert.strictEqual(results[0].fixableWarningCount, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should return two messages when given a file in excluded files list while ignore is off", async () => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath(),
+                    ignorePath: getFixturePath(".eslintignore"),
+                    ignore: false,
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: {
+                            "no-undef": 2
+                        }
+                    }
+                });
+                const filePath = fs.realpathSync(getFixturePath("undef.js"));
+                const results = await eslint.lintFiles([filePath]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].filePath, filePath);
+                assert.strictEqual(results[0].messages[0].ruleId, "no-undef");
+                assert.strictEqual(results[0].messages[0].severity, 2);
+                assert.strictEqual(results[0].messages[1].ruleId, "no-undef");
+                assert.strictEqual(results[0].messages[1].severity, 2);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+        });
+
+
+        it("should report zero messages when given a pattern with a .js and a .js2 file", async () => {
+            eslint = new FlatESLint({
+                overrideConfig: { files: ["**/*.js", "**/*.js2"] },
+                ignore: false,
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true
+            });
+            const results = await eslint.lintFiles(["fixtures/files/*.?s*"]);
+
+            assert.strictEqual(results.length, 2);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[1].suppressedMessages.length, 0);
+        });
+
+        it("should return one error message when given a config with rules with options and severity level set to error", async () => {
+            eslint = new FlatESLint({
+                cwd: getFixturePath(),
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        quotes: ["error", "double"]
+                    }
+                },
+                ignore: false
+            });
+            const results = await eslint.lintFiles([getFixturePath("single-quoted.js")]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 1);
+            assert.strictEqual(results[0].messages[0].ruleId, "quotes");
+            assert.strictEqual(results[0].messages[0].severity, 2);
+            assert.strictEqual(results[0].errorCount, 1);
+            assert.strictEqual(results[0].warningCount, 0);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
+            assert.strictEqual(results[0].fixableErrorCount, 1);
+            assert.strictEqual(results[0].fixableWarningCount, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return 5 results when given a config and a directory of 5 valid files", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 1,
+                        strict: 0
+                    }
+                }
+            });
+
+            const formattersDir = getFixturePath("formatters");
+            const results = await eslint.lintFiles([formattersDir]);
+
+            assert.strictEqual(results.length, 5);
+            assert.strictEqual(path.relative(formattersDir, results[0].filePath), "async.js");
+            assert.strictEqual(results[0].errorCount, 0);
+            assert.strictEqual(results[0].warningCount, 0);
+            assert.strictEqual(results[0].fatalErrorCount, 0);
+            assert.strictEqual(results[0].fixableErrorCount, 0);
+            assert.strictEqual(results[0].fixableWarningCount, 0);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+            assert.strictEqual(path.relative(formattersDir, results[1].filePath), "broken.js");
+            assert.strictEqual(results[1].errorCount, 0);
+            assert.strictEqual(results[1].warningCount, 0);
+            assert.strictEqual(results[1].fatalErrorCount, 0);
+            assert.strictEqual(results[1].fixableErrorCount, 0);
+            assert.strictEqual(results[1].fixableWarningCount, 0);
+            assert.strictEqual(results[1].messages.length, 0);
+            assert.strictEqual(results[1].suppressedMessages.length, 0);
+            assert.strictEqual(path.relative(formattersDir, results[2].filePath), "cwd.js");
+            assert.strictEqual(results[2].errorCount, 0);
+            assert.strictEqual(results[2].warningCount, 0);
+            assert.strictEqual(results[2].fatalErrorCount, 0);
+            assert.strictEqual(results[2].fixableErrorCount, 0);
+            assert.strictEqual(results[2].fixableWarningCount, 0);
+            assert.strictEqual(results[2].messages.length, 0);
+            assert.strictEqual(results[2].suppressedMessages.length, 0);
+            assert.strictEqual(path.relative(formattersDir, results[3].filePath), "simple.js");
+            assert.strictEqual(results[3].errorCount, 0);
+            assert.strictEqual(results[3].warningCount, 0);
+            assert.strictEqual(results[3].fatalErrorCount, 0);
+            assert.strictEqual(results[3].fixableErrorCount, 0);
+            assert.strictEqual(results[3].fixableWarningCount, 0);
+            assert.strictEqual(results[3].messages.length, 0);
+            assert.strictEqual(results[3].suppressedMessages.length, 0);
+            assert.strictEqual(path.relative(formattersDir, results[4].filePath), path.join("test", "simple.js"));
+            assert.strictEqual(results[4].errorCount, 0);
+            assert.strictEqual(results[4].warningCount, 0);
+            assert.strictEqual(results[4].fatalErrorCount, 0);
+            assert.strictEqual(results[4].fixableErrorCount, 0);
+            assert.strictEqual(results[4].fixableWarningCount, 0);
+            assert.strictEqual(results[4].messages.length, 0);
+            assert.strictEqual(results[4].suppressedMessages.length, 0);
+        });
+
+        it("should return zero messages when given a config with browser globals", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: getFixturePath("configurations", "env-browser.js")
+            });
+            const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("globals-browser.js"))]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0, "Should have no messages.");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return zero messages when given an option to add browser globals", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                overrideConfig: {
+                    languageOptions: {
+                        globals: {
+                            window: false
+                        }
+                    },
+                    rules: {
+                        "no-alert": 0,
+                        "no-undef": 2
+                    }
+                }
+            });
+            const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("globals-browser.js"))]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return zero messages when given a config with sourceType set to commonjs and Node.js globals", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: getFixturePath("configurations", "env-node.js")
+            });
+            const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("globals-node.js"))]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0, "Should have no messages.");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should not return results from previous call when calling more than once", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: getFixturePath("eslint.config.js"),
+                ignore: false,
+                overrideConfig: {
+                    rules: {
+                        semi: 2
+                    }
+                }
+            });
+            const failFilePath = fs.realpathSync(getFixturePath("missing-semicolon.js"));
+            const passFilePath = fs.realpathSync(getFixturePath("passing.js"));
+
+            let results = await eslint.lintFiles([failFilePath]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, failFilePath);
+            assert.strictEqual(results[0].messages.length, 1);
+            assert.strictEqual(results[0].messages[0].ruleId, "semi");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+            assert.strictEqual(results[0].messages[0].severity, 2);
+
+            results = await eslint.lintFiles([passFilePath]);
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, passFilePath);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return zero messages when executing a file with a shebang", async () => {
+            eslint = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath(),
+                overrideConfigFile: getFixturePath("eslint.config.js")
+            });
+            const results = await eslint.lintFiles([getFixturePath("shebang.js")]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].messages.length, 0, "Should have lint messages.");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should return zero messages when executing without a config file", async () => {
+            eslint = new FlatESLint({
+                cwd: getFixturePath(),
+                ignore: false,
+                overrideConfigFile: true
+            });
+            const filePath = fs.realpathSync(getFixturePath("missing-semicolon.js"));
+            const results = await eslint.lintFiles([filePath]);
+
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].filePath, filePath);
+            assert.strictEqual(results[0].messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        // working
+        describe("Deprecated Rules", () => {
+
+            it("should warn when deprecated rules are configured", async () => {
+                eslint = new FlatESLint({
+                    cwd: originalDir,
+                    overrideConfig: {
+                        rules: {
+                            "indent-legacy": 1,
+                            "require-jsdoc": 1,
+                            "valid-jsdoc": 1
+                        }
+                    }
+                });
+                const results = await eslint.lintFiles(["lib/cli*.js"]);
+
+                assert.deepStrictEqual(
+                    results[0].usedDeprecatedRules,
+                    [
+                        { ruleId: "indent-legacy", replacedBy: ["indent"] },
+                        { ruleId: "require-jsdoc", replacedBy: [] },
+                        { ruleId: "valid-jsdoc", replacedBy: [] }
+                    ]
+                );
+            });
+
+            it("should not warn when deprecated rules are not configured", async () => {
+                eslint = new FlatESLint({
+                    cwd: originalDir,
+                    overrideConfig: {
+                        rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 }
+                    }
+                });
+                const results = await eslint.lintFiles(["lib/cli*.js"]);
+
+                assert.deepStrictEqual(results[0].usedDeprecatedRules, []);
+            });
+
+            it("should warn when deprecated rules are found in a config", async () => {
+                eslint = new FlatESLint({
+                    cwd: originalDir,
+                    overrideConfigFile: "tests/fixtures/cli-engine/deprecated-rule-config/eslint.config.js"
+                });
+                const results = await eslint.lintFiles(["lib/cli*.js"]);
+
+                assert.deepStrictEqual(
+                    results[0].usedDeprecatedRules,
+                    [{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
+                );
+            });
+        });
+
+        // working
+        describe("Fix Mode", () => {
+
+            it("correctly autofixes semicolon-conflicting-fixes", async () => {
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    fix: true
+                });
+                const inputPath = getFixturePath("autofix/semicolon-conflicting-fixes.js");
+                const outputPath = getFixturePath("autofix/semicolon-conflicting-fixes.expected.js");
+                const results = await eslint.lintFiles([inputPath]);
+                const expectedOutput = fs.readFileSync(outputPath, "utf8");
+
+                assert.strictEqual(results[0].output, expectedOutput);
+            });
+
+            it("correctly autofixes return-conflicting-fixes", async () => {
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    fix: true
+                });
+                const inputPath = getFixturePath("autofix/return-conflicting-fixes.js");
+                const outputPath = getFixturePath("autofix/return-conflicting-fixes.expected.js");
+                const results = await eslint.lintFiles([inputPath]);
+                const expectedOutput = fs.readFileSync(outputPath, "utf8");
+
+                assert.strictEqual(results[0].output, expectedOutput);
+            });
+
+            it("should return fixed text on multiple files when in fix mode", async () => {
+
+                /**
+                 * Converts CRLF to LF in output.
+                 * This is a workaround for git's autocrlf option on Windows.
+                 * @param {Object} result A result object to convert.
+                 * @returns {void}
+                 */
+                function convertCRLF(result) {
+                    if (result && result.output) {
+                        result.output = result.output.replace(/\r\n/gu, "\n");
+                    }
+                }
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    fix: true,
+                    overrideConfig: {
+                        rules: {
+                            semi: 2,
+                            quotes: [2, "double"],
+                            eqeqeq: 2,
+                            "no-undef": 2,
+                            "space-infix-ops": 2
+                        }
+                    }
+                });
+                const results = await eslint.lintFiles([path.resolve(fixtureDir, `${fixtureDir}/fixmode`)]);
+
+                results.forEach(convertCRLF);
+                assert.deepStrictEqual(results, [
+                    {
+                        filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/multipass.js")),
+                        messages: [],
+                        suppressedMessages: [],
+                        errorCount: 0,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        output: "true ? \"yes\" : \"no\";\n",
+                        usedDeprecatedRules: []
+                    },
+                    {
+                        filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/ok.js")),
+                        messages: [],
+                        suppressedMessages: [],
+                        errorCount: 0,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        usedDeprecatedRules: []
+                    },
+                    {
+                        filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes-semi-eqeqeq.js")),
+                        messages: [
+                            {
+                                column: 9,
+                                line: 2,
+                                endColumn: 11,
+                                endLine: 2,
+                                message: "Expected '===' and instead saw '=='.",
+                                messageId: "unexpected",
+                                nodeType: "BinaryExpression",
+                                ruleId: "eqeqeq",
+                                severity: 2
+                            }
+                        ],
+                        suppressedMessages: [],
+                        errorCount: 1,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        output: "var msg = \"hi\";\nif (msg == \"hi\") {\n\n}\n",
+                        usedDeprecatedRules: []
+                    },
+                    {
+                        filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes.js")),
+                        messages: [
+                            {
+                                column: 18,
+                                line: 1,
+                                endColumn: 21,
+                                endLine: 1,
+                                messageId: "undef",
+                                message: "'foo' is not defined.",
+                                nodeType: "Identifier",
+                                ruleId: "no-undef",
+                                severity: 2
+                            }
+                        ],
+                        suppressedMessages: [],
+                        errorCount: 1,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        output: "var msg = \"hi\" + foo;\n",
+                        usedDeprecatedRules: []
+                    }
+                ]);
+            });
+
+            // Cannot be run properly until cache is implemented
+            it("should run autofix even if files are cached without autofix results", async () => {
+                const baseOptions = {
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: {
+                            semi: 2,
+                            quotes: [2, "double"],
+                            eqeqeq: 2,
+                            "no-undef": 2,
+                            "space-infix-ops": 2
+                        }
+                    }
+                };
+
+                eslint = new FlatESLint(Object.assign({}, baseOptions, { cache: true, fix: false }));
+
+                // Do initial lint run and populate the cache file
+                await eslint.lintFiles([path.resolve(fixtureDir, `${fixtureDir}/fixmode`)]);
+
+                eslint = new FlatESLint(Object.assign({}, baseOptions, { cache: true, fix: true }));
+                const results = await eslint.lintFiles([path.resolve(fixtureDir, `${fixtureDir}/fixmode`)]);
+
+                assert(results.some(result => result.output));
+            });
+        });
+
+        describe("plugins", () => {
+            it("should return two messages when executing with config file that specifies a plugin", async () => {
+                eslint = eslintWithPlugins({
+                    cwd: path.resolve(fixtureDir, ".."),
+                    overrideConfigFile: getFixturePath("configurations", "plugins-with-prefix.js")
+                });
+                const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("rules", "test/test-custom-rule.js"))]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 2, "Expected two messages.");
+                assert.strictEqual(results[0].messages[0].ruleId, "example/example-rule");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should return two messages when executing with cli option that specifies a plugin", async () => {
+                eslint = eslintWithPlugins({
+                    cwd: path.resolve(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: { "example/example-rule": 1 }
+                    }
+                });
+                const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("rules", "test", "test-custom-rule.js"))]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 2);
+                assert.strictEqual(results[0].messages[0].ruleId, "example/example-rule");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should return two messages when executing with cli option that specifies preloaded plugin", async () => {
+                eslint = new FlatESLint({
+                    cwd: path.resolve(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        rules: { "test/example-rule": 1 }
+                    },
+                    plugins: {
+                        "eslint-plugin-test": { rules: { "example-rule": require("../../fixtures/rules/custom-rule") } }
+                    }
+                });
+                const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("rules", "test", "test-custom-rule.js"))]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 2);
+                assert.strictEqual(results[0].messages[0].ruleId, "test/example-rule");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+        });
+
+        describe("cache", () => {
+
+            /**
+             * helper method to delete a file without caring about exceptions
+             * @param {string} filePath The file path
+             * @returns {void}
+             */
+            function doDelete(filePath) {
+                try {
+                    fs.unlinkSync(filePath);
+                } catch {
+
+                    /*
+                     * we don't care if the file didn't exist, since our
+                     * intention was to remove the file
+                     */
+                }
+            }
+
+            /**
+             * helper method to delete the cache files created during testing
+             * @returns {void}
+             */
+            function deleteCache() {
+                doDelete(path.resolve(".eslintcache"));
+                doDelete(path.resolve(".cache/custom-cache"));
+            }
+
+            beforeEach(() => {
+                deleteCache();
+            });
+
+            afterEach(() => {
+                sinon.restore();
+                deleteCache();
+            });
+
+            describe("when the cacheFile is a directory or looks like a directory", () => {
+
+                /**
+                 * helper method to delete the cache files created during testing
+                 * @returns {void}
+                 */
+                function deleteCacheDir() {
+                    try {
+                        fs.unlinkSync("./tmp/.cacheFileDir/.cache_hashOfCurrentWorkingDirectory");
+                    } catch {
+
+                        /*
+                         * we don't care if the file didn't exist, since our
+                         * intention was to remove the file
+                         */
+                    }
+                }
+                beforeEach(() => {
+                    deleteCacheDir();
+                });
+
+                afterEach(() => {
+                    deleteCacheDir();
+                });
+
+                it("should create the cache file inside the provided directory", async () => {
+                    assert(!shell.test("-d", path.resolve("./tmp/.cacheFileDir/.cache_hashOfCurrentWorkingDirectory")), "the cache for eslint does not exist");
+
+                    eslint = new FlatESLint({
+                        overrideConfigFile: true,
+
+                        // specifying cache true the cache will be created
+                        cache: true,
+                        cacheLocation: "./tmp/.cacheFileDir/",
+                        overrideConfig: {
+                            rules: {
+                                "no-console": 0,
+                                "no-unused-vars": 2
+                            }
+                        },
+                        ignore: false
+                    });
+                    const file = getFixturePath("cache/src", "test-file.js");
+
+                    await eslint.lintFiles([file]);
+
+                    assert(shell.test("-f", path.resolve(`./tmp/.cacheFileDir/.cache_${hash(process.cwd())}`)), "the cache for eslint was created");
+
+                    sinon.restore();
+                });
+            });
+
+            it("should create the cache file inside the provided directory using the cacheLocation option", async () => {
+                assert(!shell.test("-d", path.resolve("./tmp/.cacheFileDir/.cache_hashOfCurrentWorkingDirectory")), "the cache for eslint does not exist");
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    cacheLocation: "./tmp/.cacheFileDir/",
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    ignore: false
+                });
+                const file = getFixturePath("cache/src", "test-file.js");
+
+                await eslint.lintFiles([file]);
+
+                assert(shell.test("-f", path.resolve(`./tmp/.cacheFileDir/.cache_${hash(process.cwd())}`)), "the cache for eslint was created");
+
+                sinon.restore();
+            });
+
+            it("should create the cache file inside cwd when no cacheLocation provided", async () => {
+                const cwd = path.resolve(getFixturePath("cli-engine"));
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    cache: true,
+                    cwd,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0
+                        }
+                    },
+                    ignore: false
+                });
+                const file = getFixturePath("cli-engine", "console.js");
+
+                await eslint.lintFiles([file]);
+
+                assert(shell.test("-f", path.resolve(cwd, ".eslintcache")), "the cache for eslint was created at provided cwd");
+            });
+
+            it("should invalidate the cache if the overrideConfig changed between executions", async () => {
+                const cwd = getFixturePath("cache/src");
+                const cacheLocation = path.resolve(cwd, ".eslintcache");
+
+                assert(!shell.test("-f", cacheLocation), "the cache for eslint does not exist");
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    cwd,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    ignore: false
+                });
+
+                let spy = sinon.spy(fs.promises, "readFile");
+
+                let file = path.join(cwd, "test-file.js");
+
+                file = fs.realpathSync(file);
+                const results = await eslint.lintFiles([file]);
+
+                for (const { errorCount, warningCount } of results) {
+                    assert.strictEqual(errorCount + warningCount, 0, "the file passed without errors or warnings");
+                }
+
+                assert(spy.calledWith(file), "ESLint should have read the file because it's considered changed");
+                assert(shell.test("-f", cacheLocation), "the cache for eslint should still exist");
+
+                // destroy the spy
+                sinon.restore();
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    cwd,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 2,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    ignore: false
+                });
+
+                // create a new spy
+                spy = sinon.spy(fs.promises, "readFile");
+
+                const [cachedResult] = await eslint.lintFiles([file]);
+
+                assert(spy.calledWith(file), "ESLint should have read the file again because is considered changed because the config changed");
+                assert.strictEqual(cachedResult.errorCount, 1, "since configuration changed the cache was not used and one error was reported");
+                assert(shell.test("-f", cacheLocation), "The cache for ESLint should still exist (2)");
+            });
+
+            it("should remember the files from a previous run and do not operate on them if not changed", async () => {
+
+                const cwd = getFixturePath("cache/src");
+                const cacheLocation = path.resolve(cwd, ".eslintcache");
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    cwd,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    ignore: false
+                });
+
+                let spy = sinon.spy(fs.promises, "readFile");
+
+                let file = getFixturePath("cache/src", "test-file.js");
+
+                file = fs.realpathSync(file);
+
+                const result = await eslint.lintFiles([file]);
+
+                assert(spy.calledWith(file), "the module read the file because is considered changed");
+                assert(shell.test("-f", cacheLocation), "the cache for eslint was created");
+
+                // destroy the spy
+                sinon.restore();
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    cwd,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    ignore: false
+                });
+
+                // create a new spy
+                spy = sinon.spy(fs.promises, "readFile");
+
+                const cachedResult = await eslint.lintFiles([file]);
+
+                assert.deepStrictEqual(result, cachedResult, "the result is the same regardless of using cache or not");
+
+                // assert the file was not processed because the cache was used
+                assert(!spy.calledWith(file), "the file was not loaded because it used the cache");
+            });
+
+            it("should remember the files from a previous run and do not operate on then if not changed", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+                const eslintOptions = {
+                    overrideConfigFile: true,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    },
+                    cwd: path.join(fixtureDir, "..")
+                };
+
+                assert(!shell.test("-f", cacheLocation), "the cache for eslint does not exist");
+
+                eslint = new FlatESLint(eslintOptions);
+
+                let file = getFixturePath("cache/src", "test-file.js");
+
+                file = fs.realpathSync(file);
+
+                await eslint.lintFiles([file]);
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint was created");
+
+                eslintOptions.cache = false;
+                eslint = new FlatESLint(eslintOptions);
+
+                await eslint.lintFiles([file]);
+
+                assert(!shell.test("-f", cacheLocation), "the cache for eslint was deleted since last run did not used the cache");
+            });
+
+            it("should store in the cache a file that failed the test", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                assert(!shell.test("-f", cacheLocation), "the cache for eslint does not exist");
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+                const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+                const result = await eslint.lintFiles([badFile, goodFile]);
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint was created");
+                const fileCache = fCache.createFromFile(cacheLocation);
+                const { cache } = fileCache;
+
+                assert.strictEqual(typeof cache.getKey(goodFile), "object", "the entry for the good file is in the cache");
+                assert.strictEqual(typeof cache.getKey(badFile), "object", "the entry for the bad file is in the cache");
+                const cachedResult = await eslint.lintFiles([badFile, goodFile]);
+
+                assert.deepStrictEqual(result, cachedResult, "result is the same with or without cache");
+            });
+
+            it("should not contain in the cache a file that was deleted", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                doDelete(cacheLocation);
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+                const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+                const toBeDeletedFile = fs.realpathSync(getFixturePath("cache/src", "file-to-delete.js"));
+
+                await eslint.lintFiles([badFile, goodFile, toBeDeletedFile]);
+                const fileCache = fCache.createFromFile(cacheLocation);
+                let { cache } = fileCache;
+
+                assert.strictEqual(typeof cache.getKey(toBeDeletedFile), "object", "the entry for the file to be deleted is in the cache");
+
+                // delete the file from the file system
+                fs.unlinkSync(toBeDeletedFile);
+
+                /*
+                 * file-entry-cache@2.0.0 will remove from the cache deleted files
+                 * even when they were not part of the array of files to be analyzed
+                 */
+                await eslint.lintFiles([badFile, goodFile]);
+
+                cache = JSON.parse(fs.readFileSync(cacheLocation));
+
+                assert.strictEqual(typeof cache[toBeDeletedFile], "undefined", "the entry for the file to be deleted is not in the cache");
+            });
+
+            it("should contain files that were not visited in the cache provided they still exist", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                doDelete(cacheLocation);
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+
+                    // specifying cache true the cache will be created
+                    cache: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+                const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+                const testFile2 = fs.realpathSync(getFixturePath("cache/src", "test-file2.js"));
+
+                await eslint.lintFiles([badFile, goodFile, testFile2]);
+
+                let fileCache = fCache.createFromFile(cacheLocation);
+                let { cache } = fileCache;
+
+                assert.strictEqual(typeof cache.getKey(testFile2), "object", "the entry for the test-file2 is in the cache");
+
+                /*
+                 * we pass a different set of files minus test-file2
+                 * previous version of file-entry-cache would remove the non visited
+                 * entries. 2.0.0 version will keep them unless they don't exist
+                 */
+                await eslint.lintFiles([badFile, goodFile]);
+
+                fileCache = fCache.createFromFile(cacheLocation);
+                cache = fileCache.cache;
+
+                assert.strictEqual(typeof cache.getKey(testFile2), "object", "the entry for the test-file2 is in the cache");
+            });
+
+            it("should not delete cache when executing on text", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint exists");
+
+                await eslint.lintText("var foo = 'bar';");
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint still exists");
+            });
+
+            it("should not delete cache when executing on text with a provided filename", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint exists");
+
+                await eslint.lintText("var bar = foo;", { filePath: "fixtures/passing.js" });
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint still exists");
+            });
+
+            it("should not delete cache when executing on files with --cache flag", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    cache: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+                });
+                const file = getFixturePath("cli-engine", "console.js");
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint exists");
+
+                await eslint.lintFiles([file]);
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint still exists");
+            });
+
+            it("should delete cache when executing on files without --cache flag", async () => {
+                const cacheLocation = getFixturePath(".eslintcache");
+
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    cacheLocation,
+                    overrideConfig: {
+                        rules: {
+                            "no-console": 0,
+                            "no-unused-vars": 2
+                        }
+                    }
+
+                });
+                const file = getFixturePath("cli-engine", "console.js");
+
+                assert(shell.test("-f", cacheLocation), "the cache for eslint exists");
+
+                await eslint.lintFiles([file]);
+
+                assert(!shell.test("-f", cacheLocation), "the cache for eslint has been deleted");
+            });
+
+            describe("cacheFile", () => {
+                it("should use the specified cache file", async () => {
+                    const customCacheFile = path.resolve(".cache/custom-cache");
+
+                    assert(!shell.test("-f", customCacheFile), "the cache for eslint does not exist");
+
+                    eslint = new FlatESLint({
+                        overrideConfigFile: true,
+
+                        // specify a custom cache file
+                        cacheLocation: customCacheFile,
+
+                        // specifying cache true the cache will be created
+                        cache: true,
+                        overrideConfig: {
+                            rules: {
+                                "no-console": 0,
+                                "no-unused-vars": 2
+                            }
+                        },
+
+                        cwd: path.join(fixtureDir, "..")
+                    });
+                    const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                    const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+                    const result = await eslint.lintFiles([badFile, goodFile]);
+
+                    assert(shell.test("-f", customCacheFile), "the cache for eslint was created");
+                    const fileCache = fCache.createFromFile(customCacheFile);
+                    const { cache } = fileCache;
+
+                    assert(typeof cache.getKey(goodFile) === "object", "the entry for the good file is in the cache");
+
+                    assert(typeof cache.getKey(badFile) === "object", "the entry for the bad file is in the cache");
+                    const cachedResult = await eslint.lintFiles([badFile, goodFile]);
+
+                    assert.deepStrictEqual(result, cachedResult, "result is the same with or without cache");
+                });
+            });
+
+            describe("cacheStrategy", () => {
+                it("should detect changes using a file's modification time when set to 'metadata'", async () => {
+                    const cacheLocation = getFixturePath(".eslintcache");
+
+                    doDelete(cacheLocation);
+
+                    eslint = new FlatESLint({
+                        cwd: path.join(fixtureDir, ".."),
+                        overrideConfigFile: true,
+
+                        // specifying cache true the cache will be created
+                        cache: true,
+                        cacheLocation,
+                        cacheStrategy: "metadata",
+                        overrideConfig: {
+                            rules: {
+                                "no-console": 0,
+                                "no-unused-vars": 2
+                            }
+                        }
+
+                    });
+                    const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                    const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+
+                    await eslint.lintFiles([badFile, goodFile]);
+                    let fileCache = fCache.createFromFile(cacheLocation);
+                    const entries = fileCache.normalizeEntries([badFile, goodFile]);
+
+                    entries.forEach(entry => {
+                        assert(entry.changed === false, `the entry for ${entry.key} is initially unchanged`);
+                    });
+
+                    // this should result in a changed entry
+                    shell.touch(goodFile);
+                    fileCache = fCache.createFromFile(cacheLocation);
+                    assert(fileCache.getFileDescriptor(badFile).changed === false, `the entry for ${badFile} is unchanged`);
+                    assert(fileCache.getFileDescriptor(goodFile).changed === true, `the entry for ${goodFile} is changed`);
+                });
+
+                it("should not detect changes using a file's modification time when set to 'content'", async () => {
+                    const cacheLocation = getFixturePath(".eslintcache");
+
+                    doDelete(cacheLocation);
+
+                    eslint = new FlatESLint({
+                        cwd: path.join(fixtureDir, ".."),
+                        overrideConfigFile: true,
+
+                        // specifying cache true the cache will be created
+                        cache: true,
+                        cacheLocation,
+                        cacheStrategy: "content",
+                        overrideConfig: {
+                            rules: {
+                                "no-console": 0,
+                                "no-unused-vars": 2
+                            }
+                        }
+
+                    });
+                    const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                    const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+
+                    await eslint.lintFiles([badFile, goodFile]);
+                    let fileCache = fCache.createFromFile(cacheLocation, true);
+                    let entries = fileCache.normalizeEntries([badFile, goodFile]);
+
+                    entries.forEach(entry => {
+                        assert(entry.changed === false, `the entry for ${entry.key} is initially unchanged`);
+                    });
+
+                    // this should NOT result in a changed entry
+                    shell.touch(goodFile);
+                    fileCache = fCache.createFromFile(cacheLocation, true);
+                    entries = fileCache.normalizeEntries([badFile, goodFile]);
+                    entries.forEach(entry => {
+                        assert(entry.changed === false, `the entry for ${entry.key} remains unchanged`);
+                    });
+                });
+
+                it("should detect changes using a file's contents when set to 'content'", async () => {
+                    const cacheLocation = getFixturePath(".eslintcache");
+
+                    doDelete(cacheLocation);
+
+                    eslint = new FlatESLint({
+                        cwd: path.join(fixtureDir, ".."),
+                        overrideConfigFile: true,
+
+                        // specifying cache true the cache will be created
+                        cache: true,
+                        cacheLocation,
+                        cacheStrategy: "content",
+                        overrideConfig: {
+                            rules: {
+                                "no-console": 0,
+                                "no-unused-vars": 2
+                            }
+                        }
+
+                    });
+                    const badFile = fs.realpathSync(getFixturePath("cache/src", "fail-file.js"));
+                    const goodFile = fs.realpathSync(getFixturePath("cache/src", "test-file.js"));
+                    const goodFileCopy = path.resolve(`${path.dirname(goodFile)}`, "test-file-copy.js");
+
+                    shell.cp(goodFile, goodFileCopy);
+
+                    await eslint.lintFiles([badFile, goodFileCopy]);
+                    let fileCache = fCache.createFromFile(cacheLocation, true);
+                    const entries = fileCache.normalizeEntries([badFile, goodFileCopy]);
+
+                    entries.forEach(entry => {
+                        assert(entry.changed === false, `the entry for ${entry.key} is initially unchanged`);
+                    });
+
+                    // this should result in a changed entry
+                    shell.sed("-i", "abc", "xzy", goodFileCopy);
+                    fileCache = fCache.createFromFile(cacheLocation, true);
+                    assert(fileCache.getFileDescriptor(badFile).changed === false, `the entry for ${badFile} is unchanged`);
+                    assert(fileCache.getFileDescriptor(goodFileCopy).changed === true, `the entry for ${goodFileCopy} is changed`);
+                });
+            });
+        });
+
+        describe("processors", () => {
+
+            it("should return two messages when executing with config file that specifies preloaded processor", async () => {
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    overrideConfig: [
+                        {
+                            plugins: {
+                                test: {
+                                    processors: {
+                                        txt: {
+                                            preprocess(text) {
+                                                return [text];
+                                            },
+                                            postprocess(messages) {
+                                                return messages[0];
+                                            }
+                                        }
+                                    }
+                                }
+                            },
+                            processor: "test/txt",
+                            rules: {
+                                "no-console": 2,
+                                "no-unused-vars": 2
+                            }
+                        },
+                        {
+                            files: ["**/*.txt", "**/*.txt/*.txt"]
+                        }
+                    ],
+                    cwd: path.join(fixtureDir, "..")
+                });
+                const results = await eslint.lintFiles([fs.realpathSync(getFixturePath("processors", "test", "test-processor.txt"))]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 2);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should run processors when calling lintFiles with config file that specifies preloaded processor", async () => {
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    overrideConfig: [
+                        {
+                            plugins: {
+                                test: {
+                                    processors: {
+                                        txt: {
+                                            preprocess(text) {
+                                                return [text.replace("a()", "b()")];
+                                            },
+                                            postprocess(messages) {
+                                                messages[0][0].ruleId = "post-processed";
+                                                return messages[0];
+                                            }
+                                        }
+                                    }
+                                }
+                            },
+                            processor: "test/txt",
+                            rules: {
+                                "no-console": 2,
+                                "no-unused-vars": 2
+                            }
+                        },
+                        {
+                            files: ["**/*.txt", "**/*.txt/*.txt"]
+                        }
+                    ],
+                    cwd: path.join(fixtureDir, "..")
+                });
+                const results = await eslint.lintFiles([getFixturePath("processors", "test", "test-processor.txt")]);
+
+                assert.strictEqual(results[0].messages[0].message, "'b' is defined but never used.");
+                assert.strictEqual(results[0].messages[0].ruleId, "post-processed");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should run processors when calling lintText with config file that specifies preloaded processor", async () => {
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    overrideConfig: [
+                        {
+                            plugins: {
+                                test: {
+                                    processors: {
+                                        txt: {
+                                            preprocess(text) {
+                                                return [text.replace("a()", "b()")];
+                                            },
+                                            postprocess(messages) {
+                                                messages[0][0].ruleId = "post-processed";
+                                                return messages[0];
+                                            }
+                                        }
+                                    }
+                                }
+                            },
+                            processor: "test/txt",
+                            rules: {
+                                "no-console": 2,
+                                "no-unused-vars": 2
+                            }
+                        },
+                        {
+                            files: ["**/*.txt", "**/*.txt/*.txt"]
+                        }
+                    ],
+                    ignore: false
+                });
+                const results = await eslint.lintText("function a() {console.log(\"Test\");}", { filePath: "tests/fixtures/processors/test/test-processor.txt" });
+
+                assert.strictEqual(results[0].messages[0].message, "'b' is defined but never used.");
+                assert.strictEqual(results[0].messages[0].ruleId, "post-processed");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should run processors when calling lintText with processor resolves same extension but different content correctly", async () => {
+                let count = 0;
+
+                eslint = new FlatESLint({
+                    overrideConfigFile: true,
+                    overrideConfig: [
+                        {
+                            plugins: {
+                                test: {
+                                    processors: {
+                                        txt: {
+                                            preprocess(text) {
+                                                count++;
+                                                return [
+                                                    {
+
+                                                        // it will be run twice, and text will be as-is at the second time, then it will not run third time
+                                                        text: text.replace("a()", "b()"),
+                                                        filename: ".txt"
+                                                    }
+                                                ];
+                                            },
+                                            postprocess(messages) {
+                                                messages[0][0].ruleId = "post-processed";
+                                                return messages[0];
+                                            }
+                                        }
+                                    }
+                                }
+                            },
+                            processor: "test/txt"
+                        },
+                        {
+                            files: ["**/*.txt/*.txt"],
+                            rules: {
+                                "no-console": 2,
+                                "no-unused-vars": 2
+                            }
+                        },
+                        {
+                            files: ["**/*.txt"]
+                        }
+                    ],
+                    ignore: false
+                });
+                const results = await eslint.lintText("function a() {console.log(\"Test\");}", { filePath: "tests/fixtures/processors/test/test-processor.txt" });
+
+                assert.strictEqual(count, 2);
+                assert.strictEqual(results[0].messages[0].message, "'b' is defined but never used.");
+                assert.strictEqual(results[0].messages[0].ruleId, "post-processed");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            describe("autofixing with processors", () => {
+                const HTML_PROCESSOR = Object.freeze({
+                    preprocess(text) {
+                        return [text.replace(/^<script>/u, "").replace(/<\/script>$/u, "")];
+                    },
+                    postprocess(problemLists) {
+                        return problemLists[0].map(problem => {
+                            if (problem.fix) {
+                                const updatedFix = Object.assign({}, problem.fix, {
+                                    range: problem.fix.range.map(index => index + "<script>".length)
+                                });
+
+                                return Object.assign({}, problem, { fix: updatedFix });
+                            }
+                            return problem;
+                        });
+                    }
+                });
+
+
+                it("should run in autofix mode when using a processor that supports autofixing", async () => {
+                    eslint = new FlatESLint({
+                        overrideConfigFile: true,
+                        overrideConfig: [
+                            {
+                                files: ["**/*.html"],
+                                plugins: {
+                                    test: { processors: { html: Object.assign({ supportsAutofix: true }, HTML_PROCESSOR) } }
+                                },
+                                processor: "test/html",
+                                rules: {
+                                    semi: 2
+                                }
+                            },
+                            {
+                                files: ["**/*.txt"]
+                            }
+                        ],
+                        ignore: false,
+                        fix: true
+                    });
+                    const results = await eslint.lintText("<script>foo</script>", { filePath: "foo.html" });
+
+                    assert.strictEqual(results[0].messages.length, 0);
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
+                    assert.strictEqual(results[0].output, "<script>foo;</script>");
+                });
+
+                it("should not run in autofix mode when using a processor that does not support autofixing", async () => {
+                    eslint = new FlatESLint({
+                        overrideConfigFile: true,
+                        overrideConfig: {
+                            files: ["**/*.html"],
+                            plugins: {
+                                test: { processors: { html: HTML_PROCESSOR } }
+                            },
+                            processor: "test/html",
+                            rules: {
+                                semi: 2
+                            }
+                        },
+                        ignore: false,
+                        fix: true
+                    });
+                    const results = await eslint.lintText("<script>foo</script>", { filePath: "foo.html" });
+
+                    assert.strictEqual(results[0].messages.length, 1);
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
+                    assert(!Object.prototype.hasOwnProperty.call(results[0], "output"));
+                });
+
+                it("should not run in autofix mode when `fix: true` is not provided, even if the processor supports autofixing", async () => {
+                    eslint = new FlatESLint({
+                        overrideConfigFile: true,
+                        overrideConfig: [
+                            {
+                                files: ["**/*.html"],
+                                plugins: {
+                                    test: { processors: { html: Object.assign({ supportsAutofix: true }, HTML_PROCESSOR) } }
+                                },
+                                processor: "test/html",
+                                rules: {
+                                    semi: 2
+                                }
+                            },
+                            {
+                                files: ["**/*.txt"]
+                            }
+                        ],
+                        ignore: false
+                    });
+                    const results = await eslint.lintText("<script>foo</script>", { filePath: "foo.html" });
+
+                    assert.strictEqual(results[0].messages.length, 1);
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
+                    assert(!Object.prototype.hasOwnProperty.call(results[0], "output"));
+                });
+            });
+        });
+
+        describe("Patterns which match no file should throw errors.", () => {
+            beforeEach(() => {
+                eslint = new FlatESLint({
+                    cwd: getFixturePath("cli-engine"),
+                    overrideConfigFile: true
+                });
+            });
+
+            it("one file", async () => {
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["non-exist.js"]);
+                }, /No files matching 'non-exist\.js' were found\./u);
+            });
+
+            it("should throw if the directory exists and is empty", async () => {
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["empty"]);
+                }, /No files matching 'empty\/\*\*\/\*\.js' were found\./u);
+            });
+
+            it("one glob pattern", async () => {
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["non-exist/**/*.js"]);
+                }, /No files matching 'non-exist\/\*\*\/\*\.js' were found\./u);
+            });
+
+            it("two files", async () => {
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["aaa.js", "bbb.js"]);
+                }, /No files matching 'aaa\.js' were found\./u);
+            });
+
+            it("a mix of an existing file and a non-existing file", async () => {
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["console.js", "non-exist.js"]);
+                }, /No files matching 'non-exist\.js' were found\./u);
+            });
+        });
+
+        describe("multiple processors", () => {
+            const root = path.join(os.tmpdir(), "eslint/eslint/multiple-processors");
+            const commonFiles = {
+                "node_modules/pattern-processor/index.js": fs.readFileSync(
+                    require.resolve("../../fixtures/processors/pattern-processor"),
+                    "utf8"
+                ),
+                "node_modules/eslint-plugin-markdown/index.js": `
+                    const { defineProcessor } = require("pattern-processor");
+                    const processor = defineProcessor(${/```(\w+)\n([\s\S]+?)\n```/gu});
+                    exports.processors = {
+                        "markdown": { ...processor, supportsAutofix: true },
+                        "non-fixable": processor
+                    };
+                `,
+                "node_modules/eslint-plugin-html/index.js": `
+                    const { defineProcessor } = require("pattern-processor");
+                    const processor = defineProcessor(${/<script lang="(\w*)">\n([\s\S]+?)\n<\/script>/gu});
+                    const legacyProcessor = defineProcessor(${/<script lang="(\w*)">\n([\s\S]+?)\n<\/script>/gu}, true);
+                    exports.processors = {
+                        "html": { ...processor, supportsAutofix: true },
+                        "non-fixable": processor,
+                        "legacy": legacyProcessor
+                    };
+                `,
+                "test.md": unIndent`
+                    \`\`\`js
+                    console.log("hello")
+                    \`\`\`
+                    \`\`\`html
+                    <div>Hello</div>
+                    <script lang="js">
+                        console.log("hello")
+                    </script>
+                    <script lang="ts">
+                        console.log("hello")
+                    </script>
+                    \`\`\`
+                `
+            };
+
+            // unique directory for each test to avoid quirky disk-cleanup errors
+            let id;
+
+            beforeEach(() => (id = Date.now().toString()));
+            afterEach(async () => fsp.rmdir(root, { recursive: true, force: true }));
+
+            it("should lint only JavaScript blocks.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                }
+                            },
+                            {
+                                files: ["**/*.js"],
+                                rules: { semi: "error" }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/markdown"
+                            }
+                        ];`
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+                const results = await eslint.lintFiles(["test.md"]);
+
+                assert.strictEqual(results.length, 1, "Should have one result.");
+                assert.strictEqual(results[0].messages.length, 1, "Should have one message.");
+                assert.strictEqual(results[0].messages[0].ruleId, "semi");
+                assert.strictEqual(results[0].messages[0].line, 2, "Message should be on line 2.");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should lint HTML blocks as well with multiple processors if represented in config.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                }
+                            },
+                            {
+                                files: ["**/*.js"],
+                                rules: { semi: "error" }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/markdown"
+                            },
+                            {
+                                files: ["**/*.html"],
+                                processor: "html/html"
+                            }
+                        ];`
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath(), overrideConfig: { files: ["**/*.html"] } });
+                const results = await eslint.lintFiles(["test.md"]);
+
+                assert.strictEqual(results.length, 1, "Should have one result.");
+                assert.strictEqual(results[0].messages.length, 2, "Should have two messages.");
+                assert.strictEqual(results[0].messages[0].ruleId, "semi"); // JS block
+                assert.strictEqual(results[0].messages[0].line, 2, "First error should be on line 2");
+                assert.strictEqual(results[0].messages[1].ruleId, "semi"); // JS block in HTML block
+                assert.strictEqual(results[0].messages[1].line, 7, "Second error should be on line 7.");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should fix HTML blocks as well with multiple processors if represented in config.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                }
+                            },
+                            {
+                                files: ["**/*.js"],
+                                rules: { semi: "error" }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/markdown"
+                            },
+                            {
+                                files: ["**/*.html"],
+                                processor: "html/html"
+                            }
+                        ];`
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath(), overrideConfig: { files: ["**/*.html"] }, fix: true });
+                const results = await eslint.lintFiles(["test.md"]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 0);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+                assert.strictEqual(results[0].output, unIndent`
+                    \`\`\`js
+                    console.log("hello");${/* ← fixed */""}
+                    \`\`\`
+                    \`\`\`html
+                    <div>Hello</div>
+                    <script lang="js">
+                        console.log("hello");${/* ← fixed */""}
+                    </script>
+                    <script lang="ts">
+                        console.log("hello")${/* ← ignored */""}
+                    </script>
+                    \`\`\`
+                `);
+            });
+
+            it("should use the config '**/*.html/*.js' to lint JavaScript blocks in HTML.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                }
+                            },
+                            {
+                                files: ["**/*.js"],
+                                rules: { semi: "error" }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/markdown"
+                            },
+                            {
+                                files: ["**/*.html"],
+                                processor: "html/html"
+                            },
+                            {
+                                files: ["**/*.html/*.js"],
+                                rules: {
+                                    semi: "off",
+                                    "no-console": "error"
+                                }
+                            }
+
+                        ];`
+
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath(), overrideConfig: { files: ["**/*.html"] } });
+                const results = await eslint.lintFiles(["test.md"]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 2);
+                assert.strictEqual(results[0].messages[0].ruleId, "semi");
+                assert.strictEqual(results[0].messages[0].line, 2);
+                assert.strictEqual(results[0].messages[1].ruleId, "no-console");
+                assert.strictEqual(results[0].messages[1].line, 7);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+
+            });
+
+            it("should use the same config as one which has 'processor' property in order to lint blocks in HTML if the processor was legacy style.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                },
+                                rules: { semi: "error" }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/markdown"
+                            },
+                            {
+                                files: ["**/*.html"],
+                                processor: "html/legacy",  // this processor returns strings rather than '{ text, filename }'
+                                rules: {
+                                    semi: "off",
+                                    "no-console": "error"
+                                }
+                            },
+                            {
+                                files: ["**/*.html/*.js"],
+                                rules: {
+                                    semi: "error",
+                                    "no-console": "off"
+                                }
+                            }
+
+                        ];`
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath(), overrideConfig: { files: ["**/*.html"] } });
+                const results = await eslint.lintFiles(["test.md"]);
+
+                assert.strictEqual(results.length, 1);
+                assert.strictEqual(results[0].messages.length, 3);
+                assert.strictEqual(results[0].messages[0].ruleId, "semi");
+                assert.strictEqual(results[0].messages[0].line, 2);
+                assert.strictEqual(results[0].messages[1].ruleId, "no-console");
+                assert.strictEqual(results[0].messages[1].line, 7);
+                assert.strictEqual(results[0].messages[2].ruleId, "no-console");
+                assert.strictEqual(results[0].messages[2].line, 10);
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            it("should throw an error if invalid processor was specified.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: path.join(root, id),
+                    files: {
+                        ...commonFiles,
+                        "eslint.config.js": `module.exports = [
+                            {
+                                plugins: {
+                                    markdown: require("eslint-plugin-markdown"),
+                                    html: require("eslint-plugin-html")
+                                }
+                            },
+                            {
+                                files: ["**/*.md"],
+                                processor: "markdown/unknown"
+                            }
+
+                        ];`
+                    }
+                });
+
+                await teardown.prepare();
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+
+                await assert.rejects(async () => {
+                    await eslint.lintFiles(["test.md"]);
+                }, /Key "processor": Could not find "unknown" in plugin "markdown"/u);
+            });
+
+        });
+
+        describe("glob pattern '[ab].js'", () => {
+            const root = getFixturePath("cli-engine/unmatched-glob");
+
+            let cleanup;
+
+            beforeEach(() => {
+                cleanup = () => { };
+            });
+
+            afterEach(() => cleanup());
+
+            it("should match '[ab].js' if existed.", async () => {
+
+                const teardown = createCustomTeardown({
+                    cwd: root,
+                    files: {
+                        "a.js": "",
+                        "b.js": "",
+                        "ab.js": "",
+                        "[ab].js": "",
+                        "eslint.config.js": "module.exports = [];"
+                    }
+                });
+
+                await teardown.prepare();
+                cleanup = teardown.cleanup;
+
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+                const results = await eslint.lintFiles(["[ab].js"]);
+                const filenames = results.map(r => path.basename(r.filePath));
+
+                assert.deepStrictEqual(filenames, ["[ab].js"]);
+            });
+
+            it("should match 'a.js' and 'b.js' if '[ab].js' didn't existed.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: root,
+                    files: {
+                        "a.js": "",
+                        "b.js": "",
+                        "ab.js": "",
+                        "eslint.config.js": "module.exports = [];"
+                    }
+                });
+
+                await teardown.prepare();
+                cleanup = teardown.cleanup;
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+                const results = await eslint.lintFiles(["[ab].js"]);
+                const filenames = results.map(r => path.basename(r.filePath));
+
+                assert.deepStrictEqual(filenames, ["a.js", "b.js"]);
+            });
+        });
+
+        describe("with 'noInlineConfig' setting", () => {
+            const root = getFixturePath("cli-engine/noInlineConfig");
+
+            let cleanup;
+
+            beforeEach(() => {
+                cleanup = () => { };
+            });
+
+            afterEach(() => cleanup());
+
+            it("should warn directive comments if 'noInlineConfig' was given.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: root,
+                    files: {
+                        "test.js": "/* globals foo */",
+                        "eslint.config.js": "module.exports = [{ linterOptions: { noInlineConfig: true } }];"
+                    }
+                });
+
+                await teardown.prepare();
+                cleanup = teardown.cleanup;
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+
+                const results = await eslint.lintFiles(["test.js"]);
+                const messages = results[0].messages;
+
+                assert.strictEqual(messages.length, 1);
+                assert.strictEqual(messages[0].message, "'/*globals*/' has no effect because you have 'noInlineConfig' setting in your config.");
+            });
+
+        });
+
+        describe("with 'reportUnusedDisableDirectives' setting", () => {
+            const root = getFixturePath("cli-engine/reportUnusedDisableDirectives");
+
+            let cleanup;
+
+            beforeEach(() => {
+                cleanup = () => { };
+            });
+
+            afterEach(() => cleanup());
+
+            it("should warn unused 'eslint-disable' comments if 'reportUnusedDisableDirectives' was given.", async () => {
+                const teardown = createCustomTeardown({
+                    cwd: root,
+                    files: {
+                        "test.js": "/* eslint-disable eqeqeq */",
+                        "eslint.config.js": "module.exports = { linterOptions: { reportUnusedDisableDirectives: true } }"
+                    }
+                });
+
+
+                await teardown.prepare();
+                cleanup = teardown.cleanup;
+                eslint = new FlatESLint({ cwd: teardown.getPath() });
+
+                const results = await eslint.lintFiles(["test.js"]);
+                const messages = results[0].messages;
+
+                assert.strictEqual(messages.length, 1);
+                assert.strictEqual(messages[0].severity, 1);
+                assert.strictEqual(messages[0].message, "Unused eslint-disable directive (no problems were reported from 'eqeqeq').");
+                assert.strictEqual(results[0].suppressedMessages.length, 0);
+            });
+
+            describe("the runtime option overrides config files.", () => {
+                it("should not warn unused 'eslint-disable' comments if 'reportUnusedDisableDirectives=off' was given in runtime.", async () => {
+                    const teardown = createCustomTeardown({
+                        cwd: root,
+                        files: {
+                            "test.js": "/* eslint-disable eqeqeq */",
+                            ".eslintrc.yml": "reportUnusedDisableDirectives: true"
+                        }
+                    });
+
+                    await teardown.prepare();
+                    cleanup = teardown.cleanup;
+
+                    eslint = new FlatESLint({
+                        cwd: teardown.getPath(),
+                        reportUnusedDisableDirectives: "off"
+                    });
+
+                    const results = await eslint.lintFiles(["test.js"]);
+                    const messages = results[0].messages;
+
+                    assert.strictEqual(messages.length, 0);
+                });
+
+                it("should warn unused 'eslint-disable' comments as error if 'reportUnusedDisableDirectives=error' was given in runtime.", async () => {
+                    const teardown = createCustomTeardown({
+                        cwd: root,
+                        files: {
+                            "test.js": "/* eslint-disable eqeqeq */",
+                            ".eslintrc.yml": "reportUnusedDisableDirectives: true"
+                        }
+                    });
+
+                    await teardown.prepare();
+                    cleanup = teardown.cleanup;
+
+                    eslint = new FlatESLint({
+                        cwd: teardown.getPath(),
+                        reportUnusedDisableDirectives: "error"
+                    });
+
+                    const results = await eslint.lintFiles(["test.js"]);
+                    const messages = results[0].messages;
+
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].severity, 2);
+                    assert.strictEqual(messages[0].message, "Unused eslint-disable directive (no problems were reported from 'eqeqeq').");
+                    assert.strictEqual(results[0].suppressedMessages.length, 0);
+                });
+            });
+        });
+
+        it("should throw if non-boolean value is given to 'options.warnIgnored' option", async () => {
+            eslint = new FlatESLint();
+            await assert.rejects(() => eslint.lintFiles(777), /'patterns' must be a non-empty string or an array of non-empty strings/u);
+            await assert.rejects(() => eslint.lintFiles([null]), /'patterns' must be a non-empty string or an array of non-empty strings/u);
+        });
+    });
+
+    describe("Fix Types", () => {
+
+        let eslint;
+
+        it("should throw an error when an invalid fix type is specified", () => {
+            assert.throws(() => {
+                eslint = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    fix: true,
+                    fixTypes: ["layou"]
+                });
+            }, /'fixTypes' must be an array of any of "directive", "problem", "suggestion", and "layout"\./iu);
+        });
+
+        it("should not fix any rules when fixTypes is used without fix", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                fix: false,
+                fixTypes: ["layout"]
+            });
+            const inputPath = getFixturePath("fix-types/fix-only-semi.js");
+            const results = await eslint.lintFiles([inputPath]);
+
+            assert.strictEqual(results[0].output, void 0);
+        });
+
+        it("should not fix non-style rules when fixTypes has only 'layout'", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                fix: true,
+                fixTypes: ["layout"]
+            });
+            const inputPath = getFixturePath("fix-types/fix-only-semi.js");
+            const outputPath = getFixturePath("fix-types/fix-only-semi.expected.js");
+            const results = await eslint.lintFiles([inputPath]);
+            const expectedOutput = fs.readFileSync(outputPath, "utf8");
+
+            assert.strictEqual(results[0].output, expectedOutput);
+        });
+
+        it("should not fix style or problem rules when fixTypes has only 'suggestion'", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                fix: true,
+                fixTypes: ["suggestion"]
+            });
+            const inputPath = getFixturePath("fix-types/fix-only-prefer-arrow-callback.js");
+            const outputPath = getFixturePath("fix-types/fix-only-prefer-arrow-callback.expected.js");
+            const results = await eslint.lintFiles([inputPath]);
+            const expectedOutput = fs.readFileSync(outputPath, "utf8");
+
+            assert.strictEqual(results[0].output, expectedOutput);
+        });
+
+        it("should fix both style and problem rules when fixTypes has 'suggestion' and 'layout'", async () => {
+            eslint = new FlatESLint({
+                cwd: path.join(fixtureDir, ".."),
+                overrideConfigFile: true,
+                fix: true,
+                fixTypes: ["suggestion", "layout"]
+            });
+            const inputPath = getFixturePath("fix-types/fix-both-semi-and-prefer-arrow-callback.js");
+            const outputPath = getFixturePath("fix-types/fix-both-semi-and-prefer-arrow-callback.expected.js");
+            const results = await eslint.lintFiles([inputPath]);
+            const expectedOutput = fs.readFileSync(outputPath, "utf8");
+
+            assert.strictEqual(results[0].output, expectedOutput);
+        });
+
+    });
+
+    describe("isPathIgnored", () => {
+        it("should check if the given path is ignored", async () => {
+            const engine = new FlatESLint({
+                ignorePath: getFixturePath(".eslintignore2"),
+                cwd: getFixturePath()
+            });
+
+            assert(await engine.isPathIgnored("undef.js"));
+            assert(!await engine.isPathIgnored("passing.js"));
+        });
+
+        it("should return false if ignoring is disabled", async () => {
+            const engine = new FlatESLint({
+                ignore: false,
+                ignorePath: getFixturePath(".eslintignore2"),
+                cwd: getFixturePath()
+            });
+
+            assert(!await engine.isPathIgnored("undef.js"));
+        });
+
+        // https://github.com/eslint/eslint/issues/5547
+        it("should return true for default ignores even if ignoring is disabled", async () => {
+            const engine = new FlatESLint({
+                ignore: false,
+                cwd: getFixturePath("cli-engine")
+            });
+
+            assert(await engine.isPathIgnored("node_modules/foo.js"));
+        });
+
+        describe("about the default ignore patterns", () => {
+            it("should always apply default ignore patterns if ignore option is true", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules/package/file.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/node_modules/package/file.js")));
+            });
+
+            it("should still apply default ignore patterns if ignore option is is false", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignore: false, cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules/package/file.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/node_modules/package/file.js")));
+            });
+
+            it("should allow subfolders of defaultPatterns to be unignored by ignorePattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({
+                    cwd,
+                    overrideConfigFile: true,
+                    ignorePatterns: "!/node_modules/package"
+                });
+
+                const result = await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules", "package", "file.js"));
+
+                assert(!result, "File should not be ignored");
+            });
+
+            it("should allow subfolders of defaultPatterns to be unignored by ignorePath", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({
+                    cwd,
+                    overrideConfigFile: true,
+                    ignorePath: getFixturePath("ignored-paths", ".eslintignoreWithUnignoredDefaults")
+                });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules", "package", "file.js")));
+            });
+
+            it("should ignore .git directory", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", ".git/bar")));
+            });
+
+            it("should still ignore .git directory when ignore option disabled", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignore: false, cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", ".git/bar")));
+            });
+
+            it("should not ignore absolute paths containing '..'", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ cwd });
+
+                assert(!await engine.isPathIgnored(`${getFixturePath("ignored-paths", "foo")}/../unignored.js`));
+            });
+
+            it("should ignore /node_modules/ relative to .eslintignore when loaded", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignorePath: getFixturePath("ignored-paths", ".eslintignore"), cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules", "existing.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "foo", "node_modules", "existing.js")));
+            });
+
+            it("should ignore /node_modules/ relative to cwd without an .eslintignore", async () => {
+                const cwd = getFixturePath("ignored-paths", "no-ignore-file");
+                const engine = new FlatESLint({ cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "no-ignore-file", "node_modules", "existing.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "no-ignore-file", "foo", "node_modules", "existing.js")));
+            });
+        });
+
+        describe("with no .eslintignore file", () => {
+            it("should not travel to parent directories to find .eslintignore when it's missing and cwd is provided", async () => {
+                const cwd = getFixturePath("ignored-paths", "configurations");
+                const engine = new FlatESLint({ cwd });
+
+                // a .eslintignore in parent directories includes `*.js`, but don't load it.
+                assert(!await engine.isPathIgnored("foo.js"));
+                assert(await engine.isPathIgnored("node_modules/foo.js"));
+            });
+
+            it("should return false for files outside of the cwd (with no ignore file provided)", async () => {
+
+                // Default ignore patterns should not inadvertently ignore files in parent directories
+                const engine = new FlatESLint({ cwd: getFixturePath("ignored-paths", "no-ignore-file") });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "undef.js")));
+            });
+        });
+
+        describe("with .eslintignore file or package.json file", () => {
+            it("should load .eslintignore from cwd when explicitly passed", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ cwd });
+
+                // `${cwd}/.eslintignore` includes `sampleignorepattern`.
+                assert(await engine.isPathIgnored("sampleignorepattern"));
+            });
+
+        });
+
+        describe("with ignorePatterns option", () => {
+            it("should accept a string for options.ignorePatterns", async () => {
+                const cwd = getFixturePath("ignored-paths", "ignore-pattern");
+                const engine = new FlatESLint({
+                    ignorePatterns: ["ignore-me.txt"],
+                    cwd
+                });
+
+                assert(await engine.isPathIgnored("ignore-me.txt"));
+            });
+
+            it("should accept an array for options.ignorePattern", async () => {
+                const engine = new FlatESLint({
+                    ignorePatterns: ["a.js", "b.js"],
+                    overrideConfigFile: true
+                });
+
+                assert(await engine.isPathIgnored("a.js"), "a.js should be ignored");
+                assert(await engine.isPathIgnored("b.js"), "b.js should be ignored");
+                assert(!await engine.isPathIgnored("c.js"), "c.js should not be ignored");
+            });
+
+            it("should return true for files which match an ignorePattern even if they do not exist on the filesystem", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({
+                    ignorePatterns: ["not-a-file"],
+                    cwd
+                });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "not-a-file")));
+            });
+
+            it("should return true for file matching an ignore pattern exactly", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignorePatterns: ["undef.js"], cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "undef.js")));
+            });
+
+            it("should return false for file in subfolder of cwd matching an ignore pattern with leading '/'", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const filePath = getFixturePath("ignored-paths", "subdir", "undef.js");
+                const engine = new FlatESLint({
+                    ignorePatterns: ["/undef.js"],
+                    overrideConfigFile: true,
+                    cwd
+                });
+
+                assert(!await engine.isPathIgnored(filePath));
+            });
+
+            it("should return true for file matching a child of an ignore pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignorePatterns: ["ignore-pattern"], cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "ignore-pattern", "ignore-me.txt")));
+            });
+
+            it("should return true for file matching a grandchild of an ignore pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignorePatterns: ["ignore-pattern"], cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "ignore-pattern", "subdir", "ignore-me.txt")));
+            });
+
+            it("should return false for file not matching any ignore pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({ ignorePatterns: ["failing.js"], cwd });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "unignored.js")));
+            });
+
+            it("two globstar '**' ignore pattern should ignore files in nested directories", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({
+                    overrideConfigFile: true,
+                    ignorePatterns: ["**/*.js"],
+                    cwd
+                });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "foo.js")), "foo.js should be ignored");
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "foo/bar.js")), "foo/bar.js should be ignored");
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "foo/bar/baz.js")), "foo/bar/baz.js");
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "foo.cjs")), "foo.cjs should not be ignored");
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "foo/bar.cjs")), "foo/bar.cjs should not be ignored");
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "foo/bar/baz.cjs")), "foo/bar/baz.cjs should not be ignored");
+            });
+        });
+
+        describe("with ignorePath option", () => {
+            it("initialization with ignorePath should work when cwd is a parent directory", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "custom-name", "ignore-file");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored("custom-name/foo.js"));
+            });
+
+            it("initialization with ignorePath should work when the file is in the cwd", async () => {
+                const cwd = getFixturePath("ignored-paths", "custom-name");
+                const ignorePath = getFixturePath("ignored-paths", "custom-name", "ignore-file");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored("foo.js"));
+            });
+
+            it("initialization with ignorePath should work when cwd is a subdirectory", async () => {
+                const cwd = getFixturePath("ignored-paths", "custom-name", "subdirectory");
+                const ignorePath = getFixturePath("ignored-paths", "custom-name", "ignore-file");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored("../custom-name/foo.js"));
+            });
+
+            it("missing ignore file should throw error", done => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "not-a-directory", ".foobaz");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                engine.isPathIgnored("foo.js").then(() => {
+                    assert.fail("missing file should not succeed");
+                }).catch(error => {
+                    assert(/Cannot read ignore file/u.test(error));
+                    done();
+                });
+            });
+
+            it("should return false for files outside of ignorePath's directory", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "custom-name", "ignore-file");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "undef.js")));
+            });
+
+            it("should resolve relative paths from CWD", async () => {
+                const cwd = getFixturePath("ignored-paths", "subdir");
+
+                // /undef.js in ignore file
+                const ignorePath = getFixturePath("ignored-paths", ".eslintignoreForDifferentCwd");
+                const engine = new FlatESLint({ ignorePath, cwd, overrideConfigFile: true });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/undef.js")), "subdir/undef.js should be ignored");
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/subdir/undef.js")), "subdir/subdir/undef.js should not be ignored");
+            });
+
+            it("should resolve relative paths from CWD when it's in a child directory", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "subdir/.eslintignoreInChildDir");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/undef.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "undef.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "foo.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "subdir/foo.js")));
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "node_modules/bar.js")));
+            });
+
+            it("should resolve relative paths from CWD when it contains negated globs", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "subdir/.eslintignoreInChildDir");
+                const engine = new FlatESLint({
+                    ignorePath,
+                    cwd,
+                    overrideConfig: {
+                        files: ["**/*.txt"]
+                    }
+                });
+
+                assert(await engine.isPathIgnored("subdir/blah.txt"), "subdir/blah.txt should be ignore");
+                assert(await engine.isPathIgnored("blah.txt"), "blah.txt should be ignored");
+                assert(await engine.isPathIgnored("subdir/bar.txt"), "subdir/bar.txt should be ignored");
+                assert(!await engine.isPathIgnored("bar.txt"), "bar.txt should not be ignored");
+                assert(!await engine.isPathIgnored("baz.txt"), "baz.txt should not be ignored");
+                assert(!await engine.isPathIgnored("subdir/baz.txt"), "subdir/baz.txt should not be ignored");
+            });
+
+            it("should resolve default ignore patterns from the CWD even when the ignorePath is in a subdirectory", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "subdir/.eslintignoreInChildDir");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored("node_modules/blah.js"));
+            });
+
+            it("should resolve default ignore patterns from the CWD even when the ignorePath is in a parent directory", async () => {
+                const cwd = getFixturePath("ignored-paths", "subdir");
+                const ignorePath = getFixturePath("ignored-paths", ".eslintignoreForDifferentCwd");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored("node_modules/blah.js"));
+            });
+
+            it("should handle .eslintignore which contains CRLF correctly.", async () => {
+                const ignoreFileContent = fs.readFileSync(getFixturePath("ignored-paths", "crlf/.eslintignore"), "utf8");
+
+                assert(ignoreFileContent.includes("\r"), "crlf/.eslintignore should contains CR.", "Ignore file must have CRLF for test to pass.");
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", "crlf/.eslintignore");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "crlf/hide1/a.js")));
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "crlf/hide2/a.js")));
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "crlf/hide3/a.js")));
+            });
+
+            it("should ignore a non-negated pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", ".eslintignoreWithNegation");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(await engine.isPathIgnored(getFixturePath("ignored-paths", "negation", "ignore.js")));
+            });
+
+            it("should not ignore a negated pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const ignorePath = getFixturePath("ignored-paths", ".eslintignoreWithNegation");
+                const engine = new FlatESLint({ ignorePath, cwd });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "negation", "unignore.js")));
+            });
+        });
+
+        describe("with ignorePath option and ignorePatterns option", () => {
+            it("should return false for ignored file when unignored with ignore pattern", async () => {
+                const cwd = getFixturePath("ignored-paths");
+                const engine = new FlatESLint({
+                    ignorePath: getFixturePath("ignored-paths", ".eslintignoreForNegationTest"),
+                    ignorePatterns: ["!undef.js"],
+                    cwd
+                });
+
+                assert(!await engine.isPathIgnored(getFixturePath("ignored-paths", "undef.js")));
+            });
+        });
+
+        it("should throw if non-string value is given to 'filePath' parameter", async () => {
+            const eslint = new FlatESLint();
+
+            await assert.rejects(() => eslint.isPathIgnored(null), /'filePath' must be a non-empty string/u);
+        });
+    });
+
+    describe("loadFormatter()", () => {
+        it("should return a formatter object when a bundled formatter is requested", async () => {
+            const engine = new FlatESLint();
+            const formatter = await engine.loadFormatter("compact");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when no argument is passed", async () => {
+            const engine = new FlatESLint();
+            const formatter = await engine.loadFormatter();
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a custom formatter is requested", async () => {
+            const engine = new FlatESLint();
+            const formatter = await engine.loadFormatter(getFixturePath("formatters", "simple.js"));
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a custom formatter is requested, also if the path has backslashes", async () => {
+            const engine = new FlatESLint({
+                cwd: path.join(fixtureDir, "..")
+            });
+            const formatter = await engine.loadFormatter(".\\fixtures\\formatters\\simple.js");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a formatter prefixed with eslint-formatter is requested", async () => {
+            const engine = new FlatESLint({
+                cwd: getFixturePath("cli-engine")
+            });
+            const formatter = await engine.loadFormatter("bar");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a formatter is requested, also when the eslint-formatter prefix is included in the format argument", async () => {
+            const engine = new FlatESLint({
+                cwd: getFixturePath("cli-engine")
+            });
+            const formatter = await engine.loadFormatter("eslint-formatter-bar");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a formatter is requested within a scoped npm package", async () => {
+            const engine = new FlatESLint({
+                cwd: getFixturePath("cli-engine")
+            });
+            const formatter = await engine.loadFormatter("@somenamespace/foo");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should return a formatter object when a formatter is requested within a scoped npm package, also when the eslint-formatter prefix is included in the format argument", async () => {
+            const engine = new FlatESLint({
+                cwd: getFixturePath("cli-engine")
+            });
+            const formatter = await engine.loadFormatter("@somenamespace/eslint-formatter-foo");
+
+            assert.strictEqual(typeof formatter, "object");
+            assert.strictEqual(typeof formatter.format, "function");
+        });
+
+        it("should throw if a custom formatter doesn't exist", async () => {
+            const engine = new FlatESLint();
+            const formatterPath = getFixturePath("formatters", "doesntexist.js");
+            const fullFormatterPath = path.resolve(formatterPath);
+
+            await assert.rejects(async () => {
+                await engine.loadFormatter(formatterPath);
+            }, new RegExp(escapeStringRegExp(`There was a problem loading formatter: ${fullFormatterPath}\nError: Cannot find module '${fullFormatterPath}'`), "u"));
+        });
+
+        it("should throw if a built-in formatter doesn't exist", async () => {
+            const engine = new FlatESLint();
+            const fullFormatterPath = path.resolve(__dirname, "../../../lib/cli-engine/formatters/special");
+
+            await assert.rejects(async () => {
+                await engine.loadFormatter("special");
+            }, new RegExp(escapeStringRegExp(`There was a problem loading formatter: ${fullFormatterPath}.js\nError: Cannot find module '${fullFormatterPath}.js'`), "u"));
+        });
+
+        it("should throw if the required formatter exists but has an error", async () => {
+            const engine = new FlatESLint();
+            const formatterPath = getFixturePath("formatters", "broken.js");
+
+            await assert.rejects(async () => {
+                await engine.loadFormatter(formatterPath);
+
+                // for some reason, the error here contains multiple "there was a problem loading formatter" lines, so omitting
+            }, new RegExp(escapeStringRegExp("Error: Cannot find module 'this-module-does-not-exist'"), "u"));
+        });
+
+        it("should throw if a non-string formatter name is passed", async () => {
+            const engine = new FlatESLint();
+
+            await assert.rejects(async () => {
+                await engine.loadFormatter(5);
+            }, /'name' must be a string/u);
+        });
+    });
+
+    describe("getErrorResults()", () => {
+
+        it("should report 5 error messages when looking for errors only", async () => {
+            process.chdir(originalDir);
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        quotes: "error",
+                        "no-var": "error",
+                        "eol-last": "error",
+                        "no-unused-vars": "error"
+                    }
+                }
+            });
+            const results = await engine.lintText("var foo = 'bar';");
+            const errorResults = FlatESLint.getErrorResults(results);
+
+            assert.strictEqual(errorResults[0].messages.length, 4, "messages.length is wrong");
+            assert.strictEqual(errorResults[0].errorCount, 4, "errorCount is wrong");
+            assert.strictEqual(errorResults[0].fixableErrorCount, 3, "fixableErrorCount is wrong");
+            assert.strictEqual(errorResults[0].fixableWarningCount, 0, "fixableWarningCount is wrong");
+            assert.strictEqual(errorResults[0].messages[0].ruleId, "no-var");
+            assert.strictEqual(errorResults[0].messages[0].severity, 2);
+            assert.strictEqual(errorResults[0].messages[1].ruleId, "no-unused-vars");
+            assert.strictEqual(errorResults[0].messages[1].severity, 2);
+            assert.strictEqual(errorResults[0].messages[2].ruleId, "quotes");
+            assert.strictEqual(errorResults[0].messages[2].severity, 2);
+            assert.strictEqual(errorResults[0].messages[3].ruleId, "eol-last");
+            assert.strictEqual(errorResults[0].messages[3].severity, 2);
+        });
+
+        it("should not mutate passed report parameter", async () => {
+            process.chdir(originalDir);
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { quotes: [1, "double"] }
+                }
+            });
+            const results = await engine.lintText("var foo = 'bar';");
+            const reportResultsLength = results[0].messages.length;
+
+            FlatESLint.getErrorResults(results);
+
+            assert.strictEqual(results[0].messages.length, reportResultsLength);
+        });
+
+        it("should report a warningCount of 0 when looking for errors only", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        strict: ["error", "global"],
+                        quotes: "error",
+                        "no-var": "error",
+                        "eol-last": "error",
+                        "no-unused-vars": "error"
+                    }
+                }
+            });
+            const lintResults = await engine.lintText("var foo = 'bar';");
+            const errorResults = FlatESLint.getErrorResults(lintResults);
+
+            assert.strictEqual(errorResults[0].warningCount, 0);
+            assert.strictEqual(errorResults[0].fixableWarningCount, 0);
+        });
+
+        it("should return 0 error or warning messages even when the file has warnings", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                ignorePath: path.join(fixtureDir, ".eslintignore"),
+                cwd: path.join(fixtureDir, "..")
+            });
+            const options = {
+                filePath: "fixtures/passing.js",
+                warnIgnored: true
+            };
+            const results = await engine.lintText("var bar = foo;", options);
+            const errorReport = FlatESLint.getErrorResults(results);
+
+            assert.strictEqual(errorReport.length, 0);
+            assert.strictEqual(results.length, 1);
+            assert.strictEqual(results[0].errorCount, 0);
+            assert.strictEqual(results[0].warningCount, 1);
+        });
+
+        it("should return source code of file in the `source` property", async () => {
+            process.chdir(originalDir);
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: { quotes: [2, "double"] }
+                }
+            });
+            const results = await engine.lintText("var foo = 'bar';");
+            const errorResults = FlatESLint.getErrorResults(results);
+
+            assert.strictEqual(errorResults[0].messages.length, 1);
+            assert.strictEqual(errorResults[0].source, "var foo = 'bar';");
+        });
+
+        it("should contain `output` property after fixes", async () => {
+            process.chdir(originalDir);
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                fix: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 2,
+                        "no-console": 2
+                    }
+                }
+            });
+            const results = await engine.lintText("console.log('foo')");
+            const errorResults = FlatESLint.getErrorResults(results);
+
+            assert.strictEqual(errorResults[0].messages.length, 1);
+            assert.strictEqual(errorResults[0].output, "console.log('foo');");
+        });
+    });
+
+    describe("getRulesMetaForResults()", () => {
+
+        it("should throw an error when results were not created from this instance", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true
+            });
+
+            assert.throws(() => {
+                engine.getRulesMetaForResults([
+                    {
+                        filePath: "path/to/file.js",
+                        messages: [
+                            {
+                                ruleId: "curly",
+                                severity: 2,
+                                message: "Expected { after 'if' condition.",
+                                line: 2,
+                                column: 1,
+                                nodeType: "IfStatement"
+                            },
+                            {
+                                ruleId: "no-process-exit",
+                                severity: 2,
+                                message: "Don't use process.exit(); throw an error instead.",
+                                line: 3,
+                                column: 1,
+                                nodeType: "CallExpression"
+                            }
+                        ],
+                        suppressedMessages: [],
+                        errorCount: 2,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        source:
+                            "var err = doStuff();\nif (err) console.log('failed tests: ' + err);\nprocess.exit(1);\n"
+                    }
+                ]);
+            }, /Results object was not created from this ESLint instance/u);
+        });
+
+        it("should return empty object when there are no linting errors", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true
+            });
+
+            const rulesMeta = engine.getRulesMetaForResults([]);
+
+            assert.strictEqual(Object.keys(rulesMeta).length, 0);
+        });
+
+        it("should return one rule meta when there is a linting error", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 2
+                    }
+                }
+            });
+
+            const results = await engine.lintText("a", { filePath: "foo.js" });
+            const rulesMeta = engine.getRulesMetaForResults(results);
+
+            assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
+        });
+
+        it("should return multiple rule meta when there are multiple linting errors", async () => {
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    rules: {
+                        semi: 2,
+                        quotes: [2, "double"]
+                    }
+                }
+            });
+
+            const results = await engine.lintText("'a'");
+            const rulesMeta = engine.getRulesMetaForResults(results);
+
+            assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
+            assert.strictEqual(rulesMeta.quotes, coreRules.get("quotes").meta);
+        });
+
+        it("should return multiple rule meta when there are multiple linting errors from a plugin", async () => {
+            const nodePlugin = require("eslint-plugin-n");
+            const engine = new FlatESLint({
+                overrideConfigFile: true,
+                overrideConfig: {
+                    plugins: {
+                        n: nodePlugin
+                    },
+                    rules: {
+                        "n/no-new-require": 2,
+                        semi: 2,
+                        quotes: [2, "double"]
+                    }
+                }
+            });
+
+            const results = await engine.lintText("new require('hi')");
+            const rulesMeta = engine.getRulesMetaForResults(results);
+
+            assert.strictEqual(rulesMeta.semi, coreRules.get("semi").meta);
+            assert.strictEqual(rulesMeta.quotes, coreRules.get("quotes").meta);
+            assert.strictEqual(
+                rulesMeta["n/no-new-require"],
+                nodePlugin.rules["no-new-require"].meta
+            );
+        });
+    });
+
+    describe("outputFixes()", () => {
+        afterEach(() => {
+            sinon.verifyAndRestore();
+        });
+
+        it("should call fs.writeFile() for each result with output", async () => {
+            const fakeFS = {
+                writeFile: sinon.spy(() => Promise.resolve())
+            };
+            const spy = fakeFS.writeFile;
+            const { FlatESLint: localESLint } = proxyquire("../../../lib/eslint/flat-eslint", {
+                fs: {
+                    promises: fakeFS
+                }
+            });
+
+            const results = [
+                {
+                    filePath: path.resolve("foo.js"),
+                    output: "bar"
+                },
+                {
+                    filePath: path.resolve("bar.js"),
+                    output: "baz"
+                }
+            ];
+
+            await localESLint.outputFixes(results);
+
+            assert.strictEqual(spy.callCount, 2);
+            assert(spy.firstCall.calledWithExactly(path.resolve("foo.js"), "bar"), "First call was incorrect.");
+            assert(spy.secondCall.calledWithExactly(path.resolve("bar.js"), "baz"), "Second call was incorrect.");
+        });
+
+        it("should call fs.writeFile() for each result with output and not at all for a result without output", async () => {
+            const fakeFS = {
+                writeFile: sinon.spy(() => Promise.resolve())
+            };
+            const spy = fakeFS.writeFile;
+            const { FlatESLint: localESLint } = proxyquire("../../../lib/eslint/flat-eslint", {
+                fs: {
+                    promises: fakeFS
+                }
+            });
+            const results = [
+                {
+                    filePath: path.resolve("foo.js"),
+                    output: "bar"
+                },
+                {
+                    filePath: path.resolve("abc.js")
+                },
+                {
+                    filePath: path.resolve("bar.js"),
+                    output: "baz"
+                }
+            ];
+
+            await localESLint.outputFixes(results);
+
+            assert.strictEqual(spy.callCount, 2, "Call count was wrong");
+            assert(spy.firstCall.calledWithExactly(path.resolve("foo.js"), "bar"), "First call was incorrect.");
+            assert(spy.secondCall.calledWithExactly(path.resolve("bar.js"), "baz"), "Second call was incorrect.");
+        });
+
+        it("should throw if non object array is given to 'results' parameter", async () => {
+            await assert.rejects(() => FlatESLint.outputFixes(null), /'results' must be an array/u);
+            await assert.rejects(() => FlatESLint.outputFixes([null]), /'results' must include only objects/u);
+        });
+    });
+
+    describe("when evaluating code with comments to change config when allowInlineConfig is disabled", () => {
+        it("should report a violation for disabling rules", async () => {
+            const code = [
+                "alert('test'); // eslint-disable-line no-alert"
+            ].join("\n");
+            const config = {
+                ignore: true,
+                overrideConfigFile: true,
+                allowInlineConfig: false,
+                overrideConfig: {
+                    rules: {
+                        "eol-last": 0,
+                        "no-alert": 1,
+                        "no-trailing-spaces": 0,
+                        strict: 0,
+                        quotes: 0
+                    }
+                }
+            };
+            const eslintCLI = new FlatESLint(config);
+            const results = await eslintCLI.lintText(code);
+            const messages = results[0].messages;
+
+            assert.strictEqual(messages.length, 1);
+            assert.strictEqual(messages[0].ruleId, "no-alert");
+            assert.strictEqual(results[0].suppressedMessages.length, 0);
+        });
+
+        it("should not report a violation by default", async () => {
+            const code = [
+                "alert('test'); // eslint-disable-line no-alert"
+            ].join("\n");
+            const config = {
+                ignore: true,
+                overrideConfigFile: true,
+                allowInlineConfig: true,
+                overrideConfig: {
+                    rules: {
+                        "eol-last": 0,
+                        "no-alert": 1,
+                        "no-trailing-spaces": 0,
+                        strict: 0,
+                        quotes: 0
+                    }
+                }
+            };
+            const eslintCLI = new FlatESLint(config);
+            const results = await eslintCLI.lintText(code);
+            const messages = results[0].messages;
+
+            assert.strictEqual(messages.length, 0);
+            assert.strictEqual(results[0].suppressedMessages.length, 1);
+            assert.strictEqual(results[0].suppressedMessages[0].ruleId, "no-alert");
+        });
+    });
+
+    describe("when evaluating code when reportUnusedDisableDirectives is enabled", () => {
+        it("should report problems for unused eslint-disable directives", async () => {
+            const eslint = new FlatESLint({ overrideConfigFile: true, reportUnusedDisableDirectives: "error" });
+
+            assert.deepStrictEqual(
+                await eslint.lintText("/* eslint-disable */"),
+                [
+                    {
+                        filePath: "<text>",
+                        messages: [
+                            {
+                                ruleId: null,
+                                message: "Unused eslint-disable directive (no problems were reported).",
+                                line: 1,
+                                column: 1,
+                                fix: {
+                                    range: [0, 20],
+                                    text: " "
+                                },
+                                severity: 2,
+                                nodeType: null
+                            }
+                        ],
+                        suppressedMessages: [],
+                        errorCount: 1,
+                        warningCount: 0,
+                        fatalErrorCount: 0,
+                        fixableErrorCount: 1,
+                        fixableWarningCount: 0,
+                        source: "/* eslint-disable */",
+                        usedDeprecatedRules: []
+                    }
+                ]
+            );
+        });
+    });
+
+    describe("when retrieving version number", () => {
+        it("should return current version number", () => {
+            const eslintCLI = require("../../../lib/eslint/flat-eslint").FlatESLint;
+            const version = eslintCLI.version;
+
+            assert.strictEqual(typeof version, "string");
+            assert(parseInt(version[0], 10) >= 3);
+        });
+    });
+
+    describe("mutability", () => {
+
+        describe("rules", () => {
+            it("Loading rules in one instance doesn't mutate to another instance", async () => {
+                const filePath = getFixturePath("single-quoted.js");
+                const engine1 = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true,
+                    overrideConfig: {
+                        plugins: {
+                            example: {
+                                rules: {
+                                    "example-rule"() {
+                                        return {};
+                                    }
+                                }
+                            }
+                        },
+                        rules: { "example/example-rule": 1 }
+                    }
+                });
+                const engine2 = new FlatESLint({
+                    cwd: path.join(fixtureDir, ".."),
+                    overrideConfigFile: true
+                });
+                const fileConfig1 = await engine1.calculateConfigForFile(filePath);
+                const fileConfig2 = await engine2.calculateConfigForFile(filePath);
+
+                // plugin
+                assert.deepStrictEqual(fileConfig1.rules["example/example-rule"], [1], "example is present for engine 1");
+                assert.strictEqual(fileConfig2.rules, void 0, "example is not present for engine 2");
+            });
+        });
+    });
+
+    describe("with ignores config", () => {
+        const root = getFixturePath("cli-engine/ignore-patterns");
+
+        describe("ignores can add an ignore pattern ('foo.js').", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root,
+                files: {
+                    "eslint.config.js": `module.exports = {
+                        ignores: ["**/foo.js"]
+                    };`,
+                    "foo.js": "",
+                    "bar.js": "",
+                    "subdir/foo.js": "",
+                    "subdir/bar.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'true' for 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("foo.js"), true);
+                assert.strictEqual(await engine.isPathIgnored("subdir/foo.js"), true);
+            });
+
+            it("'isPathIgnored()' should return 'false' for 'bar.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("bar.js"), false);
+                assert.strictEqual(await engine.isPathIgnored("subdir/bar.js"), false);
+            });
+
+            it("'lintFiles()' should not verify 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(root, "bar.js"),
+                    path.join(root, "eslint.config.js"),
+                    path.join(root, "subdir/bar.js")
+                ]);
+            });
+        });
+
+        describe("ignores can add ignore patterns ('**/foo.js', '/bar.js').", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root + Date.now(),
+                files: {
+                    "eslint.config.js": `module.exports = {
+                        ignores: ["**/foo.js", "bar.js"]
+                    };`,
+                    "foo.js": "",
+                    "bar.js": "",
+                    "baz.js": "",
+                    "subdir/foo.js": "",
+                    "subdir/bar.js": "",
+                    "subdir/baz.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'true' for 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("foo.js"), true);
+                assert.strictEqual(await engine.isPathIgnored("subdir/foo.js"), true);
+            });
+
+            it("'isPathIgnored()' should return 'true' for '/bar.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("bar.js"), true);
+                assert.strictEqual(await engine.isPathIgnored("subdir/bar.js"), false);
+            });
+
+            it("'lintFiles()' should not verify 'foo.js' and '/bar.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "baz.js"),
+                    path.join(getPath(), "eslint.config.js"),
+                    path.join(getPath(), "subdir/bar.js"),
+                    path.join(getPath(), "subdir/baz.js")
+                ]);
+            });
+        });
+
+
+        /*
+         * These tests fail due to a bug in fast-flob that doesn't allow
+         * negated patterns inside of ignores. These tests won't work until
+         * this bug is fixed:
+         * https://github.com/mrmlnc/fast-glob/issues/356
+         */
+        xdescribe("ignorePatterns can unignore '/node_modules/foo'.", () => {
+
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root,
+                files: {
+                    "eslint.config.js": `module.exports = {
+                        ignores: ["!**/node_modules/foo/**"]
+                    };`,
+                    "node_modules/foo/index.js": "",
+                    "node_modules/foo/.dot.js": "",
+                    "node_modules/bar/index.js": "",
+                    "foo.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'false' for 'node_modules/foo/index.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("node_modules/foo/index.js"), false);
+            });
+
+            it("'isPathIgnored()' should return 'false' for 'node_modules/foo/.dot.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("node_modules/foo/.dot.js"), false);
+            });
+
+            it("'isPathIgnored()' should return 'true' for 'node_modules/bar/index.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("node_modules/bar/index.js"), true);
+            });
+
+            it("'lintFiles()' should verify 'node_modules/foo/index.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(root, "eslint.config.js"),
+                    path.join(root, "foo.js"),
+                    path.join(root, "node_modules/foo/index.js")
+                ]);
+            });
+        });
+
+        xdescribe(".eslintignore can re-ignore files that are unignored by ignorePatterns.", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root,
+                files: {
+                    "eslint.config.js": `module.exports = ${JSON.stringify({
+                        ignores: ["!.*"]
+                    })}`,
+                    ".eslintignore": ".foo*",
+                    ".foo.js": "",
+                    ".bar.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'true' for re-ignored '.foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored(".foo.js"), true);
+            });
+
+            it("'isPathIgnored()' should return 'false' for unignored '.bar.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored(".bar.js"), false);
+            });
+
+            it("'lintFiles()' should not lint re-ignored '.foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(root, ".bar.js"),
+                    path.join(root, "eslint.config.js")
+                ]);
+            });
+        });
+
+        xdescribe(".eslintignore can unignore files that are ignored by ignorePatterns.", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root,
+                files: {
+                    "eslint.config.js": `module.exports = ${JSON.stringify({
+                        ignores: ["**/*.js"]
+                    })}`,
+                    ".eslintignore": "!foo.js",
+                    "foo.js": "",
+                    "bar.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'false' for unignored 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("foo.js"), false);
+            });
+
+            it("'isPathIgnored()' should return 'true' for ignored 'bar.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+
+                assert.strictEqual(await engine.isPathIgnored("bar.js"), true);
+            });
+
+            it("'lintFiles()' should verify unignored 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(root, "foo.js")
+                ]);
+            });
+        });
+
+        describe("ignores in a config file should not be used if ignore: false.", () => {
+
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root,
+                files: {
+                    "eslint.config.js": `module.exports = {
+                        ignores: ["*.js"]
+                    }`,
+                    "foo.js": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'isPathIgnored()' should return 'false' for 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath(), ignore: false });
+
+                assert.strictEqual(await engine.isPathIgnored("foo.js"), false);
+            });
+
+            it("'lintFiles()' should verify 'foo.js'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath(), ignore: false });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(root, "eslint.config.js"),
+                    path.join(root, "foo.js")
+                ]);
+            });
+        });
+
+    });
+
+    describe("config.files adds lint targets", () => {
+        const root = getFixturePath("cli-engine/additional-lint-targets");
+
+
+        describe("if { files: 'foo/*.txt', ignores: '**/ignore.txt' } is present,", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root + 1,
+                files: {
+                    "eslint.config.js": `module.exports = [{
+                        files: ["foo/*.txt"],
+                        ignores: ["**/ignore.txt"]
+                    }];`,
+                    "foo/nested/test.txt": "",
+                    "foo/test.js": "",
+                    "foo/test.txt": "",
+                    "foo/ignore.txt": "",
+                    "bar/test.js": "",
+                    "bar/test.txt": "",
+                    "bar/ignore.txt": "",
+                    "test.js": "",
+                    "test.txt": "",
+                    "ignore.txt": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with a directory path should contain 'foo/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("."))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "bar/test.js"),
+                    path.join(getPath(), "eslint.config.js"),
+                    path.join(getPath(), "foo/test.js"),
+                    path.join(getPath(), "foo/test.txt"),
+                    path.join(getPath(), "test.js")
+                ]);
+            });
+
+            it("'lintFiles()' with a glob pattern '*.js' should not contain 'foo/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "bar/test.js"),
+                    path.join(getPath(), "eslint.config.js"),
+                    path.join(getPath(), "foo/test.js"),
+                    path.join(getPath(), "test.js")
+                ]);
+            });
+        });
+
+        describe("if { files: 'foo/*.txt', ignores: '**/ignore.txt' } is present and subdirectory is passed,", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root + 2,
+                files: {
+                    "eslint.config.js": `module.exports = [{
+                        files: ["foo/*.txt"],
+                        ignores: ["**/ignore.txt"]
+                    }];`,
+                    "foo/nested/test.txt": "",
+                    "foo/test.js": "",
+                    "foo/test.txt": "",
+                    "foo/ignore.txt": "",
+                    "bar/test.js": "",
+                    "bar/test.txt": "",
+                    "bar/ignore.txt": "",
+                    "test.js": "",
+                    "test.txt": "",
+                    "ignore.txt": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with a directory path should contain 'foo/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("foo"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "foo/test.js"),
+                    path.join(getPath(), "foo/test.txt")
+                ]);
+            });
+
+            it("'lintFiles()' with a glob pattern '*.js' should not contain 'foo/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("foo/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "foo/test.js")
+                ]);
+            });
+        });
+
+        describe("if { files: 'foo/**/*.txt' } is present,", () => {
+
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root + 3,
+                files: {
+                    "eslint.config.js": `module.exports = [
+                        {
+                            files: ["foo/**/*.txt"]
+                        }
+                    ]`,
+                    "foo/nested/test.txt": "",
+                    "foo/test.js": "",
+                    "foo/test.txt": "",
+                    "bar/test.js": "",
+                    "bar/test.txt": "",
+                    "test.js": "",
+                    "test.txt": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with a directory path should contain 'foo/test.txt' and 'foo/nested/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("."))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "bar/test.js"),
+                    path.join(getPath(), "eslint.config.js"),
+                    path.join(getPath(), "foo/nested/test.txt"),
+                    path.join(getPath(), "foo/test.js"),
+                    path.join(getPath(), "foo/test.txt"),
+                    path.join(getPath(), "test.js")
+                ]);
+            });
+        });
+
+        describe("if { files: 'foo/**/*' } is present,", () => {
+
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: root + 4,
+                files: {
+                    "eslint.config.js": `module.exports = [
+                        {
+                            files: ["foo/**/*"]
+                        }
+                    ]`,
+                    "foo/nested/test.txt": "",
+                    "foo/test.js": "",
+                    "foo/test.txt": "",
+                    "bar/test.js": "",
+                    "bar/test.txt": "",
+                    "test.js": "",
+                    "test.txt": ""
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with a directory path should NOT contain 'foo/test.txt' and 'foo/nested/test.txt'.", async () => {
+                const engine = new FlatESLint({ cwd: getPath() });
+                const filePaths = (await engine.lintFiles("."))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(filePaths, [
+                    path.join(getPath(), "bar/test.js"),
+                    path.join(getPath(), "eslint.config.js"),
+                    path.join(getPath(), "foo/test.js"),
+                    path.join(getPath(), "test.js")
+                ]);
+            });
+        });
+
+    });
+
+    describe("'ignores', 'files' of the configuration that the '--config' option provided should be resolved from CWD.", () => {
+        const root = getFixturePath("cli-engine/config-and-overrides-files");
+
+        describe("if { files: 'foo/*.txt', ... } is present by '--config node_modules/myconf/eslint.config.js',", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: `${root}a1`,
+                files: {
+                    "node_modules/myconf/eslint.config.js": `module.exports = [
+                        {
+                            files: ["foo/*.js"],
+                            rules: {
+                                eqeqeq: "error"
+                            }
+                        }
+                    ];`,
+                    "node_modules/myconf/foo/test.js": "a == b",
+                    "foo/test.js": "a == b"
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with 'foo/test.js' should use the files entry.", async () => {
+                const engine = new FlatESLint({
+                    overrideConfigFile: "node_modules/myconf/eslint.config.js",
+                    cwd: getPath(),
+                    ignore: false
+                });
+                const results = await engine.lintFiles("foo/test.js");
+
+                // Expected to be an 'eqeqeq' error because the file matches to `$CWD/foo/*.js`.
+                assert.deepStrictEqual(results, [
+                    {
+                        suppressedMessages: [],
+                        errorCount: 1,
+                        filePath: path.join(getPath(), "foo/test.js"),
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        messages: [
+                            {
+                                column: 3,
+                                endColumn: 5,
+                                endLine: 1,
+                                line: 1,
+                                message: "Expected '===' and instead saw '=='.",
+                                messageId: "unexpected",
+                                nodeType: "BinaryExpression",
+                                ruleId: "eqeqeq",
+                                severity: 2
+                            }
+                        ],
+                        source: "a == b",
+                        usedDeprecatedRules: [],
+                        warningCount: 0,
+                        fatalErrorCount: 0
+                    }
+                ]);
+            });
+
+            it("'lintFiles()' with 'node_modules/myconf/foo/test.js' should NOT use the files entry.", async () => {
+                const engine = new FlatESLint({
+                    overrideConfigFile: "node_modules/myconf/eslint.config.js",
+                    cwd: getPath(),
+                    ignore: false
+                });
+                const results = await engine.lintFiles("node_modules/myconf/foo/test.js");
+
+                // Expected to be no errors because the file doesn't match to `$CWD/foo/*.js`.
+                assert.deepStrictEqual(results, [
+                    {
+                        suppressedMessages: [],
+                        errorCount: 0,
+                        filePath: path.join(getPath(), "node_modules/myconf/foo/test.js"),
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        messages: [
+                            {
+                                fatal: false,
+                                message: "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override.",
+                                severity: 1
+                            }
+                        ],
+                        usedDeprecatedRules: [],
+                        warningCount: 1,
+                        fatalErrorCount: 0
+                    }
+                ]);
+            });
+        });
+
+        describe("if { files: '*', ignores: 'foo/*.txt', ... } is present by '--config bar/myconf/eslint.config.js',", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: `${root}a2`,
+                files: {
+                    "bar/myconf/eslint.config.js": `module.exports = [
+                        {
+                            files: ["**/*"],
+                            ignores: ["foo/*.js"],
+                            rules: {
+                                eqeqeq: "error"
+                            }
+                        }
+                    ]`,
+                    "bar/myconf/foo/test.js": "a == b",
+                    "foo/test.js": "a == b"
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with 'foo/test.js' should have no errors because no rules are enabled.", async () => {
+                const engine = new FlatESLint({
+                    overrideConfigFile: "bar/myconf/eslint.config.js",
+                    cwd: getPath(),
+                    ignore: false
+                });
+                const results = await engine.lintFiles("foo/test.js");
+
+                // Expected to be no errors because the file matches to `$CWD/foo/*.js`.
+                assert.deepStrictEqual(results, [
+                    {
+                        suppressedMessages: [],
+                        errorCount: 0,
+                        filePath: path.join(getPath(), "foo/test.js"),
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        messages: [],
+                        usedDeprecatedRules: [],
+                        warningCount: 0,
+                        fatalErrorCount: 0
+                    }
+                ]);
+            });
+
+            it("'lintFiles()' with 'bar/myconf/foo/test.js' should have an error because eqeqeq is enabled.", async () => {
+                const engine = new FlatESLint({
+                    overrideConfigFile: "bar/myconf/eslint.config.js",
+                    cwd: getPath(),
+                    ignore: false
+                });
+                const results = await engine.lintFiles("bar/myconf/foo/test.js");
+
+                // Expected to be an 'eqeqeq' error because the file doesn't match to `$CWD/foo/*.js`.
+                assert.deepStrictEqual(results, [
+                    {
+                        suppressedMessages: [],
+                        errorCount: 1,
+                        filePath: path.join(getPath(), "bar/myconf/foo/test.js"),
+                        fixableErrorCount: 0,
+                        fixableWarningCount: 0,
+                        messages: [
+                            {
+                                column: 3,
+                                endColumn: 5,
+                                endLine: 1,
+                                line: 1,
+                                message: "Expected '===' and instead saw '=='.",
+                                messageId: "unexpected",
+                                nodeType: "BinaryExpression",
+                                ruleId: "eqeqeq",
+                                severity: 2
+                            }
+                        ],
+                        source: "a == b",
+                        usedDeprecatedRules: [],
+                        warningCount: 0,
+                        fatalErrorCount: 0
+                    }
+                ]);
+            });
+        });
+
+        // dependent on https://github.com/mrmlnc/fast-glob/issues/86
+        xdescribe("if { ignores: 'foo/*.js', ... } is present by '--config node_modules/myconf/eslint.config.js',", () => {
+            const { prepare, cleanup, getPath } = createCustomTeardown({
+                cwd: `${root}a3`,
+                files: {
+                    "node_modules/myconf/eslint.config.js": `module.exports = {
+                        ignores: ["**/eslint.config.js", "!node_modules/myconf", "foo/*.js"],
+                        rules: {
+                            eqeqeq: "error"
+                        }
+                    }`,
+                    "node_modules/myconf/foo/test.js": "a == b",
+                    "foo/test.js": "a == b"
+                }
+            });
+
+            beforeEach(prepare);
+            afterEach(cleanup);
+
+            it("'lintFiles()' with '**/*.js' should iterate 'node_modules/myconf/foo/test.js' but not 'foo/test.js'.", async () => {
+                const engine = new FlatESLint({
+                    overrideConfigFile: "node_modules/myconf/eslint.config.js",
+                    cwd: getPath()
+                });
+                const files = (await engine.lintFiles("**/*.js"))
+                    .map(r => r.filePath)
+                    .sort();
+
+                assert.deepStrictEqual(files, [
+                    path.join(getPath(), "node_modules/myconf/foo/test.js")
+                ]);
+            });
+        });
+    });
+
+});
diff --git a/eslint/tests/lib/init/autoconfig.js b/eslint/tests/lib/init/autoconfig.js
deleted file mode 100644 (file)
index 3db6a63..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/**
- * @fileoverview Used for creating a suggested configuration based on project code.
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const assert = require("chai").assert,
-    autoconfig = require("../../../lib/init/autoconfig"),
-    sourceCodeUtils = require("../../../lib/init/source-code-utils"),
-    baseDefaultOptions = require("../../../conf/default-cli-options"),
-    recommendedConfig = require("../../conf/eslint-recommended");
-
-const defaultOptions = Object.assign({}, baseDefaultOptions, { cwd: process.cwd() });
-
-//------------------------------------------------------------------------------
-// Data
-//------------------------------------------------------------------------------
-
-const SOURCE_CODE_FIXTURE_FILENAME = "./tests/fixtures/autoconfig/source.js";
-const CONFIG_COMMENTS_FILENAME = "./tests/fixtures/autoconfig/source-with-comments.js";
-const SEVERITY = 2;
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-const rulesConfig = {
-    semi: [SEVERITY, [SEVERITY, "always"], [SEVERITY, "never"]],
-    "semi-spacing": [SEVERITY,
-        [SEVERITY, { before: true, after: true }],
-        [SEVERITY, { before: true, after: false }],
-        [SEVERITY, { before: false, after: true }],
-        [SEVERITY, { before: false, after: false }]
-    ],
-    quotes: [SEVERITY,
-        [SEVERITY, "single"],
-        [SEVERITY, "double"],
-        [SEVERITY, "backtick"],
-        [SEVERITY, "single", "avoid-escape"],
-        [SEVERITY, "double", "avoid-escape"],
-        [SEVERITY, "backtick", "avoid-escape"]]
-};
-
-const errorRulesConfig = {
-    "no-unused-vars": [SEVERITY],
-    "semi-spacing": [SEVERITY,
-        [SEVERITY, { before: true, after: true }],
-        [SEVERITY, { before: true, after: false }],
-        [SEVERITY, { before: false, after: true }],
-        [SEVERITY, { before: false, after: false }]
-    ]
-};
-
-describe("autoconfig", () => {
-
-    describe("Registry", () => {
-
-        it("should set up a registry for rules in a provided rulesConfig", () => {
-            const expectedRules = Object.keys(rulesConfig);
-            const registry = new autoconfig.Registry(rulesConfig);
-
-            assert.strictEqual(Object.keys(registry.rules).length, 3);
-            assert.sameMembers(Object.keys(registry.rules), expectedRules);
-            assert.isArray(registry.rules.semi);
-            assert.isArray(registry.rules["semi-spacing"]);
-            assert.isArray(registry.rules.quotes);
-            assert.lengthOf(registry.rules.semi, 3);
-            assert.lengthOf(registry.rules["semi-spacing"], 5);
-            assert.lengthOf(registry.rules.quotes, 7);
-        });
-
-        it("should not have any rules if constructed without a config argument", () => {
-            const registry = new autoconfig.Registry();
-
-            assert.isObject(registry.rules);
-            assert.lengthOf(Object.keys(registry.rules), 0);
-        });
-
-        it("should create registryItems for each rule with the proper keys", () => {
-            const registry = new autoconfig.Registry(rulesConfig);
-
-            assert.isObject(registry.rules.semi[0]);
-            assert.isObject(registry.rules["semi-spacing"][0]);
-            assert.isObject(registry.rules.quotes[0]);
-            assert.property(registry.rules.semi[0], "config");
-            assert.property(registry.rules.semi[0], "specificity");
-            assert.property(registry.rules.semi[0], "errorCount");
-        });
-
-        it("should populate the config property correctly", () => {
-            const registry = new autoconfig.Registry(rulesConfig);
-
-            assert.strictEqual(registry.rules.quotes[0].config, SEVERITY);
-            assert.deepStrictEqual(registry.rules.quotes[1].config, [SEVERITY, "single"]);
-            assert.deepStrictEqual(registry.rules.quotes[2].config, [SEVERITY, "double"]);
-            assert.deepStrictEqual(registry.rules.quotes[3].config, [SEVERITY, "backtick"]);
-            assert.deepStrictEqual(registry.rules.quotes[4].config, [SEVERITY, "single", "avoid-escape"]);
-            assert.deepStrictEqual(registry.rules.quotes[5].config, [SEVERITY, "double", "avoid-escape"]);
-            assert.deepStrictEqual(registry.rules.quotes[6].config, [SEVERITY, "backtick", "avoid-escape"]);
-        });
-
-        it("should assign the correct specificity", () => {
-            const registry = new autoconfig.Registry(rulesConfig);
-
-            assert.strictEqual(registry.rules.quotes[0].specificity, 1);
-            assert.strictEqual(registry.rules.quotes[1].specificity, 2);
-            assert.strictEqual(registry.rules.quotes[6].specificity, 3);
-        });
-
-        it("should initially leave the errorCount as undefined", () => {
-            const registry = new autoconfig.Registry(rulesConfig);
-
-            assert.isUndefined(registry.rules.quotes[0].errorCount);
-            assert.isUndefined(registry.rules.quotes[1].errorCount);
-            assert.isUndefined(registry.rules.quotes[6].errorCount);
-        });
-
-        describe("populateFromCoreRules()", () => {
-
-            it("should add core rules to registry", () => {
-                const registry = new autoconfig.Registry();
-
-                registry.populateFromCoreRules();
-                const finalRuleCount = Object.keys(registry.rules).length;
-
-                assert(finalRuleCount > 0);
-                assert.include(Object.keys(registry.rules), "eqeqeq");
-            });
-
-            it("should not add deprecated rules", () => {
-                const registry = new autoconfig.Registry();
-
-                registry.populateFromCoreRules();
-
-                const { rules } = registry;
-
-                assert.notProperty(rules, "id-blacklist");
-                assert.notProperty(rules, "no-negated-in-lhs");
-                assert.notProperty(rules, "no-process-exit");
-                assert.notProperty(rules, "no-spaced-func");
-                assert.notProperty(rules, "prefer-reflect");
-            });
-
-            it("should not add duplicate rules", () => {
-                const registry = new autoconfig.Registry(rulesConfig);
-
-                registry.populateFromCoreRules();
-                const semiCount = Object.keys(registry.rules).filter(ruleId => ruleId === "semi").length;
-
-                assert.strictEqual(semiCount, 1);
-            });
-        });
-
-        describe("buildRuleSets()", () => {
-            let ruleSets;
-
-            beforeEach(() => {
-                const registry = new autoconfig.Registry(rulesConfig);
-
-                ruleSets = registry.buildRuleSets();
-            });
-
-            it("should create an array of rule configuration sets", () => {
-                assert.isArray(ruleSets);
-            });
-
-            it("should include configs for each rule (at least for the first set)", () => {
-                assert.sameMembers(Object.keys(ruleSets[0]), ["semi", "semi-spacing", "quotes"]);
-            });
-
-            it("should create the first set from default rule configs (severity only)", () => {
-                assert.deepStrictEqual(ruleSets[0], { semi: SEVERITY, "semi-spacing": SEVERITY, quotes: SEVERITY });
-            });
-
-            it("should create as many ruleSets as the highest number of configs in a rule", () => {
-
-                // `quotes` has 7 possible configurations
-                assert.lengthOf(ruleSets, 7);
-            });
-        });
-
-        describe("lintSourceCode()", () => {
-            let registry;
-
-            beforeEach(() => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(SOURCE_CODE_FIXTURE_FILENAME, config);
-
-                registry = new autoconfig.Registry(rulesConfig);
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-            });
-
-            it("should populate the errorCount of all registryItems", () => {
-                const expectedRules = ["semi", "semi-spacing", "quotes"];
-
-                assert.sameMembers(Object.keys(registry.rules), expectedRules);
-                expectedRules.forEach(ruleId => {
-                    assert(registry.rules[ruleId].length > 0);
-                    registry.rules[ruleId].forEach(conf => {
-                        assert.isNumber(conf.errorCount);
-                    });
-                });
-            });
-
-            it("should correctly set the error count of configurations", () => {
-                assert.strictEqual(registry.rules.semi[0].config, SEVERITY);
-                assert.strictEqual(registry.rules.semi[0].errorCount, 0);
-                assert.deepStrictEqual(registry.rules.semi[2].config, [SEVERITY, "never"]);
-                assert.strictEqual(registry.rules.semi[2].errorCount, 3);
-            });
-
-            it("should respect inline eslint config comments (and not crash when they make linting errors)", () => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(CONFIG_COMMENTS_FILENAME, config);
-                const expectedRegistry = [
-                    { config: 2, specificity: 1, errorCount: 3 },
-                    { config: [2, "always"], specificity: 2, errorCount: 3 },
-                    { config: [2, "never"], specificity: 2, errorCount: 3 }
-                ];
-
-                registry = new autoconfig.Registry(rulesConfig);
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-
-                assert.deepStrictEqual(registry.rules.semi, expectedRegistry);
-            });
-        });
-
-        describe("stripFailingConfigs()", () => {
-            let registry;
-
-            beforeEach(() => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(SOURCE_CODE_FIXTURE_FILENAME, config);
-
-                registry = new autoconfig.Registry(rulesConfig);
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-                registry = registry.stripFailingConfigs();
-            });
-
-            it("should remove all registryItems with a non-zero errorCount", () => {
-                assert.lengthOf(registry.rules.semi, 2);
-                assert.lengthOf(registry.rules["semi-spacing"], 3);
-                assert.lengthOf(registry.rules.quotes, 1);
-                registry.rules.semi.forEach(registryItem => {
-                    assert.strictEqual(registryItem.errorCount, 0);
-                });
-                registry.rules["semi-spacing"].forEach(registryItem => {
-                    assert.strictEqual(registryItem.errorCount, 0);
-                });
-                registry.rules.quotes.forEach(registryItem => {
-                    assert.strictEqual(registryItem.errorCount, 0);
-                });
-            });
-        });
-
-        describe("getFailingRulesRegistry()", () => {
-            let failingRegistry;
-
-            beforeEach(() => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(SOURCE_CODE_FIXTURE_FILENAME, config);
-                let registry = new autoconfig.Registry(errorRulesConfig);
-
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-                failingRegistry = registry.getFailingRulesRegistry();
-            });
-
-            it("should return a registry with no registryItems with an errorCount of zero", () => {
-                const failingRules = Object.keys(failingRegistry.rules);
-
-                assert.deepStrictEqual(failingRules, ["no-unused-vars"]);
-                assert.lengthOf(failingRegistry.rules["no-unused-vars"], 1);
-                assert(failingRegistry.rules["no-unused-vars"][0].errorCount > 0);
-            });
-        });
-
-        describe("createConfig()", () => {
-            let createdConfig;
-
-            beforeEach(() => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(SOURCE_CODE_FIXTURE_FILENAME, config);
-                let registry = new autoconfig.Registry(rulesConfig);
-
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-                registry = registry.stripFailingConfigs();
-                createdConfig = registry.createConfig();
-            });
-
-            it("should create a config with a rules property", () => {
-                assert.property(createdConfig, "rules");
-            });
-
-            it("should add rules which have only one registryItem to the config", () => {
-                const configuredRules = Object.keys(createdConfig.rules);
-
-                assert.deepStrictEqual(configuredRules, ["quotes"]);
-            });
-
-            it("should set the configuration of the rule to the registryItem's `config` value", () => {
-                assert.deepStrictEqual(createdConfig.rules.quotes, [2, "double", "avoid-escape"]);
-            });
-
-            it("should not care how many errors the config has", () => {
-                const config = { ignore: false };
-                const sourceCode = sourceCodeUtils.getSourceCodeOfFiles(SOURCE_CODE_FIXTURE_FILENAME, config);
-                let registry = new autoconfig.Registry(errorRulesConfig);
-
-                registry = registry.lintSourceCode(sourceCode, defaultOptions);
-                const failingRegistry = registry.getFailingRulesRegistry();
-
-                createdConfig = failingRegistry.createConfig();
-                const configuredRules = Object.keys(createdConfig.rules);
-
-                assert.deepStrictEqual(configuredRules, ["no-unused-vars"]);
-            });
-        });
-
-        describe("filterBySpecificity()", () => {
-            let registry;
-
-            beforeEach(() => {
-                registry = new autoconfig.Registry(rulesConfig);
-            });
-
-            it("should return a registry where all configs have a desired specificity", () => {
-                const filteredRegistry1 = registry.filterBySpecificity(1);
-                const filteredRegistry2 = registry.filterBySpecificity(2);
-                const filteredRegistry3 = registry.filterBySpecificity(3);
-
-                assert.lengthOf(filteredRegistry1.rules.semi, 1);
-                assert.lengthOf(filteredRegistry1.rules["semi-spacing"], 1);
-                assert.lengthOf(filteredRegistry1.rules.quotes, 1);
-                assert.lengthOf(filteredRegistry2.rules.semi, 2);
-                assert.lengthOf(filteredRegistry2.rules["semi-spacing"], 4);
-                assert.lengthOf(filteredRegistry2.rules.quotes, 3);
-                assert.lengthOf(filteredRegistry3.rules.quotes, 3);
-            });
-        });
-    });
-
-    describe("extendFromRecommended()", () => {
-        it("should return a configuration which has `extends` key with Array type value", () => {
-            const oldConfig = { extends: [], rules: {} };
-            const newConfig = autoconfig.extendFromRecommended(oldConfig);
-
-            assert.exists(newConfig.extends);
-            assert.isArray(newConfig.extends);
-        });
-
-        it("should return a configuration which has array property `extends`", () => {
-            const oldConfig = { extends: [], rules: {} };
-            const newConfig = autoconfig.extendFromRecommended(oldConfig);
-
-            assert.include(newConfig.extends, "eslint:recommended");
-        });
-
-        it("should return a configuration which preserves the previous extending configurations", () => {
-            const oldConfig = { extends: ["previous:configuration1", "previous:configuration2"], rules: {} };
-            const newConfig = autoconfig.extendFromRecommended(oldConfig);
-
-            assert.includeMembers(newConfig.extends, oldConfig.extends);
-        });
-
-        it("should return a configuration which has `eslint:recommended` at the first of `extends`", () => {
-            const oldConfig = { extends: ["previous:configuration1", "previous:configuration2"], rules: {} };
-            const newConfig = autoconfig.extendFromRecommended(oldConfig);
-            const [firstExtendInNewConfig] = newConfig.extends;
-
-            assert.strictEqual(firstExtendInNewConfig, "eslint:recommended");
-        });
-
-        it("should return a configuration which not includes rules configured in `eslint:recommended`", () => {
-            const oldConfig = { extends: [], rules: { ...recommendedConfig.rules } };
-            const newConfig = autoconfig.extendFromRecommended(oldConfig);
-
-            assert.notInclude(newConfig.rules, oldConfig.rules);
-        });
-    });
-});
diff --git a/eslint/tests/lib/init/config-file.js b/eslint/tests/lib/init/config-file.js
deleted file mode 100644 (file)
index 50a9af1..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * @fileoverview Tests for ConfigFile
- * @author Nicholas C. Zakas
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const assert = require("chai").assert,
-    sinon = require("sinon"),
-    path = require("path"),
-    yaml = require("js-yaml"),
-    espree = require("espree"),
-    ConfigFile = require("../../../lib/init/config-file"),
-    { CLIEngine } = require("../../../lib/cli-engine");
-
-const proxyquire = require("proxyquire").noCallThru().noPreserveCache();
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Helper function get easily get a path in the fixtures directory.
- * @param {string} filepath The path to find in the fixtures directory.
- * @returns {string} Full path in the fixtures directory.
- * @private
- */
-function getFixturePath(filepath) {
-    return path.resolve(__dirname, "../../fixtures/config-file", filepath);
-}
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-describe("ConfigFile", () => {
-    describe("write()", () => {
-        let config;
-
-        beforeEach(() => {
-            config = {
-                env: {
-                    browser: true,
-                    node: true
-                },
-                rules: {
-                    quotes: 2,
-                    semi: 1
-                }
-            };
-        });
-
-        afterEach(() => {
-            sinon.verifyAndRestore();
-        });
-
-        [
-            ["JavaScript", "foo.js", espree.parse],
-            ["JSON", "bar.json", JSON.parse],
-            ["YAML", "foo.yaml", yaml.load],
-            ["YML", "foo.yml", yaml.load]
-        ].forEach(([fileType, filename, validate]) => {
-
-            it(`should write a file through fs when a ${fileType} path is passed`, () => {
-                const fakeFS = {
-                    writeFileSync: () => {}
-                };
-
-                sinon.mock(fakeFS).expects("writeFileSync").withExactArgs(
-                    filename,
-                    sinon.match(value => !!validate(value)),
-                    "utf8"
-                );
-
-                const StubbedConfigFile = proxyquire("../../../lib/init/config-file", {
-                    fs: fakeFS
-                });
-
-                StubbedConfigFile.write(config, filename);
-            });
-
-            it("should include a newline character at EOF", () => {
-                const fakeFS = {
-                    writeFileSync: () => {}
-                };
-
-                sinon.mock(fakeFS).expects("writeFileSync").withExactArgs(
-                    filename,
-                    sinon.match(value => value.endsWith("\n")),
-                    "utf8"
-                );
-
-                const StubbedConfigFile = proxyquire("../../../lib/init/config-file", {
-                    fs: fakeFS
-                });
-
-                StubbedConfigFile.write(config, filename);
-            });
-        });
-
-        it("should make sure js config files match linting rules", () => {
-            const fakeFS = {
-                writeFileSync: () => {}
-            };
-
-            const singleQuoteConfig = {
-                rules: {
-                    quotes: [2, "single"]
-                }
-            };
-
-            sinon.mock(fakeFS).expects("writeFileSync").withExactArgs(
-                "test-config.js",
-                sinon.match(value => !value.includes("\"")),
-                "utf8"
-            );
-
-            const StubbedConfigFile = proxyquire("../../../lib/init/config-file", {
-                fs: fakeFS
-            });
-
-            StubbedConfigFile.write(singleQuoteConfig, "test-config.js");
-        });
-
-        it("should still write a js config file even if linting fails", () => {
-            const fakeFS = {
-                writeFileSync: () => {}
-            };
-            const fakeCLIEngine = sinon.mock().withExactArgs(sinon.match({
-                baseConfig: config,
-                fix: true,
-                useEslintrc: false
-            }));
-
-            Object.defineProperties(fakeCLIEngine.prototype, Object.getOwnPropertyDescriptors(CLIEngine.prototype));
-            sinon.stub(fakeCLIEngine.prototype, "executeOnText").throws();
-
-            sinon.mock(fakeFS).expects("writeFileSync").once();
-
-            const StubbedConfigFile = proxyquire("../../../lib/init/config-file", {
-                fs: fakeFS,
-                "../cli-engine": { CLIEngine: fakeCLIEngine }
-            });
-
-            assert.throws(() => {
-                StubbedConfigFile.write(config, "test-config.js");
-            });
-        });
-
-        it("should throw error if file extension is not valid", () => {
-            assert.throws(() => {
-                ConfigFile.write({}, getFixturePath("yaml/.eslintrc.class"));
-            }, /write to unknown file type/u);
-        });
-    });
-});
diff --git a/eslint/tests/lib/init/config-initializer.js b/eslint/tests/lib/init/config-initializer.js
deleted file mode 100644 (file)
index 81e4e52..0000000
+++ /dev/null
@@ -1,577 +0,0 @@
-/**
- * @fileoverview Tests for configInitializer.
- * @author Ilya Volodin
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const assert = require("chai").assert,
-    fs = require("fs"),
-    path = require("path"),
-    os = require("os"),
-    sinon = require("sinon"),
-    sh = require("shelljs"),
-    espree = require("espree"),
-    autoconfig = require("../../../lib/init/autoconfig"),
-    npmUtils = require("../../../lib/init/npm-utils");
-
-const originalDir = process.cwd();
-const proxyquire = require("proxyquire").noPreserveCache();
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-let answers = {};
-let pkgJSONContents = {};
-let pkgJSONPath = "";
-
-describe("configInitializer", () => {
-
-    let fixtureDir,
-        npmCheckStub,
-        npmInstallStub,
-        npmFetchPeerDependenciesStub,
-        init,
-        localESLintVersion = null;
-
-    const log = {
-        info: sinon.spy(),
-        error: sinon.spy()
-    };
-    const requireStubs = {
-        "../shared/logging": log,
-        "../shared/relative-module-resolver": {
-            resolve() {
-                if (localESLintVersion) {
-                    return `local-eslint-${localESLintVersion}`;
-                }
-                throw new Error("Cannot find module");
-            }
-        },
-        "local-eslint-3.18.0": { linter: { version: "3.18.0" }, "@noCallThru": true },
-        "local-eslint-3.19.0": { linter: { version: "3.19.0" }, "@noCallThru": true },
-        "local-eslint-4.0.0": { linter: { version: "4.0.0" }, "@noCallThru": true }
-    };
-
-    /**
-     * Returns the path inside of the fixture directory.
-     * @param {...string} args file path segments.
-     * @returns {string} The path inside the fixture directory.
-     * @private
-     */
-    function getFixturePath(...args) {
-        const filepath = path.join(fixtureDir, ...args);
-
-        try {
-            return fs.realpathSync(filepath);
-        } catch {
-            return filepath;
-        }
-    }
-
-    // copy into clean area so as not to get "infected" by this project's .eslintrc files
-    before(() => {
-        fixtureDir = path.join(os.tmpdir(), "eslint/fixtures/config-initializer");
-        sh.mkdir("-p", fixtureDir);
-        sh.cp("-r", "./tests/fixtures/config-initializer/.", fixtureDir);
-        fixtureDir = fs.realpathSync(fixtureDir);
-    });
-
-    beforeEach(() => {
-        npmInstallStub = sinon.stub(npmUtils, "installSyncSaveDev");
-        npmCheckStub = sinon.stub(npmUtils, "checkDevDeps").callsFake(packages => packages.reduce((status, pkg) => {
-            status[pkg] = false;
-            return status;
-        }, {}));
-        npmFetchPeerDependenciesStub = sinon
-            .stub(npmUtils, "fetchPeerDependencies")
-            .returns({
-                eslint: "^3.19.0",
-                "eslint-plugin-jsx-a11y": "^5.0.1",
-                "eslint-plugin-import": "^2.2.0",
-                "eslint-plugin-react": "^7.0.1"
-            });
-        init = proxyquire("../../../lib/init/config-initializer", requireStubs);
-    });
-
-    afterEach(() => {
-        log.info.resetHistory();
-        log.error.resetHistory();
-        npmInstallStub.restore();
-        npmCheckStub.restore();
-        npmFetchPeerDependenciesStub.restore();
-    });
-
-    after(() => {
-        sh.rm("-r", fixtureDir);
-    });
-
-    describe("processAnswers()", () => {
-
-        describe("prompt", () => {
-
-            beforeEach(() => {
-                answers = {
-                    purpose: "style",
-                    source: "prompt",
-                    extendDefault: true,
-                    indent: 2,
-                    quotes: "single",
-                    linebreak: "unix",
-                    semi: true,
-                    moduleType: "esm",
-                    es6Globals: true,
-                    env: ["browser"],
-                    format: "JSON"
-                };
-            });
-
-            it("should create default config", () => {
-                const config = init.processAnswers(answers);
-
-                assert.deepStrictEqual(config.rules.indent, ["error", 2]);
-                assert.deepStrictEqual(config.rules.quotes, ["error", "single"]);
-                assert.deepStrictEqual(config.rules["linebreak-style"], ["error", "unix"]);
-                assert.deepStrictEqual(config.rules.semi, ["error", "always"]);
-                assert.strictEqual(config.env.es2021, true);
-                assert.strictEqual(config.parserOptions.ecmaVersion, espree.latestEcmaVersion);
-                assert.strictEqual(config.parserOptions.sourceType, "module");
-                assert.strictEqual(config.env.browser, true);
-                assert.strictEqual(config.extends, "eslint:recommended");
-            });
-
-            it("should disable semi", () => {
-                answers.semi = false;
-                const config = init.processAnswers(answers);
-
-                assert.deepStrictEqual(config.rules.semi, ["error", "never"]);
-            });
-
-            it("should enable react plugin", () => {
-                answers.framework = "react";
-                const config = init.processAnswers(answers);
-
-                assert.strictEqual(config.parserOptions.ecmaFeatures.jsx, true);
-                assert.strictEqual(config.parserOptions.ecmaVersion, espree.latestEcmaVersion);
-                assert.deepStrictEqual(config.plugins, ["react"]);
-            });
-
-            it("should enable vue plugin", () => {
-                answers.framework = "vue";
-                const config = init.processAnswers(answers);
-
-                assert.strictEqual(config.parserOptions.ecmaVersion, espree.latestEcmaVersion);
-                assert.deepStrictEqual(config.plugins, ["vue"]);
-                assert.deepStrictEqual(config.extends, ["eslint:recommended", "plugin:vue/essential"]);
-            });
-
-            it("should enable typescript parser and plugin", () => {
-                answers.typescript = true;
-                const config = init.processAnswers(answers);
-
-                assert.strictEqual(config.parser, "@typescript-eslint/parser");
-                assert.deepStrictEqual(config.plugins, ["@typescript-eslint"]);
-                assert.deepStrictEqual(config.extends, ["eslint:recommended", "plugin:@typescript-eslint/recommended"]);
-            });
-
-            it("should enable typescript parser and plugin with vue", () => {
-                answers.framework = "vue";
-                answers.typescript = true;
-                const config = init.processAnswers(answers);
-
-                assert.deepStrictEqual(config.extends, ["eslint:recommended", "plugin:vue/essential", "plugin:@typescript-eslint/recommended"]);
-                assert.strictEqual(config.parserOptions.parser, "@typescript-eslint/parser");
-                assert.deepStrictEqual(config.plugins, ["vue", "@typescript-eslint"]);
-            });
-
-            it("should extend eslint:recommended", () => {
-                const config = init.processAnswers(answers);
-
-                assert.strictEqual(config.extends, "eslint:recommended");
-            });
-
-            it("should not use commonjs by default", () => {
-                const config = init.processAnswers(answers);
-
-                assert.isUndefined(config.env.commonjs);
-            });
-
-            it("should use commonjs when set", () => {
-                answers.moduleType = "commonjs";
-                const config = init.processAnswers(answers);
-
-                assert.isTrue(config.env.commonjs);
-            });
-        });
-
-        describe("guide", () => {
-            it("should support the google style guide", () => {
-                const config = { extends: "google" };
-                const modules = init.getModulesList(config);
-
-                assert.deepStrictEqual(config, { extends: "google", installedESLint: true });
-                assert.include(modules, "eslint-config-google@latest");
-            });
-
-            it("should support the airbnb style guide", () => {
-                const config = { extends: "airbnb" };
-                const modules = init.getModulesList(config);
-
-                assert.deepStrictEqual(config, { extends: "airbnb", installedESLint: true });
-                assert.include(modules, "eslint-config-airbnb@latest");
-            });
-
-            it("should support the airbnb base style guide", () => {
-                const config = { extends: "airbnb-base" };
-                const modules = init.getModulesList(config);
-
-                assert.deepStrictEqual(config, { extends: "airbnb-base", installedESLint: true });
-                assert.include(modules, "eslint-config-airbnb-base@latest");
-            });
-
-            it("should support the standard style guide", () => {
-                const config = { extends: "standard" };
-                const modules = init.getModulesList(config);
-
-                assert.deepStrictEqual(config, { extends: "standard", installedESLint: true });
-                assert.include(modules, "eslint-config-standard@latest");
-            });
-
-            it("should support the xo style guide", () => {
-                const config = { extends: "xo" };
-                const modules = init.getModulesList(config);
-
-                assert.deepStrictEqual(config, { extends: "xo", installedESLint: true });
-                assert.include(modules, "eslint-config-xo@latest");
-            });
-
-            it("should install required sharable config", () => {
-                const config = { extends: "google" };
-
-                init.installModules(init.getModulesList(config));
-                assert(npmInstallStub.calledOnce);
-                assert(npmInstallStub.firstCall.args[0].some(name => name.startsWith("eslint-config-google@")));
-            });
-
-            it("should install ESLint if not installed locally", () => {
-                const config = { extends: "google" };
-
-                init.installModules(init.getModulesList(config));
-                assert(npmInstallStub.calledOnce);
-                assert(npmInstallStub.firstCall.args[0].some(name => name.startsWith("eslint@")));
-            });
-
-            it("should install peerDependencies of the sharable config", () => {
-                const config = { extends: "airbnb" };
-
-                init.installModules(init.getModulesList(config));
-
-                assert(npmFetchPeerDependenciesStub.calledOnce);
-                assert(npmFetchPeerDependenciesStub.firstCall.args[0] === "eslint-config-airbnb@latest");
-                assert(npmInstallStub.calledOnce);
-                assert.deepStrictEqual(
-                    npmInstallStub.firstCall.args[0],
-                    [
-                        "eslint-config-airbnb@latest",
-                        "eslint@^3.19.0",
-                        "eslint-plugin-jsx-a11y@^5.0.1",
-                        "eslint-plugin-import@^2.2.0",
-                        "eslint-plugin-react@^7.0.1"
-                    ]
-                );
-            });
-
-            describe("hasESLintVersionConflict (Note: peerDependencies always `eslint: \"^3.19.0\"` by stubs)", () => {
-                describe("if local ESLint is not found,", () => {
-                    before(() => {
-                        localESLintVersion = null;
-                    });
-
-                    it("should return false.", () => {
-                        const result = init.hasESLintVersionConflict({ styleguide: "airbnb" });
-
-                        assert.strictEqual(result, false);
-                    });
-                });
-
-                describe("if local ESLint is 3.19.0,", () => {
-                    before(() => {
-                        localESLintVersion = "3.19.0";
-                    });
-
-                    it("should return false.", () => {
-                        const result = init.hasESLintVersionConflict({ styleguide: "airbnb" });
-
-                        assert.strictEqual(result, false);
-                    });
-                });
-
-                describe("if local ESLint is 4.0.0,", () => {
-                    before(() => {
-                        localESLintVersion = "4.0.0";
-                    });
-
-                    it("should return true.", () => {
-                        const result = init.hasESLintVersionConflict({ styleguide: "airbnb" });
-
-                        assert.strictEqual(result, true);
-                    });
-                });
-
-                describe("if local ESLint is 3.18.0,", () => {
-                    before(() => {
-                        localESLintVersion = "3.18.0";
-                    });
-
-                    it("should return true.", () => {
-                        const result = init.hasESLintVersionConflict({ styleguide: "airbnb" });
-
-                        assert.strictEqual(result, true);
-                    });
-                });
-            });
-
-            it("should support the standard style guide with Vue.js", () => {
-                const config = {
-                    plugins: ["vue"],
-                    extends: ["plugin:vue/essential", "standard"]
-                };
-                const modules = init.getModulesList(config);
-
-                assert.include(modules, "eslint-plugin-vue@latest");
-                assert.include(modules, "eslint-config-standard@latest");
-            });
-
-            it("should support custom parser", () => {
-                const config = {
-                    parser: "@typescript-eslint/parser"
-                };
-                const modules = init.getModulesList(config);
-
-                assert.include(modules, "@typescript-eslint/parser@latest");
-            });
-
-            it("should support custom parser with Vue.js", () => {
-                const config = {
-
-                    // We should declare the parser at `parserOptions` when using with `eslint-plugin-vue`.
-                    parserOptions: {
-                        parser: "@typescript-eslint/parser"
-                    }
-                };
-                const modules = init.getModulesList(config);
-
-                assert.include(modules, "@typescript-eslint/parser@latest");
-            });
-        });
-
-        describe("auto", () => {
-            const completeSpy = sinon.spy();
-            let config;
-
-            before(() => {
-                const patterns = [
-                    getFixturePath("lib"),
-                    getFixturePath("tests")
-                ].join(" ");
-
-                answers = {
-                    purpose: "style",
-                    source: "auto",
-                    patterns,
-                    env: ["browser"],
-                    format: "JSON"
-                };
-
-                sinon.stub(console, "log"); // necessary to replace, because of progress bar
-
-                process.chdir(fixtureDir);
-                config = init.processAnswers(answers);
-                sinon.restore();
-            });
-
-            after(() => {
-                sinon.restore();
-            });
-
-            afterEach(() => {
-                process.chdir(originalDir);
-                sinon.restore();
-            });
-
-            it("should create a config", () => {
-                assert.isTrue(completeSpy.notCalled);
-                assert.ok(config);
-            });
-
-            it("should create the config based on examined files", () => {
-                assert.deepStrictEqual(config.rules.quotes, ["error", "double"]);
-                assert.strictEqual(config.rules.semi, "off");
-            });
-
-            it("should extend and not disable recommended rules", () => {
-                assert.strictEqual(config.extends, "eslint:recommended");
-                assert.notProperty(config.rules, "no-debugger");
-            });
-
-            it("should not include deprecated rules", () => {
-                assert.notProperty(config.rules, "id-blacklist");
-                assert.notProperty(config.rules, "no-negated-in-lhs");
-                assert.notProperty(config.rules, "no-process-exit");
-                assert.notProperty(config.rules, "no-spaced-func");
-                assert.notProperty(config.rules, "prefer-reflect");
-            });
-
-            it("should support new ES features if using later ES version", () => {
-                const filename = getFixturePath("new-es-features");
-
-                answers.patterns = filename;
-                answers.ecmaVersion = 2017;
-                process.chdir(fixtureDir);
-                config = init.processAnswers(answers);
-            });
-
-            it("should throw on fatal parsing error", () => {
-                const filename = getFixturePath("parse-error");
-
-                sinon.stub(autoconfig, "extendFromRecommended");
-                answers.patterns = filename;
-                process.chdir(fixtureDir);
-                assert.throws(() => {
-                    config = init.processAnswers(answers);
-                }, "Parsing error: Unexpected token ;");
-            });
-
-            it("should throw if no files are matched from patterns", () => {
-                sinon.stub(autoconfig, "extendFromRecommended");
-                answers.patterns = "not-a-real-filename";
-                process.chdir(fixtureDir);
-                assert.throws(() => {
-                    config = init.processAnswers(answers);
-                }, "No files matching 'not-a-real-filename' were found.");
-            });
-        });
-    });
-
-    describe("writeFile()", () => {
-
-        beforeEach(() => {
-            answers = {
-                purpose: "style",
-                source: "prompt",
-                extendDefault: true,
-                indent: 2,
-                quotes: "single",
-                linebreak: "unix",
-                semi: true,
-                moduleType: "esm",
-                es6Globals: true,
-                env: ["browser"],
-                format: "JSON"
-            };
-
-            pkgJSONContents = {
-                name: "config-initializer",
-                version: "1.0.0"
-            };
-
-            process.chdir(fixtureDir);
-
-            pkgJSONPath = path.resolve(fixtureDir, "package.json");
-        });
-
-        afterEach(() => {
-            process.chdir(originalDir);
-        });
-
-        it("should create .eslintrc.json", () => {
-            const config = init.processAnswers(answers);
-            const filePath = path.resolve(fixtureDir, ".eslintrc.json");
-
-            fs.writeFileSync(pkgJSONPath, JSON.stringify(pkgJSONContents));
-
-            init.writeFile(config, answers.format);
-
-            assert.isTrue(fs.existsSync(filePath));
-
-            fs.unlinkSync(filePath);
-            fs.unlinkSync(pkgJSONPath);
-        });
-
-        it("should create .eslintrc.js", () => {
-            answers.format = "JavaScript";
-
-            const config = init.processAnswers(answers);
-            const filePath = path.resolve(fixtureDir, ".eslintrc.js");
-
-            fs.writeFileSync(pkgJSONPath, JSON.stringify(pkgJSONContents));
-
-            init.writeFile(config, answers.format);
-
-            assert.isTrue(fs.existsSync(filePath));
-
-            fs.unlinkSync(filePath);
-            fs.unlinkSync(pkgJSONPath);
-        });
-
-        it("should create .eslintrc.yml", () => {
-            answers.format = "YAML";
-
-            const config = init.processAnswers(answers);
-            const filePath = path.resolve(fixtureDir, ".eslintrc.yml");
-
-            fs.writeFileSync(pkgJSONPath, JSON.stringify(pkgJSONContents));
-
-            init.writeFile(config, answers.format);
-
-            assert.isTrue(fs.existsSync(filePath));
-
-            fs.unlinkSync(filePath);
-            fs.unlinkSync(pkgJSONPath);
-        });
-
-        // For https://github.com/eslint/eslint/issues/14137
-        it("should create .eslintrc.cjs", () => {
-            answers.format = "JavaScript";
-
-            // create package.json with "type": "module"
-            pkgJSONContents.type = "module";
-
-            fs.writeFileSync(pkgJSONPath, JSON.stringify(pkgJSONContents));
-
-            const config = init.processAnswers(answers);
-            const filePath = path.resolve(fixtureDir, ".eslintrc.cjs");
-
-            init.writeFile(config, answers.format);
-
-            assert.isTrue(fs.existsSync(filePath));
-
-            fs.unlinkSync(filePath);
-            fs.unlinkSync(pkgJSONPath);
-        });
-
-        it("should create .eslintrc.json even with type: 'module'", () => {
-            answers.format = "JSON";
-
-            // create package.json with "type": "module"
-            pkgJSONContents.type = "module";
-
-            fs.writeFileSync(pkgJSONPath, JSON.stringify(pkgJSONContents));
-
-            const config = init.processAnswers(answers);
-            const filePath = path.resolve(fixtureDir, ".eslintrc.json");
-
-            init.writeFile(config, answers.format);
-
-            assert.isTrue(fs.existsSync(filePath));
-
-            fs.unlinkSync(filePath);
-            fs.unlinkSync(pkgJSONPath);
-        });
-    });
-});
diff --git a/eslint/tests/lib/init/config-rule.js b/eslint/tests/lib/init/config-rule.js
deleted file mode 100644 (file)
index 425317d..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-/**
- * @fileoverview Tests for ConfigOps
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const assert = require("chai").assert,
-    ConfigRule = require("../../../lib/init/config-rule"),
-    builtInRules = require("../../../lib/rules"),
-    schema = require("../../fixtures/config-rule/schemas");
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-const SEVERITY = 2;
-
-describe("ConfigRule", () => {
-
-    describe("generateConfigsFromSchema()", () => {
-        let actualConfigs;
-
-        it("should create a config with only severity for an empty schema", () => {
-            actualConfigs = ConfigRule.generateConfigsFromSchema([]);
-            assert.deepStrictEqual(actualConfigs, [SEVERITY]);
-        });
-
-        it("should create a config with only severity with no arguments", () => {
-            actualConfigs = ConfigRule.generateConfigsFromSchema();
-            assert.deepStrictEqual(actualConfigs, [SEVERITY]);
-        });
-
-        describe("for a single enum schema", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.enum);
-            });
-
-            it("should create an array of configs", () => {
-                assert.isArray(actualConfigs);
-                assert.strictEqual(actualConfigs.length, 3);
-            });
-
-            it("should include the error severity (2) without options as the first config", () => {
-                assert.strictEqual(actualConfigs[0], SEVERITY);
-            });
-
-            it("should set all configs to error severity (2)", () => {
-                actualConfigs.forEach(actualConfig => {
-                    if (Array.isArray(actualConfig)) {
-                        assert.strictEqual(actualConfig[0], SEVERITY);
-                    }
-                });
-            });
-
-            it("should return configs with each enumerated value in the schema", () => {
-                assert.sameDeepMembers(actualConfigs, [SEVERITY, [SEVERITY, "always"], [SEVERITY, "never"]]);
-            });
-        });
-
-        describe("for a object schema with a single enum property", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithEnum);
-            });
-
-            it("should return configs with option objects", () => {
-
-                // Skip first config (severity only)
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const actualConfigOption = actualConfig[1]; // severity is first element, option is second
-
-                    assert.isObject(actualConfigOption);
-                });
-            });
-
-            it("should use the object property name from the schema", () => {
-                const propName = "enumProperty";
-
-                assert.strictEqual(actualConfigs.length, 3);
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const actualConfigOption = actualConfig[1];
-
-                    assert.property(actualConfigOption, propName);
-                });
-            });
-
-            it("should have each enum as option object values", () => {
-                const propName = "enumProperty",
-                    actualValues = [];
-
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const configOption = actualConfig[1];
-
-                    actualValues.push(configOption[propName]);
-                });
-                assert.sameMembers(actualValues, ["always", "never"]);
-            });
-        });
-
-        describe("for a object schema with a multiple enum properties", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithMultipleEnums);
-            });
-
-            it("should create configs for all properties in each config", () => {
-                const expectedProperties = ["firstEnum", "anotherEnum"];
-
-                assert.strictEqual(actualConfigs.length, 7);
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const configOption = actualConfig[1];
-                    const actualProperties = Object.keys(configOption);
-
-                    assert.sameMembers(actualProperties, expectedProperties);
-                });
-            });
-
-            it("should create configs for every possible combination", () => {
-                const expectedConfigs = [
-                    { firstEnum: "always", anotherEnum: "var" },
-                    { firstEnum: "always", anotherEnum: "let" },
-                    { firstEnum: "always", anotherEnum: "const" },
-                    { firstEnum: "never", anotherEnum: "var" },
-                    { firstEnum: "never", anotherEnum: "let" },
-                    { firstEnum: "never", anotherEnum: "const" }
-                ];
-                const actualConfigOptions = actualConfigs.slice(1).map(actualConfig => actualConfig[1]);
-
-                assert.sameDeepMembers(actualConfigOptions, expectedConfigs);
-            });
-
-        });
-
-        describe("for a object schema with a single boolean property", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithBool);
-            });
-
-            it("should return configs with option objects", () => {
-                assert.strictEqual(actualConfigs.length, 3);
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const actualConfigOption = actualConfig[1];
-
-                    assert.isObject(actualConfigOption);
-                });
-            });
-
-            it("should use the object property name from the schema", () => {
-                const propName = "boolProperty";
-
-                assert.strictEqual(actualConfigs.length, 3);
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const actualConfigOption = actualConfig[1];
-
-                    assert.property(actualConfigOption, propName);
-                });
-            });
-
-            it("should include both true and false configs", () => {
-                const propName = "boolProperty",
-                    actualValues = [];
-
-                actualConfigs.slice(1).forEach(actualConfig => {
-                    const configOption = actualConfig[1];
-
-                    actualValues.push(configOption[propName]);
-                });
-                assert.sameMembers(actualValues, [true, false]);
-            });
-        });
-
-        describe("for a object schema with a multiple bool properties", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithMultipleBools);
-            });
-
-            it("should create configs for all properties in each config", () => {
-                const expectedProperties = ["firstBool", "anotherBool"];
-
-                assert.strictEqual(actualConfigs.length, 5);
-                actualConfigs.slice(1).forEach(config => {
-                    const configOption = config[1];
-                    const actualProperties = Object.keys(configOption);
-
-                    assert.sameMembers(actualProperties, expectedProperties);
-                });
-            });
-
-            it("should create configs for every possible combination", () => {
-                const expectedConfigOptions = [
-                    { firstBool: true, anotherBool: true },
-                    { firstBool: true, anotherBool: false },
-                    { firstBool: false, anotherBool: true },
-                    { firstBool: false, anotherBool: false }
-                ];
-                const actualConfigOptions = actualConfigs.slice(1).map(config => config[1]);
-
-                assert.sameDeepMembers(actualConfigOptions, expectedConfigOptions);
-            });
-        });
-
-        describe("for a schema with an enum and an object", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedEnumObject);
-            });
-
-            it("should create configs with only the enum values", () => {
-                assert.strictEqual(actualConfigs[1].length, 2);
-                assert.strictEqual(actualConfigs[2].length, 2);
-                const actualOptions = [actualConfigs[1][1], actualConfigs[2][1]];
-
-                assert.sameMembers(actualOptions, ["always", "never"]);
-            });
-
-            it("should create configs with a string and an object", () => {
-                assert.strictEqual(actualConfigs.length, 7);
-                actualConfigs.slice(3).forEach(config => {
-                    assert.isString(config[1]);
-                    assert.isObject(config[2]);
-                });
-            });
-        });
-
-        describe("for a schema with an enum followed by an object with no usable properties", () => {
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedEnumObjectWithNothing);
-            });
-
-            it("should create config only for the enum", () => {
-                const expectedConfigs = [2, [2, "always"], [2, "never"]];
-
-                assert.sameDeepMembers(actualConfigs, expectedConfigs);
-            });
-        });
-
-        describe("for a schema with an enum preceded by an object with no usable properties", () => {
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedObjectWithNothingEnum);
-            });
-
-            it("should not create a config for the enum", () => {
-                const expectedConfigs = [2];
-
-                assert.sameDeepMembers(actualConfigs, expectedConfigs);
-            });
-        });
-
-        describe("for a schema with an enum preceded by a string", () => {
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedStringEnum);
-            });
-
-            it("should not create a config for the enum", () => {
-                const expectedConfigs = [2];
-
-                assert.sameDeepMembers(actualConfigs, expectedConfigs);
-            });
-        });
-
-        describe("for a schema with oneOf", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.oneOf);
-            });
-
-            it("should create a set of configs", () => {
-                assert.isArray(actualConfigs);
-            });
-        });
-
-        describe("for a schema with nested objects", () => {
-
-            before(() => {
-                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.nestedObjects);
-            });
-
-            it("should create a set of configs", () => {
-                assert.isArray(actualConfigs);
-            });
-        });
-    });
-
-    describe("createCoreRuleConfigs()", () => {
-
-        const rulesConfig = ConfigRule.createCoreRuleConfigs();
-
-        it("should create a rulesConfig containing all core rules", () => {
-            const
-                expectedRules = Array.from(builtInRules.keys()),
-                actualRules = Object.keys(rulesConfig);
-
-            assert.sameMembers(actualRules, expectedRules);
-        });
-
-        it("should allow to ignore deprecated rules", () => {
-            const expectedRules = Array.from(builtInRules.entries())
-                    .filter(([, rule]) => {
-                        const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated;
-
-                        return !isDeprecated;
-                    })
-                    .map(([id]) => id),
-                actualRules = Object.keys(ConfigRule.createCoreRuleConfigs(true));
-
-            assert.sameMembers(actualRules, expectedRules);
-
-            // Make sure it doesn't contain deprecated rules.
-            assert.notInclude(actualRules, "newline-after-var");
-        });
-
-        it("should create arrays of configs for rules", () => {
-            assert.isArray(rulesConfig.quotes);
-            assert.include(rulesConfig.quotes, 2);
-        });
-
-        it("should create configs for rules with meta", () => {
-            assert(rulesConfig["accessor-pairs"].length > 1);
-        });
-    });
-});
diff --git a/eslint/tests/lib/init/npm-utils.js b/eslint/tests/lib/init/npm-utils.js
deleted file mode 100644 (file)
index 8465796..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-/**
- * @fileoverview Tests for rule fixer.
- * @author Ian VanSchooten
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const
-    assert = require("chai").assert,
-    spawn = require("cross-spawn"),
-    sinon = require("sinon"),
-    npmUtils = require("../../../lib/init/npm-utils"),
-    log = require("../../../lib/shared/logging"),
-    { defineInMemoryFs } = require("../../_utils");
-
-const proxyquire = require("proxyquire").noCallThru().noPreserveCache();
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/**
- * Import `npm-utils` with the in-memory file system.
- * @param {Object} files The file definitions.
- * @returns {Object} `npm-utils`.
- */
-function requireNpmUtilsWithInMemoryFileSystem(files) {
-    const fs = defineInMemoryFs({ files });
-
-    return proxyquire("../../../lib/init/npm-utils", { fs });
-}
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-describe("npmUtils", () => {
-    afterEach(() => {
-        sinon.verifyAndRestore();
-    });
-
-    describe("checkDevDeps()", () => {
-        let installStatus;
-
-        before(() => {
-            installStatus = npmUtils.checkDevDeps(["debug", "mocha", "notarealpackage", "jshint"]);
-        });
-
-        it("should not find a direct dependency of the project", () => {
-            assert.isFalse(installStatus.debug);
-        });
-
-        it("should find a dev dependency of the project", () => {
-            assert.isTrue(installStatus.mocha);
-        });
-
-        it("should not find non-dependencies", () => {
-            assert.isFalse(installStatus.notarealpackage);
-        });
-
-        it("should not find nested dependencies", () => {
-            assert.isFalse(installStatus.jshint);
-        });
-
-        it("should return false for a single, non-existent package", () => {
-            installStatus = npmUtils.checkDevDeps(["notarealpackage"]);
-            assert.isFalse(installStatus.notarealpackage);
-        });
-
-        it("should handle missing devDependencies key", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({
-                "package.json": JSON.stringify({ private: true, dependencies: {} })
-            });
-
-            // Should not throw.
-            stubbedNpmUtils.checkDevDeps(["some-package"]);
-        });
-
-        it("should throw with message when parsing invalid package.json", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({
-                "package.json": "{ \"not: \"valid json\" }"
-            });
-
-            assert.throws(() => {
-                try {
-                    stubbedNpmUtils.checkDevDeps(["some-package"]);
-                } catch (error) {
-                    assert.strictEqual(error.messageTemplate, "failed-to-read-json");
-                    throw error;
-                }
-            }, "SyntaxError: Unexpected token v");
-        });
-    });
-
-    describe("checkDeps()", () => {
-        let installStatus;
-
-        before(() => {
-            installStatus = npmUtils.checkDeps(["debug", "mocha", "notarealpackage", "jshint"]);
-        });
-
-        it("should find a direct dependency of the project", () => {
-            assert.isTrue(installStatus.debug);
-        });
-
-        it("should not find a dev dependency of the project", () => {
-            assert.isFalse(installStatus.mocha);
-        });
-
-        it("should not find non-dependencies", () => {
-            assert.isFalse(installStatus.notarealpackage);
-        });
-
-        it("should not find nested dependencies", () => {
-            assert.isFalse(installStatus.jshint);
-        });
-
-        it("should return false for a single, non-existent package", () => {
-            installStatus = npmUtils.checkDeps(["notarealpackage"]);
-            assert.isFalse(installStatus.notarealpackage);
-        });
-
-        it("should throw if no package.json can be found", () => {
-            assert.throws(() => {
-                installStatus = npmUtils.checkDeps(["notarealpackage"], "/fakepath");
-            }, "Could not find a package.json file");
-        });
-
-        it("should handle missing dependencies key", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({
-                "package.json": JSON.stringify({ private: true, devDependencies: {} })
-            });
-
-            // Should not throw.
-            stubbedNpmUtils.checkDeps(["some-package"]);
-        });
-
-        it("should throw with message when parsing invalid package.json", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({
-                "package.json": "{ \"not: \"valid json\" }"
-            });
-
-            assert.throws(() => {
-                try {
-                    stubbedNpmUtils.checkDeps(["some-package"]);
-                } catch (error) {
-                    assert.strictEqual(error.messageTemplate, "failed-to-read-json");
-                    throw error;
-                }
-            }, "SyntaxError: Unexpected token v");
-        });
-    });
-
-    describe("checkPackageJson()", () => {
-        it("should return true if package.json exists", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({
-                "package.json": "{ \"file\": \"contents\" }"
-            });
-
-            assert.strictEqual(stubbedNpmUtils.checkPackageJson(), true);
-        });
-
-        it("should return false if package.json does not exist", () => {
-            const stubbedNpmUtils = requireNpmUtilsWithInMemoryFileSystem({});
-
-            assert.strictEqual(stubbedNpmUtils.checkPackageJson(), false);
-        });
-    });
-
-    describe("installSyncSaveDev()", () => {
-        it("should invoke npm to install a single desired package", () => {
-            const stub = sinon.stub(spawn, "sync").returns({ stdout: "" });
-
-            npmUtils.installSyncSaveDev("desired-package");
-            assert(stub.calledOnce);
-            assert.strictEqual(stub.firstCall.args[0], "npm");
-            assert.deepStrictEqual(stub.firstCall.args[1], ["i", "--save-dev", "desired-package"]);
-            stub.restore();
-        });
-
-        it("should accept an array of packages to install", () => {
-            const stub = sinon.stub(spawn, "sync").returns({ stdout: "" });
-
-            npmUtils.installSyncSaveDev(["first-package", "second-package"]);
-            assert(stub.calledOnce);
-            assert.strictEqual(stub.firstCall.args[0], "npm");
-            assert.deepStrictEqual(stub.firstCall.args[1], ["i", "--save-dev", "first-package", "second-package"]);
-            stub.restore();
-        });
-
-        it("should log an error message if npm throws ENOENT error", () => {
-            const logErrorStub = sinon.stub(log, "error");
-            const npmUtilsStub = sinon.stub(spawn, "sync").returns({ error: { code: "ENOENT" } });
-
-            npmUtils.installSyncSaveDev("some-package");
-
-            assert(logErrorStub.calledOnce);
-
-            logErrorStub.restore();
-            npmUtilsStub.restore();
-        });
-    });
-
-    describe("fetchPeerDependencies()", () => {
-        it("should execute 'npm show --json <packageName> peerDependencies' command", () => {
-            const stub = sinon.stub(spawn, "sync").returns({ stdout: "" });
-
-            npmUtils.fetchPeerDependencies("desired-package");
-            assert(stub.calledOnce);
-            assert.strictEqual(stub.firstCall.args[0], "npm");
-            assert.deepStrictEqual(stub.firstCall.args[1], ["show", "--json", "desired-package", "peerDependencies"]);
-            stub.restore();
-        });
-
-        it("should return null if npm throws ENOENT error", () => {
-            const stub = sinon.stub(spawn, "sync").returns({ error: { code: "ENOENT" } });
-
-            const peerDependencies = npmUtils.fetchPeerDependencies("desired-package");
-
-            assert.isNull(peerDependencies);
-
-            stub.restore();
-        });
-    });
-});
diff --git a/eslint/tests/lib/init/source-code-utils.js b/eslint/tests/lib/init/source-code-utils.js
deleted file mode 100644 (file)
index 994d23d..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @fileoverview Tests for source-code-util.
- * @author Ian VanSchooten
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-const path = require("path"),
-    fs = require("fs"),
-    os = require("os"),
-    assert = require("chai").assert,
-    sinon = require("sinon"),
-    sh = require("shelljs"),
-    { SourceCode } = require("../../../lib/source-code");
-
-const proxyquire = require("proxyquire").noCallThru().noPreserveCache();
-const originalDir = process.cwd();
-
-//------------------------------------------------------------------------------
-// Tests
-//------------------------------------------------------------------------------
-
-describe("SourceCodeUtil", () => {
-
-    let fixtureDir,
-        getSourceCodeOfFiles;
-
-    /**
-     * Returns the path inside of the fixture directory.
-     * @param {...string} args file path segments.
-     * @returns {string} The path inside the fixture directory.
-     * @private
-     */
-    function getFixturePath(...args) {
-        let filepath = path.join(fixtureDir, ...args);
-
-        try {
-            filepath = fs.realpathSync(filepath);
-            return filepath;
-        } catch {
-            return filepath;
-        }
-    }
-
-    const log = {
-        info: sinon.spy(),
-        error: sinon.spy()
-    };
-    const requireStubs = {
-        "../logging": log
-    };
-
-    // copy into clean area so as not to get "infected" by this project's .eslintrc files
-    before(() => {
-        fixtureDir = `${os.tmpdir()}/eslint/fixtures/source-code-util`;
-        sh.mkdir("-p", fixtureDir);
-        sh.cp("-r", "./tests/fixtures/source-code-util/.", fixtureDir);
-        fixtureDir = fs.realpathSync(fixtureDir);
-    });
-
-    beforeEach(() => {
-        getSourceCodeOfFiles = proxyquire("../../../lib/init/source-code-utils", requireStubs).getSourceCodeOfFiles;
-    });
-
-    afterEach(() => {
-        log.info.resetHistory();
-        log.error.resetHistory();
-    });
-
-    after(() => {
-        sh.rm("-r", fixtureDir);
-    });
-
-    describe("getSourceCodeOfFiles()", () => {
-
-        it("should handle single string filename arguments", () => {
-            const filename = getFixturePath("foo.js");
-            const sourceCode = getSourceCodeOfFiles(filename, { cwd: fixtureDir });
-
-            assert.isObject(sourceCode);
-        });
-
-        it("should accept an array of string filenames", () => {
-            const fooFilename = getFixturePath("foo.js");
-            const barFilename = getFixturePath("bar.js");
-            const sourceCode = getSourceCodeOfFiles([fooFilename, barFilename], { cwd: fixtureDir });
-
-            assert.isObject(sourceCode);
-        });
-
-        it("should accept a glob argument", () => {
-            const glob = getFixturePath("*.js");
-            const filename = getFixturePath("foo.js");
-            const sourceCode = getSourceCodeOfFiles(glob, { cwd: fixtureDir });
-
-            assert.isObject(sourceCode);
-            assert.property(sourceCode, filename);
-        });
-
-        it("should accept a relative filename", () => {
-            const filename = "foo.js";
-            const sourceCode = getSourceCodeOfFiles(filename, { cwd: fixtureDir });
-
-            assert.isObject(sourceCode);
-            assert.property(sourceCode, getFixturePath(filename));
-        });
-
-        it("should accept a relative path to a file in a parent directory", () => {
-            const filename = "../foo.js";
-            const sourceCode = getSourceCodeOfFiles(filename, { cwd: getFixturePath("nested") });
-
-            assert.isObject(sourceCode);
-            assert.property(sourceCode, getFixturePath("foo.js"));
-        });
-
-        it("should accept a callback", () => {
-            const filename = getFixturePath("foo.js");
-            const spy = sinon.spy();
-
-            process.chdir(fixtureDir);
-            getSourceCodeOfFiles(filename, {}, spy);
-            process.chdir(originalDir);
-            assert(spy.calledOnce);
-        });
-
-        it("should call the callback with total number of files being processed", () => {
-            const filename = getFixturePath("foo.js");
-            const spy = sinon.spy();
-
-            process.chdir(fixtureDir);
-            getSourceCodeOfFiles(filename, {}, spy);
-            process.chdir(originalDir);
-            assert.strictEqual(spy.firstCall.args[0], 1);
-        });
-
-        it("should create an object with located filenames as keys", () => {
-            const fooFilename = getFixturePath("foo.js");
-            const barFilename = getFixturePath("bar.js");
-            const sourceCode = getSourceCodeOfFiles([fooFilename, barFilename], { cwd: fixtureDir });
-
-            assert.property(sourceCode, fooFilename);
-            assert.property(sourceCode, barFilename);
-        });
-
-        it("should should not include non-existent filenames in results", () => {
-            const filename = getFixturePath("missing.js");
-
-            assert.throws(() => {
-                getSourceCodeOfFiles(filename, { cwd: fixtureDir });
-            }, `No files matching '${filename}' were found.`);
-        });
-
-        it("should throw for files with parsing errors", () => {
-            const filename = getFixturePath("parse-error", "parse-error.js");
-
-            assert.throw(() => {
-                getSourceCodeOfFiles(filename, { cwd: fixtureDir });
-            }, /Parsing error: Unexpected token ;/u);
-
-        });
-
-        it("should obtain the sourceCode of a file", () => {
-            const filename = getFixturePath("foo.js");
-            const sourceCode = getSourceCodeOfFiles(filename, { cwd: fixtureDir });
-
-            assert.isObject(sourceCode);
-            assert.instanceOf(sourceCode[filename], SourceCode);
-        });
-
-        it("should obtain the sourceCode of JSX files", () => {
-            const filename = getFixturePath("jsx", "foo.jsx");
-            const options = {
-                cwd: fixtureDir,
-                parserOptions: {
-                    ecmaFeatures: {
-                        jsx: true
-                    }
-                }
-            };
-            const sourceCode = getSourceCodeOfFiles(filename, options);
-
-            assert.isObject(sourceCode);
-            assert.instanceOf(sourceCode[filename], SourceCode);
-        });
-
-        it("should honor .eslintignore files by default", () => {
-            const glob = getFixturePath("*.js");
-            const unignoredFilename = getFixturePath("foo.js");
-            const ignoredFilename = getFixturePath("ignored.js");
-            const sourceCode = getSourceCodeOfFiles(glob, { cwd: fixtureDir });
-
-            assert.property(sourceCode, unignoredFilename);
-            assert.notProperty(sourceCode, ignoredFilename);
-        });
-
-        it("should obtain the sourceCode of all files in a specified folder", () => {
-            const folder = getFixturePath("nested");
-            const fooFile = getFixturePath("nested/foo.js");
-            const barFile = getFixturePath("nested/bar.js");
-            const sourceCode = getSourceCodeOfFiles(folder, { cwd: fixtureDir });
-
-            assert.strictEqual(Object.keys(sourceCode).length, 2);
-            assert.instanceOf(sourceCode[fooFile], SourceCode);
-            assert.instanceOf(sourceCode[barFile], SourceCode);
-        });
-
-        it("should accept cli options", () => {
-            const pattern = getFixturePath("ext");
-            const abcFile = getFixturePath("ext/foo.abc");
-            const cliOptions = { extensions: [".abc"], cwd: fixtureDir };
-            const sourceCode = getSourceCodeOfFiles(pattern, cliOptions);
-
-            assert.strictEqual(Object.keys(sourceCode).length, 1);
-            assert.instanceOf(sourceCode[abcFile], SourceCode);
-        });
-
-        it("should execute the callback function, if provided", () => {
-            const callback = sinon.spy();
-            const filename = getFixturePath("foo.js");
-
-            getSourceCodeOfFiles(filename, { cwd: fixtureDir }, callback);
-            assert(callback.calledOnce);
-        });
-
-        it("should execute callback function once per file", () => {
-            const callback = sinon.spy();
-            const fooFilename = getFixturePath("foo.js");
-            const barFilename = getFixturePath("bar.js");
-
-            getSourceCodeOfFiles([fooFilename, barFilename], { cwd: fixtureDir }, callback);
-            assert.strictEqual(callback.callCount, 2);
-        });
-
-        it("should call callback function with total number of files with sourceCode", () => {
-            const callback = sinon.spy();
-            const firstFn = getFixturePath("foo.js");
-            const secondFn = getFixturePath("bar.js");
-            const thirdFn = getFixturePath("nested/foo.js");
-
-            getSourceCodeOfFiles([firstFn, secondFn, thirdFn], { cwd: fixtureDir }, callback);
-            assert(callback.calledWith(3));
-        });
-
-    });
-
-});
index 72708bcbddc85dfd8ab9f52595635b0e267edd9c..de56f729627f6d44d44c60c27f0ee721347fb6e3 100644 (file)
@@ -25,7 +25,20 @@ const applyDisableDirectives = require("../../../lib/linter/apply-disable-direct
  */
 function createParentComment(range, value, ruleIds = []) {
     return {
-        commentToken: { range, value },
+        commentToken: {
+            range,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 1
+                },
+                end: {
+                    line: 1,
+                    column: value ? value.length : 10
+                }
+            },
+            value
+        },
         ruleIds
     };
 }
@@ -39,50 +52,50 @@ describe("apply-disable-directives", () => {
         it("keeps problems before the comment on the same line", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ parentComment: createParentComment([0, 7]), type: "disable", line: 1, column: 8, ruleId: null }],
+                    directives: [{ parentComment: createParentComment([0, 7]), type: "disable", line: 1, column: 8, ruleId: null, justification: "justification" }],
                     problems: [{ line: 1, column: 7, ruleId: "foo" }]
                 }),
-                [{ ruleId: "foo", line: 1, column: 7 }]
+                [{ line: 1, column: 7, ruleId: "foo" }]
             );
         });
 
         it("keeps problems on a previous line before the comment", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ parentComment: createParentComment([21, 27]), type: "disable", line: 2, column: 1, ruleId: null }],
+                    directives: [{ parentComment: createParentComment([21, 27]), type: "disable", line: 2, column: 1, ruleId: null, justification: "justification" }],
                     problems: [{ line: 1, column: 10, ruleId: "foo" }]
                 }),
-                [{ ruleId: "foo", line: 1, column: 10 }]
+                [{ line: 1, column: 10, ruleId: "foo" }]
             );
         });
 
         it("filters problems at the same location as the comment", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null }],
+                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null, justification: "justification" }],
                     problems: [{ line: 1, column: 8, ruleId: null }]
                 }),
-                []
+                [{ line: 1, column: 8, ruleId: null, suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
         it("filters out problems after the comment on the same line", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null }],
+                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null, justification: "justification" }],
                     problems: [{ line: 1, column: 10, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 10, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
         it("filters out problems on a later line than the comment", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null }],
+                    directives: [{ type: "disable", line: 1, column: 8, ruleId: null, justification: "justification" }],
                     problems: [{ line: 2, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
     });
@@ -91,20 +104,20 @@ describe("apply-disable-directives", () => {
         it("filters problems after the comment that have the same ruleId", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 8, ruleId: "foo" }],
+                    directives: [{ type: "disable", line: 1, column: 8, ruleId: "foo", justification: "justification" }],
                     problems: [{ line: 2, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
         it("filters problems in the same location as the comment that have the same ruleId", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 8, ruleId: "foo" }],
+                    directives: [{ type: "disable", line: 1, column: 8, ruleId: "foo", justification: "justification" }],
                     problems: [{ line: 1, column: 8, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 8, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -116,7 +129,8 @@ describe("apply-disable-directives", () => {
                         type: "disable",
                         line: 1,
                         column: 1,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [{ line: 2, column: 3, ruleId: "not-foo" }]
                 }),
@@ -151,14 +165,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([27, 45]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 27, ruleId: "foo" }]
@@ -176,14 +192,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([26, 40]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 26, ruleId: "foo" }]
@@ -196,12 +214,12 @@ describe("apply-disable-directives", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
                     directives: [
-                        { type: "disable", line: 1, column: 1, ruleId: null },
-                        { type: "enable", line: 1, column: 26, ruleId: null }
+                        { type: "disable", line: 1, column: 1, ruleId: null, justification: "j1" },
+                        { type: "enable", line: 1, column: 26, ruleId: null, justification: "j2" }
                     ],
                     problems: [{ line: 1, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j1" }] }]
             );
         });
 
@@ -214,26 +232,29 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([26, 44]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         },
                         {
                             parentComment: createParentComment([45, 63]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j3"
                         }
                     ],
                     problems: [{ line: 3, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 3, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j3" }] }]
             );
         });
 
@@ -246,26 +267,29 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 44]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         },
                         {
                             parentComment: createParentComment([45, 63]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j3"
                         }
                     ],
                     problems: [{ line: 3, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 3, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j3" }] }]
             );
         });
 
@@ -278,14 +302,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([25, 44]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 3, ruleId: "not-foo" }]
@@ -305,14 +331,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 44]),
                             type: "enable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 4, ruleId: "foo" }]
@@ -330,14 +358,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 44]),
                             type: "enable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "foo" }]
@@ -350,12 +380,26 @@ describe("apply-disable-directives", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
                     directives: [
-                        { type: "disable", line: 1, column: 1, ruleId: null },
-                        { type: "enable", line: 2, column: 1, ruleId: "foo" }
+                        {
+                            parentComment: createParentComment([0, 20]),
+                            type: "disable",
+                            line: 1,
+                            column: 1,
+                            ruleId: null,
+                            justification: "j1"
+                        },
+                        {
+                            parentComment: createParentComment([21, 44]),
+                            type: "enable",
+                            line: 2,
+                            column: 1,
+                            ruleId: "foo",
+                            justification: "j2"
+                        }
                     ],
                     problems: [{ line: 2, column: 4, ruleId: "not-foo" }]
                 }),
-                []
+                [{ line: 2, column: 4, ruleId: "not-foo", suppressions: [{ kind: "directive", justification: "j1" }] }]
             );
         });
 
@@ -363,9 +407,9 @@ describe("apply-disable-directives", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
                     directives: [
-                        { type: "disable", line: 1, column: 1, ruleId: null },
-                        { type: "enable", line: 1, column: 22, ruleId: "foo" },
-                        { type: "enable", line: 1, column: 46, ruleId: "bar" }
+                        { type: "disable", line: 1, column: 1, ruleId: null, justification: "j1" },
+                        { type: "enable", line: 1, column: 22, ruleId: "foo", justification: "j2" },
+                        { type: "enable", line: 1, column: 46, ruleId: "bar", justification: "j3" }
                     ],
                     problems: [
                         { line: 1, column: 10, ruleId: "foo" },
@@ -377,7 +421,10 @@ describe("apply-disable-directives", () => {
                     ]
                 }),
                 [
+                    { line: 1, column: 10, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j1" }] },
+                    { line: 1, column: 10, ruleId: "bar", suppressions: [{ kind: "directive", justification: "j1" }] },
                     { line: 1, column: 30, ruleId: "foo" },
+                    { line: 1, column: 30, ruleId: "bar", suppressions: [{ kind: "directive", justification: "j1" }] },
                     { line: 1, column: 50, ruleId: "foo" },
                     { line: 1, column: 50, ruleId: "bar" }
                 ]
@@ -394,7 +441,8 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 2,
                         column: 1,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [{ line: 1, column: 5, ruleId: "foo" }]
                 }),
@@ -410,11 +458,12 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 1,
                         column: 8,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [{ line: 1, column: 1, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 1, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -426,11 +475,12 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 1,
                         column: 8,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [{ line: 1, column: 10, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 10, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -442,7 +492,8 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 1,
                         column: 8,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [{ line: 2, column: 1, ruleId: "foo" }]
                 }),
@@ -460,18 +511,26 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 1,
                         column: 8,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [{ line: 1, column: 2, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 1, column: 2, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
         it("keeps problems on the current line that do not match the ruleId", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ parentComment: createParentComment([0, 27]), type: "disable-line", line: 1, column: 1, ruleId: "foo" }],
+                    directives: [{
+                        parentComment: createParentComment([0, 27]),
+                        type: "disable-line",
+                        line: 1,
+                        column: 1,
+                        ruleId: "foo",
+                        justification: "justification"
+                    }],
                     problems: [{ line: 1, column: 2, ruleId: "not-foo" }]
                 }),
                 [{ line: 1, column: 2, ruleId: "not-foo" }]
@@ -487,19 +546,21 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([24, 28]),
                             type: "disable-line",
                             line: 1,
                             column: 22,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 5, ruleId: "not-foo" }]
                 }),
-                []
+                [{ line: 1, column: 5, ruleId: "not-foo", suppressions: [{ kind: "directive", justification: "j1" }] }]
             );
         });
 
@@ -512,47 +573,53 @@ describe("apply-disable-directives", () => {
                             type: "disable-line",
                             line: 1,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([38, 73]),
                             type: "disable-line",
                             line: 2,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         },
                         {
                             parentComment: createParentComment([76, 111]),
                             type: "disable-line",
                             line: 3,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j3"
                         },
                         {
                             parentComment: createParentComment([114, 149]),
                             type: "disable-line",
                             line: 4,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j4"
                         },
                         {
                             parentComment: createParentComment([152, 187]),
                             type: "disable-line",
                             line: 5,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j5"
                         },
                         {
                             parentComment: createParentComment([190, 225]),
                             type: "disable-line",
                             line: 6,
                             column: 8,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j6"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 1, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j2" }] }]
             );
         });
     });
@@ -566,11 +633,12 @@ describe("apply-disable-directives", () => {
                         type: "disable-next-line",
                         line: 1,
                         column: 1,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [{ line: 2, column: 3, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 3, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -598,7 +666,8 @@ describe("apply-disable-directives", () => {
                         type: "disable-next-line",
                         line: 1,
                         column: 1,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [{ line: 3, column: 3, ruleId: "foo" }]
                 }),
@@ -610,12 +679,12 @@ describe("apply-disable-directives", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
                     directives: [
-                        { type: "disable-next-line", line: 1, column: 1, ruleId: null },
-                        { type: "enable", line: 1, column: 5, ruleId: null }
+                        { parentComment: createParentComment([0, 31]), type: "disable-next-line", line: 1, column: 1, ruleId: null, justification: "j1" },
+                        { type: "enable", line: 1, column: 5, ruleId: null, justification: "j2" }
                     ],
                     problems: [{ line: 2, column: 2, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 2, ruleId: "foo", suppressions: [{ kind: "directive", justification: "j1" }] }]
             );
         });
     });
@@ -624,10 +693,10 @@ describe("apply-disable-directives", () => {
         it("filters problems on the next line that match the ruleId", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable-next-line", line: 1, column: 1, ruleId: "foo" }],
+                    directives: [{ type: "disable-next-line", line: 1, column: 1, ruleId: "foo", justification: "justification" }],
                     problems: [{ line: 2, column: 1, ruleId: "foo" }]
                 }),
-                []
+                [{ line: 2, column: 1, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -639,7 +708,8 @@ describe("apply-disable-directives", () => {
                         type: "disable-next-line",
                         line: 1,
                         column: 1,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [{ line: 2, column: 1, ruleId: "not-foo" }]
                 }),
@@ -653,7 +723,7 @@ describe("apply-disable-directives", () => {
             assert.throws(
                 () =>
                     applyDisableDirectives({
-                        directives: [{ type: "foo", line: 1, column: 4, ruleId: "foo" }],
+                        directives: [{ type: "foo", line: 1, column: 4, ruleId: "foo", justification: "justification" }],
                         problems: []
                     }),
                 "Unrecognized directive type 'foo'"
@@ -669,25 +739,24 @@ describe("apply-disable-directives", () => {
                         parentComment: createParentComment([0, 20]),
                         type: "disable",
                         line: 1,
-                        column: 1
+                        column: 1,
+                        justification: "justification"
                     }],
                     problems: [],
                     reportUnusedDisableDirectives: "error"
                 }),
-                [
-                    {
-                        ruleId: null,
-                        message: "Unused eslint-disable directive (no problems were reported).",
-                        line: 1,
-                        column: 1,
-                        fix: {
-                            range: [0, 20],
-                            text: " "
-                        },
-                        severity: 2,
-                        nodeType: null
-                    }
-                ]
+                [{
+                    ruleId: null,
+                    message: "Unused eslint-disable directive (no problems were reported).",
+                    line: 1,
+                    column: 1,
+                    fix: {
+                        range: [0, 20],
+                        text: " "
+                    },
+                    severity: 2,
+                    nodeType: null
+                }]
             );
         });
 
@@ -698,33 +767,32 @@ describe("apply-disable-directives", () => {
                         parentComment: createParentComment([0, 20]),
                         type: "disable",
                         line: 1,
-                        column: 1
+                        column: 1,
+                        justification: "justification"
                     }],
                     disableFixes: true,
                     problems: [],
                     reportUnusedDisableDirectives: "error"
                 }),
-                [
-                    {
-                        ruleId: null,
-                        message: "Unused eslint-disable directive (no problems were reported).",
-                        line: 1,
-                        column: 1,
-                        severity: 2,
-                        nodeType: null
-                    }
-                ]
+                [{
+                    ruleId: null,
+                    message: "Unused eslint-disable directive (no problems were reported).",
+                    line: 1,
+                    column: 1,
+                    severity: 2,
+                    nodeType: null
+                }]
             );
         });
 
         it("Does not add a problem for /* eslint-disable */ /* (problem) */", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 1, ruleId: null }],
+                    directives: [{ type: "disable", line: 1, column: 1, ruleId: null, justification: "justification" }],
                     problems: [{ line: 2, column: 1, ruleId: "foo" }],
                     reportUnusedDisableDirectives: "error"
                 }),
-                []
+                [{ line: 2, column: 1, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -736,25 +804,24 @@ describe("apply-disable-directives", () => {
                         type: "disable",
                         line: 1,
                         column: 1,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [],
                     reportUnusedDisableDirectives: "error"
                 }),
-                [
-                    {
-                        ruleId: null,
-                        message: "Unused eslint-disable directive (no problems were reported from 'foo').",
-                        line: 1,
-                        column: 1,
-                        fix: {
-                            range: [0, 21],
-                            text: " "
-                        },
-                        severity: 2,
-                        nodeType: null
-                    }
-                ]
+                [{
+                    ruleId: null,
+                    message: "Unused eslint-disable directive (no problems were reported from 'foo').",
+                    line: 1,
+                    column: 1,
+                    fix: {
+                        range: [0, 21],
+                        text: " "
+                    },
+                    severity: 2,
+                    nodeType: null
+                }]
             );
         });
 
@@ -766,7 +833,8 @@ describe("apply-disable-directives", () => {
                         type: "disable",
                         line: 1,
                         column: 1,
-                        ruleId: "foo"
+                        ruleId: "foo",
+                        justification: "justification"
                     }],
                     problems: [{ line: 1, column: 20, ruleId: "not-foo" }],
                     reportUnusedDisableDirectives: "error"
@@ -802,14 +870,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 8,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([0, 21]),
                             type: "enable",
                             line: 1,
                             column: 24,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 2, ruleId: "foo" }],
@@ -846,33 +916,33 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 41]),
                             type: "enable",
                             line: 1,
                             column: 12,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [],
                     reportUnusedDisableDirectives: "error"
                 }),
-                [
-                    {
-                        ruleId: null,
-                        message: "Unused eslint-disable directive (no problems were reported).",
-                        line: 1,
-                        column: 1,
-                        fix: {
-                            range: [0, 20],
-                            text: " "
-                        },
-                        severity: 2,
-                        nodeType: null
-                    }
-                ]
+                [{
+                    ruleId: null,
+                    message: "Unused eslint-disable directive (no problems were reported).",
+                    line: 1,
+                    column: 1,
+                    fix: {
+                        range: [0, 20],
+                        text: " "
+                    },
+                    severity: 2,
+                    nodeType: null
+                }]
             );
         });
 
@@ -885,14 +955,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 42]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [],
@@ -936,14 +1008,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([22, 45]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 3, column: 1, ruleId: "foo" }],
@@ -961,6 +1035,15 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 3,
+                        column: 1,
+                        ruleId: "foo",
+                        suppressions: [
+                            { kind: "directive", justification: "j1" },
+                            { kind: "directive", justification: "j2" }
+                        ]
                     }
                 ]
             );
@@ -975,14 +1058,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([22, 45]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 3, column: 1, ruleId: "foo" }],
@@ -1000,6 +1085,15 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 3,
+                        column: 1,
+                        ruleId: "foo",
+                        suppressions: [
+                            { kind: "directive", justification: "j1" },
+                            { kind: "directive", justification: "j2" }
+                        ]
                     }
                 ]
             );
@@ -1008,11 +1102,11 @@ describe("apply-disable-directives", () => {
         it("Does not add a problem for /* eslint-disable foo */ /* (problem from foo) */", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable", line: 1, column: 1, ruleId: "foo" }],
+                    directives: [{ type: "disable", line: 1, column: 1, ruleId: "foo", justification: "justification" }],
                     problems: [{ line: 1, column: 6, ruleId: "foo" }],
                     reportUnusedDisableDirectives: "error"
                 }),
-                []
+                [{ line: 1, column: 6, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -1025,14 +1119,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([22, 45]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 3, column: 1, ruleId: "foo" }],
@@ -1050,6 +1146,15 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 3,
+                        column: 1,
+                        ruleId: "foo",
+                        suppressions: [
+                            { kind: "directive", justification: "j1" },
+                            { kind: "directive", justification: "j2" }
+                        ]
                     }
                 ]
             );
@@ -1064,14 +1169,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([21, 45]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 3, column: 1, ruleId: "bar" }],
@@ -1089,6 +1196,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 3,
+                        column: 1,
+                        ruleId: "bar",
+                        suppressions: [{ kind: "directive", justification: "j1" }]
                     }
                 ]
             );
@@ -1103,14 +1216,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([25, 46]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 30, ruleId: "foo" }],
@@ -1147,14 +1262,16 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([25, 49]),
                             type: "enable",
                             line: 1,
                             column: 26,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 1, column: 30, ruleId: "foo" }],
@@ -1191,21 +1308,24 @@ describe("apply-disable-directives", () => {
                             type: "disable",
                             line: 1,
                             column: 1,
-                            ruleId: null
+                            ruleId: null,
+                            justification: "j1"
                         },
                         {
                             parentComment: createParentComment([22, 45]),
                             type: "disable",
                             line: 2,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j2"
                         },
                         {
                             parentComment: createParentComment([46, 69]),
                             type: "enable",
                             line: 3,
                             column: 1,
-                            ruleId: "foo"
+                            ruleId: "foo",
+                            justification: "j3"
                         }
                     ],
                     problems: [{ line: 4, column: 1, ruleId: "foo" }],
@@ -1253,7 +1373,8 @@ describe("apply-disable-directives", () => {
                         type: "disable-line",
                         line: 1,
                         column: 1,
-                        ruleId: null
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [],
                     reportUnusedDisableDirectives: "error"
@@ -1279,11 +1400,11 @@ describe("apply-disable-directives", () => {
         it("Does not add a problem for // eslint-disable-line (problem)", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable-line", line: 1, column: 1, ruleId: null }],
+                    directives: [{ type: "disable-line", line: 1, column: 1, ruleId: null, justification: "justification" }],
                     problems: [{ line: 1, column: 10, ruleId: "foo" }],
                     reportUnusedDisableDirectives: "error"
                 }),
-                []
+                [{ line: 1, column: 10, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -1294,8 +1415,9 @@ describe("apply-disable-directives", () => {
                         parentComment: createParentComment([0, 27]),
                         type: "disable-next-line",
                         line: 1,
-                        column: 1,
-                        ruleId: null
+                        column: 2,
+                        ruleId: null,
+                        justification: "justification"
                     }],
                     problems: [],
                     reportUnusedDisableDirectives: "error"
@@ -1305,7 +1427,7 @@ describe("apply-disable-directives", () => {
                         ruleId: null,
                         message: "Unused eslint-disable directive (no problems were reported).",
                         line: 1,
-                        column: 1,
+                        column: 2,
                         fix: {
                             range: [0, 27],
                             text: " "
@@ -1320,11 +1442,11 @@ describe("apply-disable-directives", () => {
         it("Does not add a problem for // eslint-disable-next-line \\n (problem)", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ type: "disable-next-line", line: 1, column: 1, ruleId: null }],
+                    directives: [{ type: "disable-next-line", line: 1, column: 1, ruleId: null, justification: "justification" }],
                     problems: [{ line: 2, column: 10, ruleId: "foo" }],
                     reportUnusedDisableDirectives: "error"
                 }),
-                []
+                [{ line: 2, column: 10, ruleId: "foo", suppressions: [{ kind: "directive", justification: "justification" }] }]
             );
         });
 
@@ -1370,7 +1492,14 @@ describe("apply-disable-directives", () => {
         it("Does not add problems when reportUnusedDisableDirectives: \"off\" is used", () => {
             assert.deepStrictEqual(
                 applyDisableDirectives({
-                    directives: [{ parentComment: createParentComment([0, 27]), type: "disable-next-line", line: 1, column: 1, ruleId: null }],
+                    directives: [{
+                        parentComment: createParentComment([0, 27]),
+                        type: "disable-next-line",
+                        line: 1,
+                        column: 1,
+                        ruleId: null,
+                        justification: "justification"
+                    }],
                     problems: [],
                     reportUnusedDisableDirectives: "off"
                 }),
@@ -1391,14 +1520,16 @@ describe("apply-disable-directives", () => {
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "unused",
                             type: "disable",
                             line: 1,
-                            column: 22
+                            column: 22,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1416,6 +1547,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j1" }]
                     }
                 ]
             );
@@ -1431,14 +1568,16 @@ describe("apply-disable-directives", () => {
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "unused",
                             type: "disable",
                             line: 1,
-                            column: 24
+                            column: 24,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1456,6 +1595,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j1" }]
                     }
                 ]
             );
@@ -1472,14 +1617,16 @@ describe("apply-disable-directives", () => {
                             ruleId: "unused",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 25
+                            column: 25,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1497,6 +1644,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j2" }]
                     }
                 ]
             );
@@ -1513,14 +1666,16 @@ describe("apply-disable-directives", () => {
                             ruleId: "unused",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 29
+                            column: 29,
+                            justification: "j2"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1538,6 +1693,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j2" }]
                     }
                 ]
             );
@@ -1554,21 +1715,24 @@ describe("apply-disable-directives", () => {
                             ruleId: "unused-1",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "unused-2",
                             type: "disable",
                             line: 1,
-                            column: 28
+                            column: 28,
+                            justification: "j2"
                         },
                         {
                             parentComment,
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 38
+                            column: 38,
+                            justification: "j3"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1598,6 +1762,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j3" }]
                     }
                 ]
             );
@@ -1614,28 +1784,32 @@ describe("apply-disable-directives", () => {
                             ruleId: "unused-1",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "unused-2",
                             type: "disable",
                             line: 1,
-                            column: 28
+                            column: 28,
+                            justification: "j2"
                         },
                         {
                             parentComment,
                             ruleId: "used",
                             type: "disable",
                             line: 1,
-                            column: 38
+                            column: 38,
+                            justification: "j3"
                         },
                         {
                             parentComment,
                             ruleId: "unused-3",
                             type: "disable",
                             line: 1,
-                            column: 43
+                            column: 43,
+                            justification: "j4"
                         }
                     ],
                     problems: [{ line: 2, column: 1, ruleId: "used" }],
@@ -1677,6 +1851,12 @@ describe("apply-disable-directives", () => {
                         },
                         severity: 2,
                         nodeType: null
+                    },
+                    {
+                        line: 2,
+                        column: 1,
+                        ruleId: "used",
+                        suppressions: [{ kind: "directive", justification: "j3" }]
                     }
                 ]
             );
@@ -1693,14 +1873,16 @@ describe("apply-disable-directives", () => {
                             ruleId: "unused-1",
                             type: "disable",
                             line: 1,
-                            column: 18
+                            column: 18,
+                            justification: "j1"
                         },
                         {
                             parentComment,
                             ruleId: "unused-2",
                             type: "disable",
                             line: 1,
-                            column: 28
+                            column: 28,
+                            justification: "j2"
                         }
                     ],
                     problems: [],
@@ -1770,5 +1952,72 @@ describe("apply-disable-directives", () => {
                 ]
             );
         });
+
+        it("Adds a problem for /* eslint-disable foo */ \\n (problem from foo and bar) // eslint-disable-line foo, bar", () => {
+            assert.deepStrictEqual(
+                applyDisableDirectives({
+                    directives: [
+                        {
+                            parentComment: createParentComment([0, 29], " eslint-disable foo ", ["foo"]),
+                            ruleId: "foo",
+                            type: "disable",
+                            line: 1,
+                            column: 1,
+                            justification: "j1"
+                        },
+                        {
+                            parentComment: createParentComment([41, 81], " eslint-disable-line foo, bar", ["foo", "bar"]),
+                            ruleId: "foo",
+                            type: "disable-line",
+                            line: 2,
+                            column: 11,
+                            justification: "j2"
+                        },
+                        {
+                            parentComment: createParentComment([41, 81], " eslint-disable-line foo, bar ", ["foo", "bar"]),
+                            ruleId: "bar",
+                            type: "disable-line",
+                            line: 2,
+                            column: 11,
+                            justification: "j2"
+                        }
+                    ],
+                    problems: [
+                        { line: 2, column: 1, ruleId: "bar" },
+                        { line: 2, column: 6, ruleId: "foo" }
+                    ],
+                    reportUnusedDisableDirectives: "error"
+                }),
+                [
+                    {
+                        ruleId: "bar",
+                        line: 2,
+                        column: 1,
+                        suppressions: [{ kind: "directive", justification: "j2" }]
+                    },
+                    {
+                        ruleId: "foo",
+                        line: 2,
+                        column: 6,
+                        suppressions: [
+                            { kind: "directive", justification: "j1" },
+                            { kind: "directive", justification: "j2" }
+                        ]
+                    },
+                    {
+                        ruleId: null,
+                        message: "Unused eslint-disable directive (no problems were reported from 'foo').",
+                        line: 2,
+                        column: 11,
+                        fix: {
+                            range: [64, 69],
+                            text: ""
+                        },
+                        severity: 2,
+                        nodeType: null
+                    }
+                ]
+            );
+        });
     });
 });
index 760d5b399898cad157a188528f6d93791b1c8032..40fb017ed7b381b02934091a9680bad893a6c105 100644 (file)
@@ -54,7 +54,7 @@ function getOrderOfTraversing(codePath, options, callback) {
     codePath.traverseSegments(options, (segment, controller) => {
         retv.push(segment.id);
         if (callback) {
-            callback(segment, controller); // eslint-disable-line node/callback-return -- At end of inner function
+            callback(segment, controller); // eslint-disable-line n/callback-return -- At end of inner function
         }
     });
 
@@ -69,7 +69,7 @@ describe("CodePathAnalyzer", () => {
 
     /*
      * If you need to output the code paths and DOT graph information for a
-     * particular piece of code, udpate and uncomment the following test and
+     * particular piece of code, update and uncomment the following test and
      * then run:
      * DEBUG=eslint:code-path npx mocha tests/lib/linter/code-path-analysis/
      *
index f51fe693a735575fb80789bf7aab3441b46b6848..e9f595d7750465785b513d57ed8930e90938c6da 100644 (file)
@@ -215,7 +215,7 @@ describe("ConfigCommentParser", () => {
             });
         });
 
-        it("should parse list config with two items and exta whitespace", () => {
+        it("should parse list config with two items and extra whitespace", () => {
             const code = "  a , b  ";
             const result = commentParser.parseListConfig(code);
 
index 3343461461013459bc4724dafc25f11895faa5bb..407194d47e70099c7fd7f6b7391471cfdf2f6de5 100644 (file)
@@ -217,6 +217,131 @@ describe("Linter", () => {
 
     });
 
+    describe("getSuppressedMessages()", () => {
+        it("should have no suppressed messages", () => {
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(suppressedMessages.length, 0);
+        });
+
+        it("should have a suppressed message", () => {
+            const code = "/* eslint-disable no-alert -- justification */\nalert(\"test\");";
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [{ kind: "directive", justification: "justification" }]
+            );
+        });
+
+        it("should have a suppressed message", () => {
+            const code = [
+                "/* eslint-disable no-alert --- j1",
+                " * --- j2",
+                " */",
+                "alert(\"test\");"
+            ].join("\n");
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [{ kind: "directive", justification: "j1\n * --- j2" }]
+            );
+        });
+
+        it("should not report a lint message", () => {
+            const code = [
+                "/* eslint-disable -- j1 */",
+                "// eslint-disable-next-line -- j2",
+                "alert(\"test\");"
+            ].join("\n");
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [
+                    { kind: "directive", justification: "j1" },
+                    { kind: "directive", justification: "j2" }
+                ]
+            );
+        });
+
+        it("should not report a lint message", () => {
+            const code = [
+                "/* eslint-disable -- j1 */",
+                "alert(\"test\"); // eslint-disable-line -- j2"
+            ].join("\n");
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [
+                    { kind: "directive", justification: "j1" },
+                    { kind: "directive", justification: "j2" }
+                ]
+            );
+        });
+
+        it("should have a suppressed message with multiple suppressions", () => {
+            const code = [
+                "/* eslint-disable no-alert -- j1 */",
+                "/* eslint-disable no-console -- unused */",
+                "/* eslint-disable-next-line no-alert -- j2 */",
+                "alert(\"test\"); // eslint-disable-line no-alert -- j3"
+            ].join("\n");
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [
+                    { kind: "directive", justification: "j1" },
+                    { kind: "directive", justification: "j2" },
+                    { kind: "directive", justification: "j3" }
+                ]
+            );
+        });
+    });
+
     describe("context.getSource()", () => {
         const code = TEST_CODE;
 
@@ -832,8 +957,10 @@ describe("Linter", () => {
             }));
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
             sinon.assert.calledOnce(spyVariableDeclaration);
             sinon.assert.calledOnce(spyVariableDeclarator);
             sinon.assert.calledOnce(spyIdentifier);
@@ -871,9 +998,11 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Hello");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not have any settings if they were not passed in", () => {
@@ -890,8 +1019,10 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -951,8 +1082,10 @@ describe("Linter", () => {
             linter.defineParser("test-parser", parser);
             const config = { rules: {}, parser: "test-parser" };
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
     });
@@ -978,8 +1111,10 @@ describe("Linter", () => {
 
             linter.defineParser("enhanced-parser", testParsers.enhancedParser);
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should expose parser services when using parseForESLint() and services are specified", () => {
@@ -995,9 +1130,11 @@ describe("Linter", () => {
 
             const config = { rules: { "test-service-rule": 2 }, parser: "enhanced-parser" };
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Hi!");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should use the same parserServices if source code object is reused", () => {
@@ -1013,14 +1150,18 @@ describe("Linter", () => {
 
             const config = { rules: { "test-service-rule": 2 }, parser: "enhanced-parser" };
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Hi!");
+            assert.strictEqual(suppressedMessages.length, 0);
 
             const messages2 = linter.verify(linter.getSourceCode(), config, filename);
+            const suppressedMessages2 = linter.getSuppressedMessages();
 
             assert.strictEqual(messages2.length, 1);
             assert.strictEqual(messages2[0].message, "Hi!");
+            assert.strictEqual(suppressedMessages2.length, 0);
         });
 
         it("should pass parser as parserPath to all rules when default parser is used", () => {
@@ -1046,9 +1187,12 @@ describe("Linter", () => {
             config.rules[rule] = 1;
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, rule);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should be configurable by only setting the string value", () => {
@@ -1058,10 +1202,13 @@ describe("Linter", () => {
             config.rules[rule] = "warn";
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 1);
             assert.strictEqual(messages[0].ruleId, rule);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should be configurable by passing in values as an array", () => {
@@ -1071,9 +1218,12 @@ describe("Linter", () => {
             config.rules[rule] = [1];
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, rule);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should be configurable by passing in string value as an array", () => {
@@ -1083,10 +1233,13 @@ describe("Linter", () => {
             config.rules[rule] = ["warn"];
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 1);
             assert.strictEqual(messages[0].ruleId, rule);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not be configurable by setting other value", () => {
@@ -1096,15 +1249,19 @@ describe("Linter", () => {
             config.rules[rule] = "1";
 
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should process empty config", () => {
             const config = {};
             const messages = linter.verify(code, config, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1504,10 +1661,13 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, code);
             assert.strictEqual(messages[0].nodeType, "Literal");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1531,6 +1691,7 @@ describe("Linter", () => {
             linter.defineRules(newRules);
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, code.length);
             code.forEach(item => {
@@ -1539,6 +1700,8 @@ describe("Linter", () => {
             messages.forEach(message => {
                 assert.strictEqual(message.nodeType, "Literal");
             });
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1557,8 +1720,10 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages[0].message, filename);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("has access to the physicalFilename", () => {
@@ -1573,8 +1738,10 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages[0].message, filename);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("defaults filename to '<input>'", () => {
@@ -1589,8 +1756,10 @@ describe("Linter", () => {
             config.rules[code] = 1;
 
             const messages = linter.verify("0", config);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages[0].message, "<input>");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1601,11 +1770,14 @@ describe("Linter", () => {
             const config = { rules: {} };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].message, "Unexpected alert.");
             assert.include(messages[0].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("rules should not change initial config", () => {
@@ -1613,11 +1785,16 @@ describe("Linter", () => {
             const codeA = "/*eslint strict: 0*/ function bar() { return 2; }";
             const codeB = "function foo() { return 1; }";
             let messages = linter.verify(codeA, config, filename, false);
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify(codeB, config, filename, false);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("rules should not change initial config", () => {
@@ -1625,42 +1802,62 @@ describe("Linter", () => {
             const codeA = "/*eslint quotes: 0*/ function bar() { return '2'; }";
             const codeB = "function foo() { return '1'; }";
             let messages = linter.verify(codeA, config, filename, false);
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify(codeB, config, filename, false);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("rules should not change initial config", () => {
             const config = { rules: { quotes: [2, "double"] } };
             const codeA = "/*eslint quotes: [0, \"single\"]*/ function bar() { return '2'; }";
             const codeB = "function foo() { return '1'; }";
+
             let messages = linter.verify(codeA, config, filename, false);
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify(codeB, config, filename, false);
+            suppressedMessages = linter.getSuppressedMessages();
+
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("rules should not change initial config", () => {
             const config = { rules: { "no-unused-vars": [2, { vars: "all" }] } };
             const codeA = "/*eslint no-unused-vars: [0, {\"vars\": \"local\"}]*/ var a = 44;";
             const codeB = "var b = 55;";
+
             let messages = linter.verify(codeA, config, filename, false);
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify(codeB, config, filename, false);
+            suppressedMessages = linter.getSuppressedMessages();
+
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
     describe("when evaluating code with invalid comments to enable rules", () => {
         it("should report a violation when the config is not a valid rule configuration", () => {
+            const messages = linter.verify("/*eslint no-alert:true*/ alert('test');", {});
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/*eslint no-alert:true*/ alert('test');", {}),
+                messages,
                 [
                     {
                         severity: 2,
@@ -1674,11 +1871,16 @@ describe("Linter", () => {
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation when the config violates a rule's schema", () => {
+            const messages = linter.verify("/* eslint no-alert: [error, {nonExistentPropertyName: true}]*/", {});
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/* eslint no-alert: [error, {nonExistentPropertyName: true}]*/", {}),
+                messages,
                 [
                     {
                         severity: 2,
@@ -1692,6 +1894,8 @@ describe("Linter", () => {
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1702,52 +1906,68 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
     describe("when evaluating code with comments to disable rules", () => {
-        let code, messages;
+        let code, messages, suppressedMessages;
 
         it("should report an error when disabling a non-existent rule in inline comment", () => {
             code = "/*eslint foo:0*/ ;";
             messages = linter.verify(code, {}, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
 
             code = "/*eslint-disable foo*/ ;";
             messages = linter.verify(code, {}, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
 
             code = "/*eslint-disable-line foo*/ ;";
             messages = linter.verify(code, {}, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
 
             code = "/*eslint-disable-next-line foo*/ ;";
             messages = linter.verify(code, {}, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report an error, when disabling a non-existent rule in config", () => {
             messages = linter.verify("", { rules: { foo: 0 } }, filename);
+            suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report an error, when config a non-existent rule in config", () => {
             messages = linter.verify("", { rules: { foo: 1 } }, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify("", { rules: { foo: 2 } }, filename);
+            suppressedMessages = linter.getSuppressedMessages();
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1758,12 +1978,15 @@ describe("Linter", () => {
             const config = { rules: {} };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].message, "Unexpected alert.");
             assert.include(messages[0].nodeType, "CallExpression");
             assert.strictEqual(messages[1].ruleId, "no-console");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1774,11 +1997,14 @@ describe("Linter", () => {
             const config = { rules: { "no-console": 1, "no-alert": 0 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].message, "Unexpected alert.");
             assert.include(messages[0].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1799,8 +2025,10 @@ describe("Linter", () => {
             const code = "/*eslint test-plugin/test-rule: 2*/ var a = \"no violation\";";
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation when inline comment disables plugin rule", () => {
@@ -1808,8 +2036,10 @@ describe("Linter", () => {
             const config = { rules: { "test-plugin/test-rule": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation when the report is right before the comment", () => {
@@ -1821,9 +2051,11 @@ describe("Linter", () => {
                 }
             }));
             const problems = linter.verify(code, { rules: { checker: "error" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(problems.length, 1);
             assert.strictEqual(problems[0].message, "foo");
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation when the report is right at the start of the comment", () => {
@@ -1835,20 +2067,32 @@ describe("Linter", () => {
                 }
             }));
             const problems = linter.verify(code, { rules: { checker: "error" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(problems.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].message, "foo");
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 1);
+            assert.strictEqual(suppressedMessages[0].suppressions[0].justification, "");
         });
 
         it("rules should not change initial config", () => {
             const config = { rules: { "test-plugin/test-rule": 2 } };
             const codeA = "/*eslint test-plugin/test-rule: 0*/ var a = \"trigger violation\";";
             const codeB = "var a = \"trigger violation\";";
+
             let messages = linter.verify(codeA, config, filename, false);
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify(codeB, config, filename, false);
+            suppressedMessages = linter.getSuppressedMessages();
+
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -1864,12 +2108,20 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].message, "Unexpected alert.");
             assert.include(messages[0].nodeType, "CallExpression");
             assert.strictEqual(messages[0].line, 4);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].message, "Unexpected alert.");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 1);
+            assert.strictEqual(suppressedMessages[0].suppressions[0].justification, "");
         });
 
         it("should not report a violation", () => {
@@ -1881,8 +2133,15 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 1);
+            assert.strictEqual(suppressedMessages[1].line, 3);
+            assert.strictEqual(suppressedMessages[1].suppressions.length, 1);
         });
 
         it("should not report a violation", () => {
@@ -1895,10 +2154,15 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
             assert.strictEqual(messages[0].column, 21);
             assert.strictEqual(messages[1].column, 19);
+
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].column, 1);
+            assert.strictEqual(suppressedMessages[1].column, 56);
         });
 
         it("should report a violation", () => {
@@ -1916,8 +2180,10 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 2);
         });
 
 
@@ -1931,8 +2197,10 @@ describe("Linter", () => {
             const config = { rules: { "no-unused-vars": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 1);
         });
 
         it("should not report a violation", () => {
@@ -1944,8 +2212,10 @@ describe("Linter", () => {
             const config = { rules: { "no-unused-vars": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 1);
         });
     });
 
@@ -1965,10 +2235,13 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
-
                 assert.strictEqual(messages[0].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
             it("should report a violation", () => {
@@ -1985,10 +2258,14 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
-
                 assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
             });
 
             it("should report a violation if eslint-disable-line in a block comment is not on a single line", () => {
@@ -2004,10 +2281,11 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
-
                 assert.strictEqual(messages[1].ruleId, "no-console");
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should not disable rule and add an extra report if eslint-disable-line in a block comment is not on a single line", () => {
@@ -2022,6 +2300,7 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.deepStrictEqual(messages, [
                     {
@@ -2046,6 +2325,8 @@ describe("Linter", () => {
                         nodeType: null
                     }
                 ]);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should not report a violation for eslint-disable-line in block comment", () => {
@@ -2060,8 +2341,13 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "no-alert");
             });
 
             it("should not report a violation", () => {
@@ -2077,8 +2363,13 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
             });
 
             it("should not report a violation", () => {
@@ -2096,8 +2387,10 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 5);
             });
 
             it("should not report a violation", () => {
@@ -2115,8 +2408,10 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 5);
             });
 
             it("should ignore violations of multiple rules when specified in mixed comments", () => {
@@ -2130,8 +2425,12 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
         });
 
@@ -2149,9 +2448,13 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
             it("should ignore violation of specified rule if eslint-disable-next-line is a block comment", () => {
@@ -2167,9 +2470,13 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
             it("should ignore violation of specified rule if eslint-disable-next-line is a block comment", () => {
                 const code = [
@@ -2182,11 +2489,15 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
-            it("should not ignore violation if block comment is not on a single line", () => {
+            it("should not ignore violation if code is not on next line", () => {
                 const code = [
                     "/* eslint-disable-next-line",
                     "no-alert */alert('test');"
@@ -2197,9 +2508,32 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
-                assert.strictEqual(messages.length, 2);
-                assert.strictEqual(messages[1].ruleId, "no-alert");
+                assert.strictEqual(messages.length, 1);
+                assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                assert.strictEqual(suppressedMessages.length, 0);
+            });
+
+            it("should ignore violation if block comment span multiple lines", () => {
+                const code = [
+                    "/* eslint-disable-next-line",
+                    "no-alert */",
+                    "alert('test');"
+                ].join("\n");
+                const config = {
+                    rules: {
+                        "no-alert": 1
+                    }
+                };
+                const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
+
+                assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
             it("should ignore violations only of specified rule", () => {
@@ -2215,10 +2549,13 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
                 assert.strictEqual(messages[0].ruleId, "no-alert");
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore violations of multiple rules when specified", () => {
@@ -2235,6 +2572,33 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
+
+                assert.strictEqual(messages.length, 1);
+                assert.strictEqual(messages[0].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+            });
+
+            it("should ignore violations of multiple rules when specified in multiple lines", () => {
+                const code = [
+                    "/* eslint-disable-next-line",
+                    "no-alert,",
+                    "quotes",
+                    "*/",
+                    "alert(\"test\");",
+                    "console.log('test');"
+                ].join("\n");
+                const config = {
+                    rules: {
+                        "no-alert": 1,
+                        quotes: [1, "single"],
+                        "no-console": 1
+                    }
+                };
+                const messages = linter.verify(code, config, filename);
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-console");
@@ -2252,6 +2616,29 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
+
+                assert.strictEqual(messages.length, 0);
+
+                assert.strictEqual(suppressedMessages.length, 2);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+            });
+
+            it("should ignore violations of multiple rules when specified in mixed single line and multi line comments", () => {
+                const code = [
+                    "/* eslint-disable-next-line",
+                    "no-alert",
+                    "*/ // eslint-disable-next-line quotes",
+                    "alert(\"test\");"
+                ].join("\n");
+                const config = {
+                    rules: {
+                        "no-alert": 1,
+                        quotes: [1, "single"]
+                    }
+                };
+                const messages = linter.verify(code, config, filename);
 
                 assert.strictEqual(messages.length, 0);
             });
@@ -2270,10 +2657,14 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
                 assert.strictEqual(messages[0].ruleId, "no-alert");
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "quotes");
             });
 
             it("should ignore violations of specified rule on next line only", () => {
@@ -2290,10 +2681,14 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
                 assert.strictEqual(messages[0].ruleId, "no-alert");
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
             it("should ignore all rule violations on next line if none specified", () => {
@@ -2311,9 +2706,15 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 3);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+                assert.strictEqual(suppressedMessages[2].ruleId, "semi");
             });
 
             it("should ignore violations if eslint-disable-next-line is a block comment", () => {
@@ -2330,10 +2731,14 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
                 assert.strictEqual(messages[0].ruleId, "no-alert");
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 1);
+                assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
             });
 
             it("should report a violation", () => {
@@ -2351,10 +2756,12 @@ describe("Linter", () => {
                 };
 
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
-
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should not ignore violations if comment is of the type hashbang", () => {
@@ -2370,10 +2777,13 @@ describe("Linter", () => {
                     }
                 };
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 2);
                 assert.strictEqual(messages[0].ruleId, "no-alert");
                 assert.strictEqual(messages[1].ruleId, "no-console");
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
     });
@@ -2389,10 +2799,13 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
-
             assert.strictEqual(messages[0].ruleId, "no-console");
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
         });
 
         it("should report no violation", () => {
@@ -2405,8 +2818,15 @@ describe("Linter", () => {
             const config = { rules: { "no-unused-vars": 2 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-unused-vars");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-unused-vars");
+            assert.strictEqual(suppressedMessages[1].line, 3);
         });
 
         it("should report no violation", () => {
@@ -2420,8 +2840,10 @@ describe("Linter", () => {
             const config = { rules: { "no-unused-vars": 2 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 5);
         });
 
         it("should report no violation", () => {
@@ -2433,8 +2855,10 @@ describe("Linter", () => {
             const config = { rules: { quotes: 2 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation", () => {
@@ -2450,13 +2874,19 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
-
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].line, 5);
             assert.strictEqual(messages[1].ruleId, "no-console");
             assert.strictEqual(messages[1].line, 6);
+
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[1].line, 3);
         });
 
         it("should report a violation", () => {
@@ -2471,10 +2901,16 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
-
             assert.strictEqual(messages[0].ruleId, "no-console");
+
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[1].line, 5);
         });
 
 
@@ -2491,11 +2927,19 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
-
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].line, 5);
+
+            assert.strictEqual(suppressedMessages.length, 3);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[1].line, 3);
+            assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[2].line, 6);
         });
 
 
@@ -2521,21 +2965,23 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 4);
-
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].line, 6);
-
             assert.strictEqual(messages[1].ruleId, "no-console");
             assert.strictEqual(messages[1].line, 7);
-
             assert.strictEqual(messages[2].ruleId, "no-alert");
             assert.strictEqual(messages[2].line, 9);
-
             assert.strictEqual(messages[3].ruleId, "no-console");
             assert.strictEqual(messages[3].line, 10);
 
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 3);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[1].line, 4);
         });
 
         it("should report a violation", () => {
@@ -2558,18 +3004,23 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 3);
-
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].line, 5);
-
             assert.strictEqual(messages[1].ruleId, "no-alert");
             assert.strictEqual(messages[1].line, 8);
-
             assert.strictEqual(messages[2].ruleId, "no-console");
             assert.strictEqual(messages[2].line, 9);
 
+            assert.strictEqual(suppressedMessages.length, 3);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[1].line, 3);
+            assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[2].line, 6);
         });
 
         it("should report a violation when severity is warn", () => {
@@ -2592,18 +3043,23 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": "warn", "no-console": "warn" } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 3);
-
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].line, 5);
-
             assert.strictEqual(messages[1].ruleId, "no-alert");
             assert.strictEqual(messages[1].line, 8);
-
             assert.strictEqual(messages[2].ruleId, "no-console");
             assert.strictEqual(messages[2].line, 9);
 
+            assert.strictEqual(suppressedMessages.length, 3);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.strictEqual(suppressedMessages[0].line, 2);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[1].line, 3);
+            assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+            assert.strictEqual(suppressedMessages[2].line, 6);
         });
     });
 
@@ -2614,11 +3070,14 @@ describe("Linter", () => {
             const config = { rules: { "no-console": 1, "no-alert": 0 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
             assert.strictEqual(messages[0].message, "Unexpected alert.");
             assert.include(messages[0].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2629,11 +3088,14 @@ describe("Linter", () => {
             const config = { rules: { quotes: [2, "single"] } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "quotes");
             assert.strictEqual(messages[0].message, "Strings must use doublequote.");
             assert.include(messages[0].nodeType, "Literal");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2644,11 +3106,14 @@ describe("Linter", () => {
             const config = { rules: { quotes: [2, "single"] } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "quotes");
             assert.strictEqual(messages[0].message, "Strings must use doublequote.");
             assert.include(messages[0].nodeType, "Literal");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2659,6 +3124,7 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
 
@@ -2676,6 +3142,8 @@ describe("Linter", () => {
             assert.strictEqual(messages[1].ruleId, "no-alert");
             assert.strictEqual(messages[1].message, "Unexpected alert.");
             assert.include(messages[1].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation", () => {
@@ -2684,6 +3152,7 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
 
@@ -2701,6 +3170,8 @@ describe("Linter", () => {
             assert.strictEqual(messages[1].ruleId, "no-alert");
             assert.strictEqual(messages[1].message, "Unexpected alert.");
             assert.include(messages[1].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation", () => {
@@ -2709,6 +3180,7 @@ describe("Linter", () => {
             const config = { rules: { "no-alert": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 2);
 
@@ -2726,6 +3198,8 @@ describe("Linter", () => {
             assert.strictEqual(messages[1].ruleId, "no-alert");
             assert.strictEqual(messages[1].message, "Unexpected alert.");
             assert.include(messages[1].nodeType, "CallExpression");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2737,11 +3211,14 @@ alert('test');
 
         it("should not parse errors, should report a violation", () => {
             const messages = linter.verify(code, {}, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "max-len");
             assert.strictEqual(messages[0].message, "This line has a length of 129. Maximum allowed is 100.");
             assert.include(messages[0].nodeType, "Program");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2756,6 +3233,7 @@ var a = "test2";
         it("should validate correctly", () => {
             const config = { rules: {} };
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
             const [message1, message2] = messages;
 
             assert.strictEqual(messages.length, 2);
@@ -2769,6 +3247,8 @@ var a = "test2";
             assert.strictEqual(message2.line, 5);
             assert.strictEqual(message2.column, 1);
             assert.include(message2.nodeType, "Program");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2778,11 +3258,14 @@ var a = "test2";
             const code = "#!bin/program\n\nvar foo;;";
             const config = { rules: { "no-extra-semi": 1 } };
             const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-extra-semi");
             assert.strictEqual(messages[0].nodeType, "EmptyStatement");
             assert.strictEqual(messages[0].line, 3);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should have a comment with the hashbang in it", () => {
@@ -2824,6 +3307,7 @@ var a = "test2";
 
         it("should report a violation with a useful parse error prefix", () => {
             const messages = linter.verify(code);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
@@ -2832,6 +3316,8 @@ var a = "test2";
             assert.strictEqual(messages[0].column, 4);
             assert.isTrue(messages[0].fatal);
             assert.match(messages[0].message, /^Parsing error:/u);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report source code where the issue is present", () => {
@@ -2842,11 +3328,14 @@ var a = "test2";
                 "}"
             ];
             const messages = linter.verify(inValidCode.join("\n"));
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.isTrue(messages[0].fatal);
             assert.match(messages[0].message, /^Parsing error:/u);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2913,9 +3402,12 @@ var a = "test2";
 
         it("should report the new rule", () => {
             const results = linter.verify(code, { rules: { "no-comma-dangle": 2 } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(results[0].ruleId, "no-comma-dangle");
             assert.strictEqual(results[0].message, "Rule 'no-comma-dangle' was removed and replaced by: comma-dangle");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2959,8 +3451,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation when using Promise", () => {
@@ -2969,8 +3463,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -2981,11 +3477,14 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-undef");
             assert.strictEqual(messages[0].nodeType, "Identifier");
             assert.strictEqual(messages[0].line, 1);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -2994,8 +3493,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         // https://github.com/eslint/eslint/issues/14652
@@ -3009,8 +3510,10 @@ var a = "test2";
 
             for (const code of codes) {
                 const messages = linter.verify(code, config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 0);
             }
 
         });
@@ -3021,8 +3524,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3031,8 +3536,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3041,8 +3548,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3051,8 +3560,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3061,8 +3572,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3071,8 +3584,10 @@ var a = "test2";
             const config = { rules: {} };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation", () => {
@@ -3081,8 +3596,10 @@ var a = "test2";
             const config = { rules: { "no-undef": 1 } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -3101,9 +3618,12 @@ var a = "test2";
                 filename,
                 allowInlineConfig: false
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation for global variable declarations", () => {
@@ -3156,9 +3676,12 @@ var a = "test2";
                 filename,
                 allowInlineConfig: false
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report a violation for rule changes", () => {
@@ -3176,8 +3699,10 @@ var a = "test2";
                 filename,
                 allowInlineConfig: false
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation for disable-line", () => {
@@ -3194,9 +3719,12 @@ var a = "test2";
                 filename,
                 allowInlineConfig: false
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-alert");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report a violation for env changes", () => {
@@ -3209,9 +3737,12 @@ var a = "test2";
                 }
             };
             const messages = linter.verify(code, config, { allowInlineConfig: false });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].ruleId, "no-undef");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -3230,12 +3761,15 @@ var a = "test2";
             // eslint-disable-next-line no-loop-func -- No closures
             it(`should warn '/* ${directive} */' if 'noInlineConfig' was given.`, () => {
                 const messages = linter.verify(`/* ${directive} */`, { noInlineConfig: true });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.deepStrictEqual(messages.length, 1);
                 assert.deepStrictEqual(messages[0].fatal, void 0);
                 assert.deepStrictEqual(messages[0].ruleId, null);
                 assert.deepStrictEqual(messages[0].severity, 1);
                 assert.deepStrictEqual(messages[0].message, `'/*${directive.split(" ")[0]}*/' has no effect because you have 'noInlineConfig' setting in your config.`);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         }
 
@@ -3246,19 +3780,24 @@ var a = "test2";
             // eslint-disable-next-line no-loop-func -- No closures
             it(`should warn '// ${directive}' if 'noInlineConfig' was given.`, () => {
                 const messages = linter.verify(`// ${directive}`, { noInlineConfig: true });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.deepStrictEqual(messages.length, 1);
                 assert.deepStrictEqual(messages[0].fatal, void 0);
                 assert.deepStrictEqual(messages[0].ruleId, null);
                 assert.deepStrictEqual(messages[0].severity, 1);
                 assert.deepStrictEqual(messages[0].message, `'//${directive.split(" ")[0]}' has no effect because you have 'noInlineConfig' setting in your config.`);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         }
 
         it("should not warn if 'noInlineConfig' and '--no-inline-config' were given.", () => {
             const messages = linter.verify("/* globals foo */", { noInlineConfig: true }, { allowInlineConfig: false });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -3316,8 +3855,11 @@ var a = "test2";
 
     describe("reportUnusedDisable option", () => {
         it("reports problems for unused eslint-disable comments", () => {
+            const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: true });
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: true }),
+                messages,
                 [
                     {
                         ruleId: null,
@@ -3333,11 +3875,75 @@ var a = "test2";
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
+        });
+
+        it("reports problems for multiple eslint-disable comments, including unused ones", () => {
+            const code = [
+                "/* eslint-disable no-alert -- j1 */",
+                "alert(\"test\"); //eslint-disable-line no-alert -- j2"
+            ].join("\n");
+            const config = {
+                rules: {
+                    "no-alert": 2
+                }
+            };
+            const messages = linter.verify(code, config, { reportUnusedDisableDirectives: true });
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 2);
+        });
+
+        it("reports problems for eslint-disable-line and eslint-disable-next-line comments, including unused ones", () => {
+            const code = [
+                "// eslint-disable-next-line no-alert -- j1 */",
+                "alert(\"test\"); //eslint-disable-line no-alert -- j2"
+            ].join("\n");
+            const config = {
+                rules: {
+                    "no-alert": 2
+                }
+            };
+            const messages = linter.verify(code, config, { reportUnusedDisableDirectives: true });
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 2);
+        });
+
+        it("reports problems for multiple unused eslint-disable comments with multiple ruleIds", () => {
+            const code = [
+                "/* eslint no-undef: 2, no-void: 2 */",
+                "/* eslint-disable no-undef -- j1 */",
+                "void foo; //eslint-disable-line no-undef, no-void -- j2"
+            ].join("\n");
+            const config = {
+                rules: {
+                    "no-undef": 2,
+                    "no-void": 2
+                }
+            };
+            const messages = linter.verify(code, config, { reportUnusedDisableDirectives: true });
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 1);
+            assert.strictEqual(suppressedMessages.length, 2);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-void");
+            assert.strictEqual(suppressedMessages[0].suppressions.length, 1);
+            assert.strictEqual(suppressedMessages[1].ruleId, "no-undef");
+            assert.strictEqual(suppressedMessages[1].suppressions.length, 2);
         });
 
         it("reports problems for unused eslint-disable comments (error)", () => {
+            const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "error" });
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "error" }),
+                messages,
                 [
                     {
                         ruleId: null,
@@ -3353,11 +3959,16 @@ var a = "test2";
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("reports problems for unused eslint-disable comments (warn)", () => {
+            const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "warn" });
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "warn" }),
+                messages,
                 [
                     {
                         ruleId: null,
@@ -3373,11 +3984,16 @@ var a = "test2";
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("reports problems for unused eslint-disable comments (in config)", () => {
+            const messages = linter.verify("/* eslint-disable */", { reportUnusedDisableDirectives: true });
+            const suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(
-                linter.verify("/* eslint-disable */", { reportUnusedDisableDirectives: true }),
+                messages,
                 [
                     {
                         ruleId: null,
@@ -3393,6 +4009,8 @@ var a = "test2";
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("reports problems for partially unused eslint-disable comments (in config)", () => {
@@ -3409,6 +4027,7 @@ var a = "test2";
                 filename,
                 allowInlineConfig: true
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(
                 messages,
@@ -3427,6 +4046,9 @@ var a = "test2";
                     }
                 ]
             );
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
         });
 
         describe("autofix", () => {
@@ -4003,8 +4625,12 @@ var a = "test2";
                 filename,
                 allowInlineConfig: true
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
         });
     });
 
@@ -4114,6 +4740,7 @@ var a = "test2";
             const config = { rules: { "no-mixed-spaces-and-tabs": 1, "eol-last": 1, semi: [1, "always"] } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 3);
             assert.strictEqual(messages[0].line, 1);
@@ -4122,22 +4749,28 @@ var a = "test2";
             assert.strictEqual(messages[1].column, 18);
             assert.strictEqual(messages[2].line, 2);
             assert.strictEqual(messages[2].column, 18);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         describe("ecmaVersion", () => {
 
             it("should not support ES6 when no ecmaVersion provided", () => {
                 const messages = linter.verify("let x = 0;");
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("supports ECMAScript version 'latest'", () => {
                 const messages = linter.verify("let x = 5 ** 7;", {
                     parserOptions: { ecmaVersion: "latest" }
                 });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("the 'latest' is equal to espree.latestEcmaVersion", () => {
@@ -4258,8 +4891,10 @@ var a = "test2";
                             ecmaVersion: 6
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("the ECMAScript version number is 2015", () => {
@@ -4268,8 +4903,10 @@ var a = "test2";
                             ecmaVersion: 2015
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
 
@@ -4279,8 +4916,10 @@ var a = "test2";
                         ecmaVersion: 2015
                     }
                 });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             describe("should properly parse exponentiation operator when", () => {
@@ -4290,8 +4929,10 @@ var a = "test2";
                             ecmaVersion: 7
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("the ECMAScript version number is 2016", () => {
@@ -4300,8 +4941,10 @@ var a = "test2";
                             ecmaVersion: 2016
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
         });
@@ -4313,8 +4956,10 @@ var a = "test2";
                     ecmaVersion: 2018
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse global return when passed ecmaFeatures", () => {
@@ -4326,8 +4971,10 @@ var a = "test2";
                     }
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse global return when in Node.js environment", () => {
@@ -4337,8 +4984,10 @@ var a = "test2";
                     node: true
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not parse global return when in Node.js environment with globalReturn explicitly off", () => {
@@ -4353,24 +5002,32 @@ var a = "test2";
                     }
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Parsing error: 'return' outside of function");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not parse global return when Node.js environment is false", () => {
 
             const messages = linter.verify("return;", {}, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Parsing error: 'return' outside of function");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse sloppy-mode code when impliedStrict is false", () => {
 
             const messages = linter.verify("var private;", {}, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not parse sloppy-mode code when impliedStrict is true", () => {
@@ -4382,9 +5039,12 @@ var a = "test2";
                     }
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].message, "Parsing error: The keyword 'private' is reserved");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse valid code when impliedStrict is true", () => {
@@ -4396,8 +5056,10 @@ var a = "test2";
                     }
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse JSX when passed ecmaFeatures", () => {
@@ -4409,69 +5071,89 @@ var a = "test2";
                     }
                 }
             }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should report an error when JSX code is encountered and JSX is not enabled", () => {
             const code = "var myDivElement = <div className=\"foo\" />;";
             const messages = linter.verify(code, {}, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].line, 1);
             assert.strictEqual(messages[0].column, 20);
             assert.strictEqual(messages[0].message, "Parsing error: Unexpected token <");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report an error when JSX code is encountered and JSX is enabled", () => {
             const code = "var myDivElement = <div className=\"foo\" />;";
             const messages = linter.verify(code, { parserOptions: { ecmaFeatures: { jsx: true } } }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not report an error when JSX code contains a spread operator and JSX is enabled", () => {
             const code = "var myDivElement = <div {...this.props} />;";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not allow the use of reserved words as variable names in ES3", () => {
             const code = "var char;";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 3 } }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.isTrue(messages[0].fatal);
             assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not allow the use of reserved words as property names in member expressions in ES3", () => {
             const code = "obj.char;";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 3 } }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.isTrue(messages[0].fatal);
             assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not allow the use of reserved words as property names in object literals in ES3", () => {
             const code = "var obj = { char: 1 };";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 3 } }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.isTrue(messages[0].fatal);
             assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should allow the use of reserved words as variable and property names in ES3 when allowReserved is true", () => {
             const code = "var char; obj.char; var obj = { char: 1 };";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 3, allowReserved: true } }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not allow the use of reserved words as variable names in ES > 3", () => {
@@ -4480,11 +5162,14 @@ var a = "test2";
             ecmaVersions.forEach(ecmaVersion => {
                 const code = "var enum;";
                 const messages = linter.verify(code, { parserOptions: { ecmaVersion } }, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].severity, 2);
                 assert.isTrue(messages[0].fatal);
                 assert.match(messages[0].message, /^Parsing error:.*'enum'/u);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -4494,8 +5179,10 @@ var a = "test2";
             ecmaVersions.forEach(ecmaVersion => {
                 const code = "obj.enum; obj.function; var obj = { enum: 1, function: 2 };";
                 const messages = linter.verify(code, { parserOptions: { ecmaVersion } }, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -4505,11 +5192,14 @@ var a = "test2";
             ecmaVersions.forEach(ecmaVersion => {
                 const code = "";
                 const messages = linter.verify(code, { parserOptions: { ecmaVersion, allowReserved: true } }, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].severity, 2);
                 assert.isTrue(messages[0].fatal);
                 assert.match(messages[0].message, /^Parsing error:.*allowReserved/u);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -4538,14 +5228,18 @@ var a = "test2";
             ].join("\n");
 
             const messages = linter.verify(code, null, "eslint-env es6");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should be able to return in global if there is a comment which enables the node environment with a comment", () => {
             const messages = linter.verify(`/* ${ESLINT_ENV} node */ return;`, null, "node environment");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should attach a \"/*global\" comment node to declared variables", () => {
@@ -4589,6 +5283,7 @@ var a = "test2";
 
         it("should report a linting error when a global is set to an invalid value", () => {
             const results = linter.verify("/* global foo: AAAAA, bar: readonly */\nfoo;\nbar;", { rules: { "no-undef": "error" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(results, [
                 {
@@ -4613,6 +5308,8 @@ var a = "test2";
                     nodeType: "Identifier"
                 }
             ]);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not crash when we reuse the SourceCode object", () => {
@@ -4648,8 +5345,10 @@ var a = "test2";
                 "obj.await",
                 { parserOptions: { ecmaVersion: 6, sourceType: "module" } }
             );
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert(result.length === 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
 
@@ -4682,6 +5381,7 @@ var a = "test2";
                     /*eslint aaa:error -- bbb:error */
                     console.log("hello")
                 `, {});
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include syntax error of the comment.
                 assert.deepStrictEqual(messages, []);
@@ -4689,6 +5389,8 @@ var a = "test2";
                 // Use only `aaa`.
                 assert.strictEqual(aaa.callCount, 1);
                 assert.strictEqual(bbb.callCount, 0);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' in '/*eslint-env*/'.", () => {
@@ -4697,6 +5399,7 @@ var a = "test2";
                     var Promise = {}
                     var Atomics = {}
                 `, { rules: { "no-redeclare": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include `Atomics`
                 assert.deepStrictEqual(
@@ -4713,6 +5416,8 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' in '/*global*/'.", () => {
@@ -4721,6 +5426,7 @@ var a = "test2";
                     var aaa = {}
                     var bbb = {}
                 `, { rules: { "no-redeclare": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include `bbb`
                 assert.deepStrictEqual(
@@ -4737,6 +5443,8 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' in '/*globals*/'.", () => {
@@ -4745,6 +5453,7 @@ var a = "test2";
                     var aaa = {}
                     var bbb = {}
                 `, { rules: { "no-redeclare": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include `bbb`
                 assert.deepStrictEqual(
@@ -4761,6 +5470,8 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' in '/*exported*/'.", () => {
@@ -4769,6 +5480,7 @@ var a = "test2";
                     var aaa = {}
                     var bbb = {}
                 `, { rules: { "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include `aaa`
                 assert.deepStrictEqual(
@@ -4785,6 +5497,8 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' in '/*eslint-disable*/'.", () => {
@@ -4793,6 +5507,7 @@ var a = "test2";
                     var aaa = {}
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-unused-vars` but not `no-redeclare`
                 assert.deepStrictEqual(
@@ -4809,6 +5524,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 4,
+                        endColumn: 28,
+                        line: 4,
+                        message: "'aaa' is already defined.",
+                        messageId: "redeclared",
+                        nodeType: "Identifier",
+                        ruleId: "no-redeclare",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                    }]
+                );
             });
 
             it("should ignore the part preceded by '--' in '/*eslint-enable*/'.", () => {
@@ -4818,6 +5549,7 @@ var a = "test2";
                     var aaa = {}
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-redeclare` but not `no-unused-vars`
                 assert.deepStrictEqual(
@@ -4834,6 +5566,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 5,
+                        endColumn: 28,
+                        line: 5,
+                        message: "'aaa' is assigned a value but never used.",
+                        messageId: "unusedVar",
+                        nodeType: "Identifier",
+                        ruleId: "no-unused-vars",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "" }]
+                    }]
+                );
             });
 
             it("should ignore the part preceded by '--' in '//eslint-disable-line'.", () => {
@@ -4841,6 +5589,7 @@ var a = "test2";
                     var aaa = {} //eslint-disable-line no-redeclare -- no-unused-vars
                     var aaa = {} //eslint-disable-line no-redeclare -- no-unused-vars
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-unused-vars` but not `no-redeclare`
                 assert.deepStrictEqual(
@@ -4857,6 +5606,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 3,
+                        endColumn: 28,
+                        line: 3,
+                        message: "'aaa' is already defined.",
+                        messageId: "redeclared",
+                        nodeType: "Identifier",
+                        ruleId: "no-redeclare",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                    }]
+                );
             });
 
             it("should ignore the part preceded by '--' in '/*eslint-disable-line*/'.", () => {
@@ -4864,6 +5629,7 @@ var a = "test2";
                     var aaa = {} /*eslint-disable-line no-redeclare -- no-unused-vars */
                     var aaa = {} /*eslint-disable-line no-redeclare -- no-unused-vars */
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-unused-vars` but not `no-redeclare`
                 assert.deepStrictEqual(
@@ -4880,6 +5646,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 3,
+                        endColumn: 28,
+                        line: 3,
+                        message: "'aaa' is already defined.",
+                        messageId: "redeclared",
+                        nodeType: "Identifier",
+                        ruleId: "no-redeclare",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                    }]
+                );
             });
 
             it("should ignore the part preceded by '--' in '//eslint-disable-next-line'.", () => {
@@ -4889,6 +5671,7 @@ var a = "test2";
                     //eslint-disable-next-line no-redeclare -- no-unused-vars
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-unused-vars` but not `no-redeclare`
                 assert.deepStrictEqual(
@@ -4905,6 +5688,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 5,
+                        endColumn: 28,
+                        line: 5,
+                        message: "'aaa' is already defined.",
+                        messageId: "redeclared",
+                        nodeType: "Identifier",
+                        ruleId: "no-redeclare",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                    }]
+                );
             });
 
             it("should ignore the part preceded by '--' in '/*eslint-disable-next-line*/'.", () => {
@@ -4914,6 +5713,7 @@ var a = "test2";
                     /*eslint-disable-next-line no-redeclare -- no-unused-vars */
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Do include `no-unused-vars` but not `no-redeclare`
                 assert.deepStrictEqual(
@@ -4930,6 +5730,22 @@ var a = "test2";
                         severity: 2
                     }]
                 );
+
+                assert.deepStrictEqual(
+                    suppressedMessages,
+                    [{
+                        column: 25,
+                        endLine: 5,
+                        endColumn: 28,
+                        line: 5,
+                        message: "'aaa' is already defined.",
+                        messageId: "redeclared",
+                        nodeType: "Identifier",
+                        ruleId: "no-redeclare",
+                        severity: 2,
+                        suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                    }]
+                );
             });
 
             it("should not ignore the part preceded by '--' if the '--' is not surrounded by whitespaces.", () => {
@@ -4940,12 +5756,15 @@ var a = "test2";
                     /*eslint a--rule:error */
                     console.log("hello")
                 `, {});
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include syntax error of the comment.
                 assert.deepStrictEqual(messages, []);
 
                 // Use `a--rule`.
                 assert.strictEqual(rule.callCount, 1);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' even if the '--' is longer than 2.", () => {
@@ -4958,6 +5777,7 @@ var a = "test2";
                     /*eslint aaa:error -------- bbb:error */
                     console.log("hello")
                 `, {});
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include syntax error of the comment.
                 assert.deepStrictEqual(messages, []);
@@ -4965,6 +5785,8 @@ var a = "test2";
                 // Use only `aaa`.
                 assert.strictEqual(aaa.callCount, 1);
                 assert.strictEqual(bbb.callCount, 0);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should ignore the part preceded by '--' with line breaks.", () => {
@@ -4979,6 +5801,7 @@ var a = "test2";
                         bbb:error */
                     console.log("hello")
                 `, {});
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 // Don't include syntax error of the comment.
                 assert.deepStrictEqual(messages, []);
@@ -4986,6 +5809,8 @@ var a = "test2";
                 // Use only `aaa`.
                 assert.strictEqual(aaa.callCount, 1);
                 assert.strictEqual(bbb.callCount, 0);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
     });
@@ -5602,6 +6427,7 @@ var a = "test2";
             });
 
             const messages = linter.verify("var a = 1;", { rules: { "rule-with-suggestions": "error" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(messages[0].suggestions, [{
                 desc: "Insert space at the beginning",
@@ -5616,6 +6442,8 @@ var a = "test2";
                     text: " "
                 }
             }]);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("supports messageIds for suggestions", () => {
@@ -5645,6 +6473,7 @@ var a = "test2";
             });
 
             const messages = linter.verify("var a = 1;", { rules: { "rule-with-suggestions": "error" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(messages[0].suggestions, [{
                 messageId: "suggestion1",
@@ -5661,6 +6490,8 @@ var a = "test2";
                     text: " "
                 }
             }]);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should throw an error if suggestion is passed but `meta.hasSuggestions` property is not enabled", () => {
@@ -5829,6 +6660,31 @@ var a = "test2";
                 assert.strictEqual(preprocess.calledOnce, true);
                 assert.deepStrictEqual(preprocess.args[0], [code, filename]);
             });
+
+            it("should catch preprocess error.", () => {
+                const code = "foo";
+                const preprocess = sinon.spy(() => {
+                    throw Object.assign(new SyntaxError("Invalid syntax"), {
+                        lineNumber: 1,
+                        column: 1
+                    });
+                });
+
+                const messages = linter.verify(code, {}, { filename, preprocess });
+
+                assert.strictEqual(preprocess.calledOnce, true);
+                assert.deepStrictEqual(preprocess.args[0], [code, filename]);
+                assert.deepStrictEqual(messages, [
+                    {
+                        ruleId: null,
+                        fatal: true,
+                        severity: 2,
+                        message: "Preprocessing error: Invalid syntax",
+                        line: 1,
+                        column: 1
+                    }
+                ]);
+            });
         });
 
         describe("postprocessors", () => {
@@ -6068,38 +6924,52 @@ var a = "test2";
         it("should properly parse import statements when sourceType is module", () => {
             const code = "import foo from 'foo';";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 6, sourceType: "module" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse import all statements when sourceType is module", () => {
             const code = "import * as foo from 'foo';";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 6, sourceType: "module" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should properly parse default export statements when sourceType is module", () => {
             const code = "export default function initialize() {}";
             const messages = linter.verify(code, { parserOptions: { ecmaVersion: 6, sourceType: "module" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         // https://github.com/eslint/eslint/issues/9687
         it("should report an error when invalid parserOptions found", () => {
             let messages = linter.verify("", { parserOptions: { ecmaVersion: 222 } });
+            let suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(messages.length, 1);
             assert.ok(messages[0].message.includes("Invalid ecmaVersion"));
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify("", { parserOptions: { sourceType: "foo" } });
+            suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(messages.length, 1);
             assert.ok(messages[0].message.includes("Invalid sourceType"));
+            assert.strictEqual(suppressedMessages.length, 0);
 
             messages = linter.verify("", { parserOptions: { ecmaVersion: 5, sourceType: "module" } });
+            suppressedMessages = linter.getSuppressedMessages();
+
             assert.deepStrictEqual(messages.length, 1);
             assert.ok(messages[0].message.includes("sourceType 'module' is not supported when ecmaVersion < 2015"));
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not crash when invalid parentheses syntax is encountered", () => {
@@ -6116,9 +6986,12 @@ var a = "test2";
 
         it("should report syntax error when a keyword exists in object property shorthand", () => {
             const messages = linter.verify("let a = {this}", { parserOptions: { ecmaVersion: 6 } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].fatal, true);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not rewrite env setting in core (https://github.com/eslint/eslint/issues/4814)", () => {
@@ -6152,6 +7025,22 @@ var a = "test2";
 
             assert(ok);
         });
+
+        it("should throw when rule's create() function does not return an object", () => {
+            const config = { rules: { checker: "error" } };
+
+            linter.defineRule("checker", () => null); // returns null
+
+            assert.throws(() => {
+                linter.verify("abc", config, filename);
+            }, "The create() function for rule 'checker' did not return an object.");
+
+            linter.defineRule("checker", () => {}); // returns undefined
+
+            assert.throws(() => {
+                linter.verify("abc", config, filename);
+            }, "The create() function for rule 'checker' did not return an object.");
+        });
     });
 
     describe("Custom parser", () => {
@@ -6173,17 +7062,22 @@ var a = "test2";
 
             linter.defineParser("esprima", esprima);
             const messages = linter.verify(code, { parser: "esprima", parserOptions: { jsx: true } }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should return an error when the custom parser can't be found", () => {
             const code = "var myDivElement = <div {...this.props} />;";
             const messages = linter.verify(code, { parser: "esprima-xyz" }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.strictEqual(messages[0].message, "Configured parser 'esprima-xyz' was not found.");
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not throw or report errors when the custom parser returns unrecognized operators (https://github.com/eslint/eslint/issues/10475)", () => {
@@ -6193,8 +7087,10 @@ var a = "test2";
 
             // This shouldn't throw
             const messages = linter.verify(code, { parser: "unknown-logical-operator" }, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not throw or report errors when the custom parser returns nested unrecognized operators (https://github.com/eslint/eslint/issues/10560)", () => {
@@ -6204,8 +7100,10 @@ var a = "test2";
 
             // This shouldn't throw
             const messages = linter.verify(code, { parser: "unknown-logical-operator-nested" }, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not throw or return errors when the custom parser returns unknown AST nodes", () => {
@@ -6227,27 +7125,36 @@ var a = "test2";
                     "collect-node-types": "error"
                 }
             }, filename, true);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
             assert.isTrue(nodes.length > 0);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should strip leading line: prefix from parser error", () => {
             linter.defineParser("line-error", testParsers.lineError);
             const messages = linter.verify(";", { parser: "line-error" }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.strictEqual(messages[0].message, errorPrefix + testParsers.lineError.expectedError);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not modify a parser error message without a leading line: prefix", () => {
             linter.defineParser("no-line-error", testParsers.noLineError);
-            const messages = linter.verify(";", { parser: "no-line-error" }, "filename");
+            const messages = linter.verify(";", { parser: "no-line-error" }, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].severity, 2);
             assert.strictEqual(messages[0].message, errorPrefix + testParsers.noLineError.expectedError);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         describe("if a parser provides 'visitorKeys'", () => {
@@ -6371,8 +7278,10 @@ var a = "test2";
         it("should not pass any default parserOptions to the parser", () => {
             linter.defineParser("throws-with-options", testParsers.throwsWithOptions);
             const messages = linter.verify(";", { parser: "throws-with-options" }, "filename");
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 
@@ -6391,9 +7300,11 @@ var a = "test2";
             };
 
             const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             // no parsing errors
             assert.strictEqual(messages.length, 0);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
     });
 });
@@ -6441,9 +7352,12 @@ describe("Linter with FlatConfigArray", () => {
                             "no-undef": "error"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1, "There should be one linting error.");
                     assert.strictEqual(messages[0].ruleId, "no-undef", "The linting error should be no-undef.");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should error when accessing a global that isn't available in ecmaVersion 3", () => {
@@ -6456,9 +7370,12 @@ describe("Linter with FlatConfigArray", () => {
                             "no-undef": "error"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1, "There should be one linting error.");
                     assert.strictEqual(messages[0].ruleId, "no-undef", "The linting error should be no-undef.");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should add globals for ES6 when ecmaVersion is 6", () => {
@@ -6470,8 +7387,10 @@ describe("Linter with FlatConfigArray", () => {
                             "no-undef": "error"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0, "There should be no linting errors.");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should allow destructuring when ecmaVersion is 6", () => {
@@ -6480,8 +7399,10 @@ describe("Linter with FlatConfigArray", () => {
                             ecmaVersion: 6
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0, "There should be no linting errors.");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("ecmaVersion should be normalized to year name for ES 6", () => {
@@ -6644,8 +7565,10 @@ describe("Linter with FlatConfigArray", () => {
                             sourceType: "module"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0, "There should no linting errors.");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should error when return is used at the top-level outside of commonjs", () => {
@@ -6655,9 +7578,12 @@ describe("Linter with FlatConfigArray", () => {
                             sourceType: "script"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1, "There should be one parsing error.");
                     assert.strictEqual(messages[0].message, "Parsing error: 'return' outside of function");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not error when top-level return is used in commonjs", () => {
@@ -6667,8 +7593,10 @@ describe("Linter with FlatConfigArray", () => {
                             sourceType: "commonjs"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0, "There should no linting errors.");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should error when accessing a Node.js global outside of commonjs", () => {
@@ -6680,9 +7608,12 @@ describe("Linter with FlatConfigArray", () => {
                             "no-undef": "error"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1, "There should be one linting error.");
                     assert.strictEqual(messages[0].ruleId, "no-undef", "The linting error should be no-undef.");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should add globals for Node.js when sourceType is commonjs", () => {
@@ -6695,8 +7626,10 @@ describe("Linter with FlatConfigArray", () => {
                             "no-undef": "error"
                         }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0, "There should be no linting errors.");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should allow 'await' as a property name in modules", () => {
@@ -6709,8 +7642,10 @@ describe("Linter with FlatConfigArray", () => {
                             }
                         }
                     );
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert(result.length === 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
             });
@@ -6748,8 +7683,10 @@ describe("Linter with FlatConfigArray", () => {
 
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should pass parser as context.languageOptions.parser to all rules when provided on config", () => {
@@ -6790,8 +7727,10 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should expose parser services when using parseForESLint() and services are specified", () => {
@@ -6823,9 +7762,12 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].message, "Hi!");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should use the same parserServices if source code object is reused", () => {
@@ -6857,14 +7799,18 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].message, "Hi!");
+                    assert.strictEqual(suppressedMessages.length, 0);
 
                     const messages2 = linter.verify(linter.getSourceCode(), config, filename);
+                    const suppressedMessages2 = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages2.length, 1);
                     assert.strictEqual(messages2[0].message, "Hi!");
+                    assert.strictEqual(suppressedMessages2.length, 0);
                 });
 
                 it("should pass parser as context.languageOptions.parser to all rules when default parser is used", () => {
@@ -6930,8 +7876,10 @@ describe("Linter with FlatConfigArray", () => {
                         };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not throw or report errors when the custom parser returns unrecognized operators (https://github.com/eslint/eslint/issues/10475)", () => {
@@ -6944,8 +7892,10 @@ describe("Linter with FlatConfigArray", () => {
 
                         // This shouldn't throw
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not throw or report errors when the custom parser returns nested unrecognized operators (https://github.com/eslint/eslint/issues/10560)", () => {
@@ -6958,8 +7908,10 @@ describe("Linter with FlatConfigArray", () => {
 
                         // This shouldn't throw
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not throw or return errors when the custom parser returns unknown AST nodes", () => {
@@ -6986,9 +7938,11 @@ describe("Linter with FlatConfigArray", () => {
                         };
 
                         const messages = linter.verify(code, config, filename, true);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
                         assert.isTrue(nodes.length > 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should strip leading line: prefix from parser error", () => {
@@ -6996,11 +7950,14 @@ describe("Linter with FlatConfigArray", () => {
                             languageOptions: {
                                 parser: testParsers.lineError
                             }
-                        }, "filename");
+                        }, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].severity, 2);
                         assert.strictEqual(messages[0].message, errorPrefix + testParsers.lineError.expectedError);
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not modify a parser error message without a leading line: prefix", () => {
@@ -7008,11 +7965,14 @@ describe("Linter with FlatConfigArray", () => {
                             languageOptions: {
                                 parser: testParsers.noLineError
                             }
-                        }, "filename");
+                        }, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].severity, 2);
                         assert.strictEqual(messages[0].message, errorPrefix + testParsers.noLineError.expectedError);
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     describe("if a parser provides 'visitorKeys'", () => {
@@ -7274,9 +8234,12 @@ describe("Linter with FlatConfigArray", () => {
                             }
                         }
                     }, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].message, "Parsing error: The keyword 'private' is reserved");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should properly parse valid code when impliedStrict is true", () => {
@@ -7290,8 +8253,10 @@ describe("Linter with FlatConfigArray", () => {
                             }
                         }
                     }, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should properly parse JSX when passed ecmaFeatures", () => {
@@ -7305,18 +8270,23 @@ describe("Linter with FlatConfigArray", () => {
                             }
                         }
                     }, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should report an error when JSX code is encountered and JSX is not enabled", () => {
                     const code = "var myDivElement = <div className=\"foo\" />;";
-                    const messages = linter.verify(code, {}, "filename");
+                    const messages = linter.verify(code, {}, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].line, 1);
                     assert.strictEqual(messages[0].column, 20);
                     assert.strictEqual(messages[0].message, "Parsing error: Unexpected token <");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not report an error when JSX code is encountered and JSX is enabled", () => {
@@ -7329,10 +8299,11 @@ describe("Linter with FlatConfigArray", () => {
                                 }
                             }
                         }
-
-                    }, "filename");
+                    }, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not report an error when JSX code contains a spread operator and JSX is enabled", () => {
@@ -7347,13 +8318,130 @@ describe("Linter with FlatConfigArray", () => {
                             }
                         }
 
-                    }, "filename");
+                    }, "filename.js");
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
-            });
+                it("should not allow the use of reserved words as variable names in ES3", () => {
+                    const code = "var char;";
+                    const messages = linter.verify(code, {
+                        languageOptions: {
+                            ecmaVersion: 3,
+                            sourceType: "script"
+                        }
+                    }, filename);
+
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].severity, 2);
+                    assert.isTrue(messages[0].fatal);
+                    assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+                });
+
+                it("should not allow the use of reserved words as property names in member expressions in ES3", () => {
+                    const code = "obj.char;";
+                    const messages = linter.verify(code, {
+                        languageOptions: {
+                            ecmaVersion: 3,
+                            sourceType: "script"
+                        }
+                    }, filename);
+
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].severity, 2);
+                    assert.isTrue(messages[0].fatal);
+                    assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+                });
+
+                it("should not allow the use of reserved words as property names in object literals in ES3", () => {
+                    const code = "var obj = { char: 1 };";
+                    const messages = linter.verify(code, {
+                        languageOptions: {
+                            ecmaVersion: 3,
+                            sourceType: "script"
+                        }
+                    }, filename);
+
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].severity, 2);
+                    assert.isTrue(messages[0].fatal);
+                    assert.match(messages[0].message, /^Parsing error:.*'char'/u);
+                });
+
+                it("should allow the use of reserved words as variable and property names in ES3 when allowReserved is true", () => {
+                    const code = "var char; obj.char; var obj = { char: 1 };";
+                    const messages = linter.verify(code, {
+                        languageOptions: {
+                            ecmaVersion: 3,
+                            sourceType: "script",
+                            parserOptions: {
+                                allowReserved: true
+                            }
+                        }
+                    }, filename);
+
+                    assert.strictEqual(messages.length, 0);
+                });
+
+                it("should not allow the use of reserved words as variable names in ES > 3", () => {
+                    const ecmaVersions = [void 0, ...espree.supportedEcmaVersions.filter(ecmaVersion => ecmaVersion > 3)];
+
+                    ecmaVersions.forEach(ecmaVersion => {
+                        const code = "var enum;";
+                        const messages = linter.verify(code, {
+                            languageOptions: {
+                                ...ecmaVersion ? { ecmaVersion } : {},
+                                sourceType: "script"
+                            }
+                        }, filename);
+
+                        assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(messages[0].severity, 2);
+                        assert.isTrue(messages[0].fatal);
+                        assert.match(messages[0].message, /^Parsing error:.*'enum'/u);
+                    });
+                });
+
+                it("should allow the use of reserved words as property names in ES > 3", () => {
+                    const ecmaVersions = [void 0, ...espree.supportedEcmaVersions.filter(ecmaVersion => ecmaVersion > 3)];
+
+                    ecmaVersions.forEach(ecmaVersion => {
+                        const code = "obj.enum; obj.function; var obj = { enum: 1, function: 2 };";
+                        const messages = linter.verify(code, {
+                            languageOptions: {
+                                ...ecmaVersion ? { ecmaVersion } : {},
+                                sourceType: "script"
+                            }
+                        }, filename);
 
+                        assert.strictEqual(messages.length, 0);
+                    });
+                });
+
+                it("should not allow `allowReserved: true` in ES > 3", () => {
+                    const ecmaVersions = [void 0, ...espree.supportedEcmaVersions.filter(ecmaVersion => ecmaVersion > 3)];
+
+                    ecmaVersions.forEach(ecmaVersion => {
+                        const code = "";
+                        const messages = linter.verify(code, {
+                            languageOptions: {
+                                ...ecmaVersion ? { ecmaVersion } : {},
+                                sourceType: "script",
+                                parserOptions: {
+                                    allowReserved: true
+                                }
+                            }
+                        }, filename);
+
+                        assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(messages[0].severity, 2);
+                        assert.isTrue(messages[0].fatal);
+                        assert.match(messages[0].message, /^Parsing error:.*allowReserved/u);
+                    });
+                });
+            });
         });
 
         describe("settings", () => {
@@ -7382,9 +8470,12 @@ describe("Linter with FlatConfigArray", () => {
                 };
 
                 const messages = linter.verify("0", config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].message, "Hello");
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should not have any settings if they were not passed in", () => {
@@ -7411,8 +8502,10 @@ describe("Linter with FlatConfigArray", () => {
                 };
 
                 const messages = linter.verify("0", config, filename);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -7426,9 +8519,12 @@ describe("Linter with FlatConfigArray", () => {
                 config.rules[rule] = 1;
 
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, rule);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should be configurable by only setting the string value", () => {
@@ -7438,10 +8534,13 @@ describe("Linter with FlatConfigArray", () => {
                 config.rules[rule] = "warn";
 
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].severity, 1);
                 assert.strictEqual(messages[0].ruleId, rule);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should be configurable by passing in values as an array", () => {
@@ -7451,9 +8550,12 @@ describe("Linter with FlatConfigArray", () => {
                 config.rules[rule] = [1];
 
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, rule);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should be configurable by passing in string value as an array", () => {
@@ -7463,10 +8565,13 @@ describe("Linter with FlatConfigArray", () => {
                 config.rules[rule] = ["warn"];
 
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].severity, 1);
                 assert.strictEqual(messages[0].ruleId, rule);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should not be configurable by setting other value", () => {
@@ -7483,8 +8588,10 @@ describe("Linter with FlatConfigArray", () => {
             it("should process empty config", () => {
                 const config = {};
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -7498,6 +8605,7 @@ describe("Linter with FlatConfigArray", () => {
             const config = { rules: { "no-mixed-spaces-and-tabs": 1, "eol-last": 1, semi: [1, "always"] } };
 
             const messages = linter.verify(code, config, filename);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 3);
             assert.strictEqual(messages[0].line, 1);
@@ -7506,6 +8614,25 @@ describe("Linter with FlatConfigArray", () => {
             assert.strictEqual(messages[1].column, 18);
             assert.strictEqual(messages[2].line, 2);
             assert.strictEqual(messages[2].column, 18);
+
+            assert.strictEqual(suppressedMessages.length, 0);
+        });
+
+        it("should report ignored file when filename isn't matched in the config array", () => {
+
+            const code = "foo()\n    alert('test')";
+            const config = { rules: { "no-mixed-spaces-and-tabs": 1, "eol-last": 1, semi: [1, "always"] } };
+
+            const messages = linter.verify(code, config, "filename.ts");
+
+            assert.strictEqual(messages.length, 1);
+            assert.deepStrictEqual(messages[0], {
+                ruleId: null,
+                severity: 1,
+                message: "No matching configuration found for filename.ts.",
+                line: 0,
+                column: 0
+            });
         });
 
         describe("Plugins", () => {
@@ -7652,6 +8779,7 @@ describe("Linter with FlatConfigArray", () => {
                 };
 
                 const messages = linter.verify(code, config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0);
                 sinon.assert.calledOnce(spyVariableDeclaration);
@@ -7659,6 +8787,8 @@ describe("Linter with FlatConfigArray", () => {
                 sinon.assert.calledOnce(spyIdentifier);
                 sinon.assert.calledTwice(spyLiteral);
                 sinon.assert.calledOnce(spyBinaryExpression);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should throw an error if a rule reports a problem without a message", () => {
@@ -7715,8 +8845,10 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages[0].message, filename);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("defaults filename to '<input>'", () => {
@@ -7740,8 +8872,10 @@ describe("Linter with FlatConfigArray", () => {
 
 
                     const messages = linter.verify("0", config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages[0].message, "<input>");
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
 
@@ -7769,8 +8903,10 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                     const messages = linter.verify("0", config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages[0].message, filename);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
             });
@@ -9537,9 +10673,12 @@ describe("Linter with FlatConfigArray", () => {
 
                 configs.normalizeSync();
                 const messages = linter.verify("foo", configs, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1, "Message length is wrong");
                 assert.strictEqual(messages[0].ruleId, ruleId);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("rule should run as warning when set to 1 with a plain array", () => {
@@ -9552,9 +10691,12 @@ describe("Linter with FlatConfigArray", () => {
                     }];
 
                 const messages = linter.verify("foo", configs, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1, "Message length is wrong");
                 assert.strictEqual(messages[0].ruleId, ruleId);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("rule should run as warning when set to 1 with an object", () => {
@@ -9567,9 +10709,12 @@ describe("Linter with FlatConfigArray", () => {
                     };
 
                 const messages = linter.verify("foo", config, filename, true);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1, "Message length is wrong");
                 assert.strictEqual(messages[0].ruleId, ruleId);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
 
@@ -9579,11 +10724,14 @@ describe("Linter with FlatConfigArray", () => {
             it("should preserve line numbers", () => {
                 const config = { rules: { "no-extra-semi": 1 } };
                 const messages = linter.verify(code, config);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 1);
                 assert.strictEqual(messages[0].ruleId, "no-extra-semi");
                 assert.strictEqual(messages[0].nodeType, "EmptyStatement");
                 assert.strictEqual(messages[0].line, 3);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should have a comment with the hashbang in it", () => {
@@ -9999,6 +11147,7 @@ describe("Linter with FlatConfigArray", () => {
 
                 it("should report a linting error when a global is set to an invalid value", () => {
                     const results = linter.verify("/* global foo: AAAAA, bar: readonly */\nfoo;\nbar;", { rules: { "no-undef": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.deepStrictEqual(results, [
                         {
@@ -10023,6 +11172,8 @@ describe("Linter with FlatConfigArray", () => {
                             nodeType: "Identifier"
                         }
                     ]);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
             });
@@ -10197,11 +11348,14 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: {} };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
                         assert.strictEqual(messages[0].message, "Unexpected alert.");
                         assert.include(messages[0].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("rules should not change initial config", () => {
@@ -10214,11 +11368,16 @@ describe("Linter with FlatConfigArray", () => {
                         const codeA = "/*eslint strict: 0*/ function bar() { return 2; }";
                         const codeB = "function foo() { return 1; }";
                         let messages = linter.verify(codeA, config, filename, false);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         messages = linter.verify(codeB, config, filename, false);
+                        suppressedMessages = linter.getSuppressedMessages();
+
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("rules should not change initial config", () => {
@@ -10231,11 +11390,16 @@ describe("Linter with FlatConfigArray", () => {
                         const codeA = "/*eslint quotes: 0*/ function bar() { return '2'; }";
                         const codeB = "function foo() { return '1'; }";
                         let messages = linter.verify(codeA, config, filename, false);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         messages = linter.verify(codeB, config, filename, false);
+                        suppressedMessages = linter.getSuppressedMessages();
+
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("rules should not change initial config", () => {
@@ -10243,11 +11407,16 @@ describe("Linter with FlatConfigArray", () => {
                         const codeA = "/*eslint quotes: [0, \"single\"]*/ function bar() { return '2'; }";
                         const codeB = "function foo() { return '1'; }";
                         let messages = linter.verify(codeA, config, filename, false);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         messages = linter.verify(codeB, config, filename, false);
+                        suppressedMessages = linter.getSuppressedMessages();
+
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("rules should not change initial config", () => {
@@ -10260,18 +11429,26 @@ describe("Linter with FlatConfigArray", () => {
                         const codeA = "/*eslint no-unused-vars: [0, {\"vars\": \"local\"}]*/ var a = 44;";
                         const codeB = "var b = 55;";
                         let messages = linter.verify(codeA, config, filename, false);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         messages = linter.verify(codeB, config, filename, false);
+                        suppressedMessages = linter.getSuppressedMessages();
+
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
                 describe("when evaluating code with invalid comments to enable rules", () => {
                     it("should report a violation when the config is not a valid rule configuration", () => {
+                        const messages = linter.verify("/*eslint no-alert:true*/ alert('test');", {});
+                        const suppressedMessages = linter.getSuppressedMessages();
+
                         assert.deepStrictEqual(
-                            linter.verify("/*eslint no-alert:true*/ alert('test');", {}),
+                            messages,
                             [
                                 {
                                     severity: 2,
@@ -10285,11 +11462,16 @@ describe("Linter with FlatConfigArray", () => {
                                 }
                             ]
                         );
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation when the config violates a rule's schema", () => {
+                        const messages = linter.verify("/* eslint no-alert: [error, {nonExistentPropertyName: true}]*/", {});
+                        const suppressedMessages = linter.getSuppressedMessages();
+
                         assert.deepStrictEqual(
-                            linter.verify("/* eslint no-alert: [error, {nonExistentPropertyName: true}]*/", {}),
+                            messages,
                             [
                                 {
                                     severity: 2,
@@ -10303,6 +11485,8 @@ describe("Linter with FlatConfigArray", () => {
                                 }
                             ]
                         );
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10311,37 +11495,49 @@ describe("Linter with FlatConfigArray", () => {
                     it("should not report a violation", () => {
                         const config = { rules: { "no-alert": 1 } };
                         const messages = linter.verify("/*eslint no-alert:0*/ alert('test');", config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report an error when disabling a non-existent rule in inline comment", () => {
                         let code = "/*eslint foo:0*/ ;";
                         let messages = linter.verify(code, {}, filename);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1, "/*eslint*/ comment should report problem.");
                         assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         code = "/*eslint-disable foo*/ ;";
                         messages = linter.verify(code, {}, filename);
+                        suppressedMessages = linter.getSuppressedMessages();
                         assert.strictEqual(messages.length, 1, "/*eslint-disable*/ comment should report problem.");
                         assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         code = "/*eslint-disable-line foo*/ ;";
                         messages = linter.verify(code, {}, filename);
+                        suppressedMessages = linter.getSuppressedMessages();
                         assert.strictEqual(messages.length, 1, "/*eslint-disable-line*/ comment should report problem.");
                         assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         code = "/*eslint-disable-next-line foo*/ ;";
                         messages = linter.verify(code, {}, filename);
+                        suppressedMessages = linter.getSuppressedMessages();
                         assert.strictEqual(messages.length, 1, "/*eslint-disable-next-line*/ comment should report problem.");
                         assert.strictEqual(messages[0].message, "Definition for rule 'foo' was not found.");
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not report an error, when disabling a non-existent rule in config", () => {
                         const messages = linter.verify("", { rules: { foo: 0 } }, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should throw an error when a non-existent rule in config", () => {
@@ -10363,12 +11559,15 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: {} };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
                         assert.strictEqual(messages[0].message, "Unexpected alert.");
                         assert.include(messages[0].nodeType, "CallExpression");
                         assert.strictEqual(messages[1].ruleId, "no-console");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10379,11 +11578,14 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-console": 1, "no-alert": 0 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
                         assert.strictEqual(messages[0].message, "Unexpected alert.");
                         assert.include(messages[0].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10417,8 +11619,10 @@ describe("Linter with FlatConfigArray", () => {
                         const code = "/*eslint test-plugin/test-rule: 2*/ var a = \"no violation\";";
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not report a violation when inline comment disables plugin rule", () => {
@@ -10426,8 +11630,10 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { ...baseConfig, rules: { "test-plugin/test-rule": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation when the report is right before the comment", () => {
@@ -10451,9 +11657,12 @@ describe("Linter with FlatConfigArray", () => {
                         };
 
                         const problems = linter.verify(code, config);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(problems.length, 1);
                         assert.strictEqual(problems[0].message, "foo");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not report a violation when the report is right at the start of the comment", () => {
@@ -10477,8 +11686,13 @@ describe("Linter with FlatConfigArray", () => {
                         };
 
                         const problems = linter.verify(code, config);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(problems.length, 0);
+
+                        assert.strictEqual(suppressedMessages.length, 1);
+                        assert.strictEqual(suppressedMessages[0].message, "foo");
+                        assert.deepStrictEqual(suppressedMessages[0].suppressions, [{ kind: "directive", justification: "" }]);
                     });
 
                     it("rules should not change initial config", () => {
@@ -10486,11 +11700,16 @@ describe("Linter with FlatConfigArray", () => {
                         const codeA = "/*eslint test-plugin/test-rule: 0*/ var a = \"trigger violation\";";
                         const codeB = "var a = \"trigger violation\";";
                         let messages = linter.verify(codeA, config, filename, false);
+                        let suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
 
                         messages = linter.verify(codeB, config, filename, false);
+                        suppressedMessages = linter.getSuppressedMessages();
+
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10506,12 +11725,17 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
                         assert.strictEqual(messages[0].message, "Unexpected alert.");
                         assert.include(messages[0].nodeType, "CallExpression");
                         assert.strictEqual(messages[0].line, 4);
+
+                        assert.strictEqual(suppressedMessages.length, 1);
+                        assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                        assert.strictEqual(suppressedMessages[0].line, 2);
                     });
 
                     it("should not report a violation", () => {
@@ -10523,8 +11747,10 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 2);
                     });
 
                     it("should not report a violation", () => {
@@ -10537,10 +11763,15 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
                         assert.strictEqual(messages[0].column, 21);
                         assert.strictEqual(messages[1].column, 19);
+
+                        assert.strictEqual(suppressedMessages.length, 2);
+                        assert.strictEqual(suppressedMessages[0].column, 1);
+                        assert.strictEqual(suppressedMessages[1].column, 56);
                     });
 
                     it("should report a violation", () => {
@@ -10558,8 +11789,10 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
+                        assert.strictEqual(suppressedMessages.length, 2);
                     });
 
 
@@ -10573,8 +11806,12 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-unused-vars": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+
+                        assert.strictEqual(suppressedMessages.length, 1);
+                        assert.strictEqual(suppressedMessages[0].ruleId, "no-unused-vars");
                     });
 
                     it("should not report a violation", () => {
@@ -10586,8 +11823,12 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-unused-vars": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+
+                        assert.strictEqual(suppressedMessages.length, 1);
+                        assert.strictEqual(suppressedMessages[0].ruleId, "no-unused-vars");
                     });
                 });
 
@@ -10598,11 +11839,14 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-console": 1, "no-alert": 0 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
                         assert.strictEqual(messages[0].message, "Unexpected alert.");
                         assert.include(messages[0].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10613,11 +11857,14 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { quotes: [2, "single"] } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "quotes");
                         assert.strictEqual(messages[0].message, "Strings must use doublequote.");
                         assert.include(messages[0].nodeType, "Literal");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10628,11 +11875,14 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { quotes: [2, "single"] } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "quotes");
                         assert.strictEqual(messages[0].message, "Strings must use doublequote.");
                         assert.include(messages[0].nodeType, "Literal");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10643,6 +11893,7 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
 
@@ -10660,6 +11911,8 @@ describe("Linter with FlatConfigArray", () => {
                         assert.strictEqual(messages[1].ruleId, "no-alert");
                         assert.strictEqual(messages[1].message, "Unexpected alert.");
                         assert.include(messages[1].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation", () => {
@@ -10668,6 +11921,7 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
 
@@ -10685,6 +11939,8 @@ describe("Linter with FlatConfigArray", () => {
                         assert.strictEqual(messages[1].ruleId, "no-alert");
                         assert.strictEqual(messages[1].message, "Unexpected alert.");
                         assert.include(messages[1].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation", () => {
@@ -10693,6 +11949,7 @@ describe("Linter with FlatConfigArray", () => {
                         const config = { rules: { "no-alert": 1 } };
 
                         const messages = linter.verify(code, config, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
 
@@ -10710,6 +11967,8 @@ describe("Linter with FlatConfigArray", () => {
                         assert.strictEqual(messages[1].ruleId, "no-alert");
                         assert.strictEqual(messages[1].message, "Unexpected alert.");
                         assert.include(messages[1].nodeType, "CallExpression");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10721,11 +11980,14 @@ alert('test');
 
                     it("should not parse errors, should report a violation", () => {
                         const messages = linter.verify(code, {}, filename);
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "max-len");
                         assert.strictEqual(messages[0].message, "This line has a length of 129. Maximum allowed is 100.");
                         assert.include(messages[0].nodeType, "Program");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10741,6 +12003,7 @@ var a = "test2";
                         const config = { rules: {} };
                         const messages = linter.verify(code, config, filename);
                         const [message1, message2] = messages;
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 2);
                         assert.strictEqual(message1.ruleId, "max-len");
@@ -10753,6 +12016,8 @@ var a = "test2";
                         assert.strictEqual(message2.line, 5);
                         assert.strictEqual(message2.column, 1);
                         assert.include(message2.nodeType, "Program");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -10768,10 +12033,13 @@ var a = "test2";
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
-
                     assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
                 it("should report no violation", () => {
@@ -10783,8 +12051,10 @@ var a = "test2";
                     const config = { rules: { quotes: 2 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should report a violation", () => {
@@ -10800,31 +12070,42 @@ var a = "test2";
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[0].line, 5);
                     assert.strictEqual(messages[1].ruleId, "no-console");
                     assert.strictEqual(messages[1].line, 6);
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 3);
                 });
 
                 it("should report a violation", () => {
                     const code = [
                         "/*eslint-disable no-alert */",
                         "alert('test');",
-                        "console.log('test');",
+                        "console.log('test');", // here
                         "/*eslint-enable no-console */",
-
-                        "alert('test');" // here
+                        "alert('test');"
                     ].join("\n");
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
-
                     assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[1].line, 5);
                 });
 
 
@@ -10841,11 +12122,19 @@ var a = "test2";
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[0].line, 5);
+
+                    assert.strictEqual(suppressedMessages.length, 3);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 3);
+                    assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[2].line, 6);
                 });
 
 
@@ -10871,21 +12160,23 @@ var a = "test2";
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 4);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[0].line, 6);
-
                     assert.strictEqual(messages[1].ruleId, "no-console");
                     assert.strictEqual(messages[1].line, 7);
-
                     assert.strictEqual(messages[2].ruleId, "no-alert");
                     assert.strictEqual(messages[2].line, 9);
-
                     assert.strictEqual(messages[3].ruleId, "no-console");
                     assert.strictEqual(messages[3].line, 10);
 
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 3);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 4);
                 });
 
                 it("should report a violation", () => {
@@ -10908,18 +12199,23 @@ var a = "test2";
                     const config = { rules: { "no-alert": 1, "no-console": 1 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 3);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[0].line, 5);
-
                     assert.strictEqual(messages[1].ruleId, "no-alert");
                     assert.strictEqual(messages[1].line, 8);
-
                     assert.strictEqual(messages[2].ruleId, "no-console");
                     assert.strictEqual(messages[2].line, 9);
 
+                    assert.strictEqual(suppressedMessages.length, 3);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 3);
+                    assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[2].line, 6);
                 });
 
                 it("should report a violation when severity is warn", () => {
@@ -10942,18 +12238,23 @@ var a = "test2";
                     const config = { rules: { "no-alert": "warn", "no-console": "warn" } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 3);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[0].line, 5);
-
                     assert.strictEqual(messages[1].ruleId, "no-alert");
                     assert.strictEqual(messages[1].line, 8);
-
                     assert.strictEqual(messages[2].ruleId, "no-console");
                     assert.strictEqual(messages[2].line, 9);
 
+                    assert.strictEqual(suppressedMessages.length, 3);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 3);
+                    assert.strictEqual(suppressedMessages[2].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[2].line, 6);
                 });
 
                 it("should report no violation", () => {
@@ -10966,8 +12267,15 @@ var a = "test2";
                     const config = { rules: { "no-unused-vars": 2 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-unused-vars");
+                    assert.strictEqual(suppressedMessages[0].line, 2);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-unused-vars");
+                    assert.strictEqual(suppressedMessages[1].line, 3);
                 });
 
             });
@@ -10987,10 +12295,15 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
-
                     assert.strictEqual(messages[0].ruleId, "no-console");
+                    assert.strictEqual(messages[0].line, 2);
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 1);
                 });
 
                 it("should report a violation", () => {
@@ -11007,10 +12320,17 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
-
                     assert.strictEqual(messages[0].ruleId, "no-alert");
+                    assert.strictEqual(messages[0].line, 3);
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[0].line, 1);
+                    assert.strictEqual(suppressedMessages[1].ruleId, "no-console");
+                    assert.strictEqual(suppressedMessages[1].line, 2);
                 });
 
                 it("should report a violation if eslint-disable-line in a block comment is not on a single line", () => {
@@ -11026,10 +12346,12 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
-
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not disable rule and add an extra report if eslint-disable-line in a block comment is not on a single line", () => {
@@ -11044,6 +12366,7 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.deepStrictEqual(messages, [
                         {
@@ -11068,6 +12391,8 @@ var a = "test2";
                             nodeType: null
                         }
                     ]);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not report a violation for eslint-disable-line in block comment", () => {
@@ -11082,8 +12407,10 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 2);
                 });
 
                 it("should not report a violation", () => {
@@ -11099,8 +12426,10 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 2);
                 });
 
                 it("should not report a violation", () => {
@@ -11118,8 +12447,10 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 5);
                 });
 
                 it("should not report a violation", () => {
@@ -11137,8 +12468,10 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 5);
                 });
 
                 it("should ignore violations of multiple rules when specified in mixed comments", () => {
@@ -11152,8 +12485,13 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
                 });
 
                 it("should report no violation", () => {
@@ -11167,8 +12505,10 @@ var a = "test2";
                     const config = { rules: { "no-unused-vars": 2 } };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+                    assert.strictEqual(suppressedMessages.length, 5);
                 });
 
             });
@@ -11187,9 +12527,13 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
                 it("should ignore violation of specified rule if eslint-disable-next-line is a block comment", () => {
@@ -11205,9 +12549,13 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
                 it("should ignore violation of specified rule if eslint-disable-next-line is a block comment", () => {
                     const code = [
@@ -11220,11 +12568,15 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
-                it("should not ignore violation if block comment is not on a single line", () => {
+                it("should not ignore violation if code is not on next line", () => {
                     const code = [
                         "/* eslint-disable-next-line",
                         "no-alert */alert('test');"
@@ -11235,9 +12587,55 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
-                    assert.strictEqual(messages.length, 2);
-                    assert.strictEqual(messages[1].ruleId, "no-alert");
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
+                });
+
+                it("should ignore violation if block comment span multiple lines", () => {
+                    const code = [
+                        "/* eslint-disable-next-line",
+                        "no-alert */",
+                        "alert('test');"
+                    ].join("\n");
+                    const config = {
+                        rules: {
+                            "no-alert": 1
+                        }
+                    };
+                    const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
+
+                    assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                });
+
+                // For https://github.com/eslint/eslint/issues/14284
+                it("should ignore violation if block comment span multiple lines with description", () => {
+                    const code = `
+                    /* eslint-disable-next-line no-alert --
+                        description on why this exception is seen as appropriate but past a
+                        comfortable reading line length
+                    */
+                    alert("buzz");
+                    `;
+                    const config = {
+                        rules: {
+                            "no-alert": 1
+                        }
+                    };
+                    const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
+
+                    assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
                 it("should ignore violations only of specified rule", () => {
@@ -11253,6 +12651,29 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
+
+                    assert.strictEqual(messages.length, 2);
+                    assert.strictEqual(messages[0].ruleId, "no-alert");
+                    assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
+                });
+
+                it("should ignore violations only of specified rule when block comment span multiple lines", () => {
+                    const code = [
+                        "/* eslint-disable-next-line",
+                        "no-console */",
+                        "alert('test');",
+                        "console.log('test');"
+                    ].join("\n");
+                    const config = {
+                        rules: {
+                            "no-alert": 1,
+                            "no-console": 1
+                        }
+                    };
+                    const messages = linter.verify(code, config, filename);
 
                     assert.strictEqual(messages.length, 2);
                     assert.strictEqual(messages[0].ruleId, "no-alert");
@@ -11273,6 +12694,33 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
+
+                    assert.strictEqual(messages.length, 1);
+                    assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+                });
+
+                it("should ignore violations of multiple rules when specified in multiple lines", () => {
+                    const code = [
+                        "/* eslint-disable-next-line",
+                        "no-alert,",
+                        "quotes",
+                        "*/",
+                        "alert(\"test\");",
+                        "console.log('test');"
+                    ].join("\n");
+                    const config = {
+                        rules: {
+                            "no-alert": 1,
+                            quotes: [1, "single"],
+                            "no-console": 1
+                        }
+                    };
+                    const messages = linter.verify(code, config, filename);
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].ruleId, "no-console");
@@ -11290,6 +12738,29 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
+
+                    assert.strictEqual(messages.length, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 2);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+                });
+
+                it("should ignore violations of multiple rules when specified in mixed single line and multi line comments", () => {
+                    const code = [
+                        "/* eslint-disable-next-line",
+                        "no-alert",
+                        "*/ // eslint-disable-next-line quotes",
+                        "alert(\"test\");"
+                    ].join("\n");
+                    const config = {
+                        rules: {
+                            "no-alert": 1,
+                            quotes: [1, "single"]
+                        }
+                    };
+                    const messages = linter.verify(code, config, filename);
 
                     assert.strictEqual(messages.length, 0);
                 });
@@ -11308,10 +12779,14 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "quotes");
                 });
 
                 it("should ignore violations of specified rule on next line only", () => {
@@ -11328,10 +12803,14 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
                 it("should ignore all rule violations on next line if none specified", () => {
@@ -11349,9 +12828,15 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 3);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                    assert.strictEqual(suppressedMessages[1].ruleId, "quotes");
+                    assert.strictEqual(suppressedMessages[2].ruleId, "semi");
                 });
 
                 it("should ignore violations if eslint-disable-next-line is a block comment", () => {
@@ -11368,10 +12853,14 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                 });
 
                 it("should report a violation", () => {
@@ -11389,10 +12878,12 @@ var a = "test2";
                     };
 
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
-
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should not ignore violations if comment is of the type hashbang", () => {
@@ -11408,10 +12899,13 @@ var a = "test2";
                         }
                     };
                     const messages = linter.verify(code, config, filename);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 2);
                     assert.strictEqual(messages[0].ruleId, "no-alert");
                     assert.strictEqual(messages[1].ruleId, "no-console");
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
 
@@ -11434,6 +12928,7 @@ var a = "test2";
                     /*eslint test/aaa:error -- test/bbb:error */
                     console.log("hello")
                 `, config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include syntax error of the comment.
                     assert.deepStrictEqual(messages, []);
@@ -11441,6 +12936,8 @@ var a = "test2";
                     // Use only `aaa`.
                     assert.strictEqual(aaa.callCount, 1);
                     assert.strictEqual(bbb.callCount, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should ignore the part preceded by '--' in '/*globals*/'.", () => {
@@ -11454,6 +12951,7 @@ var a = "test2";
                         },
                         rules: { "no-redeclare": "error" }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include `bbb`
                     assert.deepStrictEqual(
@@ -11470,6 +12968,8 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should ignore the part preceded by '--' in '/*exported*/'.", () => {
@@ -11483,6 +12983,7 @@ var a = "test2";
                         },
                         rules: { "no-unused-vars": "error" }
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include `aaa`
                     assert.deepStrictEqual(
@@ -11499,6 +13000,8 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should ignore the part preceded by '--' in '/*eslint-disable*/'.", () => {
@@ -11507,6 +13010,7 @@ var a = "test2";
                     var aaa = {}
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-unused-vars` but not `no-redeclare`
                     assert.deepStrictEqual(
@@ -11523,6 +13027,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endColumn: 28,
+                            endLine: 4,
+                            line: 4,
+                            message: "'aaa' is already defined.",
+                            messageId: "redeclared",
+                            nodeType: "Identifier",
+                            ruleId: "no-redeclare",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                        }]
+                    );
                 });
 
                 it("should ignore the part preceded by '--' in '/*eslint-enable*/'.", () => {
@@ -11532,6 +13052,7 @@ var a = "test2";
                     var aaa = {}
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-redeclare` but not `no-unused-vars`
                     assert.deepStrictEqual(
@@ -11548,6 +13069,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endLine: 5,
+                            endColumn: 28,
+                            line: 5,
+                            message: "'aaa' is assigned a value but never used.",
+                            messageId: "unusedVar",
+                            nodeType: "Identifier",
+                            ruleId: "no-unused-vars",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "" }]
+                        }]
+                    );
                 });
 
                 it("should ignore the part preceded by '--' in '//eslint-disable-line'.", () => {
@@ -11555,6 +13092,7 @@ var a = "test2";
                     var aaa = {} //eslint-disable-line no-redeclare -- no-unused-vars
                     var aaa = {} //eslint-disable-line no-redeclare -- no-unused-vars
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-unused-vars` but not `no-redeclare`
                     assert.deepStrictEqual(
@@ -11571,6 +13109,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endLine: 3,
+                            endColumn: 28,
+                            line: 3,
+                            message: "'aaa' is already defined.",
+                            messageId: "redeclared",
+                            nodeType: "Identifier",
+                            ruleId: "no-redeclare",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                        }]
+                    );
                 });
 
                 it("should ignore the part preceded by '--' in '/*eslint-disable-line*/'.", () => {
@@ -11578,6 +13132,7 @@ var a = "test2";
                     var aaa = {} /*eslint-disable-line no-redeclare -- no-unused-vars */
                     var aaa = {} /*eslint-disable-line no-redeclare -- no-unused-vars */
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-unused-vars` but not `no-redeclare`
                     assert.deepStrictEqual(
@@ -11594,6 +13149,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endLine: 3,
+                            endColumn: 28,
+                            line: 3,
+                            message: "'aaa' is already defined.",
+                            messageId: "redeclared",
+                            nodeType: "Identifier",
+                            ruleId: "no-redeclare",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                        }]
+                    );
                 });
 
                 it("should ignore the part preceded by '--' in '//eslint-disable-next-line'.", () => {
@@ -11603,6 +13174,7 @@ var a = "test2";
                     //eslint-disable-next-line no-redeclare -- no-unused-vars
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-unused-vars` but not `no-redeclare`
                     assert.deepStrictEqual(
@@ -11619,6 +13191,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endLine: 5,
+                            endColumn: 28,
+                            line: 5,
+                            message: "'aaa' is already defined.",
+                            messageId: "redeclared",
+                            nodeType: "Identifier",
+                            ruleId: "no-redeclare",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                        }]
+                    );
                 });
 
                 it("should ignore the part preceded by '--' in '/*eslint-disable-next-line*/'.", () => {
@@ -11628,6 +13216,7 @@ var a = "test2";
                     /*eslint-disable-next-line no-redeclare -- no-unused-vars */
                     var aaa = {}
                 `, { rules: { "no-redeclare": "error", "no-unused-vars": "error" } });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Do include `no-unused-vars` but not `no-redeclare`
                     assert.deepStrictEqual(
@@ -11644,6 +13233,22 @@ var a = "test2";
                             severity: 2
                         }]
                     );
+
+                    assert.deepStrictEqual(
+                        suppressedMessages,
+                        [{
+                            column: 25,
+                            endLine: 5,
+                            endColumn: 28,
+                            line: 5,
+                            message: "'aaa' is already defined.",
+                            messageId: "redeclared",
+                            nodeType: "Identifier",
+                            ruleId: "no-redeclare",
+                            severity: 2,
+                            suppressions: [{ kind: "directive", justification: "no-unused-vars" }]
+                        }]
+                    );
                 });
 
                 it("should not ignore the part preceded by '--' if the '--' is not surrounded by whitespaces.", () => {
@@ -11662,12 +13267,15 @@ var a = "test2";
                     /*eslint test/a--rule:error */
                     console.log("hello")
                 `, config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include syntax error of the comment.
                     assert.deepStrictEqual(messages, []);
 
                     // Use `a--rule`.
                     assert.strictEqual(rule.callCount, 1);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should ignore the part preceded by '--' even if the '--' is longer than 2.", () => {
@@ -11688,6 +13296,7 @@ var a = "test2";
                     /*eslint test/aaa:error -------- test/bbb:error */
                     console.log("hello")
                 `, config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include syntax error of the comment.
                     assert.deepStrictEqual(messages, []);
@@ -11695,6 +13304,8 @@ var a = "test2";
                     // Use only `aaa`.
                     assert.strictEqual(aaa.callCount, 1);
                     assert.strictEqual(bbb.callCount, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should ignore the part preceded by '--' with line breaks.", () => {
@@ -11717,6 +13328,7 @@ var a = "test2";
                         test/bbb:error */
                     console.log("hello")
                 `, config);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     // Don't include syntax error of the comment.
                     assert.deepStrictEqual(messages, []);
@@ -11724,6 +13336,8 @@ var a = "test2";
                     // Use only `aaa`.
                     assert.strictEqual(aaa.callCount, 1);
                     assert.strictEqual(bbb.callCount, 0);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
 
@@ -11743,9 +13357,12 @@ var a = "test2";
                             filename,
                             allowInlineConfig: false
                         });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation for global variable declarations", () => {
@@ -11801,9 +13418,12 @@ var a = "test2";
                             filename,
                             allowInlineConfig: false
                         });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should not report a violation for rule changes", () => {
@@ -11821,8 +13441,10 @@ var a = "test2";
                             filename,
                             allowInlineConfig: false
                         });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                     it("should report a violation for disable-line", () => {
@@ -11839,9 +13461,12 @@ var a = "test2";
                             filename,
                             allowInlineConfig: false
                         });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 1);
                         assert.strictEqual(messages[0].ruleId, "no-alert");
+
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
 
                 });
@@ -11864,12 +13489,15 @@ var a = "test2";
                                     noInlineConfig: true
                                 }
                             });
+                            const suppressedMessages = linter.getSuppressedMessages();
 
                             assert.deepStrictEqual(messages.length, 1);
                             assert.deepStrictEqual(messages[0].fatal, void 0);
                             assert.deepStrictEqual(messages[0].ruleId, null);
                             assert.deepStrictEqual(messages[0].severity, 1);
                             assert.deepStrictEqual(messages[0].message, `'/*${directive.split(" ")[0]}*/' has no effect because you have 'noInlineConfig' setting in your config.`);
+
+                            assert.strictEqual(suppressedMessages.length, 0);
                         });
                     }
 
@@ -11884,12 +13512,15 @@ var a = "test2";
                                     noInlineConfig: true
                                 }
                             });
+                            const suppressedMessages = linter.getSuppressedMessages();
 
                             assert.deepStrictEqual(messages.length, 1);
                             assert.deepStrictEqual(messages[0].fatal, void 0);
                             assert.deepStrictEqual(messages[0].ruleId, null);
                             assert.deepStrictEqual(messages[0].severity, 1);
                             assert.deepStrictEqual(messages[0].message, `'//${directive.split(" ")[0]}' has no effect because you have 'noInlineConfig' setting in your config.`);
+
+                            assert.strictEqual(suppressedMessages.length, 0);
                         });
                     }
 
@@ -11899,8 +13530,10 @@ var a = "test2";
                                 noInlineConfig: true
                             }
                         }, { allowInlineConfig: false });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.deepStrictEqual(messages.length, 0);
+                        assert.strictEqual(suppressedMessages.length, 0);
                     });
                 });
 
@@ -11919,8 +13552,12 @@ var a = "test2";
                             filename,
                             allowInlineConfig: true
                         });
+                        const suppressedMessages = linter.getSuppressedMessages();
 
                         assert.strictEqual(messages.length, 0);
+
+                        assert.strictEqual(suppressedMessages.length, 1);
+                        assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
                     });
                 });
 
@@ -11928,8 +13565,11 @@ var a = "test2";
 
             describe("reportUnusedDisableDirectives option", () => {
                 it("reports problems for unused eslint-disable comments", () => {
+                    const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: true });
+                    const suppressedMessages = linter.getSuppressedMessages();
+
                     assert.deepStrictEqual(
-                        linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: true }),
+                        messages,
                         [
                             {
                                 ruleId: null,
@@ -11945,11 +13585,16 @@ var a = "test2";
                             }
                         ]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("reports problems for unused eslint-disable comments (error)", () => {
+                    const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "error" });
+                    const suppressedMessages = linter.getSuppressedMessages();
+
                     assert.deepStrictEqual(
-                        linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "error" }),
+                        messages,
                         [
                             {
                                 ruleId: null,
@@ -11965,11 +13610,16 @@ var a = "test2";
                             }
                         ]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("reports problems for unused eslint-disable comments (warn)", () => {
+                    const messages = linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "warn" });
+                    const suppressedMessages = linter.getSuppressedMessages();
+
                     assert.deepStrictEqual(
-                        linter.verify("/* eslint-disable */", {}, { reportUnusedDisableDirectives: "warn" }),
+                        messages,
                         [
                             {
                                 ruleId: null,
@@ -11985,15 +13635,20 @@ var a = "test2";
                             }
                         ]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("reports problems for unused eslint-disable comments (in config)", () => {
+                    const messages = linter.verify("/* eslint-disable */", {
+                        linterOptions: {
+                            reportUnusedDisableDirectives: true
+                        }
+                    });
+                    const suppressedMessages = linter.getSuppressedMessages();
+
                     assert.deepStrictEqual(
-                        linter.verify("/* eslint-disable */", {
-                            linterOptions: {
-                                reportUnusedDisableDirectives: true
-                            }
-                        }),
+                        messages,
                         [
                             {
                                 ruleId: null,
@@ -12009,6 +13664,8 @@ var a = "test2";
                             }
                         ]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("reports problems for partially unused eslint-disable comments (in config)", () => {
@@ -12027,6 +13684,7 @@ var a = "test2";
                         filename,
                         allowInlineConfig: true
                     });
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.deepStrictEqual(
                         messages,
@@ -12045,6 +13703,135 @@ var a = "test2";
                             }
                         ]
                     );
+
+                    assert.strictEqual(suppressedMessages.length, 1);
+                    assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+                });
+
+                it("reports problems for unused eslint-disable-next-line comments (in config)", () => {
+                    assert.deepStrictEqual(
+                        linter.verify("// eslint-disable-next-line", {
+                            linterOptions: {
+                                reportUnusedDisableDirectives: true
+                            }
+                        }),
+                        [
+                            {
+                                ruleId: null,
+                                message: "Unused eslint-disable directive (no problems were reported).",
+                                line: 1,
+                                column: 1,
+                                fix: {
+                                    range: [0, 27],
+                                    text: " "
+                                },
+                                severity: 1,
+                                nodeType: null
+                            }
+                        ]
+                    );
+                });
+
+                it("reports problems for unused multiline eslint-disable-next-line comments (in config)", () => {
+                    assert.deepStrictEqual(
+                        linter.verify("/* \neslint-disable-next-line\n */", {
+                            linterOptions: {
+                                reportUnusedDisableDirectives: true
+                            }
+                        }),
+                        [
+                            {
+                                ruleId: null,
+                                message: "Unused eslint-disable directive (no problems were reported).",
+                                line: 1,
+                                column: 1,
+                                fix: {
+                                    range: [0, 32],
+                                    text: " "
+                                },
+                                severity: 1,
+                                nodeType: null
+                            }
+                        ]
+                    );
+                });
+
+                it("reports problems for partially unused eslint-disable-next-line comments (in config)", () => {
+                    const code = "// eslint-disable-next-line no-alert, no-redeclare \nalert('test');";
+                    const config = {
+                        linterOptions: {
+                            reportUnusedDisableDirectives: true
+                        },
+                        rules: {
+                            "no-alert": 1,
+                            "no-redeclare": 1
+                        }
+                    };
+
+                    const messages = linter.verify(code, config, {
+                        filename,
+                        allowInlineConfig: true
+                    });
+
+                    assert.deepStrictEqual(
+                        messages,
+                        [
+                            {
+                                ruleId: null,
+                                message: "Unused eslint-disable directive (no problems were reported from 'no-redeclare').",
+                                line: 1,
+                                column: 1,
+                                fix: {
+                                    range: [36, 50],
+                                    text: ""
+                                },
+                                severity: 1,
+                                nodeType: null
+                            }
+                        ]
+                    );
+                });
+
+                it("reports problems for partially unused multiline eslint-disable-next-line comments (in config)", () => {
+                    const code = `
+                    /* eslint-disable-next-line no-alert, no-redeclare --
+                     * Here's a very long description about why this configuration is necessary
+                     * along with some additional information
+                    **/
+                    alert('test');
+                    `;
+                    const config = {
+                        linterOptions: {
+                            reportUnusedDisableDirectives: true
+                        },
+                        rules: {
+                            "no-alert": 1,
+                            "no-redeclare": 1
+                        }
+                    };
+
+                    const messages = linter.verify(code, config, {
+                        filename,
+                        allowInlineConfig: true
+                    });
+
+                    assert.deepStrictEqual(
+                        messages,
+                        [
+                            {
+                                ruleId: null,
+                                message: "Unused eslint-disable directive (no problems were reported from 'no-redeclare').",
+                                line: 2,
+                                column: 21,
+                                fix: {
+                                    range: [57, 71],
+                                    text: ""
+                                },
+                                severity: 1,
+                                nodeType: null
+                            }
+                        ]
+                    );
                 });
 
                 describe("autofix", () => {
@@ -12721,6 +14508,7 @@ var a = "test2";
                 };
 
                 const messages = linter.verify("var a = 1;", config);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.deepStrictEqual(messages[0].suggestions, [{
                     desc: "Insert space at the beginning",
@@ -12735,6 +14523,8 @@ var a = "test2";
                         text: " "
                     }
                 }]);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("supports messageIds for suggestions", () => {
@@ -12776,6 +14566,7 @@ var a = "test2";
                 };
 
                 const messages = linter.verify("var a = 1;", config);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.deepStrictEqual(messages[0].suggestions, [{
                     messageId: "suggestion1",
@@ -12792,6 +14583,8 @@ var a = "test2";
                         text: " "
                     }
                 }]);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should throw an error if suggestion is passed but `meta.hasSuggestions` property is not enabled", () => {
@@ -12864,6 +14657,7 @@ var a = "test2";
 
                 it("should report a violation with a useful parse error prefix", () => {
                     const messages = linter.verify(code);
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].severity, 2);
@@ -12872,6 +14666,8 @@ var a = "test2";
                     assert.strictEqual(messages[0].column, 4);
                     assert.isTrue(messages[0].fatal);
                     assert.match(messages[0].message, /^Parsing error:/u);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
 
                 it("should report source code where the issue is present", () => {
@@ -12882,11 +14678,14 @@ var a = "test2";
                         "}"
                     ];
                     const messages = linter.verify(inValidCode.join("\n"));
+                    const suppressedMessages = linter.getSuppressedMessages();
 
                     assert.strictEqual(messages.length, 1);
                     assert.strictEqual(messages[0].severity, 2);
                     assert.isTrue(messages[0].fatal);
                     assert.match(messages[0].message, /^Parsing error:/u);
+
+                    assert.strictEqual(suppressedMessages.length, 0);
                 });
             });
 
@@ -12930,6 +14729,55 @@ var a = "test2";
 
     });
 
+    describe("getSuppressedMessages()", () => {
+        it("should have no suppressed messages", () => {
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(suppressedMessages.length, 0);
+        });
+
+        it("should have a suppressed message", () => {
+            const code = "/* eslint-disable no-alert -- justification */\nalert(\"test\");";
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [{ kind: "directive", justification: "justification" }]
+            );
+        });
+
+        it("should have a suppressed message", () => {
+            const code = [
+                "/* eslint-disable no-alert -- j1",
+                " * j2",
+                " */",
+                "alert(\"test\");"
+            ].join("\n");
+            const config = {
+                rules: { "no-alert": 1 }
+            };
+            const messages = linter.verify(code, config);
+            const suppressedMessages = linter.getSuppressedMessages();
+
+            assert.strictEqual(messages.length, 0);
+
+            assert.strictEqual(suppressedMessages.length, 1);
+            assert.strictEqual(suppressedMessages[0].ruleId, "no-alert");
+            assert.deepStrictEqual(
+                suppressedMessages[0].suppressions,
+                [{ kind: "directive", justification: "j1\n * j2" }]
+            );
+        });
+    });
+
     describe("defineRule()", () => {
         it("should throw an error when called in flat config mode", () => {
             assert.throws(() => {
@@ -12978,9 +14826,12 @@ var a = "test2";
                     semi: 2
                 }
             }, { filename: "test.js" });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.output, "var a;", "Fixes were applied correctly");
             assert.isTrue(messages.fixed);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("does not require a third argument", () => {
@@ -12989,12 +14840,15 @@ var a = "test2";
                     semi: 2
                 }
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(fixResult, {
                 fixed: true,
                 messages: [],
                 output: "var a;"
             });
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("does not include suggestions in autofix results", () => {
@@ -13004,10 +14858,13 @@ var a = "test2";
                     "no-useless-escape": 2
                 }
             });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(fixResult.output, "var foo = /\\#/;");
             assert.strictEqual(fixResult.fixed, true);
             assert.strictEqual(fixResult.messages[0].suggestions.length > 0, true);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("does not apply autofixes when fix argument is `false`", () => {
@@ -13016,8 +14873,10 @@ var a = "test2";
                     semi: 2
                 }
             }, { fix: false });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(fixResult.fixed, false);
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("stops fixing after 10 passes", () => {
@@ -13051,10 +14910,13 @@ var a = "test2";
             };
 
             const fixResult = linter.verifyAndFix("a", config);
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(fixResult.fixed, true);
             assert.strictEqual(fixResult.output, `${" ".repeat(10)}a`);
             assert.strictEqual(fixResult.messages.length, 1);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should throw an error if fix is passed but meta has no `fixable` property", () => {
@@ -13253,9 +15115,12 @@ var a = "test2";
                         }
                     }
                 );
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(problems.length, 3);
                 assert.deepStrictEqual(problems.map(problem => problem.message), ["foo", "bar", "baz"]);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should apply a preprocessor to the code even if the preprocessor returned code block objects.", () => {
@@ -13282,10 +15147,13 @@ var a = "test2";
                         }
                     }
                 );
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(problems.length, 3);
                 assert.deepStrictEqual(problems.map(problem => problem.message), ["foo", "bar", "baz"]);
 
+                assert.strictEqual(suppressedMessages.length, 0);
+
                 // filename
                 assert.strictEqual(receivedFilenames.length, 3);
                 assert(/^filename\.js[/\\]0_block\.js/u.test(receivedFilenames[0]));
@@ -13332,6 +15200,37 @@ var a = "test2";
                 assert.strictEqual(preprocess.calledOnce, true);
                 assert.deepStrictEqual(preprocess.args[0], [code, filename]);
             });
+
+            it("should catch preprocess error.", () => {
+                const code = "foo";
+                const preprocess = sinon.spy(() => {
+                    throw Object.assign(new SyntaxError("Invalid syntax"), {
+                        lineNumber: 1,
+                        column: 1
+                    });
+                });
+
+                const configs = createFlatConfigArray([
+                    extraConfig
+                ]);
+
+                configs.normalizeSync();
+
+                const messages = linter.verify(code, configs, { filename, preprocess });
+
+                assert.strictEqual(preprocess.calledOnce, true);
+                assert.deepStrictEqual(preprocess.args[0], [code, filename]);
+                assert.deepStrictEqual(messages, [
+                    {
+                        ruleId: null,
+                        fatal: true,
+                        severity: 2,
+                        message: "Preprocessing error: Invalid syntax",
+                        line: 1,
+                        column: 1
+                    }
+                ]);
+            });
         });
 
         describe("postprocessors", () => {
@@ -13392,10 +15291,13 @@ var a = "test2";
                         }
                     }
                 );
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(problems.length, 3);
                 assert.deepStrictEqual(problems.map(problem => problem.message), ["FOO", "BAR", "BAZ"]);
                 assert.deepStrictEqual(problems.map(problem => problem.column), [1, 5, 9]);
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should use postprocessed problem ranges when applying autofixes", () => {
@@ -13462,10 +15364,13 @@ var a = "test2";
                         }
                     }
                 );
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(fixResult.fixed, true);
                 assert.strictEqual(fixResult.messages.length, 0);
                 assert.strictEqual(fixResult.output, "FOO BAR BAZ");
+
+                assert.strictEqual(suppressedMessages.length, 0);
             });
         });
     });
@@ -13483,22 +15388,28 @@ var a = "test2";
             it("should properly parse import statements when sourceType is module", () => {
                 const code = "import foo from 'foo';";
                 const messages = linter.verify(code, moduleConfig);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0, "Unexpected linting error.");
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should properly parse import all statements when sourceType is module", () => {
                 const code = "import * as foo from 'foo';";
                 const messages = linter.verify(code, moduleConfig);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0, "Unexpected linting error.");
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
             it("should properly parse default export statements when sourceType is module", () => {
                 const code = "export default function initialize() {}";
                 const messages = linter.verify(code, moduleConfig);
+                const suppressedMessages = linter.getSuppressedMessages();
 
                 assert.strictEqual(messages.length, 0, "Unexpected linting error.");
+                assert.strictEqual(suppressedMessages.length, 0);
             });
 
         });
@@ -13517,9 +15428,12 @@ var a = "test2";
 
 
             messages = linter.verify("", { languageOptions: { ecmaVersion: 5, sourceType: "module" } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.deepStrictEqual(messages.length, 1);
             assert.ok(messages[0].message.includes("sourceType 'module' is not supported when ecmaVersion < 2015"));
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not crash when invalid parentheses syntax is encountered", () => {
@@ -13536,9 +15450,12 @@ var a = "test2";
 
         it("should report syntax error when a keyword exists in object property shorthand", () => {
             const messages = linter.verify("let a = {this}", { languageOptions: { ecmaVersion: 6 } });
+            const suppressedMessages = linter.getSuppressedMessages();
 
             assert.strictEqual(messages.length, 1);
             assert.strictEqual(messages[0].fatal, true);
+
+            assert.strictEqual(suppressedMessages.length, 0);
         });
 
         it("should not crash when we reuse the SourceCode object", () => {
index 44f8e512d6796c78854e104ac027915b9e4018d6..2719bf30e300e5ace71d9a3c1b1ede0a2c3802e2 100644 (file)
@@ -60,7 +60,7 @@ describe("NodeEventGenerator", () => {
             assert(emitter.emit.calledWith("Foo", dummyNode));
         });
 
-        it("should generate events for exitting AST node.", () => {
+        it("should generate events for exiting AST node.", () => {
             const dummyNode = { type: "Foo", value: 1 };
 
             generator.leaveNode(dummyNode);
@@ -126,7 +126,7 @@ describe("NodeEventGenerator", () => {
             it(possibleQueries.join("; "), () => {
                 const ast = espree.parse(sourceText, ESPREE_CONFIG);
                 const emissions = getEmissions(ast, possibleQueries)
-                    .filter(emission => possibleQueries.indexOf(emission[0]) !== -1);
+                    .filter(emission => possibleQueries.includes(emission[0]));
 
                 assert.deepStrictEqual(emissions, expectedEmissions(ast));
             });
@@ -388,7 +388,7 @@ describe("NodeEventGenerator", () => {
         function assertEmissions(ast, visitorKeys, possibleQueries, expectedEmissions) {
             it(possibleQueries.join("; "), () => {
                 const emissions = getEmissions(ast, visitorKeys, possibleQueries)
-                    .filter(emission => possibleQueries.indexOf(emission[0]) !== -1);
+                    .filter(emission => possibleQueries.includes(emission[0]));
 
                 assert.deepStrictEqual(emissions, expectedEmissions(ast));
             });
index c84e46d9afd26deb72b450bd4a449201d8ab3088..4d3507a47647940636dbee3c4beeeff0280166f9 100644 (file)
 //------------------------------------------------------------------------------
 
 const assert = require("chai").assert,
-    options = require("../../lib/options");
+    createOptions = require("../../lib/options");
+
+//-----------------------------------------------------------------------------
+// Data
+//-----------------------------------------------------------------------------
+
+const eslintrcOptions = createOptions(false);
+const flatOptions = createOptions(true);
 
 //------------------------------------------------------------------------------
 // Tests
@@ -21,243 +28,360 @@ const assert = require("chai").assert,
  */
 
 describe("options", () => {
-    describe("--help", () => {
-        it("should return true for .help when passed", () => {
-            const currentOptions = options.parse("--help");
 
-            assert.isTrue(currentOptions.help);
-        });
-    });
+    describe("Common options", () => {
 
-    describe("-h", () => {
-        it("should return true for .help when passed", () => {
-            const currentOptions = options.parse("-h");
+        [eslintrcOptions, flatOptions].forEach(options => {
 
-            assert.isTrue(currentOptions.help);
-        });
-    });
+            describe("--help", () => {
+                it("should return true for .help when passed", () => {
+                    const currentOptions = options.parse("--help");
 
-    describe("--config", () => {
-        it("should return a string for .config when passed a string", () => {
-            const currentOptions = options.parse("--config file");
+                    assert.isTrue(currentOptions.help);
+                });
+            });
 
-            assert.isString(currentOptions.config);
-            assert.strictEqual(currentOptions.config, "file");
-        });
-    });
+            describe("-h", () => {
+                it("should return true for .help when passed", () => {
+                    const currentOptions = options.parse("-h");
 
-    describe("-c", () => {
-        it("should return a string for .config when passed a string", () => {
-            const currentOptions = options.parse("-c file");
+                    assert.isTrue(currentOptions.help);
+                });
+            });
 
-            assert.isString(currentOptions.config);
-            assert.strictEqual(currentOptions.config, "file");
-        });
-    });
+            describe("--config", () => {
+                it("should return a string for .config when passed a string", () => {
+                    const currentOptions = options.parse("--config file");
 
-    describe("--ext", () => {
-        it("should return an array with one item when passed .jsx", () => {
-            const currentOptions = options.parse("--ext .jsx");
+                    assert.isString(currentOptions.config);
+                    assert.strictEqual(currentOptions.config, "file");
+                });
+            });
 
-            assert.isArray(currentOptions.ext);
-            assert.strictEqual(currentOptions.ext[0], ".jsx");
-        });
+            describe("-c", () => {
+                it("should return a string for .config when passed a string", () => {
+                    const currentOptions = options.parse("-c file");
 
-        it("should return an array with two items when passed .js and .jsx", () => {
-            const currentOptions = options.parse("--ext .jsx --ext .js");
+                    assert.isString(currentOptions.config);
+                    assert.strictEqual(currentOptions.config, "file");
+                });
+            });
 
-            assert.isArray(currentOptions.ext);
-            assert.strictEqual(currentOptions.ext[0], ".jsx");
-            assert.strictEqual(currentOptions.ext[1], ".js");
-        });
+            describe("--format", () => {
+                it("should return a string for .format when passed a string", () => {
+                    const currentOptions = options.parse("--format compact");
 
-        it("should return an array with two items when passed .jsx,.js", () => {
-            const currentOptions = options.parse("--ext .jsx,.js");
+                    assert.isString(currentOptions.format);
+                    assert.strictEqual(currentOptions.format, "compact");
+                });
 
-            assert.isArray(currentOptions.ext);
-            assert.strictEqual(currentOptions.ext[0], ".jsx");
-            assert.strictEqual(currentOptions.ext[1], ".js");
-        });
+                it("should return stylish for .format when not passed", () => {
+                    const currentOptions = options.parse("");
 
-        it("should not exist when not passed", () => {
-            const currentOptions = options.parse("");
+                    assert.isString(currentOptions.format);
+                    assert.strictEqual(currentOptions.format, "stylish");
+                });
+            });
 
-            assert.notProperty(currentOptions, "ext");
-        });
-    });
+            describe("-f", () => {
+                it("should return a string for .format when passed a string", () => {
+                    const currentOptions = options.parse("-f compact");
 
-    describe("--rulesdir", () => {
-        it("should return a string for .rulesdir when passed a string", () => {
-            const currentOptions = options.parse("--rulesdir /morerules");
+                    assert.isString(currentOptions.format);
+                    assert.strictEqual(currentOptions.format, "compact");
+                });
+            });
 
-            assert.isArray(currentOptions.rulesdir);
-            assert.deepStrictEqual(currentOptions.rulesdir, ["/morerules"]);
-        });
-    });
+            describe("--version", () => {
+                it("should return true for .version when passed", () => {
+                    const currentOptions = options.parse("--version");
 
-    describe("--format", () => {
-        it("should return a string for .format when passed a string", () => {
-            const currentOptions = options.parse("--format compact");
+                    assert.isTrue(currentOptions.version);
+                });
+            });
 
-            assert.isString(currentOptions.format);
-            assert.strictEqual(currentOptions.format, "compact");
-        });
+            describe("-v", () => {
+                it("should return true for .version when passed", () => {
+                    const currentOptions = options.parse("-v");
 
-        it("should return stylish for .format when not passed", () => {
-            const currentOptions = options.parse("");
+                    assert.isTrue(currentOptions.version);
+                });
+            });
 
-            assert.isString(currentOptions.format);
-            assert.strictEqual(currentOptions.format, "stylish");
-        });
-    });
+            describe("when asking for help", () => {
+                it("should return string of help text when called", () => {
+                    const helpText = options.generateHelp();
 
-    describe("-f", () => {
-        it("should return a string for .format when passed a string", () => {
-            const currentOptions = options.parse("-f compact");
+                    assert.isString(helpText);
+                });
+            });
+
+            describe("--no-ignore", () => {
+                it("should return false for .ignore when passed", () => {
+                    const currentOptions = options.parse("--no-ignore");
 
-            assert.isString(currentOptions.format);
-            assert.strictEqual(currentOptions.format, "compact");
-        });
-    });
+                    assert.isFalse(currentOptions.ignore);
+                });
+            });
+
+            describe("--ignore-path", () => {
+                it("should return a string for .ignorePath when passed", () => {
+                    const currentOptions = options.parse("--ignore-path .gitignore");
 
-    describe("--version", () => {
-        it("should return true for .version when passed", () => {
-            const currentOptions = options.parse("--version");
+                    assert.strictEqual(currentOptions.ignorePath, ".gitignore");
+                });
+            });
+
+            describe("--ignore-pattern", () => {
+                it("should return a string array for .ignorePattern when passed", () => {
+                    const currentOptions = options.parse("--ignore-pattern *.js");
+
+                    assert.ok(currentOptions.ignorePattern);
+                    assert.strictEqual(currentOptions.ignorePattern.length, 1);
+                    assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
+                });
+
+                it("should return a string array for multiple values", () => {
+                    const currentOptions = options.parse("--ignore-pattern *.js --ignore-pattern *.ts");
+
+                    assert.ok(currentOptions.ignorePattern);
+                    assert.strictEqual(currentOptions.ignorePattern.length, 2);
+                    assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
+                    assert.strictEqual(currentOptions.ignorePattern[1], "*.ts");
+                });
+
+                it("should return a string array of properly parsed values, when those values include commas", () => {
+                    const currentOptions = options.parse("--ignore-pattern *.js --ignore-pattern foo-{bar,baz}.js");
+
+                    assert.ok(currentOptions.ignorePattern);
+                    assert.strictEqual(currentOptions.ignorePattern.length, 2);
+                    assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
+                    assert.strictEqual(currentOptions.ignorePattern[1], "foo-{bar,baz}.js");
+                });
+            });
+
+            describe("--color", () => {
+                it("should return true for .color when passed --color", () => {
+                    const currentOptions = options.parse("--color");
+
+                    assert.isTrue(currentOptions.color);
+                });
+
+                it("should return false for .color when passed --no-color", () => {
+                    const currentOptions = options.parse("--no-color");
+
+                    assert.isFalse(currentOptions.color);
+                });
+            });
+
+            describe("--stdin", () => {
+                it("should return true for .stdin when passed", () => {
+                    const currentOptions = options.parse("--stdin");
+
+                    assert.isTrue(currentOptions.stdin);
+                });
+            });
+
+            describe("--stdin-filename", () => {
+                it("should return a string for .stdinFilename when passed", () => {
+                    const currentOptions = options.parse("--stdin-filename test.js");
+
+                    assert.strictEqual(currentOptions.stdinFilename, "test.js");
+                });
+            });
+
+            describe("--global", () => {
+                it("should return an array for a single occurrence", () => {
+                    const currentOptions = options.parse("--global foo");
+
+                    assert.isArray(currentOptions.global);
+                    assert.strictEqual(currentOptions.global.length, 1);
+                    assert.strictEqual(currentOptions.global[0], "foo");
+                });
+
+                it("should split variable names using commas", () => {
+                    const currentOptions = options.parse("--global foo,bar");
+
+                    assert.isArray(currentOptions.global);
+                    assert.strictEqual(currentOptions.global.length, 2);
+                    assert.strictEqual(currentOptions.global[0], "foo");
+                    assert.strictEqual(currentOptions.global[1], "bar");
+                });
+
+                it("should not split on colons", () => {
+                    const currentOptions = options.parse("--global foo:false,bar:true");
+
+                    assert.isArray(currentOptions.global);
+                    assert.strictEqual(currentOptions.global.length, 2);
+                    assert.strictEqual(currentOptions.global[0], "foo:false");
+                    assert.strictEqual(currentOptions.global[1], "bar:true");
+                });
+
+                it("should concatenate successive occurrences", () => {
+                    const currentOptions = options.parse("--global foo:true --global bar:false");
 
-            assert.isTrue(currentOptions.version);
-        });
-    });
+                    assert.isArray(currentOptions.global);
+                    assert.strictEqual(currentOptions.global.length, 2);
+                    assert.strictEqual(currentOptions.global[0], "foo:true");
+                    assert.strictEqual(currentOptions.global[1], "bar:false");
+                });
+            });
 
-    describe("-v", () => {
-        it("should return true for .version when passed", () => {
-            const currentOptions = options.parse("-v");
 
-            assert.isTrue(currentOptions.version);
-        });
-    });
+            describe("--quiet", () => {
+                it("should return true for .quiet when passed", () => {
+                    const currentOptions = options.parse("--quiet");
 
-    describe("when asking for help", () => {
-        it("should return string of help text when called", () => {
-            const helpText = options.generateHelp();
+                    assert.isTrue(currentOptions.quiet);
+                });
+            });
 
-            assert.isString(helpText);
-        });
-    });
+            describe("--max-warnings", () => {
+                it("should return correct value for .maxWarnings when passed", () => {
+                    const currentOptions = options.parse("--max-warnings 10");
 
-    describe("--no-ignore", () => {
-        it("should return false for .ignore when passed", () => {
-            const currentOptions = options.parse("--no-ignore");
+                    assert.strictEqual(currentOptions.maxWarnings, 10);
+                });
 
-            assert.isFalse(currentOptions.ignore);
-        });
-    });
+                it("should return -1 for .maxWarnings when not passed", () => {
+                    const currentOptions = options.parse("");
 
-    describe("--ignore-path", () => {
-        it("should return a string for .ignorePath when passed", () => {
-            const currentOptions = options.parse("--ignore-path .gitignore");
+                    assert.strictEqual(currentOptions.maxWarnings, -1);
+                });
 
-            assert.strictEqual(currentOptions.ignorePath, ".gitignore");
-        });
-    });
+                it("should throw an error when supplied with a non-integer", () => {
+                    assert.throws(() => {
+                        options.parse("--max-warnings 10.2");
+                    }, /Invalid value for option 'max-warnings' - expected type Int/u);
+                });
+            });
 
-    describe("--ignore-pattern", () => {
-        it("should return a string array for .ignorePattern when passed", () => {
-            const currentOptions = options.parse("--ignore-pattern *.js");
+            describe("--init", () => {
+                it("should return true for --init when passed", () => {
+                    const currentOptions = options.parse("--init");
 
-            assert.ok(currentOptions.ignorePattern);
-            assert.strictEqual(currentOptions.ignorePattern.length, 1);
-            assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
-        });
+                    assert.isTrue(currentOptions.init);
+                });
+            });
 
-        it("should return a string array for multiple values", () => {
-            const currentOptions = options.parse("--ignore-pattern *.js --ignore-pattern *.ts");
+            describe("--fix", () => {
+                it("should return true for --fix when passed", () => {
+                    const currentOptions = options.parse("--fix");
 
-            assert.ok(currentOptions.ignorePattern);
-            assert.strictEqual(currentOptions.ignorePattern.length, 2);
-            assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
-            assert.strictEqual(currentOptions.ignorePattern[1], "*.ts");
-        });
+                    assert.isTrue(currentOptions.fix);
+                });
+            });
 
-        it("should return a string array of properly parsed values, when those values include commas", () => {
-            const currentOptions = options.parse("--ignore-pattern *.js --ignore-pattern foo-{bar,baz}.js");
+            describe("--fix-type", () => {
+                it("should return one value with --fix-type is passed", () => {
+                    const currentOptions = options.parse("--fix-type problem");
 
-            assert.ok(currentOptions.ignorePattern);
-            assert.strictEqual(currentOptions.ignorePattern.length, 2);
-            assert.strictEqual(currentOptions.ignorePattern[0], "*.js");
-            assert.strictEqual(currentOptions.ignorePattern[1], "foo-{bar,baz}.js");
-        });
-    });
+                    assert.strictEqual(currentOptions.fixType.length, 1);
+                    assert.strictEqual(currentOptions.fixType[0], "problem");
+                });
 
-    describe("--color", () => {
-        it("should return true for .color when passed --color", () => {
-            const currentOptions = options.parse("--color");
+                it("should return two values when --fix-type is passed twice", () => {
+                    const currentOptions = options.parse("--fix-type problem --fix-type suggestion");
 
-            assert.isTrue(currentOptions.color);
-        });
+                    assert.strictEqual(currentOptions.fixType.length, 2);
+                    assert.strictEqual(currentOptions.fixType[0], "problem");
+                    assert.strictEqual(currentOptions.fixType[1], "suggestion");
+                });
+
+                it("should return two values when --fix-type is passed a comma-separated value", () => {
+                    const currentOptions = options.parse("--fix-type problem,suggestion");
+
+                    assert.strictEqual(currentOptions.fixType.length, 2);
+                    assert.strictEqual(currentOptions.fixType[0], "problem");
+                    assert.strictEqual(currentOptions.fixType[1], "suggestion");
+                });
+            });
+
+            describe("--debug", () => {
+                it("should return true for --debug when passed", () => {
+                    const currentOptions = options.parse("--debug");
+
+                    assert.isTrue(currentOptions.debug);
+                });
+            });
+
+            describe("--inline-config", () => {
+                it("should return false when passed --no-inline-config", () => {
+                    const currentOptions = options.parse("--no-inline-config");
+
+                    assert.isFalse(currentOptions.inlineConfig);
+                });
+
+                it("should return true for --inline-config when empty", () => {
+                    const currentOptions = options.parse("");
 
-        it("should return false for .color when passed --no-color", () => {
-            const currentOptions = options.parse("--no-color");
+                    assert.isTrue(currentOptions.inlineConfig);
+                });
+            });
 
-            assert.isFalse(currentOptions.color);
+            describe("--print-config", () => {
+                it("should return file path when passed --print-config", () => {
+                    const currentOptions = options.parse("--print-config file.js");
+
+                    assert.strictEqual(currentOptions.printConfig, "file.js");
+                });
+            });
         });
+
     });
 
-    describe("--stdin", () => {
-        it("should return true for .stdin when passed", () => {
-            const currentOptions = options.parse("--stdin");
 
-            assert.isTrue(currentOptions.stdin);
+    describe("--ext", () => {
+        it("should return an array with one item when passed .jsx", () => {
+            const currentOptions = eslintrcOptions.parse("--ext .jsx");
+
+            assert.isArray(currentOptions.ext);
+            assert.strictEqual(currentOptions.ext[0], ".jsx");
         });
-    });
 
-    describe("--stdin-filename", () => {
-        it("should return a string for .stdinFilename when passed", () => {
-            const currentOptions = options.parse("--stdin-filename test.js");
+        it("should return an array with two items when passed .js and .jsx", () => {
+            const currentOptions = eslintrcOptions.parse("--ext .jsx --ext .js");
 
-            assert.strictEqual(currentOptions.stdinFilename, "test.js");
+            assert.isArray(currentOptions.ext);
+            assert.strictEqual(currentOptions.ext[0], ".jsx");
+            assert.strictEqual(currentOptions.ext[1], ".js");
         });
-    });
 
-    describe("--global", () => {
-        it("should return an array for a single occurrence", () => {
-            const currentOptions = options.parse("--global foo");
+        it("should return an array with two items when passed .jsx,.js", () => {
+            const currentOptions = eslintrcOptions.parse("--ext .jsx,.js");
 
-            assert.isArray(currentOptions.global);
-            assert.strictEqual(currentOptions.global.length, 1);
-            assert.strictEqual(currentOptions.global[0], "foo");
+            assert.isArray(currentOptions.ext);
+            assert.strictEqual(currentOptions.ext[0], ".jsx");
+            assert.strictEqual(currentOptions.ext[1], ".js");
         });
 
-        it("should split variable names using commas", () => {
-            const currentOptions = options.parse("--global foo,bar");
+        it("should not exist when not passed", () => {
+            const currentOptions = eslintrcOptions.parse("");
 
-            assert.isArray(currentOptions.global);
-            assert.strictEqual(currentOptions.global.length, 2);
-            assert.strictEqual(currentOptions.global[0], "foo");
-            assert.strictEqual(currentOptions.global[1], "bar");
+            assert.notProperty(currentOptions, "ext");
         });
+    });
 
-        it("should not split on colons", () => {
-            const currentOptions = options.parse("--global foo:false,bar:true");
+    describe("--rulesdir", () => {
+        it("should return a string for .rulesdir when passed a string", () => {
+            const currentOptions = eslintrcOptions.parse("--rulesdir /morerules");
 
-            assert.isArray(currentOptions.global);
-            assert.strictEqual(currentOptions.global.length, 2);
-            assert.strictEqual(currentOptions.global[0], "foo:false");
-            assert.strictEqual(currentOptions.global[1], "bar:true");
+            assert.isArray(currentOptions.rulesdir);
+            assert.deepStrictEqual(currentOptions.rulesdir, ["/morerules"]);
         });
+    });
 
-        it("should concatenate successive occurrences", () => {
-            const currentOptions = options.parse("--global foo:true --global bar:false");
+    describe("--parser", () => {
+        it("should return a string for --parser when passed", () => {
+            const currentOptions = eslintrcOptions.parse("--parser test");
 
-            assert.isArray(currentOptions.global);
-            assert.strictEqual(currentOptions.global.length, 2);
-            assert.strictEqual(currentOptions.global[0], "foo:true");
-            assert.strictEqual(currentOptions.global[1], "bar:false");
+            assert.strictEqual(currentOptions.parser, "test");
         });
     });
 
     describe("--plugin", () => {
         it("should return an array when passed a single occurrence", () => {
-            const currentOptions = options.parse("--plugin single");
+            const currentOptions = eslintrcOptions.parse("--plugin single");
 
             assert.isArray(currentOptions.plugin);
             assert.strictEqual(currentOptions.plugin.length, 1);
@@ -265,7 +389,7 @@ describe("options", () => {
         });
 
         it("should return an array when passed a comma-delimited string", () => {
-            const currentOptions = options.parse("--plugin foo,bar");
+            const currentOptions = eslintrcOptions.parse("--plugin foo,bar");
 
             assert.isArray(currentOptions.plugin);
             assert.strictEqual(currentOptions.plugin.length, 2);
@@ -274,7 +398,7 @@ describe("options", () => {
         });
 
         it("should return an array when passed multiple times", () => {
-            const currentOptions = options.parse("--plugin foo --plugin bar");
+            const currentOptions = eslintrcOptions.parse("--plugin foo --plugin bar");
 
             assert.isArray(currentOptions.plugin);
             assert.strictEqual(currentOptions.plugin.length, 2);
@@ -283,110 +407,12 @@ describe("options", () => {
         });
     });
 
-    describe("--quiet", () => {
-        it("should return true for .quiet when passed", () => {
-            const currentOptions = options.parse("--quiet");
-
-            assert.isTrue(currentOptions.quiet);
-        });
-    });
-
-    describe("--max-warnings", () => {
-        it("should return correct value for .maxWarnings when passed", () => {
-            const currentOptions = options.parse("--max-warnings 10");
-
-            assert.strictEqual(currentOptions.maxWarnings, 10);
-        });
-
-        it("should return -1 for .maxWarnings when not passed", () => {
-            const currentOptions = options.parse("");
-
-            assert.strictEqual(currentOptions.maxWarnings, -1);
-        });
-
-        it("should throw an error when supplied with a non-integer", () => {
-            assert.throws(() => {
-                options.parse("--max-warnings 10.2");
-            }, /Invalid value for option 'max-warnings' - expected type Int/u);
-        });
-    });
-
-    describe("--init", () => {
-        it("should return true for --init when passed", () => {
-            const currentOptions = options.parse("--init");
-
-            assert.isTrue(currentOptions.init);
-        });
-    });
-
-    describe("--fix", () => {
-        it("should return true for --fix when passed", () => {
-            const currentOptions = options.parse("--fix");
-
-            assert.isTrue(currentOptions.fix);
-        });
-    });
-
-    describe("--fix-type", () => {
-        it("should return one value with --fix-type is passed", () => {
-            const currentOptions = options.parse("--fix-type problem");
-
-            assert.strictEqual(currentOptions.fixType.length, 1);
-            assert.strictEqual(currentOptions.fixType[0], "problem");
-        });
-
-        it("should return two values when --fix-type is passed twice", () => {
-            const currentOptions = options.parse("--fix-type problem --fix-type suggestion");
-
-            assert.strictEqual(currentOptions.fixType.length, 2);
-            assert.strictEqual(currentOptions.fixType[0], "problem");
-            assert.strictEqual(currentOptions.fixType[1], "suggestion");
-        });
-
-        it("should return two values when --fix-type is passed a comma-separated value", () => {
-            const currentOptions = options.parse("--fix-type problem,suggestion");
-
-            assert.strictEqual(currentOptions.fixType.length, 2);
-            assert.strictEqual(currentOptions.fixType[0], "problem");
-            assert.strictEqual(currentOptions.fixType[1], "suggestion");
-        });
-    });
-
-    describe("--debug", () => {
-        it("should return true for --debug when passed", () => {
-            const currentOptions = options.parse("--debug");
-
-            assert.isTrue(currentOptions.debug);
-        });
-    });
-
-    describe("--inline-config", () => {
-        it("should return false when passed --no-inline-config", () => {
-            const currentOptions = options.parse("--no-inline-config");
-
-            assert.isFalse(currentOptions.inlineConfig);
-        });
-
-        it("should return true for --inline-config when empty", () => {
-            const currentOptions = options.parse("");
-
-            assert.isTrue(currentOptions.inlineConfig);
-        });
-    });
-
-    describe("--parser", () => {
-        it("should return a string for --parser when passed", () => {
-            const currentOptions = options.parse("--parser test");
+    describe("--no-config-lookup", () => {
+        it("should return a string for .rulesdir when passed a string", () => {
+            const currentOptions = flatOptions.parse("--no-config-lookup foo.js");
 
-            assert.strictEqual(currentOptions.parser, "test");
+            assert.isFalse(currentOptions.configLookup);
         });
     });
 
-    describe("--print-config", () => {
-        it("should return file path when passed --print-config", () => {
-            const currentOptions = options.parse("--print-config file.js");
-
-            assert.strictEqual(currentOptions.printConfig, "file.js");
-        });
-    });
 });
diff --git a/eslint/tests/lib/rule-tester/flat-rule-tester.js b/eslint/tests/lib/rule-tester/flat-rule-tester.js
new file mode 100644 (file)
index 0000000..bdc196e
--- /dev/null
@@ -0,0 +1,2625 @@
+/**
+ * @fileoverview Tests for ESLint Tester
+ * @author Nicholas C. Zakas
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+const sinon = require("sinon"),
+    EventEmitter = require("events"),
+    FlatRuleTester = require("../../../lib/rule-tester/flat-rule-tester"),
+    assert = require("chai").assert,
+    nodeAssert = require("assert");
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+const NODE_ASSERT_STRICT_EQUAL_OPERATOR = (() => {
+    try {
+        nodeAssert.strictEqual(1, 2);
+    } catch (err) {
+        return err.operator;
+    }
+    throw new Error("unexpected successful assertion");
+})();
+
+/**
+ * A helper function to verify Node.js core error messages.
+ * @param {string} actual The actual input
+ * @param {string} expected The expected input
+ * @returns {Function} Error callback to verify that the message is correct
+ *                     for the actual and expected input.
+ */
+function assertErrorMatches(actual, expected) {
+    const err = new nodeAssert.AssertionError({
+        actual,
+        expected,
+        operator: NODE_ASSERT_STRICT_EQUAL_OPERATOR
+    });
+
+    return err.message;
+}
+
+/**
+ * Do nothing.
+ * @returns {void}
+ */
+function noop() {
+
+    // do nothing.
+}
+
+//------------------------------------------------------------------------------
+// Rewire Things
+//------------------------------------------------------------------------------
+
+/*
+ * So here's the situation. Because RuleTester uses it() and describe() from
+ * Mocha, any failures would show up in the output of this test file. That means
+ * when we tested that a failure is thrown, that would also count as a failure
+ * in the testing for RuleTester. In order to remove those results from the
+ * results of this file, we need to overwrite it() and describe() just in
+ * RuleTester to do nothing but run code. Effectively, it() and describe()
+ * just become regular functions inside of index.js, not at all related to Mocha.
+ * That allows the results of this file to be untainted and therefore accurate.
+ *
+ * To assert that the right arguments are passed to RuleTester.describe/it, an
+ * event emitter is used which emits the arguments.
+ */
+
+const ruleTesterTestEmitter = new EventEmitter();
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+describe("FlatRuleTester", () => {
+
+    let ruleTester;
+
+    // Stub `describe()` and `it()` while this test suite.
+    before(() => {
+        FlatRuleTester.describe = function(text, method) {
+            ruleTesterTestEmitter.emit("describe", text, method);
+            return method.call(this);
+        };
+        FlatRuleTester.it = function(text, method) {
+            ruleTesterTestEmitter.emit("it", text, method);
+            return method.call(this);
+        };
+    });
+
+    after(() => {
+        FlatRuleTester.describe = null;
+        FlatRuleTester.it = null;
+    });
+
+    beforeEach(() => {
+        ruleTester = new FlatRuleTester();
+    });
+
+    describe("Default Config", () => {
+
+        afterEach(() => {
+            FlatRuleTester.resetDefaultConfig();
+        });
+
+        it("should correctly set the globals configuration", () => {
+            const config = { languageOptions: { globals: { test: true } } };
+
+            FlatRuleTester.setDefaultConfig(config);
+            assert(
+                FlatRuleTester.getDefaultConfig().languageOptions.globals.test,
+                "The default config object is incorrect"
+            );
+        });
+
+        it("should correctly reset the global configuration", () => {
+            const config = { languageOptions: { globals: { test: true } } };
+
+            FlatRuleTester.setDefaultConfig(config);
+            FlatRuleTester.resetDefaultConfig();
+            assert.deepStrictEqual(
+                FlatRuleTester.getDefaultConfig(),
+                { rules: {} },
+                "The default configuration has not reset correctly"
+            );
+        });
+
+        it("should enforce the global configuration to be an object", () => {
+
+            /**
+             * Set the default config for the rules tester
+             * @param {Object} config configuration object
+             * @returns {Function} Function to be executed
+             * @private
+             */
+            function setConfig(config) {
+                return function() {
+                    FlatRuleTester.setDefaultConfig(config);
+                };
+            }
+            assert.throw(setConfig());
+            assert.throw(setConfig(1));
+            assert.throw(setConfig(3.14));
+            assert.throw(setConfig("foo"));
+            assert.throw(setConfig(null));
+            assert.throw(setConfig(true));
+        });
+
+        it("should pass-through the globals config to the tester then to the to rule", () => {
+            const config = { languageOptions: { sourceType: "script", globals: { test: true } } };
+
+            FlatRuleTester.setDefaultConfig(config);
+            ruleTester = new FlatRuleTester();
+
+            ruleTester.run("no-test-global", require("../../fixtures/testers/rule-tester/no-test-global"), {
+                valid: [
+                    "var test = 'foo'",
+                    "var test2 = test"
+                ],
+                invalid: [{ code: "bar", errors: 1, languageOptions: { globals: { foo: true } } }]
+            });
+        });
+
+        it("should throw an error if node.start is accessed with parser in default config", () => {
+            const enhancedParser = require("../../fixtures/parsers/enhanced-parser");
+
+            FlatRuleTester.setDefaultConfig({
+                languageOptions: {
+                    parser: enhancedParser
+                }
+            });
+            ruleTester = new FlatRuleTester();
+
+            /*
+             * Note: More robust test for start/end found later in file.
+             * This one is just for checking the default config has a
+             * parser that is wrapped.
+             */
+            const usesStartEndRule = {
+                create() {
+
+                    return {
+                        CallExpression(node) {
+                            noop(node.arguments[1].start);
+                        }
+                    };
+                }
+            };
+
+            assert.throws(() => {
+                ruleTester.run("uses-start-end", usesStartEndRule, {
+                    valid: ["foo(a, b)"],
+                    invalid: []
+                });
+            }, "Use node.range[0] instead of node.start");
+        });
+
+    });
+
+    describe("only", () => {
+        describe("`itOnly` accessor", () => {
+            describe("when `itOnly` is set", () => {
+                before(() => {
+                    FlatRuleTester.itOnly = sinon.spy();
+                });
+                after(() => {
+                    FlatRuleTester.itOnly = void 0;
+                });
+                beforeEach(() => {
+                    FlatRuleTester.itOnly.resetHistory();
+                    ruleTester = new FlatRuleTester();
+                });
+
+                it("is called by exclusive tests", () => {
+                    ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                        valid: [{
+                            code: "const notVar = 42;",
+                            only: true
+                        }],
+                        invalid: []
+                    });
+
+                    sinon.assert.calledWith(FlatRuleTester.itOnly, "const notVar = 42;");
+                });
+            });
+
+            describe("when `it` is set and has an `only()` method", () => {
+                before(() => {
+                    FlatRuleTester.it.only = () => {};
+                    sinon.spy(FlatRuleTester.it, "only");
+                });
+                after(() => {
+                    FlatRuleTester.it.only = void 0;
+                });
+                beforeEach(() => {
+                    FlatRuleTester.it.only.resetHistory();
+                    ruleTester = new FlatRuleTester();
+                });
+
+                it("is called by tests with `only` set", () => {
+                    ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                        valid: [{
+                            code: "const notVar = 42;",
+                            only: true
+                        }],
+                        invalid: []
+                    });
+
+                    sinon.assert.calledWith(FlatRuleTester.it.only, "const notVar = 42;");
+                });
+            });
+
+            describe("when global `it` is a function that has an `only()` method", () => {
+                let originalGlobalItOnly;
+
+                before(() => {
+
+                    /*
+                     * We run tests with `--forbid-only`, so we have to override
+                     * `it.only` to prevent the real one from being called.
+                     */
+                    originalGlobalItOnly = it.only;
+                    it.only = () => {};
+                    sinon.spy(it, "only");
+                });
+                after(() => {
+                    it.only = originalGlobalItOnly;
+                });
+                beforeEach(() => {
+                    it.only.resetHistory();
+                    ruleTester = new FlatRuleTester();
+                });
+
+                it("is called by tests with `only` set", () => {
+                    ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                        valid: [{
+                            code: "const notVar = 42;",
+                            only: true
+                        }],
+                        invalid: []
+                    });
+
+                    sinon.assert.calledWith(it.only, "const notVar = 42;");
+                });
+            });
+
+            describe("when `describe` and `it` are overridden without `itOnly`", () => {
+                let originalGlobalItOnly;
+
+                before(() => {
+
+                    /*
+                     * These tests override `describe` and `it` already, so we
+                     * don't need to override them here. We do, however, need to
+                     * remove `only` from the global `it` to prevent it from
+                     * being used instead.
+                     */
+                    originalGlobalItOnly = it.only;
+                    it.only = void 0;
+                });
+                after(() => {
+                    it.only = originalGlobalItOnly;
+                });
+                beforeEach(() => {
+                    ruleTester = new FlatRuleTester();
+                });
+
+                it("throws an error recommending overriding `itOnly`", () => {
+                    assert.throws(() => {
+                        ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                            valid: [{
+                                code: "const notVar = 42;",
+                                only: true
+                            }],
+                            invalid: []
+                        });
+                    }, "Set `RuleTester.itOnly` to use `only` with a custom test framework.");
+                });
+            });
+
+            describe("when global `it` is a function that does not have an `only()` method", () => {
+                let originalGlobalIt;
+                let originalRuleTesterDescribe;
+                let originalRuleTesterIt;
+
+                before(() => {
+                    originalGlobalIt = global.it;
+
+                    // eslint-disable-next-line no-global-assign -- Temporarily override Mocha global
+                    it = () => {};
+
+                    /*
+                     * These tests override `describe` and `it`, so we need to
+                     * un-override them here so they won't interfere.
+                     */
+                    originalRuleTesterDescribe = FlatRuleTester.describe;
+                    FlatRuleTester.describe = void 0;
+                    originalRuleTesterIt = FlatRuleTester.it;
+                    FlatRuleTester.it = void 0;
+                });
+                after(() => {
+
+                    // eslint-disable-next-line no-global-assign -- Restore Mocha global
+                    it = originalGlobalIt;
+                    FlatRuleTester.describe = originalRuleTesterDescribe;
+                    FlatRuleTester.it = originalRuleTesterIt;
+                });
+                beforeEach(() => {
+                    ruleTester = new FlatRuleTester();
+                });
+
+                it("throws an error explaining that the current test framework does not support `only`", () => {
+                    assert.throws(() => {
+                        ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                            valid: [{
+                                code: "const notVar = 42;",
+                                only: true
+                            }],
+                            invalid: []
+                        });
+                    }, "The current test framework does not support exclusive tests with `only`.");
+                });
+            });
+        });
+
+        describe("test cases", () => {
+            const ruleName = "no-var";
+            const rule = require("../../fixtures/testers/rule-tester/no-var");
+
+            let originalRuleTesterIt;
+            let spyRuleTesterIt;
+            let originalRuleTesterItOnly;
+            let spyRuleTesterItOnly;
+
+            before(() => {
+                originalRuleTesterIt = FlatRuleTester.it;
+                spyRuleTesterIt = sinon.spy();
+                FlatRuleTester.it = spyRuleTesterIt;
+                originalRuleTesterItOnly = FlatRuleTester.itOnly;
+                spyRuleTesterItOnly = sinon.spy();
+                FlatRuleTester.itOnly = spyRuleTesterItOnly;
+            });
+            after(() => {
+                FlatRuleTester.it = originalRuleTesterIt;
+                FlatRuleTester.itOnly = originalRuleTesterItOnly;
+            });
+            beforeEach(() => {
+                spyRuleTesterIt.resetHistory();
+                spyRuleTesterItOnly.resetHistory();
+                ruleTester = new FlatRuleTester();
+            });
+
+            it("isn't called for normal tests", () => {
+                ruleTester.run(ruleName, rule, {
+                    valid: ["const notVar = 42;"],
+                    invalid: []
+                });
+                sinon.assert.calledWith(spyRuleTesterIt, "const notVar = 42;");
+                sinon.assert.notCalled(spyRuleTesterItOnly);
+            });
+
+            it("calls it or itOnly for every test case", () => {
+
+                /*
+                 * `RuleTester` doesn't implement test case exclusivity itself.
+                 * Setting `only: true` just causes `RuleTester` to call
+                 * whatever `only()` function is provided by the test framework
+                 * instead of the regular `it()` function.
+                 */
+
+                ruleTester.run(ruleName, rule, {
+                    valid: [
+                        "const valid = 42;",
+                        {
+                            code: "const onlyValid = 42;",
+                            only: true
+                        }
+                    ],
+                    invalid: [
+                        {
+                            code: "var invalid = 42;",
+                            errors: [/^Bad var/u]
+                        },
+                        {
+                            code: "var onlyInvalid = 42;",
+                            errors: [/^Bad var/u],
+                            only: true
+                        }
+                    ]
+                });
+
+                sinon.assert.calledWith(spyRuleTesterIt, "const valid = 42;");
+                sinon.assert.calledWith(spyRuleTesterItOnly, "const onlyValid = 42;");
+                sinon.assert.calledWith(spyRuleTesterIt, "var invalid = 42;");
+                sinon.assert.calledWith(spyRuleTesterItOnly, "var onlyInvalid = 42;");
+            });
+        });
+
+        describe("static helper wrapper", () => {
+            it("adds `only` to string test cases", () => {
+                const test = FlatRuleTester.only("const valid = 42;");
+
+                assert.deepStrictEqual(test, {
+                    code: "const valid = 42;",
+                    only: true
+                });
+            });
+
+            it("adds `only` to object test cases", () => {
+                const test = FlatRuleTester.only({ code: "const valid = 42;" });
+
+                assert.deepStrictEqual(test, {
+                    code: "const valid = 42;",
+                    only: true
+                });
+            });
+        });
+    });
+
+    it("should not throw an error when everything passes", () => {
+        ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+            valid: [
+                "Eval(foo)"
+            ],
+            invalid: [
+                { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] }
+            ]
+        });
+    });
+
+    it("should throw correct error when valid code is invalid and enables other core rule", () => {
+
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "/*eslint semi: 2*/ eval(foo);"
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] }
+                ]
+            });
+        }, /Should have no errors but had 1/u);
+    });
+
+    it("should throw an error when valid code is invalid", () => {
+
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "eval(foo)"
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] }
+                ]
+            });
+        }, /Should have no errors but had 1/u);
+    });
+
+    it("should throw an error when valid code is invalid", () => {
+
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    { code: "eval(foo)" }
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] }
+                ]
+            });
+        }, /Should have no errors but had 1/u);
+    });
+
+    it("should throw an error if invalid code is valid", () => {
+
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "Eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] }
+                ]
+            });
+        }, /Should have 1 error but had 0/u);
+    });
+
+    it("should throw an error when the error message is wrong", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+                // Only the invalid test matters here
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: [{ message: "Bad error message." }] }
+                ]
+            });
+        }, assertErrorMatches("Bad var.", "Bad error message."));
+    });
+
+    it("should throw an error when the error message regex does not match", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", errors: [{ message: /Bad error message/u }] }
+                ]
+            });
+        }, /Expected 'Bad var.' to match \/Bad error message\//u);
+    });
+
+    it("should throw an error when the error is not a supported type", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+                // Only the invalid test matters here
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: [42] }
+                ]
+            });
+        }, /Error should be a string, object, or RegExp/u);
+    });
+
+    it("should throw an error when any of the errors is not a supported type", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+                // Only the invalid test matters here
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar; var baz = quux", errors: [{ type: "VariableDeclaration" }, null] }
+                ]
+            });
+        }, /Error should be a string, object, or RegExp/u);
+    });
+
+    it("should throw an error when the error is a string and it does not match error message", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+                // Only the invalid test matters here
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: ["Bad error message."] }
+                ]
+            });
+        }, assertErrorMatches("Bad var.", "Bad error message."));
+    });
+
+    it("should throw an error when the error is a string and it does not match error message", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+                valid: [
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: [/Bad error message/u] }
+                ]
+            });
+        }, /Expected 'Bad var.' to match \/Bad error message\//u);
+    });
+
+    it("should not throw an error when the error is a string and it matches error message", () => {
+        ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+
+            // Only the invalid test matters here
+            valid: [
+                "bar = baz;"
+            ],
+            invalid: [
+                { code: "var foo = bar;", output: " foo = bar;", errors: ["Bad var."] }
+            ]
+        });
+    });
+
+    it("should not throw an error when the error is a regex and it matches error message", () => {
+        ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+            valid: [],
+            invalid: [
+                { code: "var foo = bar;", output: " foo = bar;", errors: [/^Bad var/u] }
+            ]
+        });
+    });
+
+    it("should throw an error when the error is an object with an unknown property name", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: [{ Message: "Bad var." }] }
+                ]
+            });
+        }, /Invalid error property name 'Message'/u);
+    });
+
+    it("should throw an error when any of the errors is an object with an unknown property name", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    {
+                        code: "var foo = bar; var baz = quux",
+                        errors: [
+                            { message: "Bad var.", type: "VariableDeclaration" },
+                            { message: "Bad var.", typo: "VariableDeclaration" }
+                        ]
+                    }
+                ]
+            });
+        }, /Invalid error property name 'typo'/u);
+    });
+
+    it("should not throw an error when the error is a regex in an object and it matches error message", () => {
+        ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+            valid: [],
+            invalid: [
+                { code: "var foo = bar;", output: " foo = bar;", errors: [{ message: /^Bad var/u }] }
+            ]
+        });
+    });
+
+    it("should throw an error when the expected output doesn't match", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration" }] }
+                ]
+            });
+        }, /Output is incorrect/u);
+    });
+
+    it("should use strict equality to compare output", () => {
+        const replaceProgramWith5Rule = {
+            meta: {
+                fixable: "code"
+            },
+
+            create: context => ({
+                Program(node) {
+                    context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
+                }
+            })
+        };
+
+        // Should not throw.
+        ruleTester.run("foo", replaceProgramWith5Rule, {
+            valid: [],
+            invalid: [
+                { code: "var foo = bar;", output: "5", errors: 1 }
+            ]
+        });
+
+        assert.throws(() => {
+            ruleTester.run("foo", replaceProgramWith5Rule, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", output: 5, errors: 1 }
+                ]
+            });
+        }, /Output is incorrect/u);
+    });
+
+    it("should throw an error when the expected output doesn't match and errors is just a number", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", output: "foo = bar", errors: 1 }
+                ]
+            });
+        }, /Output is incorrect/u);
+    });
+
+    it("should not throw an error when the expected output is null and no errors produce output", () => {
+        ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+            valid: [
+                "bar = baz;"
+            ],
+            invalid: [
+                { code: "eval(x)", errors: 1, output: null },
+                { code: "eval(x); eval(y);", errors: 2, output: null }
+            ]
+        });
+    });
+
+    it("should throw an error when the expected output is null and problems produce output", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", output: null, errors: 1 }
+                ]
+            });
+        }, /Expected no autofixes to be suggested/u);
+
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    {
+                        code: "var foo = bar; var qux = boop;",
+                        output: null,
+                        errors: 2
+                    }
+                ]
+            });
+        }, /Expected no autofixes to be suggested/u);
+    });
+
+    it("should throw an error when the expected output is null and only some problems produce output", () => {
+        assert.throws(() => {
+            ruleTester.run("fixes-one-problem", require("../../fixtures/testers/rule-tester/fixes-one-problem"), {
+                valid: [],
+                invalid: [
+                    { code: "foo", output: null, errors: 2 }
+                ]
+            });
+        }, /Expected no autofixes to be suggested/u);
+    });
+
+    it("should throw an error when the expected output isn't specified and problems produce output", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", errors: 1 }
+                ]
+            });
+        }, "The rule fixed the code. Please add 'output' property.");
+    });
+
+    it("should throw an error if invalid code specifies wrong type", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression2" }] }
+                ]
+            });
+        }, /Error type should be CallExpression2, found CallExpression/u);
+    });
+
+    it("should throw an error if invalid code specifies wrong line", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression", line: 5 }] }
+                ]
+            });
+        }, /Error line should be 5/u);
+    });
+
+    it("should not skip line assertion if line is a falsy value", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "\neval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression", line: 0 }] }
+                ]
+            });
+        }, /Error line should be 0/u);
+    });
+
+    it("should throw an error if invalid code specifies wrong column", () => {
+        const wrongColumn = 10,
+            expectedErrorMessage = "Error column should be 1";
+
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: ["Eval(foo)"],
+                invalid: [{
+                    code: "eval(foo)",
+                    errors: [{
+                        message: "eval sucks.",
+                        column: wrongColumn
+                    }]
+                }]
+            });
+        }, expectedErrorMessage);
+    });
+
+    it("should throw error for empty error array", () => {
+        assert.throws(() => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: []
+                }]
+            });
+        }, /Invalid cases must have at least one error/u);
+    });
+
+    it("should throw error for errors : 0", () => {
+        assert.throws(() => {
+            ruleTester.run(
+                "suggestions-messageIds",
+                require("../../fixtures/testers/rule-tester/suggestions")
+                    .withMessageIds,
+                {
+                    valid: [],
+                    invalid: [
+                        {
+                            code: "var foo;",
+                            errors: 0
+                        }
+                    ]
+                }
+            );
+        }, /Invalid cases must have 'error' value greater than 0/u);
+    });
+
+    it("should not skip column assertion if column is a falsy value", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: ["Eval(foo)"],
+                invalid: [{
+                    code: "var foo; eval(foo)",
+                    errors: [{ message: "eval sucks.", column: 0 }]
+                }]
+            });
+        }, /Error column should be 0/u);
+    });
+
+    it("should throw an error if invalid code specifies wrong endLine", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration", endLine: 10 }] }
+                ]
+            });
+        }, "Error endLine should be 10");
+    });
+
+    it("should throw an error if invalid code specifies wrong endColumn", () => {
+        assert.throws(() => {
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "bar = baz;"
+                ],
+                invalid: [
+                    { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration", endColumn: 10 }] }
+                ]
+            });
+        }, "Error endColumn should be 10");
+    });
+
+    it("should throw an error if invalid code has the wrong number of errors", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    {
+                        code: "eval(foo)",
+                        errors: [
+                            { message: "eval sucks.", type: "CallExpression" },
+                            { message: "eval sucks.", type: "CallExpression" }
+                        ]
+                    }
+                ]
+            });
+        }, /Should have 2 errors but had 1/u);
+    });
+
+    it("should throw an error if invalid code does not have errors", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "eval(foo)" }
+                ]
+            });
+        }, /Did not specify errors for an invalid test of no-eval/u);
+    });
+
+    it("should throw an error if invalid code has the wrong explicit number of errors", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "Eval(foo)"
+                ],
+                invalid: [
+                    { code: "eval(foo)", errors: 2 }
+                ]
+            });
+        }, /Should have 2 errors but had 1/u);
+    });
+
+    it("should throw an error if there's a parsing error in a valid test", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "1eval('foo')"
+                ],
+                invalid: [
+                    { code: "eval('foo')", errors: [{}] }
+                ]
+            });
+        }, /fatal parsing error/iu);
+    });
+
+    it("should throw an error if there's a parsing error in an invalid test", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "noeval('foo')"
+                ],
+                invalid: [
+                    { code: "1eval('foo')", errors: [{}] }
+                ]
+            });
+        }, /fatal parsing error/iu);
+    });
+
+    it("should throw an error if there's a parsing error in an invalid test and errors is just a number", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    "noeval('foo')"
+                ],
+                invalid: [
+                    { code: "1eval('foo')", errors: 1 }
+                ]
+            });
+        }, /fatal parsing error/iu);
+    });
+
+    // https://github.com/eslint/eslint/issues/4779
+    it("should throw an error if there's a parsing error and output doesn't match", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [],
+                invalid: [
+                    { code: "eval(`foo`", output: "eval(`foo`);", errors: [{}] }
+                ]
+            });
+        }, /fatal parsing error/iu);
+    });
+
+    it("should not throw an error if invalid code has at least an expected empty error object", () => {
+        ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+            valid: ["Eval(foo)"],
+            invalid: [{
+                code: "eval(foo)",
+                errors: [{}]
+            }]
+        });
+    });
+
+    it("should pass-through the globals config of valid tests to the to rule", () => {
+        ruleTester.run("no-test-global", require("../../fixtures/testers/rule-tester/no-test-global"), {
+            valid: [
+                {
+                    code: "var test = 'foo'",
+                    languageOptions: {
+                        sourceType: "script"
+                    }
+                },
+                {
+                    code: "var test2 = 'bar'",
+                    languageOptions: {
+                        globals: { test: true }
+                    }
+                }
+            ],
+            invalid: [{ code: "bar", errors: 1 }]
+        });
+    });
+
+    it("should pass-through the globals config of invalid tests to the rule", () => {
+        ruleTester.run("no-test-global", require("../../fixtures/testers/rule-tester/no-test-global"), {
+            valid: [
+                {
+                    code: "var test = 'foo'",
+                    languageOptions: {
+                        sourceType: "script"
+                    }
+                }
+            ],
+            invalid: [
+                {
+                    code: "var test = 'foo'; var foo = 'bar'",
+                    languageOptions: {
+                        sourceType: "script"
+                    },
+                    errors: 1
+                },
+                {
+                    code: "var test = 'foo'",
+                    languageOptions: {
+                        sourceType: "script",
+                        globals: { foo: true }
+                    },
+                    errors: [{ message: "Global variable foo should not be used." }]
+                }
+            ]
+        });
+    });
+
+    it("should pass-through the settings config to rules", () => {
+        ruleTester.run("no-test-settings", require("../../fixtures/testers/rule-tester/no-test-settings"), {
+            valid: [
+                {
+                    code: "var test = 'bar'", settings: { test: 1 }
+                }
+            ],
+            invalid: [
+                {
+                    code: "var test = 'bar'", settings: { "no-test": 22 }, errors: 1
+                }
+            ]
+        });
+    });
+
+    it("should pass-through the filename to the rule", () => {
+        (function() {
+            ruleTester.run("", require("../../fixtures/testers/rule-tester/no-test-filename"), {
+                valid: [
+                    {
+                        code: "var foo = 'bar'",
+                        filename: "somefile.js"
+                    }
+                ],
+                invalid: [
+                    {
+                        code: "var foo = 'bar'",
+                        errors: [
+                            { message: "Filename test was not defined." }
+                        ]
+                    }
+                ]
+            });
+        }());
+    });
+
+    it("should pass-through the options to the rule", () => {
+        ruleTester.run("no-invalid-args", require("../../fixtures/testers/rule-tester/no-invalid-args"), {
+            valid: [
+                {
+                    code: "var foo = 'bar'",
+                    options: [false]
+                }
+            ],
+            invalid: [
+                {
+                    code: "var foo = 'bar'",
+                    options: [true],
+                    errors: [{ message: "Invalid args" }]
+                }
+            ]
+        });
+    });
+
+    it("should throw an error if the options are an object", () => {
+        assert.throws(() => {
+            ruleTester.run("no-invalid-args", require("../../fixtures/testers/rule-tester/no-invalid-args"), {
+                valid: [
+                    {
+                        code: "foo",
+                        options: { ok: true }
+                    }
+                ],
+                invalid: []
+            });
+        }, /options must be an array/u);
+    });
+
+    it("should throw an error if the options are a number", () => {
+        assert.throws(() => {
+            ruleTester.run("no-invalid-args", require("../../fixtures/testers/rule-tester/no-invalid-args"), {
+                valid: [
+                    {
+                        code: "foo",
+                        options: 0
+                    }
+                ],
+                invalid: []
+            });
+        }, /options must be an array/u);
+    });
+
+    describe("Parsers", () => {
+
+        it("should pass-through the parser to the rule", () => {
+            const spy = sinon.spy(ruleTester.linter, "verify");
+            const esprima = require("esprima");
+
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    {
+                        code: "Eval(foo)"
+                    }
+                ],
+                invalid: [
+                    {
+                        code: "eval(foo)",
+                        languageOptions: {
+                            parser: esprima
+                        },
+                        errors: [{ line: 1 }]
+                    }
+                ]
+            });
+
+            const configs = spy.args[1][1];
+            const config = configs.getConfig("test.js");
+
+            assert.strictEqual(
+                config.languageOptions.parser[Symbol.for("eslint.RuleTester.parser")],
+                esprima
+            );
+        });
+
+        it("should pass-through services from parseForESLint to the rule", () => {
+            const enhancedParser = require("../../fixtures/parsers/enhanced-parser");
+            const disallowHiRule = {
+                create: context => ({
+                    Literal(node) {
+                        const disallowed = context.parserServices.test.getMessage(); // returns "Hi!"
+
+                        if (node.value === disallowed) {
+                            context.report({ node, message: `Don't use '${disallowed}'` });
+                        }
+                    }
+                })
+            };
+
+            ruleTester.run("no-hi", disallowHiRule, {
+                valid: [
+                    {
+                        code: "'Hello!'",
+                        languageOptions: {
+                            parser: enhancedParser
+                        }
+                    }
+                ],
+                invalid: [
+                    {
+                        code: "'Hi!'",
+                        languageOptions: {
+                            parser: enhancedParser
+                        },
+                        errors: [{ message: "Don't use 'Hi!'" }]
+                    }
+                ]
+            });
+        });
+
+        it("should throw an error when the parser is not an object", () => {
+            assert.throws(() => {
+                ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        languageOptions: {
+                            parser: "esprima"
+                        },
+                        errors: 1
+                    }]
+                });
+            }, /Parser must be an object with a parse\(\) or parseForESLint\(\) method/u);
+
+        });
+
+    });
+
+
+    it("should prevent invalid options schemas", () => {
+        assert.throws(() => {
+            ruleTester.run("no-invalid-schema", require("../../fixtures/testers/rule-tester/no-invalid-schema"), {
+                valid: [
+                    "var answer = 6 * 7;",
+                    { code: "var answer = 6 * 7;", options: [] }
+                ],
+                invalid: [
+                    { code: "var answer = 6 * 7;", options: ["bar"], errors: [{ message: "Expected nothing." }] }
+                ]
+            });
+        }, "Schema for rule no-invalid-schema is invalid:,\titems: should be object\n\titems[0].enum: should NOT have fewer than 1 items\n\titems: should match some schema in anyOf");
+
+    });
+
+    it("should prevent schema violations in options", () => {
+        assert.throws(() => {
+            ruleTester.run("no-schema-violation", require("../../fixtures/testers/rule-tester/no-schema-violation"), {
+                valid: [
+                    "var answer = 6 * 7;",
+                    { code: "var answer = 6 * 7;", options: ["foo"] }
+                ],
+                invalid: [
+                    { code: "var answer = 6 * 7;", options: ["bar"], errors: [{ message: "Expected foo." }] }
+                ]
+            });
+        }, /Value "bar" should be equal to one of the allowed values./u);
+
+    });
+
+    it("should disallow invalid defaults in rules", () => {
+        const ruleWithInvalidDefaults = {
+            meta: {
+                schema: [
+                    {
+                        oneOf: [
+                            { enum: ["foo"] },
+                            {
+                                type: "object",
+                                properties: {
+                                    foo: {
+                                        enum: ["foo", "bar"],
+                                        default: "foo"
+                                    }
+                                },
+                                additionalProperties: false
+                            }
+                        ]
+                    }
+                ]
+            },
+            create: () => ({})
+        };
+
+        assert.throws(() => {
+            ruleTester.run("invalid-defaults", ruleWithInvalidDefaults, {
+                valid: [
+                    {
+                        code: "foo",
+                        options: [{}]
+                    }
+                ],
+                invalid: []
+            });
+        }, /Schema for rule invalid-defaults is invalid: default is ignored for: data1\.foo/u);
+    });
+
+    it("throw an error when an unknown config option is included", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    { code: "Eval(foo)", foo: "bar" }
+                ],
+                invalid: []
+            });
+        }, /ESLint configuration in rule-tester is invalid./u);
+    });
+
+    it("throw an error when env is included in config", () => {
+        assert.throws(() => {
+            ruleTester.run("no-eval", require("../../fixtures/testers/rule-tester/no-eval"), {
+                valid: [
+                    { code: "Eval(foo)", env: ["es6"] }
+                ],
+                invalid: []
+            });
+        }, /Unexpected key "env" found./u);
+    });
+
+    it("should pass-through the tester config to the rule", () => {
+        ruleTester = new FlatRuleTester({
+            languageOptions: {
+                globals: { test: true }
+            }
+        });
+
+        ruleTester.run("no-test-global", require("../../fixtures/testers/rule-tester/no-test-global"), {
+            valid: [
+                "var test = 'foo'",
+                "var test2 = test"
+            ],
+            invalid: [{ code: "bar", errors: 1, languageOptions: { globals: { foo: true } } }]
+        });
+    });
+
+    it("should throw an error if AST was modified", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast"), {
+                valid: [
+                    "var foo = 0;"
+                ],
+                invalid: []
+            });
+        }, "Rule should not modify AST.");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast"), {
+                valid: [],
+                invalid: [
+                    { code: "var bar = 0;", errors: ["error"] }
+                ]
+            });
+        }, "Rule should not modify AST.");
+    });
+
+    it("should throw an error node.start is accessed with custom parser", () => {
+        const enhancedParser = require("../../fixtures/parsers/enhanced-parser");
+
+        ruleTester = new FlatRuleTester({
+            languageOptions: {
+                parser: enhancedParser
+            }
+        });
+
+        /*
+         * Note: More robust test for start/end found later in file.
+         * This one is just for checking the custom config has a
+         * parser that is wrapped.
+         */
+        const usesStartEndRule = {
+            create() {
+
+                return {
+                    CallExpression(node) {
+                        noop(node.arguments[1].start);
+                    }
+                };
+            }
+        };
+
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: ["foo(a, b)"],
+                invalid: []
+            });
+        }, "Use node.range[0] instead of node.start");
+    });
+
+    it("should throw an error if AST was modified (at Program)", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-first"), {
+                valid: [
+                    "var foo = 0;"
+                ],
+                invalid: []
+            });
+        }, "Rule should not modify AST.");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-first"), {
+                valid: [],
+                invalid: [
+                    { code: "var bar = 0;", errors: ["error"] }
+                ]
+            });
+        }, "Rule should not modify AST.");
+    });
+
+    it("should throw an error if AST was modified (at Program:exit)", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), {
+                valid: [
+                    "var foo = 0;"
+                ],
+                invalid: []
+            });
+        }, "Rule should not modify AST.");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), {
+                valid: [],
+                invalid: [
+                    { code: "var bar = 0;", errors: ["error"] }
+                ]
+            });
+        }, "Rule should not modify AST.");
+    });
+
+    it("should throw an error if rule uses start and end properties on nodes, tokens or comments", () => {
+        const usesStartEndRule = {
+            create(context) {
+
+                const sourceCode = context.getSourceCode();
+
+                return {
+                    CallExpression(node) {
+                        noop(node.arguments[1].start);
+                    },
+                    "BinaryExpression[operator='+']"(node) {
+                        noop(node.end);
+                    },
+                    "UnaryExpression[operator='-']"(node) {
+                        noop(sourceCode.getFirstToken(node).start);
+                    },
+                    ConditionalExpression(node) {
+                        noop(sourceCode.getFirstToken(node).end);
+                    },
+                    BlockStatement(node) {
+                        noop(sourceCode.getCommentsInside(node)[0].start);
+                    },
+                    ObjectExpression(node) {
+                        noop(sourceCode.getCommentsInside(node)[0].end);
+                    },
+                    Decorator(node) {
+                        noop(node.start);
+                    }
+                };
+            }
+        };
+
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: ["foo(a, b)"],
+                invalid: []
+            });
+        }, "Use node.range[0] instead of node.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var a = b * (c + d) / e;", errors: 1 }]
+            });
+        }, "Use node.range[1] instead of node.end");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var a = -b * c;", errors: 1 }]
+            });
+        }, "Use token.range[0] instead of token.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: ["var a = b ? c : d;"],
+                invalid: []
+            });
+        }, "Use token.range[1] instead of token.end");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: ["function f() { /* comment */ }"],
+                invalid: []
+            });
+        }, "Use token.range[0] instead of token.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var x = //\n {\n //comment\n //\n}", errors: 1 }]
+            });
+        }, "Use token.range[1] instead of token.end");
+
+        const enhancedParser = require("../../fixtures/parsers/enhanced-parser");
+
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [{ code: "foo(a, b)", languageOptions: { parser: enhancedParser } }],
+                invalid: []
+            });
+        }, "Use node.range[0] instead of node.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var a = b * (c + d) / e;", languageOptions: { parser: enhancedParser }, errors: 1 }]
+            });
+        }, "Use node.range[1] instead of node.end");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var a = -b * c;", languageOptions: { parser: enhancedParser }, errors: 1 }]
+            });
+        }, "Use token.range[0] instead of token.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [{ code: "var a = b ? c : d;", languageOptions: { parser: enhancedParser } }],
+                invalid: []
+            });
+        }, "Use token.range[1] instead of token.end");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [{ code: "function f() { /* comment */ }", languageOptions: { parser: enhancedParser } }],
+                invalid: []
+            });
+        }, "Use token.range[0] instead of token.start");
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [],
+                invalid: [{ code: "var x = //\n {\n //comment\n //\n}", languageOptions: { parser: enhancedParser }, errors: 1 }]
+            });
+        }, "Use token.range[1] instead of token.end");
+
+        assert.throws(() => {
+            ruleTester.run("uses-start-end", usesStartEndRule, {
+                valid: [{ code: "@foo class A {}", languageOptions: { parser: require("../../fixtures/parsers/enhanced-parser2") } }],
+                invalid: []
+            });
+        }, "Use node.range[0] instead of node.start");
+    });
+
+    it("should throw an error if no test scenarios given", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"));
+        }, "Test Scenarios for rule foo : Could not find test scenario object");
+    });
+
+    it("should throw an error if no acceptable test scenario object is given", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), []);
+        }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios\nCould not find any invalid test scenarios");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), "");
+        }, "Test Scenarios for rule foo : Could not find test scenario object");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), 2);
+        }, "Test Scenarios for rule foo : Could not find test scenario object");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), {});
+        }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios\nCould not find any invalid test scenarios");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), {
+                valid: []
+            });
+        }, "Test Scenarios for rule foo is invalid:\nCould not find any invalid test scenarios");
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/modify-ast-at-last"), {
+                invalid: []
+            });
+        }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios");
+    });
+
+    // Nominal message/messageId use cases
+    it("should assert match if message provided in both test and result.", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMessageOnly, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ message: "something" }] }]
+            });
+        }, /Avoid using variables named/u);
+
+        ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMessageOnly, {
+            valid: [],
+            invalid: [{ code: "foo", errors: [{ message: "Avoid using variables named 'foo'." }] }]
+        });
+    });
+
+    it("should assert match between messageId if provided in both test and result.", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ messageId: "unused" }] }]
+            });
+        }, "messageId 'avoidFoo' does not match expected messageId 'unused'.");
+
+        ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+            valid: [],
+            invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }]
+        });
+    });
+    it("should assert match between resulting message output if messageId and data provided in both test and result", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo", data: { name: "notFoo" } }] }]
+            });
+        }, "Hydrated message \"Avoid using variables named 'notFoo'.\" does not match \"Avoid using variables named 'foo'.\"");
+    });
+
+    // messageId/message misconfiguration cases
+    it("should throw if user tests for both message and messageId", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ message: "something", messageId: "avoidFoo" }] }]
+            });
+        }, "Error should not specify both 'message' and a 'messageId'.");
+    });
+    it("should throw if user tests for messageId but the rule doesn't use the messageId meta syntax.", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMessageOnly, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }]
+            });
+        }, "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'");
+    });
+    it("should throw if user tests for messageId not listed in the rule's meta syntax.", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ messageId: "useFoo" }] }]
+            });
+        }, /Invalid messageId 'useFoo'/u);
+    });
+    it("should throw if data provided without messageId.", () => {
+        assert.throws(() => {
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/messageId").withMetaWithData, {
+                valid: [],
+                invalid: [{ code: "foo", errors: [{ data: "something" }] }]
+            });
+        }, "Error must specify 'messageId' if 'data' is used.");
+    });
+
+    // fixable rules with or without `meta` property
+    it("should not throw an error if a rule that has `meta.fixable` produces fixes", () => {
+        const replaceProgramWith5Rule = {
+            meta: {
+                fixable: "code"
+            },
+            create(context) {
+                return {
+                    Program(node) {
+                        context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
+                    }
+                };
+            }
+        };
+
+        ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
+            valid: [],
+            invalid: [
+                { code: "var foo = bar;", output: "5", errors: 1 }
+            ]
+        });
+    });
+    it("should throw an error if a new-format rule that doesn't have `meta` produces fixes", () => {
+        const replaceProgramWith5Rule = {
+            create(context) {
+                return {
+                    Program(node) {
+                        context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
+                    }
+                };
+            }
+        };
+
+        assert.throws(() => {
+            ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", output: "5", errors: 1 }
+                ]
+            });
+        }, /Fixable rules must set the `meta\.fixable` property/u);
+    });
+    it("should throw an error if a legacy-format rule produces fixes", () => {
+
+        /**
+         * Legacy-format rule (a function instead of an object with `create` method).
+         * @param {RuleContext} context The ESLint rule context object.
+         * @returns {Object} Listeners.
+         */
+        function replaceProgramWith5Rule(context) {
+            return {
+                Program(node) {
+                    context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
+                }
+            };
+        }
+
+        assert.throws(() => {
+            ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", output: "5", errors: 1 }
+                ]
+            });
+        }, /Fixable rules must set the `meta\.fixable` property/u);
+    });
+
+    describe("suggestions", () => {
+        it("should pass with valid suggestions (tested using desc)", () => {
+            ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                valid: [
+                    "var boo;"
+                ],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            desc: "Rename identifier 'foo' to 'bar'",
+                            output: "var bar;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+        it("should pass with suggestions on multiple lines", () => {
+            ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                valid: [],
+                invalid: [
+                    {
+                        code: "function foo() {\n  var foo = 1;\n}",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                output: "function bar() {\n  var foo = 1;\n}"
+                            }]
+                        }, {
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                output: "function foo() {\n  var bar = 1;\n}"
+                            }]
+                        }]
+                    }
+                ]
+            });
+        });
+
+        it("should pass with valid suggestions (tested using messageIds)", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            messageId: "renameFoo",
+                            output: "var bar;"
+                        }, {
+                            messageId: "renameFoo",
+                            output: "var baz;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+        it("should pass with valid suggestions (one tested using messageIds, the other using desc)", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            messageId: "renameFoo",
+                            output: "var bar;"
+                        }, {
+                            desc: "Rename identifier 'foo' to 'baz'",
+                            output: "var baz;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+        it("should pass with valid suggestions (tested using both desc and messageIds for the same suggestion)", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            desc: "Rename identifier 'foo' to 'bar'",
+                            messageId: "renameFoo",
+                            output: "var bar;"
+                        }, {
+                            desc: "Rename identifier 'foo' to 'baz'",
+                            messageId: "renameFoo",
+                            output: "var baz;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+        it("should pass with valid suggestions (tested using only desc on a rule that utilizes meta.messages)", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            desc: "Rename identifier 'foo' to 'bar'",
+                            output: "var bar;"
+                        }, {
+                            desc: "Rename identifier 'foo' to 'baz'",
+                            output: "var baz;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+        it("should pass with valid suggestions (tested using messageIds and data)", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{
+                            messageId: "renameFoo",
+                            data: { newName: "bar" },
+                            output: "var bar;"
+                        }, {
+                            messageId: "renameFoo",
+                            data: { newName: "baz" },
+                            output: "var baz;"
+                        }]
+                    }]
+                }]
+            });
+        });
+
+
+        it("should pass when tested using empty suggestion test objects if the array length is correct", () => {
+            ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                valid: [],
+                invalid: [{
+                    code: "var foo;",
+                    errors: [{
+                        suggestions: [{}, {}]
+                    }]
+                }]
+            });
+        });
+
+        it("should support explicitly expecting no suggestions", () => {
+            [void 0, null, false, []].forEach(suggestions => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/no-eval"), {
+                    valid: [],
+                    invalid: [{
+                        code: "eval('var foo');",
+                        errors: [{
+                            suggestions
+                        }]
+                    }]
+                });
+            });
+        });
+
+        it("should fail when expecting no suggestions and there are suggestions", () => {
+            [void 0, null, false, []].forEach(suggestions => {
+                assert.throws(() => {
+                    ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                        valid: [],
+                        invalid: [{
+                            code: "var foo;",
+                            errors: [{
+                                suggestions
+                            }]
+                        }]
+                    });
+                }, "Error should have no suggestions on error with message: \"Avoid using identifiers named 'foo'.\"");
+            });
+        });
+
+        it("should fail when testing for suggestions that don't exist", () => {
+            assert.throws(() => {
+                ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "this-does-not-exist"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error should have an array of suggestions. Instead received \"undefined\" on error with message: \"Bad var.\"");
+        });
+
+        it("should fail when there are a different number of suggestions", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                output: "var bar;"
+                            }, {
+                                desc: "Rename identifier 'foo' to 'baz'",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error should have 2 suggestions. Instead found 1 suggestions");
+        });
+
+        it("should throw if the suggestion description doesn't match", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "not right",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 0 : desc should be \"not right\" but got \"Rename identifier 'foo' to 'bar'\" instead.");
+        });
+
+        it("should throw if the suggestion description doesn't match (although messageIds match)", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                messageId: "renameFoo",
+                                output: "var bar;"
+                            }, {
+                                desc: "Rename id 'foo' to 'baz'",
+                                messageId: "renameFoo",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 1 : desc should be \"Rename id 'foo' to 'baz'\" but got \"Rename identifier 'foo' to 'baz'\" instead.");
+        });
+
+        it("should throw if the suggestion messageId doesn't match", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "unused",
+                                output: "var bar;"
+                            }, {
+                                messageId: "renameFoo",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 0 : messageId should be 'unused' but got 'renameFoo' instead.");
+        });
+
+        it("should throw if the suggestion messageId doesn't match (although descriptions match)", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                messageId: "renameFoo",
+                                output: "var bar;"
+                            }, {
+                                desc: "Rename identifier 'foo' to 'baz'",
+                                messageId: "avoidFoo",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 1 : messageId should be 'avoidFoo' but got 'renameFoo' instead.");
+        });
+
+        it("should throw if test specifies messageId for a rule that doesn't have meta.messages", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                output: "var bar;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 0 : Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.");
+        });
+
+        it("should throw if test specifies messageId that doesn't exist in the rule's meta.messages", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                output: "var bar;"
+                            }, {
+                                messageId: "removeFoo",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 1 : Test has invalid messageId 'removeFoo', the rule under test allows only one of ['avoidFoo', 'unused', 'renameFoo'].");
+        });
+
+        it("should throw if hydrated desc doesn't match (wrong data value)", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                data: { newName: "car" },
+                                output: "var bar;"
+                            }, {
+                                messageId: "renameFoo",
+                                data: { newName: "baz" },
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 0 : Hydrated test desc \"Rename identifier 'foo' to 'car'\" does not match received desc \"Rename identifier 'foo' to 'bar'\".");
+        });
+
+        it("should throw if hydrated desc doesn't match (wrong data key)", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                data: { newName: "bar" },
+                                output: "var bar;"
+                            }, {
+                                messageId: "renameFoo",
+                                data: { name: "baz" },
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 1 : Hydrated test desc \"Rename identifier 'foo' to '{{ newName }}'\" does not match received desc \"Rename identifier 'foo' to 'baz'\".");
+        });
+
+        it("should throw if test specifies both desc and data", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                messageId: "renameFoo",
+                                data: { newName: "bar" },
+                                output: "var bar;"
+                            }, {
+                                messageId: "renameFoo",
+                                data: { newName: "baz" },
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 0 : Test should not specify both 'desc' and 'data'.");
+        });
+
+        it("should throw if test uses data but doesn't specify messageId", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                data: { newName: "bar" },
+                                output: "var bar;"
+                            }, {
+                                data: { newName: "baz" },
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Error Suggestion at index 1 : Test must specify 'messageId' if 'data' is used.");
+        });
+
+        it("should throw if the resulting suggestion output doesn't match", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                desc: "Rename identifier 'foo' to 'bar'",
+                                output: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, "Expected the applied suggestion fix to match the test suggestion output");
+        });
+
+        it("should fail when specified suggestion isn't an object", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [null]
+                        }]
+                    }]
+                });
+            }, "Test suggestion in 'suggestions' array must be an object.");
+
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [
+                                {
+                                    messageId: "renameFoo",
+                                    output: "var bar;"
+                                },
+                                "Rename identifier 'foo' to 'baz'"
+                            ]
+                        }]
+                    }]
+                });
+            }, "Test suggestion in 'suggestions' array must be an object.");
+        });
+
+        it("should fail when the suggestion is an object with an unknown property name", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
+                    valid: [
+                        "var boo;"
+                    ],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                message: "Rename identifier 'foo' to 'bar'"
+                            }]
+                        }]
+                    }]
+                });
+            }, /Invalid suggestion property name 'message'/u);
+        });
+
+        it("should fail when any of the suggestions is an object with an unknown property name", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMessageIds, {
+                    valid: [],
+                    invalid: [{
+                        code: "var foo;",
+                        errors: [{
+                            suggestions: [{
+                                messageId: "renameFoo",
+                                output: "var bar;"
+                            }, {
+                                messageId: "renameFoo",
+                                outpt: "var baz;"
+                            }]
+                        }]
+                    }]
+                });
+            }, /Invalid suggestion property name 'outpt'/u);
+        });
+
+        it("should throw an error if a rule that doesn't have `meta.hasSuggestions` enabled produces suggestions", () => {
+            assert.throws(() => {
+                ruleTester.run("suggestions-missing-hasSuggestions-property", require("../../fixtures/testers/rule-tester/suggestions").withoutHasSuggestionsProperty, {
+                    valid: [],
+                    invalid: [
+                        { code: "var foo = bar;", output: "5", errors: 1 }
+                    ]
+                });
+            }, "Rules with suggestions must set the `meta.hasSuggestions` property to `true`.");
+        });
+    });
+
+    /**
+     * Asserts that a particular value will be emitted from an EventEmitter.
+     * @param {EventEmitter} emitter The emitter that should emit a value
+     * @param {string} emitType The type of emission to listen for
+     * @param {any} expectedValue The value that should be emitted
+     * @returns {Promise<void>} A Promise that fulfills if the value is emitted, and rejects if something else is emitted.
+     * The Promise will be indefinitely pending if no value is emitted.
+     */
+    function assertEmitted(emitter, emitType, expectedValue) {
+        return new Promise((resolve, reject) => {
+            emitter.once(emitType, emittedValue => {
+                if (emittedValue === expectedValue) {
+                    resolve();
+                } else {
+                    reject(new Error(`Expected ${expectedValue} to be emitted but ${emittedValue} was emitted instead.`));
+                }
+            });
+        });
+    }
+
+    describe("naming test cases", () => {
+
+        it("should use the first argument as the name of the test suite", () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "describe", "this-is-a-rule-name");
+
+            ruleTester.run("this-is-a-rule-name", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: []
+            });
+
+            return assertion;
+        });
+
+        it("should use the test code as the name of the tests for valid code (string form)", () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "valid(code);");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "valid(code);"
+                ],
+                invalid: []
+            });
+
+            return assertion;
+        });
+
+        it("should use the test code as the name of the tests for valid code (object form)", () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "valid(code);");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    {
+                        code: "valid(code);"
+                    }
+                ],
+                invalid: []
+            });
+
+            return assertion;
+        });
+
+        it("should use the test code as the name of the tests for invalid code", () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "var x = invalid(code);");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        code: "var x = invalid(code);",
+                        output: " x = invalid(code);",
+                        errors: 1
+                    }
+                ]
+            });
+
+            return assertion;
+        });
+
+        // https://github.com/eslint/eslint/issues/8142
+        it("should use the empty string as the name of the test if the test case is an empty string", () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    {
+                        code: ""
+                    }
+                ],
+                invalid: []
+            });
+
+            return assertion;
+        });
+
+        it('should use the "name" property if set to a non-empty string', () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "my test");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        name: "my test",
+                        code: "var x = invalid(code);",
+                        output: " x = invalid(code);",
+                        errors: 1
+                    }
+                ]
+            });
+
+            return assertion;
+        });
+
+        it('should use the "name" property if set to a non-empty string for valid cases too', () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "my test");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    {
+                        name: "my test",
+                        code: "valid(code);"
+                    }
+                ],
+                invalid: []
+            });
+
+            return assertion;
+        });
+
+
+        it('should use the test code as the name if the "name" property is set to an empty string', () => {
+            const assertion = assertEmitted(ruleTesterTestEmitter, "it", "var x = invalid(code);");
+
+            ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        name: "",
+                        code: "var x = invalid(code);",
+                        output: " x = invalid(code);",
+                        errors: 1
+                    }
+                ]
+            });
+
+            return assertion;
+        });
+
+        it('should throw if "name" property is not a string', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ code: "foo", name: 123 }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Optional test case property 'name' must be a string/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ code: "foo", name: 123 }]
+                });
+            }, /Optional test case property 'name' must be a string/u);
+        });
+
+        it('should throw if "code" property is not a string', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ code: 123 }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [123],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ code: 123 }]
+                });
+            }, /Test case must specify a string value for 'code'/u);
+        });
+
+        it('should throw if "code" property is missing', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ }]
+                });
+            }, /Test case must specify a string value for 'code'/u);
+        });
+    });
+
+    // https://github.com/eslint/eslint/issues/11615
+    it("should fail the case if autofix made a syntax error.", () => {
+        assert.throw(() => {
+            ruleTester.run(
+                "foo",
+                {
+                    meta: {
+                        fixable: "code"
+                    },
+                    create(context) {
+                        return {
+                            Identifier(node) {
+                                context.report({
+                                    node,
+                                    message: "make a syntax error",
+                                    fix(fixer) {
+                                        return fixer.replaceText(node, "one two");
+                                    }
+                                });
+                            }
+                        };
+                    }
+                },
+                {
+                    valid: ["one()"],
+                    invalid: []
+                }
+            );
+        }, /A fatal parsing error occurred in autofix.\nError: .+\nAutofix output:\n.+/u);
+    });
+
+    describe("sanitize test cases", () => {
+        let originalRuleTesterIt;
+        let spyRuleTesterIt;
+
+        before(() => {
+            originalRuleTesterIt = FlatRuleTester.it;
+            spyRuleTesterIt = sinon.spy();
+            FlatRuleTester.it = spyRuleTesterIt;
+        });
+        after(() => {
+            FlatRuleTester.it = originalRuleTesterIt;
+        });
+        beforeEach(() => {
+            spyRuleTesterIt.resetHistory();
+            ruleTester = new FlatRuleTester();
+        });
+        it("should present newline when using back-tick as new line", () => {
+            const code = `
+            var foo = bar;`;
+
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        code,
+                        errors: [/^Bad var/u]
+                    }
+                ]
+            });
+            sinon.assert.calledWith(spyRuleTesterIt, code);
+        });
+        it("should present \\u0000 as a string", () => {
+            const code = "\u0000";
+
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        code,
+                        errors: [/^Bad var/u]
+                    }
+                ]
+            });
+            sinon.assert.calledWith(spyRuleTesterIt, "\\u0000");
+        });
+        it("should present the pipe character correctly", () => {
+            const code = "var foo = bar || baz;";
+
+            ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [],
+                invalid: [
+                    {
+                        code,
+                        errors: [/^Bad var/u]
+                    }
+                ]
+            });
+            sinon.assert.calledWith(spyRuleTesterIt, code);
+        });
+
+    });
+
+    describe("SourceCode#getComments()", () => {
+        const useGetCommentsRule = {
+            create: context => ({
+                Program(node) {
+                    const sourceCode = context.getSourceCode();
+
+                    sourceCode.getComments(node);
+                }
+            })
+        };
+
+        it("should throw if called from a valid test case", () => {
+            assert.throws(() => {
+                ruleTester.run("use-get-comments", useGetCommentsRule, {
+                    valid: [""],
+                    invalid: []
+                });
+            }, /`SourceCode#getComments\(\)` is deprecated/u);
+        });
+
+        it("should throw if called from an invalid test case", () => {
+            assert.throws(() => {
+                ruleTester.run("use-get-comments", useGetCommentsRule, {
+                    valid: [],
+                    invalid: [{
+                        code: "",
+                        errors: [{}]
+                    }]
+                });
+            }, /`SourceCode#getComments\(\)` is deprecated/u);
+        });
+    });
+
+    describe("Subclassing", () => {
+        it("should allow subclasses to set the describe/it/itOnly statics and should correctly use those values", () => {
+            const assertionDescribe = assertEmitted(ruleTesterTestEmitter, "custom describe", "this-is-a-rule-name");
+            const assertionIt = assertEmitted(ruleTesterTestEmitter, "custom it", "valid(code);");
+            const assertionItOnly = assertEmitted(ruleTesterTestEmitter, "custom itOnly", "validOnly(code);");
+
+            /**
+             * Subclass for testing
+             */
+            class RuleTesterSubclass extends FlatRuleTester { }
+            RuleTesterSubclass.describe = function(text, method) {
+                ruleTesterTestEmitter.emit("custom describe", text, method);
+                return method.call(this);
+            };
+            RuleTesterSubclass.it = function(text, method) {
+                ruleTesterTestEmitter.emit("custom it", text, method);
+                return method.call(this);
+            };
+            RuleTesterSubclass.itOnly = function(text, method) {
+                ruleTesterTestEmitter.emit("custom itOnly", text, method);
+                return method.call(this);
+            };
+
+            const ruleTesterSubclass = new RuleTesterSubclass();
+
+            ruleTesterSubclass.run("this-is-a-rule-name", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "valid(code);",
+                    {
+                        code: "validOnly(code);",
+                        only: true
+                    }
+                ],
+                invalid: []
+            });
+
+            return Promise.all([
+                assertionDescribe,
+                assertionIt,
+                assertionItOnly
+            ]);
+        });
+
+    });
+
+});
index 5018a037b09f6da0144c067c979930a22fe49332..0e35258750c6fbdc74b17ad7fe8d3f6fa709351e 100644 (file)
@@ -1220,8 +1220,8 @@ describe("RuleTester", () => {
                     },
                     {
                         code: "",
-                        errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }],
-                        parserOptions: {}
+                        parserOptions: {},
+                        errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }]
                     }
                 ]
             });
@@ -1236,8 +1236,8 @@ describe("RuleTester", () => {
                 },
                 {
                     code: "",
-                    errors: [{ messageId: "ecmaVersionMessage", data: { type: "string", ecmaVersion: "latest" } }],
-                    parserOptions: { ecmaVersion: "latest" }
+                    parserOptions: { ecmaVersion: "latest" },
+                    errors: [{ messageId: "ecmaVersionMessage", data: { type: "string", ecmaVersion: "latest" } }]
                 }
             ]
         });
@@ -1710,73 +1710,6 @@ describe("RuleTester", () => {
         }, "Error must specify 'messageId' if 'data' is used.");
     });
 
-    // fixable rules with or without `meta` property
-    it("should not throw an error if a rule that has `meta.fixable` produces fixes", () => {
-        const replaceProgramWith5Rule = {
-            meta: {
-                fixable: "code"
-            },
-            create(context) {
-                return {
-                    Program(node) {
-                        context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
-                    }
-                };
-            }
-        };
-
-        ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
-            valid: [],
-            invalid: [
-                { code: "var foo = bar;", output: "5", errors: 1 }
-            ]
-        });
-    });
-    it("should throw an error if a new-format rule that doesn't have `meta` produces fixes", () => {
-        const replaceProgramWith5Rule = {
-            create(context) {
-                return {
-                    Program(node) {
-                        context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
-                    }
-                };
-            }
-        };
-
-        assert.throws(() => {
-            ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
-                valid: [],
-                invalid: [
-                    { code: "var foo = bar;", output: "5", errors: 1 }
-                ]
-            });
-        }, /Fixable rules must set the `meta\.fixable` property/u);
-    });
-    it("should throw an error if a legacy-format rule produces fixes", () => {
-
-        /**
-         * Legacy-format rule (a function instead of an object with `create` method).
-         * @param {RuleContext} context The ESLint rule context object.
-         * @returns {Object} Listeners.
-         */
-        function replaceProgramWith5Rule(context) {
-            return {
-                Program(node) {
-                    context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") });
-                }
-            };
-        }
-
-        assert.throws(() => {
-            ruleTester.run("replaceProgramWith5", replaceProgramWith5Rule, {
-                valid: [],
-                invalid: [
-                    { code: "var foo = bar;", output: "5", errors: 1 }
-                ]
-            });
-        }, /Fixable rules must set the `meta\.fixable` property/u);
-    });
-
     describe("suggestions", () => {
         it("should pass with valid suggestions (tested using desc)", () => {
             ruleTester.run("suggestions-basic", require("../../fixtures/testers/rule-tester/suggestions").basic, {
@@ -2295,27 +2228,286 @@ describe("RuleTester", () => {
         });
     });
 
-    describe("naming test cases", () => {
+    describe("deprecations", () => {
+        let processStub;
+        const ruleWithNoSchema = {
+            meta: {
+                type: "suggestion"
+            },
+            create(context) {
+                return {
+                    Program(node) {
+                        context.report({ node, message: "bad" });
+                    }
+                };
+            }
+        };
+        const ruleWithNoMeta = {
+            create(context) {
+                return {
+                    Program(node) {
+                        context.report({ node, message: "bad" });
+                    }
+                };
+            }
+        };
 
-        /**
-         * Asserts that a particular value will be emitted from an EventEmitter.
-         * @param {EventEmitter} emitter The emitter that should emit a value
-         * @param {string} emitType The type of emission to listen for
-         * @param {any} expectedValue The value that should be emitted
-         * @returns {Promise<void>} A Promise that fulfills if the value is emitted, and rejects if something else is emitted.
-         * The Promise will be indefinitely pending if no value is emitted.
-         */
-        function assertEmitted(emitter, emitType, expectedValue) {
-            return new Promise((resolve, reject) => {
-                emitter.once(emitType, emittedValue => {
-                    if (emittedValue === expectedValue) {
-                        resolve();
-                    } else {
-                        reject(new Error(`Expected ${expectedValue} to be emitted but ${emittedValue} was emitted instead.`));
+        beforeEach(() => {
+            processStub = sinon.stub(process, "emitWarning");
+        });
+
+        afterEach(() => {
+            processStub.restore();
+        });
+
+        it("should log a deprecation warning when using the legacy function-style API for rule", () => {
+
+            /**
+             * Legacy-format rule (a function instead of an object with `create` method).
+             * @param {RuleContext} context The ESLint rule context object.
+             * @returns {Object} Listeners.
+             */
+            function functionStyleRule(context) {
+                return {
+                    Program(node) {
+                        context.report({ node, message: "bad" });
                     }
-                });
+                };
+            }
+
+            ruleTester.run("function-style-rule", functionStyleRule, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", errors: 1 }
+                ]
             });
-        }
+
+            assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once");
+            assert.deepStrictEqual(
+                processStub.getCall(0).args,
+                [
+                    "\"function-style-rule\" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/developer-guide/working-with-rules",
+                    "DeprecationWarning"
+                ]
+            );
+        });
+
+        it("should log a deprecation warning when meta is not defined for the rule", () => {
+            ruleTester.run("rule-with-no-meta-1", ruleWithNoMeta, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [{ foo: true }], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once");
+            assert.deepStrictEqual(
+                processStub.getCall(0).args,
+                [
+                    "\"rule-with-no-meta-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas",
+                    "DeprecationWarning"
+                ]
+            );
+        });
+
+        it("should log a deprecation warning when schema is not defined for the rule", () => {
+            ruleTester.run("rule-with-no-schema-1", ruleWithNoSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [{ foo: true }], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once");
+            assert.deepStrictEqual(
+                processStub.getCall(0).args,
+                [
+                    "\"rule-with-no-schema-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas",
+                    "DeprecationWarning"
+                ]
+            );
+        });
+
+        it("should log a deprecation warning when schema is `undefined`", () => {
+            const ruleWithUndefinedSchema = {
+                meta: {
+                    type: "problem",
+                    // eslint-disable-next-line no-undefined -- intentioally added for test case
+                    schema: undefined
+                },
+                create(context) {
+                    return {
+                        Program(node) {
+                            context.report({ node, message: "bad" });
+                        }
+                    };
+                }
+            };
+
+            ruleTester.run("rule-with-undefined-schema", ruleWithUndefinedSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [{ foo: true }], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once");
+            assert.deepStrictEqual(
+                processStub.getCall(0).args,
+                [
+                    "\"rule-with-undefined-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas",
+                    "DeprecationWarning"
+                ]
+            );
+        });
+
+        it("should log a deprecation warning when schema is `null`", () => {
+            const ruleWithNullSchema = {
+                meta: {
+                    type: "problem",
+                    schema: null
+                },
+                create(context) {
+                    return {
+                        Program(node) {
+                            context.report({ node, message: "bad" });
+                        }
+                    };
+                }
+            };
+
+            ruleTester.run("rule-with-null-schema", ruleWithNullSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [{ foo: true }], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once");
+            assert.deepStrictEqual(
+                processStub.getCall(0).args,
+                [
+                    "\"rule-with-null-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas",
+                    "DeprecationWarning"
+                ]
+            );
+        });
+
+        it("should not log a deprecation warning when schema is an empty array", () => {
+            const ruleWithEmptySchema = {
+                meta: {
+                    type: "suggestion",
+                    schema: []
+                },
+                create(context) {
+                    return {
+                        Program(node) {
+                            context.report({ node, message: "bad" });
+                        }
+                    };
+                }
+            };
+
+            ruleTester.run("rule-with-no-options", ruleWithEmptySchema, {
+                valid: [],
+                invalid: [{ code: "var foo = bar;", errors: 1 }]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+
+        it("When the rule is an object-style rule, the legacy rule API warning is not emitted", () => {
+            ruleTester.run("rule-with-no-schema-2", ruleWithNoSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+
+        it("When the rule has meta.schema and there are test cases with options, the missing schema warning is not emitted", () => {
+            const ruleWithSchema = {
+                meta: {
+                    type: "suggestion",
+                    schema: [{
+                        type: "boolean"
+                    }]
+                },
+                create(context) {
+                    return {
+                        Program(node) {
+                            context.report({ node, message: "bad" });
+                        }
+                    };
+                }
+            };
+
+            ruleTester.run("rule-with-schema", ruleWithSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [true], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+
+        it("When the rule does not have meta, but there are no test cases with options, the missing schema warning is not emitted", () => {
+            ruleTester.run("rule-with-no-meta-2", ruleWithNoMeta, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+
+        it("When the rule has meta without meta.schema, but there are no test cases with options, the missing schema warning is not emitted", () => {
+            ruleTester.run("rule-with-no-schema-3", ruleWithNoSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+        it("When the rule has meta without meta.schema, and some test cases have options property but it's an empty array, the missing schema warning is not emitted", () => {
+            ruleTester.run("rule-with-no-schema-4", ruleWithNoSchema, {
+                valid: [],
+                invalid: [
+                    { code: "var foo = bar;", options: [], errors: 1 }
+                ]
+            });
+
+            assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`");
+        });
+    });
+
+    /**
+     * Asserts that a particular value will be emitted from an EventEmitter.
+     * @param {EventEmitter} emitter The emitter that should emit a value
+     * @param {string} emitType The type of emission to listen for
+     * @param {any} expectedValue The value that should be emitted
+     * @returns {Promise<void>} A Promise that fulfills if the value is emitted, and rejects if something else is emitted.
+     * The Promise will be indefinitely pending if no value is emitted.
+     */
+    function assertEmitted(emitter, emitType, expectedValue) {
+        return new Promise((resolve, reject) => {
+            emitter.once(emitType, emittedValue => {
+                if (emittedValue === expectedValue) {
+                    resolve();
+                } else {
+                    reject(new Error(`Expected ${expectedValue} to be emitted but ${emittedValue} was emitted instead.`));
+                }
+            });
+        });
+    }
+
+    describe("naming test cases", () => {
 
         it("should use the first argument as the name of the test suite", () => {
             const assertion = assertEmitted(ruleTesterTestEmitter, "describe", "this-is-a-rule-name");
@@ -2441,6 +2633,65 @@ describe("RuleTester", () => {
 
             return assertion;
         });
+
+        it('should throw if "name" property is not a string', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ code: "foo", name: 123 }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Optional test case property 'name' must be a string/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ code: "foo", name: 123 }]
+                });
+            }, /Optional test case property 'name' must be a string/u);
+        });
+
+        it('should throw if "code" property is not a string', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ code: 123 }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [123],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ code: 123 }]
+                });
+            }, /Test case must specify a string value for 'code'/u);
+        });
+
+        it('should throw if "code" property is missing', () => {
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: [{ }],
+                    invalid: [{ code: "foo" }]
+
+                });
+            }, /Test case must specify a string value for 'code'/u);
+
+            assert.throws(() => {
+                ruleTester.run("foo", require("../../fixtures/testers/rule-tester/no-var"), {
+                    valid: ["foo"],
+                    invalid: [{ }]
+                });
+            }, /Test case must specify a string value for 'code'/u);
+        });
     });
 
     // https://github.com/eslint/eslint/issues/11615
@@ -2569,4 +2820,50 @@ describe("RuleTester", () => {
         });
     });
 
+    describe("Subclassing", () => {
+
+        it("should allow subclasses to set the describe/it/itOnly statics and should correctly use those values", () => {
+            const assertionDescribe = assertEmitted(ruleTesterTestEmitter, "custom describe", "this-is-a-rule-name");
+            const assertionIt = assertEmitted(ruleTesterTestEmitter, "custom it", "valid(code);");
+            const assertionItOnly = assertEmitted(ruleTesterTestEmitter, "custom itOnly", "validOnly(code);");
+
+            /**
+             * Subclass for testing
+             */
+            class RuleTesterSubclass extends RuleTester { }
+            RuleTesterSubclass.describe = function(text, method) {
+                ruleTesterTestEmitter.emit("custom describe", text, method);
+                return method.call(this);
+            };
+            RuleTesterSubclass.it = function(text, method) {
+                ruleTesterTestEmitter.emit("custom it", text, method);
+                return method.call(this);
+            };
+            RuleTesterSubclass.itOnly = function(text, method) {
+                ruleTesterTestEmitter.emit("custom itOnly", text, method);
+                return method.call(this);
+            };
+
+            const ruleTesterSubclass = new RuleTesterSubclass();
+
+            ruleTesterSubclass.run("this-is-a-rule-name", require("../../fixtures/testers/rule-tester/no-var"), {
+                valid: [
+                    "valid(code);",
+                    {
+                        code: "validOnly(code);",
+                        only: true
+                    }
+                ],
+                invalid: []
+            });
+
+            return Promise.all([
+                assertionDescribe,
+                assertionIt,
+                assertionItOnly
+            ]);
+        });
+
+    });
+
 });
index 90ee8213b7780d8c4c2c995d011df2d497d687d6..3f2b66f549f6fd61a3be4558edfe36e917e2f4b5 100644 (file)
@@ -440,7 +440,7 @@ ruleTester.run("array-bracket-newline", rule, {
 
     invalid: [
 
-        // default : { mutliline : true}
+        // default : { multiline : true}
         {
             code: `var foo = [
                 [1,2]
index d2f32a784a3a7a9b4a7aa722dd9b62bfd1892879..c7af7f6dea875ee0e4996d990234de32fc97c65c 100644 (file)
@@ -46,7 +46,7 @@ const valid = [
     { code: "a.then((foo) => {});", options: ["always"] },
     { code: "a.then((foo) => { if (true) {}; });", options: ["always"] },
     { code: "a.then(async (foo) => { if (true) {}; });", options: ["always"], parserOptions: { ecmaVersion: 8 } },
-    { code: "(a: T) => a", options: ["always"], parser: parser("identifer-type") },
+    { code: "(a: T) => a", options: ["always"], parser: parser("identifier-type") },
     { code: "(a): T => a", options: ["always"], parser: parser("return-type") },
 
     // "as-needed"
@@ -64,7 +64,7 @@ const valid = [
     { code: "async a => a", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } },
     { code: "async ([a, b]) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } },
     { code: "async (a, b) => {}", options: ["as-needed"], parserOptions: { ecmaVersion: 8 } },
-    { code: "(a: T) => a", options: ["as-needed"], parser: parser("identifer-type") },
+    { code: "(a: T) => a", options: ["as-needed"], parser: parser("identifier-type") },
     { code: "(a): T => a", options: ["as-needed"], parser: parser("return-type") },
 
     // "as-needed", { "requireForBlockBody": true }
@@ -83,7 +83,7 @@ const valid = [
     { code: "a => ({})", options: ["as-needed", { requireForBlockBody: true }] },
     { code: "async a => ({})", options: ["as-needed", { requireForBlockBody: true }], parserOptions: { ecmaVersion: 8 } },
     { code: "async a => a", options: ["as-needed", { requireForBlockBody: true }], parserOptions: { ecmaVersion: 8 } },
-    { code: "(a: T) => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("identifer-type") },
+    { code: "(a: T) => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("identifier-type") },
     { code: "(a): T => a", options: ["as-needed", { requireForBlockBody: true }], parser: parser("return-type") },
     {
         code: "const f = (/** @type {number} */a/**hello*/) => a + a;",
index 514eb85d2ef6901ad1ae166d3023c4a0f03bb812..f634c71b43d3ecfff6858886a15888172aba07c2 100644 (file)
@@ -164,11 +164,32 @@ ruleTester.run("camelcase", rule, {
             options: [{ ignoreImports: true }],
             parserOptions: { ecmaVersion: 6, sourceType: "module" }
         },
+        {
+            code: "import { snake_cased as snake_cased } from 'mod'",
+            options: [{ ignoreImports: true }],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" }
+        },
+        {
+            code: "import { 'snake_cased' as snake_cased } from 'mod'",
+            options: [{ ignoreImports: true }],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" }
+        },
         {
             code: "import { camelCased } from 'mod'",
             options: [{ ignoreImports: false }],
             parserOptions: { ecmaVersion: 6, sourceType: "module" }
         },
+
+        // this rule doesn't apply to quoted module export names, as it doesn't apply to quoted property names.
+        {
+            code: "export { a as 'snake_cased' } from 'mod'",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" }
+        },
+        {
+            code: "export * as 'snake_cased' from 'mod'",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" }
+        },
+
         {
             code: "var _camelCased = aGlobalVariable",
             options: [{ ignoreGlobals: false }],
@@ -386,6 +407,35 @@ ruleTester.run("camelcase", rule, {
             code: "class C { snake_case; #snake_case; #snake_case2() {} }",
             options: [{ properties: "never" }],
             parserOptions: { ecmaVersion: 2022 }
+        },
+
+        // Combinations of `properties` and `ignoreDestructuring`
+        {
+            code: `
+            const { some_property } = obj;
+
+            const bar = { some_property };
+
+            obj.some_property = 10;
+
+            const xyz = { some_property: obj.some_property };
+
+            const foo = ({ some_property }) => {
+                console.log(some_property)
+            };
+            `,
+            options: [{ properties: "never", ignoreDestructuring: true }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+
+        // https://github.com/eslint/eslint/issues/15572
+        {
+            code: `
+            const { some_property } = obj;
+            doSomething({ some_property });
+            `,
+            options: [{ properties: "never", ignoreDestructuring: true }],
+            parserOptions: { ecmaVersion: 2022 }
         }
     ],
     invalid: [
@@ -668,6 +718,29 @@ ruleTester.run("camelcase", rule, {
                 }
             ]
         },
+        {
+            code: "import { 'snake_cased' as snake_cased } from 'mod'",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: [
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "snake_cased" },
+                    type: "Identifier"
+                }
+            ]
+        },
+        {
+            code: "import { 'snake_cased' as another_snake_cased } from 'mod'",
+            options: [{ ignoreImports: true }],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: [
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "another_snake_cased" },
+                    type: "Identifier"
+                }
+            ]
+        },
         {
             code: "import { camelCased, no_camelcased } from \"external-module\";",
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
@@ -1372,6 +1445,78 @@ ruleTester.run("camelcase", rule, {
             options: [{ properties: "always" }],
             parserOptions: { ecmaVersion: 2022 },
             errors: [{ messageId: "notCamelCasePrivate", data: { name: "snake_case" } }]
+        },
+
+        // Combinations of `properties` and `ignoreDestructuring`
+        {
+            code: `
+            const { some_property } = obj;
+            doSomething({ some_property });
+            `,
+            options: [{ properties: "always", ignoreDestructuring: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "some_property" },
+                    line: 3,
+                    column: 27
+                }
+            ]
+        },
+        {
+            code: `
+            const { some_property } = obj;
+            doSomething({ some_property });
+            doSomething({ [some_property]: "bar" });
+            `,
+            options: [{ properties: "never", ignoreDestructuring: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "some_property" },
+                    line: 4,
+                    column: 28
+                }
+            ]
+        },
+        {
+            code: `
+            const { some_property } = obj;
+
+            const bar = { some_property };
+
+            obj.some_property = 10;
+
+            const xyz = { some_property: obj.some_property };
+
+            const foo = ({ some_property }) => {
+                console.log(some_property)
+            };
+            `,
+            options: [{ properties: "always", ignoreDestructuring: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "some_property" },
+                    line: 4,
+                    column: 27
+                },
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "some_property" },
+                    line: 6,
+                    column: 17
+                },
+                {
+                    messageId: "notCamelCase",
+                    data: { name: "some_property" },
+                    line: 8,
+                    column: 27
+                }
+            ]
         }
     ]
 });
index 2ef7a008e2eb38bca5093ad4c3b48921ac22b339..b02a74a552801e160c9c43de512734f13210a4ee 100644 (file)
@@ -10,6 +10,7 @@
 //------------------------------------------------------------------------------
 
 const path = require("path"),
+    { unIndent } = require("../../_utils"),
     rule = require("../../../lib/rules/comma-dangle"),
     { RuleTester } = require("../../../lib/rule-tester");
 
@@ -35,6 +36,29 @@ function parser(name) {
 
 const ruleTester = new RuleTester();
 
+ruleTester.defineRule("add-named-import", {
+    meta: {
+        fixable: "code"
+    },
+    create(context) {
+        return {
+            ImportDeclaration(node) {
+                const sourceCode = context.getSourceCode();
+                const closingBrace = sourceCode.getLastToken(node, token => token.value === "}");
+                const addComma = sourceCode.getTokenBefore(closingBrace).value !== ",";
+
+                context.report({
+                    message: "Add I18nManager.",
+                    node,
+                    fix(fixer) {
+                        return fixer.insertTextBefore(closingBrace, `${addComma ? "," : ""}I18nManager`);
+                    }
+                });
+            }
+        };
+    }
+});
+
 ruleTester.run("comma-dangle", rule, {
     valid: [
         "var foo = { bar: 'baz' }",
@@ -1766,6 +1790,66 @@ let d = 0;export {d,};
             output: "foo(a)",
             parserOptions: { ecmaVersion: 8 },
             errors: [{ messageId: "unexpected" }]
+        },
+
+        // https://github.com/eslint/eslint/issues/15660
+        {
+            code: unIndent`
+                /*eslint add-named-import:1*/
+                import {
+                    StyleSheet,
+                    View,
+                    TextInput,
+                    ImageBackground,
+                    Image,
+                    TouchableOpacity,
+                    SafeAreaView
+                } from 'react-native';
+            `,
+            output: unIndent`
+                /*eslint add-named-import:1*/
+                import {
+                    StyleSheet,
+                    View,
+                    TextInput,
+                    ImageBackground,
+                    Image,
+                    TouchableOpacity,
+                    SafeAreaView,
+                } from 'react-native';
+            `,
+            options: [{ imports: "always-multiline" }],
+            parserOptions: { ecmaVersion: 6, sourceType: "module" },
+            errors: 2
+        },
+        {
+            code: unIndent`
+                /*eslint add-named-import:1*/
+                import {
+                    StyleSheet,
+                    View,
+                    TextInput,
+                    ImageBackground,
+                    Image,
+                    TouchableOpacity,
+                    SafeAreaView,
+                } from 'react-native';
+            `,
+            output: unIndent`
+                /*eslint add-named-import:1*/
+                import {
+                    StyleSheet,
+                    View,
+                    TextInput,
+                    ImageBackground,
+                    Image,
+                    TouchableOpacity,
+                    SafeAreaView
+                } from 'react-native';
+            `,
+            options: [{ imports: "never" }],
+            parserOptions: { ecmaVersion: 6, sourceType: "module" },
+            errors: 2
         }
     ]
 });
index df7dac6324a1cf2520d62d03f8246957676ec97b..a3b23b62d73c6451d47715c41db19986166291bd 100644 (file)
@@ -27,19 +27,36 @@ ruleTester.run("comma-spacing", rule, {
         "myfunc(404, // comment\n true, /* bla bla bla */ 'hello');",
         { code: "myfunc(404, // comment\n true,/* bla bla bla */ 'hello');", options: [{ before: false, after: false }] },
         "var a = 1, b = 2;",
+        "var arr = [,];",
         "var arr = [, ];",
+        "var arr = [ ,];",
+        "var arr = [ , ];",
+        "var arr = [1,];",
         "var arr = [1, ];",
         "var arr = [, 2];",
+        "var arr = [ , 2];",
         "var arr = [1, 2];",
+        "var arr = [,,];",
+        "var arr = [ ,,];",
+        "var arr = [, ,];",
+        "var arr = [,, ];",
+        "var arr = [ , ,];",
+        "var arr = [ ,, ];",
         "var arr = [, , ];",
+        "var arr = [ , , ];",
         "var arr = [1, , ];",
         "var arr = [, 2, ];",
         "var arr = [, , 3];",
+        "var arr = [,, 3];",
         "var arr = [1, 2, ];",
         "var arr = [, 2, 3];",
         "var arr = [1, , 3];",
         "var arr = [1, 2, 3];",
+        "var arr = [1, 2, 3,];",
+        "var arr = [1, 2, 3, ];",
         "var obj = {'foo':'bar', 'baz':'qur'};",
+        "var obj = {'foo':'bar', 'baz':'qur', };",
+        "var obj = {'foo':'bar', 'baz':'qur',};",
         "var obj = {'foo':'bar', 'baz':\n'qur'};",
         "var obj = {'foo':\n'bar', 'baz':\n'qur'};",
         "function foo(a, b){}",
@@ -74,20 +91,34 @@ ruleTester.run("comma-spacing", rule, {
         { code: "var a = 1 ,b = 2;", options: [{ before: true, after: false }] },
         { code: "function foo(a ,b){}", options: [{ before: true, after: false }] },
         { code: "var arr = [,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ ,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [, ];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ , ];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 ,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [1 , ];", options: [{ before: true, after: false }] },
         { code: "var arr = [ ,2];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 ,2];", options: [{ before: true, after: false }] },
         { code: "var arr = [,,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ ,,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [, ,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [,, ];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ , ,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ ,, ];", options: [{ before: true, after: false }] },
+        { code: "var arr = [, , ];", options: [{ before: true, after: false }] },
+        { code: "var arr = [ , , ];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 , ,];", options: [{ before: true, after: false }] },
         { code: "var arr = [ ,2 ,];", options: [{ before: true, after: false }] },
+        { code: "var arr = [,2 , ];", options: [{ before: true, after: false }] },
         { code: "var arr = [ , ,3];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 ,2 ,];", options: [{ before: true, after: false }] },
         { code: "var arr = [ ,2 ,3];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 , ,3];", options: [{ before: true, after: false }] },
         { code: "var arr = [1 ,2 ,3];", options: [{ before: true, after: false }] },
         { code: "var obj = {'foo':'bar' , 'baz':'qur'};", options: [{ before: true, after: true }] },
+        { code: "var obj = {'foo':'bar' ,'baz':'qur' , };", options: [{ before: true, after: false }] },
         { code: "var a = 1 , b = 2;", options: [{ before: true, after: true }] },
         { code: "var arr = [, ];", options: [{ before: true, after: true }] },
+        { code: "var arr = [,,];", options: [{ before: true, after: true }] },
         { code: "var arr = [1 , ];", options: [{ before: true, after: true }] },
         { code: "var arr = [ , 2];", options: [{ before: true, after: true }] },
         { code: "var arr = [1 , 2];", options: [{ before: true, after: true }] },
@@ -107,6 +138,7 @@ ruleTester.run("comma-spacing", rule, {
         { code: "var arr = [ ,2];", options: [{ before: false, after: false }] },
         { code: "var arr = [1,2];", options: [{ before: false, after: false }] },
         { code: "var arr = [,,];", options: [{ before: false, after: false }] },
+        { code: "var arr = [ , , ];", options: [{ before: false, after: false }] },
         { code: "var arr = [ ,,];", options: [{ before: false, after: false }] },
         { code: "var arr = [1,,];", options: [{ before: false, after: false }] },
         { code: "var arr = [,2,];", options: [{ before: false, after: false }] },
@@ -120,12 +152,22 @@ ruleTester.run("comma-spacing", rule, {
         { code: "var a; console.log(`${a}`, \"a\");", parserOptions: { ecmaVersion: 6 } },
         { code: "var [a, b] = [1, 2];", parserOptions: { ecmaVersion: 6 } },
         { code: "var [a, b, ] = [1, 2];", parserOptions: { ecmaVersion: 6 } },
+        { code: "var [a, b,] = [1, 2];", parserOptions: { ecmaVersion: 6 } },
         { code: "var [a, , b] = [1, 2, 3];", parserOptions: { ecmaVersion: 6 } },
+        { code: "var [a,, b] = [1, 2, 3];", parserOptions: { ecmaVersion: 6 } },
         { code: "var [ , b] = a;", parserOptions: { ecmaVersion: 6 } },
         { code: "var [, b] = a;", parserOptions: { ecmaVersion: 6 } },
+        { code: "var { a,} = a;", parserOptions: { ecmaVersion: 6 } },
+        { code: "import { a,} from 'mod';", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "<a>,</a>", parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } },
         { code: "<a>  ,  </a>", parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } },
-        { code: "<a>Hello, world</a>", options: [{ before: true, after: false }], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }
+        { code: "<a>Hello, world</a>", options: [{ before: true, after: false }], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } },
+
+        // For backwards compatibility. Ignoring spacing between a comment and comma of a null element was possibly unintentional.
+        { code: "[a, /**/ , ]", options: [{ before: false, after: true }] },
+        { code: "[a , /**/, ]", options: [{ before: true, after: true }] },
+        { code: "[a, /**/ , ] = foo", options: [{ before: false, after: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "[a , /**/, ] = foo", options: [{ before: true, after: true }], parserOptions: { ecmaVersion: 6 } }
     ],
 
     invalid: [
@@ -198,17 +240,6 @@ ruleTester.run("comma-spacing", rule, {
                 }
             ]
         },
-        {
-            code: "var arr = [1 , ];",
-            output: "var arr = [1 ,];",
-            options: [{ before: true, after: false }],
-            errors: [
-                {
-                    message: "There should be no space after ','.",
-                    type: "Punctuator"
-                }
-            ]
-        },
         {
             code: "var arr = [1 ,2];",
             output: "var arr = [1, 2];",
index eff0c0a73bd633b8f70b2ecc86b1848817f5a455..35533d9e686a56d89250f34024b1f39cfd3dc295 100644 (file)
@@ -265,7 +265,30 @@ ruleTester.run("computed-property-spacing", rule, {
             ].join("\n"),
             options: ["never"],
             parserOptions: { ecmaVersion: 6 }
+        },
+
+        // Destructuring Assignment
+        {
+            code: "const { [a]: someProp } = obj;",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "({ [a]: someProp } = obj);",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "const { [ a ]: someProp } = obj;",
+            options: ["always"],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "({ [ a ]: someProp } = obj);",
+            options: ["always"],
+            parserOptions: { ecmaVersion: 6 }
         }
+
     ],
 
     invalid: [
@@ -2062,6 +2085,66 @@ ruleTester.run("computed-property-spacing", rule, {
                 { messageId: "unexpectedSpaceAfter", data: { tokenValue: "[" } },
                 { messageId: "unexpectedSpaceBefore", data: { tokenValue: "]" } }
             ]
+        },
+
+        // Destructuring Assignment
+        {
+            code: "const { [ a]: someProp } = obj;",
+            output: "const { [a]: someProp } = obj;",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "unexpectedSpaceAfter", data: { tokenValue: "[" } }
+            ]
+        },
+        {
+            code: "const { [a ]: someProp } = obj;",
+            output: "const { [a]: someProp } = obj;",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "unexpectedSpaceBefore", data: { tokenValue: "]" } }
+            ]
+        },
+        {
+            code: "const { [ a ]: someProp } = obj;",
+            output: "const { [a]: someProp } = obj;",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "unexpectedSpaceAfter", data: { tokenValue: "[" } },
+                { messageId: "unexpectedSpaceBefore", data: { tokenValue: "]" } }
+            ]
+        },
+        {
+            code: "({ [ a ]: someProp } = obj);",
+            output: "({ [a]: someProp } = obj);",
+            options: ["never"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "unexpectedSpaceAfter", data: { tokenValue: "[" } },
+                { messageId: "unexpectedSpaceBefore", data: { tokenValue: "]" } }
+            ]
+        },
+        {
+            code: "const { [a]: someProp } = obj;",
+            output: "const { [ a ]: someProp } = obj;",
+            options: ["always"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "missingSpaceAfter", data: { tokenValue: "[" } },
+                { messageId: "missingSpaceBefore", data: { tokenValue: "]" } }
+            ]
+        },
+        {
+            code: "({ [a]: someProp } = obj);",
+            output: "({ [ a ]: someProp } = obj);",
+            options: ["always"],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "missingSpaceAfter", data: { tokenValue: "[" } },
+                { messageId: "missingSpaceBefore", data: { tokenValue: "]" } }
+            ]
         }
     ]
 });
index 0c9feb7a7897139569306ac4333785a42ab63f5b..a8c7cc858270583841ac47b5ce4eec4ab1e91b1b 100644 (file)
@@ -11,6 +11,9 @@
 const rule = require("../../../lib/rules/function-paren-newline");
 const { RuleTester } = require("../../../lib/rule-tester");
 
+const { unIndent } = require("../../_utils");
+const fixtureParser = require("../../fixtures/fixture-parser");
+
 
 //------------------------------------------------------------------------------
 // Tests
@@ -27,6 +30,7 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } });
 ruleTester.run("function-paren-newline", rule, {
 
     valid: [
+        "new new Foo();",
 
         // multiline option (default)
         "function baz(foo, bar) {}",
@@ -583,6 +587,22 @@ ruleTester.run("function-paren-newline", rule, {
             code: "import(\n  source\n)",
             options: ["consistent"],
             parserOptions: { ecmaVersion: 2020 }
+        },
+
+        // https://github.com/eslint/eslint/issues/15091#issuecomment-975605821
+        {
+            code: unIndent`
+                const method6 = (
+                  abc: number,
+                  def: () => void,
+                ): [
+                  string,
+                  () => void
+                ] => [\`a\${abc}\`, def];
+                method6(3, () => {});
+            `,
+            options: ["multiline"],
+            parser: fixtureParser("function-paren-newline", "arrow-function-return-type")
         }
     ],
 
@@ -1155,6 +1175,18 @@ ruleTester.run("function-paren-newline", rule, {
             options: ["never"],
             errors: [LEFT_UNEXPECTED_ERROR]
         },
+        {
+            code: `
+                new new C()(
+                );
+            `,
+            output: `
+                new new C()();
+            `,
+            options: ["never"],
+            errors: [LEFT_UNEXPECTED_ERROR, RIGHT_UNEXPECTED_ERROR]
+        },
+
         {
             code: `
                 function baz(
@@ -1437,6 +1469,31 @@ ruleTester.run("function-paren-newline", rule, {
             options: ["consistent"],
             parserOptions: { ecmaVersion: 2020 },
             errors: [RIGHT_MISSING_ERROR]
+        },
+
+        // https://github.com/eslint/eslint/issues/15091#issuecomment-975605821
+        {
+            code: unIndent`
+                const method6 = (
+                  abc: number,
+                  def: () => void,
+                ): [
+                  string,
+                  () => void
+                ] => [\`a\${abc}\`, def];
+                method6(3, () => {});
+            `,
+            output: unIndent`
+                const method6 = (abc: number,
+                  def: () => void,): [
+                  string,
+                  () => void
+                ] => [\`a\${abc}\`, def];
+                method6(3, () => {});
+            `,
+            options: ["never"],
+            parser: fixtureParser("function-paren-newline", "arrow-function-return-type"),
+            errors: [LEFT_UNEXPECTED_ERROR, RIGHT_UNEXPECTED_ERROR]
         }
     ]
 });
index d1fad2ecb8b04d8725397baf925363b625092079..7e469bd4d5bd90f93466947c894dee6efa544068 100644 (file)
@@ -185,6 +185,71 @@ ruleTester.run("id-match", rule, {
             }]
         },
 
+        // Should not report for global references - https://github.com/eslint/eslint/issues/15395
+        {
+            code: `
+            const foo = Object.keys(bar);
+            const a = Array.from(b);
+            const bar = () => Array;
+            `,
+            options: ["^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$", {
+                properties: true
+            }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: `
+            const foo = {
+                foo_one: 1,
+                bar_one: 2,
+                fooBar: 3
+            };
+            `,
+            options: ["^[^_]+$", {
+                properties: false
+            }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: `
+            const foo = {
+                foo_one: 1,
+                bar_one: 2,
+                fooBar: 3
+            };
+            `,
+            options: ["^[^_]+$", {
+                onlyDeclarations: true
+            }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: `
+            const foo = {
+                foo_one: 1,
+                bar_one: 2,
+                fooBar: 3
+            };
+            `,
+            options: ["^[^_]+$", {
+                properties: false,
+                onlyDeclarations: false
+            }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: `
+            const foo = {
+                [a]: 1,
+            };
+            `,
+            options: ["^[^a]", {
+                properties: true,
+                onlyDeclarations: true
+            }],
+            parserOptions: { ecmaVersion: 2022 }
+        },
+
         // Class Methods
         {
             code: "class x { foo() {} }",
@@ -641,6 +706,76 @@ ruleTester.run("id-match", rule, {
             ]
         },
 
+        // https://github.com/eslint/eslint/issues/15395
+        {
+            code: `
+            const foo_variable = 1;
+            class MyClass {
+            }
+            let a = new MyClass();
+            let b = {id: 1};
+            let c = Object.keys(b);
+            let d = Array.from(b);
+            let e = (Object) => Object.keys(obj, prop); // not global Object
+            let f = (Array) => Array.from(obj, prop); // not global Array
+            foo.Array = 5; // not global Array
+            `,
+            options: ["^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$", {
+                properties: true
+            }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    message: "Identifier 'foo_variable' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 2,
+                    column: 19
+                },
+                {
+                    message: "Identifier 'MyClass' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 3,
+                    column: 19
+                },
+
+                // let e = (Object) => Object.keys(obj, prop)
+                {
+                    message: "Identifier 'Object' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 9,
+                    column: 22
+                },
+                {
+                    message: "Identifier 'Object' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 9,
+                    column: 33
+                },
+
+                // let f =(Array) => Array.from(obj, prop);
+                {
+                    message: "Identifier 'Array' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 10,
+                    column: 22
+                },
+                {
+                    message: "Identifier 'Array' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 10,
+                    column: 32
+                },
+
+                // foo.Array = 5;
+                {
+                    message: "Identifier 'Array' does not match the pattern '^\\$?[a-z]+([A-Z0-9][a-z0-9]+)*$'.",
+                    type: "Identifier",
+                    line: 11,
+                    column: 17
+                }
+            ]
+        },
+
         // Class Methods
         {
             code: "class x { _foo() {} }",
@@ -691,7 +826,94 @@ ruleTester.run("id-match", rule, {
                     type: "PrivateIdentifier"
                 }
             ]
-        }
+        },
+
+        // https://github.com/eslint/eslint/issues/15123
+        {
+            code: `
+            const foo = {
+                foo_one: 1,
+                bar_one: 2,
+                fooBar: 3
+            };
+            `,
+            options: ["^[^_]+$", {
+                properties: true,
+                onlyDeclarations: true
+            }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    message: "Identifier 'foo_one' does not match the pattern '^[^_]+$'.",
+                    type: "Identifier"
+                },
+                {
+                    message: "Identifier 'bar_one' does not match the pattern '^[^_]+$'.",
+                    type: "Identifier"
+                }
+            ]
+        },
+        {
+            code: `
+            const foo = {
+                foo_one: 1,
+                bar_one: 2,
+                fooBar: 3
+            };
+            `,
+            options: ["^[^_]+$", {
+                properties: true,
+                onlyDeclarations: false
+            }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    message: "Identifier 'foo_one' does not match the pattern '^[^_]+$'.",
+                    type: "Identifier"
+                },
+                {
+                    message: "Identifier 'bar_one' does not match the pattern '^[^_]+$'.",
+                    type: "Identifier"
+                }
+            ]
+        },
+        {
+            code: `
+            const foo = {
+                [a]: 1,
+            };
+            `,
+            options: ["^[^a]", {
+                properties: true,
+                onlyDeclarations: false
+            }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    message: "Identifier 'a' does not match the pattern '^[^a]'.",
+                    type: "Identifier"
+                }
+            ]
+        },
 
+        // https://github.com/eslint/eslint/issues/15443
+        {
+            code: `
+            const foo = {
+                [a]: 1,
+            };
+            `,
+            options: ["^[^a]", {
+                properties: false,
+                onlyDeclarations: false
+            }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                {
+                    message: "Identifier 'a' does not match the pattern '^[^a]'.",
+                    type: "Identifier"
+                }
+            ]
+        }
     ]
 });
index 3947679142086ce202574862610b852056ae3c8f..0785083d0aca2cdbe7e192c0f384099561b25ec7 100644 (file)
@@ -776,6 +776,21 @@ ruleTester.run("indent", rule, {
             `,
             options: [2, { VariableDeclarator: 2, SwitchCase: 1 }]
         },
+        {
+            code: unIndent`
+                with (a)
+                    b();
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                with (a)
+                    b();
+                c();
+            `,
+            options: [4]
+        },
         {
             code: unIndent`
                 if(true)
@@ -6082,6 +6097,270 @@ ruleTester.run("indent", rule, {
             `,
             options: [4, { FunctionExpression: { body: 2 }, StaticBlock: { body: 2 } }],
             parserOptions: { ecmaVersion: 2022 }
+        },
+
+        // https://github.com/eslint/eslint/issues/15930
+        {
+            code: unIndent`
+                if (2 > 1)
+                \tconsole.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: ["tab"]
+        },
+        {
+            code: unIndent`
+                if (2 > 1)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo) bar();
+                baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo) bar()
+                ;baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar();
+                baz();
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                ; baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                ;baz()
+                qux()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                ;else
+                    baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                else
+                    baz()
+                ;qux()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                ;qux()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                else if (baz)
+                    qux()
+                ;quux()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                    else
+                        qux()
+                ;quux()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                    ;
+                baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    ;
+                baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                ;baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo);
+                else
+                    baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    ;
+                else
+                    baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                if (foo)
+                ;else
+                    baz()
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do foo();
+                while (bar)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do foo()
+                ;while (bar)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do
+                    foo();
+                while (bar)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do
+                    foo()
+                ;while (bar)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do;
+                while (foo)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do
+                    ;
+                while (foo)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                do
+                ;while (foo)
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                while (2 > 1)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                for (;;)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                for (a in b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                with (a)
+                    console.log(b)
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                label: for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
+        },
+        {
+            code: unIndent`
+                label:
+                for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4]
         }
     ],
 
@@ -6699,6 +6978,20 @@ ruleTester.run("indent", rule, {
                 [2, 4, 0, "Identifier"]
             ])
         },
+        {
+            code: unIndent`
+                with(a)
+                b();
+            `,
+            output: unIndent`
+                with(a)
+                    b();
+            `,
+            options: [4],
+            errors: expectedErrors([
+                [2, 4, 0, "Identifier"]
+            ])
+        },
         {
             code: unIndent`
                 if(true)
@@ -12623,6 +12916,471 @@ ruleTester.run("indent", rule, {
                 [6, 12, 0, "Identifier"],
                 [7, 4, 0, "Punctuator"]
             ])
+        },
+
+        // https://github.com/eslint/eslint/issues/15930
+        {
+            code: unIndent`
+                if (2 > 1)
+                \tconsole.log('a')
+                \t;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                if (2 > 1)
+                \tconsole.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: ["tab"],
+            errors: expectedErrors("tab", [3, 0, 1, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (2 > 1)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                if (2 > 1)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo) bar();
+                    baz()
+            `,
+            output: unIndent`
+                if (foo) bar();
+                baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Identifier"])
+        },
+        {
+            code: unIndent`
+                if (foo) bar()
+                    ;baz()
+            `,
+            output: unIndent`
+                if (foo) bar()
+                ;baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar();
+                    baz();
+            `,
+            output: unIndent`
+                if (foo)
+                    bar();
+                baz();
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Identifier"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                    ; baz()
+            `,
+            output: unIndent`
+                if (foo)
+                    bar()
+                ; baz()
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                    ;baz()
+                    qux()
+            `,
+            output: unIndent`
+            if (foo)
+                bar()
+            ;baz()
+            qux()
+        `,
+            options: [4],
+            errors: expectedErrors([
+                [3, 0, 4, "Punctuator"],
+                [4, 0, 4, "Identifier"]
+            ])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                    ;else
+                    baz()
+            `,
+            output: unIndent`
+                if (foo)
+                    bar()
+                ;else
+                    baz()
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                else
+                    baz()
+                    ;qux()
+            `,
+            output: unIndent`
+                if (foo)
+                    bar()
+                else
+                    baz()
+                ;qux()
+            `,
+            options: [4],
+            errors: expectedErrors([5, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                    ;qux()
+            `,
+            output: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                ;qux()
+            `,
+            options: [4],
+            errors: expectedErrors([4, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                else if (baz)
+                    qux()
+                    ;quux()
+            `,
+            output: unIndent`
+                if (foo)
+                    bar()
+                else if (baz)
+                    qux()
+                ;quux()
+            `,
+            options: [4],
+            errors: expectedErrors([5, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                    else
+                        qux()
+                    ;quux()
+            `,
+            output: unIndent`
+                if (foo)
+                    if (bar)
+                        baz()
+                    else
+                        qux()
+                ;quux()
+            `,
+            options: [4],
+            errors: expectedErrors([6, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    bar()
+                ;
+                baz()
+            `,
+            output: unIndent`
+                if (foo)
+                    bar()
+                    ;
+                baz()
+            `,
+            options: [4],
+            errors: expectedErrors([3, 4, 0, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                ;
+                baz()
+            `,
+            output: unIndent`
+                if (foo)
+                    ;
+                baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 4, 0, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    ;baz()
+            `,
+            output: unIndent`
+                if (foo)
+                ;baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo);
+                    else
+                    baz()
+            `,
+            output: unIndent`
+                if (foo);
+                else
+                    baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Keyword"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                ;
+                else
+                    baz()
+            `,
+            output: unIndent`
+                if (foo)
+                    ;
+                else
+                    baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 4, 0, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                if (foo)
+                    ;else
+                    baz()
+            `,
+            output: unIndent`
+                if (foo)
+                ;else
+                    baz()
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                do foo();
+                    while (bar)
+            `,
+            output: unIndent`
+                do foo();
+                while (bar)
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Keyword"])
+        },
+        {
+            code: unIndent`
+                do foo()
+                    ;while (bar)
+            `,
+            output: unIndent`
+                do foo()
+                ;while (bar)
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                do
+                    foo();
+                    while (bar)
+            `,
+            output: unIndent`
+                do
+                    foo();
+                while (bar)
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Keyword"])
+        },
+        {
+            code: unIndent`
+                do
+                    foo()
+                    ;while (bar)
+            `,
+            output: unIndent`
+            do
+                foo()
+            ;while (bar)
+        `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                do;
+                    while (foo)
+            `,
+            output: unIndent`
+                do;
+                while (foo)
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Keyword"])
+        },
+        {
+            code: unIndent`
+                do
+                ;
+                while (foo)
+            `,
+            output: unIndent`
+                do
+                    ;
+                while (foo)
+            `,
+            options: [4],
+            errors: expectedErrors([2, 4, 0, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                do
+                    ;while (foo)
+            `,
+            output: unIndent`
+                do
+                ;while (foo)
+            `,
+            options: [4],
+            errors: expectedErrors([2, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                while (2 > 1)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                while (2 > 1)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                for (;;)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                for (;;)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                for (a in b)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                for (a in b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                for (a of b)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                with (a)
+                    console.log(b)
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                with (a)
+                    console.log(b)
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                label: for (a of b)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                label: for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([3, 0, 4, "Punctuator"])
+        },
+        {
+            code: unIndent`
+                label:
+                for (a of b)
+                    console.log('a')
+                    ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            output: unIndent`
+                label:
+                for (a of b)
+                    console.log('a')
+                ;[1, 2, 3].forEach(x=>console.log(x))
+            `,
+            options: [4],
+            errors: expectedErrors([4, 0, 4, "Punctuator"])
         }
     ]
 });
index fde9673a63bdbb035e40f8fa41579e8ded003a2f..dd0fcbc4dcf68c43e40d654409873860ba82ed3a 100644 (file)
@@ -896,8 +896,82 @@ ruleTester.run("key-spacing", rule, {
                 on: "value"
             }
         }]
-    }
-    ],
+    },
+
+    // https://github.com/eslint/eslint/issues/15914
+    {
+        code: `
+            var foo = {
+                "a": "bar",
+                "𐌘": "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }]
+    },
+    {
+        code: `
+            var foo = {
+                "a": "bar",
+                "Á": "baz",
+                "o͂": "qux",
+                "m̅": "xyz",
+                "ř": "abc"
+
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }]
+    },
+    {
+        code: `
+            var foo = {
+                "🌷": "bar", // 2 code points
+                "🎁": "baz", // 2 code points
+                "🇮🇳": "qux", // 4 code points
+                "🏳️‍🌈": "xyz", // 6 code points
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }]
+    },
+    {
+        code: `
+            const foo = {
+                "a": "bar",
+                [𐌘]: "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }],
+        parserOptions: { ecmaVersion: 6 }
+    },
+    {
+        code: `
+            const foo = {
+                "abc": "bar",
+                [ 𐌘 ]: "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }],
+        parserOptions: { ecmaVersion: 6 }
+    }],
     invalid: [{
         code: "var a ={'key' : value };",
         output: "var a ={'key':value };",
@@ -2203,5 +2277,103 @@ ruleTester.run("key-spacing", rule, {
             { messageId: "missingValue", data: { computed: "", key: "bar" }, line: 3, column: 12, type: "Literal" },
             { messageId: "missingValue", data: { computed: "", key: "baz" }, line: 3, column: 20, type: "Literal" }
         ]
-    }]
+    },
+    {
+        code: `
+            const foo = {
+                "a": "bar",
+                [ 𐌘 ]: "baz"
+            };
+        `,
+        output: `
+            const foo = {
+                "a":   "bar",
+                [ 𐌘 ]: "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }],
+        parserOptions: { ecmaVersion: 6 },
+        errors: [
+            { messageId: "missingValue", data: { computed: "", key: "a" }, line: 3, column: 22, type: "Literal" }
+        ]
+    },
+    {
+        code: `
+            const foo = {
+                "a": "bar",
+                [ 𐌘 ]: "baz"
+            };
+        `,
+        output: `
+            const foo = {
+                "a"  : "bar",
+                [ 𐌘 ]: "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "colon"
+            }
+        }],
+        parserOptions: { ecmaVersion: 6 },
+        errors: [
+            { messageId: "missingKey", data: { computed: "", key: "a" }, line: 3, column: 17, type: "Literal" }
+        ]
+    },
+    {
+        code: `
+            const foo = {
+                "a":  "bar",
+                "𐌘": "baz"
+            };
+        `,
+        output: `
+            const foo = {
+                "a": "bar",
+                "𐌘": "baz"
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }],
+        parserOptions: { ecmaVersion: 6 },
+        errors: [
+            { messageId: "extraValue", data: { computed: "", key: "a" }, line: 3, column: 20, type: "Literal" }
+        ]
+    },
+    {
+        code: `
+            var foo = {
+                "🌷":     "bar", // 2 code points
+                "🎁":     "baz", // 2 code points
+                "🇮🇳":   "qux", // 4 code points
+                "🏳️‍🌈": "xyz", // 6 code points
+            };
+        `,
+        output: `
+            var foo = {
+                "🌷": "bar", // 2 code points
+                "🎁": "baz", // 2 code points
+                "🇮🇳": "qux", // 4 code points
+                "🏳️‍🌈": "xyz", // 6 code points
+            };
+        `,
+        options: [{
+            align: {
+                on: "value"
+            }
+        }],
+        errors: [
+            { messageId: "extraValue", data: { computed: "", key: "🌷" }, line: 3, column: 21, type: "Literal" },
+            { messageId: "extraValue", data: { computed: "", key: "🎁" }, line: 4, column: 21, type: "Literal" },
+            { messageId: "extraValue", data: { computed: "", key: "🇮🇳" }, line: 5, column: 23, type: "Literal" }
+        ]
+    }
+    ]
 });
index 35c8a06e43e6590667a29b0d9f6d0ee5fbade5da..97d198f56fce3e50985a019ae7ff847addd46074 100644 (file)
@@ -126,14 +126,53 @@ ruleTester.run("keyword-spacing", rule, {
         // as
         //----------------------------------------------------------------------
 
+        // import { a as b }
+        { code: "import { a } from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "import { a as b } from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "import { \"a\" as b } from \"foo\"", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "import{ a }from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "import{ a as b }from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "import{ \"a\"as b }from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "import{ \"a\" as b }from\"foo\"", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "import { a as b } from \"foo\"", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "import { \"a\"as b } from \"foo\"", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+
+        // export { a as b }
+        { code: "let a; export { a };", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export { \"a\" } from \"foo\";", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a; export { a as b };", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "let a; export { a as \"b\" };", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\" as b } from \"foo\";", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\" as \"b\" } from \"foo\";", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a; export{ a };", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export{ \"a\" }from\"foo\";", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a; export{ a as b };", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "let a; export{ a as\"b\" };", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export{ \"a\"as b }from\"foo\";", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export{ \"a\"as\"b\" }from\"foo\";", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a; export{ a as \"b\" };", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export{ \"a\" as b }from\"foo\";", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export{ \"a\" as \"b\" }from\"foo\";", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a; export { a as b };", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "let a; export { a as\"b\" };", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\"as b } from \"foo\";", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\"as\"b\" } from \"foo\";", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+
+        // import * as a
         { code: "import * as a from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "import*as a from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "import* as a from\"foo\"", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "import *as a from \"foo\"", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+
+        // export * as a
         { code: "export * as a from \"foo\"", parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export * as \"a\" from \"foo\"", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "export*as a from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export*as\"a\"from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "export* as a from\"foo\"", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export* as \"a\"from\"foo\"", options: [override("as", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "export *as a from \"foo\"", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export *as\"a\" from \"foo\"", options: [override("as", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
 
         //----------------------------------------------------------------------
         // async
@@ -654,15 +693,21 @@ ruleTester.run("keyword-spacing", rule, {
         { code: "import {foo} from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export {foo} from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export * from \"foo\"", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export * as \"x\" from \"foo\"", parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "import{foo}from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export{foo}from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export*from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export*as x from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export*as\"x\"from\"foo\"", options: [NEITHER], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "import{foo} from \"foo\"", options: [override("from", BOTH)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export{foo} from \"foo\"", options: [override("from", BOTH)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export* from \"foo\"", options: [override("from", BOTH)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export*as\"x\" from \"foo\"", options: [override("from", BOTH)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
         { code: "import {foo}from\"foo\"", options: [override("from", NEITHER)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export {foo}from\"foo\"", options: [override("from", NEITHER)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export *from\"foo\"", options: [override("from", NEITHER)], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "export * as x from\"foo\"", options: [override("from", NEITHER)], parserOptions: { ecmaVersion: 2020, sourceType: "module" } },
+        { code: "export * as \"x\"from\"foo\"", options: [override("from", NEITHER)], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
 
         //----------------------------------------------------------------------
         // function
@@ -1469,6 +1514,119 @@ ruleTester.run("keyword-spacing", rule, {
         // as
         //----------------------------------------------------------------------
 
+        // import { a as b }
+        {
+            code: "import { \"a\"as b } from \"foo\"",
+            output: "import { \"a\" as b } from \"foo\"",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBefore("as")
+        },
+        {
+            code: "import{ \"a\" as b }from\"foo\"",
+            output: "import{ \"a\"as b }from\"foo\"",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBefore("as")
+        },
+        {
+            code: "import{ \"a\"as b }from\"foo\"",
+            output: "import{ \"a\" as b }from\"foo\"",
+            options: [override("as", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBefore("as")
+        },
+        {
+            code: "import { \"a\" as b } from \"foo\"",
+            output: "import { \"a\"as b } from \"foo\"",
+            options: [override("as", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBefore("as")
+        },
+
+        // export { a as b }
+        {
+            code: "let a; export { a as\"b\" };",
+            output: "let a; export { a as \"b\" };",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedAfter("as")
+        },
+        {
+            code: "export { \"a\"as b } from \"foo\";",
+            output: "export { \"a\" as b } from \"foo\";",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBefore("as")
+        },
+        {
+            code: "export { \"a\"as\"b\" } from \"foo\";",
+            output: "export { \"a\" as \"b\" } from \"foo\";",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("as")
+        },
+        {
+            code: "let a; export{ a as \"b\" };",
+            output: "let a; export{ a as\"b\" };",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedAfter("as")
+        },
+        {
+            code: "export{ \"a\" as b }from\"foo\";",
+            output: "export{ \"a\"as b }from\"foo\";",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBefore("as")
+        },
+        {
+            code: "export{ \"a\" as \"b\" }from\"foo\";",
+            output: "export{ \"a\"as\"b\" }from\"foo\";",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("as")
+        },
+        {
+            code: "let a; export{ a as\"b\" };",
+            output: "let a; export{ a as \"b\" };",
+            options: [override("as", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedAfter("as")
+        },
+        {
+            code: "export{ \"a\"as b }from\"foo\";",
+            output: "export{ \"a\" as b }from\"foo\";",
+            options: [override("as", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBefore("as")
+        },
+        {
+            code: "export{ \"a\"as\"b\" }from\"foo\";",
+            output: "export{ \"a\" as \"b\" }from\"foo\";",
+            options: [override("as", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("as")
+        },
+        {
+            code: "let a; export { a as \"b\" };",
+            output: "let a; export { a as\"b\" };",
+            options: [override("as", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedAfter("as")
+        },
+        {
+            code: "export { \"a\" as b } from \"foo\";",
+            output: "export { \"a\"as b } from \"foo\";",
+            options: [override("as", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBefore("as")
+        },
+        {
+            code: "export { \"a\" as \"b\" } from \"foo\";",
+            output: "export { \"a\"as\"b\" } from \"foo\";",
+            options: [override("as", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("as")
+        },
+
+        // import * as a
         {
             code: "import *as a from \"foo\"",
             output: "import * as a from \"foo\"",
@@ -1524,12 +1682,20 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
             errors: unexpectedBefore("as")
         },
+
+        // export * as a
         {
             code: "export *as a from \"foo\"",
             output: "export * as a from \"foo\"",
             parserOptions: { ecmaVersion: 2020, sourceType: "module" },
             errors: expectedBefore("as")
         },
+        {
+            code: "export *as\"a\" from \"foo\"",
+            output: "export * as \"a\" from \"foo\"",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("as")
+        },
         {
             code: "export* as a from\"foo\"",
             output: "export*as a from\"foo\"",
@@ -1537,6 +1703,13 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 2020, sourceType: "module" },
             errors: unexpectedBefore("as")
         },
+        {
+            code: "export* as \"a\"from\"foo\"",
+            output: "export*as\"a\"from\"foo\"",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("as")
+        },
         {
             code: "export*as a from\"foo\"",
             output: "export* as a from\"foo\"",
@@ -1544,6 +1717,13 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 2020, sourceType: "module" },
             errors: expectedBefore("as")
         },
+        {
+            code: "export*as\"a\"from\"foo\"",
+            output: "export* as \"a\"from\"foo\"",
+            options: [override("as", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("as")
+        },
         {
             code: "export * as a from \"foo\"",
             output: "export *as a from \"foo\"",
@@ -1551,6 +1731,13 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 2020, sourceType: "module" },
             errors: unexpectedBefore("as")
         },
+        {
+            code: "export * as \"a\" from \"foo\"",
+            output: "export *as\"a\" from \"foo\"",
+            options: [override("as", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("as")
+        },
 
         //----------------------------------------------------------------------
         // async
@@ -2399,6 +2586,12 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
             errors: expectedBeforeAndAfter("from")
         },
+        {
+            code: "export * as \"a\"from\"foo\"",
+            output: "export * as \"a\" from \"foo\"",
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("from")
+        },
         {
             code: "import{foo} from \"foo\"",
             output: "import{foo}from\"foo\"",
@@ -2420,6 +2613,20 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
             errors: unexpectedBeforeAndAfter("from")
         },
+        {
+            code: "export*as x from \"foo\"",
+            output: "export*as x from\"foo\"",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2020, sourceType: "module" },
+            errors: unexpectedAfter("from")
+        },
+        {
+            code: "export*as\"x\" from \"foo\"",
+            output: "export*as\"x\"from\"foo\"",
+            options: [NEITHER],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("from")
+        },
         {
             code: "import{foo}from\"foo\"",
             output: "import{foo} from \"foo\"",
@@ -2441,6 +2648,13 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
             errors: expectedBeforeAndAfter("from")
         },
+        {
+            code: "export*as\"x\"from\"foo\"",
+            output: "export*as\"x\" from \"foo\"",
+            options: [override("from", BOTH)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: expectedBeforeAndAfter("from")
+        },
         {
             code: "import {foo} from \"foo\"",
             output: "import {foo}from\"foo\"",
@@ -2462,6 +2676,20 @@ ruleTester.run("keyword-spacing", rule, {
             parserOptions: { ecmaVersion: 6, sourceType: "module" },
             errors: unexpectedBeforeAndAfter("from")
         },
+        {
+            code: "export * as x from \"foo\"",
+            output: "export * as x from\"foo\"",
+            options: [override("from", NEITHER)],
+            parserOptions: { ecmaVersion: 2020, sourceType: "module" },
+            errors: unexpectedAfter("from")
+        },
+        {
+            code: "export * as \"x\" from \"foo\"",
+            output: "export * as \"x\"from\"foo\"",
+            options: [override("from", NEITHER)],
+            parserOptions: { ecmaVersion: 2022, sourceType: "module" },
+            errors: unexpectedBeforeAndAfter("from")
+        },
 
         //----------------------------------------------------------------------
         // function
index 2687f1458aa3d9f79b20d602d858345b6090c51c..379698549e449a10f31d10b6308498a9fe72105e 100644 (file)
@@ -364,6 +364,60 @@ ruleTester.run("lines-around-comment", rule, {
             parserOptions: { ecmaVersion: 2022 }
         },
 
+        // https://github.com/eslint/eslint/issues/16131
+        {
+            code: `
+            switch (foo) {
+            // this comment is allowed by allowBlockStart: true 
+                
+            case 1:    
+                bar();
+                break;
+                
+            // this comment is allowed by allowBlockEnd: true
+            }
+            `,
+            options: [{
+                allowBlockStart: true,
+                beforeLineComment: true,
+                afterLineComment: true,
+                allowBlockEnd: true
+            }]
+        },
+        {
+            code: `
+            switch (foo)
+            {
+            // this comment is allowed by allowBlockStart: true 
+                
+            case 1:    
+                bar();
+                break;
+            }
+            `,
+            options: [{
+                allowBlockStart: true,
+                beforeLineComment: true,
+                afterLineComment: true
+            }]
+        },
+        {
+            code: `
+            switch (
+                function(){}()
+            )
+            {
+                // this comment is allowed by allowBlockStart: true
+                case foo:
+                    break;
+            }
+            `,
+            options: [{
+                allowBlockStart: true,
+                beforeLineComment: true
+            }]
+        },
+
         // check for block end comments
         {
             code: "var a,\n// line\n\nb;",
@@ -2106,6 +2160,39 @@ ruleTester.run("lines-around-comment", rule, {
             output: "foo;\n\n/* fallthrough */",
             options: [],
             errors: [{ messageId: "before", type: "Block" }]
+        },
+        {
+            code: `
+            switch (
+            // this comment is not allowed by allowBlockStart: true
+
+                foo
+            )
+            {   
+            case 1:    
+                bar();
+                break;
+            }
+            `,
+            output: `
+            switch (
+
+            // this comment is not allowed by allowBlockStart: true
+
+                foo
+            )
+            {   
+            case 1:    
+                bar();
+                break;
+            }
+            `,
+            options: [{
+                allowBlockStart: true,
+                beforeLineComment: true,
+                afterLineComment: true
+            }],
+            errors: [{ messageId: "before", type: "Line" }]
         }
     ]
 
index 74acab2af2e78e647d8fbcfa3d5e4797363942f8..621d66e312d53c80c5a0790e803b4bb1d81310ca 100644 (file)
@@ -143,7 +143,7 @@ if ( x === y ) {
             options: [{ max: 5, skipComments: true, skipBlankLines: false }]
         },
 
-        // IIFEs should be recognised if IIFEs: true
+        // IIFEs should be recognized if IIFEs: true
         {
             code: `(function(){
     let x = 0;
@@ -155,7 +155,7 @@ if ( x === y ) {
             options: [{ max: 7, skipComments: true, skipBlankLines: false, IIFEs: true }]
         },
 
-        // IIFEs should not be recognised if IIFEs: false
+        // IIFEs should not be recognized if IIFEs: false
         {
             code: `(function(){
     let x = 0;
@@ -167,7 +167,7 @@ if ( x === y ) {
             options: [{ max: 2, skipComments: true, skipBlankLines: false, IIFEs: false }]
         },
 
-        // Arrow IIFEs should be recognised if IIFEs: true
+        // Arrow IIFEs should be recognized if IIFEs: true
         {
             code: `(() => {
     let x = 0;
@@ -179,7 +179,7 @@ if ( x === y ) {
             options: [{ max: 7, skipComments: true, skipBlankLines: false, IIFEs: true }]
         },
 
-        // Arrow IIFEs should not be recognised if IIFEs: false
+        // Arrow IIFEs should not be recognized if IIFEs: false
         {
             code: `(() => {
     let x = 0;
@@ -194,67 +194,39 @@ if ( x === y ) {
 
     invalid: [
 
-        // Test simple standalone function is recognised
+        // Test simple standalone function is recognized
         {
             code: "function name() {\n}",
             options: [1],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 1, maxLines: 1 },
-                    line: 2,
-                    column: 1,
-                    endLine: 2,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 2, maxLines: 1 } }
             ]
         },
 
-        // Test anonymous function assigned to variable is recognised
+        // Test anonymous function assigned to variable is recognized
         {
             code: "var func = function() {\n}",
             options: [1],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function", linesExceed: 1, maxLines: 1 },
-                    line: 2,
-                    column: 1,
-                    endLine: 2,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function", lineCount: 2, maxLines: 1 } }
             ]
         },
 
-        // Test arrow functions are recognised
+        // Test arrow functions are recognized
         {
             code: "const bar = () => {\nconst x = 2 + 1;\nreturn x;\n}",
             options: [3],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Arrow function", linesExceed: 1, maxLines: 3 },
-                    line: 4,
-                    column: 1,
-                    endLine: 4,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Arrow function", lineCount: 4, maxLines: 3 } }
             ]
         },
 
-        // Test inline arrow functions are recognised
+        // Test inline arrow functions are recognized
         {
             code: "const bar = () =>\n 2",
             options: [1],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Arrow function", linesExceed: 1, maxLines: 1 },
-                    line: 2,
-                    column: 1,
-                    endLine: 2,
-                    endColumn: 3
-                }
+                { messageId: "exceed", data: { name: "Arrow function", lineCount: 2, maxLines: 1 } }
             ]
         },
 
@@ -263,14 +235,7 @@ if ( x === y ) {
             code: `() => {${"foo\n".repeat(60)}}`,
             options: [{}],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Arrow function", linesExceed: 11, maxLines: 50 },
-                    line: 51,
-                    column: 1,
-                    endLine: 61,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Arrow function", lineCount: 61, maxLines: 50 } }
             ]
         },
 
@@ -279,14 +244,7 @@ if ( x === y ) {
             code: "function name() {\nvar x = 5;\n\t\n \n\nvar x = 2;\n}",
             options: [{ max: 6, skipComments: false, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 1, maxLines: 6 },
-                    line: 7,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 7, maxLines: 6 } }
             ]
         },
 
@@ -295,14 +253,7 @@ if ( x === y ) {
             code: "function name() {\r\nvar x = 5;\r\n\t\r\n \r\n\r\nvar x = 2;\r\n}",
             options: [{ max: 6, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 1, maxLines: 6 },
-                    line: 7,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 7, maxLines: 6 } }
             ]
         },
 
@@ -311,14 +262,7 @@ if ( x === y ) {
             code: "function name() {\nvar x = 5;\n\t\n \n\nvar x = 2;\n}",
             options: [{ max: 2, skipComments: true, skipBlankLines: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 2, maxLines: 2 },
-                    line: 6,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 4, maxLines: 2 } }
             ]
         },
 
@@ -327,14 +271,7 @@ if ( x === y ) {
             code: "function name() {\r\nvar x = 5;\r\n\t\r\n \r\n\r\nvar x = 2;\r\n}",
             options: [{ max: 2, skipComments: true, skipBlankLines: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 2, maxLines: 2 },
-                    line: 6,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 4, maxLines: 2 } }
             ]
         },
 
@@ -343,14 +280,7 @@ if ( x === y ) {
             code: "function name() { // end of line comment\nvar x = 5; /* mid line comment */\n\t// single line comment taking up whole line\n\t\n \n\nvar x = 2;\n}",
             options: [{ max: 6, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 1, maxLines: 6 },
-                    line: 8,
-                    column: 1,
-                    endLine: 8,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 7, maxLines: 6 } }
             ]
         },
 
@@ -359,14 +289,7 @@ if ( x === y ) {
             code: "function name() { // end of line comment\nvar x = 5; /* mid line comment */\n\t// single line comment taking up whole line\n\t\n \n\nvar x = 2;\n}",
             options: [{ max: 1, skipComments: true, skipBlankLines: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 3, maxLines: 1 },
-                    line: 2,
-                    column: 1,
-                    endLine: 8,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 4, maxLines: 1 } }
             ]
         },
 
@@ -375,14 +298,7 @@ if ( x === y ) {
             code: "function name() { // end of line comment\nvar x = 5; /* mid line comment */\n\t// single line comment taking up whole line\n\t\n \n\nvar x = 2;\n}",
             options: [{ max: 1, skipComments: false, skipBlankLines: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 4, maxLines: 1 },
-                    line: 2,
-                    column: 1,
-                    endLine: 8,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'name'", lineCount: 5, maxLines: 1 } }
             ]
         },
 
@@ -397,14 +313,7 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'foo'", linesExceed: 5, maxLines: 2 },
-                    line: 3,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'foo'", lineCount: 7, maxLines: 2 } }
             ]
         },
 
@@ -419,14 +328,7 @@ function
 ()`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false, IIFEs: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function", linesExceed: 2, maxLines: 2 },
-                    line: 4,
-                    column: 1,
-                    endLine: 5,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function", lineCount: 4, maxLines: 2 } }
             ]
         },
 
@@ -444,14 +346,7 @@ if ( x === y ) {
 }`,
             options: [{ max: 9, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'parent'", linesExceed: 1, maxLines: 9 },
-                    line: 10,
-                    column: 1,
-                    endLine: 10,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'parent'", lineCount: 10, maxLines: 9 } }
             ]
         },
 
@@ -469,26 +364,12 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'parent'", linesExceed: 8, maxLines: 2 },
-                    line: 3,
-                    column: 1,
-                    endLine: 10,
-                    endColumn: 2
-                },
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'nested'", linesExceed: 2, maxLines: 2 },
-                    line: 5,
-                    column: 1,
-                    endLine: 6,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function 'parent'", lineCount: 10, maxLines: 2 } },
+                { messageId: "exceed", data: { name: "Function 'nested'", lineCount: 4, maxLines: 2 } }
             ]
         },
 
-        // Test regular methods are recognised
+        // Test regular methods are recognized
         {
             code: `class foo {
     method() {
@@ -499,18 +380,11 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Method 'method'", linesExceed: 3, maxLines: 2 },
-                    line: 4,
-                    column: 1,
-                    endLine: 6,
-                    endColumn: 6
-                }
+                { messageId: "exceed", data: { name: "Method 'method'", lineCount: 5, maxLines: 2 } }
             ]
         },
 
-        // Test static methods are recognised
+        // Test static methods are recognized
         {
             code: `class A {
     static
@@ -521,18 +395,11 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Static method 'foo'", linesExceed: 3, maxLines: 2 },
-                    line: 4,
-                    column: 1,
-                    endLine: 6,
-                    endColumn: 6
-                }
+                { messageId: "exceed", data: { name: "Static method 'foo'", lineCount: 5, maxLines: 2 } }
             ]
         },
 
-        // Test getters are recognised as properties
+        // Test getters are recognized as properties
         {
             code: `var obj = {
     get
@@ -541,20 +408,13 @@ if ( x === y ) {
         return 1
     }
 }`,
-            options: [{ max: 4, skipComments: true, skipBlankLines: false }],
+            options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Getter 'foo'", linesExceed: 1, maxLines: 4 },
-                    line: 6,
-                    column: 1,
-                    endLine: 6,
-                    endColumn: 6
-                }
+                { messageId: "exceed", data: { name: "Getter 'foo'", lineCount: 5, maxLines: 2 } }
             ]
         },
 
-        // Test setters are recognised as properties
+        // Test setters are recognized as properties
         {
             code: `var obj = {
     set
@@ -565,14 +425,7 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Setter 'foo'", linesExceed: 3, maxLines: 2 },
-                    line: 4,
-                    column: 1,
-                    endLine: 6,
-                    endColumn: 6
-                }
+                { messageId: "exceed", data: { name: "Setter 'foo'", lineCount: 5, maxLines: 2 } }
             ]
         },
 
@@ -590,14 +443,7 @@ if ( x === y ) {
 }`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Static method", linesExceed: 6, maxLines: 2 },
-                    line: 4,
-                    column: 1,
-                    endLine: 9,
-                    endColumn: 6
-                }
+                { messageId: "exceed", data: { name: "Static method", lineCount: 8, maxLines: 2 } }
             ]
         },
 
@@ -612,14 +458,7 @@ if ( x === y ) {
 }());`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false, IIFEs: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function", linesExceed: 5, maxLines: 2 },
-                    line: 3,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Function", lineCount: 7, maxLines: 2 } }
             ]
         },
 
@@ -634,28 +473,7 @@ if ( x === y ) {
 })();`,
             options: [{ max: 2, skipComments: true, skipBlankLines: false, IIFEs: true }],
             errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Arrow function", linesExceed: 5, maxLines: 2 },
-                    line: 3,
-                    column: 1,
-                    endLine: 7,
-                    endColumn: 2
-                }
-            ]
-        },
-        {
-            code: "\nfoo();\nbar();\nbaz();\nfunction name() {\nvar x = 5;\n/* comment 1 */\n/* comment 2 */\n\t\n \n\nvar x = 2;\n}\nquz();",
-            options: [{ max: 2, skipComments: true, skipBlankLines: true }],
-            errors: [
-                {
-                    messageId: "exceed",
-                    data: { name: "Function 'name'", linesExceed: 2, maxLines: 2 },
-                    line: 12,
-                    column: 1,
-                    endLine: 13,
-                    endColumn: 2
-                }
+                { messageId: "exceed", data: { name: "Arrow function", lineCount: 7, maxLines: 2 } }
             ]
         }
     ]
index 58724d9ace29a8971ff6eeb578b856765a268691..372f2057bbfdd0b655e11d286deacf43b350bc0a 100644 (file)
@@ -30,7 +30,15 @@ ruleTester.run("no-confusing-arrow", rule, {
         { code: "var x = (a) => { return 1 ? 2 : 3; }", options: [{ allowParens: false }] },
 
         "var x = a => (1 ? 2 : 3)",
-        { code: "var x = a => (1 ? 2 : 3)", options: [{ allowParens: true }] }
+        { code: "var x = a => (1 ? 2 : 3)", options: [{ allowParens: true }] },
+
+        "var x = (a,b) => (1 ? 2 : 3)",
+        { code: "() => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] },
+        { code: "(a, b) => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] },
+        { code: "(a = b) => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] },
+        { code: "({ a }) => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] },
+        { code: "([a]) => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] },
+        { code: "(...a) => 1 ? 2 : 3", options: [{ onlyOneSimpleParam: true }] }
     ],
     invalid: [
         {
@@ -71,6 +79,48 @@ ruleTester.run("no-confusing-arrow", rule, {
             code: "var x = (a) => 1 ? 2 : 3",
             output: "var x = (a) => (1 ? 2 : 3)",
             errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = () => 1 ? 2 : 3",
+            output: "var x = () => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = () => 1 ? 2 : 3",
+            output: "var x = () => (1 ? 2 : 3)",
+            options: [{}],
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = () => 1 ? 2 : 3",
+            output: "var x = () => (1 ? 2 : 3)",
+            options: [{ onlyOneSimpleParam: false }],
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = (a, b) => 1 ? 2 : 3",
+            output: "var x = (a, b) => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = (a = b) => 1 ? 2 : 3",
+            output: "var x = (a = b) => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = ({ a }) => 1 ? 2 : 3",
+            output: "var x = ({ a }) => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = ([a]) => 1 ? 2 : 3",
+            output: "var x = ([a]) => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
+        },
+        {
+            code: "var x = (...a) => 1 ? 2 : 3",
+            output: "var x = (...a) => (1 ? 2 : 3)",
+            errors: [{ messageId: "confusing" }]
         }
     ]
 });
diff --git a/eslint/tests/lib/rules/no-constant-binary-expression.js b/eslint/tests/lib/rules/no-constant-binary-expression.js
new file mode 100644 (file)
index 0000000..c430c77
--- /dev/null
@@ -0,0 +1,313 @@
+/**
+ * @fileoverview Tests for no-constant-binary-expression rule.
+ * @author Jordan Eldredge <https://jordaneldredge.com>
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const rule = require("../../../lib/rules/no-constant-binary-expression");
+const { RuleTester } = require("../../../lib/rule-tester");
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2021, ecmaFeatures: { jsx: true } } });
+
+ruleTester.run("no-constant-binary-expression", rule, {
+    valid: [
+
+        // While this _would_ be a constant condition in React, ESLint has a policy of not attributing any specific behavior to JSX.
+        "<p /> && foo",
+        "<></> && foo",
+        "<p /> ?? foo",
+        "<></> ?? foo",
+        "arbitraryFunction(n) ?? foo",
+        "foo.Boolean(n) ?? foo",
+        "(x += 1) && foo",
+        "`${bar}` && foo",
+        "bar && foo",
+        "delete bar.baz && foo",
+        "true ? foo : bar", // We leave ConditionalExpression for `no-constant-condition`.
+        "new Foo() == true",
+        "foo == true",
+        "`${foo}` == true",
+        "`${foo}${bar}` == true",
+        "`0${foo}` == true",
+        "`00000000${foo}` == true",
+        "`0${foo}.000` == true",
+        "[n] == true",
+
+        "delete bar.baz === true",
+
+        "foo.Boolean(true) && foo",
+        "function Boolean(n) { return n; }; Boolean(x) ?? foo",
+        "function String(n) { return n; }; String(x) ?? foo",
+        "function Number(n) { return n; }; Number(x) ?? foo",
+        "function Boolean(n) { return Math.random(); }; Boolean(x) === 1",
+        "function Boolean(n) { return Math.random(); }; Boolean(1) == true",
+
+        "new Foo() === x",
+        "x === new someObj.Promise()",
+        "Boolean(foo) === true",
+        "function foo(undefined) { undefined ?? bar;}",
+        "function foo(undefined) { undefined == true;}",
+        "function foo(undefined) { undefined === true;}",
+        "[...arr, 1] == true",
+        "[,,,] == true",
+        { code: "new Foo() === bar;", globals: { Foo: "writable" } }
+    ],
+    invalid: [
+
+        // Error messages
+        { code: "[] && greeting", errors: [{ message: "Unexpected constant truthiness on the left-hand side of a `&&` expression." }] },
+        { code: "[] || greeting", errors: [{ message: "Unexpected constant truthiness on the left-hand side of a `||` expression." }] },
+        { code: "[] ?? greeting", errors: [{ message: "Unexpected constant nullishness on the left-hand side of a `??` expression." }] },
+        { code: "[] == true", errors: [{ message: "Unexpected constant binary expression. Compares constantly with the right-hand side of the `==`." }] },
+        { code: "true == []", errors: [{ message: "Unexpected constant binary expression. Compares constantly with the left-hand side of the `==`." }] },
+        { code: "[] != true", errors: [{ message: "Unexpected constant binary expression. Compares constantly with the right-hand side of the `!=`." }] },
+        { code: "[] === true", errors: [{ message: "Unexpected constant binary expression. Compares constantly with the right-hand side of the `===`." }] },
+        { code: "[] !== true", errors: [{ message: "Unexpected constant binary expression. Compares constantly with the right-hand side of the `!==`." }] },
+
+        // Motivating examples from the original proposal https://github.com/eslint/eslint/issues/13752
+        { code: "!foo == null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "!foo ?? bar", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a + b) / 2 ?? bar", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "String(foo.bar) ?? baz", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: '"hello" + name ?? ""', errors: [{ messageId: "constantShortCircuit" }] },
+        { code: '[foo?.bar ?? ""] ?? []', errors: [{ messageId: "constantShortCircuit" }] },
+
+        // Logical expression with constant truthiness
+        { code: "true && hello", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "true || hello", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "true && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "'' && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "100 && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "+100 && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "-100 && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "~100 && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "/[a-z]/ && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "Boolean([]) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "Boolean() && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "Boolean([], n) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "({}) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "[] && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(() => {}) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(function() {}) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(class {}) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(class { valueOf() { return x; } }) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(class { [x]() { return x; } }) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "new Foo() && foo", errors: [{ messageId: "constantShortCircuit" }] },
+
+        // (boxed values are always truthy)
+        { code: "new Boolean(unknown) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(bar = false) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(bar.baz = false) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(bar[0] = false) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "`hello ${hello}` && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "void bar && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "!true && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "typeof bar && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(bar, baz, true) && foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "undefined && foo", errors: [{ messageId: "constantShortCircuit" }] },
+
+        // Logical expression with constant nullishness
+        { code: "({}) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "([]) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(() => {}) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(function() {}) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(class {}) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "new Foo() ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "1 ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "/[a-z]/ ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "`${''}` ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a = true) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a += 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a -= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a *= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a /= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a %= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a <<= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a >>= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a >>>= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a |= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a ^= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(a &= 1) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "undefined ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "!bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "void bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "typeof bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "+bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "-bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "~bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "++bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "bar++ ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "--bar ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "bar-- ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(x == y) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(x + y) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(x / y) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(x instanceof String) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "(x in y) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "Boolean(x) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "String(x) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+        { code: "Number(x) ?? foo", errors: [{ messageId: "constantShortCircuit" }] },
+
+        // Binary expression with comparison to null
+        { code: "({}) != null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "null == ({})", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "undefined == ({})", errors: [{ messageId: "constantBinaryOperand" }] },
+
+        // Binary expression with loose comparison to boolean
+        { code: "({}) != true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "([]) == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "([a, b]) == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(() => {}) == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(function() {}) == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "void foo == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "typeof foo == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "![] == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true == class {}", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true == 1", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "undefined == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true == undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "`hello` == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "/[a-z]/ == true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == Boolean({})", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == Boolean()", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == Boolean(() => {}, foo)", errors: [{ messageId: "constantBinaryOperand" }] },
+
+        // Binary expression with strict comparison to boolean
+        { code: "({}) !== true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) == !({})", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "([]) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(function() {}) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(() => {}) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "!{} === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "typeof n === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "void n === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "+n === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "-n === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "~n === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "1 === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "'hello' === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "/[a-z]/ === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "undefined === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a = {}) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a += 1) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a -= 1) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a *= 1) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a %= 1) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a ** b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a << b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a >> b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a >>> b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "--a === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a-- === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "++a === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a++ === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a + b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a - b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a * b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a / b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a % b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a | b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a ^ b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a & b) === true", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "Boolean(0) === Boolean(1)", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true === String(x)", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true === Number(x)", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "Boolean(0) == !({})", errors: [{ messageId: "constantBinaryOperand" }] },
+
+        // Binary expression with strict comparison to null
+        { code: "({}) !== null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "([]) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(() => {}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(function() {}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(class {}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "new Foo() === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "`` === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "1 === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "'hello' === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "/[a-z]/ === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "null === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a++ === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "++a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "--a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a-- === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "!a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "typeof a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "delete a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "void a === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "undefined === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x = {}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x += y) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x -= y) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a, b, {}) === null", errors: [{ messageId: "constantBinaryOperand" }] },
+
+        // Binary expression with strict comparison to undefined
+        { code: "({}) !== undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "({}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "([]) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(() => {}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(function() {}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(class {}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "new Foo() === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "`` === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "1 === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "'hello' === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "/[a-z]/ === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "true === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "null === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a++ === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "++a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "--a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "a-- === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "!a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "typeof a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "delete a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "void a === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "undefined === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x = {}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x += y) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(x -= y) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+        { code: "(a, b, {}) === undefined", errors: [{ messageId: "constantBinaryOperand" }] },
+
+        /*
+         * If both sides are newly constructed objects, we can tell they will
+         * never be equal, even with == equality.
+         */
+        { code: "[a] == [a]", errors: [{ messageId: "bothAlwaysNew" }] },
+        { code: "[a] != [a]", errors: [{ messageId: "bothAlwaysNew" }] },
+        { code: "({}) == []", errors: [{ messageId: "bothAlwaysNew" }] },
+
+        // Comparing to always new objects
+        { code: "x === {}", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x !== {}", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === []", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (() => {})", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (function() {})", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (class {})", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === new Boolean()", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === new Promise()", env: { es6: true }, errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === new WeakSet()", env: { es6: true }, errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (foo, {})", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (y = {})", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === (y ? {} : [])", errors: [{ messageId: "alwaysNew" }] },
+        { code: "x === /[a-z]/", errors: [{ messageId: "alwaysNew" }] },
+
+        // It's not obvious what this does, but it compares the old value of `x` to the new object.
+        { code: "x === (x = {})", errors: [{ messageId: "alwaysNew" }] }
+    ]
+});
index 0b5f3c5a1dc9294bc5f479c205d73ca0b56129ca..af7bd355db45708656472220b84c08e568817e68 100644 (file)
@@ -175,7 +175,27 @@ ruleTester.run("no-constant-condition", rule, {
         "function* foo() {while (true) {function* foo() {yield;}yield;}}",
         "function* foo() { for (let x = yield; x < 10; x++) {yield;}yield;}",
         "function* foo() { for (let x = yield; ; x++) { yield; }}",
-        "if (new Number(x) + 1 === 2) {}"
+        "if (new Number(x) + 1 === 2) {}",
+
+        // #15467
+        "if([a]==[b]) {}",
+        "if (+[...a]) {}",
+        "if (+[...[...a]]) {}",
+        "if (`${[...a]}`) {}",
+        "if (`${[a]}`) {}",
+        "if (+[a]) {}",
+        "if (0 - [a]) {}",
+        "if (1 * [a]) {}",
+
+        // Boolean function
+        "if (Boolean(a)) {}",
+        "if (Boolean(...args)) {}",
+        "if (foo.Boolean(1)) {}",
+        "function foo(Boolean) { if (Boolean(1)) {} }",
+        "const Boolean = () => {}; if (Boolean(1)) {}",
+        { code: "if (Boolean()) {}", globals: { Boolean: "off" } },
+        "const undefined = 'lol'; if (undefined) {}",
+        { code: "if (undefined) {}", globals: { undefined: "off" } }
     ],
     invalid: [
         { code: "for(;true;);", errors: [{ messageId: "unexpected", type: "Literal" }] },
@@ -262,8 +282,6 @@ ruleTester.run("no-constant-condition", rule, {
 
         // #5228 , typeof conditions
         { code: "if(typeof x){}", errors: [{ messageId: "unexpected", type: "UnaryExpression" }] },
-        { code: "if(`${typeof x}`){}", errors: [{ messageId: "unexpected", type: "TemplateLiteral" }] },
-        { code: "if(`${''}${typeof x}`){}", errors: [{ messageId: "unexpected", type: "TemplateLiteral" }] },
         { code: "if(typeof 'abc' === 'string'){}", errors: [{ messageId: "unexpected", type: "BinaryExpression" }] },
         { code: "if(a = typeof b){}", errors: [{ messageId: "unexpected", type: "AssignmentExpression" }] },
         { code: "if(a, typeof b){}", errors: [{ messageId: "unexpected", type: "SequenceExpression" }] },
@@ -358,18 +376,6 @@ ruleTester.run("no-constant-condition", rule, {
             code: "if(''+[]) {}",
             errors: [{ messageId: "unexpected", type: "BinaryExpression" }]
         },
-        {
-            code: "if([a]==[a]) {}",
-            errors: [{ messageId: "unexpected", type: "BinaryExpression" }]
-        },
-        {
-            code: "if([a] - '') {}",
-            errors: [{ messageId: "unexpected", type: "BinaryExpression" }]
-        },
-        {
-            code: "if(+[a]) {}",
-            errors: [{ messageId: "unexpected", type: "UnaryExpression" }]
-        },
         {
             code: "if(+1) {}",
             errors: [{ messageId: "unexpected", type: "UnaryExpression" }]
@@ -397,7 +403,21 @@ ruleTester.run("no-constant-condition", rule, {
         // Boxed primitives are always truthy
         { code: "if(new Boolean(foo)) {}", errors: [{ messageId: "unexpected" }] },
         { code: "if(new String(foo)) {}", errors: [{ messageId: "unexpected" }] },
-        { code: "if(new Number(foo)) {}", errors: [{ messageId: "unexpected" }] }
+        { code: "if(new Number(foo)) {}", errors: [{ messageId: "unexpected" }] },
+
+        // Spreading a constant array
+        { code: "if(`${[...['a']]}`) {}", errors: [{ messageId: "unexpected" }] },
+
+        /*
+         * undefined is always falsy (except in old browsers that let you
+         * re-assign, but that's an obscure enough edge case to not worry about)
+         */
+        { code: "if (undefined) {}", errors: [{ messageId: "unexpected" }] },
 
+        // Coercion to boolean via Boolean function
+        { code: "if (Boolean(1)) {}", errors: [{ messageId: "unexpected" }] },
+        { code: "if (Boolean()) {}", errors: [{ messageId: "unexpected" }] },
+        { code: "if (Boolean([a])) {}", errors: [{ messageId: "unexpected" }] },
+        { code: "if (Boolean(1)) { function Boolean() {}}", errors: [{ messageId: "unexpected" }] }
     ]
 });
index 059e50dc4e7b1a2b24d6cd20f21c1aad043291f6..14abfbce4505cd81a47902ab5e56131c97adfc6d 100644 (file)
@@ -26,7 +26,14 @@ ruleTester.run("no-control-regex", rule, {
         "var regex = RegExp('x1f')",
         "new RegExp('[')",
         "RegExp('[')",
-        "new (function foo(){})('\\x1f')"
+        "new (function foo(){})('\\x1f')",
+        { code: String.raw`/\u{20}/u`, parserOptions: { ecmaVersion: 2015 } },
+        String.raw`/\u{1F}/`,
+        String.raw`/\u{1F}/g`,
+        String.raw`new RegExp("\\u{20}", "u")`,
+        String.raw`new RegExp("\\u{1F}")`,
+        String.raw`new RegExp("\\u{1F}", "g")`,
+        String.raw`new RegExp("\\u{1F}", flags)` // when flags are unknown, this rule assumes there's no `u` flag
     ],
     invalid: [
         { code: String.raw`var regex = /\x1f/`, errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }] },
@@ -46,6 +53,38 @@ ruleTester.run("no-control-regex", rule, {
             code: String.raw`var regex = /(?<\u{1d49c}>.)\x1f/`,
             parserOptions: { ecmaVersion: 2020 },
             errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`new RegExp("\\u001F", flags)`,
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`/\u{1111}*\x1F/u`,
+            parserOptions: { ecmaVersion: 2015 },
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`new RegExp("\\u{1111}*\\x1F", "u")`,
+            parserOptions: { ecmaVersion: 2015 },
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`/\u{1F}/u`,
+            parserOptions: { ecmaVersion: 2015 },
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`/\u{1F}/gui`,
+            parserOptions: { ecmaVersion: 2015 },
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`new RegExp("\\u{1F}", "u")`,
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
+        },
+        {
+            code: String.raw`new RegExp("\\u{1F}", "gui")`,
+            errors: [{ messageId: "unexpected", data: { controlChars: "\\x1f" }, type: "Literal" }]
         }
     ]
 });
index 79ba4a1eb11bfb26c8c53d54a11f04847919220e..840bcb20f1dedebc83f83daaded482596f04b1ef 100644 (file)
@@ -42,10 +42,15 @@ ruleTester.run("no-eval", rule, {
         { code: "function foo() { var eval = 'foo'; globalThis[eval]('foo') }", env: { es2020: true } },
         "this.noeval('foo');",
         "function foo() { 'use strict'; this.eval('foo'); }",
+        { code: "'use strict'; this.eval('foo');", parserOptions: { ecmaFeatures: { globalReturn: true } } },
+        { code: "this.eval('foo');", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "function foo() { this.eval('foo'); }", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "function foo() { this.eval('foo'); }", parserOptions: { ecmaFeatures: { impliedStrict: true } } },
         "var obj = {foo: function() { this.eval('foo'); }}",
         "var obj = {}; obj.foo = function() { this.eval('foo'); }",
+        { code: "() => { this.eval('foo') }", parserOptions: { ecmaVersion: 6, sourceType: "module" } },
+        { code: "function f() { 'use strict'; () => { this.eval('foo') } }", parserOptions: { ecmaVersion: 6 } },
+        { code: "(function f() { 'use strict'; () => { this.eval('foo') } })", parserOptions: { ecmaVersion: 6 } },
         { code: "class A { foo() { this.eval(); } }", parserOptions: { ecmaVersion: 6 } },
         { code: "class A { static foo() { this.eval(); } }", parserOptions: { ecmaVersion: 6 } },
         { code: "class A { field = this.eval(); }", parserOptions: { ecmaVersion: 2022 } },
@@ -92,6 +97,11 @@ ruleTester.run("no-eval", rule, {
         { code: "(0, window['eval'])('foo')", env: { browser: true }, errors: [{ messageId: "unexpected", type: "MemberExpression", column: 12, endColumn: 18 }] },
         { code: "var EVAL = eval; EVAL('foo')", errors: [{ messageId: "unexpected", type: "Identifier", column: 12, endColumn: 16 }] },
         { code: "var EVAL = this.eval; EVAL('foo')", errors: [{ messageId: "unexpected", type: "MemberExpression", column: 17, endColumn: 21 }] },
+        { code: "'use strict'; var EVAL = this.eval; EVAL('foo')", errors: [{ messageId: "unexpected", type: "MemberExpression", column: 31, endColumn: 35 }] },
+        { code: "() => { this.eval('foo'); }", parserOptions: { ecmaVersion: 6 }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 14, endColumn: 18 }] },
+        { code: "() => { 'use strict'; this.eval('foo'); }", parserOptions: { ecmaVersion: 6 }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 28, endColumn: 32 }] },
+        { code: "'use strict'; () => { this.eval('foo'); }", parserOptions: { ecmaVersion: 6 }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 28, endColumn: 32 }] },
+        { code: "() => { 'use strict'; () => { this.eval('foo'); } }", parserOptions: { ecmaVersion: 6 }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 36, endColumn: 40 }] },
         { code: "(function(exe){ exe('foo') })(eval);", errors: [{ messageId: "unexpected", type: "Identifier", column: 31, endColumn: 35 }] },
         { code: "window.eval('foo')", env: { browser: true }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 8, endColumn: 12 }] },
         { code: "window.window.eval('foo')", env: { browser: true }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 15, endColumn: 19 }] },
@@ -100,6 +110,7 @@ ruleTester.run("no-eval", rule, {
         { code: "global.global.eval('foo')", env: { node: true }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 15, endColumn: 19 }] },
         { code: "global.global[`eval`]('foo')", parserOptions: { ecmaVersion: 6 }, env: { node: true }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 15, endColumn: 21 }] },
         { code: "this.eval('foo')", errors: [{ messageId: "unexpected", type: "CallExpression", column: 6, endColumn: 10 }] },
+        { code: "'use strict'; this.eval('foo')", errors: [{ messageId: "unexpected", type: "CallExpression", column: 20, endColumn: 24 }] },
         { code: "function foo() { this.eval('foo') }", errors: [{ messageId: "unexpected", type: "CallExpression", column: 23, endColumn: 27 }] },
         { code: "var EVAL = globalThis.eval; EVAL('foo')", env: { es2020: true }, errors: [{ messageId: "unexpected", type: "MemberExpression", column: 23, endColumn: 27 }] },
         { code: "globalThis.eval('foo')", env: { es2020: true }, errors: [{ messageId: "unexpected", type: "CallExpression", column: 12, endColumn: 16 }] },
@@ -134,11 +145,23 @@ ruleTester.run("no-eval", rule, {
             parserOptions: { ecmaVersion: 2022 },
             errors: [{ messageId: "unexpected" }]
         },
+        {
+            code: "'use strict'; class C { [this.eval('foo')] }",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unexpected" }]
+        },
 
         {
             code: "class A { static {} [this.eval()]; }",
             parserOptions: { ecmaVersion: 2022 },
             errors: [{ messageId: "unexpected" }]
+        },
+
+        // in es3, "use strict" directives do not apply
+        {
+            code: "function foo() { 'use strict'; this.eval(); }",
+            parserOptions: { ecmaVersion: 3 },
+            errors: [{ messageId: "unexpected" }]
         }
     ]
 });
index cb488c891e52c90be30c40ef09c323ca60580d95..557b641cf50b06e55492c2d876c8fd431193d282 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @fileoverview Disallow parenthesesisng higher precedence subexpressions.
+ * @fileoverview Disallow parenthesising higher precedence subexpressions.
  * @author Michael Ficarra
  */
 
@@ -2334,13 +2334,8 @@ ruleTester.run("no-extra-parens", rule, {
         invalid("[...(a.b)] = []", "[...a.b] = []", "MemberExpression"),
         invalid("({ a: (b) } = {})", "({ a: b } = {})", "Identifier"),
         invalid("({ a: (b.c) } = {})", "({ a: b.c } = {})", "MemberExpression"),
-
-        /*
-         * TODO: Add these tests for RestElement's parenthesized arguments in object patterns when that becomes supported by Espree.
-         *
-         * invalid("({ ...(a) } = {})", "({ ...a } = {})", "Identifier"),
-         * invalid("({ ...(a.b) } = {})", "({ ...a.b } = {})", "MemberExpression")
-         */
+        invalid("({ ...(a) } = {})", "({ ...a } = {})", "Identifier"),
+        invalid("({ ...(a.b) } = {})", "({ ...a.b } = {})", "MemberExpression"),
 
         // https://github.com/eslint/eslint/issues/11706 (also in valid[])
         {
index 0b98d3293e91cb485942ac4666a241c3fe084c36..d6f6c6f93f2a1cba8baa63290fcf1b5514396792 100644 (file)
@@ -92,6 +92,22 @@ ruleTester.run("no-fallthrough", rule, {
             options: [{
                 commentPattern: "break[\\s\\w]+omitted"
             }]
+        },
+        {
+            code: "switch(foo) { case 0: \n\n\n case 1: b(); }",
+            options: [{ allowEmptyCase: true }]
+        },
+        {
+            code: "switch(foo) { case 0: \n /* with comments */  \n case 1: b(); }",
+            options: [{ allowEmptyCase: true }]
+        },
+        {
+            code: "switch (a) {\n case 1: ; break; \n case 3: }",
+            options: [{ allowEmptyCase: true }]
+        },
+        {
+            code: "switch (a) {\n case 1: ; break; \n case 3: }",
+            options: [{ allowEmptyCase: false }]
         }
     ],
     invalid: [
@@ -214,6 +230,73 @@ ruleTester.run("no-fallthrough", rule, {
                     column: 1
                 }
             ]
+        },
+        {
+            code: "switch(foo) { case 0: \n /* with comments */  \ncase 1: b(); }",
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 3,
+                    column: 1
+                }
+            ]
+        },
+        {
+            code: "switch(foo) { case 0:\n\ncase 1: b(); }",
+            options: [{
+                allowEmptyCase: false
+            }],
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 3,
+                    column: 1
+                }
+            ]
+        },
+        {
+            code: "switch(foo) { case 0:\n\ncase 1: b(); }",
+            options: [{}],
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 3,
+                    column: 1
+                }
+            ]
+        },
+        {
+            code: "switch (a) { case 1: \n ; case 2:  }",
+            options: [{ allowEmptyCase: false }],
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 2,
+                    column: 4
+                }
+            ]
+        },
+        {
+            code: "switch (a) { case 1: ; case 2: ; case 3: }",
+            options: [{ allowEmptyCase: true }],
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 1,
+                    column: 24
+                },
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 1,
+                    column: 34
+                }
+            ]
         }
     ]
 });
index 463c86eea660e448a73a0e32a23cc44bfe892c97..7eb0cac730f514aad73e042ae707c3e6367b2407 100644 (file)
@@ -39,6 +39,9 @@ ruleTester.run("no-inline-comments", rule, {
         "// A solitary comment",
         "var a = 1; // eslint-disable-line no-debugger",
         "var a = 1; /* eslint-disable-line no-debugger */",
+        "foo(); /* global foo */",
+        "foo(); /* globals foo */",
+        "var foo; /* exported foo */",
 
         // JSX exception
         `var a = (
index 62033fd389e0bf09b01d46935c7ac96926ff21f7..dd72be4999150e0cbd0b474a9d122c42a68b5dea 100644 (file)
@@ -86,8 +86,7 @@ function extractPatterns(patterns, type) {
         return thisPattern;
     }));
 
-    // Flatten.
-    return [].concat(...patternsList);
+    return patternsList.flat();
 }
 
 //------------------------------------------------------------------------------
@@ -106,8 +105,8 @@ const patterns = [
         code: "console.log(this); z(x => console.log(x, this));",
         parserOptions: { ecmaVersion: 6 },
         errors,
-        valid: [NORMAL],
-        invalid: [USE_STRICT, IMPLIED_STRICT, MODULES]
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES]
     },
     {
         code: "console.log(this); z(x => console.log(x, this));",
@@ -119,6 +118,24 @@ const patterns = [
         valid: [NORMAL],
         invalid: [USE_STRICT, IMPLIED_STRICT, MODULES]
     },
+    {
+        code: "() => { this }; this;",
+        parserOptions: {
+            ecmaVersion: 6
+        },
+        errors,
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES]
+    },
+    {
+        code: "this.eval('foo');",
+        parserOptions: {
+            ecmaVersion: 6
+        },
+        errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }],
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES]
+    },
 
     // IIFE.
     {
@@ -365,8 +382,8 @@ const patterns = [
     {
         code: "obj.foo = (() => () => { console.log(this); z(x => console.log(x, this)); })();",
         parserOptions: { ecmaVersion: 6 },
-        valid: [NORMAL],
-        invalid: [USE_STRICT, IMPLIED_STRICT, MODULES],
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES],
         errors
     },
     {
@@ -745,6 +762,18 @@ const patterns = [
     },
 
     // Class fields.
+    {
+        code: "class C { field = this }",
+        parserOptions: { ecmaVersion: 2022 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES],
+        invalid: []
+    },
+    {
+        code: "class C { static field = this }",
+        parserOptions: { ecmaVersion: 2022 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES],
+        invalid: []
+    },
     {
         code: "class C { field = console.log(this); }",
         parserOptions: { ecmaVersion: 2022 },
@@ -772,8 +801,22 @@ const patterns = [
     {
         code: "class C { [this.foo]; }",
         parserOptions: { ecmaVersion: 2022 },
-        valid: [NORMAL], // the global this in non-strict mode is OK.
-        invalid: [USE_STRICT, IMPLIED_STRICT, MODULES],
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT], // `this` is the top-level `this`
+        invalid: [MODULES],
+        errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
+    },
+    {
+        code: "class C { foo = () => this; }",
+        parserOptions: { ecmaVersion: 2022 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES],
+        invalid: [],
+        errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
+    },
+    {
+        code: "class C { foo = () => { this }; }",
+        parserOptions: { ecmaVersion: 2022 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES],
+        invalid: [],
         errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
     },
 
@@ -817,12 +860,27 @@ const patterns = [
         invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES],
         errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
     },
+    {
+        code: "class C { static {} [this]; }",
+        parserOptions: { ecmaVersion: 2022 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES],
+        errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
+    },
     {
         code: "class C { static {} [this.x]; }",
         parserOptions: { ecmaVersion: 2022 },
-        valid: [NORMAL],
-        invalid: [USE_STRICT, IMPLIED_STRICT, MODULES],
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: [MODULES],
         errors: [{ messageId: "unexpectedThis", type: "ThisExpression" }]
+    },
+
+    // in es3, "use strict" directives do not apply
+    {
+        code: "function foo() { 'use strict'; this.eval(); }",
+        parserOptions: { ecmaVersion: 3 },
+        valid: [NORMAL, USE_STRICT, IMPLIED_STRICT],
+        invalid: []
     }
 ];
 
index a02e5e13e327ea45f1a9f9f25437c264617b72b4..0aaf34e59422ba5ecac5e54c58d55529a15a6291 100644 (file)
@@ -76,223 +76,549 @@ ruleTester.run("no-misleading-character-class", rule, {
         // RegExp Literals.
         {
             code: "var r = /[👍]/",
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[👍]/u" }]
+            }]
         },
         {
             code: "var r = /[\\uD83D\\uDC4D]/",
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[\\uD83D\\uDC4D]/u" }]
+            }]
+        },
+        {
+            code: "var r = /[👍]/",
+            parserOptions: { ecmaVersion: 3 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // ecmaVersion doesn't support the 'u' flag
+            }]
+        },
+        {
+            code: "var r = /[👍]/",
+            parserOptions: { ecmaVersion: 5 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // ecmaVersion doesn't support the 'u' flag
+            }]
+        },
+        {
+            code: "var r = /[👍]\\a/",
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // pattern would be invalid with the 'u' flag
+            }]
+        },
+        {
+            code: "var r = /(?<=[👍])/",
+            parserOptions: { ecmaVersion: 9 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /(?<=[👍])/u" }]
+            }]
+        },
+        {
+            code: "var r = /(?<=[👍])/",
+            parserOptions: { ecmaVersion: 2018 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /(?<=[👍])/u" }]
+            }]
         },
         {
             code: "var r = /[Á]/",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[Á]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u0041\\u0301]/",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u0041\\u0301]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u{41}\\u{301}]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[❇️]/",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[❇️]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u2747\\uFE0F]/",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u2747\\uFE0F]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u{2747}\\u{FE0F}]/u",
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[👶🏻]/",
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[👶🏻]/u" }]
+            }]
         },
         {
             code: "var r = /[👶🏻]/u",
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\uD83D\\uDC76\\uD83C\\uDFFB]/u",
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u{1F476}\\u{1F3FB}]/u",
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[🇯🇵]/",
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[🇯🇵]/u" }]
+            }]
+        },
+        {
+            code: "var r = /[🇯🇵]/i",
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[🇯🇵]/iu" }]
+            }]
         },
         {
             code: "var r = /[🇯🇵]/u",
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\uD83C\\uDDEF\\uD83C\\uDDF5]/u",
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u{1F1EF}\\u{1F1F5}]/u",
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[👨‍👩‍👦]/",
             errors: [
-                { messageId: "surrogatePairWithoutUFlag" },
-                { messageId: "zwj" }
+                {
+                    messageId: "surrogatePairWithoutUFlag",
+                    suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = /[👨‍👩‍👦]/u" }]
+                },
+                {
+                    messageId: "zwj",
+                    suggestions: null
+                }
             ]
         },
         {
             code: "var r = /[👨‍👩‍👦]/u",
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66]/u",
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
         {
             code: "var r = /[\\u{1F468}\\u{200D}\\u{1F469}\\u{200D}\\u{1F466}]/u",
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
 
         // RegExp constructors.
         {
             code: String.raw`var r = new RegExp("[👍]", "")`,
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[👍]", "u")` }]
+            }]
+        },
+        {
+            code: "var r = new RegExp('[👍]', ``)",
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = new RegExp('[👍]', `u`)" }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[👍]", flags)`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null
+            }]
+        },
+        {
+            code: String.raw`const flags = ""; var r = new RegExp("[👍]", flags)`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\uD83D\\uDC4D]", "")`,
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[\\uD83D\\uDC4D]", "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[👍]", "")`,
+            parserOptions: { ecmaVersion: 3 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // ecmaVersion doesn't support the 'u' flag
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[👍]", "")`,
+            parserOptions: { ecmaVersion: 5 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // ecmaVersion doesn't support the 'u' flag
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[👍]\\a", "")`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: null // pattern would be invalid with the 'u' flag
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("/(?<=[👍])", "")`,
+            parserOptions: { ecmaVersion: 9 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("/(?<=[👍])", "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("/(?<=[👍])", "")`,
+            parserOptions: { ecmaVersion: 2018 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("/(?<=[👍])", "u")` }]
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[Á]", "")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[Á]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u0041\\u0301]", "")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u0041\\u0301]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u{41}\\u{301}]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[❇️]", "")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[❇️]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u2747\\uFE0F]", "")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u2747\\uFE0F]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u{2747}\\u{FE0F}]", "u")`,
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[👶🏻]", "")`,
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[👶🏻]", "u")` }]
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[👶🏻]", "u")`,
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\uD83D\\uDC76\\uD83C\\uDFFB]", "u")`,
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u{1F476}\\u{1F3FB}]", "u")`,
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[🇯🇵]", "")`,
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[🇯🇵]", "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[🇯🇵]", "i")`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[🇯🇵]", "iu")` }]
+            }]
+        },
+        {
+            code: "var r = new RegExp('[🇯🇵]', `i`)",
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = new RegExp('[🇯🇵]', `iu`)" }]
+            }]
+        },
+        {
+            code: "var r = new RegExp('[🇯🇵]', `${foo}`)",
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: "var r = new RegExp('[🇯🇵]', `${foo}u`)" }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[🇯🇵]")`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[🇯🇵]", "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp("[🇯🇵]",)`,
+            parserOptions: { ecmaVersion: 2017 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[🇯🇵]", "u",)` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp(("[🇯🇵]"))`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp(("[🇯🇵]"), "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp((("[🇯🇵]")))`,
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp((("[🇯🇵]")), "u")` }]
+            }]
+        },
+        {
+            code: String.raw`var r = new RegExp(("[🇯🇵]"),)`,
+            parserOptions: { ecmaVersion: 2017 },
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp(("[🇯🇵]"), "u",)` }]
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[🇯🇵]", "u")`,
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\uD83C\\uDDEF\\uD83C\\uDDF5]", "u")`,
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u{1F1EF}\\u{1F1F5}]", "u")`,
-            errors: [{ messageId: "regionalIndicatorSymbol" }]
+            errors: [{
+                messageId: "regionalIndicatorSymbol",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[👨‍👩‍👦]", "")`,
             errors: [
-                { messageId: "surrogatePairWithoutUFlag" },
-                { messageId: "zwj" }
+                {
+                    messageId: "surrogatePairWithoutUFlag",
+                    suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new RegExp("[👨‍👩‍👦]", "u")` }]
+                },
+                {
+                    messageId: "zwj",
+                    suggestions: null
+                }
             ]
         },
         {
             code: String.raw`var r = new RegExp("[👨‍👩‍👦]", "u")`,
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\uD83D\\uDC68\\u200D\\uD83D\\uDC69\\u200D\\uD83D\\uDC66]", "u")`,
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new RegExp("[\\u{1F468}\\u{200D}\\u{1F469}\\u{200D}\\u{1F466}]", "u")`,
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new globalThis.RegExp("[❇️]", "")`,
             env: { es2020: true },
-            errors: [{ messageId: "combiningClass" }]
+            errors: [{
+                messageId: "combiningClass",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new globalThis.RegExp("[👶🏻]", "u")`,
             env: { es2020: true },
-            errors: [{ messageId: "emojiModifier" }]
+            errors: [{
+                messageId: "emojiModifier",
+                suggestions: null
+            }]
         },
         {
             code: String.raw`var r = new globalThis.RegExp("[🇯🇵]", "")`,
             env: { es2020: true },
-            errors: [{ messageId: "surrogatePairWithoutUFlag" }]
+            errors: [{
+                messageId: "surrogatePairWithoutUFlag",
+                suggestions: [{ messageId: "suggestUnicodeFlag", output: String.raw`var r = new globalThis.RegExp("[🇯🇵]", "u")` }]
+            }]
         },
         {
             code: String.raw`var r = new globalThis.RegExp("[\\u{1F468}\\u{200D}\\u{1F469}\\u{200D}\\u{1F466}]", "u")`,
             env: { es2020: true },
-            errors: [{ messageId: "zwj" }]
+            errors: [{
+                messageId: "zwj",
+                suggestions: null
+            }]
         }
     ]
 });
index 7920d9900fbd89b8cd681c3c70d8662b5dad16da..94db78ff81dcd9d33b0687f8c65024263d1f679d 100644 (file)
@@ -39,7 +39,7 @@ function errorAt(line, column, type) {
 
 const ruleTester = new RuleTester();
 
-ruleTester.run("no-mutli-assign", rule, {
+ruleTester.run("no-multi-assign", rule, {
     valid: [
         "var a, b, c,\nd = 0;",
         "var a = 1; var b = 2; var c = 3;\nvar d = 0;",
index dd2839e728c3096c2520fcbd72e00db6a514c9c8..a48bf5a10319f554fb73859fefb9346a2e7625b3 100644 (file)
@@ -31,77 +31,77 @@ ruleTester.run("no-octal", rule, {
         {
             code: "var a = 01234;",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "a = 1 + 01234;",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "00",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "08",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "09.1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "09e1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "09.1e1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "018",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "019.1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "019e1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         },
         {
             code: "019.1e1",
             errors: [{
-                messageId: "noOcatal",
+                messageId: "noOctal",
                 type: "Literal"
             }]
         }
index bbbe5808171b1ea00959c9a8e5854336c080f56a..5754d19945f9588faf8ba366735a6edac3f925d1 100644 (file)
@@ -105,8 +105,8 @@ ruleTester.run("no-redeclare", rule, {
             options: [{ builtinGlobals: true }],
             env: { browser: false }
         },
-        { code: "var glovalThis = foo", options: [{ builtinGlobals: true }], env: { es6: true } },
-        { code: "var glovalThis = foo", options: [{ builtinGlobals: true }], env: { es2017: true } },
+        { code: "var globalThis = foo", options: [{ builtinGlobals: true }], env: { es6: true } },
+        { code: "var globalThis = foo", options: [{ builtinGlobals: true }], env: { es2017: true } },
 
         // Comments and built-ins.
         {
index ac0602a25b29f43215eaec3b932e04cd9edbe24b..631fd6f02fa3f9e1f863ef788082ad0adb2bfa0d 100644 (file)
@@ -16,7 +16,7 @@ const { RuleTester } = require("../../../lib/rule-tester");
 // Tests
 //------------------------------------------------------------------------------
 
-const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2020, sourceType: "module" } });
+const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2022, sourceType: "module" } });
 
 ruleTester.run("no-restricted-exports", rule, {
     valid: [
@@ -57,8 +57,12 @@ ruleTester.run("no-restricted-exports", rule, {
         { code: "var b; export { b as a };", options: [{ restrictedNamedExports: ["x"] }] },
         { code: "export { a } from 'foo';", options: [{ restrictedNamedExports: ["x"] }] },
         { code: "export { b as a } from 'foo';", options: [{ restrictedNamedExports: ["x"] }] },
+        { code: "export { '' } from 'foo';", options: [{ restrictedNamedExports: ["undefined"] }] },
+        { code: "export { '' } from 'foo';", options: [{ restrictedNamedExports: [" "] }] },
+        { code: "export { ' ' } from 'foo';", options: [{ restrictedNamedExports: [""] }] },
+        { code: "export { ' a', 'a ' } from 'foo';", options: [{ restrictedNamedExports: ["a"] }] },
 
-        // does not mistakenly disallow non-exported identifiers that appear in named export declarations
+        // does not mistakenly disallow non-exported names that appear in named export declarations
         { code: "export var b = a;", options: [{ restrictedNamedExports: ["a"] }] },
         { code: "export let [b = a] = [];", options: [{ restrictedNamedExports: ["a"] }] },
         { code: "export const [b] = [a];", options: [{ restrictedNamedExports: ["a"] }] },
@@ -69,7 +73,10 @@ ruleTester.run("no-restricted-exports", rule, {
         { code: "export class A { a(){} }", options: [{ restrictedNamedExports: ["a"] }] },
         { code: "export class A extends B {}", options: [{ restrictedNamedExports: ["B"] }] },
         { code: "var a; export { a as b };", options: [{ restrictedNamedExports: ["a"] }] },
+        { code: "var a; export { a as 'a ' };", options: [{ restrictedNamedExports: ["a"] }] },
         { code: "export { a as b } from 'foo';", options: [{ restrictedNamedExports: ["a"] }] },
+        { code: "export { a as 'a ' } from 'foo';", options: [{ restrictedNamedExports: ["a"] }] },
+        { code: "export { 'a' as 'a ' } from 'foo';", options: [{ restrictedNamedExports: ["a"] }] },
 
         // does not check source in re-export declarations
         { code: "export { b } from 'a';", options: [{ restrictedNamedExports: ["a"] }] },
@@ -188,6 +195,59 @@ ruleTester.run("no-restricted-exports", rule, {
             errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Identifier" }]
         },
 
+        // string literals
+        {
+            code: "let a; export { a as 'a' };",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Literal", column: 22 }]
+        },
+        {
+            code: "let a; export { a as 'b' };",
+            options: [{ restrictedNamedExports: ["b"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "b" }, type: "Literal", column: 22 }]
+        },
+        {
+            code: "let a; export { a as ' b ' };",
+            options: [{ restrictedNamedExports: [" b "] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: " b " }, type: "Literal", column: 22 }]
+        },
+        {
+            code: "let a; export { a as '👍' };",
+            options: [{ restrictedNamedExports: ["👍"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "👍" }, type: "Literal", column: 22 }]
+        },
+        {
+            code: "export { 'a' } from 'foo';",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Literal" }]
+        },
+        {
+            code: "export { '' } from 'foo';",
+            options: [{ restrictedNamedExports: [""] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "" }, type: "Literal" }]
+        },
+        {
+            code: "export { ' ' } from 'foo';",
+            options: [{ restrictedNamedExports: [" "] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: " " }, type: "Literal" }]
+        },
+        {
+            code: "export { b as 'a' } from 'foo';",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Literal" }]
+        },
+        {
+            code: "export { b as '\\u0061' } from 'foo';",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Literal" }]
+        },
+        {
+            code: "export * as 'a' from 'foo';",
+            options: [{ restrictedNamedExports: ["a"] }],
+            errors: [{ messageId: "restrictedNamed", data: { name: "a" }, type: "Literal" }]
+        },
+
+
         // destructuring
         {
             code: "export var [a] = [];",
@@ -341,7 +401,7 @@ ruleTester.run("no-restricted-exports", rule, {
 
         // Note: duplicate identifiers in the same export declaration are a 'duplicate export' syntax error. Example: export var a, a;
 
-        // invalid and valid or multiple ivalid in the same declaration
+        // invalid and valid or multiple invalid in the same declaration
         {
             code: "export var a, b;",
             options: [{ restrictedNamedExports: ["a"] }],
index c86e67ecf65d6e045e3d69140c12a2a319a858d9..5403812de3689bf5dce0d7e0393dd09edb864cd9 100644 (file)
@@ -16,7 +16,7 @@ const rule = require("../../../lib/rules/no-restricted-imports"),
 // Tests
 //------------------------------------------------------------------------------
 
-const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2020, sourceType: "module" } });
+const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2022, sourceType: "module" } });
 
 ruleTester.run("no-restricted-imports", rule, {
     valid: [
@@ -54,6 +54,16 @@ ruleTester.run("no-restricted-imports", rule, {
             code: "import withPatterns from \"foo/bar\";",
             options: [{ patterns: [{ group: ["foo/*", "!foo/bar"], message: "foo is forbidden, use bar instead" }] }]
         },
+        {
+            code: "import withPatternsCaseSensitive from 'foo';",
+            options: [{
+                patterns: [{
+                    group: ["FOO"],
+                    message: "foo is forbidden, use bar instead",
+                    caseSensitive: true
+                }]
+            }]
+        },
         {
             code: "import AllowedObject from \"foo\";",
             options: [{
@@ -92,6 +102,34 @@ ruleTester.run("no-restricted-imports", rule, {
                 }]
             }]
         },
+        {
+            code: "import { 'AllowedObject' as bar } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: ["DisallowedObject"],
+                    message: "Please import 'DisallowedObject' from /bar/ instead."
+                }]
+            }]
+        },
+        {
+            code: "import { ' ' as bar } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: [""]
+                }]
+            }]
+        },
+        {
+            code: "import { '' as bar } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: [" "]
+                }]
+            }]
+        },
         {
             code: "import { DisallowedObject } from \"foo\";",
             options: [{
@@ -112,6 +150,16 @@ ruleTester.run("no-restricted-imports", rule, {
                 }]
             }]
         },
+        {
+            code: "import { 'AllowedObject' as DisallowedObject } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: ["DisallowedObject"],
+                    message: "Please import 'DisallowedObject' from /bar/ instead."
+                }]
+            }]
+        },
         {
             code: "import { AllowedObject, AllowedObjectTwo } from \"foo\";",
             options: [{
@@ -196,6 +244,44 @@ ruleTester.run("no-restricted-imports", rule, {
                 name: "bar",
                 importNames: ["DisallowedObject"]
             }]
+        },
+        {
+            code: "export { 'AllowedObject' } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: ["DisallowedObject"]
+                }]
+            }]
+        },
+        {
+            code: "export { 'AllowedObject' as DisallowedObject } from \"foo\";",
+            options: [{
+                paths: [{
+                    name: "foo",
+                    importNames: ["DisallowedObject"]
+                }]
+            }]
+        },
+        {
+            code: "import { Bar } from '../../my/relative-module';",
+            options: [{
+                patterns: [{
+                    group: ["**/my/relative-module"],
+                    importNames: ["Foo"]
+                }]
+            }]
+        },
+        {
+
+            // Default import should not be reported unless importNames includes 'default'
+            code: "import Foo from '../../my/relative-module';",
+            options: [{
+                patterns: [{
+                    group: ["**/my/relative-module"],
+                    importNames: ["Foo"]
+                }]
+            }]
         }
     ],
     invalid: [{
@@ -288,6 +374,16 @@ ruleTester.run("no-restricted-imports", rule, {
             column: 1,
             endColumn: 36
         }]
+    }, {
+        code: "import withPatternsCaseInsensitive from 'foo';",
+        options: [{ patterns: [{ group: ["FOO"] }] }],
+        errors: [{
+            message: "'foo' import is restricted from being used by a pattern.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 1,
+            endColumn: 47
+        }]
     }, {
         code: "import withGitignores from \"foo/bar\";",
         options: [{ patterns: ["foo/*", "!foo/baz"] }],
@@ -344,6 +440,70 @@ ruleTester.run("no-restricted-imports", rule, {
             column: 9,
             endColumn: 17
         }]
+    }, {
+        code: "export {'foo' as b} from \"fs\";",
+        options: [{
+            paths: [{
+                name: "fs",
+                importNames: ["foo"],
+                message: "Don't import 'foo'."
+            }]
+        }],
+        errors: [{
+            message: "'foo' import from 'fs' is restricted. Don't import 'foo'.",
+            type: "ExportNamedDeclaration",
+            line: 1,
+            column: 9,
+            endColumn: 19
+        }]
+    }, {
+        code: "export {'foo'} from \"fs\";",
+        options: [{
+            paths: [{
+                name: "fs",
+                importNames: ["foo"],
+                message: "Don't import 'foo'."
+            }]
+        }],
+        errors: [{
+            message: "'foo' import from 'fs' is restricted. Don't import 'foo'.",
+            type: "ExportNamedDeclaration",
+            line: 1,
+            column: 9,
+            endColumn: 14
+        }]
+    }, {
+        code: "export {'👍'} from \"fs\";",
+        options: [{
+            paths: [{
+                name: "fs",
+                importNames: ["👍"],
+                message: "Don't import '👍'."
+            }]
+        }],
+        errors: [{
+            message: "'👍' import from 'fs' is restricted. Don't import '👍'.",
+            type: "ExportNamedDeclaration",
+            line: 1,
+            column: 9,
+            endColumn: 13
+        }]
+    }, {
+        code: "export {''} from \"fs\";",
+        options: [{
+            paths: [{
+                name: "fs",
+                importNames: [""],
+                message: "Don't import ''."
+            }]
+        }],
+        errors: [{
+            message: "'' import from 'fs' is restricted. Don't import ''.",
+            type: "ExportNamedDeclaration",
+            line: 1,
+            column: 9,
+            endColumn: 11
+        }]
     }, {
         code: "export * as ns from \"fs\";",
         options: [{
@@ -505,6 +665,55 @@ ruleTester.run("no-restricted-imports", rule, {
             endColumn: 43
         }]
     },
+    {
+        code: "import { 'DisallowedObject' as AllowedObject } from \"foo\";",
+        options: [{
+            paths: [{
+                name: "foo",
+                importNames: ["DisallowedObject"],
+                message: "Please import 'DisallowedObject' from /bar/ instead."
+            }]
+        }],
+        errors: [{
+            message: "'DisallowedObject' import from 'foo' is restricted. Please import 'DisallowedObject' from /bar/ instead.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 10,
+            endColumn: 45
+        }]
+    },
+    {
+        code: "import { '👍' as bar } from \"foo\";",
+        options: [{
+            paths: [{
+                name: "foo",
+                importNames: ["👍"]
+            }]
+        }],
+        errors: [{
+            message: "'👍' import from 'foo' is restricted.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 10,
+            endColumn: 21
+        }]
+    },
+    {
+        code: "import { '' as bar } from \"foo\";",
+        options: [{
+            paths: [{
+                name: "foo",
+                importNames: [""]
+            }]
+        }],
+        errors: [{
+            message: "'' import from 'foo' is restricted.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 10,
+            endColumn: 19
+        }]
+    },
     {
         code: "import { AllowedObject, DisallowedObject } from \"foo\";",
         options: [{
@@ -894,6 +1103,138 @@ ruleTester.run("no-restricted-imports", rule, {
             column: 1,
             endColumn: 41
         }]
+    },
+    {
+        code: "import absoluteWithPatterns from '#foo/bar';",
+        options: [{ patterns: ["\\#foo"] }],
+        errors: [{
+            message: "'#foo/bar' import is restricted from being used by a pattern.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 1,
+            endColumn: 45
+        }]
+    },
+    {
+        code: "import { Foo } from '../../my/relative-module';",
+        options: [{
+            patterns: [{
+                group: ["**/my/relative-module"],
+                importNames: ["Foo"]
+            }]
+        }],
+        errors: [{
+            type: "ImportDeclaration",
+            line: 1,
+            column: 10,
+            endColumn: 13,
+            message: "'Foo' import from '../../my/relative-module' is restricted from being used by a pattern."
+        }]
+    },
+    {
+        code: "import { Foo, Bar } from '../../my/relative-module';",
+        options: [{
+            patterns: [{
+                group: ["**/my/relative-module"],
+                importNames: ["Foo", "Bar"],
+                message: "Import from @/utils instead."
+            }]
+        }],
+        errors: [{
+            type: "ImportDeclaration",
+            line: 1,
+            column: 10,
+            endColumn: 13,
+            message: "'Foo' import from '../../my/relative-module' is restricted from being used by a pattern. Import from @/utils instead."
+        }, {
+            type: "ImportDeclaration",
+            line: 1,
+            column: 15,
+            endColumn: 18,
+            message: "'Bar' import from '../../my/relative-module' is restricted from being used by a pattern. Import from @/utils instead."
+        }]
+    },
+    {
+
+        /*
+         * Star import should be reported for consistency with `paths` option (see: https://github.com/eslint/eslint/pull/16059#discussion_r908749964)
+         * For example, import * as All allows for calling/referencing the restricted import All.Foo
+         */
+        code: "import * as All from '../../my/relative-module';",
+        options: [{
+            patterns: [{
+                group: ["**/my/relative-module"],
+                importNames: ["Foo"]
+            }]
+        }],
+        errors: [{
+            message: "* import is invalid because 'Foo' from '../../my/relative-module' is restricted from being used by a pattern.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 8,
+            endColumn: 16
+        }]
+    },
+    {
+
+        /*
+         * Star import should be reported for consistency with `paths` option (see: https://github.com/eslint/eslint/pull/16059#discussion_r908749964)
+         * For example, import * as All allows for calling/referencing the restricted import All.Foo
+         */
+        code: "import * as AllWithCustomMessage from '../../my/relative-module';",
+        options: [{
+            patterns: [{
+                group: ["**/my/relative-module"],
+                importNames: ["Foo"],
+                message: "Import from @/utils instead."
+            }]
+        }],
+        errors: [{
+            message: "* import is invalid because 'Foo' from '../../my/relative-module' is restricted from being used by a pattern. Import from @/utils instead.",
+            type: "ImportDeclaration",
+            line: 1,
+            column: 8,
+            endColumn: 33
+        }]
+    },
+    {
+        code: "import def, * as ns from 'mod';",
+        options: [{
+            patterns: [{
+                group: ["mod"],
+                importNames: ["default"]
+            }]
+        }],
+        errors: [{
+            type: "ImportDeclaration",
+            line: 1,
+            column: 8,
+            endColumn: 11,
+            message: "'default' import from 'mod' is restricted from being used by a pattern."
+        },
+        {
+            type: "ImportDeclaration",
+            line: 1,
+            column: 13,
+            endColumn: 20,
+            message: "* import is invalid because 'default' from 'mod' is restricted from being used by a pattern."
+        }]
+    },
+    {
+        code: "import Foo from 'mod';",
+        options: [{
+            patterns: [{
+                group: ["mod"],
+                importNames: ["default"]
+            }]
+        }],
+        errors: [{
+            type: "ImportDeclaration",
+            line: 1,
+            column: 8,
+            endColumn: 11,
+            message: "'default' import from 'mod' is restricted from being used by a pattern."
+        }]
     }
     ]
 });
index 04aa2dee4023d090152bb43eb8853309009b0c18..0fe04040d7aa7f9ad3b5f23496066eacfb2a2f47 100644 (file)
@@ -25,6 +25,8 @@ ruleTester.run("no-self-assign", rule, {
         "a += a",
         "a = +a",
         "a = [a]",
+        "a &= a",
+        "a |= a",
         { code: "let a = a", parserOptions: { ecmaVersion: 6 } },
         { code: "const a = a", parserOptions: { ecmaVersion: 6 } },
         { code: "[a] = a", parserOptions: { ecmaVersion: 6 } },
@@ -167,6 +169,23 @@ ruleTester.run("no-self-assign", rule, {
             code: "class C { #field; foo() { [this.#field] = [this.#field]; } }",
             parserOptions: { ecmaVersion: 2022 },
             errors: [{ messageId: "selfAssignment", data: { name: "this.#field" } }]
+        },
+
+        // logical assignment
+        {
+            code: "a &&= a",
+            parserOptions: { ecmaVersion: 2021 },
+            errors: [{ messageId: "selfAssignment", data: { name: "a" } }]
+        },
+        {
+            code: "a ||= a",
+            parserOptions: { ecmaVersion: 2021 },
+            errors: [{ messageId: "selfAssignment", data: { name: "a" } }]
+        },
+        {
+            code: "a ??= a",
+            parserOptions: { ecmaVersion: 2021 },
+            errors: [{ messageId: "selfAssignment", data: { name: "a" } }]
         }
     ]
 });
index 13c4c1100d6c8c787b3fb64ff1759f0a95ea8c55..0afcc3ff31bbaa356b869fce2bfd26711274a482 100644 (file)
@@ -63,7 +63,35 @@ ruleTester.run("no-shadow", rule, {
         { code: "class C { static { let x; } static { let x; } }", parserOptions: { ecmaVersion: 2022 } },
         { code: "class C { static { var x; { var x; /* redeclaration */ } } }", parserOptions: { ecmaVersion: 2022 } },
         { code: "class C { static { { var x; } { var x; /* redeclaration */ } } }", parserOptions: { ecmaVersion: 2022 } },
-        { code: "class C { static { { let x; } { let x; } } }", parserOptions: { ecmaVersion: 2022 } }
+        { code: "class C { static { { let x; } { let x; } } }", parserOptions: { ecmaVersion: 2022 } },
+        { code: "const a = [].find(a => a)", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const a = [].find(function(a) { return a; })", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const [a = [].find(a => true)] = dummy", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const { a = [].find(a => true) } = dummy", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "function func(a = [].find(a => true)) {}", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "for (const a in [].find(a => true)) {}", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "for (const a of [].find(a => true)) {}", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const a = [].map(a => true).filter(a => a === 'b')", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const a = [].map(a => true).filter(a => a === 'b').find(a => a === 'c')", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const { a } = (({ a }) => ({ a }))();", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const person = people.find(item => {const person = item.name; return person === 'foo'})", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var y = bar || foo(y => y);", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var y = bar && foo(y => y);", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var z = bar(foo(z => z));", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var z = boo(bar(foo(z => z)));", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var match = function (person) { return person.name === 'foo'; };\nconst person = [].find(match);", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const a = foo(x || (a => {}))", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const { a = 1 } = foo(a => {})", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const person = {...people.find((person) => person.firstName.startsWith('s'))}", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 2021 } },
+        { code: "const person = { firstName: people.filter((person) => person.firstName.startsWith('s')).map((person) => person.firstName)[0]}", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 2021 } },
+        { code: "() => { const y = foo(y => y); }", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const x = (x => x)()", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var y = bar || (y => y)();", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var y = bar && (y => y)();", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "var x = (x => x)((y => y)());", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const { a = 1 } = (a => {})()", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "() => { const y = (y => y)(); }", options: [{ ignoreOnInitialization: true }], parserOptions: { ecmaVersion: 6 } },
+        { code: "const [x = y => y] = [].map(y => y)", parserOptions: { ecmaVersion: 6 } }
     ],
     invalid: [
         {
@@ -859,6 +887,232 @@ ruleTester.run("no-shadow", rule, {
                 line: 1,
                 column: 50
             }]
+        },
+        {
+            code: "let x = foo((x,y) => {});\nlet y;",
+            options: [{ hoist: "all" }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "noShadow",
+                    data: {
+                        name: "x",
+                        shadowedLine: 1,
+                        shadowedColumn: 5
+                    },
+                    type: "Identifier"
+                },
+                {
+                    messageId: "noShadow",
+                    data: {
+                        name: "y",
+                        shadowedLine: 2,
+                        shadowedColumn: 5
+                    },
+                    type: "Identifier"
+                }
+            ]
+        },
+        {
+            code: "const a = fn(()=>{ class C { fn () { const a = 42; return a } } return new C() })",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "a",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 44
+            }]
+        },
+        {
+            code: "function a() {}\nfoo(a => {});",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "a",
+                    shadowedLine: 1,
+                    shadowedColumn: 10
+                },
+                type: "Identifier",
+                line: 2,
+                column: 5
+            }]
+        },
+        {
+            code: "const a = fn(()=>{ function C() { this.fn=function() { const a = 42; return a } } return new C() });",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "a",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 62
+            }]
+        },
+        {
+            code: "const x = foo(() => { const bar = () => { return x => {}; }; return bar; });",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 50
+            }]
+        },
+        {
+            code: "const x = foo(() => { return { bar(x) {} }; });",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 36
+            }]
+        },
+        {
+            code: "const x = () => { foo(x => x); }",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 23
+            }]
+        },
+        {
+            code: "const foo = () => { let x; bar(x => x); }",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 25
+                },
+                type: "Identifier",
+                line: 1,
+                column: 32
+            }]
+        },
+        {
+            code: "foo(() => { const x = x => x; });",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 19
+                },
+                type: "Identifier",
+                line: 1,
+                column: 23
+            }]
+        },
+        {
+            code: "const foo = (x) => { bar(x => {}) }",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 14
+                },
+                type: "Identifier",
+                line: 1,
+                column: 26
+            }]
+        },
+        {
+            code: "let x = ((x,y) => {})();\nlet y;",
+            options: [{ hoist: "all" }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "noShadow",
+                    data: {
+                        name: "x",
+                        shadowedLine: 1,
+                        shadowedColumn: 5
+                    },
+                    type: "Identifier"
+                },
+                {
+                    messageId: "noShadow",
+                    data: {
+                        name: "y",
+                        shadowedLine: 2,
+                        shadowedColumn: 5
+                    },
+                    type: "Identifier"
+                }
+            ]
+        },
+        {
+            code: "const a = (()=>{ class C { fn () { const a = 42; return a } } return new C() })()",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "a",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 42
+            }]
+        },
+        {
+            code: "const x = () => { (x => x)(); }",
+            options: [{ ignoreOnInitialization: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [{
+                messageId: "noShadow",
+                data: {
+                    name: "x",
+                    shadowedLine: 1,
+                    shadowedColumn: 7
+                },
+                type: "Identifier",
+                line: 1,
+                column: 20
+            }]
         }
     ]
 });
index c83a5b3fe28435dad48abe97761d11767b233d00..f3e11cc3e76b05bb2afc27dab831a24560948908 100644 (file)
@@ -71,7 +71,10 @@ ruleTester.run("no-underscore-dangle", rule, {
         { code: "function foo( { _bar = 0 } = {}) {}", options: [{ allowFunctionParams: false }], parserOptions: { ecmaVersion: 6 } },
         { code: "function foo(...[_bar]) {}", options: [{ allowFunctionParams: false }], parserOptions: { ecmaVersion: 2016 } },
         { code: "class foo { _field; }", parserOptions: { ecmaVersion: 2022 } },
-        { code: "class foo { #_field; }", parserOptions: { ecmaVersion: 2022 } }
+        { code: "class foo { _field; }", options: [{ enforceInClassFields: false }], parserOptions: { ecmaVersion: 2022 } },
+        { code: "class foo { #_field; }", parserOptions: { ecmaVersion: 2022 } },
+        { code: "class foo { #_field; }", options: [{ enforceInClassFields: false }], parserOptions: { ecmaVersion: 2022 } },
+        { code: "class foo { _field; }", options: [{}], parserOptions: { ecmaVersion: 2022 } }
     ],
     invalid: [
         { code: "var _foo = 1", errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "_foo" }, type: "VariableDeclarator" }] },
@@ -109,6 +112,30 @@ ruleTester.run("no-underscore-dangle", rule, {
             options: [{ enforceInMethodNames: true }],
             parserOptions: { ecmaVersion: 2022 },
             errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "#bar_" } }]
+        },
+        {
+            code: "class foo { _field; }",
+            options: [{ enforceInClassFields: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "_field" } }]
+        },
+        {
+            code: "class foo { #_field; }",
+            options: [{ enforceInClassFields: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "#_field" } }]
+        },
+        {
+            code: "class foo { field_; }",
+            options: [{ enforceInClassFields: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "field_" } }]
+        },
+        {
+            code: "class foo { #field_; }",
+            options: [{ enforceInClassFields: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unexpectedUnderscore", data: { identifier: "#field_" } }]
         }
     ]
 });
index 7c5c87102a9062205f663fce385846703318c80a..b723a29abcf31b910a07fe0a9b589fd7512a49a6 100644 (file)
@@ -162,6 +162,81 @@ ruleTester.run("no-unused-vars", rule, {
         { code: "function foo(_a) { } foo();", options: [{ args: "all", argsIgnorePattern: "^_" }] },
         { code: "function foo(a, _b) { return a; } foo();", options: [{ args: "after-used", argsIgnorePattern: "^_" }] },
         { code: "var [ firstItemIgnored, secondItem ] = items;\nconsole.log(secondItem);", options: [{ vars: "all", varsIgnorePattern: "[iI]gnored" }], parserOptions: { ecmaVersion: 6 } },
+        {
+            code: "const [ a, _b, c ] = items;\nconsole.log(a+c);",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "const [ [a, _b, c] ] = items;\nconsole.log(a+c);",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "const { x: [_a, foo] } = bar;\nconsole.log(foo);",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "function baz([_b, foo]) { foo; };\nbaz()",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "function baz({x: [_b, foo]}) {foo};\nbaz()",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: "function baz([{x: [_b, foo]}]) {foo};\nbaz()",
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+            let _a, b;
+            foo.forEach(item => {
+                [_a, b] = item;
+                doSomething(b);
+            });
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+            // doesn't report _x
+            let _x, y;
+            _x = 1;
+            [_x, y] = foo;
+            y;
+
+            // doesn't report _a
+            let _a, b;
+            [_a, b] = foo;
+            _a = 1;
+            b;
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2018 }
+        },
+        {
+            code: `
+            // doesn't report _x
+            let _x, y;
+            _x = 1;
+            [_x, y] = foo;
+            y;
+
+            // doesn't report _a
+            let _a, b;
+            _a = 1;
+            ({_a, ...b } = foo);
+            b;
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_", ignoreRestSiblings: true }],
+            parserOptions: { ecmaVersion: 2018 }
+        },
 
         // for-in loops (see #2342)
         "(function(obj) { var name; for ( name in obj ) return; })({});",
@@ -177,6 +252,15 @@ ruleTester.run("no-unused-vars", rule, {
         { code: "(function(obj) { for ( const name in obj ) { return true } })({})", parserOptions: { ecmaVersion: 6 } },
         { code: "(function(obj) { for ( const name in obj ) return true })({})", parserOptions: { ecmaVersion: 6 } },
 
+        // For-of loops
+        { code: "(function(iter) { let name; for ( name of iter ) return; })({});", parserOptions: { ecmaVersion: 6 } },
+        { code: "(function(iter) { let name; for ( name of iter ) { return; } })({});", parserOptions: { ecmaVersion: 6 } },
+        { code: "(function(iter) { for ( let name of iter ) { return true } })({})", parserOptions: { ecmaVersion: 6 } },
+        { code: "(function(iter) { for ( let name of iter ) return true })({})", parserOptions: { ecmaVersion: 6 } },
+
+        { code: "(function(iter) { for ( const name of iter ) { return true } })({})", parserOptions: { ecmaVersion: 6 } },
+        { code: "(function(iter) { for ( const name of iter ) return true })({})", parserOptions: { ecmaVersion: 6 } },
+
         // Sequence Expressions (See https://github.com/eslint/eslint/issues/14325)
         { code: "let x = 0; foo = (0, x++);", parserOptions: { ecmaVersion: 6 } },
         { code: "let x = 0; foo = (0, x += 1);", parserOptions: { ecmaVersion: 6 } },
@@ -463,6 +547,131 @@ ruleTester.run("no-unused-vars", rule, {
             }]
         },
 
+        // https://github.com/eslint/eslint/issues/15611
+        {
+            code: `
+            const array = ['a', 'b', 'c'];
+            const [a, _b, c] = array;
+            const newArray = [a, c];
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+
+                // should report only `newArray`
+                { ...assignedError("newArray"), line: 4, column: 19 }
+            ]
+        },
+        {
+            code: `
+            const array = ['a', 'b', 'c', 'd', 'e'];
+            const [a, _b, c] = array;
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+                {
+                    ...assignedError("a", ". Allowed unused elements of array destructuring patterns must match /^_/u"),
+                    line: 3,
+                    column: 20
+                },
+                {
+                    ...assignedError("c", ". Allowed unused elements of array destructuring patterns must match /^_/u"),
+                    line: 3,
+                    column: 27
+                }
+            ]
+        },
+        {
+            code: `
+            const array = ['a', 'b', 'c'];
+            const [a, _b, c] = array;
+            const fooArray = ['foo'];
+            const barArray = ['bar'];
+            const ignoreArray = ['ignore'];
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_", varsIgnorePattern: "ignore" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+                {
+                    ...assignedError("a", ". Allowed unused elements of array destructuring patterns must match /^_/u"),
+                    line: 3,
+                    column: 20
+                },
+                {
+                    ...assignedError("c", ". Allowed unused elements of array destructuring patterns must match /^_/u"),
+                    line: 3,
+                    column: 27
+                },
+                {
+                    ...assignedError("fooArray", ". Allowed unused vars must match /ignore/u"),
+                    line: 4,
+                    column: 19
+                },
+                {
+                    ...assignedError("barArray", ". Allowed unused vars must match /ignore/u"),
+                    line: 5,
+                    column: 19
+                }
+            ]
+        },
+        {
+            code: `
+            const array = [obj];
+            const [{_a, foo}] = array;
+            console.log(foo);
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+                {
+                    ...assignedError("_a"),
+                    line: 3,
+                    column: 21
+                }
+            ]
+        },
+        {
+            code: `
+            function foo([{_a, bar}]) {
+                bar;
+            }
+            foo();
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+                {
+                    ...definedError("_a"),
+                    line: 2,
+                    column: 28
+                }
+            ]
+        },
+        {
+            code: `
+            let _a, b;
+
+            foo.forEach(item => {
+                [a, b] = item;
+            });
+            `,
+            options: [{ destructuredArrayIgnorePattern: "^_" }],
+            parserOptions: { ecmaVersion: 2020 },
+            errors: [
+                {
+                    ...definedError("_a"),
+                    line: 2,
+                    column: 17
+                },
+                {
+                    ...assignedError("b"),
+                    line: 2,
+                    column: 21
+                }
+            ]
+        },
+
         // for-in loops (see #2342)
         {
             code: "(function(obj) { var name; for ( name in obj ) { i(); return; } })({});",
@@ -504,6 +713,50 @@ ruleTester.run("no-unused-vars", rule, {
             }]
         },
 
+        // For-of loops
+        {
+            code: "(function(iter) { var name; for ( name of iter ) { i(); return; } })({});",
+            env: { es6: true },
+            errors: [{
+                line: 1,
+                column: 35,
+                messageId: "unusedVar",
+                data: {
+                    varName: "name",
+                    action: "assigned a value",
+                    additional: ""
+                }
+            }]
+        },
+        {
+            code: "(function(iter) { var name; for ( name of iter ) { } })({});",
+            env: { es6: true },
+            errors: [{
+                line: 1,
+                column: 35,
+                messageId: "unusedVar",
+                data: {
+                    varName: "name",
+                    action: "assigned a value",
+                    additional: ""
+                }
+            }]
+        },
+        {
+            code: "(function(iter) { for ( var name of iter ) { } })({});",
+            env: { es6: true },
+            errors: [{
+                line: 1,
+                column: 29,
+                messageId: "unusedVar",
+                data: {
+                    varName: "name",
+                    action: "assigned a value",
+                    additional: ""
+                }
+            }]
+        },
+
         // https://github.com/eslint/eslint/issues/3617
         {
             code: "\n/* global foobar, foo, bar */\nfoobar;",
index ba80e4075c24ce83273ec3825c8b4310d2730cc7..dc858f752870ce976954fc00f9492f067ad48879 100644 (file)
@@ -209,6 +209,38 @@ ruleTester.run("no-use-before-define", rule, {
         {
             code: "const C = class C { static { C.x; } }",
             parserOptions: { ecmaVersion: 2022 }
+        },
+
+        // "allowNamedExports" option
+        {
+            code: "export { a }; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
+        },
+        {
+            code: "export { a as b }; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
+        },
+        {
+            code: "export { a, b }; let a, b;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
+        },
+        {
+            code: "export { a }; var a;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
+        },
+        {
+            code: "export { f }; function f() {}",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
+        },
+        {
+            code: "export { C }; class C {}",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" }
         }
     ],
     invalid: [
@@ -1091,7 +1123,7 @@ ruleTester.run("no-use-before-define", rule, {
                 messageId: "usedBeforeDefined",
                 data: { name: "a" }
             }]
-        }
+        },
 
         /*
          * TODO(mdjermanovic): Add the following test cases once https://github.com/eslint/eslint-scope/issues/59 gets fixed:
@@ -1123,5 +1155,124 @@ ruleTester.run("no-use-before-define", rule, {
          *  }]
          * }
          */
+
+        // "allowNamedExports" option
+        {
+            code: "export { a }; const a = 1;",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { a }; const a = 1;",
+            options: [{}],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { a }; const a = 1;",
+            options: [{ allowNamedExports: false }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { a }; const a = 1;",
+            options: ["nofunc"],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { a as b }; const a = 1;",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { a, b }; let a, b;",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [
+                {
+                    messageId: "usedBeforeDefined",
+                    data: { name: "a" }
+                },
+                {
+                    messageId: "usedBeforeDefined",
+                    data: { name: "b" }
+                }
+            ]
+        },
+        {
+            code: "export { a }; var a;",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export { f }; function f() {}",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "f" }
+            }]
+        },
+        {
+            code: "export { C }; class C {}",
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "C" }
+            }]
+        },
+        {
+            code: "export const foo = a; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export default a; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export function foo() { return a; }; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        },
+        {
+            code: "export class C { foo() { return a; } }; const a = 1;",
+            options: [{ allowNamedExports: true }],
+            parserOptions: { ecmaVersion: 2015, sourceType: "module" },
+            errors: [{
+                messageId: "usedBeforeDefined",
+                data: { name: "a" }
+            }]
+        }
     ]
 });
index 66077f2b4974861b554e5c0fab82fca5b5f6d7db..262cf2cc5ac1220dda75df4fba00f25106b76be1 100644 (file)
@@ -47,11 +47,43 @@ ruleTester.run("no-useless-rename", rule, {
         "import {foo} from 'foo';",
         "import {foo as bar} from 'foo';",
         "import {foo as bar, baz as qux} from 'foo';",
+        {
+            code: "import {'foo' as bar} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
         "export {foo} from 'foo';",
         "var foo = 0;export {foo as bar};",
         "var foo = 0; var baz = 0; export {foo as bar, baz as qux};",
         "export {foo as bar} from 'foo';",
         "export {foo as bar, baz as qux} from 'foo';",
+        {
+            code: "var foo = 0; export {foo as 'bar'};",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {foo as 'bar'} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {'foo' as bar} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {'foo' as 'bar'} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {'' as ' '} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {' ' as ''} from 'baz';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
+        {
+            code: "export {'foo'} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 }
+        },
         {
             code: "const {...stuff} = myObject;",
             parserOptions: { ecmaVersion: 2018 }
@@ -380,6 +412,12 @@ ruleTester.run("no-useless-rename", rule, {
             output: "import {foo} from 'foo';",
             errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Import", name: "foo" } }]
         },
+        {
+            code: "import {'foo' as foo} from 'foo';",
+            output: "import {foo} from 'foo';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Import", name: "foo" } }]
+        },
         {
             code: "import {\\u0061 as a} from 'foo';",
             output: "import {a} from 'foo';",
@@ -418,6 +456,42 @@ ruleTester.run("no-useless-rename", rule, {
             output: "var foo = 0; export {foo};",
             errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "foo" } }]
         },
+        {
+            code: "var foo = 0; export {foo as 'foo'};",
+            output: "var foo = 0; export {foo};",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "foo" } }]
+        },
+        {
+            code: "export {foo as 'foo'} from 'bar';",
+            output: "export {foo} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "foo" } }]
+        },
+        {
+            code: "export {'foo' as foo} from 'bar';",
+            output: "export {'foo'} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "foo" } }]
+        },
+        {
+            code: "export {'foo' as 'foo'} from 'bar';",
+            output: "export {'foo'} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "foo" } }]
+        },
+        {
+            code: "export {' 👍 ' as ' 👍 '} from 'bar';",
+            output: "export {' 👍 '} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: " 👍 " } }]
+        },
+        {
+            code: "export {'' as ''} from 'bar';",
+            output: "export {''} from 'bar';",
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [{ messageId: "unnecessarilyRenamed", data: { type: "Export", name: "" } }]
+        },
         {
             code: "var a = 0; export {a as \\u0061};",
             output: "var a = 0; export {a};",
index c2689defab101f2e93b07e4e649f574dce6da063..74122456121acac4f16df8cf2e88bd56a5e50d90 100644 (file)
@@ -34,10 +34,12 @@ ruleTester.run("no-warning-comments", rule, {
         "/* any block comment with TODO, FIXME or XXX */",
         "/* any block comment with (TODO, FIXME's or XXX!) */",
         { code: "// comments containing terms as substrings like TodoMVC", options: [{ terms: ["todo"], location: "anywhere" }] },
-        { code: "// special regex characters don't cause problems", options: [{ terms: ["[aeiou]"], location: "anywhere" }] },
+        { code: "// special regex characters don't cause a problem", options: [{ terms: ["[aeiou]"], location: "anywhere" }] },
         "/*eslint no-warning-comments: [2, { \"terms\": [\"todo\", \"fixme\", \"any other term\"], \"location\": \"anywhere\" }]*/\n\nvar x = 10;\n",
         { code: "/*eslint no-warning-comments: [2, { \"terms\": [\"todo\", \"fixme\", \"any other term\"], \"location\": \"anywhere\" }]*/\n\nvar x = 10;\n", options: [{ location: "anywhere" }] },
-        { code: "foo", options: [{ terms: ["foo-bar"] }] }
+        { code: "// foo", options: [{ terms: ["foo-bar"] }] },
+        "/** multi-line block comment with lines starting with\nTODO\nFIXME or\nXXX\n*/",
+        { code: "//!TODO ", options: [{ decoration: ["*"] }] }
     ],
     invalid: [
         {
@@ -257,6 +259,188 @@ ruleTester.run("no-warning-comments", rule, {
                     }
                 }
             ]
+        },
+        {
+            code: "// Comment ending with term followed by punctuation TODO!",
+            options: [{ terms: ["todo"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo",
+                        comment: "Comment ending with term followed by..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// Comment ending with term including punctuation TODO!",
+            options: [{ terms: ["todo!"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo!",
+                        comment: "Comment ending with term including..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// Comment ending with term including punctuation followed by more TODO!!!",
+            options: [{ terms: ["todo!"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo!",
+                        comment: "Comment ending with term including..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// !TODO comment starting with term preceded by punctuation",
+            options: [{ terms: ["todo"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo",
+                        comment: "!TODO comment starting with term..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// !TODO comment starting with term including punctuation",
+            options: [{ terms: ["!todo"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "!todo",
+                        comment: "!TODO comment starting with term..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// !!!TODO comment starting with term including punctuation preceded by more",
+            options: [{ terms: ["!todo"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "!todo",
+                        comment: "!!!TODO comment starting with term..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// FIX!term ending with punctuation followed word character",
+            options: [{ terms: ["FIX!"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "FIX!",
+                        comment: "FIX!term ending with punctuation..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "// Term starting with punctuation preceded word character!FIX",
+            options: [{ terms: ["!FIX"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "!FIX",
+                        comment: "Term starting with punctuation preceded..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "//!XXX comment starting with no spaces (anywhere)",
+            options: [{ terms: ["!xxx"], location: "anywhere" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "!xxx",
+                        comment: "!XXX comment starting with no spaces..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "//!XXX comment starting with no spaces (start)",
+            options: [{ terms: ["!xxx"], location: "start" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "!xxx",
+                        comment: "!XXX comment starting with no spaces..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "/*\nTODO undecorated multi-line block comment (start)\n*/",
+            options: [{ terms: ["todo"], location: "start" }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo",
+                        comment: "TODO undecorated multi-line block..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "///// TODO decorated single-line comment with decoration array \n /////",
+            options: [{ terms: ["todo"], location: "start", decoration: ["*", "/"] }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo",
+                        comment: "/// TODO decorated single-line comment..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "///*/*/ TODO decorated single-line comment with multiple decoration characters (start) \n /////",
+            options: [{ terms: ["todo"], location: "start", decoration: ["*", "/"] }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "todo",
+                        comment: "/*/*/ TODO decorated single-line comment..."
+                    }
+                }
+            ]
+        },
+        {
+            code: "//**TODO term starts with a decoration character",
+            options: [{ terms: ["*todo"], location: "start", decoration: ["*"] }],
+            errors: [
+                {
+                    messageId: "unexpectedComment",
+                    data: {
+                        matchedTerm: "*todo",
+                        comment: "**TODO term starts with a decoration..."
+                    }
+                }
+            ]
         }
     ]
 });
index 01a72f4e6f0a3259e949da7cf1354331fbbb89a2..58bb5708327592e8efda9fa42c5fe222798e9677 100644 (file)
@@ -185,6 +185,52 @@ ruleTester.run("object-shorthand", rule, {
             options: ["never"]
         },
 
+        // methodsIgnorePattern
+        {
+            code: "var x = { foo: function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { foo: function() {}  }",
+            options: ["methods", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { foo: function*() {}  }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { foo: async function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { foo: () => { return 5; }  }",
+            options: ["always", { methodsIgnorePattern: "^foo$", avoidExplicitReturnArrows: true }]
+        },
+        {
+            code: "var x = { 'foo': function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { ['foo']: function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }]
+        },
+        {
+            code: "var x = { 123: function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^123$" }]
+        },
+        {
+            code: "var x = { afoob: function() {}  }",
+            options: ["always", { methodsIgnorePattern: "foo" }]
+        },
+        {
+            code: "var x = { afoob: function() {}  }",
+            options: ["always", { methodsIgnorePattern: "^.foo.$" }]
+        },
+        {
+            code: "var x = { '👍foo👍': function() {}  }", // this wouldn't pass without the "u" flag
+            options: ["always", { methodsIgnorePattern: "^.foo.$" }]
+        },
+
         // avoidQuotes
         {
             code: "var x = {'a': function(){}}",
@@ -781,6 +827,50 @@ ruleTester.run("object-shorthand", rule, {
             errors: [METHOD_ERROR]
         },
 
+        // methodsIgnorePattern
+        {
+            code: "var x = { afoob: function() {} }",
+            output: "var x = { afoob() {} }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { afoob: function() {} }",
+            output: "var x = { afoob() {} }",
+            options: ["methods", { methodsIgnorePattern: "^foo$" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { 'afoob': function() {} }",
+            output: "var x = { 'afoob'() {} }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { 1234: function() {} }",
+            output: "var x = { 1234() {} }",
+            options: ["always", { methodsIgnorePattern: "^123$" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { bar: function() {} }",
+            output: "var x = { bar() {} }",
+            options: ["always", { methodsIgnorePattern: "foo" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { [foo]: function() {} }",
+            output: "var x = { [foo]() {} }",
+            options: ["always", { methodsIgnorePattern: "foo" }],
+            errors: [METHOD_ERROR]
+        },
+        {
+            code: "var x = { foo: foo }", // does not apply to properties
+            output: "var x = { foo }",
+            options: ["always", { methodsIgnorePattern: "^foo$" }],
+            errors: [PROPERTY_ERROR]
+        },
+
         // avoidQuotes
         {
             code: "var x = {a: a}",
index 8f814840e299277b51aa41e637fcbb534414df13..50229af4903045322b759ff0c761e8fbda946aab 100644 (file)
@@ -18,9 +18,6 @@ const rule = require("../../../lib/rules/operator-assignment"),
 
 const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2022 } });
 
-const EXPECTED_OPERATOR_ASSIGNMENT = [{ messageId: "replaced", type: "AssignmentExpression" }];
-const UNEXPECTED_OPERATOR_ASSIGNMENT = [{ messageId: "unexpected", type: "AssignmentExpression" }];
-
 ruleTester.run("operator-assignment", rule, {
 
     valid: [
@@ -117,326 +114,326 @@ ruleTester.run("operator-assignment", rule, {
     invalid: [{
         code: "x = x + y",
         output: "x += y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = x - y",
         output: "x -= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "-=" } }]
     }, {
         code: "x = x * y",
         output: "x *= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "x = y * x",
         output: null, // not fixed (possible change in behavior if y and x have valueOf() functions)
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "x = (y * z) * x",
         output: null, // not fixed (possible change in behavior if y/z and x have valueOf() functions)
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "x = x / y",
         output: "x /= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "x = x % y",
         output: "x %= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "%=" } }]
     }, {
         code: "x = x << y",
         output: "x <<= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "<<=" } }]
     }, {
         code: "x = x >> y",
         output: "x >>= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: ">>=" } }]
     }, {
         code: "x = x >>> y",
         output: "x >>>= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: ">>>=" } }]
     }, {
         code: "x = x & y",
         output: "x &= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "&=" } }]
     }, {
         code: "x = x ^ y",
         output: "x ^= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "^=" } }]
     }, {
         code: "x = x | y",
         output: "x |= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "|=" } }]
     }, {
         code: "x[0] = x[0] - y",
         output: "x[0] -= y",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "-=" } }]
     }, {
         code: "x.y[z['a']][0].b = x.y[z['a']][0].b * 2",
         output: null, // not fixed; might activate getters more than before
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "x = x + y",
         output: "x += y",
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = (x + y)",
         output: "x += y",
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = x + (y)",
         output: "x += (y)",
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x += (y)",
         output: "x = x + (y)",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x += y",
         output: "x = x + y",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo.bar = foo.bar + baz",
         output: "foo.bar += baz",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo.bar += baz",
         output: "foo.bar = foo.bar + baz",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "this.foo = this.foo + bar",
         output: "this.foo += bar",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "this.foo += bar",
         output: "this.foo = this.foo + bar",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo.bar.baz = foo.bar.baz + qux",
         output: null, // not fixed; fixing would cause a foo.bar getter to activate once rather than twice
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo.bar.baz += qux",
         output: null, // not fixed; fixing would cause a foo.bar getter to activate twice rather than once
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "this.foo.bar = this.foo.bar + baz",
         output: null, // not fixed; fixing would cause a this.foo getter to activate once rather than twice
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "this.foo.bar += baz",
         output: null, // not fixed; fixing would cause a this.foo getter to activate twice rather than once
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo[bar] = foo[bar] + baz",
         output: null, // not fixed; fixing would cause bar.toString() to get called once instead of twice
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "this[foo] = this[foo] + bar",
         output: null, // not fixed; fixing would cause foo.toString() to get called once instead of twice
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo[bar] >>>= baz",
         output: null, // not fixed; fixing would cause bar.toString() to get called twice instead of once
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: ">>>=" } }]
     }, {
         code: "this[foo] >>>= bar",
         output: null, // not fixed; fixing would cause foo.toString() to get called twice instead of once
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: ">>>=" } }]
     }, {
         code: "foo[5] = foo[5] / baz",
         output: "foo[5] /= baz", // this is ok because 5 is a literal, so toString won't get called
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "this[5] = this[5] / foo",
         output: "this[5] /= foo", // this is ok because 5 is a literal, so toString won't get called
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "/*1*/x/*2*/./*3*/y/*4*/= x.y +/*5*/z/*6*/./*7*/w/*8*/;",
         output: "/*1*/x/*2*/./*3*/y/*4*/+=/*5*/z/*6*/./*7*/w/*8*/;", // these comments are preserved
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x // 1\n . // 2\n y // 3\n = x.y + //4\n z //5\n . //6\n w;",
         output: "x // 1\n . // 2\n y // 3\n += //4\n z //5\n . //6\n w;", // these comments are preserved
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = /*1*/ x + y",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = //1\n x + y",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x.y = x/*1*/.y + z",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x.y = x. //1\n y + z",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = x /*1*/ + y",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x = x //1\n + y",
         output: null, // not fixed; fixing would remove this comment
         options: ["always"],
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "/*1*/x +=/*2*/y/*3*/;",
         output: "/*1*/x = x +/*2*/y/*3*/;", // these comments are preserved and not duplicated
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x +=//1\n y",
         output: "x = x +//1\n y", // this comment is preserved and not duplicated
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "(/*1*/x += y)",
         output: "(/*1*/x = x + y)", // this comment is preserved and not duplicated
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x/*1*/+=  y",
         output: null, // not fixed; fixing would duplicate this comment
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x //1\n +=  y",
         output: null, // not fixed; fixing would duplicate this comment
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "(/*1*/x) +=  y",
         output: null, // not fixed; fixing would duplicate this comment
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x/*1*/.y +=  z",
         output: null, // not fixed; fixing would duplicate this comment
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "x.//1\n y +=  z",
         output: null, // not fixed; fixing would duplicate this comment
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "(foo.bar) ^= ((((((((((((((((baz))))))))))))))))",
         output: "(foo.bar) = (foo.bar) ^ ((((((((((((((((baz))))))))))))))))",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "^=" } }]
     }, {
         code: "foo = foo ** bar",
         output: "foo **= bar",
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "**=" } }]
     }, {
         code: "foo **= bar",
         output: "foo = foo ** bar",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "**=" } }]
     }, {
         code: "foo *= bar + 1",
         output: "foo = foo * (bar + 1)",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "foo -= bar - baz",
         output: "foo = foo - (bar - baz)",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "-=" } }]
     }, {
         code: "foo += bar + baz",
         output: "foo = foo + (bar + baz)", // addition is not associative in JS, e.g. (1 + 2) + '3' !== 1 + (2 + '3')
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo += bar = 1",
         output: "foo = foo + (bar = 1)",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo *= (bar + 1)",
         output: "foo = foo * (bar + 1)",
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "*=" } }]
     }, {
         code: "foo+=-bar",
         output: "foo= foo+-bar", // tokens can be adjacent
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo/=bar",
         output: "foo= foo/bar", // tokens can be adjacent
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "foo/=/**/bar",
         output: "foo= foo/ /**/bar", // // tokens cannot be adjacent, insert a space between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "foo/=//\nbar",
         output: "foo= foo/ //\nbar", // // tokens cannot be adjacent, insert a space between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "foo/=/^bar$/",
         output: "foo= foo/ /^bar$/", // // tokens cannot be adjacent, insert a space between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "/=" } }]
     }, {
         code: "foo+=+bar",
         output: "foo= foo+ +bar", // tokens cannot be adjacent, insert a space between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo+= +bar",
         output: "foo= foo+ +bar", // tokens cannot be adjacent, but there is already a space between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo+=/**/+bar",
         output: "foo= foo+/**/+bar", // tokens cannot be adjacent, but there is a comment between
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     }, {
         code: "foo+=+bar===baz",
         output: "foo= foo+(+bar===baz)", // tokens cannot be adjacent, but the right side will be parenthesised
         options: ["never"],
-        errors: UNEXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "unexpected", type: "AssignmentExpression", data: { operator: "+=" } }]
     },
 
     // Optional chaining
     {
         code: "(obj?.a).b = (obj?.a).b + y",
         output: null,
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     },
     {
         code: "obj.a = obj?.a + b",
         output: null,
-        errors: EXPECTED_OPERATOR_ASSIGNMENT
+        errors: [{ messageId: "replaced", type: "AssignmentExpression", data: { operator: "+=" } }]
     }
 
     ]
index 51ddf0eb3b50c0403b6526470189e454905a2d40..0d6e93c437a0d61347a0e03650d630c3541f2f31 100644 (file)
@@ -2729,7 +2729,7 @@ ruleTester.run("padding-line-between-statements", rule, {
             parserOptions: { ecmaVersion: 2022 }
         },
         {
-            code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "espression", because class static blocks don't have directives
+            code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "expression", because class static blocks don't have directives
             options: [
                 { blankLine: "always", prev: "directive", next: "let" }
             ],
@@ -5188,7 +5188,7 @@ ruleTester.run("padding-line-between-statements", rule, {
             errors: [{ messageId: "expectedBlankLine" }]
         },
         {
-            code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "espression", because class static blocks don't have directives
+            code: "class C { static { 'use strict'; let x; } }", // 'use strict'; is "expression", because class static blocks don't have directives
             output: "class C { static { 'use strict';\n\n let x; } }",
             options: [
                 { blankLine: "always", prev: "expression", next: "let" }
index 0a44b0bd01778db58e39435a4aea2f2adcb3b4f9..c65252cb0bf1e26c956e8d6d0ba10758802a3f40 100644 (file)
@@ -684,6 +684,78 @@ ruleTester.run("prefer-const", rule, {
             errors: [
                 { messageId: "useConst", data: { name: "a" }, type: "Identifier" }
             ]
+        },
+
+        // https://github.com/eslint/eslint/issues/16266
+        {
+            code: `
+            let { itemId, list } = {},
+            obj = [],
+            total = 0;
+            total = 9;
+            console.log(itemId, list, obj, total);
+            `,
+            output: null,
+            options: [{ destructuring: "any", ignoreReadBeforeAssign: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "useConst", data: { name: "itemId" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "list" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "obj" }, type: "Identifier" }
+            ]
+        },
+        {
+            code: `
+            let { itemId, list } = {},
+            obj = [];
+            console.log(itemId, list, obj);
+            `,
+            output: `
+            const { itemId, list } = {},
+            obj = [];
+            console.log(itemId, list, obj);
+            `,
+            options: [{ destructuring: "any", ignoreReadBeforeAssign: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "useConst", data: { name: "itemId" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "list" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "obj" }, type: "Identifier" }
+            ]
+        },
+        {
+            code: `
+            let [ itemId, list ] = [],
+            total = 0;
+            total = 9;
+            console.log(itemId, list, total);
+            `,
+            output: null,
+            options: [{ destructuring: "any", ignoreReadBeforeAssign: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "useConst", data: { name: "itemId" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "list" }, type: "Identifier" }
+            ]
+        },
+        {
+            code: `
+            let [ itemId, list ] = [],
+            obj = [];
+            console.log(itemId, list, obj);
+            `,
+            output: `
+            const [ itemId, list ] = [],
+            obj = [];
+            console.log(itemId, list, obj);
+            `,
+            options: [{ destructuring: "any", ignoreReadBeforeAssign: true }],
+            parserOptions: { ecmaVersion: 2022 },
+            errors: [
+                { messageId: "useConst", data: { name: "itemId" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "list" }, type: "Identifier" },
+                { messageId: "useConst", data: { name: "obj" }, type: "Identifier" }
+            ]
         }
     ]
 });
diff --git a/eslint/tests/lib/rules/prefer-object-has-own.js b/eslint/tests/lib/rules/prefer-object-has-own.js
new file mode 100644 (file)
index 0000000..d58f7f5
--- /dev/null
@@ -0,0 +1,461 @@
+/**
+ * @fileoverview Tests for prefer-object-has-own rule.
+ * @author Nitin Kumar
+ * @author Gautam Arora
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const rule = require("../../../lib/rules/prefer-object-has-own");
+const { RuleTester } = require("../../../lib/rule-tester");
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+const parserOptions = {
+    ecmaVersion: 2022
+};
+
+const ruleTester = new RuleTester({ parserOptions });
+
+ruleTester.run("prefer-object-has-own", rule, {
+    valid: [
+        "Object",
+        "Object(obj, prop)",
+        "Object.hasOwnProperty",
+        "Object.hasOwnProperty(prop)",
+        "hasOwnProperty(obj, prop)",
+        "foo.hasOwnProperty(prop)",
+        "foo.hasOwnProperty(obj, prop)",
+        "Object.hasOwnProperty.call",
+        "foo.Object.hasOwnProperty.call(obj, prop)",
+        "foo.hasOwnProperty.call(obj, prop)",
+        "foo.call(Object.prototype.hasOwnProperty, Object.prototype.hasOwnProperty.call)",
+        "Object.foo.call(obj, prop)",
+        "Object.hasOwnProperty.foo(obj, prop)",
+        "Object.hasOwnProperty.call.foo(obj, prop)",
+        "Object[hasOwnProperty].call(obj, prop)",
+        "Object.hasOwnProperty[call](obj, prop)",
+        "class C { #hasOwnProperty; foo() { Object.#hasOwnProperty.call(obj, prop) } }",
+        "class C { #call; foo() { Object.hasOwnProperty.#call(obj, prop) } }",
+        "(Object) => Object.hasOwnProperty.call(obj, prop)", // not global Object
+        "Object.prototype",
+        "Object.prototype(obj, prop)",
+        "Object.prototype.hasOwnProperty",
+        "Object.prototype.hasOwnProperty(obj, prop)",
+        "Object.prototype.hasOwnProperty.call",
+        "foo.Object.prototype.hasOwnProperty.call(obj, prop)",
+        "foo.prototype.hasOwnProperty.call(obj, prop)",
+        "Object.foo.hasOwnProperty.call(obj, prop)",
+        "Object.prototype.foo.call(obj, prop)",
+        "Object.prototype.hasOwnProperty.foo(obj, prop)",
+        "Object.prototype.hasOwnProperty.call.foo(obj, prop)",
+        "Object.prototype.prototype.hasOwnProperty.call(a, b);",
+        "Object.hasOwnProperty.prototype.hasOwnProperty.call(a, b);",
+        "Object.prototype[hasOwnProperty].call(obj, prop)",
+        "Object.prototype.hasOwnProperty[call](obj, prop)",
+        "class C { #hasOwnProperty; foo() { Object.prototype.#hasOwnProperty.call(obj, prop) } }",
+        "class C { #call; foo() { Object.prototype.hasOwnProperty.#call(obj, prop) } }",
+        "Object[prototype].hasOwnProperty.call(obj, prop)",
+        "class C { #prototype; foo() { Object.#prototype.hasOwnProperty.call(obj, prop) } }",
+        "(Object) => Object.prototype.hasOwnProperty.call(obj, prop)", // not global Object
+        "({})",
+        "({}(obj, prop))",
+        "({}.hasOwnProperty)",
+        "({}.hasOwnProperty(prop))",
+        "({}.hasOwnProperty(obj, prop))",
+        "({}.hasOwnProperty.call)",
+        "({}).prototype.hasOwnProperty.call(a, b);",
+        "({}.foo.call(obj, prop))",
+        "({}.hasOwnProperty.foo(obj, prop))",
+        "({}[hasOwnProperty].call(obj, prop))",
+        "({}.hasOwnProperty[call](obj, prop))",
+        "({}).hasOwnProperty[call](object, property)",
+        "({})[hasOwnProperty].call(object, property)",
+        "class C { #hasOwnProperty; foo() { ({}.#hasOwnProperty.call(obj, prop)) } }",
+        "class C { #call; foo() { ({}.hasOwnProperty.#call(obj, prop)) } }",
+        "({ foo }.hasOwnProperty.call(obj, prop))", // object literal should be empty
+        "(Object) => ({}).hasOwnProperty.call(obj, prop)", // Object is shadowed, so Object.hasOwn cannot be used here
+        `
+        let obj = {};
+        Object.hasOwn(obj,"");
+        `,
+        "const hasProperty = Object.hasOwn(object, property);",
+        `/* global Object: off */
+        ({}).hasOwnProperty.call(a, b);`
+    ],
+    invalid: [
+        {
+            code: "Object.hasOwnProperty.call(obj, 'foo')",
+            output: "Object.hasOwn(obj, 'foo')",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 39
+            }]
+        },
+        {
+            code: "Object.hasOwnProperty.call(obj, property)",
+            output: "Object.hasOwn(obj, property)",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 42
+            }]
+        },
+        {
+            code: "Object.prototype.hasOwnProperty.call(obj, 'foo')",
+            output: "Object.hasOwn(obj, 'foo')",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 49
+            }]
+        },
+        {
+            code: "({}).hasOwnProperty.call(obj, 'foo')",
+            output: "Object.hasOwn(obj, 'foo')",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 37
+            }]
+        },
+
+        //  prevent autofixing if there are any comments
+        {
+            code: "Object/* comment */.prototype.hasOwnProperty.call(a, b);",
+            output: null,
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 56
+            }]
+        },
+        {
+            code: "const hasProperty = Object.prototype.hasOwnProperty.call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 75
+            }]
+        },
+        {
+            code: "const hasProperty = (( Object.prototype.hasOwnProperty.call(object, property) ));",
+            output: "const hasProperty = (( Object.hasOwn(object, property) ));",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 24,
+                endLine: 1,
+                endColumn: 78
+            }]
+        },
+        {
+            code: "const hasProperty = (( Object.prototype.hasOwnProperty.call ))(object, property);",
+            output: "const hasProperty = (( Object.hasOwn ))(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 81
+            }]
+        },
+        {
+            code: "const hasProperty = (( Object.prototype.hasOwnProperty )).call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 81
+            }]
+        },
+        {
+            code: "const hasProperty = (( Object.prototype )).hasOwnProperty.call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 81
+            }]
+        },
+        {
+            code: "const hasProperty = (( Object )).prototype.hasOwnProperty.call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 81
+            }]
+        },
+        {
+            code: "const hasProperty = {}.hasOwnProperty.call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 61
+            }]
+        },
+        {
+            code: "const hasProperty={}.hasOwnProperty.call(object, property);",
+            output: "const hasProperty=Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 19,
+                endLine: 1,
+                endColumn: 59
+            }]
+        },
+        {
+            code: "const hasProperty = (( {}.hasOwnProperty.call(object, property) ));",
+            output: "const hasProperty = (( Object.hasOwn(object, property) ));",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 24,
+                endLine: 1,
+                endColumn: 64
+            }]
+        },
+        {
+            code: "const hasProperty = (( {}.hasOwnProperty.call ))(object, property);",
+            output: "const hasProperty = (( Object.hasOwn ))(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 67
+            }]
+        },
+        {
+            code: "const hasProperty = (( {}.hasOwnProperty )).call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 67
+            }]
+        },
+        {
+            code: "const hasProperty = (( {} )).hasOwnProperty.call(object, property);",
+            output: "const hasProperty = Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 21,
+                endLine: 1,
+                endColumn: 67
+            }]
+        },
+        {
+            code: "function foo(){return {}.hasOwnProperty.call(object, property)}",
+            output: "function foo(){return Object.hasOwn(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 23,
+                endLine: 1,
+                endColumn: 63
+            }]
+        },
+
+        // https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
+        {
+            code: "function foo(){return{}.hasOwnProperty.call(object, property)}",
+            output: "function foo(){return Object.hasOwn(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 22,
+                endLine: 1,
+                endColumn: 62
+            }]
+        },
+        {
+            code: "function foo(){return/*comment*/{}.hasOwnProperty.call(object, property)}",
+            output: "function foo(){return/*comment*/Object.hasOwn(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 33,
+                endLine: 1,
+                endColumn: 73
+            }]
+        },
+        {
+            code: "async function foo(){return await{}.hasOwnProperty.call(object, property)}",
+            output: "async function foo(){return await Object.hasOwn(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 34,
+                endLine: 1,
+                endColumn: 74
+            }]
+        },
+        {
+            code: "async function foo(){return await/*comment*/{}.hasOwnProperty.call(object, property)}",
+            output: "async function foo(){return await/*comment*/Object.hasOwn(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 45,
+                endLine: 1,
+                endColumn: 85
+            }]
+        },
+        {
+            code: "for (const x of{}.hasOwnProperty.call(object, property).toString());",
+            output: "for (const x of Object.hasOwn(object, property).toString());",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 16,
+                endLine: 1,
+                endColumn: 56
+            }]
+        },
+        {
+            code: "for (const x of/*comment*/{}.hasOwnProperty.call(object, property).toString());",
+            output: "for (const x of/*comment*/Object.hasOwn(object, property).toString());",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 27,
+                endLine: 1,
+                endColumn: 67
+            }]
+        },
+        {
+            code: "for (const x in{}.hasOwnProperty.call(object, property).toString());",
+            output: "for (const x in Object.hasOwn(object, property).toString());",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 16,
+                endLine: 1,
+                endColumn: 56
+            }]
+        },
+        {
+            code: "for (const x in/*comment*/{}.hasOwnProperty.call(object, property).toString());",
+            output: "for (const x in/*comment*/Object.hasOwn(object, property).toString());",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 27,
+                endLine: 1,
+                endColumn: 67
+            }]
+        },
+        {
+            code: "function foo(){return({}.hasOwnProperty.call)(object, property)}",
+            output: "function foo(){return(Object.hasOwn)(object, property)}",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 22,
+                endLine: 1,
+                endColumn: 64
+            }]
+        },
+        {
+            code: "Object['prototype']['hasOwnProperty']['call'](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 64
+            }]
+        },
+        {
+            code: "Object[`prototype`][`hasOwnProperty`][`call`](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 64
+            }]
+        },
+        {
+            code: "Object['hasOwnProperty']['call'](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 51
+            }]
+        },
+        {
+            code: "Object[`hasOwnProperty`][`call`](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 51
+            }]
+        },
+        {
+            code: "({})['hasOwnProperty']['call'](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 49
+            }]
+        },
+        {
+            code: "({})[`hasOwnProperty`][`call`](object, property);",
+            output: "Object.hasOwn(object, property);",
+            errors: [{
+                messageId: "useHasOwn",
+                line: 1,
+                column: 1,
+                endLine: 1,
+                endColumn: 49
+            }]
+        }
+    ]
+});
index ccd88ae74fd5053033e8127ae32d8c954f1f3339..f2982cbfb72a263c848268da23e9713fb1f36031 100644 (file)
@@ -26,6 +26,8 @@ ruleTester.run("prefer-regex-literals", rule, {
 
         // considered as dynamic
         "new RegExp(pattern)",
+        "new RegExp('\\\\p{Emoji_Presentation}\\\\P{Script_Extensions=Latin}' + '', `ug`)",
+        "new RegExp('\\\\cA' + '')",
         "RegExp(pattern, 'g')",
         "new RegExp(f('a'))",
         "RegExp(prefix + 'a')",
@@ -33,6 +35,7 @@ ruleTester.run("prefer-regex-literals", rule, {
         "RegExp(`a` + suffix);",
         "new RegExp(String.raw`a` + suffix);",
         "RegExp('a', flags)",
+        "const flags = 'gu';RegExp('a', flags)",
         "RegExp('a', 'g' + flags)",
         "new RegExp(String.raw`a`, flags);",
         "RegExp(`${prefix}abc`)",
@@ -42,8 +45,10 @@ ruleTester.run("prefer-regex-literals", rule, {
         "new RegExp(String.raw`a${''}c`);",
         "new RegExp('a' + 'b')",
         "RegExp(1)",
-        "new RegExp(/a/, 'u');",
-        "new RegExp(/a/);",
+        "new RegExp('(\\\\p{Emoji_Presentation})\\\\1' + '', `ug`)",
+        "RegExp(String.raw`\\78\\126` + '\\\\5934', '' + `g` + '')",
+        "func(new RegExp(String.raw`a${''}c\\d`, 'u'),new RegExp(String.raw`a${''}c\\d`, 'u'))",
+        "new RegExp('\\\\[' + \"b\\\\]\")",
         {
             code: "new RegExp(/a/, flags);",
             options: [{ disallowRedundantWrapping: true }]
@@ -134,124 +139,2338 @@ ruleTester.run("prefer-regex-literals", rule, {
     invalid: [
         {
             code: "new RegExp('abc');",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp('abc');",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp('abc', 'g');",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp('abc', 'g');",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(`abc`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(`abc`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(`abc`, `g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(`abc`, `g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(String.raw`abc`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(String.raw`abc\nabc`);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc\\nabc/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(String.raw`\tabc\nabc`);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\tabc\\nabc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(String.raw`abc`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(String.raw`abc`, String.raw`g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(String.raw`abc`, String.raw`g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(String['raw']`a`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp('');",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/(?:)/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp('', '');",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/(?:)/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(String.raw``);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/(?:)/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp('a', `g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(`a`, 'g');",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp(String.raw`a`, 'g');",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new RegExp(String.raw`\\d`, `g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\d/g;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(String.raw`\\\\d`, `g`);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\\\d/g;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(String['raw']`\\\\d`, `g`);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\\\d/g;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(String[\"raw\"]`\\\\d`, `g`);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\\\d/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "RegExp('a', String.raw`g`);",
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/g;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "new globalThis.RegExp('a');",
-            env: { es2020: true },
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression" }]
+            env: {
+                es2020: true
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/;"
+                        }
+                    ]
+                }
+            ]
         },
         {
             code: "globalThis.RegExp('a');",
-            env: { es2020: true },
-            errors: [{ messageId: "unexpectedRegExp", type: "CallExpression" }]
+            env: {
+                es2020: true
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "CallExpression",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/;"
+                        }
+                    ]
+                }
+            ]
         },
-
         {
             code: "new RegExp(/a/);",
-            options: [{ disallowRedundantWrapping: true }],
-            errors: [{ messageId: "unexpectedRedundantRegExp", type: "NewExpression", line: 1, column: 1 }]
+            options: [
+                {
+                    disallowRedundantWrapping: true
+                }
+            ],
+            errors: [
+                {
+                    messageId: "unexpectedRedundantRegExp",
+                    type: "NewExpression",
+                    line: 1,
+                    column: 1
+                }
+            ]
         },
         {
             code: "new RegExp(/a/, 'u');",
-            options: [{ disallowRedundantWrapping: true }],
-            errors: [{ messageId: "unexpectedRedundantRegExpWithFlags", type: "NewExpression", line: 1, column: 1 }]
+            options: [
+                {
+                    disallowRedundantWrapping: true
+                }
+            ],
+            errors: [
+                {
+                    messageId: "unexpectedRedundantRegExpWithFlags",
+                    type: "NewExpression",
+                    line: 1,
+                    column: 1
+                }
+            ]
         },
         {
             code: "new RegExp(/a/, `u`);",
-            options: [{ disallowRedundantWrapping: true }],
-            errors: [{ messageId: "unexpectedRedundantRegExpWithFlags", type: "NewExpression", line: 1, column: 1 }]
+            options: [
+                {
+                    disallowRedundantWrapping: true
+                }
+            ],
+            errors: [
+                {
+                    messageId: "unexpectedRedundantRegExpWithFlags",
+                    type: "NewExpression",
+                    line: 1,
+                    column: 1
+                }
+            ]
+        },
+        {
+            code: "new RegExp(/a/, String.raw`u`);",
+            options: [
+                {
+                    disallowRedundantWrapping: true
+                }
+            ],
+            errors: [
+                {
+                    messageId: "unexpectedRedundantRegExpWithFlags",
+                    type: "NewExpression",
+                    line: 1,
+                    column: 1
+                }
+            ]
         },
         {
             code: "new RegExp('a');",
-            options: [{ disallowRedundantWrapping: true }],
-            errors: [{ messageId: "unexpectedRegExp", type: "NewExpression", line: 1, column: 1 }]
+            options: [
+                {
+                    disallowRedundantWrapping: true
+                }
+            ],
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    type: "NewExpression",
+                    line: 1,
+                    column: 1,
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/;"
+                        }
+                    ]
+                }
+            ]
         },
-
-        // Optional chaining
         {
             code: "new RegExp((String?.raw)`a`);",
-            errors: [{ messageId: "unexpectedRegExp" }]
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/a/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('+');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "new RegExp('*');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('+');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('*');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "new RegExp('+', 'g');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "new RegExp('*', 'g');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('+', 'g');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('*', 'g');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('abc', 'u');",
+            parserOptions: {
+                ecmaVersion: 3
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "new RegExp('abc', 'd');",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('abc', 'd');",
+            parserOptions: {
+                ecmaVersion: 2022
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/abc/d;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\\\\\', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\\\/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\n', '');",
+            parserOptions: {
+                ecmaVersion: 2022
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\n\\n', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n\\n/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\t', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\t/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\t\\t', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\t\\t/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\r\\n', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\r\\n/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\u1234', 'g')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\u{1234}', 'g')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\u{11111}', 'g')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\v', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\v/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\v\\v', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\v\\v/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\f', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\f/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\f\\f', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\f\\f/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\b', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\b/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\b\\\\b', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\b\\b/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('\\\\B\\\\b', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\B\\b/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\w', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\w/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new globalThis.RegExp('\\\\W', '');",
+            globals: {
+                globalThis: "readonly"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\W/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\s', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\s/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('\\\\S', '')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\S/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "globalThis.RegExp('\\\\d', '');",
+            globals: {
+                globalThis: "readonly"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\d/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "globalThis.RegExp('\\\\D', '')",
+            globals: {
+                globalThis: "readonly"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\D/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "globalThis.RegExp('\\\\\\\\\\\\D', '')",
+            globals: {
+                globalThis: "readonly"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\\\\\D/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('\\\\D\\\\D', '')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\D\\D/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new globalThis.RegExp('\\\\0\\\\0', '');",
+            globals: {
+                globalThis: "writable"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\0\\0/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('\\\\0\\\\0', '');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\0\\0/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('\\0\\0', 'g');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\0\\\\0\\\\0', '')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\0\\0\\0/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp('\\\\78\\\\126\\\\5934', '')",
+            parserOptions: {
+                ecmaVersion: 2022
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\78\\126\\5934/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new window['RegExp']('\\\\x56\\\\x78\\\\x45', '');",
+            env: {
+                browser: true
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\x56\\x78\\x45/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "a in(RegExp('abc'))",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "a in(/abc/)"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "x = y\n            RegExp(\"foo\").test(x) ? bar() : baz()",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "func(new RegExp(String.raw`\\w{1, 2`, 'u'),new RegExp(String.raw`\\w{1, 2`, 'u'))",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "x = y;\n            RegExp(\"foo\").test(x) ? bar() : baz()",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "x = y;\n            /foo/.test(x) ? bar() : baz()"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "typeof RegExp(\"foo\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "typeof /foo/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"foo\") instanceof RegExp(String.raw`blahblah`, 'g') ? typeof new RegExp('(\\\\p{Emoji_Presentation})\\\\1', `ug`) : false",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/foo/ instanceof RegExp(String.raw`blahblah`, 'g') ? typeof new RegExp('(\\\\p{Emoji_Presentation})\\\\1', `ug`) : false"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "RegExp(\"foo\") instanceof /blahblah/g ? typeof new RegExp('(\\\\p{Emoji_Presentation})\\\\1', `ug`) : false"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "RegExp(\"foo\") instanceof RegExp(String.raw`blahblah`, 'g') ? typeof /(\\p{Emoji_Presentation})\\1/ug : false"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "[   new RegExp(`someregular`)]",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "[   /someregular/]"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "const totallyValidatesEmails = new RegExp(\"\\\\S+@(\\\\S+\\\\.)+\\\\S+\")\n            if (typeof totallyValidatesEmails === 'object') {\n                runSomethingThatExists(Regexp('stuff'))\n            }",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "const totallyValidatesEmails = /\\S+@(\\S+\\.)+\\S+/\n            if (typeof totallyValidatesEmails === 'object') {\n                runSomethingThatExists(Regexp('stuff'))\n            }"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~new RegExp('^Sup, ') || new RegExp('hi') + new RegExp('person') === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!/^Hey, /u && new RegExp('jk$') && ~new RegExp('^Sup, ') || new RegExp('hi') + new RegExp('person') === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && /jk$/ && ~new RegExp('^Sup, ') || new RegExp('hi') + new RegExp('person') === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~/^Sup, / || new RegExp('hi') + new RegExp('person') === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~new RegExp('^Sup, ') || /hi/ + new RegExp('person') === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~new RegExp('^Sup, ') || new RegExp('hi') + /person/ === -new RegExp('hi again') ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~new RegExp('^Sup, ') || new RegExp('hi') + new RegExp('person') === -/hi again/ ? 5 * new RegExp('abc') : 'notregbutstring'"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "!new RegExp('^Hey, ', 'u') && new RegExp('jk$') && ~new RegExp('^Sup, ') || new RegExp('hi') + new RegExp('person') === -new RegExp('hi again') ? 5 * /abc/ : 'notregbutstring'"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "#!/usr/bin/sh\n            RegExp(\"foo\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "#!/usr/bin/sh\n            /foo/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "async function abc(){await new RegExp(\"foo\")}",
+            parserOptions: {
+                ecmaVersion: 8,
+                sourceType: "module"
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "function* abc(){yield new RegExp(\"foo\")}",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "function* abc(){yield* new RegExp(\"foo\")}",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "function* abc(){yield* /foo/}"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "console.log({ ...new RegExp('a') })",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "console.log({ .../a/ })"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "delete RegExp('a');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "delete /a/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "void RegExp('a');",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "void /a/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\\\S+@(\\\\S+\\\\.)+\\\\S+\")**RegExp('a')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\S+@(\\S+\\.)+\\S+/**RegExp('a')"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "new RegExp(\"\\\\S+@(\\\\S+\\\\.)+\\\\S+\")**/a/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\\\S+@(\\\\S+\\\\.)+\\\\S+\")%RegExp('a')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\S+@(\\S+\\.)+\\S+/%RegExp('a')"
+                        }
+                    ]
+                },
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "new RegExp(\"\\\\S+@(\\\\S+\\\\.)+\\\\S+\")%/a/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "a in RegExp('abc')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "a in /abc/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ == new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ == /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ === new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ === /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ != new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ != /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ !== new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ !== /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ > new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ > /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ < new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ < /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ >= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ >= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ <= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ <= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ << new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ << /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ >> new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ >> /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ >>> new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ >>> /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ ^ new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ ^ /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ & new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ & /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            /abc/ | new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            /abc/ | /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            null ?? new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            null ?? /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc *= new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc *= /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            console.log({a: new RegExp('sup')})\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            console.log({a: /sup/})\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            console.log(() => {new RegExp('sup')})\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            console.log(() => {/sup/})\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            function abc() {new RegExp('sup')}\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            function abc() {/sup/}\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            function abc() {return new RegExp('sup')}\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            function abc() {return /sup/}\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc <<= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc <<= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc >>= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc >>= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc >>>= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc >>>= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc ^= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc ^= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc &= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc &= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc |= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc |= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc ??= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc ??= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc &&= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc &&= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc ||= new RegExp('cba');\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc ||= /cba/;\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc **= new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc **= /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc /= new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc /= /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc += new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc += /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc -= new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc -= /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            abc %= new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            abc %= /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            () => new RegExp('blah')\n            ",
+            parserOptions: {
+                ecmaVersion: 2021
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            () => /blah/\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "a/RegExp(\"foo\")in b",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "a/ /foo/ in b"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "a/RegExp(\"foo\")instanceof b",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "a/ /foo/ instanceof b"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "do RegExp(\"foo\")\nwhile (true);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "do /foo/\nwhile (true);"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "for(let i;i<5;i++) { break\nnew RegExp('search')}",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "for(let i;i<5;i++) { break\n/search/}"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "for(let i;i<5;i++) { continue\nnew RegExp('search')}",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "for(let i;i<5;i++) { continue\n/search/}"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "\n            switch (value) {\n                case \"possibility\":\n                    console.log('possibility matched')\n                case RegExp('myReg').toString():\n                    console.log('matches a regexp\\' toString value')\n                    break;\n            }\n            ",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "\n            switch (value) {\n                case \"possibility\":\n                    console.log('possibility matched')\n                case /myReg/.toString():\n                    console.log('matches a regexp\\' toString value')\n                    break;\n            }\n            "
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "throw new RegExp('abcdefg') // fail with a regular expression",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "throw /abcdefg/ // fail with a regular expression"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "for (value of new RegExp('something being searched')) { console.log(value) }",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "(async function(){for await (value of new RegExp('something being searched')) { console.log(value) }})()",
+            parserOptions: {
+                ecmaVersion: 2018
+            },
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "for (value in new RegExp('something being searched')) { console.log(value) }",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "for (value in /something being searched/) { console.log(value) }"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "if (condition1 && condition2) new RegExp('avalue').test(str);",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
+        },
+        {
+            code: "debugger\nnew RegExp('myReg')",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "debugger\n/myReg/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"\\\\\\n\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"\\\\\\t\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\t/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"\\\\\\f\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\f/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"\\\\\\v\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\v/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "RegExp(\"\\\\\\r\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\r/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\t\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\t/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"/\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\//"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\.\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/./"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\\\.\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\./"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\\\\\n\\\\\\n\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n\\n/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\\\\\n\\\\\\f\\\\\\n\")",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n\\f\\n/"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp(\"\\u000A\\u000A\");",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: [
+                        {
+                            messageId: "replaceWithLiteral",
+                            output: "/\\n\\n/;"
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            code: "new RegExp('mysafereg' /* comment explaining its safety */)",
+            errors: [
+                {
+                    messageId: "unexpectedRegExp",
+                    suggestions: null
+                }
+            ]
         }
     ]
 });
index eea0255f1ac0454bcbaa455f92fe94c14fd10f1e..a89a36a9de2fd85c32f6d48361962fe8e053cc83 100644 (file)
@@ -223,6 +223,187 @@ ruleTester.run("prefer-template", rule, {
             code: "foo + '\\0'",
             output: "`${foo  }\\0`",
             errors
+        },
+
+        // https://github.com/eslint/eslint/issues/15083
+        {
+            code: `"default-src 'self' https://*.google.com;"
+            + "frame-ancestors 'none';"
+            + "report-to " + foo + ";"`,
+            output: `\`default-src 'self' https://*.google.com;\`
+            + \`frame-ancestors 'none';\`
+            + \`report-to \${  foo  };\``,
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo",
+            output: "`a` + `b${  foo}`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + 'c' + 'd'",
+            output: "`a` + `b${  foo  }c` + `d`",
+            errors
+        },
+        {
+            code: "'a' + 'b + c' + foo + 'd' + 'e'",
+            output: "`a` + `b + c${  foo  }d` + `e`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + 'd')",
+            output: "`a` + `b${  foo  }c` + `d`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('a' + 'b')",
+            output: "`a` + `b${  foo  }a` + `b`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + 'd') + ('e' + 'f')",
+            output: "`a` + `b${  foo  }c` + `d` + `e` + `f`",
+            errors
+        },
+        {
+            code: "foo + ('a' + 'b') + ('c' + 'd')",
+            output: "`${foo  }a` + `b` + `c` + `d`",
+            errors
+        },
+        {
+            code: "'a' + foo + ('b' + 'c') + ('d' + bar + 'e')",
+            output: "`a${  foo  }b` + `c` + `d${  bar  }e`",
+            errors
+        },
+        {
+            code: "foo + ('b' + 'c') + ('d' + bar + 'e')",
+            output: "`${foo  }b` + `c` + `d${  bar  }e`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + 'd' + 'e')",
+            output: "`a` + `b${  foo  }c` + `d` + `e`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + bar + 'd')",
+            output: "`a` + `b${  foo  }c${  bar  }d`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + bar + ('d' + 'e') + 'f')",
+            output: "`a` + `b${  foo  }c${  bar  }d` + `e` + `f`",
+            errors
+        },
+        {
+            code: "'a' + 'b' + foo + ('c' + bar + 'e') + 'f' + test",
+            output: "`a` + `b${  foo  }c${  bar  }e` + `f${  test}`",
+            errors
+        },
+        {
+            code: "'a' + foo + ('b' + bar + 'c') + ('d' + test)",
+            output: "`a${  foo  }b${  bar  }c` + `d${  test}`",
+            errors
+        },
+        {
+            code: "'a' + foo + ('b' + 'c') + ('d' + bar)",
+            output: "`a${  foo  }b` + `c` + `d${  bar}`",
+            errors
+        },
+        {
+            code: "foo + ('a' + bar + 'b') + 'c' + test",
+            output: "`${foo  }a${  bar  }b` + `c${  test}`",
+            errors
+        },
+        {
+            code: "'a' + '`b`' + c",
+            output: "`a` + `\\`b\\`${  c}`",
+            errors
+        },
+        {
+            code: "'a' + '`b` + `c`' + d",
+            output: "`a` + `\\`b\\` + \\`c\\`${  d}`",
+            errors
+        },
+        {
+            code: "'a' + b + ('`c`' + '`d`')",
+            output: "`a${  b  }\\`c\\`` + `\\`d\\``",
+            errors
+        },
+        {
+            code: "'`a`' + b + ('`c`' + '`d`')",
+            output: "`\\`a\\`${  b  }\\`c\\`` + `\\`d\\``",
+            errors
+        },
+        {
+            code: "foo + ('`a`' + bar + '`b`') + '`c`' + test",
+            output: "`${foo  }\\`a\\`${  bar  }\\`b\\`` + `\\`c\\`${  test}`",
+            errors
+        },
+        {
+            code: "'a' + ('b' + 'c') + d",
+            output: "`a` + `b` + `c${  d}`",
+            errors
+        },
+        {
+            code: "'a' + ('`b`' + '`c`') + d",
+            output: "`a` + `\\`b\\`` + `\\`c\\`${  d}`",
+            errors
+        },
+        {
+            code: "a + ('b' + 'c') + d",
+            output: "`${a  }b` + `c${  d}`",
+            errors
+        },
+        {
+            code: "a + ('b' + 'c') + (d + 'e')",
+            output: "`${a  }b` + `c${  d  }e`",
+            errors
+        },
+        {
+            code: "a + ('`b`' + '`c`') + d",
+            output: "`${a  }\\`b\\`` + `\\`c\\`${  d}`",
+            errors
+        },
+        {
+            code: "a + ('`b` + `c`' + '`d`') + e",
+            output: "`${a  }\\`b\\` + \\`c\\`` + `\\`d\\`${  e}`",
+            errors
+        },
+        {
+            code: "'a' + ('b' + 'c' + 'd') + e",
+            output: "`a` + `b` + `c` + `d${  e}`",
+            errors
+        },
+        {
+            code: "'a' + ('b' + 'c' + 'd' + (e + 'f') + 'g' +'h' + 'i') + j",
+            output: "`a` + `b` + `c` + `d${  e  }fg` +`h` + `i${  j}`",
+            errors
+        },
+        {
+            code: "a + (('b' + 'c') + 'd')",
+            output: "`${a  }b` + `c` + `d`",
+            errors
+        },
+        {
+            code: "(a + 'b') + ('c' + 'd') + e",
+            output: "`${a  }b` + `c` + `d${  e}`",
+            errors
+        },
+        {
+            code: "var foo = \"Hello \" + \"world \" + \"another \" + test",
+            output: "var foo = `Hello ` + `world ` + `another ${  test}`",
+            errors
+        },
+        {
+            code: "'Hello ' + '\"world\" ' + test",
+            output: "`Hello ` + `\"world\" ${  test}`",
+            errors
+        },
+        {
+            code: "\"Hello \" + \"'world' \" + test",
+            output: "`Hello ` + `'world' ${  test}`",
+            errors
         }
     ]
 });
index faf3713019b91a8cdcf95e970250374332df8247..d1c42b73e84064d40100258dc5fd61d387692526 100644 (file)
@@ -77,6 +77,16 @@ ruleTester.run("quotes", rule, {
         { code: "import a from \"a\"; import b from 'b';", options: ["backtick"], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
         { code: "export * from \"a\"; export * from 'b';", options: ["backtick"], parserOptions: { ecmaVersion: 6, sourceType: "module" } },
 
+        // `backtick` should not warn module export names.
+        { code: "import { \"a\" as b, 'c' as d } from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "let a, c; export { a as \"b\", c as 'd' };", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\", 'b' } from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { a as \"b\", c as 'd' } from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\" as b, 'c' as d } from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export { \"a\" as \"b\", 'c' as 'd' } from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export * as \"a\" from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+        { code: "export * as 'a' from 'mod';", options: ["backtick"], parserOptions: { ecmaVersion: 2022, sourceType: "module" } },
+
         // `backtick` should not warn property/method names (not computed).
         { code: "var obj = {\"key0\": 0, 'key1': 1};", options: ["backtick"], parserOptions: { ecmaVersion: 6 } },
         { code: "class Foo { 'bar'(){} }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } },
index ff6482747ad9a50c82b216d1db9a8694da5d2206..5c9523ab68cc8fe74e4f424216de9318f956c9ec 100644 (file)
@@ -163,7 +163,202 @@ ruleTester.run("sort-keys", rule, {
         { code: "var obj = {è:4, À:3, 'Z':2, '#':1}", options: ["desc", { natural: true, caseSensitive: false }] },
 
         // desc, natural, insensitive, minKeys should ignore unsorted keys when number of keys is less than minKeys
-        { code: "var obj = {a:1, _:2, b:3}", options: ["desc", { natural: true, caseSensitive: false, minKeys: 4 }] }
+        { code: "var obj = {a:1, _:2, b:3}", options: ["desc", { natural: true, caseSensitive: false, minKeys: 4 }] },
+
+        // allowLineSeparatedGroups option
+        {
+            code: `
+                var obj = {
+                    e: 1,
+                    f: 2,
+                    g: 3,
+
+                    a: 4,
+                    b: 5,
+                    c: 6
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }]
+        },
+        {
+            code: `
+                var obj = {
+                    b: 1,
+
+                    // comment
+                    a: 2,
+                    c: 3
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }]
+        },
+        {
+            code: `
+                var obj = {
+                    b: 1
+                    
+                    ,
+
+                    // comment
+                    a: 2,
+                    c: 3
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }]
+        },
+        {
+            code: `
+                var obj = {
+                    c: 1,
+                    d: 2,
+
+                    b() {
+                    },
+                    e: 4
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    c: 1,
+                    d: 2,
+                    // comment
+
+                    // comment
+                    b() {
+                    },
+                    e: 4
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                  b,
+
+                  [a+b]: 1,
+                  a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    c: 1,
+                    d: 2,
+
+                    a() {
+
+                    },
+
+                    // abce
+                    f: 3,
+
+                    /*
+
+                    */
+                    [a+b]: 1,
+                    cc: 1,
+                    e: 2
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    b: "/*",
+
+                    a: "*/",
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }]
+        },
+        {
+            code: `
+                var obj = {
+                    b,
+                    /*
+                    */ //
+
+                    a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    b,
+
+                    /*
+                    */ //
+                    a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    b: 1
+
+                    ,a: 2
+                };
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                    b: 1
+                // comment before comma
+
+                ,
+                a: 2
+                };
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+        {
+            code: `
+                var obj = {
+                  b,
+
+                  a,
+                  ...z,
+                  c
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 2018 }
+        },
+        {
+            code: `
+                var obj = {
+                  b,
+
+                  [foo()]: [
+
+                  ],
+                  a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 2018 }
+        }
     ],
     invalid: [
 
@@ -1761,6 +1956,296 @@ ruleTester.run("sort-keys", rule, {
                     }
                 }
             ]
+        },
+
+        // When allowLineSeparatedGroups option is false
+        {
+            code: `
+                var obj = {
+                    b: 1,
+                    c: 2,
+                    a: 3
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: false }],
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "c"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                let obj = {
+                    b
+
+                    ,a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: false }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "b"
+                    }
+                }
+            ]
+        },
+
+        // When allowLineSeparatedGroups option is true
+        {
+            code: `
+                 var obj = {
+                    b: 1,
+                    c () {
+
+                    },
+                    a: 3
+                  }
+             `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "c"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                 var obj = {
+                    a: 1,
+                    b: 2,
+
+                    z () {
+
+                    },
+                    y: 3
+                  }
+             `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "y",
+                        prevName: "z"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                 var obj = {
+                    b: 1,
+                    c () {
+                    },
+                    // comment
+                    a: 3
+                  }
+             `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "c"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                var obj = {
+                  b,
+                  [a+b]: 1,
+                  a // sort-keys: 'a' should be before 'b'
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "b"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                var obj = {
+                    c: 1,
+                    d: 2,
+                    // comment
+                    // comment
+                    b() {
+                    },
+                    e: 4
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "b",
+                        prevName: "d"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                var obj = {
+                    c: 1,
+                    d: 2,
+
+                    z() {
+
+                    },
+                    f: 3,
+                    /*
+
+
+                    */
+                    [a+b]: 1,
+                    b: 1,
+                    e: 2
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "f",
+                        prevName: "z"
+                    }
+                },
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "b",
+                        prevName: "f"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                var obj = {
+                    b: "/*",
+                    a: "*/",
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "b"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                var obj = {
+                    b: 1
+                    // comment before comma
+                    , a: 2
+                };
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 6 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "b"
+                    }
+                }
+            ]
+        },
+        {
+            code: `
+                let obj = {
+                  b,
+                  [foo()]: [
+                  // ↓ this blank is inside a property and therefore should not count
+
+                  ],
+                  a
+                }
+            `,
+            options: ["asc", { allowLineSeparatedGroups: true }],
+            parserOptions: { ecmaVersion: 2018 },
+            errors: [
+                {
+                    messageId: "sortKeys",
+                    data: {
+                        natural: "",
+                        insensitive: "",
+                        order: "asc",
+                        thisName: "a",
+                        prevName: "b"
+                    }
+                }
+            ]
         }
     ]
 });
index ccee19c663dc3e1d2fb71f96f0b6b4a7070ec724..9969bbc64e323a0a7d4f1c167b0f231ab95637aa 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @fileoverview This rule shoud require or disallow spaces before or after unary operations.
+ * @fileoverview This rule should require or disallow spaces before or after unary operations.
  * @author Marcin Kumorek
  */
 "use strict";
index 7789de7742c66f071480b7b115a584a766f3da5a..c36a9ac0e25270171cac88fde73b6283027c2cba 100644 (file)
@@ -204,7 +204,10 @@ describe("ast-utils", () => {
                 "// lalala I'm a normal comment",
                 "// trying to confuse eslint ",
                 "//trying to confuse eslint-directive-detection",
-                "//eslint is awesome"
+                "//eslint is awesome",
+                "//global line comment is not a directive",
+                "//globals line comment is not a directive",
+                "//exported line comment is not a directive"
             ].join("\n");
             const ast = espree.parse(code, ESPREE_CONFIG);
             const sourceCode = new SourceCode(code, ast);
@@ -247,7 +250,10 @@ describe("ast-utils", () => {
                 "/*eslint-enable no-undef*/",
                 "/* eslint-env {\"es6\": true} */",
                 "/* eslint foo */",
-                "/*eslint bar*/"
+                "/*eslint bar*/",
+                "/*global foo*/",
+                "/*globals foo*/",
+                "/*exported foo*/"
             ].join("\n");
             const ast = espree.parse(code, ESPREE_CONFIG);
             const sourceCode = new SourceCode(code, ast);
@@ -1480,10 +1486,14 @@ describe("ast-utils", () => {
             [["a/", "+b"], true],
             [["a+", "/^regex$/"], true],
             [["a/", "/^regex$/"], false],
+            [["a+", "/**/"], true],
             [["a+", "/**/b"], true],
+            [["//", "a"], false],
             [["a/", "/**/b"], false],
+            [["a+", "//"], true],
             [["a+", "//\nb"], true],
             [["a/", "//\nb"], false],
+            [["/**/", "b"], true],
             [["a/**/", "b"], true],
             [["/**/a", "b"], false],
             [["a", "/**/b"], true],
index 33fe23eee124f035e06c21d21fc42358a24fdcac..aeed89173bbfb01a16d39b668e759cf9b73966cb 100644 (file)
@@ -129,7 +129,7 @@ describe("FixTracker", () => {
         });
     });
 
-    describe("retainSurroungingTokens", () => {
+    describe("retainSurroundingTokens", () => {
         it("handles a change to a binary operator", () => {
             const sourceCode = createSourceCode("const i = j + k;");
             const plusToken = sourceCode.ast.tokens[4];
index cd28088a0edd77a7766fa2c6509f7cadb8a339e9..35a52f0a6c00e7b931a78abc31fca2fa14b945e6 100644 (file)
@@ -45,6 +45,7 @@ ruleTester.run("valid-typeof", rule, {
         "typeof(foo) == 'string'",
         "typeof(foo) != 'string'",
         "var oddUse = typeof foo + 'thing'",
+        "function f(undefined) { typeof x === undefined }",
         {
             code: "typeof foo === 'number'",
             options: [{ requireStringLiterals: true }]
@@ -136,6 +137,21 @@ ruleTester.run("valid-typeof", rule, {
             options: [{ requireStringLiterals: true }],
             errors: [{ messageId: "invalidValue", type: "Literal" }]
         },
+        {
+            code: "if (typeof bar !== undefined) {}",
+            errors: [
+                {
+                    messageId: "invalidValue",
+                    type: "Identifier",
+                    suggestions: [
+                        {
+                            messageId: "suggestString",
+                            data: { type: "undefined" },
+                            output: 'if (typeof bar !== "undefined") {}'
+                        }
+                    ]
+                }]
+        },
         {
             code: "typeof foo == Object",
             options: [{ requireStringLiterals: true }],
@@ -144,17 +160,50 @@ ruleTester.run("valid-typeof", rule, {
         {
             code: "typeof foo === undefined",
             options: [{ requireStringLiterals: true }],
-            errors: [{ messageId: "notString", type: "Identifier" }]
+            errors: [
+                {
+                    messageId: "notString",
+                    type: "Identifier",
+                    suggestions: [
+                        {
+                            messageId: "suggestString",
+                            data: { type: "undefined" },
+                            output: 'typeof foo === "undefined"'
+                        }
+                    ]
+                }]
         },
         {
             code: "undefined === typeof foo",
             options: [{ requireStringLiterals: true }],
-            errors: [{ messageId: "notString", type: "Identifier" }]
+            errors: [
+                {
+                    messageId: "notString",
+                    type: "Identifier",
+                    suggestions: [
+                        {
+                            messageId: "suggestString",
+                            data: { type: "undefined" },
+                            output: '"undefined" === typeof foo'
+                        }
+                    ]
+                }]
         },
         {
             code: "undefined == typeof foo",
             options: [{ requireStringLiterals: true }],
-            errors: [{ messageId: "notString", type: "Identifier" }]
+            errors: [
+                {
+                    messageId: "notString",
+                    type: "Identifier",
+                    suggestions: [
+                        {
+                            messageId: "suggestString",
+                            data: { type: "undefined" },
+                            output: '"undefined" == typeof foo'
+                        }
+                    ]
+                }]
         },
         {
             code: "typeof foo === `undefined${foo}`",
index 035e265da40420083ca994973f15aef30fe64930..642e29b26dfef30f84b61e0076a7b038412de487 100644 (file)
@@ -434,7 +434,7 @@ ruleTester.run("wrap-iife", rule, {
         },
         {
             code: "if ((function (){}())) {}",
-            output: "if ((function (){})()) {}", // wrap function expression and remove unnecessary grouping parens aroung the call expression
+            output: "if ((function (){})()) {}", // wrap function expression and remove unnecessary grouping parens around the call expression
             options: ["inside"],
             errors: [wrapExpressionError]
         },
@@ -557,7 +557,7 @@ ruleTester.run("wrap-iife", rule, {
         },
         {
             code: "if ((function (){}.call())) {}",
-            output: "if ((function (){}).call()) {}", // wrap function expression and remove unnecessary grouping parens aroung the call expression
+            output: "if ((function (){}).call()) {}", // wrap function expression and remove unnecessary grouping parens around the call expression
             options: ["inside", { functionPrototypeMethods: true }],
             errors: [wrapExpressionError]
         },
index dd88be5e69b00dd4fa4d81a031b180bfcec92995..53b466adf06dd155ced23bffee0a94ccde300bba 100644 (file)
@@ -23,6 +23,14 @@ describe("unsupported-api", () => {
         assert.isFunction(api.FileEnumerator);
     });
 
+    it("should have FlatESLint exposed", () => {
+        assert.isFunction(api.FlatESLint);
+    });
+
+    it("should have FlatRuleTester exposed", () => {
+        assert.isFunction(api.FlatRuleTester);
+    });
+
     it("should have builtinRules exposed", () => {
         assert.instanceOf(api.builtinRules, LazyLoadingRuleMap);
     });
diff --git a/eslint/tests/tools/config-rule.js b/eslint/tests/tools/config-rule.js
new file mode 100644 (file)
index 0000000..c91f464
--- /dev/null
@@ -0,0 +1,329 @@
+/**
+ * @fileoverview Tests for ConfigOps
+ * @author Ian VanSchooten
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const assert = require("chai").assert,
+    ConfigRule = require("../../tools/config-rule"),
+    builtInRules = require("../../lib/rules"),
+    schema = require("../fixtures/config-rule/schemas");
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+const SEVERITY = 2;
+
+describe("ConfigRule", () => {
+
+    describe("generateConfigsFromSchema()", () => {
+        let actualConfigs;
+
+        it("should create a config with only severity for an empty schema", () => {
+            actualConfigs = ConfigRule.generateConfigsFromSchema([]);
+            assert.deepStrictEqual(actualConfigs, [SEVERITY]);
+        });
+
+        it("should create a config with only severity with no arguments", () => {
+            actualConfigs = ConfigRule.generateConfigsFromSchema();
+            assert.deepStrictEqual(actualConfigs, [SEVERITY]);
+        });
+
+        describe("for a single enum schema", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.enum);
+            });
+
+            it("should create an array of configs", () => {
+                assert.isArray(actualConfigs);
+                assert.strictEqual(actualConfigs.length, 3);
+            });
+
+            it("should include the error severity (2) without options as the first config", () => {
+                assert.strictEqual(actualConfigs[0], SEVERITY);
+            });
+
+            it("should set all configs to error severity (2)", () => {
+                actualConfigs.forEach(actualConfig => {
+                    if (Array.isArray(actualConfig)) {
+                        assert.strictEqual(actualConfig[0], SEVERITY);
+                    }
+                });
+            });
+
+            it("should return configs with each enumerated value in the schema", () => {
+                assert.sameDeepMembers(actualConfigs, [SEVERITY, [SEVERITY, "always"], [SEVERITY, "never"]]);
+            });
+        });
+
+        describe("for a object schema with a single enum property", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithEnum);
+            });
+
+            it("should return configs with option objects", () => {
+
+                // Skip first config (severity only)
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const actualConfigOption = actualConfig[1]; // severity is first element, option is second
+
+                    assert.isObject(actualConfigOption);
+                });
+            });
+
+            it("should use the object property name from the schema", () => {
+                const propName = "enumProperty";
+
+                assert.strictEqual(actualConfigs.length, 3);
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const actualConfigOption = actualConfig[1];
+
+                    assert.property(actualConfigOption, propName);
+                });
+            });
+
+            it("should have each enum as option object values", () => {
+                const propName = "enumProperty",
+                    actualValues = [];
+
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const configOption = actualConfig[1];
+
+                    actualValues.push(configOption[propName]);
+                });
+                assert.sameMembers(actualValues, ["always", "never"]);
+            });
+        });
+
+        describe("for a object schema with a multiple enum properties", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithMultipleEnums);
+            });
+
+            it("should create configs for all properties in each config", () => {
+                const expectedProperties = ["firstEnum", "anotherEnum"];
+
+                assert.strictEqual(actualConfigs.length, 7);
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const configOption = actualConfig[1];
+                    const actualProperties = Object.keys(configOption);
+
+                    assert.sameMembers(actualProperties, expectedProperties);
+                });
+            });
+
+            it("should create configs for every possible combination", () => {
+                const expectedConfigs = [
+                    { firstEnum: "always", anotherEnum: "var" },
+                    { firstEnum: "always", anotherEnum: "let" },
+                    { firstEnum: "always", anotherEnum: "const" },
+                    { firstEnum: "never", anotherEnum: "var" },
+                    { firstEnum: "never", anotherEnum: "let" },
+                    { firstEnum: "never", anotherEnum: "const" }
+                ];
+                const actualConfigOptions = actualConfigs.slice(1).map(actualConfig => actualConfig[1]);
+
+                assert.sameDeepMembers(actualConfigOptions, expectedConfigs);
+            });
+
+        });
+
+        describe("for a object schema with a single boolean property", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithBool);
+            });
+
+            it("should return configs with option objects", () => {
+                assert.strictEqual(actualConfigs.length, 3);
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const actualConfigOption = actualConfig[1];
+
+                    assert.isObject(actualConfigOption);
+                });
+            });
+
+            it("should use the object property name from the schema", () => {
+                const propName = "boolProperty";
+
+                assert.strictEqual(actualConfigs.length, 3);
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const actualConfigOption = actualConfig[1];
+
+                    assert.property(actualConfigOption, propName);
+                });
+            });
+
+            it("should include both true and false configs", () => {
+                const propName = "boolProperty",
+                    actualValues = [];
+
+                actualConfigs.slice(1).forEach(actualConfig => {
+                    const configOption = actualConfig[1];
+
+                    actualValues.push(configOption[propName]);
+                });
+                assert.sameMembers(actualValues, [true, false]);
+            });
+        });
+
+        describe("for a object schema with a multiple bool properties", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.objectWithMultipleBools);
+            });
+
+            it("should create configs for all properties in each config", () => {
+                const expectedProperties = ["firstBool", "anotherBool"];
+
+                assert.strictEqual(actualConfigs.length, 5);
+                actualConfigs.slice(1).forEach(config => {
+                    const configOption = config[1];
+                    const actualProperties = Object.keys(configOption);
+
+                    assert.sameMembers(actualProperties, expectedProperties);
+                });
+            });
+
+            it("should create configs for every possible combination", () => {
+                const expectedConfigOptions = [
+                    { firstBool: true, anotherBool: true },
+                    { firstBool: true, anotherBool: false },
+                    { firstBool: false, anotherBool: true },
+                    { firstBool: false, anotherBool: false }
+                ];
+                const actualConfigOptions = actualConfigs.slice(1).map(config => config[1]);
+
+                assert.sameDeepMembers(actualConfigOptions, expectedConfigOptions);
+            });
+        });
+
+        describe("for a schema with an enum and an object", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedEnumObject);
+            });
+
+            it("should create configs with only the enum values", () => {
+                assert.strictEqual(actualConfigs[1].length, 2);
+                assert.strictEqual(actualConfigs[2].length, 2);
+                const actualOptions = [actualConfigs[1][1], actualConfigs[2][1]];
+
+                assert.sameMembers(actualOptions, ["always", "never"]);
+            });
+
+            it("should create configs with a string and an object", () => {
+                assert.strictEqual(actualConfigs.length, 7);
+                actualConfigs.slice(3).forEach(config => {
+                    assert.isString(config[1]);
+                    assert.isObject(config[2]);
+                });
+            });
+        });
+
+        describe("for a schema with an enum followed by an object with no usable properties", () => {
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedEnumObjectWithNothing);
+            });
+
+            it("should create config only for the enum", () => {
+                const expectedConfigs = [2, [2, "always"], [2, "never"]];
+
+                assert.sameDeepMembers(actualConfigs, expectedConfigs);
+            });
+        });
+
+        describe("for a schema with an enum preceded by an object with no usable properties", () => {
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedObjectWithNothingEnum);
+            });
+
+            it("should not create a config for the enum", () => {
+                const expectedConfigs = [2];
+
+                assert.sameDeepMembers(actualConfigs, expectedConfigs);
+            });
+        });
+
+        describe("for a schema with an enum preceded by a string", () => {
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.mixedStringEnum);
+            });
+
+            it("should not create a config for the enum", () => {
+                const expectedConfigs = [2];
+
+                assert.sameDeepMembers(actualConfigs, expectedConfigs);
+            });
+        });
+
+        describe("for a schema with oneOf", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.oneOf);
+            });
+
+            it("should create a set of configs", () => {
+                assert.isArray(actualConfigs);
+            });
+        });
+
+        describe("for a schema with nested objects", () => {
+
+            before(() => {
+                actualConfigs = ConfigRule.generateConfigsFromSchema(schema.nestedObjects);
+            });
+
+            it("should create a set of configs", () => {
+                assert.isArray(actualConfigs);
+            });
+        });
+    });
+
+    describe("createCoreRuleConfigs()", () => {
+
+        const rulesConfig = ConfigRule.createCoreRuleConfigs();
+
+        it("should create a rulesConfig containing all core rules", () => {
+            const
+                expectedRules = Array.from(builtInRules.keys()),
+                actualRules = Object.keys(rulesConfig);
+
+            assert.sameMembers(actualRules, expectedRules);
+        });
+
+        it("should allow to ignore deprecated rules", () => {
+            const expectedRules = Array.from(builtInRules.entries())
+                    .filter(([, rule]) => {
+                        const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated;
+
+                        return !isDeprecated;
+                    })
+                    .map(([id]) => id),
+                actualRules = Object.keys(ConfigRule.createCoreRuleConfigs(true));
+
+            assert.sameMembers(actualRules, expectedRules);
+
+            // Make sure it doesn't contain deprecated rules.
+            assert.notInclude(actualRules, "newline-after-var");
+        });
+
+        it("should create arrays of configs for rules", () => {
+            assert.isArray(rulesConfig.quotes);
+            assert.include(rulesConfig.quotes, 2);
+        });
+
+        it("should create configs for rules with meta", () => {
+            assert(rulesConfig["accessor-pairs"].length > 1);
+        });
+    });
+});
index c68f45820507ca8047438d10d3632310396cbaaf..e1eb4995cc0620f1afa5d3449fc686f474cf0cbc 100644 (file)
@@ -133,10 +133,8 @@ function reduceBadExampleSize({
      * @returns {ASTNode} A descendent of `node` which is also bad
      */
     function extractRelevantChild(node) {
-        const childNodes = [].concat(
-            ...visitorKeys[node.type]
-                .map(key => (Array.isArray(node[key]) ? node[key] : [node[key]]))
-        );
+        const childNodes = visitorKeys[node.type]
+            .flatMap(key => (Array.isArray(node[key]) ? node[key] : [node[key]]));
 
         for (const childNode of childNodes) {
             if (!childNode) {
diff --git a/eslint/tools/config-rule.js b/eslint/tools/config-rule.js
new file mode 100644 (file)
index 0000000..91e7eae
--- /dev/null
@@ -0,0 +1,316 @@
+/**
+ * @fileoverview Create configurations for a rule
+ * @author Ian VanSchooten
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const builtInRules = require("../lib/rules");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Wrap all of the elements of an array into arrays.
+ * @param {*[]} xs Any array.
+ * @returns {Array[]} An array of arrays.
+ */
+function explodeArray(xs) {
+    return xs.reduce((accumulator, x) => {
+        accumulator.push([x]);
+        return accumulator;
+    }, []);
+}
+
+/**
+ * Mix two arrays such that each element of the second array is concatenated
+ * onto each element of the first array.
+ *
+ * For example:
+ * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]]
+ * @param {Array} arr1 The first array to combine.
+ * @param {Array} arr2 The second array to combine.
+ * @returns {Array} A mixture of the elements of the first and second arrays.
+ */
+function combineArrays(arr1, arr2) {
+    const res = [];
+
+    if (arr1.length === 0) {
+        return explodeArray(arr2);
+    }
+    if (arr2.length === 0) {
+        return explodeArray(arr1);
+    }
+    arr1.forEach(x1 => {
+        arr2.forEach(x2 => {
+            res.push([].concat(x1, x2));
+        });
+    });
+    return res;
+}
+
+/**
+ * Group together valid rule configurations based on object properties
+ *
+ * e.g.:
+ * groupByProperty([
+ *     {before: true},
+ *     {before: false},
+ *     {after: true},
+ *     {after: false}
+ * ]);
+ *
+ * will return:
+ * [
+ *     [{before: true}, {before: false}],
+ *     [{after: true}, {after: false}]
+ * ]
+ * @param {Object[]} objects Array of objects, each with one property/value pair
+ * @returns {Array[]} Array of arrays of objects grouped by property
+ */
+function groupByProperty(objects) {
+    const groupedObj = objects.reduce((accumulator, obj) => {
+        const prop = Object.keys(obj)[0];
+
+        accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj];
+        return accumulator;
+    }, {});
+
+    return Object.keys(groupedObj).map(prop => groupedObj[prop]);
+}
+
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+/**
+ * Configuration settings for a rule.
+ *
+ * A configuration can be a single number (severity), or an array where the first
+ * element in the array is the severity, and is the only required element.
+ * Configs may also have one or more additional elements to specify rule
+ * configuration or options.
+ * @typedef {Array|number} ruleConfig
+ * @param {number} 0 The rule's severity (0, 1, 2).
+ */
+
+/**
+ * Object whose keys are rule names and values are arrays of valid ruleConfig items
+ * which should be linted against the target source code to determine error counts.
+ * (a ruleConfigSet.ruleConfigs).
+ *
+ * e.g. rulesConfig = {
+ *     "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]],
+ *     "no-console": [2]
+ * }
+ * @typedef rulesConfig
+ */
+
+
+/**
+ * Create valid rule configurations by combining two arrays,
+ * with each array containing multiple objects each with a
+ * single property/value pair and matching properties.
+ *
+ * e.g.:
+ * combinePropertyObjects(
+ *     [{before: true}, {before: false}],
+ *     [{after: true}, {after: false}]
+ * );
+ *
+ * will return:
+ * [
+ *     {before: true, after: true},
+ *     {before: true, after: false},
+ *     {before: false, after: true},
+ *     {before: false, after: false}
+ * ]
+ * @param {Object[]} objArr1 Single key/value objects, all with the same key
+ * @param {Object[]} objArr2 Single key/value objects, all with another key
+ * @returns {Object[]} Combined objects for each combination of input properties and values
+ */
+function combinePropertyObjects(objArr1, objArr2) {
+    const res = [];
+
+    if (objArr1.length === 0) {
+        return objArr2;
+    }
+    if (objArr2.length === 0) {
+        return objArr1;
+    }
+    objArr1.forEach(obj1 => {
+        objArr2.forEach(obj2 => {
+            const combinedObj = {};
+            const obj1Props = Object.keys(obj1);
+            const obj2Props = Object.keys(obj2);
+
+            obj1Props.forEach(prop1 => {
+                combinedObj[prop1] = obj1[prop1];
+            });
+            obj2Props.forEach(prop2 => {
+                combinedObj[prop2] = obj2[prop2];
+            });
+            res.push(combinedObj);
+        });
+    });
+    return res;
+}
+
+/**
+ * Creates a new instance of a rule configuration set
+ *
+ * A rule configuration set is an array of configurations that are valid for a
+ * given rule.  For example, the configuration set for the "semi" rule could be:
+ *
+ * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]]
+ *
+ * Rule configuration set class
+ */
+class RuleConfigSet {
+
+    /**
+     * @param {ruleConfig[]} configs Valid rule configurations
+     */
+    constructor(configs) {
+
+        /**
+         * Stored valid rule configurations for this instance
+         * @type {Array}
+         */
+        this.ruleConfigs = configs || [];
+    }
+
+    /**
+     * Add a severity level to the front of all configs in the instance.
+     * This should only be called after all configs have been added to the instance.
+     * @returns {void}
+     */
+    addErrorSeverity() {
+        const severity = 2;
+
+        this.ruleConfigs = this.ruleConfigs.map(config => {
+            config.unshift(severity);
+            return config;
+        });
+
+        // Add a single config at the beginning consisting of only the severity
+        this.ruleConfigs.unshift(severity);
+    }
+
+    /**
+     * Add rule configs from an array of strings (schema enums)
+     * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"])
+     * @returns {void}
+     */
+    addEnums(enums) {
+        this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums));
+    }
+
+    /**
+     * Add rule configurations from a schema object
+     * @param {Object} obj Schema item with type === "object"
+     * @returns {boolean} true if at least one schema for the object could be generated, false otherwise
+     */
+    addObject(obj) {
+        const objectConfigSet = {
+            objectConfigs: [],
+            add(property, values) {
+                for (let idx = 0; idx < values.length; idx++) {
+                    const optionObj = {};
+
+                    optionObj[property] = values[idx];
+                    this.objectConfigs.push(optionObj);
+                }
+            },
+
+            combine() {
+                this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []);
+            }
+        };
+
+        /*
+         * The object schema could have multiple independent properties.
+         * If any contain enums or booleans, they can be added and then combined
+         */
+        Object.keys(obj.properties).forEach(prop => {
+            if (obj.properties[prop].enum) {
+                objectConfigSet.add(prop, obj.properties[prop].enum);
+            }
+            if (obj.properties[prop].type && obj.properties[prop].type === "boolean") {
+                objectConfigSet.add(prop, [true, false]);
+            }
+        });
+        objectConfigSet.combine();
+
+        if (objectConfigSet.objectConfigs.length > 0) {
+            this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs));
+            return true;
+        }
+
+        return false;
+    }
+}
+
+/**
+ * Generate valid rule configurations based on a schema object
+ * @param {Object} schema A rule's schema object
+ * @returns {Array[]} Valid rule configurations
+ */
+function generateConfigsFromSchema(schema) {
+    const configSet = new RuleConfigSet();
+
+    if (Array.isArray(schema)) {
+        for (const opt of schema) {
+            if (opt.enum) {
+                configSet.addEnums(opt.enum);
+            } else if (opt.type && opt.type === "object") {
+                if (!configSet.addObject(opt)) {
+                    break;
+                }
+
+            // TODO (IanVS): support oneOf
+            } else {
+
+                // If we don't know how to fill in this option, don't fill in any of the following options.
+                break;
+            }
+        }
+    }
+    configSet.addErrorSeverity();
+    return configSet.ruleConfigs;
+}
+
+/**
+ * Generate possible rule configurations for all of the core rules
+ * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not.
+ * @returns {rulesConfig} Hash of rule names and arrays of possible configurations
+ */
+function createCoreRuleConfigs(noDeprecated = false) {
+    return Array.from(builtInRules).reduce((accumulator, [id, rule]) => {
+        const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema;
+        const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated;
+
+        if (noDeprecated && isDeprecated) {
+            return accumulator;
+        }
+
+        accumulator[id] = generateConfigsFromSchema(schema);
+        return accumulator;
+    }, {});
+}
+
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = {
+    generateConfigsFromSchema,
+    createCoreRuleConfigs
+};
diff --git a/eslint/tools/fetch-docs-links.js b/eslint/tools/fetch-docs-links.js
new file mode 100644 (file)
index 0000000..3d92633
--- /dev/null
@@ -0,0 +1,112 @@
+/**
+ * @fileoverview Script to fetch link data.
+ *
+ * To fetch info about all files:
+ *
+ *      node tools/fetch-docs-links.js
+ *
+ * To fetch info for just selected files (for use with lint-staged):
+ *
+ *      node tools/fetch-docs-links.js docs/src/user-guide/index.md
+ *
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const matter = require("gray-matter");
+const metascraper = require("metascraper")([
+    require("metascraper-image")(),
+    require("metascraper-logo")(),
+    require("metascraper-logo-favicon")(),
+    require("metascraper-title")(),
+    require("metascraper-description")()
+]);
+const got = require("got");
+const path = require("path");
+const fs = require("fs").promises;
+const glob = require("fast-glob");
+
+//-----------------------------------------------------------------------------
+// Data
+//-----------------------------------------------------------------------------
+
+const BASE_DIR = path.resolve(__dirname, "../");
+const SRC_DIR = path.resolve(BASE_DIR, "docs/src");
+const DATA_DIR = path.resolve(SRC_DIR, "_data");
+const DATA_FILE_PATH = path.resolve(DATA_DIR, "further_reading_links.json");
+
+// determine which files to check
+let filenames = process.argv.slice(2);
+
+if (filenames.length === 0) {
+    filenames = glob.sync("docs/src/rules/*.md", { cwd: BASE_DIR });
+}
+
+filenames = filenames.map(filename => path.resolve(BASE_DIR, filename));
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+/**
+ * Fetches metadata information for a given URL.
+ * @param {string} url The URL to fetch data for.
+ * @returns {Promise<object>} An object with metadata info.
+ */
+async function fetchLinkMeta(url) {
+    const { body: html, url: returnedURL } = await got(url);
+    const metadata = await metascraper({ html, url: returnedURL });
+    const domain = (new URL(returnedURL)).hostname;
+
+    return {
+        domain,
+        url,
+        logo: metadata.logo,
+        title: metadata.title,
+        description: metadata.description
+    };
+}
+
+
+//-----------------------------------------------------------------------------
+// Main
+//-----------------------------------------------------------------------------
+
+(async () => {
+
+    // First read in the current data file
+    const links = JSON.parse(await fs.readFile(DATA_FILE_PATH, "utf8"));
+
+    // check each file
+    for (const filename of filenames) {
+
+        const text = await fs.readFile(filename, "utf8");
+        const frontmatter = matter(text).data;
+
+        if (frontmatter.further_reading) {
+
+            for (const url of frontmatter.further_reading) {
+                if (!links[url]) {
+                    try {
+                        links[url] = await fetchLinkMeta(url);
+                    } catch (ex) {
+                        console.error("Error in ", filename);
+                        console.error("Could not fetch data for", url);
+                        console.error(ex.message);
+                        console.error(ex.stack);
+                        process.exit(1); // eslint-disable-line n/no-process-exit -- used in tools
+                    }
+                }
+            }
+
+        }
+    }
+
+    // Last write new data into the current data file
+    await fs.writeFile(DATA_FILE_PATH, JSON.stringify(links, null, 4), "utf8");
+})();
index 2bfa2e21a4aee76f951e2392633d77aa18adfd75..7fd62f5c7acf1f2f4b7efbf9bc7e6690f7043bf2 100644 (file)
@@ -92,7 +92,7 @@ function checkMetaValidity(context, exportsNode) {
 module.exports = {
     meta: {
         docs: {
-            description: "enforce correct use of `meta` property in core rules",
+            description: "Enforce correct use of `meta` property in core rules",
             recommended: false
         },
         type: "problem",
index ce4449a6b6ae6e1141d4a7f118405a2a41357998..46cbafb0ffe4309da8e1dbd37fb5c1a56d60b218 100644 (file)
@@ -4,7 +4,7 @@
  */
 "use strict";
 
-/* eslint-env mocha -- Mocha */
+/* globals describe, it -- Mocha globals */
 
 //------------------------------------------------------------------------------
 // Requirements
@@ -24,7 +24,7 @@ module.exports = {
      * @param {Function} method A test logic.
      * @returns {any} The returned value with the test logic.
      */
-    describe: (typeof describe === "function") ? describe : /* istanbul ignore next */ function(text, method) {
+    describe: (typeof describe === "function") ? describe : /* c8 ignore next */ function(text, method) {
         return method.apply(this);
     },
 
@@ -34,7 +34,7 @@ module.exports = {
      * @param {Function} method A test logic.
      * @returns {any} The returned value with the test logic.
      */
-    it: (typeof it === "function") ? it : /* istanbul ignore next */ function(text, method) {
+    it: (typeof it === "function") ? it : /* c8 ignore next */ function(text, method) {
         return method.apply(this);
     },
 
index 4a71a8b09edddf317da923448f1706fe45c470b4..d69028448a1f2b156aeac6466f6fde8c1a920001 100644 (file)
@@ -90,6 +90,7 @@
     "no-confusing-arrow": "suggestion",
     "no-console": "suggestion",
     "no-const-assign": "problem",
+    "no-constant-binary-expression": "problem",
     "no-constant-condition": "problem",
     "no-constructor-return": "problem",
     "no-continue": "suggestion",
     "prefer-exponentiation-operator": "suggestion",
     "prefer-named-capture-group": "suggestion",
     "prefer-numeric-literals": "suggestion",
+    "prefer-object-has-own": "suggestion",
     "prefer-object-spread": "suggestion",
     "prefer-promise-reject-errors": "suggestion",
     "prefer-reflect": "suggestion",