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.5 to 1.0.7

29

index.js
module.exports = {
rules: {
'disallowComments': {
create: function(context) {
"rules": {
"disallowComments": {
meta: {
type: "problem",
docs: {
description: "Comments are not allowed in this project as they can cause unnecessary noise or leak into production code. Check configuration to see the exceptions from this rule."
},
fixable: "code",
},
"create"(context) {
const sourceCode = context.getSourceCode();
function processComment(comment) {
const re = /^\s?(global|eslint)/
const re = /^\s?(global|eslint)/;
if (comment && !re.test(comment.value)) {
context.report({
node: null,
loc: comment.loc,
message: 'Comments are forbidden',
fix(fixer) {
return fixer.remove(comment)
return fixer.remove(comment);
},
"loc": comment.loc,
"message": "Comments are forbidden",
"node": null
});

@@ -23,7 +30,7 @@ }

comments.forEach(processComment);
},
}
}
};
}
}
}
}
};
{
"name": "eslint-plugin-no-comments",
"version": "1.0.5",
"version": "1.0.7",
"description": "ESLint plugin to disallow comment blocks",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -19,5 +19,5 @@ # eslint-plugin-no-comments

{
"plugins": ["eslint-plugin-no-comments"],
"plugins": ["no-comments"],
"rules": {
"eslint-plugin-no-comments/disallowComments": "error"
"no-comments/disallowComments": "error"
}

@@ -24,0 +24,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