diff --git a/docs/Getting_Started.mdx b/docs/Getting_Started.mdx index cdaf39899a9a..28399ac0f4b2 100644 --- a/docs/Getting_Started.mdx +++ b/docs/Getting_Started.mdx @@ -20,6 +20,7 @@ npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugi Next, create a `.eslintrc.cjs` config file in the root of your project, and populate it with the following: ```js title=".eslintrc.cjs" +/* eslint-env node */ module.exports = { extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], parser: '@typescript-eslint/parser', diff --git a/docs/linting/Typed_Linting.mdx b/docs/linting/Typed_Linting.mdx index a51afdad02b5..b4c7e6e93760 100644 --- a/docs/linting/Typed_Linting.mdx +++ b/docs/linting/Typed_Linting.mdx @@ -7,6 +7,7 @@ Some typescript-eslint rules utilize the awesome power of TypeScript's type chec To tap into TypeScript's additional powers, there are two small changes you need to make to your config file: ```js title=".eslintrc.js" +/* eslint-env node */ module.exports = { extends: [ 'eslint:recommended', diff --git a/docs/linting/troubleshooting/Formatting.mdx b/docs/linting/troubleshooting/Formatting.mdx index 345ac00acf49..fecec612bdcf 100644 --- a/docs/linting/troubleshooting/Formatting.mdx +++ b/docs/linting/troubleshooting/Formatting.mdx @@ -38,6 +38,7 @@ 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" +/* eslint-env node */ module.exports = { extends: [ 'eslint:recommended', diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx index dd94b933317d..19cd0639bc69 100644 --- a/docs/linting/typed-linting/Monorepos.mdx +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -43,6 +43,7 @@ Paths may be provided as [Node globs](https://github.com/isaacs/node-glob/blob/f For each file being linted, the first matching project path will be used as its backing TSConfig. ```js title=".eslintrc.js" +/* eslint-env node */ module.exports = { extends: [ 'eslint:recommended', @@ -68,6 +69,7 @@ Using wide globs `**` in your `parserOptions.project` may degrade linting perfor Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. ```js title=".eslintrc.js" +/* eslint-env node */ module.exports = { extends: [ 'eslint:recommended',