Skip to content

Commit

Permalink
Adding eslint (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Martinez Gotor committed Jul 24, 2020
1 parent 7839595 commit 2445d01
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@
"lint-js-fix": "tslint -c ./tslint.ci.json --fix 'src/**/*.{ts,tsx}'",
"lint-css": "stylelint --config ./.stylelintrc.json 'src/**/*.scss'",
"lint-css-fix": "stylelint --config ./.stylelintrc.json --fix 'src/**/*.scss'",
"lint": "npm-run-all lint-js lint-css",
"eslint": "eslint '**/*.{ts,tsx}' --ignore-pattern '**/*.d.ts' --max-warnings=0",
"eslint-fix": "eslint '**/*.{ts,tsx}' --ignore-pattern '**/*.d.ts' --fix --max-warnings=0",
"lint": "npm-run-all lint-js lint-css eslint",
"ts-compile-check": "tsc -p tsconfig.json --noEmit"
},
"lint-staged": {
"*.{ts,tsx}": [
"yarn run lint-js-fix",
"yarn run eslint-fix",
"prettier --write",
"git add"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function AccessURLTable({ ingressRefs, serviceRefs }: IAccessURLT
// Fetch all related Ingress resources. We don't need to fetch Services as
// they are expected to be watched by the ServiceTable.
ingressRefs.forEach(r => dispatch(actions.kube.getResource(r)));
}, [ingressRefs]);
}, [dispatch, ingressRefs]);
const ingresses = useSelector((state: IStoreState) =>
flattenResources(ingressRefs, state.kube.items),
) as Array<IKubeItem<IResource>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const defaultProps = {
params: [
{
path: "configuration",
value: "First line\n" + "Second line",
value: "First line\nSecond line",
render: "textArea",
} as IBasicFormParam,
],
Expand Down Expand Up @@ -118,7 +118,7 @@ const defaultProps = {
);
expect(wrapper).toMatchSnapshot();

t.params.map((param, i) => {
t.params.forEach((param, i) => {
wrapper.find(`input#${param.path}-${i}`).simulate("change");
const mockCalls = handleBasicFormParamChange.mock.calls;
expect(mockCalls[i]).toEqual([param]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ it("should set the input value as empty if a string parameter value is not defin

const textAreaParam = {
path: "configuration",
value: "First line\n" + "Second line",
value: "First line\nSecond line",
type: "string",
} as IBasicFormParam;
const textAreaProps = {
Expand Down Expand Up @@ -92,7 +92,7 @@ it("should forward the proper value when using a textArea parameter", () => {
expect(handleBasicFormParamChange.mock.calls[0][0]).toEqual({
path: "configuration",
type: "string",
value: "First line\n" + "Second line",
value: "First line\nSecond line",
});
expect(handler.mock.calls[0][0]).toMatchObject(event);
});
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/Header/ContextSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function ContextSelector({
if (namespaceSelected !== definedNamespaces.all) {
getNamespace(clusters.currentCluster, namespaceSelected);
}
}, [fetchNamespaces, namespaceSelected, getNamespace]);
}, [fetchNamespaces, namespaceSelected, getNamespace, clusters.currentCluster]);

const toggleOpen = () => setOpen(!open);
const selectCluster = (event: React.ChangeEvent<HTMLSelectElement>) =>
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/LoginForm/LoginForm.v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function LoginForm(props: ILoginFormProps) {
if (oauthLoginURI) {
checkCookieAuthentication(props.cluster);
}
}, [oauthLoginURI, checkCookieAuthentication]);
}, [oauthLoginURI, checkCookieAuthentication, props.cluster]);

if (props.authenticating) {
return <LoadingWrapper />;
Expand Down

0 comments on commit 2445d01

Please sign in to comment.