diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx index 79e65c2b991..232fe15966d 100644 --- a/docs/getting-started/Quickstart.mdx +++ b/docs/getting-started/Quickstart.mdx @@ -45,18 +45,29 @@ export default tseslint.config( This code will enable our [recommended configuration](../users/Shared_Configurations.mdx) for linting. +#### Details + +- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). +- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js). +- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended). +
-Aside on file extensions +Aside on ESLint's `defineConfig()` -The `.mjs` extension makes the file use the [ES modules (ESM)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) format. Node interprets `.js` files in the [CommonJS (CJS)](https://nodejs.org/api/modules.html) format by default, but if you have `"type": "module"` in your `package.json`, you can also use `eslint.config.js`. +ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. +However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. +For now we recommend using `tseslint.config()` for use with typescript-eslint's configs. + +See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details.
-#### Details +
+Aside on file extensions -- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). -- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js). -- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended). +The `.mjs` extension makes the file use the [ES modules (ESM)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) format. Node interprets `.js` files in the [CommonJS (CJS)](https://nodejs.org/api/modules.html) format by default, but if you have `"type": "module"` in your `package.json`, you can also use `eslint.config.js`. + +
### Step 3: Running ESLint diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index f4e7106bf9a..9fc886d872b 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -31,7 +31,7 @@ npm i typescript-eslint ## Usage -We recommend getting started by using `tseslint.config` helper function in your ESLint config: +We recommend getting started by using the `tseslint.config()` helper function in your ESLint config: ```js title="eslint.config.mjs" // @ts-check @@ -47,6 +47,15 @@ export default tseslint.config( This config file exports a flat config that enables both the [core ESLint recommended config](https://www.npmjs.com/package/@eslint/js) and [our recommended config](../users/Shared_Configurations.mdx#recommended). +:::note +ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. +However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. +For now we recommend using `tseslint.config()` for use with typescript-eslint configs. + +See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details. + +::: + ### `config(...)` `tseslint.config(...)` takes in any number of ESLint config objects, each of which may additionally include an `extends` array of configs to extend. @@ -105,7 +114,7 @@ Otherwise it _will not_ impact your ability to use our tooling. #### Flat config `extends` -The `tseslint.config` utility function also adds handling for the `extends` property on flat config objects. +The `tseslint.config()` utility function also adds handling for the `extends` property on flat config objects. This allows you to more easily extend shared configs for specific file patterns whilst also overriding rules/options provided by those configs: ```js pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy