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
Implement Language Plugins #16999
Comments
* feat: Copy getScope() to SourceCode Refs #16999 * Fix no-obj-calls * Add getScope() tests * Throw error if argument is missing * Update docs * Add caching * Clean up caching
* feat: Move getDeclaredVariables and getAncestors to SourceCode Refs #16999 * Update rules to use sourceCode.getAncestors() * Add caching to sourceCode.getAncestors() * Update docs * Fix getAncestors caching * Update tests/lib/source-code/source-code.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update tests/lib/source-code/source-code.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update tests/lib/source-code/source-code.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Restore deprecated custom rules docs * Update comments in source-code.js * Check for missing argument in getAncestors() * Check for missing argument in getAncestors() --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
I can also help with phase 2, I can start with |
Renames the private __isNodejsScope to isGlobalReturn to formally make it part of the interface and available in ESLint. Refs eslint/eslint#16999
@snitin315 |
@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: Lines 979 to 1000 in 9d1b8fc
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. |
Renames the private __isNodejsScope to isGlobalReturn to formally make it part of the interface and available in ESLint. Refs eslint/eslint#16999
Implements `SourceCode#markVariableAsUsed()` while leaving `context.markVariableAsUsed()` alone. Refs #16999
Phase 1 is finished!!! |
Implements `SourceCode#markVariableAsUsed()` while leaving `context.markVariableAsUsed()` alone. Refs #16999
* feat: Implement `SourceCode#markVariableAsUsed()` Implements `SourceCode#markVariableAsUsed()` while leaving `context.markVariableAsUsed()` alone. Refs #16999 * Refactor markVariableAsUsed * Finish refactor * Update docs/src/extend/custom-rules.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/src/extend/custom-rules.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/src/extend/custom-rules.md * Update logic to eliminate scopeManager dependency * Update docs/src/extend/custom-rules.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Fix lint errors --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
With #17086 merged, Copy context.markVariableAsUsed() to SourceCode should be checked off |
I'll work on |
With #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 Edit: Okay, this is a lot more complicated than I realized initially. This may take a while and require some design changes. |
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. |
I'm working on this now.
|
Deprecates `context.parserServices` in favor of `SourceCode#parserServices` Refs #16999
Deprecates `context.parserServices` in favor of `SourceCode#parserServices` Refs #16999
* feat: Implement SourceCode#traverse() Refs #16999 * Add more debugging * Clean up sourcecode * Try to fix code paths * Fix rules and update migration guide * Cache traversal steps * Fix lint error * Fix fuzz test * Simplify TraversalStep constructor * Remove unused parent arg * Fix constructor-super
* feat: Move directive gathering to SourceCode refs #16999 * Add caching * Update lib/linter/apply-disable-directives.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
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
feat: Move getDeclaredVariables and getAncestors to SourceCode #17059context.getDeclaredVariables()
toSourceCode
feat: Move getDeclaredVariables and getAncestors to SourceCode #17059context.getScope()
toSourceCode
feat: Copy getScope() to SourceCode #17004context.markVariableAsUsed()
toSourceCode
feat: ImplementSourceCode#markVariableAsUsed()
#17086parserServices
toSourceCode
feat: MoveparserServices
toSourceCode
#17311context.cwd
to replacecontext.getCwd()
feat: addcwd
to rule context #17106context.sourceCode
to replacecontext.getSourceCode()
feat: addsourceCode
property to the rule context #17107context.filename
to replacecontext.getFilename()
feat: addfilename
to the rule context #17108context.physicalFilename
to replacecontext.getPhysicalFilename()
feat: addphysicalFilename
property to the rule context #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
packageTBD
Phase 8: Create
@eslint/markdown
packageTBD
Phase 9: Removal of old APIs (v10.0.0)
context.getCwd()
context.getSourceCode()
context.getFilename()
context.getPhysicalFilename()
The text was updated successfully, but these errors were encountered: