-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(rule-tester): switched to flat config #9603
feat(rule-tester): switched to flat config #9603
Conversation
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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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. |
…ns/wrappers; hacked around [] getConfig
Yeah I don't think we're in a good place to do anything here. +1 that this will be work for plugins, but:
|
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
BREAKING CHANGE:
Switches
RuleTester
from legacy configs to flat configs.PR Checklist
Overview
Switches the internals of our forked
RuleTester
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.@/
plugin can't be redefined, a@rule-tester/
prefix is added in front of rule names.parser
,parserOptions
, and other language-specific settings are moved tolanguageOptions
.parser
has to be the actual parser, not a string descriptor.parser: '@typescript-eslint/parser'
,parserOptions: { sourceType: 'module' }
, and other seemingly unnecessary options from our test files@typescript-eslint/utils
RuleTester
re-export as deprecatedI think we'll want to follow this up with added info in the v8 beta blog post. See our
packages/eslint-plugin(-internal)/**/*.test.ts
file changes. There's a fair amount users will have to do:lib
,parser
,parserOptions
,sourceType
, and any other parser options insidelanguageOptions
parser
from astring
to the actual parserecmaVersion
andsourceType
are now'latest'
and'module'
, respectively💖