@@ -13,6 +13,7 @@ const importXPlugin = require('eslint-plugin-import-x')
1313const nodePlugin = require ( 'eslint-plugin-n' )
1414const sortDestructureKeysPlugin = require ( 'eslint-plugin-sort-destructure-keys' )
1515const unicornPlugin = require ( 'eslint-plugin-unicorn' )
16+ const globals = require ( 'globals' )
1617const tsEslint = require ( 'typescript-eslint' )
1718
1819const constants = require ( '@socketsecurity/registry/lib/constants' )
@@ -34,15 +35,16 @@ const sharedPlugins = {
3435}
3536
3637const sharedRules = {
37- 'no-await-in-loop' : [ 'error' ] ,
38- 'no-control-regex' : [ 'error' ] ,
38+ 'no-await-in-loop' : 'error' ,
39+ 'no-control-regex' : 'error' ,
3940 'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
40- 'no-new' : [ 'error' ] ,
41- 'no-proto' : [ 'error' ] ,
41+ 'no-new' : 'error' ,
42+ 'no-proto' : 'error' ,
43+ 'no-undef' : 'error' ,
4244 'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' ] } ] ,
43- 'sort-destructure-keys/sort-destructure-keys' : [ 'error' ] ,
45+ 'sort-destructure-keys/sort-destructure-keys' : 'error' ,
4446 'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ] ,
45- 'unicorn/consistent-function-scoping' : [ 'error' ]
47+ 'unicorn/consistent-function-scoping' : 'error'
4648}
4749
4850const sharedRulesForImportX = {
@@ -141,6 +143,14 @@ module.exports = [
141143 {
142144 files : [ 'src/**/*.ts' , 'test/**/*.ts' ] ,
143145 languageOptions : {
146+ globals : {
147+ BufferConstructor : 'readonly' ,
148+ BufferEncoding : 'readonly' ,
149+ NodeJS : 'readonly' ,
150+ ...Object . fromEntries (
151+ Object . entries ( globals . node ) . map ( ( [ k ] ) => [ k , 'readonly' ] )
152+ )
153+ } ,
144154 parser : tsParser ,
145155 parserOptions : {
146156 projectService : {
@@ -160,7 +170,7 @@ module.exports = [
160170 rules : {
161171 ...sharedRules ,
162172 '@typescript-eslint/array-type' : [ 'error' , { default : 'array-simple' } ] ,
163- '@typescript-eslint/no-misused-new' : [ 'error' ] ,
173+ '@typescript-eslint/no-misused-new' : 'error' ,
164174 '@typescript-eslint/no-this-alias' : [
165175 'error' ,
166176 { allowDestructuring : true }
0 commit comments