aladdin-add/eslint-plugin

rule support: react/jsx-no-leaked-render

l1135677068 opened this issue · 3 comments

something wents to wrong when auto fix 'jsx-no-leaked-render'.
see below code
fix before

 scrollY={scrollY && !showChangeNoResult }

fix after

 scrollY={scrollY ? !showChangeNoResult : null}

they are not equivalence

so, i want to know if there is some support for the react/jsx-no-leaked-render rule in the future

the fixer was not provided by the plugin, please file it in eslint-plugin-react: https://github.com/jsx-eslint/eslint-plugin-react

the fixer was not provided by the plugin, please file it in eslint-plugin-react: https://github.com/jsx-eslint/eslint-plugin-react

i know, so i want to use this no-auto-fix plugin to disable fix this rule react/jsx-no-leaked-render.
and i add some config in .eslintrc files like below code

plugins: ['prettier', 'no-autofix', 'react'],
  rules: {
    'no-autofix/react/jsx-no-leaked-render': 'error',
    'prefer-const': 'off',
  },

but when i save file, it still auto fix 'reace/jsx-no-leaked-render' problem

well, you will need to disable the rule first:

  rules: {
    'react/jsx-no-leaked-render': 'off',
    'no-autofix/react/jsx-no-leaked-render': 'error',
  },