prettier / tslint-config-prettier

Use TSLint with Prettier without any conflict

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work properly with newest TSLint version

svzi opened this issue Β· comments

Hi there,

first of all thanks for this awesome plugin, I really love it and use it in all my projects. Keep up the good work please! πŸ‘

Sadly I discovered an issue some days ago. I always get this messages when I run tslint in my projects:

Could not find implementations for the following rules specified in the configuration:
    conditional-expression-parens
    import-destructuring-spacing
    jsx-alignment
    jsx-attribute-spacing
    jsx-curly-spacing
    jsx-equals-spacing
    jsx-expression-spacing
    jsx-no-closing-bracket-newline
    jsx-no-multiline-js
    jsx-wrap-multiline
    literal-spacing
    newline-per-chained-call
    no-empty-line-after-opening-brace
    no-semicolon-interface
    no-unnecessary-parens-for-arrow-function-arguments
    no-unnecessary-semicolons
    react-tsx-curly-spacing
    space-within-parens
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.

This is my tslint.json file:

{
  "defaultSeverity": "error",
  "extends": ["tslint:recommended", "tslint-eslint-rules", "tslint-config-prettier"],
  "jsRules": {},
  "rules": {
    "quotemark": [true, "single", "avoid-escape"],
    "no-duplicate-variable": true,
    "no-unused-variable": [true],
    "variable-name": false,
    "no-console": [false, "log", "error"],
    "object-literal-shorthand": false,
    "no-bitwise": false,
    "no-string-literal": false,
    "jsdoc-format": false,
    "no-namespace": false
  },
  "rulesDirectory": ["node_modules/tslint-eslint-rules/dist/rules"]
}

When I remove "tslint-config-prettier" from the extends-array, the messages disappear.

Could someone please help me with this?

Best,
Sven

commented

I tried it with tslint@5.9.1 but cannot reproduce, I guess it's probably the issue about tslint version.

commented

Sorry I didn't noticed that you've already mentioned it's the newest tslint.

Can you provide a repro repo?

Thanks for your ultra quick response. I can try to create one.

Interestingly I couldn't reproduce it in a clean (ionic3) project. I discovered that updating my @ionic/app-scripts package (from 1.3.7 to 3.1.9) removed the issues for me. Interesting. I just found out because my sample Ionic3 app that I just prepared for sharing, didn't have this issues.

Thanks for your help, that pointed me in the right direction. Hopefully I can solve it in my other projects as well. If not, because not all are Ionic-based, I will open a new issue or comment here again.

I thought I’d leave a comment in here in case it helps others with this issue.

In my case I had accidentally npm installed the ts-lint package instead of tslint, which does not contain the rules that the β€œCould not find implementations for the following rules” message complains about.