From 6d0c5f140978752adb6763cee634f5e7c9012f07 Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Mon, 28 Aug 2023 16:59:59 +0000 Subject: [PATCH] fix lint --- .stylelintrc.json | 12 +++++++++++- src/material/autocomplete/autocomplete.ts | 11 +++++++---- src/material/button/_button-theme.scss | 1 - src/material/button/_fab-theme.scss | 1 - src/material/button/_icon-button-theme.scss | 1 - src/material/core/mdc-helpers/_mdc-helpers.scss | 3 --- src/material/core/theming/_m2-inspection.scss | 2 +- src/material/core/tokens/m2/mat/_paginator.scss | 1 - src/material/core/tokens/m2/mat/_radio.scss | 2 -- src/material/core/tokens/m2/mat/_slide-toggle.scss | 1 - src/material/core/tokens/m2/mat/_slider.scss | 1 - src/material/core/tokens/m2/mdc/_extended-fab.scss | 2 -- src/material/core/tokens/m2/mdc/_fab.scss | 1 - src/material/core/tokens/m2/mdc/_list.scss | 2 -- src/material/core/tokens/m2/mdc/_slider.scss | 2 -- src/material/core/tokens/m2/mdc/_switch.scss | 1 - src/material/core/typography/_typography-utils.scss | 4 ---- src/material/core/typography/_typography.scss | 3 --- src/material/input/_input-theme.scss | 1 - src/material/list/_list-theme.scss | 1 - src/material/radio/_radio-theme.scss | 1 - src/material/slide-toggle/_slide-toggle-theme.scss | 1 - src/material/slider/_slider-theme.scss | 2 -- 23 files changed, 19 insertions(+), 38 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 7e0b17c91a70..f0267172a95d 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -147,14 +147,24 @@ "overrides": [ { "files": [ + "**/_button-theme.scss", "**/_card-theme.scss", + "**/_checkbox-theme.scss", "**/_core-theme.scss", + "**/_fab-theme.scss", "**/_form-field-theme.scss", + "**/_icon-button-theme.scss", + "**/_input-theme.scss", + "**/_list-theme.scss", "**/_optgroup-theme.scss", "**/_option-theme.scss", + "**/_paginator-theme.scss", "**/_progress-bar-theme.scss", "**/_pseudo-checkbox-theme.scss", - "**/_ripple-theme.scss" + "**/_radio-theme.scss", + "**/_ripple-theme.scss", + "**/_slide-toggle-theme.scss", + "**/_slider-theme.scss" ], "rules": { "material/theme-mixin-api": false diff --git a/src/material/autocomplete/autocomplete.ts b/src/material/autocomplete/autocomplete.ts index 33a436245470..48e6adc54230 100644 --- a/src/material/autocomplete/autocomplete.ts +++ b/src/material/autocomplete/autocomplete.ts @@ -250,10 +250,13 @@ export class MatAutocomplete @Input('class') set classList(value: string | string[]) { if (value && value.length) { - this._classList = coerceStringArray(value).reduce((classList, className) => { - classList[className] = true; - return classList; - }, {} as {[key: string]: boolean}); + this._classList = coerceStringArray(value).reduce( + (classList, className) => { + classList[className] = true; + return classList; + }, + {} as {[key: string]: boolean}, + ); } else { this._classList = {}; } diff --git a/src/material/button/_button-theme.scss b/src/material/button/_button-theme.scss index 7c2e7506c5e8..f3385a051e92 100644 --- a/src/material/button/_button-theme.scss +++ b/src/material/button/_button-theme.scss @@ -1,4 +1,3 @@ -@use 'sass:map'; @use '@material/button/button' as mdc-button; @use '@material/button/button-theme' as mdc-button-theme; @use '@material/button/button-text-theme' as mdc-button-text-theme; diff --git a/src/material/button/_fab-theme.scss b/src/material/button/_fab-theme.scss index c633be53094e..f96189d2cee3 100644 --- a/src/material/button/_fab-theme.scss +++ b/src/material/button/_fab-theme.scss @@ -1,4 +1,3 @@ -@use 'sass:map'; @use '@material/fab/fab' as mdc-fab; @use '@material/fab/fab-theme' as mdc-fab-theme; @use '@material/fab/extended-fab-theme' as mdc-extended-fab-theme; diff --git a/src/material/button/_icon-button-theme.scss b/src/material/button/_icon-button-theme.scss index 34ab1eb40e42..37db62a952be 100644 --- a/src/material/button/_icon-button-theme.scss +++ b/src/material/button/_icon-button-theme.scss @@ -1,4 +1,3 @@ -@use 'sass:map'; @use 'sass:math'; @use '@material/density/functions' as mdc-density-functions; @use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme; diff --git a/src/material/core/mdc-helpers/_mdc-helpers.scss b/src/material/core/mdc-helpers/_mdc-helpers.scss index ec3ce9c366fe..e54487469eeb 100644 --- a/src/material/core/mdc-helpers/_mdc-helpers.scss +++ b/src/material/core/mdc-helpers/_mdc-helpers.scss @@ -1,10 +1,7 @@ // TODO(mmalerba): this file should be split into separate cohesive partials for things like // "theming", "typography", "core". - -@use '../theming/theming'; @use '../theming/inspection'; @use '../typography/typography'; -@use '../typography/typography-utils'; @use '@material/feature-targeting' as mdc-feature-targeting; @use '@material/typography' as mdc-typography; @use '@material/theme/theme-color' as mdc-theme-color; diff --git a/src/material/core/theming/_m2-inspection.scss b/src/material/core/theming/_m2-inspection.scss index b7d5d39dfce7..64b7b86ca633 100644 --- a/src/material/core/theming/_m2-inspection.scss +++ b/src/material/core/theming/_m2-inspection.scss @@ -6,7 +6,7 @@ @use '../typography/versioning' as typography-versioning; /// Key used to access the Angular Material theme internals. -$_internals: _mat-theming-internals-do-not-accesst; +$_internals: _mat-theming-internals-do-not-access; /// Keys that indicate a config object is a color config. $_color-keys: ( diff --git a/src/material/core/tokens/m2/mat/_paginator.scss b/src/material/core/tokens/m2/mat/_paginator.scss index 00e8dedac593..257f3b35e1d2 100644 --- a/src/material/core/tokens/m2/mat/_paginator.scss +++ b/src/material/core/tokens/m2/mat/_paginator.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @use '../../token-utils'; -@use '../../../typography/typography-utils'; @use '../../../theming/theming'; @use '../../../theming/inspection'; @use '../../../style/sass-utils'; diff --git a/src/material/core/tokens/m2/mat/_radio.scss b/src/material/core/tokens/m2/mat/_radio.scss index ddefae7bb4bb..78cfe308d876 100644 --- a/src/material/core/tokens/m2/mat/_radio.scss +++ b/src/material/core/tokens/m2/mat/_radio.scss @@ -1,6 +1,4 @@ -@use 'sass:map'; @use '../../token-utils'; -@use '../../../theming/theming'; @use '../../../theming/inspection'; @use '../../../style/sass-utils'; diff --git a/src/material/core/tokens/m2/mat/_slide-toggle.scss b/src/material/core/tokens/m2/mat/_slide-toggle.scss index a0a6cc1f63ab..fe1355cbe825 100644 --- a/src/material/core/tokens/m2/mat/_slide-toggle.scss +++ b/src/material/core/tokens/m2/mat/_slide-toggle.scss @@ -1,7 +1,6 @@ @use '../../token-utils'; @use '../../../style/sass-utils'; @use '../../../theming/inspection'; -@use '../../../typography/typography-utils'; // The prefix used to generate the fully qualified name for tokens in this file. $prefix: (mat, slide-toggle); diff --git a/src/material/core/tokens/m2/mat/_slider.scss b/src/material/core/tokens/m2/mat/_slider.scss index 1e0165422c1f..e74aa342deff 100644 --- a/src/material/core/tokens/m2/mat/_slider.scss +++ b/src/material/core/tokens/m2/mat/_slider.scss @@ -1,4 +1,3 @@ -@use 'sass:map'; @use '../../token-utils'; @use '../../../style/sass-utils'; @use '../../../theming/inspection'; diff --git a/src/material/core/tokens/m2/mdc/_extended-fab.scss b/src/material/core/tokens/m2/mdc/_extended-fab.scss index 5e32dcff2f24..45a535ae863a 100644 --- a/src/material/core/tokens/m2/mdc/_extended-fab.scss +++ b/src/material/core/tokens/m2/mdc/_extended-fab.scss @@ -1,6 +1,4 @@ -@use '../../../mdc-helpers/mdc-helpers'; @use '../../token-utils'; -@use '../../../typography/typography-utils'; @use '../../../theming/inspection'; @use 'sass:map'; diff --git a/src/material/core/tokens/m2/mdc/_fab.scss b/src/material/core/tokens/m2/mdc/_fab.scss index a7ffbbefccbc..d108f56ea574 100644 --- a/src/material/core/tokens/m2/mdc/_fab.scss +++ b/src/material/core/tokens/m2/mdc/_fab.scss @@ -1,4 +1,3 @@ -@use '../../../theming/theming'; @use '../../../theming/inspection'; @use '../../token-utils'; diff --git a/src/material/core/tokens/m2/mdc/_list.scss b/src/material/core/tokens/m2/mdc/_list.scss index 4b4729759d66..044e68ff3193 100644 --- a/src/material/core/tokens/m2/mdc/_list.scss +++ b/src/material/core/tokens/m2/mdc/_list.scss @@ -1,7 +1,5 @@ @use 'sass:map'; -@use '../../../theming/theming'; @use '../../../theming/inspection'; -@use '../../../typography/typography-utils'; @use '../../../style/sass-utils'; @use '../../token-utils'; diff --git a/src/material/core/tokens/m2/mdc/_slider.scss b/src/material/core/tokens/m2/mdc/_slider.scss index 5527afd5856e..a514ba147831 100644 --- a/src/material/core/tokens/m2/mdc/_slider.scss +++ b/src/material/core/tokens/m2/mdc/_slider.scss @@ -1,10 +1,8 @@ @use 'sass:map'; -@use '../../../theming/theming'; @use '../../../theming/inspection'; @use '../../token-utils'; @use '../../../style/elevation'; @use '../../../style/sass-utils'; -@use '../../../typography/typography-utils'; // The prefix used to generate the fully qualified name for tokens in this file. $prefix: (mdc, slider); diff --git a/src/material/core/tokens/m2/mdc/_switch.scss b/src/material/core/tokens/m2/mdc/_switch.scss index f8b6045a7535..e05675a28ea0 100644 --- a/src/material/core/tokens/m2/mdc/_switch.scss +++ b/src/material/core/tokens/m2/mdc/_switch.scss @@ -1,7 +1,6 @@ @use 'sass:map'; @use '../../../style/elevation'; @use '../../../style/sass-utils'; -@use '../../../theming/theming'; @use '../../../theming/inspection'; @use '../../token-utils'; diff --git a/src/material/core/typography/_typography-utils.scss b/src/material/core/typography/_typography-utils.scss index 70295afa2117..a359215d6338 100644 --- a/src/material/core/typography/_typography-utils.scss +++ b/src/material/core/typography/_typography-utils.scss @@ -1,10 +1,6 @@ @use 'sass:list'; -@use 'sass:map'; @use 'sass:math'; -@use 'sass:meta'; -@use 'sass:string'; @use './property-getters'; -@use '../theming/inspection'; // Property getters live in their own file to avoid circular dependencies, but we re-export them // here so that historical imports from this file continue to work without needing to be updated. diff --git a/src/material/core/typography/_typography.scss b/src/material/core/typography/_typography.scss index 63cf3a076366..37400026ffb5 100644 --- a/src/material/core/typography/_typography.scss +++ b/src/material/core/typography/_typography.scss @@ -1,6 +1,3 @@ -@use 'sass:map'; -@use 'sass:math'; -@use 'sass:meta'; @use 'typography-utils'; @use '../theming/theming'; @use './versioning'; diff --git a/src/material/input/_input-theme.scss b/src/material/input/_input-theme.scss index c375bf1ef78c..88e0e36271dd 100644 --- a/src/material/input/_input-theme.scss +++ b/src/material/input/_input-theme.scss @@ -1,7 +1,6 @@ @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; -@use '../core/mdc-helpers/mdc-helpers'; @mixin color($theme) {} diff --git a/src/material/list/_list-theme.scss b/src/material/list/_list-theme.scss index 7b0d459213a8..2335395f21c5 100644 --- a/src/material/list/_list-theme.scss +++ b/src/material/list/_list-theme.scss @@ -11,7 +11,6 @@ @use '../core/tokens/m2/mdc/radio' as tokens-mdc-radio; @use '../core/tokens/m2/mdc/list' as tokens-mdc-list; @use '../core/typography/typography'; -@use '../core/typography/typography-utils'; @mixin base($config-or-theme) { // Add default values for tokens not related to color, typography, or density. diff --git a/src/material/radio/_radio-theme.scss b/src/material/radio/_radio-theme.scss index 0a5c8815f180..36a16110a871 100644 --- a/src/material/radio/_radio-theme.scss +++ b/src/material/radio/_radio-theme.scss @@ -8,7 +8,6 @@ @use '../core/typography/typography'; @use '../core/tokens/m2/mdc/radio' as tokens-mdc-radio; @use '../core/tokens/m2/mat/radio' as tokens-mat-radio; -@use 'sass:map'; @mixin color($theme) { @include mdc-helpers.using-mdc-theme($theme) { diff --git a/src/material/slide-toggle/_slide-toggle-theme.scss b/src/material/slide-toggle/_slide-toggle-theme.scss index 07b9b3de8e0e..5386667261e1 100644 --- a/src/material/slide-toggle/_slide-toggle-theme.scss +++ b/src/material/slide-toggle/_slide-toggle-theme.scss @@ -1,4 +1,3 @@ -@use 'sass:map'; @use '@material/switch/switch-theme' as mdc-switch-theme; @use '@material/form-field' as mdc-form-field; @use '../core/theming/theming'; diff --git a/src/material/slider/_slider-theme.scss b/src/material/slider/_slider-theme.scss index 5cae3c9b7bb5..889df1e6e45b 100644 --- a/src/material/slider/_slider-theme.scss +++ b/src/material/slider/_slider-theme.scss @@ -1,5 +1,3 @@ -@use 'sass:map'; - @use '@material/slider/slider-theme' as mdc-slider-theme; @use '../core/theming/theming'; @use '../core/theming/inspection';