-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(linter): write json schema to npm/oxlint
- Loading branch information
Showing
8 changed files
with
293 additions
and
75 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ite/src/linter/snapshots/schema_json.snap → ...oxc_linter/src/snapshots/schema_json.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,267 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "OxlintConfig", | ||
"description": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json`\n\n::: danger NOTE\n\nOnly the `.json` format is supported.\n\n:::\n\nExample\n\n```json\n // oxlintrc.json\n {\n // Comments are supported.\n \"env\": {\n \"browser\": true\n },\n \"globals\": {\n \"foo\": \"readonly\",\n },\n \"settings\": {\n },\n \"rules\": {\n \"eqeqeq\": \"warn\",\n },\n }\n```", | ||
"type": "object", | ||
"properties": { | ||
"env": { | ||
"$ref": "#/definitions/OxlintEnv" | ||
}, | ||
"globals": { | ||
"$ref": "#/definitions/OxlintGlobals" | ||
}, | ||
"rules": { | ||
"description": "See [Oxlint Rules](./rules)", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/OxlintRules" | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"$ref": "#/definitions/OxlintSettings" | ||
} | ||
}, | ||
"definitions": { | ||
"CustomComponent": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"attribute", | ||
"name" | ||
], | ||
"properties": { | ||
"attribute": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"attributes", | ||
"name" | ||
], | ||
"properties": { | ||
"attributes": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"DummyRule": { | ||
"anyOf": [ | ||
{ | ||
"type": "integer", | ||
"format": "uint", | ||
"minimum": 0.0 | ||
}, | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": true | ||
} | ||
] | ||
}, | ||
"GlobalValue": { | ||
"type": "string", | ||
"enum": [ | ||
"readonly", | ||
"writeable", | ||
"off" | ||
] | ||
}, | ||
"JSDocPluginSettings": { | ||
"type": "object", | ||
"properties": { | ||
"augmentsExtendsReplacesDocs": { | ||
"description": "Only for `require-(yields|returns|description|example|param|throws)` rule", | ||
"default": false, | ||
"type": "boolean" | ||
}, | ||
"exemptDestructuredRootsFromChecks": { | ||
"description": "Only for `require-param-type` and `require-param-description` rule", | ||
"default": false, | ||
"type": "boolean" | ||
}, | ||
"ignoreInternal": { | ||
"description": "For all rules but NOT apply to `empty-tags` rule", | ||
"default": false, | ||
"type": "boolean" | ||
}, | ||
"ignorePrivate": { | ||
"description": "For all rules but NOT apply to `check-access` and `empty-tags` rule", | ||
"default": false, | ||
"type": "boolean" | ||
}, | ||
"ignoreReplacesDocs": { | ||
"description": "Only for `require-(yields|returns|description|example|param|throws)` rule", | ||
"default": true, | ||
"type": "boolean" | ||
}, | ||
"implementsReplacesDocs": { | ||
"description": "Only for `require-(yields|returns|description|example|param|throws)` rule", | ||
"default": false, | ||
"type": "boolean" | ||
}, | ||
"overrideReplacesDocs": { | ||
"description": "Only for `require-(yields|returns|description|example|param|throws)` rule", | ||
"default": true, | ||
"type": "boolean" | ||
}, | ||
"tagNamePreference": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/TagNamePreference" | ||
} | ||
} | ||
} | ||
}, | ||
"JSXA11yPluginSettings": { | ||
"type": "object", | ||
"properties": { | ||
"components": { | ||
"default": {}, | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"polymorphicPropName": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
} | ||
} | ||
}, | ||
"NextPluginSettings": { | ||
"type": "object", | ||
"properties": { | ||
"rootDir": { | ||
"$ref": "#/definitions/OneOrMany_for_String" | ||
} | ||
} | ||
}, | ||
"OneOrMany_for_String": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
] | ||
}, | ||
"OxlintEnv": { | ||
"description": "Predefine global variables.", | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"OxlintGlobals": { | ||
"description": "Add or remove global variables.", | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/GlobalValue" | ||
} | ||
}, | ||
"OxlintRules": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/DummyRule" | ||
} | ||
}, | ||
"OxlintSettings": { | ||
"description": "Shared settings for plugins", | ||
"type": "object", | ||
"properties": { | ||
"jsdoc": { | ||
"$ref": "#/definitions/JSDocPluginSettings" | ||
}, | ||
"jsx-a11y": { | ||
"$ref": "#/definitions/JSXA11yPluginSettings" | ||
}, | ||
"next": { | ||
"$ref": "#/definitions/NextPluginSettings" | ||
}, | ||
"react": { | ||
"$ref": "#/definitions/ReactPluginSettings" | ||
} | ||
} | ||
}, | ||
"ReactPluginSettings": { | ||
"type": "object", | ||
"properties": { | ||
"formComponents": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CustomComponent" | ||
} | ||
}, | ||
"linkComponents": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CustomComponent" | ||
} | ||
} | ||
} | ||
}, | ||
"TagNamePreference": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"message", | ||
"replacement" | ||
], | ||
"properties": { | ||
"message": { | ||
"type": "string" | ||
}, | ||
"replacement": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"message" | ||
], | ||
"properties": { | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "boolean" | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.