Migrate ESLint to flat config format (v9) and update CI workflow
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
run: npx eslint "src/**/*.ts" --ext .ts
|
run: npx eslint "src/**/*.ts"
|
||||||
|
|
||||||
- name: Run Prettier check
|
- name: Run Prettier check
|
||||||
run: npx prettier --check "src/**/*.ts" "test/**/*.ts"
|
run: npx prettier --check "src/**/*.ts" "test/**/*.ts"
|
||||||
|
|||||||
39
eslint.config.js
Normal file
39
eslint.config.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
const js = require('@eslint/js');
|
||||||
|
const parser = require('@typescript-eslint/parser');
|
||||||
|
const plugin = require('@typescript-eslint/eslint-plugin');
|
||||||
|
const prettierPlugin = require('eslint-plugin-prettier');
|
||||||
|
const prettierConfig = require('eslint-config-prettier');
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
js.configs.recommended,
|
||||||
|
prettierConfig,
|
||||||
|
{
|
||||||
|
files: ['**/*.ts'],
|
||||||
|
languageOptions: {
|
||||||
|
parser: parser,
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
node: true,
|
||||||
|
jest: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
'@typescript-eslint': plugin,
|
||||||
|
prettier: prettierPlugin,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...plugin.configs.recommended.rules,
|
||||||
|
'@typescript-eslint/interface-name-prefix': 'off',
|
||||||
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'prettier/prettier': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
|
||||||
|
},
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user