Comments (8)
Quite honestly? I don't even believe in the concept of this tool at all any more and I don't use it myself for that very reason. To me, EditorConfig is all about – would you believe it – configuring your editor and nothing more. I don't think it should be responsible for linting or fixing, as there are language-specific tools to accomplish those goals (e.g., ESLint for JavaScript). The only way you can reliably lint or fix indentation is to be aware of the language in question and EditorConfig is language agnostic.
I think EditorConfig is more about getting your editor configured properly so that you don't insert bad indentation in the first place. It's more about prevention than fixing. Make sense?
from eclint.
It makes sense to me right now. I just downloaded a template and it's indent using 4 spaces. My team use 2 spaces. So I just want a tool that allows me to change it's indentation. This tool would do it.
I mean, yeah, you are right probably, this tool it's not useful all the time, but this corner cases would be really helpful to have something like this.
I hope you still want to support this.
Thanks,
from eclint.
Out of curiosity, what language are you writing in and why don't you use a linting tool for that language?
from eclint.
I'm using JS, and I do use a linting tool for that language. However, none of those are able to "fix" indent spaces. Maybe cause it's not a problem, but I would like to have all with the same configuration.
from eclint.
What is the name of the linting tool you use?
from eclint.
Also, in answer to your previous question, asking why this tool "can't do it," it's because it "cannot be done." I don't care what other tools claim they can do. I've done so much development, trying to fix this problem w/o knowledge of the language in question and I came to a conclusion that it literally cannot be done. You absolutely need to be aware of the language syntax to do it properly. Anything else is half-assed and will yield inconsistent results. For example, without knowing that you're dealing with JavaScript, you couldn't even lint that the following block of code properly, let alone "fix" it:
/*
* some comment
*/
function foo() {
// function body
}
You need to understand that the space before the *
in the multi-line comment does not count as indentation. In fact, it's considered alignment in this case. You would never know that if you weren't aware of the language in question.
There are so many potential inputs that would never "fix" indentation properly and the fundamental reason is that there's no correct way to detect what the proper indentation should be in the first place if you can't understand what you're looking at. That's the root of the problem.
The main problem, as I've said time and time again, is that people are using spaces for indentation. I am a strong believer in tabs for indentation and spaces for alignment, for this very reason:
If everyone used tabs for indentation followed by spaces for alignment, well, your issue wouldn't be an issue at all, because you would just view the code in whatever tab width you deem appropriate.
That said, I'm sure there are a host of tools that claim to do such and such job. If you want to use those tools, fine. Nobody is stopping you. But I promise you they will make mistakes unless they are language-specific tools, aware of the syntax tree.
from eclint.
For the record, ESLint has an autofix capability with the --fix
flag.
from eclint.
I'm using ESLint, but it doesn't autofix the indentation. You have a good point. The tool would need to know the lenguage syntaxis and how tabs it's being use, if they are.
Thanks anyway. I'm closing this now. :).
from eclint.
Related Issues (20)
- Output of Linting to a file HOT 2
- XML files are ignored
- eclint gets confused by multiple line ending HOT 2
- eclint only indents comments HOT 1
- latest eclint depends on vulnerable axios package HOT 2
- FYI: GitHub Action for checking/enforcing .editorconfig using eclint
- check doesn't handle file paths with spaces
- Option to output only the filenames with errors when checking? HOT 1
- Provide sync version of check/ fix/ infer
- os-locale dependency vulnerable HOT 1
- False-Errors With Latin1 HOT 1
- fix not work HOT 1
- Allow failures from single-file globs
- Error: Dependencies need to be updated
- Feature request: pre-commit hook HOT 1
- security warning for gulp-reporter dependency
- Reusing an existing configuration .editorconfig file HOT 3
- EClint Check Skipping Some Files (indentation only)
- [Feature] Read config from package.json
- Is this officially unmaintained? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclint.