Skip to content

Commit

Permalink
Port to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Mar 13, 2024
1 parent 4577b92 commit 88e320c
Show file tree
Hide file tree
Showing 20 changed files with 2,348 additions and 254 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/
/dist/
/dev/
/test/
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"root": true,
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"rules": {
"eqeqeq": 2,
"no-duplicate-imports": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "never"]
},
"env": {
"node": true
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.[hH][eE][iI][cC] linguist-detectable=false
/dist/* -diff linguist-generated=true
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
pull_request:
branches: [ main ]
branches: [main]

jobs:
test:
Expand All @@ -18,16 +18,25 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm ci
- run: npm build --if-present
- run: npm test
- run: npm pack --dry-run
- uses: actions/upload-artifact@v4
if: ${{ matrix.node-version == 16 }}
with:
name: build
path: dist

publish:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: build
- uses: actions/setup-node@v4
with:
node-version: 16
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/test/test.jpg
/node_modules/
/dev/
/dist/
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/test/
/package-lock.json
/.*
/src/
/dev/
/tsconfig.json
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/
/dist/
/dev/
/test/
12 changes: 8 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"printWidth": 140,
"singleQuote": true,
"semi": true,
"useTabs": false
"semi": false,
"singleQuote": true,
"singleAttributePerLine": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 140,
"endOfLine": "lf"
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files.eol": "\n",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "never",
"source.fixAll.format": "never"
},
"typescript.tsdk": "./node_modules/typescript/lib"
}
Loading

0 comments on commit 88e320c

Please sign in to comment.