question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tslint auto fix and prettier format on save

See original GitHub issue

Hi,

I’m trying to use both tslint auto fix and prettier format on save. My settings is as below:

{
    "editor.formatOnSave": true,
    "[handlebars]": {
        "editor.formatOnSave": false
    },
    "tslint.autoFixOnSave": true
}

When I save a file, prettier formats code, but to let tslint fix work I need to save again:

  1. Save -> Prettier formats code.
  2. Save again -> tslint fixes further.

Is it expected behavior, or I miss something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:31
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

11reactions
wish4129commented, Jun 12, 2019

this doesn’t seem to exist for me

"tslint.autoFixOnSave": true,

image

change to this works for me

"editor.codeActionsOnSave": {
        "source.fixAll.tslint": true
    },
3reactions
orblazercommented, Apr 11, 2018

@romainquellec I work on https://github.com/azz/prettier-tslint for make format method and after i go implement “tsIntegration” on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSLint and Prettier linting on save with VS Code
A blog post on the topic of: TSLint and Prettier linting on save with VS Code. ... and ESLint transforming your code into...
Read more >
Tslint.config formatting/beautification in VS code
autoFixOnSave , which will run the fixes for any rules that have fixes. As suggested above prettier would be a better solution for...
Read more >
Configure TypeScript, TSLint, and Prettier in VS Code for ...
Prettier will auto-format your code based on it's rules whenever you save a file. Open the sample app.js file and add an array...
Read more >
How to use Prettier with ESLint and TypeScript in VSCode
Prettier can be configured to format your code (makes it look prettier ) after you save a file or manually tell it to,...
Read more >
TSlint, Prettier, autosave, autofix: A drama in VSCode - genox.ch
The rather frustrating journey on getting TSLint, Prettier, autosave and autofix to work in VSCode - and play nice together (luckily this is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found