@tsslint/cli 1.4.1 → 1.4.2

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/lib/worker.js +22 -1
  2. package/package.json +4 -4
package/lib/worker.js CHANGED
@@ -46,6 +46,22 @@ const originalHost = {
46
46
  }
47
47
  return snapshots.get(fileName);
48
48
  },
49
+ getScriptKind(fileName) {
50
+ const languageId = (0, typescript_1.resolveFileLanguageId)(fileName);
51
+ switch (languageId) {
52
+ case 'javascript':
53
+ return ts.ScriptKind.JS;
54
+ case 'javascriptreact':
55
+ return ts.ScriptKind.JSX;
56
+ case 'typescript':
57
+ return ts.ScriptKind.TS;
58
+ case 'typescriptreact':
59
+ return ts.ScriptKind.TSX;
60
+ case 'json':
61
+ return ts.ScriptKind.JSON;
62
+ }
63
+ return ts.ScriptKind.Unknown;
64
+ },
49
65
  getDefaultLibFileName(options) {
50
66
  return ts.getDefaultLibFilePath(options);
51
67
  },
@@ -164,7 +180,12 @@ async function setup(tsconfig, languages, configFile, builtConfig, _fileNames, _
164
180
  projectVersion++;
165
181
  typeRootsVersion++;
166
182
  fileNames = _fileNames;
167
- options = _options;
183
+ options = plugins.some(plugin => plugin.typescript?.extraFileExtensions.length)
184
+ ? {
185
+ ..._options,
186
+ allowNonTsExtensions: true,
187
+ }
188
+ : _options;
168
189
  linter = core.createLinter({
169
190
  configFile,
170
191
  languageService: linterLanguageService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/cli",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsslint": "./bin/tsslint.js"
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@clack/prompts": "^0.8.2",
19
- "@tsslint/config": "1.4.1",
20
- "@tsslint/core": "1.4.1",
19
+ "@tsslint/config": "1.4.2",
20
+ "@tsslint/core": "1.4.2",
21
21
  "@volar/language-core": "~2.4.0",
22
22
  "@volar/typescript": "~2.4.0",
23
23
  "glob": "^10.4.1"
@@ -28,5 +28,5 @@
28
28
  "devDependencies": {
29
29
  "@vue/language-core": "latest"
30
30
  },
31
- "gitHead": "54f42ec9414029a356fa19a762260f03392563fa"
31
+ "gitHead": "4cdc9070fda83e226ab04fa90b99c2b8d748b315"
32
32
  }