-
Notifications
You must be signed in to change notification settings - Fork 75
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
eslint config with typescript support, some basic rules #860
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s variable since 2019, not used :)
…slint/parser eslint eslint-config-prettier eslint-plugin-react typescript
the config is really just the defaults, globals and plugins, and then disabling any rules that generates warnings for now so that we can enable eslint, and then fix individual rules in separate PRs
/home/himdel/ansible-hub-ui/config/webpack.base.config.js 1:11 error 'require' is already defined as a built-in global variable no-redeclare 1:20 error 'module' is already defined as a built-in global variable no-redeclare 1:28 error '__dirname' is already defined as a built-in global variable no-redeclare /home/himdel/ansible-hub-ui/src/components/collection-list/collection-filter.tsx 49:34 error Expected a `const` instead of a literal type assertion @typescript-eslint/prefer-as-const /home/himdel/ansible-hub-ui/src/components/empty-state/empty-state-unauthorized.tsx 7:11 error An empty interface is equivalent to `{}` @typescript-eslint/no-empty-interface /home/himdel/ansible-hub-ui/src/components/repositories/remote-repository-table.tsx 46:14 error Empty block statement no-empty /home/himdel/ansible-hub-ui/src/containers/execution-environment-detail/execution_environment_detail_activities.tsx 72:39 error Unexpected empty arrow function @typescript-eslint/no-empty-function /home/himdel/ansible-hub-ui/src/index.d.ts 11:1 error Unexpected var, use let or const instead no-var 12:1 error Unexpected var, use let or const instead no-var 13:1 error Unexpected var, use let or const instead no-var 14:1 error Unexpected var, use let or const instead no-var 15:1 error Unexpected var, use let or const instead no-var 16:1 error Unexpected var, use let or const instead no-var 17:1 error Unexpected var, use let or const instead no-var /home/himdel/ansible-hub-ui/src/loaders/insights/insights-loader.js 26:5 error 'insights' is not defined no-undef 27:5 error 'insights' is not defined no-undef 32:19 error 'insights' is not defined no-undef 60:5 error 'insights' is not defined no-undef
ZitaNemeckova
approved these changes
Dec 7, 2021
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.
LGTM 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This re-enables eslint, making
npm run lint:js
run both eslint and prettier,configures it to use the typescript-capable
@typescript-eslint/parser
,starts off with
eslint:recommended
,react/recommended
,@typescript-eslint/recommended
andprettier
rules,and for now just disables anything that creates errors, as we can address individual rules in follow-up PRs
(except a couple of single-file issues fixed manually here)
(The current config generated too many errors, we can add individual rules as needed in separate PRs as well, leaving in a reminder comment for now.)