gscan 4.49.4 → 4.49.6
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.
package/app/tpl/index.hbs
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<span class="gh-input-icon select-arrow">{{> icon-arrow-up}}</span>
|
|
23
23
|
<span class="gh-input-icon select-arrow active">{{> icon-arrow-down}}</span>
|
|
24
24
|
<select class="gh-input gh-select" name="version" id="version">
|
|
25
|
+
<option value="v6">{{ghostVersions.v6.major}}</option>
|
|
25
26
|
<option value="v5" selected>{{ghostVersions.v5.major}}</option>
|
|
26
27
|
<option value="v4">{{ghostVersions.v4.major}}</option>
|
|
27
28
|
<option value="v3">{{ghostVersions.v3.major}}</option>
|
|
@@ -12,6 +12,7 @@ module.exports = {
|
|
|
12
12
|
'GS090-NO-PRICE-DATA-CURRENCY-GLOBAL': require('./lint-no-price-data-currency-global'),
|
|
13
13
|
'GS090-NO-PRICE-DATA-CURRENCY-CONTEXT': require('./lint-no-price-data-currency-context'),
|
|
14
14
|
'GS090-NO-PRICE-DATA-MONTHLY-YEARLY': require('./lint-no-price-data-monthly-yearly'),
|
|
15
|
+
'GS090-NO-LIMIT-ALL-IN-GET-HELPER': require('./lint-no-limit-all-in-get-helper'),
|
|
15
16
|
'GS110-NO-UNKNOWN-PAGE-BUILDER-USAGE': require('./lint-no-unknown-page-properties'),
|
|
16
17
|
'GS120-NO-UNKNOWN-GLOBALS': require('./lint-no-unknown-globals'),
|
|
17
18
|
'no-multi-param-conditionals': require('./lint-no-multi-param-conditionals'),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const Rule = require('./base');
|
|
2
|
+
const {getNodeName} = require('../helpers');
|
|
3
|
+
|
|
4
|
+
module.exports = class NoLimitAllInGetHelper extends Rule {
|
|
5
|
+
_checkForLimitAll(node) {
|
|
6
|
+
const nodeName = getNodeName(node);
|
|
7
|
+
|
|
8
|
+
if (nodeName === 'get' && node.hash && node.hash.pairs && node.hash.pairs.length > 0) {
|
|
9
|
+
const limitPair = node.hash.pairs.find(pair => pair.key === 'limit');
|
|
10
|
+
|
|
11
|
+
if (limitPair && limitPair.value) {
|
|
12
|
+
// Handle both string literals and quoted values
|
|
13
|
+
const limitValue = limitPair.value.value || limitPair.value.original;
|
|
14
|
+
|
|
15
|
+
if (limitValue === 'all') {
|
|
16
|
+
this.log({
|
|
17
|
+
line: node.loc && node.loc.start.line,
|
|
18
|
+
column: node.loc && node.loc.start.column,
|
|
19
|
+
source: this.sourceForNode(node)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
visitor() {
|
|
27
|
+
return {
|
|
28
|
+
BlockStatement: this._checkForLimitAll.bind(this)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
package/lib/specs/v6.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
const _ = require('lodash');
|
|
2
|
+
const oneLineTrim = require('common-tags/lib/oneLineTrim');
|
|
2
3
|
const previousSpec = require('./v5');
|
|
4
|
+
const docsBaseUrl = `https://ghost.org/docs/themes/`;
|
|
3
5
|
|
|
4
6
|
const previousKnownHelpers = previousSpec.knownHelpers;
|
|
5
7
|
const previousTemplates = previousSpec.templates;
|
|
6
8
|
const previousRules = previousSpec.rules;
|
|
7
9
|
|
|
8
10
|
// assign new or overwrite existing knownHelpers, templates, or rules here:
|
|
9
|
-
// Currently no new rules for v6
|
|
10
11
|
let knownHelpers = [];
|
|
11
12
|
let templates = [];
|
|
12
|
-
let rules = {
|
|
13
|
+
let rules = {
|
|
14
|
+
'GS090-NO-LIMIT-ALL-IN-GET-HELPER': {
|
|
15
|
+
level: 'warning',
|
|
16
|
+
rule: 'Using <code>limit="all"</code> in <code>{{#get}}</code> helper is not supported',
|
|
17
|
+
details: oneLineTrim`In Ghost 6.0 and later, <code>limit="all"</code> will return at most 100 results. Consider using a specific limit number or implementing pagination instead.<br>
|
|
18
|
+
Find more information about the <code>{{#get}}</code> helper <a href="${docsBaseUrl}helpers/get/" target=_blank>here</a>.`,
|
|
19
|
+
helper: '{{#get}}'
|
|
20
|
+
},
|
|
21
|
+
'GS001-DEPR-AMP-TEMPLATE': {
|
|
22
|
+
level: 'warning',
|
|
23
|
+
rule: 'AMP templates are no longer supported in Ghost 6.0',
|
|
24
|
+
details: 'AMP support was removed in Ghost 6.0. Remove AMP templates and use responsive design instead.',
|
|
25
|
+
// Matches <html amp> or <html ⚡>, with or without other attributes mixed in
|
|
26
|
+
regex: /<html\s+(?:amp|⚡)(?:\s|>)|<html\s+[^>]*\s(?:amp|⚡)(?:\s|>)/i
|
|
27
|
+
}
|
|
28
|
+
};
|
|
13
29
|
|
|
14
30
|
knownHelpers = _.union(previousKnownHelpers, knownHelpers);
|
|
15
31
|
templates = _.union(previousTemplates, templates);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gscan",
|
|
3
|
-
"version": "4.49.
|
|
3
|
+
"version": "4.49.6",
|
|
4
4
|
"description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ghost",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"c8": "8.0.1",
|
|
72
72
|
"eslint": "8.1.0",
|
|
73
73
|
"eslint-plugin-ghost": "2.1.0",
|
|
74
|
-
"mocha": "11.7.
|
|
74
|
+
"mocha": "11.7.1",
|
|
75
75
|
"node-fetch": "3.3.2",
|
|
76
76
|
"nodemon": "2.0.7",
|
|
77
77
|
"rewire": "6.0.0",
|