Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mention @stylistic/eslint-plugin-jsx and typescript in eslint-plugin-react alternatives #190

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion docs/modules/eslint-plugin-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,53 @@

## `@eslint-react/eslint-plugin`

Feature rich alternative with many of the same rules.
Not a drop-in replacement but a feature rich alternative with many of the same rules.

[Project Page](https://github.com/Rel1cx/eslint-react)
[npm](https://www.npmjs.com/package/@eslint-react/eslint-plugin)

## `@stylistic/eslint-plugin-jsx`

The following stylistic rules in `eslint-plugin-react` can be replaced by the same rules in `@stylistic/eslint-plugin-jsx`:

- `react/jsx-child-element-spacing`
- `react/jsx-closing-bracket-location`
- `react/jsx-closing-tag-location`
- `react/jsx-curly-brace-presence`
- `react/jsx-curly-newline`
- `react/jsx-curly-spacing`
- `react/jsx-equals-spacing`
- `react/jsx-first-prop-new-line`
- `react/jsx-indent-props`
- `react/jsx-indent`
- `react/jsx-max-props-per-line`
- `react/jsx-newline`
- `react/jsx-one-expression-per-line`
- `react/jsx-pascal-case`
- `react/jsx-props-no-multi-spaces`
- `react/jsx-sort-default-props`
- `react/jsx-sort-props`
- `react/jsx-space-before-closing`
- `react/jsx-tag-spacing`
- `react/jsx-wrap-multilines`

[Project Page](https://eslint.style/packages/jsx)
[npm](https://www.npmjs.com/package/@stylistic/eslint-plugin-jsx)

## TypeScript
Rel1cx marked this conversation as resolved.
Show resolved Hide resolved

The following correctness rules in `eslint-plugin-react` can be enforced by TypeScript with appropriate `tsconfig.json` settings:

- `react/jsx-no-duplicate-props`
- `react/jsx-no-undef`
- `react/jsx-uses-react`
- `react/jsx-uses-vars`
- `react/no-invalid-html-attribute`
- `react/no-unescaped-entities` -> No need when using `@typescript-eslint/parser`
- `react/no-unknown-property`
- `react/style-prop-object`
- `react/react-in-jsx-scope`
- `react/require-render-return`

[Project Page](https://www.typescriptlang.org)
[npm](https://www.npmjs.com/package/typescript)