Skip to content

refactor: use oxlint types#424

Merged
Sysix merged 10 commits intomainfrom
refactor-use-oxlint-type
Mar 12, 2026
Merged

refactor: use oxlint types#424
Sysix merged 10 commits intomainfrom
refactor-use-oxlint-type

Conversation

@Sysix
Copy link
Copy Markdown
Member

@Sysix Sysix commented Mar 7, 2026

The internal oxlint types are also exported by this package.
I trade this increasing type definitions for correctness. I removed the ESLint types because they did get really big

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the project’s internal config/type model to reuse oxlint’s published TypeScript types, and updates rule/plugin/env/global transformation logic accordingly.

Changes:

  • Replaced locally-defined Oxlint config/override/category/rule types with types imported from oxlint.
  • Updated rule/plugin/env/global transforms and cleanup to handle nullable fields (null) in config shapes.
  • Adjusted constants and tests to align with updated plugin/category typings (e.g., plugin name expectations).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/types.ts Switches to oxlint-sourced types; introduces new exported type aliases for config, overrides, categories, and rule config values.
src/plugins_rules.ts Updates rule severity normalization/merging types, adds warning for unsupported rule config values, and handles nullable plugins.
src/jsPlugins.ts Updates rule-entry typing and handles nullable jsPlugins; assigns resolved rules into config.
src/index.ts Adds a non-null assertion after config initialization (type-narrowing workaround).
src/env_globals.ts Adds null checks for env/globals (and overrides/env cleanup paths) to match nullable config fields.
src/constants.ts Tightens plugin-prefix mapping values to Oxlint plugin type.
src/cleanup.ts Updates cleanup guards to handle nullable globals/env.
src/cleanup.test.ts Updates expected plugin name in override fixture (oxc).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix marked this pull request as ready for review March 8, 2026 18:01
@Sysix Sysix requested a review from connorshea March 8, 2026 18:01
Copy link
Copy Markdown
Member

@connorshea connorshea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sysix Sysix merged commit beeee13 into main Mar 12, 2026
2 checks passed
@Sysix Sysix deleted the refactor-use-oxlint-type branch March 12, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants