Skip to content

Commit

Permalink
chore: isPaddingBetweenTokens -> hasPaddingBetweenTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Diana Suvorova authored and Nicolas Fernandez committed Jun 22, 2017
1 parent 99c458d commit 00e5dc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* @param {Token} second The second token
* @returns {boolean} True if there is at least a line between the tokens
*/
function isPaddingBetweenTokens (first, second) {
function hasPaddingBetweenTokens (first, second) {
return second.loc.start.line - first.loc.end.line >= 2
}

module.exports = isPaddingBetweenTokens
module.exports = hasPaddingBetweenTokens
4 changes: 2 additions & 2 deletions lib/rules/new-line-before-expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Diana Suvorova
*/

var isPaddingBetweenTokens = require('../helpers/isPaddingBetweenTokens')
var hasPaddingBetweenTokens = require('../helpers/hasPaddingBetweenTokens')

var blockRegexp = /^((f|x)?(it|describe))$/

Expand All @@ -19,7 +19,7 @@ module.exports = function (context) {
const parent = jasmineBlocks[jasmineBlocks.length - 1]
if (!isFirstNodeInSuiteOrTest(node, parent)) {
const tokenBeforeExpect = context.getSourceCode().getTokenBefore(node)
if (!isPaddingBetweenTokens(tokenBeforeExpect, node)) {
if (!hasPaddingBetweenTokens(tokenBeforeExpect, node)) {
context.report(node, 'No new line before expect')
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/new-line-between-declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Diana Suvorova
*/

var isPaddingBetweenTokens = require('../helpers/isPaddingBetweenTokens')
var hasPaddingBetweenTokens = require('../helpers/hasPaddingBetweenTokens')

var suiteRegexp = /^(f|x)?describe$/

Expand All @@ -18,7 +18,7 @@ module.exports = function (context) {
pass = declarations.every((token, i) => {
var next = declarations[i + 1]
if (next) {
return isPaddingBetweenTokens(token, next)
return hasPaddingBetweenTokens(token, next)
} else {
return true
}
Expand Down

0 comments on commit 00e5dc6

Please sign in to comment.