You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* test: create test fixture for eslint + activate vscode plugin
* feat: add eslint option infrastructure
* feat: add basic implementation (untested) - might work!
* chore: disable eslint in Travis for now
* test: added first test of eslint message being published
* test: add error test for eslint
* feat: add eslint support to IncrementalChecker
* test: remove duplicate test and up test timeout
* docs: add eslint details to readme
* feat: validate eslint and allow options to be passed
* fix: correctly output version
* feat: persist eslinter instance between runs
* feat: incrementalchecker no longer recreates eslint each time
* feat: share eslint between checkers
* feat: share eslint logic between checkers
* fix: respond to @piotr-oles PR feedback
* fix: delete stale lints first
* fix: addressed comments suggested by @phryneas
* docs: more eslint info in the readme
* fix: respond to review comments from piotr
* fix: move cancellation token check
context:__dirname, // to automatically find tsconfig.json
28
34
entry:'./src/index.ts',
29
35
module: {
@@ -44,12 +50,12 @@ var webpackConfig = {
44
50
45
51
## Motivation
46
52
47
-
There is already similar solution - [awesome-typescript-loader](https://github.com/s-panferov/awesome-typescript-loader). You can
53
+
There was already similar solution - [awesome-typescript-loader](https://github.com/s-panferov/awesome-typescript-loader). You can
48
54
add `CheckerPlugin` and delegate checker to the separate process. The problem with `awesome-typescript-loader` was that, in our case,
49
55
it was a lot slower than [ts-loader](https://github.com/TypeStrong/ts-loader) on an incremental build (~20s vs ~3s).
50
-
Secondly, we use[tslint](https://palantir.github.io/tslint) and we wanted to run this, along with type checker, in a separate process.
51
-
This is why we've created this plugin. To provide better performance, plugin reuses Abstract Syntax Trees between compilations and shares
52
-
these trees with tslint. It can be scaled with a multi-process mode to utilize maximum CPU power.
56
+
Secondly, we used[tslint](https://palantir.github.io/tslint) and we wanted to run this, along with type checker, in a separate process.
57
+
This is why this plugin was created. To provide better performance, the plugin reuses Abstract Syntax Trees between compilations and shares
58
+
these trees with TSLint. It can be scaled with a multi-process mode to utilize maximum CPU power.
53
59
54
60
## Modules resolution
55
61
@@ -61,12 +67,47 @@ to compile files (which traverses dependency graph during compilation) - we have
61
67
62
68
To debug TypeScript's modules resolution, you can use `tsc --traceResolution` command.
63
69
70
+
## ESLint
71
+
72
+
[ESLint is the future of linting in the TypeScript world.](https://eslint.org/blog/2019/01/future-typescript-eslint) If you'd like to use eslint with the plugin, supply this option: `eslint: true` and ensure you have the relevant dependencies installed:
ecmaVersion:2018, // Allows for the parsing of modern ECMAScript features
89
+
sourceType:'module', // Allows for the use of imports
90
+
},
91
+
rules: {
92
+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
93
+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
94
+
}
95
+
};
96
+
```
97
+
98
+
There's a good explanation on setting up TypeScript ESLint support by Robert Cooper [here](https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb).
99
+
64
100
## TSLint
65
101
102
+
*[TSLint is being replaced by ESLint](https://medium.com/palantir/tslint-in-2019-1a144c2317a9).
103
+
https://eslint.org/blog/2019/01/future-typescript-eslint. As a consequence, support for TSLint in fork-ts-checker-webpack-plugin will be deprecated and removed in future versions of the plugin.*
104
+
66
105
If you have installed [tslint](https://palantir.github.io/tslint), you can enable it by setting `tslint: true` or
67
106
`tslint: './path/to/tslint.json'`. We recommend changing `defaultSeverity` to a `"warning"` in `tslint.json` file.
68
107
It helps to distinguish lints from TypeScript's diagnostics.
69
108
109
+
110
+
70
111
## Options
71
112
72
113
-**tsconfig**`string`:
@@ -75,6 +116,14 @@ It helps to distinguish lints from TypeScript's diagnostics.
75
116
-**compilerOptions**`object`:
76
117
Allows overriding TypeScript options. Should be specified in the same format as you would do for the `compilerOptions` property in tsconfig.json. Default: `{}`.
77
118
119
+
-**eslint**`true | undefined`:
120
+
121
+
- If `true`, this activates eslint support.
122
+
123
+
-**eslintOptions**`object`:
124
+
125
+
- Options that can be used to initialise ESLint. See https://eslint.org/docs/1.0.0/developer-guide/nodejs-api#cliengine
126
+
78
127
-**tslint**`string | true | undefined`:
79
128
80
129
- If `string`, path to _tslint.json_ file to check source files against.
0 commit comments