Skip to content

Commit

Permalink
Update: Fix incorrect default value for position (#10670)
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter authored and platinumazure committed Jul 28, 2018
1 parent 8084bfc commit e37a593
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/line-comment-position.js
Expand Up @@ -59,7 +59,7 @@ module.exports = {
above = !options || options === "above";

} else {
above = options.position === "above";
above = !options.position || options.position === "above";
ignorePattern = options.ignorePattern;

if (options.hasOwnProperty("applyDefaultIgnorePatterns")) {
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/line-comment-position.js
Expand Up @@ -76,6 +76,10 @@ ruleTester.run("line-comment-position", rule, {
{
code: "// pragma valid comment\n1 + 1;",
options: [{ position: "beside", ignorePattern: "pragma|linter" }]
},
{
code: "// above\n1 + 1; // ignored",
options: [{ ignorePattern: "ignored" }]
}
],

Expand Down

0 comments on commit e37a593

Please sign in to comment.