Open nzakas opened 1 year ago
I can also help with phase 2, I can start with Copy context.markVariableAsUsed() to SourceCode
. @nzakas Let me know if that's ok.
@snitin315 markVariableAsUsed()
is a bit complicated, so I'd prefer to keep that one. If you could do the next few items (cwd
, sourceCode
, filename
, and physicalFilename
) that would be a huge help.
@nzakas I can also help with some items (any of CWD, sourceCode, filename, and physicalFilename) if possible. Can you pls give some context?
@amareshsm if you'd like to take a look at those four, this is the part of the code involved: https://github.com/eslint/eslint/blob/9d1b8fc60cc31f12618e58c10a2669506b7ce9bf/lib/linter/linter.js#L979-L1000
Basically, we want to create properties where there are currently methods, and then update all of the rules to use the properties instead of the methods.
Phase 1 is finished!!!
With https://github.com/eslint/eslint/pull/17086 merged, Copy context.markVariableAsUsed() to SourceCode should be checked off
I'll work on parserServices
.
With https://github.com/eslint/eslint/pull/17107 merged, Create context.sourceCode to replace context.getSourceCode() should be checked off
@ollie-iterators it seems like you enjoy tracking our tasks, do you have any interest in becoming more involved with the project?
I'm working on getInlineConfig
next.
Edit: Okay, this is a lot more complicated than I realized initially. This may take a while and require some design changes.
@ollie-iterators it seems like you enjoy tracking our tasks, do you have any interest in becoming more involved with the project?
I haven't thought about that. I might be interested in that.
@ollie-iterators cool. If you want to discuss, swing by Discord and we'd be happy to chat.
- Copy
parserServices
toSourceCode
I'm working on this now.
parserServices
actually already exists on SourceCode
, so the task is only to update documentation and tests.
This issue describes the implementation plan for eslint/rfcs#99, which will take place in several phases:
Phase 1: Implement external changes
eslint-scope
ScopeManager
to exposeisNodejsScope()
as public methodPhase 2: Implement backward-compatible changes
SourceCode#getInlineConfig()
SourceCode#getDisableDirectives()
SourceCode#traverse()
context.getAncestors()
toSourceCode
https://github.com/eslint/eslint/pull/17059context.getDeclaredVariables()
toSourceCode
https://github.com/eslint/eslint/pull/17059context.getScope()
toSourceCode
https://github.com/eslint/eslint/pull/17004context.markVariableAsUsed()
toSourceCode
https://github.com/eslint/eslint/pull/17086parserServices
toSourceCode
https://github.com/eslint/eslint/pull/17311context.cwd
to replacecontext.getCwd()
https://github.com/eslint/eslint/pull/17106context.sourceCode
to replacecontext.getSourceCode()
https://github.com/eslint/eslint/pull/17107context.filename
to replacecontext.getFilename()
https://github.com/eslint/eslint/pull/17108context.physicalFilename
to replacecontext.getPhysicalFilename()
https://github.com/eslint/eslint/pull/17111Phase 4: Deprecation of old APIs (v8.0.0)
RuleTester
to warn aboutcontext.getAncestors()
RuleTester
to warn aboutcontext.getDeclaredVariables()
RuleTester
to warn aboutcontext.getScope()
RuleTester
to warn aboutcontext.parserServices
RuleTester
to warn aboutcontext.getCwd()
RuleTester
to warn aboutcontext.getSourceCode()
RuleTester
to warn aboutcontext.getFilename()
RuleTester
to warn aboutcontext.getPhysicalFilename()
Phase 5: Removal of old APIs (v9.0.0)
context.getAncestors()
context.getDeclaredVariables()
context.getScope()
context.markVariableAsUsed()
context.parserServices
Phase 6: Create JS language object
parse()
andcreateSourceCode()
language
option (also update default config to use JS language object)Linter
to call language object for parsing (fallback to JS language for eslintrc)Linter
to useSourceCode#getInlineConfig()
Linter
to useSourceCode#getDisableDirectives()
Linter
to useSourceCode#traverse()
Phase 7: Create
@eslint/json
package@eslint/json
Phase 8: Create
@eslint/markdown
packagePhase 9: Ecosystem Updates
@types/eslint
with language type definitionsPhase 10: Removal of old APIs (v10.0.0)
context.getCwd()
context.getSourceCode()
context.getFilename()
context.getPhysicalFilename()