Skip to content

Commit 97c495d

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 <justin808@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 40b79b8 commit 97c495d

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
@@ -113,6 +113,8 @@ jobs:
113113
run: yarn run eslint --report-unused-disable-directives
114114
- name: Check formatting
115115
run: yarn start format.listDifferent
116+
- name: Lint SCSS with stylelint
117+
run: yarn run lint:scss
116118
- name: Type-check TypeScript
117119
run: yarn run type-check
118120
- 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
@@ -37,7 +37,6 @@ group :development, :test do
3737
gem "rubocop", "1.61.0", require: false
3838
gem "rubocop-performance", "~>1.20.0", require: false
3939
gem "rubocop-rspec", "~>2.26", require: false
40-
gem "scss_lint", require: false
4140
gem "spring", "~> 4.0"
4241
gem "lefthook", require: false
4342
# 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
@@ -55,6 +55,8 @@
5555
"react-dom": "^19.0.0",
5656
"react-on-rails-rsc": "19.0.2",
5757
"redux": "^4.2.1",
58+
"stylelint": "^16.14.0",
59+
"stylelint-config-standard-scss": "^13.1.0",
5860
"swc-loader": "^0.2.6",
5961
"ts-jest": "^29.2.5",
6062
"typescript": "^5.8.3",
@@ -67,6 +69,7 @@
6769
"build": "yarn workspace react-on-rails run build && yarn workspace react-on-rails-pro run build",
6870
"build-watch": "yarn workspaces run build-watch",
6971
"lint": "nps eslint",
72+
"lint:scss": "stylelint \"spec/dummy/app/assets/stylesheets/**/*.scss\" \"spec/dummy/client/**/*.scss\"",
7073
"check": "yarn run lint && yarn workspaces run check",
7174
"type-check": "yarn workspaces run type-check",
7275
"yalc:publish": "yarn workspaces run yalc:publish",

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)