Skip to content

Commit 07e546d

Browse files
authored
Merge pull request #7 from chughtapan/groups/scaffolding-v2
Add TypeScript SDK scaffolding with CI and linting
2 parents ee8b6b4 + f190cd4 commit 07e546d

7 files changed

Lines changed: 4229 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: sdk/typescript
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 18
23+
cache: npm
24+
cache-dependency-path: sdk/typescript/package-lock.json
25+
26+
- run: npm ci
27+
- run: npm run build
28+
- run: npm test
29+
- run: npm run lint

sdk/typescript/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
coverage
3+
node_modules
4+
*-lock.*

sdk/typescript/.prettierrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"printWidth": 140,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"bracketSameLine": false,
10+
"proseWrap": "always",
11+
"arrowParens": "avoid",
12+
"overrides": [
13+
{
14+
"files": "**/*.md",
15+
"options": {
16+
"printWidth": 280
17+
}
18+
}
19+
]
20+
}

sdk/typescript/eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{
11+
linterOptions: {
12+
reportUnusedDisableDirectives: false
13+
},
14+
rules: {
15+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }]
16+
}
17+
},
18+
eslintConfigPrettier
19+
);

0 commit comments

Comments
 (0)