Re-enable the max-len ESLint rule. (#5265)

This commit is contained in:
Logan Smyth
2017-02-04 08:07:15 -08:00
committed by Henry Zhu
parent 4d411ef83e
commit b845f2b69d
63 changed files with 317 additions and 223 deletions

View File

@@ -1,5 +1,3 @@
/* eslint max-len: 0 */
import * as t from "babel-types";
import * as n from "../node";

View File

@@ -1,5 +1,3 @@
/* eslint max-len: 0 */
export function AnyTypeAnnotation() {
this.word("any");
}

View File

@@ -93,5 +93,6 @@ export function ArrowFunctionExpression(node: Object) {
}
function hasTypes(node, param) {
return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
return node.typeParameters || node.returnType || param.typeAnnotation || param.optional ||
param.trailingComments;
}

View File

@@ -1,6 +1,3 @@
/* eslint max-len: 0 */
/* eslint quotes: 0 */
import * as t from "babel-types";
import jsesc from "jsesc";
@@ -62,7 +59,8 @@ export function ObjectProperty(node: Object) {
this.token("]");
} else {
// print `({ foo: foo = 5 } = {})` as `({ foo = 5 } = {});`
if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {
if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) &&
node.key.name === node.value.left.name) {
this.print(node.value, node);
return;
}

View File

@@ -1,5 +1,3 @@
/* eslint max-len: 0 */
import find from "lodash/find";
import findLast from "lodash/findLast";
import isInteger from "lodash/isInteger";
@@ -321,6 +319,7 @@ export default class Printer {
const printMethod = this[node.type];
if (!printMethod) {
// eslint-disable-next-line max-len
throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node && node.constructor.name)}`);
}

View File

@@ -312,7 +312,10 @@ suites.forEach(function (testSuite) {
});
const result = generate(actualAst, task.options, actualCode);
if (!expect.code && result.code && fs.statSync(path.dirname(expect.loc)).isDirectory() && !process.env.CI) {
if (
!expect.code && result.code && fs.statSync(path.dirname(expect.loc)).isDirectory() &&
!process.env.CI
) {
console.log(`New test file created: ${expect.loc}`);
fs.writeFileSync(expect.loc, result.code);
} else {