File tree 2 files changed +6
-1
lines changed
packages/theme-check-common/src/checks
duplicate-render-snippet-params
unrecognized-render-snippet-params
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ export const DuplicateRenderSnippetParams: LiquidCheckDefinition = {
40
40
{
41
41
message : `Remove duplicate parameter '${ paramName } '` ,
42
42
fix : ( fixer ) => {
43
+ // This parameter removal logic is duplicated in UnrecognizedRenderSnippetParams
44
+ // Consider extracting to a shared utility or simplifying the removal approach in the parsing steps.
45
+ // I chose not to do so here as I would like more examples to see how this should be done.
43
46
const sourceBeforeArg = node . source . slice ( 0 , param . position . start ) ;
44
47
const matches = sourceBeforeArg . match ( / , \s * / g) ;
45
48
const lastWhitespaceMatch = matches ? matches [ matches . length - 1 ] : null ;
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ export const UnrecognizedRenderSnippetParams: LiquidCheckDefinition = {
36
36
{
37
37
message : `Remove '${ param . name } '` ,
38
38
fix : ( fixer ) => {
39
- // This is a bit messy, but it allows us to strip leading and trailing whitespaces and commas
39
+ // This parameter removal logic is duplicated in DuplicateRenderSnippetParams
40
+ // Consider extracting to a shared utility or simplifying the removal approach in the parsing steps.
41
+ // I chose not to do so here as I would like more examples to see how this should be done.
40
42
const sourceBeforeArg = node . source . slice ( 0 , param . position . start ) ;
41
43
const matches = sourceBeforeArg . match ( / , \s * / g) ;
42
44
const lastWhitespaceMatch = matches ? matches [ matches . length - 1 ] : null ;
You can’t perform that action at this time.
0 commit comments