eclint icon indicating copy to clipboard operation
eclint copied to clipboard

feature_request(fix): remove leading spaces

Open Kristinita opened this issue 6 years ago • 4 comments

1. Summary

It would be nice, if eclint fix will remove leading spaces for tabs users.

2. Argumentation

Some tools automatically generate files with leading spaces. eclint fix doesn't fix it and eclint check makes my builds failed.

3. MCVE

  • .editorconfig — I prefer tabs:
[*]
indent_style = tab
indent_size = 4
/*
 * Kira Stylus comment
 */
  • KiraECLint.js — beginning of real file, that generate by grunt-modernizr:
/*! modernizr 3.6.0 (Custom Build) | MIT *
 * https://modernizr.com/download/?-webp-addtest-fnbind-printshiv-testprop !*/

Leading spaces in KiraECLint.styl and KiraECLint.js.

4. Steps to reproduce

eclint check
eclint fix
eclint check

5. Expected behavior

Remove leading spaces after fix, successful check.

6. Actual behavior

D:\SashaDebugging\Eclint>eclint check
KiraECLint.js
    02:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)
KiraECLint.styl
    02:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)
    03:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)

D:\SashaDebugging\Eclint>eclint fix

D:\SashaDebugging\Eclint>eclint check
KiraECLint.js
    02:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)
KiraECLint.styl
    02:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)
    03:01 ❌️ invalid indent style: space, expected: tab
                                                        (EditorConfig indent_style https://goo.gl/8Qkrbr)

Thanks.

Kristinita avatar Feb 19 '19 16:02 Kristinita

Think you need to set the block_comment option https://github.com/jedmao/eclint#block_comment

nschonni avatar Feb 19 '19 22:02 nschonni

https://github.com/jedmao/eclint#support-for-doc-comments

gucong3000 avatar Feb 20 '19 02:02 gucong3000

@nschonni, @gucong3000, Status: partially fixed

+ — eclint check doesn't show errors

- — eclint fix doesn't remove leading spaces in comments

Is it possible remove leading spaces? They are not needed.

Thanks.

Kristinita avatar Feb 20 '19 03:02 Kristinita

My comment was about comment blocks (😉 ) that were being flagged in your example. There are 3 editorconfig settings that deal specifically with comment blocks, that are separate from the indent settings.

nschonni avatar Feb 20 '19 04:02 nschonni