Skip to content

Commit 0d4379d

Browse files
committed
Add config for ESLint and Prettier
1 parent 4bb4bf8 commit 0d4379d

6 files changed

Lines changed: 58 additions & 0 deletions

File tree

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
.idea
3+
node_modules/
4+
built/

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es6: true
6+
},
7+
extends: [
8+
'eslint:recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'prettier/@typescript-eslint',
11+
'plugin:prettier/recommended'
12+
],
13+
rules: {
14+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
15+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
16+
'@typescript-eslint/no-unused-vars': 'error',
17+
'@typescript-eslint/no-explicit-any': 0,
18+
'@typescript-eslint/explicit-function-return-type': [
19+
'error',
20+
{
21+
allowExpressions: true
22+
}
23+
],
24+
'object-shorthand': ['error', 'always', { avoidQuotes: true }]
25+
},
26+
parserOptions: {
27+
parser: '@typescript-eslint/parser'
28+
}
29+
};

.prettierrc

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

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint"]
3+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": true
5+
}
6+
}

tests/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
env: {
3+
mocha: true
4+
},
5+
rules: {
6+
'@typescript-eslint/no-explicit-any': 0
7+
}
8+
};

0 commit comments

Comments
 (0)