From 00f0ff038ee2463e4dbd16efaffffd0f7616672d Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Tue, 1 Aug 2023 11:58:39 +0200 Subject: [PATCH] Chore: Introduce yarn start:noLint (#64430) chore(webpack): introduce start:noLint to bypass typecheck and lint plugins during dev --- package.json | 1 + scripts/webpack/webpack.dev.js | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 520388fb4ef..4f7c0a3a03b 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "prettier:write": "prettier --list-different \"**/*.{js,ts,tsx,scss,md,mdx}\" --write", "start": "yarn themes:generate && yarn dev --watch", "start:noTsCheck": "yarn start --env noTsCheck=1", + "start:noLint": "yarn start --env noTsCheck=1 --env noLint=1", "stats": "webpack --mode production --config scripts/webpack/webpack.prod.js --profile --json > compilation-stats.json", "storybook": "yarn workspace @grafana/ui storybook --ci", "storybook:build": "yarn workspace @grafana/ui storybook:build", diff --git a/scripts/webpack/webpack.dev.js b/scripts/webpack/webpack.dev.js index 40c7a5c7b87..4a821432a0b 100644 --- a/scripts/webpack/webpack.dev.js +++ b/scripts/webpack/webpack.dev.js @@ -91,11 +91,13 @@ module.exports = (env = {}) => { }, }, }), - new ESLintPlugin({ - cache: true, - lintDirtyModulesOnly: true, // don't lint on start, only lint changed files - extensions: ['.ts', '.tsx'], - }), + parseInt(env.noLint, 10) + ? new DefinePlugin({}) // bogus plugin to satisfy webpack API + : new ESLintPlugin({ + cache: true, + lintDirtyModulesOnly: true, // don't lint on start, only lint changed files + extensions: ['.ts', '.tsx'], + }), new MiniCssExtractPlugin({ filename: 'grafana.[name].[contenthash].css', }),