Skip to content

Commit de77b8f

Browse files
committed
Update ESLint, update ESLint config, configure Prettier, format all files using new config
1 parent 0d2b1f0 commit de77b8f

Some content is hidden

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

74 files changed

+1493
-2245
lines changed

.babelrc

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"presets": [
3-
"@babel/env",
4-
"@babel/react"
5-
],
6-
"plugins": [
7-
"@babel/transform-runtime"
8-
],
2+
"presets": ["@babel/env", "@babel/react"],
3+
"plugins": ["@babel/transform-runtime"],
94
"env": {
105
"production-esm": {
116
"presets": [
12-
["@babel/env", {
13-
"modules": false
14-
}],
7+
[
8+
"@babel/env",
9+
{
10+
"modules": false
11+
}
12+
],
1513
"@babel/react"
1614
],
17-
"plugins": [
18-
["@babel/transform-runtime", { "useESModules": true }]
19-
]
15+
"plugins": [["@babel/transform-runtime", { "useESModules": true }]]
2016
}
2117
}
2218
}

.eslintrc.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
{
2-
"extends": "wojtekmaj/react",
3-
"parser": "babel-eslint",
4-
"rules": {
5-
"no-underscore-dangle": ["error", { "allow": ["_pdfInfo", "_pageIndex", "_pageInfo"] }],
6-
"react/sort-comp": "off"
7-
},
2+
"extends": "wojtekmaj/react-no-automatic-runtime",
83
"overrides": [
94
{
10-
"files": [
11-
"sample/**",
12-
"test/**"
13-
],
5+
"files": ["sample/**", "test/**"],
146
"rules": {
157
"import/no-unresolved": "off"
168
}

.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: 81 additions & 81 deletions
Large diffs are not rendered by default.

jest.config.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
"moduleNameMapper": {
99
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
1010
},
11-
"setupFiles": [
12-
"<rootDir>/jest.setup.js"
13-
],
11+
"setupFiles": ["<rootDir>/jest.setup.js"],
1412
"testEnvironment": "<rootDir>/jest.env.js"
1513
}

jest.env.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ const JSDOMEnvironment = require('jest-environment-jsdom');
88

99
class CustomJSDOMEnvironment extends JSDOMEnvironment {
1010
constructor(config) {
11-
super(
12-
{
13-
...config,
14-
globals: {
15-
...config.globals,
16-
Uint32Array,
17-
Uint8Array,
18-
ArrayBuffer,
19-
},
11+
super({
12+
...config,
13+
globals: {
14+
...config.globals,
15+
Uint32Array,
16+
Uint8Array,
17+
ArrayBuffer,
2018
},
21-
);
19+
});
2220
}
2321
}
2422

0 commit comments

Comments
 (0)