editorconfig-tools icon indicating copy to clipboard operation
editorconfig-tools copied to clipboard

Often skips single vs double quote check

Open mcandre opened this issue 9 years ago • 4 comments

I want to enforce single quotes for strings across all my JavaScript (*.js) files, but for some reason this linter is ignoring lib/regenboog.js.

Code:

https://github.com/mcandre/regenboog/tree/ac12033014bc08e08988ecedb461263b8005f4a4

Configuration:

[*.js]
quote_type = single

Trace:

$ grunt editorconfig
Running "exec:editorconfig" (exec) task
./Gruntfile.js failed max_line_length on line 16: line is 1337 chars, it should be 800
./passwords.txt failed trim_trailing_whitespace on line 2627: found setting 'false', should be 'true'
./README.md failed indent_char: found setting '  ', should be '    '

mcandre avatar Mar 03 '15 21:03 mcandre

Actually, it should always skip single vs double quote checks... we don't have a rule defined for that yet.

I would be happy to add one, but I'm pretty sure this requires language-specific parsing, right?

notslang avatar Mar 04 '15 00:03 notslang

That would be a great addition!

Ideally, this feature would be supported for JavaScript, Ruby, Python, and Bash, since those languages tend to have the most single vs double quote fights.

mcandre avatar Mar 04 '15 03:03 mcandre

You can't do that w/o parsing the file into a language-specific syntax tree. CodePainter does this for JavaScript.

jednano avatar Mar 18 '15 18:03 jednano

@slang800 this issue should be closed as a wontfix. There's no way to do it w/o knowledge of the language being formatted.

jednano avatar Mar 23 '15 07:03 jednano