Skip to content

Commit c12f1d8

Browse files
committed
chore(eslint): migrate to flat config
1 parent f19ac8c commit c12f1d8

File tree

3 files changed

+68
-61
lines changed

3 files changed

+68
-61
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.cjs

-59
This file was deleted.

eslint.config.js

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { builtinModules } from 'module';
2+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
3+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default tseslint.config(
7+
{
8+
ignores: ['**/node_modules/', '**/dist/'],
9+
},
10+
tseslint.configs.recommended,
11+
{
12+
plugins: {
13+
'simple-import-sort': simpleImportSort,
14+
},
15+
rules: {
16+
'@typescript-eslint/explicit-module-boundary-types': 'off',
17+
'@typescript-eslint/no-inferrable-types': 'off',
18+
'@typescript-eslint/ban-types': 'off',
19+
'@typescript-eslint/no-redeclare': 'off',
20+
'@typescript-eslint/no-empty-object-type': 'off',
21+
'@typescript-eslint/no-non-null-assertion': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'@typescript-eslint/no-empty-interface': 'off',
24+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
25+
'@typescript-eslint/explicit-member-accessibility': ['warn', { accessibility: 'no-public' }],
26+
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
27+
'simple-import-sort/exports': 'warn',
28+
'simple-import-sort/imports': [
29+
'warn',
30+
{
31+
groups: [
32+
// Side effect imports.
33+
['^\\u0000'],
34+
[
35+
// Node.js builtins.
36+
`^node:`,
37+
`^(${builtinModules.join('|')})(/|$)`,
38+
// Packages.
39+
'^@?\\w',
40+
// Internal packages.
41+
'^(src)(/.*|$)',
42+
// Parent imports. Put `..` last.
43+
'^\\.\\.(?!/?$)',
44+
'^\\.\\./?$',
45+
// Other relative imports. Put same-folder imports and `.` last.
46+
'^\\./(?=.*/)(?!/?$)',
47+
'^\\.(?!/?$)',
48+
'^\\./?$',
49+
],
50+
],
51+
},
52+
],
53+
},
54+
},
55+
{
56+
files: ['*.js', '*.cjs', '*.cts'],
57+
rules: {
58+
'@typescript-eslint/no-var-requires': 'off',
59+
},
60+
},
61+
{
62+
files: ['*.test.ts'],
63+
rules: {
64+
'@typescript-eslint/ban-ts-comment': 'off',
65+
},
66+
},
67+
prettierRecommended,
68+
);

0 commit comments

Comments
 (0)