Skip to content

Commit 00e09da

Browse files
authored
Merge pull request #5 from arkrm/next
chore(release): publish v5.0.0
2 parents e231d31 + 4d96be1 commit 00e09da

8 files changed

Lines changed: 60 additions & 1503 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ yarn-error.log*
88

99
# misc
1010
.DS_Store
11+
12+
yarn.lock

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
## INSTALL
1616

1717
```bash
18-
# npx 会自动识别 npm/yarn
19-
npx install-peerdeps @arkrm/bionic -D
18+
# install with yarn
19+
yarn add @arkrm/bionic -D
20+
21+
# install with npm
22+
npm i @arkrm/bionic -D
2023
```
2124

2225
## USEAGE
@@ -33,9 +36,32 @@ module.exports = {
3336
};
3437

3538
// .prettierrc.js
36-
module.exports = require('@arkrm/bionic/prettier');;
39+
module.exports = require('@arkrm/bionic/prettier');
3740
```
3841

3942
## TIPS
4043

41-
+ [taro](https://github.com/nervjs/taro) 仅适用于 `>=3.x` 版本,且上层框架为 `react`
44+
+ [taro](https://github.com/nervjs/taro) 仅适用于 `>=3.x` 版本,且上层框架为 `react`
45+
46+
## VSCode config example
47+
48+
```json
49+
// .vscode/settings.json
50+
{
51+
"eslint.validate": ["javascript", "typescript", "typescriptreact"],
52+
"editor.codeActionsOnSave": {
53+
"source.fixAll.eslint": true
54+
},
55+
"[javascript]": {
56+
"editor.formatOnSave": false
57+
},
58+
"[typescript]": {
59+
"editor.formatOnSave": false
60+
},
61+
"[typescriptreact]": {
62+
"editor.formatOnSave": false
63+
},
64+
"editor.formatOnSave": true,
65+
"editor.defaultFormatter": "esbenp.prettier-vscode",
66+
}
67+
```

eslint/base.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ module.exports = {
88
jasmine: true,
99
},
1010
parser: require.resolve('@typescript-eslint/parser'),
11-
plugins: ['@typescript-eslint'],
12-
extends: ['airbnb', 'airbnb/hooks', 'plugin:prettier/recommended', 'prettier/react', 'prettier/@typescript-eslint'],
11+
plugins: ['jest'],
12+
extends: [
13+
'airbnb',
14+
'airbnb-typescript',
15+
'airbnb/hooks',
16+
'plugin:prettier/recommended',
17+
'prettier/react',
18+
'prettier/@typescript-eslint'
19+
],
1320
parserOptions: {
14-
ecmaVersion: 2018,
15-
sourceType: 'module',
21+
project: './tsconfig.json',
1622
ecmaFeatures: {
1723
jsx: true,
1824
},
1925
useJSXTextNode: true,
20-
warnOnUnsupportedTypeScriptVersion: true,
26+
warnOnUnsupportedTypeScriptVersion: false,
2127
},
2228
root: true,
2329
settings: {

eslint/rules.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module.exports = {
5959
'no-useless-constructor': 'off',
6060
'react/button-has-type': 'off',
6161
'react/jsx-filename-extension': ['error', { extensions: ['js', 'jsx', 'ts', 'tsx'] }],
62+
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
6263
'react/jsx-props-no-spreading': 'off',
6364
'react/require-default-props': 'off',
6465
'react/prop-types': 'off',

eslint/taro.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const forbidElements = htmlTags.map((tag) => ({
99

1010
module.exports = Object.assign({}, require('./base'), {
1111
rules: Object.assign({}, rules, {
12-
'class-methods-use-this': 'off',
1312
'react/forbid-elements': ['error', { forbid: forbidElements }],
1413
}),
1514
});

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@arkrm/bionic",
3-
"version": "4.1.1",
3+
"version": "5.0.0",
44
"author": "vdfor",
55
"keywords": [
66
"qurak",
@@ -33,18 +33,20 @@
3333
"release:next": "yarn publish --tag=next",
3434
"release:beta": "yarn publish --tag=beta"
3535
},
36-
"peerDependencies": {
37-
"@typescript-eslint/eslint-plugin": "^3.6.1",
38-
"@typescript-eslint/parser": "^3.6.1",
39-
"eslint": "^7.4.0",
40-
"eslint-config-airbnb": "^18.2.0",
41-
"eslint-config-prettier": "^6.11.0",
42-
"eslint-plugin-import": "^2.22.0",
43-
"eslint-plugin-jsx-a11y": "^6.3.1",
36+
"dependencies": {
37+
"@typescript-eslint/eslint-plugin": "^4.8.1",
38+
"@typescript-eslint/parser": "^4.8.1",
39+
"eslint": "^7.14.0",
40+
"eslint-config-airbnb": "^18.2.1",
41+
"eslint-config-airbnb-typescript": "^12.0.0",
42+
"eslint-config-prettier": "^6.15.0",
43+
"eslint-plugin-import": "^2.22.1",
44+
"eslint-plugin-jest": "^24.1.3",
45+
"eslint-plugin-jsx-a11y": "^6.4.1",
4446
"eslint-plugin-prettier": "^3.1.4",
45-
"eslint-plugin-react": "^7.20.3",
46-
"eslint-plugin-react-hooks": "^4.0.8",
47-
"prettier": "^2.0.5",
48-
"typescript": "^3.9.7"
47+
"eslint-plugin-react": "^7.21.5",
48+
"eslint-plugin-react-hooks": "^4.2.0",
49+
"prettier": "^2.2.0",
50+
"typescript": "^4.0.0"
4951
}
5052
}

prettier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
},
1313
},
1414
],
15-
printWidth: 150,
15+
printWidth: 200,
1616
singleQuote: true,
1717
trailingComma: 'all',
1818
};

0 commit comments

Comments
 (0)