Skip to content

Commit

Permalink
Add linting and formatting for JS code in wasmtime explore
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen committed May 21, 2024
1 parent 8bde231 commit 52bf55f
Show file tree
Hide file tree
Showing 9 changed files with 1,184 additions and 61 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: JavaScript CI

on:
pull_request
branches:
- main
- "release-*"

# Cancel any in-flight jobs for the same PR/branch so there's only one active at
# a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
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
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 52bf55f

Please sign in to comment.