Skip to content

Commit 9490e37

Browse files
author
liaoliao666
committed
feat: version 1.0.0
0 parents  commit 9490e37

24 files changed

Lines changed: 21542 additions & 0 deletions

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.eslintrc

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"shared-node-browser": true,
5+
"node": true,
6+
"es6": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"prettier",
12+
"plugin:prettier/recommended",
13+
"plugin:react-hooks/recommended",
14+
"plugin:import/errors",
15+
"plugin:import/warnings"
16+
],
17+
"plugins": [
18+
"@typescript-eslint",
19+
"react",
20+
"prettier",
21+
"react-hooks",
22+
"import",
23+
"jest"
24+
],
25+
"parser": "@typescript-eslint/parser",
26+
"parserOptions": {
27+
"ecmaVersion": 2018,
28+
"sourceType": "module",
29+
"ecmaFeatures": {
30+
"jsx": true
31+
}
32+
},
33+
"rules": {
34+
"eqeqeq": "error",
35+
"no-var": "error",
36+
"prefer-const": "error",
37+
"curly": ["warn", "multi-line", "consistent"],
38+
"no-console": "off",
39+
"import/no-unresolved": ["error", { "commonjs": true, "amd": true }],
40+
"import/export": "error",
41+
"@typescript-eslint/no-duplicate-imports": ["error"],
42+
"@typescript-eslint/explicit-module-boundary-types": "off",
43+
"@typescript-eslint/no-unused-vars": [
44+
"warn",
45+
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
46+
],
47+
"@typescript-eslint/no-use-before-define": "off",
48+
"@typescript-eslint/no-empty-function": "off",
49+
"@typescript-eslint/no-explicit-any": "off",
50+
"jest/consistent-test-it": [
51+
"error",
52+
{ "fn": "it", "withinDescribe": "it" }
53+
],
54+
"import/order": [
55+
"error",
56+
{
57+
"alphabetize": { "order": "asc", "caseInsensitive": true },
58+
"groups": [
59+
"builtin",
60+
"external",
61+
"internal",
62+
"parent",
63+
"sibling",
64+
"index",
65+
"object"
66+
],
67+
"newlines-between": "never",
68+
"pathGroups": [
69+
{
70+
"pattern": "react",
71+
"group": "builtin",
72+
"position": "before"
73+
}
74+
],
75+
"pathGroupsExcludedImportTypes": ["builtin"]
76+
}
77+
],
78+
"react/jsx-uses-react": "off",
79+
"react/react-in-jsx-scope": "off",
80+
"sort-imports": [
81+
"error",
82+
{
83+
"ignoreDeclarationSort": true
84+
}
85+
]
86+
},
87+
"settings": {
88+
"react": {
89+
"version": "detect"
90+
},
91+
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
92+
"import/parsers": {
93+
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
94+
},
95+
"import/resolver": {
96+
"node": {
97+
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"],
98+
"paths": ["src"]
99+
}
100+
}
101+
},
102+
"overrides": [
103+
{
104+
"files": ["src"],
105+
"parserOptions": {
106+
"project": "./tsconfig.json"
107+
}
108+
},
109+
{
110+
"files": ["tests/**/*.tsx"],
111+
"env": {
112+
"jest/globals": true
113+
}
114+
},
115+
{
116+
"files": ["./*.js"],
117+
"rules": {
118+
"@typescript-eslint/no-var-requires": "off"
119+
}
120+
}
121+
]
122+
}

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "publish"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
registry-url: https://registry.npmjs.org
18+
cache: 'yarn'
19+
- run: |
20+
git config --global user.name 'liaoliao666'
21+
git config --global user.email '1076988944@qq.com'
22+
yarn
23+
yarn test && yarn build
24+
- name: publish
25+
run: npm publish --access publish
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules
2+
3+
# builds
4+
types
5+
dist
6+
lib
7+
es
8+
9+
# misc
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
size-plugin.json
14+
stats.json
15+
stats.html

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitlint --edit

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 liaoliao666
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)