Skip to content

Commit 4b5f74d

Browse files
.
1 parent 54d4a79 commit 4b5f74d

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

.babelrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": ["@babel/plugin-proposal-class-properties"],
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"modules": false
8+
}
9+
]
10+
]
11+
}

.eslintrc.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,32 @@ module.exports = {
33
browser: true,
44
es2021: true,
55
},
6-
extends: ['airbnb', 'prettier', 'plugin:prettier/recommended'],
7-
plugins: ['import', 'prettier'],
6+
extends: ['airbnb', 'prettier'],
7+
plugins: ['import', 'promise', 'prettier'],
8+
parser: '@babel/eslint-parser',
89
parserOptions: {
910
ecmaVersion: 12,
11+
sourceType: 'module',
1012
},
1113
rules: {
12-
'class-methods-use-this': false,
14+
// Native
15+
'class-methods-use-this': [0],
16+
'new-cap': 0,
17+
'no-restricted-syntax': 0,
18+
'no-unused-vars': ['error', { varsIgnorePattern: '^_' }],
19+
20+
// Plugins
21+
'promise/always-return': 'error',
22+
'promise/avoid-new': 'warn',
23+
'promise/catch-or-return': 'error',
24+
'promise/no-callback-in-promise': 'warn',
25+
'promise/no-native': 'off',
26+
'promise/no-nesting': 'warn',
27+
'promise/no-new-statics': 'error',
28+
'promise/no-promise-in-callback': 'warn',
29+
'promise/no-return-in-finally': 'warn',
30+
'promise/no-return-wrap': 'error',
31+
'promise/param-names': 'error',
32+
'promise/valid-params': 'warn',
1333
},
1434
};

jest.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"testEnvironment": "node",
33
"verbose": true,
4+
"modulePathIgnorePatterns": ["<rootDir>/coverage/", "<rootDir>/docs/"],
45
"testMatch": ["**/tests/**/*.test.js"]
56
}

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@
1414
"project:reset": "rm -rf node_modules"
1515
},
1616
"dependencies": {
17+
"@babel/core": "^7.12.10",
18+
"@babel/eslint-parser": "^7.12.1",
19+
"@babel/plugin-proposal-class-properties": "^7.12.1",
20+
"@babel/preset-env": "^7.12.11",
21+
"autoprefixer": "^10.2.1",
22+
"babel-jest": "^26.6.3",
23+
"babel-loader": "^8.2.2",
1724
"eslint": "^7.18.0",
1825
"eslint-config-airbnb": "^18.2.0",
1926
"eslint-config-airbnb-base": "^14.2.1",
2027
"eslint-config-prettier": "^7.2.0",
2128
"eslint-plugin-import": "^2.22.1",
2229
"eslint-plugin-jsx-a11y": "^6.4.1",
2330
"eslint-plugin-prettier": "^3.3.1",
31+
"eslint-plugin-promise": "^4.2.1",
2432
"eslint-plugin-react": "^7.22.0",
2533
"eslint-plugin-react-hooks": "^4.2.0",
2634
"jest": "^26.6.3",

0 commit comments

Comments
 (0)