eslint-plugin-no-comments
Advanced tools
Comparing version 1.0.7 to 1.1.8
@@ -14,3 +14,8 @@ module.exports = { | ||
function processComment(comment) { | ||
const re = /^\s?(global|eslint)/; | ||
const options = context.options[0] || {}; | ||
const allow = options && options.allow || []; | ||
let re = /^\s?(global|eslint)/; | ||
if (allow.length > 0) { | ||
re = new RegExp(`^\\s?(${allow.join("|")})`); | ||
} | ||
if (comment && !re.test(comment.value)) { | ||
@@ -28,3 +33,3 @@ context.report({ | ||
return { | ||
Program(node) { | ||
Program() { | ||
const comments = sourceCode.getAllComments(); | ||
@@ -31,0 +36,0 @@ comments.forEach(processComment); |
{ | ||
"name": "eslint-plugin-no-comments", | ||
"version": "1.0.7", | ||
"version": "1.1.8", | ||
"description": "ESLint plugin to disallow comment blocks", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,3 +21,8 @@ # eslint-plugin-no-comments | ||
"rules": { | ||
"no-comments/disallowComments": "error" | ||
"no-comments/disallowComments": [ | ||
"error", | ||
{ | ||
"allow": ["TODO", "FIXME", "NOTE", "DEBUG"], | ||
} | ||
] | ||
} | ||
@@ -24,0 +29,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4203
39
65