@platformos/platformos-check-common 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/AugmentedPlatformOSDocset.d.ts +11 -0
  3. package/dist/AugmentedPlatformOSDocset.js +81 -0
  4. package/dist/AugmentedPlatformOSDocset.js.map +1 -0
  5. package/dist/JSONValidator.js +1 -1
  6. package/dist/JSONValidator.js.map +1 -1
  7. package/dist/checks/deprecated-filter/index.js +4 -41
  8. package/dist/checks/deprecated-filter/index.js.map +1 -1
  9. package/dist/checks/deprecated-tag/index.js +21 -22
  10. package/dist/checks/deprecated-tag/index.js.map +1 -1
  11. package/dist/checks/duplicate-function-arguments/index.js +1 -1
  12. package/dist/checks/duplicate-function-arguments/index.js.map +1 -1
  13. package/dist/checks/duplicate-render-partial-arguments/index.js +1 -1
  14. package/dist/checks/duplicate-render-partial-arguments/index.js.map +1 -1
  15. package/dist/checks/graphql/index.js +1 -1
  16. package/dist/checks/graphql/index.js.map +1 -1
  17. package/dist/checks/img-width-and-height/index.js +1 -1
  18. package/dist/checks/img-width-and-height/index.js.map +1 -1
  19. package/dist/checks/index.d.ts +3 -3
  20. package/dist/checks/index.js +4 -79
  21. package/dist/checks/index.js.map +1 -1
  22. package/dist/checks/json-syntax-error/index.js +1 -1
  23. package/dist/checks/json-syntax-error/index.js.map +1 -1
  24. package/dist/checks/liquid-html-syntax-error/index.js +2 -2
  25. package/dist/checks/liquid-html-syntax-error/index.js.map +1 -1
  26. package/dist/checks/matching-translations/index.d.ts +2 -2
  27. package/dist/checks/matching-translations/index.js +20 -31
  28. package/dist/checks/matching-translations/index.js.map +1 -1
  29. package/dist/checks/metadata-params/index.js +6 -3
  30. package/dist/checks/metadata-params/index.js.map +1 -1
  31. package/dist/checks/missing-asset/index.js +1 -1
  32. package/dist/checks/missing-asset/index.js.map +1 -1
  33. package/dist/checks/missing-partial/index.d.ts +6 -0
  34. package/dist/checks/missing-partial/index.js +70 -0
  35. package/dist/checks/missing-partial/index.js.map +1 -0
  36. package/dist/checks/orphaned-partial/index.js +4 -4
  37. package/dist/checks/orphaned-partial/index.js.map +1 -1
  38. package/dist/checks/parser-blocking-script/index.js +10 -36
  39. package/dist/checks/parser-blocking-script/index.js.map +1 -1
  40. package/dist/checks/parser-blocking-script/suggestions.d.ts +1 -2
  41. package/dist/checks/parser-blocking-script/suggestions.js +1 -11
  42. package/dist/checks/parser-blocking-script/suggestions.js.map +1 -1
  43. package/dist/checks/reserved-doc-param-names/index.js +6 -5
  44. package/dist/checks/reserved-doc-param-names/index.js.map +1 -1
  45. package/dist/checks/translation-key-exists/index.js +1 -1
  46. package/dist/checks/translation-key-exists/index.js.map +1 -1
  47. package/dist/checks/unclosed-html-element/index.js +5 -1
  48. package/dist/checks/unclosed-html-element/index.js.map +1 -1
  49. package/dist/checks/undefined-object/index.js +7 -30
  50. package/dist/checks/undefined-object/index.js.map +1 -1
  51. package/dist/checks/unique-doc-param-names/index.js +1 -1
  52. package/dist/checks/unique-doc-param-names/index.js.map +1 -1
  53. package/dist/checks/unknown-filter/index.js +3 -3
  54. package/dist/checks/unknown-filter/index.js.map +1 -1
  55. package/dist/checks/unknown-property/index.js +1 -1
  56. package/dist/checks/unknown-property/index.js.map +1 -1
  57. package/dist/checks/unrecognized-render-partial-arguments/index.js +2 -2
  58. package/dist/checks/unrecognized-render-partial-arguments/index.js.map +1 -1
  59. package/dist/checks/unused-assign/index.js +1 -1
  60. package/dist/checks/unused-assign/index.js.map +1 -1
  61. package/dist/checks/unused-doc-param/index.js +1 -1
  62. package/dist/checks/unused-doc-param/index.js.map +1 -1
  63. package/dist/checks/utils.js +1 -1
  64. package/dist/checks/utils.js.map +1 -1
  65. package/dist/checks/valid-content-for-arguments/index.js +1 -1
  66. package/dist/checks/valid-content-for-arguments/index.js.map +1 -1
  67. package/dist/checks/valid-doc-param-types/index.js +4 -4
  68. package/dist/checks/valid-doc-param-types/index.js.map +1 -1
  69. package/dist/checks/valid-html-translation/index.d.ts +2 -2
  70. package/dist/checks/valid-html-translation/index.js +4 -4
  71. package/dist/checks/valid-html-translation/index.js.map +1 -1
  72. package/dist/checks/valid-json/index.js +1 -1
  73. package/dist/checks/valid-json/index.js.map +1 -1
  74. package/dist/checks/valid-render-partial-argument-types/index.js +2 -2
  75. package/dist/checks/valid-render-partial-argument-types/index.js.map +1 -1
  76. package/dist/checks/variable-name/index.js +1 -1
  77. package/dist/checks/variable-name/index.js.map +1 -1
  78. package/dist/context-utils.d.ts +2 -7
  79. package/dist/context-utils.js +39 -109
  80. package/dist/context-utils.js.map +1 -1
  81. package/dist/disabled-checks/index.js +4 -2
  82. package/dist/disabled-checks/index.js.map +1 -1
  83. package/dist/find-root.d.ts +7 -10
  84. package/dist/find-root.js +10 -17
  85. package/dist/find-root.js.map +1 -1
  86. package/dist/fixes/autofix.d.ts +4 -4
  87. package/dist/fixes/autofix.js +2 -2
  88. package/dist/fixes/autofix.js.map +1 -1
  89. package/dist/fixes/correctors/index.js +4 -0
  90. package/dist/fixes/correctors/index.js.map +1 -1
  91. package/dist/index.d.ts +4 -5
  92. package/dist/index.js +34 -17
  93. package/dist/index.js.map +1 -1
  94. package/dist/jsonc/parse.d.ts +1 -1
  95. package/dist/jsonc/parse.js +1 -1
  96. package/dist/liquid-doc/arguments.d.ts +7 -8
  97. package/dist/liquid-doc/arguments.js +20 -28
  98. package/dist/liquid-doc/arguments.js.map +1 -1
  99. package/dist/liquid-doc/liquidDoc.d.ts +1 -1
  100. package/dist/liquid-doc/liquidDoc.js.map +1 -1
  101. package/dist/liquid-doc/utils.d.ts +1 -1
  102. package/dist/liquid-doc/utils.js +4 -3
  103. package/dist/liquid-doc/utils.js.map +1 -1
  104. package/dist/path.d.ts +1 -0
  105. package/dist/path.js +5 -1
  106. package/dist/path.js.map +1 -1
  107. package/dist/test/MockApp.d.ts +16 -0
  108. package/dist/test/MockApp.js +16 -0
  109. package/dist/test/MockApp.js.map +1 -0
  110. package/dist/test/MockFileSystem.d.ts +3 -3
  111. package/dist/test/MockFileSystem.js +6 -6
  112. package/dist/test/MockFileSystem.js.map +1 -1
  113. package/dist/test/index.d.ts +1 -1
  114. package/dist/test/index.js +1 -1
  115. package/dist/test/index.js.map +1 -1
  116. package/dist/test/test-helper.d.ts +10 -9
  117. package/dist/test/test-helper.js +15 -106
  118. package/dist/test/test-helper.js.map +1 -1
  119. package/dist/to-source-code.d.ts +4 -3
  120. package/dist/to-source-code.js +20 -0
  121. package/dist/to-source-code.js.map +1 -1
  122. package/dist/tsconfig.tsbuildinfo +1 -1
  123. package/dist/types/platformos-liquid-docs.d.ts +128 -0
  124. package/dist/types/platformos-liquid-docs.js +3 -0
  125. package/dist/types/platformos-liquid-docs.js.map +1 -0
  126. package/dist/types/schemas/index.d.ts +0 -2
  127. package/dist/types/schemas/index.js.map +1 -1
  128. package/dist/types.d.ts +18 -67
  129. package/dist/types.js +3 -5
  130. package/dist/types.js.map +1 -1
  131. package/dist/utils/file-utils.js +1 -2
  132. package/dist/utils/file-utils.js.map +1 -1
  133. package/dist/utils/index.d.ts +0 -1
  134. package/dist/utils/index.js +0 -1
  135. package/dist/utils/index.js.map +1 -1
  136. package/dist/yaml/parse.d.ts +5 -0
  137. package/dist/yaml/parse.js +94 -0
  138. package/dist/yaml/parse.js.map +1 -0
  139. package/package.json +9 -9
  140. package/src/{AugmentedThemeDocset.spec.ts → AugmentedPlatformOSDocset.spec.ts} +47 -34
  141. package/src/AugmentedPlatformOSDocset.ts +89 -0
  142. package/src/JSONValidator.ts +1 -1
  143. package/src/checks/deprecated-filter/index.spec.ts +76 -248
  144. package/src/checks/deprecated-filter/index.ts +5 -53
  145. package/src/checks/deprecated-tag/index.spec.ts +85 -34
  146. package/src/checks/deprecated-tag/index.ts +27 -22
  147. package/src/checks/duplicate-function-arguments/index.ts +1 -1
  148. package/src/checks/duplicate-render-partial-arguments/index.ts +1 -1
  149. package/src/checks/graphql/index.ts +1 -1
  150. package/src/checks/img-width-and-height/index.ts +1 -1
  151. package/src/checks/index.ts +11 -80
  152. package/src/checks/invalid-hash-assign-target/index.spec.ts +14 -14
  153. package/src/checks/json-syntax-error/index.ts +1 -1
  154. package/src/checks/liquid-html-syntax-error/checks/InvalidBooleanExpression.spec.ts +0 -11
  155. package/src/checks/liquid-html-syntax-error/checks/InvalidLoopArguments.spec.ts +1 -2
  156. package/src/checks/liquid-html-syntax-error/index.spec.ts +1 -6
  157. package/src/checks/liquid-html-syntax-error/index.ts +2 -2
  158. package/src/checks/matching-translations/index.spec.ts +89 -346
  159. package/src/checks/matching-translations/index.ts +24 -35
  160. package/src/checks/metadata-params/index.ts +5 -7
  161. package/src/checks/missing-asset/index.ts +1 -1
  162. package/src/checks/{missing-template → missing-partial}/index.spec.ts +6 -6
  163. package/src/checks/{missing-template → missing-partial}/index.ts +6 -20
  164. package/src/checks/orphaned-partial/index.ts +3 -3
  165. package/src/checks/parser-blocking-script/index.spec.ts +0 -118
  166. package/src/checks/parser-blocking-script/index.ts +3 -33
  167. package/src/checks/parser-blocking-script/suggestions.ts +1 -28
  168. package/src/checks/translation-key-exists/index.ts +1 -1
  169. package/src/checks/unclosed-html-element/index.ts +5 -1
  170. package/src/checks/undefined-object/index.spec.ts +3 -109
  171. package/src/checks/undefined-object/index.ts +8 -33
  172. package/src/checks/unique-doc-param-names/index.ts +1 -1
  173. package/src/checks/unknown-filter/index.spec.ts +2 -2
  174. package/src/checks/unknown-filter/index.ts +3 -3
  175. package/src/checks/unknown-property/index.ts +1 -1
  176. package/src/checks/unrecognized-render-partial-arguments/index.spec.ts +5 -5
  177. package/src/checks/unrecognized-render-partial-arguments/index.ts +2 -5
  178. package/src/checks/unused-assign/index.spec.ts +0 -30
  179. package/src/checks/unused-assign/index.ts +1 -1
  180. package/src/checks/unused-doc-param/index.ts +1 -1
  181. package/src/checks/utils.ts +1 -1
  182. package/src/checks/valid-doc-param-types/index.ts +4 -4
  183. package/src/checks/valid-html-translation/index.spec.ts +42 -32
  184. package/src/checks/valid-html-translation/index.ts +7 -7
  185. package/src/checks/valid-json/index.ts +1 -1
  186. package/src/checks/valid-render-partial-argument-types/index.ts +2 -5
  187. package/src/checks/variable-name/index.ts +1 -1
  188. package/src/context-utils.spec.ts +49 -77
  189. package/src/context-utils.ts +39 -128
  190. package/src/disabled-checks/index.spec.ts +35 -0
  191. package/src/disabled-checks/index.ts +4 -2
  192. package/src/find-root.ts +12 -22
  193. package/src/fixes/autofix.spec.ts +2 -2
  194. package/src/fixes/autofix.ts +4 -4
  195. package/src/fixes/correctors/index.ts +4 -0
  196. package/src/ignore.spec.ts +0 -1
  197. package/src/index.ts +33 -21
  198. package/src/jsonc/parse.ts +1 -1
  199. package/src/liquid-doc/arguments.spec.ts +19 -45
  200. package/src/liquid-doc/arguments.ts +26 -39
  201. package/src/liquid-doc/liquidDoc.ts +1 -2
  202. package/src/liquid-doc/utils.ts +4 -3
  203. package/src/path.ts +1 -0
  204. package/src/test/{MockTheme.ts → MockApp.ts} +1 -1
  205. package/src/test/MockFileSystem.ts +9 -6
  206. package/src/test/index.ts +1 -1
  207. package/src/test/test-helper.ts +29 -127
  208. package/src/to-source-code.ts +20 -1
  209. package/src/types/{theme-liquid-docs.ts → platformos-liquid-docs.ts} +8 -13
  210. package/src/types/schemas/index.ts +0 -2
  211. package/src/types.ts +21 -92
  212. package/src/utils/file-utils.ts +0 -1
  213. package/src/utils/index.ts +0 -1
  214. package/src/yaml/parse.ts +111 -0
  215. package/src/AugmentedThemeDocset.ts +0 -137
  216. package/src/checks/app-block-missing-schema/index.spec.ts +0 -121
  217. package/src/checks/app-block-missing-schema/index.ts +0 -46
  218. package/src/checks/app-block-valid-tags/index.spec.ts +0 -96
  219. package/src/checks/app-block-valid-tags/index.ts +0 -54
  220. package/src/checks/asset-preload/index.spec.ts +0 -78
  221. package/src/checks/asset-preload/index.ts +0 -65
  222. package/src/checks/asset-size-app-block-css/index.spec.ts +0 -88
  223. package/src/checks/asset-size-app-block-css/index.ts +0 -78
  224. package/src/checks/asset-size-app-block-javascript/index.spec.ts +0 -66
  225. package/src/checks/asset-size-app-block-javascript/index.ts +0 -78
  226. package/src/checks/asset-size-css/index.spec.ts +0 -166
  227. package/src/checks/asset-size-css/index.ts +0 -160
  228. package/src/checks/asset-size-javascript/index.spec.ts +0 -184
  229. package/src/checks/asset-size-javascript/index.ts +0 -144
  230. package/src/checks/block-id-usage/index.spec.ts +0 -76
  231. package/src/checks/block-id-usage/index.ts +0 -72
  232. package/src/checks/cdn-preconnect/index.spec.ts +0 -40
  233. package/src/checks/cdn-preconnect/index.ts +0 -43
  234. package/src/checks/content-for-header-modification/index.spec.ts +0 -65
  235. package/src/checks/content-for-header-modification/index.ts +0 -72
  236. package/src/checks/deprecate-bgsizes/index.spec.ts +0 -41
  237. package/src/checks/deprecate-bgsizes/index.ts +0 -49
  238. package/src/checks/deprecate-lazysizes/index.spec.ts +0 -26
  239. package/src/checks/deprecate-lazysizes/index.ts +0 -58
  240. package/src/checks/deprecated-filter/fixes.ts +0 -264
  241. package/src/checks/deprecated-fonts-on-sections-and-blocks/deprecated-fonts-data.ts +0 -1343
  242. package/src/checks/deprecated-fonts-on-sections-and-blocks/index.spec.ts +0 -613
  243. package/src/checks/deprecated-fonts-on-sections-and-blocks/index.ts +0 -284
  244. package/src/checks/deprecated-fonts-on-settings-schema/index.spec.ts +0 -102
  245. package/src/checks/deprecated-fonts-on-settings-schema/index.ts +0 -66
  246. package/src/checks/duplicate-content-for-arguments/index.spec.ts +0 -98
  247. package/src/checks/duplicate-content-for-arguments/index.ts +0 -43
  248. package/src/checks/empty-block-content/index.spec.ts +0 -117
  249. package/src/checks/empty-block-content/index.ts +0 -60
  250. package/src/checks/hardcoded-routes/index.spec.ts +0 -58
  251. package/src/checks/hardcoded-routes/index.ts +0 -100
  252. package/src/checks/json-missing-block/index.spec.ts +0 -435
  253. package/src/checks/json-missing-block/index.ts +0 -56
  254. package/src/checks/json-missing-block/missing-block-utils.ts +0 -147
  255. package/src/checks/liquid-free-settings/index.spec.ts +0 -180
  256. package/src/checks/liquid-free-settings/index.ts +0 -79
  257. package/src/checks/missing-content-for-arguments/index.spec.ts +0 -144
  258. package/src/checks/missing-content-for-arguments/index.ts +0 -46
  259. package/src/checks/pagination-size/index.spec.ts +0 -158
  260. package/src/checks/pagination-size/index.ts +0 -104
  261. package/src/checks/remote-asset/index.spec.ts +0 -280
  262. package/src/checks/remote-asset/index.ts +0 -238
  263. package/src/checks/reserved-doc-param-names/index.spec.ts +0 -62
  264. package/src/checks/reserved-doc-param-names/index.ts +0 -57
  265. package/src/checks/schema-presets-block-order/index.spec.ts +0 -344
  266. package/src/checks/schema-presets-block-order/index.ts +0 -154
  267. package/src/checks/schema-presets-static-blocks/index.spec.ts +0 -145
  268. package/src/checks/schema-presets-static-blocks/index.ts +0 -126
  269. package/src/checks/static-stylesheet-and-javascript-tags/index.spec.ts +0 -257
  270. package/src/checks/static-stylesheet-and-javascript-tags/index.ts +0 -48
  271. package/src/checks/unique-settings-id/index.spec.ts +0 -24
  272. package/src/checks/unique-settings-id/index.ts +0 -84
  273. package/src/checks/unique-settings-id/test-data.ts +0 -1191
  274. package/src/checks/unique-static-block-id/index.spec.ts +0 -55
  275. package/src/checks/unique-static-block-id/index.ts +0 -60
  276. package/src/checks/unrecognized-content-for-arguments/index.spec.ts +0 -145
  277. package/src/checks/unrecognized-content-for-arguments/index.ts +0 -55
  278. package/src/checks/valid-block-target/index.spec.ts +0 -1396
  279. package/src/checks/valid-block-target/index.ts +0 -142
  280. package/src/checks/valid-content-for-argument-types/index.spec.ts +0 -382
  281. package/src/checks/valid-content-for-argument-types/index.ts +0 -42
  282. package/src/checks/valid-content-for-arguments/index.spec.ts +0 -107
  283. package/src/checks/valid-content-for-arguments/index.ts +0 -98
  284. package/src/checks/valid-local-blocks/index.spec.ts +0 -286
  285. package/src/checks/valid-local-blocks/index.ts +0 -100
  286. package/src/checks/valid-local-blocks/valid-block-utils.ts +0 -97
  287. package/src/checks/valid-schema/index.spec.ts +0 -174
  288. package/src/checks/valid-schema/index.ts +0 -41
  289. package/src/checks/valid-schema-name/index.spec.ts +0 -112
  290. package/src/checks/valid-schema-name/index.ts +0 -75
  291. package/src/checks/valid-settings-key/index.spec.ts +0 -321
  292. package/src/checks/valid-settings-key/index.ts +0 -144
  293. package/src/checks/valid-static-block-type/index.spec.ts +0 -38
  294. package/src/checks/valid-static-block-type/index.ts +0 -58
  295. package/src/checks/valid-visible-if/index.spec.ts +0 -619
  296. package/src/checks/valid-visible-if/index.ts +0 -184
  297. package/src/checks/valid-visible-if/visible-if-utils.ts +0 -158
  298. package/src/tags/content-for.ts +0 -25
  299. package/src/to-schema.ts +0 -231
  300. package/src/types/schemas/section.ts +0 -86
  301. package/src/types/schemas/theme-block.ts +0 -34
  302. package/src/types/theme-schemas.ts +0 -80
  303. package/src/utils/block.ts +0 -300
  304. package/src/utils/markup.ts +0 -10
@@ -1,13 +1,5 @@
1
1
  import { LiquidFilter } from '@platformos/liquid-html-parser';
2
- import {
3
- Severity,
4
- SourceCodeType,
5
- LiquidCheckDefinition,
6
- LiquidHtmlSuggestion,
7
- FilterEntry,
8
- Fixer,
9
- } from '../../types';
10
- import { fixHexToRgba, suggestImageUrlFix, suggestImgTagFix, suggestImgUrlFix } from './fixes';
2
+ import { Severity, SourceCodeType, LiquidCheckDefinition, FilterEntry } from '../../types';
11
3
 
12
4
  export const DeprecatedFilter: LiquidCheckDefinition = {
13
5
  meta: {
@@ -15,8 +7,8 @@ export const DeprecatedFilter: LiquidCheckDefinition = {
15
7
  aliases: ['DeprecatedFilters'],
16
8
  name: 'Deprecated Filter',
17
9
  docs: {
18
- description: 'Discourages using deprecated filters in themes.',
19
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecated-filter',
10
+ description: 'Discourages using deprecated filters.',
11
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/deprecated-filter',
20
12
  recommended: true,
21
13
  },
22
14
  type: SourceCodeType.LiquidHtml,
@@ -26,13 +18,13 @@ export const DeprecatedFilter: LiquidCheckDefinition = {
26
18
  },
27
19
 
28
20
  create(context) {
29
- if (!context.themeDocset) {
21
+ if (!context.platformosDocset) {
30
22
  return {};
31
23
  }
32
24
 
33
25
  return {
34
26
  LiquidFilter: async (node: LiquidFilter) => {
35
- const filters = await context.themeDocset!.filters();
27
+ const filters = await context.platformosDocset!.filters();
36
28
 
37
29
  const deprecatedFilter = filters.find((f) => {
38
30
  return f.deprecated && f.name === node.name;
@@ -46,13 +38,9 @@ export const DeprecatedFilter: LiquidCheckDefinition = {
46
38
  const recommendedFilter = filters.find((f) => f.name === recommendedFilterName);
47
39
 
48
40
  const message = deprecatedFilterMessage(deprecatedFilter, recommendedFilter);
49
- const suggest = deprecatedFilterSuggestion(node);
50
- const fix = deprecatedFilterFix(node);
51
41
 
52
42
  context.report({
53
43
  message,
54
- suggest,
55
- fix,
56
44
  startIndex: node.position.start + 1,
57
45
  endIndex: node.position.end,
58
46
  });
@@ -61,42 +49,6 @@ export const DeprecatedFilter: LiquidCheckDefinition = {
61
49
  },
62
50
  };
63
51
 
64
- function deprecatedFilterSuggestion(node: LiquidFilter): LiquidHtmlSuggestion[] | undefined {
65
- const filter = node.name;
66
-
67
- switch (filter) {
68
- case 'img_tag':
69
- return suggestImgTagFix(node);
70
- case 'img_url':
71
- return suggestImgUrlFix(node);
72
- case 'article_img_url':
73
- case 'collection_img_url':
74
- case 'product_img_url':
75
- /**
76
- * These filters rely on the usage of the `image_url`
77
- * filter as the fix.
78
- */
79
- return suggestImageUrlFix(filter, node);
80
- case 'currency_selector':
81
- /**
82
- * Cannot be fixed.
83
- *
84
- * Deprecated without a direct replacement because the
85
- * currency form has also been deprecated. The currency
86
- * form was replaced by the localization form.
87
- */
88
- return;
89
- }
90
- }
91
-
92
- function deprecatedFilterFix(node: LiquidFilter): Fixer<SourceCodeType.LiquidHtml> | undefined {
93
- const filter = node.name;
94
-
95
- if (filter === 'hex_to_rgba') {
96
- return fixHexToRgba(node);
97
- }
98
- }
99
-
100
52
  function deprecatedFilterMessage(deprecated: FilterEntry, recommended?: FilterEntry) {
101
53
  if (recommended) {
102
54
  return `Deprecated filter '${deprecated.name}', consider using '${recommended.name}'.`;
@@ -2,66 +2,117 @@ import { expect, describe, it } from 'vitest';
2
2
  import { highlightedOffenses, runLiquidCheck } from '../../test';
3
3
  import { DeprecatedTag } from './index';
4
4
 
5
- describe.skip('Module: DeprecatedTag', () => {
6
- it('should report an offense when include tag is used', async () => {
7
- const sourceCode = `
8
- {% include 'templates/foo.liquid' %}
9
- `;
10
- const offenses = await runLiquidCheck(DeprecatedTag, sourceCode);
5
+ const mockDependencies = {
6
+ platformosDocset: {
7
+ async graphQL() {
8
+ return null;
9
+ },
10
+ async filters() {
11
+ return [];
12
+ },
13
+ async objects() {
14
+ return [];
15
+ },
16
+ async liquidDrops() {
17
+ return [];
18
+ },
19
+ async tags() {
20
+ return [
21
+ {
22
+ name: 'include',
23
+ deprecated: true,
24
+ deprecation_reason: "Use the 'render' tag instead.",
25
+ },
26
+ {
27
+ name: 'deprecated_no_reason',
28
+ deprecated: true,
29
+ },
30
+ {
31
+ name: 'render',
32
+ },
33
+ ];
34
+ },
35
+ },
36
+ };
37
+
38
+ describe('Module: DeprecatedTag', () => {
39
+ it('should report an offense when a deprecated tag is used', async () => {
40
+ const sourceCode = `{% include 'templates/foo.liquid' %}`;
41
+
42
+ const offenses = await runLiquidCheck(
43
+ DeprecatedTag,
44
+ sourceCode,
45
+ 'file.liquid',
46
+ mockDependencies,
47
+ );
11
48
 
12
49
  expect(offenses).toHaveLength(1);
13
- expect(offenses[0].message).toEqual(`Use the 'render' tag instead of 'include'`);
50
+ expect(offenses[0].message).toEqual(`Deprecated tag 'include': Use the 'render' tag instead.`);
14
51
 
15
52
  const highlights = highlightedOffenses({ 'file.liquid': sourceCode }, offenses);
16
53
  expect(highlights).toEqual(['include']);
17
54
  });
18
55
 
19
- it('should not report an offense when render tag is used', async () => {
20
- const sourceCode = `
21
- {% render 'templates/foo.liquid' %}
22
- `;
23
- const offenses = await runLiquidCheck(DeprecatedTag, sourceCode);
56
+ it('should not report an offense when a non-deprecated tag is used', async () => {
57
+ const sourceCode = `{% render 'templates/foo.liquid' %}`;
58
+
59
+ const offenses = await runLiquidCheck(
60
+ DeprecatedTag,
61
+ sourceCode,
62
+ 'file.liquid',
63
+ mockDependencies,
64
+ );
24
65
 
25
66
  expect(offenses).toHaveLength(0);
67
+ });
26
68
 
27
- const highlights = highlightedOffenses({ 'file.liquid': sourceCode }, offenses);
28
- expect(highlights).toHaveLength(0);
69
+ it('should report a generic message when no deprecation_reason is provided', async () => {
70
+ const sourceCode = `{% deprecated_no_reason %}`;
71
+
72
+ const offenses = await runLiquidCheck(
73
+ DeprecatedTag,
74
+ sourceCode,
75
+ 'file.liquid',
76
+ mockDependencies,
77
+ );
78
+
79
+ expect(offenses).toHaveLength(1);
80
+ expect(offenses[0].message).toEqual(`Deprecated tag 'deprecated_no_reason'.`);
29
81
  });
30
82
 
31
- it('should suggest replacing include tag with render tag', async () => {
83
+ it('should report multiple offenses when multiple deprecated tags are used', async () => {
32
84
  const sourceCode = `
33
85
  {% include 'foo.liquid' %}
34
86
  {% assign greeting = "hello world" %}
35
87
  {% include 'greeting.liquid' %}
36
88
  `;
37
- const offenses = await runLiquidCheck(DeprecatedTag, sourceCode);
38
89
 
39
- expect(offenses).toHaveLength(2);
40
- if (!offenses[0].suggest || !offenses[1].suggest) return;
90
+ const offenses = await runLiquidCheck(
91
+ DeprecatedTag,
92
+ sourceCode,
93
+ 'file.liquid',
94
+ mockDependencies,
95
+ );
41
96
 
42
- expect(offenses[0].suggest[0].message).toEqual(`Replace 'include' with 'render'`);
43
- expect(offenses[1].suggest[0].message).toEqual(`Replace 'include' with 'render'`);
97
+ expect(offenses).toHaveLength(2);
98
+ expect(offenses[0].message).toEqual(`Deprecated tag 'include': Use the 'render' tag instead.`);
99
+ expect(offenses[1].message).toEqual(`Deprecated tag 'include': Use the 'render' tag instead.`);
44
100
 
45
101
  const highlights = highlightedOffenses({ 'file.liquid': sourceCode }, offenses);
46
- expect(highlights).toHaveLength(2);
47
- expect(highlights[0]).toBe('include');
48
- expect(highlights[1]).toBe('include');
102
+ expect(highlights).toEqual(['include', 'include']);
49
103
  });
50
104
 
51
- it('should report multiple offenses when multiple include tags are used in the same line', async () => {
52
- const sourceCode = "{% include 'foo.liquid' %} Some text {% include 'bar.liquid' %}";
53
- const offenses = await runLiquidCheck(DeprecatedTag, sourceCode);
105
+ it('should highlight only the tag name', async () => {
106
+ const sourceCode = `{% include 'foo.liquid' %}`;
54
107
 
55
- expect(offenses).toHaveLength(2);
56
- });
57
-
58
- it('should report offenses when include tags are nested', async () => {
59
- const sourceCode = "{% if true %} {% include 'foo.liquid' %} {% endif %}";
60
- const offenses = await runLiquidCheck(DeprecatedTag, sourceCode);
108
+ const offenses = await runLiquidCheck(
109
+ DeprecatedTag,
110
+ sourceCode,
111
+ 'file.liquid',
112
+ mockDependencies,
113
+ );
61
114
 
62
115
  expect(offenses).toHaveLength(1);
63
- expect(offenses[0].message).toEqual(`Use the 'render' tag instead of 'include'`);
64
-
65
116
  const highlights = highlightedOffenses({ 'file.liquid': sourceCode }, offenses);
66
117
  expect(highlights).toEqual(['include']);
67
118
  });
@@ -7,7 +7,7 @@ export const DeprecatedTag: LiquidCheckDefinition = {
7
7
  name: 'Deprecated Tag',
8
8
  docs: {
9
9
  description: 'This check is aimed at eliminating the use of deprecated tags.',
10
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/deprecated-tag',
10
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/deprecated-tag',
11
11
  recommended: true,
12
12
  },
13
13
  type: SourceCodeType.LiquidHtml,
@@ -17,29 +17,34 @@ export const DeprecatedTag: LiquidCheckDefinition = {
17
17
  },
18
18
 
19
19
  create(context) {
20
+ if (!context.platformosDocset) {
21
+ return {};
22
+ }
23
+
20
24
  return {
21
25
  async LiquidTag(node) {
22
- // commenting this out to stop include from getting flagged
23
- // if (node.name === 'include') {
24
- // const start = node.source.substring(node.position.start);
25
- // const includeStartIndex = start.indexOf('include');
26
- // const includeEndIndex = includeStartIndex + 'include'.length;
27
- // const includeStart = node.position.start + includeStartIndex;
28
- // const includeEnd = node.position.start + includeEndIndex;
29
- // context.report({
30
- // message: `Use the 'render' tag instead of 'include'`,
31
- // startIndex: includeStart,
32
- // endIndex: includeEnd,
33
- // suggest: [
34
- // {
35
- // message: `Replace 'include' with 'render'`,
36
- // fix: (corrector) => {
37
- // corrector.replace(includeStart, includeEnd, 'render');
38
- // },
39
- // },
40
- // ],
41
- // });
42
- // }
26
+ const tags = await context.platformosDocset!.tags();
27
+
28
+ const deprecatedTag = tags.find((t) => t.deprecated && t.name === node.name);
29
+
30
+ if (!deprecatedTag) {
31
+ return;
32
+ }
33
+
34
+ const source = node.source.substring(node.position.start);
35
+ const tagNameIndex = source.indexOf(node.name);
36
+ const startIndex = node.position.start + tagNameIndex;
37
+ const endIndex = startIndex + node.name.length;
38
+
39
+ const message = deprecatedTag.deprecation_reason
40
+ ? `Deprecated tag '${node.name}': ${deprecatedTag.deprecation_reason}`
41
+ : `Deprecated tag '${node.name}'.`;
42
+
43
+ context.report({
44
+ message,
45
+ startIndex,
46
+ endIndex,
47
+ });
43
48
  },
44
49
  };
45
50
  },
@@ -11,7 +11,7 @@ export const DuplicateFunctionArguments: LiquidCheckDefinition = {
11
11
  description:
12
12
  'This check ensures that no duplicate argument names are provided when invoking partial as a function.',
13
13
  recommended: true,
14
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/duplicate-function-arguments',
14
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/duplicate-function-arguments',
15
15
  },
16
16
  type: SourceCodeType.LiquidHtml,
17
17
  severity: Severity.WARNING,
@@ -11,7 +11,7 @@ export const DuplicateRenderPartialArguments: LiquidCheckDefinition = {
11
11
  description:
12
12
  'This check ensures that no duplicate argument names are provided when rendering a partial.',
13
13
  recommended: true,
14
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/duplicate-render-partial-arguments',
14
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/duplicate-render-partial-arguments',
15
15
  },
16
16
  type: SourceCodeType.LiquidHtml,
17
17
  severity: Severity.WARNING,
@@ -35,7 +35,7 @@ export const GraphQLCheck: GraphQLCheckDefinition = {
35
35
 
36
36
  create(context) {
37
37
  const validateContent = async (content: string) => {
38
- const graphQLSchemaString = await context.themeDocset?.graphQL();
38
+ const graphQLSchemaString = await context.platformosDocset?.graphQL();
39
39
  if (!graphQLSchemaString) {
40
40
  return;
41
41
  }
@@ -9,7 +9,7 @@ export const ImgWidthAndHeight: LiquidCheckDefinition = {
9
9
  description:
10
10
  'This check is aimed at eliminating content layout shift in themes by enforcing the use of the width and height attributes on img tags.',
11
11
  recommended: true,
12
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/img-width-and-height',
12
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/img-width-and-height',
13
13
  },
14
14
  type: SourceCodeType.LiquidHtml,
15
15
  severity: Severity.ERROR,
@@ -3,140 +3,71 @@ import {
3
3
  GraphQLCheckDefinition,
4
4
  JSONCheckDefinition,
5
5
  LiquidCheckDefinition,
6
+ YAMLCheckDefinition,
6
7
  } from '../types';
7
8
 
8
- import { AppBlockValidTags } from './app-block-valid-tags';
9
- import { AssetPreload } from './asset-preload';
10
- import { AssetSizeAppBlockCSS } from './asset-size-app-block-css';
11
- import { AssetSizeAppBlockJavaScript } from './asset-size-app-block-javascript';
12
- import { AssetSizeCSS } from './asset-size-css';
13
- import { AssetSizeJavaScript } from './asset-size-javascript';
14
- import { BlockIdUsage } from './block-id-usage';
15
- import { CdnPreconnect } from './cdn-preconnect';
16
- import { ContentForHeaderModification } from './content-for-header-modification';
17
- import { DeprecateBgsizes } from './deprecate-bgsizes';
18
- import { DeprecateLazysizes } from './deprecate-lazysizes';
19
9
  import { DeprecatedFilter } from './deprecated-filter';
20
- import { DeprecatedFontsOnSectionsAndBlocks } from './deprecated-fonts-on-sections-and-blocks';
21
- import { DeprecatedFontsOnSettingsSchema } from './deprecated-fonts-on-settings-schema';
22
10
  import { DeprecatedTag } from './deprecated-tag';
23
11
  import { DuplicateRenderPartialArguments } from './duplicate-render-partial-arguments';
24
- import { DuplicateContentForArguments } from './duplicate-content-for-arguments';
25
- import { EmptyBlockContent } from './empty-block-content';
26
- import { HardcodedRoutes } from './hardcoded-routes';
27
12
  import { ImgWidthAndHeight } from './img-width-and-height';
28
- import { JSONMissingBlock } from './json-missing-block';
29
13
  import { JSONSyntaxError } from './json-syntax-error';
30
- import { LiquidFreeSettings } from './liquid-free-settings';
31
14
  import { LiquidHTMLSyntaxError } from './liquid-html-syntax-error';
32
15
  import { MatchingTranslations } from './matching-translations';
33
16
  import { MissingAsset } from './missing-asset';
34
- import { MissingContentForArguments } from './missing-content-for-arguments';
35
- import { MissingTemplate } from './missing-template';
17
+ import { MissingPartial } from './missing-partial';
36
18
  import { OrphanedPartial } from './orphaned-partial';
37
- import { PaginationSize } from './pagination-size';
38
19
  import { ParserBlockingScript } from './parser-blocking-script';
39
- import { SchemaPresetsBlockOrder } from './schema-presets-block-order';
40
- import { SchemaPresetsStaticBlocks } from './schema-presets-static-blocks';
41
- import { RemoteAsset } from './remote-asset';
42
- import { ReservedDocParamNames } from './reserved-doc-param-names';
43
- import { StaticStylesheetAndJavascriptTags } from './static-stylesheet-and-javascript-tags';
44
20
  import { TranslationKeyExists } from './translation-key-exists';
45
21
  import { UnclosedHTMLElement } from './unclosed-html-element';
46
22
  import { UndefinedObject } from './undefined-object';
47
23
  import { UniqueDocParamNames } from './unique-doc-param-names';
48
- import { UniqueStaticBlockId } from './unique-static-block-id';
49
24
  import { UnknownFilter } from './unknown-filter';
50
- import { UnrecognizedContentForArguments } from './unrecognized-content-for-arguments';
51
25
  import { UnrecognizedRenderPartialArguments } from './unrecognized-render-partial-arguments';
52
26
  import { UnusedAssign } from './unused-assign';
53
27
  import { UnusedDocParam } from './unused-doc-param';
54
- import { ValidContentForArguments } from './valid-content-for-arguments';
55
- import { ValidContentForArgumentTypes } from './valid-content-for-argument-types';
56
- import { ValidBlockTarget } from './valid-block-target';
57
28
  import { ValidHTMLTranslation } from './valid-html-translation';
58
29
  import { ValidJSON } from './valid-json';
59
30
  import { ValidDocParamTypes } from './valid-doc-param-types';
60
- import { ValidLocalBlocks } from './valid-local-blocks';
61
31
  import { ValidRenderPartialArgumentTypes } from './valid-render-partial-argument-types';
62
- import { ValidSchema } from './valid-schema';
63
- import { ValidSchemaName } from './valid-schema-name';
64
- import { ValidSettingsKey } from './valid-settings-key';
65
- import { ValidStaticBlockType } from './valid-static-block-type';
66
- import { ValidVisibleIf, ValidVisibleIfSettingsSchema } from './valid-visible-if';
67
32
  import { VariableName } from './variable-name';
68
- import { AppBlockMissingSchema } from './app-block-missing-schema';
69
- import { UniqueSettingIds } from './unique-settings-id';
70
33
  import { MetadataParamsCheck } from './metadata-params';
71
34
  import { GraphQLVariablesCheck } from './graphql-variables';
72
35
  import { GraphQLCheck } from './graphql';
73
36
  import { UnknownProperty } from './unknown-property';
74
37
  import { InvalidHashAssignTarget } from './invalid-hash-assign-target';
38
+ import { DuplicateFunctionArguments } from './duplicate-function-arguments';
75
39
 
76
- export const allChecks: (LiquidCheckDefinition | JSONCheckDefinition | GraphQLCheckDefinition)[] = [
77
- AppBlockValidTags,
78
- AssetPreload,
79
- AssetSizeAppBlockCSS,
80
- AssetSizeAppBlockJavaScript,
81
- AssetSizeCSS,
82
- AssetSizeJavaScript,
83
- BlockIdUsage,
84
- CdnPreconnect,
85
- ContentForHeaderModification,
86
- DeprecateBgsizes,
87
- DeprecateLazysizes,
40
+ export const allChecks: (
41
+ | LiquidCheckDefinition
42
+ | JSONCheckDefinition
43
+ | GraphQLCheckDefinition
44
+ | YAMLCheckDefinition
45
+ )[] = [
88
46
  DeprecatedFilter,
89
- DeprecatedFontsOnSectionsAndBlocks,
90
- DeprecatedFontsOnSettingsSchema,
91
47
  DeprecatedTag,
92
- DuplicateContentForArguments,
48
+ DuplicateFunctionArguments,
93
49
  DuplicateRenderPartialArguments,
94
- EmptyBlockContent,
95
- HardcodedRoutes,
96
50
  ImgWidthAndHeight,
97
- JSONMissingBlock,
98
51
  JSONSyntaxError,
99
- LiquidFreeSettings,
100
52
  LiquidHTMLSyntaxError,
101
53
  MatchingTranslations,
102
54
  MissingAsset,
103
- MissingContentForArguments,
104
- MissingTemplate,
105
- AppBlockMissingSchema,
55
+ MissingPartial,
106
56
  OrphanedPartial,
107
- PaginationSize,
108
57
  ParserBlockingScript,
109
- SchemaPresetsBlockOrder,
110
- SchemaPresetsStaticBlocks,
111
- RemoteAsset,
112
- ReservedDocParamNames,
113
- StaticStylesheetAndJavascriptTags,
114
58
  TranslationKeyExists,
115
59
  UnclosedHTMLElement,
116
60
  UndefinedObject,
117
61
  UniqueDocParamNames,
118
- UniqueSettingIds,
119
- UniqueStaticBlockId,
120
62
  UnknownFilter,
121
- UnrecognizedContentForArguments,
122
63
  UnrecognizedRenderPartialArguments,
123
64
  UnusedAssign,
124
65
  UnusedDocParam,
125
- ValidBlockTarget,
126
66
  ValidHTMLTranslation,
127
- ValidContentForArguments,
128
- ValidContentForArgumentTypes,
129
67
  ValidJSON,
130
68
  ValidDocParamTypes,
131
- ValidLocalBlocks,
132
69
  ValidRenderPartialArgumentTypes,
133
- ValidSchema,
134
- ValidSettingsKey,
135
- ValidStaticBlockType,
136
- ValidVisibleIf,
137
- ValidVisibleIfSettingsSchema,
138
70
  VariableName,
139
- ValidSchemaName,
140
71
  MetadataParamsCheck,
141
72
  GraphQLVariablesCheck,
142
73
  GraphQLCheck,
@@ -1,10 +1,10 @@
1
1
  import { describe, it, expect } from 'vitest';
2
2
  import { InvalidHashAssignTarget } from './index';
3
- import { check, MockTheme } from '../../test';
3
+ import { check, MockApp } from '../../test';
4
4
 
5
5
  describe('Module: InvalidHashAssignTarget', () => {
6
6
  it('should report an error when hash_assign is used on a number', async () => {
7
- const theme: MockTheme = {
7
+ const theme: MockApp = {
8
8
  'file.liquid': `
9
9
  {% assign x = 10 %}
10
10
  {% hash_assign x['key'] = 'value' %}
@@ -18,7 +18,7 @@ describe('Module: InvalidHashAssignTarget', () => {
18
18
  });
19
19
 
20
20
  it('should report an error when hash_assign is used on a string', async () => {
21
- const theme: MockTheme = {
21
+ const theme: MockApp = {
22
22
  'file.liquid': `
23
23
  {% assign x = 'hello' %}
24
24
  {% hash_assign x['key'] = 'value' %}
@@ -31,7 +31,7 @@ describe('Module: InvalidHashAssignTarget', () => {
31
31
  });
32
32
 
33
33
  it('should report an error when hash_assign is used on a boolean', async () => {
34
- const theme: MockTheme = {
34
+ const theme: MockApp = {
35
35
  'file.liquid': `
36
36
  {% assign x = true %}
37
37
  {% hash_assign x['key'] = 'value' %}
@@ -44,7 +44,7 @@ describe('Module: InvalidHashAssignTarget', () => {
44
44
  });
45
45
 
46
46
  it('should report an error when hash_assign is used on an array (range)', async () => {
47
- const theme: MockTheme = {
47
+ const theme: MockApp = {
48
48
  'file.liquid': `
49
49
  {% assign x = (1..5) %}
50
50
  {% hash_assign x['key'] = 'value' %}
@@ -57,7 +57,7 @@ describe('Module: InvalidHashAssignTarget', () => {
57
57
  });
58
58
 
59
59
  it('should not report an error when hash_assign is used on an object from parse_json', async () => {
60
- const theme: MockTheme = {
60
+ const theme: MockApp = {
61
61
  'file.liquid': `
62
62
  {% assign x = '{}' | parse_json %}
63
63
  {% hash_assign x['key'] = 'value' %}
@@ -69,7 +69,7 @@ describe('Module: InvalidHashAssignTarget', () => {
69
69
  });
70
70
 
71
71
  it('should not report an error when hash_assign is used on an object from parse_json tag', async () => {
72
- const theme: MockTheme = {
72
+ const theme: MockApp = {
73
73
  'file.liquid': `
74
74
  {% parse_json x %}
75
75
  {}
@@ -83,7 +83,7 @@ describe('Module: InvalidHashAssignTarget', () => {
83
83
  });
84
84
 
85
85
  it('should not report an error when hash_assign is used on an object from graphql', async () => {
86
- const theme: MockTheme = {
86
+ const theme: MockApp = {
87
87
  'file.liquid': `
88
88
  {% graphql result %}
89
89
  query { user { id } }
@@ -97,7 +97,7 @@ describe('Module: InvalidHashAssignTarget', () => {
97
97
  });
98
98
 
99
99
  it('should not report an error when hash_assign is used on an untyped variable', async () => {
100
- const theme: MockTheme = {
100
+ const theme: MockApp = {
101
101
  'file.liquid': `
102
102
  {% hash_assign unknown_var['key'] = 'value' %}
103
103
  `,
@@ -108,7 +108,7 @@ describe('Module: InvalidHashAssignTarget', () => {
108
108
  });
109
109
 
110
110
  it('should not report an error when hash_assign is used on a function return', async () => {
111
- const theme: MockTheme = {
111
+ const theme: MockApp = {
112
112
  'file.liquid': `
113
113
  {% function data = 'lib/get_data' %}
114
114
  {% hash_assign data['extra'] = 'value' %}
@@ -120,7 +120,7 @@ describe('Module: InvalidHashAssignTarget', () => {
120
120
  });
121
121
 
122
122
  it('should track reassignment and report error on new type', async () => {
123
- const theme: MockTheme = {
123
+ const theme: MockApp = {
124
124
  'file.liquid': `
125
125
  {% assign x = '{}' | parse_json %}
126
126
  {% hash_assign x['key1'] = 'value1' %}
@@ -135,7 +135,7 @@ describe('Module: InvalidHashAssignTarget', () => {
135
135
  });
136
136
 
137
137
  it('should handle increment/decrement as numbers', async () => {
138
- const theme: MockTheme = {
138
+ const theme: MockApp = {
139
139
  'file.liquid': `
140
140
  {% increment counter %}
141
141
  {% hash_assign counter['key'] = 'value' %}
@@ -148,7 +148,7 @@ describe('Module: InvalidHashAssignTarget', () => {
148
148
  });
149
149
 
150
150
  it('should handle capture as string', async () => {
151
- const theme: MockTheme = {
151
+ const theme: MockApp = {
152
152
  'file.liquid': `
153
153
  {% capture x %}hello{% endcapture %}
154
154
  {% hash_assign x['key'] = 'value' %}
@@ -161,7 +161,7 @@ describe('Module: InvalidHashAssignTarget', () => {
161
161
  });
162
162
 
163
163
  it('should allow multiple hash_assign on same object', async () => {
164
- const theme: MockTheme = {
164
+ const theme: MockApp = {
165
165
  'file.liquid': `
166
166
  {% assign x = '{}' | parse_json %}
167
167
  {% hash_assign x['key1'] = 'value1' %}
@@ -15,7 +15,7 @@ export const JSONSyntaxError: JSONCheckDefinition = {
15
15
  docs: {
16
16
  description: 'This check exists to prevent invalid JSON files in themes.',
17
17
  recommended: true,
18
- url: 'https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/json-syntax-error',
18
+ url: 'https://documentation.platformos.com/developer-guide/platformos-check/checks/json-syntax-error',
19
19
  },
20
20
  type: SourceCodeType.JSON,
21
21
  severity: Severity.ERROR,
@@ -12,17 +12,6 @@ describe('detectTrailingAssignValue', async () => {
12
12
  }
13
13
  });
14
14
 
15
- it('should not report when the boolean expression is in a schema tag', async () => {
16
- const sourceCode = `{% schema %}
17
- {
18
- "visible_if": "{{ this > that }}"
19
- }
20
- {% endschema %}`;
21
-
22
- const offenses = await runLiquidCheck(LiquidHTMLSyntaxError, sourceCode);
23
- expect(offenses).to.have.length(0);
24
- });
25
-
26
15
  it('should report all use of boolean expressions', async () => {
27
16
  const testCases = [
28
17
  [`{% assign foo = something == else %}`, '{% assign foo = something %}'],