Skip to content

feat(eslint-plugin): remove formatting/layout rules #8833

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

Merged

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Apr 4, 2024

BREAKING CHANGE: removes many rules.

PR Checklist

Overview

Deletes the rules marked as type 'layout', as well as handling for them in the config and website tooling.

I confirmed locally that https://github.com/eslint-stylistic/eslint-stylistic does rely on the 'layout' constituent for meta.type (#8695). But they only ever set type: 'layout' and later use rule as unknown as. So this can be worked around in userland.

💖

@JoshuaKGoldberg JoshuaKGoldberg added this to the 8.0.0 milestone Apr 4, 2024
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@JoshuaKGoldberg JoshuaKGoldberg force-pushed the remove-formatting-rules branch from 5d779d9 to 5702dc2 Compare April 4, 2024 02:11
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review April 4, 2024 02:24
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.42%. Comparing base (716b783) to head (5702dc2).
Report is 27 commits behind head on v8.

❗ Current head 5702dc2 differs from pull request most recent head 94a530d. Consider uploading reports for the commit 94a530d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##               v8    #8833      +/-   ##
==========================================
- Coverage   88.02%   86.42%   -1.61%     
==========================================
  Files         405      234     -171     
  Lines       14089    11423    -2666     
  Branches     4125     3575     -550     
==========================================
- Hits        12402     9872    -2530     
+ Misses       1382     1291      -91     
+ Partials      305      260      -45     
Flag Coverage Δ
unittest 86.42% <ø> (-1.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ckages/eslint-plugin/src/util/getESLintCoreRule.ts 50.00% <ø> (ø)
packages/utils/src/ts-eslint/ESLint.ts 50.00% <ø> (ø)

... and 150 files with indirect coverage changes

@JoshuaKGoldberg JoshuaKGoldberg requested a review from armano2 April 8, 2024 17:12
@armano2
Copy link
Collaborator

armano2 commented Apr 8, 2024

seems good to me

JoshuaKGoldberg and others added 2 commits April 15, 2024 09:39
…script-eslint#8815)

* feat(typescript-estree): add defaultProject for project service

* Thanks Jake, service.setCompilerOptionsForInferredProjects

* Cleaned up a bit and added happy path testing

* Update packages/typescript-estree/src/parser-options.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
…onstructor` (typescript-eslint#8895)

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete it all. Yes. Die.

The only suggestion I would have:
like camelcase - I think it would be best to leave tombstones behind to forward people to the new rules.

Why? Because people running on older versions will "click to open docs" in their IDE and it will open our site to https://typescript-eslint.io/rules/block-spacing/. They'll get a 404 page and be completely confused and probably file an issue.

Or they'll be using ESLint v8 and notice comma-dangle doesn't work as expected with TS constructs and they'll search our repo for a replacement (as is the standard when looking for extension rules) and find no existing rule -then request it cos they didn't read any other docs.

It'll cost us nothing to keep tombstones around but it'll help orient people and cut off useless support requests.

@bradzacher bradzacher added the breaking change This change will require a new major version to be released label Apr 15, 2024
@armano2
Copy link
Collaborator

armano2 commented Apr 16, 2024

Delete it all. Yes. Die.

The only suggestion I would have: like camelcase - I think it would be best to leave tombstones behind to forward people to the new rules.

Why? Because people running on older versions will "click to open docs" in their IDE and it will open our site to https://typescript-eslint.io/rules/block-spacing/. They'll get a 404 page and be completely confused and probably file an issue.

Or they'll be using ESLint v8 and notice comma-dangle doesn't work as expected with TS constructs and they'll search our repo for a replacement (as is the standard when looking for extension rules) and find no existing rule -then request it cos they didn't read any other docs.

It'll cost us nothing to keep tombstones around but it'll help orient people and cut off useless support requests.

what do you think about releasing old version of docs at https://v7.typescript-eslint.io/, that would let ppl who still use old version have access to it

@bradzacher
Copy link
Member

@armano2 we could do that. The problem there is discoverability - the rules are setup to link directly to typescript-eslint.io/rules/rule-name so if someone uses the "open docs" command then they're not gonna see the legacy docs.

I'm personally not too miffed about older versions losing docs - it's going to be a small fraction of users that actively need the old docs.
Each time this has been brought up in the past our collective response has been "it's just not worth the effort".

@JoshuaKGoldberg JoshuaKGoldberg merged commit 3f1cfda into typescript-eslint:v8 Apr 19, 2024
53 checks passed
JoshuaKGoldberg added a commit that referenced this pull request Apr 22, 2024
* feat(eslint-plugin): remove formatting/layout rules

* Remove "layout"

* feat(typescript-estree): add defaultProject for project service (#8815)

* feat(typescript-estree): add defaultProject for project service

* Thanks Jake, service.setCompilerOptionsForInferredProjects

* Cleaned up a bit and added happy path testing

* Update packages/typescript-estree/src/parser-options.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (#8895)

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* Add tombstones

* 'deprecated' typo

* Let's mention both issues

* Fix unused variable issue

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Co-authored-by: Dave <reduckted@outlook.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants