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

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

Closed
godlikeSwan opened this issue Sep 18, 2022 · 4 comments
Labels

Comments

@godlikeSwan
Copy link

godlikeSwan commented Sep 18, 2022

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.
                    />
                }

@godlikeSwan godlikeSwan changed the title ules fight for identation Rules fight for identation Sep 18, 2022
@godlikeSwan godlikeSwan changed the title Rules fight for identation Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation Sep 18, 2022
@godlikeSwan godlikeSwan changed the title Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation Sep 18, 2022
@godlikeSwan godlikeSwan changed the title Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation Rules @typescript-eslint/indent and react/jsx-indent-props fight for identation Sep 18, 2022
@godlikeSwan
Copy link
Author

godlikeSwan commented Sep 18, 2022

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 =(

@sindresorhus
Copy link
Member

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];
}

@sindresorhus
Copy link
Member

sindresorhus commented Sep 19, 2022

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

Same issue as #613.

@fregante
Copy link
Member

fregante commented Jan 4, 2023

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

Reopen if not

@fregante fregante closed this as completed Jan 4, 2023
@fregante fregante added the bug label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants