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

feat(eslint-plugin): deprecate formatting (meta.type: layout) rules #8073

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

For every rule whose meta includes type: 'layout', adds deprecated: true and removes the rule from the all config.

Note that changes to the all config are explicitly not considered breaking. Per https://typescript-eslint.io/linting/configs (added in #5719, back in v5):

With the exception of all, strict, and strict-type-checked, all configurations are considered "stable".

@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.

Copy link

netlify bot commented Dec 15, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 0273e89
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6587a14401f7a8000868326d
😎 Deploy Preview https://deploy-preview-8073--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 91 (🔴 down 7 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review December 17, 2023 23:59
@bradzacher bradzacher added the enhancement New feature or request label Dec 23, 2023
bradzacher
bradzacher previously approved these changes Dec 23, 2023
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.

just to confirm - all the deprecated rules are the ones that have been moved to eslint-stylistic, right? Are there any others?

Also accepted but you should mark them all as replacedBy: ['eslint-stylistic/foo'].

Final note (follow up?) we should add a banner to deprecated rules using this metadata and point them at the replacement docs.

@JoshuaKGoldberg
Copy link
Member Author

Are there any others?

Just did another pass - I did miss one, object-curly-spacing. I'd searched on type: 'layout' before, but that misses some extension rules that ... spread from the base rule. https://typescript-eslint.io/rules/?=formatting is a better query.

👍 on the other two suggestions, good call! Done.

bradzacher
bradzacher previously approved these changes Dec 24, 2023
packages/eslint-plugin/tests/areOptionsValid.test.ts Outdated Show resolved Hide resolved
Comment on lines +27 to +32
deprecated: true,
docs: {
description: 'Enforce consistent spacing inside braces',
extendsBaseRule: true,
},
replacedBy: ['@stylistic/object-curly-spacing'],
Copy link
Member

Choose a reason for hiding this comment

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

OCD eye twitch: all the other ones you added on consecutive lines

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, the other ones are placed before a type:. So they somewhat don't make the sorting less alphabetical. This one doesn't have a type:...

@JoshuaKGoldberg JoshuaKGoldberg merged commit 04dea84 into typescript-eslint:main Dec 24, 2023
56 of 57 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the deprecate-formatting-rules branch December 24, 2023 05:05
auvred pushed a commit to auvred/typescript-eslint that referenced this pull request Dec 29, 2023
…ypescript-eslint#8073)

* feat(eslint-plugin): deprecate formatting (meta.type: layout) rules

* fix: whoops, forgot to commit all.ts changes

* Add replacedBy

* Update formatting admonition

* Missed object-curly-spacing

* areOptionsValid undo

* Correct configs and tweak deprecation notice
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💀 Rule deprecations: formatting rules
2 participants