Skip to content

Commit ba1dfc1

Browse files
author
Will Binns-Smith
committed
use arrow fns
1 parent 0dd50b2 commit ba1dfc1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/rules/no-unused-state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = {
6464
schema: []
6565
},
6666

67-
create: Components.detect(function(context, components, utils) {
67+
create: Components.detect((context, components, utils) => {
6868
// Non-null when we are inside a React component ClassDeclaration and we have
6969
// not yet encountered any use of this.state which we have chosen not to
7070
// analyze. If we encounter any such usage (like this.state being spread as

tests/lib/rules/no-unused-state.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ const parserOptions = {
1818
const eslintTester = new RuleTester({parserOptions});
1919

2020
function getErrorMessages(unusedFields) {
21-
return unusedFields.map(function(field) {
22-
return {
23-
message: `Unused state field: '${field}'`
24-
};
25-
});
21+
return unusedFields.map(field => ({
22+
message: `Unused state field: '${field}'`
23+
}));
2624
}
2725

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

0 commit comments

Comments
 (0)