Skip to content

Releases: ezhlobo/eslint-plugin-react-pug

v0.8.4

29 Aug 11:35
Compare
Choose a tag to compare

Fixed

  • Now we resolve and understand used variables when we use nested iterations correctly:

    each item in props.list
      each inside in item
        = inside.a

    In this example props.list[][].a will be marked as used.

v0.8.3

28 Aug 06:07
Compare
Choose a tag to compare

Fixed

  • We now handle nested spreading properly and mark all variables inside it as used

    The following code doesn't trigger a warning. However, if there is props.style.id used in props, we require the definition for id.

    const Component = props => pug`
      div(...props.style)
    `
    Component.propTypes = {
      style: PropTypes.shape({
        one: PropTypes.string,
      }),
    }
  • Fixed false-errors when we use main props object inside iteration over any prop.

    The following code doesn't trigger any reports:

    const Component = props => pug`
      each item in props.list
        div(key=item.id ...item another=props.test)
    `
    Component.propTypes = {
      list: PropTypes.arrayOf(PropTypes.shape({
        id: PropTypes.string,
      })),
      test: PropTypes.bool,
    }

v0.8.2

26 Aug 13:41
Compare
Choose a tag to compare

Fixed

  • Stop crashes when we use iterations over basic variables, not related to props.

    function Component() {
      const list = []
    
      return pug`
        each item in list
          div(key=item.id)= item.test
      `
    }

    In this example we were trying to attach item.id and item.test to props.

v0.8.1

23 Aug 19:02
Compare
Choose a tag to compare

Fixed

  • There was a mistake when we reference used and not defined props. Now we point to it correctly.

v0.8.0

23 Aug 10:30
Compare
Choose a tag to compare

Added

  • A new rule prop-types

    We now have a chance to prevent prop-types definitions for unused props and prevent used props without definitions.

    It works with function components only for now.

    Pull Request: #68
    Initial issue: #66

v0.7.1

19 Jun 08:04
Compare
Choose a tag to compare

Fixed

  • Since it became possible to support spreading attributes (babel-plugin-transform-react-pug#v7.0.1) we make it possible to lint too.

    The following syntax is now available:

    button(type="button" ...props)

v0.7.0

14 Jun 16:19
Compare
Choose a tag to compare

Added

  • Experimental Rule pug-lint (It runs pug-lint when this rule is applied) #65

    It's experimental because it didn't go through comprehensive testing. And there are not many use-cases for this rule, most likely we will consider moving forward with own rules.

v0.6.0

14 May 06:40
Compare
Choose a tag to compare

Added

  • Rule eslint (Lint JavaScript code inside Pug) #62

    Use eslint rules to lint javascript written in pug templates.

v0.5.7

10 Feb 10:36
Compare
Choose a tag to compare

Fixed

  • Mark nested objects as used when we use its properties in destructuring (Issue: #56)
  • It's not crashed when we define variables (Issue: #57)

v0.5.6

07 Sep 06:27
Compare
Choose a tag to compare

Fixed

  • Don't require spaces between comments