@tsslint/core 1.0.11 → 1.0.12
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/index.js +14 -4
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -50,7 +50,7 @@ function createLinter(ctx, config, withStack) {
|
|
|
50
50
|
const token = ctx.languageServiceHost.getCancellationToken?.();
|
|
51
51
|
const rules = getFileRules(sourceFile.fileName);
|
|
52
52
|
const fixes = getFileFixes(sourceFile.fileName);
|
|
53
|
-
let
|
|
53
|
+
let diagnostics = [];
|
|
54
54
|
let currentRuleId;
|
|
55
55
|
fixes.clear();
|
|
56
56
|
for (const [id, rule] of Object.entries(rules)) {
|
|
@@ -68,10 +68,20 @@ function createLinter(ctx, config, withStack) {
|
|
|
68
68
|
}
|
|
69
69
|
for (const plugin of plugins) {
|
|
70
70
|
if (plugin.resolveDiagnostics) {
|
|
71
|
-
|
|
71
|
+
diagnostics = plugin.resolveDiagnostics(sourceFile.fileName, diagnostics);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
const diagnosticSet = new Set(diagnostics);
|
|
75
|
+
for (const [ruleId, fix] of [...fixes]) {
|
|
76
|
+
const finalFixes = fix.filter(fix => diagnosticSet.has(fix.diagnostic));
|
|
77
|
+
if (finalFixes.length) {
|
|
78
|
+
fixes.set(ruleId, finalFixes);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
fixes.delete(ruleId);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return diagnostics;
|
|
75
85
|
function reportError(message, start, end, traceOffset = 0) {
|
|
76
86
|
return report(ts.DiagnosticCategory.Error, message, start, end, traceOffset);
|
|
77
87
|
}
|
|
@@ -103,7 +113,7 @@ function createLinter(ctx, config, withStack) {
|
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
|
-
|
|
116
|
+
diagnostics.push(error);
|
|
107
117
|
return {
|
|
108
118
|
withDeprecated() {
|
|
109
119
|
error.reportsDeprecated = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsslint/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"source-map-support": "^0.5.21"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@tsslint/config": "1.0.
|
|
20
|
+
"@tsslint/config": "1.0.12"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "b34fbb2c8408616eb00536f00e525cb4fc8d8913"
|
|
23
23
|
}
|