Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@types/googlemaps": "^3.43.1",
"@types/youtube": "^0.0.42",
"core-js-bundle": "^3.8.2",
"material-components-web": "12.0.0-canary.03f525f9f.0",
"material-components-web": "^12.0.0-canary.a23ecb682.0",
"rxjs": "^6.5.3",
"rxjs-tslint-rules": "^4.33.1",
"systemjs": "0.19.43",
Expand Down Expand Up @@ -91,53 +91,53 @@
"@bazel/terser": "3.3.0",
"@bazel/typescript": "3.3.0",
"@firebase/app-types": "^0.6.1",
"@material/animation": "12.0.0-canary.03f525f9f.0",
"@material/auto-init": "12.0.0-canary.03f525f9f.0",
"@material/banner": "12.0.0-canary.03f525f9f.0",
"@material/base": "12.0.0-canary.03f525f9f.0",
"@material/button": "12.0.0-canary.03f525f9f.0",
"@material/card": "12.0.0-canary.03f525f9f.0",
"@material/checkbox": "12.0.0-canary.03f525f9f.0",
"@material/chips": "12.0.0-canary.03f525f9f.0",
"@material/circular-progress": "12.0.0-canary.03f525f9f.0",
"@material/data-table": "12.0.0-canary.03f525f9f.0",
"@material/density": "12.0.0-canary.03f525f9f.0",
"@material/dialog": "12.0.0-canary.03f525f9f.0",
"@material/dom": "12.0.0-canary.03f525f9f.0",
"@material/drawer": "12.0.0-canary.03f525f9f.0",
"@material/elevation": "12.0.0-canary.03f525f9f.0",
"@material/fab": "12.0.0-canary.03f525f9f.0",
"@material/feature-targeting": "12.0.0-canary.03f525f9f.0",
"@material/floating-label": "12.0.0-canary.03f525f9f.0",
"@material/form-field": "12.0.0-canary.03f525f9f.0",
"@material/icon-button": "12.0.0-canary.03f525f9f.0",
"@material/image-list": "12.0.0-canary.03f525f9f.0",
"@material/layout-grid": "12.0.0-canary.03f525f9f.0",
"@material/line-ripple": "12.0.0-canary.03f525f9f.0",
"@material/linear-progress": "12.0.0-canary.03f525f9f.0",
"@material/list": "12.0.0-canary.03f525f9f.0",
"@material/menu": "12.0.0-canary.03f525f9f.0",
"@material/menu-surface": "12.0.0-canary.03f525f9f.0",
"@material/notched-outline": "12.0.0-canary.03f525f9f.0",
"@material/radio": "12.0.0-canary.03f525f9f.0",
"@material/ripple": "12.0.0-canary.03f525f9f.0",
"@material/rtl": "12.0.0-canary.03f525f9f.0",
"@material/segmented-button": "12.0.0-canary.03f525f9f.0",
"@material/select": "12.0.0-canary.03f525f9f.0",
"@material/shape": "12.0.0-canary.03f525f9f.0",
"@material/slider": "12.0.0-canary.03f525f9f.0",
"@material/snackbar": "12.0.0-canary.03f525f9f.0",
"@material/switch": "12.0.0-canary.03f525f9f.0",
"@material/tab": "12.0.0-canary.03f525f9f.0",
"@material/tab-bar": "12.0.0-canary.03f525f9f.0",
"@material/tab-indicator": "12.0.0-canary.03f525f9f.0",
"@material/tab-scroller": "12.0.0-canary.03f525f9f.0",
"@material/textfield": "12.0.0-canary.03f525f9f.0",
"@material/theme": "12.0.0-canary.03f525f9f.0",
"@material/tooltip": "12.0.0-canary.03f525f9f.0",
"@material/top-app-bar": "12.0.0-canary.03f525f9f.0",
"@material/touch-target": "12.0.0-canary.03f525f9f.0",
"@material/typography": "12.0.0-canary.03f525f9f.0",
"@material/animation": "^12.0.0-canary.a23ecb682.0",
"@material/auto-init": "^12.0.0-canary.a23ecb682.0",
"@material/banner": "^12.0.0-canary.a23ecb682.0",
"@material/base": "^12.0.0-canary.a23ecb682.0",
"@material/button": "^12.0.0-canary.a23ecb682.0",
"@material/card": "^12.0.0-canary.a23ecb682.0",
"@material/checkbox": "^12.0.0-canary.a23ecb682.0",
"@material/chips": "^12.0.0-canary.a23ecb682.0",
"@material/circular-progress": "^12.0.0-canary.a23ecb682.0",
"@material/data-table": "^12.0.0-canary.a23ecb682.0",
"@material/density": "^12.0.0-canary.a23ecb682.0",
"@material/dialog": "^12.0.0-canary.a23ecb682.0",
"@material/dom": "^12.0.0-canary.a23ecb682.0",
"@material/drawer": "^12.0.0-canary.a23ecb682.0",
"@material/elevation": "^12.0.0-canary.a23ecb682.0",
"@material/fab": "^12.0.0-canary.a23ecb682.0",
"@material/feature-targeting": "^12.0.0-canary.a23ecb682.0",
"@material/floating-label": "^12.0.0-canary.a23ecb682.0",
"@material/form-field": "^12.0.0-canary.a23ecb682.0",
"@material/icon-button": "^12.0.0-canary.a23ecb682.0",
"@material/image-list": "^12.0.0-canary.a23ecb682.0",
"@material/layout-grid": "^12.0.0-canary.a23ecb682.0",
"@material/line-ripple": "^12.0.0-canary.a23ecb682.0",
"@material/linear-progress": "^12.0.0-canary.a23ecb682.0",
"@material/list": "^12.0.0-canary.a23ecb682.0",
"@material/menu": "^12.0.0-canary.a23ecb682.0",
"@material/menu-surface": "^12.0.0-canary.a23ecb682.0",
"@material/notched-outline": "^12.0.0-canary.a23ecb682.0",
"@material/radio": "^12.0.0-canary.a23ecb682.0",
"@material/ripple": "^12.0.0-canary.a23ecb682.0",
"@material/rtl": "^12.0.0-canary.a23ecb682.0",
"@material/segmented-button": "^12.0.0-canary.a23ecb682.0",
"@material/select": "^12.0.0-canary.a23ecb682.0",
"@material/shape": "^12.0.0-canary.a23ecb682.0",
"@material/slider": "^12.0.0-canary.a23ecb682.0",
"@material/snackbar": "^12.0.0-canary.a23ecb682.0",
"@material/switch": "^12.0.0-canary.a23ecb682.0",
"@material/tab": "^12.0.0-canary.a23ecb682.0",
"@material/tab-bar": "^12.0.0-canary.a23ecb682.0",
"@material/tab-indicator": "^12.0.0-canary.a23ecb682.0",
"@material/tab-scroller": "^12.0.0-canary.a23ecb682.0",
"@material/textfield": "^12.0.0-canary.a23ecb682.0",
"@material/theme": "^12.0.0-canary.a23ecb682.0",
"@material/tooltip": "^12.0.0-canary.a23ecb682.0",
"@material/top-app-bar": "^12.0.0-canary.a23ecb682.0",
"@material/touch-target": "^12.0.0-canary.a23ecb682.0",
"@material/typography": "^12.0.0-canary.a23ecb682.0",
"@octokit/rest": "18.3.5",
"@schematics/angular": "^12.0.0",
"@types/autoprefixer": "^9.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
# version for the placeholders.
ANGULAR_PACKAGE_VERSION = "^12.0.0 || ^13.0.0-0"
MDC_PACKAGE_VERSION = "^12.0.0-canary.af453daf8.0"
MDC_PACKAGE_VERSION = "^12.0.0-canary.a23ecb682.0"
TSLIB_PACKAGE_VERSION = "^2.1.0"
RXJS_PACKAGE_VERSION = "^6.5.3"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '@material/theme/theme-color' as mdc-theme-color;
@use '@material/switch/deprecated' as mdc-switch;
@use '@material/switch/deprecated' as mdc-switch with ($deprecated-suffix: '');
@use '@material/form-field' as mdc-form-field;
@use 'sass:map';
@use '../mdc-helpers/mdc-helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '@material/switch/deprecated' as mdc-switch;
@use '@material/switch/deprecated' as mdc-switch with ($deprecated-suffix: '');
@use '@material/form-field' as mdc-form-field;
@use '@material/ripple' as mdc-ripple;
@use 'sass:map';
Expand Down
34 changes: 17 additions & 17 deletions tools/stylelint/no-unused-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,34 @@ const factory = (isEnabled: boolean, _options: never, context: {fix: boolean}) =

/** Extracts the namespace of an `@use` rule from its parameters. */
function extractNamespaceFromUseStatement(params: string): string|null {
const closeQuoteIndex = Math.max(params.lastIndexOf(`"`), params.lastIndexOf(`'`));
const openQuoteIndex = Math.max(params.indexOf(`"`), params.indexOf(`'`));
const closeQuoteIndex =
Math.max(params.indexOf(`"`, openQuoteIndex + 1), params.indexOf(`'`, openQuoteIndex + 1));

if (closeQuoteIndex > -1) {
const asExpression = 'as ';
const asIndex = params.indexOf(asExpression, closeQuoteIndex);
const withIndex = params.indexOf(' with', asIndex);

// If we found an ` as ` expression, we consider the rest of the text as the namespace.
if (asIndex > -1) {
return params.slice(asIndex + asExpression.length).trim();
return withIndex == -1 ?
params.slice(asIndex + asExpression.length).trim() :
params.slice(asIndex + asExpression.length, withIndex).trim();
}

const openQuoteIndex = Math.max(params.lastIndexOf(`"`, closeQuoteIndex - 1),
params.lastIndexOf(`'`, closeQuoteIndex - 1));
const importPath = params.slice(openQuoteIndex + 1, closeQuoteIndex)
// Sass allows for leading underscores to be omitted and it technically supports .scss.
.replace(/^_|(\.import)?\.scss$|\.import$/g, '');

if (openQuoteIndex > -1) {
const importPath = params.slice(openQuoteIndex + 1, closeQuoteIndex)
// Sass allows for leading underscores to be omitted and it technically supports .scss.
.replace(/^_|(\.import)?\.scss$|\.import$/g, '');

// Built-in Sass imports look like `sass:map`.
if (importPath.startsWith('sass:')) {
return importPath.split('sass:')[1];
}

// Sass ignores `/index` and infers the namespace as the next segment in the path.
const fileName = basename(importPath);
return fileName === 'index' ? basename(join(fileName, '..')) : fileName;
// Built-in Sass imports look like `sass:map`.
if (importPath.startsWith('sass:')) {
return importPath.split('sass:')[1];
}

// Sass ignores `/index` and infers the namespace as the next segment in the path.
const fileName = basename(importPath);
return fileName === 'index' ? basename(join(fileName, '..')) : fileName;
}

return null;
Expand Down
Loading