New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ESLint and Stylelint caches to GitHub actions workflow #2860
Conversation
c523315
to
2fdf1b5
Compare
package.json
Outdated
@@ -23,7 +23,7 @@ | |||
"test:build:dist": "npx jest --selectProjects \"Gulp tasks\" --testMatch \"**/*build-dist*\"", | |||
"lint": "npm run lint:js && npm run lint:scss", | |||
"lint:js": "eslint --cache --cache-location .cache/eslint --cache-strategy content --color --ignore-path .gitignore \"**/*.{cjs,js,mjs}\"", | |||
"lint:scss": "stylelint \"app/**/*.scss\" \"src/**/*.scss\"" | |||
"lint:scss": "stylelint --cache --cache-location .cache/stylelint --color --ignore-path .gitignore \"app/**/*.scss\" \"src/**/*.scss\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we changed the stylelint config, will we need to clear the cache to force it to re-lint all files against the new config? I can't see anything in the stylelint docs to suggest this is handled for us.
(Same applies for eslint)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint automatically marks the cache as stale when the config changes
Let me check what StyleLint does (good shout)
Update: StyleLint doesn't yet but it's been picked up in stylelint/stylelint#2908 (comment)
2fdf1b5
to
efb9697
Compare
Converting back to draft whilst we wait for stylelint/stylelint#6356 🎉 |
We've just released |
efb9697
to
ab6037c
Compare
Thanks @jeddy3 (and @kimulaco @kaorun343 @ybiquitous) Massively appreciate the new addition (and contribution) 🙌 |
ab6037c
to
d7a433b
Compare
@36degrees This one's ready to review again 😊 Not a huge speed bump for the GitHub workflow, but noticeable when running |
34dad96
to
f1182b3
Compare
d7a433b
to
32036bb
Compare
f1182b3
to
de727f2
Compare
32036bb
to
73d9223
Compare
de727f2
to
83736b7
Compare
73d9223
to
63dce70
Compare
During workflow runs we only need to lint "changed" files
Both ESLint and Stylelint support this 👍
This removes a 2-3 second delay during both
gulp dev
file changes (Sass and JS files) and git hook "lint" runsBefore
GitHub Actions workflow
npm run lint:js 4.87s user 0.44s system 141% cpu 3.752 total
npm run lint:scss 4.91s user 0.65s system 144% cpu 3.845 total
After
GitHub Actions workflow (~49s faster with Jest, ESLint and Stylelint caching)
npm run lint:js 1.16s user 0.36s system 105% cpu 1.438 total
npm run lint:scss 2.41s user 0.56s system 137% cpu 2.173 total