@@ -5,65 +5,77 @@ import eslintConfigPrettier from "eslint-config-prettier";
55import importPlugin from "eslint-plugin-import" ;
66import unusedImports from "eslint-plugin-unused-imports" ;
77
8- export default tseslint . config (
9- eslint . configs . recommended ,
10- ...tseslint . configs . recommended ,
11- eslintConfigPrettier ,
8+ export default [
129 {
13- plugins : {
14- import : importPlugin ,
15- 'unused-imports' : unusedImports ,
16- } ,
17- ignores : [ "dist/" , "node_modules/" ] ,
18- languageOptions : {
19- parser : tseslint . parser ,
20- parserOptions : {
21- project : "./tsconfig.json" ,
10+ ignores : [ "**/dist/**" , "**/node_modules/**" , "**/coverage/**" ] ,
11+ } ,
12+ ...tseslint . config (
13+ eslint . configs . recommended ,
14+ ...tseslint . configs . recommended ,
15+ eslintConfigPrettier ,
16+ {
17+ files : [ "src/**/*.{js,ts}" , "tests/**/*.{js,ts}" , "bin/**/*.{js,ts}" ] ,
18+ plugins : {
19+ import : importPlugin ,
20+ "unused-imports" : unusedImports ,
2221 } ,
23- } ,
24- rules : {
25- // Basic TypeScript rules
26- "@typescript-eslint/no-unused-vars" : [ "warn" , { "ignoreRestSiblings" : true } ] ,
27- "unused-imports/no-unused-imports" : "error" ,
28- "@typescript-eslint/no-explicit-any" : "off" , // Allow any for initial flexibility
29- "@typescript-eslint/explicit-function-return-type" : "off" ,
30- "@typescript-eslint/no-floating-promises" : "warn" ,
22+ languageOptions : {
23+ ecmaVersion : 2022 ,
24+ sourceType : "module" ,
25+ parser : tseslint . parser ,
26+ } ,
27+ rules : {
28+ // Basic TypeScript rules
29+ "@typescript-eslint/no-unused-vars" : [
30+ "warn" ,
31+ {
32+ ignoreRestSiblings : true ,
33+ argsIgnorePattern : "^_" ,
34+ varsIgnorePattern : "^_" ,
35+ caughtErrorsIgnorePattern : "^_" ,
36+ } ,
37+ ] ,
38+ "unused-imports/no-unused-imports" : "error" ,
39+ "@typescript-eslint/no-explicit-any" : "off" ,
40+ "@typescript-eslint/explicit-function-return-type" : "off" ,
41+ "@typescript-eslint/no-floating-promises" : "off" ,
42+
43+ // Basic code quality rules
44+ "no-console" : "off" ,
45+ "prefer-const" : "warn" ,
46+ "no-var" : "warn" ,
47+ eqeqeq : [ "warn" , "always" ] ,
3148
32- // Basic code quality rules
33- "no-console" : "off" , // Allow console logs for development
34- "prefer-const" : "warn" ,
35- "no-var" : "warn" ,
36- eqeqeq : [ "warn" , "always" ] ,
49+ // Light complexity rules
50+ complexity : [ "warn" , { max : 20 } ] ,
51+ "max-depth" : [ "warn" , { max : 4 } ] ,
52+ "max-lines-per-function" : [ "warn" , { max : 150 } ] ,
3753
38- // Light complexity rules
39- complexity : [ "warn" , { max : 20 } ] , // More permissive complexity
40- "max-depth" : [ "warn" , { max : 4 } ] ,
41- "max-lines-per-function" : [ "warn" , { max : 100 } ] ,
54+ // Error prevention
55+ "import/no-duplicates" : "error" ,
56+ "no-template-curly-in-string" : "warn" ,
4257
43- // Error prevention
44- "import/no-duplicates" : "error" , // Using import plugin's rule instead
45- "no-template-curly-in-string" : "warn" ,
58+ // Format and whitespace
59+ "max-len" : [
60+ "warn" ,
61+ {
62+ code : 120 ,
63+ ignoreComments : true ,
64+ ignoreStrings : true ,
65+ ignoreTemplateLiterals : true ,
66+ } ,
67+ ] ,
4668
47- // Format and whitespace
48- "max-len" : [
49- "warn" ,
50- {
51- code : 120 , // More permissive line length
52- ignoreComments : true ,
53- ignoreStrings : true ,
54- ignoreTemplateLiterals : true ,
55- } ,
56- ] ,
69+ // Import rules
70+ "import/extensions" : [ "off" ] ,
71+ "import/no-unresolved" : "off" ,
5772
58- // Import rules
59- "import/extensions" : [
60- "error" ,
61- "ignorePackages" ,
62- {
63- ts : "never" ,
64- tsx : "never" ,
65- } ,
66- ] ,
67- } ,
68- }
69- ) ;
73+ // Disable specific TypeScript rules that require type information
74+ "@typescript-eslint/no-unsafe-assignment" : "off" ,
75+ "@typescript-eslint/no-unsafe-member-access" : "off" ,
76+ "@typescript-eslint/no-unsafe-call" : "off" ,
77+ "@typescript-eslint/no-unsafe-return" : "off" ,
78+ } ,
79+ }
80+ ) ,
81+ ] ;
0 commit comments