Skip to content

Commit

Permalink
use arrow fns
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Binns-Smith committed Jul 21, 2017
1 parent 0dd50b2 commit ba1dfc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-unused-state.js
Expand Up @@ -64,7 +64,7 @@ module.exports = {
schema: []
},

create: Components.detect(function(context, components, utils) {
create: Components.detect((context, components, utils) => {
// Non-null when we are inside a React component ClassDeclaration and we have
// not yet encountered any use of this.state which we have chosen not to
// analyze. If we encounter any such usage (like this.state being spread as
Expand Down
8 changes: 3 additions & 5 deletions tests/lib/rules/no-unused-state.js
Expand Up @@ -18,11 +18,9 @@ const parserOptions = {
const eslintTester = new RuleTester({parserOptions});

function getErrorMessages(unusedFields) {
return unusedFields.map(function(field) {
return {
message: `Unused state field: '${field}'`
};
});
return unusedFields.map(field => ({
message: `Unused state field: '${field}'`
}));
}

eslintTester.run('no-unused-state', rule, {
Expand Down

0 comments on commit ba1dfc1

Please sign in to comment.