mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce semicolons in eslint
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
0f3f5611ba
commit
1477bb8274
531 files changed
+3979
-3975
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import packageInfo from "../../../package.json"
|
||||
import packageInfo from "../../../package.json";
|
||||
|
||||
export function getAppVersion(): string {
|
||||
return packageInfo.version;
|
||||
@@ -9,5 +9,5 @@ export function getBundledKubectlVersion(): string {
|
||||
}
|
||||
|
||||
export function getBundledExtensions(): string[] {
|
||||
return packageInfo.lens?.extensions || []
|
||||
return packageInfo.lens?.extensions || [];
|
||||
}
|
||||
@@ -6,7 +6,7 @@ export function autobind() {
|
||||
return function (target: Constructor | object, prop?: string, descriptor?: PropertyDescriptor) {
|
||||
if (target instanceof Function) return bindClass(target);
|
||||
else return bindMethod(target, prop, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function bindClass<T extends Constructor>(constructor: T) {
|
||||
@@ -22,12 +22,12 @@ function bindClass<T extends Constructor>(constructor: T) {
|
||||
if (skipMethod(prop)) return;
|
||||
const boundDescriptor = bindMethod(proto, prop, descriptors[prop]);
|
||||
Object.defineProperty(proto, prop, boundDescriptor);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function bindMethod(target: object, prop?: string, descriptor?: PropertyDescriptor) {
|
||||
if (!descriptor || typeof descriptor.value !== "function") {
|
||||
throw new Error(`@autobind() must be used on class or method only`)
|
||||
throw new Error(`@autobind() must be used on class or method only`);
|
||||
}
|
||||
const { value: func, enumerable, configurable } = descriptor;
|
||||
const boundFunc = new WeakMap<object, Function>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { compile } from "path-to-regexp"
|
||||
import { compile } from "path-to-regexp";
|
||||
|
||||
export interface IURLParams<P extends object = {}, Q extends object = {}> {
|
||||
params?: P;
|
||||
@@ -8,7 +8,7 @@ export interface IURLParams<P extends object = {}, Q extends object = {}> {
|
||||
export function buildURL<P extends object = {}, Q extends object = {}>(path: string | any) {
|
||||
const pathBuilder = compile(String(path));
|
||||
return function ({ params, query }: IURLParams<P, Q> = {}) {
|
||||
const queryParams = query ? new URLSearchParams(Object.entries(query)).toString() : ""
|
||||
return pathBuilder(params) + (queryParams ? `?${queryParams}` : "")
|
||||
}
|
||||
const queryParams = query ? new URLSearchParams(Object.entries(query)).toString() : "";
|
||||
return pathBuilder(params) + (queryParams ? `?${queryParams}` : "");
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
export function defineGlobal(propName: string, descriptor: PropertyDescriptor) {
|
||||
const scope = typeof global !== "undefined" ? global : window;
|
||||
if (scope.hasOwnProperty(propName)) {
|
||||
console.info(`Global variable "${propName}" already exists. Skipping.`)
|
||||
console.info(`Global variable "${propName}" already exists. Skipping.`);
|
||||
return;
|
||||
}
|
||||
Object.defineProperty(scope, propName, descriptor);
|
||||
|
||||
+12
-12
@@ -1,14 +1,14 @@
|
||||
// Common utils (main OR renderer)
|
||||
|
||||
export * from "./app-version"
|
||||
export * from "./autobind"
|
||||
export * from "./base64"
|
||||
export * from "./camelCase"
|
||||
export * from "./cloneJson"
|
||||
export * from "./debouncePromise"
|
||||
export * from "./defineGlobal"
|
||||
export * from "./getRandId"
|
||||
export * from "./splitArray"
|
||||
export * from "./saveToAppFiles"
|
||||
export * from "./singleton"
|
||||
export * from "./openExternal"
|
||||
export * from "./app-version";
|
||||
export * from "./autobind";
|
||||
export * from "./base64";
|
||||
export * from "./camelCase";
|
||||
export * from "./cloneJson";
|
||||
export * from "./debouncePromise";
|
||||
export * from "./defineGlobal";
|
||||
export * from "./getRandId";
|
||||
export * from "./splitArray";
|
||||
export * from "./saveToAppFiles";
|
||||
export * from "./singleton";
|
||||
export * from "./openExternal";
|
||||
@@ -1,5 +1,5 @@
|
||||
// Opens a link in external browser
|
||||
import { shell } from "electron"
|
||||
import { shell } from "electron";
|
||||
|
||||
export function openExternal(url: string) {
|
||||
return shell.openExternal(url);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import path from "path";
|
||||
import { app, remote } from "electron";
|
||||
import { ensureDirSync, writeFileSync } from "fs-extra";
|
||||
import { WriteFileOptions } from "fs"
|
||||
import { WriteFileOptions } from "fs";
|
||||
|
||||
export function saveToAppFiles(filePath: string, contents: any, options?: WriteFileOptions): string {
|
||||
const absPath = path.resolve((app || remote.app).getPath("userData"), filePath);
|
||||
|
||||
@@ -24,5 +24,5 @@ class Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
export { Singleton }
|
||||
export { Singleton };
|
||||
export default Singleton;
|
||||
@@ -15,5 +15,5 @@ export function splitArray<T>(array: T[], element: T): [T[], T[], boolean] {
|
||||
if (index < 0) {
|
||||
return [array, [], false];
|
||||
}
|
||||
return [array.slice(0, index), array.slice(index + 1, array.length), true]
|
||||
return [array.slice(0, index), array.slice(index + 1, array.length), true];
|
||||
}
|
||||
Reference in new issue
Block a user