Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

feature_request(fix): remove leading spaces #155

Open
Kristinita opened this issue Feb 19, 2019 · 4 comments
Open

feature_request(fix): remove leading spaces #155

Kristinita opened this issue Feb 19, 2019 · 4 comments

Comments

@Kristinita
Copy link

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.

@nschonni
Copy link

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

@gucong3000
Copy link
Collaborator

@Kristinita
Copy link
Author

@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.

@nschonni
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants