Skip to content

jsx-wrap-multiline eslint crash #2100

@paolommj

Description

@paolommj

Thanks all for the great library, I use it a lot.
Recently I have discovered a problem with the rule jsx-wrap-multiline that throws exception during eslint execution.

I have a really bad formatted file:

import React from 'react';

export default () =>
    <div>
        with newline without parenthesys eslint crashes
    </div>

the error I receive is

TypeError: Cannot read property 'range' of null
    at Object.fixer [as fix] ([...]/node_modules/eslint-plugin-react/lib/rules/jsx-wrap-multilines.js:165:51)
...

I'll attach a basic example
jsx-wrap-multiline-issue.zip

There are a few ways of patching this error and I would like to send a PR for it, but I'm not sure how would you like the fix to be implemented. Also I'm not aware of possible implications.

Let me know if I can help you

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions