Skip to content

linter/js: improve/export types #20122

@Sysix

Description

@Sysix

Coming from oxc-project/oxlint-migrate#424 where we removed the own oxlint types and used the types from oxlint itself.

I do not have a clean way to define some settings, they need some unexpected workaround:

Getting rules severity/config

import type { DummyRule } from 'oxlint';
// should be `AllowWarnDeny | [AllowWarnDeny, ...unknown[]]
export type OxlintConfigRuleSeverity = DummyRule;
// current: type DummyRule = AllowWarnDeny | unknown[];

getting globals values

import type { OxlintGlobals } from 'oxlint';
// should be `GlobalValue`
export type OxlintConfigGlobalsValue = OxlintGlobals[string];

oxlint plugins union

import type { OxlintConfig } from 'oxlint';
// should be `LintPluginOptionsSchema`
export type OxlintConfigPlugin = Exclude<
  OxlintConfig['plugins'],
  null | undefined
>[number];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions