From 7cfc78e2e158a50f236c391690e7ead4108710c9 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 2 Oct 2022 21:42:44 -0400 Subject: [PATCH 1/3] chore(website): add details to Configurations page --- .../{CONFIGURATIONS.md => CONFIGURATIONS.mdx} | 110 ++++++++++-------- docs/linting/troubleshooting/FORMATTING.md | 16 +++ packages/website-eslint/package.json | 1 + packages/website-eslint/rollup.config.js | 20 ++++ packages/website-eslint/types/index.d.ts | 2 + .../ConfigurationContents.module.css | 8 ++ .../MDXComponents/ConfigurationContents.tsx | 22 ++++ .../website/src/theme/MDXComponents/index.tsx | 2 + yarn.lock | 20 ++++ 9 files changed, 153 insertions(+), 48 deletions(-) rename docs/linting/{CONFIGURATIONS.md => CONFIGURATIONS.mdx} (55%) create mode 100644 packages/website/src/theme/MDXComponents/ConfigurationContents.module.css create mode 100644 packages/website/src/theme/MDXComponents/ConfigurationContents.tsx diff --git a/docs/linting/CONFIGURATIONS.md b/docs/linting/CONFIGURATIONS.mdx similarity index 55% rename from docs/linting/CONFIGURATIONS.md rename to docs/linting/CONFIGURATIONS.mdx index de05a216ff87..98fa29a955d1 100644 --- a/docs/linting/CONFIGURATIONS.md +++ b/docs/linting/CONFIGURATIONS.mdx @@ -3,35 +3,29 @@ id: configs title: Configurations --- -[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you, with the intention that you add the config and it gives you an opinionated setup. - -## Built-In Configurations - +[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you. `@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules. -With the exception of `strict`, all configurations are considered "stable". -Rule additions and removals are treated as breaking changes and will only be done in major version bumps. +> With the exception of `strict`, all configurations are considered "stable". +> Rule additions and removals are treated as breaking changes and will only be done in major version bumps. -:::note -We recommend most packages extend from [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./TYPED_LINTING.md)). -::: +## Recommended Configurations -### `eslint-recommended` +Most projects should extend from at least one of: -This ruleset is meant to be used after extending `eslint:recommended`. -It disables core ESLint rules that are already checked by the TypeScript compiler. -Additionally, it enables rules that promote using the more modern constructs TypeScript allows for. +- [`recommended`](#recommended): Recommended rules for code correctness that you can drop in without additional configuration. +- [`recommended-requiring-type-checking`](#recommended-requiring-type-checking): Additional recommended rules that require type information. +- [`strict`](#strict): Additional strict rules that can also catch bugs but are more opinionated than recommended rules. -```jsonc -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended" - ] -} -``` +:::tip +We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./TYPED_LINTING.md)). +::: -This config is automatically included if you use any of the other configurations mentioned on this page. +:::note +These configurations are our recommended starting points, but **you don't need to use them as-is**. +ESLint allows configuring own rule settings on top of extended configurations. +See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files). +::: ### `recommended` @@ -49,6 +43,8 @@ These rules are those whose reports are almost always for a bad practice and/or We strongly recommend all TypeScript projects extend from this configuration. ::: + + ### `recommended-requiring-type-checking` Additional recommended rules that require type information. @@ -68,6 +64,8 @@ We recommend all TypeScript projects extend from this configuration, with the ca See [Linting with Type Information](/docs/linting/typed-linting) for more details. ::: + + ### `strict` Additional strict rules that can also catch bugs but are more opinionated than recommended rules. @@ -82,41 +80,57 @@ Additional strict rules that can also catch bugs but are more opinionated than r } ``` -:::tip +:::caution We recommend a TypeScript project extend from this configuration only if a nontrivial percentage of its developers are highly proficient in TypeScript. ::: -## Overriding Configurations + -These configurations are our recommended starting points, but **you don't need to use them as-is**. -ESLint allows you to configure your own rule settings on top of any extended configurations. -See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files). +## Other Configurations -### Suggesting Configuration Changes +TypeScript ESLint includes a scattering of utility configurations used by the recommended configurations. +We don't recommend using these directly; instead, extend from an earlier recommended rule. -If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning. +### `all` + +Enables each the rules provided as a part of TypeScript ESLint. +Note that many rules are not applicable in all codebases, or are meant to be configured. + + -## Prettier +### `base` -If you use [`prettier`](https://www.npmjs.com/package/prettier), there is also a helpful config to help ensure ESLint doesn't report on formatting issues that prettier will fix: [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier). +A minimal ruleset that sets only the required parser and plugin options needed to run TypeScript ESLint. -Using this config by adding it to the end of your `extends`: + + +This config is automatically included if you use any of the recommended configurations. + +### `eslint-recommended` -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Add this line - 'prettier', - ], -}; +This ruleset is meant to be used after extending `eslint:recommended`. +It disables core ESLint rules that are already checked by the TypeScript compiler. +Additionally, it enables rules that promote using the more modern constructs TypeScript allows for. + +```jsonc +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended" + ] +} ``` -:::warning -**We strongly recommend you use Prettier or an equivalent**, not ESLint formatting rules. -See [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/4907 'Issue: Docs: Add our opinion on delegating stylistic issues to a tool such as Prettier #4907') for more information. -::: +This config is automatically included if you use any of the recommended configurations. + + + +## Suggesting Configuration Changes + +If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning. + +## Formatting + +None of the preset configs provided by TypeScript ESLint enable formatting rules (rules that only serve to enforce code whitespace and other trivia). +We strongly recommend you use Prettier or an equivalent for formatting your code, not ESLint formatting rules. +See [What About Formatting? > Suggested Usage](./troubleshooting/formatting#suggested-usage). diff --git a/docs/linting/troubleshooting/FORMATTING.md b/docs/linting/troubleshooting/FORMATTING.md index 2acb36d0e600..47ff57c3b45c 100644 --- a/docs/linting/troubleshooting/FORMATTING.md +++ b/docs/linting/troubleshooting/FORMATTING.md @@ -27,6 +27,22 @@ Linters typically run on a rule-by-rule basis, typically resulting in many edge We recommend using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) to disable formatting rules in your ESLint configuration. You can then configure your formatter separately from ESLint. +Using this config by adding it to the end of your `extends`: + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + // Add this line + 'prettier', + ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + root: true, +}; +``` + ## ESLint Core and Formatting Per [ESLint's 2020 Changes to Rule Policies blog post](https://eslint.org/blog/2020/05/changes-to-rules-policies#what-are-the-changes): diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 45d851cf862e..d700f2e9a7e4 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -31,6 +31,7 @@ "@typescript-eslint/visitor-keys": "5.38.1", "eslint": "*", "rollup": "^2.75.4", + "rollup-plugin-insert": "^1.3.2", "rollup-plugin-terser": "^7.0.2", "semver": "^7.3.7" } diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js index bc9143b27dbe..9a12feae197e 100644 --- a/packages/website-eslint/rollup.config.js +++ b/packages/website-eslint/rollup.config.js @@ -1,10 +1,27 @@ import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import resolve from '@rollup/plugin-node-resolve'; +import { configs } from '@typescript-eslint/eslint-plugin'; +import { format } from 'prettier'; +import { append } from 'rollup-plugin-insert'; import { terser } from 'rollup-plugin-terser'; const replace = require('./rollup-plugin/replace'); +// Prettifying configs here means the website doesn't have to load Prettier +const prettierConfigs = Object.fromEntries( + Object.entries(configs).map(([key, value]) => [ + key, + format( + JSON.stringify(value).replaceAll( + `"./configs/`, + `"plugin:@typescript-eslint/`, + ), + { parser: 'json' }, + ), + ]), +); + module.exports = { input: 'src/linter/linter.js', output: { @@ -16,6 +33,9 @@ module.exports = { }, external: ['vs/language/typescript/tsWorker'], plugins: [ + append(` + export const configs = ${JSON.stringify(prettierConfigs)}; + `), terser({ keep_classnames: true, }), diff --git a/packages/website-eslint/types/index.d.ts b/packages/website-eslint/types/index.d.ts index 7673f6d10a27..397be472be8f 100644 --- a/packages/website-eslint/types/index.d.ts +++ b/packages/website-eslint/types/index.d.ts @@ -11,3 +11,5 @@ export interface LintUtils { astConverter: typeof astConverter; getScriptKind: typeof getScriptKind; } + +export const configs: Record; diff --git a/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css b/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css new file mode 100644 index 000000000000..0933fe508437 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css @@ -0,0 +1,8 @@ +.summary { + cursor: pointer; + font-style: italic; +} + +.configurationContents + p { + margin-top: 1rem; +} diff --git a/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx b/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx new file mode 100644 index 000000000000..f2c82615121d --- /dev/null +++ b/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx @@ -0,0 +1,22 @@ +import CodeBlock from '@theme/CodeBlock'; +import { configs } from '@typescript-eslint/website-eslint'; +import React from 'react'; + +import styles from './ConfigurationContents.module.css'; + +export interface ConfigurationContentsProps { + name: string; +} + +export function ConfigurationContents({ + name, +}: ConfigurationContentsProps): JSX.Element { + return ( +
+ + Contents of the {name} config + + {configs[name]} +
+ ); +} diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 70fa555536b5..941267dfbedc 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -1,9 +1,11 @@ import MDXComponents from '@theme-original/MDXComponents'; +import { ConfigurationContents } from './ConfigurationContents'; import { RuleAttributes } from './RuleAttributes'; // eslint-disable-next-line import/no-default-export export default { ...MDXComponents, + 'configuration-contents': ConfigurationContents, 'rule-attributes': RuleAttributes, }; diff --git a/yarn.lock b/yarn.lock index 10a60b825f34..463cfe7aadc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7172,6 +7172,11 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + estree-walker@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" @@ -12665,6 +12670,14 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" +rollup-plugin-insert@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-insert/-/rollup-plugin-insert-1.3.2.tgz#a2d646041758f6c3a748b55e1294e65146ac7df5" + integrity sha512-oTlUJikRZ1dYW9Kg9LHbG0T8pKNboHvMI0VZZoOUbqYPHE7rrKERHlGd3xsHH6W1KTr9Fcl4+UgrjpVkveWgPA== + dependencies: + magic-string "^0.25.7" + rollup-pluginutils "^2.8.2" + rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -12675,6 +12688,13 @@ rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" +rollup-pluginutils@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" + integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + dependencies: + estree-walker "^0.6.1" + rollup@^2.75.4: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" From ac221f6719326882139d02c7acf1f150c5bc5dbe Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 24 Oct 2022 15:23:04 -0400 Subject: [PATCH 2/3] Reverted Rollup shenanigans, and just went with regular link --- docs/linting/CONFIGURATIONS.mdx | 22 +++++++------- packages/website-eslint/package.json | 17 +++++------ packages/website-eslint/rollup.config.js | 20 ------------- packages/website-eslint/types/index.d.ts | 2 -- .../ConfigurationContents.module.css | 8 ----- .../MDXComponents/ConfigurationContents.tsx | 22 -------------- .../website/src/theme/MDXComponents/index.tsx | 2 -- yarn.lock | 30 +++++++------------ 8 files changed, 29 insertions(+), 94 deletions(-) delete mode 100644 packages/website/src/theme/MDXComponents/ConfigurationContents.module.css delete mode 100644 packages/website/src/theme/MDXComponents/ConfigurationContents.tsx diff --git a/docs/linting/CONFIGURATIONS.mdx b/docs/linting/CONFIGURATIONS.mdx index 98fa29a955d1..901f01cb8651 100644 --- a/docs/linting/CONFIGURATIONS.mdx +++ b/docs/linting/CONFIGURATIONS.mdx @@ -39,12 +39,12 @@ These rules are those whose reports are almost always for a bad practice and/or } ``` +See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config. + :::tip -We strongly recommend all TypeScript projects extend from this configuration. +We strongly recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended`. ::: - - ### `recommended-requiring-type-checking` Additional recommended rules that require type information. @@ -59,13 +59,13 @@ Rules in this configuration are similarly useful to those in `recommended`. } ``` +See [`configs/recommended-requiring-type-checking.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts) for the exact contents of this config. + :::tip -We recommend all TypeScript projects extend from this configuration, with the caveat that rules using type information take longer to run. +We recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended-requiring-type-checking`, with the caveat that rules using type information take longer to run. See [Linting with Type Information](/docs/linting/typed-linting) for more details. ::: - - ### `strict` Additional strict rules that can also catch bugs but are more opinionated than recommended rules. @@ -80,12 +80,12 @@ Additional strict rules that can also catch bugs but are more opinionated than r } ``` +See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config. + :::caution -We recommend a TypeScript project extend from this configuration only if a nontrivial percentage of its developers are highly proficient in TypeScript. +We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript. ::: - - ## Other Configurations TypeScript ESLint includes a scattering of utility configurations used by the recommended configurations. @@ -96,7 +96,7 @@ We don't recommend using these directly; instead, extend from an earlier recomme Enables each the rules provided as a part of TypeScript ESLint. Note that many rules are not applicable in all codebases, or are meant to be configured. - +See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config. ### `base` @@ -123,7 +123,7 @@ Additionally, it enables rules that promote using the more modern constructs Typ This config is automatically included if you use any of the recommended configurations. - +See [`configs/eslint-recommended.ts``](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config. ## Suggesting Configuration Changes diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index aac64780b1e3..f094f70c3be4 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.40.1", + "version": "5.41.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,22 +16,21 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.40.1", - "@typescript-eslint/utils": "5.40.1" + "@typescript-eslint/types": "5.41.0", + "@typescript-eslint/utils": "5.41.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^23.0.0", "@rollup/plugin-json": "^5.0.0", "@rollup/plugin-node-resolve": "^15.0.0", "@rollup/pluginutils": "^5.0.0", - "@typescript-eslint/eslint-plugin": "5.40.1", - "@typescript-eslint/parser": "5.40.1", - "@typescript-eslint/scope-manager": "5.40.1", - "@typescript-eslint/typescript-estree": "5.40.1", - "@typescript-eslint/visitor-keys": "5.40.1", + "@typescript-eslint/eslint-plugin": "5.41.0", + "@typescript-eslint/parser": "5.41.0", + "@typescript-eslint/scope-manager": "5.41.0", + "@typescript-eslint/typescript-estree": "5.41.0", + "@typescript-eslint/visitor-keys": "5.41.0", "eslint": "*", "rollup": "^2.75.4", - "rollup-plugin-insert": "^1.3.2", "rollup-plugin-terser": "^7.0.2", "semver": "^7.3.7" } diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js index d848a14fa6b4..77c6d5280036 100644 --- a/packages/website-eslint/rollup.config.js +++ b/packages/website-eslint/rollup.config.js @@ -1,27 +1,10 @@ import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import resolve from '@rollup/plugin-node-resolve'; -import { configs } from '@typescript-eslint/eslint-plugin'; -import { format } from 'prettier'; -import { append } from 'rollup-plugin-insert'; import { terser } from 'rollup-plugin-terser'; const replace = require('./rollup-plugin/replace'); -// Prettifying configs here means the website doesn't have to load Prettier -const prettierConfigs = Object.fromEntries( - Object.entries(configs).map(([key, value]) => [ - key, - format( - JSON.stringify(value).replaceAll( - `"./configs/`, - `"plugin:@typescript-eslint/`, - ), - { parser: 'json' }, - ), - ]), -); - module.exports = { input: 'src/linter/linter.js', output: { @@ -33,9 +16,6 @@ module.exports = { }, external: ['vs/language/typescript/tsWorker'], plugins: [ - append(` - export const configs = ${JSON.stringify(prettierConfigs)}; - `), terser({ keep_classnames: true, }), diff --git a/packages/website-eslint/types/index.d.ts b/packages/website-eslint/types/index.d.ts index 397be472be8f..7673f6d10a27 100644 --- a/packages/website-eslint/types/index.d.ts +++ b/packages/website-eslint/types/index.d.ts @@ -11,5 +11,3 @@ export interface LintUtils { astConverter: typeof astConverter; getScriptKind: typeof getScriptKind; } - -export const configs: Record; diff --git a/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css b/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css deleted file mode 100644 index 0933fe508437..000000000000 --- a/packages/website/src/theme/MDXComponents/ConfigurationContents.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.summary { - cursor: pointer; - font-style: italic; -} - -.configurationContents + p { - margin-top: 1rem; -} diff --git a/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx b/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx deleted file mode 100644 index f2c82615121d..000000000000 --- a/packages/website/src/theme/MDXComponents/ConfigurationContents.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import CodeBlock from '@theme/CodeBlock'; -import { configs } from '@typescript-eslint/website-eslint'; -import React from 'react'; - -import styles from './ConfigurationContents.module.css'; - -export interface ConfigurationContentsProps { - name: string; -} - -export function ConfigurationContents({ - name, -}: ConfigurationContentsProps): JSX.Element { - return ( -
- - Contents of the {name} config - - {configs[name]} -
- ); -} diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 941267dfbedc..70fa555536b5 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -1,11 +1,9 @@ import MDXComponents from '@theme-original/MDXComponents'; -import { ConfigurationContents } from './ConfigurationContents'; import { RuleAttributes } from './RuleAttributes'; // eslint-disable-next-line import/no-default-export export default { ...MDXComponents, - 'configuration-contents': ConfigurationContents, 'rule-attributes': RuleAttributes, }; diff --git a/yarn.lock b/yarn.lock index b3cad50a6a97..1e719261af60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4112,6 +4112,11 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== +"@types/natural-compare-lite@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@types/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#90724682da3c304dd8d643b4e9ba00f53f29d454" + integrity sha512-ZDcj/yWsRPacqKPpCExWWFq9X1JQwEOfHsu8deN1Qfa6M02z6tN4DK6AMf2IkM7709gp3QW6Bo7m2NFDhA485w== + "@types/ncp@^2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@types/ncp/-/ncp-2.0.5.tgz#5c53b229a321946102a188b603306162137f4fb9" @@ -7076,11 +7081,6 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" - integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== - estree-walker@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" @@ -10332,6 +10332,11 @@ nanoid@^3.3.4: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -12380,14 +12385,6 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -rollup-plugin-insert@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-insert/-/rollup-plugin-insert-1.3.2.tgz#a2d646041758f6c3a748b55e1294e65146ac7df5" - integrity sha512-oTlUJikRZ1dYW9Kg9LHbG0T8pKNboHvMI0VZZoOUbqYPHE7rrKERHlGd3xsHH6W1KTr9Fcl4+UgrjpVkveWgPA== - dependencies: - magic-string "^0.25.7" - rollup-pluginutils "^2.8.2" - rollup-plugin-terser@^7.0.0, rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -12398,13 +12395,6 @@ rollup-plugin-terser@^7.0.0, rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup-pluginutils@^2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" - integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== - dependencies: - estree-walker "^0.6.1" - rollup@^2.43.1, rollup@^2.75.4: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" From 473794e51414d1f87528f8293cede68a844fd4da Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 24 Oct 2022 15:25:56 -0400 Subject: [PATCH 3/3] Added /all notice --- docs/linting/CONFIGURATIONS.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/linting/CONFIGURATIONS.mdx b/docs/linting/CONFIGURATIONS.mdx index 901f01cb8651..eebf58cf8fd2 100644 --- a/docs/linting/CONFIGURATIONS.mdx +++ b/docs/linting/CONFIGURATIONS.mdx @@ -98,6 +98,11 @@ Note that many rules are not applicable in all codebases, or are meant to be con See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config. +:::warning +We do not recommend a TypeScript projects extend from `plugin:@typescript-eslint/all`. +Many rules conflict with each other and/or are intended to be configured per-project. +::: + ### `base` A minimal ruleset that sets only the required parser and plugin options needed to run TypeScript ESLint.