Skip to content

Commit

Permalink
Merge pull request #1822 from headlamp-k8s/lint-cache
Browse files Browse the repository at this point in the history
frontend: plugins: Add cache option to lint
  • Loading branch information
illume authored Mar 18, 2024
2 parents eb96e66 + 2bd079d commit 2296b0c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"build": "if-env PUBLIC_URL react-scripts build || cross-env PUBLIC_URL=./ react-scripts build --max_old_space_size=768 && npx shx rm -f build/frontend/index.baseUrl.html",
"test": "cross-env UNDER_TEST=true react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint -c package.json --ext .js,.ts,.tsx src/ ../app/electron ../plugins/headlamp-plugin --ignore-pattern ../plugins/headlamp-plugin/template --ignore-pattern ../plugins/headlamp-plugin/lib/",
"lint": "eslint --cache -c package.json --ext .js,.ts,.tsx src/ ../app/electron ../plugins/headlamp-plugin --ignore-pattern ../plugins/headlamp-plugin/template --ignore-pattern ../plugins/headlamp-plugin/lib/",
"format": "prettier --config package.json --write src ../app/electron ../app/scripts ../plugins/headlamp-plugin/bin ../plugins/headlamp-plugin/config ../plugins/headlamp-plugin/template ../plugins/headlamp-plugin/test*.js ../plugins/headlamp-plugin/*.json ../plugins/headlamp-plugin/*.js",
"format-check": "prettier --config package.json --check src ../app/electron ../app/scripts ../plugins/headlamp-plugin/bin ../plugins/headlamp-plugin/config ../plugins/headlamp-plugin/template ../plugins/headlamp-plugin/test*.js ../plugins/headlamp-plugin/*.json ../plugins/headlamp-plugin/*.js",
"storybook": "storybook dev -p 6006 -s public",
Expand Down
2 changes: 1 addition & 1 deletion plugins/headlamp-plugin/bin/headlamp-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ function upgrade(packageFolder, skipPackageUpdates, headlampPluginVersion) {
* @returns {0 | 1} - Exit code, where 0 is success, 1 is failure.
*/
function lint(packageFolder, fix) {
const script = `eslint -c package.json --max-warnings 0 --ext .js,.ts,.tsx src/${
const script = `eslint --cache -c package.json --max-warnings 0 --ext .js,.ts,.tsx src/${
fix ? ' --fix' : ''
}`;
return runScriptOnPackages(packageFolder, 'lint', script, {});
Expand Down
2 changes: 2 additions & 0 deletions plugins/headlamp-plugin/template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ yarn-error.log*

# The output for npm run storybook-book, static html built storybook for the plugin
storybook-static

.eslintcache

0 comments on commit 2296b0c

Please sign in to comment.