Merge pull request #3361 from babel/klint

Switch to klint, fix some lint rules
This commit is contained in:
Sebastian McKenzie
2016-02-14 23:26:30 +00:00
11 changed files with 26 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ export const types: {
b_tmpl: new TokContext("${", true),
p_stat: new TokContext("(", false),
p_expr: new TokContext("(", true),
q_tmpl: new TokContext("`", true, true, p => p.readTmplToken()),
q_tmpl: new TokContext("`", true, true, (p) => p.readTmplToken()),
f_expr: new TokContext("function", true)
};
@@ -78,7 +78,8 @@ tt.dollarBraceL.updateContext = function () {
};
tt.parenL.updateContext = function (prevType) {
let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while;
let statementParens = prevType === tt._if || prevType === tt._for ||
prevType === tt._with || prevType === tt._while;
this.state.context.push(statementParens ? types.p_stat : types.p_expr);
this.state.exprAllowed = true;
};

View File

@@ -1,4 +1,6 @@
/* @noflow */
/* eslint max-len: 0 */
/* eslint indent: 0 */
import type { TokenType } from "./types";
import { isIdentifierStart, isIdentifierChar, isKeyword } from "../util/identifier";