Skip to content

Commit 7f1984c

Browse files
committed
build(eslint): adds eslint config and jest config
1 parent 42ac5c9 commit 7f1984c

File tree

4 files changed

+1231
-73
lines changed

4 files changed

+1231
-73
lines changed

.eslintrc.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"ecmaFeatures": {
15+
"jsx": true
16+
},
17+
"ecmaVersion": 12,
18+
"sourceType": "module"
19+
},
20+
"plugins": [
21+
"react",
22+
"@typescript-eslint"
23+
],
24+
"rules": {
25+
},
26+
"ignorePatterns": ["!src/**", "!stories/**"],"settings": {
27+
"react":{
28+
"version":"detect"
29+
}
30+
}
31+
}

jest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'jsdom',
4+
};

package.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"build:tsc": "ts-node config/move-files.ts",
2323
"build:storybook": "build-storybook",
2424
"storybook": "start-storybook -p 6006",
25-
"style": "yarn styles:format && yarn style:lint",
26-
"style:format": "prettier -w \"src/**.(ts|tsx)\"",
27-
"style:lint": "eslint \"src/**.(ts|tsx)\""
25+
"style": "yarn style:format && yarn style:lint",
26+
"style:format": "prettier -w src",
27+
"style:lint": "eslint src/**"
2828
},
2929
"release": {
3030
"plugins": [
@@ -55,8 +55,8 @@
5555
"husky": {
5656
"hooks": {
5757
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
58-
"pre-commit": "yarn build",
59-
"pre-push": "yarn build"
58+
"pre-commit": "yarn style && yarn build",
59+
"pre-push": "yarn style && yarn build"
6060
}
6161
},
6262
"config": {
@@ -89,16 +89,21 @@
8989
"@storybook/addon-links": "^6.0.21",
9090
"@storybook/react": "^6.0.21",
9191
"@types/classnames": "^2.2.10",
92+
"@types/jest": "^26.0.14",
9293
"@types/node": "14.11.2",
9394
"@types/react": "16.9.49",
9495
"@types/react-dom": "16.9.8",
9596
"@types/sortablejs": "^1.10.0",
97+
"@typescript-eslint/eslint-plugin": "^4.2.0",
98+
"@typescript-eslint/parser": "^4.2.0",
9699
"babel-loader": "^8.1.0",
97100
"commitizen": "^4.2.1",
98101
"copy-dir": "^1.3.0",
99102
"cz-conventional-changelog": "^3.3.0",
100103
"eslint": "^7.9.0",
104+
"eslint-plugin-react": "^7.21.2",
101105
"husky": "^4.3.0",
106+
"jest": "^26.4.2",
102107
"parcel-bundler": "^1.12.4",
103108
"prettier": "^2.1.2",
104109
"react": "^16.13.1",
@@ -110,6 +115,7 @@
110115
"semantic-release": "^17.1.2",
111116
"sortablejs": "^1.10.0",
112117
"storybook": "^6.0.21",
118+
"ts-jest": "^26.4.0",
113119
"ts-node": "^9.0.0",
114120
"typescript": "^4.0.3"
115121
}

0 commit comments

Comments
 (0)