mirror of
https://github.com/github/codeql-action.git
synced 2025-12-23 07:40:10 +08:00
Update checked-in dependencies
This commit is contained in:
41
node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js
generated
vendored
41
node_modules/eslint-plugin-github/lib/rules/unescaped-html-literal.js
generated
vendored
@@ -1,24 +1,35 @@
|
||||
module.exports = function(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
|
||||
})
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'disallow unesaped HTML literals',
|
||||
url: require('../url')(module)
|
||||
},
|
||||
TemplateLiteral(node) {
|
||||
if (!htmlOpenTag.test(node.quasis[0].value.raw)) return
|
||||
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
|
||||
|
||||
if (!node.parent.tag || node.parent.tag.name !== 'html') {
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user