Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ jobs:
RUSTDOCFLAGS: "-D warnings"
- run: cargo package --list --locked
- run: npm ci
- run: npm run format:check
- run: npm run check:wasm
env:
RUSTDOCFLAGS: "-D warnings"
- run: npm run verify:pack
- run: npm run lint
- run: npm run typecheck
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pkg/
dist/
target/
CHANGELOG.md
package-lock.json
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 9 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,20 @@ cargo clippy --locked --lib --target wasm32-unknown-unknown --features wasm -- -
RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps --target wasm32-unknown-unknown --features wasm
```

If you change the Wasm or TypeScript code, also run these commands.
`npm run check:wasm` runs Clippy and rustdoc for `wasm32-unknown-unknown`.
`npm run build` compiles `src/wasm.rs` and `src/index.ts`.
`npm run verify:pack` runs `npm run build` and checks the archives:
If you change the Wasm, TypeScript, JSON, YAML or Markdown files, also
run these commands. `npm run check:wasm` runs Clippy and rustdoc for
`wasm32-unknown-unknown`. `npm run build` compiles `src/wasm.rs` and
`src/index.ts`. `npm run verify:pack` runs `npm run build` and checks
the archives. `npm run lint` and `npm run typecheck` need
`pkg/tunelet.d.ts` from `npm run build:wasm`:

```sh
npm ci
npm run format:check
RUSTDOCFLAGS="-D warnings" npm run check:wasm
npm run verify:pack
npm run lint
npm run typecheck
```

- `.github/workflows/ci.yml` runs these checks on each pull request and each
Expand Down
55 changes: 55 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { defineConfig, globalIgnores } from "eslint/config";
import js from "@eslint/js";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import prettier from "eslint-config-prettier/flat";
import yml from "eslint-plugin-yml";
import globals from "globals";
import tseslint from "typescript-eslint";

export default defineConfig([
globalIgnores([
"pkg/",
"dist/",
"target/",
"CHANGELOG.md",
"package-lock.json",
]),
{
files: ["**/*.{js,mjs,cjs}"],
extends: [js.configs.recommended, prettier],
languageOptions: {
globals: globals.node,
},
},
{
files: ["**/*.{ts,mts,cts}"],
extends: [
js.configs.recommended,
tseslint.configs.recommendedTypeChecked,
prettier,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ["**/*.json"],
plugins: { json },
language: "json/json",
extends: ["json/recommended"],
},
{
files: ["**/*.{yml,yaml}"],
extends: [yml.configs.recommended, yml.configs.prettier],
},
{
files: ["**/*.md"],
plugins: { markdown },
language: "markdown/gfm",
extends: ["markdown/recommended"],
},
]);
Loading