Skip to content

no-unescaped-entities: Add exception for children content #1263

@alexilyaev

Description

@alexilyaev

The rule no-unescaped-entities warns on these characters inside JSX:

>
"
'
}

But it looks like Babel handles them pretty well when used as children content:
https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Creact&targets=&browsers=&builtIns=false&debug=false&code_lz=DwEwlgbgBAxgNgQwM5IHIILYFMC8AiACyzjgHs8A-AKCigEkAXAciSgHNSA7ThKAIyxReHUiCggEATygNRUgIQ0oFKACUwbAgwD8SgL5QkAVwBOgsKzwIA7llIYkWPFWAB6cBGpA&experimental=true&loose=false&spec=false

I've got a bunch of text I copy paste all the time (note I wrote I've, that's what ppl are used to).
I would like to have warnings when I probably did an error, but in children content these characters are ok and refactoring them all the time is painful.

Right now the team just disabled this rule because of it.

Can we add an exception for children content (either an option or built in)?

Related #894

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions