diff --git a/package.json b/package.json index 5d7d51cd5c..e39e05f8bf 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "avoid-escape" ], "no-var": 2, + "space-after-keywords": 2, "strict": 0, "no-underscore-dangle": 0, "curly": 0, diff --git a/packages/babel-cli/src/babel-doctor/rules/has-config.js b/packages/babel-cli/src/babel-doctor/rules/has-config.js index e31eeb1536..605cd457a7 100644 --- a/packages/babel-cli/src/babel-doctor/rules/has-config.js +++ b/packages/babel-cli/src/babel-doctor/rules/has-config.js @@ -23,7 +23,7 @@ export default async function () { } parts.pop(); - } while(parts.length); + } while (parts.length); return [false, "Found no .babelrc config"]; } diff --git a/packages/babel-core/src/transformation/file/index.js b/packages/babel-core/src/transformation/file/index.js index 51dd9a43d4..613da36868 100644 --- a/packages/babel-core/src/transformation/file/index.js +++ b/packages/babel-core/src/transformation/file/index.js @@ -369,7 +369,7 @@ export default class File extends Store { column: mapping.generatedColumn, source: source }); - if(generatedPosition.column != null) { + if (generatedPosition.column != null) { mergedGenerator.addMapping({ source: mapping.source, diff --git a/packages/babel-plugin-transform-flow-strip-types/src/index.js b/packages/babel-plugin-transform-flow-strip-types/src/index.js index c700426aa9..11933b0ff8 100644 --- a/packages/babel-plugin-transform-flow-strip-types/src/index.js +++ b/packages/babel-plugin-transform-flow-strip-types/src/index.js @@ -41,7 +41,7 @@ export default function ({ types: t }) { let { node } = path; do { node = node.expression; - } while(t.isTypeCastExpression(node)); + } while (t.isTypeCastExpression(node)); path.replaceWith(node); } } diff --git a/packages/babel-traverse/src/path/ancestry.js b/packages/babel-traverse/src/path/ancestry.js index ee199a1a35..7e52857056 100644 --- a/packages/babel-traverse/src/path/ancestry.js +++ b/packages/babel-traverse/src/path/ancestry.js @@ -46,7 +46,7 @@ export function getStatementParent() { if (Array.isArray(path.container)) { return path; } - } while(path = path.parentPath); + } while (path = path.parentPath); } /** @@ -120,7 +120,7 @@ export function getDeepestCommonAncestorFrom(paths: Array, filter?: Fu do { ancestry.unshift(path); - } while((path = path.parentPath) && path !== this); + } while ((path = path.parentPath) && path !== this); // save min depth to avoid going too far in if (ancestry.length < minDepth) { @@ -171,7 +171,7 @@ export function getAncestry() { let paths = []; do { paths.push(path); - } while(path = path.parentPath); + } while (path = path.parentPath); return paths; } @@ -212,6 +212,6 @@ export function inShadow(key?) { // normal function, we've found our function context return null; } - } while(path = path.parentPath); + } while (path = path.parentPath); return null; } diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js index 2140ee9284..3c04d82f97 100644 --- a/packages/babel-traverse/src/path/index.js +++ b/packages/babel-traverse/src/path/index.js @@ -149,7 +149,7 @@ export default class NodePath { let key = path.key; if (path.inList) key = `${path.listKey}[${key}]`; parts.unshift(key); - } while(path = path.parentPath); + } while (path = path.parentPath); return parts.join("."); } diff --git a/packages/babel-traverse/src/path/inference/inferer-reference.js b/packages/babel-traverse/src/path/inference/inferer-reference.js index 97fbb8a29e..28310f6134 100644 --- a/packages/babel-traverse/src/path/inference/inferer-reference.js +++ b/packages/babel-traverse/src/path/inference/inferer-reference.js @@ -175,7 +175,7 @@ function getConditionalAnnotation(path, name) { let type = inferAnnotationFromBinaryExpression(name, path); if (type) types.push(type); } - } while(paths.length); + } while (paths.length); if (types.length) { return { diff --git a/packages/babel-traverse/src/path/lib/hoister.js b/packages/babel-traverse/src/path/lib/hoister.js index f9a39ffd8b..075333aea6 100644 --- a/packages/babel-traverse/src/path/lib/hoister.js +++ b/packages/babel-traverse/src/path/lib/hoister.js @@ -57,7 +57,7 @@ export default class PathHoister { if (this.breakOnScopePaths.indexOf(scope.path) >= 0) { break; } - } while(scope = scope.parent); + } while (scope = scope.parent); } getAttachmentPath() { diff --git a/packages/babel-traverse/src/scope/index.js b/packages/babel-traverse/src/scope/index.js index 6478ce08cc..02a4122337 100644 --- a/packages/babel-traverse/src/scope/index.js +++ b/packages/babel-traverse/src/scope/index.js @@ -404,7 +404,7 @@ export default class Scope { kind: binding.kind }); } - } while(scope = scope.parent); + } while (scope = scope.parent); console.log(sep); } @@ -618,7 +618,7 @@ export default class Scope { do { let data = scope.data[key]; if (data != null) return data; - } while(scope = scope.parent); + } while (scope = scope.parent); } /** @@ -631,7 +631,7 @@ export default class Scope { do { let data = scope.data[key]; if (data != null) scope.data[key] = null; - } while(scope = scope.parent); + } while (scope = scope.parent); } init() { @@ -931,6 +931,6 @@ export default class Scope { if (scope.uids[name]) { scope.uids[name] = false; } - } while(scope = scope.parent); + } while (scope = scope.parent); } } diff --git a/packages/babylon/src/plugins/flow.js b/packages/babylon/src/plugins/flow.js index 7e561ac56d..a0f32f550c 100644 --- a/packages/babylon/src/plugins/flow.js +++ b/packages/babylon/src/plugins/flow.js @@ -113,7 +113,7 @@ pp.flowParseInterfaceish = function (node, allowStatic) { if (this.eat(tt._extends)) { do { node.extends.push(this.flowParseInterfaceExtends()); - } while(this.eat(tt.comma)); + } while (this.eat(tt.comma)); } node.body = this.flowParseObjectType(allowStatic); @@ -876,7 +876,7 @@ export default function (instance) { node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); - } while(this.eat(tt.comma)) + } while (this.eat(tt.comma)) } }; });