class-methods-use-this

This commit is contained in:
Amine Ben hammou
2017-10-31 16:46:19 +00:00
parent d791538086
commit 588ad3eab7
2 changed files with 2 additions and 5 deletions

View File

@@ -47,10 +47,7 @@
"import/no-extraneous-dependencies": 0,
"camelcase": 0,
"eqeqeq": 0,
// "no-lonely-if": 0,
"space-unary-ops": 0,
"no-extra-bind": 0,
"class-methods-use-this": 0,
"no-case-declarations": 0,
"no-else-return": 0,
"max-len": 0,

View File

@@ -49,7 +49,7 @@ const stats = {
};
class StatsBadge extends React.Component {
getBadgeType(stat, rate) {
static getBadgeType(stat, rate) {
const len = stat.badgeRanges.length;
for (let i = 0; i < len; i += 1) {
if (rate > stat.badgeRanges[i]) {
@@ -70,7 +70,7 @@ class StatsBadge extends React.Component {
return null;
}
const badgeType = this.getBadgeType(stat, rate);
const badgeType = StatsBadge.getBadgeType(stat, rate);
const badge = badges[badgeType] || null;
if (!badge) {
return null;