Skip to content

Commit d382dbe

Browse files
update eslint config
1 parent fb5eb2a commit d382dbe

2 files changed

Lines changed: 30 additions & 51 deletions

File tree

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,26 @@
1-
import tseslint from 'typescript-eslint';
2-
import globals from 'globals';
3-
import oclif from 'eslint-config-oclif';
4-
import oclifTypescript from 'eslint-config-oclif-typescript';
1+
'use strict';
52

6-
export default [
7-
...tseslint.configs.recommended,
3+
const path = require('path');
4+
const { FlatCompat } = require('@eslint/eslintrc');
85

9-
oclif,
10-
11-
oclifTypescript,
6+
const compat = new FlatCompat({
7+
baseDirectory: __dirname,
8+
});
129

10+
module.exports = [
1311
{
1412
ignores: [
1513
'lib/**/*',
1614
],
1715
},
18-
19-
{
20-
languageOptions: {
21-
parser: tseslint.parser,
22-
parserOptions: {
23-
ecmaVersion: 2020,
24-
sourceType: 'module',
25-
},
26-
globals: {
27-
...globals.node,
28-
},
16+
...compat.config({
17+
parser: '@typescript-eslint/parser',
18+
parserOptions: {
19+
ecmaVersion: 2020,
20+
sourceType: 'module',
2921
},
30-
31-
plugins: {
32-
'@typescript-eslint': tseslint.plugin,
33-
},
34-
22+
plugins: ['@typescript-eslint'],
23+
extends: ['oclif', 'oclif-typescript'],
3524
rules: {
3625
'unicorn/prefer-module': 'off',
3726
'@typescript-eslint/no-require-imports': 'off',
@@ -47,5 +36,5 @@ export default [
4736
'object-curly-spacing': ['error', 'never'],
4837
'node/no-missing-import': 'off',
4938
},
50-
},
39+
}),
5140
];
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
import tseslint from 'typescript-eslint';
2-
import globals from 'globals';
3-
import oclif from 'eslint-config-oclif';
4-
import oclifTypescript from 'eslint-config-oclif-typescript';
1+
'use strict';
52

6-
export default [
7-
...tseslint.configs.recommended,
3+
const path = require('path');
4+
const { FlatCompat } = require('@eslint/eslintrc');
85

9-
oclif,
6+
const compat = new FlatCompat({
7+
baseDirectory: __dirname,
8+
});
109

11-
oclifTypescript,
12-
13-
{
14-
languageOptions: {
15-
parser: tseslint.parser,
16-
parserOptions: {
17-
ecmaVersion: 2020,
18-
sourceType: 'module',
19-
},
20-
globals: {
21-
...globals.node,
22-
},
23-
},
24-
25-
plugins: {
26-
'@typescript-eslint': tseslint.plugin,
10+
module.exports = [
11+
...compat.config({
12+
parser: '@typescript-eslint/parser',
13+
parserOptions: {
14+
ecmaVersion: 2020,
15+
sourceType: 'module',
2716
},
28-
17+
plugins: ['@typescript-eslint'],
18+
extends: ['oclif', 'oclif-typescript'],
2919
rules: {
3020
'unicorn/prefer-module': 'off',
3121
'@typescript-eslint/no-require-imports': 'off',
@@ -41,5 +31,5 @@ export default [
4131
'object-curly-spacing': ['error', 'never'],
4232
'node/no-missing-import': 'off',
4333
},
44-
},
34+
}),
4535
];

0 commit comments

Comments
 (0)