Skip to content

Commit

Permalink
Default display-name's acceptTranspilerName to true
Browse files Browse the repository at this point in the history
This was a change that has been queued for v4.

Addresses jsx-eslint#436
  • Loading branch information
lencioni committed Feb 13, 2016
1 parent 229bb1b commit 3af995a
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 53 deletions.
2 changes: 1 addition & 1 deletion docs/rules/display-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var Hello = React.createClass({

### `acceptTranspilerName`

When `true` the rule will accept the name set by the transpiler and does not require a `displayName` property in this case.
When `true` (default) the rule will accept the name set by the transpiler and does not require a `displayName` property in this case.

The following patterns are considered okay and do not cause warnings:

Expand Down
4 changes: 3 additions & 1 deletion lib/rules/display-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ var Components = require('../util/Components');
module.exports = Components.detect(function(context, components, utils) {

var config = context.options[0] || {};
var acceptTranspilerName = config.acceptTranspilerName || false;
var acceptTranspilerName = config.hasOwnProperty('acceptTranspilerName') ?
config.acceptTranspilerName :
true;

var MISSING_MESSAGE = 'Component definition is missing display name';

Expand Down
Loading

0 comments on commit 3af995a

Please sign in to comment.