Skip to content

Commit 57a01bf

Browse files
authored
build: flag unnecessary stylelint disable clauses (#23290)
Bumps Stylelint to the latest version and turns on an option to flag unnecessary disable clauses.
1 parent 38e40f0 commit 57a01bf

File tree

6 files changed

+4
-10
lines changed

6 files changed

+4
-10
lines changed

.stylelintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"defaultSeverity": "error",
3+
"reportNeedlessDisables": true,
4+
"reportInvalidScopeDisables": true,
35
"plugins": [
46
"./tools/stylelint/loader-rule.js",
57
"./tools/stylelint/no-prefixes/index.ts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"semver": "^7.3.4",
221221
"send": "^0.17.1",
222222
"shelljs": "^0.8.3",
223-
"stylelint": "^13.8.0",
223+
"stylelint": "^13.13.1",
224224
"terser": "^4.8.0",
225225
"ts-node": "^9.1.1",
226226
"tsickle": "0.39.1",

src/material-experimental/mdc-helpers/_mdc-helpers.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ $mat-typography-mdc-level-mappings: (
9696

9797
// Configures MDC's global variables to reflect the given theme, applies the given styles,
9898
// then resets the global variables to prevent unintended side effects.
99-
// stylelint-disable-next-line material/theme-mixin-api
10099
@mixin mat-using-mdc-theme($config) {
101100
$primary: theming.get-color-from-palette(map.get($config, primary));
102101
$accent: theming.get-color-from-palette(map.get($config, accent));
@@ -187,7 +186,6 @@ $mat-typography-mdc-level-mappings: (
187186

188187
// Configures MDC's global variables to reflect the given typography config,
189188
// applies the given styles, then resets the global variables to prevent unintended side effects.
190-
// stylelint-disable-next-line material/theme-mixin-api
191189
@mixin mat-using-mdc-typography($config) {
192190
// Save the original values.
193191
$orig-mdc-typography-styles: mdc-typography.$styles;

src/material/core/typography/_typography.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@
171171
@return $config;
172172
}
173173

174-
// stylelint-disable material/theme-mixin-api
175-
176174
/// Emits baseline typographic styles based on a given config.
177175
/// @param {Map} $config-or-theme A typography config for an entire theme.
178176
/// @param {String} $selector Ancestor selector under which native elements, such as h1, will
@@ -263,5 +261,3 @@
263261
margin: 0 0 64px;
264262
}
265263
}
266-
267-
// stylelint-enable material/theme-mixin-api

src/material/sidenav/drawer.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ $drawer-side-drawer-z-index: 2;
77
$drawer-backdrop-z-index: 3;
88
$drawer-over-drawer-z-index: 4;
99

10-
// stylelint-disable max-line-length
1110
// Mixin that creates a new stacking context.
1211
// see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
13-
// stylelint-enable
1412
@mixin drawer-stacking-context($z-index: 1) {
1513
position: relative;
1614

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12619,7 +12619,7 @@ style-search@^0.1.0:
1261912619
resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"
1262012620
integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=
1262112621

12622-
stylelint@^13.8.0:
12622+
stylelint@^13.13.1:
1262312623
version "13.13.1"
1262412624
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.13.1.tgz#fca9c9f5de7990ab26a00f167b8978f083a18f3c"
1262512625
integrity sha512-Mv+BQr5XTUrKqAXmpqm6Ddli6Ief+AiPZkRsIrAoUKFuq/ElkUh9ZMYxXD0iQNZ5ADghZKLOWz1h7hTClB7zgQ==

0 commit comments

Comments
 (0)