Skip to content

Commit

Permalink
Add linting and formatting for JS code in wasmtime explore (#8675)
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen authored May 21, 2024
1 parent 8bde231 commit 8848bac
Show file tree
Hide file tree
Showing 9 changed files with 1,173 additions and 61 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}

# Quick JS formatting/linting checks for the little bits of JS we have for the
# `wasmtime explore` UI.
check_js:
name: Check JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install
working-directory: ./crates/explorer
- run: npm run lint
working-directory: ./crates/explorer
- run: npm run fmt-check
working-directory: ./crates/explorer

# Check Code style quickly by running `clang-format` over all the C/C++ code
#
# Note that `wasmtime-platform.h` is excluded here as it's auto-generated.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ vendor
examples/build
examples/.cache
*.coredump
crates/explorer/node_modules
6 changes: 6 additions & 0 deletions crates/explorer/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.html
*.css
*.toml
*.rs
*.yml

3 changes: 3 additions & 0 deletions crates/explorer/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"arrowParens": "avoid"
}
12 changes: 12 additions & 0 deletions crates/explorer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import js from "@eslint/js";

export default [
js.configs.recommended,

{
rules: {
"no-unused-vars": "error",
"no-undef": "error",
},
},
];
Loading

0 comments on commit 8848bac

Please sign in to comment.