Bug 31528 - Replace scss-lint configuration with one for stylelint
Summary: Replace scss-lint configuration with one for stylelint
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 20427
Blocks: 31529
  Show dependency treegraph
 
Reported: 2022-09-07 12:19 UTC by Owen Leonard
Modified: 2023-12-28 20:43 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Circulation function:


Attachments
Bug 31528: Replace scss-lint configuration with one for stylelint (82.93 KB, patch)
2022-09-07 14:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31528: Replace scss-lint configuration with one for stylelint (82.97 KB, patch)
2022-09-07 15:44 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31528: (follow-up) A few additional rules (1.23 KB, patch)
2022-09-08 12:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31528: (follow-up) A few additional rules (1.40 KB, patch)
2022-09-08 12:58 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 31528: Replace scss-lint configuration with one for stylelint (83.02 KB, patch)
2022-09-12 18:22 UTC, David Nind
Details | Diff | Splinter Review
Bug 31528: (follow-up) A few additional rules (1.45 KB, patch)
2022-09-12 18:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 31528: Replace scss-lint configuration with one for stylelint (83.07 KB, patch)
2022-10-01 19:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31528: (follow-up) A few additional rules (1.51 KB, patch)
2022-10-01 19:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t (634 bytes, patch)
2022-10-03 12:55 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2022-09-07 12:19:57 UTC
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.
Comment 1 Owen Leonard 2022-09-07 14:06:36 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2022-09-07 15:44:03 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2022-09-08 12:45:52 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2022-09-08 12:58:33 UTC Comment hidden (obsolete)
Comment 5 David Nind 2022-09-12 18:22:56 UTC Comment hidden (obsolete)
Comment 6 David Nind 2022-09-12 18:23:00 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2022-10-01 19:37:55 UTC
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>
Comment 8 Katrin Fischer 2022-10-01 19:37:59 UTC
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>
Comment 9 Tomás Cohen Arazi (tcohen) 2022-10-03 11:32:51 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Tomás Cohen Arazi (tcohen) 2022-10-03 12:55:21 UTC
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>