11module . exports = {
22 parser : '@typescript-eslint/parser' ,
3- // Specifies the ESLint parser
43 parserOptions : {
54 ecmaVersion : 2020 ,
6- // Allows for the parsing of modern ECMAScript features
5+ // Allows for the parsing of modern ECMAScript features.
76 sourceType : 'module' ,
8- // Allows for the use of imports
7+ // Allows for the use of imports.
98 ecmaFeatures : {
10- jsx : true , // Allows for the parsing of JSX
9+ jsx : true , // Allows for the parsing of JSX.
1110 } ,
12- // project: ['./tsconfig.json'],
1311 } ,
1412
15- plugins : [ 'simple-import-sort' , ' unused-imports'] ,
13+ plugins : [ 'unused-imports' ] ,
1614 extends : [
1715 'plugin:react-hooks/recommended' ,
1816 'plugin:react/recommended' ,
1917 'plugin:@typescript-eslint/recommended' ,
18+ 'plugin:import/recommended' ,
19+ 'plugin:import/typescript' ,
2020 'prettier' ,
2121 ] ,
2222 rules : {
2323 // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
2424 // e.g. '@typescript-eslint/explicit-function-return-type': 'off',
2525 'react/prop-types' : 'warn' ,
2626 'react/jsx-key' : 'warn' ,
27- 'simple-import-sort/imports' : process . env . NODE_ENV === 'test' ? 'error' : 'off' ,
28- 'simple-import-sort/exports' : process . env . NODE_ENV === 'test' ? 'error' : 'off' ,
2927 'react/react-in-jsx-scope' : 'off' ,
28+ // Configuration for import. See: https://github.com/import-js/eslint-plugin-import/tree/main.
29+ 'import/order' : [
30+ 'warn' ,
31+ {
32+ groups : [
33+ 'builtin' ,
34+ 'external' ,
35+ 'internal' ,
36+ [ 'parent' , 'sibling' ] ,
37+ 'index' ,
38+ 'object' ,
39+ 'type' ,
40+ ] ,
41+ alphabetize : {
42+ order : 'asc' ,
43+ caseInsensitive : true ,
44+ } ,
45+ 'newlines-between' : 'always' ,
46+ } ,
47+ ] ,
48+ 'import/no-named-as-default' : 'off' ,
49+ // Configuration for unused-imports. See: https://github.com/sweepline/eslint-plugin-unused-imports#usage.
50+ '@typescript-eslint/no-unused-vars' : 'off' ,
3051 'unused-imports/no-unused-imports' : process . env . NODE_ENV === 'test' ? 'error' : 'warn' ,
3152 'unused-imports/no-unused-vars' : [
3253 'warn' ,
@@ -40,7 +61,11 @@ module.exports = {
4061 } ,
4162 settings : {
4263 react : {
43- version : 'detect' , // Tells eslint-plugin-react to automatically detect the version of React to use
64+ version : 'detect' , // Tells eslint-plugin-react to automatically detect the version of React to use.
65+ } ,
66+ 'import/resolver' : {
67+ typescript : true ,
68+ node : true ,
4469 } ,
4570 } ,
4671} ;
0 commit comments