@tsslint/typescript-plugin 1.1.5 → 1.1.6

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 +18 -22
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -156,18 +156,11 @@ function decorateLanguageService(ts, tsconfig, info) {
156
156
  ...errors.map(error => [error, ts.DiagnosticCategory.Error]),
157
157
  ...warnings.map(error => [error, ts.DiagnosticCategory.Warning]),
158
158
  ].map(([error, category]) => {
159
- let messageText;
160
- if (error.id === 'config-import-error') {
161
- messageText = `Error importing config file.`;
162
- }
163
- else {
164
- messageText = `Error building config file.`;
165
- }
166
159
  const diag = {
167
160
  category,
168
161
  source: 'tsslint',
169
162
  code: error.id ?? 0,
170
- messageText,
163
+ messageText: error.text,
171
164
  file: jsonConfigFile,
172
165
  start: configOptionSpan.start,
173
166
  length: configOptionSpan.length,
@@ -175,20 +168,23 @@ function decorateLanguageService(ts, tsconfig, info) {
175
168
  if (error.location) {
176
169
  const fileName = path.resolve(error.location.file).replace('http-url:', '');
177
170
  const fileText = ts.sys.readFile(error.location.file);
178
- const sourceFile = fileText !== undefined
179
- ? ts.createSourceFile(fileName, fileText, ts.ScriptTarget.Latest, true)
180
- : undefined;
181
- diag.relatedInformation = [{
182
- category,
183
- code: error.id,
184
- messageText: error.text,
185
- file: sourceFile,
186
- start: sourceFile?.getPositionOfLineAndCharacter(error.location.line - 1, error.location.column),
187
- length: error.location.lineText.length,
188
- }];
189
- }
190
- else {
191
- diag.messageText += `\n\n${error.text}`;
171
+ if (fileText !== undefined) {
172
+ if (error.id === 'config-import-error') {
173
+ diag.messageText = `Error importing config file.`;
174
+ }
175
+ else {
176
+ diag.messageText = `Error building config file.`;
177
+ }
178
+ const sourceFile = ts.createSourceFile(fileName, fileText, ts.ScriptTarget.Latest, true);
179
+ diag.relatedInformation = [{
180
+ category,
181
+ code: error.id,
182
+ messageText: error.text,
183
+ file: sourceFile,
184
+ start: sourceFile.getPositionOfLineAndCharacter(error.location.line - 1, error.location.column),
185
+ length: error.location.lineText.length,
186
+ }];
187
+ }
192
188
  }
193
189
  return diag;
194
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/typescript-plugin",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
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.1.5"
15
+ "@tsslint/core": "1.1.6"
16
16
  },
17
17
  "devDependencies": {
18
- "@tsslint/config": "1.1.5"
18
+ "@tsslint/config": "1.1.6"
19
19
  },
20
- "gitHead": "7aa702de750c8efee2681fbabafcab3da344df03"
20
+ "gitHead": "040024b0c2a08ded87940935090b4aaaebd8c7c4"
21
21
  }