From 17b65ad10d653bb05077f21d8b1f79bee96e38d8 Mon Sep 17 00:00:00 2001 From: Ben Perlmutter <57849986+bpmutter@users.noreply.github.com> Date: Sat, 14 Jan 2023 22:52:05 -0500 Subject: [PATCH] docs: IA Update page URL move (#16665) * docs: initial IA move * initial path rename * Second pass * Fix /use/ links * allow crawling * trigger deploy * Additional fixes * Remove todo * more link fixes * Fix link * fix more broken links * fix more broken links * remove noindex * Fix broken link * fix broken link * remove unused files * Change links outside of docs so no redirects * undo mistake * Apply suggestions from code review Co-authored-by: Amaresh S M * remove empty file * integrate getting started changes * add files to delete * remove unwanted files * move nodejs-api to integrate section && update links * move code-path-analysis to extend section && update links * Apply suggestions from code review Co-authored-by: Nicholas C. Zakas * Update docs/src/use/configure/configuration-files.md Co-authored-by: Nicholas C. Zakas * fix migrating link * fix additional broken link * ignore-code -> ignore * unit-tests -> tests * manage-pull-requests -> review-pull-requests * migrating-to-8.0.0 -> migrate-to-8.0.0 * move governance to contribute * Apply suggestions from code review Co-authored-by: Milos Djermanovic * fix broken link * Update docs/src/use/migrating-to-5.0.0.md Co-authored-by: Milos Djermanovic * add /latest/ to absolute URL paths * remove /latest/ from rules link * Additional fixes * Revert changes nec for link checking Co-authored-by: Amaresh S M Co-authored-by: Nicholas C. Zakas Co-authored-by: Milos Djermanovic --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- CONTRIBUTING.md | 12 ++++---- Makefile.js | 2 +- README.md | 24 ++++++++-------- conf/rule-type-list.json | 4 +-- docs/package.json | 1 + docs/src/_data/links.json | 11 +++----- docs/src/_data/rules.json | 4 +-- .../components/rule-categories.macro.html | 6 ++-- .../architecture/index.md | 0 .../code-conventions.md | 0 .../development-environment.md | 2 +- .../governance.md | 12 ++++---- .../contributing => contribute}/index.md | 10 +++---- .../package-json-conventions.md | 2 +- .../propose-new-rule.md} | 2 +- .../propose-rule-change.md} | 2 +- .../pull-requests.md | 12 ++++---- .../report-bugs.md} | 0 .../request-change.md} | 0 .../source-code.md | 0 .../unit-tests.md => contribute/tests.md} | 0 .../work-on-issue.md} | 4 +-- .../code-path-analysis.md | 0 .../custom-formatters.md} | 6 ++-- .../custom-parsers.md} | 0 .../custom-rules-deprecated.md} | 16 +++++------ .../custom-rules.md} | 28 +++++++++---------- docs/src/{developer-guide => extend}/index.md | 16 +++++------ .../plugins.md} | 8 +++--- .../scope-manager-interface.md | 0 .../{developer-guide => extend}/selectors.md | 0 .../shareable-configs.md | 0 .../nodejs-api.md | 16 +++++------ .../{maintainer-guide => maintain}/index.md | 8 +++--- .../issues.md => maintain/manage-issues.md} | 0 .../manage-releases.md} | 0 .../review-pull-requests.md} | 0 .../working-groups.md | 0 docs/src/pages/index.md | 9 +++--- docs/src/rules/id-denylist.md | 2 +- docs/src/rules/indent.md | 2 +- docs/src/rules/no-global-assign.md | 4 +-- docs/src/rules/no-implicit-globals.md | 4 +-- docs/src/rules/no-native-reassign.md | 4 +-- docs/src/rules/no-restricted-syntax.md | 2 +- docs/src/rules/no-undef.md | 4 +-- docs/src/rules/rest-spread-spacing.md | 2 +- docs/src/rules/space-after-keywords.md | 2 +- docs/src/rules/space-before-keywords.md | 2 +- docs/src/rules/space-return-throw-case.md | 2 +- docs/src/rules/strict.md | 8 +++--- .../command-line-interface.md | 8 +++--- .../configure}/configuration-files-new.md | 0 .../configure}/configuration-files.md | 6 ++-- .../configure/ignore.md} | 2 +- .../configuring => use/configure}/index.md | 12 ++++---- .../configure}/language-options.md | 0 .../configuring => use/configure}/plugins.md | 2 +- .../configuring => use/configure}/rules.md | 0 docs/src/{user-guide => use}/core-concepts.md | 8 +++--- .../formatters/html-formatter-example.html | 0 .../formatters/html-formatter-example.json | 0 .../{user-guide => use}/formatters/index.md | 4 +-- .../{user-guide => use}/getting-started.md | 12 ++++---- docs/src/{user-guide => use}/index.md | 6 ++-- docs/src/{user-guide => use}/integrations.md | 2 +- .../migrate-to-8.0.0.md} | 8 +++--- .../migrating-from-jscs.md | 2 +- .../{user-guide => use}/migrating-to-1.0.0.md | 0 .../{user-guide => use}/migrating-to-2.0.0.md | 0 .../{user-guide => use}/migrating-to-3.0.0.md | 0 .../{user-guide => use}/migrating-to-4.0.0.md | 2 +- .../{user-guide => use}/migrating-to-5.0.0.md | 10 +++---- .../{user-guide => use}/migrating-to-6.0.0.md | 6 ++-- .../{user-guide => use}/migrating-to-7.0.0.md | 4 +-- .../{user-guide => use}/rule-deprecation.md | 0 .../formatters/formatters-meta.json | 4 +-- lib/rule-tester/flat-rule-tester.js | 2 +- lib/rule-tester/rule-tester.js | 6 ++-- messages/print-config-with-directory-path.js | 2 +- packages/eslint-config-eslint/README.md | 2 +- templates/blogpost.md.ejs | 2 +- tests/lib/rule-tester/rule-tester.js | 10 +++---- tools/fetch-docs-links.js | 2 +- 85 files changed, 189 insertions(+), 192 deletions(-) rename docs/src/{developer-guide => contribute}/architecture/index.md (100%) rename docs/src/{developer-guide => contribute}/code-conventions.md (100%) rename docs/src/{developer-guide => contribute}/development-environment.md (98%) rename docs/src/{maintainer-guide => contribute}/governance.md (97%) rename docs/src/{developer-guide/contributing => contribute}/index.md (92%) rename docs/src/{developer-guide => contribute}/package-json-conventions.md (97%) rename docs/src/{developer-guide/contributing/new-rules.md => contribute/propose-new-rule.md} (96%) rename docs/src/{developer-guide/contributing/rule-changes.md => contribute/propose-rule-change.md} (94%) rename docs/src/{developer-guide/contributing => contribute}/pull-requests.md (93%) rename docs/src/{developer-guide/contributing/reporting-bugs.md => contribute/report-bugs.md} (100%) rename docs/src/{developer-guide/contributing/changes.md => contribute/request-change.md} (100%) rename docs/src/{developer-guide => contribute}/source-code.md (100%) rename docs/src/{developer-guide/unit-tests.md => contribute/tests.md} (100%) rename docs/src/{developer-guide/contributing/working-on-issues.md => contribute/work-on-issue.md} (92%) rename docs/src/{developer-guide => extend}/code-path-analysis.md (100%) rename docs/src/{developer-guide/working-with-custom-formatters.md => extend/custom-formatters.md} (97%) rename docs/src/{developer-guide/working-with-custom-parsers.md => extend/custom-parsers.md} (100%) rename docs/src/{developer-guide/working-with-rules-deprecated.md => extend/custom-rules-deprecated.md} (96%) rename docs/src/{developer-guide/working-with-rules.md => extend/custom-rules.md} (96%) rename docs/src/{developer-guide => extend}/index.md (79%) rename docs/src/{developer-guide/working-with-plugins.md => extend/plugins.md} (95%) rename docs/src/{developer-guide => extend}/scope-manager-interface.md (100%) rename docs/src/{developer-guide => extend}/selectors.md (100%) rename docs/src/{developer-guide => extend}/shareable-configs.md (100%) rename docs/src/{developer-guide => integrate}/nodejs-api.md (97%) rename docs/src/{maintainer-guide => maintain}/index.md (79%) rename docs/src/{maintainer-guide/issues.md => maintain/manage-issues.md} (100%) rename docs/src/{maintainer-guide/releases.md => maintain/manage-releases.md} (100%) rename docs/src/{maintainer-guide/pullrequests.md => maintain/review-pull-requests.md} (100%) rename docs/src/{maintainer-guide => maintain}/working-groups.md (100%) rename docs/src/{user-guide => use}/command-line-interface.md (97%) rename docs/src/{user-guide/configuring => use/configure}/configuration-files-new.md (100%) rename docs/src/{user-guide/configuring => use/configure}/configuration-files.md (96%) rename docs/src/{user-guide/configuring/ignoring-code.md => use/configure/ignore.md} (98%) rename docs/src/{user-guide/configuring => use/configure}/index.md (87%) rename docs/src/{user-guide/configuring => use/configure}/language-options.md (100%) rename docs/src/{user-guide/configuring => use/configure}/plugins.md (98%) rename docs/src/{user-guide/configuring => use/configure}/rules.md (100%) rename docs/src/{user-guide => use}/core-concepts.md (93%) rename docs/src/{user-guide => use}/formatters/html-formatter-example.html (100%) rename docs/src/{user-guide => use}/formatters/html-formatter-example.json (100%) rename docs/src/{user-guide => use}/formatters/index.md (99%) rename docs/src/{user-guide => use}/getting-started.md (91%) rename docs/src/{user-guide => use}/index.md (92%) rename docs/src/{user-guide => use}/integrations.md (97%) rename docs/src/{user-guide/migrating-to-8.0.0.md => use/migrate-to-8.0.0.md} (95%) rename docs/src/{user-guide => use}/migrating-from-jscs.md (95%) rename docs/src/{user-guide => use}/migrating-to-1.0.0.md (100%) rename docs/src/{user-guide => use}/migrating-to-2.0.0.md (100%) rename docs/src/{user-guide => use}/migrating-to-3.0.0.md (100%) rename docs/src/{user-guide => use}/migrating-to-4.0.0.md (99%) rename docs/src/{user-guide => use}/migrating-to-5.0.0.md (97%) rename docs/src/{user-guide => use}/migrating-to-6.0.0.md (98%) rename docs/src/{user-guide => use}/migrating-to-7.0.0.md (97%) rename docs/src/{user-guide => use}/rule-deprecation.md (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8c4bf8eb1b7..35d24100191 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -31,7 +31,7 @@ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40163d86847..07597a76ed6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,18 +10,18 @@ This project adheres to the [Open JS Foundation Code of Conduct](https://eslint. Before filing an issue, please be sure to read the guidelines for what you're reporting: -* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) -* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules) -* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes) -* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes) +* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs) +* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule) +* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change) +* [Request a Change](https://eslint.org/docs/latest/contribute/request-change) To report a security vulnerability in ESLint, please use our [HackerOne program](https://hackerone.com/eslint). ## Contributing Code -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 .) Also, please read over the [Pull Request Guidelines](https://eslint.org/docs/developer-guide/contributing/pull-requests). +In order to submit code or documentation to an ESLint project, you’ll be asked to sign our CLA when you send your first pull request. (Read more about the Open JS Foundation CLA process at .) Also, please read over the [Pull Request Guidelines](https://eslint.org/docs/latest/contribute/pull-requests). ## Full Documentation Our full contribution guidelines can be found at: - + diff --git a/Makefile.js b/Makefile.js index 4bf2c580645..93fd0476b88 100644 --- a/Makefile.js +++ b/Makefile.js @@ -167,7 +167,7 @@ function generateBlogPost(releaseInfo, prereleaseMajorVersion) { */ function generateFormatterExamples(formatterInfo) { const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo); - const outputDir = path.join(DOCS_SRC_DIR, "user-guide/formatters/"), + const outputDir = path.join(DOCS_SRC_DIR, "use/formatters/"), filename = path.join(outputDir, "index.md"), htmlFilename = path.join(outputDir, "html-formatter-example.html"); diff --git a/README.md b/README.md index fb176592457..95f4bfe56e6 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ # ESLint [Website](https://eslint.org) | -[Configuring](https://eslint.org/docs/user-guide/configuring) | +[Configuring](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | -[Contributing](https://eslint.org/docs/developer-guide/contributing) | -[Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) | +[Contributing](https://eslint.org/docs/latest/contribute) | +[Reporting Bugs](https://eslint.org/docs/latest/contribute/report-bugs) | [Code of Conduct](https://eslint.org/conduct) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | @@ -76,7 +76,7 @@ The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/do * `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) * `"error"` or `2` - turn the rule on as an error (exit code will be 1) -The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)). +The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/latest/use/configure)). ## Code of Conduct @@ -86,10 +86,10 @@ ESLint adheres to the [JS Foundation Code of Conduct](https://eslint.org/conduct Before filing an issue, please be sure to read the guidelines for what you're reporting: -* [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) -* [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules) -* [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes) -* [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes) +* [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs) +* [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule) +* [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change) +* [Request a Change](https://eslint.org/docs/latest/contribute/request-change) ## Frequently Asked Questions @@ -97,7 +97,7 @@ Before filing an issue, please be sure to read the guidelines for what you're re Yes. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life) and is no longer supported. -We have prepared a [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration. +We have prepared a [migration guide](https://eslint.org/docs/latest/use/migrating-from-jscs) to help you convert your JSCS settings to an ESLint configuration. We are now at or near 100% compatibility with JSCS. If you try ESLint and believe we are not yet compatible with a JSCS rule/configuration, please create an issue (mentioning that it is a JSCS compatibility issue) and we will evaluate it as per our normal process. @@ -113,11 +113,11 @@ No, ESLint does both traditional linting (looking for problematic patterns) and ### Does ESLint support JSX? -Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. +Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. ### What ECMAScript versions does ESLint support? -ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring). +ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/latest/use/configure). ### What about experimental features? @@ -125,7 +125,7 @@ ESLint's parser only officially supports the latest final ECMAScript standard. W 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. +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/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature. ### Where to ask for help? diff --git a/conf/rule-type-list.json b/conf/rule-type-list.json index f362aa412f9..517f8219166 100644 --- a/conf/rule-type-list.json +++ b/conf/rule-type-list.json @@ -6,12 +6,12 @@ ], "deprecated": { "name": "Deprecated", - "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", + "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", "rules": [] }, "removed": { "name": "Removed", - "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", + "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"] }, diff --git a/docs/package.json b/docs/package.json index bce43092f77..5423914e0bc 100644 --- a/docs/package.json +++ b/docs/package.json @@ -54,3 +54,4 @@ "node": ">=14.0.0" } } + diff --git a/docs/src/_data/links.json b/docs/src/_data/links.json index 84374f9de97..e8cdc8b6c69 100644 --- a/docs/src/_data/links.json +++ b/docs/src/_data/links.json @@ -4,20 +4,17 @@ "chat": "https://eslint.org/chat", "group": "https://groups.google.com/group/eslint", "mastodon": "https://fosstodon.org/@eslint", - "blog": "/blog", "docs": "/docs/latest/", "playground": "/play", - "getStarted": "/docs/latest/user-guide/getting-started", + "getStarted": "/docs/latest/use/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#fix-problems", - + "configuring": "https://eslint.org/docs/latest/use/configure/", + "fixProblems": "https://eslint.org/docs/latest/use/command-line-interface#fix-problems", "donate": "/donate", "openCollective": "https://opencollective.com/eslint", "githubSponsors": "https://github.com/sponsors/eslint" -} +} \ No newline at end of file diff --git a/docs/src/_data/rules.json b/docs/src/_data/rules.json index 742567f7d24..5b9d2e21ff3 100644 --- a/docs/src/_data/rules.json +++ b/docs/src/_data/rules.json @@ -1893,7 +1893,7 @@ ], "deprecated": { "name": "Deprecated", - "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", + "description": "These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules:", "rules": [ { "name": "callback-return", @@ -2009,7 +2009,7 @@ }, "removed": { "name": "Removed", - "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", + "description": "These rules from older versions of ESLint (before the deprecation policy existed) have been replaced by newer rules:", "rules": [ { "removed": "generator-star", diff --git a/docs/src/_includes/components/rule-categories.macro.html b/docs/src/_includes/components/rule-categories.macro.html index f59f20c2735..193f6def64e 100644 --- a/docs/src/_includes/components/rule-categories.macro.html +++ b/docs/src/_includes/components/rule-categories.macro.html @@ -5,7 +5,7 @@
Recommended

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

{%- endif -%} @@ -13,7 +13,7 @@
🔧 Fixable

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

{%- endif -%} @@ -21,7 +21,7 @@
💡 hasSuggestions

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

{%- endif -%} diff --git a/docs/src/developer-guide/architecture/index.md b/docs/src/contribute/architecture/index.md similarity index 100% rename from docs/src/developer-guide/architecture/index.md rename to docs/src/contribute/architecture/index.md diff --git a/docs/src/developer-guide/code-conventions.md b/docs/src/contribute/code-conventions.md similarity index 100% rename from docs/src/developer-guide/code-conventions.md rename to docs/src/contribute/code-conventions.md diff --git a/docs/src/developer-guide/development-environment.md b/docs/src/contribute/development-environment.md similarity index 98% rename from docs/src/developer-guide/development-environment.md rename to docs/src/contribute/development-environment.md index f55da6ac845..6a0d2951fd3 100644 --- a/docs/src/developer-guide/development-environment.md +++ b/docs/src/contribute/development-environment.md @@ -71,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). +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](./pull-requests). ### Build Scripts diff --git a/docs/src/maintainer-guide/governance.md b/docs/src/contribute/governance.md similarity index 97% rename from docs/src/maintainer-guide/governance.md rename to docs/src/contribute/governance.md index 6b77d9f8952..7f59b210ff0 100644 --- a/docs/src/maintainer-guide/governance.md +++ b/docs/src/contribute/governance.md @@ -28,7 +28,7 @@ As Contributors gain experience and familiarity with the project, their profile ### Website Team Member -Website Team Members are community members who have shown that they are committed to the continued maintenance of [eslint.org](https://eslint.org/) through ongoing engagement with the community. Website Team Members are given push access to the `eslint.org` GitHub repository and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/). +Website Team Members are community members who have shown that they are committed to the continued maintenance of [eslint.org](https://eslint.org/) through ongoing engagement with the community. Website Team Members are given push access to the `eslint.org` GitHub repository and must abide by the project's [Contribution Guidelines](../contribute/). Website Team Members: @@ -36,8 +36,8 @@ Website Team Members are community members who have shown that they are committe * Are expected to delete their public branches when they are no longer necessary. * Must submit pull requests for all changes. * Have their work reviewed by Reviewers and TSC members before acceptance into the repository. -* May label and close website-related issues (see [Managing Issues](issues)) -* May merge some pull requests (see [Managing Pull Requests](pullrequests)) +* May label and close website-related issues (see [Managing Issues](../maintain/manage-issues)) +* May merge some pull requests (see [Managing Pull Requests](../maintain/review-pull-requests)) To become a Website Team Member: @@ -51,7 +51,7 @@ It is important to recognize that membership on the website team is a privilege, ### Committers -Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../developer-guide/contributing/). +Committers are community members who have shown that they are committed to the continued development of the project through ongoing engagement with the community. Committers are given push access to the project's GitHub repos and must abide by the project's [Contribution Guidelines](../contribute/). Committers: @@ -59,8 +59,8 @@ Committers: * Are expected to delete their public branches when they are no longer necessary. * Must submit pull requests for all changes. * Have their work reviewed by TSC members before acceptance into the repository. -* May label and close issues (see [Managing Issues](issues)) -* May merge some pull requests (see [Managing Pull Requests](pullrequests)) +* May label and close issues (see [Managing Issues](../maintain/manage-issues)) +* May merge some pull requests (see [Managing Pull Requests](../maintain/review-pull-requests)) To become a Committer: diff --git a/docs/src/developer-guide/contributing/index.md b/docs/src/contribute/index.md similarity index 92% rename from docs/src/developer-guide/contributing/index.md rename to docs/src/contribute/index.md index 2af9df41d0e..8e5a76ce029 100644 --- a/docs/src/developer-guide/contributing/index.md +++ b/docs/src/contribute/index.md @@ -16,19 +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. -## [Bug Reporting](reporting-bugs) +## [Bug Reporting](report-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) +## Proposing a [New Rule](propose-new-rule) 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) +## Proposing a [Rule Change](propose-rule-change) Want to make a change to an existing rule? This section explains the process and how we evaluate such proposals. -## Requesting a [Change](changes) +## Requesting a [Change](request-change) If you'd like to request a change other than a bug fix or new rule, this section explains that process. @@ -36,7 +36,7 @@ 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) +## [Working on Issues](work-on-issue) Have some extra time and want to contribute? This section talks about the process of working on issues. diff --git a/docs/src/developer-guide/package-json-conventions.md b/docs/src/contribute/package-json-conventions.md similarity index 97% rename from docs/src/developer-guide/package-json-conventions.md rename to docs/src/contribute/package-json-conventions.md index 3d38adecd2b..99afe8b2222 100644 --- a/docs/src/developer-guide/package-json-conventions.md +++ b/docs/src/contribute/package-json-conventions.md @@ -1,6 +1,6 @@ --- title: Package.json Conventions -edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/package-json-conventions.md +edit_link: https://github.com/eslint/eslint/edit/main/docs/src/contribute/package-json-conventions.md --- The following applies to the "scripts" section of `package.json` files. diff --git a/docs/src/developer-guide/contributing/new-rules.md b/docs/src/contribute/propose-new-rule.md similarity index 96% rename from docs/src/developer-guide/contributing/new-rules.md rename to docs/src/contribute/propose-new-rule.md index 28514e85c75..f540f5b8117 100644 --- a/docs/src/developer-guide/contributing/new-rules.md +++ b/docs/src/contribute/propose-new-rule.md @@ -42,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) and [working with plugins](../working-with-plugins) 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](../extend/custom-rules) and [working with plugins](../extend/plugins) documentation for more information. diff --git a/docs/src/developer-guide/contributing/rule-changes.md b/docs/src/contribute/propose-rule-change.md similarity index 94% rename from docs/src/developer-guide/contributing/rule-changes.md rename to docs/src/contribute/propose-rule-change.md index 14de4495df3..ba2738eed8b 100644 --- a/docs/src/developer-guide/contributing/rule-changes.md +++ b/docs/src/contribute/propose-rule-change.md @@ -15,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#core-rule-guidelines) +1. Adhere to the [Core Rule Guidelines](propose-new-rule#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/src/developer-guide/contributing/pull-requests.md b/docs/src/contribute/pull-requests.md similarity index 93% rename from docs/src/developer-guide/contributing/pull-requests.md rename to docs/src/contribute/pull-requests.md index 0690b794e43..ca478f521eb 100644 --- a/docs/src/developer-guide/contributing/pull-requests.md +++ b/docs/src/contribute/pull-requests.md @@ -9,8 +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. 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. +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](./work-on-issue). Bug fixes, documentation changes, and other pull requests do not require an issue. After that, you're ready to start working on code. @@ -42,7 +42,7 @@ 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) 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: ```shell git add -A @@ -75,7 +75,7 @@ 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#issue-labels) to determine the best tag. +Use the [labels of the issue you are working on](work-on-issue#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`. @@ -119,7 +119,7 @@ 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). +* Follow the [Code Conventions](./code-conventions). ### Step 6: Push your changes @@ -179,7 +179,7 @@ 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) 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: ```shell git fetch upstream diff --git a/docs/src/developer-guide/contributing/reporting-bugs.md b/docs/src/contribute/report-bugs.md similarity index 100% rename from docs/src/developer-guide/contributing/reporting-bugs.md rename to docs/src/contribute/report-bugs.md diff --git a/docs/src/developer-guide/contributing/changes.md b/docs/src/contribute/request-change.md similarity index 100% rename from docs/src/developer-guide/contributing/changes.md rename to docs/src/contribute/request-change.md diff --git a/docs/src/developer-guide/source-code.md b/docs/src/contribute/source-code.md similarity index 100% rename from docs/src/developer-guide/source-code.md rename to docs/src/contribute/source-code.md diff --git a/docs/src/developer-guide/unit-tests.md b/docs/src/contribute/tests.md similarity index 100% rename from docs/src/developer-guide/unit-tests.md rename to docs/src/contribute/tests.md diff --git a/docs/src/developer-guide/contributing/working-on-issues.md b/docs/src/contribute/work-on-issue.md similarity index 92% rename from docs/src/developer-guide/contributing/working-on-issues.md rename to docs/src/contribute/work-on-issue.md index 5c929844843..216224b0dd4 100644 --- a/docs/src/developer-guide/contributing/working-on-issues.md +++ b/docs/src/contribute/work-on-issue.md @@ -7,10 +7,10 @@ Our public [issues tracker](https://github.com/eslint/eslint/issues) lists all o ## Issue Labels -We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](../../maintainer-guide/issues#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are: +We use labels to indicate the status of issues. The most complete documentation on the labels is found in the [Maintainer Guide](../maintain/manage-issues#when-an-issue-is-opened), but most contributors should find the information on this page sufficient. The most important questions that labels can help you, as a contributor, answer are: 1. Is this issue available for me to work on? If you have little or no experience contributing to ESLint, the [`good first issue`](https://github.com/eslint/eslint/labels/good%20first%20issue) label marks appropriate issues. Otherwise, the [`help wanted`](https://github.com/eslint/eslint/labels/help%20wanted) label is an invitation to work on the issue. If you have more experience, you can try working on other issues labeled [`accepted`](https://github.com/eslint/eslint/labels/accepted). Conversely, issues not yet ready to work on are labeled `triage`, `evaluating`, and/or `needs bikeshedding`, and issues that cannot currently be worked on because of something else, such as a bug in a dependency, are labeled `blocked`. -1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](../../maintainer-guide/issues#types-of-issues). +1. What is this issue about? Labels describing the nature of issues include `bug`, `enhancement`, `feature`, `question`, `rule`, `documentation`, `core`, `build`, `cli`, `infrastructure`, `breaking`, and `chore`. These are documented in the [Maintainer Guide](../maintain/manage-issues#types-of-issues). 1. What is the priority of this issue? Because we have a lot of issues, we prioritize certain issues above others. The following is the list of priorities, from highest to lowest: 1. **Bugs** - problems with the project are actively affecting users. We want to get these resolved as quickly as possible. diff --git a/docs/src/developer-guide/code-path-analysis.md b/docs/src/extend/code-path-analysis.md similarity index 100% rename from docs/src/developer-guide/code-path-analysis.md rename to docs/src/extend/code-path-analysis.md diff --git a/docs/src/developer-guide/working-with-custom-formatters.md b/docs/src/extend/custom-formatters.md similarity index 97% rename from docs/src/developer-guide/working-with-custom-formatters.md rename to docs/src/extend/custom-formatters.md index 78bcb67abb8..b34baaf250e 100644 --- a/docs/src/developer-guide/working-with-custom-formatters.md +++ b/docs/src/extend/custom-formatters.md @@ -130,9 +130,9 @@ Each `message` object contains information about the ESLint rule that was trigge 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#-new-eslintoptions) class. +* `cwd` ... The current working directory. This value comes from the `cwd` constructor option of the [ESLint](../integrate/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. +* `rulesMeta` ... The `meta` property values of rules. See the [Working with Rules](custom-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: @@ -376,7 +376,7 @@ error semi ### Complex Argument Passing -If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](../user-guide/formatters/) and pipe the output to a second program. For example: +If you find the custom formatter pattern doesn't provide enough options for the way you'd like to format ESLint results, the best option is to use ESLint's built-in [JSON formatter](../use/formatters/) and pipe the output to a second program. For example: ```bash eslint -f json src/ | your-program-that-reads-JSON --option diff --git a/docs/src/developer-guide/working-with-custom-parsers.md b/docs/src/extend/custom-parsers.md similarity index 100% rename from docs/src/developer-guide/working-with-custom-parsers.md rename to docs/src/extend/custom-parsers.md diff --git a/docs/src/developer-guide/working-with-rules-deprecated.md b/docs/src/extend/custom-rules-deprecated.md similarity index 96% rename from docs/src/developer-guide/working-with-rules-deprecated.md rename to docs/src/extend/custom-rules-deprecated.md index b2fb8522ff4..0742233bbab 100644 --- a/docs/src/developer-guide/working-with-rules-deprecated.md +++ b/docs/src/extend/custom-rules-deprecated.md @@ -3,7 +3,7 @@ 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). +**Note:** This page covers the deprecated rule format for ESLint <= 2.13.1. [This is the most recent rule format](./custom-rules). Each rule in ESLint has two files named with its identifier (for example, `no-extra-semi`). @@ -37,13 +37,13 @@ module.exports.schema = []; // no options ## Rule Basics -`schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../user-guide/configuring/rules#configuring-rules) +`schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../use/configure/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) +* 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. @@ -77,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#specifying-parser-options)). +* `parserOptions` - the parser options configured for this run (more details [here](../use/configure/language-options#specifying-parser-options)). * `id` - the rule ID. * `options` - an array of rule options. * `settings` - the `settings` from configuration. @@ -327,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) +[details here](code-path-analysis) ## Rule Unit Tests @@ -481,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#specifying-parser-options). +The options available and the expected syntax for `parserOptions` is the same as those used in [configuration](../use/configure/language-options#specifying-parser-options). ### Write Several Tests @@ -576,5 +576,5 @@ The thing that makes ESLint different from other linters is the ability to defin Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps: 1. Place all of your runtime rules in the same directory (i.e., `eslint_rules`). -2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `1` or `2` in the configuration file. -3. Run the [command line interface](../user-guide/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules. +2. Create a [configuration file](../use/configure/) 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](../use/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules. diff --git a/docs/src/developer-guide/working-with-rules.md b/docs/src/extend/custom-rules.md similarity index 96% rename from docs/src/developer-guide/working-with-rules.md rename to docs/src/extend/custom-rules.md index 0e92ccfe748..8e7632484ad 100644 --- a/docs/src/developer-guide/working-with-rules.md +++ b/docs/src/extend/custom-rules.md @@ -8,7 +8,7 @@ eleventyNavigation: --- -**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). +**Note:** This page covers the most recent rule format for ESLint >= 3.0.0. There is also a [deprecated rule format](./custom-rules-deprecated). Each rule in ESLint has three files named with its identifier (for example, `no-extra-semi`). @@ -67,12 +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/) - * `recommended` (boolean) is whether the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring/configuration-files#extending-configuration-files) enables the rule + * `recommended` (boolean) is whether the `"extends": "eslint:recommended"` property in a [configuration file](../use/configure/configuration-files#extending-configuration-files) enables the rule * `url` (string) specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations) In a custom rule or plugin, you can omit `docs` or include any properties that you need in it. -* `fixable` (string) is either `"code"` or `"whitespace"` if the `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixes problems reported by the rule +* `fixable` (string) is either `"code"` or `"whitespace"` if the `--fix` option on the [command line](../use/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. @@ -80,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#configuring-rules) +* `schema` (array) specifies the [options](#options-schemas) so ESLint can prevent invalid [rule configurations](../use/configure/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. @@ -90,7 +90,7 @@ The source file for a rule exports an object with the following properties. * 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) +* 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. @@ -127,17 +127,17 @@ 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#specifying-parser-options)). +* `parserOptions` - the parser options configured for this run (more details [here](../use/configure/language-options#specifying-parser-options)). * `id` - the rule ID. -* `options` - an array of the [configured options](../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](../user-guide/configuring/configuration-files#adding-shared-settings) from configuration. +* `options` - an array of the [configured options](../use/configure/rules#configuring-rules) for this rule. This array does not include the rule severity. For more information, see [here](#contextoptions). +* `settings` - the [shared settings](../use/configure/configuration-files#adding-shared-settings) from configuration. * `parserPath` - the name of the `parser` from configuration. * `parserServices` - an object containing parser-provided services for rules. The default parser does not provide any services. However, if a rule is intended to be used with a custom parser, it could use `parserServices` to access anything provided by that parser. (For example, a TypeScript parser could provide the ability to get the computed type of a given node.) Additionally, the `context` object has the following methods: * `getAncestors()` - returns an array of the ancestors of the currently-traversed node, starting at the root of the AST and continuing through the direct parent of the current node. This array does not include the currently-traversed node itself. -* `getCwd()` - returns the `cwd` passed to [Linter](./nodejs-api#linter). It is a path to a directory that should be considered as the current working directory. +* `getCwd()` - returns the `cwd` passed to [Linter](../integrate/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. @@ -163,7 +163,7 @@ This method returns the scope of the current node. It is a useful method for fin #### 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). +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#scope-interface). | AST Node Type | Scope Type | |:--------------------------|:-----------| @@ -708,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) +[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`](nodejs-api#ruletester) utility to make it easy to write tests for rules. +ESLint provides the [`RuleTester`](../integrate/nodejs-api#ruletester) utility to make it easy to write tests for rules. ## Performance Testing @@ -796,5 +796,5 @@ The thing that makes ESLint different from other linters is the ability to defin Runtime rules are written in the same format as all other rules. Create your rule as you would any other and then follow these steps: 1. Place all of your runtime rules in the same directory (e.g., `eslint_rules`). -2. Create a [configuration file](../user-guide/configuring/) and specify your rule ID error level under the `rules` key. Your rule will not run unless it has a value of `"warn"` or `"error"` in the configuration file. -3. Run the [command line interface](../user-guide/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules. +2. Create a [configuration file](../use/configure/) 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](../use/command-line-interface) using the `--rulesdir` option to specify the location of your runtime rules. diff --git a/docs/src/developer-guide/index.md b/docs/src/extend/index.md similarity index 79% rename from docs/src/developer-guide/index.md rename to docs/src/extend/index.md index 66b76b12bce..2c97b2fa204 100644 --- a/docs/src/developer-guide/index.md +++ b/docs/src/extend/index.md @@ -21,34 +21,34 @@ 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) +## Section 1: Get the [Source Code](../contribute/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) +## Section 2: Set up a [Development Environment](../contribute/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) +## Section 3: Run the [Unit Tests](../contribute/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) +## Section 4: [Working with Rules](custom-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) +## Section 5: [Working with Plugins](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) +## Section 6: [Working with Custom Parsers](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) +## Section 7: [Node.js API](../integrate/nodejs-api) If you're interested in writing a tool that uses ESLint, then you can use the Node.js API to get programmatic access to functionality. -## Section 8: [Contributing](contributing/) +## Section 8: [Contributing](../contribute/) Once you've made changes that you want to share with the community, the next step is to submit those changes back via a pull request. diff --git a/docs/src/developer-guide/working-with-plugins.md b/docs/src/extend/plugins.md similarity index 95% rename from docs/src/developer-guide/working-with-plugins.md rename to docs/src/extend/plugins.md index dc032922eb3..8de331714db 100644 --- a/docs/src/developer-guide/working-with-plugins.md +++ b/docs/src/extend/plugins.md @@ -92,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#--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](../use/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. @@ -144,7 +144,7 @@ overrides: processor: a-plugin/markdown ``` -See [Specifying Processor](../user-guide/configuring/plugins#specify-a-processor) for details. +See [Specifying Processor](../use/configure/plugins#specify-a-processor) for details. #### File Extension-named Processor @@ -205,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#configure-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](../use/configure/plugins#configure-plugins) for more information. ### Peer Dependency @@ -222,7 +222,7 @@ The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDep ### Testing -ESLint provides the [`RuleTester`](nodejs-api#ruletester) utility to make it easy to test the rules of your plugin. +ESLint provides the [`RuleTester`](../integrate/nodejs-api#ruletester) utility to make it easy to test the rules of your plugin. ### Linting diff --git a/docs/src/developer-guide/scope-manager-interface.md b/docs/src/extend/scope-manager-interface.md similarity index 100% rename from docs/src/developer-guide/scope-manager-interface.md rename to docs/src/extend/scope-manager-interface.md diff --git a/docs/src/developer-guide/selectors.md b/docs/src/extend/selectors.md similarity index 100% rename from docs/src/developer-guide/selectors.md rename to docs/src/extend/selectors.md diff --git a/docs/src/developer-guide/shareable-configs.md b/docs/src/extend/shareable-configs.md similarity index 100% rename from docs/src/developer-guide/shareable-configs.md rename to docs/src/extend/shareable-configs.md diff --git a/docs/src/developer-guide/nodejs-api.md b/docs/src/integrate/nodejs-api.md similarity index 97% rename from docs/src/developer-guide/nodejs-api.md rename to docs/src/integrate/nodejs-api.md index 833a678d722..b817c23fa53 100644 --- a/docs/src/developer-guide/nodejs-api.md +++ b/docs/src/integrate/nodejs-api.md @@ -467,7 +467,7 @@ The `Linter` object does the actual evaluation of the JavaScript code. It doesn' The `Linter` is a constructor, and you can create a new instance by passing in the options you want to use. The available options are: -* `cwd` - Path to a directory that should be considered as the current working directory. It is accessible to rules by calling `context.getCwd()` (see [The Context Object](./working-with-rules#the-context-object)). If `cwd` is `undefined`, it will be normalized to `process.cwd()` if the global `process` object is defined (for example, in the Node.js runtime) , or `undefined` otherwise. +* `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](../extend/custom-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: @@ -489,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](working-with-plugins#processors-in-plugins) documentation describes as the `preprocess` method. - * `postprocess` - (optional) A function that [Processors in Plugins](working-with-plugins#processors-in-plugins) documentation describes as the `postprocess` method. + * `preprocess` - (optional) A function that [Processors in Plugins](../extend/plugins#processors-in-plugins) documentation describes as the `preprocess` method. + * `postprocess` - (optional) A function that [Processors in Plugins](../extend/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. @@ -554,7 +554,7 @@ 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#providing-suggestions)). +* `suggestions` - an array of objects describing possible lint fixes for editors to programmatically enable (see details in the [Working with Rules docs](../extend/custom-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. @@ -686,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](working-with-custom-parsers) 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](../extend/custom-parsers) as second argument. The default `"espree"` parser will already be loaded for every `Linter` instance. ```js const Linter = require("eslint").Linter; @@ -766,7 +766,7 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015 } }); The `RuleTester#run()` method is used to run the tests. It should be passed the following arguments: * The name of the rule (string) -* The rule object itself (see ["working with rules"](./working-with-rules)) +* The rule object itself (see ["working with rules"](../extend/custom-rules)) * An object containing `valid` and `invalid` properties, each of which is an array containing test cases. A test case is an object with the following properties: @@ -917,8 +917,8 @@ ruleTester.run("my-rule", myRule, { --- -[configuration object]: ../user-guide/configuring/ -[builtin-formatters]: ../user-guide/formatters/ +[configuration object]: ../use/configure/ +[builtin-formatters]: ../use/formatters/ [third-party-formatters]: https://www.npmjs.com/search?q=eslintformatter [eslint-lintfiles]: #-eslintlintfilespatterns [eslint-linttext]: #-eslintlinttextcode-options diff --git a/docs/src/maintainer-guide/index.md b/docs/src/maintain/index.md similarity index 79% rename from docs/src/maintainer-guide/index.md rename to docs/src/maintain/index.md index 6e96eccf6c9..ed7d04005bb 100644 --- a/docs/src/maintainer-guide/index.md +++ b/docs/src/maintain/index.md @@ -9,19 +9,19 @@ eleventyNavigation: This guide is intended for those who work as part of the ESLint project team. -## [Managing Issues](issues) +## [Managing Issues](manage-issues) Describes how to deal with issues when they're opened, when interacting with users, and how to close them effectively. -## [Reviewing Pull Requests](pullrequests) +## [Reviewing Pull Requests](review-pull-requests) Describes how to review incoming pull requests. -## [Managing Releases](releases) +## [Managing Releases](manage-releases) Describes how to do an ESLint project release. -## [Governance](governance) +## [Governance](../contribute/governance) Describes the governance policy for ESLint, including the rights and privileges of individuals inside the project. diff --git a/docs/src/maintainer-guide/issues.md b/docs/src/maintain/manage-issues.md similarity index 100% rename from docs/src/maintainer-guide/issues.md rename to docs/src/maintain/manage-issues.md diff --git a/docs/src/maintainer-guide/releases.md b/docs/src/maintain/manage-releases.md similarity index 100% rename from docs/src/maintainer-guide/releases.md rename to docs/src/maintain/manage-releases.md diff --git a/docs/src/maintainer-guide/pullrequests.md b/docs/src/maintain/review-pull-requests.md similarity index 100% rename from docs/src/maintainer-guide/pullrequests.md rename to docs/src/maintain/review-pull-requests.md diff --git a/docs/src/maintainer-guide/working-groups.md b/docs/src/maintain/working-groups.md similarity index 100% rename from docs/src/maintainer-guide/working-groups.md rename to docs/src/maintain/working-groups.md diff --git a/docs/src/pages/index.md b/docs/src/pages/index.md index 5f1b6933af7..a2e82b8cd1c 100644 --- a/docs/src/pages/index.md +++ b/docs/src/pages/index.md @@ -5,16 +5,15 @@ permalink: /index.html Welcome to our documentation pages! What would you like to view? -## [User Guide](user-guide/) +## [User Guide](use/) Intended for end users of ESLint. Contains information about core rules, configuration, command line options, formatters, and integrations, as well as guides for migrating from earlier versions of ESLint. -## [Developer Guide](developer-guide/) +## [Developer Guide](extend/) -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. +Intended for people who wish to extend ESLint. Contains information about creating custom rules, configurations, plugins, and formatters; and information about our Node.js API. -## [Maintainer Guide](maintainer-guide/) +## [Maintainer Guide](maintain/) Intended for maintainers of ESLint. diff --git a/docs/src/rules/id-denylist.md b/docs/src/rules/id-denylist.md index d841f37d2dd..8be84183274 100644 --- a/docs/src/rules/id-denylist.md +++ b/docs/src/rules/id-denylist.md @@ -37,7 +37,7 @@ For example, to restrict the use of common generic identifiers: } ``` -**Note:** The first element of the array is for the rule severity (see [configuring rules](../user-guide/configuring/rules). The other elements in the array are the identifiers that you want to disallow. +**Note:** The first element of the array is for the rule severity (see [configuring rules](../use/configure/rules). The other elements in the array are the identifiers that you want to disallow. Examples of **incorrect** code for this rule with sample `"data", "callback"` restricted identifiers: diff --git a/docs/src/rules/indent.md b/docs/src/rules/indent.md index d783bf179bd..7f81c0fd57b 100644 --- a/docs/src/rules/indent.md +++ b/docs/src/rules/indent.md @@ -81,7 +81,7 @@ if (a) { This rule has an object option: -* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](../developer-guide/selectors). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern. +* `"ignoredNodes"` can be used to disable indentation checking for any AST node. This accepts an array of [selectors](../extend/selectors). If an AST node is matched by any of the selectors, the indentation of tokens which are direct children of that node will be ignored. This can be used as an escape hatch to relax the rule if you disagree with the indentation that it enforces for a particular syntactic pattern. * `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements * `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations. It can also be `"first"`, indicating all the declarators should be aligned with the first declarator. * `"outerIIFEBody"` (default: 1) enforces indentation level for file-level IIFEs. This can also be set to `"off"` to disable checking for file-level IIFEs. diff --git a/docs/src/rules/no-global-assign.md b/docs/src/rules/no-global-assign.md index 4829f835f1a..dcdd05d519e 100644 --- a/docs/src/rules/no-global-assign.md +++ b/docs/src/rules/no-global-assign.md @@ -23,8 +23,8 @@ This rule disallows modifications to read-only global variables. ESLint has the capability to configure global variables as read-only. -* [Specifying Environments](../user-guide/configuring#specifying-environments) -* [Specifying Globals](../user-guide/configuring#specifying-globals) +* [Specifying Environments](../use/configure#specifying-environments) +* [Specifying Globals](../use/configure#specifying-globals) Examples of **incorrect** code for this rule: diff --git a/docs/src/rules/no-implicit-globals.md b/docs/src/rules/no-implicit-globals.md index bf94c4c192d..1e5c5fad723 100644 --- a/docs/src/rules/no-implicit-globals.md +++ b/docs/src/rules/no-implicit-globals.md @@ -122,8 +122,8 @@ A read-only global variable can be a built-in ES global (e.g. `Array`), an envir (e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file or in a `/*global */` comment. -* [Specifying Environments](../user-guide/configuring#specifying-environments) -* [Specifying Globals](../user-guide/configuring#specifying-globals) +* [Specifying Environments](../use/configure#specifying-environments) +* [Specifying Globals](../use/configure#specifying-globals) Examples of **incorrect** code for this rule: diff --git a/docs/src/rules/no-native-reassign.md b/docs/src/rules/no-native-reassign.md index d21e60fa0d6..c2c658f7705 100644 --- a/docs/src/rules/no-native-reassign.md +++ b/docs/src/rules/no-native-reassign.md @@ -24,8 +24,8 @@ This rule disallows modifications to read-only global variables. ESLint has the capability to configure global variables as read-only. -* [Specifying Environments](../user-guide/configuring#specifying-environments) -* [Specifying Globals](../user-guide/configuring#specifying-globals) +* [Specifying Environments](../use/configure#specifying-environments) +* [Specifying Globals](../use/configure#specifying-globals) Examples of **incorrect** code for this rule: diff --git a/docs/src/rules/no-restricted-syntax.md b/docs/src/rules/no-restricted-syntax.md index 4416830d977..25d419c149d 100644 --- a/docs/src/rules/no-restricted-syntax.md +++ b/docs/src/rules/no-restricted-syntax.md @@ -13,7 +13,7 @@ JavaScript has a lot of language features, and not everyone likes all of them. A Rather than creating separate rules for every language feature you want to turn off, this rule allows you to configure the syntax elements you want to restrict use of. These elements are represented by their [ESTree](https://github.com/estree/estree) node types. For example, a function declaration is represented by `FunctionDeclaration` and the `with` statement is represented by `WithStatement`. You may find the full list of AST node names you can use [on GitHub](https://github.com/eslint/eslint-visitor-keys/blob/main/lib/visitor-keys.js) and use [AST Explorer](https://astexplorer.net/) with the espree parser to see what type of nodes your code consists of. -You can also specify [AST selectors](../developer-guide/selectors) to restrict, allowing much more precise control over syntax patterns. +You can also specify [AST selectors](../extend/selectors) to restrict, allowing much more precise control over syntax patterns. ## Rule Details diff --git a/docs/src/rules/no-undef.md b/docs/src/rules/no-undef.md index 89c2b05b68e..0bc7a28279f 100644 --- a/docs/src/rules/no-undef.md +++ b/docs/src/rules/no-undef.md @@ -12,7 +12,7 @@ This rule can help you locate potential ReferenceErrors resulting from misspelli ## Rule Details -Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](../user-guide/configuring/language-options#using-configuration-files-1). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML). +Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a `/*global ...*/` comment, or specified in the [`globals` key in the configuration file](../use/configure/language-options#using-configuration-files-1). A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML). Examples of **incorrect** code for this rule: @@ -96,7 +96,7 @@ if(typeof a === "string"){} ## Environments -For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in [Specifying Environments](../user-guide/configuring/language-options#specifying-environments). A few examples are given below. +For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in [Specifying Environments](../use/configure/language-options#specifying-environments). A few examples are given below. ### browser diff --git a/docs/src/rules/rest-spread-spacing.md b/docs/src/rules/rest-spread-spacing.md index d17c81189fc..b27b5378d23 100644 --- a/docs/src/rules/rest-spread-spacing.md +++ b/docs/src/rules/rest-spread-spacing.md @@ -58,7 +58,7 @@ This rule aims to enforce consistent spacing between rest and spread operators a } ``` -Please read the user guide's section on [configuring parser options](../user-guide/configuring#specifying-parser-options) to learn more. +Please read the user guide's section on [configuring parser options](../use/configure#specifying-parser-options) to learn more. ## Options diff --git a/docs/src/rules/space-after-keywords.md b/docs/src/rules/space-after-keywords.md index 087b6acb1af..7f5d63d9986 100644 --- a/docs/src/rules/space-after-keywords.md +++ b/docs/src/rules/space-after-keywords.md @@ -7,7 +7,7 @@ Enforces consistent spacing after keywords. (removed) This rule was **removed** in ESLint v2.0 and replaced by the [keyword-spacing](keyword-spacing) rule. -(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule. +(fixable) The `--fix` option on the [command line](../use/command-line-interface#--fix) automatically fixed problems reported by this rule. Some style guides will require or disallow spaces following the certain keywords. diff --git a/docs/src/rules/space-before-keywords.md b/docs/src/rules/space-before-keywords.md index 27bd16f54b9..9c2f7358109 100644 --- a/docs/src/rules/space-before-keywords.md +++ b/docs/src/rules/space-before-keywords.md @@ -13,7 +13,7 @@ Enforces consistent spacing before keywords. (removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing) rule. -(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule. +(fixable) The `--fix` option on the [command line](../use/command-line-interface#--fix) automatically fixed problems reported by this rule. Keywords are syntax elements of JavaScript, such as `function` and `if`. These identifiers have special meaning to the language and so often appear in a different color in code editors. As an important part of the language, style guides often refer to the spacing that should be used around keywords. For example, you might have a style guide that says keywords should be always be preceded by spaces, which would mean `if-else` statements must look like this: diff --git a/docs/src/rules/space-return-throw-case.md b/docs/src/rules/space-return-throw-case.md index bb5b3435b3b..8a9242280ab 100644 --- a/docs/src/rules/space-return-throw-case.md +++ b/docs/src/rules/space-return-throw-case.md @@ -7,7 +7,7 @@ Requires spaces after `return`, `throw`, and `case` keywords. (removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing) rule. -(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule. +(fixable) The `--fix` option on the [command line](../use/command-line-interface#--fix) automatically fixed problems reported by this rule. Require spaces following `return`, `throw`, and `case`. diff --git a/docs/src/rules/strict.md b/docs/src/rules/strict.md index 5a8b1899e6b..c559b00710d 100644 --- a/docs/src/rules/strict.md +++ b/docs/src/rules/strict.md @@ -47,7 +47,7 @@ In **ECMAScript** modules, which always have strict mode semantics, the directiv This rule requires or disallows strict mode directives. -This rule disallows strict mode directives, no matter which option is specified, if ESLint configuration specifies either of the following as [parser options](../user-guide/configuring/language-options#specifying-parser-options): +This rule disallows strict mode directives, no matter which option is specified, if ESLint configuration specifies either of the following as [parser options](../use/configure/language-options#specifying-parser-options): * `"sourceType": "module"` that is, files are **ECMAScript** modules * `"impliedStrict": true` property in the `ecmaFeatures` object @@ -73,8 +73,8 @@ This rule has a string option: The `"safe"` option corresponds to the `"global"` option if ESLint considers a file to be a **Node.js** or **CommonJS** module because the configuration specifies either of the following: -* `node` or `commonjs` [environments](../user-guide/configuring/language-options#specifying-environments) -* `"globalReturn": true` property in the `ecmaFeatures` object of [parser options](../user-guide/configuring/language-options#specifying-parser-options) +* `node` or `commonjs` [environments](../use/configure/language-options#specifying-environments) +* `"globalReturn": true` property in the `ecmaFeatures` object of [parser options](../use/configure/language-options#specifying-parser-options) Otherwise the `"safe"` option corresponds to the `"function"` option. Note that if `"globalReturn": false` is explicitly specified in the configuration, the `"safe"` option will correspond to the `"function"` option regardless of the specified environment. @@ -340,4 +340,4 @@ function foo() { ## When Not To Use It -In a codebase that has both strict and non-strict code, either turn this rule off, or [selectively disable it](../user-guide/configuring/rules#disabling-rules) where necessary. For example, functions referencing `arguments.callee` are invalid in strict mode. A [full list of strict mode differences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode#Differences_from_non-strict_to_strict) is available on MDN. +In a codebase that has both strict and non-strict code, either turn this rule off, or [selectively disable it](../use/configure/rules#disabling-rules) where necessary. For example, functions referencing `arguments.callee` are invalid in strict mode. A [full list of strict mode differences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode#Differences_from_non-strict_to_strict) is available on MDN. diff --git a/docs/src/user-guide/command-line-interface.md b/docs/src/use/command-line-interface.md similarity index 97% rename from docs/src/user-guide/command-line-interface.md rename to docs/src/use/command-line-interface.md index fa0ae714c6c..04eb6a0805b 100644 --- a/docs/src/user-guide/command-line-interface.md +++ b/docs/src/use/command-line-interface.md @@ -132,7 +132,7 @@ npx eslint --no-eslintrc file.js #### `-c`, `--config` -This option allows you to specify an additional configuration file for ESLint (see [Configuring ESLint](configuring/) for more). +This option allows you to specify an additional configuration file for ESLint (see [Configuring ESLint](configure/) for more). * **Argument Type**: String. Path to file. * **Multiple Arguments**: No @@ -154,7 +154,7 @@ This option enables specific environments. * **Argument Type**: String. One of the available environments. * **Multiple Arguments**: Yes -Details about the global variables defined by each environment are available in the [Specifying Environments](configuring/language-options#specifying-environments) documentation. This option only enables environments. It does not disable environments set in other configuration files. To specify multiple environments, separate them using commas, or use the option multiple times. +Details about the global variables defined by each environment are available in the [Specifying Environments](configure/language-options#specifying-environments) documentation. This option only enables environments. It does not disable environments set in other configuration files. To specify multiple environments, separate them using commas, or use the option multiple times. ##### `--env` example @@ -379,7 +379,7 @@ This option allows you to specify the file to use as your `.eslintignore`. * **Multiple Arguments**: No * **Default Value**: By default, ESLint looks for `.eslintignore` in the current working directory. -**Note:** `--ignore-path` is not supported when using [flat configuration](./configuring/configuration-files-new) (`eslint.config.js`). +**Note:** `--ignore-path` is not supported when using [flat configuration](./configure/configuration-files-new) (`eslint.config.js`). ##### `--ignore-path` example @@ -404,7 +404,7 @@ npx eslint --no-ignore file.js This option allows you to specify patterns of files to ignore (in addition to those in `.eslintignore`). -* **Argument Type**: String. The supported syntax is the same as for [`.eslintignore` files](configuring/ignoring-code#the-eslintignore-file), which use the same patterns as the [`.gitignore` specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns. +* **Argument Type**: String. The supported syntax is the same as for [`.eslintignore` files](configure/ignore#the-eslintignore-file), which use the same patterns as the [`.gitignore` specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns. * **Multiple Arguments**: Yes ##### `--ignore-pattern` example diff --git a/docs/src/user-guide/configuring/configuration-files-new.md b/docs/src/use/configure/configuration-files-new.md similarity index 100% rename from docs/src/user-guide/configuring/configuration-files-new.md rename to docs/src/use/configure/configuration-files-new.md diff --git a/docs/src/user-guide/configuring/configuration-files.md b/docs/src/use/configure/configuration-files.md similarity index 96% rename from docs/src/user-guide/configuring/configuration-files.md rename to docs/src/use/configure/configuration-files.md index 7c4110db593..644bc5127f3 100644 --- a/docs/src/user-guide/configuring/configuration-files.md +++ b/docs/src/use/configure/configuration-files.md @@ -41,7 +41,7 @@ The second way to use configuration files is to save the file wherever you would eslint -c myconfig.json myfiletotest.js ``` -If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use [`--no-eslintrc`](../command-line-interface#--no-eslintrc) along with the [`--config`](../../user-guide/command-line-interface#-c---config) flag. +If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use [`--no-eslintrc`](../command-line-interface#--no-eslintrc) along with the [`--config`](../../use/command-line-interface#-c---config) flag. Here's an example JSON configuration file that uses the `typescript-eslint` parser to support TypeScript syntax: @@ -232,7 +232,7 @@ The `rules` property can do any of the following to extend (or override) the set ### Using a shareable configuration package -A [sharable configuration](../../developer-guide/shareable-configs) is an npm package that exports a configuration object. Make sure that you have installed the package in your project root directory, so that ESLint can require it. +A [sharable configuration](../../extend/shareable-configs) is an npm package that exports a configuration object. Make sure that you have installed the package in your project root directory, so that ESLint can require it. The `extends` property value can omit the `eslint-config-` prefix of the package name. @@ -279,7 +279,7 @@ module.exports = { ### Using a configuration from a plugin -A [plugin](../../developer-guide/working-with-plugins) is an npm package that can add various extensions to ESLint. A plugin can perform numerous functions, including but not limited to adding new rules and exporting [shareable configurations](../../developer-guide/working-with-plugins#configs-in-plugins). Make sure the package has been installed in a directory where ESLint can require it. +A [plugin](../../extend/plugins) is an npm package that can add various extensions to ESLint. A plugin can perform numerous functions, including but not limited to adding new rules and exporting [shareable configurations](../../extend/plugins#configs-in-plugins). Make sure the package has been installed in a directory where ESLint can require it. The `plugins` [property value](./plugins#configure-plugins) can omit the `eslint-plugin-` prefix of the package name. diff --git a/docs/src/user-guide/configuring/ignoring-code.md b/docs/src/use/configure/ignore.md similarity index 98% rename from docs/src/user-guide/configuring/ignoring-code.md rename to docs/src/use/configure/ignore.md index 739b84a8a13..46852ef6135 100644 --- a/docs/src/user-guide/configuring/ignoring-code.md +++ b/docs/src/use/configure/ignore.md @@ -16,7 +16,7 @@ You can ignore files in the following ways: ## `ignorePatterns` in Config Files -You can tell ESLint to ignore specific files and directories using `ignorePatterns` in your config files. `ignorePatterns` patterns follow the same rules as `.eslintignore`. Please see the [`.eslintignore` file documentation](./ignoring-code#the-eslintignore-file) to learn more. +You can tell ESLint to ignore specific files and directories using `ignorePatterns` in your config files. `ignorePatterns` patterns follow the same rules as `.eslintignore`. Please see the [`.eslintignore` file documentation](#the-eslintignore-file) to learn more. ```json { diff --git a/docs/src/user-guide/configuring/index.md b/docs/src/use/configure/index.md similarity index 87% rename from docs/src/user-guide/configuring/index.md rename to docs/src/use/configure/index.md index c71ccbf18b1..a00b927b54d 100644 --- a/docs/src/user-guide/configuring/index.md +++ b/docs/src/use/configure/index.md @@ -51,10 +51,10 @@ All of these options give you fine-grained control over how ESLint treats your c * [Specifying Processors](./plugins#specify-a-processor) * [Configuring Parsers](./plugins#configure-a-parser) -[**Ignoring Code**](ignoring-code) +[**Ignoring Code**](ignore) -* [`ignorePatterns` in Config Files](./ignoring-code#ignorepatterns-in-config-files) -* [The `.eslintignore` File](./ignoring-code#the-eslintignore-file) -* [Using an Alternate File](./ignoring-code#using-an-alternate-file) -* [Using eslintIgnore in package.json](./ignoring-code#using-eslintignore-in-packagejson) -* [Ignored File Warnings](./ignoring-code#ignored-file-warnings) +* [`ignorePatterns` in Config Files](./ignore#ignorepatterns-in-config-files) +* [The `.eslintignore` File](./ignore#the-eslintignore-file) +* [Using an Alternate File](./ignore#using-an-alternate-file) +* [Using eslintIgnore in package.json](./ignore#using-eslintignore-in-packagejson) +* [Ignored File Warnings](./ignore#ignored-file-warnings) diff --git a/docs/src/user-guide/configuring/language-options.md b/docs/src/use/configure/language-options.md similarity index 100% rename from docs/src/user-guide/configuring/language-options.md rename to docs/src/use/configure/language-options.md diff --git a/docs/src/user-guide/configuring/plugins.md b/docs/src/use/configure/plugins.md similarity index 98% rename from docs/src/user-guide/configuring/plugins.md rename to docs/src/use/configure/plugins.md index 7f3c521a255..5303625bdbd 100644 --- a/docs/src/user-guide/configuring/plugins.md +++ b/docs/src/use/configure/plugins.md @@ -167,7 +167,7 @@ ESLint checks the file path of named code blocks then ignores those if any `over By default, ESLint uses [Espree](https://github.com/eslint/espree) as its parser. You can optionally specify that a different parser should be used in your configuration file if the parser meets the following requirements: 1. It must be a Node module loadable from the config file where the parser is used. Usually, this means you should install the parser package separately using npm. -1. It must conform to the [parser interface](../../developer-guide/working-with-custom-parsers). +1. It must conform to the [parser interface](../../extend/custom-parsers). Note that even with these compatibilities, there are no guarantees that an external parser works correctly with ESLint. ESLint does not fix bugs related to incompatibilities with other parsers. diff --git a/docs/src/user-guide/configuring/rules.md b/docs/src/use/configure/rules.md similarity index 100% rename from docs/src/user-guide/configuring/rules.md rename to docs/src/use/configure/rules.md diff --git a/docs/src/user-guide/core-concepts.md b/docs/src/use/core-concepts.md similarity index 93% rename from docs/src/user-guide/core-concepts.md rename to docs/src/use/core-concepts.md index d373f0971e0..93b0fb9fa82 100644 --- a/docs/src/user-guide/core-concepts.md +++ b/docs/src/use/core-concepts.md @@ -27,7 +27,7 @@ For more information, refer to [Rules](../rules/). An ESLint configuration file is a place where you put the configuration for ESLint in your project. You can include built-in rules, how you want them enforced, plugins with custom rules, shareable configurations, which files you want rules to apply to, and more. -For more information, refer to [Configuration Files](./configuring/configuration-files). +For more information, refer to [Configuration Files](./configure/configuration-files). ## Shareable Configurations @@ -35,7 +35,7 @@ Shareable configurations are ESLint configurations that are shared via npm. Often shareable configurations are used to enforce style guides using ESLint's built-in rules. For example the sharable configuration [eslint-config-airbnb-base](https://www.npmjs.com/package/eslint-config-airbnb-base) implements the popular Airbnb JavaScript style guide. -For more information, refer to [Using a shareable configuration package](./configuring/configuration-files#using-a-shareable-configuration-package). +For more information, refer to [Using a shareable configuration package](./configure/configuration-files#using-a-shareable-configuration-package). ## Plugins @@ -43,7 +43,7 @@ An ESLint plugin is an npm module that can contain a set of ESLint rules, config A popular use case for plugins is to enforce best practices for a framework. For example, [@angular-eslint/eslint-plugin](https://www.npmjs.com/package/@angular-eslint/eslint-plugin) contains best practices for using the Angular framework. -For more information, refer to [Configuring Plugins](./configuring/plugins). +For more information, refer to [Configuring Plugins](./configure/plugins). ## Parsers @@ -79,4 +79,4 @@ The ESLint Node.js API lets you use ESLint programmatically from Node.js code. T Unless you are extending ESLint in some way, you should use the CLI. -For more information, refer to [Command Line Interface](./command-line-interface) and [Node.js API](../developer-guide/nodejs-api). +For more information, refer to [Command Line Interface](./command-line-interface) and [Node.js API](../integrate/nodejs-api). diff --git a/docs/src/user-guide/formatters/html-formatter-example.html b/docs/src/use/formatters/html-formatter-example.html similarity index 100% rename from docs/src/user-guide/formatters/html-formatter-example.html rename to docs/src/use/formatters/html-formatter-example.html diff --git a/docs/src/user-guide/formatters/html-formatter-example.json b/docs/src/use/formatters/html-formatter-example.json similarity index 100% rename from docs/src/user-guide/formatters/html-formatter-example.json rename to docs/src/use/formatters/html-formatter-example.json diff --git a/docs/src/user-guide/formatters/index.md b/docs/src/use/formatters/index.md similarity index 99% rename from docs/src/user-guide/formatters/index.md rename to docs/src/use/formatters/index.md index 7f4b04e1eb7..fe8d68d08ef 100644 --- a/docs/src/user-guide/formatters/index.md +++ b/docs/src/use/formatters/index.md @@ -117,7 +117,7 @@ Example output: Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property. -Alternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api) to programmatically use ESLint. +Alternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint. Example output: @@ -129,7 +129,7 @@ Example output: Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results. -Alternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api) to programmatically use ESLint. +Alternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint. Example output: diff --git a/docs/src/user-guide/getting-started.md b/docs/src/use/getting-started.md similarity index 91% rename from docs/src/user-guide/getting-started.md rename to docs/src/use/getting-started.md index e13ff206581..31beeac3b67 100644 --- a/docs/src/user-guide/getting-started.md +++ b/docs/src/use/getting-started.md @@ -81,7 +81,7 @@ The names `"semi"` and `"quotes"` are the names of [rules](../rules) in ESLint. * `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code) * `"error"` or `2` - turn the rule on as an error (exit code will be 1) -The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](configuring/)). +The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](configure/)). Your `.eslintrc.{js,yml,json}` configuration file will also include the line: @@ -109,14 +109,14 @@ Before you begin, you must already have a `package.json` file. If you don't, mak npm install --save-dev eslint ``` -1. Add an `.eslintrc` file in one of the [supported configuration file formats](./configuring/configuration-files#configuration-file-formats). +1. Add an `.eslintrc` file in one of the [supported configuration file formats](./configure/configuration-files#configuration-file-formats). ```shell # Create JavaScript configuration file touch .eslintrc.js ``` -1. Add configuration to the `.eslintrc` file. Refer to the [Configuring ESLint documentation](configuring/) to learn how to add rules, environments, custom configurations, plugins, and more. +1. Add configuration to the `.eslintrc` file. Refer to the [Configuring ESLint documentation](configure/) to learn how to add rules, environments, custom configurations, plugins, and more. ```js // .eslintrc.js example @@ -145,8 +145,8 @@ Before you begin, you must already have a `package.json` file. If you don't, mak ## Next Steps -* Learn about [advanced configuration](configuring/) of ESLint. +* Learn about [advanced configuration](configure/) of ESLint. * Get familiar with the [command line options](command-line-interface). * Explore [ESLint integrations](integrations) into other tools like editors, build systems, and more. -* Can't find just the right rule? Make your own [custom rule](../developer-guide/working-with-rules). -* Make ESLint even better by [contributing](../developer-guide/contributing/). +* Can't find just the right rule? Make your own [custom rule](../extend/custom-rules). +* Make ESLint even better by [contributing](../contribute/). diff --git a/docs/src/user-guide/index.md b/docs/src/use/index.md similarity index 92% rename from docs/src/user-guide/index.md rename to docs/src/use/index.md index 0912632c7b0..5358b7240cf 100644 --- a/docs/src/user-guide/index.md +++ b/docs/src/use/index.md @@ -6,7 +6,7 @@ eleventyNavigation: order: 1 --- -This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../developer-guide/). +This guide is intended for those who wish to use ESLint as an end-user. If you're looking for how to extend ESLint or work with the ESLint source code, please see the [Developer Guide](../extend/). ## [Getting Started](getting-started) @@ -16,7 +16,7 @@ Want to skip ahead and just start using ESLint? This section gives a high-level ESLint has a lot of rules that you can configure to fine-tune it to your project. This section is an exhaustive list of every rule and link to each rule's documentation. -## [Configuring](configuring/) +## [Configuring](configure/) Once you've got ESLint running, you'll probably want to adjust the configuration to better suit your project. This section explains all the different ways you can configure ESLint. @@ -43,4 +43,4 @@ If you were using a prior version of ESLint, you can get help with the transitio * [migrating-to-5.0.0](migrating-to-5.0.0) * [migrating-to-6.0.0](migrating-to-6.0.0) * [migrating-to-7.0.0](migrating-to-7.0.0) -* [migrating-to-8.0.0](migrating-to-8.0.0) +* [migrate-to-8.0.0](migrate-to-8.0.0) diff --git a/docs/src/user-guide/integrations.md b/docs/src/use/integrations.md similarity index 97% rename from docs/src/user-guide/integrations.md rename to docs/src/use/integrations.md index b01e613e5ad..7de6e11b641 100644 --- a/docs/src/user-guide/integrations.md +++ b/docs/src/use/integrations.md @@ -10,7 +10,7 @@ eleventyNavigation: This page contains community projects that have integrated ESLint. The projects on this page are not maintained by the ESLint team. -If you would like to recommend an integration to be added to this page, [submit a pull request](../developer-guide/contributing/pull-requests). +If you would like to recommend an integration to be added to this page, [submit a pull request](../contribute/pull-requests). ## Editors diff --git a/docs/src/user-guide/migrating-to-8.0.0.md b/docs/src/use/migrate-to-8.0.0.md similarity index 95% rename from docs/src/user-guide/migrating-to-8.0.0.md rename to docs/src/use/migrate-to-8.0.0.md index f28f15ccbd1..fbc3b85c775 100644 --- a/docs/src/user-guide/migrating-to-8.0.0.md +++ b/docs/src/use/migrate-to-8.0.0.md @@ -120,7 +120,7 @@ Four new rules have been enabled in the `eslint:recommended` preset. ## Rules require `meta.hasSuggestions` to provide suggestions -In ESLint v7.0.0, rules that [provided suggestions](../developer-guide/working-with-rules#providing-suggestions) did not need to let ESLint know. In v8.0.0, rules providing suggestions need to set their `meta.hasSuggestions` to `true`. This informs ESLint that the rule intends to provide suggestions. Without this property, any attempt to provide a suggestion will result in an error. +In ESLint v7.0.0, rules that [provided suggestions](../extend/custom-rules#providing-suggestions) did not need to let ESLint know. In v8.0.0, rules providing suggestions need to set their `meta.hasSuggestions` to `true`. This informs ESLint that the rule intends to provide suggestions. Without this property, any attempt to provide a suggestion will result in an error. **To address:** If your rule provides suggestions, add `meta.hasSuggestions` to the object, such as: @@ -168,7 +168,7 @@ The [eslint-plugin/require-meta-fixable](https://github.com/not-an-aardvark/esli The [eslint-plugin/prefer-object-rule](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-object-rule.md) rule can automatically fix and enforce that your rules are written with the object format instead of the deprecated function format. -See the [rule documentation](../developer-guide/working-with-rules) for more information on writing rules. +See the [rule documentation](../extend/custom-rules) for more information on writing rules. **Related issue(s):** [#13349](https://github.com/eslint/eslint/issues/13349) @@ -178,7 +178,7 @@ Back in ESLint v4.0.0, we deprecated `SourceCode#getComments()`, but we neglecte The `SourceCode#getComments()` method will be removed in v9.0.0. -**To address:** If your rule uses `SourceCode#getComments()`, please use [`SourceCode#getCommentsBefore()`, `SourceCode#getCommentsAfter()`, or `SourceCode#getCommentsInside()`](../developer-guide/working-with-rules#sourcecodegetcommentsbefore-sourcecodegetcommentsafter-and-sourcecodegetcommentsinside). +**To address:** If your rule uses `SourceCode#getComments()`, please use [`SourceCode#getCommentsBefore()`, `SourceCode#getCommentsAfter()`, or `SourceCode#getCommentsInside()`](../extend/custom-rules#sourcecodegetcommentsbefore-sourcecodegetcommentsafter-and-sourcecodegetcommentsinside). **Related issue(s):** [#14744](https://github.com/eslint/eslint/issues/14744) @@ -233,7 +233,7 @@ In ESLint v8.0.0 (via Acorn v8.0.0), the key and value are now separate objects ## The `CLIEngine` class has been removed -The `CLIEngine` class has been removed and replaced by the [`ESLint` class](../developer-guide/nodejs-api#eslint-class). +The `CLIEngine` class has been removed and replaced by the [`ESLint` class](../integrate/nodejs-api#eslint-class). **To address:** Update your code to use the new `ESLint` class if you are currently using `CLIEngine`. The following table maps the existing `CLIEngine` methods to their `ESLint` counterparts: diff --git a/docs/src/user-guide/migrating-from-jscs.md b/docs/src/use/migrating-from-jscs.md similarity index 95% rename from docs/src/user-guide/migrating-from-jscs.md rename to docs/src/use/migrating-from-jscs.md index 938daf8e230..cf213b4596e 100644 --- a/docs/src/user-guide/migrating-from-jscs.md +++ b/docs/src/use/migrating-from-jscs.md @@ -10,7 +10,7 @@ In April 2016, we [announced](https://eslint.org/blog/2016/04/welcoming-jscs-to- Before beginning the process of migrating to ESLint, it's helpful to understand some of the terminology that ESLint uses and how it relates to terminology that JSCS uses. * **Configuration File** - In JSCS, the configuration file is `.jscsrc`, `.jscsrc.json`, `.jscsrc.yaml`, or `.jscsrs.js`. In ESLint, the configuration file can be `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc.yaml`, or `.eslintrc.js` (there is also a deprecated `.eslintrc` file format). -* **Presets** - In JSCS, there were numerous predefined configurations shipped directly within JSCS. ESLint ships with just one predefined configuration (`eslint:recommended`) that has no style rules enabled. However, ESLint does support [shareable configs](../developer-guide/shareable-configs). Shareable configs are configurations that are published on their own to npm and there are shareable configs available for almost all of the JSCS presets (see [the "Converting Presets" section](#converting-presets) below). Additionally, the `preset` option in a configuration file is the equivalent of the ESLint `extends` option. +* **Presets** - In JSCS, there were numerous predefined configurations shipped directly within JSCS. ESLint ships with just one predefined configuration (`eslint:recommended`) that has no style rules enabled. However, ESLint does support [shareable configs](../extend/shareable-configs). Shareable configs are configurations that are published on their own to npm and there are shareable configs available for almost all of the JSCS presets (see [the "Converting Presets" section](#converting-presets) below). Additionally, the `preset` option in a configuration file is the equivalent of the ESLint `extends` option. ## Convert Configuration Files Using Polyjuice diff --git a/docs/src/user-guide/migrating-to-1.0.0.md b/docs/src/use/migrating-to-1.0.0.md similarity index 100% rename from docs/src/user-guide/migrating-to-1.0.0.md rename to docs/src/use/migrating-to-1.0.0.md diff --git a/docs/src/user-guide/migrating-to-2.0.0.md b/docs/src/use/migrating-to-2.0.0.md similarity index 100% rename from docs/src/user-guide/migrating-to-2.0.0.md rename to docs/src/use/migrating-to-2.0.0.md diff --git a/docs/src/user-guide/migrating-to-3.0.0.md b/docs/src/use/migrating-to-3.0.0.md similarity index 100% rename from docs/src/user-guide/migrating-to-3.0.0.md rename to docs/src/use/migrating-to-3.0.0.md diff --git a/docs/src/user-guide/migrating-to-4.0.0.md b/docs/src/use/migrating-to-4.0.0.md similarity index 99% rename from docs/src/user-guide/migrating-to-4.0.0.md rename to docs/src/use/migrating-to-4.0.0.md index d1267270d43..81051a71b05 100644 --- a/docs/src/user-guide/migrating-to-4.0.0.md +++ b/docs/src/use/migrating-to-4.0.0.md @@ -35,7 +35,7 @@ The lists below are ordered roughly by the number of users each change is expect ## `eslint:recommended` changes -Two new rules have been added to the [`eslint:recommended`](configuring#using-eslintrecommended) config: +Two new rules have been added to the [`eslint:recommended`](configure#using-eslintrecommended) config: * [`no-compare-neg-zero`](../rules/no-compare-neg-zero) disallows comparisons to `-0` * [`no-useless-escape`](../rules/no-useless-escape) disallows uselessly-escaped characters in strings and regular expressions diff --git a/docs/src/user-guide/migrating-to-5.0.0.md b/docs/src/use/migrating-to-5.0.0.md similarity index 97% rename from docs/src/user-guide/migrating-to-5.0.0.md rename to docs/src/use/migrating-to-5.0.0.md index 13898eb3268..5eb4ec7ad1a 100644 --- a/docs/src/user-guide/migrating-to-5.0.0.md +++ b/docs/src/use/migrating-to-5.0.0.md @@ -50,7 +50,7 @@ As of April 30th, 2018, Node.js 4 will be at EOL and will no longer be receiving ## `eslint:recommended` changes -Two new rules have been added to the [`eslint:recommended`](configuring#using-eslintrecommended) config: +Two new rules have been added to the [`eslint:recommended`](configure/configuration-files#using-eslintrecommended) config: * [`for-direction`](../rules/for-direction) enforces that a `for` loop update clause moves the counter in the right direction. * [`getter-return`](../rules/getter-return) enforces that a `return` statement is present in property getters. @@ -113,7 +113,7 @@ ESLint v5 will report a fatal error when either of the following conditions is m * A file provided on the command line does not exist * A glob or folder provided on the command line does not match any lintable files -Note that this also affects the [`CLIEngine.executeOnFiles()`](../developer-guide/nodejs-api#cliengineexecuteonfiles) API. +Note that this also affects the [`CLIEngine.executeOnFiles()`](../integrate/nodejs-api#cliengineexecuteonfiles) API. **To address:** If you encounter an error about missing files after upgrading to ESLint v5, you may want to double-check that there are no typos in the paths you provide to ESLint. To make the error go away, you can simply remove the given files or globs from the list of arguments provided to ESLint on the command line. @@ -158,7 +158,7 @@ ESLint v4 had a special behavior when linting files that only contain whitespace ESLint v5 treats whitespace-only files the same way as all other files: it parses them and runs enabled rules on them as appropriate. This could lead to additional linting problems if you use a custom rule that reports errors on empty files. -**To address:** If you have an empty file in your project and you don't want it to be linted, consider adding it to an [`.eslintignore` file](configuring#ignoring-files-and-directories). +**To address:** If you have an empty file in your project and you don't want it to be linted, consider adding it to an [`.eslintignore` file](configure/ignore). If you have a custom rule, you should make sure it handles empty files appropriately. (In most cases, no changes should be necessary.) @@ -221,7 +221,7 @@ Previously, the `context.getScope()` method changed its behavior based on the `p Additionally, `context.getScope()` incorrectly returned the parent scope of the proper scope on `CatchClause` (in ES5), `ForStatement` (in ≧ES2015), `ForInStatement` (in ≧ES2015), `ForOfStatement`, and `WithStatement` nodes. -In ESLint v5, the `context.getScope()` method has the same behavior regardless of `parserOptions.ecmaVersion` and returns the proper scope. See [the documentation](../developer-guide/working-with-rules#contextgetscope) for more details on which scopes are returned. +In ESLint v5, the `context.getScope()` method has the same behavior regardless of `parserOptions.ecmaVersion` and returns the proper scope. See [the documentation](../extend/custom-rules#contextgetscope) for more details on which scopes are returned. **To address:** If you have written a custom rule that uses the `context.getScope()` method in node handlers, you may need to update it to account for the modified scope information. @@ -268,6 +268,6 @@ In ESLint v5, an unsuccessful linting run due to a fatal error will result in an ## The `eslint.linter` property is now non-enumerable -When using ESLint's Node.js API, the [`linter`](../developer-guide/nodejs-api#linter-1) property is now non-enumerable. Note that the `linter` property was deprecated in ESLint v4 in favor of the [`Linter`](../developer-guide/nodejs-api#linter) property. +When using ESLint's Node.js API, the [`linter`](../integrate/nodejs-api#linter-1) property is now non-enumerable. Note that the `linter` property was deprecated in ESLint v4 in favor of the [`Linter`](../integrate/nodejs-api#linter) property. **To address:** If you rely on enumerating all the properties of the `eslint` object, use something like `Object.getOwnPropertyNames` to ensure that non-enumerable keys are captured. diff --git a/docs/src/user-guide/migrating-to-6.0.0.md b/docs/src/use/migrating-to-6.0.0.md similarity index 98% rename from docs/src/user-guide/migrating-to-6.0.0.md rename to docs/src/use/migrating-to-6.0.0.md index 36f67f16a07..0d2595ee062 100644 --- a/docs/src/user-guide/migrating-to-6.0.0.md +++ b/docs/src/use/migrating-to-6.0.0.md @@ -51,7 +51,7 @@ As of April 2019, Node.js 6 will be at EOL and will no longer be receiving secur ## `eslint:recommended` has been updated -The following rules have been added to the [`eslint:recommended`](../user-guide/configuring#using-eslintrecommended) config: +The following rules have been added to the [`eslint:recommended`](../use/configure#using-eslintrecommended) config: * [`no-async-promise-executor`](../rules/no-async-promise-executor) disallows using an `async` function as the argument to the `Promise` constructor, which is usually a bug. * [`no-misleading-character-class`](../rules/no-misleading-character-class) reports character classes in regular expressions that might not behave as expected. @@ -195,7 +195,7 @@ The default options for the [`no-confusing-arrow`](../rules/no-confusing-arrow) Due to a bug, the glob patterns in a `files` list in an `overrides` section of a config file would never match dotfiles, making it impossible to have overrides apply to files starting with a dot. This bug has been fixed in ESLint v6. -**To address:** If you don't want dotfiles to be matched by an override, consider adding something like `excludedFiles: [".*"]` to that `overrides` section. See the [documentation](../user-guide/configuring#configuration-based-on-glob-patterns) for more details. +**To address:** If you don't want dotfiles to be matched by an override, consider adding something like `excludedFiles: [".*"]` to that `overrides` section. See the [documentation](../use/configure#configuration-based-on-glob-patterns) for more details. **Related issue(s):** [eslint/eslint#11201](https://github.com/eslint/eslint/issues/11201) @@ -328,6 +328,6 @@ Previously, when linting code with a parser that had not been previously defined In ESLint v6, `Linter` will no longer perform any filesystem operations, including loading parsers. -**To address:** If you're using `Linter` with a custom parser, use [`Linter#defineParser`](../developer-guide/nodejs-api#linterdefineparser) to explicitly define the parser before linting any code. +**To address:** If you're using `Linter` with a custom parser, use [`Linter#defineParser`](../integrate/nodejs-api#linterdefineparser) to explicitly define the parser before linting any code. **Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7) diff --git a/docs/src/user-guide/migrating-to-7.0.0.md b/docs/src/use/migrating-to-7.0.0.md similarity index 97% rename from docs/src/user-guide/migrating-to-7.0.0.md rename to docs/src/use/migrating-to-7.0.0.md index ecb959bb587..80fad67a025 100644 --- a/docs/src/user-guide/migrating-to-7.0.0.md +++ b/docs/src/use/migrating-to-7.0.0.md @@ -147,7 +147,7 @@ To allow for the colocation of comments that provide context with the directive, The ten Node.js/CommonJS rules in core have been deprecated and moved to the [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) plugin. -**To address:** As per [our deprecation policy](../user-guide/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead. +**To address:** As per [our deprecation policy](../use/rule-deprecation), the deprecated rules will remain in core for the foreseeable future and are still available for use. However, we will no longer be updating or fixing any bugs in those rules. To use a supported version of the rules, we recommend using the corresponding rules in the plugin instead. | Deprecated Rules | Replacement | | :--------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | @@ -209,7 +209,7 @@ The `RuleTester` now validates the following: ## The `CLIEngine` class has been deprecated -The [`CLIEngine` class](../developer-guide/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](../developer-guide/nodejs-api#eslint-class). +The [`CLIEngine` class](../integrate/nodejs-api#cliengine) has been deprecated and replaced by the new [`ESLint` class](../integrate/nodejs-api#eslint-class). The `CLIEngine` class provides a synchronous API that is blocking the implementation of features such as parallel linting, supporting ES modules in shareable configs/parsers/plugins/formatters, and adding the ability to visually display the progress of linting runs. The new `ESLint` class provides an asynchronous API that ESLint core will now using going forward. `CLIEngine` will remain in core for the foreseeable future but may be removed in a future major version. diff --git a/docs/src/user-guide/rule-deprecation.md b/docs/src/use/rule-deprecation.md similarity index 100% rename from docs/src/user-guide/rule-deprecation.md rename to docs/src/use/rule-deprecation.md diff --git a/lib/cli-engine/formatters/formatters-meta.json b/lib/cli-engine/formatters/formatters-meta.json index a26ce8d2874..bcd35e50428 100644 --- a/lib/cli-engine/formatters/formatters-meta.json +++ b/lib/cli-engine/formatters/formatters-meta.json @@ -17,11 +17,11 @@ }, { "name": "json-with-metadata", - "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api) to programmatically use ESLint." + "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." }, { "name": "json", - "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api) to programmatically use ESLint." + "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint." }, { "name": "junit", diff --git a/lib/rule-tester/flat-rule-tester.js b/lib/rule-tester/flat-rule-tester.js index b45b5d3c3db..510cbc688ce 100644 --- a/lib/rule-tester/flat-rule-tester.js +++ b/lib/rule-tester/flat-rule-tester.js @@ -430,7 +430,7 @@ class FlatRuleTester { if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") { throw new Error( "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" + - "See https://eslint.org/docs/developer-guide/nodejs-api#customizing-ruletester for more." + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." ); } if (typeof it === "function") { diff --git a/lib/rule-tester/rule-tester.js b/lib/rule-tester/rule-tester.js index 62fd467e0b0..48df3b79b94 100644 --- a/lib/rule-tester/rule-tester.js +++ b/lib/rule-tester/rule-tester.js @@ -314,7 +314,7 @@ function emitLegacyRuleAPIWarning(ruleName) { if (!emitLegacyRuleAPIWarning[`warned-${ruleName}`]) { emitLegacyRuleAPIWarning[`warned-${ruleName}`] = true; process.emitWarning( - `"${ruleName}" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/developer-guide/working-with-rules`, + `"${ruleName}" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/latest/extend/custom-rules`, "DeprecationWarning" ); } @@ -329,7 +329,7 @@ function emitMissingSchemaWarning(ruleName) { if (!emitMissingSchemaWarning[`warned-${ruleName}`]) { emitMissingSchemaWarning[`warned-${ruleName}`] = true; process.emitWarning( - `"${ruleName}" rule has options but is missing the "meta.schema" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas`, + `"${ruleName}" rule has options but is missing the "meta.schema" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas`, "DeprecationWarning" ); } @@ -493,7 +493,7 @@ class RuleTester { if (typeof this[DESCRIBE] === "function" || typeof this[IT] === "function") { throw new Error( "Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" + - "See https://eslint.org/docs/developer-guide/nodejs-api#customizing-ruletester for more." + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." ); } if (typeof it === "function") { diff --git a/messages/print-config-with-directory-path.js b/messages/print-config-with-directory-path.js index f65bdaaf770..4559c8d6de4 100644 --- a/messages/print-config-with-directory-path.js +++ b/messages/print-config-with-directory-path.js @@ -3,6 +3,6 @@ module.exports = function() { return ` The '--print-config' CLI option requires a path to a source code file rather than a directory. -See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config +See also: https://eslint.org/docs/latest/use/command-line-interface#--print-config `.trimStart(); }; diff --git a/packages/eslint-config-eslint/README.md b/packages/eslint-config-eslint/README.md index ea144120fc4..d12b24a8fed 100644 --- a/packages/eslint-config-eslint/README.md +++ b/packages/eslint-config-eslint/README.md @@ -2,7 +2,7 @@ # ESLint Configuration -[Website](https://eslint.org) | [Configuring](https://eslint.org/docs/user-guide/configuring) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/developer-guide/contributing) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | [Chatroom](https://eslint.org/chat) +[Website](https://eslint.org) | [Configuring](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | [Chatroom](https://eslint.org/chat) Contains the ESLint configuration used for projects maintained by the ESLint team. diff --git a/templates/blogpost.md.ejs b/templates/blogpost.md.ejs index 2d73ee127fe..efb1161ed47 100644 --- a/templates/blogpost.md.ejs +++ b/templates/blogpost.md.ejs @@ -50,7 +50,7 @@ npm i eslint@<%- version %> --save-dev ### Migration Guide -As there are a lot of changes, we've created a [migration guide](/docs/<%- prereleaseMajorVersion %>/user-guide/migrating-to-<%- prereleaseMajorVersion %>) describing the changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems. +As there are a lot of changes, we've created a [migration guide](/docs/<%- prereleaseMajorVersion %>/use/migrating-to-<%- prereleaseMajorVersion %>) describing the changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems. <% } %> diff --git a/tests/lib/rule-tester/rule-tester.js b/tests/lib/rule-tester/rule-tester.js index bba5f14bfbc..e961dd9a516 100644 --- a/tests/lib/rule-tester/rule-tester.js +++ b/tests/lib/rule-tester/rule-tester.js @@ -2286,7 +2286,7 @@ describe("RuleTester", () => { assert.deepStrictEqual( processStub.getCall(0).args, [ - "\"function-style-rule\" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/developer-guide/working-with-rules", + "\"function-style-rule\" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/latest/extend/custom-rules", "DeprecationWarning" ] ); @@ -2304,7 +2304,7 @@ describe("RuleTester", () => { assert.deepStrictEqual( processStub.getCall(0).args, [ - "\"rule-with-no-meta-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas", + "\"rule-with-no-meta-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", "DeprecationWarning" ] ); @@ -2322,7 +2322,7 @@ describe("RuleTester", () => { assert.deepStrictEqual( processStub.getCall(0).args, [ - "\"rule-with-no-schema-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas", + "\"rule-with-no-schema-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", "DeprecationWarning" ] ); @@ -2355,7 +2355,7 @@ describe("RuleTester", () => { assert.deepStrictEqual( processStub.getCall(0).args, [ - "\"rule-with-undefined-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas", + "\"rule-with-undefined-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", "DeprecationWarning" ] ); @@ -2387,7 +2387,7 @@ describe("RuleTester", () => { assert.deepStrictEqual( processStub.getCall(0).args, [ - "\"rule-with-null-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/developer-guide/working-with-rules#options-schemas", + "\"rule-with-null-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", "DeprecationWarning" ] ); diff --git a/tools/fetch-docs-links.js b/tools/fetch-docs-links.js index 3d92633f37f..d29dff1b3a0 100644 --- a/tools/fetch-docs-links.js +++ b/tools/fetch-docs-links.js @@ -7,7 +7,7 @@ * * To fetch info for just selected files (for use with lint-staged): * - * node tools/fetch-docs-links.js docs/src/user-guide/index.md + * node tools/fetch-docs-links.js docs/src/use/index.md * * @author Nicholas C. Zakas */