mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint: comma-spacing (error) & comma-dangle (error) (#4200)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
02e77afcd1
commit
c6dce043a7
406 files changed
+1590
-1580
No files matched your search
@@ -34,8 +34,8 @@ class TestCatalogCategory extends CatalogCategory {
|
||||
group: "entity.k8slens.dev",
|
||||
versions: [],
|
||||
names: {
|
||||
kind: "Test"
|
||||
}
|
||||
kind: "Test",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ class TestCatalogCategory2 extends CatalogCategory {
|
||||
group: "entity.k8slens.dev",
|
||||
versions: [],
|
||||
names: {
|
||||
kind: "Test2"
|
||||
}
|
||||
kind: "Test2",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ jest.mock("electron", () => ({
|
||||
removeAllListeners: jest.fn(),
|
||||
off: jest.fn(),
|
||||
send: jest.fn(),
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
AppPaths.init();
|
||||
@@ -95,8 +95,8 @@ describe("empty config", () => {
|
||||
ClusterStore.resetInstance();
|
||||
const mockOpts = {
|
||||
"tmp": {
|
||||
"lens-cluster-store.json": JSON.stringify({})
|
||||
}
|
||||
"lens-cluster-store.json": JSON.stringify({}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -117,10 +117,10 @@ describe("empty config", () => {
|
||||
preferences: {
|
||||
terminalCWD: "/tmp",
|
||||
icon: "data:image/jpeg;base64, iVBORw0KGgoAAAANSUhEUgAAA1wAAAKoCAYAAABjkf5",
|
||||
clusterName: "minikube"
|
||||
clusterName: "minikube",
|
||||
},
|
||||
kubeConfigPath: embed("foo", kubeconfig)
|
||||
})
|
||||
kubeConfigPath: embed("foo", kubeconfig),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -141,17 +141,17 @@ describe("empty config", () => {
|
||||
id: "prod",
|
||||
contextName: "foo",
|
||||
preferences: {
|
||||
clusterName: "prod"
|
||||
clusterName: "prod",
|
||||
},
|
||||
kubeConfigPath: embed("prod", kubeconfig)
|
||||
kubeConfigPath: embed("prod", kubeconfig),
|
||||
});
|
||||
store.addCluster({
|
||||
id: "dev",
|
||||
contextName: "foo2",
|
||||
preferences: {
|
||||
clusterName: "dev"
|
||||
clusterName: "dev",
|
||||
},
|
||||
kubeConfigPath: embed("dev", kubeconfig)
|
||||
kubeConfigPath: embed("dev", kubeconfig),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -177,8 +177,8 @@ describe("config with existing clusters", () => {
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "99.99.99"
|
||||
}
|
||||
version: "99.99.99",
|
||||
},
|
||||
},
|
||||
clusters: [
|
||||
{
|
||||
@@ -186,13 +186,13 @@ describe("config with existing clusters", () => {
|
||||
kubeConfigPath: "./temp-kube-config",
|
||||
contextName: "foo",
|
||||
preferences: { terminalCWD: "/foo" },
|
||||
workspace: "default"
|
||||
workspace: "default",
|
||||
},
|
||||
{
|
||||
id: "cluster2",
|
||||
kubeConfigPath: "./temp-kube-config",
|
||||
contextName: "foo2",
|
||||
preferences: { terminalCWD: "/foo2" }
|
||||
preferences: { terminalCWD: "/foo2" },
|
||||
},
|
||||
{
|
||||
id: "cluster3",
|
||||
@@ -200,11 +200,11 @@ describe("config with existing clusters", () => {
|
||||
contextName: "foo",
|
||||
preferences: { terminalCWD: "/foo" },
|
||||
workspace: "foo",
|
||||
ownerRef: "foo"
|
||||
ownerRef: "foo",
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -265,8 +265,8 @@ users:
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "99.99.99"
|
||||
}
|
||||
version: "99.99.99",
|
||||
},
|
||||
},
|
||||
clusters: [
|
||||
{
|
||||
@@ -281,12 +281,12 @@ users:
|
||||
kubeConfigPath: "./valid-kube-config",
|
||||
contextName: "foo",
|
||||
preferences: { terminalCWD: "/foo" },
|
||||
workspace: "default"
|
||||
workspace: "default",
|
||||
},
|
||||
|
||||
]
|
||||
})
|
||||
}
|
||||
],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -326,7 +326,7 @@ const minimalValidKubeConfig = JSON.stringify({
|
||||
user: {
|
||||
"client-certificate": "/Users/foo/.minikube/client.crt",
|
||||
"client-key": "/Users/foo/.minikube/client.key",
|
||||
}
|
||||
},
|
||||
}],
|
||||
kind: "Config",
|
||||
preferences: {},
|
||||
@@ -340,12 +340,12 @@ describe("pre 2.0 config with an existing cluster", () => {
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "1.0.0"
|
||||
}
|
||||
version: "1.0.0",
|
||||
},
|
||||
},
|
||||
cluster1: minimalValidKubeConfig,
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -372,8 +372,8 @@ describe("pre 2.6.0 config with a cluster that has arrays in auth config", () =>
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "2.4.1"
|
||||
}
|
||||
version: "2.4.1",
|
||||
},
|
||||
},
|
||||
cluster1: {
|
||||
kubeConfig: JSON.stringify({
|
||||
@@ -403,19 +403,19 @@ describe("pre 2.6.0 config with a cluster that has arrays in auth config", () =>
|
||||
"auth-provider": {
|
||||
config: {
|
||||
"access-token": [
|
||||
"should be string"
|
||||
"should be string",
|
||||
],
|
||||
expiry: [
|
||||
"should be string"
|
||||
"should be string",
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}]
|
||||
}],
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -445,19 +445,19 @@ describe("pre 2.6.0 config with a cluster icon", () => {
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "2.4.1"
|
||||
}
|
||||
version: "2.4.1",
|
||||
},
|
||||
},
|
||||
cluster1: {
|
||||
kubeConfig: minimalValidKubeConfig,
|
||||
icon: "icon_path",
|
||||
preferences: {
|
||||
terminalCWD: "/tmp"
|
||||
}
|
||||
terminalCWD: "/tmp",
|
||||
},
|
||||
},
|
||||
}),
|
||||
"icon_path": testDataIcon,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -486,17 +486,17 @@ describe("for a pre 2.7.0-beta.0 config without a workspace", () => {
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "2.6.6"
|
||||
}
|
||||
version: "2.6.6",
|
||||
},
|
||||
},
|
||||
cluster1: {
|
||||
kubeConfig: minimalValidKubeConfig,
|
||||
preferences: {
|
||||
terminalCWD: "/tmp"
|
||||
}
|
||||
terminalCWD: "/tmp",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -517,8 +517,8 @@ describe("pre 3.6.0-beta.1 config with an existing cluster", () => {
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "3.5.0"
|
||||
}
|
||||
version: "3.5.0",
|
||||
},
|
||||
},
|
||||
clusters: [
|
||||
{
|
||||
@@ -527,12 +527,12 @@ describe("pre 3.6.0-beta.1 config with an existing cluster", () => {
|
||||
contextName: "cluster",
|
||||
preferences: {
|
||||
icon: "store://icon_path",
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
"icon_path": testDataIcon,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
@@ -33,25 +33,25 @@ jest.mock("../../main/catalog/catalog-entity-registry", () => ({
|
||||
metadata: {
|
||||
uid: "1dfa26e2ebab15780a3547e9c7fa785c",
|
||||
name: "mycluster",
|
||||
source: "local"
|
||||
}
|
||||
source: "local",
|
||||
},
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
uid: "55b42c3c7ba3b04193416cda405269a5",
|
||||
name: "my_shiny_cluster",
|
||||
source: "remote"
|
||||
}
|
||||
source: "remote",
|
||||
},
|
||||
},
|
||||
{
|
||||
metadata: {
|
||||
uid: "catalog-entity",
|
||||
name: "Catalog",
|
||||
source: "app"
|
||||
source: "app",
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
}));
|
||||
|
||||
const testCluster = {
|
||||
@@ -60,7 +60,7 @@ const testCluster = {
|
||||
apiVersion: "v1",
|
||||
kind: "Cluster",
|
||||
status: {
|
||||
phase: "Running"
|
||||
phase: "Running",
|
||||
},
|
||||
spec: {},
|
||||
getName: jest.fn(),
|
||||
@@ -71,8 +71,8 @@ const testCluster = {
|
||||
metadata: {
|
||||
uid: "test",
|
||||
name: "test",
|
||||
labels: {}
|
||||
}
|
||||
labels: {},
|
||||
},
|
||||
};
|
||||
|
||||
const minikubeCluster = {
|
||||
@@ -81,7 +81,7 @@ const minikubeCluster = {
|
||||
apiVersion: "v1",
|
||||
kind: "Cluster",
|
||||
status: {
|
||||
phase: "Running"
|
||||
phase: "Running",
|
||||
},
|
||||
spec: {},
|
||||
getName: jest.fn(),
|
||||
@@ -92,8 +92,8 @@ const minikubeCluster = {
|
||||
metadata: {
|
||||
uid: "minikube",
|
||||
name: "minikube",
|
||||
labels: {}
|
||||
}
|
||||
labels: {},
|
||||
},
|
||||
};
|
||||
|
||||
const awsCluster = {
|
||||
@@ -102,7 +102,7 @@ const awsCluster = {
|
||||
apiVersion: "v1",
|
||||
kind: "Cluster",
|
||||
status: {
|
||||
phase: "Running"
|
||||
phase: "Running",
|
||||
},
|
||||
spec: {},
|
||||
getName: jest.fn(),
|
||||
@@ -113,8 +113,8 @@ const awsCluster = {
|
||||
metadata: {
|
||||
uid: "aws",
|
||||
name: "aws",
|
||||
labels: {}
|
||||
}
|
||||
labels: {},
|
||||
},
|
||||
};
|
||||
|
||||
jest.mock("electron", () => ({
|
||||
@@ -139,8 +139,8 @@ describe("HotbarStore", () => {
|
||||
beforeEach(() => {
|
||||
mockFs({
|
||||
"tmp": {
|
||||
"lens-hotbar-store.json": JSON.stringify({})
|
||||
}
|
||||
"lens-hotbar-store.json": JSON.stringify({}),
|
||||
},
|
||||
});
|
||||
ClusterStore.createInstance();
|
||||
HotbarStore.createInstance();
|
||||
@@ -351,8 +351,8 @@ describe("HotbarStore", () => {
|
||||
"lens-hotbar-store.json": JSON.stringify({
|
||||
__internal__: {
|
||||
migrations: {
|
||||
version: "5.0.0-beta.3"
|
||||
}
|
||||
version: "5.0.0-beta.3",
|
||||
},
|
||||
},
|
||||
"hotbars": [
|
||||
{
|
||||
@@ -361,51 +361,51 @@ describe("HotbarStore", () => {
|
||||
"items": [
|
||||
{
|
||||
"entity": {
|
||||
"uid": "1dfa26e2ebab15780a3547e9c7fa785c"
|
||||
}
|
||||
"uid": "1dfa26e2ebab15780a3547e9c7fa785c",
|
||||
},
|
||||
},
|
||||
{
|
||||
"entity": {
|
||||
"uid": "55b42c3c7ba3b04193416cda405269a5"
|
||||
}
|
||||
"uid": "55b42c3c7ba3b04193416cda405269a5",
|
||||
},
|
||||
},
|
||||
{
|
||||
"entity": {
|
||||
"uid": "176fd331968660832f62283219d7eb6e"
|
||||
}
|
||||
"uid": "176fd331968660832f62283219d7eb6e",
|
||||
},
|
||||
},
|
||||
{
|
||||
"entity": {
|
||||
"uid": "61c4fb45528840ebad1badc25da41d14",
|
||||
"name": "user1-context",
|
||||
"source": "local"
|
||||
}
|
||||
"source": "local",
|
||||
},
|
||||
},
|
||||
{
|
||||
"entity": {
|
||||
"uid": "27d6f99fe9e7548a6e306760bfe19969",
|
||||
"name": "foo2",
|
||||
"source": "local"
|
||||
}
|
||||
"source": "local",
|
||||
},
|
||||
},
|
||||
null,
|
||||
{
|
||||
"entity": {
|
||||
"uid": "c0b20040646849bb4dcf773e43a0bf27",
|
||||
"name": "multinode-demo",
|
||||
"source": "local"
|
||||
}
|
||||
"source": "local",
|
||||
},
|
||||
},
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
null,
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
mockFs(mockOpts);
|
||||
@@ -436,16 +436,16 @@ describe("HotbarStore", () => {
|
||||
entity: {
|
||||
name: "mycluster",
|
||||
source: "local",
|
||||
uid: "1dfa26e2ebab15780a3547e9c7fa785c"
|
||||
}
|
||||
uid: "1dfa26e2ebab15780a3547e9c7fa785c",
|
||||
},
|
||||
});
|
||||
|
||||
expect(items[1]).toEqual({
|
||||
entity: {
|
||||
name: "my_shiny_cluster",
|
||||
source: "remote",
|
||||
uid: "55b42c3c7ba3b04193416cda405269a5"
|
||||
}
|
||||
uid: "55b42c3c7ba3b04193416cda405269a5",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -100,7 +100,7 @@ describe("kube helpers", () => {
|
||||
describe("with invalid context object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalid"))).toEqual(
|
||||
expect.stringContaining("No valid context object provided in kubeconfig for context 'invalid'")
|
||||
expect.stringContaining("No valid context object provided in kubeconfig for context 'invalid'"),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -108,7 +108,7 @@ describe("kube helpers", () => {
|
||||
describe("with invalid cluster object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalidCluster"))).toEqual(
|
||||
expect.stringContaining("No valid cluster object provided in kubeconfig for context 'invalidCluster'")
|
||||
expect.stringContaining("No valid cluster object provided in kubeconfig for context 'invalidCluster'"),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -116,7 +116,7 @@ describe("kube helpers", () => {
|
||||
describe("with invalid user object", () => {
|
||||
it("returns an error", () => {
|
||||
expect(String(validateKubeConfig(kc, "invalidUser"))).toEqual(
|
||||
expect.stringContaining("No valid user object provided in kubeconfig for context 'invalidUser'")
|
||||
expect.stringContaining("No valid user object provided in kubeconfig for context 'invalidUser'"),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ let searchStore: SearchStore = null;
|
||||
const logs = [
|
||||
"1:M 30 Oct 2020 16:17:41.553 # Connection with replica 172.17.0.12:6379 lost",
|
||||
"1:M 30 Oct 2020 16:17:41.623 * Replica 172.17.0.12:6379 asks for synchronization",
|
||||
"1:M 30 Oct 2020 16:17:41.623 * Starting Partial resynchronization request from 172.17.0.12:6379 accepted. Sending 0 bytes of backlog starting from offset 14407."
|
||||
"1:M 30 Oct 2020 16:17:41.623 * Starting Partial resynchronization request from 172.17.0.12:6379 accepted. Sending 0 bytes of backlog starting from offset 14407.",
|
||||
];
|
||||
|
||||
describe("search store tests", () => {
|
||||
|
||||
@@ -106,7 +106,7 @@ describe("user store tests", () => {
|
||||
"config.json": JSON.stringify({
|
||||
user: { username: "foobar" },
|
||||
preferences: { colorTheme: "light" },
|
||||
lastSeenAppVersion: "1.2.3"
|
||||
lastSeenAppVersion: "1.2.3",
|
||||
}),
|
||||
"lens-cluster-store.json": JSON.stringify({
|
||||
clusters: [
|
||||
@@ -118,15 +118,15 @@ describe("user store tests", () => {
|
||||
id: "barfoo",
|
||||
kubeConfigPath: "some/other/path",
|
||||
},
|
||||
]
|
||||
],
|
||||
} as ClusterStoreModel),
|
||||
"extension_data": {},
|
||||
},
|
||||
"some": {
|
||||
"other": {
|
||||
"path": "is file",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
UserStore.createInstance();
|
||||
|
||||
Reference in new issue
Block a user