Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtan committed Sep 14, 2018
1 parent ed4d773 commit 0edfa24
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 53 deletions.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ module.exports = {
'react/jsx-no-undef': 2,
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
'react/no-arrow-function-lifecycle': 2,
'react/no-children-prop': 2,
'react/no-danger-with-children': 2,
'react/no-deprecated': 2,
Expand Down
104 changes: 52 additions & 52 deletions tests/lib/rules/no-arrow-function-lifecycle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @fileoverview It is not neccessary to use arrow function for lifecycle methods
* @fileoverview It is not necessary to use arrow function for lifecycle methods
* @author Tan Nguyen
*/
'use strict';
Expand Down Expand Up @@ -318,7 +318,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -328,7 +328,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'getDefaultProps is unnecessary to use arrow function'
message: 'getDefaultProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -338,7 +338,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'getInitialState is unnecessary to use arrow function'
message: 'getInitialState is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -348,7 +348,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'getChildContext is unnecessary to use arrow function'
message: 'getChildContext is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -358,7 +358,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'getDerivedStateFromProps is unnecessary to use arrow function'
message: 'getDerivedStateFromProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -368,7 +368,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentWillMount is unnecessary to use arrow function'
message: 'componentWillMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -378,7 +378,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'UNSAFE_componentWillMount is unnecessary to use arrow function'
message: 'UNSAFE_componentWillMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -388,7 +388,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentDidMount is unnecessary to use arrow function'
message: 'componentDidMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -398,7 +398,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentWillReceiveProps is unnecessary to use arrow function'
message: 'componentWillReceiveProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -408,7 +408,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'UNSAFE_componentWillReceiveProps is unnecessary to use arrow function'
message: 'UNSAFE_componentWillReceiveProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -418,7 +418,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'shouldComponentUpdate is unnecessary to use arrow function'
message: 'shouldComponentUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -428,7 +428,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentWillUpdate is unnecessary to use arrow function'
message: 'componentWillUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -438,7 +438,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'UNSAFE_componentWillUpdate is unnecessary to use arrow function'
message: 'UNSAFE_componentWillUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -448,7 +448,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'getSnapshotBeforeUpdate is unnecessary to use arrow function'
message: 'getSnapshotBeforeUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -458,7 +458,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentDidUpdate is unnecessary to use arrow function'
message: 'componentDidUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -468,7 +468,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentDidCatch is unnecessary to use arrow function'
message: 'componentDidCatch is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -478,7 +478,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentWillUnmount is unnecessary to use arrow function'
message: 'componentWillUnmount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -488,7 +488,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
});
`,
errors: [{
message: 'componentWillUnmount is unnecessary to use arrow function'
message: 'componentWillUnmount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -499,7 +499,7 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -511,9 +511,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'getDefaultProps is unnecessary to use arrow function'
message: 'getDefaultProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -525,9 +525,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'getInitialState is unnecessary to use arrow function'
message: 'getInitialState is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -539,9 +539,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'getChildContext is unnecessary to use arrow function'
message: 'getChildContext is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -553,9 +553,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'getDerivedStateFromProps is unnecessary to use arrow function'
message: 'getDerivedStateFromProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -567,9 +567,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentWillMount is unnecessary to use arrow function'
message: 'componentWillMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -581,9 +581,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'UNSAFE_componentWillMount is unnecessary to use arrow function'
message: 'UNSAFE_componentWillMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -595,9 +595,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentDidMount is unnecessary to use arrow function'
message: 'componentDidMount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -609,9 +609,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentWillReceiveProps is unnecessary to use arrow function'
message: 'componentWillReceiveProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -623,9 +623,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'UNSAFE_componentWillReceiveProps is unnecessary to use arrow function'
message: 'UNSAFE_componentWillReceiveProps is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -637,9 +637,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'shouldComponentUpdate is unnecessary to use arrow function'
message: 'shouldComponentUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -651,9 +651,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentWillUpdate is unnecessary to use arrow function'
message: 'componentWillUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -665,9 +665,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'UNSAFE_componentWillUpdate is unnecessary to use arrow function'
message: 'UNSAFE_componentWillUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -679,9 +679,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'getSnapshotBeforeUpdate is unnecessary to use arrow function'
message: 'getSnapshotBeforeUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -693,9 +693,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentDidUpdate is unnecessary to use arrow function'
message: 'componentDidUpdate is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -707,9 +707,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentDidCatch is unnecessary to use arrow function'
message: 'componentDidCatch is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}, {
code: `
Expand All @@ -721,9 +721,9 @@ ruleTester.run('no-arrow-function-lifecycle', rule, {
`,
parser: 'babel-eslint',
errors: [{
message: 'componentWillUnmount is unnecessary to use arrow function'
message: 'componentWillUnmount is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}, {
message: 'render is unnecessary to use arrow function'
message: 'render is a React lifecycle method, and should not be an arrow function. Use an instance method instead.'
}]
}]
});

0 comments on commit 0edfa24

Please sign in to comment.