-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSLint is ignoring the .prettierrc file #1347
Comments
Just found this project and tried it out and love it because the feedback is so much faster than neomake but I'm seeing this too and can't use this at work because of that :/ If this is still open because it's low priority for you, @w0rp, and you think it might be an easy fix for someone not acquainted with the project who cares more about this specific configuration than you, I'd love for pointers on where to look to start making a change :) |
Actually, no need for the pointers. I'll just use prettier as an example since it finds the .prettierrc and see if I can update the tslint fixer https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/w0rp/ale%24+%28tslint%7Cprettier%29 I'll see if I can find enough time to figure this out soon :) |
Is there an easy way to disable prettier only on TypeScript until this issue is resolved? |
Fixing this will probably involve someone patching tslint itself so we can tell it what the filename when checking a buffer. This is how ESLint works, with the |
Has anyone filed an issue on https://github.com/palantir/tslint yet? I can do so if not. Also, bump on any way to disable prettier in the meantime? |
Yes. palantir/tslint#1590 I'm working on it now, because nobody else seems to have attempted it yet. |
The only way to "disable prettier" for TSLint is to remove the plugin from the TSLint configuration file. Turn TSLint off completely if you can't use it with that plugin. |
Got it. Thanks @w0rp! |
Hi! Are there updates on this? I'm running on latest version (prettier and tslint), and I'm getting exactly the same behaviour as described in the initial post. Thanks for all the hard work, ale is an amazing vim plugin. |
No, this needs to be fixed in |
Due to a bug in tslint, fixing should happen on the command line. For linting using tsserver is more robust. See dense-analysis/ale#1347
I was running into the exact same issue.. While this isn't the best solution, explicitly setting the example:
|
Explicitly setting the
@w0rp I'm currently using
Also: just want to say thanks for the awesome plugin! |
You can't fix files with |
If you guys use coc.nvim with coc-tslint-plugin, it has quick fix and autofix on save. It is a TypeScript TSLint plugin for vim. Coc is intellisense for vim. coc-tslint-plugin adds tslint as a plugin to typescript. For autofix on save is similar to vscode where you configure a json file. See |
I'm going to close this issue as TSLint is going away this year. I recommend trying ESLint with recent plugins and |
@CorbanR that's a great solution, thanks!! |
This was conflicting with prettier and reporting issues which weren’t consistent with the prettier config. This comment was how I figured this out: dense-analysis/ale#1347 (comment)
Information
It appears to be a similar issue as in #983. The new setting that solved the problem there, seems not to be used for tslint. But actually this is an issue about prettier and neither eslint nor tslint directly. There should be a generic setting for prettier, that works for all languages which prettier supports.
VIM version
Operating System: WHAT OS WERE YOU USING?
MacOS
:ALEInfo
What went wrong
A file with this content:
foo.ts
and with this
.prettierrc
file:will still report an error about
'bar
' should be replaced with"bar"
.ALEFix
also makes that change whereastslint --project tsconfig.json foo.ts
andprettier foo.ts
invoked from the command line fully respect the single quote setting in.prettierrc
.Reproducing the bug
Steps for repeating the bug:
tslint
andprettier
with npm and enable it in vim settings:let g:ale_fixers = {
\ 'typescript': ['tslint']
\ }
tslint-plugin-prettier
andtslint-config-prettier
and follow instructions (tl;dr: install both packages and add both to theextends
clause oftslint.json
and add"prettier": true
to therules
clause)foo.ts
. ALE/prettier now report the single quote when it shouldn't.Note: When configured in
tslint.json
(i.e. add"prettier": [true, { "singleQuote": true }]
instead of simply"prettier": true
to tslint.json), it works as expected.The text was updated successfully, but these errors were encountered: