Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnHols committed Jun 2, 2017
1 parent 69bd753 commit 25ac2ce
Show file tree
Hide file tree
Showing 20 changed files with 123 additions and 98 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dependencies": {
"chartist": "^0.11.0",
"chartist-plugin-legend": "^0.6.1",
"prop-types": "^15.5.10",
"react": "^15.4.2",
"react-chartist": "^0.12.0",
"react-dom": "^15.4.2",
Expand Down
17 changes: 9 additions & 8 deletions src/Main/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link, hashHistory } from 'react-router';
import ReactTooltip from 'react-tooltip';

Expand Down Expand Up @@ -27,14 +28,14 @@ const githubUrl = 'https://github.com/MartijnHols/WoWAnalyzer';

class App extends Component {
static propTypes = {
router: React.PropTypes.shape({
push: React.PropTypes.func.isRequired,
}).isRequired,
params: React.PropTypes.shape({
reportCode: React.PropTypes.string,
playerName: React.PropTypes.string,
fightId: React.PropTypes.string,
resultTab: React.PropTypes.string,
router: PropTypes.shape({
push: PropTypes.func.isRequired,
}),
params: PropTypes.shape({
reportCode: PropTypes.string,
playerName: PropTypes.string,
fightId: PropTypes.string,
resultTab: PropTypes.string,
}),
};
static defaultProps = {
Expand Down
23 changes: 12 additions & 11 deletions src/Main/CastEfficiency.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

import SpellLink from 'common/SpellLink';
import SpellIcon from 'common/SpellIcon';
Expand Down Expand Up @@ -64,18 +65,18 @@ const CastEfficiency = ({ categories, abilities }) => {
);
};
CastEfficiency.propTypes = {
abilities: React.PropTypes.arrayOf(React.PropTypes.shape({
ability: React.PropTypes.shape({
name: React.PropTypes.string.isRequired,
spellId: React.PropTypes.number.isRequired,
icon: React.PropTypes.string.isRequired,
abilities: PropTypes.arrayOf(PropTypes.shape({
ability: PropTypes.shape({
name: PropTypes.string.isRequired,
spellId: PropTypes.number.isRequired,
icon: PropTypes.string.isRequired,
}),
cpm: React.PropTypes.number.isRequired,
maxCpm: React.PropTypes.number,
casts: React.PropTypes.number.isRequired,
maxCasts: React.PropTypes.number.isRequired,
castEfficiency: React.PropTypes.number,
canBeImproved: React.PropTypes.bool.isRequired,
cpm: PropTypes.number.isRequired,
maxCpm: PropTypes.number,
casts: PropTypes.number.isRequired,
maxCasts: PropTypes.number.isRequired,
castEfficiency: PropTypes.number,
canBeImproved: PropTypes.bool.isRequired,
})).isRequired,
};

Expand Down
27 changes: 14 additions & 13 deletions src/Main/Cooldown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

import SpellLink from 'common/SpellLink';
import SpellIcon from 'common/SpellIcon';
Expand Down Expand Up @@ -26,20 +27,20 @@ function formatPercentage(percentage) {

class Cooldown extends React.Component {
static propTypes = {
fightStart: React.PropTypes.number.isRequired,
fightEnd: React.PropTypes.number.isRequired,
ShowStatistics: React.PropTypes.bool,
showResourceStatistics: React.PropTypes.bool,
cooldown: React.PropTypes.shape({
ability: React.PropTypes.shape({
id: React.PropTypes.number.isRequired,
name: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired,
fightStart: PropTypes.number.isRequired,
fightEnd: PropTypes.number.isRequired,
ShowStatistics: PropTypes.bool,
showResourceStatistics: PropTypes.bool,
cooldown: PropTypes.shape({
ability: PropTypes.shape({
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
icon: PropTypes.string.isRequired,
}),
start: React.PropTypes.number.isRequired,
end: React.PropTypes.number,
events: React.PropTypes.arrayOf(React.PropTypes.shape({
type: React.PropTypes.string.isRequired,
start: PropTypes.number.isRequired,
end: PropTypes.number,
events: PropTypes.arrayOf(PropTypes.shape({
type: PropTypes.string.isRequired,
})).isRequired,
}).isRequired,
};
Expand Down
29 changes: 15 additions & 14 deletions src/Main/CooldownOverview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

import Cooldown from './Cooldown';

Expand All @@ -14,21 +15,21 @@ const CooldownOverview = ({ fightStart, fightEnd, cooldowns, showOutputStatistic
</div>
);
CooldownOverview.propTypes = {
fightStart: React.PropTypes.number.isRequired,
fightEnd: React.PropTypes.number.isRequired,
showOutputStatistics: React.PropTypes.bool,
showResourceStatistics: React.PropTypes.bool,
cooldowns: React.PropTypes.arrayOf(React.PropTypes.shape({
ability: React.PropTypes.shape({
id: React.PropTypes.number.isRequired,
name: React.PropTypes.string.isRequired,
icon: React.PropTypes.string.isRequired,
cooldownType: React.PropTypes.string.isRequired
fightStart: PropTypes.number.isRequired,
fightEnd: PropTypes.number.isRequired,
showOutputStatistics: PropTypes.bool,
showResourceStatistics: PropTypes.bool,
cooldowns: PropTypes.arrayOf(PropTypes.shape({
ability: PropTypes.shape({
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
icon: PropTypes.string.isRequired,
cooldownType: PropTypes.string.isRequired
}),
start: React.PropTypes.number.isRequired,
end: React.PropTypes.number,
events: React.PropTypes.arrayOf(React.PropTypes.shape({
type: React.PropTypes.string.isRequired,
start: PropTypes.number.isRequired,
end: PropTypes.number,
events: PropTypes.arrayOf(PropTypes.shape({
type: PropTypes.string.isRequired,
})).isRequired,
})).isRequired,
};
Expand Down
15 changes: 8 additions & 7 deletions src/Main/Fight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

import DIFFICULTIES from './DIFFICULTIES';

Expand All @@ -23,13 +24,13 @@ const Fight = ({ difficulty, name, kill, start_time, end_time, wipes, ...others
);
};
Fight.propTypes = {
id: React.PropTypes.number.isRequired,
difficulty: React.PropTypes.number.isRequired,
boss: React.PropTypes.number.isRequired,
start_time: React.PropTypes.number.isRequired,
end_time: React.PropTypes.number.isRequired,
name: React.PropTypes.string.isRequired,
kill: React.PropTypes.bool.isRequired,
id: PropTypes.number.isRequired,
difficulty: PropTypes.number.isRequired,
boss: PropTypes.number.isRequired,
start_time: PropTypes.number.isRequired,
end_time: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
kill: PropTypes.bool.isRequired,
};

export default Fight;
23 changes: 12 additions & 11 deletions src/Main/FightSelecter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import ReactTooltip from 'react-tooltip';

Expand All @@ -8,17 +9,17 @@ import getWipeCount from './getWipeCount';

class FightSelecter extends Component {
static propTypes = {
report: React.PropTypes.shape({
code: React.PropTypes.string.isRequired,
title: React.PropTypes.string.isRequired,
fights: React.PropTypes.arrayOf(React.PropTypes.shape({
id: React.PropTypes.number.isRequired,
difficulty: React.PropTypes.number,
boss: React.PropTypes.number.isRequired,
start_time: React.PropTypes.number.isRequired,
end_time: React.PropTypes.number.isRequired,
name: React.PropTypes.string.isRequired,
kill: React.PropTypes.bool,
report: PropTypes.shape({
code: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
fights: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
difficulty: PropTypes.number,
boss: PropTypes.number.isRequired,
start_time: PropTypes.number.isRequired,
end_time: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
kill: PropTypes.bool,
})),
}),
};
Expand Down
9 changes: 5 additions & 4 deletions src/Main/Mana.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import ChartistGraph from 'react-chartist';
import Chartist from 'chartist';
import 'chartist-plugin-legend';
Expand All @@ -17,10 +18,10 @@ const formatDuration = (duration) => {

class Mana extends React.PureComponent {
static propTypes = {
reportCode: React.PropTypes.string.isRequired,
actorId: React.PropTypes.number.isRequired,
start: React.PropTypes.number.isRequired,
end: React.PropTypes.number.isRequired,
reportCode: PropTypes.string.isRequired,
actorId: PropTypes.number.isRequired,
start: PropTypes.number.isRequired,
end: PropTypes.number.isRequired,
};

constructor() {
Expand Down
5 changes: 3 additions & 2 deletions src/Main/PlayerBreakdown.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';

import SPECS from 'common/SPECS';

class PlayerBreakdown extends React.Component {
static propTypes = {
stats: React.PropTypes.object.isRequired,
playersById: React.PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
playersById: PropTypes.object.isRequired,
};

calculatePlayerBreakdown(stats, playersById) {
Expand Down
19 changes: 10 additions & 9 deletions src/Main/PlayerSelecter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import ReactTooltip from 'react-tooltip';

Expand All @@ -8,17 +9,17 @@ import makeAnalyzerUrl from './makeAnalyzerUrl';

class PlayerSelecter extends Component {
static propTypes = {
report: React.PropTypes.shape({
code: React.PropTypes.string.isRequired,
title: React.PropTypes.string.isRequired,
friendlies: React.PropTypes.arrayOf(React.PropTypes.shape({
id: React.PropTypes.number.isRequired,
type: React.PropTypes.string.isRequired,
name: React.PropTypes.string.isRequired,
report: PropTypes.shape({
code: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
friendlies: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
type: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
})),
}).isRequired,
fightId: React.PropTypes.number.isRequired,
combatants: React.PropTypes.arrayOf(React.PropTypes.shape({
fightId: PropTypes.number.isRequired,
combatants: PropTypes.arrayOf(PropTypes.shape({

})).isRequired,
};
Expand Down
3 changes: 2 additions & 1 deletion src/Main/ReportSelecter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import AVAILABLE_CONFIGS from 'Parser/AVAILABLE_CONFIGS';

Expand All @@ -7,7 +8,7 @@ import Changelog from './Changelog';

class ReportSelecter extends Component {
static propTypes = {
onSubmit: React.PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
};

codeInput = null;
Expand Down
5 changes: 3 additions & 2 deletions src/Main/Results.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';

class Results extends React.Component {
static propTypes = {
parser: React.PropTypes.object.isRequired,
tab: React.PropTypes.string,
parser: PropTypes.object.isRequired,
tab: PropTypes.string,
};

render() {
Expand Down
7 changes: 4 additions & 3 deletions src/Main/StatisticBox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

const StatisticBox = ({ icon, value, label }) => (
<div className="panel statistic-box">
Expand All @@ -20,9 +21,9 @@ const StatisticBox = ({ icon, value, label }) => (
</div>
);
StatisticBox.propTypes = {
icon: React.PropTypes.node.isRequired,
value: React.PropTypes.node.isRequired,
label: React.PropTypes.node.isRequired,
icon: PropTypes.node.isRequired,
value: PropTypes.node.isRequired,
label: PropTypes.node.isRequired,
};

export default StatisticBox;
13 changes: 10 additions & 3 deletions src/Main/Talents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
Expand Down Expand Up @@ -28,7 +29,7 @@ const Talent = ({ talent }) => {
);
};
Talent.propTypes = {
talent: React.PropTypes.number,
talent: PropTypes.number,
};

const Talents = ({ combatant }) => {
Expand Down Expand Up @@ -67,8 +68,14 @@ const Talents = ({ combatant }) => {
);
};
Talents.propTypes = {
combatant: React.PropTypes.shape({

combatant: PropTypes.shape({
lv15Talent: PropTypes.number,
lv30Talent: PropTypes.number,
lv45Talent: PropTypes.number,
lv60Talent: PropTypes.number,
lv75Talent: PropTypes.number,
lv90Talent: PropTypes.number,
lv100Talent: PropTypes.number,
}).isRequired,
};

Expand Down
5 changes: 3 additions & 2 deletions src/common/Icon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';

const Icon = ({ icon, alt, ...other }) => {
icon = icon.replace('.jpg', '').replace('-', '');
Expand All @@ -16,8 +17,8 @@ const Icon = ({ icon, alt, ...other }) => {
);
};
Icon.propTypes = {
icon: React.PropTypes.string.isRequired,
alt: React.PropTypes.string.isRequired,
icon: PropTypes.string.isRequired,
alt: PropTypes.string.isRequired,
};

export default Icon;
3 changes: 2 additions & 1 deletion src/common/ItemIcon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import ITEMS from './ITEMS';
import ItemLink from './ItemLink';
import Icon from './Icon';
Expand All @@ -13,7 +14,7 @@ const ItemIcon = ({ id, ...others }) => (
</ItemLink>
);
ItemIcon.propTypes = {
id: React.PropTypes.number.isRequired,
id: PropTypes.number.isRequired,
};

export default ItemIcon;
Loading

0 comments on commit 25ac2ce

Please sign in to comment.