chore: Add eslint rule for no-shadow (#6658)
* chore: Add eslint rule for no-shadow * fix
This commit is contained in:
@@ -22,8 +22,8 @@ export class PublicEnvironmentRegister {
|
||||
|
||||
static registerEnv(env: Environment) {
|
||||
process.nextTick(() => {
|
||||
const vars: string[] = Reflect.getMetadata(key, env);
|
||||
(vars ?? []).forEach((key: string) => {
|
||||
const vars: string[] = Reflect.getMetadata(key, env) ?? [];
|
||||
vars.forEach((key: string) => {
|
||||
if (isUndefined(this.publicEnv[key])) {
|
||||
this.publicEnv[key] = env[key];
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ export default function fetch(
|
||||
): Promise<Response> {
|
||||
// In self-hosted, webhooks support proxying and are also allowed to connect
|
||||
// to internal services, so use fetchWithProxy without the filtering agent.
|
||||
const fetch = env.isCloudHosted ? nodeFetch : fetchWithProxy;
|
||||
const fetchMethod = env.isCloudHosted ? nodeFetch : fetchWithProxy;
|
||||
|
||||
return fetch(url, {
|
||||
return fetchMethod(url, {
|
||||
...init,
|
||||
agent: env.isCloudHosted ? useAgent(url) : undefined,
|
||||
});
|
||||
|
||||
@@ -32,12 +32,12 @@ if (env.isProduction) {
|
||||
const manifest = readManifestFile();
|
||||
|
||||
const returnFileAndImportsFromManifest = (
|
||||
manifest: ManifestStructure,
|
||||
manifestStructure: ManifestStructure,
|
||||
file: string
|
||||
): string[] => [
|
||||
manifest[file]["file"],
|
||||
...(manifest[file]["imports"] ?? []).map(
|
||||
(entry: string) => manifest[entry]["file"]
|
||||
manifestStructure[file]["file"],
|
||||
...(manifestStructure[file]["imports"] ?? []).map(
|
||||
(entry: string) => manifestStructure[entry]["file"]
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ export function CannotUseWithout(
|
||||
options: validationOptions,
|
||||
validator: {
|
||||
validate<T>(value: T, args: ValidationArguments) {
|
||||
const object = args.object as unknown as T;
|
||||
const obj = args.object as unknown as T;
|
||||
const required = args.constraints[0] as string;
|
||||
return object[required] !== undefined;
|
||||
return obj[required] !== undefined;
|
||||
},
|
||||
defaultMessage(args: ValidationArguments) {
|
||||
return `${propertyName} cannot be used without ${args.constraints[0]}.`;
|
||||
|
||||
Reference in New Issue
Block a user