@astrojs/language-server 2.5.4 → 2.5.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/dist/check.d.ts +1 -0
- package/dist/check.js +11 -1
- package/package.json +1 -1
package/dist/check.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class AstroCheck {
|
|
|
21
21
|
private ts;
|
|
22
22
|
project: ReturnType<typeof kit.createProject>;
|
|
23
23
|
private linter;
|
|
24
|
+
private skipJSX;
|
|
24
25
|
constructor(workspacePath: string, typescriptPath: string | undefined, tsconfigPath: string | undefined);
|
|
25
26
|
/**
|
|
26
27
|
* Lint a list of files or the entire project and optionally log the errors found
|
package/dist/check.js
CHANGED
|
@@ -45,6 +45,8 @@ class AstroCheck {
|
|
|
45
45
|
this.workspacePath = workspacePath;
|
|
46
46
|
this.typescriptPath = typescriptPath;
|
|
47
47
|
this.tsconfigPath = tsconfigPath;
|
|
48
|
+
// TODO: Remove this when the JSX typing issue is fixed
|
|
49
|
+
this.skipJSX = false;
|
|
48
50
|
this.initialize();
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
@@ -54,7 +56,10 @@ class AstroCheck {
|
|
|
54
56
|
* @return {CheckResult} The result of the lint, including a list of errors, the file's content and its file path.
|
|
55
57
|
*/
|
|
56
58
|
async lint({ fileNames = undefined, cancel = () => false, logErrors = undefined, }) {
|
|
57
|
-
|
|
59
|
+
let files = fileNames !== undefined ? fileNames : this.project.languageHost.getScriptFileNames();
|
|
60
|
+
if (this.skipJSX) {
|
|
61
|
+
files = files.filter((file) => !file.endsWith('.jsx') && !file.endsWith('.tsx'));
|
|
62
|
+
}
|
|
58
63
|
const result = {
|
|
59
64
|
status: undefined,
|
|
60
65
|
fileChecked: 0,
|
|
@@ -134,6 +139,11 @@ class AstroCheck {
|
|
|
134
139
|
});
|
|
135
140
|
});
|
|
136
141
|
}
|
|
142
|
+
const files = this.project.languageHost.getScriptFileNames();
|
|
143
|
+
if (files.some((file) => file.endsWith('.jsx') || file.endsWith('.tsx'))) {
|
|
144
|
+
console.warn('\x1b[33;1mWARNING:\x1b[0m Checking `.jsx` and `.tsx` files is temporarily disabled due to an issue in the Astro language server and TypeScript. See https://github.com/withastro/language-tools/issues/727 for more details. In the meantime, such files can be checked using `tsc --noEmit`.');
|
|
145
|
+
this.skipJSX = true;
|
|
146
|
+
}
|
|
137
147
|
this.linter = kit.createLinter(config, this.project.languageHost);
|
|
138
148
|
}
|
|
139
149
|
getTsconfig() {
|