@@ -3,84 +3,84 @@ import globals from "globals";
33import reactHooks from "eslint-plugin-react-hooks" ;
44import reactRefresh from "eslint-plugin-react-refresh" ;
55import tseslint from "typescript-eslint" ;
6- import prettier from "eslint-config-prettier" ;
7- import { globalIgnores } from "eslint/config" ;
6+ import unusedImports from "eslint-plugin-unused-imports" ;
87
98export default tseslint . config ( [
10- globalIgnores ( [ " dist" ] ) ,
9+ { ignores : [ "node_modules/" , " dist/" , "build/" , ".next/" , "coverage/" , "*.config.js" ] } ,
1110 {
12- files : [ "**/*.{ts,tsx}" ] ,
13- ignores : [ "build" , "node_modules" , ".github" , ".vscode" ] ,
11+ files : [ "**/*.{ts,tsx,js,jsx}" ] ,
1412 extends : [ js . configs . recommended , tseslint . configs . recommended , reactHooks . configs [ "recommended-latest" ] , reactRefresh . configs . vite ] ,
1513 languageOptions : {
1614 ecmaVersion : 2020 ,
1715 globals : globals . browser ,
1816 } ,
17+ plugins : {
18+ "unused-imports" : unusedImports ,
19+ } ,
1920 rules : {
21+ // --- Code quality ---
22+ "prefer-const" : "error" ,
2023 "@typescript-eslint/no-explicit-any" : "off" ,
21- "@typescript-eslint/consistent-type-imports" : "off" ,
24+ "@typescript-eslint/no-unused-vars" : [ "warn" , {
25+ args : "all" ,
26+ argsIgnorePattern : "^_" ,
27+ varsIgnorePattern : "^_"
28+ } ] ,
29+ "unused-imports/no-unused-imports" : "error" ,
2230 "no-case-declarations" : "off" ,
2331 "no-constant-binary-expression" : "off" ,
2432
25- // Compact if statements and blocks
26- curly : [ "error" , "multi-line" ] ,
33+ // --- Formatting (ESLint is the sole formatter — no Prettier) ---
34+ "no-trailing-spaces" : "error" ,
35+ "eol-last" : [ "error" , "always" ] ,
36+ "quotes" : [ "error" , "double" , { avoidEscape : true , allowTemplateLiterals : true } ] ,
37+ "semi" : [ "error" , "always" ] ,
38+ "comma-dangle" : [ "error" , "never" ] ,
39+ "indent" : [ "warn" , 2 , { SwitchCase : 1 } ] ,
40+ "comma-spacing" : [ "error" , { before : false , after : true } ] ,
41+ "key-spacing" : [ "error" , { beforeColon : false , afterColon : true , mode : "strict" } ] ,
42+ "keyword-spacing" : [ "error" , { before : true , after : true } ] ,
43+ "space-infix-ops" : "error" ,
44+ "no-multi-spaces" : [ "error" , { ignoreEOLComments : true } ] ,
45+ "block-spacing" : [ "error" , "always" ] ,
46+
47+ // --- Compact / single-line formatting ---
2748 "brace-style" : [ "error" , "1tbs" , { allowSingleLine : true } ] ,
49+ curly : [ "error" , "multi-line" ] ,
2850 "nonblock-statement-body-position" : [ "error" , "beside" ] ,
2951
30- // Object and array formatting - prefer compact single-line objects
52+ // Objects
3153 "object-curly-spacing" : [ "error" , "always" ] ,
32- "object-curly-newline" : [
33- "error" ,
34- {
35- ObjectExpression : { multiline : true , minProperties : 6 , consistent : true } ,
36- ObjectPattern : { multiline : true , minProperties : 6 , consistent : true } ,
37- ImportDeclaration : { multiline : true , minProperties : 8 , consistent : true } ,
38- ExportDeclaration : { multiline : true , minProperties : 8 , consistent : true } ,
39- } ,
40- ] ,
54+ "object-curly-newline" : [ "error" , {
55+ ObjectExpression : { multiline : true } ,
56+ ObjectPattern : { multiline : true } ,
57+ ImportDeclaration : { multiline : true } ,
58+ ExportDeclaration : { multiline : true }
59+ } ] ,
4160 "object-property-newline" : [ "error" , { allowAllPropertiesOnSameLine : true } ] ,
61+
62+ // Arrays
4263 "array-bracket-spacing" : [ "error" , "never" ] ,
4364 "array-bracket-newline" : [ "error" , { multiline : true , minItems : 8 } ] ,
4465 "array-element-newline" : [ "error" , { ArrayExpression : "consistent" , ArrayPattern : { minItems : 8 } } ] ,
4566
46- // Function formatting - allow compact
67+ // Functions
4768 "function-paren-newline" : [ "error" , "consistent" ] ,
4869 "function-call-argument-newline" : [ "error" , "consistent" ] ,
4970
50- // Line length and spacing
51- "max-len" : [
52- "warn" ,
53- {
54- code : 250 ,
55- ignoreStrings : true ,
56- ignoreTemplateLiterals : true ,
57- ignoreComments : true ,
58- ignoreUrls : true ,
59- ignoreRegExpLiterals : true ,
60- } ,
61- ] ,
62-
63- // Semicolons and commas
64- semi : [ "error" , "always" ] ,
65- "comma-dangle" : [ "error" , "only-multiline" ] ,
66- "comma-spacing" : [ "error" , { before : false , after : true } ] ,
67-
68- // JSX formatting - prefer compact single-line elements
69- // Note: React ESLint plugin rules would go here if available
70-
71- // Additional compact formatting rules
72- indent : [ "error" , 2 , { SwitchCase : 1 , ignoredNodes : [ "JSXElement" , "JSXFragment" ] } ] ,
73- "no-multi-spaces" : [ "error" , { ignoreEOLComments : true } ] ,
74- "key-spacing" : [ "error" , { beforeColon : false , afterColon : true , mode : "strict" } ] ,
75-
76- // Block formatting - encourage single line for simple blocks
77- "block-spacing" : [ "error" , "always" ] ,
78- "keyword-spacing" : [ "error" , { before : true , after : true } ] ,
71+ // Line length
72+ "max-len" : [ "warn" , {
73+ code : 250 ,
74+ ignoreStrings : true ,
75+ ignoreTemplateLiterals : true ,
76+ ignoreComments : true ,
77+ ignoreUrls : true ,
78+ ignoreRegExpLiterals : true
79+ } ] ,
7980
80- // React hooks formatting
81+ // React hooks
8182 "react-hooks/rules-of-hooks" : "error" ,
82- "react-hooks/exhaustive-deps" : "warn " ,
83+ "react-hooks/exhaustive-deps" : "off " ,
8384 } ,
8485 } ,
85- prettier ,
8686] ) ;
0 commit comments