stable
Clone or download
Fixes: request #11530 Replace scss-lint with a nodejs linter How to test: - Try to make a new commit with a new .scss file with this content: .truc { color: #ffffff; margin: 20px 20px; display: flex; } - The pre-commit hook should stop you and give you a command to try to automatically fix those errors. (Not all errors in the config will be auto-fixable though) Rules notes: - Since a majority of our "scss_lint" rules matched them, I chose to extend "stylelint-config-sass-guidelines". For the rules that did not match, our own configuration will override them (for example indentation). - Check [1] for the equivalence between scss_lint rules and stylelint rules. - MergeableSelector is not exactly matched by stylelint. If needed I can spend more time looking for plugins that do this, but I don't think it's a deal-breaker. - UrlFormat has no equivalent. I'm not sure it was such a critical rule however, code review may be enough to spot bad cases. - PropertySortOrder is slightly different, but stylelint can fix that automatically (at last :') ) Performance notes: Stylelint is orders of magnitude faster. To give you an idea, on my machine: time scss-lint . real 11m10.339s time npm run stylelint -- "**/*.scss" user 0m10.612s [1] https://github.com/bjankord/stylelint-config-sass-guidelines/wiki/Lint-Rule-Comparison Might be done later: - Bulk-format all our SCSS files - Convert all //scss-lint:disable comments Change-Id: Ifa38dcf4f8ccbb6a8a40ee616b6f6ee4e9cb9404
Modified Files
Name | ||||
---|---|---|---|---|
D | .scss-lint.yml | +0 | −247 | Go to diff View file |
A | .stylelintignore | +7 | −0 | Go to diff View file |
A | .stylelintrc.js | +55 | −0 | Go to diff View file |
M | gulpfile.js | +19 | −4 | Go to diff View file |
M | package-lock.json | +3113 | −2073 | Go to diff View file |
M | package.json | +5 | −3 | Go to diff View file |
D | src/www/themes/common/tlp/.scss-lint.yml | +0 | −1 | Go to diff View file |
M | src/www/themes/common/tlp/gulpfile.js | +3 | −34 | Go to diff View file |
M | src/www/themes/common/tlp/package-lock.json | +0 | −621 | Go to diff View file |
M | src/www/themes/common/tlp/package.json | +0 | −1 | Go to diff View file |
R | tools/utils/githooks/pre-commit-03-scss-lint | Go to diff View file | ||
M | tools/utils/scripts/sass-builder.js | +19 | −20 | Go to diff View file |
M | tools/utils/scripts/tuleap-gulp-build.js | +19 | −5 | Go to diff View file |