Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress: add eslint typescript support #304

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
parserOptions: {
ecmaVersion: 2018
},
env: {
node: true,
mocha: true,
es6: true
},
extends: 'eslint:recommended'
};
14 changes: 0 additions & 14 deletions .eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions .github/stale.yml

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Fork TS Checker Webpack Plugin

[![npm version](https://img.shields.io/npm/v/fork-ts-checker-webpack-plugin.svg)](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin)

[![npm beta version](https://img.shields.io/npm/v/fork-ts-checker-webpack-plugin/beta.svg)](https://www.npmjs.com/package/fork-ts-checker-webpack-plugin)

[![build status](https://travis-ci.org/Realytics/fork-ts-checker-webpack-plugin.svg?branch=master)](https://travis-ci.org/Realytics/fork-ts-checker-webpack-plugin)

[![downloads](http://img.shields.io/npm/dm/fork-ts-checker-webpack-plugin.svg)](https://npmjs.org/package/fork-ts-checker-webpack-plugin)

[![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Webpack plugin that runs TypeScript type checker on a separate process.
Expand Down
7 changes: 0 additions & 7 deletions babel.config.js

This file was deleted.

188 changes: 0 additions & 188 deletions jest.config.js

This file was deleted.

25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"lint": "tslint --project src/tsconfig.json && eslint ./test",
"lint:fix": "tslint --project src/tsconfig.json --fix && eslint ./test --fix",
"test": "yarn build && yarn test:unit && yarn test:integration",
"test:coverage": "rimraf coverage && jest --coverage && rimraf tmp",
"test:integration": "jest integration && rimraf tmp",
"test:unit": "jest unit",
"test:watch": "jest unit --watch",
"test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources mocha -- -R spec ./test/unit ./test/integration",
"test:integration": "mocha -R spec ./test/integration --exit && rimraf tmp",
"test:unit": "mocha -R spec ./test/unit --exit",
"test:watch": "mocha -R spec --watch ./test/unit",
"watch": "tsc --version && tsc --project \"./src\" --watch",
"precommit": "lint-staged && yarn build",
"commit": "./node_modules/.bin/git-cz"
Expand All @@ -67,7 +67,6 @@
"git add"
],
"*.ts": [
"tslint --fix",
"prettier --write",
"git add"
],
Expand Down Expand Up @@ -108,35 +107,31 @@
"worker-rpc": "^0.1.0"
},
"devDependencies": {
"@babel/preset-env": "^7.4.4",
"@babel/preset-typescript": "^7.3.3",
"@commitlint/config-conventional": "^7.5.0",
"@types/babel-code-frame": "^6.20.1",
"@types/chokidar": "^1.7.5",
"@types/jest": "^24.0.11",
"@types/lodash": "^4.14.134",
"@types/micromatch": "^3.1.0",
"@types/minimatch": "^3.0.1",
"@types/mock-require": "^2.0.0",
"@types/node": "^8.10.38",
"@types/rimraf": "^2.0.2",
"@types/semver": "^5.5.0",
"@types/webpack": "^4.4.19",
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"chai": "^4.2.0",
"commitlint": "^7.5.2",
"copy-dir": "^0.4.0",
"css-loader": "0.28.11",
"eslint": "^5.7.0",
"eslint": "^6.0.1",
"git-cz": "^3.0.1",
"husky": "^1.1.4",
"istanbul": "^0.4.5",
"jest": "^24.7.1",
"lint-staged": "^8.0.5",
"lodash": "^4.17.11",
"mocha": "^5.2.0",
"mock-fs": "^4.3.0",
"mock-require": "^3.0.2",
"prettier": "^1.14.3",
"rimraf": "^2.5.4",
"semantic-release": "^16.0.0-beta.18",
"sinon": "^7.1.1",
"ts-loader": "^5.0.0",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ApiIncrementalChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ApiIncrementalChecker implements IncrementalCheckerInterface {
private linterConfig?: ConfigurationFile;
private linterConfigs: Record<string, ConfigurationFile | undefined> = {};

protected readonly tsIncrementalCompiler: CompilerHost;
private readonly tsIncrementalCompiler: CompilerHost;
private linterExclusions: minimatch.IMinimatch[] = [];

private currentLintErrors = new Map<string, LintResult>();
Expand Down
9 changes: 2 additions & 7 deletions src/CompilerHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class CompilerHost
private readonly tsHost: ts.WatchCompilerHostOfConfigFile<
ts.EmitAndSemanticDiagnosticsBuilderProgram
>;
protected lastProcessing?: Promise<ts.Diagnostic[]>;
private lastProcessing?: Promise<ts.Diagnostic[]>;

private compilationStarted = false;

Expand Down Expand Up @@ -82,12 +82,7 @@ export class CompilerHost
typescript.sys,
typescript.createEmitAndSemanticDiagnosticsBuilderProgram,
(diag: ts.Diagnostic) => {
if (
!checkSyntacticErrors &&
diag.code >= 1000 &&
diag.code < 2000 &&
diag.file // if diag.file is undefined, this is not a syntactic error, but a global error that should be emitted
) {
if (!checkSyntacticErrors && diag.code >= 1000 && diag.code < 2000) {
return;
}
this.gatheredDiagnostic.push(diag);
Expand Down
4 changes: 2 additions & 2 deletions src/IncrementalChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export class IncrementalChecker implements IncrementalCheckerInterface {
// to check of its existence later on.
private linterExclusions: minimatch.IMinimatch[] = [];

protected program?: ts.Program;
protected programConfig?: ts.ParsedCommandLine;
private program?: ts.Program;
private programConfig?: ts.ParsedCommandLine;
private watcher?: FilesWatcher;

private readonly hasFixedConfig: boolean;
Expand Down
Loading