Skip to content

Commit 9decd67

Browse files
committed
refactor: add a new setup to react-tooltip related to V5
BREAKING CHANGE: V5 will be the react tooltip built from scratch
1 parent a9b6854 commit 9decd67

Some content is hidden

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

45 files changed

+3176
-9782
lines changed

.babelrc

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
{
2-
"plugins": [
3-
["@babel/plugin-proposal-decorators", { "legacy": true }],
4-
"@babel/plugin-syntax-dynamic-import",
5-
"@babel/plugin-syntax-import-meta",
6-
["@babel/plugin-proposal-class-properties", { "loose": false }],
7-
"@babel/plugin-proposal-json-strings"
8-
],
92
"presets": [
10-
[
11-
"@babel/preset-env",
12-
{
13-
"useBuiltIns": "entry",
14-
"corejs": "3.12"
15-
}
16-
],
17-
"@babel/preset-react"
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
"@babel/plugin-proposal-class-properties"
188
]
199
}

.editorconfig

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# editorconfig.org
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
max_line_length = 100
13+
14+
[*.md]
15+
max_line_length = 0
16+
trim_trailing_whitespace = false
17+
18+
[{*.json, *.svg}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
# Matches the exact package.json, or *rc
23+
[{package.json,*.yml,*rc}]
24+
indent_style = space
25+
indent_size = 2

.eslintignore

-10
This file was deleted.

.eslintrc

-54
This file was deleted.

.eslintrc.json

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"extends": [
3+
"eslint-config-airbnb",
4+
"plugin:import/typescript",
5+
"plugin:@typescript-eslint/recommended",
6+
"prettier",
7+
"plugin:prettier/recommended"
8+
],
9+
"env": {
10+
"browser": true
11+
},
12+
"parser": "@typescript-eslint/parser",
13+
"plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
14+
"settings": {
15+
"import/resolver": {
16+
"node": {
17+
"extensions": [".js", ".jsx", ".ts", ".tsx"],
18+
"moduleDirectory": ["node_modules", "src/"]
19+
},
20+
"babel-module": {
21+
"root": ["./src/"],
22+
"alias": {
23+
"src": "./src",
24+
"components": "./src/components"
25+
}
26+
}
27+
}
28+
},
29+
"rules": {
30+
"operator-linebreak": [
31+
2,
32+
"after",
33+
{
34+
"overrides": {
35+
"?": "before",
36+
":": "before"
37+
}
38+
}
39+
],
40+
"object-curly-newline": 0,
41+
"implicit-arrow-linebreak": 0,
42+
"semi": ["error", "never"],
43+
"quotes": [
44+
"error",
45+
"single",
46+
{
47+
"allowTemplateLiterals": true,
48+
"avoidEscape": true
49+
}
50+
],
51+
"max-len": [
52+
"error",
53+
{
54+
"code": 100,
55+
"ignoreStrings": true,
56+
"ignoreTemplateLiterals": true
57+
}
58+
],
59+
"import/no-extraneous-dependencies": [
60+
"error",
61+
{
62+
"devDependencies": true
63+
}
64+
],
65+
"import/no-unresolved": [
66+
"error",
67+
{
68+
"commonjs": true,
69+
"amd": true
70+
}
71+
],
72+
"react/jsx-filename-extension": ["off"],
73+
"react/prop-types": ["warn"],
74+
"react/button-has-type": 0,
75+
"jsx-a11y/href-no-hash": "off",
76+
"jsx-a11y/label-has-for": [
77+
"error",
78+
{
79+
"allowChildren": true
80+
}
81+
],
82+
"jsx-a11y/anchor-is-valid": [
83+
"error",
84+
{
85+
"specialLink": ["to"]
86+
}
87+
],
88+
"react/jsx-props-no-spreading": 0,
89+
"react/react-in-jsx-scope": "off",
90+
"prettier/prettier": "error",
91+
"import/extensions": 0,
92+
"@typescript-eslint/no-unused-vars": "error",
93+
"@typescript-eslint/no-explicit-any": "warn",
94+
"import/prefer-default-export": "off"
95+
}
96+
}

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# do not show lock files while doing git diff
2+
package-lock.json -diff
3+
yarn.lock -diff

.gitignore

+31-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
1-
# system files
2-
*.log
3-
.DS_Store*
1+
## editors
2+
/.idea
3+
4+
## system files
5+
.DS_Store
46
.idea/
7+
*.log
8+
9+
## npm
10+
/node_modules/
11+
/npm-debug.log
12+
.npmrc
13+
14+
## testing
15+
/coverage/
16+
17+
## bower
18+
/bower_components*/
19+
/bower-*.json
20+
21+
## temp folders
22+
/.tmp/
23+
24+
## demoing
25+
/demo/
26+
27+
## building
28+
/build/
29+
/dist/
30+
31+
## other
32+
yarn-error.log
533

634
# push to github
735
!.babelrc
836
!.gitignore
937
!.npmignore
10-
11-
# files
12-
node_modules/
13-
dist/
14-
build/
15-
.env
16-
.npmrc

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
33

4-
npm test
4+
npm run eslint
5+
# npm run stylelint
6+
npm run prettier

.prettierrc.js

-11
This file was deleted.

.prettierrc.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "always",
4+
"proseWrap": "preserve",
5+
"singleQuote": true,
6+
"trailingComma": "all",
7+
"tabWidth": 2,
8+
"printWidth": 100,
9+
"bracketSameLine": false,
10+
"endOfLine": "auto"
11+
}

.stylelintrc.json

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
{
2-
"extends": "stylelint-config-standard",
3-
"ignoreFiles": ["src/**/*.js"],
4-
"overrides": [
5-
{
6-
"files": ["*.scss", "**/*.scss"],
7-
"customSyntax": "postcss-scss"
8-
}
9-
],
2+
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
103
"rules": {
11-
"selector-class-pattern": null
4+
"declaration-no-important": true,
5+
"declaration-colon-newline-after": null,
6+
"selector-pseudo-class-no-unknown": [
7+
true,
8+
{
9+
"ignorePseudoClasses": ["global"]
10+
}
11+
],
12+
"selector-pseudo-element-no-unknown": [
13+
true,
14+
{
15+
"ignorePseudoElements": ["global"]
16+
}
17+
]
1218
}
13-
}
19+
}

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": true
4+
},
5+
"css.lint.unknownAtRules": "ignore",
6+
"editor.formatOnSave": true,
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"typescript.tsdk": "node_modules/typescript/lib",
9+
"eslint.validate": [
10+
"vue",
11+
"html",
12+
"javascript",
13+
"typescript",
14+
"javascriptreact",
15+
"typescriptreact"
16+
]
17+
}

0 commit comments

Comments
 (0)