Skip to content

Commit cf07c6d

Browse files
committed
Update ESLint, update ESLint config, configure Prettier, format all files using new config
1 parent 42194a6 commit cf07c6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1577
-2754
lines changed

.babelrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"presets": [
3-
"@babel/env",
4-
"@babel/react"
5-
],
2+
"presets": ["@babel/env", "@babel/react"],
63
"env": {
74
"production-esm": {
85
"presets": [
9-
["@babel/env", {
10-
"modules": false
11-
}],
6+
[
7+
"@babel/env",
8+
{
9+
"modules": false
10+
}
11+
],
1212
"@babel/react"
1313
]
1414
}

.eslintrc.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
{
2-
"extends": "wojtekmaj/react",
3-
"parser": "babel-eslint",
4-
"rules": {
5-
"no-restricted-globals": "off"
6-
},
2+
"extends": "wojtekmaj/react-no-automatic-runtime",
73
"overrides": [
84
{
9-
"files": [
10-
"sample/**",
11-
"test/**"
12-
],
5+
"files": ["sample/**", "test/**"],
136
"rules": {
147
"import/no-unresolved": "off"
158
}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn pretty-quick --staged

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.cache
2+
.yarn
3+
coverage
4+
dist
5+
*.yml

.prettierrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

.vscode/extensions.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"recommendations": [
3-
"dbaeumer.vscode-eslint",
4-
"eamodio.gitlens"
5-
],
6-
"unwantedRecommendations": [
7-
"dbaeumer.jshint"
8-
]
2+
"recommendations": ["dbaeumer.vscode-eslint", "eamodio.gitlens", "esbenp.prettier-vscode"],
3+
"unwantedRecommendations": ["dbaeumer.jshint"]
94
}

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
24
"search.exclude": {
35
"**/.yarn": true
46
}

README.md

Lines changed: 75 additions & 77 deletions
Large diffs are not rendered by default.

jest.config.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
2-
"collectCoverageFrom": [
3-
"**/src/**.{js,jsx}",
4-
"!**/src/index.js"
5-
],
6-
"setupFiles": [
7-
"<rootDir>/jest.setup.js"
8-
],
2+
"collectCoverageFrom": ["**/src/**.{js,jsx}", "!**/src/index.js"],
3+
"setupFiles": ["<rootDir>/jest.setup.js"],
94
"testEnvironment": "jsdom"
105
}

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"copy-styles": "node ./copy-styles.js",
2020
"jest": "jest",
2121
"lint": "eslint sample/ src/ test/ --ext .jsx,.js",
22+
"postinstall": "husky install",
2223
"prepack": "yarn clean && yarn build",
2324
"test": "yarn lint && yarn jest"
2425
},
@@ -77,12 +78,14 @@
7778
"@babel/preset-env": "^7.15.0",
7879
"@babel/preset-react": "^7.14.0",
7980
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
80-
"babel-eslint": "^10.0.0",
8181
"enzyme": "^3.10.0",
82-
"eslint": "~7.19.0",
83-
"eslint-config-wojtekmaj": "^0.5.0",
82+
"eslint": "^8.5.0",
83+
"eslint-config-wojtekmaj": "^0.6.5",
84+
"husky": "^7.0.0",
8485
"jest": "^27.0.0",
8586
"less": "^4.0.0",
87+
"prettier": "^2.5.0",
88+
"pretty-quick": "^3.1.0",
8689
"react": "^17.0.0",
8790
"react-dom": "^17.0.0",
8891
"rimraf": "^3.0.0"

0 commit comments

Comments
 (0)