Skip to content

Commit 1efb67d

Browse files
Adding jest 🎉🎉
1 parent c5219f7 commit 1efb67d

17 files changed

+10366
-10320
lines changed

.babelrc

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"presets": [
3-
"@babel/preset-env",
4-
[
5-
"@babel/preset-react",
6-
{
7-
"runtime": "automatic"
8-
}
9-
],
10-
"@babel/preset-typescript"
11-
],
12-
"plugins": [
13-
[
14-
"@babel/plugin-transform-runtime",
15-
{
16-
"regenerator": true
17-
}
18-
]
19-
]
2+
"presets": [
3+
"@babel/preset-env",
4+
[
5+
"@babel/preset-react",
6+
{
7+
"runtime": "automatic"
8+
}
9+
],
10+
"@babel/preset-typescript"
11+
],
12+
"plugins": [
13+
[
14+
"@babel/plugin-transform-runtime",
15+
{
16+
"regenerator": true
17+
}
18+
]
19+
]
2020
}

.eslintrc.js

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,67 @@
11
module.exports = {
2-
parser: '@typescript-eslint/parser',
3-
root: true,
4-
env: {
5-
node: true,
6-
es6: true,
7-
browser: true,
8-
jest: true,
9-
},
10-
ignorePatterns: ['node_modules/*', 'build/*', 'webpack/*', '!.prettierrc.js'],
11-
parserOptions: {
12-
ecmaVersion: 2020,
13-
sourceType: 'module',
14-
},
15-
settings: {
16-
react: {
17-
version: 'detect',
18-
},
19-
},
20-
extends: [
21-
'plugin:react/recommended',
22-
'plugin:react-hooks/recommended',
23-
'plugin:@typescript-eslint/recommended',
24-
'plugin:import/errors',
25-
'plugin:import/warnings',
26-
'plugin:import/typescript',
27-
'plugin:jsx-a11y/recommended',
28-
'plugin:eslint-comments/recommended',
29-
// "prettier/@typescript-eslint",
30-
// "plugin:prettier/recommended",
31-
],
32-
rules: {
33-
'no-unused-vars': 'off',
34-
'@typescript-eslint/no-unused-vars': ['error'],
35-
'@typescript-eslint/no-var-requires': 'off',
36-
'react/prop-types': 'off',
37-
'react/jsx-uses-react': 'off',
38-
'react/react-in-jsx-scope': 'off',
39-
'@typescript-eslint/explicit-module-boundary-types': 'off',
40-
},
2+
parser: '@typescript-eslint/parser',
3+
root: true,
4+
env: {
5+
node: true,
6+
es6: true,
7+
browser: true,
8+
jest: true,
9+
},
10+
ignorePatterns: ['node_modules/*', 'build/*', 'webpack/*', '!.prettierrc.js'],
11+
parserOptions: {
12+
ecmaVersion: 2020,
13+
sourceType: 'module',
14+
},
15+
settings: {
16+
react: {
17+
version: 'detect',
18+
},
19+
},
20+
extends: [
21+
'plugin:react/recommended',
22+
'plugin:react-hooks/recommended',
23+
'plugin:@typescript-eslint/recommended',
24+
'plugin:import/errors',
25+
'plugin:import/warnings',
26+
'plugin:import/typescript',
27+
'plugin:jsx-a11y/recommended',
28+
'plugin:eslint-comments/recommended',
29+
'plugin:prettier/recommended',
30+
],
31+
rules: {
32+
'no-unused-vars': 'off',
33+
'@typescript-eslint/no-unused-vars': ['error'],
34+
'@typescript-eslint/no-var-requires': 'off',
35+
'react/prop-types': 'off',
36+
'react/jsx-uses-react': 'off',
37+
'react/react-in-jsx-scope': 'off',
38+
'@typescript-eslint/explicit-module-boundary-types': 'off',
39+
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
40+
'import/extensions': 'off',
41+
'import/no-unresolved': 'error',
42+
'import/order': [
43+
'error',
44+
{
45+
groups: [
46+
'builtin',
47+
'external',
48+
'internal',
49+
['parent', 'sibling', 'object', 'index'],
50+
],
51+
pathGroups: [
52+
{
53+
pattern: 'react',
54+
group: 'external',
55+
position: 'before',
56+
},
57+
],
58+
pathGroupsExcludedImportTypes: ['react'],
59+
'newlines-between': 'never',
60+
alphabetize: {
61+
order: 'asc',
62+
caseInsensitive: true,
63+
},
64+
},
65+
],
66+
},
4167
}

.prettierrc.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module.exports = {
2-
semi: false,
3-
trailingComma: 'es5',
4-
singleQuote: true,
5-
printWidth: 100,
6-
tabWidth: 4,
7-
endOfLine: 'auto',
2+
semi: false,
3+
trailingComma: 'es5',
4+
singleQuote: true,
5+
printWidth: 100,
6+
tabWidth: 4,
7+
useTabs: true,
8+
endOfLine: 'auto',
89
}

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+
testMatch: ['**/__tests__/**/*.(js|ts|tsx)'],
3+
testPathIgnorePatterns: [
4+
'<rootDir>/.next/',
5+
'<rootDir>/node_modules/',
6+
'<rootDir>/coverage',
7+
'<rootDir>/dist',
8+
],
9+
}

0 commit comments

Comments
 (0)