@@ -11,6 +11,9 @@ module.exports = {
1111 } ,
1212 env : { es6 : true , node : true , commonjs : true } ,
1313 rules : {
14+ // ===============================
15+ // KEEP EXISTING RELAXED RULES
16+ // ===============================
1417 'global-require' : 'off' ,
1518 'func-names' : 'off' ,
1619 'no-underscore-dangle' : 'off' ,
@@ -21,8 +24,109 @@ module.exports = {
2124 'template-curly-spacing' : 'off' ,
2225 indent : 'off' ,
2326 'linebreak-style' : 0 ,
24- 'no-console' : 'off ' ,
27+ 'no-console' : 'warn ' ,
2528 'consistent-return' : 'off' ,
29+
30+ // ===============================
31+ // LIGHT ENTERPRISE ADDITIONS (MOSTLY WARNINGS)
32+ // ===============================
33+
34+ // Critical Error Prevention (errors only for breaking stuff)
35+ 'no-undef' : 'error' ,
36+ 'no-unused-vars' : [
37+ 'warn' ,
38+ {
39+ vars : 'local' ,
40+ args : 'none' ,
41+ varsIgnorePattern : '^_' ,
42+ argsIgnorePattern : '^_' ,
43+ } ,
44+ ] ,
45+ 'no-unreachable' : 'error' ,
46+ 'no-dupe-keys' : 'error' ,
47+ 'no-duplicate-case' : 'error' ,
48+
49+ // Security (light - just warnings to start awareness)
50+ 'no-eval' : 'warn' ,
51+ 'no-implied-eval' : 'warn' ,
52+ 'no-new-func' : 'warn' ,
53+ 'no-script-url' : 'warn' ,
54+
55+ // Code Quality (warnings only - gradual improvement)
56+ 'no-var' : 'warn' , // Encourage let/const
57+ 'prefer-const' : 'warn' , // Encourage immutability
58+ 'no-magic-numbers' : [
59+ 'warn' ,
60+ {
61+ ignore : [ - 1 , 0 , 1 , 2 , 100 , 200 , 201 , 400 , 401 , 403 , 404 , 500 ] ,
62+ ignoreArrayIndexes : true ,
63+ } ,
64+ ] ,
65+ 'prefer-template' : 'warn' ,
66+ 'no-duplicate-imports' : 'warn' ,
67+ 'object-shorthand' : 'warn' ,
68+
69+ // Async/Promise Best Practices (warnings)
70+ 'no-return-await' : 'warn' ,
71+ 'prefer-promise-reject-errors' : 'warn' ,
72+ 'no-async-promise-executor' : 'warn' ,
73+
74+ // Node.js Specific (warnings)
75+ 'no-path-concat' : 'warn' ,
76+ 'no-process-exit' : 'warn' ,
77+ 'handle-callback-err' : 'warn' ,
78+ 'new-cap' : 'warn' ,
79+ 'no-lonely-if' : 'warn' ,
80+ 'no-nested-ternary' : 'warn' ,
81+ camelcase : 'warn' ,
82+ radix : 'warn' ,
83+ 'no-restricted-syntax' : 'warn' ,
84+
85+ // Light Complexity Control (warnings with high thresholds)
86+ complexity : [ 'warn' , { max : 15 } ] , // High threshold for lazy devs
87+ 'max-depth' : [ 'warn' , { max : 5 } ] ,
88+ 'max-params' : [ 'warn' , { max : 4 } ] ,
89+ 'max-lines-per-function' : [
90+ 'warn' ,
91+ {
92+ max : 100 ,
93+ skipBlankLines : true ,
94+ skipComments : true ,
95+ } ,
96+ ] ,
97+
98+ // Import Organization (warnings only)
99+ 'import/order' : [
100+ 'warn' ,
101+ {
102+ groups : [ 'builtin' , 'external' , 'internal' , 'parent' , 'sibling' , 'index' ] ,
103+ 'newlines-between' : 'never' , // Keep it simple
104+ } ,
105+ ] ,
106+ 'import/newline-after-import' : 'warn' ,
107+ 'import/no-duplicates' : 'warn' ,
108+
109+ // Performance Hints (warnings)
110+ 'no-loop-func' : 'warn' ,
111+
112+ // API Design (warnings for better practices)
113+ 'no-throw-literal' : 'warn' ,
114+ 'prefer-rest-params' : 'warn' ,
115+ 'prefer-spread' : 'warn' ,
116+
117+ // Database/Backend Specific (warnings)
118+ 'no-eq-null' : 'warn' , // Encourage strict equality
119+ eqeqeq : [ 'warn' , 'smart' ] , // Allow == null for lazy devs
120+
121+ // Documentation Encouragement (warnings)
122+ 'spaced-comment' : [
123+ 'warn' ,
124+ 'always' ,
125+ {
126+ markers : [ '/' , '!' , '*' ] ,
127+ exceptions : [ '-' , '+' , '*' ] ,
128+ } ,
129+ ] ,
26130 } ,
27131 settings : {
28132 'import/resolver' : {
@@ -32,9 +136,40 @@ module.exports = {
32136 } ,
33137 } ,
34138 overrides : [
139+ // Test Files - More Relaxed
35140 {
36141 files : [ '**/*.test.js' , '**/*.spec.js' , 'src/test/**/*.js' , 'src/__tests__/**/*.js' ] ,
37142 env : { jest : true } ,
143+ rules : {
144+ // Relax rules for test files
145+ 'no-magic-numbers' : 'off' ,
146+ 'max-lines-per-function' : 'off' ,
147+ complexity : 'off' ,
148+ 'max-params' : 'off' ,
149+ 'prefer-promise-reject-errors' : 'off' ,
150+ 'no-console' : 'off' ,
151+ 'import/no-extraneous-dependencies' : 'off' ,
152+ } ,
153+ } ,
154+
155+ // Config Files - Super Relaxed
156+ {
157+ files : [ '*.config.js' , '.eslintrc.js' , 'babel.config.js' , 'webpack.config.js' ] ,
158+ rules : {
159+ 'no-console' : 'off' ,
160+ 'import/no-extraneous-dependencies' : 'off' ,
161+ 'global-require' : 'off' ,
162+ } ,
163+ } ,
164+
165+ // Migration Files - Relaxed (if using DB migrations)
166+ {
167+ files : [ '**/migrations/*.js' , '**/seeders/*.js' ] ,
168+ rules : {
169+ 'no-console' : 'off' ,
170+ 'max-lines-per-function' : 'off' ,
171+ 'no-magic-numbers' : 'off' ,
172+ } ,
38173 } ,
39174 ] ,
40175} ;
0 commit comments