Add eslint warning on props spreading

pull/2413/head
Jérémy Rialland 2022-11-22 12:17:07 +01:00 committed by Jérémy Rialland
parent 4efd814561
commit 3ab6942243
1 changed files with 7 additions and 0 deletions

View File

@ -85,6 +85,13 @@ module.exports = {
'react/no-unknown-property': ['error', { ignore: ['css'] }],
/**
* Warning on props spreading cause typescript doesn't check type on it:
* https://github.com/microsoft/TypeScript/issues/18801#issuecomment-332610604
* Explicit spread is allow, example: <img {...{ prop1, prop2, prop3 }} />
*/
'react/jsx-props-no-spreading': ['warn', { explicitSpread: 'ignore' }],
// Auto fixable lint error
'prefer-const': 'error',
'padding-line-between-statements': [