Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 676 Bytes

File metadata and controls

24 lines (17 loc) · 676 Bytes

No mutable types allowed in propTypes for models (no-mutable-prop-types-in-models)

No mutable types allowed in propTypes for models.

Rule Details

By default, this rule checks for the following object-types within the propTypes definition in createModel:

  • array, arrayOf
  • object, objectOf
  • shape
  • func

Options

This can be configured to forbid / warn against any valid propType. In your .eslintrc configuration file, provide an array of object types you don't want to be allowed within the ModulaJS Model Class:

{
  "rules": {
    "modulajs/no-mutable-prop-types-in-models": ["error", ["object", "array", "arrayOf", "objectOf"]]
  }
}