jonaskello / tslint-immutable

TSLint rules to disable mutation in TypeScript.
MIT License
417 stars 14 forks source link

rule requires type information. #143

Closed binjospookie closed 5 years ago

binjospookie commented 5 years ago

version of package "tslint-immutable": "6.0.0", my TSLint.json

{
  "defaultSeverity": "error",
  "extends": [
    "tslint:recommended",
    "tslint-react",
    "tslint-config-prettier",
    "tslint-immutable"
  ],
  "rules": {
    "quotemark": [
      true,
      "single",
      "jsx-double"
    ],
    "arrow-parens": false,
    "no-empty": false,
    "no-any": true,
    "jsx-no-lambda": true,
    "jsx-boolean-value": false,
    "readonly-array": true,
    "no-let": true,
    "no-delete": true,
    "no-method-signature": true,
    "no-parameter-reassignment": true,
    "typedef": true,
    "no-loop-statement": true,
    "no-object-mutation": true,
    "no-array-mutation": true
  },
  "rulesDirectory": []
}

When I run lint I faced with two warnings:

Warning: The 'no-array-mutation' rule requires type information.
Warning: The 'no-object-mutation' rule requires type information.

I don't know what I do wrong. Could you please help me?

RebeccaStevens commented 5 years ago

Those two rules require type information inorder to work. tslint needs access your tsconfig.json file inorder to get type information.

So run tslint like this:

tslint -c tslint.json -p tsconfig.json
binjospookie commented 5 years ago

Thank you so much!