(context)
| 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 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected