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
5 changes: 5 additions & 0 deletions .changeset/rude-poems-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/theme-graph': patch
---

[internal] Moving @shopify/theme-check-node to being a dev-dependency of the package
14 changes: 14 additions & 0 deletions .changeset/small-items-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@shopify/theme-language-server-common': minor
'@shopify/theme-check-common': minor
'@shopify/theme-check-node': minor
---

Introduce new theme-check to detect invalid CSS class usage in HTML

`ValidScopedCSSClass` detects invalid CSS classes in HTML if it deems them being out of scope.
A CSS class is in-scope if it matches any of the following:
- The CSS class is declared in `assets/*.css` file
- The CSS class is declared in the file's `stylesheet` tag
- The CSS class is declared in a *direct* ancestor's `stylesheet` tag
- The CSS class is declared in a snippet file's `stylesheet` tag that is rendered by this file or its direct ancestor (recursive)
6 changes: 5 additions & 1 deletion packages/theme-check-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@
"line-column": "^1.0.2",
"lodash": "^4.17.23",
"minimatch": "^10.2.1",
"postcss": "^8.5.9",
"postcss-safe-parser": "^7.0.1",
"postcss-selector-parser": "^7.1.1",
"vscode-json-languageservice": "^5.3.10",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
"@types/line-column": "^1.0.0",
"@types/lodash": "^4.17.20"
"@types/lodash": "^4.17.20",
"@types/postcss-safe-parser": "^5.0.4"
}
}
2 changes: 2 additions & 0 deletions packages/theme-check-common/src/checks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { UnusedDocParam } from './unused-doc-param';
import { ValidContentForArguments } from './valid-content-for-arguments';
import { ValidContentForArgumentTypes } from './valid-content-for-argument-types';
import { ValidBlockTarget } from './valid-block-target';
import { ValidScopedCSSClass } from './valid-scoped-css-class';
import { ValidHTMLTranslation } from './valid-html-translation';
import { ValidJSON } from './valid-json';
import { ValidDocParamTypes } from './valid-doc-param-types';
Expand Down Expand Up @@ -123,6 +124,7 @@ export const allChecks: (LiquidCheckDefinition | JSONCheckDefinition)[] = [
ValidHTMLTranslation,
ValidContentForArguments,
ValidContentForArgumentTypes,
ValidScopedCSSClass,
ValidJSON,
ValidDocParamTypes,
ValidLocalBlocks,
Expand Down
Loading
Loading