Skip to content

Commit 5ebb621

Browse files
committed
chore: add react configs
1 parent 3dab3f3 commit 5ebb621

File tree

3 files changed

+69
-58
lines changed

3 files changed

+69
-58
lines changed

.eslintrc.json

+24-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
{
2-
"extends": [
3-
"standard-with-typescript",
4-
"plugin:@typescript-eslint/recommended"
5-
],
6-
"parserOptions": {
7-
"project": "./tsconfig.json"
8-
},
9-
"rules": {
10-
"@typescript-eslint/consistent-type-definitions": "off",
11-
"@typescript-eslint/strict-boolean-expressions": "off"
12-
}
13-
}
1+
{
2+
"settings": {
3+
"react": {
4+
"version": "detect"
5+
}
6+
},
7+
"extends": [
8+
"standard-with-typescript",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:react/recommended"
11+
],
12+
"plugins": [
13+
"react"
14+
],
15+
"parserOptions": {
16+
"project": "./tsconfig.json"
17+
},
18+
"rules": {
19+
"@typescript-eslint/consistent-type-definitions": "off",
20+
"@typescript-eslint/strict-boolean-expressions": "off",
21+
"react/jsx-uses-react": "error",
22+
"react/jsx-uses-vars": "error"
23+
}
24+
}

jest.config.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
module.exports = {
2-
roots: ['<rootDir>/src'],
3-
collectCoverageFrom: [
4-
'<rootDir>/src/**/*.{ts,tsx}'
5-
],
6-
coverageDirectory: 'coverage',
7-
testEnvironment: 'node',
8-
transform: {
9-
'.+\\.ts$': 'ts-jest'
10-
},
11-
moduleNameMapper: {
12-
'@/(.*)': '<rootDir>/src/$1'
13-
}
14-
}
1+
module.exports = {
2+
roots: ['<rootDir>/src'],
3+
collectCoverageFrom: [
4+
'<rootDir>/src/**/*.{ts,tsx}'
5+
],
6+
coverageDirectory: 'coverage',
7+
testEnvironment: 'jsdom',
8+
transform: {
9+
'.+\\.(ts|tsx)$': 'ts-jest'
10+
},
11+
moduleNameMapper: {
12+
'@/(.*)': '<rootDir>/src/$1'
13+
}
14+
}

tsconfig.json

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
9-
"esModuleInterop": true,
10-
"module": "esnext",
11-
"moduleResolution": "Node",
12-
"jsx": "react",
13-
"rootDir": "src",
14-
"baseUrl": "src",
15-
"paths": {
16-
"@/*": [
17-
"*"
18-
]
19-
},
20-
"allowJs": true,
21-
"skipLibCheck": true,
22-
"allowSyntheticDefaultImports": true,
23-
"strict": true,
24-
"forceConsistentCasingInFileNames": true,
25-
"resolveJsonModule": true,
26-
"noEmit": true,
27-
},
28-
"include": [
29-
"./src",
30-
]
31-
}
1+
{
2+
"compilerOptions": {
3+
"target": "es6",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "Node",
12+
"jsx": "react",
13+
"rootDir": "src",
14+
"baseUrl": "src",
15+
"paths": {
16+
"@/*": [
17+
"*"
18+
]
19+
},
20+
"allowJs": true,
21+
// "skipLibCheck": true,
22+
// "allowSyntheticDefaultImports": true,
23+
"strict": true,
24+
// "forceConsistentCasingInFileNames": true,
25+
"resolveJsonModule": true,
26+
// "noEmit": true,
27+
},
28+
"include": [
29+
"./src",
30+
]
31+
}

0 commit comments

Comments
 (0)