When we switched from LESS to SCSS in the OPAC (Bug 20427) I added a linting configuration, .scss-lint.yml. This could be put to use by configuring a compatible editor to run the linting process during editing. In VS Code I was using scss-lint for this, but it's now deprecated. They suggest stylelint instead: https://stylelint.io. I propose replacing .scss-lint.yml with .stylelintrc.json, transferring most of the same rules.
Created attachment 140288 [details] [review] Bug 31528: Replace scss-lint configuration with one for stylelint This patch removes the SCSS linting configuration .scss-lint.yml which was intended to be used with a now-obsolete tool, scss-lint. It is replaced with .stylelintrc.json, for use with stylelint. I've tried to keep the linting rules the same as before. To test, run 'yarn install' to install the new dependencies. You can test stylelint from the command line like so: npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss It should output a list of problems with the file: koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss 30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case 81:31 ✖ Expected single space after "(" function-parentheses-space-inside ...etc.
Created attachment 140316 [details] [review] Bug 31528: Replace scss-lint configuration with one for stylelint This patch removes the SCSS linting configuration .scss-lint.yml which was intended to be used with a now-obsolete tool, scss-lint. It is replaced with .stylelintrc.json, for use with stylelint. I've tried to keep the linting rules the same as before. To test, run 'yarn install' to install the new dependencies. You can test stylelint from the command line like so: npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss It should output a list of problems with the file: koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss 30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case 81:31 ✖ Expected single space after "(" function-parentheses-space-inside ...etc.
Created attachment 140336 [details] [review] Bug 31528: (follow-up) A few additional rules Adding a few more rules which came up during the correction process in the follow-up bug.
Created attachment 140339 [details] [review] Bug 31528: (follow-up) A few additional rules Adding a few more rules which came up during the correction process in the follow-up bug.
Created attachment 140500 [details] [review] Bug 31528: Replace scss-lint configuration with one for stylelint This patch removes the SCSS linting configuration .scss-lint.yml which was intended to be used with a now-obsolete tool, scss-lint. It is replaced with .stylelintrc.json, for use with stylelint. I've tried to keep the linting rules the same as before. To test, run 'yarn install' to install the new dependencies. You can test stylelint from the command line like so: npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss It should output a list of problems with the file: koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss 30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case 81:31 ✖ Expected single space after "(" function-parentheses-space-inside ...etc. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 140501 [details] [review] Bug 31528: (follow-up) A few additional rules Adding a few more rules which came up during the correction process in the follow-up bug. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 141182 [details] [review] Bug 31528: Replace scss-lint configuration with one for stylelint This patch removes the SCSS linting configuration .scss-lint.yml which was intended to be used with a now-obsolete tool, scss-lint. It is replaced with .stylelintrc.json, for use with stylelint. I've tried to keep the linting rules the same as before. To test, run 'yarn install' to install the new dependencies. You can test stylelint from the command line like so: npx stylelint koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss It should output a list of problems with the file: koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss 30:27 ✖ Expected "#e6f0f2" to be "#E6F0F2" color-hex-case 81:31 ✖ Expected single space after "(" function-parentheses-space-inside ...etc. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 141183 [details] [review] Bug 31528: (follow-up) A few additional rules Adding a few more rules which came up during the correction process in the follow-up bug. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 22.11. Nice work everyone, thanks!
Created attachment 141260 [details] [review] Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>