Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting and formatting for JS code in wasmtime explore #8675

Merged
Merged
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
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