diff --git a/.nycrc b/.c8rc similarity index 100% rename from .nycrc rename to .c8rc diff --git a/.eslintignore b/.eslintignore index b8414c9c832d..905f2a39ddf2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,7 @@ /build/** /coverage/** /docs/** +!/docs/.eleventy.js /jsdoc/** /templates/** /tests/bench/** diff --git a/.eslintrc.js b/.eslintrc.js index f97d93a1bf5e..f504850ad571 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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/.github/CODEOWNERS.md b/.github/CODEOWNERS.md deleted file mode 100644 index b032d30bb8e1..000000000000 --- a/.github/CODEOWNERS.md +++ /dev/null @@ -1,17 +0,0 @@ -# Config-related files - -lib/conf/config-schema.js @nzakas -lib/cli-engine/config-array/* @nzakas -lib/cli-engine/config-array-factory.js @nzakas -lib/cli-engine/cascading-config-array-factory.js @nzakas -lib/shared/config-* @nzakas -lib/shared/naming.js @nzakas -lib/shared/relative-module-resolver.js @nzakas - -tests/lib/conf/config-schema.js @nzakas -tests/lib/cli-engine/config-array/* @nzakas -tests/lib/cli-engine/config-array-factory.js @nzakas -tests/lib/cli-engine/cascading-config-array-factory.js @nzakas -tests/lib/shared/config-* @nzakas -tests/lib/shared/naming.js @nzakas -tests/lib/shared/relative-module-resolver.js @nzakas diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3af794af7fdf..000000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,53 +0,0 @@ - - -**Tell us about your environment** - - - -* **ESLint Version:** -* **Node Version:** -* **npm Version:** - -**What parser (default, `@babel/eslint-parser`, `@typescript-eslint/parser`, etc.) are you using?** - -**Please show your full configuration:** - -
-Configuration - - -```js - -``` - -
- -**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.** - - -```js - -``` - - -```bash - -``` - -**What did you expect to happen?** - -**What actually happened? Please include the actual, raw output from ESLint.** diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 8c477f442400..18c135356382 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -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: |
Configuration diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index af8c43451d46..f98389b25f29 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,3 +3,6 @@ contact_links: - name: 🗣 Ask a Question, Discuss url: https://github.com/eslint/eslint/discussions about: Get help using ESLint + - name: 📝 Help with VS Code ESLint + url: https://github.com/microsoft/vscode-eslint/issues/ + about: Bugs and feature requests for the VS Code ESLint plugin diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 593e8f784219..8c4bf8eb1b75 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ #### Prerequisites checklist diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..4c39a334be4f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d9aa9536c01..8ad5ab3a2382 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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,13 +25,21 @@ jobs: run: node Makefile checkRuleFiles - name: Check Licenses run: node Makefile checkLicenses + - name: Install Docs Packages + working-directory: docs + run: npm install + - name: Stylelint Docs + working-directory: docs + run: npm run lint:scss + - 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: [19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"] include: - os: windows-latest node: "16.x" @@ -36,8 +47,8 @@ jobs: 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 +62,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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ef362a4b64de..e2995e66d404 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 45740229477b..3d8fff0ad813 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v3 + - uses: actions/stale@v6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 60 diff --git a/.gitignore b/.gitignore index dbe2a2b59610..075a4d740c70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /node_modules +/docs/node_modules test.js coverage/ build/ @@ -10,7 +11,7 @@ tmp/ debug/ .idea jsdoc/ -versions.json +/versions.json *.iml .eslintcache .cache @@ -26,3 +27,7 @@ versions.json yarn.lock package-lock.json pnpm-lock.yaml + +# Docs site +_site +/docs/src/assets/css diff --git a/.markdownlint.yml b/.markdownlint.yml index a8478b2ae94b..79c1f0fbecf3 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -7,7 +7,6 @@ MD004: # Unordered list style 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 @@ -16,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/CHANGELOG.md b/CHANGELOG.md index ce5670c38ac4..1bd172a0afee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,374 @@ +v8.27.0 - November 6, 2022 + +* [`f14587c`](https://github.com/eslint/eslint/commit/f14587c42bb0fe6ec89529aede045a488083d6ee) feat: new `no-new-native-nonconstructor` rule (#16368) (Sosuke Suzuki) +* [`978799b`](https://github.com/eslint/eslint/commit/978799bd5c76fecf4ce8f17d89ad6c9f436c3228) feat: add new rule `no-empty-static-block` (#16325) (Sosuke Suzuki) +* [`ce93b42`](https://github.com/eslint/eslint/commit/ce93b429bf917640473dd7e26b49bba993c68ce4) docs: Stylelint property-no-unknown (#16497) (Nick Schonning) +* [`d2cecb4`](https://github.com/eslint/eslint/commit/d2cecb4ad2a6d33444cf0288a863c43acb3b468a) docs: Stylelint declaration-block-no-shorthand-property-overrides (#16498) (Nick Schonning) +* [`0a92805`](https://github.com/eslint/eslint/commit/0a92805d7713118866e519b0ff2a61c5d6238ad9) docs: stylelint color-hex-case (#16496) (Nick Schonning) +* [`c3ce521`](https://github.com/eslint/eslint/commit/c3ce5212f672d95dde3465d7d3c4bf99ff665f8b) fix: Ensure unmatched glob patterns throw an error (#16462) (Nicholas C. Zakas) +* [`74a5af4`](https://github.com/eslint/eslint/commit/74a5af487ac7296a46a8078e585f00df72b63d83) docs: fix stylelint error (#16491) (Milos Djermanovic) +* [`69216ee`](https://github.com/eslint/eslint/commit/69216ee69c7172e847b64e0e934b5121a34d0ea3) feat: no-empty suggest to add comment in empty BlockStatement (#16470) (Nitin Kumar) +* [`324db1a`](https://github.com/eslint/eslint/commit/324db1a11e43ba9d954dc522763faea19129ce6a) docs: explicit stylelint color related rules (#16465) (Nick Schonning) +* [`94dc4f1`](https://github.com/eslint/eslint/commit/94dc4f19ba49fe2358f8bcc2fc3555d222766755) docs: use Stylelint for HTML files (#16468) (Nick Schonning) +* [`cc6128d`](https://github.com/eslint/eslint/commit/cc6128db4f489c3ab80fff2f9dbeea313e72208d) docs: enable stylelint declaration-block-no-duplicate-properties (#16466) (Nick Schonning) +* [`d03a8bf`](https://github.com/eslint/eslint/commit/d03a8bf8978bd330aeb951f18cc92bf1ad24eeec) docs: Add heading to justification explanation (#16430) (Maritaria) +* [`886a038`](https://github.com/eslint/eslint/commit/886a0386897f96d2da95eba8c52bd893fcbf7e86) fix: handle files with unspecified path in `getRulesMetaForResults` (#16437) (Francesco Trotta) +* [`319f0a5`](https://github.com/eslint/eslint/commit/319f0a5491598825bbd528c6d1fc12771056a74c) feat: use `context.languageOptions.ecmaVersion` in core rules (#16458) (Milos Djermanovic) +* [`8a15968`](https://github.com/eslint/eslint/commit/8a159686f9d497262d573dd601855ce28362199b) docs: add Stylelint configuration and cleanup (#16379) (Nick Schonning) +* [`9b0a469`](https://github.com/eslint/eslint/commit/9b0a469d1e4650c1d9da26239357e715b11b2d97) docs: note commit messages don't support scope (#16435) (Andy Edwards) +* [`1581405`](https://github.com/eslint/eslint/commit/15814057fd69319b3744bdea5db2455f85d2e74f) docs: improve context.getScope() docs (#16417) (Ben Perlmutter) +* [`b797149`](https://github.com/eslint/eslint/commit/b7971496e9b44add405ca0360294f5c3be85b540) docs: update formatters template (#16454) (Milos Djermanovic) +* [`5ac4de9`](https://github.com/eslint/eslint/commit/5ac4de911f712cb3a5a16eb7a4063eee09dfc97c) docs: fix link to formatters on the Core Concepts page (#16455) (Vladislav) +* [`33313ef`](https://github.com/eslint/eslint/commit/33313ef56258a6a96b00a3e70025b94bd2f2fe9f) docs: core-concepts: fix link to semi rule (#16453) (coderaiser) + +v8.26.0 - October 21, 2022 + +* [`df77409`](https://github.com/eslint/eslint/commit/df7740967ffab2915974c7b310ac76ea2915ac2d) fix: use `baseConfig` constructor option in FlatESLint (#16432) (Milos Djermanovic) +* [`33668ee`](https://github.com/eslint/eslint/commit/33668ee9d22e1988ba03e07fb547738bdb21dc0e) fix: Ensure that glob patterns are matched correctly. (#16449) (Nicholas C. Zakas) +* [`651649b`](https://github.com/eslint/eslint/commit/651649b12797594a86c0d659d6a0d1cdbda6f57b) docs: Core concepts page (#16399) (Ben Perlmutter) +* [`4715787`](https://github.com/eslint/eslint/commit/4715787724a71494ba0bb0c5fe4639570bb6985b) feat: check `Object.create()` in getter-return (#16420) (Yuki Hirasawa) +* [`e917a9a`](https://github.com/eslint/eslint/commit/e917a9a2e555d398c64b985fc933d44a42c958f0) ci: add node v19 (#16443) (Koichi ITO) +* [`740b208`](https://github.com/eslint/eslint/commit/740b20826fadc5322ea5547c1ba41793944e571d) fix: ignore messages without a `ruleId` in `getRulesMetaForResults` (#16409) (Francesco Trotta) +* [`8f9759e`](https://github.com/eslint/eslint/commit/8f9759e2a94586357d85fac902e038fabdba79a7) fix: `--ignore-pattern` in flat config mode should be relative to `cwd` (#16425) (Milos Djermanovic) +* [`325ad37`](https://github.com/eslint/eslint/commit/325ad375a52d1c7b8b8fd23943350c91781366a2) fix: make `getRulesMetaForResults` return a plain object in trivial case (#16438) (Francesco Trotta) +* [`a2810bc`](https://github.com/eslint/eslint/commit/a2810bc485d9f1123a86b60702fcaa51e19d71a3) fix: Ensure that directories can be unignored. (#16436) (Nicholas C. Zakas) +* [`631cf72`](https://github.com/eslint/eslint/commit/631cf72e82f316a2cc08770e5c81b858637ab04a) docs: note --ignore-path not supported with flat config (#16434) (Andy Edwards) +* [`1692840`](https://github.com/eslint/eslint/commit/1692840a2f763737a4891419dc304db4ebedab5d) docs: fix syntax in examples for new config files (#16427) (Milos Djermanovic) +* [`28d1902`](https://github.com/eslint/eslint/commit/28d190264017dbaa29f2ab218f73b623143cd1af) feat: `no-implicit-globals` supports `exported` block comment (#16343) (Sosuke Suzuki) +* [`35916ad`](https://github.com/eslint/eslint/commit/35916ad9bfc07dab63361721df1bd7f21e43e094) fix: Ensure unignore and reignore work correctly in flat config. (#16422) (Nicholas C. Zakas) +* [`4b70b91`](https://github.com/eslint/eslint/commit/4b70b91a6e28669ab8e2a4ce2a6d9ed40be20fa7) chore: Add VS Code issues link (#16423) (Nicholas C. Zakas) +* [`e940be7`](https://github.com/eslint/eslint/commit/e940be7a83d0caea15b64c1e1c2785a6540e2641) feat: Use ESLINT_USE_FLAT_CONFIG environment variable for flat config (#16356) (Tomer Aberbach) +* [`d336cfc`](https://github.com/eslint/eslint/commit/d336cfc9145a72bf8730250ee1e331a135e6ee2c) docs: Document extending plugin with new config (#16394) (Ben Perlmutter) +* [`dd0c58f`](https://github.com/eslint/eslint/commit/dd0c58f0f34d24331ae55139af39cf2747125f5e) feat: Swap out Globby for custom globbing solution. (#16369) (Nicholas C. Zakas) +* [`232d291`](https://github.com/eslint/eslint/commit/232d2916ac5e44db55c2ffbd2f3b37ad70037b7b) chore: suppress a Node.js deprecation warning (#16398) (Koichi ITO) + +v8.25.0 - October 7, 2022 + +* [`1f78594`](https://github.com/eslint/eslint/commit/1f785944f61c97996445e48cb74fc300142e7310) chore: upgrade @eslint/eslintrc@1.3.3 (#16397) (Milos Djermanovic) +* [`173e820`](https://github.com/eslint/eslint/commit/173e82040895ad53b2d9940bfb3fb67a0478f00b) feat: Pass --max-warnings value to formatters (#16348) (Brandon Mills) +* [`8476a9b`](https://github.com/eslint/eslint/commit/8476a9b8b81164887cdf38a21d431b75ff2956b1) chore: Remove CODEOWNERS (#16375) (Nick Schonning) +* [`720ff75`](https://github.com/eslint/eslint/commit/720ff75beb9f4fdcf2a185fcb8020cf78483fdeb) chore: use "ci" for Dependabot commit message (#16377) (Nick Schonning) +* [`90c6028`](https://github.com/eslint/eslint/commit/90c602802b6e330b79c42f282e9a615c583e32d7) docs: Conflicting fixes (#16366) (Ben Perlmutter) +* [`5a3fe70`](https://github.com/eslint/eslint/commit/5a3fe70c5261acbf115fa5f47231cbc4ac62c1bc) docs: Add VS to integrations page (#16381) (Maria José Solano) +* [`6964cb1`](https://github.com/eslint/eslint/commit/6964cb1e0f073b236cb3288b9d8be495336bbf29) feat: remove support for ignore files in FlatESLint (#16355) (Milos Djermanovic) +* [`49bd1e5`](https://github.com/eslint/eslint/commit/49bd1e5669b34fd7e0f4a3cf42009866980d7e15) docs: remove unused link definitions (#16376) (Nick Schonning) +* [`42f5479`](https://github.com/eslint/eslint/commit/42f547948f284f1c67799f237dfeb86fc400c7c7) chore: bump actions/stale from 5 to 6 (#16350) (dependabot[bot]) +* [`3bd380d`](https://github.com/eslint/eslint/commit/3bd380d3ea7e88ade4905ec0b240c866ab79a69d) docs: typo cleanups for docs (#16374) (Nick Schonning) +* [`b3a0837`](https://github.com/eslint/eslint/commit/b3a08376cfb61275a7557d6d166b6116f36e5ac2) docs: remove duplicate words (#16378) (Nick Schonning) +* [`a682562`](https://github.com/eslint/eslint/commit/a682562458948f74a227be60a80e10e7a3753124) docs: add `BigInt` to `new-cap` docs (#16362) (Sosuke Suzuki) +* [`1cc4b3a`](https://github.com/eslint/eslint/commit/1cc4b3a8f82a7945dcd8c59550b6a906a0fabbb4) feat: `id-length` counts graphemes instead of code units (#16321) (Sosuke Suzuki) +* [`f6d57fb`](https://github.com/eslint/eslint/commit/f6d57fb657c2f4e8e0140ad057da34c935482972) docs: Update docs README (#16352) (Ben Perlmutter) +* [`e5e9e27`](https://github.com/eslint/eslint/commit/e5e9e271da58361bda16f7abc8f367ccc6f91510) chore: remove `jsdoc` dev dependency (#16344) (Milos Djermanovic) +* [`7214347`](https://github.com/eslint/eslint/commit/721434705bd569e33911e25d2688e33f10898d52) docs: fix logical-assignment-operators option typo (#16346) (Jonathan Wilsson) + +v8.24.0 - September 23, 2022 + +* [`131e646`](https://github.com/eslint/eslint/commit/131e646e227b9aca3937fe287343bf2c3df408af) chore: Upgrade @humanwhocodes/config-array for perf (#16339) (Nicholas C. Zakas) +* [`2c152ff`](https://github.com/eslint/eslint/commit/2c152ff0fb709b99e62c19ecd2c95689efacbe4c) docs: note false positive `Object.getOwnPropertyNames` in prefer-reflect (#16317) (AnnAngela) +* [`bf7bd88`](https://github.com/eslint/eslint/commit/bf7bd885a92046a6b6bcbcaaa1e78e9f2c4b482f) docs: fix warn severity description for new config files (#16324) (Nitin Kumar) +* [`504fe59`](https://github.com/eslint/eslint/commit/504fe59b0e0f4f5a2afb6a69aaed5cb4ca631012) perf: switch from object spread to `Object.assign` when merging globals (#16311) (Milos Djermanovic) +* [`1729f9e`](https://github.com/eslint/eslint/commit/1729f9ea4d7b2945b2b701d72027fd4aace954cf) feat: account for `sourceType: "commonjs"` in the strict rule (#16308) (Milos Djermanovic) +* [`b0d72c9`](https://github.com/eslint/eslint/commit/b0d72c96b2a9cde7a5798c2b08ec4e70683c6aca) feat: add rule logical-assignment-operators (#16102) (fnx) +* [`f02bcd9`](https://github.com/eslint/eslint/commit/f02bcd91bf89b6c167d5346a36677fdb854f0c05) feat: `array-callback-return` support `findLast` and `findLastIndex` (#16314) (Sosuke Suzuki) +* [`8cc0bbe`](https://github.com/eslint/eslint/commit/8cc0bbe440dc5e6af6ef02f00d0514a40ca07c24) docs: use more clean link syntax (#16309) (Percy Ma) +* [`6ba269e`](https://github.com/eslint/eslint/commit/6ba269ed673f965d081287b769c12beeb5f98887) docs: fix typo (#16288) (jjangga0214) + +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) diff --git a/Makefile.js b/Makefile.js index 10203f5ed4a2..64b524579433 100644 --- a/Makefile.js +++ b/Makefile.js @@ -12,7 +12,6 @@ const checker = require("npm-license"), ReleaseOps = require("eslint-release"), - dateformat = require("dateformat"), fs = require("fs"), glob = require("glob"), marked = require("marked"), @@ -23,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"); @@ -33,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 @@ -60,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 @@ -71,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 @@ -144,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); } @@ -155,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); @@ -181,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])) @@ -193,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, @@ -219,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); } /** @@ -235,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} */ @@ -254,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); } @@ -271,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}`); } /** @@ -318,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(); } @@ -482,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++; } @@ -502,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 }); @@ -547,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++; } @@ -583,48 +637,14 @@ target.test = function() { target.checkLicenses(); }; -target.gensite = function(prereleaseVersion) { - echo("Generating eslint.org"); +target.gensite = function() { + echo("Generating documentation"); - let docFiles = [ - "/rules/", - "/user-guide/", - "/maintainer-guide/", - "/developer-guide/", - "/about/" - ]; + const DOCS_RULES_DIR = path.join(DOCS_SRC_DIR, "rules"); + const RULE_VERSIONS_FILE = path.join(DOCS_SRC_DIR, "_data/rule_versions.json"); - // 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); - - if (filePath.indexOf(".md") >= 0 && test("-f", htmlFullPath)) { - rm("-rf", htmlFullPath); - } - } - }); - - // 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 = { @@ -633,149 +653,45 @@ target.gensite = function(prereleaseVersion) { }; } - const { Linter } = require("."); - const rules = new Linter().getRules(); + // 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); - 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)."; - - // 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, - "---", - "", - "", - 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; - - if (prereleaseVersion) { - outputDir += `/${prereleaseVersion}`; - if (!test("-d", outputDir)) { - mkdir(outputDir); - } - } - cp("-rf", `${TEMP_DIR}*`, outputDir); - // 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(); - } + JSON.stringify(versions, null, 4).to(RULE_VERSIONS_FILE); - // 12. Delete temporary directory - echo("> Removing the temporary directory (Step 12)"); - rm("-rf", TEMP_DIR); + // 2. Generate rules index page meta data + echo("> Generating the rules index page (Step 2)"); + generateRuleIndexPage(); - // 13. Create Example Formatter Output Page - echo("> Creating the formatter examples (Step 14)"); - generateFormatterExamples(getFormatterResults(), prereleaseVersion); + // 3. Create Example Formatter Output Page + echo("> Creating the formatter examples (Step 3)"); + generateFormatterExamples(getFormatterResults()); - 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}`); }; @@ -789,11 +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", "Related Rules", "Compatibility", "Further Reading"]; + 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. @@ -809,17 +725,10 @@ 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 - /* - * 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. - */ - - return idNewAtBeginningOfTitleRegExp.test(docText) || idOldAtEndOfTitleRegExp.test(docText); + return new RegExp(`title: ${id}`, "u").test(docText); } /** @@ -879,7 +788,7 @@ 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++; @@ -1014,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); } /** @@ -1086,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); diff --git a/README.md b/README.md index 1f98fa251987..309db3dc8499 100644 --- a/README.md +++ b/README.md @@ -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 ``` ## 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.
- -
-Toru Nagashima -
-

唯然
+
+ +
+Nitin Kumar +
### Committers @@ -261,6 +255,11 @@ Brett Zamir Bryan Mishkin + +
+Sara Soueidan +
+
Pig Fang @@ -275,11 +274,6 @@ Anix
YeonJuan
- - -
-Nitin Kumar -
@@ -292,9 +286,9 @@ The following companies, organizations, and individuals support ESLint's ongoing

Platinum Sponsors

Automattic

Gold Sponsors

-

Contra Nx (by Nrwl) Chrome's Web Framework & Tools Performance Fund Salesforce Airbnb Coinbase American Express Substack

Silver Sponsors

+

Salesforce Airbnb American Express

Silver Sponsors

Liftoff

Bronze Sponsors

-

launchdarkly Anagram Solver VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Practice Ignition

+

launchdarkly Nx (by Nrwl) Anagram Solver VPS Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Ignition HeroCoders

## Technology Sponsors diff --git a/bin/eslint.js b/bin/eslint.js index 6b05356b9dbf..7094ac77bc4b 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -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); diff --git a/conf/globals.js b/conf/globals.js index 076ffb2af942..6018b7af15c2 100644 --- a/conf/globals.js +++ b/conf/globals.js @@ -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/docs/.eleventy.js b/docs/.eleventy.js new file mode 100644 index 000000000000..b3e302646c29 --- /dev/null +++ b/docs/.eleventy.js @@ -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} 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 ` + + `.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 ` + `; + }); + + eleventyConfig.addShortcode("fixable", () => ` +
+ 🛠 Fixable +

+ if some problems reported by the rule are automatically fixable by the --fix command line option +

+
`); + + eleventyConfig.addShortcode("recommended", () => ` +
+ Recommended +

+ if the "extends": "eslint:recommended" property in a configuration file enables the rule. +

+
`); + + eleventyConfig.addShortcode("hasSuggestions", () => ` +
+ 💡 hasSuggestions +

+ if some problems reported by the rule are manually fixable by editor suggestions +

+
`); + + eleventyConfig.addShortcode("related_rules", arr => { + const rules = arr; + let items = ""; + + rules.forEach(rule => { + const listItem = ``; + + items += listItem; + }); + + return ` + `; + }); + + eleventyConfig.addShortcode("important", (text, url) => ` +
+ +
+ Important +
${text}
+ Learn more +
+
`); + + eleventyConfig.addShortcode("warning", (text, url) => ` +
+ +
+ Warning +
${text}
+ Learn more +
+
`); + + eleventyConfig.addShortcode("tip", (text, url) => ` +
+ +
+ Tip +
${text}
+ Learn more +
+
`); + + + 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" + } + }; +}; diff --git a/docs/.stylelintrc.json b/docs/.stylelintrc.json new file mode 100644 index 000000000000..98c118e79c1f --- /dev/null +++ b/docs/.stylelintrc.json @@ -0,0 +1,35 @@ +{ + "extends": ["stylelint-config-standard-scss"], + "rules": { + "alpha-value-notation": "number", + "at-rule-empty-line-before": null, + "color-function-notation": "legacy", + "custom-property-empty-line-before": null, + "custom-property-pattern": null, + "declaration-block-no-duplicate-properties": [true, { + "ignore": ["consecutive-duplicates-with-different-values"] + }], + "declaration-block-no-redundant-longhand-properties": null, + "hue-degree-notation": "number", + "indentation": 4, + "max-line-length": null, + "no-descending-specificity": null, + "no-duplicate-selectors": null, + "number-leading-zero": null, + "number-no-trailing-zeros": null, + "property-no-vendor-prefix": null, + "selector-class-pattern": null, + "value-keyword-case": null + }, + "overrides": [ + { + "files": [ + "**/*.html" + ], + "extends": ["stylelint-config-html/html", "stylelint-config-standard"] + } + ], + "ignoreFiles": [ + "_site/**" + ] + } diff --git a/docs/README.md b/docs/README.md index 8f5223a74d82..140608aa2d22 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,17 +1,41 @@ -# Documentation +# ESLint Documentation -Welcome to our documentation pages! What would you like to view? +## Install Dependencies -## [User Guide](user-guide) +Install the necessary dependencies for the documentation site by running this +from the `docs` folder: -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. +```shell +npm install +``` -## [Developer Guide](developer-guide) +## Run Locally -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. +Run this from the `docs` folder: -## [Maintainer Guide](maintainer-guide) +```shell +npm start +``` -Intended for maintainers of ESLint. +Once the script finishes building the documentation site, you can visit it at +. + +## Scripts + +To update the links data file, run this from the root folder (not the `docs` folder): + +```shell +npm run docs:update-links +``` + +To lint JS files, run this from the root folder (not the `docs` folder): + +```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/docs/developer-guide/architecture/dependency.svg b/docs/developer-guide/architecture/dependency.svg deleted file mode 100644 index 3b0c74c9b924..000000000000 --- a/docs/developer-guide/architecture/dependency.svg +++ /dev/null @@ -1,52 +0,0 @@ -binlibeslint.jscli.jsapi.jsinitcli-enginelintersource-coderule-testerrules \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/README.md b/docs/developer-guide/code-path-analysis/README.md deleted file mode 100644 index 2b6fd7486f68..000000000000 --- a/docs/developer-guide/code-path-analysis/README.md +++ /dev/null @@ -1 +0,0 @@ -[Code Path Analysis Details](../code-path-analysis.md) diff --git a/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg b/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg deleted file mode 100644 index 4a3d5289dc80..000000000000 --- a/docs/developer-guide/code-path-analysis/example-dowhilestatement.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -DoWhileStatement - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -ExpressionStatement -CallExpression -Identifier (bar) -Identifier (a) - - -s1_1->s1_2 - - - - -s1_2->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -DoWhileStatement:exit -Program:exit - - -s1_2->s1_3 - - - - -s1_3->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-forinstatement.svg b/docs/developer-guide/code-path-analysis/example-forinstatement.svg deleted file mode 100644 index 00da11ecd4c8..000000000000 --- a/docs/developer-guide/code-path-analysis/example-forinstatement.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForInStatement - - -initial->s1_1 - - - - -final - - - - -s1_3 - - - - - - - - - - - - - -Identifier (obj) - - -s1_1->s1_3 - - - - -s1_2 - - - - - - - - - - - - - -VariableDeclaration -VariableDeclarator -Identifier (key) - - -s1_3->s1_2 - - - - -s1_5 - - - - - - - - - - - - - -ForInStatement:exit -Program:exit - - -s1_3->s1_5 - - - - -s1_4 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -Identifier (key) - - -s1_2->s1_4 - - - - -s1_4->s1_2 - - - - -s1_4->s1_5 - - - - -s1_5->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg b/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg deleted file mode 100644 index b4bdb2337e71..000000000000 --- a/docs/developer-guide/code-path-analysis/example-forstatement-for-ever.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -s1_1->s1_2 - - - - -s1_2->s1_2 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-forstatement.svg b/docs/developer-guide/code-path-analysis/example-forstatement.svg deleted file mode 100644 index 376d91b44678..000000000000 --- a/docs/developer-guide/code-path-analysis/example-forstatement.svg +++ /dev/null @@ -1,201 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -IfStatement -Identifier (b) - - -s1_2->s1_3 - - - - -s1_8 - - - - - - - - - - - - - -ForStatement:exit -Program:exit - - -s1_2->s1_8 - - - - -s1_5 - - - - - - - - - - - - - -BlockStatement -BreakStatement - - -s1_3->s1_5 - - - - -s1_7 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_3->s1_7 - - - - -s1_5->s1_8 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_7->s1_4 - - - - -s1_4->s1_2 - - - - -s1_8->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-hello-world.svg b/docs/developer-guide/code-path-analysis/example-hello-world.svg deleted file mode 100644 index 26c40387cd1c..000000000000 --- a/docs/developer-guide/code-path-analysis/example-hello-world.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ExpressionStatement -CallExpression -MemberExpression -Identifier (console) -Identifier (log) -Literal (Hello world!) - - -initial->s1_1 - - - - -final - - - - -s1_1->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg b/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg deleted file mode 100644 index 88c2b6e43d08..000000000000 --- a/docs/developer-guide/code-path-analysis/example-ifstatement-chain.svg +++ /dev/null @@ -1,203 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -IfStatement -Identifier (a) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -IfStatement -Identifier (b) - - -s1_1->s1_3 - - - - -s1_9 - - - - - - - - - - - - - -IfStatement:exit -Program:exit - - -s1_2->s1_9 - - - - -s1_9->final - - - - -s1_4 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_3->s1_4 - - - - -s1_5 - - - - - - - - - - - - - -IfStatement -Identifier (c) - - -s1_3->s1_5 - - - - -s1_4->s1_9 - - - - -s1_5->s1_9 - - - - -s1_6 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (hoge) - - -s1_5->s1_6 - - - - -s1_6->s1_9 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-ifstatement.svg b/docs/developer-guide/code-path-analysis/example-ifstatement.svg deleted file mode 100644 index 7ea670afff77..000000000000 --- a/docs/developer-guide/code-path-analysis/example-ifstatement.svg +++ /dev/null @@ -1,122 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -IfStatement -Identifier (a) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_1->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -IfStatement:exit -Program:exit - - -s1_2->s1_4 - - - - -s1_4->final - - - - -s1_3->s1_4 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg b/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg deleted file mode 100644 index 26c45fa79abd..000000000000 --- a/docs/developer-guide/code-path-analysis/example-switchstatement-has-default.svg +++ /dev/null @@ -1,279 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -SwitchStatement -Identifier (a) -SwitchCase -Literal (0) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (foo) -BreakStatement - - -s1_1->s1_2 - - - - -s1_4 - - - - - - - - - - - - - -SwitchCase -Literal (1) - - -s1_1->s1_4 - - - - -s1_14 - - - - - - - - - - - - - -SwitchStatement:exit -Program:exit - - -s1_2->s1_14 - - - - -s1_7 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_9 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (hoge) -BreakStatement - - -s1_7->s1_9 - - - - -s1_9->s1_14 - - - - -s1_12 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (fuga) -BreakStatement - - -s1_12->s1_14 - - - - -s1_14->final - - - - -s1_4->s1_7 - - - - -s1_6 - - - - - - - - - - - - - -SwitchCase -Literal (2) - - -s1_4->s1_6 - - - - -s1_6->s1_7 - - - - -s1_8 - - - - - - - - - - - - - -SwitchCase -Literal (3) - - -s1_6->s1_8 - - - - -s1_8->s1_9 - - - - -s1_11 - - - - - - - - - - - - - -SwitchCase - - -s1_8->s1_11 - - - - -s1_11->s1_12 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-switchstatement.svg b/docs/developer-guide/code-path-analysis/example-switchstatement.svg deleted file mode 100644 index 778017efdbc0..000000000000 --- a/docs/developer-guide/code-path-analysis/example-switchstatement.svg +++ /dev/null @@ -1,232 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -SwitchStatement -Identifier (a) -SwitchCase -Literal (0) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (foo) -BreakStatement - - -s1_1->s1_2 - - - - -s1_4 - - - - - - - - - - - - - -SwitchCase -Literal (1) - - -s1_1->s1_4 - - - - -s1_11 - - - - - - - - - - - - - -SwitchStatement:exit -Program:exit - - -s1_2->s1_11 - - - - -s1_7 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_9 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (hoge) -BreakStatement - - -s1_7->s1_9 - - - - -s1_9->s1_11 - - - - -s1_11->final - - - - -s1_4->s1_7 - - - - -s1_6 - - - - - - - - - - - - - -SwitchCase -Literal (2) - - -s1_4->s1_6 - - - - -s1_6->s1_7 - - - - -s1_8 - - - - - - - - - - - - - -SwitchCase -Literal (3) - - -s1_6->s1_8 - - - - -s1_8->s1_9 - - - - -s1_8->s1_11 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg b/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg deleted file mode 100644 index fbc008302943..000000000000 --- a/docs/developer-guide/code-path-analysis/example-trystatement-try-catch-finally.svg +++ /dev/null @@ -1,137 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -TryStatement -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -CatchClause -Identifier (err) -BlockStatement -ExpressionStatement -CallExpression -Identifier (hoge) -Identifier (err) - - -s1_1->s1_3 - - - - -s1_2->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (fuga) -ExpressionStatement -CallExpression -Identifier (last) - - -s1_2->s1_4 - - - - -s1_3->s1_4 - - - - -s1_4->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg b/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg deleted file mode 100644 index c6f1879f03e2..000000000000 --- a/docs/developer-guide/code-path-analysis/example-trystatement-try-catch.svg +++ /dev/null @@ -1,186 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -TryStatement -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -IfStatement -Identifier (a) - - -s1_1->s1_2 - - - - -s1_6 - - - - - - - - - - - - - -CatchClause -Identifier (err) -BlockStatement -ExpressionStatement -CallExpression -Identifier (hoge) -Identifier (err) - - -s1_1->s1_6 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ThrowStatement -NewExpression -Identifier (Error) - - -s1_2->s1_3 - - - - -s1_5 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_2->s1_5 - - - - -s1_3->s1_6 - - - - -s1_5->s1_6 - - - - -s1_7 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (last) - - -s1_5->s1_7 - - - - -s1_6->s1_7 - - - - -s1_7->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg b/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg deleted file mode 100644 index 8b1fb92117fb..000000000000 --- a/docs/developer-guide/code-path-analysis/example-trystatement-try-finally.svg +++ /dev/null @@ -1,139 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -TryStatement -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - - -initial->s1_1 - - - - -final - - - - -thrown - - - - -s1_2 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_1->s1_2 - - - - -s1_4 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (fuga) - - -s1_1->s1_4 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (fuga) -ExpressionStatement -CallExpression -Identifier (last) - - -s1_2->s1_3 - - - - -s1_2->s1_4 - - - - -s1_3->final - - - - -s1_4->thrown - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg b/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg deleted file mode 100644 index a91270022f39..000000000000 --- a/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-f.svg +++ /dev/null @@ -1,99 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s2_1 - - - - - - - - - - - - - -FunctionDeclaration -Identifier (foo) -Identifier (a) -BlockStatement -IfStatement -Identifier (a) - - -initial->s2_1 - - - - -final - - - - -s2_2 - - - - - - - - - - - - - -BlockStatement -ReturnStatement - - -s2_1->s2_2 - - - - -s2_4 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s2_1->s2_4 - - - - -s2_2->final - - - - -s2_4->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg b/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg deleted file mode 100644 index 7bde3ea8da5e..000000000000 --- a/docs/developer-guide/code-path-analysis/example-when-there-is-a-function-g.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -FunctionDeclaration -ExpressionStatement -CallExpression -Identifier (foo) -Literal (false) - - -initial->s1_1 - - - - -final - - - - -s1_1->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/example-whilestatement.svg b/docs/developer-guide/code-path-analysis/example-whilestatement.svg deleted file mode 100644 index d833dc08a6d8..000000000000 --- a/docs/developer-guide/code-path-analysis/example-whilestatement.svg +++ /dev/null @@ -1,172 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -WhileStatement - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -Identifier (a) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -IfStatement -Identifier (b) - - -s1_2->s1_3 - - - - -s1_7 - - - - - - - - - - - - - -WhileStatement:exit -Program:exit - - -s1_2->s1_7 - - - - -s1_4 - - - - - - - - - - - - - -BlockStatement -ContinueStatement - - -s1_3->s1_4 - - - - -s1_6 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_3->s1_6 - - - - -s1_4->s1_2 - - - - -s1_7->final - - - - -s1_6->s1_2 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/helo.svg b/docs/developer-guide/code-path-analysis/helo.svg deleted file mode 100644 index e2dd9f2228b3..000000000000 --- a/docs/developer-guide/code-path-analysis/helo.svg +++ /dev/null @@ -1,113 +0,0 @@ - - - -Code Path 1 -initial - - -s1_1 - - - - - - - - - - - - - -Program -IfStatement -LogicalExpression -Identifier (a) - -initial->s1_1 - - - -final - - - -s1_2 - - - - - - - - - - - - - -Identifier (b) - -s1_1->s1_2 - - - -s1_4 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - -s1_1->s1_4 - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) - -s1_2->s1_3 - - - -s1_2->s1_4 - - - -s1_3->s1_4 - - - -s1_4->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg b/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg deleted file mode 100644 index 497554025ca9..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-for-1.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_2->s1_4 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg b/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg deleted file mode 100644 index d35bddfe18fb..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-for-2.svg +++ /dev/null @@ -1,110 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -Identifier (i) - - -s1_2->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_2->s1_4 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg b/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg deleted file mode 100644 index a1af0e6d7eb5..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-for-3.svg +++ /dev/null @@ -1,115 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -Identifier (i) - - -s1_2->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_3->s1_4 - - - - -s1_4->s1_2 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg b/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg deleted file mode 100644 index a4ee87ec5431..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-for-4.svg +++ /dev/null @@ -1,115 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -Identifier (i) - - -s1_2->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_3->s1_4 - - - - -s1_4->s1_2 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg b/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg deleted file mode 100644 index cba3a010b5e3..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-for-5.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -ForStatement -VariableDeclaration -VariableDeclarator -Identifier (i) -Literal (0) - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -BinaryExpression -Identifier (i) -Literal (10) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -CallExpression -Identifier (foo) -Identifier (i) - - -s1_2->s1_3 - - - - -s1_5 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_2->s1_5 - - - - -s1_4 - - - - - - - - - - - - - -UpdateExpression -Identifier (i) - - -s1_3->s1_4 - - - - -s1_4->s1_2 - - - - -s1_5->final - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg b/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg deleted file mode 100644 index 8036529e7cbc..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-while-1.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -WhileStatement - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -Identifier (a) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -AssignmentExpression -Identifier (a) -CallExpression -Identifier (foo) - - -s1_2->s1_3 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg b/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg deleted file mode 100644 index 63355dd815da..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-while-2.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -WhileStatement - - -initial->s1_1 - - - - -s1_2 - - - - - - - - - - - - - -Identifier (a) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -AssignmentExpression -Identifier (a) -CallExpression -Identifier (foo) - - -s1_2->s1_3 - - - - -s1_3->s1_2 - - - - - \ No newline at end of file diff --git a/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg b/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg deleted file mode 100644 index cb21c43828bd..000000000000 --- a/docs/developer-guide/code-path-analysis/loop-event-example-while-3.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - -_anonymous_0 - -initial - - - -s1_1 - - - - - - - - - - - - - -Program -WhileStatement - - -initial->s1_1 - - - - -final - - - - -s1_2 - - - - - - - - - - - - - -Identifier (a) - - -s1_1->s1_2 - - - - -s1_3 - - - - - - - - - - - - - -BlockStatement -ExpressionStatement -AssignmentExpression -Identifier (a) -CallExpression -Identifier (foo) - - -s1_2->s1_3 - - - - -s1_4 - - - - - - - - - - - - - -ExpressionStatement -CallExpression -Identifier (bar) - - -s1_2->s1_4 - - - - -s1_3->s1_2 - - - - -s1_4->final - - - - - \ No newline at end of file diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 000000000000..910a2b5248f2 --- /dev/null +++ b/docs/package.json @@ -0,0 +1,55 @@ +{ + "name": "docs-eslint", + "private": true, + "version": "8.27.0", + "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", + "lint:scss": "stylelint \"**/*.{scss,html}\"", + "lint:fix:scss": "npm run lint:scss -- --fix" + }, + "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", + "postcss-html": "^1.5.0", + "rimraf": "^3.0.2", + "sass": "^1.52.1", + "stylelint": "^14.13.0", + "stylelint-config-html": "^1.1.0", + "stylelint-config-standard": "^29.0.0", + "stylelint-config-standard-scss": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/docs/rules/id-blacklist.md b/docs/rules/id-blacklist.md deleted file mode 100644 index 87a7d9503bbd..000000000000 --- a/docs/rules/id-blacklist.md +++ /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/docs/rules/no-control-regex.md b/docs/rules/no-control-regex.md deleted file mode 100644 index 01a55fbe2d7f..000000000000 --- a/docs/rules/no-control-regex.md +++ /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/docs/src/_data/config.json b/docs/src/_data/config.json new file mode 100644 index 000000000000..4acb48202474 --- /dev/null +++ b/docs/src/_data/config.json @@ -0,0 +1,4 @@ +{ + "lang": "en", + "version": "7.26.0" +} diff --git a/docs/src/_data/eslintVersion.js b/docs/src/_data/eslintVersion.js new file mode 100644 index 000000000000..24964276c0d3 --- /dev/null +++ b/docs/src/_data/eslintVersion.js @@ -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/docs/src/_data/further_reading_links.json b/docs/src/_data/further_reading_links.json new file mode 100644 index 000000000000..120dd37032fd --- /dev/null +++ b/docs/src/_data/further_reading_links.json @@ -0,0 +1,723 @@ +{ + "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'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." + }, + "https://github.com/tc39/proposal-class-static-block": { + "domain": "github.com", + "url": "https://github.com/tc39/proposal-class-static-block", + "logo": "https://github.com/fluidicon.png", + "title": "GitHub - tc39/proposal-class-static-block: ECMAScript class static initialization blocks", + "description": "ECMAScript class static initialization blocks. Contribute to tc39/proposal-class-static-block development by creating an account on GitHub." + }, + "https://tc39.es/ecma262/#sec-symbol-constructor": { + "domain": "tc39.es", + "url": "https://tc39.es/ecma262/#sec-symbol-constructor", + "logo": "https://tc39.es/ecma262/img/favicon.ico", + "title": "ECMAScript® 2023 Language Specification", + "description": null + }, + "https://tc39.es/ecma262/#sec-bigint-constructor": { + "domain": "tc39.es", + "url": "https://tc39.es/ecma262/#sec-bigint-constructor", + "logo": "https://tc39.es/ecma262/img/favicon.ico", + "title": "ECMAScript® 2023 Language Specification", + "description": null + } +} \ No newline at end of file diff --git a/docs/src/_data/helpers.js b/docs/src/_data/helpers.js new file mode 100644 index 000000000000..a7c4ef6fab7d --- /dev/null +++ b/docs/src/_data/helpers.js @@ -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/docs/src/_data/languages.json b/docs/src/_data/languages.json new file mode 100644 index 000000000000..7defcb63eb1a --- /dev/null +++ b/docs/src/_data/languages.json @@ -0,0 +1,27 @@ +{ + "items": [{ + "flag": "🇺🇸", + "code": "en", + "name": "English (US)", + "url": "https://eslint.org" + }, + { + "flag": "🇯🇵", + "code": "ja", + "name": "Japanese - 日本語", + "url": "https://ja.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/docs/src/_data/layout.js b/docs/src/_data/layout.js new file mode 100644 index 000000000000..2665a708914e --- /dev/null +++ b/docs/src/_data/layout.js @@ -0,0 +1 @@ +module.exports = "doc.html"; diff --git a/docs/src/_data/links.json b/docs/src/_data/links.json new file mode 100644 index 000000000000..d9b297332167 --- /dev/null +++ b/docs/src/_data/links.json @@ -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/docs/src/_data/navigation.json b/docs/src/_data/navigation.json new file mode 100644 index 000000000000..bc831667e91a --- /dev/null +++ b/docs/src/_data/navigation.json @@ -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/docs/src/_data/rule_versions.json b/docs/src/_data/rule_versions.json new file mode 100644 index 000000000000..3e0b0ad761d7 --- /dev/null +++ b/docs/src/_data/rule_versions.json @@ -0,0 +1,332 @@ +{ + "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", + "logical-assignment-operators": "8.24.0", + "no-empty-static-block": "8.27.0", + "no-new-native-nonconstructor": "8.27.0" + }, + "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/docs/src/_data/rules.json b/docs/src/_data/rules.json new file mode 100644 index 000000000000..87a6e2168ca8 --- /dev/null +++ b/docs/src/_data/rules.json @@ -0,0 +1,2126 @@ +{ + "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-native-nonconstructor", + "description": "Disallow `new` operators with global non-constructor functions", + "recommended": false, + "fixable": false, + "hasSuggestions": false + }, + { + "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": "logical-assignment-operators", + "description": "Require or disallow logical assignment logical operator shorthand", + "recommended": false, + "fixable": true, + "hasSuggestions": true + }, + { + "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": true + }, + { + "name": "no-empty-function", + "description": "Disallow empty functions", + "recommended": false, + "fixable": false, + "hasSuggestions": false + }, + { + "name": "no-empty-static-block", + "description": "Disallow empty static blocks", + "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 deprecation policy, 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 deprecation policy 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/docs/src/_data/rules_meta.json b/docs/src/_data/rules_meta.json new file mode 100644 index 000000000000..cf4cd4ce046e --- /dev/null +++ b/docs/src/_data/rules_meta.json @@ -0,0 +1,2514 @@ +{ + "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" + }, + "logical-assignment-operators": { + "type": "suggestion", + "docs": { + "description": "Require or disallow logical assignment logical operator shorthand", + "recommended": false, + "url": "https://eslint.org/docs/rules/logical-assignment-operators" + }, + "fixable": "code", + "hasSuggestions": true + }, + "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": { + "hasSuggestions": true, + "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-empty-static-block": { + "type": "suggestion", + "docs": { + "description": "Disallow empty static blocks", + "recommended": false, + "url": "https://eslint.org/docs/rules/no-empty-static-block" + } + }, + "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-native-nonconstructor": { + "type": "problem", + "docs": { + "description": "Disallow `new` operators with global non-constructor functions", + "recommended": false, + "url": "https://eslint.org/docs/rules/no-new-native-nonconstructor" + } + }, + "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/docs/src/_data/site.js b/docs/src/_data/site.js new file mode 100644 index 000000000000..d0792694f48a --- /dev/null +++ b/docs/src/_data/site.js @@ -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/docs/src/_data/sites/en.yml b/docs/src/_data/sites/en.yml new file mode 100644 index 000000000000..43e112fe1b02 --- /dev/null +++ b/docs/src/_data/sites/en.yml @@ -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: > + © OpenJS Foundation and ESLint contributors, www.openjsf.org + 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/docs/src/_data/versions.json b/docs/src/_data/versions.json new file mode 100644 index 000000000000..6e585d6ad5a4 --- /dev/null +++ b/docs/src/_data/versions.json @@ -0,0 +1,4 @@ +{ + "items": [ + ] +} diff --git a/docs/src/_includes/components/_component.njk b/docs/src/_includes/components/_component.njk new file mode 100644 index 000000000000..f36f898aaf0c --- /dev/null +++ b/docs/src/_includes/components/_component.njk @@ -0,0 +1,3 @@ +{% macro component(name, params) %} + {% include './' + name + '.macro.html' ignore missing %} +{% endmacro %} diff --git a/docs/src/_includes/components/alert.macro.html b/docs/src/_includes/components/alert.macro.html new file mode 100644 index 000000000000..91e3a94a8b8b --- /dev/null +++ b/docs/src/_includes/components/alert.macro.html @@ -0,0 +1,38 @@ +{%- macro warning(params) -%} + +{%- endmacro -%} + +{%- macro important(params) -%} + +{%- endmacro -%} + +{%- macro tip(params) -%} + +{%- endmacro -%} diff --git a/docs/src/_includes/components/button.macro.html b/docs/src/_includes/components/button.macro.html new file mode 100644 index 000000000000..1881d957a26a --- /dev/null +++ b/docs/src/_includes/components/button.macro.html @@ -0,0 +1,26 @@ +{%- macro button(behavior="link", params) -%} + {%- if params.behavior == "action" -%} + + {%- else -%} + + {%- if params.text -%} + {{ params.text }} + {%- else -%} + This is a link styled like a button + {%- endif -%} + + {%- endif -%} +{%- endmacro -%} diff --git a/docs/src/_includes/components/code-tabs.html b/docs/src/_includes/components/code-tabs.html new file mode 100644 index 000000000000..8f1524b7df74 --- /dev/null +++ b/docs/src/_includes/components/code-tabs.html @@ -0,0 +1,21 @@ +
+ +
+

npm

+ +```shell + npm install --save-dev +``` + +
+
+

yarn

+ +```shell +yarn install +``` +
+
diff --git a/docs/src/_includes/components/docs-index.html b/docs/src/_includes/components/docs-index.html new file mode 100644 index 000000000000..0cdbe7403d0d --- /dev/null +++ b/docs/src/_includes/components/docs-index.html @@ -0,0 +1,29 @@ +{% set navPages = collections.docs | eleventyNavigation %} +{% macro renderNavListItem(entry) -%} +
  • + {{ entry.title }} + {%- if entry.children.length -%} +
      + {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%} +
    + {%- endif -%} +
  • +{%- endmacro %} + + diff --git a/docs/src/_includes/components/docs-toc.html b/docs/src/_includes/components/docs-toc.html new file mode 100644 index 000000000000..c4f4a4a80a9b --- /dev/null +++ b/docs/src/_includes/components/docs-toc.html @@ -0,0 +1,8 @@ + diff --git a/docs/src/_includes/components/hero.macro.html b/docs/src/_includes/components/hero.macro.html new file mode 100644 index 000000000000..3ff0c9c6f80f --- /dev/null +++ b/docs/src/_includes/components/hero.macro.html @@ -0,0 +1,29 @@ +{%- macro hero(params) -%} +
    +
    +
    + {%- if params.post -%} + + {%- endif -%} +

    {{ params.title }}

    +

    + {{ params.supporting_text | safe }} +

    + {% if params.buttons %} +
    + {% if params.buttons.primary %} + {{ params.buttons.primary.primaryText }} + {% endif %} + {% if params.buttons.secondary %} + {{ params.buttons.secondary.secondaryText }} + {% endif %} +
    + + {% endif %} +
    +
    + {% include "partials/carbon-ad.html" %} +
    +
    +
    +{%- endmacro -%} diff --git a/docs/src/_includes/components/language-switcher.html b/docs/src/_includes/components/language-switcher.html new file mode 100644 index 000000000000..aef1c2aa9569 --- /dev/null +++ b/docs/src/_includes/components/language-switcher.html @@ -0,0 +1,24 @@ +
    + {{ site.footer.language_switcher.change_language }} + +
    diff --git a/docs/src/_includes/components/logo.html b/docs/src/_includes/components/logo.html new file mode 100644 index 000000000000..5e422b6fa3ce --- /dev/null +++ b/docs/src/_includes/components/logo.html @@ -0,0 +1,21 @@ + diff --git a/docs/src/_includes/components/nav-search.html b/docs/src/_includes/components/nav-search.html new file mode 100644 index 000000000000..531e81979572 --- /dev/null +++ b/docs/src/_includes/components/nav-search.html @@ -0,0 +1,11 @@ + diff --git a/docs/src/_includes/components/nav-version-switcher.html b/docs/src/_includes/components/nav-version-switcher.html new file mode 100644 index 000000000000..f4e0f5fe025d --- /dev/null +++ b/docs/src/_includes/components/nav-version-switcher.html @@ -0,0 +1,25 @@ + +
    + Versions + + +
    diff --git a/docs/src/_includes/components/navigation.html b/docs/src/_includes/components/navigation.html new file mode 100644 index 000000000000..56cd65fc5406 --- /dev/null +++ b/docs/src/_includes/components/navigation.html @@ -0,0 +1,26 @@ + diff --git a/docs/src/_includes/components/related-rules.macro.html b/docs/src/_includes/components/related-rules.macro.html new file mode 100644 index 000000000000..913872aae7ea --- /dev/null +++ b/docs/src/_includes/components/related-rules.macro.html @@ -0,0 +1,14 @@ +{%- macro related_rules(params) -%} + +{%- endmacro -%} diff --git a/docs/src/_includes/components/rule-categories.macro.html b/docs/src/_includes/components/rule-categories.macro.html new file mode 100644 index 000000000000..d8531c2b5798 --- /dev/null +++ b/docs/src/_includes/components/rule-categories.macro.html @@ -0,0 +1,56 @@ + +{%- macro ruleCategories(params) -%} +
    + {%- if params.recommended == true -%} +
    + Recommended +

    + The "extends": "eslint:recommended" property in a configuration file enables this rule +

    +
    + {%- endif -%} + {%- if params.fixable -%} +
    + 🛠 Fixable +

    + Some problems reported by this rule are automatically fixable by the --fix command line option +

    +
    + {%- endif -%} + {%- if params.hasSuggestions == true -%} +
    + 💡 hasSuggestions +

    + Some problems reported by this rule are manually fixable by editor suggestions +

    +
    + {%- endif -%} +
    +{%- endmacro -%} + +{%- macro recommended() -%} +
    + Recommended +

    + if the "extends": "eslint:recommended" property in a configuration file enables the rule. +

    +
    +{%- endmacro -%} + +{%- macro fixable() -%} +
    + 🛠 Fixable +

    + if some problems reported by the rule are automatically fixable by the --fix command line option +

    +
    +{%- endmacro -%} + +{%- macro hasSuggestions() -%} +
    + 💡 hasSuggestions +

    + if some problems reported by the rule are manually fixable by editor suggestions +

    +
    +{%- endmacro -%} diff --git a/docs/src/_includes/components/rule-list.macro.html b/docs/src/_includes/components/rule-list.macro.html new file mode 100644 index 000000000000..670a0a70be89 --- /dev/null +++ b/docs/src/_includes/components/rule-list.macro.html @@ -0,0 +1,3 @@ +{%- macro ruleList(params) -%} + {% for rule in params.rules %}{{ rule }}{% endfor %} +{%- endmacro -%} diff --git a/docs/src/_includes/components/rule.macro.html b/docs/src/_includes/components/rule.macro.html new file mode 100644 index 000000000000..ec8722e976b7 --- /dev/null +++ b/docs/src/_includes/components/rule.macro.html @@ -0,0 +1,47 @@ +{% from 'components/rule-list.macro.html' import ruleList %} + +{%- macro rule(params) -%} +
    +
    + {%- if params.deprecated == true -%} +

    + {{ params.name }} + deprecated +

    + {%- if params.replacedBy|length -%} +

    Replaced by {{ ruleList({ rules: params.replacedBy }) }}

    + {%- else -%}

    {{ params.description }}

    + {%- endif -%} + {%- elseif params.removed == true -%} +

    + {{ params.name }} + removed +

    + {%- if params.replacedBy -%} +

    Replaced by {{ ruleList({ rules: params.replacedBy }) }}

    + {%- else -%}

    {{ params.description }}

    + {%- endif -%} + {%- else -%} + {{ params.name }} +

    {{ params.description }}

    + {%- endif -%} +
    +
    + Categories: + {%- if (params.deprecated) or (params.removed) -%} +

    + {%- else -%} +

    + ✅ Extends +

    + {%- endif -%} + +

    + 🛠 Fix +

    +

    + 💡 Suggestions +

    +
    +
    +{%- endmacro -%} diff --git a/docs/src/_includes/components/search.html b/docs/src/_includes/components/search.html new file mode 100644 index 000000000000..336385869b82 --- /dev/null +++ b/docs/src/_includes/components/search.html @@ -0,0 +1,22 @@ + diff --git a/docs/src/_includes/components/social-icons.html b/docs/src/_includes/components/social-icons.html new file mode 100644 index 000000000000..b75b75f82731 --- /dev/null +++ b/docs/src/_includes/components/social-icons.html @@ -0,0 +1,57 @@ + diff --git a/docs/src/_includes/components/theme-switcher.html b/docs/src/_includes/components/theme-switcher.html new file mode 100644 index 000000000000..69924d9d7c33 --- /dev/null +++ b/docs/src/_includes/components/theme-switcher.html @@ -0,0 +1,28 @@ + diff --git a/docs/src/_includes/components/version-switcher.html b/docs/src/_includes/components/version-switcher.html new file mode 100644 index 000000000000..ce29efd6aa8b --- /dev/null +++ b/docs/src/_includes/components/version-switcher.html @@ -0,0 +1,25 @@ + +
    + Versions + + +
    diff --git a/docs/src/_includes/layouts/base.html b/docs/src/_includes/layouts/base.html new file mode 100644 index 000000000000..300ba7457194 --- /dev/null +++ b/docs/src/_includes/layouts/base.html @@ -0,0 +1,159 @@ + + + + + + + {% if 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 %} + + + {{ page_title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ content | safe }} + + + + + + {% include 'partials/analytics.html' %} + + {%- if hook == "component-library" -%} + + {%- endif -%} + + + + + diff --git a/docs/src/_includes/layouts/components.html b/docs/src/_includes/layouts/components.html new file mode 100644 index 000000000000..0e28f26784b2 --- /dev/null +++ b/docs/src/_includes/layouts/components.html @@ -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." + }) +}} + +
    +
    + +
    + +
    +
    +

    {{ title }}

    + {{ content | safe }} +
    +
    +
    + +{% include "partials/site-footer.html" %} diff --git a/docs/src/_includes/layouts/doc.html b/docs/src/_includes/layouts/doc.html new file mode 100644 index 000000000000..70888cd6b815 --- /dev/null +++ b/docs/src/_includes/layouts/doc.html @@ -0,0 +1,107 @@ +--- +layout: base.html +--- + +{% include "partials/docs-header.html" %} +{% from 'components/rule-categories.macro.html' import ruleCategories %} + +
    +
    +
    + {% include 'components/version-switcher.html' %} +
    + {% include 'components/docs-index.html' %} +
    + + {# 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 %} + + {% related_rules related_rules %} + {% endset %} + + {% set all_content = [all_content, related_rules_content] | join %} + {% endif %} + + {% if added_version %} + {% set version_content %} +

    Version

    +

    This rule was introduced in ESLint v{{added_version}}{% if removed_version%} + and removed in v{{removed_version}}{% endif %}.

    + {% endset %} + + {% set all_content = [all_content, version_content] | join %} + {% endif %} + + {% if further_reading %} + {% set further_reading_content %} +

    Further Reading

    + {% 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 %} +

    Resources

    + + {% endset %} + {% set all_content = [all_content, resources_content] | join %} + {% endif %} + +
    +
    +
    +

    {{ title }}

    + {% if rule_meta %} + {%set id = true if (rule_meta.docs.recommended or rule_meta.fixable or rule_meta.hasSuggestions) else false %} +

    {{ rule_meta.docs.description | markdown | safe }}

    + {{ 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 }} +
    + + +
    + +
    +
    + + {% include 'components/docs-toc.html' %} +
    + {% include "partials/docs-footer.html" %} +
    +
    +
    + + diff --git a/docs/src/_includes/layouts/main.html b/docs/src/_includes/layouts/main.html new file mode 100644 index 000000000000..ed38d9c2ec88 --- /dev/null +++ b/docs/src/_includes/layouts/main.html @@ -0,0 +1,12 @@ +--- +layout: base.html +--- + +{% include "partials/docs-header.html" %} + + +
    + {{ content | safe }} +
    + +{% include "partials/site-footer.html" %} diff --git a/docs/src/_includes/partials/analytics.html b/docs/src/_includes/partials/analytics.html new file mode 100644 index 000000000000..a8a927e40b30 --- /dev/null +++ b/docs/src/_includes/partials/analytics.html @@ -0,0 +1,24 @@ + +{% if site.google_analytics.code %} + + + +{% endif %} diff --git a/docs/src/_includes/partials/carbon-ad.html b/docs/src/_includes/partials/carbon-ad.html new file mode 100644 index 000000000000..c79eba5a6794 --- /dev/null +++ b/docs/src/_includes/partials/carbon-ad.html @@ -0,0 +1,13 @@ + +{% if site.carbon_ads.serve %} + +{% endif %} diff --git a/docs/src/_includes/partials/docs-footer.html b/docs/src/_includes/partials/docs-footer.html new file mode 100644 index 000000000000..54791ea19660 --- /dev/null +++ b/docs/src/_includes/partials/docs-footer.html @@ -0,0 +1,14 @@ +
    + +
    + {% include 'components/theme-switcher.html' %} + {% include 'components/language-switcher.html' %} +
    +
    diff --git a/docs/src/_includes/partials/docs-header.html b/docs/src/_includes/partials/docs-header.html new file mode 100644 index 000000000000..f7abc754879d --- /dev/null +++ b/docs/src/_includes/partials/docs-header.html @@ -0,0 +1,8 @@ + diff --git a/docs/src/_includes/partials/docs-left-sidebar.html b/docs/src/_includes/partials/docs-left-sidebar.html new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docs/src/_includes/partials/languages-list.html b/docs/src/_includes/partials/languages-list.html new file mode 100644 index 000000000000..5d22b8a925a1 --- /dev/null +++ b/docs/src/_includes/partials/languages-list.html @@ -0,0 +1,5 @@ + diff --git a/docs/src/_includes/partials/site-footer.html b/docs/src/_includes/partials/site-footer.html new file mode 100644 index 000000000000..024718769a1d --- /dev/null +++ b/docs/src/_includes/partials/site-footer.html @@ -0,0 +1,24 @@ + diff --git a/docs/src/_includes/partials/versions-list.html b/docs/src/_includes/partials/versions-list.html new file mode 100644 index 000000000000..2e2fb2ff82a1 --- /dev/null +++ b/docs/src/_includes/partials/versions-list.html @@ -0,0 +1,7 @@ + diff --git a/docs/about/index.md b/docs/src/about/index.md similarity index 98% rename from docs/about/index.md rename to docs/src/about/index.md index a9c5acb46389..0f59d9cf39c0 100644 --- a/docs/about/index.md +++ b/docs/src/about/index.md @@ -1,4 +1,7 @@ -# About +--- +title: 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. diff --git a/docs/src/assets/fonts/Consolas.woff b/docs/src/assets/fonts/Consolas.woff new file mode 100644 index 000000000000..c4db8dd2ea36 Binary files /dev/null and b/docs/src/assets/fonts/Consolas.woff differ diff --git a/docs/src/assets/fonts/Inter-Regular-subset.woff2 b/docs/src/assets/fonts/Inter-Regular-subset.woff2 new file mode 100644 index 000000000000..de0e6016b2d4 Binary files /dev/null and b/docs/src/assets/fonts/Inter-Regular-subset.woff2 differ diff --git a/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff b/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff new file mode 100644 index 000000000000..dd5418f4f36c Binary files /dev/null and b/docs/src/assets/fonts/Inter-Regular-subset.zopfli.woff differ diff --git a/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 b/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 new file mode 100644 index 000000000000..1fee6c700ff3 Binary files /dev/null and b/docs/src/assets/fonts/Inter-SemiBold-subset.woff2 differ diff --git a/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff b/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff new file mode 100644 index 000000000000..619bca170279 Binary files /dev/null and b/docs/src/assets/fonts/Inter-SemiBold-subset.zopfli.woff differ diff --git a/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf b/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf new file mode 100644 index 000000000000..32a79990a55c Binary files /dev/null and b/docs/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf differ diff --git a/docs/src/assets/fonts/Inter/OFL.txt b/docs/src/assets/fonts/Inter/OFL.txt new file mode 100644 index 000000000000..ce049adca3ed --- /dev/null +++ b/docs/src/assets/fonts/Inter/OFL.txt @@ -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/docs/src/assets/fonts/Inter/README.txt b/docs/src/assets/fonts/Inter/README.txt new file mode 100644 index 000000000000..9f35f6cf69f5 --- /dev/null +++ b/docs/src/assets/fonts/Inter/README.txt @@ -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/docs/src/assets/fonts/Inter/static/Inter-Black.ttf b/docs/src/assets/fonts/Inter/static/Inter-Black.ttf new file mode 100644 index 000000000000..565375773523 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Black.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf b/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf new file mode 100644 index 000000000000..e98b84ce87fa Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Bold.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf b/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf new file mode 100644 index 000000000000..7f16a0f0f594 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf b/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf new file mode 100644 index 000000000000..69426a3eb566 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Light.ttf b/docs/src/assets/fonts/Inter/static/Inter-Light.ttf new file mode 100644 index 000000000000..a5f073690d3f Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Light.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf b/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf new file mode 100644 index 000000000000..721147d8311f Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Medium.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf b/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf new file mode 100644 index 000000000000..71c56ff75a22 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Regular-subset.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf b/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf new file mode 100644 index 000000000000..96fd6a12d0e2 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Regular.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf b/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf new file mode 100644 index 000000000000..97c3b862716e Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-SemiBold-subset.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf b/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf new file mode 100644 index 000000000000..ddb279290ba3 Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-SemiBold.ttf differ diff --git a/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf b/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf new file mode 100644 index 000000000000..76be6252b91e Binary files /dev/null and b/docs/src/assets/fonts/Inter/static/Inter-Thin.ttf differ diff --git a/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 b/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 new file mode 100644 index 000000000000..0d2e1313ea8d Binary files /dev/null and b/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.woff2 differ diff --git a/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff b/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff new file mode 100644 index 000000000000..8f8bb5ec311b Binary files /dev/null and b/docs/src/assets/fonts/SpaceGrotesk-Medium-subset.zopfli.woff differ diff --git a/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 b/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 new file mode 100644 index 000000000000..e7d587741571 Binary files /dev/null and b/docs/src/assets/fonts/SpaceMono-Regular-subset.woff2 differ diff --git a/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff b/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff new file mode 100644 index 000000000000..31832cfee037 Binary files /dev/null and b/docs/src/assets/fonts/SpaceMono-Regular-subset.zopfli.woff differ diff --git a/docs/src/assets/fonts/Space_Grotesk/OFL.txt b/docs/src/assets/fonts/Space_Grotesk/OFL.txt new file mode 100644 index 000000000000..f831dbc69f05 --- /dev/null +++ b/docs/src/assets/fonts/Space_Grotesk/OFL.txt @@ -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/docs/src/assets/fonts/Space_Grotesk/README.txt b/docs/src/assets/fonts/Space_Grotesk/README.txt new file mode 100644 index 000000000000..a5761741fda9 --- /dev/null +++ b/docs/src/assets/fonts/Space_Grotesk/README.txt @@ -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/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf b/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf new file mode 100644 index 000000000000..1e79375f7b40 Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf new file mode 100644 index 000000000000..869a60f04eb7 Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Bold.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf new file mode 100644 index 000000000000..76a195f12bc5 Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Light.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf new file mode 100644 index 000000000000..721d8ae00c94 Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium-subset.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf new file mode 100644 index 000000000000..667905f405aa Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Medium.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf new file mode 100644 index 000000000000..792fe1b396d2 Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-Regular.ttf differ diff --git a/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf new file mode 100644 index 000000000000..2171d9d301ab Binary files /dev/null and b/docs/src/assets/fonts/Space_Grotesk/static/SpaceGrotesk-SemiBold.ttf differ diff --git a/docs/src/assets/fonts/Space_Mono/OFL.txt b/docs/src/assets/fonts/Space_Mono/OFL.txt new file mode 100644 index 000000000000..5bb7346e6a56 --- /dev/null +++ b/docs/src/assets/fonts/Space_Mono/OFL.txt @@ -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/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf b/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf new file mode 100644 index 000000000000..18b8aea3b732 Binary files /dev/null and b/docs/src/assets/fonts/Space_Mono/SpaceMono-Bold.ttf differ diff --git a/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf b/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf new file mode 100644 index 000000000000..51fcc39906b9 Binary files /dev/null and b/docs/src/assets/fonts/Space_Mono/SpaceMono-BoldItalic.ttf differ diff --git a/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf b/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf new file mode 100644 index 000000000000..119c545edecc Binary files /dev/null and b/docs/src/assets/fonts/Space_Mono/SpaceMono-Italic.ttf differ diff --git a/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf b/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf new file mode 100644 index 000000000000..5cf59572e27d Binary files /dev/null and b/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular-subset.ttf differ diff --git a/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf b/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf new file mode 100644 index 000000000000..3374aca03058 Binary files /dev/null and b/docs/src/assets/fonts/Space_Mono/SpaceMono-Regular.ttf differ diff --git a/docs/src/assets/images/404.png b/docs/src/assets/images/404.png new file mode 100644 index 000000000000..347d16086ef8 Binary files /dev/null and b/docs/src/assets/images/404.png differ diff --git a/docs/src/assets/images/architecture/dependency.svg b/docs/src/assets/images/architecture/dependency.svg new file mode 100644 index 000000000000..1609b53e1d99 --- /dev/null +++ b/docs/src/assets/images/architecture/dependency.svg @@ -0,0 +1 @@ +binlibeslint.jscli.jsapi.jsinitcli-enginelintersource-coderule-testerrules \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg b/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg new file mode 100644 index 000000000000..f81d36123c4a --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-dowhilestatement.svg @@ -0,0 +1 @@ +ProgramDoWhileStatementBlockStatementExpressionStatementCallExpressionIdentifier (foo)ExpressionStatementCallExpressionIdentifier (bar)Identifier (a)DoWhileStatement:exitProgram:exit \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-forinstatement.svg b/docs/src/assets/images/code-path-analysis/example-forinstatement.svg new file mode 100644 index 000000000000..a6bc754b1be8 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-forinstatement.svg @@ -0,0 +1 @@ +ProgramForInStatementIdentifier (obj)VariableDeclarationVariableDeclaratorIdentifier (key)ForInStatement:exitProgram:exitBlockStatementExpressionStatementCallExpressionIdentifier (foo)Identifier (key) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg b/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg new file mode 100644 index 000000000000..4d334ca62d9e --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-forstatement-for-ever.svg @@ -0,0 +1 @@ +ProgramForStatementBlockStatementExpressionStatementCallExpressionIdentifier (foo) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-forstatement.svg b/docs/src/assets/images/code-path-analysis/example-forstatement.svg new file mode 100644 index 000000000000..aa0ccf0d82f1 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-forstatement.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)BlockStatementExpressionStatementCallExpressionIdentifier (foo)IfStatementIdentifier (b)ForStatement:exitProgram:exitBlockStatementBreakStatementExpressionStatementCallExpressionIdentifier (bar)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-hello-world.svg b/docs/src/assets/images/code-path-analysis/example-hello-world.svg new file mode 100644 index 000000000000..fc28d1fdaf9c --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-hello-world.svg @@ -0,0 +1 @@ +ProgramExpressionStatementCallExpressionMemberExpressionIdentifier (console)Identifier (log)Literal (Hello world!) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg b/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg new file mode 100644 index 000000000000..0944c3bcf59c --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-ifstatement-chain.svg @@ -0,0 +1 @@ +ProgramIfStatementIdentifier (a)BlockStatementExpressionStatementCallExpressionIdentifier (foo)IfStatementIdentifier (b)IfStatement:exitProgram:exitBlockStatementExpressionStatementCallExpressionIdentifier (bar)IfStatementIdentifier (c)BlockStatementExpressionStatementCallExpressionIdentifier (hoge) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-ifstatement.svg b/docs/src/assets/images/code-path-analysis/example-ifstatement.svg new file mode 100644 index 000000000000..b83c67b51061 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-ifstatement.svg @@ -0,0 +1 @@ +ProgramIfStatementIdentifier (a)BlockStatementExpressionStatementCallExpressionIdentifier (foo)BlockStatementExpressionStatementCallExpressionIdentifier (bar)IfStatement:exitProgram:exit \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg b/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg new file mode 100644 index 000000000000..5d6d73998b37 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-switchstatement-has-default.svg @@ -0,0 +1 @@ +ProgramSwitchStatementIdentifier (a)SwitchCaseLiteral (0)ExpressionStatementCallExpressionIdentifier (foo)BreakStatementSwitchCaseLiteral (1)SwitchStatement:exitProgram:exitExpressionStatementCallExpressionIdentifier (bar)ExpressionStatementCallExpressionIdentifier (hoge)BreakStatementExpressionStatementCallExpressionIdentifier (fuga)BreakStatementSwitchCaseLiteral (2)SwitchCaseLiteral (3)SwitchCase \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-switchstatement.svg b/docs/src/assets/images/code-path-analysis/example-switchstatement.svg new file mode 100644 index 000000000000..e43e5e11190b --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-switchstatement.svg @@ -0,0 +1 @@ +ProgramSwitchStatementIdentifier (a)SwitchCaseLiteral (0)ExpressionStatementCallExpressionIdentifier (foo)BreakStatementSwitchCaseLiteral (1)SwitchStatement:exitProgram:exitExpressionStatementCallExpressionIdentifier (bar)ExpressionStatementCallExpressionIdentifier (hoge)BreakStatementSwitchCaseLiteral (2)SwitchCaseLiteral (3) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg new file mode 100644 index 000000000000..60ec1cdf69b6 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg @@ -0,0 +1 @@ +ProgramTryStatementBlockStatementExpressionStatementCallExpressionIdentifier (foo)ExpressionStatementCallExpressionIdentifier (bar)CatchClauseIdentifier (err)BlockStatementExpressionStatementCallExpressionIdentifier (hoge)Identifier (err)BlockStatementExpressionStatementCallExpressionIdentifier (fuga)ExpressionStatementCallExpressionIdentifier (last) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg new file mode 100644 index 000000000000..a2a0c8af2507 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-trystatement-try-catch.svg @@ -0,0 +1 @@ +ProgramTryStatementBlockStatementExpressionStatementCallExpressionIdentifier (foo)IfStatementIdentifier (a)CatchClauseIdentifier (err)BlockStatementExpressionStatementCallExpressionIdentifier (hoge)Identifier (err)BlockStatementThrowStatementNewExpressionIdentifier (Error)ExpressionStatementCallExpressionIdentifier (bar)ExpressionStatementCallExpressionIdentifier (last) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg b/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg new file mode 100644 index 000000000000..68c7801b7cd8 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-trystatement-try-finally.svg @@ -0,0 +1 @@ +ProgramTryStatementBlockStatementExpressionStatementCallExpressionIdentifier (foo)ExpressionStatementCallExpressionIdentifier (bar)BlockStatementExpressionStatementCallExpressionIdentifier (fuga)BlockStatementExpressionStatementCallExpressionIdentifier (fuga)ExpressionStatementCallExpressionIdentifier (last) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg new file mode 100644 index 000000000000..53bb946cf162 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-f.svg @@ -0,0 +1 @@ +FunctionDeclarationIdentifier (foo)Identifier (a)BlockStatementIfStatementIdentifier (a)BlockStatementReturnStatementExpressionStatementCallExpressionIdentifier (bar) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg new file mode 100644 index 000000000000..4d3fe12b4a8f --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-when-there-is-a-function-g.svg @@ -0,0 +1 @@ +ProgramFunctionDeclarationExpressionStatementCallExpressionIdentifier (foo)Literal (false) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/example-whilestatement.svg b/docs/src/assets/images/code-path-analysis/example-whilestatement.svg new file mode 100644 index 000000000000..f03944389cda --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/example-whilestatement.svg @@ -0,0 +1 @@ +ProgramWhileStatementIdentifier (a)BlockStatementExpressionStatementCallExpressionIdentifier (foo)IfStatementIdentifier (b)WhileStatement:exitProgram:exitBlockStatementContinueStatementExpressionStatementCallExpressionIdentifier (bar) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/helo.svg b/docs/src/assets/images/code-path-analysis/helo.svg new file mode 100644 index 000000000000..cd72a37d9aff --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/helo.svg @@ -0,0 +1 @@ +ProgramIfStatementLogicalExpressionIdentifier (a)Identifier (b)ExpressionStatementCallExpressionIdentifier (bar)BlockStatementExpressionStatementCallExpressionIdentifier (foo) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg new file mode 100644 index 000000000000..727ec12b132d --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-for-1.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg new file mode 100644 index 000000000000..70d762f38bc1 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-for-2.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)BlockStatementExpressionStatementCallExpressionIdentifier (foo)Identifier (i)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg new file mode 100644 index 000000000000..5adea136b40e --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-for-3.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)BlockStatementExpressionStatementCallExpressionIdentifier (foo)Identifier (i)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg new file mode 100644 index 000000000000..99389751f340 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-for-4.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)BlockStatementExpressionStatementCallExpressionIdentifier (foo)Identifier (i)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg new file mode 100644 index 000000000000..070decb12924 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-for-5.svg @@ -0,0 +1 @@ +ProgramForStatementVariableDeclarationVariableDeclaratorIdentifier (i)Literal (0)BinaryExpressionIdentifier (i)Literal (10)BlockStatementExpressionStatementCallExpressionIdentifier (foo)Identifier (i)ExpressionStatementCallExpressionIdentifier (bar)UpdateExpressionIdentifier (i) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg new file mode 100644 index 000000000000..7d0c1a02d686 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-while-1.svg @@ -0,0 +1 @@ +ProgramWhileStatementIdentifier (a)BlockStatementExpressionStatementAssignmentExpressionIdentifier (a)CallExpressionIdentifier (foo) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg new file mode 100644 index 000000000000..d5c31e276ca9 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-while-2.svg @@ -0,0 +1 @@ +ProgramWhileStatementIdentifier (a)BlockStatementExpressionStatementAssignmentExpressionIdentifier (a)CallExpressionIdentifier (foo) \ No newline at end of file diff --git a/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg b/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg new file mode 100644 index 000000000000..3f4e02c17db2 --- /dev/null +++ b/docs/src/assets/images/code-path-analysis/loop-event-example-while-3.svg @@ -0,0 +1 @@ +ProgramWhileStatementIdentifier (a)BlockStatementExpressionStatementAssignmentExpressionIdentifier (a)CallExpressionIdentifier (foo)ExpressionStatementCallExpressionIdentifier (bar) \ No newline at end of file diff --git a/docs/src/assets/images/icons/arrow-left.svg b/docs/src/assets/images/icons/arrow-left.svg new file mode 100644 index 000000000000..83483a7f256a --- /dev/null +++ b/docs/src/assets/images/icons/arrow-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/arrow-right.svg b/docs/src/assets/images/icons/arrow-right.svg new file mode 100644 index 000000000000..22bb24fc3d4d --- /dev/null +++ b/docs/src/assets/images/icons/arrow-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/arrow-top-right.svg b/docs/src/assets/images/icons/arrow-top-right.svg new file mode 100644 index 000000000000..58bbed85264f --- /dev/null +++ b/docs/src/assets/images/icons/arrow-top-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/chevron-down.svg b/docs/src/assets/images/icons/chevron-down.svg new file mode 100644 index 000000000000..b09f7f73216a --- /dev/null +++ b/docs/src/assets/images/icons/chevron-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/copy.svg b/docs/src/assets/images/icons/copy.svg new file mode 100644 index 000000000000..24fc6afae9c7 --- /dev/null +++ b/docs/src/assets/images/icons/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/correct.svg b/docs/src/assets/images/icons/correct.svg new file mode 100644 index 000000000000..4f589241cb28 --- /dev/null +++ b/docs/src/assets/images/icons/correct.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/discord.svg b/docs/src/assets/images/icons/discord.svg new file mode 100644 index 000000000000..16bae7b3c46e --- /dev/null +++ b/docs/src/assets/images/icons/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/facebook.svg b/docs/src/assets/images/icons/facebook.svg new file mode 100644 index 000000000000..194c83485029 --- /dev/null +++ b/docs/src/assets/images/icons/facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/features-list-icon.svg b/docs/src/assets/images/icons/features-list-icon.svg new file mode 100644 index 000000000000..2e576cff9fd8 --- /dev/null +++ b/docs/src/assets/images/icons/features-list-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/github-icon-mono.svg b/docs/src/assets/images/icons/github-icon-mono.svg new file mode 100644 index 000000000000..f73b88b55b4f --- /dev/null +++ b/docs/src/assets/images/icons/github-icon-mono.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/github-img.svg b/docs/src/assets/images/icons/github-img.svg new file mode 100644 index 000000000000..51ad25a46eb8 --- /dev/null +++ b/docs/src/assets/images/icons/github-img.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/github-large.svg b/docs/src/assets/images/icons/github-large.svg new file mode 100644 index 000000000000..c540e36168fc --- /dev/null +++ b/docs/src/assets/images/icons/github-large.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/github-small.svg b/docs/src/assets/images/icons/github-small.svg new file mode 100644 index 000000000000..b410d3adcdff --- /dev/null +++ b/docs/src/assets/images/icons/github-small.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/github.svg b/docs/src/assets/images/icons/github.svg new file mode 100644 index 000000000000..0f3149634b9e --- /dev/null +++ b/docs/src/assets/images/icons/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/google.svg b/docs/src/assets/images/icons/google.svg new file mode 100644 index 000000000000..8b149df54a95 --- /dev/null +++ b/docs/src/assets/images/icons/google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/incorrect.svg b/docs/src/assets/images/icons/incorrect.svg new file mode 100644 index 000000000000..666811ebe475 --- /dev/null +++ b/docs/src/assets/images/icons/incorrect.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/languages.svg b/docs/src/assets/images/icons/languages.svg new file mode 100644 index 000000000000..2653515fe681 --- /dev/null +++ b/docs/src/assets/images/icons/languages.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/learn-more-arrow.svg b/docs/src/assets/images/icons/learn-more-arrow.svg new file mode 100644 index 000000000000..8aab0b95e408 --- /dev/null +++ b/docs/src/assets/images/icons/learn-more-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/link.svg b/docs/src/assets/images/icons/link.svg new file mode 100644 index 000000000000..6dfe15866b02 --- /dev/null +++ b/docs/src/assets/images/icons/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/linkedin.svg b/docs/src/assets/images/icons/linkedin.svg new file mode 100644 index 000000000000..a7c36f64e258 --- /dev/null +++ b/docs/src/assets/images/icons/linkedin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/menu.svg b/docs/src/assets/images/icons/menu.svg new file mode 100644 index 000000000000..d068dbd04db0 --- /dev/null +++ b/docs/src/assets/images/icons/menu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/minus-circle.svg b/docs/src/assets/images/icons/minus-circle.svg new file mode 100644 index 000000000000..f8e8023389a0 --- /dev/null +++ b/docs/src/assets/images/icons/minus-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/npm.svg b/docs/src/assets/images/icons/npm.svg new file mode 100644 index 000000000000..c9baf323174d --- /dev/null +++ b/docs/src/assets/images/icons/npm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/open-collectione-mono.svg b/docs/src/assets/images/icons/open-collectione-mono.svg new file mode 100644 index 000000000000..660478343ac0 --- /dev/null +++ b/docs/src/assets/images/icons/open-collectione-mono.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/opencollective-img.svg b/docs/src/assets/images/icons/opencollective-img.svg new file mode 100644 index 000000000000..a3b46dcd5d4b --- /dev/null +++ b/docs/src/assets/images/icons/opencollective-img.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/plus-circle.svg b/docs/src/assets/images/icons/plus-circle.svg new file mode 100644 index 000000000000..58533a0b7bdf --- /dev/null +++ b/docs/src/assets/images/icons/plus-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/search.svg b/docs/src/assets/images/icons/search.svg new file mode 100644 index 000000000000..6c70237669ba --- /dev/null +++ b/docs/src/assets/images/icons/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/icons/twitter.svg b/docs/src/assets/images/icons/twitter.svg new file mode 100644 index 000000000000..ffee249edaed --- /dev/null +++ b/docs/src/assets/images/icons/twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/logo/brand-colors.svg b/docs/src/assets/images/logo/brand-colors.svg new file mode 100644 index 000000000000..2c2048de281d --- /dev/null +++ b/docs/src/assets/images/logo/brand-colors.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/logo/eslint-logo-color.png b/docs/src/assets/images/logo/eslint-logo-color.png new file mode 100644 index 000000000000..efa54ec778d2 Binary files /dev/null and b/docs/src/assets/images/logo/eslint-logo-color.png differ diff --git a/docs/src/assets/images/logo/eslint-logo-color.svg b/docs/src/assets/images/logo/eslint-logo-color.svg new file mode 100644 index 000000000000..5a8dbfc6818f --- /dev/null +++ b/docs/src/assets/images/logo/eslint-logo-color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/images/logo/eslint-logo-white.svg b/docs/src/assets/images/logo/eslint-logo-white.svg new file mode 100644 index 000000000000..2493dc4cfdfc --- /dev/null +++ b/docs/src/assets/images/logo/eslint-logo-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/src/assets/js/components-index.js b/docs/src/assets/js/components-index.js new file mode 100644 index 000000000000..9e3bc0f5cf9c --- /dev/null +++ b/docs/src/assets/js/components-index.js @@ -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/docs/src/assets/js/css-vars-ponyfill@2.js b/docs/src/assets/js/css-vars-ponyfill@2.js new file mode 100644 index 000000000000..3285a577a2a9 --- /dev/null +++ b/docs/src/assets/js/css-vars-ponyfill@2.js @@ -0,0 +1,47 @@ +/*! + * css-vars-ponyfill + * v2.1.2 + * https://jhildenbiddle.github.io/css-vars-ponyfill/ + * (c) 2018-2019 John Hildenbiddle + * 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;t1&&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())=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;s1&&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;n1&&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.length2&&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;o1&&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/docs/src/assets/js/focus-visible.js b/docs/src/assets/js/focus-visible.js new file mode 100644 index 000000000000..c95845112cf4 --- /dev/null +++ b/docs/src/assets/js/focus-visible.js @@ -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 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/docs/src/assets/js/inert-polyfill.js b/docs/src/assets/js/inert-polyfill.js new file mode 100644 index 000000000000..11ae095ccf60 --- /dev/null +++ b/docs/src/assets/js/inert-polyfill.js @@ -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/docs/src/assets/js/main.js b/docs/src/assets/js/main.js new file mode 100644 index 000000000000..28ec0e1306be --- /dev/null +++ b/docs/src/assets/js/main.js @@ -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 += ``; + + 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: '', + }; + 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/docs/src/assets/js/search.js b/docs/src/assets/js/search.js new file mode 100644 index 000000000000..25282bc2d7fd --- /dev/null +++ b/docs/src/assets/js/search.js @@ -0,0 +1,190 @@ +/** + * @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>} 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} 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 = ` +

    ${result.hierarchy.lvl0}

    +

    ${typeof result._highlightResult.content !== 'undefined' ? result._highlightResult.content.value : result._highlightResult.hierarchy[`lvl${maxLvl}`].value}

    + `.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({ behavior: "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); + } +}); diff --git a/docs/src/assets/js/tabs.js b/docs/src/assets/js/tabs.js new file mode 100644 index 000000000000..a22159385389 --- /dev/null +++ b/docs/src/assets/js/tabs.js @@ -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/docs/src/assets/js/themes.js b/docs/src/assets/js/themes.js new file mode 100644 index 000000000000..e6071b21983a --- /dev/null +++ b/docs/src/assets/js/themes.js @@ -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/docs/src/assets/scss/carbon-ads.scss b/docs/src/assets/scss/carbon-ads.scss new file mode 100644 index 000000000000..bd7ea8e660cb --- /dev/null +++ b/docs/src/assets/scss/carbon-ads.scss @@ -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; + background-color: var(--body-background-color); + border: 1px solid var(--border-color); + border-radius: 4px; + 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%, 0.6); + background-color: hsla(0, 0%, 70%, 0.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/docs/src/assets/scss/components/alert.scss b/docs/src/assets/scss/components/alert.scss new file mode 100644 index 000000000000..fb3b5d62d013 --- /dev/null +++ b/docs/src/assets/scss/components/alert.scss @@ -0,0 +1,132 @@ +.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/docs/src/assets/scss/components/buttons.scss b/docs/src/assets/scss/components/buttons.scss new file mode 100644 index 000000000000..ca0aa72a726c --- /dev/null +++ b/docs/src/assets/scss/components/buttons.scss @@ -0,0 +1,77 @@ +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/docs/src/assets/scss/components/docs-index.scss b/docs/src/assets/scss/components/docs-index.scss new file mode 100644 index 000000000000..d524a9b25892 --- /dev/null +++ b/docs/src/assets/scss/components/docs-index.scss @@ -0,0 +1,165 @@ +.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/docs/src/assets/scss/components/docs-navigation.scss b/docs/src/assets/scss/components/docs-navigation.scss new file mode 100644 index 000000000000..f47fce3a0a50 --- /dev/null +++ b/docs/src/assets/scss/components/docs-navigation.scss @@ -0,0 +1,147 @@ +.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/docs/src/assets/scss/components/hero.scss b/docs/src/assets/scss/components/hero.scss new file mode 100644 index 000000000000..b4c8cd4d52a1 --- /dev/null +++ b/docs/src/assets/scss/components/hero.scss @@ -0,0 +1,59 @@ +.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/docs/src/assets/scss/components/index.scss b/docs/src/assets/scss/components/index.scss new file mode 100644 index 000000000000..5989e1f48e7a --- /dev/null +++ b/docs/src/assets/scss/components/index.scss @@ -0,0 +1,109 @@ +.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/docs/src/assets/scss/components/language-switcher.scss b/docs/src/assets/scss/components/language-switcher.scss new file mode 100644 index 000000000000..6ea2fad0c73f --- /dev/null +++ b/docs/src/assets/scss/components/language-switcher.scss @@ -0,0 +1,31 @@ +.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/docs/src/assets/scss/components/resources.scss b/docs/src/assets/scss/components/resources.scss new file mode 100644 index 000000000000..4ee2616d8db7 --- /dev/null +++ b/docs/src/assets/scss/components/resources.scss @@ -0,0 +1,67 @@ +.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: 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; + offset-block-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/docs/src/assets/scss/components/rules.scss b/docs/src/assets/scss/components/rules.scss new file mode 100644 index 000000000000..423e0d2fb628 --- /dev/null +++ b/docs/src/assets/scss/components/rules.scss @@ -0,0 +1,201 @@ +.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: 0; + } + } + + @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/docs/src/assets/scss/components/search.scss b/docs/src/assets/scss/components/search.scss new file mode 100644 index 000000000000..0d9c522e56cc --- /dev/null +++ b/docs/src/assets/scss/components/search.scss @@ -0,0 +1,164 @@ +[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); + z-index: 10; + width: 100%; + border-radius: 0 0 var(--border-radius) var(--border-radius); + border: 1px solid var(--divider-color); + position: relative; + 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/docs/src/assets/scss/components/social-icons.scss b/docs/src/assets/scss/components/social-icons.scss new file mode 100644 index 000000000000..37902a9f588c --- /dev/null +++ b/docs/src/assets/scss/components/social-icons.scss @@ -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/docs/src/assets/scss/components/tabs.scss b/docs/src/assets/scss/components/tabs.scss new file mode 100644 index 000000000000..8a7d866c514c --- /dev/null +++ b/docs/src/assets/scss/components/tabs.scss @@ -0,0 +1,63 @@ +.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/docs/src/assets/scss/components/theme-switcher.scss b/docs/src/assets/scss/components/theme-switcher.scss new file mode 100644 index 000000000000..c7276301af7e --- /dev/null +++ b/docs/src/assets/scss/components/theme-switcher.scss @@ -0,0 +1,83 @@ +.theme-switcher { + display: inline-flex; + align-items: center; + gap: .5rem; + position: relative; +} + +.theme-switcher-label.theme-switcher-label { + 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/docs/src/assets/scss/components/toc.scss b/docs/src/assets/scss/components/toc.scss new file mode 100644 index 000000000000..5e2e66a166ad --- /dev/null +++ b/docs/src/assets/scss/components/toc.scss @@ -0,0 +1,116 @@ +.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/docs/src/assets/scss/components/version-switcher.scss b/docs/src/assets/scss/components/version-switcher.scss new file mode 100644 index 000000000000..606b802395cb --- /dev/null +++ b/docs/src/assets/scss/components/version-switcher.scss @@ -0,0 +1,4 @@ +.version-switcher { + margin-bottom: .5rem; + margin-block-end: .5rem; +} diff --git a/docs/src/assets/scss/docs-footer.scss b/docs/src/assets/scss/docs-footer.scss new file mode 100644 index 000000000000..347afd3978e6 --- /dev/null +++ b/docs/src/assets/scss/docs-footer.scss @@ -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/docs/src/assets/scss/docs-header.scss b/docs/src/assets/scss/docs-header.scss new file mode 100644 index 000000000000..e2a2fecdb48b --- /dev/null +++ b/docs/src/assets/scss/docs-header.scss @@ -0,0 +1,39 @@ +.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/docs/src/assets/scss/docs.scss b/docs/src/assets/scss/docs.scss new file mode 100644 index 000000000000..934fbb04bfb4 --- /dev/null +++ b/docs/src/assets/scss/docs.scss @@ -0,0 +1,151 @@ +/* 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/docs/src/assets/scss/eslint-site-footer.scss b/docs/src/assets/scss/eslint-site-footer.scss new file mode 100644 index 000000000000..6ecb430c7038 --- /dev/null +++ b/docs/src/assets/scss/eslint-site-footer.scss @@ -0,0 +1,64 @@ +.site-footer { + text-align: center; + background-color: var(--footer-background-color); + border-top: 1px solid var(--divider-color); + border-block-start: 1px solid var(--divider-color); +} + +.footer-cta { + .logo { + margin-bottom: 2.5rem; + margin-block-end: 2.5rem; + } + + .section-supporting-text { + margin-bottom: 2.5rem; + margin-block-end: 2.5rem; + } + + .eslint-actions { + justify-content: center; + } +} + +.footer-legal-links { + ul { + li { + display: inline-block; + margin-right: .5rem; + margin-inline-end: .5rem; + + &:not(:last-of-type)::after { + content: "|"; + margin-left: .5rem; + margin-inline-start: .5rem; + } + } + } +} + +.footer-legal-section { + font-size: var(--step--1); + padding: 2rem 1rem; +} + +.copyright { + max-width: 1100px; + margin: 0 auto; +} + +.footer-middle { + padding-top: 2rem; + padding-bottom: 2rem; + padding-block-start: 2rem; + padding-block-end: 2rem; + display: flex; + flex-direction: column; + align-items: center; + gap: 2rem; + + @media all and (min-width: 768px) { + flex-direction: row; + justify-content: space-between; + } +} diff --git a/docs/src/assets/scss/eslint-site-header.scss b/docs/src/assets/scss/eslint-site-header.scss new file mode 100644 index 000000000000..892ebc7e6250 --- /dev/null +++ b/docs/src/assets/scss/eslint-site-header.scss @@ -0,0 +1,40 @@ +.site-header { + padding: .75rem 0; + border-top: 4px solid var(--link-color); + border-block-start: 4px solid var(--link-color); + border-bottom: 1px solid var(--divider-color); + border-block-end: 1px solid var(--divider-color); + + .content-container { + display: grid; + align-items: start; + padding-top: 0; + padding-bottom: 0; + padding-block-start: 0; + padding-block-end: 0; + + @media all and (min-width: 680px) { + 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; + z-index: 2; +} + +.logo svg { + display: inline-block; + margin-bottom: -4px; + margin-block-end: -4px; + width: 100%; + max-width: 100px; + height: auto; +} diff --git a/docs/src/assets/scss/forms.scss b/docs/src/assets/scss/forms.scss new file mode 100644 index 000000000000..0df746c558e3 --- /dev/null +++ b/docs/src/assets/scss/forms.scss @@ -0,0 +1,51 @@ +.c-custom-select { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + box-sizing: border-box; + display: block; + width: 100%; + max-width: 100%; + min-width: 0; + 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; + 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; + min-width: 0; + line-height: 1.3; + max-width: 100%; + background-color: var(--body-background-color); + color: inherit; +} diff --git a/docs/src/assets/scss/foundations.scss b/docs/src/assets/scss/foundations.scss new file mode 100644 index 000000000000..25b0e1df4298 --- /dev/null +++ b/docs/src/assets/scss/foundations.scss @@ -0,0 +1,433 @@ +::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/docs/src/assets/scss/languages.scss b/docs/src/assets/scss/languages.scss new file mode 100644 index 000000000000..49613b7133c5 --- /dev/null +++ b/docs/src/assets/scss/languages.scss @@ -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; + width: 100%; + padding: .75rem .1rem; + text-decoration: none; + display: block; + 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/docs/src/assets/scss/print.scss b/docs/src/assets/scss/print.scss new file mode 100644 index 000000000000..68d4146240ec --- /dev/null +++ b/docs/src/assets/scss/print.scss @@ -0,0 +1,209 @@ +*, +*::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*="eslint.org"])::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/docs/src/assets/scss/styles.scss b/docs/src/assets/scss/styles.scss new file mode 100644 index 000000000000..8907a6c4bf9f --- /dev/null +++ b/docs/src/assets/scss/styles.scss @@ -0,0 +1,35 @@ +@import "tokens/themes"; +@import "tokens/spacing"; +@import "tokens/typography"; +@import "tokens/ui"; + +@import "foundations"; +@import "syntax-highlighter"; +@import "docs-header"; +@import "docs-footer"; +@import "eslint-site-footer"; +@import "eslint-site-header"; +@import "forms"; +@import "docs"; +@import "versions"; +@import "languages"; + +@import "components/buttons"; +@import "components/docs-navigation"; +@import "components/toc"; +@import "components/search"; +@import "components/alert"; +@import "components/rules"; +@import "components/social-icons"; +@import "components/hero"; +@import "components/theme-switcher"; +@import "components/version-switcher"; +@import "components/language-switcher"; +@import "components/docs-index"; // docs index on the main docs pages +@import "components/index"; // used in component library +@import "components/tabs"; +@import "components/resources"; + +@import "carbon-ads"; + +@import "utilities"; diff --git a/docs/src/assets/scss/syntax-highlighter.scss b/docs/src/assets/scss/syntax-highlighter.scss new file mode 100644 index 000000000000..cb26ac75af42 --- /dev/null +++ b/docs/src/assets/scss/syntax-highlighter.scss @@ -0,0 +1,124 @@ +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; + 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/docs/src/assets/scss/tokens/spacing.scss b/docs/src/assets/scss/tokens/spacing.scss new file mode 100644 index 000000000000..1f5549b8e702 --- /dev/null +++ b/docs/src/assets/scss/tokens/spacing.scss @@ -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/docs/src/assets/scss/tokens/themes.scss b/docs/src/assets/scss/tokens/themes.scss new file mode 100644 index 000000000000..2612ec5f485c --- /dev/null +++ b/docs/src/assets/scss/tokens/themes.scss @@ -0,0 +1,154 @@ +: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/docs/src/assets/scss/tokens/typography.scss b/docs/src/assets/scss/tokens/typography.scss new file mode 100644 index 000000000000..24a4597442bc --- /dev/null +++ b/docs/src/assets/scss/tokens/typography.scss @@ -0,0 +1,81 @@ +/* @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/docs/src/assets/scss/tokens/ui.scss b/docs/src/assets/scss/tokens/ui.scss new file mode 100644 index 000000000000..49380e12da85 --- /dev/null +++ b/docs/src/assets/scss/tokens/ui.scss @@ -0,0 +1,9 @@ +:root { + // elevations + --shadow-lg: + 0 12px 16px -4px rgba(16, 24, 40, 0.1), + 0 4px 6px -2px rgba(16, 24, 40, 0.05); + --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05); + + --border-radius: .5rem; +} diff --git a/docs/src/assets/scss/utilities.scss b/docs/src/assets/scss/utilities.scss new file mode 100644 index 000000000000..c296358837ee --- /dev/null +++ b/docs/src/assets/scss/utilities.scss @@ -0,0 +1,171 @@ +.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 { + 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/docs/src/assets/scss/versions.scss b/docs/src/assets/scss/versions.scss new file mode 100644 index 000000000000..1a2e0ffe9a31 --- /dev/null +++ b/docs/src/assets/scss/versions.scss @@ -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); + width: 100%; + padding: 1rem .5rem; + text-decoration: none; + display: block; + 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/docs/developer-guide/architecture.md b/docs/src/developer-guide/architecture/index.md similarity index 96% rename from docs/developer-guide/architecture.md rename to docs/src/developer-guide/architecture/index.md index 6531c28391f8..a066f1e2d5fa 100644 --- a/docs/developer-guide/architecture.md +++ b/docs/src/developer-guide/architecture/index.md @@ -1,13 +1,19 @@ -# Architecture +--- +title: Architecture +eleventyNavigation: + key: architecture + parent: developer guide + title: Architecture + order: 1 +--- -
    dependency graph
    +
    dependency graph
    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. diff --git a/docs/developer-guide/code-conventions.md b/docs/src/developer-guide/code-conventions.md similarity index 72% rename from docs/developer-guide/code-conventions.md rename to docs/src/developer-guide/code-conventions.md index 0c1cbe6245d6..e5f5a4482814 100644 --- a/docs/developer-guide/code-conventions.md +++ b/docs/src/developer-guide/code-conventions.md @@ -1,4 +1,6 @@ -# Code Conventions +--- +title: Code Conventions +--- Code conventions for ESLint are determined by [eslint-config-eslint](https://www.npmjs.com/package/eslint-config-eslint). @@ -7,3 +9,6 @@ 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/docs/developer-guide/code-path-analysis.md b/docs/src/developer-guide/code-path-analysis.md similarity index 83% rename from docs/developer-guide/code-path-analysis.md rename to docs/src/developer-guide/code-path-analysis.md index 2b01bc77e813..5dca4ed79a52 100644 --- a/docs/developer-guide/code-path-analysis.md +++ b/docs/src/developer-guide/code-path-analysis.md @@ -1,4 +1,7 @@ -# Code Path Analysis Details +--- +title: Code Path Analysis Details + +--- ESLint's rules can use code paths. The code path is execution routes of programs. @@ -11,7 +14,7 @@ if (a && b) { bar(); ``` -![Code Path Example](./code-path-analysis/helo.svg) +![Code Path Example](../assets/images/code-path-analysis/helo.svg) ## Objects @@ -95,10 +98,10 @@ module.exports = function(context) { }, /** - * This is called when a code path segment was leaved. + * 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 leaved code path segment. + * @param {CodePathSegment} segment - The left code path segment. * @param {ASTNode} node - The current node. * @returns {void} */ @@ -140,17 +143,17 @@ 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) + ![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](./code-path-analysis/loop-event-example-while-2.svg) + ![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](./code-path-analysis/loop-event-example-while-3.svg) + ![Loop Event's Example 3](../assets/images/code-path-analysis/loop-event-example-while-3.svg) For example 2: @@ -165,29 +168,29 @@ bar(); 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) + ![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](./code-path-analysis/loop-event-example-for-2.svg) + ![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](./code-path-analysis/loop-event-example-for-3.svg) + ![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](./code-path-analysis/loop-event-example-for-4.svg) + ![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](./code-path-analysis/loop-event-example-for-5.svg) + ![Loop Event's Example 5](../assets/images/code-path-analysis/loop-event-example-for-5.svg) ## Usage Examples @@ -333,7 +336,7 @@ See Also: console.log("Hello world!"); ``` -![Hello World](./code-path-analysis/example-hello-world.svg) +![Hello World](../assets/images/code-path-analysis/example-hello-world.svg) ### `IfStatement` @@ -345,7 +348,7 @@ if (a) { } ``` -![`IfStatement`](./code-path-analysis/example-ifstatement.svg) +![`IfStatement`](../assets/images/code-path-analysis/example-ifstatement.svg) ### `IfStatement` (chain) @@ -359,7 +362,7 @@ if (a) { } ``` -![`IfStatement` (chain)](./code-path-analysis/example-ifstatement-chain.svg) +![`IfStatement` (chain)](../assets/images/code-path-analysis/example-ifstatement-chain.svg) ### `SwitchStatement` @@ -380,7 +383,7 @@ switch (a) { } ``` -![`SwitchStatement`](./code-path-analysis/example-switchstatement.svg) +![`SwitchStatement`](../assets/images/code-path-analysis/example-switchstatement.svg) ### `SwitchStatement` (has `default`) @@ -405,7 +408,7 @@ switch (a) { } ``` -![`SwitchStatement` (has `default`)](./code-path-analysis/example-switchstatement-has-default.svg) +![`SwitchStatement` (has `default`)](../assets/images/code-path-analysis/example-switchstatement-has-default.svg) ### `TryStatement` (try-catch) @@ -428,7 +431,7 @@ It creates the paths from `try` block to `catch` block at: * 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-catch)](../assets/images/code-path-analysis/example-trystatement-try-catch.svg) ### `TryStatement` (try-finally) @@ -446,7 +449,7 @@ 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-finally)](../assets/images/code-path-analysis/example-trystatement-try-finally.svg) ### `TryStatement` (try-catch-finally) @@ -462,7 +465,7 @@ try { last(); ``` -![`TryStatement` (try-catch-finally)](./code-path-analysis/example-trystatement-try-catch-finally.svg) +![`TryStatement` (try-catch-finally)](../assets/images/code-path-analysis/example-trystatement-try-catch-finally.svg) ### `WhileStatement` @@ -476,7 +479,7 @@ while (a) { } ``` -![`WhileStatement`](./code-path-analysis/example-whilestatement.svg) +![`WhileStatement`](../assets/images/code-path-analysis/example-whilestatement.svg) ### `DoWhileStatement` @@ -487,7 +490,7 @@ do { } while (a); ``` -![`DoWhileStatement`](./code-path-analysis/example-dowhilestatement.svg) +![`DoWhileStatement`](../assets/images/code-path-analysis/example-dowhilestatement.svg) ### `ForStatement` @@ -501,7 +504,7 @@ for (let i = 0; i < 10; ++i) { } ``` -![`ForStatement`](./code-path-analysis/example-forstatement.svg) +![`ForStatement`](../assets/images/code-path-analysis/example-forstatement.svg) ### `ForStatement` (for ever) @@ -512,7 +515,7 @@ for (;;) { bar(); ``` -![`ForStatement` (for ever)](./code-path-analysis/example-forstatement-for-ever.svg) +![`ForStatement` (for ever)](../assets/images/code-path-analysis/example-forstatement-for-ever.svg) ### `ForInStatement` @@ -522,7 +525,7 @@ for (let key in obj) { } ``` -![`ForInStatement`](./code-path-analysis/example-forinstatement.svg) +![`ForInStatement`](../assets/images/code-path-analysis/example-forinstatement.svg) ### When there is a function @@ -541,8 +544,8 @@ It creates two code paths. * The global's - ![When there is a function](./code-path-analysis/example-when-there-is-a-function-g.svg) + ![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](./code-path-analysis/example-when-there-is-a-function-f.svg) + ![When there is a function](../assets/images/code-path-analysis/example-when-there-is-a-function-f.svg) diff --git a/docs/developer-guide/contributing/changes.md b/docs/src/developer-guide/contributing/changes.md similarity index 78% rename from docs/developer-guide/contributing/changes.md rename to docs/src/developer-guide/contributing/changes.md index 3c13051c39cb..692715b3844e 100644 --- a/docs/developer-guide/contributing/changes.md +++ b/docs/src/developer-guide/contributing/changes.md @@ -1,10 +1,13 @@ -# Change Requests +--- +title: 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: +--- + +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. -1. The problem you want to solve. -1. Your take on the correct solution to problem. +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: diff --git a/docs/developer-guide/contributing/README.md b/docs/src/developer-guide/contributing/index.md similarity index 72% rename from docs/developer-guide/contributing/README.md rename to docs/src/developer-guide/contributing/index.md index 25a889466e5b..2af9df41d0ef 100644 --- a/docs/developer-guide/contributing/README.md +++ b/docs/src/developer-guide/contributing/index.md @@ -1,4 +1,12 @@ -# Contributing +--- +title: Contributing +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. @@ -8,23 +16,19 @@ This guide is intended for anyone who wants to contribute to an ESLint project. 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) +## 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.md) +## 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.md) +## 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. @@ -32,10 +36,14 @@ If you'd like to request a change other than a bug fix or new rule, this section To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint). -## [Working on Issues](working-on-issues.md) +## [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.md) +## 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/docs/developer-guide/contributing/new-rules.md b/docs/src/developer-guide/contributing/new-rules.md similarity index 94% rename from docs/developer-guide/contributing/new-rules.md rename to docs/src/developer-guide/contributing/new-rules.md index e4a19e486f56..0b4cd1bb95a0 100644 --- a/docs/developer-guide/contributing/new-rules.md +++ b/docs/src/developer-guide/contributing/new-rules.md @@ -1,4 +1,7 @@ -# New Rules +--- +title: 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. @@ -19,7 +22,7 @@ Even though these are the formal criteria for inclusion, each rule is evaluated ## 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). +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. @@ -39,4 +42,4 @@ The ESLint team doesn't implement new rules that are suggested by users because ## 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. +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/docs/developer-guide/contributing/pull-requests.md b/docs/src/developer-guide/contributing/pull-requests.md similarity index 87% rename from docs/developer-guide/contributing/pull-requests.md rename to docs/src/developer-guide/contributing/pull-requests.md index 58fe6f9c02a2..0690b794e43c 100644 --- a/docs/developer-guide/contributing/pull-requests.md +++ b/docs/src/developer-guide/contributing/pull-requests.md @@ -1,4 +1,7 @@ -# Pull Requests +--- +title: 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. @@ -6,9 +9,8 @@ If you want to contribute to an ESLint repo, please use a GitHub pull request. T 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. +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. @@ -30,8 +32,8 @@ Details about each step are found below. 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 +```shell +git checkout -b issue1234 ``` You should do all of your development for the issue in this branch. @@ -40,16 +42,16 @@ You should do all of your development for the issue in this branch. ### Step 2: Make your changes -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: +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: -```sh -$ git add -A -$ git commit +```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: +All ESLint projects follow [Conventional Commits](https://www.conventionalcommits.org/) for our commit messages. (Note: we don’t support the optional scope in messages.) Here's an example commit message: -```pt +```txt tag: Short description of what you did Longer description here if necessary @@ -73,13 +75,13 @@ The `tag` is one of the following: * `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. +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: -```pt +```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 @@ -91,7 +93,7 @@ The commit message format is important because these messages are used to create 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 +```shell git fetch upstream git rebase upstream/main ``` @@ -100,7 +102,7 @@ git rebase upstream/main After rebasing, be sure to run all of the tests once again to make sure nothing broke: -```sh +```shell npm test ``` @@ -117,19 +119,19 @@ With your code ready to go, this is a good time to double-check your submission * 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). +* Follow the [Code Conventions](../code-conventions). ### Step 6: Push your changes Next, push your changes to your clone: -```sh +```shell git push origin issue1234 ``` If you are unable to push because some references are old, do a forced push instead: -```sh +```shell git push -f origin issue1234 ``` @@ -137,6 +139,8 @@ git push -f origin issue1234 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 .) + ## Following Up Once your pull request is sent, it's time for the team to review it. As such, please make sure to: @@ -149,24 +153,24 @@ Once your pull request is sent, it's time for the team to review it. As such, pl 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 +```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: -```sh -$ git push origin issue1234 -f +```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: -```sh -$ git add -A -$ git commit -$ git push origin issue1234 +```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. @@ -175,15 +179,15 @@ The commit messages in subsequent commits do not need to be in any specific form ### 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: +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: -```sh -$ git fetch upstream -$ git rebase upstream/main +```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: -```sh -$ git push origin issue1234 -f +```shell +git push origin issue1234 -f ``` diff --git a/docs/developer-guide/contributing/reporting-bugs.md b/docs/src/developer-guide/contributing/reporting-bugs.md similarity index 78% rename from docs/developer-guide/contributing/reporting-bugs.md rename to docs/src/developer-guide/contributing/reporting-bugs.md index 4dd0da02f08c..f0ec2fe54e44 100644 --- a/docs/developer-guide/contributing/reporting-bugs.md +++ b/docs/src/developer-guide/contributing/reporting-bugs.md @@ -1,6 +1,9 @@ -# Reporting Bugs +--- +title: 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. +--- + +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. diff --git a/docs/developer-guide/contributing/rule-changes.md b/docs/src/developer-guide/contributing/rule-changes.md similarity index 81% rename from docs/developer-guide/contributing/rule-changes.md rename to docs/src/developer-guide/contributing/rule-changes.md index d45ddbe449d9..7a880e0caca1 100644 --- a/docs/developer-guide/contributing/rule-changes.md +++ b/docs/src/developer-guide/contributing/rule-changes.md @@ -1,10 +1,13 @@ -# Rule Changes +--- +title: 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. +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. @@ -12,7 +15,7 @@ We need all of this information in order to determine whether or not the 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. 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 diff --git a/docs/developer-guide/contributing/working-on-issues.md b/docs/src/developer-guide/contributing/working-on-issues.md similarity index 99% rename from docs/developer-guide/contributing/working-on-issues.md rename to docs/src/developer-guide/contributing/working-on-issues.md index 9e666d649b3f..fabb9b1881d3 100644 --- a/docs/developer-guide/contributing/working-on-issues.md +++ b/docs/src/developer-guide/contributing/working-on-issues.md @@ -1,4 +1,7 @@ -# Working on Issues +--- +title: 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. diff --git a/docs/developer-guide/development-environment.md b/docs/src/developer-guide/development-environment.md similarity index 89% rename from docs/developer-guide/development-environment.md rename to docs/src/developer-guide/development-environment.md index 4828476aac83..d25b4444910c 100644 --- a/docs/developer-guide/development-environment.md +++ b/docs/src/developer-guide/development-environment.md @@ -1,4 +1,12 @@ -# Development Environment +--- +title: Development Environment +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. @@ -14,9 +22,9 @@ Go to and click the "Fork" button. Follow the Once you've cloned the repository, run `npm install` to get all the necessary dependencies: -```sh -$ cd eslint -$ npm install +```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. @@ -27,7 +35,7 @@ The *upstream source* is the main ESLint repository where active development hap To add the upstream source for ESLint, run the following in your repository: -```sh +```shell git remote add upstream git@github.com:eslint/eslint.git ``` @@ -37,11 +45,15 @@ Now, the remote `upstream` points to the upstream source. [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 +```shell +npm install -g yo +``` Then, you can install the ESLint Yeoman generator: - npm install -g generator-eslint +```shell +npm install -g generator-eslint +``` Please see the [generator documentation](https://github.com/eslint/generator-eslint) for instructions on how to use it. @@ -49,7 +61,7 @@ Please see the [generator documentation](https://github.com/eslint/generator-esl 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 +```shell npm test ``` @@ -59,7 +71,7 @@ The testing takes a few minutes to complete. If any tests fail, that likely mean ### 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). +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 diff --git a/docs/developer-guide/README.md b/docs/src/developer-guide/index.md similarity index 82% rename from docs/developer-guide/README.md rename to docs/src/developer-guide/index.md index a5e659278691..66b76b12bce2 100644 --- a/docs/developer-guide/README.md +++ b/docs/src/developer-guide/index.md @@ -1,4 +1,11 @@ -# Developer Guide +--- +title: Developer Guide +eleventyNavigation: + key: developer guide + title: Developer Guide + order: 2 + +--- This guide is intended for those who wish to: @@ -14,31 +21,31 @@ In order to work with ESLint as a developer, it's recommended that: If that sounds like you, then continue reading to get started. -## Section 1: Get the [Source Code](source-code.md) +## 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.md) +## 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.md) +## 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.md) +## 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.md) +## 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.md) +## 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.md) +## 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. diff --git a/docs/developer-guide/nodejs-api.md b/docs/src/developer-guide/nodejs-api.md similarity index 90% rename from docs/developer-guide/nodejs-api.md rename to docs/src/developer-guide/nodejs-api.md index ca07415cd2bf..30b75ccecd98 100644 --- a/docs/developer-guide/nodejs-api.md +++ b/docs/src/developer-guide/nodejs-api.md @@ -1,41 +1,17 @@ -# Node.js API +--- +title: Node.js API +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. -## 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. @@ -278,7 +254,7 @@ This method loads a formatter. Formatters convert lint results to a human- or ma 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: + * 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`. @@ -286,8 +262,8 @@ This method loads a formatter. Formatters convert lint results to a human- or ma #### Return Value -* (`Promise`)
    - The promise that will be fulfilled with a [Formatter] object. +* (`Promise`)
    + The promise that will be fulfilled with a [LoadedFormatter] object. ### ◆ ESLint.version @@ -347,6 +323,8 @@ The `LintResult` value is the information of the linting result of each file. Th The absolute path to the file of this result. This is the string `""` if the file path is unknown (when you didn't pass the `options.filePath` option to the [`eslint.lintText()`][eslint-linttext] method). * `messages` (`LintMessage[]`)
    The array of [LintMessage] objects. +* `suppressedMessages` (`SuppressedLintMessage[]`)
    + The array of [SuppressedLintMessage] objects. * `fixableErrorCount` (`number`)
    The number of errors that can be fixed automatically by the `fix` constructor option. * `fixableWarningCount` (`number`)
    @@ -389,6 +367,33 @@ The `LintMessage` value is the information of each linting error. The `messages` * `suggestions` (`{ desc: string; fix: EditInfo }[] | undefined`)
    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`)
    + Same as `ruleId` in [LintMessage] type. +* `severity` (`1 | 2`)
    + Same as `severity` in [LintMessage] type. +* `fatal` (`boolean | undefined`)
    + Same as `fatal` in [LintMessage] type. +* `message` (`string`)
    + Same as `message` in [LintMessage] type. +* `line` (`number | undefined`)
    + Same as `line` in [LintMessage] type. +* `column` (`number | undefined`)
    + Same as `column` in [LintMessage] type. +* `endLine` (`number | undefined`)
    + Same as `endLine` in [LintMessage] type. +* `endColumn` (`number | undefined`)
    + Same as `endColumn` in [LintMessage] type. +* `fix` (`EditInfo | undefined`)
    + Same as `fix` in [LintMessage] type. +* `suggestions` (`{ desc: string; fix: EditInfo }[] | undefined`)
    + Same as `suggestions` in [LintMessage] type. +* `suppressions` (`{ kind: string; justification: string}[]`)
    + 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: @@ -400,12 +405,12 @@ The `EditInfo` value is information to edit text. The `fix` and `suggestions` pr 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 +### ◆ LoadedFormatter 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: +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`)
    - The method to convert the [LintResult] objects to text. +* `format` (`(results: LintResult[], resultsMeta: ResultsMeta) => string | Promise`)
    + The method to convert the [LintResult] objects to text. `resultsMeta` is an object that will contain a `maxWarningsExceeded` object if `--max-warnings` was set and the number of warnings exceeded the limit. The `maxWarningsExceeded` object will contain two properties: `maxWarnings`, the value of the `--max-warnings` option, and `foundWarnings`, the number of lint warnings. --- @@ -458,11 +463,11 @@ const codeLines = SourceCode.splitLines(code); ## 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` 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) 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. +* `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: @@ -484,8 +489,8 @@ The most important method on `Linter` is `verify()`, which initiates linting of * **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. + * `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. @@ -549,7 +554,23 @@ The information available for each linting message is: * `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)). +* `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. @@ -665,7 +686,7 @@ Map { ### 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. +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; @@ -896,22 +917,14 @@ ruleTester.run("my-rule", myRule, { --- -[configuration object]: ../user-guide/configuring +[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 +[third-party-formatters]: https://www.npmjs.com/search?q=eslintformatter [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 -[formatter]: #-formatter-type -[linter]: #linter +[loadedformatter]: #-loadedformatter-type diff --git a/docs/src/developer-guide/package-json-conventions.md b/docs/src/developer-guide/package-json-conventions.md new file mode 100644 index 000000000000..654b9d7ad0db --- /dev/null +++ b/docs/src/developer-guide/package-json-conventions.md @@ -0,0 +1,88 @@ +--- +title: Package.json Conventions +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/docs/developer-guide/scope-manager-interface.md b/docs/src/developer-guide/scope-manager-interface.md similarity index 98% rename from docs/developer-guide/scope-manager-interface.md rename to docs/src/developer-guide/scope-manager-interface.md index 2762f74eace7..60e26431c0c9 100644 --- a/docs/developer-guide/scope-manager-interface.md +++ b/docs/src/developer-guide/scope-manager-interface.md @@ -1,4 +1,7 @@ -# ScopeManager +--- +title: 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. @@ -204,6 +207,11 @@ Those members are defined but not used in ESLint. * **Type:** `string` * **Description:** The name of this variable. +#### scope + +* **Type:** `Scope` +* **Description:** The scope in which this variable is defined. + #### identifiers * **Type:** `ASTNode[]` diff --git a/docs/developer-guide/selectors.md b/docs/src/developer-guide/selectors.md similarity index 94% rename from docs/developer-guide/selectors.md rename to docs/src/developer-guide/selectors.md index 78bb26084266..e06098641097 100644 --- a/docs/developer-guide/selectors.md +++ b/docs/src/developer-guide/selectors.md @@ -1,10 +1,13 @@ -# Selectors +--- +title: 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 +2. Describe the syntax for creating selectors +3. Describe what selectors can be used for ## What is a selector? @@ -90,7 +93,7 @@ If multiple selectors have equal specificity, their listeners will be called in ### 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: +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 { diff --git a/docs/developer-guide/shareable-configs.md b/docs/src/developer-guide/shareable-configs.md similarity index 97% rename from docs/developer-guide/shareable-configs.md rename to docs/src/developer-guide/shareable-configs.md index 15032d9e7a0d..ca42eafa69d5 100644 --- a/docs/developer-guide/shareable-configs.md +++ b/docs/src/developer-guide/shareable-configs.md @@ -1,4 +1,12 @@ -# Shareable Configs +--- +title: Shareable Configs +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. diff --git a/docs/developer-guide/source-code.md b/docs/src/developer-guide/source-code.md similarity index 77% rename from docs/developer-guide/source-code.md rename to docs/src/developer-guide/source-code.md index a6b7fa5b1d72..4ddc9a8ba941 100644 --- a/docs/developer-guide/source-code.md +++ b/docs/src/developer-guide/source-code.md @@ -1,12 +1,22 @@ -# Source Code +--- +title: Source Code +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/). +--- + +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 . 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 +```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. +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 . After forking the ESLint repository, you'll want to create a local copy of your fork. ## Start Developing @@ -17,8 +27,10 @@ Before you can get started developing, you'll need to have a couple of things in 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 +```shell +cd eslint +npm install +``` Now when you run `eslint`, it will be running your local copy and showing your changes. diff --git a/docs/developer-guide/unit-tests.md b/docs/src/developer-guide/unit-tests.md similarity index 80% rename from docs/developer-guide/unit-tests.md rename to docs/src/developer-guide/unit-tests.md index 46d77b59076c..730642f624bc 100644 --- a/docs/developer-guide/unit-tests.md +++ b/docs/src/developer-guide/unit-tests.md @@ -1,10 +1,20 @@ -# Unit Tests +--- +title: Unit Tests +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: - npm test +```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. @@ -12,7 +22,9 @@ This automatically starts Mocha and runs all tests in the `tests` directory. You 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 +```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: @@ -37,3 +49,9 @@ Running individual tests is useful when you're working on a specific bug and ite ## 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/docs/developer-guide/working-with-custom-formatters.md b/docs/src/developer-guide/working-with-custom-formatters.md similarity index 91% rename from docs/developer-guide/working-with-custom-formatters.md rename to docs/src/developer-guide/working-with-custom-formatters.md index e157bb079415..c52d373829d3 100644 --- a/docs/developer-guide/working-with-custom-formatters.md +++ b/docs/src/developer-guide/working-with-custom-formatters.md @@ -1,8 +1,16 @@ -# Working with Custom Formatters +--- +title: Working with Custom Formatters +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 returns a string. For example, the following is how the `json` built-in formatter is implemented: +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 @@ -11,7 +19,7 @@ module.exports = function(results, context) { }; ``` -Formatter can also be an async function (from ESLint v8.4.0), the following shows a simple example: +A formatter can also be an async function (from ESLint v8.4.0), the following shows a simple example: ```js //my-awesome-formatter.js @@ -120,16 +128,21 @@ Each `message` object contains information about the ESLint rule that was trigge ## The `context` Argument -The formatter function receives an object as the second argument. The object has two properties: +The formatter function receives an object as the second argument. The object has the following 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. +* `cwd` ... The current working directory. This value comes from the `cwd` constructor option of the [ESLint](nodejs-api#-new-eslintoptions) class. +* `maxWarningsExceeded` (optional): If `--max-warnings` was set and the number of warnings exceeded the limit, this property's value will be an object containing two properties: `maxWarnings`, the value of the `--max-warnings` option, and `foundWarnings`, the number of lint warnings. +* `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", + maxWarningsExceeded: { + maxWarnings: 5, + foundWarnings: 6 + }, rulesMeta: { "no-extra-semi": { type: "suggestion", @@ -144,7 +157,7 @@ For example, here's what the object would look like if one rule, `no-extra-semi` unexpected: "Unnecessary semicolon." } } - } + }, } ``` @@ -280,7 +293,7 @@ warning no-unused-vars (https://eslint.org/docs/rules/no-unused-vars) ## 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. +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 diff --git a/docs/developer-guide/working-with-custom-parsers.md b/docs/src/developer-guide/working-with-custom-parsers.md similarity index 91% rename from docs/developer-guide/working-with-custom-parsers.md rename to docs/src/developer-guide/working-with-custom-parsers.md index 6387b848584c..a2b47c53f035 100644 --- a/docs/developer-guide/working-with-custom-parsers.md +++ b/docs/src/developer-guide/working-with-custom-parsers.md @@ -1,10 +1,18 @@ -# Working with Custom Parsers +--- +title: Working with Custom Parsers +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.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). +* `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. diff --git a/docs/developer-guide/working-with-plugins.md b/docs/src/developer-guide/working-with-plugins.md similarity index 94% rename from docs/developer-guide/working-with-plugins.md rename to docs/src/developer-guide/working-with-plugins.md index bea47021932f..f33cf4b37544 100644 --- a/docs/developer-guide/working-with-plugins.md +++ b/docs/src/developer-guide/working-with-plugins.md @@ -1,4 +1,12 @@ -# Working with Plugins +--- +title: Working with Plugins +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-`, such as `eslint-plugin-jquery`. You can also use scoped packages in the format of `@/eslint-plugin-` such as `@jquery/eslint-plugin-jquery` or even `@/eslint-plugin` such as `@jquery/eslint-plugin`. @@ -84,7 +92,7 @@ module.exports = { **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. +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. @@ -136,7 +144,7 @@ overrides: processor: a-plugin/markdown ``` -See [Specifying Processor](../user-guide/configuring/plugins.md#specifying-processor) for details. +See [Specifying Processor](../user-guide/configuring/plugins#specifying-processor) for details. #### File Extension-named Processor @@ -197,7 +205,7 @@ If the example plugin above were called `eslint-plugin-myPlugin`, the `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. +**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 @@ -214,7 +222,7 @@ The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDep ### Testing -ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api.md#ruletester) utility to make it easy to test the rules of your plugin. +ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to test the rules of your plugin. ### Linting diff --git a/docs/developer-guide/working-with-rules-deprecated.md b/docs/src/developer-guide/working-with-rules-deprecated.md similarity index 98% rename from docs/developer-guide/working-with-rules-deprecated.md rename to docs/src/developer-guide/working-with-rules-deprecated.md index 63d7bb2fc691..b2fb8522ff4c 100644 --- a/docs/developer-guide/working-with-rules-deprecated.md +++ b/docs/src/developer-guide/working-with-rules-deprecated.md @@ -1,6 +1,9 @@ -# Working with Rules (Deprecated) +--- +title: 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). +--- + +**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`). @@ -34,17 +37,17 @@ 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) +`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.md) +* 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.md) rule: +Here are methods for the [array-callback-return](../rules/array-callback-return) rule: ```js function checkLastSegment (node) { @@ -74,7 +77,7 @@ module.exports = function(context) { 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)). +* `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. @@ -87,7 +90,7 @@ Additionally, the `context` object has the following methods: * `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. +* `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: @@ -324,7 +327,7 @@ Keep in mind that comments are technically not a part of the AST and are only at 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) +[details here](./code-path-analysis) ## Rule Unit Tests @@ -478,7 +481,7 @@ valid: [ ] ``` -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). +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 @@ -574,4 +577,4 @@ Runtime rules are written in the same format as all other rules. Create your rul 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. +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/docs/developer-guide/working-with-rules.md b/docs/src/developer-guide/working-with-rules.md similarity index 88% rename from docs/developer-guide/working-with-rules.md rename to docs/src/developer-guide/working-with-rules.md index 697b7ed8bff1..a11617239ac6 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/src/developer-guide/working-with-rules.md @@ -1,12 +1,20 @@ -# Working with Rules +--- +title: Working with Rules +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.md). +--- + +**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/rules` directory: a Markdown documentation file (for example, `no-extra-semi.md`) +* 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. @@ -31,7 +39,6 @@ module.exports = { docs: { description: "disallow unnecessary semicolons", - category: "Possible Errors", recommended: true, url: "https://eslint.org/docs/rules/no-extra-semi" }, @@ -60,13 +67,12 @@ The source file for a rule exports an object with the following properties. * `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 + * `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.md#--fix) automatically fixes problems reported by the rule +* `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. @@ -74,7 +80,7 @@ The source file for a rule exports an object with the following properties. **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) +* `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. @@ -82,13 +88,13 @@ The source file for a rule exports an object with the following properties. `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) +* 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.md) rule: +Here are methods for the [array-callback-return](../rules/array-callback-return) rule: ```js function checkLastSegment (node) { @@ -121,18 +127,18 @@ module.exports = { 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)). +* `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.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. +* `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.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. +* `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. @@ -144,16 +150,20 @@ Additionally, the `context` object has the following methods: * 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 `` 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. +* `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.md) rule. Returns `true` if a variable with the given name was found and marked as used, otherwise `false`. +* `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: +This method returns the scope of the current node. It is a useful method for finding information about the variables in a given scope, and how they are used in other scopes. + +#### Scope types + +The following table contains a list of AST node types and the scope type that they correspond to. For more information about the scope types, refer to the [`Scope` object documentation](./scope-manager-interface.md#scope-interface). | AST Node Type | Scope Type | |:--------------------------|:-----------| @@ -176,12 +186,25 @@ This method returns the scope which has the following types: **※2** Only if the `for` statement defines the iteration variable as a block-scoped variable (E.g., `for (let i = 0;;) {}`).
    **※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. +#### Scope Variables + +The `Scope#variables` property contains an array of [`Variable` objects](./scope-manager-interface#variable-interface). These are the variables declared in current scope. You can use these `Variable` objects to track references to a variable throughout the entire module. + +Inside of each `Variable`, the `Variable#references` property contains an array of [`Reference` objects](./scope-manager-interface#reference-interface). The `Reference` array contains all the locations where the variable is referenced in the module's source code. + +Also inside of each `Variable`, the `Variable#defs` property contains an array of [`Definition` objects](./scope-manager-interface#definition-interface). You can use the `Definitions` to find where the variable was defined. -* `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. +Global variables have the following 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. + +For examples of using `context.getScope()` to track variables, refer to the source code for the following built-in rules: + +* [no-shadow](https://github.com/eslint/eslint/blob/main/lib/rules/no-shadow.js): Calls `context.getScopes()` at the global scope and parses all child scopes to make sure a variable name is not reused at a lower scope. ([no-shadow](../rules/no-shadow) documentation) +* [no-redeclare](https://github.com/eslint/eslint/blob/main/lib/rules/no-redeclare.js): Calls `context.getScope()` at each scope to make sure that a variable is not declared twice at that scope. ([no-redeclare](../rules/no-redeclare) documentation) ### context.report() @@ -328,7 +351,7 @@ The `fix()` function can return the following values: * 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. +If you make a `fix()` function which returns multiple `fixing` objects, those `fixing` objects must not overlap. Best practices for fixes: @@ -350,7 +373,7 @@ Best practices for fixes: ({ "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. + * 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. @@ -370,6 +393,13 @@ context.report({ }); ``` +#### Conflicting Fixes + +Conflicting fixes are fixes that apply different changes to the same part of the source code. +There is no way to specify which of the conflicting fixes is applied. + +For example, if two fixes want to modify characters 0 through 5, only one is applied. + ### 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. @@ -536,7 +566,6 @@ Once you have an instance of `SourceCode`, you can use the following methods on * `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. @@ -579,7 +608,7 @@ 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. +* `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. @@ -593,6 +622,7 @@ Please note that the following methods have been deprecated and will be removed * `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 @@ -678,13 +708,13 @@ Shebangs are represented by tokens of type `"Shebang"`. They are treated as comm 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) +[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.md#ruletester) utility to make it easy to write tests for rules. +ESLint provides the [`RuleTester`](/docs/developer-guide/nodejs-api#ruletester) utility to make it easy to write tests for rules. ## Performance Testing @@ -722,7 +752,7 @@ 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. +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 @@ -767,4 +797,4 @@ Runtime rules are written in the same format as all other rules. Create your rul 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. +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/docs/src/library/alert.md b/docs/src/library/alert.md new file mode 100644 index 000000000000..cefd830407cf --- /dev/null +++ b/docs/src/library/alert.md @@ -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/docs/src/library/buttons.md b/docs/src/library/buttons.md new file mode 100644 index 000000000000..45bf205f546d --- /dev/null +++ b/docs/src/library/buttons.md @@ -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 ``. + +The button macro will default to `link`, which will render an <a> 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 `