eslint-plugin-more
Advanced tools
Comparing version
@@ -20,3 +20,3 @@ | ||
'force-native-methods': 2, | ||
'no-duplicated-chains': 2, | ||
'no-duplicated-chains': [2, {repetitions: 2, chainLength: 3}], | ||
'classbody-starts-with-newline': [2, 'never'] | ||
@@ -23,0 +23,0 @@ } |
@@ -1,10 +0,10 @@ | ||
//No empty string after class definition (before constructor) (with fixer) | ||
//No empty string after class definition (before varructor) (with fixer) | ||
module.exports = function(context) { | ||
const sourceCode = context.getSourceCode(); | ||
var sourceCode = context.getSourceCode(); | ||
const mode = context.options[0] || 'never'; | ||
var mode = context.options[0] || 'never'; | ||
function checkForNewLine(node) { | ||
const nextNode = node.body[0]; | ||
var nextNode = node.body[0]; | ||
@@ -15,7 +15,7 @@ if (nextNode.type !== 'ClassProperty' && nextNode.type !== 'MethodDefinition') { | ||
const nextLineNum = node.loc.start.line + 1; | ||
let bodyStartsWithNewLine = nextNode.loc.start.line > nextLineNum; | ||
var nextLineNum = node.loc.start.line + 1; | ||
var bodyStartsWithNewLine = nextNode.loc.start.line > nextLineNum; | ||
const comments = sourceCode.getComments(nextNode).leading; | ||
var comments = sourceCode.getComments(nextNode).leading; | ||
@@ -22,0 +22,0 @@ if (comments.length && comments[0].loc.start.line === nextLineNum) { |
@@ -5,7 +5,7 @@ | ||
module.exports = function(context) { | ||
const longChains = []; | ||
let isInsideCallExpression = false; | ||
var longChains = []; | ||
var isInsideCallExpression = false; | ||
// to avoid subexpressions output | ||
let memberExpressionsDepth = 0; | ||
var memberExpressionsDepth = 0; | ||
@@ -55,5 +55,5 @@ function startFunction(node) { | ||
let pathParts = []; | ||
let parent = node; | ||
let depth = 0; | ||
var pathParts = []; | ||
var parent = node; | ||
var depth = 0; | ||
@@ -84,4 +84,4 @@ while (parent) { | ||
const path = pathParts.reverse().join('.'); | ||
const chainCount = incrementChainCount(path); | ||
var path = pathParts.reverse().join('.'); | ||
var chainCount = incrementChainCount(path); | ||
@@ -91,3 +91,3 @@ if (chainCount >= 2) { | ||
node: node, | ||
message: `Do not duplicate long chains. Assign "${path}" to a variable or destruct it.` | ||
message: 'Do not duplicate long chains. Assign "' + path + '" to a variable or destruct it.' | ||
}); | ||
@@ -94,0 +94,0 @@ } |
{ | ||
"name": "eslint-plugin-more", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"keywords": ["eslint","eslintplugin"], | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/WebbyLab/eslint-plugin-more", |
10138
0.23%