Skip to content

Commit

Permalink
refactor: enforce standard format & move config to root along with pr…
Browse files Browse the repository at this point in the history
…ettier & eslint
  • Loading branch information
Sceat committed Mar 4, 2024
1 parent 16be7a1 commit b88ec01
Show file tree
Hide file tree
Showing 28 changed files with 3,708 additions and 1,097 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
test
25 changes: 25 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": ["standard", "prettier"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"requireConfigFile": false,
"sourceType": "module",
"ecmaVersion": 12
},
"rules": {
"camelcase": "off",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": ["error", { "destructuring": "any" }],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-object-spread": "error",
"prefer-destructuring": "error",
"prefer-numeric-literals": "error",
"import/order": ["error", { "newlines-between": "always" }],
"no-throw-literal": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"]
}
}
16 changes: 15 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@ name: CI

on:
push:
branches:
- master
tags:
- v*
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
- run: npm ci
- run: npm run lint
publish-npm:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -14,10 +27,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
}
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@
![](https://i.imgur.com/ozCF28L.png)

TODO: documentation


4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down Expand Up @@ -26,7 +26,7 @@
])

// Define indices for the square using TRIANGLE_STRIP
const indices = new Uint16Array([0, 1, 2, 0, 2, 3]);
const indices = new Uint16Array([0, 1, 2, 0, 2, 3])
</script>
</body>
</html>
Loading

0 comments on commit b88ec01

Please sign in to comment.