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

feat: support ESLint v8#3737

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bradzacher merged 15 commits intotypescript-eslint:v5fromota-meshi:eslint-v8
Aug 22, 2021
Merged

Conversation

@ota-meshi
Copy link
Contributor

@ota-meshiota-meshi commentedAug 15, 2021
edited
Loading

This PR updates this plugin to support ESLint v8.

However, currently eslint is still v8.0.0-beta-0.

Summary of changes

  • Change to get ESLint core rules from Linter instance. Seefeat: support ESLint v8 #3737 (comment).
  • Addemeta.hasSuggestions to the rules that provide suggestions.
  • Fixno-dupe-class-members andno-extra-semi to work with v8.0.0-beta.0.
  • ChangeCLIEngine to beundefined in eslint v8.
  • Addjest-resolver.js
    jest doesn't seem to support the exports map in package.json at this time.
    For this reason, jest-resolver.js is added as a workaround.
    SeeSupport package exports injest-resolve jestjs/jest#9771.

About Lint errors:
Since eslint-plugin-import and eslint-plugin-jest do not yet support eslint v8, still get a run error.

Test failed on Node 10.x:
Test fails because eslint v8 doesn't support Node 10.

Should I change the problematic workflow and use eslint v7 only for Node 10.x testing and linting? Or should I delete the workflow for Node 10.x?

ybiquitous, coderaiser, and sosukesuzuki reacted with thumbs up emoji
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@ota-meshi!

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 onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@nx-cloud
Copy link

nx-cloudbot commentedAug 15, 2021
edited
Loading

Nx Cloud Report

CI ran the following commands for commitabb4094. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

StatusCommand
#000000nx test @typescript-eslint/eslint-plugin-tslint
#000000nx test @typescript-eslint/eslint-plugin
#000000nx test @typescript-eslint/eslint-plugin-tslint
#000000nx test @typescript-eslint/eslint-plugin
#000000nx test @typescript-eslint/eslint-plugin-tslint
#000000nx test @typescript-eslint/eslint-plugin-internal
#000000nx test @typescript-eslint/eslint-plugin
#000000nx test @typescript-eslint/eslint-plugin-tslint
#000000nx test @typescript-eslint/eslint-plugin
#000000nx test @typescript-eslint/parser
#000000nx test @typescript-eslint/experimental-utils
#000000nx test @typescript-eslint/scope-manager
#000000nx test @typescript-eslint/visitor-keys
#000000nx test @typescript-eslint/typescript-estree
#000000nx test @typescript-eslint/parser
#000000nx test @typescript-eslint/experimental-utils
#000000nx test @typescript-eslint/scope-manager
#000000nx test @typescript-eslint/parser
#000000nx test @typescript-eslint/parser
#000000nx test @typescript-eslint/visitor-keys

Sent with 💌 fromNxCloud.

@coderaiser
Copy link
Contributor

That's amazing! This is the thing I wrote in#3735. The only thing that is missing isuse-at-own-risk fromeslint migration. You can cherry-pick from my PR. And I thinknode v10 can be removed fromCI because it is not supported byESLint v8.

@ota-meshi
Copy link
ContributorAuthor

I don't think use-at-own-risk can be used unless this plugin drops support for eslint <= v7.

@bradzacherbradzacher mentioned this pull requestAug 16, 2021
@bradzacher
Copy link
Member

I don't think use-at-own-risk can be used unless this plugin drops support for eslint <= v7.

It's possible for us to use both - it just means we can't migrate to ESM any time soon (not that we were planning on doing that. There's only one module we depend on that's made that switch so far).

This example code should work and allow us to support both, I believe:

import{version}from'eslint';importsemverfrom'semver';constisESLintV8=semver.major(version)>=8;exportfunctiongetESLintCoreRule<RextendsRuleId>(ruleId:R):RuleMap[R]{if(isESLintV8){returnrequire('eslint/use-at-own-risk').builtinRules[ruleId];}else{returnrequire(`eslint/lib/rules/${ruleId}`);}}// for no-loss-of-precisionexportfunctionmaybeGetESLintCoreRule<RextendsRuleId>(ruleId:R):RuleMap[R]|null{try{returngetESLintCoreRule<R>(ruleId);}catch{returnnull;}}
ota-meshi reacted with thumbs up emoji

@bradzacherbradzacher added breaking changeThis change will require a new major version to be released dependenciesIssue about dependencies of the package labelsAug 16, 2021
@bradzacherbradzacher added this to the5.0.0 milestoneAug 16, 2021
@ota-meshi
Copy link
ContributorAuthor

ota-meshi commentedAug 16, 2021
edited
Loading

@ota-meshi
Copy link
ContributorAuthor

Do you have any ideas on how to fix a lint crash?

What do you think about changing to using eslint v7 in devDependencies and using eslint v8 only for CI unit tests?
This plugin is so popular that I think it could deadlock if you wait for other plugins to be fixed.

@bradzacherbradzacher changed the base branch frommaster tov5August 21, 2021 22:14
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

I pushed a fix for the broken linting - this was due to breaking changes not being supported yet. For now I've manually patched the packages to handle this. Eventually they'll release full support and we can drop those patches.


LGTM - thanks for this!

ota-meshi reacted with heart emoji
@bradzacherbradzacher changed the titlefeat(eslint-plugin): supports eslint v8feat: support ESLint v8Aug 22, 2021
@bradzacherbradzacher merged commita5eac58 intotypescript-eslint:v5Aug 22, 2021
@ota-meshiota-meshi deleted the eslint-v8 branchAugust 22, 2021 01:21
bradzacher pushed a commit that referenced this pull requestSep 3, 2021
bradzacher pushed a commit that referenced this pull requestSep 21, 2021
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsSep 22, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bradzacherbradzacherbradzacher approved these changes

+1 more reviewer

@coderaisercoderaisercoderaiser left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

breaking changeThis change will require a new major version to be releaseddependenciesIssue about dependencies of the package

Projects

None yet

Milestone

5.0.0

Development

Successfully merging this pull request may close these issues.

3 participants

@ota-meshi@coderaiser@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp