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
Modify no-restricted-globals to allow providing optional custom messages #8315
Comments
Thanks for the rule suggestion! I'll champion this. |
Thanks @platinumazure! |
@dryajov Could you provide a schema of what you think the options should look like with this change? |
@platinumazure This has three 👍s from the team -- marking as accepted. |
@ilyavolodin Missed your question about proposed schema for this rule, sorry. I would want to do something similar to what we have in schema: {
type: "array",
items: [{
oneOf: [
{
type: "string"
},
{
type: "object",
properties: {
global: { type: "string" },
message: { type: "string" }
},
required: ["global"],
additionalProperties: false
}
]
}],
uniqueItems: true,
minItems: 0
} |
Working on this. |
@not-an-aardvark @platinumazure
This is a continuation of a new rule proposal and subsequent discussion initially started here - #8229
Please describe what the rule should do:
no-restricted-globals
allows to prevent the use of certain globals, but it doesn't allow providing custom messages that would explain why the usage is being prevented.What category of rule is this? (place an "X" next to just one item)
[x] Enforces code style
[x] Warns about a potential error
[x] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
The text was updated successfully, but these errors were encountered: