-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Rule Migration] migrate eslint-plugin-react rules #85
Comments
How to migrate |
All stylistic rules including jsx-self-closing-comp have been migrated to @stylistic/eslint-plugin-jsx, which can be used in addition to this plugin. |
Hi @rEl1cx, thanks for this! Amazing as always 🚀 However, I ran into an issue today that There is not yet full TypeScript support for MDX files, and it appears ESLint doesn't support multiple parsers for a set of files (eg. for trying to use I tried to use
What do you think about implementing this for other languages like MDX? (and also just for completeness, for other situations where TypeScript cannot be used) I can create a separate issue for this to track this request. |
This is a good point, I agree with creating a separate issue to track this, please proceed. |
Thanks for the response! New issue here: |
Opened another similar one for |
This says that |
Thank you for mentioning that the rule also supported linting based on a declared TypeScript type. This aspect was overlooked at the time, and I will reconsider whether to migrate this rule. |
Migration Status
Correctness and best practices rules
react/jsx-boolean-value
···················->
@eslint-react/jsx/prefer-shorthand-boolean
react/jsx-fragments
·······················->
@eslint-react/jsx/prefer-shorthand-fragment
react/jsx-key -----------|··················->
@eslint-react/jsx/no-missing-key
react/no-array-index-key |··················->
@eslint-react/jsx/no-array-index-key
·························|··················->
@eslint-react/jsx/no-duplicate-key
-------------------------|··················->
@eslint-react/jsx/no-spreading-key
react/jsx-props-no-spreading
··············->
@eslint-react/jsx/no-spreading-props
#102react/jsx-no-useless-fragment
·············->
@eslint-react/jsx/no-useless-fragment
react/jsx-no-leaked-render
················->
@eslint-react/jsx/no-leaked-conditional-rendering
react/jsx-max-depth
·······················->
@eslint-react/jsx/max-depth
#104react/jsx-no-comment-textnodes
············->
@eslint-react/jsx/no-comment-textnodes
react/jsx-filename-extension
··············->
@eslint-react/naming-convention/filename-extension
react/boolean-prop-naming
·················->
@eslint-react/naming-convention/boolean-prop
react/jsx-handler-names
···················->
@eslint-react/naming-convention/handler-prop
react/hook-use-state
······················->
@eslint-react/naming-convention/use-state
#205react/display-name
························->
@eslint-react/react/no-missing-display-name
#107react/jsx-no-script-url
···················->
@eslint-react/react/no-script-url
react/jsx-no-target-blank
·················->
@eslint-react/react/no-unsafe-target-blank
react/button-has-type
·····················->
@eslint-react/react/no-missing-button-type
react/iframe-missing-sandbox |
············->
@eslint-react/react/no-missing-iframe-sandbox
-----------------------------|··············->
@eslint-react/react/no-unsafe-iframe-sandbox
react/jsx-no-constructed-context-values
···->
@eslint-react/react/no-constructed-context-value
react/no-danger
···························->
@eslint-react/react/no-dangerously-set-innerhtml
react/no-danger-with-children
·············->
@eslint-react/react/no-dangerously-set-innerhtml-with-children
react/no-namespace
························->
@eslint-react/react/no-namespace
react/no-deprecated ---------|··············->
@eslint-react/react/no-create-class
#186react/no-find-dom-node ······|··············->
@eslint-react/react/no-find-dom-node
#173react/no-render-return-value |··············->
@eslint-react/react/no-render-return-value
#183react/no-is-mounted ·········|··············->
@eslint-react/react/no-is-mounted
#185react/no-string-refs ········|··············->
@eslint-react/react/no-string-refs
-----------------------------|··············->
@eslint-react/react/no-create-ref
react/no-children-prop
····················->
@eslint-react/react/no-children-prop
#101react/no-direct-mutation-state
············->
@eslint-react/react/no-direct-mutation-state
#202@eslint-react/react/no-unsafe-component-will-mount
#190@eslint-react/react/no-unsafe-component-will-receive-props
#191@eslint-react/react/no-unsafe-component-will-update
#192react/no-did-mount-set-state
··············->
@eslint-react/react/no-set-state-in-component-did-mount
#197react/no-did-update-set-state
·············->
@eslint-react/react/no-set-state-in-component-did-update
#198react/no-will-update-set-state
············->
@eslint-react/react/no-set-state-in-component-will-update
#199react/no-redundant-should-component-update
->
@eslint-react/react/no-redundant-should-component-update
#187react/no-object-type-as-default-prop
······->
@eslint-react/react/no-unstable-default-props
react/no-unstable-nested-components
·······->
@eslint-react/react/no-unstable-nested-components
react/no-unused-state
·····················->
@eslint-react/react/no-unused-state
react/no-unused-class-component-methods
···->
@eslint-react/react/no-unused-class-component-members
#207react/void-dom-elements-no-children
·······->
@eslint-react/react/no-children-in-vold-dom-elements
react/destructuring-assignment
············->
@eslint-react/react/prefer-destructuring-assignment
react/prefer-read-only-props
··············->
@eslint-react/react/prefer-readonly-props
react/no-access-state-in-setstate
·········->
@eslint-react/hooks/no-access-state-in-setstate
#301react/sort-comp
···························->
@eslint-react/react/no-unsorted-class-component-members
#234The 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
The following correctness rules in
eslint-plugin-react
can be enforced by TypeScript with appropriatetsconfig.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
Outdated or obsolete rules
These rules are considered outdated or obsolete. They are not going to be supported by this plugin.
react/default-props-match-prop-types
react/forbid-foreign-prop-types
react/forbid-prop-types
react/no-unused-prop-types
react/prefer-exact-props
react/prefer-es6-class
react/prefer-stateless-function
react/require-default-props
react/require-optimization
react/sort-default-props
react/sort-prop-types
react/state-in-constructor
react/static-property-placement
react/jsx-no-bind
The text was updated successfully, but these errors were encountered: