@@ -2,20 +2,33 @@ import eslint from '@eslint/js'
22import tseslint from 'typescript-eslint'
33import prettier from 'eslint-plugin-prettier'
44import simpleImportSort from 'eslint-plugin-simple-import-sort'
5+ import unusedImports from 'eslint-plugin-unused-imports'
6+ import eslintImport from 'eslint-plugin-import'
7+
8+ import globals from 'globals'
59
610export default tseslint . config (
711 { ignores : [ 'node_modules' , 'dist' , 'generated' ] } ,
812 {
9- extends : [ eslint . configs . recommended , ... tseslint . configs . recommended ] ,
13+ extends : [ ... tseslint . configs . recommendedTypeChecked , eslint . configs . recommended ] ,
1014 files : [ '**/*.ts' ] ,
1115 plugins : {
1216 'simple-import-sort' : simpleImportSort ,
1317 'prettier' : prettier ,
18+ 'unused-imports' : unusedImports ,
19+ 'eslint-plugin-import' : eslintImport ,
1420 } ,
1521 languageOptions : {
22+ parserOptions : {
23+ projectService : true ,
24+ tsconfigRootDir : import . meta. dirname ,
25+ } ,
1626 parser : tseslint . parser ,
1727 ecmaVersion : 2020 ,
1828 sourceType : 'module' ,
29+ globals : {
30+ ...globals . node
31+ }
1932 } ,
2033 rules : {
2134 'prettier/prettier' : [
@@ -29,6 +42,36 @@ export default tseslint.config(
2942 semi : false ,
3043 } ,
3144 ] ,
32- }
45+ 'unused-imports/no-unused-imports' : 'error' ,
46+ 'unused-imports/no-unused-vars' : [
47+ 'warn' ,
48+ {
49+ vars : 'all' ,
50+ varsIgnorePattern : '^_' ,
51+ args : 'after-used' ,
52+ argsIgnorePattern : '^_' ,
53+ } ,
54+ ] ,
55+ 'simple-import-sort/imports' : 'error' ,
56+ 'simple-import-sort/exports' : 'error' ,
57+ 'no-duplicate-imports' : [ "error" , { "includeExports" : true } ] ,
58+ 'eslint-plugin-import/no-duplicates' : 'error' ,
59+ 'no-unused-vars' : 'off' ,
60+ '@typescript-eslint/no-unused-vars' : [
61+ 'warn' ,
62+ {
63+ vars : 'all' ,
64+ varsIgnorePattern : '^_' ,
65+ args : 'after-used' ,
66+ argsIgnorePattern : '^_' ,
67+ } ,
68+ ] ,
69+ '@typescript-eslint/restrict-template-expressions' : 'off' ,
70+ '@typescript-eslint/no-misused-promises' : 'off' ,
71+ '@typescript-eslint/no-base-to-string' : 'off' ,
72+ '@typescript-eslint/no-floating-promises' : 'off' ,
73+ '@typescript-eslint/no-explicit-any' : 'off' ,
74+ '@typescript-eslint/unbound-method' : 'off' ,
75+ } ,
3376 }
3477)
0 commit comments