initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
36
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js
generated
vendored
Normal file
36
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
module.exports = {
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'disallow unesaped HTML literals',
|
||||
url: require('../url')(module)
|
||||
},
|
||||
schema: []
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const htmlOpenTag = /^<[a-zA-Z]/
|
||||
const message = 'Unescaped HTML literal. Use html`` tag template literal for secure escaping.'
|
||||
|
||||
return {
|
||||
Literal(node) {
|
||||
if (!htmlOpenTag.test(node.value)) return
|
||||
|
||||
context.report({
|
||||
node,
|
||||
message
|
||||
})
|
||||
},
|
||||
TemplateLiteral(node) {
|
||||
if (!htmlOpenTag.test(node.quasis[0].value.raw)) return
|
||||
|
||||
if (!node.parent.tag || node.parent.tag.name !== 'html') {
|
||||
context.report({
|
||||
node,
|
||||
message
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue