Skip to content

Commit

Permalink
Merge pull request #1930 from manaswinidas/enforce-eqeqeq
Browse files Browse the repository at this point in the history
Enforce strict equality operator
  • Loading branch information
openshift-ci[bot] authored Oct 11, 2023
2 parents 970fc27 + 8cc06ab commit c8595db
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
19 changes: 10 additions & 9 deletions backend/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"tsconfigRootDir": "."
},
// includes the typescript specific rules found here: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand All @@ -32,13 +30,16 @@
"process": "readonly",
"document": "readonly"
},
"settings": {
},
"settings": {},
"rules": {
"no-restricted-properties": [ "error", {
"property": "toString",
"message": "e.toString() should be fastify.log.error(e, 'your string'). Other use-cases should avoid obj.toString() on principle. Craft the string you want instead."
}],
"eqeqeq": ["error", "always", { "null": "ignore" }],
"no-restricted-properties": [
"error",
{
"property": "toString",
"message": "e.toString() should be fastify.log.error(e, 'your string'). Other use-cases should avoid obj.toString() on principle. Craft the string you want instead."
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-var-requires": "off",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/routes/api/gpu/gpuUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getGPUNumber = async (fastify: KubeFastifyInstance): Promise<GPUInf
return { items: [] } as V1PodList;
});
const scalingLimit = await getGPUScaling(fastify);
if (gpuPodList.items.length != 0 && fastify.kube.currentToken) {
if (gpuPodList.items.length !== 0 && fastify.kube.currentToken) {
areGpusConfigured = true;
const gpuDataResponses = [];
for (let i = 0; i < gpuPodList.items.length; i++) {
Expand All @@ -61,7 +61,7 @@ export const getGPUNumber = async (fastify: KubeFastifyInstance): Promise<GPUInf
}
}
});
} else if (scalingLimit.length != 0) {
} else if (scalingLimit.length !== 0) {
areGpusConfigured = true;
}

Expand Down
1 change: 1 addition & 0 deletions frontend/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"curly": "error",
"camelcase": "warn",
"no-else-return": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"no-restricted-imports": [
"error",
{
Expand Down
18 changes: 6 additions & 12 deletions frontend/src/pages/BYONImages/UpdateImageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,19 @@ export const UpdateImageModal: React.FC<UpdateImageModalProps> = ({
onCloseHandler,
}) => {
const [name, setName] = React.useState<string>(image.name);
const [description, setDescription] = React.useState<string>(
image.description != undefined ? image.description : '',
);
const [packages, setPackages] = React.useState<BYONImagePackage[]>(
image.packages != undefined ? image.packages : [],
);
const [software, setSoftware] = React.useState<BYONImagePackage[]>(
image.software != undefined ? image.software : [],
);
const [description, setDescription] = React.useState<string>(image.description ?? '');
const [packages, setPackages] = React.useState<BYONImagePackage[]>(image.packages ?? []);
const [software, setSoftware] = React.useState<BYONImagePackage[]>(image.software ?? []);
const [activeTabKey, setActiveTabKey] = React.useState(0);
const [validName, setValidName] = React.useState(true);
const dispatch = useAppDispatch();

React.useEffect(() => {
if (isOpen === true) {
setName(image.name);
setDescription(image.description != undefined ? image.description : '');
setPackages(image.packages != undefined ? image.packages : []);
setSoftware(image.software != undefined ? image.software : []);
setDescription(image.description ?? '');
setPackages(image.packages ?? []);
setSoftware(image.software ?? []);
setValidName(true);
}
// Only update when isOpen is updated to true
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/learningCenter/CategoryFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const CategoryFilters: React.FC<CategoryFiltersProps> = ({ docApps, favorites })
key={category}
title={category}
shown
active={category === categoryQuery || (!categoryQuery && category == ALL_ITEMS)}
active={category === categoryQuery || (!categoryQuery && category === ALL_ITEMS)}
onActivate={() => onSelectCategory(category)}
tabIndex={-1}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilities/useFetchState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const isCommonStateError = (e: Error) => {
// Re-compute your callback to re-trigger again
return true;
}
if (e.name == 'AbortError') {
if (e.name === 'AbortError') {
// Abort errors are silent
return true;
}
Expand Down

0 comments on commit c8595db

Please sign in to comment.