chore: add nodejs globals
Added nodejs globals to the project for better development. This will be changed and a config to change the globals will be added.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
"@eslint/eslintrc": "^2.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"globals": "^13.20.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import tsEslint from '@typescript-eslint/eslint-plugin';
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import js from '@eslint/js';
|
||||
import * as configs from './configs/index.js';
|
||||
import globals from 'globals';
|
||||
import { getUserRules } from './userOptions.js';
|
||||
|
||||
/**
|
||||
@@ -37,6 +38,11 @@ export function defineConfig(userConfig) {
|
||||
// eslint-disable-next-line no-undef
|
||||
tsconfigRootDir: process.cwd(),
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
globals: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
...globals.nodeBuiltin,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error The `@typescript-eslint/eslint-plugin` package doesn't export
|
||||
// rules as `RulesRecord` type.
|
||||
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -84,6 +84,9 @@ importers:
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^5.45.0
|
||||
version: 5.45.0(eslint@8.44.0)(typescript@5.1.6)
|
||||
globals:
|
||||
specifier: ^13.20.0
|
||||
version: 13.20.0
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
version: 5.1.6
|
||||
|
||||
Reference in New Issue
Block a user