Skip to content

Commit 15ef15e

Browse files
alan-agius4vikerman
authored andcommitted
style: remove redundant max-line-length disables and fix other lint issues
1 parent 278d0d3 commit 15ef15e

File tree

33 files changed

+18
-60
lines changed

33 files changed

+18
-60
lines changed

packages/angular/cli/lib/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default async function(options: { testing?: boolean; cliArgs: string[] })
7272

7373
logger.fatal(
7474
`An unhandled exception occurred: ${err.message}\n` +
75-
`See "${logPath}" for further details.`
75+
`See "${logPath}" for further details.`,
7676
);
7777
} catch (e) {
7878
logger.fatal(

packages/angular/cli/utilities/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export function getWorkspace(
8686
if (error) {
8787
throw new Error(
8888
`Workspace config file cannot le loaded: ${configPath}`
89-
+ `\n${error instanceof Error ? error.message : error}`
90-
)
89+
+ `\n${error instanceof Error ? error.message : error}`,
90+
);
9191
}
9292

9393
cachedWorkspaces.set(level, workspace);

packages/angular/pwa/pwa/index_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/te
99
import * as path from 'path';
1010
import { Schema as PwaOptions } from './schema';
1111

12-
13-
// tslint:disable:max-line-length
1412
describe('PWA Schematic', () => {
1513
const schematicRunner = new SchematicTestRunner(
1614
'@angular/pwa',

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface HashFormat {
2121
}
2222

2323
export function getOutputHashFormat(option: string, length = 20): HashFormat {
24-
/* tslint:disable:max-line-length */
2524
const hashFormats: { [option: string]: HashFormat } = {
2625
none: { chunk: '', extract: '', file: '', script: '' },
2726
media: { chunk: '', extract: '', file: `.[hash:${length}]`, script: '' },
@@ -38,7 +37,6 @@ export function getOutputHashFormat(option: string, length = 20): HashFormat {
3837
script: `.[hash:${length}]`,
3938
},
4039
};
41-
/* tslint:enable:max-line-length */
4240
return hashFormats[option] || hashFormats['none'];
4341
}
4442

packages/angular_devkit/build_optimizer/src/build-optimizer/build-optimizer_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ describe('build-optimizer', () => {
5454
}());
5555
var RenderType_MdOption = ɵcrt({ encapsulation: 2, styles: styles_MdOption});
5656
`;
57-
// tslint:disable:max-line-length
5857
const output = tags.oneLine`
5958
import { __extends } from "tslib";
6059
${imports}

packages/angular_devkit/build_optimizer/src/build-optimizer/webpack-plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { Compiler } from 'webpack'; // tslint:disable-line:no-implicit-dependen
1010

1111
export class BuildOptimizerWebpackPlugin {
1212
apply(compiler: Compiler) {
13-
compiler.hooks.normalModuleFactory.tap("BuildOptimizerWebpackPlugin", nmf => {
14-
nmf.hooks.module.tap("BuildOptimizerWebpackPlugin", (module, data) => {
13+
compiler.hooks.normalModuleFactory.tap('BuildOptimizerWebpackPlugin', nmf => {
14+
nmf.hooks.module.tap('BuildOptimizerWebpackPlugin', (module, data) => {
1515
const resolveData = data.resourceResolveData;
1616
if (resolveData && resolveData.descriptionFileData) {
1717
// Only TS packages should use Build Optimizer.

packages/angular_devkit/build_optimizer/src/transforms/import-tslib_spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('import-tslib', () => {
3232
});
3333

3434
it('replaces wrapped __extends', () => {
35-
// tslint:disable:max-line-length
3635
const input = tags.stripIndent`
3736
export default function appGlobal() {
3837
var __extends = (this && this.__extends) || function (d, b) {
@@ -61,7 +60,6 @@ describe('import-tslib', () => {
6160
return c > 3 && r && Object.defineProperty(target, key, r), r;
6261
};
6362
`;
64-
// tslint:enable:max-line-length
6563
const output = tags.stripIndent`
6664
import { __decorate } from "tslib";
6765
`;
@@ -71,13 +69,11 @@ describe('import-tslib', () => {
7169
});
7270

7371
it('replaces __metadata', () => {
74-
// tslint:disable:max-line-length
7572
const input = tags.stripIndent`
7673
var __metadata = (this && this.__metadata) || function (k, v) {
7774
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7875
};
7976
`;
80-
// tslint:enable:max-line-length
8177
const output = tags.stripIndent`
8278
import { __metadata } from "tslib";
8379
`;

packages/angular_devkit/build_optimizer/src/transforms/wrap-enums.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function findTs2_3EnumIife(
262262
|| !ts.isBinaryExpression(statement.expression)
263263
|| !ts.isElementAccessExpression(statement.expression.left)
264264
) {
265-
return null
265+
return null;
266266
}
267267

268268
const leftExpression = statement.expression.left.expression;

packages/angular_devkit/schematics/tools/workflow/node-workflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class NodeWorkflow extends workflow.BaseWorkflow {
3434

3535
force: options.force,
3636
dryRun: options.dryRun,
37-
registry: options.registry
37+
registry: options.registry,
3838
});
3939

4040
engineHost.registerTaskExecutor(

packages/angular_devkit/schematics_cli/bin/schematics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
DryRunEvent,
2525
SchematicEngine,
2626
UnsuccessfulWorkflowExecution,
27-
formats
27+
formats,
2828
} from '@angular-devkit/schematics';
2929
import { NodeModulesEngineHost, NodeWorkflow, validateOptionsWithSchema } from '@angular-devkit/schematics/tools';
3030
import * as inquirer from 'inquirer';

packages/ngtools/webpack/src/transformers/ctor-parameters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export function downlevelConstructorParameters(
1919

2020
// The following is sourced from tsickle with local modifications
2121
// Only the creation of `ctorParameters` is retained
22-
// tslint:disable-next-line:max-line-length
2322
// https://github.com/angular/tsickle/blob/0ceb7d6bc47f6945a6c4c09689f1388eb48f5c07/src/decorator_downlevel_transformer.ts
2423
//
2524

packages/ngtools/webpack/src/transformers/ctor-parameters_spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ describe('Constructor Parameter Transformer', () => {
5252
}
5353
`;
5454

55+
// tslint:disable:max-line-length
5556
const output = `
5657
import * as tslib_1 from "tslib";
5758
let RootProvidedService = class RootProvidedService { constructor() { } };
5859
RootProvidedService = tslib_1.__decorate([ Injectable({ providedIn: 'root' }) ], RootProvidedService);
5960
export { RootProvidedService }; export class MyService { constructor(v) { } } MyService.ctorParameters = () => [ { type: RootProvidedService } ];
6061
`;
62+
// tslint:enable:max-line-length
6163

6264
const result = transform(input);
6365

packages/ngtools/webpack/src/transformers/import_factory_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ describe('@ngtools/webpack transformers', () => {
8181
}];
8282
`;
8383

84-
// tslint:disable: max-line-length
8584
const output = tags.stripIndent`
8685
const ɵ0 = () => import("./shared/path/to/lazy/lazy.module.ngfactory").then(m => m.LazyModuleNgFactory);
8786
const routes = [{
8887
path: 'lazy',
8988
loadChildren: ɵ0
9089
}];
9190
`;
92-
// tslint:enable: max-line-length
9391

9492
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true);
9593
const transformer = importFactory(() => { }, () => program.getTypeChecker());

packages/ngtools/webpack/src/transformers/replace_bootstrap_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('@ngtools/webpack transformers', () => {
2626
platformBrowserDynamic().bootstrapModule(AppModule);
2727
`;
2828

29-
// tslint:disable:max-line-length
3029
const output = tags.stripIndent`
3130
import { enableProdMode } from '@angular/core';
3231
import { environment } from './environments/environment';
@@ -39,7 +38,6 @@ describe('@ngtools/webpack transformers', () => {
3938
}
4039
__NgCli_bootstrap_2.platformBrowser().bootstrapModuleFactory(__NgCli_bootstrap_1.AppModuleNgFactory);
4140
`;
42-
// tslint:enable:max-line-length
4341

4442
const { program, compilerHost } = createTypescriptContext(input);
4543
const transformer = replaceBootstrap(

packages/ngtools/webpack/src/transformers/replace_server_bootstrap_spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe('@ngtools/webpack transformers', () => {
2727
platformDynamicServer().bootstrapModule(AppModule);
2828
`;
2929

30-
// tslint:disable:max-line-length
3130
const output = tags.stripIndent`
3231
import { enableProdMode } from '@angular/core';
3332
import { environment } from './environments/environment';
@@ -40,7 +39,6 @@ describe('@ngtools/webpack transformers', () => {
4039
}
4140
__NgCli_bootstrap_2.platformServer().bootstrapModuleFactory(__NgCli_bootstrap_1.AppModuleNgFactory);
4241
`;
43-
// tslint:enable:max-line-length
4442

4543
const { program, compilerHost } = createTypescriptContext(input);
4644
const transformer = replaceServerBootstrap(
@@ -71,7 +69,6 @@ describe('@ngtools/webpack transformers', () => {
7169
});
7270
`;
7371

74-
// tslint:disable:max-line-length
7572
const output = tags.stripIndent`
7673
import { enableProdMode } from '@angular/core';
7774
import { environment } from './environments/environment';
@@ -87,7 +84,6 @@ describe('@ngtools/webpack transformers', () => {
8784
url: '/'
8885
});
8986
`;
90-
// tslint:enable:max-line-length
9187

9288
const { program, compilerHost } = createTypescriptContext(input);
9389
const transformer = replaceServerBootstrap(
@@ -120,7 +116,6 @@ describe('@ngtools/webpack transformers', () => {
120116
}));
121117
`;
122118

123-
// tslint:disable:max-line-length
124119
const output = tags.stripIndent`
125120
import * as express from 'express';
126121
@@ -140,7 +135,6 @@ describe('@ngtools/webpack transformers', () => {
140135
bootstrap: __NgCli_bootstrap_1.AppModuleNgFactory
141136
}));
142137
`;
143-
// tslint:enable:max-line-length
144138

145139
const { program, compilerHost } = createTypescriptContext(input);
146140
const transformer = replaceServerBootstrap(
@@ -168,7 +162,6 @@ describe('@ngtools/webpack transformers', () => {
168162
platformDynamicServer().bootstrapModule(AppModule);
169163
`;
170164

171-
// tslint:disable:max-line-length
172165
const output = tags.stripIndent`
173166
import { enableProdMode } from '@angular/core';
174167
import { environment } from './environments/environment';
@@ -181,7 +174,6 @@ describe('@ngtools/webpack transformers', () => {
181174
}
182175
__NgCli_bootstrap_2.platformServer().bootstrapModuleFactory(__NgCli_bootstrap_1.AppModuleNgFactory);
183176
`;
184-
// tslint:enable:max-line-length
185177

186178
const { program, compilerHost } = createTypescriptContext(input);
187179
const transformer = replaceServerBootstrap(

packages/schematics/angular/application/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { getFileContent } from '../utility/test';
1212
import { Schema as WorkspaceOptions } from '../workspace/schema';
1313
import { Schema as ApplicationOptions, Style, ViewEncapsulation } from './schema';
1414

15-
// tslint:disable:max-line-length
1615
describe('Application Schematic', () => {
1716
const schematicRunner = new SchematicTestRunner(
1817
'@schematics/angular',

packages/schematics/angular/component/index_spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { createAppModule } from '../utility/test';
1212
import { Schema as WorkspaceOptions } from '../workspace/schema';
1313
import { ChangeDetection, Schema as ComponentOptions, Style } from './schema';
1414

15-
// tslint:disable:max-line-length
1615
describe('Component Schematic', () => {
1716
const schematicRunner = new SchematicTestRunner(
1817
'@schematics/angular',
@@ -273,7 +272,6 @@ describe('Component Schematic', () => {
273272
const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
274273
const content = tree.readContent('/projects/bar/src/app/app.module.ts');
275274
expect(content).toMatch(
276-
// tslint:disable-next-line:max-line-length
277275
/import { TestComponentComponent } from '\.\/dir\/test-component\/test-component.component'/,
278276
);
279277
});
@@ -288,7 +286,6 @@ describe('Component Schematic', () => {
288286

289287
const content = appTree.readContent('/projects/bar/src/app/admin/module/module.module.ts');
290288
expect(content).toMatch(
291-
// tslint:disable-next-line:max-line-length
292289
/import { TestComponentComponent } from '..\/..\/other\/test-component\/test-component.component'/,
293290
);
294291
});

packages/schematics/angular/directive/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Schema as ApplicationOptions } from '../application/schema';
1010
import { Schema as WorkspaceOptions } from '../workspace/schema';
1111
import { Schema as DirectiveOptions } from './schema';
1212

13-
// tslint:disable:max-line-length
1413
describe('Directive Schematic', () => {
1514
const schematicRunner = new SchematicTestRunner(
1615
'@schematics/angular',

packages/schematics/angular/library/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function getJsonFileContent(tree: UnitTestTree, path: string) {
1717
return JSON.parse(tree.readContent(path));
1818
}
1919

20-
// tslint:disable:max-line-length
2120
describe('Library Schematic', () => {
2221
const schematicRunner = new SchematicTestRunner(
2322
'@schematics/ng_packagr',

packages/schematics/angular/migrations/update-6/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ function extractProjectsConfig(
556556

557557
const e2eTargets: JsonObject = {};
558558

559-
// tslint:disable-next-line:max-line-length
560559
const protractorConfig = config && config.e2e && config.e2e.protractor && config.e2e.protractor.config
561560
? config.e2e.protractor.config
562561
: '';

packages/schematics/angular/migrations/update-8/differential-loading.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
removePropertyInAstObject,
2121
} from '../../utility/json-utils';
2222

23-
// tslint:disable-next-line:max-line-length
2423
const browserslistContent = `# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2524
# For additional information regarding the format and rule options, please see:
2625
# https://github.com/browserslist/browserslist#queries

packages/schematics/angular/migrations/update-9/update-workspace-config_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ const scriptsWithLazy = [
2828
{ bundleName: 'two', input: 'two.js', lazy: true },
2929
{ bundleName: 'tree', input: 'tree.js' },
3030
'four.js',
31-
]
31+
];
3232

3333
const scriptsExpectWithLazy = [
3434
{ bundleName: 'one', input: 'one.js' },
3535
{ bundleName: 'two', inject: false, input: 'two.js' },
3636
{ bundleName: 'tree', input: 'tree.js' },
3737
'four.js',
38-
]
38+
];
3939

4040
const stylesWithLazy = [
4141
{ bundleName: 'one', input: 'one.css', lazy: false },
4242
{ bundleName: 'two', input: 'two.css', lazy: true },
4343
{ bundleName: 'tree', input: 'tree.css' },
4444
'four.css',
45-
]
45+
];
4646

4747
const stylesExpectWithLazy = [
4848
{ bundleName: 'one', input: 'one.css' },
4949
{ bundleName: 'two', inject: false, input: 'two.css' },
5050
{ bundleName: 'tree', input: 'tree.css' },
5151
'four.css',
52-
]
52+
];
5353

5454
const workspacePath = '/angular.json';
5555

packages/schematics/angular/module/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Schema as ApplicationOptions } from '../application/schema';
1010
import { Schema as WorkspaceOptions } from '../workspace/schema';
1111
import { Schema as ModuleOptions } from './schema';
1212

13-
// tslint:disable:max-line-length
1413
describe('Module Schematic', () => {
1514
const schematicRunner = new SchematicTestRunner(
1615
'@schematics/angular',

packages/schematics/angular/service-worker/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ describe('Service Worker Schematic', () => {
9393
const tree = await schematicRunner.runSchematicAsync('service-worker', defaultOptions, appTree)
9494
.toPromise();
9595
const pkgText = tree.readContent('/projects/bar/src/app/app.module.ts');
96-
// tslint:disable-next-line:max-line-length
9796
const expectedText = 'ServiceWorkerModule.register(\'ngsw-worker.js\', { enabled: environment.production })';
9897
expect(pkgText).toContain(expectedText);
9998
});

packages/schematics/angular/service/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Schema as ApplicationOptions } from '../application/schema';
1010
import { Schema as WorkspaceOptions } from '../workspace/schema';
1111
import { Schema as ServiceOptions } from './schema';
1212

13-
// tslint:disable:max-line-length
1413
describe('Service Schematic', () => {
1514
const schematicRunner = new SchematicTestRunner(
1615
'@schematics/angular',

packages/schematics/angular/universal/index_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('Universal Schematic', () => {
9393
module: 'commonjs',
9494
},
9595
files: [
96-
"src/main.server.ts"
96+
'src/main.server.ts',
9797
],
9898
angularCompilerOptions: {
9999
entryModule: './src/app/app.server.module#AppServerModule',
@@ -117,7 +117,7 @@ describe('Universal Schematic', () => {
117117
module: 'commonjs',
118118
},
119119
files: [
120-
"src/main.server.ts"
120+
'src/main.server.ts',
121121
],
122122
angularCompilerOptions: {
123123
entryModule: './src/app/app.server.module#AppServerModule',

0 commit comments

Comments
 (0)