From edbb1ccc2771558efec4daa5045628aa74435935 Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Fri, 6 Aug 2021 17:57:59 -0400 Subject: [PATCH] build(dev,proxy,prod): ent-3643 eslint webpack plugin --- config/build.plugins.js | 4 ++++ package.json | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/build.plugins.js b/config/build.plugins.js index b2defe94b..96f1f0260 100644 --- a/config/build.plugins.js +++ b/config/build.plugins.js @@ -1,6 +1,7 @@ const { join, resolve } = require('path'); const webpack = require('webpack'); const CopyPlugin = require('copy-webpack-plugin'); +const ESLintPlugin = require('eslint-webpack-plugin'); const fedModulePlugin = require('@redhat-cloud-services/frontend-components-config/federated-modules'); const { setupWebpackDotenvFilesForEnv } = require('./build.dotenv'); @@ -25,6 +26,9 @@ const setCommonPlugins = () => { const plugins = [ ...setupWebpackDotenvFilesForEnv({ directory: RELATIVE_DIRNAME, env: DOTENV_ENV }), + new ESLintPlugin({ + lintDirtyModulesOnly: NODE_ENV !== 'production' + }), new CopyPlugin({ patterns: [{ from: join(STATIC_DIR, 'locales'), to: join(DIST_DIR, 'locales'), noErrorOnMissing: true }] }), diff --git a/package.json b/package.json index 1ae5a9657..c8b752ed0 100644 --- a/package.json +++ b/package.json @@ -60,8 +60,8 @@ "dev:chrome": "bash ./scripts/dev.chrome.sh -b prod-stable", "release": "standard-version", "start": "run-p -l api:dev start:js", - "start:js": "export NODE_ENV=development; webpack serve --config config/webpack.dev.config.js", - "start:js-proxy": "export NODE_ENV=development; webpack serve --config config/webpack.proxy.config.js", + "start:js": "export NODE_ENV=development; webpack serve --color --config config/webpack.dev.config.js", + "start:js-proxy": "export NODE_ENV=development; webpack serve --color --config config/webpack.proxy.config.js", "start:proxy": "run-s -l api:proxy-hosts start:js-proxy", "test": "run-s test:spell* test:lint test:ci", "test:ci": "export CI=true; jest ./src --coverage", @@ -82,7 +82,7 @@ "@patternfly/react-styles": "4.11.0", "@patternfly/react-table": "4.29.0", "@patternfly/react-tokens": "4.12.0", - "@redhat-cloud-services/frontend-components": "3.3.4", + "@redhat-cloud-services/frontend-components": "3.3.9", "@redhat-cloud-services/frontend-components-notifications": "3.2.2", "@redhat-cloud-services/frontend-components-utilities": "3.2.3", "axios": "^0.21.1", @@ -139,6 +139,7 @@ "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-react": "^7.24.0", "eslint-plugin-react-hooks": "^4.2.0", + "eslint-webpack-plugin": "^3.0.1", "express": "^4.17.1", "glob": "^7.1.7", "jest": "26.6.0",