-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Change eslint configuration and fix resulting issues #4423
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6701516
Remove app/service/query-string (unused) and its dependency.
arikfr cf6d780
Fix usage of mixed operators.
arikfr 0d4730d
eslint --fix fixes for missing dependencies for react hooks
arikfr fd7d19a
Fix: useCallback dependency passed to $http's .catch.
arikfr 619baf4
Satisfy react/no-direct-mutation-state.
arikfr 01c9e36
Fix no-mixed-operators violations.
arikfr 32e4a7e
Move the decision of whether to render Custom chart one level up to m…
arikfr 6c676f9
Fix: name was undefined. It wasn't detected before because there is s…
arikfr c207ec0
Simplify eslint config and switch to creat-react-app's eslint base.
arikfr b25c229
Add prettier config.
arikfr 3d6665b
Make sure eslint doesn't conflict with prettier
arikfr 5936249
A few updates post eslint (#4425)
gabrieldutra 5be44d2
Prettier command in package.json
arikfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/*.js | ||
dist | ||
config/*.js | ||
client/dist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,17 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["airbnb", "plugin:compat/recommended"], | ||
extends: ["react-app", "plugin:compat/recommended", "prettier"], | ||
plugins: ["jest", "compat", "no-only-tests"], | ||
settings: { | ||
"import/resolver": "webpack" | ||
}, | ||
parser: "babel-eslint", | ||
env: { | ||
browser: true, | ||
node: true | ||
}, | ||
rules: { | ||
// allow debugger during development | ||
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0, | ||
"no-param-reassign": 0, | ||
"no-mixed-operators": 0, | ||
"no-underscore-dangle": 0, | ||
"no-use-before-define": ["error", "nofunc"], | ||
"prefer-destructuring": "off", | ||
"prefer-template": "off", | ||
"no-restricted-properties": "off", | ||
"no-restricted-globals": "off", | ||
"no-multi-assign": "off", | ||
"no-lonely-if": "off", | ||
"consistent-return": "off", | ||
"no-control-regex": "off", | ||
"no-multiple-empty-lines": "warn", | ||
"no-only-tests/no-only-tests": "error", | ||
"operator-linebreak": "off", | ||
"react/destructuring-assignment": "off", | ||
"react/jsx-filename-extension": "off", | ||
"react/jsx-one-expression-per-line": "off", | ||
"react/jsx-uses-react": "error", | ||
"react/jsx-uses-vars": "error", | ||
"react/jsx-wrap-multilines": "warn", | ||
"react/no-access-state-in-setstate": "warn", | ||
"react/prefer-stateless-function": "warn", | ||
"react/forbid-prop-types": "warn", | ||
"react/prop-types": "warn", | ||
"jsx-a11y/anchor-is-valid": "off", | ||
"jsx-a11y/click-events-have-key-events": "off", | ||
"jsx-a11y/label-has-associated-control": [ | ||
"warn", | ||
{ | ||
controlComponents: true | ||
} | ||
], | ||
"jsx-a11y/label-has-for": "off", | ||
"jsx-a11y/no-static-element-interactions": "off", | ||
"max-len": [ | ||
"error", | ||
120, | ||
2, | ||
{ | ||
ignoreUrls: true, | ||
ignoreComments: false, | ||
ignoreRegExpLiterals: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true | ||
} | ||
], | ||
"no-else-return": ["error", { allowElseIf: true }], | ||
"object-curly-newline": ["error", { consistent: true }] | ||
} | ||
}; |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ function useGrantees(url) { | |
|
||
const addPermission = useCallback((userId, accessType = 'modify') => $http.post( | ||
url, { access_type: accessType, user_id: userId }, | ||
).catch(() => notification.error('Could not grant permission to the user'), [url])); | ||
).catch(() => notification.error('Could not grant permission to the user')), [url]); | ||
|
||
const removePermission = useCallback((userId, accessType = 'modify') => $http.delete( | ||
url, { data: { access_type: accessType, user_id: userId } }, | ||
|
@@ -77,7 +77,7 @@ function UserSelect({ onSelect, shouldShowUser }) { | |
useEffect(() => { | ||
setLoadingUsers(true); | ||
debouncedSearchUsers(searchTerm); | ||
}, [searchTerm]); | ||
}, [debouncedSearchUsers, searchTerm]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably it should be replaced with |
||
|
||
return ( | ||
<Select | ||
|
@@ -117,16 +117,16 @@ function PermissionsEditorDialog({ dialog, author, context, aclUrl }) { | |
.then(setGrantees) | ||
.catch(() => notification.error('Failed to load grantees list')) | ||
.finally(() => setLoadingGrantees(false)); | ||
}, []); | ||
}, [loadGrantees]); | ||
|
||
const userHasPermission = useCallback( | ||
user => (user.id === author.id || !!get(find(grantees, { id: user.id }), 'accessType')), | ||
[grantees], | ||
[author.id, grantees], | ||
); | ||
|
||
useEffect(() => { | ||
loadUsersWithPermissions(); | ||
}, [aclUrl]); | ||
}, [aclUrl, loadUsersWithPermissions]); | ||
|
||
return ( | ||
<Modal | ||
|
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
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
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.
👍