Commit b276cb6
Fix RuboCop violations in demo apps (#66)
* Fix linting configuration for demo apps
## Changes
**1. Fixed Broken Symlinks**
- now points to (was pointing to wrong directory)
- now points to (was broken)
**2. Created Shared Config Files**
- - Rails Omakase style
- - React/TypeScript linting
**3. Added ESLint Dependencies**
Installed ESLint 8 and plugins in both demos (required for npm run lint):
- eslint, eslint-plugin-react, eslint-plugin-react-hooks
- eslint-plugin-jsx-a11y, eslint-plugin-import
- @typescript-eslint/eslint-plugin, @typescript-eslint/parser
- eslint-config-prettier
**4. Fixed ESLint Violations**
- Prefixed unused variables with underscore (_devServer, _inliningCss, _merge)
- Added blank lines between import groups
- Reordered imports (builtin before external)
- Changed console.log to console.warn
## Verification
Both demos now pass all linting:
- ✅ bundle exec rubocop (0 offenses)
- ✅ npm run lint (0 violations)
- ✅ npm run format:check (all files formatted)
## Note on bin/ Files
bin/ files are intentionally excluded from Rails Omakase StringLiterals
enforcement and were not modified. Only app/, config/, lib/, test/, and
Gemfile are enforced to use double quotes per Rails conventions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Simplify RuboCop config - inherit directly from rubocop-rails-omakase
Instead of duplicating Rails Omakase config, each demo now inherits
directly from the rubocop-rails-omakase gem using inherit_gem.
Changes:
- Removed shared rubocop.yml from shakacode_demo_common
- Changed .rubocop.yml from symlink to actual file in each demo
- Each demo now uses: inherit_gem: { rubocop-rails-omakase: rubocop.yml }
- Fixed array bracket spacing per Rails Omakase conventions
- Added rubocop disables for bin/switch-bundler complexity
Benefits:
- No config duplication
- Always uses latest Rails Omakase rules from the gem
- Cleaner, more maintainable setup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Fix Playwright test formatting
Fix formatting artifact where closing brace was on the same line.
Before:
await page.goto('/'); });
After:
await page.goto('/');
});
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Add ESLint and Prettier to pre-commit hooks
Updated lefthook.yml to run ESLint and Prettier on staged files
in demo apps during pre-commit. This prevents linting violations
from being committed.
Pre-commit hooks now run:
- trailing-newline: Ensures all files end with newline
- rubocop: Checks Ruby files
- eslint: Checks and fixes JavaScript/TypeScript files in demos
- prettier: Formats JavaScript/TypeScript/JSON/CSS/Markdown in demos
Each tool runs only on staged files for fast commits.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 0e76ec6 commit b276cb6
File tree
23 files changed
+8429
-560
lines changed- demos
- basic-v16-rspack
- app/javascript/src/HelloWorld/ror_components
- bin
- config
- environments
- webpack
- basic-v16-webpack
- app/javascript/src/HelloWorld/ror_components
- config
- environments
- webpack
- e2e/playwright
- e2e/rails_examples
- support
- packages/shakacode_demo_common/configs
23 files changed
+8429
-560
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
161 | | - | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| |||
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
209 | | - | |
| 211 | + | |
210 | 212 | | |
| 213 | + | |
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments