Skip to content

Commit

Permalink
sort-comp #1858 PR amendments
Browse files Browse the repository at this point in the history
  • Loading branch information
nosilleg committed Jul 4, 2018
1 parent 98ce807 commit 76a4120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rules/sort-comp.js
Expand Up @@ -8,6 +8,7 @@ const has = require('has');
const util = require('util');

const Components = require('../util/Components');
const arrayIncludes = require('array-includes');
const astUtil = require('../util/ast');
const docsUrl = require('../util/docsUrl');

Expand Down Expand Up @@ -158,7 +159,7 @@ module.exports = {
if (method.instanceMethod) {
methodGroupIndexes.push(groupIndex);
}
} else if ([
} else if (arrayIncludes([
'displayName',
'propTypes',
'contextTypes',
Expand All @@ -185,7 +186,7 @@ module.exports = {
'componentDidCatch',
'componentWillUnmount',
'render'
].includes(currentGroup)) {
], currentGroup)) {
if (currentGroup === method.name) {
methodGroupIndexes.push(groupIndex);
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -24,6 +24,7 @@
"homepage": "https://github.com/yannickcr/eslint-plugin-react",
"bugs": "https://github.com/yannickcr/eslint-plugin-react/issues",
"dependencies": {
"array-includes": "^3.0.3",
"doctrine": "^2.1.0",
"has": "^1.0.3",
"jsx-ast-utils": "^2.0.1",
Expand Down

0 comments on commit 76a4120

Please sign in to comment.