codeql-action/node_modules/eslint-plugin-escompat/lib/rules/no-hashbang-comment.js
2024-12-03 18:37:29 +00:00

13 lines
367 B
JavaScript

'use strict';
module.exports = (context, badBrowser) => {
const { sourceCode = context.getSourceCode() } = context;
return {
'Program:exit' (node) {
const [comment] = sourceCode.getAllComments();
if (comment && comment.type === 'Shebang') {
context.report(node, `Hashbang comments are not supported in ${badBrowser}`)
}
}
}
}