Skip to content

Commit 34284b9

Browse files
authored
fix: enforce multiline selectors use backtick (#6386)
* fix: enforce multiline selectors use backtick * add checkbox validator
1 parent ff4e6e9 commit 34284b9

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

src/lib/autocomplete/autocomplete-trigger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export function getMdAutocompleteMissingPanelError(): Error {
9797
}
9898

9999
@Directive({
100-
selector: 'input[mdAutocomplete], input[matAutocomplete],' +
101-
'textarea[mdAutocomplete], textarea[matAutocomplete]',
100+
selector: `input[mdAutocomplete], input[matAutocomplete],
101+
textarea[mdAutocomplete], textarea[matAutocomplete]`,
102102
host: {
103103
'role': 'combobox',
104104
'autocomplete': 'off',

src/lib/button/button.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ export const _MdButtonMixinBase = mixinColor(mixinDisabled(mixinDisableRipple(Md
112112
*/
113113
@Component({
114114
moduleId: module.id,
115-
selector: 'button[md-button], button[md-raised-button], button[md-icon-button],' +
116-
'button[md-fab], button[md-mini-fab],' +
117-
'button[mat-button], button[mat-raised-button], button[mat-icon-button],' +
118-
'button[mat-fab], button[mat-mini-fab]',
115+
selector: `button[md-button], button[md-raised-button], button[md-icon-button],
116+
button[md-fab], button[md-mini-fab],
117+
button[mat-button], button[mat-raised-button], button[mat-icon-button],
118+
button[mat-fab], button[mat-mini-fab]`,
119119
host: {
120120
'[disabled]': 'disabled || null',
121121
},

src/lib/card/card.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export class MdCardContent {}
3030
* @docs-private
3131
*/
3232
@Directive({
33-
selector: 'md-card-title, mat-card-title, [md-card-title], [mat-card-title],' +
34-
'[mdCardTitle], [matCardTitle]',
33+
selector: `md-card-title, mat-card-title, [md-card-title], [mat-card-title],
34+
[mdCardTitle], [matCardTitle]`,
3535
host: {
3636
'class': 'mat-card-title'
3737
}
@@ -43,8 +43,8 @@ export class MdCardTitle {}
4343
* @docs-private
4444
*/
4545
@Directive({
46-
selector: 'md-card-subtitle, mat-card-subtitle, [md-card-subtitle], [mat-card-subtitle],' +
47-
'[mdCardSubtitle], [matCardSubtitle]',
46+
selector: `md-card-subtitle, mat-card-subtitle, [md-card-subtitle], [mat-card-subtitle],
47+
[mdCardSubtitle], [matCardSubtitle]`,
4848
host: {
4949
'class': 'mat-card-subtitle'
5050
}

src/lib/checkbox/checkbox-required-validator.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ export const MD_CHECKBOX_REQUIRED_VALIDATOR: Provider = {
3030
* work with `md-checkbox`.
3131
*/
3232
@Directive({
33-
selector:
34-
'md-checkbox[required][formControlName],' +
35-
'mat-checkbox[required][formControlName],' +
36-
'md-checkbox[required][formControl],md-checkbox[required][ngModel],' +
37-
'mat-checkbox[required][formControl],mat-checkbox[required][ngModel]',
33+
selector: `md-checkbox[required][formControlName],
34+
mat-checkbox[required][formControlName],
35+
md-checkbox[required][formControl], md-checkbox[required][ngModel],
36+
mat-checkbox[required][formControl], mat-checkbox[required][ngModel]`,
3837
providers: [MD_CHECKBOX_REQUIRED_VALIDATOR],
3938
host: {'[attr.required]': 'required ? "" : null'}
4039
})

src/lib/dialog/dialog-content-directives.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ let dialogElementUid = 0;
1717
* Button that will close the current dialog.
1818
*/
1919
@Directive({
20-
selector: 'button[md-dialog-close], button[mat-dialog-close],' +
21-
'button[mdDialogClose], button[matDialogClose]',
20+
selector: `button[md-dialog-close], button[mat-dialog-close],
21+
button[mdDialogClose], button[matDialogClose]`,
2222
host: {
2323
'(click)': 'dialogRef.close(dialogResult)',
2424
'[attr.aria-label]': 'ariaLabel',
@@ -75,8 +75,8 @@ export class MdDialogTitle implements OnInit {
7575
* Scrollable content container of a dialog.
7676
*/
7777
@Directive({
78-
selector: '[md-dialog-content], md-dialog-content, [mat-dialog-content], mat-dialog-content,' +
79-
'[mdDialogContent], [matDialogContent]',
78+
selector: `[md-dialog-content], md-dialog-content, [mat-dialog-content], mat-dialog-content,
79+
[mdDialogContent], [matDialogContent]`,
8080
host: {'class': 'mat-dialog-content'}
8181
})
8282
export class MdDialogContent { }
@@ -87,8 +87,8 @@ export class MdDialogContent { }
8787
* Stays fixed to the bottom when scrolling.
8888
*/
8989
@Directive({
90-
selector: '[md-dialog-actions], md-dialog-actions, [mat-dialog-actions], mat-dialog-actions,' +
91-
'[mdDialogActions], [matDialogActions]',
90+
selector: `[md-dialog-actions], md-dialog-actions, [mat-dialog-actions], mat-dialog-actions,
91+
[mdDialogActions], [matDialogActions]`,
9292
host: {'class': 'mat-dialog-actions'}
9393
})
9494
export class MdDialogActions { }

src/lib/input/autosize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {Platform} from '@angular/cdk/platform';
1515
* Directive to automatically resize a textarea to fit its content.
1616
*/
1717
@Directive({
18-
selector: 'textarea[md-autosize], textarea[mdTextareaAutosize],' +
19-
'textarea[mat-autosize], textarea[matTextareaAutosize]',
18+
selector: `textarea[md-autosize], textarea[mdTextareaAutosize],
19+
textarea[mat-autosize], textarea[matTextareaAutosize]`,
2020
exportAs: 'mdTextareaAutosize',
2121
host: {
2222
'(input)': 'resizeToFitContent()',

0 commit comments

Comments
 (0)