Skip to content

Commit

Permalink
Some prettier-related fixes
Browse files Browse the repository at this point in the history
This applies prettier to README.md.ejs, replacing tabs with spaces there.

Also, it seems that fastGlob has some limitation that prevents it from
correctly handling the glob pattern, so that prettier is not applied to
README.md or other files in the root directory of the package. I worked
around this limitation by duplicationg the list of file endings.
  • Loading branch information
hoodmane committed May 15, 2023
1 parent 92781a3 commit 29002e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ npm install -g wasm-feature-detect

```html
<script type="module">
import { simd } from "wasm-feature-detect";
import { simd } from "wasm-feature-detect";
if (await simd()) {
/* SIMD support */
} else {
/* No SIMD support */
}
if (await simd()) {
/* SIMD support */
} else {
/* No SIMD support */
}
</script>
```

### Hotlinking from Unpkg

```html
<script type="module">
import { simd } from "https://unpkg.com/wasm-feature-detect?module";
// ...
import { simd } from "https://unpkg.com/wasm-feature-detect?module";
// ...
</script>
```

Expand All @@ -42,9 +42,9 @@ If required, there’s also a UMD version
```html
<script src="https://unpkg.com/wasm-feature-detect/dist/umd/index.js"></script>
<script>
if (await wasmFeatureDetect.simd()) {
// ...
}
if (await wasmFeatureDetect.simd()) {
// ...
}
</script>
```

Expand All @@ -53,7 +53,7 @@ If required, there’s also a UMD version
All detectors return a `Promise<bool>`.

| Function | Proposal |
| --- | --- |
| -------- | -------- |
<% for (let detector of detectors) { _%>
| `<%= detector.func %>()` | [<%= detector.name %>](<%= detector.proposal %>) |
<%_ } %>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"build": "npm run build:library && npm run build:readme && npm run build:dts && npm run fmt",
"build:website": "npm run build && node genwebsite.cjs",
"prepublishOnly": "npm run build",
"fmt": "prettier --no-error-on-unmatched-pattern --write ./{,src,test,rollup-plugins}/*.{mjs,cjs,js,md}",
"fmt_test": "prettier --check --no-error-on-unmatched-pattern --write ./{,src,test,rollup-plugins}/*.{mjs,cjs,js,md}",
"fmt": "prettier --write ./{src,test,rollup-plugins}/*.{mjs,cjs,js,md} *.{mjs,cjs,js,md}",
"fmt_test": "prettier --check --no-error-on-unmatched-pattern --write ./{src,test,rollup-plugins}/*.{mjs,cjs,js,md} *.{mjs,cjs,js,md}",
"test": "npm run fmt_test && npm run build && node --no-warnings test/index.cjs"
},
"repository": "GoogleChromeLabs/wasm-feature-detect",
Expand Down

0 comments on commit 29002e9

Please sign in to comment.