gscan 4.37.3 → 4.37.4
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.
|
@@ -8,7 +8,8 @@ const ghostGlobals = {
|
|
|
8
8
|
setting: true, // TODO: we should remove this but the Journal theme is using it atm
|
|
9
9
|
config: true,
|
|
10
10
|
labs: true,
|
|
11
|
-
custom: true
|
|
11
|
+
custom: true,
|
|
12
|
+
page: true
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
// unless we update AST to check that we're within a foreach block, we need to allowlist all of these as they look the same as globals
|
|
@@ -116,10 +116,7 @@ function parseWithAST({theme, log, file, rules, callback}) {
|
|
|
116
116
|
|
|
117
117
|
const ruleImplementations = {
|
|
118
118
|
'GS110-NO-MISSING-PAGE-BUILDER-USAGE': {
|
|
119
|
-
isEnabled:
|
|
120
|
-
// TODO: change to `isEnabled: true` when removing labs flag
|
|
121
|
-
return options && options.labs && options.labs.pageImprovements;
|
|
122
|
-
},
|
|
119
|
+
isEnabled: true,
|
|
123
120
|
init: ({result}) => {
|
|
124
121
|
result.pageBuilderProperties = new Set();
|
|
125
122
|
},
|
|
@@ -143,16 +140,14 @@ const ruleImplementations = {
|
|
|
143
140
|
|
|
144
141
|
notUsedProperties.forEach((property) => {
|
|
145
142
|
log.failure({
|
|
146
|
-
ref:
|
|
143
|
+
ref: `page.hbs`,
|
|
144
|
+
message: `@page.${property} is not used`
|
|
147
145
|
});
|
|
148
146
|
});
|
|
149
147
|
}
|
|
150
148
|
},
|
|
151
149
|
'GS110-NO-UNKNOWN-PAGE-BUILDER-USAGE': {
|
|
152
|
-
isEnabled:
|
|
153
|
-
// TODO: change to `isEnabled: true` when removing labs flag
|
|
154
|
-
return options && options.labs && options.labs.pageImprovements;
|
|
155
|
-
},
|
|
150
|
+
isEnabled: true,
|
|
156
151
|
eachFile: ({file, theme, log}) => {
|
|
157
152
|
const templateTest = file.file.match(/(?<!partials\/.+?)\.hbs$/);
|
|
158
153
|
|
package/lib/specs/canary.js
CHANGED
|
@@ -713,7 +713,19 @@ let rules = {
|
|
|
713
713
|
details: oneLineTrim`<code>config.custom</code> entry <code>description</code> should be less than <code>100</code> characters so that it is displayed correctly.<br />
|
|
714
714
|
Check the <a href="${docsBaseUrl}custom-settings" target=_blank><code>config.custom</code> documentation</a> for further information.`
|
|
715
715
|
},
|
|
716
|
-
|
|
716
|
+
'GS110-NO-MISSING-PAGE-BUILDER-USAGE': {
|
|
717
|
+
level: 'warning',
|
|
718
|
+
rule: 'Not all page features are being used',
|
|
719
|
+
details: oneLineTrim`Some page features used by Ghost via the <code>{{@page}}</code> global are not implemented in this theme.
|
|
720
|
+
Find more information about the <code>{{@page}}</code> global <a href="${docsBaseUrl}helpers/page/" target=_blank>here</a>.`
|
|
721
|
+
},
|
|
722
|
+
'GS110-NO-UNKNOWN-PAGE-BUILDER-USAGE': {
|
|
723
|
+
level: 'error',
|
|
724
|
+
fatal: true,
|
|
725
|
+
rule: 'Unsupported page builder feature used',
|
|
726
|
+
details: oneLineTrim`A page feature used via the <code>{{@page}}</code> global was detected but it's not supported by this version of Ghost.
|
|
727
|
+
Find more information about the <code>{{@page}}</code> global <a href="${docsBaseUrl}helpers/page/" target=_blank>here</a>.`
|
|
728
|
+
},
|
|
717
729
|
'GS120-NO-UNKNOWN-GLOBALS': {
|
|
718
730
|
level: 'error',
|
|
719
731
|
rule: 'Unknown global helper used',
|