jsx-no-new-object-as-prop should not accept any built-in objects or custom objects.
For example:
This should be considered warnings, but currently not:
class Bar {}
function Component() {
const foo = new Date()
const foo = new Promise()
const foo = new Bar()
class Bar2 {}
const foo = new Bar2()
return <Item config={foo} />
}
The following patterns are not considered warnings:
class Bar {}
function Component() {
const foo = useMemo(() => new Date(), [])
const foo = useMemo(() => new Promise(), [])
const foo = useMemo(() => new Bar(), [])
const Bar2 = useMemo(() => class {}, [])
const foo = useMemo(() => new Bar2(), [Bar2])
return <Item config={foo} />
}
jsx-no-new-object-as-propshould not accept any built-in objects or custom objects.For example:
This should be considered warnings, but currently not:
The following patterns are not considered warnings: