giusedroid / react-sample

A simple react frontend to bootstrap and learn react
MIT License
0 stars 0 forks source link

Address all linting issues #5

Open giusedroid opened 5 years ago

giusedroid commented 5 years ago

Address all linting issues

A linter has been added and a bloodbath of linting issues has appeared.
As a developer I want my code as polished as possible, address all of the linting issues.

Dependencies

Acceptance Criteria

giusedroid commented 5 years ago

106 problems found with airbnb preset :/

λ ~/Code/front-end/react-sample/ features/3-linter* npx eslint src/ features/ --fix-dry-run

/Users/giuseppebattista/Code/front-end/react-sample/src/App.js
  36:24  error  Parsing error: Unexpected token =

/Users/giuseppebattista/Code/front-end/react-sample/src/App.test.js
  4:17  error  Parse errors in imported module './App': Unexpected token = (36:24)  import/no-named-as-default
  4:17  error  Parse errors in imported module './App': Unexpected token = (36:24)  import/no-named-as-default-member
  6:1   error  'it' is not defined                                                  no-undef
  7:15  error  'document' is not defined                                            no-undef
  8:19  error  JSX not allowed in files with extension '.js'                        react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/components/AppliedRoute.js
  4:1   error  Line 4 exceeds the maximum line length of 100  max-len
  4:19  error  'component' is missing in props validation     react/prop-types
  4:33  error  'props' is missing in props validation         react/prop-types
  4:62  error  JSX not allowed in files with extension '.js'  react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/components/AuthenticatedRoute.js
   4:19  error  'component' is missing in props validation          react/prop-types
   4:33  error  'props' is missing in props validation              react/prop-types
   5:3   error  JSX not allowed in files with extension '.js'       react/jsx-filename-extension
  11:40  error  'location' is missing in props validation           react/prop-types
  11:49  error  'location.pathname' is missing in props validation  react/prop-types
  11:66  error  'location' is missing in props validation           react/prop-types
  12:14  error  'location.search' is missing in props validation    react/prop-types

/Users/giuseppebattista/Code/front-end/react-sample/src/components/LoaderButton.js
   6:3  error  'isLoading' is missing in props validation     react/prop-types
   7:3  error  'text' is missing in props validation          react/prop-types
   8:3  error  'loadingText' is missing in props validation   react/prop-types
   9:3  error  'className' is missing in props validation     react/prop-types
  10:3  error  'disabled' is missing in props validation      react/prop-types
  13:3  error  JSX not allowed in files with extension '.js'  react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/components/UnauthenticatedRoute.js
   4:34  error  'window' is not defined                        no-undef
   5:3   error  Assignment to function parameter 'name'        no-param-reassign
  20:19  error  'component' is missing in props validation     react/prop-types
  20:33  error  'props' is missing in props validation         react/prop-types
  23:5   error  JSX not allowed in files with extension '.js'  react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/containers/Home.js
  19:10  error    Must use destructuring props assignment                       react/destructuring-assignment
  19:21  error    'isAuthenticated' is missing in props validation              react/prop-types
  25:7   error    'alert' is not defined                                        no-undef
  25:7   warning  Unexpected alert                                              no-alert
  31:8   error    Expected 'this' to be used by class method 'notes'            class-methods-use-this
  35:18  error    Expected 'this' to be used by class method 'renderNotesList'  class-methods-use-this
  39:11  error    JSX not allowed in files with extension '.js'                 react/jsx-filename-extension
  65:15  error    Expected 'this' to be used by class method 'renderLander'     class-methods-use-this
  81:13  error    Must use destructuring state assignment                       react/destructuring-assignment
  81:58  error    Must use destructuring state assignment                       react/destructuring-assignment
  90:10  error    Must use destructuring props assignment                       react/destructuring-assignment
  90:21  error    'isAuthenticated' is missing in props validation              react/prop-types

/Users/giuseppebattista/Code/front-end/react-sample/src/containers/Login.js
  25:18  error  Parsing error: Unexpected token =

/Users/giuseppebattista/Code/front-end/react-sample/src/containers/NewNote.js
  26:18  error  Parsing error: Unexpected token =

/Users/giuseppebattista/Code/front-end/react-sample/src/containers/Notes.js
  13:7   error    Unused state field: 'note'                        react/no-unused-state
  30:9   error    Unused state field: 'note'                        react/no-unused-state
  35:7   error    'alert' is not defined                            no-undef
  35:7   warning  Unexpected alert                                  no-alert
  40:24  error    Must use destructuring props assignment           react/destructuring-assignment
  40:35  error    'match' is missing in props validation            react/prop-types
  40:41  error    'match.params' is missing in props validation     react/prop-types
  40:48  error    'match.params.id' is missing in props validation  react/prop-types
  45:7   error    JSX not allowed in files with extension '.js'     react/jsx-filename-extension
  47:12  error    Must use destructuring state assignment           react/destructuring-assignment
  51:21  error    Must use destructuring state assignment           react/destructuring-assignment
  54:33  error    Must use destructuring state assignment           react/destructuring-assignment

/Users/giuseppebattista/Code/front-end/react-sample/src/containers/NotFound.js
  5:3  error  JSX not allowed in files with extension '.js'  react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/index.js
   5:17  error  Parse errors in imported module './App': Unexpected token = (36:24)  import/no-named-as-default
   5:17  error  Parse errors in imported module './App': Unexpected token = (36:24)  import/no-named-as-default-member
   9:3   error  JSX not allowed in files with extension '.js'                        react/jsx-filename-extension
  12:3   error  'document' is not defined                                            no-undef

/Users/giuseppebattista/Code/front-end/react-sample/src/lib/API.js
  35:20  error  'path' is defined but never used  no-unused-vars
  40:59  error  Missing radix parameter           radix

/Users/giuseppebattista/Code/front-end/react-sample/src/lib/Auth.js
  10:23  error  Parsing error: Unexpected token =

/Users/giuseppebattista/Code/front-end/react-sample/src/lib/Auth.test.js
   1:18  error  Parse errors in imported module './Auth': Unexpected token = (10:23)  import/no-named-as-default
   1:18  error  Parse errors in imported module './Auth': Unexpected token = (10:23)  import/no-named-as-default-member
   3:1   error  'it' is not defined                                                   no-undef
   4:9   error  'expect' is not defined                                               no-undef
   7:1   error  'it' is not defined                                                   no-undef
   8:9   error  'expect' is not defined                                               no-undef
  11:1   error  'it' is not defined                                                   no-undef
  13:3   error  'expect' is not defined                                               no-undef
  14:3   error  'expect' is not defined                                               no-undef

/Users/giuseppebattista/Code/front-end/react-sample/src/Routes.js
   6:19  error  Parse errors in imported module './containers/Login': Unexpected token = (25:18)    import/no-named-as-default
   6:19  error  Parse errors in imported module './containers/Login': Unexpected token = (25:18)    import/no-named-as-default-member
   7:21  error  Parse errors in imported module './containers/NewNote': Unexpected token = (26:18)  import/no-named-as-default
   7:21  error  Parse errors in imported module './containers/NewNote': Unexpected token = (26:18)  import/no-named-as-default-member
  12:19  error  'childProps' is missing in props validation                                         react/prop-types
  13:3   error  JSX not allowed in files with extension '.js'                                       react/jsx-filename-extension

/Users/giuseppebattista/Code/front-end/react-sample/src/serviceWorker.js
   14:3   error    'window' is not defined                                      no-undef
   16:8   error    'window' is not defined                                      no-undef
   18:8   error    'window' is not defined                                      no-undef
   24:67  error    'navigator' is not defined                                   no-undef
   26:55  error    'window' is not defined                                      no-undef
   27:30  error    'window' is not defined                                      no-undef
   34:5   error    'window' is not defined                                      no-undef
   39:9   error    'checkValidServiceWorker' was used before it was defined     no-use-before-define
   43:9   error    'navigator' is not defined                                   no-undef
   44:11  warning  Unexpected console statement                                 no-console
   51:9   error    'registerValidSW' was used before it was defined             no-use-before-define
   58:3   error    'navigator' is not defined                                   no-undef
   61:7   error    Assignment to property of function parameter 'registration'  no-param-reassign
   68:17  error    'navigator' is not defined                                   no-undef
   72:15  warning  Unexpected console statement                                 no-console
   85:15  warning  Unexpected console statement                                 no-console
   97:7   warning  Unexpected console statement                                 no-console
  103:3   error    'fetch' is not defined                                       no-undef
  112:9   error    'navigator' is not defined                                   no-undef
  114:13  error    'window' is not defined                                      no-undef
  123:7   warning  Unexpected console statement                                 no-console
  130:26  error    'navigator' is not defined                                   no-undef
  131:5   error    'navigator' is not defined                                   no-undef

/Users/giuseppebattista/Code/front-end/react-sample/features/hooks.js
  1:37  error  'cucumber' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies

/Users/giuseppebattista/Code/front-end/react-sample/features/step_definitions/steps.js
  1:31  error  'cucumber' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies

/Users/giuseppebattista/Code/front-end/react-sample/features/support/actions.js
  45:34  error  Redundant use of `await` on a return value  no-return-await

/Users/giuseppebattista/Code/front-end/react-sample/features/world.js
  1:33  error    'cucumber' should be listed in the project's dependencies, not devDependencies   import/no-extraneous-dependencies
  2:19  error    'puppeteer' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies
  5:15  warning  Unexpected unnamed function                                                      func-names

✖ 106 problems (98 errors, 8 warnings)