@sun-asterisk/sunlint 1.3.3 โ†’ 1.3.5

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 (31) hide show
  1. package/CHANGELOG.md +69 -2
  2. package/config/presets/all.json +49 -48
  3. package/config/presets/beginner.json +7 -18
  4. package/config/presets/ci.json +63 -27
  5. package/config/presets/maintainability.json +6 -4
  6. package/config/presets/performance.json +4 -3
  7. package/config/presets/quality.json +11 -50
  8. package/config/presets/recommended.json +83 -10
  9. package/config/presets/security.json +20 -19
  10. package/config/presets/strict.json +6 -13
  11. package/config/rules/enhanced-rules-registry.json +64 -7
  12. package/core/analysis-orchestrator.js +6 -0
  13. package/core/cli-action-handler.js +15 -1
  14. package/core/config-preset-resolver.js +7 -2
  15. package/engines/engine-factory.js +7 -0
  16. package/package.json +1 -1
  17. package/rules/common/C067_no_hardcoded_config/analyzer.js +95 -0
  18. package/rules/common/C067_no_hardcoded_config/config.json +81 -0
  19. package/rules/common/C067_no_hardcoded_config/symbol-based-analyzer.js +1000 -0
  20. package/rules/security/S024_xpath_xxe_protection/analyzer.js +242 -0
  21. package/rules/security/S024_xpath_xxe_protection/config.json +152 -0
  22. package/rules/security/S024_xpath_xxe_protection/regex-based-analyzer.js +338 -0
  23. package/rules/security/S024_xpath_xxe_protection/symbol-based-analyzer.js +474 -0
  24. package/rules/security/S025_server_side_validation/README.md +179 -0
  25. package/rules/security/S025_server_side_validation/analyzer.js +242 -0
  26. package/rules/security/S025_server_side_validation/config.json +111 -0
  27. package/rules/security/S025_server_side_validation/regex-based-analyzer.js +388 -0
  28. package/rules/security/S025_server_side_validation/symbol-based-analyzer.js +523 -0
  29. package/scripts/README.md +83 -0
  30. package/scripts/analyze-core-rules.js +151 -0
  31. package/scripts/generate-presets.js +202 -0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,67 @@
2
2
 
3
3
  ---
4
4
 
5
- ## ๐Ÿš€ **v1.3.3 - Performance & File Limits Optimization (September 4, 2025)**
5
+ ## ๐Ÿ”ง **v1.3.5 - Preset System Refactor (September 8, 2025)**
6
+
7
+ **Release Date**: September 8, 2025
8
+ **Type**: Feature Enhancement
9
+
10
+ ### โœจ **New Features**
11
+ - **ENHANCED**: Complete preset system overhaul
12
+ - **Data-driven presets**: All presets now generated from actual rule sources
13
+ - **Accurate rule counting**: Presets contain only activated rules with tool support
14
+ - **New preset categories**: Added beginner, ci, strict, maintainability, performance presets
15
+ - **Comprehensive "all" preset**: 88 activated rules from common and security files
16
+
17
+ ### ๐Ÿ”ง **Technical Improvements**
18
+ - **ADDED**: Automated preset generation scripts
19
+ - `scripts/generate-presets.js` - Generate all preset configurations
20
+ - `scripts/analyze-core-rules.js` - Analyze rules from markdown sources
21
+ - **UPDATED**: ConfigPresetResolver now supports all 9 presets
22
+ - **ORGANIZED**: Scripts directory with clear categorization and documentation
23
+ - **FIXED**: Preset-to-rule mapping accuracy
24
+
25
+ ### ๐ŸŽฏ **Preset System**
26
+ - **9 total presets**: all, recommended, security, quality, beginner, ci, strict, maintainability, performance
27
+ - **Focus**: Only common-en.md and security-en.md rules (no language-specific rules)
28
+ - **Validation**: Tested with real demo project showing 135 violations detected
29
+
30
+ ### ๐Ÿ“ฆ **Upgrade Notes**
31
+ - **Zero breaking changes** - all existing configurations work
32
+ - **New presets available** - can now use @sun/sunlint/all and other new presets
33
+ - **Improved accuracy** - presets now contain only rules that actually work
34
+
35
+ ---
36
+
37
+ ## ๏ฟฝ **v1.3.4 - Engine Auto Hotfix (September 5, 2025)**
38
+
39
+ **Release Date**: September 5, 2025
40
+ **Type**: Critical Hotfix
41
+
42
+ ### ๐Ÿšจ **Critical Bug Fix**
43
+ - **FIXED**: Engine "auto" validation and selection logic
44
+ - **Issue**: `--engine=auto` causing "Invalid engine: auto" error in v1.3.3
45
+ - **Root Cause**: Missing auto engine support in validation and orchestrator
46
+ - **Solution**: Comprehensive auto engine implementation
47
+ - Added "auto" case to engine factory with heuristic fallback
48
+ - Updated CLI validation to include "auto" in valid engines
49
+ - Enhanced orchestrator to resolve "auto" to actual engines (heuristic + eslint)
50
+ - Fixed CLI action handler auto-detection logic
51
+
52
+ ### ๐Ÿงช **Validation Results**
53
+ - **โœ… Auto engine**: Works correctly (auto-selects heuristic + eslint)
54
+ - **โœ… Heuristic engine**: Unchanged, working properly
55
+ - **โœ… ESLint engine**: Unchanged, working properly
56
+ - **โœ… CLI help**: Shows all engines including auto option
57
+
58
+ ### ๐Ÿ“ฆ **Upgrade Notes**
59
+ - **Zero breaking changes** - seamless upgrade from v1.3.3
60
+ - **Default `--engine=auto`** now works as intended
61
+ - **All existing commands** continue to work unchanged
62
+
63
+ ---
64
+
65
+ ## ๏ฟฝ๐Ÿš€ **v1.3.3 - Performance & File Limits Optimization (September 4, 2025)**
6
66
 
7
67
  **Release Date**: September 4, 2025
8
68
  **Type**: Performance Enhancement & User Experience
@@ -21,7 +81,14 @@
21
81
  - **Auto-detection**: Smart defaults for 90% of use cases
22
82
  - **Manual tuning**: Fine control for enterprise projects
23
83
 
24
- ### ๐Ÿ“š **Documentation Expansion**
84
+ ### ๏ฟฝ **Bug Fixes**
85
+ - **FIXED**: Engine "auto" validation and selection logic
86
+ - **Engine Factory**: Added "auto" case with fallback to heuristic engine
87
+ - **CLI Validation**: Added "auto" to valid engines list
88
+ - **Orchestrator**: Auto-resolve "auto" to actual engines (heuristic + eslint)
89
+ - **Engine Selection**: Auto-detection works correctly for rule preferences
90
+
91
+ ### ๏ฟฝ๐Ÿ“š **Documentation Expansion**
25
92
  - **NEW**: [FILE_LIMITS_EXPLANATION.md](./docs/FILE_LIMITS_EXPLANATION.md) - Comprehensive guide (5.7KB)
26
93
  - **NEW**: [QUICK_FILE_LIMITS.md](./docs/QUICK_FILE_LIMITS.md) - Quick reference (1.8KB)
27
94
  - **ENHANCED**: CLI help with clear usage examples
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sun/sunlint/all",
3
- "description": "Comprehensive configuration with all available activated rules (v1.0+)",
3
+ "description": "Comprehensive configuration with all activated rules from core files",
4
4
  "rules": {
5
5
  "C003": "warn",
6
6
  "C006": "warn",
@@ -32,6 +32,7 @@
32
32
  "C072": "warn",
33
33
  "C073": "warn",
34
34
  "C075": "warn",
35
+ "C076": "warn",
35
36
  "S001": "error",
36
37
  "S002": "error",
37
38
  "S003": "warn",
@@ -41,56 +42,54 @@
41
42
  "S007": "warn",
42
43
  "S008": "warn",
43
44
  "S009": "warn",
44
- "S010": "error",
45
- "S011": "error",
45
+ "S010": "warn",
46
+ "S011": "warn",
46
47
  "S012": "warn",
47
- "S013": "error",
48
+ "S013": "warn",
48
49
  "S014": "warn",
49
50
  "S015": "warn",
50
- "S016": "error",
51
+ "S016": "warn",
51
52
  "S017": "error",
52
- "S018": "error",
53
- "S019": "error",
54
- "S020": "error",
55
- "S021": "error",
56
- "S022": "error",
57
- "S023": "error",
58
- "S024": "error",
59
- "S025": "error",
53
+ "S018": "warn",
54
+ "S019": "warn",
55
+ "S020": "warn",
56
+ "S021": "warn",
57
+ "S022": "warn",
58
+ "S023": "warn",
59
+ "S025": "warn",
60
60
  "S026": "warn",
61
- "S027": "error",
62
- "S028": "error",
63
- "S029": "error",
64
- "S030": "error",
65
- "S031": "error",
66
- "S032": "error",
67
- "S033": "error",
68
- "S034": "error",
69
- "S035": "error",
70
- "S036": "error",
71
- "S037": "error",
72
- "S038": "error",
73
- "S039": "error",
74
- "S040": "error",
75
- "S041": "error",
76
- "S042": "error",
77
- "S043": "error",
61
+ "S027": "warn",
62
+ "S028": "warn",
63
+ "S029": "warn",
64
+ "S030": "warn",
65
+ "S031": "warn",
66
+ "S032": "warn",
67
+ "S033": "warn",
68
+ "S034": "warn",
69
+ "S035": "warn",
70
+ "S036": "warn",
71
+ "S037": "warn",
72
+ "S039": "warn",
73
+ "S040": "warn",
74
+ "S041": "warn",
75
+ "S042": "warn",
76
+ "S043": "warn",
78
77
  "S044": "warn",
79
- "S045": "error",
80
- "S046": "error",
81
- "S047": "error",
82
- "S048": "error",
83
- "S049": "error",
84
- "S050": "error",
85
- "S051": "error",
86
- "S052": "error",
87
- "S053": "error",
88
- "S054": "error",
89
- "S055": "error",
90
- "S056": "error",
91
- "S057": "error",
92
- "S058": "error",
93
- "S059": "error"
78
+ "S045": "warn",
79
+ "S046": "warn",
80
+ "S047": "warn",
81
+ "S048": "warn",
82
+ "S049": "warn",
83
+ "S050": "warn",
84
+ "S051": "warn",
85
+ "S052": "warn",
86
+ "S053": "warn",
87
+ "S054": "warn",
88
+ "S055": "warn",
89
+ "S056": "warn",
90
+ "S057": "warn",
91
+ "S058": "warn",
92
+ "S059": "warn"
94
93
  },
95
94
  "categories": {
96
95
  "quality": "warn",
@@ -116,9 +115,11 @@
116
115
  "**/*.min.*"
117
116
  ],
118
117
  "metadata": {
119
- "totalRules": 90,
118
+ "totalRules": 88,
120
119
  "removedRules": 0,
121
- "lastUpdated": "2025-07-30T08:59:10.118Z",
122
- "source": "origin-rules"
120
+ "approach": "comprehensive-activated-only",
121
+ "source": "common-en.md + security-en.md (activated only)",
122
+ "lastUpdated": "2025-09-08T04:34:12.590Z",
123
+ "version": "2.0.0"
123
124
  }
124
125
  }
@@ -2,9 +2,9 @@
2
2
  "name": "@sun/sunlint/beginner",
3
3
  "description": "Beginner-friendly configuration with warnings only",
4
4
  "rules": {
5
+ "C006": "info",
5
6
  "C019": "warn",
6
- "C029": "warn",
7
- "C006": "info"
7
+ "C029": "warn"
8
8
  },
9
9
  "categories": {
10
10
  "quality": "warn",
@@ -21,24 +21,13 @@
21
21
  "**/build/**",
22
22
  "**/dist/**",
23
23
  "**/*.generated.*",
24
- "**/*.min.*",
25
- "**/test/**",
26
- "**/tests/**"
24
+ "**/*.min.*"
27
25
  ],
28
- "ai": {
29
- "enabled": false,
30
- "fallbackToPattern": true
31
- },
32
- "reporting": {
33
- "exitOnError": false,
34
- "showProgress": true,
35
- "includeContext": true,
36
- "showFixSuggestions": true
37
- },
38
26
  "metadata": {
39
27
  "totalRules": 3,
40
- "removedRules": 0,
41
- "lastUpdated": "2025-07-30T08:59:10.119Z",
42
- "source": "origin-rules"
28
+ "approach": "beginner-friendly",
29
+ "source": "selected core rules",
30
+ "lastUpdated": "2025-09-08T04:34:12.590Z",
31
+ "version": "2.0.0"
43
32
  }
44
33
  }
@@ -4,6 +4,63 @@
4
4
  "rules": {
5
5
  "C019": "error",
6
6
  "C029": "error",
7
+ "S001": "error",
8
+ "S002": "error",
9
+ "S003": "error",
10
+ "S004": "error",
11
+ "S005": "error",
12
+ "S006": "error",
13
+ "S007": "error",
14
+ "S008": "error",
15
+ "S009": "error",
16
+ "S010": "error",
17
+ "S011": "error",
18
+ "S012": "error",
19
+ "S013": "error",
20
+ "S014": "error",
21
+ "S015": "error",
22
+ "S016": "error",
23
+ "S017": "error",
24
+ "S018": "error",
25
+ "S019": "error",
26
+ "S020": "error",
27
+ "S021": "error",
28
+ "S022": "error",
29
+ "S023": "error",
30
+ "S025": "error",
31
+ "S026": "error",
32
+ "S027": "error",
33
+ "S028": "error",
34
+ "S029": "error",
35
+ "S030": "error",
36
+ "S031": "error",
37
+ "S032": "error",
38
+ "S033": "error",
39
+ "S034": "error",
40
+ "S035": "error",
41
+ "S036": "error",
42
+ "S037": "error",
43
+ "S039": "error",
44
+ "S040": "error",
45
+ "S041": "error",
46
+ "S042": "error",
47
+ "S043": "error",
48
+ "S044": "error",
49
+ "S045": "error",
50
+ "S046": "error",
51
+ "S047": "error",
52
+ "S048": "error",
53
+ "S049": "error",
54
+ "S050": "error",
55
+ "S051": "error",
56
+ "S052": "error",
57
+ "S053": "error",
58
+ "S054": "error",
59
+ "S055": "error",
60
+ "S056": "error",
61
+ "S057": "error",
62
+ "S058": "error",
63
+ "S059": "error",
7
64
  "C006": "off"
8
65
  },
9
66
  "categories": {
@@ -22,34 +79,13 @@
22
79
  "**/build/**",
23
80
  "**/dist/**",
24
81
  "**/*.generated.*",
25
- "**/*.min.*",
26
- "coverage/**"
82
+ "**/*.min.*"
27
83
  ],
28
- "ai": {
29
- "enabled": false,
30
- "fallbackToPattern": true
31
- },
32
- "output": {
33
- "format": "github",
34
- "console": false,
35
- "summary": true,
36
- "file": "sunlint-report.json"
37
- },
38
- "performance": {
39
- "maxConcurrentRules": 10,
40
- "timeoutMs": 60000,
41
- "cacheEnabled": true
42
- },
43
- "reporting": {
44
- "exitOnError": true,
45
- "showProgress": false,
46
- "includeContext": false,
47
- "showFixSuggestions": false
48
- },
49
84
  "metadata": {
50
- "totalRules": 3,
51
- "removedRules": 0,
52
- "lastUpdated": "2025-07-30T08:59:10.120Z",
53
- "source": "origin-rules"
85
+ "totalRules": 60,
86
+ "approach": "ci-optimized",
87
+ "source": "critical rules only",
88
+ "lastUpdated": "2025-09-08T04:34:12.590Z",
89
+ "version": "2.0.0"
54
90
  }
55
91
  }
@@ -12,7 +12,8 @@
12
12
  "S008": "warn"
13
13
  },
14
14
  "categories": {
15
- "maintainability": "warn"
15
+ "maintainability": "warn",
16
+ "design": "warn"
16
17
  },
17
18
  "languages": [
18
19
  "typescript",
@@ -31,8 +32,9 @@
31
32
  ],
32
33
  "metadata": {
33
34
  "totalRules": 8,
34
- "removedRules": 0,
35
- "lastUpdated": "2025-07-30T08:59:10.120Z",
36
- "source": "origin-rules"
35
+ "approach": "maintainability-focused",
36
+ "source": "maintainability principle rules",
37
+ "lastUpdated": "2025-09-08T04:34:12.590Z",
38
+ "version": "2.0.0"
37
39
  }
38
40
  }
@@ -25,8 +25,9 @@
25
25
  ],
26
26
  "metadata": {
27
27
  "totalRules": 2,
28
- "removedRules": 0,
29
- "lastUpdated": "2025-07-30T08:59:10.120Z",
30
- "source": "origin-rules"
28
+ "approach": "performance-focused",
29
+ "source": "performance principle rules",
30
+ "lastUpdated": "2025-09-08T04:34:12.590Z",
31
+ "version": "2.0.0"
31
32
  }
32
33
  }
@@ -20,7 +20,9 @@
20
20
  "C042": "warn",
21
21
  "C043": "warn",
22
22
  "C047": "warn",
23
+ "C048": "warn",
23
24
  "C052": "warn",
25
+ "C056": "warn",
24
26
  "C060": "warn",
25
27
  "C061": "warn",
26
28
  "C065": "warn",
@@ -29,55 +31,12 @@
29
31
  "C072": "warn",
30
32
  "C073": "warn",
31
33
  "C075": "warn",
32
- "C076": "warn",
33
- "S001": "error",
34
- "S002": "error",
35
- "S004": "warn",
36
- "S005": "warn",
37
- "S006": "warn",
38
- "S007": "warn",
39
- "S008": "warn",
40
- "S009": "warn",
41
- "S010": "error",
42
- "S011": "error",
43
- "S013": "error",
44
- "S014": "warn",
45
- "S017": "error",
46
- "S021": "warn",
47
- "S022": "warn",
48
- "S023": "error",
49
- "S025": "warn",
50
- "S026": "warn",
51
- "S027": "warn",
52
- "S028": "warn",
53
- "S029": "error",
54
- "S030": "warn",
55
- "S033": "warn",
56
- "S034": "warn",
57
- "S035": "warn",
58
- "S036": "error",
59
- "S041": "warn",
60
- "S042": "warn",
61
- "S043": "warn",
62
- "S044": "warn",
63
- "S045": "warn",
64
- "S046": "warn",
65
- "S047": "error",
66
- "S048": "warn",
67
- "S049": "warn",
68
- "S050": "warn",
69
- "S051": "warn",
70
- "S052": "warn",
71
- "S053": "warn",
72
- "S054": "error",
73
- "S055": "warn",
74
- "S057": "warn",
75
- "S058": "warn",
76
- "S059": "warn"
34
+ "C076": "warn"
77
35
  },
78
36
  "categories": {
79
37
  "quality": "warn",
80
- "security": "error"
38
+ "maintainability": "warn",
39
+ "testability": "warn"
81
40
  },
82
41
  "languages": [
83
42
  "typescript",
@@ -95,9 +54,11 @@
95
54
  "**/*.min.*"
96
55
  ],
97
56
  "metadata": {
98
- "totalRules": 72,
99
- "removedRules": 0,
100
- "lastUpdated": "2025-07-30T08:59:10.121Z",
101
- "source": "origin-rules"
57
+ "totalRules": 30,
58
+ "qualityRules": 30,
59
+ "approach": "quality-focused",
60
+ "source": "common-en.md (non-security rules)",
61
+ "lastUpdated": "2025-09-08T04:33:23.247Z",
62
+ "version": "2.0.0"
102
63
  }
103
64
  }
@@ -4,19 +4,92 @@
4
4
  "rules": {
5
5
  "C003": "warn",
6
6
  "C006": "warn",
7
- "C010": "warn",
7
+ "C013": "warn",
8
+ "C014": "warn",
9
+ "C017": "warn",
10
+ "C018": "warn",
8
11
  "C019": "warn",
12
+ "C023": "warn",
13
+ "C024": "warn",
9
14
  "C029": "warn",
15
+ "C030": "warn",
10
16
  "C031": "warn",
11
- "C032": "warn",
12
- "C041": "error",
17
+ "C033": "warn",
18
+ "C035": "warn",
19
+ "C040": "warn",
20
+ "C041": "warn",
21
+ "C042": "warn",
22
+ "C043": "warn",
23
+ "C047": "warn",
24
+ "C048": "warn",
25
+ "C052": "warn",
26
+ "C056": "warn",
27
+ "C060": "warn",
28
+ "C061": "warn",
29
+ "C065": "warn",
30
+ "C067": "warn",
31
+ "C070": "warn",
32
+ "C072": "warn",
33
+ "C073": "warn",
34
+ "C075": "warn",
35
+ "C076": "warn",
13
36
  "S001": "error",
14
37
  "S002": "error",
15
38
  "S003": "warn",
16
- "S005": "error",
17
- "S007": "error",
18
- "S012": "error",
19
- "S013": "error"
39
+ "S004": "warn",
40
+ "S005": "warn",
41
+ "S006": "warn",
42
+ "S007": "warn",
43
+ "S008": "warn",
44
+ "S009": "warn",
45
+ "S010": "warn",
46
+ "S011": "warn",
47
+ "S012": "warn",
48
+ "S013": "warn",
49
+ "S014": "warn",
50
+ "S015": "warn",
51
+ "S016": "warn",
52
+ "S017": "error",
53
+ "S018": "warn",
54
+ "S019": "warn",
55
+ "S020": "warn",
56
+ "S021": "warn",
57
+ "S022": "warn",
58
+ "S023": "warn",
59
+ "S025": "warn",
60
+ "S026": "warn",
61
+ "S027": "warn",
62
+ "S028": "warn",
63
+ "S029": "warn",
64
+ "S030": "warn",
65
+ "S031": "warn",
66
+ "S032": "warn",
67
+ "S033": "warn",
68
+ "S034": "warn",
69
+ "S035": "warn",
70
+ "S036": "warn",
71
+ "S037": "warn",
72
+ "S039": "warn",
73
+ "S040": "warn",
74
+ "S041": "warn",
75
+ "S042": "warn",
76
+ "S043": "warn",
77
+ "S044": "warn",
78
+ "S045": "warn",
79
+ "S046": "warn",
80
+ "S047": "warn",
81
+ "S048": "warn",
82
+ "S049": "warn",
83
+ "S050": "warn",
84
+ "S051": "warn",
85
+ "S052": "warn",
86
+ "S053": "warn",
87
+ "S054": "warn",
88
+ "S055": "warn",
89
+ "S056": "warn",
90
+ "S057": "warn",
91
+ "S058": "warn",
92
+ "S059": "warn"
20
93
  },
21
94
  "categories": {
22
95
  "quality": "warn",
@@ -38,11 +111,11 @@
38
111
  "**/*.min.*"
39
112
  ],
40
113
  "metadata": {
41
- "totalRules": 15,
42
- "coreRules": 15,
114
+ "totalRules": 88,
115
+ "coreRules": 88,
43
116
  "approach": "core-files-only",
44
117
  "source": "common-en.md + security-en.md",
45
- "lastUpdated": "2025-07-30T09:30:00.000Z",
118
+ "lastUpdated": "2025-09-08T04:33:23.247Z",
46
119
  "version": "2.0.0"
47
120
  }
48
121
  }