-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypeScript and ESM support. (#163)
- Loading branch information
Showing
14 changed files
with
5,690 additions
and
1,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"root": true, | ||
"extends": ["eslint:recommended", "prettier"], | ||
"ignorePatterns": ["dist/**"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.js"], | ||
"env": { | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": "latest" | ||
} | ||
}, | ||
{ | ||
"files": ["*.ts"], | ||
"plugins": ["eslint-plugin-tsdoc"], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier" | ||
], | ||
"parserOptions": { | ||
"project": "tsconfig.json" | ||
}, | ||
"rules": { | ||
"tsdoc/syntax": "warn", | ||
// Aligns with our style-guide. | ||
"@typescript-eslint/switch-exhaustiveness-check": "error" | ||
} | ||
}, | ||
{ | ||
"files": ["tests.ts"], | ||
"extends": ["plugin:jest/recommended"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Quality | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
prettier: | ||
name: 'Prettier' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Prettier check | ||
run: npm run prettier-check | ||
|
||
eslint: | ||
name: 'ESLint' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint check | ||
run: npm run eslint-check | ||
|
||
types: | ||
name: 'TypeScript' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run TypeScript type check | ||
run: npm run type-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# build | ||
dist/ | ||
|
||
# dependencies | ||
node_modules | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
Oops, something went wrong.