isml-linter 5.43.0 → 5.43.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.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/util/RuleUtils.js +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.43.1] - 2023-02-11
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- All line-by-line rules are applied, one after the other, without ovewriting the previous rule fixed content;
|
|
7
|
+
|
|
3
8
|
## [5.43.0] - 2023-01-31
|
|
4
9
|
|
|
5
10
|
### Added
|
|
@@ -1088,6 +1093,7 @@
|
|
|
1088
1093
|
### Added
|
|
1089
1094
|
- Linter is published;
|
|
1090
1095
|
|
|
1096
|
+
[5.43.1]: https://github.com/FabiowQuixada/isml-linter/compare/v5.43.0...v5.43.1
|
|
1091
1097
|
[5.43.0]: https://github.com/FabiowQuixada/isml-linter/compare/v5.42.4...v5.43.0
|
|
1092
1098
|
[5.42.4]: https://github.com/FabiowQuixada/isml-linter/compare/v5.42.3...v5.42.4
|
|
1093
1099
|
[5.42.3]: https://github.com/FabiowQuixada/isml-linter/compare/v5.42.2...v5.42.3
|
package/package.json
CHANGED
package/src/util/RuleUtils.js
CHANGED
|
@@ -77,7 +77,7 @@ const fixTemplateOrReportIssues = (config, ruleResult, templatePath, templateRes
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
const fixTemplateOrReportIssuesForRuleList = (ruleArray, templatePath,
|
|
80
|
+
const fixTemplateOrReportIssuesForRuleList = (ruleArray, templatePath, rootNodeOrTemplateContent, config, data) => {
|
|
81
81
|
const templateResults = {
|
|
82
82
|
fixed : false,
|
|
83
83
|
errors : {},
|
|
@@ -86,13 +86,20 @@ const fixTemplateOrReportIssuesForRuleList = (ruleArray, templatePath, root, con
|
|
|
86
86
|
data
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
let tempRootNodeOrTemplateContent = rootNodeOrTemplateContent;
|
|
90
|
+
|
|
89
91
|
for (let i = 0; i < ruleArray.length; i++) {
|
|
90
92
|
const rule = ruleArray[i];
|
|
91
93
|
if (!rule.shouldIgnore(templatePath)) {
|
|
92
94
|
try {
|
|
93
95
|
ConsoleUtils.displayVerboseMessage(`Applying "${rule.id}" rule`, 1);
|
|
94
|
-
const ruleResults = rule.check(
|
|
96
|
+
const ruleResults = rule.check(tempRootNodeOrTemplateContent, templateResults.data);
|
|
95
97
|
templateResults.finalContent = ruleResults.fixedContent;
|
|
98
|
+
|
|
99
|
+
if (typeof rootNodeOrTemplateContent === 'string') {
|
|
100
|
+
tempRootNodeOrTemplateContent = ruleResults.fixedContent;
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
fixTemplateOrReportIssues(config, ruleResults, templatePath, templateResults, rule);
|
|
97
104
|
|
|
98
105
|
} catch (error) {
|