Skip to content

Commit d5f910e

Browse files
github-actions[bot]justin808claude
committed
Replace scss-lint with stylelint and include in CI
- Remove scss_lint gem dependency and configuration files - Add stylelint and stylelint-config-standard-scss npm packages - Create .stylelintrc.json configuration matching previous scss-lint rules - Update rake tasks to use stylelint instead of scss-lint - Add stylelint to CI workflow (lint-js-and-ruby.yml) - Include SCSS linting in main rake lint task and autofix task - Add yarn script 'lint:scss' for running stylelint Fixes #1688 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Justin Gordon <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 120bd43 commit d5f910e

File tree

8 files changed

+39
-240
lines changed

8 files changed

+39
-240
lines changed

.github/workflows/lint-js-and-ruby.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
run: yarn run eslint --report-unused-disable-directives
7979
- name: Check formatting
8080
run: yarn start format.listDifferent
81+
- name: Lint SCSS with stylelint
82+
run: yarn run lint:scss
8183
- name: Type-check TypeScript
8284
run: yarn run type-check
8385
- name: Pack for attw and publint

.scss-lint.yml

Lines changed: 0 additions & 205 deletions
This file was deleted.

.stylelintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": "stylelint-config-standard-scss",
3+
"rules": {
4+
"color-keyword": null,
5+
"color-hex-length": "long",
6+
"color-hex-case": "upper",
7+
"selector-id-pattern": null,
8+
"number-leading-zero": "always",
9+
"scss/at-rule-no-unknown": [true, {
10+
"ignoreAtRules": ["include", "mixin", "each", "if", "else", "for", "while", "function", "return", "use", "forward"]
11+
}],
12+
"selector-class-pattern": null,
13+
"custom-property-pattern": null,
14+
"keyframes-name-pattern": null,
15+
"scss/percent-placeholder-pattern": null,
16+
"scss/dollar-variable-pattern": null,
17+
"scss/at-function-pattern": null,
18+
"scss/at-mixin-pattern": null,
19+
"import-notation": null
20+
},
21+
"ignoreFiles": [
22+
"spec/dummy/app/assets/stylesheets/application.css",
23+
"**/*.js",
24+
"**/*.jsx",
25+
"**/*.ts",
26+
"**/*.tsx"
27+
]
28+
}

Gemfile.development_dependencies

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ group :development, :test do
3636
gem "rubocop", "1.61.0", require: false
3737
gem "rubocop-performance", "~>1.20.0", require: false
3838
gem "rubocop-rspec", "~>2.26", require: false
39-
gem "scss_lint", require: false
4039
gem "spring", "~> 4.0"
4140
gem "lefthook", require: false
4241
# Added for Ruby 3.5+ compatibility to silence warnings

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
"react-dom": "^19.0.0",
7272
"react-on-rails-rsc": "19.0.2",
7373
"redux": "^4.2.1",
74+
"stylelint": "^16.14.0",
75+
"stylelint-config-standard-scss": "^13.1.0",
7476
"ts-jest": "^29.2.5",
7577
"typescript": "^5.8.3",
7678
"typescript-eslint": "^8.35.0"
@@ -98,6 +100,7 @@
98100
"build": "yarn run clean && yarn run tsc --declaration",
99101
"build-watch": "yarn run clean && yarn run tsc --watch",
100102
"lint": "nps eslint",
103+
"lint:scss": "stylelint \"spec/dummy/app/assets/stylesheets/**/*.scss\" \"spec/dummy/client/**/*.scss\"",
101104
"check": "yarn run lint && yarn run test && yarn run type-check",
102105
"type-check": "yarn run tsc --noEmit --noErrorTruncation",
103106
"release:patch": "node_package/scripts/release patch",

rakelib/docker.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace :docker do
66
sh "docker-compose run lint rake lint:rubocop"
77
end
88

9-
desc "Run scss-lint linter from docker"
9+
desc "Run stylelint linter from docker"
1010
task :scss do
1111
sh "docker-compose run lint rake lint:scss"
1212
end

rakelib/lint.rake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@ namespace :lint do
1010
sh_in_dir(gem_root, "bundle exec rubocop --version", "bundle exec rubocop .")
1111
end
1212

13-
desc "Run scss-lint as shell"
13+
desc "Run stylelint as shell"
1414
task :scss do
15-
sh_in_dir(gem_root, "bundle exec scss-lint spec/dummy/app/assets/stylesheets/")
15+
sh_in_dir(gem_root, "yarn run stylelint \"spec/dummy/app/assets/stylesheets/**/*.scss\" \"spec/dummy/client/**/*.scss\"")
1616
end
1717

1818
desc "Run eslint as shell"
1919
task :eslint do
2020
sh_in_dir(gem_root, "yarn run eslint --version", "yarn run eslint .")
2121
end
2222

23-
desc "Run all eslint & rubocop linters. Skip scss"
24-
task lint: %i[eslint rubocop] do
23+
desc "Run all eslint, rubocop & stylelint linters"
24+
task lint: %i[eslint rubocop scss] do
2525
puts "Completed all linting"
2626
end
2727

2828
desc "Auto-fix all linting violations"
2929
task :autofix do
3030
sh_in_dir(gem_root, "yarn run eslint . --fix")
3131
sh_in_dir(gem_root, "yarn run prettier --write .")
32+
sh_in_dir(gem_root, "yarn run stylelint \"spec/dummy/app/assets/stylesheets/**/*.scss\" \"spec/dummy/client/**/*.scss\" --fix")
3233
sh_in_dir(gem_root, "bundle exec rubocop -A")
3334
puts "Completed auto-fixing all linting violations"
3435
end

spec/dummy/bin/scss-lint

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)