Skip to content

react/jsx-curly-spacing #1243

New issue

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

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

Already on GitHub? # to your account

Open
RyanNerd opened this issue Oct 11, 2021 · 3 comments
Open

react/jsx-curly-spacing #1243

RyanNerd opened this issue Oct 11, 2021 · 3 comments
Labels
area: missing merger good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨

Comments

@RyanNerd
Copy link

RyanNerd commented Oct 11, 2021

πŸ’₯ Missing Merger

  • tslint-to-eslint-config version: X.X.X
  • ESLint version: X.X.X

CLI Output

✨ 191 rules replaced with their ESLint equivalents. ✨

❗ 6 ESLint rules behave differently from their TSLint counterparts ❗
  Check ./tslint-to-eslint-config.log for details.

❌ 1 error thrown. ❌
  Check ./tslint-to-eslint-config.log for details.

πŸ¦– 1 rule is obsolete and does not have an ESLint equivalent. πŸ¦–
  Check ./tslint-to-eslint-config.log for details.

☠ Prettier plugins are missing from your configuration. ☠
  We highly recommend running tslint-to-eslint-config --prettier to disable formatting ESLint rules.
  See https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md#should-i-use-prettier.

⚑ 6 new packages are required for this ESLint configuration. ⚑
  npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-plugin-jsdoc eslint-plugin-prefer-arrow eslint-plugin-react --save-dev

β™» Consider using --comments to replace TSLint comment directives in your source files. β™»

βœ… All is well! βœ…

File Output

6 ESLint rules behave differently from their TSLint counterparts:
  * no-invalid-this:
    - Functions in methods will no longer be ignored.
  * @typescript-eslint/no-unused-expressions:
    - The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
  * prefer-arrow/prefer-arrow-functions:
    - ESLint does not support allowing standalone function declarations.
    - ESLint does not support allowing named functions defined with the function keyword.
  * eqeqeq:
    - Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons.
  * no-underscore-dangle:
    - Leading and trailing underscores (_) on identifiers will now be ignored.
  * padded-blocks:
    - ESLint's padded-blocks rule also bans a blank line before a closing brace.

Error: multiple output react/jsx-curly-spacing ESLint rule options were generated, but tslint-to-eslint-config doesn't have "merger" logic to deal with this.
Please file an issue at https://github.com/typescript-eslint/tslint-to-eslint-config/issues/new?template=missing_merger.md. Thanks!

  * import-destructuring-spacing

Reproduction

rx-chart repo

@JoshuaKGoldberg JoshuaKGoldberg added area: missing merger good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨ labels Oct 14, 2021
@Redbull08
Copy link

Dont worry be happy!

@RyanNerd
Copy link
Author

Dont worry be happy!

Thanks. I'm happy now! 😁

@jonsch318
Copy link

i've implemented this today and will be pushing a pr soon:

  • These two ruleConverters create the two options

...(tslintRule.ruleArguments.length !== 0 && {
ruleArguments: [
{
when: tslintRule.ruleArguments[0],
},
],
}),
ruleName: "react/jsx-curly-spacing",

{
ruleArguments: [
{
...(tslintRule.ruleArguments.length > 1 && tslintRule.ruleArguments[1]),
when: tslintRule.ruleArguments[0],
},
],
ruleName: "react/jsx-curly-spacing",

the only thing is: i don't know what to do when `existionOptions = {when: "always"}, newOptions = {when: "never"}
these are kinda exclusive. For now i will do it analogous to others (e.g. indet) and use the newOptions so the last then.

I will write a short test and then pr it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: missing merger good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨
Projects
None yet
Development

No branches or pull requests

4 participants