codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.92k stars 362 forks source link

Support eslint object-curly-spacing rule #332

Open karan-kang opened 8 years ago

karan-kang commented 8 years ago

Environment

Upon performing a clean, this

data: {
 time: {date: '', time: ''}
}

becomes

data: {
 time: { date: '', time: '' }
}

This breaks eslint rule object-curly-spacing

My configuration: CodeMaid.config

codecadwallader commented 8 years ago

Thanks for reporting the issue. As part of CodeMaid's cleanup, it invokes Visual Studio's built in formatting (i.e. Edit->Advanced->Format Document). It is the native cleanup within Visual Studio that affects spaces around those JSON braces.

Two options:

  1. Check if Visual Studio has an option to modify how it performs its formatting. I looked under Tools->Options->Text Editor->JSON->Advanced->"Brace positions" and that was close but not quite what you wanted.
  2. You can tell CodeMaid not to invoke Visual Studio's cleanup, but you would lose any other formatting behavior that it is covering. That option is at CodeMaid->Options->Cleaning->Visual Studio->Run format document.

Hope it helps.