Skip to content

Commit 4a22035

Browse files
committed
refactor(linting): udpated lint rules
1 parent 0086631 commit 4a22035

File tree

6 files changed

+144
-120
lines changed

6 files changed

+144
-120
lines changed

.eslintrc

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
1-
{
2-
"parser": "babel-eslint",
3-
"extends": ["standard", "standard-react", "prettier", "eslint:recommended"],
4-
"env": {
5-
"es6": true,
6-
"jest": true
7-
},
8-
"plugins": ["react", "prettier"],
9-
"parserOptions": {
10-
"sourceType": "module",
11-
"ecmaVersion": 2018,
12-
"ecmaFeatures": {
13-
"impliedStrict": true,
14-
"jsx": true,
15-
"arrowFunctions": true,
16-
"blockBindings": true,
17-
"defaultParams": true,
18-
"destructuring": true,
19-
"forOf": true,
20-
"generators": true,
21-
"objectLiteralComputedProperties": true,
22-
"objectLiteralShorthandMethods": true,
23-
"objectLiteralShorthandProperties": true,
24-
"experimentalObjectRestSpread": true,
25-
"restParams": true,
26-
"spread": true,
27-
"templateStrings": true,
28-
"modules": true,
29-
"classes": true
30-
}
31-
},
32-
"rules": {
33-
"react/jsx-no-bind": "off",
34-
"space-before-function-paren": 0,
35-
"react/jsx-boolean-value": 0,
36-
"max-len": [2, { "code": 120, "ignoreComments": true }],
37-
"newline-per-chained-call": 0,
38-
"no-trailing-spaces": ["error"],
39-
"quotes": ["error", "single", { "avoidEscape": true }],
40-
"comma-dangle": ["error", "never"],
41-
"no-template-curly-in-string": "off",
42-
"semi": ["error", "always"],
43-
"object-curly-spacing": ["error", "always"],
44-
"quote-props": ["error", "consistent"],
45-
"no-var": ["error"]
46-
}
47-
}
1+
{
2+
"parser": "@babel/eslint-parser",
3+
"extends": [
4+
"plugin:react/recommended",
5+
"standard-react",
6+
"prettier",
7+
"eslint:recommended"
8+
],
9+
"env": {
10+
"es6": true,
11+
"jest": true,
12+
"browser": true
13+
},
14+
"ignorePatterns": ["/bin", "/example", "/test", "/dist"],
15+
"plugins": ["react", "prettier"],
16+
"parserOptions": {
17+
"sourceType": "module",
18+
"ecmaVersion": 2018,
19+
"ecmaFeatures": {
20+
"impliedStrict": true,
21+
"jsx": true,
22+
"arrowFunctions": true,
23+
"blockBindings": true,
24+
"defaultParams": true,
25+
"destructuring": true,
26+
"forOf": true,
27+
"generators": true,
28+
"objectLiteralComputedProperties": true,
29+
"objectLiteralShorthandMethods": true,
30+
"objectLiteralShorthandProperties": true,
31+
"experimentalObjectRestSpread": true,
32+
"restParams": true,
33+
"spread": true,
34+
"templateStrings": true,
35+
"modules": true,
36+
"classes": true
37+
}
38+
},
39+
"rules": {
40+
"react/jsx-no-bind": "off",
41+
"space-before-function-paren": 0,
42+
"react/jsx-boolean-value": 0,
43+
"max-len": [2, { "code": 120, "ignoreComments": true }],
44+
"newline-per-chained-call": 0,
45+
"no-trailing-spaces": ["error"],
46+
"quotes": ["error", "single", { "avoidEscape": true }],
47+
"comma-dangle": ["error", "never"],
48+
"no-template-curly-in-string": "off",
49+
"semi": ["error", "always"],
50+
"object-curly-spacing": ["error", "always"],
51+
"quote-props": ["error", "consistent"],
52+
"no-var": ["error"]
53+
}
54+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
node_modules/
1313
dist/
1414
build/
15+
.env

.stylelintrc.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"extends": "stylelint-config-standard",
3-
"ignoreFiles": [
4-
"src/decorators/*.js"
5-
]
3+
"ignoreFiles": ["src/**/*.js"],
4+
"overrides": [
5+
{
6+
"files": ["*.scss", "**/*.scss"],
7+
"customSyntax": "postcss-scss"
8+
}
9+
],
10+
"rules": {
11+
"selector-class-pattern": null
12+
}
613
}

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"devDependencies": {
6565
"@babel/cli": "^7.18.10",
6666
"@babel/core": "^7.18.10",
67+
"@babel/eslint-parser": "^7.18.9",
6768
"@babel/plugin-proposal-class-properties": "^7.18.6",
6869
"@babel/plugin-proposal-decorators": "^7.18.10",
6970
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
@@ -81,7 +82,6 @@
8182
"@semantic-release/release-notes-generator": "^10.0.3",
8283
"@svgr/rollup": "^6.3.1",
8384
"@testing-library/react": "^13.3.0",
84-
"babel-eslint": "^10.1.0",
8585
"babel-loader": "8.2.5",
8686
"babelify": "^10.0.0",
8787
"browserify": "^17.0.0",
@@ -96,17 +96,16 @@
9696
"cz-conventional-changelog": "^3.3.0",
9797
"enzyme": "^3.11.0",
9898
"enzyme-adapter-react-16": "^1.15.6",
99-
"eslint": "^8.21.0",
100-
"eslint-config-jss": "5.0.1",
101-
"eslint-config-prettier": "8.5.0",
99+
"eslint": ">=8.21.0",
100+
"eslint-config-jss": ">=5.0.1",
101+
"eslint-config-prettier": ">=8.5.0",
102102
"eslint-config-standard": "^17.0.0",
103-
"eslint-config-standard-react": "^11.0.1",
104-
"eslint-plugin-import": "^2.26.0",
105-
"eslint-plugin-node": "^11.1.0",
103+
"eslint-config-standard-react": ">=11.0.1",
104+
"eslint-plugin-import": ">=2.26.0",
105+
"eslint-plugin-node": ">=11.1.0",
106106
"eslint-plugin-prettier": "4.2.1",
107-
"eslint-plugin-promise": "^6.0.0",
108-
"eslint-plugin-react": "^7.30.1",
109-
"eslint-plugin-standard": "^5.0.0",
107+
"eslint-plugin-promise": ">=6.0.0",
108+
"eslint-plugin-react": ">=7.30.1",
110109
"gh-pages": "4.0.0",
111110
"github-changes": "^2.0.3",
112111
"http-server": "^14.1.1",
@@ -119,6 +118,7 @@
119118
"mocha-jsdom": "^2.0.0",
120119
"npm-run-all": "^4.1.5",
121120
"postcss-nested": "^5.0.6",
121+
"postcss-scss": "^4.0.4",
122122
"postcss-simple-vars": "^6.0.3",
123123
"prettier": "2.7.1",
124124
"pretty-quick": "^3.1.3",

src/utils/getTipContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
import React from 'react';
1515

16-
export default function(tip, children, getContent, multiline) {
16+
export default function TipContent(tip, children, getContent, multiline) {
1717
if (children) return children;
1818
if (getContent !== undefined && getContent !== null) return getContent; // getContent can be 0, '', etc.
1919
if (getContent === null) return null; // Tip not exist and children is null or undefined

0 commit comments

Comments
 (0)