Skip to content

Commit a4b69e0

Browse files
justin808claude
andcommitted
Fix ESLint errors and update pre-commit hook
- Replace deprecated var with let in global declarations (context.ts) - Add eslint-disable comment for deprecated tsEslint.config usage - Update pre-commit hook to run ESLint with --report-unused-disable-directives flag This ensures the pre-commit hook catches the same ESLint issues that CI detects, preventing CI failures from unused eslint-disable directives and var usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d160859 commit a4b69e0

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

SWITCHING_CI_CONFIGS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ This will:
106106

107107
```bash
108108
# Reload your shell to pick up new Ruby/Node versions
109-
cd /Users/justin/conductor/react_on_rails/.conductor/kuwait-v1
109+
cd <project-root>
110110
mise current # or: asdf current
111111

112112
# Build and test
@@ -136,7 +136,7 @@ This will:
136136

137137
```bash
138138
# Reload your shell to pick up new Ruby/Node versions
139-
cd /Users/justin/conductor/react_on_rails/.conductor/kuwait-v1
139+
cd <project-root>
140140
mise current # or: asdf current
141141

142142
# Build and test
@@ -174,7 +174,7 @@ bin/ci-switch-config status
174174
bin/ci-switch-config minimum
175175

176176
# 3. Reload shell
177-
cd /Users/justin/conductor/react_on_rails/.conductor/kuwait-v1
177+
cd <project-root>
178178

179179
# 4. Verify versions changed
180180
ruby --version # Should show 3.2.x
@@ -220,7 +220,7 @@ bin/ci-switch-config latest
220220
After switching, you need to reload your shell:
221221

222222
```bash
223-
cd /Users/justin/conductor/react_on_rails/.conductor/kuwait-v1
223+
cd <project-root>
224224
# The cd command will trigger mise/asdf to load the new versions
225225
ruby --version # Verify it changed
226226
```

bin/lefthook/eslint-lint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -n "$root_and_packages_pro_files" ]; then
3131
fi
3232
printf " %s\n" $root_and_packages_pro_files
3333

34-
if ! yarn run eslint $root_and_packages_pro_files --fix; then
34+
if ! yarn run eslint $root_and_packages_pro_files --fix --report-unused-disable-directives; then
3535
exit_code=1
3636
fi
3737

@@ -53,7 +53,7 @@ if [ -n "$react_on_rails_pro_files" ]; then
5353
# Strip react_on_rails_pro/ prefix for running in Pro directory
5454
react_on_rails_pro_files_relative=$(echo "$react_on_rails_pro_files" | sed 's|^react_on_rails_pro/||')
5555

56-
if ! (cd react_on_rails_pro && yarn run eslint $react_on_rails_pro_files_relative --fix); then
56+
if ! (cd react_on_rails_pro && yarn run eslint $react_on_rails_pro_files_relative --fix --report-unused-disable-directives); then
5757
exit_code=1
5858
fi
5959

eslint.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const compat = new FlatCompat({
1717
});
1818

1919
// eslint-disable-next-line @typescript-eslint/no-deprecated
20-
const config = tsEslint.config([
20+
export default tsEslint.config([
2121
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
2222
includeIgnoreFile(path.resolve(__dirname, '.gitignore')),
2323
globalIgnores([
@@ -267,5 +267,3 @@ const config = tsEslint.config([
267267
// https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs
268268
prettierRecommended,
269269
]);
270-
271-
export default config;

packages/react-on-rails/src/context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { ReactOnRailsInternal, RailsContext } from './types/index.ts';
22

33
declare global {
4-
/* eslint-disable vars-on-top,no-underscore-dangle */
5-
var ReactOnRails: ReactOnRailsInternal | undefined;
6-
var __REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__: boolean;
7-
/* eslint-enable vars-on-top,no-underscore-dangle */
4+
/* eslint-disable no-underscore-dangle */
5+
let ReactOnRails: ReactOnRailsInternal | undefined;
6+
let __REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__: boolean;
7+
/* eslint-enable no-underscore-dangle */
88
}
99

1010
let currentRailsContext: RailsContext | null = null;

0 commit comments

Comments
 (0)