Restore UI functionalities and clean up dependencies

This commit is contained in:
streaper2
2026-05-08 08:32:58 +02:00
parent 8946955f76
commit 0895b7d5bc
26751 changed files with 4207476 additions and 158 deletions

View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
var _definerule = require("../utils/define-rule");
var url = 'https://nextjs.org/docs/messages/no-sync-scripts';
var _default = (0, _definerule.defineRule)({
meta: {
docs: {
description: 'Prevent synchronous scripts.',
recommended: true,
url: url
},
type: 'problem',
schema: []
},
create: function create(context) {
return {
JSXOpeningElement: function JSXOpeningElement(node) {
if (node.name.name !== 'script') {
return;
}
if (node.attributes.length === 0) {
return;
}
var attributeNames = node.attributes.filter(function(attr) {
return attr.type === 'JSXAttribute';
}).map(function(attr) {
return attr.name.name;
});
if (attributeNames.includes('src') && !attributeNames.includes('async') && !attributeNames.includes('defer')) {
context.report({
node: node,
message: "Synchronous scripts should not be used. See: ".concat(url)
});
}
}
};
}
});