22

We're struggling to set a team-standard indent style for javascript/typescript and from all indications, the settings in .editorconfig are not overriding user preferences as indicated at the bottom of VS when we open the solution

enter image description here

For testing purposes, I've created the world's simplest .editorconfig with a ridiculous indent size value, and added it to the root folder of the solution:

# All files
[*]
indent_style = space
indent_size = 27

Then, under Tools | Options | Text Editor | JavaScript/TypeScript | Tabs, I've set a different indent size value:

enter image description here

So - if .editorconfig is really being used, any attempt to reformat a Typescript file should result in 27 spaces of indenting at each level. No dice.

I've tried moving the file to the same folder as the Typescript files I want to format. No dice.

I've verified that "Follow project coding conventions" is selected under Tools | Options | Text Editor | General. I've also turned it off. No dice.

It always formats to the indent size specified in Tools | Options.

Is there some magic sauce I'm missing?

Mr. T
  • 3,892
  • 3
  • 29
  • 48
  • 1
    https://developercommunity.visualstudio.com/content/problem/792737/editorconfig-ignored-for-javascript-files.html – Hans Passant Oct 24 '19 at 17:23
  • 1
    https://developercommunity.visualstudio.com/content/problem/331791/visual-studio-ignored-editorconfig-after-update-76.html – Hans Passant Oct 24 '19 at 17:24
  • 4
    Version 16.3.0 was developed with a strict deadline to coincide with the .NETCore v3.0 release and it shows. It wasn't done. Keep an eye on the linked bug reports. Best to stick to a 16.2.x version until it stabilizes a bit. – Hans Passant Oct 24 '19 at 17:37
  • @HansPassant I'm having the same problem on VS 2019 v16.9.3... is it still possible? Also, I don't see the status bar message `User preferences overridden by`. – Cheshire Cat Apr 01 '21 at 10:25

1 Answers1

-3

Project proprities Code Analysis enable Run On live Analysis opt