diff options
author | Rich Trott <rtrott@gmail.com> | 2016-09-09 17:07:54 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-09-12 21:11:55 -0700 |
commit | 2da2625ad16b09c25d7622c91ffe1d940e44e41a (patch) | |
tree | 1703937d59bd6723cbbd97a2219aaa5e301fad85 /tools/eslint/lib/rules/operator-linebreak.js | |
parent | a6b1f175c2368bb749c6c58a9d8df22e8c72a377 (diff) | |
download | node-new-2da2625ad16b09c25d7622c91ffe1d940e44e41a.tar.gz |
tools: update ESLint to 3.5.0
PR-URL: https://github.com/nodejs/node/pull/8478
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/eslint/lib/rules/operator-linebreak.js')
-rw-r--r-- | tools/eslint/lib/rules/operator-linebreak.js | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/tools/eslint/lib/rules/operator-linebreak.js b/tools/eslint/lib/rules/operator-linebreak.js index c3fdb58981..ce222526e1 100644 --- a/tools/eslint/lib/rules/operator-linebreak.js +++ b/tools/eslint/lib/rules/operator-linebreak.js @@ -98,31 +98,59 @@ module.exports = { !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { // lone operator - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "Bad line breaking before and after '" + operator + "'."); + context.report({ + node, + loc: { + line: operatorToken.loc.end.line, + column: operatorToken.loc.end.column + }, + message: "Bad line breaking before and after '{{operator}}'.", + data: { + operator + } + }); } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "'" + operator + "' should be placed at the beginning of the line."); + context.report({ + node, + loc: { + line: operatorToken.loc.end.line, + column: operatorToken.loc.end.column + }, + message: "'{{operator}}' should be placed at the beginning of the line.", + data: { + operator + } + }); } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "'" + operator + "' should be placed at the end of the line."); + context.report({ + node, + loc: { + line: operatorToken.loc.end.line, + column: operatorToken.loc.end.column + }, + message: "'{{operator}}' should be placed at the end of the line.", + data: { + operator + } + }); } else if (style === "none") { - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "There should be no line break before or after '" + operator + "'."); + context.report({ + node, + loc: { + line: operatorToken.loc.end.line, + column: operatorToken.loc.end.column + }, + message: "There should be no line break before or after '{{operator}}'.", + data: { + operator + } + }); } } |