Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat!: cross test function-call-spacing#565

Merged
antfu merged 5 commits intoeslint-stylistic:maineslint-stylistic/eslint-stylistic:mainfrom
9romise:refactor/merge(func-call-spacing)9romise/eslint-stylistic:refactor/merge(func-call-spacing)Copy head branch name to clipboard
Jan 14, 2025
Merged

feat!: cross test function-call-spacing#565
antfu merged 5 commits intoeslint-stylistic:maineslint-stylistic/eslint-stylistic:mainfrom
9romise:refactor/merge(func-call-spacing)9romise/eslint-stylistic:refactor/merge(func-call-spacing)Copy head branch name to clipboard

Conversation

@9romise
Copy link
Copy Markdown
Member

@9romise 9romise commented Oct 21, 2024

Description

BREAKING CHANGE IN TS VERSION
SYNC WITH JS VERSION

Auto-fixing optional chain is different in the two versions.

Changes:

Linked Issues

part of #482

Additional context

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.23%. Comparing base (95716bc) to head (b0459f9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
- Coverage   96.94%   96.23%   -0.71%     
==========================================
  Files         121      121              
  Lines       20340    20352      +12     
  Branches     4842     4816      -26     
==========================================
- Hits        19718    19586     -132     
- Misses        619      762     +143     
- Partials        3        4       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antfu
Copy link
Copy Markdown
Member

antfu commented Oct 24, 2024

I don't have an idea of how to do the incremental breaking changes yet. On one hand I want to get them out one-by-one as soon as possible for users to test out, but on the other hand, we can't just do breaking changes for every single rule. Do you have any idea on that? Is that possible to still keep the original behavior and then break the default options all together (when we finish the migration of all rules)?

@antfu
Copy link
Copy Markdown
Member

antfu commented Oct 24, 2024

Maybe we could make a factory function to create two version of rules with different defaults, use it to create two different entry?

@9romise
Copy link
Copy Markdown
Member Author

9romise commented Oct 25, 2024

After careful consideration, I think that this PR contains too much content. Maybe I should split it up and submit.
Here's what I think about the changes.

  • update report location
  • don't remove comments while auto-fixing
  • support ImportExpression in ts version
  • auto-fix optional chain when the option is never

Some safe changes (or maybe fixes)

  • allow f?. (), f ?.(), f ?. () when the option is always

Since the core problem is the difference in the optional chain, I think maybe we can just add an option for the user to choose, which can also get a better auto-fix.
Example: @stylistic/function-call-spacing: ["error", "always", { "optionalChain": { "before": true, "after": true } }]

  • don't auto-fix while there is a line break and the allowNewlines option is falsy

There are some syntax errors in the issue description, so we can do without porting it.
eslint/eslint#7787

Completing these changes one by one may reduce the breaking changes.

@antfu
Copy link
Copy Markdown
Member

antfu commented Oct 25, 2024

Oh yeah that would do. We could merge those non-breaking PRs and ship them, while we could mark all the needed breaking PRs draft (and keep them as small as possible), and finally merge then when we do majors.

@9romise 9romise reopened this Nov 20, 2024
@9romise
Copy link
Copy Markdown
Member Author

9romise commented Nov 20, 2024

Updated the description at the top, this PR should be merged after #606

@antfu antfu enabled auto-merge January 14, 2025 07:29
@antfu antfu added this pull request to the merge queue Jan 14, 2025
Merged via the queue into eslint-stylistic:main with commit 80ec2e4 Jan 14, 2025
@9romise 9romise deleted the refactor/merge(func-call-spacing) branch January 14, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.