Skip to content

Commit 11f7b16

Browse files
authored
Convert to TypeScript (#61)
1 parent bbba60e commit 11f7b16

27 files changed

+8321
-13696
lines changed

.babelrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
}
1010
}
1111
],
12-
"@babel/preset-flow"
12+
"@babel/preset-typescript"
1313
],
1414
"plugins": [
15-
"@babel/plugin-transform-flow-strip-types",
1615
"@babel/plugin-syntax-dynamic-import",
1716
"@babel/plugin-syntax-import-meta",
18-
"@babel/plugin-proposal-class-properties",
17+
["@babel/plugin-proposal-class-properties", { "loose": true }],
18+
["@babel/plugin-transform-private-methods", { "loose": true }],
19+
["@babel/plugin-transform-private-property-in-object", { "loose": true }],
1920
"@babel/plugin-proposal-json-strings",
2021
[
2122
"@babel/plugin-proposal-decorators",

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.flowconfig

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js ${{ matrix.node_version }}
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: "22"
16+
- name: Prepare env
17+
run: yarn install --ignore-scripts --frozen-lockfile
18+
- name: Run linter
19+
run: yarn start lint
20+
21+
prettier:
22+
name: Prettier Check
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Use Node.js ${{ matrix.node_version }}
28+
uses: actions/setup-node@v2
29+
with:
30+
node-version: "22"
31+
- name: Prepare env
32+
run: yarn install --ignore-scripts --frozen-lockfile
33+
- name: Run prettier
34+
run: yarn start prettier
35+
36+
test:
37+
name: Unit Tests
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Use Node.js ${{ matrix.node_version }}
43+
uses: actions/setup-node@v2
44+
with:
45+
node-version: "22"
46+
- name: Prepare env
47+
run: yarn install --ignore-scripts --frozen-lockfile
48+
- name: Run unit tests
49+
run: yarn start test
50+
- name: Run code coverage
51+
uses: codecov/[email protected]

.github/workflows/lock.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Lock Threads"
2+
3+
on:
4+
schedule:
5+
- cron: "0 * * * *"
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
12+
concurrency:
13+
group: lock
14+
15+
jobs:
16+
action:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: dessant/lock-threads@v3
20+
with:
21+
issue-inactive-days: "365"
22+
issue-lock-reason: "resolved"
23+
pr-inactive-days: "365"
24+
pr-lock-reason: "resolved"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
*.iml
33
.nyc_output
44
coverage
5-
flow-coverage
65
node_modules
76
dist
87
lib
98
es
109
npm-debug.log
1110
.DS_Store
11+
*.d.test.ts
12+
*.tgz
13+
*.log

eslint.config.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import js from '@eslint/js'
2+
import tseslint from '@typescript-eslint/eslint-plugin'
3+
import tsparser from '@typescript-eslint/parser'
4+
5+
export default [
6+
js.configs.recommended,
7+
{
8+
files: ['**/*.{js,jsx,ts,tsx}'],
9+
languageOptions: {
10+
parser: tsparser,
11+
parserOptions: {
12+
ecmaVersion: 'latest',
13+
sourceType: 'module',
14+
ecmaFeatures: {
15+
jsx: true
16+
}
17+
},
18+
globals: {
19+
// Node.js globals
20+
require: 'readonly',
21+
module: 'readonly',
22+
process: 'readonly',
23+
global: 'readonly',
24+
__dirname: 'readonly',
25+
__filename: 'readonly',
26+
Buffer: 'readonly',
27+
console: 'readonly',
28+
// Browser globals
29+
setTimeout: 'readonly',
30+
clearTimeout: 'readonly'
31+
}
32+
},
33+
plugins: {
34+
'@typescript-eslint': tseslint
35+
},
36+
rules: {
37+
'jsx-a11y/href-no-hash': 'off',
38+
'no-unused-vars': 'off',
39+
'@typescript-eslint/no-unused-vars': [
40+
'warn',
41+
{
42+
argsIgnorePattern: '^_',
43+
varsIgnorePattern: '^_'
44+
}
45+
]
46+
}
47+
},
48+
{
49+
files: ['**/*.test.{js,jsx,ts,tsx}'],
50+
languageOptions: {
51+
globals: {
52+
// Jest globals
53+
describe: 'readonly',
54+
it: 'readonly',
55+
test: 'readonly',
56+
expect: 'readonly',
57+
beforeEach: 'readonly',
58+
afterEach: 'readonly',
59+
beforeAll: 'readonly',
60+
afterAll: 'readonly',
61+
jest: 'readonly'
62+
}
63+
}
64+
},
65+
{
66+
ignores: [
67+
'dist/**',
68+
'node_modules/**',
69+
'coverage/**',
70+
'*.config.js',
71+
'rollup.config.js'
72+
]
73+
}
74+
]

0 commit comments

Comments
 (0)