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(rule-tester): switched to flat config#9603

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

Conversation

@JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg commentedJul 22, 2024
edited
Loading

BREAKING CHANGE:
SwitchesRuleTester from legacy configs to flat configs.

PR Checklist

Overview

Switches the internals of our forkedRuleTester to work withnew Linter({ configType: 'flat' }); instead ofconfigType: 'eslintrc'. This is a pretty substantial breaking change internally:

  • this.#linter is no longer able todefineRule() ad hoc; instead, theconfig: TesterConfigWithDefaults has to haveplugins including the rule.
  • Because the@/ plugin can't be redefined, a@rule-tester/ prefix is added in front of rule names.
  • Per flat config, anyparser,parserOptions, and other language-specific settings are moved tolanguageOptions.
    • This caused a lot of churn in our test files
  • Per flat config,parser has to be the actual parser, not a string descriptor.
    • As a convenience, I formally defaulted it to our parser
    • I went ahead and removed all the redundantparser: '@typescript-eslint/parser',parserOptions: { sourceType: 'module' }, and other seemingly unnecessary options from our test files
  • Marks the@typescript-eslint/utilsRuleTester re-export as deprecated

I think we'll want to follow this up with added info in the v8 beta blog post. See ourpackages/eslint-plugin(-internal)/**/*.test.ts file changes. There's a fair amount users will have to do:

  • Nestlib,parser,parserOptions,sourceType, and any other parser options insidelanguageOptions
  • Switchparser from astring to the actual parser
  • The defaultecmaVersion andsourceType are now'latest' and'module', respectively

💖

azat-io reacted with thumbs up emoji
@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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedJul 22, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit11c5c78
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/66a0e48cf8c5db000866436b
😎 Deploy Previewhttps://deploy-preview-9603--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: 97 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (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 yourNetlify site configuration.

@nx-cloud
Copy link

nx-cloudbot commentedJul 22, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit11c5c78. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@bradzacher
Copy link
Member

Per flat config, any parser and parserOptions, and other language-specific settings are moved to languageOptions.

Thought: I wonder if we should have hoisted up our stuff / the common stuff to avoid churn. Cos this will mess with all the ecosystem as well. I know that was their intent but it is going to block plugins hard.

@JoshuaKGoldberg
Copy link
MemberAuthor

JoshuaKGoldberg commentedJul 22, 2024
edited
Loading

Per flat config, any parser and parserOptions, and other language-specific settings are moved to languageOptions.

Thought: I wonder if we should have hoisted up our stuff / the common stuff to avoid churn. Cos this will mess with all the ecosystem as well. I know that was their intent but it is going to block plugins hard.

Yeah I don't think we're in a good place to do anything here. +1 that this will be work for plugins, but:

  • Switching ourRuleTester from a rough drop-in to something noticeably different from the core config system would be a big step away from core
  • Most plugins will just need to wrap some stuff inlanguageOptions

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewJuly 22, 2024 12:05
@JoshuaKGoldbergJoshuaKGoldberg requested review froma team andbradzacherJuly 22, 2024 12:05
@bradzacherbradzacher added the breaking changeThis change will require a new major version to be released labelJul 22, 2024
JoshuaKGoldbergand others added2 commitsJuly 24, 2024 07:22
@codecov
Copy link

codecovbot commentedJul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.01%. Comparing base(ae980e3) to head(11c5c78).
Report is 8 commits behind head on v8.

Additional details and impacted files
@@            Coverage Diff             @@##               v8    #9603      +/-   ##==========================================+ Coverage   88.00%   88.01%   +0.01%==========================================  Files         401      401                Lines       13647    13637      -10       Branches     3965     3960       -5     ==========================================- Hits        12010    12003       -7  Misses       1325     1325+ Partials      312      309       -3
FlagCoverage Δ
unittest88.01% <ø> (+0.01%)⬆️

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

FilesCoverage Δ
packages/utils/src/eslint-utils/deepMerge.ts89.47% <ø> (ø)
packages/utils/src/ts-eslint/Linter.ts50.00% <ø> (ø)
packages/utils/src/ts-eslint/RuleTester.ts50.00% <ø> (ø)
packages/utils/src/ts-eslint/SourceCode.ts50.00% <ø> (ø)

... and2 files with indirect coverage changes

@JoshuaKGoldbergJoshuaKGoldberg merged commit32a7a70 intotypescript-eslint:v8Jul 24, 2024
@JoshuaKGoldbergJoshuaKGoldberg deleted the rule-tester-flat-config branchJuly 24, 2024 12:24
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsAug 2, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bradzacherbradzacherbradzacher approved these changes

Assignees

No one assigned

Labels

breaking changeThis change will require a new major version to be released

Projects

None yet

Milestone

8.0.0

Development

Successfully merging this pull request may close these issues.

2 participants

@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp