-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Key "rules": Key "header/header": should NOT have more than 0 items. #57
Comments
Also reproducing this issue. |
Seems that ESLint now mandates that meta.schema field is mandatory for rules with options: https://eslint.org/docs/latest/extend/custom-rules. I went ahead and set eslint-plugin-header/lib/rules/header.js Line 125 in 63f18ce
|
#58 - I have a PR to disable schema validation |
Thanks @tonyganchev. I verified and its working after disabling schema validation. @Stuk - can you please review the fix? |
I've published a fork at https://www.npmjs.com/package/@tony.ganchev/eslint-plugin-header containing my fix. |
I just spent a little time this afternoon looking at this. {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/schema-enum",
"type": "array",
"minItems": 1,
"maxItems": 3,
"prefixItems": [
{
"oneOf": [{
"type": "string",
"enum": ["block", "inline"]
},{
"type": "string",
"pattern": "[.*]*.*.js"
}]
},
{
"oneOf": [{
"type": "string",
},{
"type": "array",
"prefixItems": [
{
"oneOf": [
{
"type": "object",
"properties": {
"pattern": {
"type": "string"
},
"template": {
"type": "string"
}
},
"required": ["pattern"]
},
{"type": "string"}
]
},
{"type": "string"}
]
}]
},
{
"type": "number",
"minimum": 0
}
]
}
|
The latest release is not yet compatible with our version of ESLint. While awaiting the next release, we'll use a fork which has the fix. See Stuk/eslint-plugin-header#57
The latest release is not yet compatible with our version of ESLint. While awaiting the next release, we'll use a fork which has the fix. See Stuk/eslint-plugin-header#57
The latest release is not yet compatible with our version of ESLint. While awaiting the next release, we'll use a fork which has the fix. See Stuk/eslint-plugin-header#57
The latest release is not yet compatible with our version of ESLint. While awaiting the next release, we'll use a fork which has the fix. See Stuk/eslint-plugin-header#57
I add the following code in the const pluginHeader = require('eslint-plugin-header');
+ pluginHeader.rules.header.meta.schema = false; |
Closing because @Laffery's workaround works! |
I feel this is a good solution, and I want to apply it for require-path-exists/exists rule this is what I tried to do this is the source code of the rule
as you can see: |
using eslint version 9.4.0 with eslint-plugin-header gives this error -
see https://github.com/firefoxNX/learn_eslint to reproduce the issue.
The text was updated successfully, but these errors were encountered: