Socket
Socket
Sign inDemoInstall

eslint-plugin-ban

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-ban - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

4

.eslintrc.json

@@ -12,6 +12,2 @@ {

],
"linebreak-style": [
"error",
"unix"
],
"quotes": [

@@ -18,0 +14,0 @@ "error",

4

lib/rules/ban.js

@@ -154,6 +154,4 @@ /**

CallExpression(node){
if (node.callee.type === IDENTIFIER_TOKEN) {
const foundRule = findRuleByFunction(node.callee.name);
if (foundRule) report(node, foundRule);

@@ -170,3 +168,3 @@ return;

if (foundRule) report(node, foundRule);
if (foundRule) report(node.callee, foundRule);
return;

@@ -173,0 +171,0 @@ }

{
"name": "eslint-plugin-ban",
"version": "1.2.0",
"version": "1.3.0",
"description": "Allows you to bannish some methods or functions.",
"repository": {
"type": "git",
"url": "https://github.com/remithomas/eslint-plugin-ban"
},
"keywords": [

@@ -29,3 +33,3 @@ "eslint",

"husky": "^1.3.1",
"mocha": "^6.0.1"
"mocha": "^6.2.0"
},

@@ -32,0 +36,0 @@ "husky": {

@@ -161,1 +161,28 @@ /**

});
const singleLine = [{'name': ['it', 'only'], 'message': 'Don\'t use `it.only`'}];
ruleTester.run('should ban single line', rule, {
valid: [
{
code: 'hello.it("dogs");',
options: singleLine,
}
],
invalid: [
// Ban method
{
code: [
'it.only("does abc", function(){',
'my.only();',
'})'
].join('\n'),
errors: [{
message: 'Don\'t use `it.only`',
line: 1,
endLine: 1,
}],
options: singleLine
},
]
});
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