eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 75 forks source link

Disable Incompatibility Banner Option #463

Closed ColtonProvias closed 6 years ago

ColtonProvias commented 6 years ago

What version of TypeScript are you using? 2.8.1

What version of typescript-eslint-parser are you using? 14.0.0

What code were you trying to parse? Any JavaScript (not TypeScript) file.

What did you expect to happen? For source files to save normally when working across multiple projects.

What happened? On every save and every time SublimeLinter runs:

screen shot 2018-04-05 at 5 44 47 pm

Would it be possible to get a parser option to disable this banner when it is used?

megalithic commented 6 years ago

For the record, the same thing is happening with vim/neovim using the Ale linter/fixer: https://github.com/w0rp/ale/issues/1474

aboyton commented 6 years ago

Having this warning also breaks for me when I try to use this will other tools like Phabricator. Having a way of disabling it would be nice.

JamesHenry commented 6 years ago

You can pass a noop logger function.

We do that in prettier: https://github.com/prettier/prettier/blob/master/src/language-js/parser-typescript.js#L44

megalithic commented 6 years ago

@JamesHenry when i pass a noop to that loggerFn in my .eslintrc's parserOptions, my fixer fails to fix; i mean the fixer runs (and I realize this could be an issue with the fixer I use, but wanted to confirm others using (neo)vim with w0rp/ale as their fixer setup aren't having the same issues or have it working with that loggerFn noop.

Here's a snippet of my .eslintrc with that noop passed in:

  "parserOptions": {
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    },
   "loggerFn": () => {}
  },

UPDATE: for now, i've forked the project and just removed that boolean setter and the logging of that version mismatch text.

megalithic commented 6 years ago

i don't believe this should be closed. @JamesHenry?

aboyton commented 6 years ago

It's far from elegant, but adding

"parserOptions": {
  "loggerFn": false
}

to my .eslintrc suppressed the warning for me and allowed the tools we use that wrap ESLint to work.