Skip to content

Fix duplicate ESLint rule in generated React JavaScript apps - #48

Merged
skryukov merged 3 commits into
mainfrom
fix/react-js-eslint-duplicate-rule
Nov 25, 2026
Merged

skryukov merged 3 commits into
mainfrom
fix/react-js-eslint-duplicate-rule

Conversation

@skryukov

@skryukov skryukov commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Generating a React Foundation app with TypeScript off and ESLint + Prettier on writes react/prop-types twice in the same rules object. During setup, ESLint checks eslint.config.js and reports no-dupe-keys. The generated app's npm run lint fails on the same line.

Remove the duplicate entry. The remaining entry keeps react/prop-types disabled.

Verification

  • Generated a fresh app and answered y to the ESLint + Prettier prompt. Confirmed the app root contained eslint.config.js, .prettierrc, and .prettierignore and reproduced the duplicate-key error.
  • Generated another React JavaScript app from the corrected template. Both npm run lint and npm run format passed.
  • Ran bundle exec ruby -Ilib:test test/template/eslint_test.rb. All 9 tests passed.
  • Added React, Vue, and Svelte JavaScript Foundation cases to PR CI. Each requires the three config files and runs the generated lint and format scripts. All three cases passed locally (69 assertions). The React case also reproduced the duplicate-key failure against the original template.

The Svelte format script checks JavaScript and CSS. Formatting .svelte files requires a Prettier plugin that the generator currently omits.

@skryukov
skryukov merged commit 3149d4f into main Nov 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant