Skip to content

docs: add /* eslint-env node */ on top of suggested configs #6918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Getting_Started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions docs/linting/Typed_Linting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions docs/linting/troubleshooting/Formatting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions docs/linting/typed-linting/Monorepos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down