@sun-asterisk/sunlint 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +107 -1
  2. package/CONTRIBUTING.md +1654 -66
  3. package/README.md +19 -6
  4. package/config/ci-cd.json +54 -0
  5. package/config/development.json +56 -0
  6. package/config/engines/engines-enhanced.json +86 -0
  7. package/config/engines/semantic-config.json +114 -0
  8. package/config/eslint-rule-mapping.json +50 -38
  9. package/config/large-project.json +143 -0
  10. package/config/presets/all.json +0 -1
  11. package/config/release.json +70 -0
  12. package/config/rule-analysis-strategies.js +23 -4
  13. package/config/rules/S027-categories.json +122 -0
  14. package/config/rules/enhanced-rules-registry.json +2564 -0
  15. package/config/rules/rules-registry-generated.json +785 -837
  16. package/config/rules/rules-registry.json +13 -1
  17. package/core/adapters/sunlint-rule-adapter.js +25 -30
  18. package/core/analysis-orchestrator.js +42 -2
  19. package/core/categories.js +52 -0
  20. package/core/category-constants.js +39 -0
  21. package/core/cli-action-handler.js +53 -32
  22. package/core/cli-program.js +11 -3
  23. package/core/config-manager.js +111 -0
  24. package/core/config-merger.js +88 -0
  25. package/core/constants/categories.js +168 -0
  26. package/core/constants/defaults.js +165 -0
  27. package/core/constants/engines.js +185 -0
  28. package/core/constants/index.js +30 -0
  29. package/core/constants/rules.js +215 -0
  30. package/core/enhanced-rules-registry.js +3 -3
  31. package/core/file-targeting-service.js +128 -7
  32. package/core/interfaces/rule-plugin.interface.js +207 -0
  33. package/core/plugin-manager.js +448 -0
  34. package/core/rule-selection-service.js +42 -15
  35. package/core/semantic-engine.js +658 -0
  36. package/core/semantic-rule-base.js +433 -0
  37. package/core/unified-rule-registry.js +484 -0
  38. package/docs/COMMAND-EXAMPLES.md +134 -0
  39. package/docs/CONSTANTS-ARCHITECTURE.md +288 -0
  40. package/docs/LARGE-PROJECT-GUIDE.md +324 -0
  41. package/engines/core/base-engine.js +249 -0
  42. package/engines/engine-factory.js +275 -0
  43. package/engines/eslint-engine.js +171 -19
  44. package/engines/heuristic-engine.js +569 -78
  45. package/integrations/eslint/plugin/index.js +26 -28
  46. package/origin-rules/common-en.md +8 -8
  47. package/package.json +10 -6
  48. package/rules/common/C003_no_vague_abbreviations/analyzer.js +1 -1
  49. package/rules/common/C017_constructor_logic/analyzer.js +254 -17
  50. package/rules/common/C017_constructor_logic/semantic-analyzer.js +340 -0
  51. package/rules/common/C029_catch_block_logging/analyzer.js +17 -5
  52. package/rules/common/C033_separate_service_repository/README.md +78 -0
  53. package/rules/common/C033_separate_service_repository/analyzer.js +160 -0
  54. package/rules/common/C033_separate_service_repository/config.json +50 -0
  55. package/rules/common/C033_separate_service_repository/regex-based-analyzer.js +585 -0
  56. package/rules/common/C033_separate_service_repository/symbol-based-analyzer.js +368 -0
  57. package/rules/common/C035_error_logging_context/STRATEGY.md +99 -0
  58. package/rules/common/C035_error_logging_context/analyzer.js +230 -0
  59. package/rules/common/C035_error_logging_context/config.json +54 -0
  60. package/rules/common/C035_error_logging_context/regex-based-analyzer.js +299 -0
  61. package/rules/common/C035_error_logging_context/symbol-based-analyzer.js +454 -0
  62. package/rules/common/C040_centralized_validation/analyzer.js +165 -0
  63. package/rules/common/C040_centralized_validation/config.json +46 -0
  64. package/rules/common/C040_centralized_validation/regex-based-analyzer.js +243 -0
  65. package/rules/common/C040_centralized_validation/symbol-based-analyzer.js +416 -0
  66. package/rules/common/C047_no_duplicate_retry_logic/c047-semantic-rule.js +278 -0
  67. package/rules/common/C047_no_duplicate_retry_logic/symbol-analyzer-enhanced.js +968 -0
  68. package/rules/common/C047_no_duplicate_retry_logic/symbol-config.json +71 -0
  69. package/rules/common/{C076_single_test_behavior → C072_single_test_behavior}/analyzer.js +6 -6
  70. package/rules/common/C076_explicit_function_types/README.md +30 -0
  71. package/rules/common/C076_explicit_function_types/analyzer.js +172 -0
  72. package/rules/common/C076_explicit_function_types/config.json +15 -0
  73. package/rules/common/C076_explicit_function_types/semantic-analyzer.js +341 -0
  74. package/rules/index.js +8 -0
  75. package/rules/parser/rule-parser.js +13 -2
  76. package/rules/security/S005_no_origin_auth/README.md +226 -0
  77. package/rules/security/S005_no_origin_auth/analyzer.js +184 -0
  78. package/rules/security/S005_no_origin_auth/ast-analyzer.js +406 -0
  79. package/rules/security/S005_no_origin_auth/config.json +85 -0
  80. package/rules/security/S006_no_plaintext_recovery_codes/README.md +139 -0
  81. package/rules/security/S006_no_plaintext_recovery_codes/analyzer.js +306 -0
  82. package/rules/security/S006_no_plaintext_recovery_codes/config.json +48 -0
  83. package/rules/security/S007_no_plaintext_otp/README.md +198 -0
  84. package/rules/security/S007_no_plaintext_otp/analyzer.js +406 -0
  85. package/rules/security/S007_no_plaintext_otp/config.json +79 -0
  86. package/rules/security/S007_no_plaintext_otp/semantic-analyzer.js +609 -0
  87. package/rules/security/S007_no_plaintext_otp/semantic-config.json +195 -0
  88. package/rules/security/S007_no_plaintext_otp/semantic-wrapper.js +280 -0
  89. package/rules/security/S027_no_hardcoded_secrets/analyzer.js +180 -366
  90. package/rules/security/S027_no_hardcoded_secrets/categories.json +153 -0
  91. package/rules/security/S027_no_hardcoded_secrets/categorized-analyzer.js +250 -0
  92. package/scripts/category-manager.js +150 -0
  93. package/scripts/generate-rules-registry.js +88 -0
  94. package/scripts/migrate-rule-registry.js +157 -0
  95. package/scripts/prepare-release.sh +1 -1
  96. package/scripts/validate-system.js +48 -0
  97. package/.sunlint.json +0 -35
  98. package/config/README.md +0 -88
  99. package/config/engines/eslint-rule-mapping.json +0 -74
  100. package/config/schemas/sunlint-schema.json +0 -0
  101. package/config/testing/test-s005-working.ts +0 -22
  102. package/core/multi-rule-runner.js +0 -0
  103. package/docs/ESLINT-INTEGRATION-STRATEGY.md +0 -392
  104. package/docs/FUTURE_PACKAGES.md +0 -83
  105. package/docs/HEURISTIC_VS_AI.md +0 -113
  106. package/docs/PRODUCTION_DEPLOYMENT_ANALYSIS.md +0 -112
  107. package/docs/PRODUCTION_SIZE_IMPACT.md +0 -183
  108. package/docs/RELEASE_GUIDE.md +0 -230
  109. package/docs/STANDARDIZED-CATEGORY-FILTERING.md +0 -156
  110. package/engines/tree-sitter-parser.js +0 -0
  111. package/engines/universal-ast-engine.js +0 -0
  112. package/integrations/eslint/plugin/rules/common/c076-single-behavior-per-test.js +0 -254
  113. package/rules/common/C029_catch_block_logging/analyzer-backup.js +0 -426
  114. package/rules/common/C029_catch_block_logging/analyzer-fixed.js +0 -130
  115. package/rules/common/C029_catch_block_logging/analyzer-multi-tech.js +0 -487
  116. package/rules/common/C029_catch_block_logging/analyzer-simple.js +0 -110
  117. package/rules/common/C029_catch_block_logging/ast-analyzer-backup.js +0 -441
  118. package/rules/common/C029_catch_block_logging/ast-analyzer-new.js +0 -127
  119. package/rules/common/C029_catch_block_logging/ast-analyzer.js +0 -133
  120. package/rules/common/C029_catch_block_logging/cfg-analyzer.js +0 -408
  121. package/rules/common/C029_catch_block_logging/dataflow-analyzer.js +0 -454
  122. package/rules/common/C029_catch_block_logging/multi-language-ast-engine.js +0 -700
  123. package/rules/common/C029_catch_block_logging/pattern-learning-analyzer.js +0 -568
  124. package/rules/common/C029_catch_block_logging/semantic-analyzer.js +0 -459
package/README.md CHANGED
@@ -33,7 +33,7 @@ SunLint uses a unified adapter pattern ensuring consistency between CLI and VSCo
33
33
  │ • Origin Rules (markdown) │
34
34
  │ • Heuristic Engine (244 rules) │
35
35
  │ • ESLint Engine (17 rules) │
36
- │ • AI Engine (256 rules)
36
+ │ • OpenAI Engine (256 rules)
37
37
  └───────────────────────────────────┘
38
38
  ```
39
39
 
@@ -87,10 +87,17 @@ For advanced TypeScript analysis with ESLint integration:
87
87
  npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript
88
88
  ```
89
89
 
90
+ ### **Full ESLint Integration Support**
91
+ For complete ESLint integration with import analysis:
92
+
93
+ ```bash
94
+ npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import typescript
95
+ ```
96
+
90
97
  ### **What's Included by Default**
91
98
  - ✅ **JavaScript Analysis**: High-accuracy AST analysis out of the box
92
99
  - ✅ **Basic TypeScript**: Works with built-in Babel parser
93
- - ✅ **97+ Rules**: All quality and security rules available
100
+ - ✅ **256+ Rules**: All quality and security rules available
94
101
  - ✅ **Heuristic Engine**: Pattern-based analysis for all languages
95
102
 
96
103
  ### **Optional Dependencies (Install as needed)**
@@ -98,16 +105,22 @@ npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @t
98
105
  # For ESLint engine integration
99
106
  npm install eslint --save-dev
100
107
 
108
+ # For import/module analysis (recommended with ESLint)
109
+ npm install eslint-plugin-import --save-dev
110
+
101
111
  # For enhanced TypeScript analysis
102
112
  npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
103
113
 
104
114
  # For TypeScript compiler integration
105
115
  npm install typescript --save-dev
116
+
117
+ # For import/module analysis (recommended)
118
+ npm install eslint-plugin-import --save-dev
106
119
  ```
107
120
 
108
121
  **Quick setup for TypeScript projects:**
109
122
  ```bash
110
- npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript
123
+ npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-import typescript
111
124
  ```
112
125
 
113
126
  > 💡 **Note**: SunLint gracefully handles missing dependencies. Install only what your project needs. See [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md) for detailed guidance.
@@ -135,6 +148,7 @@ npm install --save-dev @sun-asterisk/sunlint eslint @typescript-eslint/parser @t
135
148
  "eslint": "^8.50.0",
136
149
  "@typescript-eslint/parser": "^7.2.0",
137
150
  "@typescript-eslint/eslint-plugin": "^7.18.0",
151
+ "eslint-plugin-import": "^2.32.0",
138
152
  "typescript": "^5.0.0"
139
153
  }
140
154
  }
@@ -152,13 +166,13 @@ sunlint --show-engines --rules=C010,R001,S005
152
166
  # Use specific engine
153
167
  sunlint --engine=heuristic --rules=C010,C020 --input=src
154
168
  sunlint --engine=eslint --rules=R001,R006 --input=src
155
- sunlint --engine=ai --rules=C010,S001 --input=src
169
+ sunlint --engine=openai --rules=C010,S001 --input=src
156
170
  ```
157
171
 
158
172
  **Engine Stats:**
159
173
  - **Heuristic Engine**: 244/256 rules (95.3%) - Fast, universal
160
174
  - **ESLint Engine**: 17/256 rules (6.6%) - JavaScript/TypeScript focused
161
- - **AI Engine**: 256/256 rules (100%) - Context-aware analysis
175
+ - **OpenAI Engine**: 256/256 rules (100%) - Context-aware analysis
162
176
 
163
177
  ### **ESLint Integration**
164
178
  Seamlessly integrate with existing ESLint configurations:
@@ -247,7 +261,6 @@ sunlint --all --only-source --input=src
247
261
  | **C043** | No Console or Print | ✅ Stable |
248
262
  | **C047** | No Duplicate Retry Logic | ✅ Stable |
249
263
  | **C075** | Explicit Function Return Types | ✅ Stable |
250
- | **C076** | Single Test Behavior | ✅ Stable |
251
264
  | **T002-T021** | TypeScript-specific rules | ✅ Stable |
252
265
 
253
266
  ### **Security Rules** 🔒 (47 rules)
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "CI/CD Optimized Configuration",
3
+ "description": "Fast analysis for CI/CD pipelines",
4
+
5
+ "performance": {
6
+ "maxSemanticFiles": 300,
7
+ "maxConcurrentRules": 3,
8
+ "timeoutMs": 30000
9
+ },
10
+
11
+ "input": ["."],
12
+
13
+ "include": [
14
+ "src/**/*.ts",
15
+ "src/**/*.js"
16
+ ],
17
+
18
+ "exclude": [
19
+ "**/*.test.*",
20
+ "**/*.d.ts",
21
+ "node_modules/**",
22
+ "dist/**",
23
+ "build/**"
24
+ ],
25
+
26
+ "rules": {
27
+ "categories": {
28
+ "security": true,
29
+ "quality": true,
30
+ "logging": false
31
+ }
32
+ },
33
+
34
+ "output": {
35
+ "format": "github",
36
+ "console": true,
37
+ "summary": false
38
+ },
39
+
40
+ "engines": {
41
+ "semantic": {
42
+ "enabled": true,
43
+ "fileLimit": 300
44
+ },
45
+ "ai": {
46
+ "enabled": false
47
+ }
48
+ },
49
+
50
+ "reporting": {
51
+ "exitOnError": true,
52
+ "showProgress": false
53
+ }
54
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "Development Configuration",
3
+ "description": "Fast feedback for daily development",
4
+
5
+ "performance": {
6
+ "maxSemanticFiles": 500,
7
+ "maxConcurrentRules": 4,
8
+ "timeoutMs": 15000
9
+ },
10
+
11
+ "input": ["."],
12
+
13
+ "include": [
14
+ "src/**/*.ts",
15
+ "src/**/*.js",
16
+ "lib/**/*.ts"
17
+ ],
18
+
19
+ "exclude": [
20
+ "**/*.test.*",
21
+ "**/*.spec.*",
22
+ "**/*.d.ts",
23
+ "node_modules/**",
24
+ "dist/**"
25
+ ],
26
+
27
+ "rules": {
28
+ "C006": "error",
29
+ "C019": "error",
30
+ "C029": "error",
31
+ "S001": "error",
32
+ "S005": "error"
33
+ },
34
+
35
+ "output": {
36
+ "format": "summary",
37
+ "console": true,
38
+ "summary": true,
39
+ "verbose": false
40
+ },
41
+
42
+ "engines": {
43
+ "semantic": {
44
+ "enabled": true,
45
+ "fileLimit": 500
46
+ },
47
+ "ai": {
48
+ "enabled": false
49
+ }
50
+ },
51
+
52
+ "git": {
53
+ "changedFiles": true,
54
+ "diffBase": "origin/main"
55
+ }
56
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "semantic-engine": {
3
+ "enabled": true,
4
+ "description": "TypeScript/JavaScript semantic analysis engine using ts-morph",
5
+ "features": [
6
+ "cross-file-analysis",
7
+ "symbol-table-caching",
8
+ "type-checking",
9
+ "semantic-rule-support"
10
+ ],
11
+ "configPath": "config/engines/semantic-config.json",
12
+ "dependencies": {
13
+ "required": [],
14
+ "optional": ["ts-morph"]
15
+ },
16
+ "performance": {
17
+ "enableCaching": true,
18
+ "maxCacheSize": 100,
19
+ "memoryLimit": "500MB",
20
+ "timeout": 30000
21
+ },
22
+ "rules": {
23
+ "classification": {
24
+ "semantic": ["C047", "C029", "C031", "C048", "C050"],
25
+ "hybrid": ["C019", "C035"]
26
+ },
27
+ "autoDetect": true
28
+ }
29
+ },
30
+ "eslint": {
31
+ "enabled": true,
32
+ "description": "ESLint integration for JavaScript/TypeScript linting",
33
+ "features": [
34
+ "syntax-checking",
35
+ "style-enforcement",
36
+ "best-practices",
37
+ "custom-rules"
38
+ ],
39
+ "configPath": "config/engines/eslint-config.json",
40
+ "dependencies": {
41
+ "required": ["eslint"],
42
+ "optional": ["@typescript-eslint/parser", "@typescript-eslint/eslint-plugin"]
43
+ }
44
+ },
45
+ "heuristic": {
46
+ "enabled": true,
47
+ "description": "Enhanced pattern-based analysis with AST and semantic capabilities",
48
+ "features": [
49
+ "pattern-matching",
50
+ "ast-analysis",
51
+ "semantic-analysis",
52
+ "multi-language-support",
53
+ "rule-classification"
54
+ ],
55
+ "configPath": "config/engines/heuristic-config.json",
56
+ "dependencies": {
57
+ "required": [],
58
+ "optional": ["tree-sitter", "ts-morph"]
59
+ },
60
+ "modes": {
61
+ "traditional": {
62
+ "description": "Pattern + AST analysis only",
63
+ "semantic": false
64
+ },
65
+ "semantic": {
66
+ "description": "Pattern + AST + semantic analysis",
67
+ "semantic": true,
68
+ "requires": ["semantic-engine"]
69
+ }
70
+ }
71
+ },
72
+ "openai": {
73
+ "enabled": true,
74
+ "description": "AI-powered code analysis using OpenAI API",
75
+ "features": [
76
+ "context-aware-analysis",
77
+ "natural-language-descriptions",
78
+ "intelligent-suggestions"
79
+ ],
80
+ "configPath": "config/engines/openai-config.json",
81
+ "dependencies": {
82
+ "required": ["openai"],
83
+ "optional": []
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "semantic-engine": {
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "module": "commonjs",
6
+ "lib": ["ES2020", "DOM"],
7
+ "allowJs": true,
8
+ "checkJs": false,
9
+ "skipLibCheck": true,
10
+ "skipDefaultLibCheck": true,
11
+ "moduleResolution": "node",
12
+ "esModuleInterop": true,
13
+ "allowSyntheticDefaultImports": true,
14
+ "strict": false,
15
+ "noImplicitAny": false
16
+ },
17
+
18
+ "performance": {
19
+ "enableCaching": true,
20
+ "maxCacheSize": 100,
21
+ "memoryLimit": 524288000,
22
+ "timeout": 30000,
23
+ "crossFileAnalysis": true,
24
+ "enableTypeChecker": false
25
+ },
26
+
27
+ "fileDiscovery": {
28
+ "patterns": [
29
+ "**/*.ts",
30
+ "**/*.tsx",
31
+ "**/*.js",
32
+ "**/*.jsx"
33
+ ],
34
+ "excludePatterns": [
35
+ "**/node_modules/**",
36
+ "**/dist/**",
37
+ "**/build/**",
38
+ "**/.git/**",
39
+ "**/coverage/**",
40
+ "**/*.test.{ts,tsx,js,jsx}",
41
+ "**/*.spec.{ts,tsx,js,jsx}"
42
+ ],
43
+ "maxFiles": 1000
44
+ },
45
+
46
+ "symbolTable": {
47
+ "extractImports": true,
48
+ "extractExports": true,
49
+ "extractFunctions": true,
50
+ "extractClasses": true,
51
+ "extractInterfaces": true,
52
+ "extractVariables": true,
53
+ "extractConstants": true,
54
+ "extractHooks": true,
55
+ "extractComponents": true,
56
+ "extractFunctionCalls": true,
57
+ "extractMethodCalls": true,
58
+ "crossFileReferences": true
59
+ },
60
+
61
+ "rules": {
62
+ "C047": {
63
+ "enabled": true,
64
+ "crossFileAnalysis": true,
65
+ "retryPatterns": [
66
+ "retry",
67
+ "retries",
68
+ "withRetry",
69
+ "retryWhen",
70
+ "attempt"
71
+ ],
72
+ "queryHooks": [
73
+ "useQuery",
74
+ "useMutation",
75
+ "useInfiniteQuery",
76
+ "useSuspenseQuery"
77
+ ],
78
+ "contextAnalysis": {
79
+ "nearbyLines": 10,
80
+ "parentContext": true
81
+ }
82
+ },
83
+
84
+ "C029": {
85
+ "enabled": false,
86
+ "crossFileAnalysis": true,
87
+ "description": "Future semantic rule for component lifecycle"
88
+ },
89
+
90
+ "C031": {
91
+ "enabled": false,
92
+ "crossFileAnalysis": true,
93
+ "description": "Future semantic rule for state management"
94
+ }
95
+ },
96
+
97
+ "optimization": {
98
+ "incrementalAnalysis": true,
99
+ "watchMode": false,
100
+ "parallelProcessing": false,
101
+ "memoryCleanup": {
102
+ "interval": 60000,
103
+ "threshold": 0.8
104
+ }
105
+ },
106
+
107
+ "debugging": {
108
+ "enableVerboseLogging": false,
109
+ "logSymbolTable": false,
110
+ "logPerformanceMetrics": true,
111
+ "outputStatsFile": false
112
+ }
113
+ }
114
+ }
@@ -3,8 +3,8 @@
3
3
  "version": "1.0.0",
4
4
  "stats": {
5
5
  "commonRulesTotal": 76,
6
- "commonRulesImplemented": 19,
7
- "commonRulesMissing": 57,
6
+ "commonRulesImplemented": 27,
7
+ "commonRulesMissing": 49,
8
8
  "securityRulesTotal": 59,
9
9
  "securityRulesImplemented": 43,
10
10
  "securityRulesMissing": 16,
@@ -12,46 +12,58 @@
12
12
  "typescriptRulesImplemented": 8
13
13
  },
14
14
  "missingCommonRules": [
15
- "C001", "C004", "C005", "C007", "C008", "C009", "C011", "C012", "C015", "C016",
16
- "C019", "C020", "C021", "C022", "C024", "C025", "C026", "C027", "C028", "C031",
17
- "C032", "C033", "C034", "C036", "C037", "C038", "C039", "C040", "C044", "C045",
18
- "C046", "C048", "C049", "C050", "C051", "C052", "C053", "C054", "C055", "C056",
19
- "C057", "C058", "C059", "C060", "C061", "C062", "C063", "C064", "C065", "C066",
20
- "C067", "C068", "C069", "C070", "C071", "C073", "C074"
15
+ "C001", "C004", "C008", "C009", "C011", "C016",
16
+ "C020", "C021", "C022", "C024", "C025", "C026", "C027", "C028", "C036",
17
+ "C039", "C044", "C045", "C046", "C048", "C049", "C050", "C051", "C052",
18
+ "C053", "C054", "C055", "C056", "C057", "C058", "C059", "C060", "C061",
19
+ "C062", "C063", "C064", "C065", "C066", "C067", "C068", "C069", "C070",
20
+ "C071", "C073", "C074"
21
21
  ],
22
22
  "missingSecurityRules": [
23
23
  "S004", "S021", "S024", "S028", "S031", "S032", "S040", "S049", "S051", "S053",
24
24
  "S056", "S059", "S060", "S061", "S062", "S063"
25
25
  ],
26
26
  "mappings": {
27
- "C002": ["custom/no-duplicate-code"],
28
- "C003": ["custom/no-vague-abbreviations"],
29
- "C006": ["custom/function-name-verb-noun"],
30
- "C010": ["custom/limit-block-nesting"],
31
- "C013": ["custom/no-dead-code"],
32
- "C014": ["custom/abstract-dependency-preferred"],
33
- "C017": ["custom/limit-constructor-logic"],
34
- "C018": ["custom/no-generic-throw"],
35
- "C023": ["custom/no-duplicate-variable-name-in-scope"],
36
- "C029": ["custom/catch-block-logging"],
37
- "C030": ["custom/use-custom-error-classes"],
38
- "C035": ["custom/no-empty-catch"],
39
- "C041": ["custom/no-config-inline"],
40
- "C042": ["custom/boolean-name-prefix"],
41
- "C043": ["custom/no-console-or-print"],
42
- "C047": ["custom/no-duplicate-retry-logic"],
43
- "C072": ["custom/one-assert-per-test"],
44
- "C075": ["custom/explicit-function-return-types"],
45
- "C076": ["custom/single-behavior-per-test"],
27
+ "C002": ["custom/c002-no-duplicate-code"],
28
+ "C003": ["custom/c003-no-vague-abbreviations"],
29
+ "C005": ["max-statements-per-line", "complexity"],
30
+ "C006": ["custom/c006-function-name-verb-noun"],
31
+ "C007": ["spaced-comment", "no-inline-comments", "no-warning-comments"],
32
+ "C010": ["custom/c010-limit-block-nesting"],
33
+ "C012": ["consistent-return", "no-void", "@typescript-eslint/no-confusing-void-expression"],
34
+ "C013": ["custom/c013-no-dead-code"],
35
+ "C014": ["custom/c014-abstract-dependency-preferred"],
36
+ "C015": ["@typescript-eslint/naming-convention", "camelcase"],
37
+ "C017": ["custom/c017-limit-constructor-logic"],
38
+ "C018": ["custom/c018-no-generic-throw"],
39
+ "C019": ["no-console", "no-alert", "no-debugger"],
40
+ "C023": ["custom/c023-no-duplicate-variable-name-in-scope"],
41
+ "C029": ["custom/c029-catch-block-logging"],
42
+ "C030": ["custom/c030-use-custom-error-classes"],
43
+ "C031": ["no-implicit-coercion", "eqeqeq"],
44
+ "C032": ["no-new", "no-constructor-return"],
45
+ "C033": ["prefer-const", "no-var"],
46
+ "C034": ["no-global-assign", "no-implicit-globals", "@typescript-eslint/no-namespace"],
47
+ "C035": ["custom/c035-no-empty-catch"],
48
+ "C037": ["consistent-return", "@typescript-eslint/explicit-function-return-type", "@typescript-eslint/explicit-module-boundary-types"],
49
+ "C038": ["import/no-dynamic-require", "import/order", "@typescript-eslint/no-var-requires"],
50
+ "C040": ["no-duplicate-imports", "import/no-duplicates"],
51
+ "C041": ["custom/c041-no-config-inline"],
52
+ "C042": ["custom/c042-boolean-name-prefix"],
53
+ "C043": ["custom/c043-no-console-or-print"],
54
+ "C047": ["custom/c047-no-duplicate-retry-logic"],
55
+ "C072": ["custom/c072-one-assert-per-test"],
56
+ "C075": ["custom/c075-explicit-function-return-types"],
57
+ "C076": ["custom/c076-single-behavior-per-test"],
46
58
 
47
- "T002": ["custom/interface-prefix-i"],
48
- "T003": ["custom/ts-ignore-reason"],
49
- "T004": ["custom/no-empty-type"],
50
- "T007": ["custom/no-fn-in-constructor"],
51
- "T010": ["custom/no-nested-union-tuple"],
52
- "T019": ["custom/no-this-assign"],
53
- "T020": ["custom/no-default-multi-export"],
54
- "T021": ["custom/limit-nested-generics"],
59
+ "T002": ["custom/t002-interface-prefix-i"],
60
+ "T003": ["custom/t003-ts-ignore-reason"],
61
+ "T004": ["custom/t004-no-empty-type"],
62
+ "T007": ["custom/t007-no-fn-in-constructor"],
63
+ "T010": ["custom/t010-no-nested-union-tuple"],
64
+ "T019": ["custom/t019-no-this-assign"],
65
+ "T020": ["custom/t020-no-default-multi-export"],
66
+ "T021": ["custom/t021-limit-nested-generics"],
55
67
 
56
68
  "S001": ["custom/s001-fail-securely"],
57
69
  "S002": ["custom/s002-idor-check"],
@@ -114,9 +126,9 @@
114
126
 
115
127
  "implementationTodo": {
116
128
  "commonRules": {
117
- "priority1": ["C001", "C004", "C005", "C007", "C008", "C009", "C011", "C012"],
118
- "priority2": ["C015", "C016", "C019", "C020", "C021", "C022", "C024", "C025"],
119
- "priority3": ["C026", "C027", "C028", "C031", "C032", "C033", "C034", "C036"]
129
+ "priority1": ["C001", "C004", "C008", "C009", "C011"],
130
+ "priority2": ["C016", "C020", "C021", "C022", "C024", "C025"],
131
+ "priority3": ["C026", "C027", "C028", "C036", "C039", "C044", "C045", "C046"]
120
132
  },
121
133
  "securityRules": {
122
134
  "needImplementation": ["S004", "S021", "S024", "S028", "S031", "S032", "S040"],
@@ -0,0 +1,143 @@
1
+ {
2
+ "$schema": "./sunlint-schema.json",
3
+ "name": "Large Project Configuration",
4
+ "description": "Optimized configuration for projects with 1000+ files",
5
+
6
+ "performance": {
7
+ "maxSemanticFiles": 1000,
8
+ "maxConcurrentRules": 5,
9
+ "timeoutMs": 60000,
10
+ "cacheEnabled": true,
11
+ "cacheLocation": ".sunlint-cache/"
12
+ },
13
+
14
+ "input": [
15
+ "src",
16
+ "lib",
17
+ "app",
18
+ "packages"
19
+ ],
20
+
21
+ "include": [
22
+ "src/**/*.ts",
23
+ "src/**/*.js",
24
+ "lib/**/*.ts",
25
+ "app/**/*.ts",
26
+ "packages/*/src/**/*.ts"
27
+ ],
28
+
29
+ "exclude": [
30
+ "node_modules/**",
31
+ "dist/**",
32
+ "build/**",
33
+ "coverage/**",
34
+ "**/*.test.*",
35
+ "**/*.spec.*",
36
+ "**/*.d.ts",
37
+ "**/*.generated.*",
38
+ "**/generated/**",
39
+ "**/*.min.*",
40
+ "**/*.bundle.*"
41
+ ],
42
+
43
+ "rules": {
44
+ "enabled": [
45
+ "C006", "C019", "C029", "C047",
46
+ "S001", "S005", "S010"
47
+ ],
48
+ "categories": {
49
+ "quality": true,
50
+ "security": true,
51
+ "performance": false,
52
+ "logging": true
53
+ }
54
+ },
55
+
56
+ "output": {
57
+ "format": "summary",
58
+ "console": true,
59
+ "summary": true,
60
+ "includeContext": true,
61
+ "showFixSuggestions": true,
62
+ "groupByFile": true,
63
+ "sortBy": "severity"
64
+ },
65
+
66
+ "engines": {
67
+ "semantic": {
68
+ "enabled": true,
69
+ "fileLimit": 1000,
70
+ "enableCaching": true,
71
+ "crossFileAnalysis": true
72
+ },
73
+ "heuristic": {
74
+ "enabled": true,
75
+ "fastMode": false
76
+ },
77
+ "ai": {
78
+ "enabled": false,
79
+ "fallbackToPattern": true
80
+ }
81
+ },
82
+
83
+ "ci": {
84
+ "changedFiles": {
85
+ "maxSemanticFiles": 300,
86
+ "format": "github",
87
+ "failOnError": true
88
+ },
89
+ "fullScan": {
90
+ "maxSemanticFiles": 1000,
91
+ "format": "json",
92
+ "output": "sunlint-report.json"
93
+ },
94
+ "nightly": {
95
+ "maxSemanticFiles": 2000,
96
+ "format": "detailed",
97
+ "output": "nightly-report.json"
98
+ }
99
+ },
100
+
101
+ "overrides": [
102
+ {
103
+ "files": ["src/critical/**/*.ts"],
104
+ "performance": {
105
+ "maxSemanticFiles": 2000
106
+ },
107
+ "rules": {
108
+ "enabled": "all"
109
+ }
110
+ },
111
+ {
112
+ "files": ["**/*.test.*", "**/*.spec.*"],
113
+ "performance": {
114
+ "maxSemanticFiles": 500
115
+ },
116
+ "rules": {
117
+ "categories": {
118
+ "testing": true,
119
+ "security": false
120
+ }
121
+ }
122
+ },
123
+ {
124
+ "files": ["packages/*/src/**"],
125
+ "performance": {
126
+ "maxSemanticFiles": 1500
127
+ }
128
+ }
129
+ ],
130
+
131
+ "reporting": {
132
+ "baseline": {
133
+ "enabled": true,
134
+ "file": "baseline.json",
135
+ "updateOnClean": true
136
+ },
137
+ "trends": {
138
+ "enabled": true,
139
+ "historyFile": "trends.json",
140
+ "trackMetrics": ["violations", "files", "performance"]
141
+ }
142
+ }
143
+ }
@@ -32,7 +32,6 @@
32
32
  "C072": "warn",
33
33
  "C073": "warn",
34
34
  "C075": "warn",
35
- "C076": "warn",
36
35
  "S001": "error",
37
36
  "S002": "error",
38
37
  "S003": "warn",