Fix eslint#33002
Conversation
9bc494a to
327ea77
Compare
* giteaofficial/main: Refactor pagination (go-gitea#33037) Test webhook email (go-gitea#33033) Fix review code comment avatar alignment (go-gitea#33031) Fix templating in pull request comparison (go-gitea#33025) Refactor tests (go-gitea#33021) [skip ci] Updated translations via Crowdin always show assignees on right (go-gitea#33006) fix toggle commit body button ui when latest commit message is long (go-gitea#32997) Fix and/or comment some legacy CSS problems (go-gitea#33015) Refactor comment history and fix content edit (go-gitea#33018) Fix bug on activities (go-gitea#33008) Refactor arch route handlers (go-gitea#32993) fix scoped label ui when contains emoji (go-gitea#33007) [skip ci] Updated translations via Crowdin De-emphasize signed commits (go-gitea#31160) Fix eslint (go-gitea#33002) Fix Agit pull request permission check (go-gitea#32999) Support for email addresses containing uppercase characters when activating user account (go-gitea#32998)
| 'no-throw-literal': [2], | ||
| 'no-undef-init': [2], | ||
| 'no-undef': [0], | ||
| 'no-undef': [2], // it is still needed by eslint & IDE to prompt undefined names in real time |
There was a problem hiding this comment.
I don't think it's correct to have it enabled as per https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors.
There was a problem hiding this comment.
I do think it is correct to have it enabled at the moment, otherwise IDE (I am using GoLand) won't report errors, which makes difficult write correct code (for example, remove import $)
There was a problem hiding this comment.
Pretty sure that's a problem with your IDE. Definitely if the CLI error reporting is different from your IDE.
As for JetBrains IDEs: Isn't one supposed to use WebStorm or something for Typescript?
There was a problem hiding this comment.
As for JetBrains IDEs: Isn't one supposed to use WebStorm or something for Typescript?
The lint result comes from eslint CLI.
There was a problem hiding this comment.
Or, could you show how to correctly lint the "undefined $" errors? You could just remove the import $ from a JS file, and try to see whether there is any lint error (either from eslint or other tools)
There was a problem hiding this comment.
What do you expect when removing import $? The global to work, so it not raises an error?
There was a problem hiding this comment.
What do you expect when removing
import $? The global to work, so it not raises an error?
It should raise an error, there is no global $
There was a problem hiding this comment.
Right, it should as there is no global defined here and env.jquery is also not set:
Lines 51 to 54 in 6410c34
I will check later why it does not error.
Fix #32982
Related #32869