Re-enable the max-len ESLint rule. (#5265)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/* eslint max-len: 0 */
|
||||
|
||||
import * as t from "babel-types";
|
||||
import * as n from "../node";
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint max-len: 0 */
|
||||
|
||||
export function AnyTypeAnnotation() {
|
||||
this.word("any");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user