@next/eslint-plugin-next 13.5.7-canary.9 → 13.5.7
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/dist/rules/google-font-display.js +1 -1
- package/dist/rules/no-before-interactive-script-outside-document.js +1 -1
- package/dist/rules/no-head-import-in-document.js +1 -1
- package/dist/rules/no-styled-jsx-in-document.js +1 -1
- package/dist/rules/no-typos.js +1 -1
- package/dist/utils/url.js +2 -2
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ module.exports = (0, _definerule.defineRule)({
|
|
|
31
31
|
var hrefValue = attributes.value("href");
|
|
32
32
|
var isGoogleFont = typeof hrefValue === "string" && hrefValue.startsWith("https://fonts.googleapis.com/css");
|
|
33
33
|
if (isGoogleFont) {
|
|
34
|
-
var params = new URLSearchParams(hrefValue.split("?"
|
|
34
|
+
var params = new URLSearchParams(hrefValue.split("?")[1]);
|
|
35
35
|
var displayValue = params.get("display");
|
|
36
36
|
if (!params.has("display")) {
|
|
37
37
|
message = "A font-display parameter is missing (adding `&display=optional` is recommended).";
|
|
@@ -88,7 +88,7 @@ module.exports = (0, _definerule.defineRule)({
|
|
|
88
88
|
if (!strategy || !strategy.value || strategy.value.value !== "beforeInteractive") {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
var document = context.getFilename().split("pages"
|
|
91
|
+
var document = context.getFilename().split("pages")[1];
|
|
92
92
|
if (document && _path.parse(document).name.startsWith("_document")) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
@@ -57,7 +57,7 @@ module.exports = (0, _definerule.defineRule)({
|
|
|
57
57
|
if (node.source.value !== "next/head") {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
var document = context.getFilename().split("pages"
|
|
60
|
+
var document = context.getFilename().split("pages")[1];
|
|
61
61
|
if (!document) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -54,7 +54,7 @@ module.exports = (0, _definerule.defineRule)({
|
|
|
54
54
|
create: function create(context) {
|
|
55
55
|
return {
|
|
56
56
|
JSXOpeningElement: function JSXOpeningElement(node) {
|
|
57
|
-
var document = context.getFilename().split("pages"
|
|
57
|
+
var document = context.getFilename().split("pages")[1];
|
|
58
58
|
if (!document) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
package/dist/rules/no-typos.js
CHANGED
|
@@ -112,7 +112,7 @@ module.exports = (0, _definerule.defineRule)({
|
|
|
112
112
|
};
|
|
113
113
|
return {
|
|
114
114
|
ExportNamedDeclaration: function ExportNamedDeclaration(node) {
|
|
115
|
-
var page = context.getFilename().split("pages"
|
|
115
|
+
var page = context.getFilename().split("pages")[1];
|
|
116
116
|
if (!page || _path.parse(page).dir.startsWith("/api")) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
package/dist/utils/url.js
CHANGED
|
@@ -119,8 +119,8 @@ function normalizeURL(url) {
|
|
|
119
119
|
if (!url) {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
url = url.split("?"
|
|
123
|
-
url = url.split("#"
|
|
122
|
+
url = url.split("?")[0];
|
|
123
|
+
url = url.split("#")[0];
|
|
124
124
|
url = url = url.replace(/(\/index\.html)$/, "/");
|
|
125
125
|
// Empty URLs should not be trailed with `/`, e.g. `#heading`
|
|
126
126
|
if (url === "") {
|