Skip to content

Commit e91589c

Browse files
crisbetojelbourn
authored andcommitted
build: max-line-length check not catching all cases (#17570)
In tslint 5.19.0 they added a separate option that determines whether strings should be checked and it seems to have been defaulted to `false` (palantir/tslint#4798). As a result we ended up with a few places where the limit was being violated. These changes explicitly enable checking of strings and fix the failures that we had accumulated.
1 parent f554610 commit e91589c

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

src/material-examples/cdk-experimental/popover-edit/module.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ import {CdkTableModule} from '@angular/cdk/table';
33
import {CommonModule} from '@angular/common';
44
import {NgModule} from '@angular/core';
55
import {FormsModule} from '@angular/forms';
6-
import {CdkPopoverEditCdkTableFlexExample} from './cdk-popover-edit-cdk-table-flex/cdk-popover-edit-cdk-table-flex-example';
7-
import {CdkPopoverEditCdkTableExample} from './cdk-popover-edit-cdk-table/cdk-popover-edit-cdk-table-example';
8-
import {CdkPopoverEditCellSpanVanillaTableExample} from './cdk-popover-edit-cell-span-vanilla-table/cdk-popover-edit-cell-span-vanilla-table-example';
9-
import {CdkPopoverEditTabOutVanillaTableExample} from './cdk-popover-edit-tab-out-vanilla-table/cdk-popover-edit-tab-out-vanilla-table-example';
10-
import {CdkPopoverEditVanillaTableExample} from './cdk-popover-edit-vanilla-table/cdk-popover-edit-vanilla-table-example';
6+
import {
7+
CdkPopoverEditCdkTableFlexExample
8+
} from './cdk-popover-edit-cdk-table-flex/cdk-popover-edit-cdk-table-flex-example';
9+
import {
10+
CdkPopoverEditCdkTableExample
11+
} from './cdk-popover-edit-cdk-table/cdk-popover-edit-cdk-table-example';
12+
import {
13+
CdkPopoverEditCellSpanVanillaTableExample
14+
// tslint:disable-next-line:max-line-length
15+
} from './cdk-popover-edit-cell-span-vanilla-table/cdk-popover-edit-cell-span-vanilla-table-example';
16+
import {
17+
CdkPopoverEditTabOutVanillaTableExample
18+
} from './cdk-popover-edit-tab-out-vanilla-table/cdk-popover-edit-tab-out-vanilla-table-example';
19+
import {
20+
CdkPopoverEditVanillaTableExample
21+
} from './cdk-popover-edit-vanilla-table/cdk-popover-edit-vanilla-table-example';
1122

1223
export {
1324
CdkPopoverEditCdkTableFlexExample,

src/material-experimental/select/testing/shared.spec.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export function runHarnessTests(
4747
});
4848

4949
it('should be able to check whether a select is in multi-selection mode', async () => {
50-
const singleSelection = await loader.getHarness(selectHarness.with({selector: '#single-selection'}));
50+
const singleSelection = await loader.getHarness(selectHarness.with({
51+
selector: '#single-selection'
52+
}));
5153
const multipleSelection =
5254
await loader.getHarness(selectHarness.with({selector: '#multiple-selection'}));
5355

@@ -56,7 +58,9 @@ export function runHarnessTests(
5658
});
5759

5860
it('should get disabled state', async () => {
59-
const singleSelection = await loader.getHarness(selectHarness.with({selector: '#single-selection'}));
61+
const singleSelection = await loader.getHarness(selectHarness.with({
62+
selector: '#single-selection'
63+
}));
6064
const multipleSelection =
6165
await loader.getHarness(selectHarness.with({selector: '#multiple-selection'}));
6266

@@ -71,7 +75,9 @@ export function runHarnessTests(
7175
});
7276

7377
it('should get required state', async () => {
74-
const singleSelection = await loader.getHarness(selectHarness.with({selector: '#single-selection'}));
78+
const singleSelection = await loader.getHarness(selectHarness.with({
79+
selector: '#single-selection'
80+
}));
7581
const multipleSelection =
7682
await loader.getHarness(selectHarness.with({selector: '#multiple-selection'}));
7783

@@ -86,8 +92,12 @@ export function runHarnessTests(
8692
});
8793

8894
it('should get valid state', async () => {
89-
const singleSelection = await loader.getHarness(selectHarness.with({selector: '#single-selection'}));
90-
const withFormControl = await loader.getHarness(selectHarness.with({selector: '#with-form-control'}));
95+
const singleSelection = await loader.getHarness(selectHarness.with({
96+
selector: '#single-selection'
97+
}));
98+
const withFormControl = await loader.getHarness(selectHarness.with({
99+
selector: '#with-form-control'
100+
}));
91101

92102
expect(await singleSelection.isValid()).toBe(true);
93103
expect(await withFormControl.isValid()).toBe(false);

tools/release/base-release-task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class BaseReleaseTask {
5757

5858
// Check if the current branch is in sync with the remote branch.
5959
if (upstreamCommitSha !== localCommitSha) {
60-
console.error(chalk.red(` ✘ The current branch is not in sync with the remote branch. Please ` +
61-
`make sure your local branch "${chalk.italic(publishBranch)}" is up to date.`));
60+
console.error(chalk.red(` ✘ The current branch is not in sync with the remote branch. ` +
61+
`Please make sure your local branch "${chalk.italic(publishBranch)}" is up to date.`));
6262
process.exit(1);
6363
}
6464
}

tslint.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
"node_modules/codelyzer"
66
],
77
"rules": {
8-
"max-line-length": [true, 100],
8+
"max-line-length": [true, {
9+
"limit": 100,
10+
"check-strings": true,
11+
"check-regex": true
12+
}
13+
],
914
// Disable this flag because of SHA tslint#48b0c597f9257712c7d1f04b55ed0aa60e333f6a
1015
// TSLint now shows warnings if types for properties are inferred. This rule needs to be
1116
// disabled because all properties need to have explicit types set to work for Dgeni.

0 commit comments

Comments
 (0)