1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Lint: space-before-function-paren (error) (#4199)

This commit is contained in:
Sebastian Malton 2021-11-01 08:37:49 -04:00 committed by GitHub
parent e74f17e8ce
commit 0759b80435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 6 deletions

View File

@ -59,6 +59,11 @@ module.exports = {
"SwitchCase": 1, "SwitchCase": 1,
}], }],
"no-unused-vars": "off", "no-unused-vars": "off",
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always",
}],
"unused-imports/no-unused-imports": "error", "unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [ "unused-imports/no-unused-vars": [
"warn", { "warn", {
@ -117,6 +122,12 @@ module.exports = {
"@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "off",
"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always",
}],
"unused-imports/no-unused-imports-ts": process.env.PROD === "true" ? "error" : "warn", "unused-imports/no-unused-imports-ts": process.env.PROD === "true" ? "error" : "warn",
"unused-imports/no-unused-vars-ts": [ "unused-imports/no-unused-vars-ts": [
"warn", { "warn", {
@ -188,6 +199,12 @@ module.exports = {
"@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-function": "off",
"react/display-name": "off", "react/display-name": "off",
"@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "off",
"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always",
}],
"unused-imports/no-unused-imports-ts": process.env.PROD === "true" ? "error" : "warn", "unused-imports/no-unused-imports-ts": process.env.PROD === "true" ? "error" : "warn",
"unused-imports/no-unused-vars-ts": [ "unused-imports/no-unused-vars-ts": [
"warn", { "warn", {

View File

@ -45,7 +45,7 @@ export function buildURL<P extends object = {}, Q extends object = {}>(path: str
export function buildURLPositional<P extends object = {}, Q extends object = {}>(path: string | any) { export function buildURLPositional<P extends object = {}, Q extends object = {}>(path: string | any) {
const builder = buildURL(path); const builder = buildURL(path);
return function(params?: P, query?: Q, fragment?: string): string { return function (params?: P, query?: Q, fragment?: string): string {
return builder({ params, query, fragment }); return builder({ params, query, fragment });
}; };
} }

View File

@ -59,7 +59,7 @@ export class ServiceAccountsDetails extends React.Component<Props> {
}); });
this.secrets = await Promise.all(secrets); this.secrets = await Promise.all(secrets);
const imagePullSecrets = serviceAccount.getImagePullSecrets().map(async({ name }) => { const imagePullSecrets = serviceAccount.getImagePullSecrets().map(async ({ name }) => {
return secretsStore.load({ name, namespace }).catch(() => this.generateDummySecretObject(name)); return secretsStore.load({ name, namespace }).catch(() => this.generateDummySecretObject(name));
}); });

View File

@ -165,7 +165,7 @@ export const terminalStore = new Proxy({}, {
const res = (ts as any)?.[p]; const res = (ts as any)?.[p];
if (typeof res === "function") { if (typeof res === "function") {
return function(...args: any[]) { return function (...args: any[]) {
return res.apply(ts, args); return res.apply(ts, args);
}; };
} }

View File

@ -28,7 +28,7 @@ export function interval(timeSec = 1, callback: IntervalCallback, autoRun = fals
let timer = -1; let timer = -1;
let isRunning = false; let isRunning = false;
const intervalManager = { const intervalManager = {
start (runImmediately = false) { start(runImmediately = false) {
if (isRunning) return; if (isRunning) return;
const tick = () => callback(++count); const tick = () => callback(++count);
@ -36,12 +36,12 @@ export function interval(timeSec = 1, callback: IntervalCallback, autoRun = fals
timer = window.setInterval(tick, 1000 * timeSec); timer = window.setInterval(tick, 1000 * timeSec);
if (runImmediately) tick(); if (runImmediately) tick();
}, },
stop () { stop() {
count = 0; count = 0;
isRunning = false; isRunning = false;
clearInterval(timer); clearInterval(timer);
}, },
restart (runImmediately = false) { restart(runImmediately = false) {
this.stop(); this.stop();
this.start(runImmediately); this.start(runImmediately);
}, },