@@ -24,7 +24,10 @@ module.exports = {
2424 'import/no-unresolved' : 'error' ,
2525 'import/no-relative-packages' : 'error' ,
2626 'import/no-self-import' : 'error' ,
27- 'import/newline-after-import' : [ 'error' , { count : 1 , exactCount : true , considerComments : true } ] ,
27+ 'import/newline-after-import' : [
28+ 'error' ,
29+ { count : 1 , exactCount : true , considerComments : true } ,
30+ ] ,
2831 'import/no-duplicates' : 'error' ,
2932
3033 'no-restricted-imports' : 'off' ,
@@ -45,23 +48,27 @@ module.exports = {
4548 ] ,
4649
4750 // https://stackoverflow.com/a/64067915
48- " no-unused-vars" : " off" ,
49- " @typescript-eslint/no-unused-vars" : [
50- " error" ,
51+ ' no-unused-vars' : ' off' ,
52+ ' @typescript-eslint/no-unused-vars' : [
53+ ' error' ,
5154 {
52- " argsIgnorePattern" : "^_" ,
53- " varsIgnorePattern" : "^_" ,
54- " caughtErrorsIgnorePattern" : "^_"
55- }
56- ]
55+ argsIgnorePattern : '^_' ,
56+ varsIgnorePattern : '^_' ,
57+ caughtErrorsIgnorePattern : '^_' ,
58+ } ,
59+ ] ,
5760 } ,
5861
5962 settings : {
6063 'import/parsers' : {
6164 '@typescript-eslint/parser' : [ '.ts' , '.tsx' ] ,
6265 } ,
6366 'import/resolver' : {
64- typescript : { } ,
67+ typescript : {
68+ // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
69+ alwaysTryTypes : true ,
70+ project : './tsconfig.json' ,
71+ } ,
6572 } ,
6673 } ,
6774}
0 commit comments