Skip to content

Commit

Permalink
COMPLETED / Code cleanup
Browse files Browse the repository at this point in the history
--------------------------------------------------------------------
 MAIN
 * Made changes according to PR review comments
 * Added eslint configuration
--------------------------------------------------------------------
  • Loading branch information
kkuna authored and Ant-Nazif committed Apr 28, 2020
1 parent 85b7221 commit 3ac2794
Show file tree
Hide file tree
Showing 32 changed files with 1,289 additions and 970 deletions.
91 changes: 91 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"parser": "babel-eslint",
"extends": "airbnb",

"env": {
"browser": true
},

"globals": {},

"rules": {
"jsx-a11y/label-has-for": [
2,
{
"components": ["Label"],
"required": {
"every": ["nesting", "id"]
},
"allowChildren": true
}
],
"jsx-a11y/label-has-associated-control": [
2,
{
"labelAttributes": ["label"],
"controlComponents": ["Input"],
"depth": 3
}
],
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/anchor-is-valid": "warn",
"dot-location": [1, "property"],
"max-len": [
"error",
{
"code": 120,
"ignoreStrings": true,
"ignoreComments": true,
"tabWidth": 2,
"ignoreTemplateLiterals": true
}
],
"no-underscore-dangle": 0,
"no-return-assign": ["error", "except-parens"],
"key-spacing": 0,
"arrow-parens": [1, "always"],
"generator-star-spacing": ["error", "both"],
"no-confusing-arrow": ["error", { "allowParens": true }],
"no-param-reassign": ["error", { "props": false }],
"no-nested-ternary": ["warn"],
"func-names": ["error", "as-needed"],

"react/sort-comp": 0,
"react/jsx-filename-extension": [
"error",
{
"extensions": [".js", ".jsx"]
}
],
"react/destructuring-assignment": 0,
"no-use-before-define": ["error", "nofunc"],
"import/first": ["off"],
"jsx-a11y/no-static-element-interactions": 0,

"no-mixed-operators": ["error", { "allowSamePrecedence": true }],
"newline-per-chained-call": ["error"],

"react/no-access-state-in-setstate": "warn",
"react/prefer-stateless-function": ["warn"],
"react/no-unused-state": ["error"],
"import/no-named-as-default-member": ["warn"],
"prefer-arrow-callback": "off",
"prefer-destructuring": [
"warn",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": true,
"object": false
}
}
],
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-unused-expressions": ["error", { "allowTernary": true }],
"no-console": ["error", { "allow": ["error", "warn"] }]
},
"plugins": ["jsx-a11y", "react"]
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,14 @@
"vm-browserify": "0.0.4"
},
"devDependencies": {
"@babel/helper-validator-identifier": "^7.9.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1",
"jest": "^24.9.0",
"jetifier": "^1.6.4",
"metro-react-native-babel-preset": "^0.56.0",
Expand Down
5 changes: 3 additions & 2 deletions src/VerusMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
fetchUsers,
loadServerVersions,
loadCachedHeaders,
initSettings
initSettings,
requestSeedData,
} from './actions/actionCreators';
import {
initCache,
Expand Down Expand Up @@ -104,7 +105,6 @@ class VerusMobile extends React.Component {
actionArr.forEach((action) => {
this.props.dispatch(action)
})

return Promise.all([loadServerVersions(this.props.dispatch), loadCachedHeaders(this.props.dispatch)])
})
.then(() => {
Expand All @@ -113,6 +113,7 @@ class VerusMobile extends React.Component {
.catch((err) => {
Alert.alert("Error", err.message)
})
this.props.dispatch(requestSeedData());
}

render() {
Expand Down
Loading

0 comments on commit 3ac2794

Please sign in to comment.