-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate eslint config to v9 flat format
- Loading branch information
Showing
8 changed files
with
229 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// SPDX-FileCopyrightText: 2017-2024 City of Espoo | ||
// | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
import eslint from '@eslint/js' | ||
import tsParser from '@typescript-eslint/parser' | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' | ||
import globals from 'globals' | ||
import typescriptEslint from 'typescript-eslint' | ||
|
||
export default [ | ||
{ ignores: ['.yarn', 'dist', 'eslint.config.mjs'] }, | ||
eslint.configs.recommended, | ||
...typescriptEslint.configs.recommended, | ||
...typescriptEslint.configs.stylisticTypeChecked, | ||
{ | ||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
parserOptions: { | ||
projectService: true, | ||
project: './tsconfig.json', | ||
tsconfigRootDir: import.meta.dirname, | ||
globals: globals.node, | ||
ecmaFeatures: { | ||
modules: true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
args: 'all', | ||
argsIgnorePattern: '^_', | ||
caughtErrors: 'all', | ||
caughtErrorsIgnorePattern: '^.*', | ||
destructuredArrayIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
ignoreRestSiblings: true | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
files: ['**/*.{ts,js,mjs}'], | ||
rules: { | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/no-empty-object-type': [ | ||
'error', | ||
{ allowInterfaces: 'always' } | ||
], | ||
'@typescript-eslint/no-misused-promises': [ | ||
'error', | ||
{ checksVoidReturn: false } | ||
], | ||
'@typescript-eslint/prefer-nullish-coalescing': 'off', | ||
'@typescript-eslint/prefer-optional-chain': 'off', | ||
'@typescript-eslint/prefer-promise-reject-errors': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.{js,mjs}'], | ||
rules: { | ||
'@typescript-eslint/no-var-requires': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
rules: { | ||
'@typescript-eslint/no-require-imports': 'off' | ||
} | ||
}, | ||
eslintPluginPrettierRecommended | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.