@@ -21,6 +21,34 @@ module.exports = {
21
21
// Next top 3 code quality rules
22
22
"no-var" : "error" , // Use let/const instead of var
23
23
"prefer-const" : "error" , // Use const for variables that never change
24
- "no-redeclare" : "error" // Prevent variable redeclaration
24
+ "no-redeclare" : "error" , // Prevent variable redeclaration
25
+
26
+ // Additional rules based on WASM code analysis
27
+ "radix" : "error" , // Require radix parameter for parseInt()
28
+ "no-magic-numbers" : [ "warn" , { // Discourage magic numbers
29
+ "ignore" : [ - 1000 , - 5 , - 1 , 0 , 1 , 2 , 3 , 4 , 5 , 8 , 10 , 15 , 16 , 17 , 20 , 30 , 32 , 50 , 60 , 100 , 200 , 250 , 300 , 512 , 1000 , 1024 , 32767 , 44100 , 1000000 ] ,
30
+ "ignoreArrayIndexes" : true ,
31
+ "enforceConst" : true ,
32
+ "ignoreDefaultValues" : true ,
33
+ "detectObjects" : false
34
+ } ] ,
35
+ "complexity" : [ "warn" , 35 ] , // Warn on high function complexity (increased for complex graphics/UI code)
36
+ "max-len" : [ "warn" , { // Limit line length for readability
37
+ "code" : 140 , // Increased for complex expressions
38
+ "ignoreUrls" : true ,
39
+ "ignoreStrings" : true ,
40
+ "ignoreTemplateLiterals" : true ,
41
+ "ignoreComments" : true
42
+ } ] ,
43
+ "no-console" : "off" , // Allow console for this debugging-heavy codebase
44
+ "prefer-template" : "warn" , // Prefer template literals over string concatenation
45
+ "no-implicit-coercion" : "warn" , // Warn instead of error for implicit type coercion
46
+ "require-await" : "warn" , // Warn instead of error for async functions without await
47
+ "no-await-in-loop" : "warn" , // Warn about await in loops (performance)
48
+ "no-promise-executor-return" : "error" , // Prevent return in Promise executor
49
+ "prefer-promise-reject-errors" : "error" , // Require Error objects for Promise.reject
50
+ "no-unreachable" : "error" , // Catch unreachable code
51
+ "no-empty-function" : "off" , // Allow empty functions (common for stubs)
52
+ "consistent-return" : "warn" // Warn about inconsistent return statements
25
53
}
26
54
} ;
0 commit comments