Skip to content

Commit c0250d0

Browse files
authored
Add Import Linting and Unused Import Detection (#1410)
1 parent c0c37e6 commit c0250d0

File tree

105 files changed

+2082
-464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+2082
-464
lines changed

eslint.config.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import js from '@eslint/js';
21
import babelParser from '@babel/eslint-parser';
3-
import prettierRecommended from 'eslint-plugin-prettier/recommended';
2+
import js from '@eslint/js';
43
import { defineConfig } from 'eslint/config';
4+
import importPlugin from 'eslint-plugin-import';
5+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
6+
import unusedImports from 'eslint-plugin-unused-imports';
57

68
export default defineConfig([
79
js.configs.recommended,
@@ -11,6 +13,32 @@ export default defineConfig([
1113
languageOptions: {
1214
ecmaVersion: 2021,
1315
},
16+
plugins: {
17+
import: importPlugin,
18+
'unused-imports': unusedImports,
19+
},
20+
rules: {
21+
complexity: ['error', { max: 35 }],
22+
'unused-imports/no-unused-imports': 'error',
23+
'import/order': [
24+
'warn',
25+
{
26+
alphabetize: {
27+
order: 'asc',
28+
caseInsensitive: true,
29+
},
30+
groups: [
31+
'builtin',
32+
'external',
33+
'internal',
34+
'parent',
35+
'sibling',
36+
'index',
37+
],
38+
'newlines-between': 'always',
39+
},
40+
],
41+
},
1442
},
1543

1644
{
@@ -24,7 +52,6 @@ export default defineConfig([
2452
},
2553
rules: {
2654
strict: ['error', 'safe'],
27-
complexity: ['error', { max: 35 }],
2855
'no-prototype-builtins': 'off',
2956
'no-redeclare': 'off',
3057
'no-undef': 'off',

0 commit comments

Comments
 (0)