-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: Error if configuration options aren't provided as expected #6403
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
Comments
ping @typescript-eslint/triage-team - any thoughts on this? |
We should just throw? Logging is bad because people don't look at them and don't action them. |
👍 . Adding to the v6 milestone, but we can always push to v7 if this ends up taking too long. Edit: v6 already has a lot in it, this isn't critical, and I'm focusing on other things. Moving to |
Is this a breaking change? Won't it just cause undefined behavior downstream anyway? |
Yeah agreed the warning log is a much lighter breaking change than most. But I'd still think it qualifies. If something was previously passing some incorrect or unknown property, this will cause it to newly spit out output. I think that could break tooling if it was expecting things in a particular format. |
When we log we have to ensure its to stderr. A non-trivial number of consumers assume that eslint output comes in certain formats and stdout logs can break that. I think that just jumping straight to throwing is fine for us. We could leverage a json schema for automated validation if we want. |
How are the new proposed errors going to be generated for the user? Will they have to add a /** @type {import("eslint").Linter.Config} */
const config = {
/** @type {import("@typescript-eslint/eslint-plugin").Linter.Config.ParserOptions} */
parserOptions: {
sourceType: "module",
ecmaVersion: "latest",
tsconfigRootDir: REPO_ROOT,
project: true,
},
ignorePatterns: ["**/dist/**"],
}; |
@Zamiell nope - hard crashes at runtime. |
We talked internally: v8 has a lot of changes in it and nobody has taken ownership of this non-trivial change. Removing it from the v8 milestone. We still want this, but it'll have to come in a future major version. |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
typescript-estree
My proposal is suitable for this project
Description
Spinning out from #6367 (comment): we have logic in
typescript-estree
to ensure provided configuration options are the expected types. But we don't show any indication about incorrect types to users who configure us incorrectly.Fail
Pass
Additional Info
Proposal:
console.warn
in v6?throw
an error in v7?The text was updated successfully, but these errors were encountered: