Skip to content

Commit 2e0f5ce

Browse files
add template and tsconfig
1 parent 2bd4336 commit 2e0f5ce

37 files changed

+11770
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 100
11+
end_of_line = lf
12+
13+
[*.md]
14+
max_line_length = off
15+
trim_trailing_whitespace = false

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# /node_modules/* in the project root is ignored by default
2+
# build artefacts
3+
dist/*
4+
# data definition files
5+
**/*.d.ts

.eslintrc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"plugin:@typescript-eslint/recommended"
5+
],
6+
"parserOptions": {
7+
"ecmaVersion": 2018,
8+
"sourceType": "module"
9+
},
10+
"rules": {
11+
"semi": [
12+
"error",
13+
"always"
14+
],
15+
"quotes": [
16+
"error",
17+
"single"
18+
],
19+
"@typescript-eslint/explicit-function-return-type": "off",
20+
"@typescript-eslint/no-explicit-any": 1,
21+
"@typescript-eslint/no-inferrable-types": [
22+
"warn",
23+
{
24+
"ignoreParameters": true
25+
}
26+
],
27+
"@typescript-eslint/no-unused-vars": "warn"
28+
}
29+
}

.github/workflows/test.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build-node:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js 16.x
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: 16.x
15+
- name: Get npm cache directory
16+
id: npm-cache
17+
run: |
18+
echo "::set-output name=dir::$(npm config get cache)"
19+
- uses: actions/cache@v2
20+
with:
21+
path: ${{ steps.npm-cache.outputs.dir }}
22+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
23+
restore-keys: |
24+
${{ runner.os }}-node-
25+
- name: yarn install, build, and test
26+
run: |
27+
yarn
28+
yarn build
29+
yarn test

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# build output
2+
dist/
3+
# dependencies
4+
node_modules/
5+
# coverage
6+
coverage/
7+
8+
# tests
9+
test/tmp
10+
11+
# yarn
12+
.yarn/*
13+
!.yarn/patches
14+
!.yarn/plugins
15+
!.yarn/releases
16+
!.yarn/sdks
17+
!.yarn/versions

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit "$1"

.husky/post-checkout

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn install

.husky/post-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
git status

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn pre-commit

.husky/pre-push

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint
5+
yarn build

.npmignore

Whitespace-only changes.

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
coverage
3+
node_modules
4+
.github

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true
6+
}

.yarn/releases/yarn-3.2.0-rc.10.cjs

+778
Large diffs are not rendered by default.

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.2.0-rc.10.cjs

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

index.js

+185
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
collectCoverage: true,
5+
coverageDirectory: 'coverage',
6+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
7+
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
8+
transformIgnorePatterns: ['node_modules/(?!graasp-.*)'],
9+
verbose: true,
10+
};

0 commit comments

Comments
 (0)