Skip to content

Commit

Permalink
Disable no-unexpected-multiline in eslint 4
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohnson committed Oct 13, 2017
1 parent 3dabeae commit 8fb9ef8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,20 @@ function monkeypatch(modules) {
};

// monkeypatch rules
var emptyRule = function() { return {}; };
emptyRule.create = function() { return {}; };
var rules = getModule(eslintMod, "./rules");
var _get = rules.get;
rules.get = function get(ruleId) {
var _get = rules.get || rules.prototype.get;
var nextGet = function get(ruleId) {
// disable no-unexpected-multiline, lsc compiler deals with this
if (ruleId === "no-unexpected-multiline") {
return function() { return {}; };
return emptyRule;
} else {
return _get.call(rules, ruleId);
return _get.call(this || rules, ruleId);
}
};

if (rules.get) rules.get = nextGet; else rules.prototype.get = nextGet;
}

function createNonceToken() {
Expand Down

0 comments on commit 8fb9ef8

Please sign in to comment.