Skip to content

Commit

Permalink
Remove gulp-stylelint for direct stylelint integration
Browse files Browse the repository at this point in the history
While looking at what would be needed for govuk-frontend to adopt a
stylelint 14 compatible release of styleint-config-gds [1] I discovered
that a blocker for that upgrade is the use of gulp-stylelint [2] which
only officially supports Stylelint up to version 13 and doesn't seem to
be actively iterated.

There didn't seem to be much that was lost by removing gulp-stylelint,
it actually made SCSS linting consistent with the approach taken for JS.
As the command to run stylelint is longer than standard I added
additional tasks to the NPM file that are consistent for both JS and
SCSS linting.

I've used quotes around the paths as it seems they were being expanded
by the OS rather than by stylelint and using quotes forces stylelint to
do so.

[1]: alphagov/stylelint-config-gds#22
[2]: olegskl/gulp-stylelint#132
  • Loading branch information
kevindew committed Jan 24, 2022
1 parent f9112b3 commit c43743e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 131 deletions.
5 changes: 1 addition & 4 deletions gulpfile.js
Expand Up @@ -14,7 +14,6 @@ require('./tasks/gulp/watch.js')
require('./tasks/gulp/copy-to-destination.js')
require('./tasks/gulp/asset-version.js')
require('./tasks/gulp/sassdoc.js')
require('./tasks/gulp/stylelint.js')

// Umbrella scripts tasks for preview ---
// Runs js lint and compilation
Expand All @@ -24,10 +23,9 @@ gulp.task('scripts', gulp.series(
))

// Umbrella styles tasks for preview ----
// Runs scss lint and compilation
// Runs scss compilation
// --------------------------------------
gulp.task('styles', gulp.series(
'scss:lint',
'scss:compile'
))

Expand All @@ -43,7 +41,6 @@ gulp.task('copy:assets', () => {
// Runs js, scss and accessibility tests
// --------------------------------------
gulp.task('test', gulp.series(
'scss:lint',
'scss:compile'
))

Expand Down
110 changes: 4 additions & 106 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -16,10 +16,13 @@
"pre-release": "node bin/check-nvmrc.js && ./bin/pre-release.sh",
"build:package": "node bin/check-nvmrc.js && gulp build:package --destination 'package' && npm run test:build:package",
"build:dist": "node bin/check-nvmrc.js && gulp build:dist --destination 'dist' && npm run test:build:dist",
"test": "npm run test:dependencies && standard && gulp test && gulp copy-assets && jest --testPathIgnorePatterns='after-*'",
"test": "npm run test:dependencies && npm run lint && gulp test && gulp copy-assets && jest --testPathIgnorePatterns='after-*'",
"test:dependencies": "npm ls --depth=0",
"test:build:package": "jest tasks/gulp/__tests__/after-build-package.test.js",
"test:build:dist": "jest tasks/gulp/__tests__/after-build-dist.test.js"
"test:build:dist": "jest tasks/gulp/__tests__/after-build-dist.test.js",
"lint": "npm run lint:js && npm run lint:scss",
"lint:js": "standard",
"lint:scss": "stylelint 'app/**/*.scss' 'src/**/*.scss'"
},
"devDependencies": {
"acorn": "^7.4.0",
Expand Down Expand Up @@ -47,7 +50,6 @@
"gulp-postcss": "^8.0.0",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.0.0",
"gulp-stylelint": "^13.0.0",
"gulp-task-listing": "^1.1.0",
"gulp-uglify": "^3.0.2",
"html5shiv": "^3.7.3",
Expand Down
18 changes: 0 additions & 18 deletions tasks/gulp/stylelint.js

This file was deleted.

0 comments on commit c43743e

Please sign in to comment.