Skip to content

Commit

Permalink
Eslint config: fix support for the latest react/no-unknown-property
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnzlml committed Sep 8, 2022
1 parent 310f96f commit 3e33b1e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,15 @@ exports[`rules snapshot: all stable rules 1`] = `
"react/no-this-in-sfc": 2,
"react/no-typos": 0,
"react/no-unescaped-entities": 2,
"react/no-unknown-property": 2,
"react/no-unknown-property": [
2,
{
"ignore": [
"jsx",
"global",
],
},
],
"react/no-unsafe": 0,
"react/no-unstable-nested-components": [
2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,15 @@ exports[`React preset: React preset 1`] = `
"react/no-this-in-sfc": 2,
"react/no-typos": 0,
"react/no-unescaped-entities": 2,
"react/no-unknown-property": 2,
"react/no-unknown-property": [
2,
{
"ignore": [
"jsx",
"global",
],
},
],
"react/no-unsafe": 0,
"react/no-unstable-nested-components": [
2,
Expand Down
12 changes: 11 additions & 1 deletion src/eslint-config-adeira/src/presets/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,17 @@ module.exports = ({
'react/no-this-in-sfc': ERROR,
'react/no-typos': OFF,
'react/no-unescaped-entities': ERROR,
'react/no-unknown-property': ERROR,
'react/no-unknown-property': [
ERROR,
{
ignore: [
// To support `<style global jsx>` from Next.js
// See: https://nextjs.org/docs/basic-features/built-in-css-support#css-in-js
'jsx',
'global',
],
},
],
'react/no-unsafe': OFF,
'react/no-unstable-nested-components': [ERROR, { allowAsProps: true }],
'react/no-unused-class-component-methods': ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const ERROR = 2;

module.exports = {
rules: {
// we are having here fixtures with invalid SX definitions on purpose
// We are having here fixtures with invalid SX definitions (and other Eslint rules) on purpose:
'sx/no-unused-stylesheet': OFF,
'react/no-unknown-property': OFF,
},
};

0 comments on commit 3e33b1e

Please sign in to comment.