-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
The purpose of ignoreTranspilerName is to ignore inferred names:
const SFC = () => <div />; // inferred name
const Foo = class extends React.Component {} // inferred nameIt should not, however, ignore explicit names:
function SFC() { return <div />; } // explicit name
class Foo extends React.Component {} // explicit nameI think that the ignoreTranspilerName option should be deprecated, and replaced with new options that cover the current use cases:
- always require an explicit
displayName(ignoreTranspilerName: true) - only require an explicit
displayNameonReact.createClasses (ignoreTranspilerName: false)
As well as cover these additional use cases:
- always require an explicit name - ie, an explicit displayName or a named function or named `class
- always require a name - either explicit, or ES6-inferred
- Never allow an explicit
displayName? (i don't really care about this one, but it seems useful for consistency)
danny-andrews, rodoabad, chiawendt and denisqdenisq