mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 10:33:43 +08:00
test: enable @typescript-eslint/await-thenable
lint rule
The `@typescript-eslint/await-thenable` rule is now enabled and all failures have been addressed within the code.
This commit is contained in:
parent
0d2d9860fd
commit
741cf7fe1e
@ -103,7 +103,6 @@
|
|||||||
"no-case-declarations": "off",
|
"no-case-declarations": "off",
|
||||||
"no-fallthrough": "off",
|
"no-fallthrough": "off",
|
||||||
"no-underscore-dangle": "off",
|
"no-underscore-dangle": "off",
|
||||||
"@typescript-eslint/await-thenable": "off",
|
|
||||||
"@typescript-eslint/ban-types": "off",
|
"@typescript-eslint/ban-types": "off",
|
||||||
"@typescript-eslint/no-empty-function": "off",
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
@ -245,7 +245,7 @@ export async function* serveWithVite(
|
|||||||
...new Set([...server.config.server.fs.allow, ...assetFiles.values()]),
|
...new Set([...server.config.server.fs.allow, ...assetFiles.values()]),
|
||||||
];
|
];
|
||||||
|
|
||||||
await handleUpdate(normalizePath, generatedFiles, server, serverOptions, context.logger);
|
handleUpdate(normalizePath, generatedFiles, server, serverOptions, context.logger);
|
||||||
|
|
||||||
if (requiresServerRestart) {
|
if (requiresServerRestart) {
|
||||||
// Restart the server to force SSR dep re-optimization when a dependency has been added.
|
// Restart the server to force SSR dep re-optimization when a dependency has been added.
|
||||||
|
@ -41,7 +41,7 @@ export abstract class ArchitectBaseCommandModule<T extends object>
|
|||||||
protected readonly missingTargetChoices: MissingTargetChoice[] | undefined;
|
protected readonly missingTargetChoices: MissingTargetChoice[] | undefined;
|
||||||
|
|
||||||
protected async runSingleTarget(target: Target, options: OtherOptions): Promise<number> {
|
protected async runSingleTarget(target: Target, options: OtherOptions): Promise<number> {
|
||||||
const architectHost = await this.getArchitectHost();
|
const architectHost = this.getArchitectHost();
|
||||||
|
|
||||||
let builderName: string;
|
let builderName: string;
|
||||||
try {
|
try {
|
||||||
|
@ -55,7 +55,7 @@ export default class NewCommandModule
|
|||||||
? collectionNameFromArgs
|
? collectionNameFromArgs
|
||||||
: await this.getCollectionFromConfig();
|
: await this.getCollectionFromConfig();
|
||||||
|
|
||||||
const workflow = await this.getOrCreateWorkflowForBuilder(collectionName);
|
const workflow = this.getOrCreateWorkflowForBuilder(collectionName);
|
||||||
const collection = workflow.engine.createCollection(collectionName);
|
const collection = workflow.engine.createCollection(collectionName);
|
||||||
const options = await this.getSchematicOptions(collection, this.schematicName, workflow);
|
const options = await this.getSchematicOptions(collection, this.schematicName, workflow);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ describe('Browser Builder build optimizer', () => {
|
|||||||
const boOutput = (await run.result) as BrowserBuilderOutput;
|
const boOutput = (await run.result) as BrowserBuilderOutput;
|
||||||
expect(boOutput.success).toBe(true);
|
expect(boOutput.success).toBe(true);
|
||||||
|
|
||||||
const boStats = await await lastValueFrom(
|
const boStats = await lastValueFrom(
|
||||||
host.stat(join(normalize(output.outputs[0].path), 'main.js')),
|
host.stat(join(normalize(output.outputs[0].path), 'main.js')),
|
||||||
);
|
);
|
||||||
if (!boStats) {
|
if (!boStats) {
|
||||||
|
@ -174,7 +174,7 @@ export async function inlineLocales(options: InlineOptions) {
|
|||||||
true,
|
true,
|
||||||
localeDataContent,
|
localeDataContent,
|
||||||
);
|
);
|
||||||
const transformResult = await transformFromAstSync(ast, options.code, {
|
const transformResult = transformFromAstSync(ast, options.code, {
|
||||||
filename: options.filename,
|
filename: options.filename,
|
||||||
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
|
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
|
||||||
// The types do not include the false option even though it is valid
|
// The types do not include the false option even though it is valid
|
||||||
|
@ -355,6 +355,7 @@ export class CoreSchemaRegistry implements SchemaRegistry {
|
|||||||
|
|
||||||
// Validate using ajv
|
// Validate using ajv
|
||||||
try {
|
try {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
||||||
const success = await validator.call(validationContext, data);
|
const success = await validator.call(validationContext, data);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user