eslint-plugin-tsc
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -32,3 +32,3 @@ "use strict"; | ||
}, | ||
getScriptSnapshot: (fileName) => { | ||
getScriptSnapshot(fileName) { | ||
let fileRef = files[fileName]; | ||
@@ -39,3 +39,4 @@ if (!fileRef) { | ||
if (fileRef.snapshot === undefined) { | ||
fileRef.snapshot = ts.ScriptSnapshot.fromString(fs_1.readFileSync(fileName, 'utf8')); | ||
const data = this.readFile(fileName); | ||
fileRef.snapshot = ts.ScriptSnapshot.fromString(data); | ||
} | ||
@@ -80,5 +81,4 @@ return fileRef.snapshot; | ||
fileRef.version++; | ||
// Clear cache | ||
fileExistsCache[fileName] = undefined; | ||
readFileCache[fileName] = undefined; | ||
fileExistsCache[fileName] = true; | ||
readFileCache[fileName] = fileContent; | ||
}, | ||
@@ -85,0 +85,0 @@ getDiagnostics(fileName) { |
{ | ||
"name": "eslint-plugin-tsc", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "eslint-plugin-tsc", |
@@ -24,4 +24,5 @@ # eslint-plugin-tsc | ||
* `tsc/config` Wraps a TypeScript compiler checks | ||
Configuration `{ configFile: string }` | ||
`configFile` path to `tsconfig.json` file | ||
Configuration `{ configFile: string, compilerOptions?: ts.CompilerOptions }` | ||
`configFile` path to `tsconfig.json` file (it's better to specify an absolute path) | ||
`compilerOptions` ability to override compilerOptions defined in config file | ||
@@ -28,0 +29,0 @@ ## CHANGELOG |
@@ -18,4 +18,4 @@ import { rules } from './index'; | ||
{ | ||
filename: resolve('test-project/source.ts'), | ||
code: readFileSync('test-project/source.ts').toString(), | ||
filename: resolve('test-project/errors.ts'), | ||
code: readFileSync('test-project/errors.ts').toString(), | ||
options: [{ configFile: 'test-project/tsconfig.json' }], | ||
@@ -49,3 +49,9 @@ errors: [ | ||
}, | ||
{ | ||
filename: resolve('test-project/global-types.ts'), | ||
code: readFileSync('test-project/global-types.ts').toString(), | ||
options: [{ configFile: 'test-project/tsconfig.json' }], | ||
}, | ||
], | ||
}); |
@@ -49,3 +49,3 @@ import * as ts from 'typescript'; | ||
}, | ||
getScriptSnapshot: (fileName) => { | ||
getScriptSnapshot(fileName: string) { | ||
let fileRef = files[fileName]; | ||
@@ -56,3 +56,4 @@ if (!fileRef) { | ||
if (fileRef.snapshot === undefined) { | ||
fileRef.snapshot = ts.ScriptSnapshot.fromString(readFileSync(fileName, 'utf8')); | ||
const data = this.readFile(fileName); | ||
fileRef.snapshot = ts.ScriptSnapshot.fromString(data); | ||
} | ||
@@ -99,5 +100,5 @@ return fileRef.snapshot; | ||
fileRef.version++; | ||
// Clear cache | ||
fileExistsCache[fileName] = undefined; | ||
readFileCache[fileName] = undefined; | ||
fileExistsCache[fileName] = true; | ||
readFileCache[fileName] = fileContent; | ||
}, | ||
@@ -104,0 +105,0 @@ getDiagnostics(fileName: string) { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27127
410
51
0