Skip to content

Commit 576c755

Browse files
authored
Fix local eslint out of memory issue (#7913)
1 parent 27d1d04 commit 576c755

54 files changed

Lines changed: 2412 additions & 802 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ module.exports = {
5555
'packages/web/app/src/gql/**/*',
5656
'codegen.cjs',
5757
'tsup',
58+
'packages/libraries/render-laboratory/src/laboratory.ts',
59+
'packages/web/app/vite.config.ts',
5860
],
5961
overrides: [
6062
{
@@ -66,6 +68,10 @@ module.exports = {
6668
schema: SCHEMA_PATH,
6769
operations: OPERATIONS_PATHS,
6870
},
71+
rules: {
72+
'@graphql-eslint/no-deprecated': 'error',
73+
'@graphql-eslint/require-id-when-available': 'error',
74+
},
6975
},
7076
{
7177
// Setup processor for operations/fragments definitions on code-files
@@ -76,8 +82,8 @@ module.exports = {
7682
files: ['packages/web/app/**/*.graphql'],
7783
plugins: ['@graphql-eslint'],
7884
rules: {
79-
'@graphql-eslint/require-id-when-available': 'error',
8085
'@graphql-eslint/no-deprecated': 'error',
86+
'@graphql-eslint/require-id-when-available': 'error',
8187
},
8288
},
8389
{
@@ -144,6 +150,16 @@ module.exports = {
144150
'@typescript-eslint/no-empty-function': 'off',
145151
'@typescript-eslint/ban-types': 'off',
146152
'@typescript-eslint/triple-slash-reference': 'off',
153+
'@typescript-eslint/no-unused-vars': [
154+
'error',
155+
{
156+
argsIgnorePattern: '^_',
157+
caughtErrors: 'none',
158+
caughtErrorsIgnorePattern: '^_',
159+
destructuredArrayIgnorePattern: '^_',
160+
varsIgnorePattern: '^_',
161+
},
162+
],
147163
},
148164
},
149165
{

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ CHANGELOG.md
3232
.hive/
3333
.hive-dev/
3434

35+
# File generated by laboratory
36+
packages/libraries/render-laboratory/src/laboratory.ts
37+
3538
# File generated by @hive/app#generate-changelog script
3639
packages/web/app/src/components/ui/changelog/generated-changelog.ts

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"graphql:generate": "VERBOSE=1 graphql-codegen --config codegen.mts",
3333
"graphql:generate:watch": "pnpm graphql:generate --watch",
3434
"integration:prepare": "cd integration-tests && ./local.sh",
35-
"lint": "eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
35+
"lint": "NODE_OPTIONS=\"--max-old-space-size=8192\" eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
3636
"lint:env-template": "tsx scripts/check-env-template.ts",
3737
"lint:fix": "pnpm lint --fix",
3838
"lint:prettier": "prettier --cache --check .",
@@ -90,7 +90,7 @@
9090
"cypress": "13.17.0",
9191
"dotenv": "16.4.7",
9292
"eslint": "8.57.1",
93-
"eslint-plugin-better-tailwindcss": "^4.0.0",
93+
"eslint-plugin-better-tailwindcss": "^4.3.2",
9494
"eslint-plugin-cypress": "4.1.0",
9595
"eslint-plugin-hive": "file:rules",
9696
"fs-extra": "11.2.0",

packages/libraries/cli/src/base-command.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
6060
protected logger: Logger = {
6161
info: (...args) => this.logInfo(...args),
6262
error: (...args) => this.logFailure(...args),
63-
debug: (...args) => {
64-
if (this.flags.debug) {
65-
this.logInfo(...args);
66-
}
67-
},
63+
debug: (...args) => this.logDebug(...args),
6864
};
6965

7066
logSuccess(...args: any[]) {
@@ -83,6 +79,12 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
8379
this.log(Texture.warning(...args));
8480
}
8581

82+
logDebug(...args: any[]) {
83+
if (this.flags.debug) {
84+
this.logInfo(...args);
85+
}
86+
}
87+
8688
maybe<TArgs extends Record<string, any>, TKey extends keyof TArgs>({
8789
key,
8890
env,
@@ -119,7 +121,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
119121
ensure<
120122
TKey extends ValidConfigurationKeys,
121123
TArgs extends {
122-
[key in TKey]: GetConfigurationValueType<TKey>;
124+
[_key in TKey]: GetConfigurationValueType<TKey>;
123125
},
124126
>({
125127
key,
@@ -215,6 +217,7 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
215217

216218
return fileContent;
217219
} catch (e) {
220+
this.logFailure(e);
218221
throw new InvalidFileContentsError(file, 'JSON');
219222
}
220223
}

packages/libraries/cli/src/commands/app/create.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default class AppCreate extends Command<typeof AppCreate> {
6161
description: AppCreate.flags['registry.endpoint'].description!,
6262
});
6363
} catch (e) {
64+
this.logDebug(e);
6465
throw new MissingEndpointError();
6566
}
6667

@@ -72,6 +73,7 @@ export default class AppCreate extends Command<typeof AppCreate> {
7273
description: AppCreate.flags['registry.accessToken'].description!,
7374
});
7475
} catch (e) {
76+
this.logDebug(e);
7577
throw new MissingRegistryTokenError();
7678
}
7779

packages/libraries/cli/src/commands/app/publish.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default class AppPublish extends Command<typeof AppPublish> {
4949
description: AppPublish.flags['registry.endpoint'].description!,
5050
});
5151
} catch (e) {
52+
this.logDebug(e);
5253
throw new MissingEndpointError();
5354
}
5455

@@ -60,6 +61,7 @@ export default class AppPublish extends Command<typeof AppPublish> {
6061
description: AppPublish.flags['registry.accessToken'].description!,
6162
});
6263
} catch (e) {
64+
this.logDebug(e);
6365
throw new MissingRegistryTokenError();
6466
}
6567

packages/libraries/cli/src/commands/app/retire.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default class AppRetire extends Command<typeof AppRetire> {
5353
description: AppRetire.flags['registry.endpoint'].description!,
5454
});
5555
} catch (e) {
56+
this.logDebug(e);
5657
throw new MissingEndpointError();
5758
}
5859

@@ -64,6 +65,7 @@ export default class AppRetire extends Command<typeof AppRetire> {
6465
description: AppRetire.flags['registry.accessToken'].description!,
6566
});
6667
} catch (e) {
68+
this.logDebug(e);
6769
throw new MissingRegistryTokenError();
6870
}
6971

packages/libraries/cli/src/commands/artifact/fetch.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
4141
description: ArtifactsFetch.flags['cdn.endpoint'].description!,
4242
});
4343
} catch (e) {
44+
this.logDebug(e);
4445
throw new MissingCdnEndpointError();
4546
}
4647

@@ -52,6 +53,7 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
5253
description: ArtifactsFetch.flags['cdn.accessToken'].description!,
5354
});
5455
} catch (e) {
56+
this.logDebug(e);
5557
throw new MissingCdnKeyError();
5658
}
5759

packages/libraries/cli/src/commands/dev.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export default class Dev extends Command<typeof Dev> {
211211
description: Dev.flags['registry.endpoint'].description!,
212212
});
213213
} catch (e) {
214+
this.logDebug(e);
214215
throw new MissingEndpointError();
215216
}
216217
try {
@@ -222,6 +223,7 @@ export default class Dev extends Command<typeof Dev> {
222223
description: Dev.flags['registry.accessToken'].description!,
223224
});
224225
} catch (e) {
226+
this.logDebug(e);
225227
throw new MissingRegistryTokenError();
226228
}
227229

@@ -270,6 +272,7 @@ export default class Dev extends Command<typeof Dev> {
270272
description: Dev.flags['registry.endpoint'].description!,
271273
});
272274
} catch (e) {
275+
this.logDebug(e);
273276
throw new MissingEndpointError();
274277
}
275278
try {
@@ -281,6 +284,7 @@ export default class Dev extends Command<typeof Dev> {
281284
description: Dev.flags['registry.accessToken'].description!,
282285
});
283286
} catch (e) {
287+
this.logDebug(e);
284288
throw new MissingRegistryTokenError();
285289
}
286290

packages/libraries/cli/src/commands/operations/check.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
111111
description: OperationsCheck.flags['registry.endpoint'].description!,
112112
});
113113
} catch (e) {
114+
this.logDebug(e);
114115
throw new MissingEndpointError();
115116
}
116117

@@ -123,6 +124,7 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
123124
description: OperationsCheck.flags['registry.accessToken'].description!,
124125
});
125126
} catch (e) {
127+
this.logDebug(e);
126128
throw new MissingRegistryTokenError();
127129
}
128130

0 commit comments

Comments
 (0)