Skip to content

Commit

Permalink
Reduce build time by removing linters from the core build step
Browse files Browse the repository at this point in the history
Run linters separately:

- in text editors - see kpi.code-workspace, #4230
- as a cli step - see package.json "scripts"
  • Loading branch information
p2edwards committed Mar 8, 2023
1 parent 141bfe2 commit 2fda342
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
"test": "webpack --config webpack/test.config.js && mocha-chrome test/tests.html",
"test-autobuild": "echo \"hint: open file://$(pwd)/test/tests.html, refresh manually\n\n\" && webpack --config webpack/test.autobuild.js",
"lint": "eslint \"jsapp/js/**/*\" --ext .es6,.js,.jsx,.ts,.tsx",
"lint-coffee": "coffeelint -f ./coffeelint.json jsapp/xlform/src test",
"lint-styles": "stylelint jsapp/**/*.{css,scss} --ip jsapp/compiled --ip jsapp/fonts",
"show-icons": "opn jsapp/fonts/k-icons.html",
"generate-icons": "node ./scripts/generate_icons.js",
"copy-fonts": "python ./scripts/copy_fonts.py && npm run generate-icons",
Expand Down
25 changes: 0 additions & 25 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const BundleTracker = require('webpack-bundle-tracker');
const ExtractTranslationKeysPlugin = require('webpack-extract-translation-keys-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
const fs = require('fs');
const lodash = require('lodash');
const path = require('path');
Expand Down Expand Up @@ -34,26 +33,6 @@ const babelLoader = {
const commonOptions = {
module: {
rules: [
{
enforce: 'pre',
test: /\.coffee$/,
exclude: /node_modules/,
loader: 'less-terrible-coffeelint-loader',
options: {
failOnErrors: true,
failOnWarns: false,
// custom reporter function that only returns errors (no warnings)
reporter: function (errors) {
errors.forEach((error) => {
if (error.level === 'error') {
this.emitError(
[error.lineNumber, error.message].join(' ') + '\n'
);
}
});
},
},
},
{
test: /\.(js|jsx|es6)$/,
exclude: /node_modules/,
Expand Down Expand Up @@ -128,10 +107,6 @@ const commonOptions = {
output: path.join(outputPath, 'extracted-strings.json'),
}),
new webpack.ProvidePlugin({$: 'jquery'}),
new ESLintPlugin({
quiet: true,
extensions: ['js', 'jsx', 'ts', 'tsx', 'es6'],
}),
],
};

Expand Down

0 comments on commit 2fda342

Please sign in to comment.