Skip to content

Commit

Permalink
feat(eslint): 新规则:no-spread-in-props
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed May 24, 2018
1 parent 28c38f4 commit deb74a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/eslint-plugin-taro/rules/custom/no-spread-in-props.js
@@ -0,0 +1,20 @@
const { buildDocsMeta } = require('../../utils/utils')

const ERROR_MESSAGE = '不能在 JSX 参数中使用对象展开符(Object spread)'

module.exports = {
meta: {
docs: buildDocsMeta(ERROR_MESSAGE, 'no-spread-in-props')
},

create (context) {
return {
JSXSpreadAttribute (node) {
context.report({
message: ERROR_MESSAGE,
node
})
}
}
}
}

0 comments on commit deb74a4

Please sign in to comment.