@tsslint/typescript-plugin 1.0.16 → 1.0.17

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 (2) hide show
  1. package/index.js +12 -12
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -36,14 +36,12 @@ function decorateLanguageService(ts, tsconfig, info) {
36
36
  if (configFileDiagnostics.length) {
37
37
  const sourceFile = info.languageService.getProgram()?.getSourceFile(fileName);
38
38
  if (sourceFile) {
39
- if (configFileDiagnostics.length) {
40
- result = result.concat(configFileDiagnostics.map(diagnostic => ({
41
- ...diagnostic,
42
- file: sourceFile,
43
- start: 0,
44
- length: 0,
45
- })));
46
- }
39
+ result = result.concat(configFileDiagnostics.map(diagnostic => ({
40
+ ...diagnostic,
41
+ file: sourceFile,
42
+ start: 0,
43
+ length: 0,
44
+ })));
47
45
  }
48
46
  }
49
47
  if (linter) {
@@ -162,21 +160,23 @@ function decorateLanguageService(ts, tsconfig, info) {
162
160
  category,
163
161
  source: 'tsslint',
164
162
  code: 0,
165
- messageText: 'Failed to build/load TSSLint config.',
163
+ messageText: `Failed to build/load TSSLint config. (${error.text})`,
166
164
  file: jsonConfigFile,
167
165
  start: configOptionSpan.start,
168
166
  length: configOptionSpan.length,
169
167
  };
170
168
  if (error.location) {
171
- const fileName = path.resolve(error.location.file);
169
+ const fileName = path.resolve(error.location.file).replace('http-url:', '');
172
170
  const fileText = ts.sys.readFile(error.location.file);
173
- const sourceFile = ts.createSourceFile(fileName, fileText ?? '', ts.ScriptTarget.Latest, true);
171
+ const sourceFile = fileText !== undefined
172
+ ? ts.createSourceFile(fileName, fileText, ts.ScriptTarget.Latest, true)
173
+ : undefined;
174
174
  diag.relatedInformation = [{
175
175
  category,
176
176
  code: error.id,
177
177
  messageText: error.text,
178
178
  file: sourceFile,
179
- start: sourceFile.getPositionOfLineAndCharacter(error.location.line - 1, error.location.column),
179
+ start: sourceFile?.getPositionOfLineAndCharacter(error.location.line - 1, error.location.column),
180
180
  length: error.location.lineText.length,
181
181
  }];
182
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/typescript-plugin",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -12,10 +12,10 @@
12
12
  "directory": "packages/typescript-plugin"
13
13
  },
14
14
  "dependencies": {
15
- "@tsslint/core": "1.0.16"
15
+ "@tsslint/core": "1.0.17"
16
16
  },
17
17
  "devDependencies": {
18
- "@tsslint/config": "1.0.16"
18
+ "@tsslint/config": "1.0.17"
19
19
  },
20
- "gitHead": "e430814fd394da5afbcd3157d02c246592162f75"
20
+ "gitHead": "5ffa59ffc098b272ff18579d9fc57f1658978a5e"
21
21
  }