Skip to content

Commit

Permalink
feat(config): FE-00 unescaped entities denylist
Browse files Browse the repository at this point in the history
  • Loading branch information
deini committed Nov 12, 2021
1 parent e22f1cd commit e82c9d4
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 6 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-config/configs/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ module.exports = {
'react/jsx-sort-props': 'warn',
'react/no-redundant-should-component-update': 'error',
'react/no-this-in-sfc': 'error',
'react/no-unescaped-entities': [
'error',
{
forbid: [
{ alternatives: ['>'], char: '>' },
{ alternatives: ['}'], char: '}' },
],
},
],
'react/no-unsafe': 'error',
'react/no-unused-state': 'error',
'react/prefer-es6-class': 'error',
Expand Down
108 changes: 102 additions & 6 deletions packages/eslint-config/test/__snapshots__/eslint.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down Expand Up @@ -3788,7 +3804,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down Expand Up @@ -5598,7 +5630,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down Expand Up @@ -7407,7 +7455,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down Expand Up @@ -9560,7 +9624,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down Expand Up @@ -11740,7 +11820,23 @@ Object {
"error",
],
"react/no-unescaped-entities": Array [
2,
"error",
Object {
"forbid": Array [
Object {
"alternatives": Array [
">",
],
"char": ">",
},
Object {
"alternatives": Array [
"}",
],
"char": "}",
},
],
},
],
"react/no-unknown-property": Array [
2,
Expand Down

0 comments on commit e82c9d4

Please sign in to comment.