xojs/xo

Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation

godlikeSwan opened this issue · 4 comments

So

                {imgLink === ''
                    ? <div className={aniClass} id='downloadQr'>
                        <Image
                            text={`${process.env.REACT_APP_API_LINK}` + props.alias}
...
                        />
                    </div>
                    : <img
                        className={aniClass} // Expected indentation of 28 space characters but found 24.
                        src={imgLink || defaultProfilePicture} // Expected indentation of 28 space characters but found 24.
                            alt='User pic' // Expected indentation of 24 spaces but found 28.
                    />
                }

And I cannot disable any of them (other rules can be turn off easily)
I've tried to add

      "react/jsx-indent": "off",
      "react/jsx-indent-props": "off",
      "@typescript-eslint/indent": "off"

to package.json > xo.rules[]

I've tried add that to package.json > eslintConfig.rules.

I've tried to play with "off" value like 0 or [0] or [0, ...] or ["off"] or ["off", ...]

I've also tried to --print-config
It shows like I'm not disabled them (but how can I locate that config file or how I can override one?)

Nothing helps =(

xo/lib/options-manager.js

Lines 373 to 377 in a608bf1

if (options.cwd && resolveFrom.silent('eslint-plugin-react', options.cwd)) {
config.baseConfig.plugins.push('react');
config.baseConfig.rules['react/jsx-indent-props'] = ['error', spaces];
config.baseConfig.rules['react/jsx-indent'] = ['error', spaces];
}

And I cannot disable any of them (other rules can be turn off easily)

Same issue as #613.

I assume this has been fixed in #691 (comment)

Reopen if not