From 1650d8fef24ebf04c09bf4950db2013986e45648 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 5 Apr 2023 13:42:27 -0700 Subject: [PATCH] Ensure blank line after copyright header --- .../forget/packages/demo-todolist-next/next.config.js | 1 + compiler/forget/packages/playground/next.config.js | 1 + compiler/forget/scripts/copyright.js | 10 ++++++---- compiler/forget/scripts/prettier.js | 1 + compiler/forget/scripts/shared/list-changed-files.js | 1 + compiler/forget/src/CompilerPipeline.ts | 1 + compiler/forget/src/HIR/ObjectShape.ts | 1 + compiler/forget/src/HIR/Types.ts | 1 + compiler/forget/src/Inference/InferAliasForPhis.ts | 1 + compiler/forget/src/Inference/InferAliasForStores.ts | 1 + compiler/forget/src/index.ts | 1 + 11 files changed, 16 insertions(+), 4 deletions(-) diff --git a/compiler/forget/packages/demo-todolist-next/next.config.js b/compiler/forget/packages/demo-todolist-next/next.config.js index be33e01671..b43afd90bf 100644 --- a/compiler/forget/packages/demo-todolist-next/next.config.js +++ b/compiler/forget/packages/demo-todolist-next/next.config.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + const nextConfig = { reactStrictMode: true, } diff --git a/compiler/forget/packages/playground/next.config.js b/compiler/forget/packages/playground/next.config.js index 1d3880021d..bc6b68a73b 100644 --- a/compiler/forget/packages/playground/next.config.js +++ b/compiler/forget/packages/playground/next.config.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + const nextConfig = { reactStrictMode: true, webpack: (config) => { diff --git a/compiler/forget/scripts/copyright.js b/compiler/forget/scripts/copyright.js index f990cf9395..12eb8417af 100644 --- a/compiler/forget/scripts/copyright.js +++ b/compiler/forget/scripts/copyright.js @@ -4,17 +4,19 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + "use strict"; const fs = require("fs"); const glob = require("glob"); -const META_COPYRIGHT_COMMENT_BLOCK = `/** +const META_COPYRIGHT_COMMENT_BLOCK = + `/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */`; + */`.trim() + "\n\n"; const files = glob.sync("**/*.{js,ts,tsx,jsx}", { ignore: [ @@ -55,9 +57,9 @@ function processFile(file) { return null; } if (/^\/\*\*/.test(source)) { - source = source.replace(/\/\*\*[^\/]+\//, META_COPYRIGHT_COMMENT_BLOCK); + source = source.replace(/\/\*\*[^\/]+\/\s+/, META_COPYRIGHT_COMMENT_BLOCK); } else { - source = `${META_COPYRIGHT_COMMENT_BLOCK}\n\n${source}`; + source = `${META_COPYRIGHT_COMMENT_BLOCK}${source}`; } return source; } diff --git a/compiler/forget/scripts/prettier.js b/compiler/forget/scripts/prettier.js index c3c8d5eb84..be010159e1 100644 --- a/compiler/forget/scripts/prettier.js +++ b/compiler/forget/scripts/prettier.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + "use strict"; // Based on similar script in React diff --git a/compiler/forget/scripts/shared/list-changed-files.js b/compiler/forget/scripts/shared/list-changed-files.js index 8fc26242b7..f6a5e61bee 100644 --- a/compiler/forget/scripts/shared/list-changed-files.js +++ b/compiler/forget/scripts/shared/list-changed-files.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + "use strict"; const execFileSync = require("child_process").execFileSync; diff --git a/compiler/forget/src/CompilerPipeline.ts b/compiler/forget/src/CompilerPipeline.ts index 714ae91437..b148da1b99 100644 --- a/compiler/forget/src/CompilerPipeline.ts +++ b/compiler/forget/src/CompilerPipeline.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + import { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; import { diff --git a/compiler/forget/src/HIR/ObjectShape.ts b/compiler/forget/src/HIR/ObjectShape.ts index 913f0ba22c..f7bf3e3b29 100644 --- a/compiler/forget/src/HIR/ObjectShape.ts +++ b/compiler/forget/src/HIR/ObjectShape.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + import invariant from "invariant"; import { Effect } from "./HIR"; import { diff --git a/compiler/forget/src/HIR/Types.ts b/compiler/forget/src/HIR/Types.ts index 279e04c003..0f272ceab7 100644 --- a/compiler/forget/src/HIR/Types.ts +++ b/compiler/forget/src/HIR/Types.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + import invariant from "invariant"; import { Hook } from "./Hooks"; diff --git a/compiler/forget/src/Inference/InferAliasForPhis.ts b/compiler/forget/src/Inference/InferAliasForPhis.ts index 2dbe2db693..f47a2dc38b 100644 --- a/compiler/forget/src/Inference/InferAliasForPhis.ts +++ b/compiler/forget/src/Inference/InferAliasForPhis.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + import { HIRFunction, Identifier } from "../HIR/HIR"; import DisjointSet from "../Utils/DisjointSet"; diff --git a/compiler/forget/src/Inference/InferAliasForStores.ts b/compiler/forget/src/Inference/InferAliasForStores.ts index bd0050cdd4..db8725dca1 100644 --- a/compiler/forget/src/Inference/InferAliasForStores.ts +++ b/compiler/forget/src/Inference/InferAliasForStores.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + import { Effect, HIRFunction, diff --git a/compiler/forget/src/index.ts b/compiler/forget/src/index.ts index fa830eb223..e8a89302fc 100644 --- a/compiler/forget/src/index.ts +++ b/compiler/forget/src/index.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + export { default as BabelPlugin } from "./Babel/BabelPlugin"; export { CompilerError,