Upgrade to ESLint v9 flat config (#34324)
Co-authored-by: Nick Schonning <nschonni@gmail.com>
This commit is contained in:
parent
9686ae7060
commit
e8270e2807
21 changed files with 1011 additions and 874 deletions
45
streaming/eslint.config.mjs
Normal file
45
streaming/eslint.config.mjs
Normal file
|
@ -0,0 +1,45 @@
|
|||
// @ts-check
|
||||
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
// eslint-disable-next-line import/no-relative-packages -- Must import from the root
|
||||
import { baseConfig } from '../eslint.config.mjs';
|
||||
|
||||
export default tseslint.config([
|
||||
baseConfig,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
|
||||
parser: tseslint.parser,
|
||||
ecmaVersion: 2021,
|
||||
sourceType: 'module',
|
||||
},
|
||||
|
||||
settings: {
|
||||
'import/ignore': ['node_modules', '\\.(json)$'],
|
||||
'import/resolver': {
|
||||
typescript: {},
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
// In the streaming server we need to delete some variables to ensure
|
||||
// garbage collection takes place on the values referenced by those objects;
|
||||
// The alternative is to declare the variable as nullable, but then we need
|
||||
// to assert it's in existence before every use, which becomes much harder
|
||||
// to maintain.
|
||||
'no-delete-var': 'off',
|
||||
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
devDependencies: ['**/*.config.mjs'],
|
||||
},
|
||||
],
|
||||
|
||||
'import/extensions': ['error', 'always'],
|
||||
},
|
||||
},
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue