diff --git a/.changeset/config.json b/.changeset/config.json index 6b37255..42efc1c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,11 +1,11 @@ { - "$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": false, - "fixed": [], - "linked": [], - "access": "restricted", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": [] + "$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 564bcf3..28c1a1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,17 @@ concurrency: cancel-in-progress: true jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm lint Tests: runs-on: ${{ matrix.os }} timeout-minutes: 15 @@ -30,7 +41,7 @@ jobs: os: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v3 with: @@ -46,7 +57,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v3 with: diff --git a/.prettierignore b/.prettierignore index ee43e2d..a73deb6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,8 @@ +pnpm-lock.yaml + test/samples/*/*.js test/sandbox/_input.js test/sandbox/_output.js + +expected.ts +expected.jsx diff --git a/package.json b/package.json index 0fa59ac..5112c7a 100644 --- a/package.json +++ b/package.json @@ -1,58 +1,61 @@ { - "name": "esrap", - "version": "2.1.0", - "description": "Parse in reverse", - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/esrap.git" - }, - "type": "module", - "files": [ - "src", - "types" - ], - "exports": { - ".": { - "types": "./types/index.d.ts", - "default": "./src/index.js" - }, - "./languages/ts": { - "types": "./types/index.d.ts", - "default": "./src/languages/ts/index.js" - }, - "./languages/tsx": { - "types": "./types/index.d.ts", - "default": "./src/languages/tsx/index.js" - } - }, - "types": "./types/index.d.ts", - "devDependencies": { - "@changesets/cli": "^2.27.11", - "@sveltejs/acorn-typescript": "^1.0.5", - "@typescript-eslint/types": "^8.2.0", - "@vitest/ui": "^2.1.1", - "acorn": "^8.15.0", - "dts-buddy": "^0.6.2", - "prettier": "^3.0.3", - "typescript": "^5.7.2", - "vitest": "^2.1.1", - "zimmerframe": "^1.0.0" - }, - "scripts": { - "changeset:version": "changeset version", - "changeset:publish": "changeset publish", - "check": "tsc", - "prepublishOnly": "pnpm test && dts-buddy -m esrap:./src/public.d.ts -m esrap/languages/ts:./src/languages/ts/public.d.ts -m esrap/languages/tsx:./src/languages/tsx/public.d.ts", - "sandbox": "node test/sandbox/index.js", - "test": "vitest --run", - "test:ui": "vitest --ui" - }, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "packageManager": "pnpm@9.8.0", - "publishConfig": { - "access": "public" - } + "name": "esrap", + "version": "2.1.0", + "description": "Parse in reverse", + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/esrap.git" + }, + "type": "module", + "files": [ + "src", + "types" + ], + "exports": { + ".": { + "types": "./types/index.d.ts", + "default": "./src/index.js" + }, + "./languages/ts": { + "types": "./types/index.d.ts", + "default": "./src/languages/ts/index.js" + }, + "./languages/tsx": { + "types": "./types/index.d.ts", + "default": "./src/languages/tsx/index.js" + } + }, + "types": "./types/index.d.ts", + "devDependencies": { + "@changesets/cli": "^2.27.11", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@typescript-eslint/types": "^8.2.0", + "@vitest/ui": "^2.1.1", + "acorn": "^8.15.0", + "dts-buddy": "^0.6.2", + "prettier": "^3.0.3", + "typescript": "^5.7.2", + "vitest": "^2.1.1", + "zimmerframe": "^1.0.0" + }, + "scripts": { + "changeset:version": "changeset version", + "changeset:publish": "changeset publish", + "check": "tsc", + "prepublishOnly": "pnpm test && dts-buddy -m esrap:./src/public.d.ts -m esrap/languages/ts:./src/languages/ts/public.d.ts -m esrap/languages/tsx:./src/languages/tsx/public.d.ts", + "sandbox": "node test/sandbox/index.js", + "test": "vitest --run", + "test:ui": "vitest --ui", + "format": "pnpm lint --write", + "lint": "prettier --check . --ignore-path .gitignore --ignore-path .prettierignore" + }, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "packageManager": "pnpm@9.8.0", + "publishConfig": { + "access": "public" + } } diff --git a/test/samples/jsx-basic/expected.jsx b/test/samples/jsx-basic/expected.jsx index 8830fe7..8425af8 100644 --- a/test/samples/jsx-basic/expected.jsx +++ b/test/samples/jsx-basic/expected.jsx @@ -1,6 +1,6 @@ console.log(<> -