Update dependencies and cleanup#4425
Conversation
- Update packages - Don't use gulp-eslint - Don't use gulp-stylelint - Use login's stylelint config
No longer relevant per stylelint
fixes per stylelint - remove strunquote - use if not instead of if == null
Remove stray strunquote
| "stylelint-prettier/recommended" | ||
| "@18f/identity-stylelint-config" |
There was a problem hiding this comment.
I've updated to login.gov's stylelint config, as it simplifies conforming to TTS CSS/Sass coding standards
| const buffer = require("vinyl-buffer"); | ||
| const browserify = require("browserify"); | ||
| const childProcess = require("child_process"); | ||
| const eslint = require("gulp-eslint"); |
There was a problem hiding this comment.
Removed gulp-eslint as it wasn't working properly and we don't need gulp to run eslint
| ); | ||
|
|
||
| gulp.task("eslint", (done) => { | ||
| if (!cFlags.test) { | ||
| dutil.logMessage("eslint", "Skipping linting of JavaScript files."); | ||
| return done(); | ||
| } | ||
|
|
||
| return gulp | ||
| .src(["src/js/**/*.js", "spec/**/*.js"]) | ||
| .pipe( | ||
| eslint({ | ||
| fix: true, | ||
| }) | ||
| ) | ||
| .pipe(eslint.format()) | ||
| .pipe(eslint.failAfterError()); | ||
| }); |
There was a problem hiding this comment.
Removed eslint task, moved to an npm script
| const filter = require("gulp-filter"); | ||
| const gulp = require("gulp"); | ||
| const gulpStylelint = require("gulp-stylelint"); | ||
| const stylelint = require("stylelint"); |
There was a problem hiding this comment.
Removed gulp-stylelint per https://github.com/18F/identity-style-guide/pull/276/files#r765819043
There was a problem hiding this comment.
gulp-stylelintmay be abandoned, as it doesn't support the newest major release of Stylelint released early in the year, and the maintainer hasn't been active in related issues (olegskl/gulp-stylelint#132).
| gulp.task('stylelint', async function (callback) { | ||
| const { errored, output } = await stylelint.lint({ | ||
| files: [`${PROJECT_SASS_SRC}/**/*.scss`, `!${PROJECT_SASS_SRC}/uswds/**/*.scss`], | ||
| formatter: 'string', | ||
| }); | ||
|
|
||
| callback(errored ? new Error(output) : null); | ||
| }); |
There was a problem hiding this comment.
Refactored task per https://github.com/18F/identity-style-guide/pull/276/files#diff-25789e3ba4c2adf4a68996260eb693a441b4a834c38b76167a120f0b51b969f7R111-R118
Removes gulp-stylelint requirement
| @@ -1,13 +1,11 @@ | |||
| // Output the @font-face rule | |||
| @mixin at-font-face($display-name, $file-path, $font-weight, $font-style) { | |||
| $file-path: unquote($file-path); | |||
There was a problem hiding this comment.
No longer necessary per stylelint
| // Dunno why I can't do this without an error... | ||
|
|
||
| @font-face { | ||
| font-family: unquote($display-name); |
There was a problem hiding this comment.
No longer necessary per stylelint
| @mixin add-utility-declaration($declaration, $utility-type, $important) { | ||
| @each $ext-prop, $ext-value in map-get($declaration, $utility-type) { | ||
| #{strunquote($ext-prop)}: unquote("#{strunquote($ext-value)}#{$important}"); | ||
| #{$ext-prop}: unquote("#{$ext-value}#{$important}"); |
There was a problem hiding this comment.
No longer necessary per stylelint
| @import "list"; | ||
| @import "table"; |
There was a problem hiding this comment.
Removed filetype per stylelint
| } | ||
| } | ||
|
|
||
| /* stylelint-disable selector-class-pattern */ |
There was a problem hiding this comment.
Added some stylelint disables for come class names that don't pass its BEM test but that we will not change in this release
See comments for more details