From 65942c23fdd661260fd2423151a1e711285db542 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 18 Jun 2025 13:00:10 +0530 Subject: [PATCH 1/2] docs: remove legacy notes about CJS extensions and __dirname --- docs/getting-started/Legacy_ESLint_Setup.mdx | 4 ---- docs/getting-started/Quickstart.mdx | 7 ------- docs/getting-started/Typed_Linting.mdx | 5 ----- 3 files changed, 16 deletions(-) diff --git a/docs/getting-started/Legacy_ESLint_Setup.mdx b/docs/getting-started/Legacy_ESLint_Setup.mdx index e1fba92b698b..e99c35f02b8f 100644 --- a/docs/getting-started/Legacy_ESLint_Setup.mdx +++ b/docs/getting-started/Legacy_ESLint_Setup.mdx @@ -37,10 +37,6 @@ module.exports = { }; ``` -:::info -If your project doesn't use ESM, naming the file as `.eslintrc.js` is fine. See [ESLint's Configuration Files docs](https://eslint.org/docs/user-guide/configuring/configuration-files) for more info. -::: - ### Step 3: Running ESLint Open a terminal to the root of your project and run the following command: diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx index 79e65c2b9915..a31ffdd7bc7b 100644 --- a/docs/getting-started/Quickstart.mdx +++ b/docs/getting-started/Quickstart.mdx @@ -45,13 +45,6 @@ export default tseslint.config( This code will enable our [recommended configuration](../users/Shared_Configurations.mdx) for linting. -
-Aside on file extensions - -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`. - -
- #### Details - `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx index 56d02afed969..95f225038dd3 100644 --- a/docs/getting-started/Typed_Linting.mdx +++ b/docs/getting-started/Typed_Linting.mdx @@ -40,11 +40,6 @@ export default tseslint.config( ); ``` -:::note -[`import.meta.dirname`](https://nodejs.org/api/esm.html#importmetadirname) is only present for ESM files in Node.js >=20.11.0 / >= 21.2.0.
-For CommonJS modules and/or older versions of Node.js, [use `__dirname` or an alternative](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules). -::: - In more detail: - `tseslint.configs.recommendedTypeChecked` is a [shared configuration](../users/Shared_Configurations.mdx). It contains recommended rules that additionally require type information. From ad23629df5048519ea7a798c133c787e08f444ec Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Tue, 24 Jun 2025 15:38:30 +0530 Subject: [PATCH 2/2] revert: add CJS notes back --- docs/getting-started/Legacy_ESLint_Setup.mdx | 4 ++++ docs/getting-started/Quickstart.mdx | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/docs/getting-started/Legacy_ESLint_Setup.mdx b/docs/getting-started/Legacy_ESLint_Setup.mdx index e99c35f02b8f..e1fba92b698b 100644 --- a/docs/getting-started/Legacy_ESLint_Setup.mdx +++ b/docs/getting-started/Legacy_ESLint_Setup.mdx @@ -37,6 +37,10 @@ module.exports = { }; ``` +:::info +If your project doesn't use ESM, naming the file as `.eslintrc.js` is fine. See [ESLint's Configuration Files docs](https://eslint.org/docs/user-guide/configuring/configuration-files) for more info. +::: + ### Step 3: Running ESLint Open a terminal to the root of your project and run the following command: diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx index a31ffdd7bc7b..79e65c2b9915 100644 --- a/docs/getting-started/Quickstart.mdx +++ b/docs/getting-started/Quickstart.mdx @@ -45,6 +45,13 @@ export default tseslint.config( This code will enable our [recommended configuration](../users/Shared_Configurations.mdx) for linting. +
+Aside on file extensions + +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`. + +
+ #### Details - `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). 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