Skip to content

Commit 2185749

Browse files
committed
Add tests & ESLint support
1 parent bbfb245 commit 2185749

22 files changed

Lines changed: 13649 additions & 2269 deletions

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
project: 'tsconfig.json',
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
'@typescript-eslint/no-unused-vars': ['warn', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }],
25+
'prettier/prettier': ['error', {
26+
singleQuote: true,
27+
printWidth: 100,
28+
endOfLine: "auto",
29+
}],
30+
eqeqeq: ['warn', 'always']
31+
},
32+
};

babel.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' } }],
4+
'@babel/preset-typescript',
5+
],
6+
plugins: [
7+
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
8+
['@babel/plugin-proposal-class-properties', { "loose": false }],
9+
],
10+
};

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
transform: {
5+
'^.+\\.ts?$': 'ts-jest',
6+
'\\.js$': '<rootDir>/node_modules/babel-jest',
7+
},
8+
transformIgnorePatterns: ['<rootDir>/node_modules/'],
9+
};

0 commit comments

Comments
 (0)