Skip to content

Commit a76587d

Browse files
committed
Fix eslint errors after upgrade
1 parent 4ff0a18 commit a76587d

File tree

4 files changed

+54
-43
lines changed

4 files changed

+54
-43
lines changed

eslint.config.mjs

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,51 @@ import eslint from '@eslint/js';
22
import tseslint from 'typescript-eslint';
33
import importPlugin from 'eslint-plugin-import';
44

5-
export default tseslint.config({
6-
extends: [
7-
eslint.configs.recommended,
8-
importPlugin.flatConfigs.errors,
9-
importPlugin.flatConfigs.warnings,
10-
tseslint.configs.recommended,
11-
importPlugin.flatConfigs.typescript,
12-
],
13-
rules: {
14-
"import/default": 0,
15-
"import/no-named-as-default-member": 0,
16-
"import/named": 2,
17-
"import/order": [
18-
2,
19-
{
20-
alphabetize: {
21-
order: "asc",
22-
caseInsensitive: true,
23-
},
24-
}
5+
export default tseslint.config([
6+
{
7+
ignores: [
8+
"**/*.pb.ts",
9+
"**/*.js",
10+
"**/*.mjs"
2511
],
26-
"@typescript-eslint/explicit-module-boundary-types": 0,
27-
"@typescript-eslint/no-explicit-any": 0,
28-
"@typescript-eslint/ban-ts-comment": 0,
29-
"import/no-named-as-default": 0,
30-
"@typescript-eslint/switch-exhaustiveness-check": "error",
31-
"import/no-unresolved": 0,
3212
},
33-
ignores: ["**/*.pb.ts"],
34-
languageOptions: {
35-
ecmaVersion: 5,
36-
sourceType: "script",
37-
parserOptions: {
38-
project: "./tsconfig.json",
13+
{
14+
extends: [
15+
eslint.configs.recommended,
16+
importPlugin.flatConfigs.errors,
17+
importPlugin.flatConfigs.warnings,
18+
tseslint.configs.recommended,
19+
importPlugin.flatConfigs.typescript,
20+
],
21+
rules: {
22+
"import/default": 0,
23+
"import/no-named-as-default-member": 0,
24+
"import/named": 2,
25+
"import/order": [
26+
2,
27+
{
28+
alphabetize: {
29+
order: "asc",
30+
caseInsensitive: true,
31+
},
32+
}
33+
],
34+
"@typescript-eslint/explicit-module-boundary-types": 0,
35+
"@typescript-eslint/no-explicit-any": 0,
36+
"@typescript-eslint/ban-ts-comment": 0,
37+
"import/no-named-as-default": 0,
38+
"@typescript-eslint/switch-exhaustiveness-check": ["error",
39+
{
40+
"considerDefaultExhaustiveForUnions": true
41+
}],
42+
"import/no-unresolved": 0,
3943
},
40-
},
41-
});
44+
languageOptions: {
45+
ecmaVersion: 5,
46+
sourceType: "script",
47+
parserOptions: {
48+
project: "./tsconfig.json",
49+
},
50+
},
51+
}
52+
]);

ui/components/AddKustomizationForm.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ type Props = {
2121
loading: boolean;
2222
};
2323

24-
const defaultInitialState = () => ({
25-
name: "",
26-
namespace: "",
27-
source: "",
28-
path: "",
29-
});
30-
31-
type FormState = ReturnType<typeof defaultInitialState>;
24+
type FormState = {
25+
name: "";
26+
namespace: "";
27+
source: "";
28+
path: "";
29+
};
3230

3331
function AddKustomizationForm({
3432
className,

ui/components/ReconciliationGraph.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import Spacer from "./Spacer";
1414
// https://github.com/parcel-bundler/parcel/issues/8792
1515
// https://github.com/weaveworks/weave-gitops/issues/3672
1616
// Theory: this is tricking parcel into correctly importing d3. :shrug:
17+
// TODO: Investigate if this can be removed safely via a component upgrade path
18+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
1719
d3;
1820

1921
interface Props {

ui/lib/objects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export class HelmRelease extends FluxObject {
262262
super(response);
263263
try {
264264
this.inventory = response.inventory || [];
265-
} catch (error) {
265+
} catch {
266266
this.inventory = [];
267267
}
268268
}

0 commit comments

Comments
 (0)