Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/oxlint/src-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type * as ESTree from "./generated/types.d.ts";
export type { Context, LanguageOptions } from "./plugins/context.ts";
export type { Fix, Fixer, FixFn } from "./plugins/fix.ts";
export type { CreateOnceRule, CreateRule, Plugin, Rule } from "./plugins/load.ts";
export type { Options } from "./plugins/options.ts";
export type { Options, RuleOptionsSchema } from "./plugins/options.ts";
export type { Diagnostic, DiagnosticData, Suggestion } from "./plugins/report.ts";
export type {
Definition,
Expand Down Expand Up @@ -44,7 +44,6 @@ export type {
export type {
RuleMeta,
RuleDocs,
RuleOptionsSchema,
RuleDeprecatedInfo,
RuleReplacedByInfo,
RuleReplacedByExternalSpecifier,
Expand Down
10 changes: 10 additions & 0 deletions apps/oxlint/src-js/plugins/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ const { freeze } = Object,
*/
export type Options = JsonValue[];

/**
* Schema describing valid options for a rule.
* `schema` property of `RuleMeta`.
*
* `false` opts out of schema validation. This is not recommended, as it increases the chance of bugs and mistakes.
*/
// TODO: Make this more precise.
// TODO: Use this to validate options in configs.
export type RuleOptionsSchema = Record<string, unknown> | unknown[] | false;

// Default rule options
export const DEFAULT_OPTIONS: Readonly<Options> = Object.freeze([]);

Expand Down
12 changes: 1 addition & 11 deletions apps/oxlint/src-js/plugins/rule_meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Options } from "./options.ts";
import type { Options, RuleOptionsSchema } from "./options.ts";

/**
* Rule metadata.
Expand Down Expand Up @@ -84,16 +84,6 @@ export interface RuleDocs {
[key: string]: unknown;
}

/**
* Schema describing valid options for a rule.
* `schema` property of `RuleMeta`.
*
* `false` opts out of schema validation. This is not recommended, as it increases the chance of bugs and mistakes.
*/
// TODO: Make this more precise.
// TODO: Use this to validate options in configs.
export type RuleOptionsSchema = Record<string, unknown> | unknown[] | false;

/**
* Info about deprecation of a rule, and possible replacements.
* `deprecated` property of `RuleMeta`.
Expand Down
Loading