@tsslint/core 1.4.1 → 1.4.3
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.d.ts +1 -1
- package/index.js +5 -4
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type FileLintCache = [
|
|
|
10
10
|
minimatchResult: Record<string, boolean>
|
|
11
11
|
];
|
|
12
12
|
export type Linter = ReturnType<typeof createLinter>;
|
|
13
|
-
export declare function createLinter(ctx: ProjectContext, config: Config | Config[], mode: 'cli' | 'typescript-plugin'
|
|
13
|
+
export declare function createLinter(ctx: ProjectContext, config: Config | Config[], mode: 'cli' | 'typescript-plugin'): {
|
|
14
14
|
lint(fileName: string, cache?: FileLintCache): ts.DiagnosticWithLocation[];
|
|
15
15
|
hasCodeFixes(fileName: string): boolean;
|
|
16
16
|
getCodeFixes(fileName: string, start: number, end: number, diagnostics?: ts.Diagnostic[], minimatchCache?: FileLintCache[4]): ts.CodeFixAction[];
|
package/index.js
CHANGED
|
@@ -24,9 +24,7 @@ const ErrorStackParser = require("error-stack-parser");
|
|
|
24
24
|
const path = require("path");
|
|
25
25
|
const minimatch = require("minimatch");
|
|
26
26
|
const typeAwareModeChange = new Error('enable type-aware mode');
|
|
27
|
-
function createLinter(ctx, config, mode
|
|
28
|
-
// @ts-expect-error
|
|
29
|
-
logger) {
|
|
27
|
+
function createLinter(ctx, config, mode) {
|
|
30
28
|
let languageServiceUsage = 0;
|
|
31
29
|
const ts = ctx.typescript;
|
|
32
30
|
const languageService = new Proxy(ctx.languageService, {
|
|
@@ -335,7 +333,10 @@ logger) {
|
|
|
335
333
|
};
|
|
336
334
|
function getSourceFile(fileName) {
|
|
337
335
|
if (languageServiceUsage) {
|
|
338
|
-
|
|
336
|
+
const sourceFile = ctx.languageService.getProgram().getSourceFile(fileName);
|
|
337
|
+
if (sourceFile) {
|
|
338
|
+
return sourceFile;
|
|
339
|
+
}
|
|
339
340
|
}
|
|
340
341
|
else {
|
|
341
342
|
const snapshot = ctx.languageServiceHost.getScriptSnapshot(fileName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsslint/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/core"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@tsslint/types": "1.4.
|
|
15
|
+
"@tsslint/types": "1.4.3",
|
|
16
16
|
"error-stack-parser": "^2.1.4",
|
|
17
17
|
"esbuild": ">=0.17.0",
|
|
18
18
|
"minimatch": "^10.0.1"
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"postinstall": "node scripts/cleanCache.js"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "7cdb4a39c0af8ee4cebd430bb546c6b6e2ddc28b"
|
|
27
27
|
}
|