MCPcopy Create free account
hub / github.com/clawstr/clawstr / create

Function create

eslint-rules/no-inline-script.js:20–39  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

18 },
19
20 create(context) {
21 return {
22 // For HTML files, we need to check script tags
23 'ScriptTag'(node) {
24 // Check if this is an inline script (has content but no src attribute)
25 const hasContent = node.value && node.value.value && node.value.value.trim().length > 0;
26 const hasSrc = node.attributes && node.attributes.some(attr =>
27 attr.key && attr.key.value === 'src'
28 );
29
30 // If the script has content but no src attribute, it's an inline script
31 if (hasContent && !hasSrc) {
32 context.report({
33 node,
34 messageId: 'noInlineScript',
35 });
36 }
37 },
38 };
39 },
40};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected