Skip to content

Commit 3a3db90

Browse files
Add changeset, globals dep, and Node globals to React ESLint preset (#208)
2 parents f7cea24 + e8fde55 commit 3a3db90

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.changeset/slick-geese-yawn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-preset-react': patch
3+
---
4+
5+
Add missing Node globals to React preset

packages/eslint-presets/eslint-preset-react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"@tcd-devkit/eslint-config-react": "workspace:*",
6363
"@tcd-devkit/eslint-config-react-hooks": "workspace:*",
6464
"@tcd-devkit/eslint-config-ts": "workspace:*",
65-
"eslint-config-prettier": "10.1.8"
65+
"eslint-config-prettier": "10.1.8",
66+
"globals": "16.3.0"
6667
},
6768
"devDependencies": {
6869
"@tcd-devkit/scripts": "workspace:*",

packages/eslint-presets/eslint-preset-react/src/react-preset.linter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Linter } from 'eslint';
22
import prettierConfig from 'eslint-config-prettier/flat';
33
import { defineConfig, globalIgnores } from 'eslint/config';
4+
import globals from 'globals';
45

56
import { baseConfig } from '@tcd-devkit/eslint-config';
67
import { a11yConfig } from '@tcd-devkit/eslint-config-a11y';
@@ -17,6 +18,11 @@ const ignoresConfig = globalIgnores(
1718
export const reactPreset: Linter.Config[] = defineConfig(
1819
{
1920
name: '@tcd-devkit/eslint-preset-react',
21+
languageOptions: {
22+
globals: {
23+
...globals.node,
24+
},
25+
},
2026
extends: [
2127
baseConfig,
2228
tsConfig,

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)