Skip to content

[eslint-config-airbnb] react version setting #1983

Closed
@aczekajski

Description

@aczekajski

Config located in eslint-config-airbnb/rules/react.js consists of following lines:

react: {
  pragma: 'React',
  version: '16.0'
},

in the settings section, setting explicitely the react version.

Meanwhile, in the new release of eslint-plugin-react (v 7.12.0), the jsx-fragments rule was introduced which enforces <> syntax instead of <React.Fragment>. However, for this rule to work you need to have a React version set to at least 16.2. As an effect, airbnb settings causes my config to throw error even though I have a correct react version but I don't have it set in settings section of my eslintrc (because defaults are provided by eslint-plugin-react).

Solution to that would be to use the detect option for version which was also introduced in 7.12.0 of eslint-plugin-react.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions