must-use-prop.js 330 B

123456789
  1. const acceptValue = ['input','textarea','option','select']
  2. module.exports = (tag, type, attr) => {
  3. return (
  4. (attr === 'value' && acceptValue.includes(tag)) && type !== 'button' ||
  5. (attr === 'selected' && tag === 'option') ||
  6. (attr === 'checked' && tag === 'input') ||
  7. (attr === 'muted' && tag === 'video')
  8. )
  9. }