Skip to content

Commit 2c6781e

Browse files
update eslint config
1 parent 5e2aec5 commit 2c6781e

2 files changed

Lines changed: 28 additions & 34 deletions

File tree

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
'use strict';
1+
import tseslint from 'typescript-eslint';
22

3-
const path = require('path');
4-
const { FlatCompat } = require('@eslint/eslintrc');
5-
6-
const compat = new FlatCompat({
7-
baseDirectory: __dirname,
8-
});
9-
10-
module.exports = [
3+
export default [
114
{
125
ignores: [
136
'lib/**/*',
147
],
158
},
16-
...compat.config({
17-
parser: '@typescript-eslint/parser',
18-
parserOptions: {
19-
ecmaVersion: 2020,
20-
sourceType: 'module',
9+
...tseslint.configs.recommended,
10+
{
11+
languageOptions: {
12+
parser: tseslint.parser,
13+
parserOptions: {
14+
ecmaVersion: 2020,
15+
sourceType: 'module',
16+
},
17+
},
18+
plugins: {
19+
'@typescript-eslint': tseslint.plugin,
2120
},
22-
plugins: ['@typescript-eslint'],
23-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
2421
rules: {
2522
'unicorn/prefer-module': 'off',
2623
'unicorn/no-abusive-eslint-disable': 'off',
@@ -30,5 +27,5 @@ module.exports = [
3027
'@typescript-eslint/no-require-imports': 'off',
3128
'no-useless-escape': 'off',
3229
},
33-
}),
30+
},
3431
];
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
'use strict';
1+
import tseslint from 'typescript-eslint';
22

3-
const path = require('path');
4-
const { FlatCompat } = require('@eslint/eslintrc');
5-
6-
const compat = new FlatCompat({
7-
baseDirectory: __dirname,
8-
});
9-
10-
module.exports = [
11-
...compat.config({
12-
parser: '@typescript-eslint/parser',
13-
parserOptions: {
14-
ecmaVersion: 2020,
15-
sourceType: 'module',
3+
export default [
4+
...tseslint.configs.recommended,
5+
{
6+
languageOptions: {
7+
parser: tseslint.parser,
8+
parserOptions: {
9+
ecmaVersion: 2020,
10+
sourceType: 'module',
11+
},
12+
},
13+
plugins: {
14+
'@typescript-eslint': tseslint.plugin,
1615
},
17-
plugins: ['@typescript-eslint'],
18-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
1916
rules: {
2017
'unicorn/prefer-module': 'off',
2118
'unicorn/no-abusive-eslint-disable': 'off',
@@ -25,5 +22,5 @@ module.exports = [
2522
'@typescript-eslint/no-require-imports': 'off',
2623
'no-useless-escape': 'off',
2724
},
28-
}),
25+
},
2926
];

0 commit comments

Comments
 (0)