Skip to content

Commit 25b7017

Browse files
committed
fix(linter): undocument override ignores option (#22213)
we need some more discussion on this feature, as well as fleshing out naming. This PR undocuments it so we can make some changes without breaking anyone.
1 parent 0c7c01c commit 25b7017

5 files changed

Lines changed: 2 additions & 46 deletions

File tree

apps/oxlint/src-js/package/config.generated.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -490,16 +490,6 @@ export interface OxlintOverride {
490490
* Enabled or disabled specific global variables.
491491
*/
492492
globals?: OxlintGlobals;
493-
/**
494-
* A list of glob patterns to exclude from this override.
495-
*
496-
* Files matching these patterns are not globally ignored; this override
497-
* simply does not apply to them.
498-
*
499-
* ## Example
500-
* `[ "*.generated.ts", "fixtures/**" ]`
501-
*/
502-
ignores?: GlobSet;
503493
/**
504494
* JS plugins for this override, allows usage of ESLint plugins with Oxlint.
505495
*

crates/oxc_linter/src/config/overrides.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ pub struct OxlintOverride {
9595
/// ## Example
9696
/// `[ "*.generated.ts", "fixtures/**" ]`
9797
#[serde(default, skip_serializing_if = "GlobSet::is_empty")]
98+
#[schemars(skip)]
9899
pub ignores: GlobSet,
99100

100101
/// Environments enable and disable collections of global variables.

npm/oxlint/configuration_schema.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,6 @@
596596
],
597597
"markdownDescription": "Enabled or disabled specific global variables."
598598
},
599-
"ignores": {
600-
"description": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`",
601-
"allOf": [
602-
{
603-
"$ref": "#/definitions/GlobSet"
604-
}
605-
],
606-
"markdownDescription": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`"
607-
},
608599
"jsPlugins": {
609600
"description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are in alpha and not subject to semver.",
610601
"anyOf": [
@@ -823,4 +814,4 @@
823814
}
824815
},
825816
"markdownDescription": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json`\n\nExample\n\n`.oxlintrc.json`\n\n```json\n{\n\"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n\"plugins\": [\"import\", \"typescript\", \"unicorn\"],\n\"env\": {\n\"browser\": true\n},\n\"globals\": {\n\"foo\": \"readonly\"\n},\n\"settings\": {\n\"react\": {\n\"version\": \"18.2.0\"\n},\n\"custom\": { \"option\": true }\n},\n\"rules\": {\n\"eqeqeq\": \"warn\",\n\"import/no-cycle\": \"error\",\n\"react/self-closing-comp\": [\"error\", { \"html\": false }]\n},\n\"overrides\": [\n{\n\"files\": [\"*.test.ts\", \"*.spec.ts\"],\n\"rules\": {\n\"@typescript-eslint/no-explicit-any\": \"off\"\n}\n}\n]\n}\n```\n\n`oxlint.config.ts`\n\n```ts\nimport { defineConfig } from \"oxlint\";\n\nexport default defineConfig({\nplugins: [\"import\", \"typescript\", \"unicorn\"],\nenv: {\n\"browser\": true\n},\nglobals: {\n\"foo\": \"readonly\"\n},\nsettings: {\nreact: {\nversion: \"18.2.0\"\n},\ncustom: { option: true }\n},\nrules: {\n\"eqeqeq\": \"warn\",\n\"import/no-cycle\": \"error\",\n\"react/self-closing-comp\": [\"error\", { \"html\": false }]\n},\noverrides: [\n{\nfiles: [\"*.test.ts\", \"*.spec.ts\"],\nrules: {\n\"@typescript-eslint/no-explicit-any\": \"off\"\n}\n}\n]\n});\n```"
826-
}
817+
}

tasks/website_linter/src/snapshots/schema_json.snap

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,15 +600,6 @@ expression: json
600600
],
601601
"markdownDescription": "Enabled or disabled specific global variables."
602602
},
603-
"ignores": {
604-
"description": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`",
605-
"allOf": [
606-
{
607-
"$ref": "#/definitions/GlobSet"
608-
}
609-
],
610-
"markdownDescription": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`"
611-
},
612603
"jsPlugins": {
613604
"description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are in alpha and not subject to semver.",
614605
"anyOf": [

tasks/website_linter/src/snapshots/schema_markdown.snap

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -522,23 +522,6 @@ type: `object`
522522
Enabled or disabled specific global variables.
523523

524524

525-
#### overrides[n].ignores
526-
527-
type: `string[]`
528-
529-
530-
A list of glob patterns to exclude from this override.
531-
532-
Files matching these patterns are not globally ignored; this override
533-
simply does not apply to them.
534-
535-
## Example
536-
`[ "*.generated.ts", "fixtures/**" ]`
537-
538-
A set of glob patterns.
539-
Patterns are matched against paths relative to the configuration file's directory.
540-
541-
542525
#### overrides[n].jsPlugins
543526

544527
type: `array`

0 commit comments

Comments
 (0)