Skip to content

Commit

Permalink
Merge pull request #5297 from mabashian/eslint-plugin-react-hooks
Browse files Browse the repository at this point in the history
Adds eslint-plugin-react-hooks as a dev dep

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] committed Nov 11, 2019
2 parents 84b5fb8 + 68a6315 commit b0cb3ca
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 6 deletions.
7 changes: 6 additions & 1 deletion awx/ui_next/.eslintrc
Expand Up @@ -8,6 +8,9 @@
"modules": true
}
},
"plugins": [
"react-hooks"
],
"extends": ["airbnb", "prettier", "prettier/react"],
"settings": {
"import/resolver": {
Expand Down Expand Up @@ -56,6 +59,8 @@
"react/prop-types": "off",
"react/sort-comp": ["error", {}],
"jsx-a11y/label-has-for": "off",
"jsx-a11y/label-has-associated-control": "off"
"jsx-a11y/label-has-associated-control": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
6 changes: 6 additions & 0 deletions awx/ui_next/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions awx/ui_next/package.json
Expand Up @@ -43,6 +43,7 @@
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-hooks": "^2.2.0",
"file-loader": "^2.0.0",
"history": "^4.9.0",
"jest": "^24.7.1",
Expand Down
Expand Up @@ -19,7 +19,7 @@ function ExpandingContainer({ isExpanded, children }) {
});
useEffect(() => {
setContentHeight(ref.current.scrollHeight);
});
}, [setContentHeight]);
const height = isExpanded ? contentHeight : '0';
return (
<Container
Expand Down
2 changes: 1 addition & 1 deletion awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx
Expand Up @@ -120,7 +120,7 @@ function HostEventModal({ onClose, hostEvent = {}, isOpen = false, i18n }) {

useEffect(() => {
setHostStatus(processEventStatus(hostEvent));
}, []);
}, [setHostStatus, hostEvent]);

const handleTabClick = (event, tabIndex) => {
setActiveTabKey(tabIndex);
Expand Down
2 changes: 1 addition & 1 deletion awx/ui_next/src/screens/Project/shared/ProjectForm.jsx
Expand Up @@ -108,7 +108,7 @@ function ProjectForm({ project, ...props }) {
}

fetchData();
}, []);
}, [summary_fields.credential]);

const scmFormFields = {
scm_url: '',
Expand Down
2 changes: 1 addition & 1 deletion awx/ui_next/src/screens/Template/shared/LabelSelect.jsx
Expand Up @@ -33,7 +33,7 @@ function LabelSelect({ value, onChange, onError }) {
const [options, setOptions] = useState([]);
useEffect(() => {
loadLabelOptions(setOptions, onError);
}, []);
}, [onError]);

return (
<MultiSelect
Expand Down
2 changes: 1 addition & 1 deletion awx/ui_next/src/screens/Template/shared/PlaybookSelect.jsx
Expand Up @@ -39,7 +39,7 @@ function PlaybookSelect({
onError(contentError);
}
})();
}, [projectId]);
}, [projectId, i18n, onError]);

return (
<AnsibleSelect
Expand Down

0 comments on commit b0cb3ca

Please sign in to comment.