Skip to content

Commit 6e5e9d8

Browse files
committed
chore: add configurations and ci
1 parent 2cf9070 commit 6e5e9d8

File tree

13 files changed

+5047
-2
lines changed

13 files changed

+5047
-2
lines changed

.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"project": "jsconfig.json",
6+
"ecmaVersion": 2019
7+
},
8+
"env": {
9+
"node": true,
10+
"es6": true
11+
},
12+
"plugins": ["prettier", "@typescript-eslint"],
13+
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
14+
"rules": {
15+
"strict": "error",
16+
"prettier/prettier": "error",
17+
"no-console": "error",
18+
"valid-typeof": "error",
19+
"eqeqeq": [
20+
"error",
21+
"always",
22+
{
23+
"null": "ignore"
24+
}
25+
],
26+
"no-implicit-coercion": "error",
27+
"@typescript-eslint/strict-boolean-expressions": "error"
28+
}
29+
}

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: unit tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [12.x, 14.x, 16.x, 18.x]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm clean-install
25+
- run: npm run check:test

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Use Node.js LTS
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: lts/*
20+
- run: npm clean-install
21+
- run: npm run check:lint

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!mongodb-legacy.d.ts
2+
.vscode/

.mocharc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json",
3+
"extension": ["js", "ts"],
4+
"recursive": true,
5+
"failZero": true,
6+
"sort": true,
7+
"color": true,
8+
"require": [
9+
"source-map-support/register",
10+
"ts-node/register"
11+
]
12+
}

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"arrowParens": "avoid",
6+
"trailingComma": "none"
7+
}

README.md

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

jsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"target": "es2020",
5+
"allowJs": true,
6+
"checkJs": true,
7+
"strict": false,
8+
"strictNullChecks": true,
9+
"strictPropertyInitialization": true,
10+
"noEmit": true
11+
}
12+
}

0 commit comments

Comments
 (0)