Skip to content

Commit 4136c01

Browse files
committed
Added test and changeset
1 parent 55e2001 commit 4136c01

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.changeset/hungry-ravens-sneeze.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@shopify/prettier-plugin-liquid': minor
3+
'@shopify/liquid-html-parser': minor
4+
'@shopify/theme-check-common': minor
5+
---
6+
7+
Updated theme check to support `doc` tag inside of `snippet` tag

packages/theme-check-common/src/checks/unsupported-doc-tag/index.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Module: UnsupportedDocTag', () => {
1414

1515
expect(offenses).to.have.length(1);
1616
expect(offenses[0].message).to.equal(
17-
'The `doc` tag can only be used within a snippet or block.',
17+
'The `doc` tag can only be used within an inline snippet, snippet or block.',
1818
);
1919
});
2020

@@ -42,4 +42,20 @@ describe('Module: UnsupportedDocTag', () => {
4242

4343
expect(offenses).to.be.empty;
4444
});
45+
46+
it('should not report an error when `doc` tag is used inside inline snippet', async () => {
47+
const layoutSourceCode = `
48+
{% snippet %}
49+
${sourceCode}
50+
{% endsnippet %}
51+
`;
52+
53+
const offenses = await runLiquidCheck(
54+
UnsupportedDocTag,
55+
layoutSourceCode,
56+
'file://layout/theme.liquid',
57+
);
58+
59+
expect(offenses).to.be.empty;
60+
});
4561
});

0 commit comments

Comments
 (0)