Commit c16890c2 by Zoltán Bedi Committed by GitHub

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
parent 95d53f03
......@@ -15,6 +15,7 @@ awsconfig
.yarnrc
.yarn/
vendor/
.eslintcache
# Enterprise emails
/emails/templates/enterprise_*
......
......@@ -129,14 +129,13 @@
"es6-shim": "0.35.5",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-jsdoc": "22.1.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.18.3",
"expect.js": "0.3.1",
"expose-loader": "0.7.5",
"file-loader": "5.0.2",
"fork-ts-checker-webpack-plugin": "4.0.3",
"fork-ts-checker-webpack-plugin": "5.0.0",
"gaze": "1.1.3",
"glob": "7.1.6",
"grunt": "1.0.4",
......
......@@ -6,7 +6,7 @@ const pull = require('lodash/pull');
let dependencies = Object.keys(pkg.dependencies);
// remove jquery so we can add it first
// remove rxjs so we can only depend on parts of it in code
pull(dependencies, 'jquery', 'rxjs')
pull(dependencies, 'jquery', 'rxjs');
// add jquery first
dependencies.unshift('jquery');
......
......@@ -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',
......
......@@ -66,13 +66,6 @@ module.exports = merge(common, {
],
},
},
{
loader: 'eslint-loader',
options: {
emitError: true,
emitWarning: true,
},
},
],
},
require('./sass.rule.js')({
......@@ -94,8 +87,26 @@ module.exports = merge(common, {
},
plugins: [
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}',
],
},
typescript: {
mode: 'write-references',
memoryLimit: 4096,
diagnosticOptions: {
semantic: true,
syntactic: true,
},
},
}),
new MiniCssExtractPlugin({
filename: 'grafana.[name].[hash].css',
......
......@@ -7823,6 +7823,11 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
at-least-node@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==
atob-lite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/atob-lite/-/atob-lite-2.0.0.tgz#0fef5ad46f1bd7a8502c65727f0367d5ee43d696"
......@@ -12131,17 +12136,6 @@ eslint-config-prettier@6.10.0:
dependencies:
get-stdin "^6.0.0"
eslint-loader@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-3.0.3.tgz#e018e3d2722381d982b1201adb56819c73b480ca"
integrity sha512-+YRqB95PnNvxNp1HEjQmvf9KNvCin5HXYYseOXVC2U0KEcw4IkQ2IQEBG46j7+gW39bMzeu0GsUhVbBY3Votpw==
dependencies:
fs-extra "^8.1.0"
loader-fs-cache "^1.0.2"
loader-utils "^1.2.3"
object-hash "^2.0.1"
schema-utils "^2.6.1"
eslint-plugin-jsdoc@22.1.0:
version "22.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-22.1.0.tgz#dadfa62653fc0d87f900d810307f5ed07ef6ecd5"
......@@ -12975,15 +12969,6 @@ finalhandler@~1.1.2:
statuses "~1.5.0"
unpipe "~1.0.0"
find-cache-dir@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9"
integrity sha1-yN765XyKUqinhPnjHFfHQumToLk=
dependencies:
commondir "^1.0.1"
mkdirp "^0.5.1"
pkg-dir "^1.0.0"
find-cache-dir@^2.0.0, find-cache-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7"
......@@ -13270,18 +13255,21 @@ fork-ts-checker-webpack-plugin@3.1.1:
tapable "^1.0.0"
worker-rpc "^0.1.0"
fork-ts-checker-webpack-plugin@4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.0.3.tgz#958f4e4ec3e7fd9d4ad5a50a4442abce77dca19a"
integrity sha512-5hGeMYKg817Hp6rvdc2EOS/T/Cq0JW9LLJDZtVUPlNIojIuP7YbOAdrHEk4Irw1097YQUr56kWIiYhqNPzfNzQ==
fork-ts-checker-webpack-plugin@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.0.0.tgz#43a8efda935aba382ca88ae169ab11b70041c06a"
integrity sha512-XdMGiyz12rl8HFEj1D9NsC0yxevLZqWncMbuhelV1a1h7ciX7ftauTHIBzO0gKGjqoqZG0NqnrnN7xavIHvzDQ==
dependencies:
babel-code-frame "^6.22.0"
"@babel/code-frame" "^7.8.3"
chalk "^2.4.1"
micromatch "^3.1.10"
cosmiconfig "^6.0.0"
deepmerge "^4.2.2"
fs-extra "^9.0.0"
memfs "^3.1.2"
minimatch "^3.0.4"
schema-utils "1.0.0"
semver "^5.6.0"
tapable "^1.0.0"
worker-rpc "^0.1.0"
form-data@~2.3.2:
version "2.3.3"
......@@ -13363,6 +13351,16 @@ fs-extra@^3.0.1:
jsonfile "^3.0.0"
universalify "^0.1.0"
fs-extra@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^1.0.0"
fs-extra@~7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
......@@ -13386,6 +13384,11 @@ fs-minipass@^2.0.0:
dependencies:
minipass "^3.0.0"
fs-monkey@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.1.tgz#4a82f36944365e619f4454d9fff106553067b781"
integrity sha512-fcSa+wyTqZa46iWweI7/ZiUfegOZl0SG8+dltIwFXo7+zYU9J9kpS3NB6pZcSlJdhvIwp81Adx2XhZorncxiaA==
fs-write-stream-atomic@^1.0.8:
version "1.0.10"
resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
......@@ -16951,6 +16954,15 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"
jsonfile@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.0.1.tgz#98966cba214378c8c84b82e085907b40bf614179"
integrity sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==
dependencies:
universalify "^1.0.0"
optionalDependencies:
graceful-fs "^4.1.6"
jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
......@@ -17323,14 +17335,6 @@ load-json-file@^5.3.0:
strip-bom "^3.0.0"
type-fest "^0.3.0"
loader-fs-cache@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.2.tgz#54cedf6b727e1779fd8f01205f05f6e88706f086"
integrity sha512-70IzT/0/L+M20jUlEqZhZyArTU6VKLRTYRDAYN26g4jfzpJqjipLL3/hgYpySqI9PwsVRHHFja0LfEmsx9X2Cw==
dependencies:
find-cache-dir "^0.1.1"
mkdirp "0.5.1"
loader-runner@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357"
......@@ -17926,6 +17930,13 @@ mem@^4.0.0:
mimic-fn "^2.0.0"
p-is-promise "^2.0.0"
memfs@^3.1.2:
version "3.2.0"
resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.2.0.tgz#f9438e622b5acd1daa8a4ae160c496fdd1325b26"
integrity sha512-f/xxz2TpdKv6uDn6GtHee8ivFyxwxmPuXatBb1FBwxYNuVpbM3k/Y1Z+vC0mH/dIXXrukYfe3qe5J32Dfjg93A==
dependencies:
fs-monkey "1.0.1"
memoize-one@5.1.1, "memoize-one@>=3.1.1 <6", memoize-one@^5.0.0, memoize-one@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.1.1.tgz#047b6e3199b508eaec03504de71229b8eb1d75c0"
......@@ -19064,11 +19075,6 @@ object-hash@^1.1.8:
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df"
integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==
object-hash@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.0.1.tgz#cef18a0c940cc60aa27965ecf49b782cbf101d96"
integrity sha512-HgcGMooY4JC2PBt9sdUdJ6PMzpin+YtY3r/7wg0uTifP+HJWW8rammseSEHuyt0UeShI183UGssCJqm1bJR7QA==
object-inspect@^1.6.0, object-inspect@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
......@@ -19935,13 +19941,6 @@ pixelmatch@^5.1.0:
dependencies:
pngjs "^3.4.0"
pkg-dir@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q=
dependencies:
find-up "^1.0.0"
pkg-dir@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
......@@ -23598,7 +23597,7 @@ scheduler@^0.19.1:
loose-envify "^1.1.0"
object-assign "^4.1.1"
schema-utils@^1.0.0:
schema-utils@1.0.0, schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==
......@@ -26181,6 +26180,11 @@ universalify@^0.1.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
universalify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment