Chore: use fork-ts-checker plugin for eslint check (#25631)

* Use fork-ts-checker for eslint check

* Fix lint issue

* Add packages to lint

* Add comments to webpack configs
This commit is contained in:
Zoltán Bedi
2020-06-22 16:15:29 +02:00
committed by GitHub
parent 95d53f03a0
commit c16890c22d
6 changed files with 97 additions and 68 deletions

View File

@ -73,13 +73,6 @@ module.exports = (env = {}) =>
],
},
},
{
loader: 'eslint-loader',
options: {
emitError: true,
emitWarning: true,
},
},
],
},
require('./sass.rule.js')({
@ -94,7 +87,28 @@ module.exports = (env = {}) =>
env.noTsCheck
? new webpack.DefinePlugin({}) // bogus plugin to satisfy webpack API
: new ForkTsCheckerWebpackPlugin({
checkSyntacticErrors: true,
eslint: {
enabled: true,
files: [
'public/app/**/*.{ts,tsx}',
// this can't be written like this packages/**/src/**/*.ts because it throws an error
'packages/grafana-ui/src/**/*.{ts,tsx}',
'packages/grafana-data/src/**/*.{ts,tsx}',
'packages/grafana-runtime/src/**/*.{ts,tsx}',
'packages/grafana-e2e-selectors/src/**/*.{ts,tsx}',
'packages/jaeger-ui-components/src/**/*.{ts,tsx}',
],
options: {
cache: true,
},
},
typescript: {
mode: 'write-references',
diagnosticOptions: {
semantic: true,
syntactic: true,
},
},
}),
new MiniCssExtractPlugin({
filename: 'grafana.[name].[hash].css',