@tsslint/core 1.0.3 → 1.0.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.
- package/index.js +17 -22
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -4,12 +4,24 @@ exports.applyTextChanges = exports.combineCodeFixes = exports.createLinter = voi
|
|
|
4
4
|
const ErrorStackParser = require("error-stack-parser");
|
|
5
5
|
function createLinter(ctx, config, withStack) {
|
|
6
6
|
if (withStack) {
|
|
7
|
-
require('source-map-support').install(
|
|
7
|
+
require('source-map-support').install({
|
|
8
|
+
retrieveFile(path) {
|
|
9
|
+
// monkey-fix, refs: https://github.com/typescript-eslint/typescript-eslint/issues/9352
|
|
10
|
+
if (path.replace(/\\/g, '/').includes('/@typescript-eslint/eslint-plugin/dist/rules/') && path.endsWith('.js.map')) {
|
|
11
|
+
return JSON.stringify({
|
|
12
|
+
version: 3,
|
|
13
|
+
sources: [],
|
|
14
|
+
sourcesContent: [],
|
|
15
|
+
mappings: '',
|
|
16
|
+
names: [],
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
});
|
|
8
21
|
}
|
|
9
22
|
const ts = ctx.typescript;
|
|
10
23
|
const fileFixes = new Map();
|
|
11
24
|
const sourceFiles = new Map();
|
|
12
|
-
const configSourceFile = ts.createSourceFile(ctx.configFile, ts.sys.readFile(ctx.configFile) ?? '', ts.ScriptTarget.Latest, true);
|
|
13
25
|
const plugins = (config.plugins ?? []).map(plugin => plugin(ctx));
|
|
14
26
|
let rules = { ...config.rules };
|
|
15
27
|
for (const plugin of plugins) {
|
|
@@ -80,27 +92,10 @@ function createLinter(ctx, config, withStack) {
|
|
|
80
92
|
: ErrorStackParser.parse(new Error());
|
|
81
93
|
if (typeof traceOffset === 'number') {
|
|
82
94
|
const baseOffset = 2 + traceOffset;
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
pushRelatedInformation(error, stacks[i]);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
if (stacks.length > baseOffset) {
|
|
90
|
-
pushRelatedInformation(error, stacks[baseOffset]);
|
|
91
|
-
}
|
|
95
|
+
if (stacks.length > baseOffset) {
|
|
96
|
+
pushRelatedInformation(error, stacks[baseOffset]);
|
|
92
97
|
}
|
|
93
98
|
}
|
|
94
|
-
if (withStack) {
|
|
95
|
-
error.relatedInformation?.push({
|
|
96
|
-
category: ts.DiagnosticCategory.Message,
|
|
97
|
-
code: 0,
|
|
98
|
-
file: configSourceFile,
|
|
99
|
-
start: 0,
|
|
100
|
-
length: 0,
|
|
101
|
-
messageText: 'TSSLint configuration file',
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
99
|
}
|
|
105
100
|
result.push(error);
|
|
106
101
|
return {
|
|
@@ -152,7 +147,7 @@ function createLinter(ctx, config, withStack) {
|
|
|
152
147
|
file: stackFile,
|
|
153
148
|
start: pos,
|
|
154
149
|
length: 0,
|
|
155
|
-
messageText: '
|
|
150
|
+
messageText: 'at ' + stack.functionName,
|
|
156
151
|
});
|
|
157
152
|
}
|
|
158
153
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsslint/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"source-map-support": "^0.5.21"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@tsslint/config": "1.0.
|
|
19
|
+
"@tsslint/config": "1.0.5"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "ee85483f0611f1005a3f49599575d1a7069c401a"
|
|
22
22
|
}
|