Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 15, 2023
1 parent 5b74037 commit 56cb074
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 30 deletions.
19 changes: 4 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions scripts/vendor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ async function cloneRecast() {

// Remove the assert import and usage
await Promise.all(fs.readdirSync('vendor/recast/lib', { withFileTypes: true }).map(async (file) => {
if (!file.isFile()) { return }
return filterLines(join(file.path, file.name), (line) => {
if (!file.isFile()) {
return
}
return await filterLines(join(file.path, file.name), (line) => {
if (line.startsWith('import assert from')) {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion test/array.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { generate } from "./_utils";
import { parseModule } from "magicast";
import { generate } from "./_utils";

describe("array", () => {
it("array operations", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/builders/expression.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { generate } from "../_utils";
import { builders, parseModule } from "magicast";
import { generate } from "../_utils";

describe("builders/expression", () => {
it("new expression", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/builders/function-call.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { generate } from "../_utils";
import { builders, parseModule } from "magicast";
import { generate } from "../_utils";

describe("builders/functionCall", () => {
it("new", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/builders/raw.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { generate } from "../_utils";
import { builders, parseModule } from "magicast";
import { generate } from "../_utils";

describe("builders/raw", () => {
it("object", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/errors.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, describe, it } from "vitest";
import { generate } from "./_utils";
import { parseExpression, parseModule } from "magicast";
import { generate } from "./_utils";

describe("errors", () => {
it("ternary", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/exports.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, it, describe } from "vitest";
import { generate } from "./_utils";
import { parseModule } from "magicast";
import { generate } from "./_utils";

describe("exports", () => {
it("manipulate exports", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/function-call.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { generate } from "./_utils";
import { builders, parseModule, ProxifiedModule } from "magicast";
import { generate } from "./_utils";

describe("function-calls", () => {
it("function wrapper", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/general.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, it, describe } from "vitest";
import { generate } from "./_utils";
import { generateCode, parseModule, parseExpression } from "magicast";
import { generate } from "./_utils";

describe("general", () => {
it("basic object and array", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/nuxt.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { it, describe, expect } from "vitest";
import { generate } from "../_utils";
import { parseModule } from "magicast";
import { generate } from "../_utils";
import { addNuxtModule } from "magicast/helpers";

describe("helpers > nuxt", () => {
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/vite.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { it, describe, expect } from "vitest";
import { generate } from "../_utils";
import { parseModule } from "magicast";
import { generate } from "../_utils";
import { addVitePlugin, updateVitePluginConfig } from "magicast/helpers";

describe("helpers > vite", () => {
Expand Down Expand Up @@ -207,7 +207,7 @@ export default defineConfig({
expect(await generate(mod)).toMatchInlineSnapshot(`
"import { VitePWA } from \\"vite-plugin-pwa\\";
import { somePlugin1, somePlugin2 } from \\"some-module\\";
import type { UserConfig } from \\"vite\\";
const myConfig = {
Expand Down Expand Up @@ -243,7 +243,7 @@ export default defineConfig({
expect(await generate(mod)).toMatchInlineSnapshot(`
"import { VitePWA } from \\"vite-plugin-pwa\\";
import { somePlugin1, somePlugin2 } from \\"some-module\\";
import type { UserConfig } from \\"vite\\";
const myConfig = defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion test/imports.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, it, describe } from "vitest";
import { generate } from "./_utils";
import { parseModule } from "magicast";
import { generate } from "./_utils";

describe("imports", () => {
it("manipulate imports", async () => {
Expand Down

0 comments on commit 56cb074

Please sign in to comment.