-
Notifications
You must be signed in to change notification settings - Fork 14
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
Lint overrides do not flag ban-ts-comment #1389
Comments
Ahh good catch. Yes the override would need to have the right options provided to it, otherwise it is just going to use the defaults: from https://typescript-eslint.io/rules/ban-ts-comment/:
In other news, we should probably update our whole project to the 2 paths forward:
And the GO package would look like:
Either way is fine with me. I'd probably factor it out, but also if I was @pixelzoom, often adding many extra rules into most of my sims, I'd probably have factored all of them out into a "superStrict_eslintrc.js" for reuse. Hope that's helpful. |
|
@zepumph said:
That's problematic, because I typically add additional rules incrementally, especially when it's a JavaScript-to-TypeScript conversion. I'm leaning towards duplicating the schema, via this change in package.json files: - "@typescript-eslint/ban-ts-comment": "error"
+ "@typescript-eslint/ban-ts-comment": [ "error", {
"ts-expect-error": true,
"ts-ignore": true,
"ts-check": true,
"ts-nocheck": true
} ] |
I agree with the recommendation in the preceding recommendation. @zepumph sound OK to you? Who should implement? |
To clarify... 27 of the 28 occurrences of 1 occurrence is in keplers-laws. I don't know who added it, or what's appropriate for that repo. So the responsible developer should be consulted, or at least notified. |
Correction... scenery-phet has an unresolved - "@typescript-eslint/ban-ts-comment": "error"
+ "@typescript-eslint/ban-ts-comment": [ "error", {
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-check": true,
"ts-nocheck": true
} ] |
In the above commits, I configured @AgustinVallejo @jonathanolson FYI, there was 1 // @ts-expect-error eccentricities should be changed to a Map
const value = eccentricities[ eccentricitiesKey ]; ... and configured keplers-laws/package.json like this: "@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-check": true,
"ts-nocheck": true
}
] @AgustinVallejo or @jonathanolson after reviewing this change in keplers-law, you can close this isssue. |
Closing as that comment is no longer present in keplers laws |
From phetsims/phet-core#130 (comment), @pixelzoom said:
I'm seeing the same problem. I tested adding this
ts-expect-error
in geometric optics:And I confirmed it has
"@typescript-eslint/ban-ts-comment": "error"
in the package.json. Lint is not catching thets-expect-error
. I saw that it overridesno-explicit-any
and that correctly catchesany
types.I also saw that changing package.json like so correctly catches the errors:
So my current hypothesis is that lint has trouble overriding a "structured" value. I also wonder if this may be corrected in a newer version of lint.
NOTE: A reminder to disable lint cache while experimenting with rule changes:
grunt lint --disable-eslint-cache
@pixelzoom how do you recommend to proceed?
The text was updated successfully, but these errors were encountered: