[IMPROVE] - fix some notes during code review
This commit is contained in:
parent
c6e7826500
commit
bacaf7fc33
91
.eslintrc.js
91
.eslintrc.js
|
@ -7,7 +7,10 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
"parser": "@babel/eslint-parser",
|
||||
"extends": "airbnb",
|
||||
"extends": [
|
||||
"@rocket.chat/eslint-config",
|
||||
// 'plugin:react/recommended'
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2017,
|
||||
|
@ -157,7 +160,7 @@ module.exports = {
|
|||
}],
|
||||
"react/static-property-placement": [0],
|
||||
"arrow-parens": ["error", "as-needed", { requireForBlockBody: true }],
|
||||
"react/jsx-props-no-spreading": [1],
|
||||
// "react/jsx-props-no-spreading": [1],
|
||||
"react/jsx-curly-newline": [0],
|
||||
"react/state-in-constructor": [0],
|
||||
"no-async-promise-executor": [0],
|
||||
|
@ -183,6 +186,90 @@ module.exports = {
|
|||
'no-await-in-loop': 0,
|
||||
'no-restricted-syntax': 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
],
|
||||
"extends": [
|
||||
// 'plugin:react/recommended',
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"@rocket.chat/eslint-config"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2018,
|
||||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true,
|
||||
"legacyDecorators": true
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/ban-types": [0],
|
||||
"func-call-spacing": "off",
|
||||
"jsx-quotes": [
|
||||
"error",
|
||||
"prefer-single"
|
||||
],
|
||||
"indent": "off",
|
||||
"no-dupe-class-members": "off",
|
||||
"no-extra-parens": "off",
|
||||
"no-spaced-func": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-useless-constructor": "off",
|
||||
"no-use-before-define": "off",
|
||||
"react/jsx-uses-react": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
"react/jsx-no-undef": "error",
|
||||
"react/jsx-fragments": [
|
||||
"error",
|
||||
"syntax"
|
||||
],
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/indent": [
|
||||
"error",
|
||||
"tab",
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-extra-parens": [
|
||||
"error",
|
||||
"all",
|
||||
{
|
||||
"conditionalAssign": true,
|
||||
"nestedBinaryExpressions": false,
|
||||
"returnAssign": true,
|
||||
"ignoreJSX": "all",
|
||||
"enforceForArrowConditionals": false
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-dupe-class-members": "error",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", {
|
||||
"argsIgnorePattern": "^_",
|
||||
"ignoreRestSiblings": true
|
||||
}]
|
||||
},
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [
|
||||
".js",
|
||||
".ts",
|
||||
".tsx"
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
10
package.json
10
package.json
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"lint-staged": {
|
||||
"*.{js,ts,tsx}": [
|
||||
"eslint",
|
||||
"eslint",
|
||||
"jest --bail --findRelatedTests"
|
||||
]
|
||||
},
|
||||
|
@ -133,10 +133,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
"@babel/eslint-parser": "^7.13.4",
|
||||
"@babel/eslint-parser": "^7.14.7",
|
||||
"@babel/eslint-plugin": "^7.13.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.8.3",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@rocket.chat/eslint-config-alt": "^0.27.0",
|
||||
"@storybook/addon-storyshots": "5.3.21",
|
||||
"@storybook/react-native": "5.3.25",
|
||||
"@types/jest": "^26.0.24",
|
||||
|
@ -149,14 +150,14 @@
|
|||
"@types/react-redux": "^7.1.18",
|
||||
"@types/react-test-renderer": "^17.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
||||
"@typescript-eslint/parser": "^4.28.3",
|
||||
"@typescript-eslint/parser": "^4.28.5",
|
||||
"axios": "0.21.1",
|
||||
"babel-jest": "27.0.2",
|
||||
"babel-plugin-transform-remove-console": "^6.9.4",
|
||||
"bugsnag-sourcemaps": "1.3.0",
|
||||
"codecov": "3.8.2",
|
||||
"detox": "18.17.0",
|
||||
"eslint": "7.14.0",
|
||||
"eslint": "^7.31.0",
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"eslint-plugin-jsx-a11y": "6.3.1",
|
||||
"eslint-plugin-react": "7.20.3",
|
||||
|
@ -169,6 +170,7 @@
|
|||
"mocha": "9.0.1",
|
||||
"otp.js": "1.2.0",
|
||||
"patch-package": "6.4.7",
|
||||
"prettier": "^2.3.2",
|
||||
"react-dom": "17.0.1",
|
||||
"react-test-renderer": "17.0.1",
|
||||
"reactotron-redux": "3.1.3",
|
||||
|
|
Loading…
Reference in New Issue