Skip to content

Commit ae100a2

Browse files
justin808claude
andcommitted
Fix ESLint errors in React component templates for React 19
- Disable react/prop-types rule for template files (React 19 doesn't need PropTypes) - Add React import to template components that use JSX - Remove unused useState import from Redux template - Fix minor RuboCop spacing issue in test 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d7e946d commit ae100a2

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

eslint.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ const config = tsEslint.config([
152152
'import/no-unresolved': 'off',
153153
// We have `const [name, setName] = useState(props.name)` so can't just destructure props
154154
'react/destructuring-assignment': 'off',
155+
// React 19 doesn't need PropTypes - we're targeting modern React
156+
'react/prop-types': 'off',
155157
},
156158
},
157159
{

lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import React, { useState } from 'react';
22
import * as style from './HelloWorld.module.css';
33

44
const HelloWorld = (props) => {

lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import React from 'react';
22
import * as style from './HelloWorld.module.css';
33

44
const HelloWorld = ({ name, updateName }) => (

spec/react_on_rails/dev/file_manager_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
allow_any_instance_of(Object).to receive(:puts)
4242

4343
result = described_class.cleanup_stale_files
44-
expect(result).to be_truthy # Accept any truthy value
44+
expect(result).to be_truthy # Accept any truthy value
4545
end
4646

4747
it "does not remove socket files when they don't exist" do

0 commit comments

Comments
 (0)