-
-
Notifications
You must be signed in to change notification settings - Fork 727
Description
First version of Oxlint JS plugins is out in the wild 🎉 ! (docs)
However, we still have a lot of ground to cover. This is an umbrella issue covering the next phase of development.
Priorities
The focus of milestone 2 is:
- Filling in the gaps in our API, to cover all of ESLint's API surface.
- Support JS plugins in language server (IDEs).
- Support framework plugins (React, Vue, Svelte etc).
- Fix bugs.
Overall aim is to make Oxlint able to run any (or almost any) ESLint plugin without modification.
We should prioritize APIs which have highest impact in terms of enabling more plugins to work "out of the box".
Performance
Performance is NOT a priority at this stage. If we can get a feature working quickly by pulling in a dependency (even one that's not well-optimized), we should do that. We can loop back and work on perf in Milestone 3.
However, any opportunity for future performance improvements should be documented - either by opening an issue, or by adding a comment to the code e.g.:
// TODO: Currently we do X for ease of implementation,
// but we should reimplement as Y later for better performanceStubs and types
First step is to stub out the whole API:
- Stub out all ESLint
Contextmethods that we are currently missing as dummy methods that throw an "unimplemented" error (similar to unimplemented methods ofSourceCode). feat(linter/plugins): stub out allContextAPIs #15479, feat(linter/plugins): implement deprecatedSourceCode#getJSDocCommentmethod #15653 - Add all missing properties of
Context(as getters which throw "unimplemented"). feat(linter/plugins): stub out allContextAPIs #15479 - Fill out TS type defs for
Plugin- to include all properties, whether implemented or not at present. - Fill out TS type defs for
Rule- to include all properties, whether implemented or not at present. - Fill out TS type defs for
RuleMetafix(linter/plugins): fill in TS type def forRuleMeta#15629 - Fill out TS type defs for
Diagnosticfix(linter/plugins): add types for suggested fixes #15636
Missing APIs
First priority on APIs is to implement APIs which are used in "fix code"-type rules (not stylistic/formatting rules).
-
Context#cwdproperty Linter plugins: Addcwdproperty toContext#14777 - Options Linter plugins: Support options for JS rules #14825
- Settings feat(linter/plugins): allow js plugins to access settings #14724
- Scope analysis Linter plugins: Scope analysis #14827
-
Context#languageOptions-
sourceType- from AST feat(linter/plugins): implementcontext.languageOptions#15486 -
ecmaVersion- static value feat(linter/plugins): implementcontext.languageOptions#15486 -
globals- already parsed on Rust side from config - send over to JS -
parser- not sure how to deal with this -
parserOptionsfeat(linter/plugins): implementcontext.languageOptions#15486
-
- Deprecated APIs (
getSourceCodeetc) feat(linter/plugins): implement deprecatedSourceCodetokens methods #15645, feat(linter/plugins): implementContext#get*deprecated methods #15606 -
SourceCode#getNodeByRangeIndexmethod feat(linter/plugins): implementSourceCode#getNodeByRangeIndex#16256 - Suggestions (requires language server support to be useful)
- BOM Linter plugins: Handle BOM #12526 (surprisingly tricky)
Token APIs
2nd priority is to add support for stylistic / formatting rules.
- Support token-related
SourceCodeAPIs Linter plugins: Token-relatedSourceCodeAPIs #14829 -
SourceCode#isSpaceBetweenmethod - feat(linter/plugins): implementSourceCode#isSpaceBetween#15498, refactor(linter/plugins): reimplementisSpaceBetween()isSpaceBetweenTokens()using tokens #16055 - Faster Rust implementation Linter plugins: Rustify token methods #16207
Code path analysis
Lowest priority, because probably rarely used APIs, and potentially difficult to implement.
- Augment the walker/visitor to support https://eslint.org/docs/latest/extend/code-path-analysis
Testing
- Rule tester Linter plugins: Rule tester #16018
- Use rule tester to test popular ESLint plugins, and ESLint built-in rules that Oxlint doesn't natively support
TS types
Weirdly, types seem to work fine in our test fixtures, but then don't work when Oxlint is consumed externally. 🤷
- Improve our TS type defs, so they work for plugins written in TS
Language server
- Support JS plugins in language server
Framework plugins
At present we don't support linting sections of multi-part files. It's tricky because raw transfer expect the source text to start at very start of the buffer. Supporting BOM (#12526) and supporting multi-section files are connected in this respect.
There are likely other features we'll need to implement to support linting other sections of single-file components (e.g. custom "processors").
First step is to research and scope out what's required.
Bug fixes + refactor
- Fix out-of-memory errors on Windows linter: Experimental jsPlugins not loading on windows #14375 (we need to replace our allocator - please leave this one to @overlookmotel)
- Refactor how plugins + rules are stored in configs on Rust side Linter plugins: Various changes #12437