Skip to content

Commit

Permalink
chore(eslint): 修复测试用例的报错信息
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed May 22, 2019
1 parent 15b33d1 commit ff300db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { parserOptions, testComponent } = require('../utils/utils')

const ruleTester = new RuleTester({ parserOptions, parser: 'babel-eslint' })

const ERROR_MESSAGE = '从 this.props 而来的函数名必须要以 `on` 或 `dispatch` 开头'
const ERROR_MESSAGE = '从 this.props 而来的函数名必须要以 `on` 或 `dispatch` 开头。详情:https://nervjs.github.io/taro/docs/event.html#%E4%BB%BB%E4%BD%95%E7%BB%84%E4%BB%B6%E7%9A%84%E4%BA%8B%E4%BB%B6%E4%BC%A0%E9%80%92%E9%83%BD%E8%A6%81%E4%BB%A5-on-%E5%BC%80%E5%A4%B4'

function testInvalid (message, tests) {
return tests.map(code => ({
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-taro/rules/this-props-function.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { buildDocsMeta } = require('../utils/utils')

const ERROR_MESSAGE = '从 this.props 而来的函数名必须要以 `on` 开头'
const ERROR_MESSAGE = '从 this.props 而来的函数名必须要以 `on` 或 `dispatch` 开头。详情:https://nervjs.github.io/taro/docs/event.html#%E4%BB%BB%E4%BD%95%E7%BB%84%E4%BB%B6%E7%9A%84%E4%BA%8B%E4%BB%B6%E4%BC%A0%E9%80%92%E9%83%BD%E8%A6%81%E4%BB%A5-on-%E5%BC%80%E5%A4%B4'

module.exports = {
meta: {
Expand All @@ -21,7 +21,7 @@ module.exports = {
property.name !== 'dispatch'
) {
context.report({
message: '从 this.props 而来的函数名必须要以 `on` 或 `dispatch` 开头。详情:https://nervjs.github.io/taro/docs/event.html#%E4%BB%BB%E4%BD%95%E7%BB%84%E4%BB%B6%E7%9A%84%E4%BA%8B%E4%BB%B6%E4%BC%A0%E9%80%92%E9%83%BD%E8%A6%81%E4%BB%A5-on-%E5%BC%80%E5%A4%B4',
message: ERROR_MESSAGE,
node
})
}
Expand Down

0 comments on commit ff300db

Please sign in to comment.