typescript-eslint / tslint-to-eslint-config

Converts your TSLint configuration to the closest possible ESLint equivalent. 🚀
MIT License
852 stars 100 forks source link

react/jsx-curly-spacing #1243

Open RyanNerd opened 3 years ago

RyanNerd commented 3 years ago

💥 Missing Merger

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

Redbull08 commented 3 years ago

Dont worry be happy!

RyanNerd commented 3 years ago

Dont worry be happy!

Thanks. I'm happy now! 😁

jonsch318 commented 7 months ago

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

https://github.com/typescript-eslint/tslint-to-eslint-config/blob/470d44de20beb7c7366de993edb8898d0766b8aa/src/converters/lintConfigs/rules/ruleConverters/jsx-curly-spacing.ts#L7-L14

https://github.com/typescript-eslint/tslint-to-eslint-config/blob/470d44de20beb7c7366de993edb8898d0766b8aa/src/converters/lintConfigs/rules/ruleConverters/react-tsx-curly-spacing.ts#L7-L14

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.