@@ -5,7 +5,7 @@ import unusedImportsPlugin from "eslint-plugin-unused-imports";
55
66export default [
77 {
8- ignores : [ "node_modules/** " , "dist/** " , "**/*.js " , "**/*.d.ts " , "tools/** " , "coverage/**" , "layer/** "]
8+ ignores : [ "node_modules/" , "dist/" , "build/ " , "coverage/ " , "layer/ " , "*.config.js " ]
99 } ,
1010 {
1111 files : [ "src/**/*.ts" ] ,
@@ -22,37 +22,63 @@ export default [
2222 "unused-imports" : unusedImportsPlugin
2323 } ,
2424 rules : {
25- // Unused imports and variables (auto-fixable)
25+ // --- Code quality ---
26+ "prefer-const" : "error" ,
27+ "@typescript-eslint/no-explicit-any" : "off" ,
28+ "@typescript-eslint/no-unused-vars" : [ "warn" , {
29+ args : "all" ,
30+ argsIgnorePattern : "^_" ,
31+ varsIgnorePattern : "^_"
32+ } ] ,
2633 "unused-imports/no-unused-imports" : "error" ,
27- "unused-imports/no-unused-vars" : [
28- "error" ,
29- {
30- vars : "all" ,
31- varsIgnorePattern : "^_|^start$|^result$|^app$|^interfaces$" ,
32- args : "after-used" ,
33- argsIgnorePattern : "^_|^req$|^res$|^au$|^ex$|^e$|^bind$|^next$|^report$|^config$" ,
34- caughtErrors : "all" ,
35- caughtErrorsIgnorePattern : "^_"
36- }
37- ] ,
3834
39- // TypeScript-specific rules (matching MembershipApi)
40- "@typescript-eslint/no-unused-vars" : "off" , // Turn off in favor of unused-imports plugin
41- "@typescript-eslint/no-explicit-any" : "off" ,
42- "@typescript-eslint/explicit-function-return-type" : "off" ,
43- "@typescript-eslint/no-require-imports" : "error" ,
44- "@typescript-eslint/no-inferrable-types" : "off" ,
35+ // --- Formatting (ESLint is the sole formatter — no Prettier) ---
36+ "no-trailing-spaces" : "error" ,
37+ "eol-last" : [ "error" , "always" ] ,
38+ "quotes" : [ "error" , "double" , { avoidEscape : true , allowTemplateLiterals : true } ] ,
39+ "semi" : [ "error" , "always" ] ,
40+ "comma-dangle" : [ "error" , "never" ] ,
41+ "indent" : [ "warn" , 2 , { SwitchCase : 1 } ] ,
42+ "comma-spacing" : [ "error" , { before : false , after : true } ] ,
43+ "key-spacing" : [ "error" , { beforeColon : false , afterColon : true , mode : "strict" } ] ,
44+ "keyword-spacing" : [ "error" , { before : true , after : true } ] ,
45+ "space-infix-ops" : "error" ,
46+ "no-multi-spaces" : [ "error" , { ignoreEOLComments : true } ] ,
47+ "block-spacing" : [ "error" , "always" ] ,
4548
46- // General rules (matching MembershipApi)
47- "prefer-const " : "error" ,
48- "no-unused-vars" : "off ", // Turn off base rule since we use unused-imports plugin
49- indent : "off ", // Delegate indentation to Prettier for consistency with VS Code
49+ // --- Compact / single-line formatting ---
50+ "brace-style " : [ "error" , "1tbs" , { allowSingleLine : true } ] ,
51+ curly : [ "error ", "multi-line" ] ,
52+ "nonblock-statement-body-position" : [ "error ", "beside" ] ,
5053
51- // Code style (enforced by Prettier, but useful for linting)
52- semi : [ "error" , "always" ] ,
53- quotes : [ "error" , "double" , { "avoidEscape" : false } ] ,
54- "comma-dangle" : [ "error" , "never" ] ,
55- "max-len" : [ "off" ] ,
54+ // Objects
55+ "object-curly-spacing" : [ "error" , "always" ] ,
56+ "object-curly-newline" : [ "error" , {
57+ ObjectExpression : { multiline : true } ,
58+ ObjectPattern : { multiline : true } ,
59+ ImportDeclaration : { multiline : true } ,
60+ ExportDeclaration : { multiline : true }
61+ } ] ,
62+ "object-property-newline" : [ "error" , { allowAllPropertiesOnSameLine : true } ] ,
63+
64+ // Arrays
65+ "array-bracket-spacing" : [ "error" , "never" ] ,
66+ "array-bracket-newline" : [ "error" , { multiline : true , minItems : 8 } ] ,
67+ "array-element-newline" : [ "error" , { ArrayExpression : "consistent" , ArrayPattern : { minItems : 8 } } ] ,
68+
69+ // Functions
70+ "function-paren-newline" : [ "error" , "consistent" ] ,
71+ "function-call-argument-newline" : [ "error" , "consistent" ] ,
72+
73+ // Generous line length
74+ "max-len" : [ "warn" , {
75+ code : 250 ,
76+ ignoreStrings : true ,
77+ ignoreTemplateLiterals : true ,
78+ ignoreComments : true ,
79+ ignoreUrls : true ,
80+ ignoreRegExpLiterals : true
81+ } ] ,
5682
5783 // Module separation rules for monolith
5884 "import/no-restricted-paths" : [
@@ -62,38 +88,32 @@ export default [
6288 {
6389 target : "./src/modules/attendance/**/*" ,
6490 from : "./src/modules/!(attendance)/**/*" ,
65- message :
66- "Attendance module should not import directly from other modules. Use shared interfaces or dependency injection."
91+ message : "Attendance module should not import directly from other modules. Use shared interfaces or dependency injection."
6792 } ,
6893 {
6994 target : "./src/modules/content/**/*" ,
7095 from : "./src/modules/!(content)/**/*" ,
71- message :
72- "Content module should not import directly from other modules. Use shared interfaces or dependency injection."
96+ message : "Content module should not import directly from other modules. Use shared interfaces or dependency injection."
7397 } ,
7498 {
7599 target : "./src/modules/doing/**/*" ,
76100 from : "./src/modules/!(doing)/**/*" ,
77- message :
78- "Doing module should not import directly from other modules. Use shared interfaces or dependency injection."
101+ message : "Doing module should not import directly from other modules. Use shared interfaces or dependency injection."
79102 } ,
80103 {
81104 target : "./src/modules/giving/**/*" ,
82105 from : "./src/modules/!(giving)/**/*" ,
83- message :
84- "Giving module should not import directly from other modules. Use shared interfaces or dependency injection."
106+ message : "Giving module should not import directly from other modules. Use shared interfaces or dependency injection."
85107 } ,
86108 {
87109 target : "./src/modules/membership/**/*" ,
88110 from : "./src/modules/!(membership)/**/*" ,
89- message :
90- "Membership module should not import directly from other modules. Use shared interfaces or dependency injection."
111+ message : "Membership module should not import directly from other modules. Use shared interfaces or dependency injection."
91112 } ,
92113 {
93114 target : "./src/modules/messaging/**/*" ,
94115 from : "./src/modules/!(messaging)/**/*" ,
95- message :
96- "Messaging module should not import directly from other modules. Use shared interfaces or dependency injection."
116+ message : "Messaging module should not import directly from other modules. Use shared interfaces or dependency injection."
97117 }
98118 ]
99119 }
0 commit comments