pagesource / fusion-components

A collection of React Components built with Emotion.js
https://sape-fusion.herokuapp.com/
MIT License
13 stars 22 forks source link

Eslint errors #58

Closed sbmadhav closed 6 years ago

sbmadhav commented 6 years ago

Do you want to request a feature or report a bug? Bug What is the current behavior? Multiple eslint errors. (excerpt below) What is the expected behavior? No eslint errors.

Below are the errors that need to be fixed-

/Users/bsrin2/Documents/CodeBase/XT-Fusion/pages/_document.js
  24:16  warning  Dangerous property 'dangerouslySetInnerHTML' found  react/no-danger

/Users/bsrin2/Documents/CodeBase/XT-Fusion/pages/chart-components.js
  11:1  error  Line 11 exceeds the maximum line length of 100  max-len

/Users/bsrin2/Documents/CodeBase/XT-Fusion/pages/components/Layout.js
  31:19  error  'children' is missing in props validation  react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/pages/kitchen-sink.js
  259:36  warning  Unexpected console statement  no-console

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Alert.js
  11:18  error  'children' is missing in props validation          react/prop-types
  18:9   error  'type' PropType is defined but prop is never used  react/no-unused-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Avatar.js
  10:19  error  'src' is missing in props validation  react/prop-types
  10:24  error  'alt' is missing in props validation  react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/BackgroundImage.js
  3:8  error  'React' is defined but never used  no-unused-vars

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Badge.js
   3:8   error  'React' is defined but never used                no-unused-vars
   5:7   error  'badgeStyle' is assigned a value but never used  no-unused-vars
  19:1   error  'Badge' is not defined                           no-undef
  31:1   error  'Badge' is not defined                           no-undef
  36:16  error  'Badge' is not defined                           no-undef

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Banner.js
  18:19  error  'src' is missing in props validation                 react/prop-types
  18:24  error  'alt' is missing in props validation                 react/prop-types
  25:11  error  'picUrl' PropType is defined but prop is never used  react/no-unused-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Blockquote.js
  3:8  error  'React' is defined but never used  no-unused-vars

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Bounce.js
   6:10  error  'theme' is defined but never used     no-unused-vars
  39:54  error  'alt' is missing in props validation  react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Button.js
  30:3  error  propType "onClick" is not required, but has no corresponding defaultProp declaration   react/require-default-props
  34:3  error  propType "children" is not required, but has no corresponding defaultProp declaration  react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Card.js
  29:41  error  Do not use Array index in keys                                                              react/no-array-index-key
  31:11  error  Do not pass children as props. Instead, nest children between the opening and closing tags  react/no-children-prop
  45:3   error  propType "cardData" is not required, but has no corresponding defaultProp declaration       react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Column.js
  13:24  error  'Column' is not defined  react/jsx-no-undef

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/CountdownTimer.js
  19:3   error  timer should be placed after componentDidMount       react/sort-comp
  20:5   error  Split 'const' declarations into multiple statements  one-var
  23:35  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  23:59  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  24:37  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  24:56  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  25:37  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  25:51  error  Unexpected mix of '%' and '/'                        no-mixed-operators
  41:5   error  Do not use setState in componentDidMount             react/no-did-mount-set-state

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Dialog.js
   72:13  error  Static HTML elements with event handlers require a role                            jsx-a11y/no-static-element-interactions
  101:10  error  'width' PropType is defined but prop is never used                                 react/no-unused-prop-types
  105:11  error  'height' PropType is defined but prop is never used                                react/no-unused-prop-types
  109:7   error  'bg' PropType is defined but prop is never used                                    react/no-unused-prop-types
  113:10  error  'title' PropType is defined but prop is never used                                 react/no-unused-prop-types
  121:3   error  propType "open" is not required, but has no corresponding defaultProp declaration  react/require-default-props
  121:9   error  'open' PropType is defined but prop is never used                                  react/no-unused-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Dropdown.js
   76:3   error  render should be placed after onClick                                              react/sort-comp
   80:1   error  Line 80 exceeds the maximum line length of 100                                     max-len
   80:7   error  Static HTML elements with event handlers require a role                            jsx-a11y/no-static-element-interactions
   86:50  error  'j' is defined but never used                                                      no-unused-vars
  106:10  error  'width' PropType is defined but prop is never used                                 react/no-unused-prop-types
  110:7   error  'bg' PropType is defined but prop is never used                                    react/no-unused-prop-types
  114:10  error  'title' PropType is defined but prop is never used                                 react/no-unused-prop-types
  118:3   error  propType "open" is not required, but has no corresponding defaultProp declaration  react/require-default-props
  118:9   error  'open' PropType is defined but prop is never used                                  react/no-unused-prop-types
  122:3   error  Prop type `array` is forbidden                                                     react/forbid-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Heading.js
  36:7  error  'H4' is assigned a value but never used           no-unused-vars
  43:7  error  'H5' is assigned a value but never used           no-unused-vars
  50:7  error  'H6' is assigned a value but never used           no-unused-vars
  57:7  error  'heading' is assigned a value but never used      no-unused-vars
  81:8  error  'tag' PropType is defined but prop is never used  react/no-unused-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/HorizontalBarChart.js
  4:10  error  'theme' is defined but never used  no-unused-vars

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Link 2.js
  3:14  error  'styled' is not defined  no-undef

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Link.js
  12:40  error  'React' must be in scope when using JSX  react/react-in-jsx-scope

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/LiveEdit.js
   5:1   error  'react-live' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies
  54:21  error  'noInline' is missing in props validation                                         react/prop-types
  54:31  error  'code' is missing in props validation                                             react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Logo.js
  10:1   error  Line 10 exceeds the maximum line length of 100  max-len
  10:43  error  'React' must be in scope when using JSX         react/react-in-jsx-scope

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Navbar.js
   69:19  error  'NavList' is defined but never used                 no-unused-vars
   74:9   error  Nested block is redundant                           no-lone-blocks
   93:23  error  'link' is missing in props validation               react/prop-types
   93:29  error  'navName' is missing in props validation            react/prop-types
   93:38  error  'keys' is missing in props validation               react/prop-types
  103:2   error  Unexpected tab character                            no-tabs
  104:2   error  Unexpected tab character                            no-tabs
  105:10  error  'width' PropType is defined but prop is never used  react/no-unused-prop-types
  107:2   error  Unexpected tab character                            no-tabs
  108:2   error  Unexpected tab character                            no-tabs
  109:7   error  'bg' PropType is defined but prop is never used     react/no-unused-prop-types
  111:2   error  Unexpected tab character                            no-tabs
  112:2   error  Unexpected tab character                            no-tabs
  113:10  error  'title' PropType is defined but prop is never used  react/no-unused-prop-types
  115:2   error  Unexpected tab character                            no-tabs
  116:2   error  Unexpected tab character                            no-tabs
  117:3   error  Prop type `array` is forbidden                      react/forbid-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Navigation.js
   5:44  error  'type' is missing in props validation                                               react/prop-types
  30:3   error  propType "links" is not required, but has no corresponding defaultProp declaration  react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Pagination.js
  60:9  error  Parsing error: Unexpected token =

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Panel.js
  6:11  error  'className' is missing in props validation  react/prop-types
  6:22  error  'children' is missing in props validation   react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Panel2.js
  14:18  error  'children' is missing in props validation  react/prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/ProgressBar.js
  43:12  error  Unexpected mix of '/' and '*'  no-mixed-operators
  43:16  error  Unexpected mix of '/' and '*'  no-mixed-operators

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/ProgressCircle.js
  38:12  error  Unexpected mix of '/' and '*'  no-mixed-operators
  38:16  error  Unexpected mix of '/' and '*'  no-mixed-operators

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Rating.js
  64:3  error  propType "onClick" is not required, but has no corresponding defaultProp declaration  react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Ripples.js
  5:10  error  'theme' is defined but never used  no-unused-vars

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Row.js
  9:20  error  'React' must be in scope when using JSX  react/react-in-jsx-scope

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/SelectRating.js
  33:5   error  Split 'let' declarations into multiple statements                                            one-var
  33:9   error  'stars' is never reassigned. Use 'const' instead                                            prefer-const
  36:5   error  iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations  no-restricted-syntax
  38:1   error  Line 38 exceeds the maximum line length of 100                                            max-len
  38:31  error  Script URL is a form of eval                                            no-script-url
  38:53  error  JSX props should not use .bind()                                            react/jsx-no-bind
  38:62  error  JSX props should not use .bind()                                            react/jsx-no-bind
  47:3   error  propType "value" is not required, but has no corresponding defaultProp declaration                                            react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Stepper.js
  46:3   error  propType "cardData" is not required, but has no corresponding defaultProp declaration  react/require-default-props
  46:13  error  'cardData' PropType is defined but prop is never used                                  react/no-unused-prop-types
  46:31  error  'cardData.*' PropType is defined but prop is never used                                react/no-unused-prop-types

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/StepperControl.js
    4:10  error  'theme' is defined but never used                                                 no-unused-vars
   79:7   error  Do not use setState in componentWillUpdate                                        react/no-will-update-set-state
   83:17  error  Expected 'this' to be used by class method 'getStepContent'                       class-methods-use-this
  114:11  error  Links must not point to "#". Use a more descriptive href or use a button instead  jsx-a11y/href-no-hash
  122:2   error  Unexpected tab character                                                          no-tabs
  122:2   error  Mixed spaces and tabs                                                             no-mixed-spaces-and-tabs
  147:1   error  Line 147 exceeds the maximum line length of 100                                   max-len
  148:23  error  Style prop value must be an object                                                react/style-prop-object

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Steps.js
   5:10  error  'theme' is defined but never used                                                   no-unused-vars
  42:17  error  Do not use Array index in keys                                                      react/no-array-index-key
  62:3   error  propType "steps" is not required, but has no corresponding defaultProp declaration  react/require-default-props

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Tabs.js
   6:17  error  'tabData' is missing in props validation  react/prop-types
   6:26  error  'onClick' is missing in props validation  react/prop-types
   6:35  error  'theme' is missing in props validation    react/prop-types
  68:22  error  Do not use Array index in keys            react/no-array-index-key
  69:23  error  Do not use Array index in keys            react/no-array-index-key
  78:21  error  Do not use Array index in keys            react/no-array-index-key

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/ToggleButton.js
   3:10  error  'theme' is defined but never used        no-unused-vars
  81:7   error  Form label must have associated control  jsx-a11y/label-has-for
  85:11  error  JSX props should not use .bind()         react/jsx-no-bind
  85:21  error  JSX props should not use .bind()         react/jsx-no-bind

/Users/bsrin2/Documents/CodeBase/XT-Fusion/fusion/Typing.js
   5:10  error  'theme' is defined but never used                      no-unused-vars
  22:31  error  'React' must be in scope when using JSX                react/react-in-jsx-scope
  33:10  error  'color' PropType is defined but prop is never used     react/no-unused-prop-types
  37:13  error  'fontSize' PropType is defined but prop is never used  react/no-unused-prop-types

✖ 131 problems (129 errors, 2 warnings)
sujayraaj commented 6 years ago

After quick analysis, Current status of master:

443 errors, 2 warnings

155 errors fixable with the eslint --fix option


121 Unexpected tab character issues 51 Mixed spaces and tabs 19 missing in props validation 19 no-unused-vars 17 indent issues

and so on.

An easy, yet tedious task. I am currently unable to pick this up, but if no one picks it up, I will in coming days.

Also, my prior experience makes me believe enforcing git hooks through a tool like husky would eliminate badly linted code getting inside master.

vinaymavi commented 6 years ago

ESLint error resolved including githooks https://github.com/pagesource/fusion-components/pull/66

vinaymavi commented 6 years ago

@sbmadhav @areai51 can we close this issue as #66 is merged?

sbmadhav commented 6 years ago

@vinaymavi - I still see eslint errors in development branch. Were all error resolved?

vinaymavi commented 6 years ago

yes @sbmadhav i have fixed all eslint errors manually. please checkout development branch at commit hash b3583860ff1f10e558fab622175d76c79a843787 and try npm run lint this should display only single warning over here.

It looks like some thing went wrong with repository that we need to investigate.