Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-no-comments

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-comments - npm Package Compare versions

Comparing version 1.0.7 to 1.1.8

9

index.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc