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 #4276
Conversation
Disabled "@typescript-eslint/no-non-null-assertion": not compatible with DOM Disabled " @typescript-eslint/no-non-null-asserted-optional-chain" See #3093 (comment) and #3168 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What fixed .closest
’s types?
.xo-config.json
Outdated
@@ -16,6 +16,8 @@ | |||
"no-void": "off", | |||
"react/jsx-key": "off", | |||
"unicorn/no-array-callback-reference": "off", | |||
"@typescript-eslint/no-non-null-assertion": "off", | |||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem again? It worked until now and typescript-eslint/typescript-eslint#1976 was resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Sindre re-enabled them they're probably working now, so maybe our code is wrong.
The only reason I can think of to disable these are if the changes required just clutter the code without actually improving it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@typescript-eslint/no-non-null-assertion
is correct in being disabled, we need those errors.
I'm checking the other one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@typescript-eslint/no-non-null-asserted-optional-chain
should probably not be disabled.
However I'm not liking most of the type changes in this PR so I'd rather avoid all of them until a TS developer can review them properly.
If you're going to update XO:
- disable
no-unsafe-argument
+ a TODO to review later - disable
no-non-null-asserted-optional-chain
+ same TODO - disable
no-non-null-assertion
with a comment that we need those runtime errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fregante in case you missed this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find a JSON to YML converter and rename the file to .yml
instead of .json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That did not work.
I am going to revert the Type's and just update dep excluding xo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I assumed it worked since ESLint supports it: xojs/xo#536
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using a JSON file which makes it not possible to leave a comment.
That's not entirely true: https://github.com/sindresorhus/sindre-playground/blob/565ba9c61dbf4b13d587bcae7047120952f924c5/package.json#L26-L31
There are a million type issues, can't open a PR and ask me to fix them. Just leave things unchanged |
Sorry I wanted to update the first post I did not think you would review so fast 😄 |
Its not fixed. |
I see that |
I am going to work on it. That part is not ready yet. |
I wish could could change some global types, but adding this to global.d.ts doesn't work 😩 interface Object {
keysa<T, K extends keyof T>(o: T): K[];
}
interface JSON {
parse(text: string, reviver?: (this: any, key: string, value: any) => any): JsonValue;
}
// and also Response#json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the outstanding reviews, it looks good so far, except I haven't tested it
@@ -61,7 +61,7 @@ function getSingleButton(prNumber: number, _?: number, prs?: number[]): HTMLElem | |||
const getPrsByFile = cache.function(async (): Promise<Record<string, number[]>> => { | |||
const {repository} = await api.v4(` | |||
repository() { | |||
pullRequests( | |||
pullRequests ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added on purpose it looked wrong without a space and the arguments on a new line.
I can revert if you feel it wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do this anywhere in the code and also doesn't match the function call style in XO. Reverted
@fregante can we disable |
Ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good to go after this
Hey looks like the "disabled" feature was removed. https://github.com/sindresorhus/refined-github/pull/3678/files#diff-cb1dafea7a9c68c5c2ebb2d56f749b3506c13f7d26feeaf56c86521b25c60358 🤔 |
Second bullet point in that PR #3678 Just comment out the |
Disabled "@typescript-eslint/no-non-null-assertion": not compatible with DOM
Disabled "@typescript-eslint/no-non-null-asserted-optional-chain" See #3093 (comment) and #3168 (comment)
Need typescript help
@typescript-eslint/no-unsafe-argument
All but 2 are this issue. If you show me how to fix one I can do the rest.