Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Changes to configurations for 8.0.0#8914

Apr 13, 2024· 11 comments· 14 replies
Discussion options

Overview

We're working towards a new v8 major versions for typescript-eslint. Major versions are when we have an opportunity to adjust theshared configs. Exciting!

As with 6.0 (#6014), this is a proposal for the new shared configs. We're looking for feedback from the community before we go ahead and make the changes.

Please, let us know here or in thetypescript-eslint Discord's#v8 channel: what feedback to you have? 💜

Table Key

ColumnDescriptionEmojis
StatusBeing added, deprecated, or removed
  • 🆕 = newly added to typescript-eslint
  • 🙅 = to be deprecated in the next major
  • 💀 = currently deprecated; to be removed in the next version
TCRequires type checking?
  • 💭 = yes
ExtExtension rule?
  • 🧱 = yes
Rec'dRecommended
  • ➕ = add to recommended this version
  • ➖️ = remove from recommended this version
  • 🟩 = stays in recommended this version
StrictStrict
  • ➕ = add to strict this version
  • ➖️ = remove from strict this version
  • 🔵 = stays in strict this version
StyleStyle
  • ➕ = add to stylistic this version
  • ➖️ = remove from stylistic this version
  • 🔸 = stays in stylistic this version

Recommendations Table

Hint: search for 🆕 to find newly added rules, and ➕ or ➖ to see config changes.

RuleStatusTCExtRec'dStrictStyleComment
adjacent-overload-signatures🔸
array-type🔸
await-thenable💭🟩
ban-ts-comment🟩
ban-tslint-comment🔸
ban-types🙅➖️SeeReplacement ofban-types
no-restricted-types
no-unsafe-function-type
no-wrapper-object-types
class-literal-property-style🔸
class-methods-use-this🆕🧱too opinionated for stylistic
consistent-generic-constructors🔸
consistent-indexed-object-style🔸
consistent-return🆕💭🧱too opinionated for stylistic
consistent-type-assertions🔸
consistent-type-definitions🔸
consistent-type-exports💭
consistent-type-imports
default-param-last🧱
dot-notation💭🧱🔸
explicit-function-return-type
explicit-member-accessibility
explicit-module-boundary-types
init-declarations🧱
max-params🆕🧱too opinionated for stylistic
member-ordering
method-signature-style
naming-convention💭
no-array-constructor🧱🟩
no-array-delete🆕💭
no-base-to-string💭🟩
no-confusing-non-null-assertion🔸
no-confusing-void-expression💭
no-dupe-class-members🧱
no-duplicate-enum-values🟩
no-duplicate-type-constituents💭🟩
no-dynamic-delete🔵
no-empty-function🧱🔸
no-empty-object-type🆕
no-empty-interface🙅
no-explicit-any🟩
no-extra-non-null-assertion🟩
no-extra-semi🧱
no-extraneous-class🔵
no-floating-promises💭🟩
no-for-in-array💭🟩
no-implied-eval💭🧱🟩
no-import-type-side-effects
no-inferrable-types🔸
no-invalid-this🧱
no-invalid-void-type🔵
no-loop-func🧱
no-loss-of-precision🙅🧱No longer necessary
no-magic-numbers🧱
no-meaningless-void-operator💭🔵
no-misused-new🟩
no-misused-promises💭🟩
no-mixed-enums💭🔵
no-namespace🟩
no-non-null-asserted-nullish-coalescing🔵
no-non-null-asserted-optional-chain🟩
no-non-null-assertion🔵
no-redeclare🧱
no-redundant-type-constituents💭🟩
no-require-imports
no-restricted-imports🧱
no-shadow🧱
no-this-alias🟩
no-throw-literal💭🧱
no-type-alias
no-unnecessary-boolean-literal-compare💭🔵
no-unnecessary-condition💭🔵
no-unnecessary-qualifier💭
no-unnecessary-type-arguments💭🔵
no-unnecessary-type-assertion💭🟩
no-unnecessary-type-constraint🟩
no-unsafe-argument💭🟩
no-unsafe-assignment💭🟩
no-unsafe-call💭🟩
no-unsafe-declaration-merging🟩
no-unsafe-enum-comparison💭🟩
no-unsafe-member-access💭🟩
no-unsafe-return💭🟩
no-unsafe-unary-minus🆕💭
no-unused-expressions🧱
no-unused-vars🧱🟩
no-use-before-define🧱
no-useless-constructor🧱🔵
no-useless-empty-export
no-useless-template-literals🆕💭To be renamed in#8821
no-var-requires🙅Switched tono-require-imports
non-nullable-type-assertion-style💭🔸
only-throw-error🆕💭🧱
parameter-propertiestoo opinionated for stylistic
prefer-as-const🟩
prefer-destructuring🆕💭🧱too opinionated for stylistic
prefer-enum-initializers
prefer-find🆕💭
prefer-for-of🔸
prefer-function-type🔸
prefer-includes💭🔵
prefer-literal-enum-member🔵
prefer-namespace-keyword
prefer-nullish-coalescing💭🔸
prefer-optional-chain💭🔸
prefer-promise-reject-errors🆕💭🧱
prefer-readonly💭
prefer-readonly-parameter-types💭
prefer-reduce-type-parameter💭🔵
prefer-regexp-exec💭
prefer-return-this-type💭🔵
prefer-string-starts-ends-with💭🔸
prefer-ts-expect-error🔵
promise-function-async💭
require-array-sort-compare💭
require-await💭🧱🟩
restrict-plus-operands💭🟩
restrict-template-expressions💭🟩
return-await💭🧱
sort-type-constituents
strict-boolean-expressions💭
switch-exhaustiveness-check💭
triple-slash-reference🟩
typedef
unbound-method💭🟩
unified-signatures🔵
use-unknown-in-catch-callback-variable🆕💭🔵too opinionated for recommended
You must be logged in to vote

Replies: 11 comments 14 replies

Comment options

JoshuaKGoldberg
Apr 13, 2024
Maintainer Author

Fun fact, I somewhat auto-generated this table. 😎https://github.com/JoshuaKGoldberg/repros/tree/ts-eslint-v8-config-changes-generator

You must be logged in to vote
0 replies
Comment options

If no-useless-template-literal is destined to be renamed, should we sneak that in before it gets added to recommended to minimize impact of the renaming (on things like disable comments etc)?

#8821

You must be logged in to vote
1 reply
@JoshuaKGoldberg
Comment options

JoshuaKGoldbergApr 14, 2024
Maintainer Author

Agreed, added to the v8 milestone. Good call!

Comment options

JoshuaKGoldberg
Apr 14, 2024
Maintainer Author

Interesting note:prefer-find andprefer-includes at first seem like rules that would be instylistic*.prefer-includes is currently instrict*. I don't mind keeping them instrict because they do help code be a little more performant... but I suspect the main benefits for users are stylistic. It'd be very rare for actual perf benefits to come out of them. So I'm leaning towards moving them tostylistic*. Does anybody have thoughts on this?

You must be logged in to vote
3 replies
@kirkwaiblinger
Comment options

The way I see it, both those rules satisfy the conditions when flagging that "there is a unique and uncontroversially better way to write this, though there is not a significant correctness concern with the existing code". So there's no reason ever to not want them, but they're not terribly important to use either. As a user my intuition would that that should be part of strict, whereas stylistic would have to do more with opinionated things that don't have a uniquely better way to write them; one is just picked largely for the sake of consistency (consistent-type-assertions springs to mind as a good example of this). Idk if that's really the intention of those configs or not, though.

@rubiesonthesky
Comment options

I think it would be good to also consider that strict is recommended only for proficient typescript developers. And I think these rules are easy to use and easy to adopt. So they could go for stylistics in that sense.

I thinkprefer-find could go to even recommended. I don't see it being really opinionated. Instead it will catch old code that could be updated. There is probably only handful of cases where you would not want to use that rule.

We recommend a TypeScript project extend from plugin:@typescript-eslint/strict only if a nontrivial percentage of its developers are highly proficient in TypeScript.

@JoshuaKGoldberg
Comment options

JoshuaKGoldbergMay 12, 2024
Maintainer Author

I'm leaning towardsstylistic for now, as (a) they really do mostly give objectively better stylistic benefits and (b) per@rubiesonthesky's note,strict locks them behind"you should be proficient" notes.

Comment options

Here are some rules I find handy

Addno-import-type-side-effects to the recommended config, andconsistent-type-exports withconsistent-type-imports to the stylistic config.

method-signature-style

You must be logged in to vote
2 replies
@bradzacher
Comment options

consistent-type-imports might too opinionated for us to turn on, I think.
Mainly because it has a fixer and it fixes to an opinionated default.

stylistic is our opinionated default but I am weary of complaints.
We could document that people should useimport/consistent-type-specifier-style if they want to customise the style...

🤔

@bradzacher
Comment options

no-import-type-side-effects isn't really useful for people unless they are usingverbatimModuleSyntax as well. With that turned off the "empty imports" are all properly elided by everything.

It's a useful rule if you have to useverbatimModuleSyntax - otherwise it's just noise and not necessary.

Comment options

Just heads up, ➕ and ➖ emojis are not visible on dark mode.

You must be logged in to vote
4 replies
@JoshuaKGoldberg
Comment options

JoshuaKGoldbergApr 19, 2024
Maintainer Author

Oh, blurgh. Good callout. Now we have to figure out - what's a good replacement pair of emojis... 🤔

@rubiesonthesky
Comment options

remove: 🗑️ (or ❌ but that is too red IMO.)
add: 🎉 / ✨

(I honestly do not know, I think it could be just+ and- :)

@JoshuaKGoldberg
Comment options

JoshuaKGoldbergApr 19, 2024
Maintainer Author

Mmhh it'd be nice to have two emojis with meanings related to each other... surprisingly hard to find. I'm surprised there aren't + and - versions in squares the way there are 🔼 / 🔽 .

@rubiesonthesky
Comment options

👍 / 👎 :D There is ✅ and ❎ but I think those are hard for some people as they use same color and the different symbol is just so small.

I think the table could use ✨ for meaning "new". Both meaning as a new rule and as a new item in shared config. Because I had difficulties remembering what every emoji means :D But I'll leave this to you (or others) to find best option.

(Found this kind of tool where you could check in both modes easilyhttps://github-emoji-picker.rickstaa.dev/ but emojis are pretty limited in this way)

Comment options

prefer-namespace-keyword

module will be probably marked as deprecated soon in typescriptmicrosoft/TypeScript#57913

I wonder would it be helpful for ts-eslint users that this rule would be moved to recommended so they would get heads up beforehand? Of course, marking it as deprecated does not mean that it will stop working. :)

You must be logged in to vote
1 reply
@JoshuaKGoldberg
Comment options

JoshuaKGoldbergApr 19, 2024
Maintainer Author

I like it! It straddles the line between "recommended" and "stylistic"... but given the strong TypeScript push, that's enough for me to be happy switching it over.

Comment options

JoshuaKGoldberg
May 12, 2024
Maintainer Author

Update (May 11th): with#8977'sno-empty-object-type merged intov8, updating the table to include that being added torecommended.

You must be logged in to vote
1 reply
@JoshuaKGoldberg
Comment options

JoshuaKGoldbergMay 24, 2024
Maintainer Author

Note that once#9102 is merged, we'll have some more changes to the table.

Comment options

I'm excited to see all this work on v8! Is there a rough timeline for when this version will drop? I think I'm right in saying ESLint v9 has been out nearly a couple of months now but the current version of typescript-eslint doesn't support it, preventing new users/projects from using the latest major version.

You must be logged in to vote
1 reply
@bradzacher
Comment options

No strict timeline. When we get to things, really.
You can use the canary releases if you need v9 support now.

As volunteer maintainers we work on things when we have the bandwidth -- and unfortunately we haven't had the bandwidth. ESLint sadly did not coordinate with us and released before we were ready and at a time where we have been time poor.

Comment options

JoshuaKGoldberg
May 27, 2024
Maintainer Author

Coming over from#9079 (comment): we're going to try out moving@typescript-eslint/no-unused-expressions torecommended. It's analogous to@typescript-eslint/no-unused-vars.

You must be logged in to vote
0 replies
Comment options

Calling out that return-await is on track to be added to the strict config, a la#8667/#9604

You must be logged in to vote
0 replies
Comment options

I'm coming from blog posthttps://typescript-eslint.io/blog/announcing-typescript-eslint-v8 to see what where the actual changes to some rules. :)

Some updates that could be made to table or just noting these here for next user that is curious why they are listed removed in config diffs. Though if you read the blog lost further, you also get the same explanation :D

  • ban-types was deprecated
  • no-loss-of-precision was deprecated
  • no-var-requires was deprecated
You must be logged in to vote
1 reply
@JoshuaKGoldberg
Comment options

JoshuaKGoldbergSep 13, 2024
Maintainer Author

Aha thank you, great callout! Updating now.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginbreaking changeThis change will require a new major version to be releasedrecommended-rulesDiscussion about recommended rule setsdefault rule optionsDiscussions about default rule options
6 participants
@JoshuaKGoldberg@rubiesonthesky@bradzacher@caribou-code@hyoban@kirkwaiblinger

[8]ページ先頭

©2009-2025 Movatter.jp