Skip to content

Commit e1a2611

Browse files
committed
chore: cleanup deps and fix tests
1 parent 989fc15 commit e1a2611

14 files changed

+621
-922
lines changed

.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.
-23.6 KB
Binary file not shown.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"devDependencies": {
5252
"@types/babel-code-frame": "^6.20.1",
5353
"@types/chokidar": "^1.7.5",
54-
"@types/lodash": "^4.14.117",
5554
"@types/micromatch": "^3.1.0",
5655
"@types/minimatch": "^3.0.1",
5756
"@types/node": "^8.0.26",
@@ -87,10 +86,8 @@
8786
"babel-code-frame": "^6.22.0",
8887
"chalk": "^2.4.1",
8988
"chokidar": "^2.0.4",
90-
"lodash": "^4.17.11",
9189
"micromatch": "^3.1.10",
9290
"minimatch": "^3.0.4",
93-
"resolve": "^1.5.0",
9491
"tapable": "^1.0.0"
9592
},
9693
"husky": {

src/FilesWatcher.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as chokidar from 'chokidar';
22
import * as path from 'path';
3-
import startsWith = require('lodash/startsWith');
43

54
export class FilesWatcher {
65
watchPaths: string[];
@@ -47,7 +46,7 @@ export class FilesWatcher {
4746
return (
4847
this.isWatching() &&
4948
this.isFileSupported(filePath) &&
50-
this.watchPaths.some(watchPath => startsWith(filePath, watchPath))
49+
this.watchPaths.some(watchPath => filePath.startsWith(watchPath))
5150
);
5251
}
5352

src/IncrementalChecker.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as fs from 'fs';
2-
import endsWith = require('lodash/endsWith');
32
import * as path from 'path';
43
import * as ts from 'typescript';
54
import { Configuration, Linter, RuleFailure } from 'tslint'; // Imported for types alone; actual requires take place in methods below
@@ -21,15 +20,15 @@ interface ConfigurationFile extends Configuration.IConfigurationFile {
2120
}
2221

2322
export class IncrementalChecker {
24-
private programConfigFile: string;
25-
private compilerOptions: object;
26-
private linterConfigFile: string | false;
27-
private linterAutoFix: boolean;
28-
private watchPaths: string[];
29-
private workNumber: number;
30-
private workDivision: number;
31-
private checkSyntacticErrors: boolean;
32-
private files: FilesRegister;
23+
programConfigFile: string;
24+
compilerOptions: object;
25+
linterConfigFile: string | false;
26+
linterAutoFix: boolean;
27+
watchPaths: string[];
28+
workNumber: number;
29+
workDivision: number;
30+
checkSyntacticErrors: boolean;
31+
files: FilesRegister;
3332

3433
linter?: Linter;
3534
linterConfig?: ConfigurationFile;
@@ -155,7 +154,7 @@ export class IncrementalChecker {
155154
linterExclusions: minimatch.IMinimatch[]
156155
): boolean {
157156
return (
158-
endsWith(filePath, '.d.ts') ||
157+
filePath.endsWith('.d.ts') ||
159158
linterExclusions.some(matcher => matcher.match(filePath))
160159
);
161160
}
@@ -304,7 +303,7 @@ export class IncrementalChecker {
304303
cancellationToken.throwIfCancellationRequested();
305304

306305
try {
307-
this.linter!.lint(fileName, undefined, this.linterConfig);
306+
this.linter!.lint(fileName, undefined!, this.linterConfig); // REVIEW: this shouldn't work?
308307
} catch (e) {
309308
if (
310309
fs.existsSync(fileName) &&

src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import * as fs from 'fs';
66
import * as micromatch from 'micromatch';
77
import * as os from 'os';
88
import * as webpack from 'webpack';
9-
import isString = require('lodash/isString');
10-
import isFunction = require('lodash/isFunction');
119
import { CancellationToken } from './CancellationToken';
1210
import { NormalizedMessage } from './NormalizedMessage';
1311
import { createDefaultFormatter } from './formatter/defaultFormatter';
@@ -131,7 +129,7 @@ class ForkTsCheckerWebpackPlugin {
131129
: options.tslint
132130
: undefined;
133131
this.tslintAutoFix = options.tslintAutoFix || false;
134-
this.watch = isString(options.watch)
132+
this.watch = (typeof options.watch === 'string')
135133
? [options.watch]
136134
: options.watch || [];
137135
this.ignoreDiagnostics = options.ignoreDiagnostics || [];
@@ -147,7 +145,7 @@ class ForkTsCheckerWebpackPlugin {
147145
this.useColors = options.colors !== false; // default true
148146
this.colors = new chalk.constructor({ enabled: this.useColors });
149147
this.formatter =
150-
options.formatter && isFunction(options.formatter)
148+
options.formatter && (typeof options.formatter === 'function')
151149
? options.formatter
152150
: ForkTsCheckerWebpackPlugin.createFormatter(
153151
(options.formatter as 'default' | 'codeframe') || 'default',

src/tslint.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"allow-pascal-case"
2424
],
2525
"no-namespace": false,
26-
"array-type": [true, "array"],
27-
"no-submodule-imports": [true, "lodash"]
28-
26+
"array-type": [true, "array"]
2927
}
3028
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"compilerOptions": {
3+
"lib": ["es2016"],
34
}
45
}

test/integration/vue/tsconfig-attrs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"compilerOptions": {},
2+
"compilerOptions": {
3+
"lib": ["es2016", "dom"]
4+
},
35
"include": [
46
"src/attrs/Test.vue",
57
"src/attrs/NotFound.vue"

test/integration/vue/tsconfig-imports.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"imports/foo1/*",
99
"imports/foo2/*"
1010
]
11-
}
11+
},
12+
"lib": ["es2016", "dom"]
1213
},
1314
"include": [
1415
"imports/Test.vue"

0 commit comments

Comments
 (0)