-
Notifications
You must be signed in to change notification settings - Fork 9
CARDS:2797: Enforce various useful ESLint rules #2137
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
base: max-len
Are you sure you want to change the base?
Conversation
|
DRAFT |
377804d to
fad766b
Compare
| setters["local"](phase); | ||
| } | ||
| if (setters.hasOwnProperty("remote")) { | ||
| if (Object.prototype.hasOwnProperty.call(setters, "remote")) { |
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.
All these hasOwnProperty calls look like ancient code... For example here, can't we just replace lines 108-110 with
setters["remote"]?.(phase);
?
Similar approaches for all the other occurrences.
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.
Linter told to replace such if hasOwnProperty is used, your suggestion is better ofcourse
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.
This commit should be pulled in a separate PR, it would be merged immediately.
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.
This commit fixes 3 actual bugs and should be made into a separate PR for immediate merge.
fad766b to
1943a77
Compare
| onClick={(e) => { | ||
| disableDropdownItemLink && setSearch(result.entityIdentifier); | ||
| onSelect(e, result, props); | ||
| onSelect ? onSelect(e, result, props) : defaultRedirect(e, result, props); |
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.
Just curious, does this shorter version work?
(onSelect ?? defaultRedirect)(e, result, props);
1943a77 to
c33fa07
Compare
Added an ESLint recommended rules Turned off no-undef and no-extra-boolean-cast rules
Fixed react-hooks/rules-of-hooks rule
- Migrated deprecated core ESLint codestyle rules to the @stylistic/eslint-plugin - Fixed emerged codestyle errors - Extend recommended rules via spreading - Removed js from commonPlugins because @eslint/js is not a plugin in flat config - Added jsxA11y to plugins for future use
Extended on react.configs.recommended.rules Removed react duplicated rules that are already included in recommended set
Extended rules on accessibility rules jsxA11y.configs.recommended.rules
Added react rule to report unused prop types
Added stylistic rule to monitor extra semicolimn
c33fa07 to
33584e5
Compare
No description provided.