Skip to content

Commit 6758134

Browse files
committed
Modernized it
* Using Yarn * Replaced ts-lint with es-lint * Added Prettier * Added Husky commit hook for linting * Added explicit return types on all methods
1 parent 041e885 commit 6758134

File tree

11 files changed

+4737
-5285
lines changed

11 files changed

+4737
-5285
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.d.ts
2+
*.js
3+
lib
4+
dist
5+
docs
6+
node_modules

.eslintrc.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
// Specifies the ESLint parser
3+
parser: '@typescript-eslint/parser',
4+
extends: [
5+
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
6+
'plugin:@typescript-eslint/recommended',
7+
// Uses eslint-config-prettier to disable ESLint rules from
8+
// @typescript-eslint/eslint-plugin that would conflict with prettier
9+
'prettier/@typescript-eslint',
10+
'plugin:prettier/recommended',
11+
],
12+
parserOptions: {
13+
// Allows for the parsing of modern ECMAScript features
14+
ecmaVersion: 2019,
15+
// Allows for the use of imports
16+
sourceType: 'module',
17+
},
18+
rules: {
19+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
20+
// "@typescript-eslint/explicit-function-return-type": "off",
21+
// "eslint/prettier/prettier)"
22+
'no-unused-vars': 'off',
23+
'@typescript-eslint/no-unused-vars': [
24+
'error',
25+
{
26+
vars: 'all',
27+
args: 'after-used',
28+
ignoreRestSiblings: true,
29+
argsIgnorePattern: '^_',
30+
},
31+
],
32+
},
33+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.d.ts
2+
lib
3+
dist
4+
docs
5+
node_modules

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
trailingComma: 'es5',
6+
arrowParens: 'always',
7+
}

jest.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
module.exports = {
22
transform: {
3-
"^.+\\.ts$": "ts-jest"
3+
'^.+\\.ts$': 'ts-jest',
44
},
55
roots: ['tests'],
6-
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts?)$",
7-
moduleFileExtensions: [
8-
"ts",
9-
"js",
10-
"json",
11-
"node"
12-
],
13-
};
6+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts?)$',
7+
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
8+
}

0 commit comments

Comments
 (0)