Skip to content

Commit

Permalink
fix(eslint): 允许 this.props.dispatch, close #1006
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche authored and luckyadam committed Nov 8, 2018
1 parent 7c5e669 commit 7abcb2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/eslint-plugin-taro/rules/this-props-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
object.object.type === 'ThisExpression' &&
object.property.name === 'props' &&
property.type === 'Identifier' &&
!/^on[A-Z_]/.test(property.name)
!/^on[A-Z_]/.test(property.name) &&
property.name !== 'dispatch'
) {
context.report({
message: '从 this.props 而来的函数名必须要以 `on` 开头',
Expand Down

0 comments on commit 7abcb2c

Please sign in to comment.