-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vision of a linter ecosystem #12
Comments
I'll refrain from comment on your ideas and your view of where this project could go, for now, and I'll instead try and paint a clear picture of my thinking and motivation around this project and where the project currently is, as far as I can remembers as it's been quite a while since I had time and motivation to work on this project. Background When I started to conceptualize this "base", As mentioned in the previous section I also didn't want to bring in the complexity that lives inside Another thing that I realized that a solution like this could help with is not having to "re-implement" editor plugins for each linting/formatting tool like what's usually done today, and a single "linter.js" editor plugin could be used for multiple linters/formatters. Current state of the project
|
OK, but please response to it, so I can see if you understand my design and like my idea 😃
Yes, I like this 🙌, yarn format && yarn lint --fix I would like to take your idea a little further by aiming for greater language/tool coverage. So instead of calling eslint directly, I would like to call plugins, which could be a I will try to summarize my idea a little bit more briefly:
So could the current state of the project possibly be moved to a more descriptive project / npm package name?
I have never heard of ink, but it looks interesting, especially since Yarn v2 uses it and ink works very reactive. Hope this also works under Windows CMD etc.
That would definitely help me 👍 |
Concept of Eco-System
Summary
This issue will be very huge and explains what I (@Shinigami92) think would be a really leading way of which direction this tool can grow.
Motivation
Nowadays there are many linters out there but only for one or few languages.
Therefore when working e.g. on a frontend project, you need to choose eslint, htmllint, stylelint and some others and you also need to setup different schemas of configurations.
Detailed Design
Do not prefer any language, do not provide them from core
We should create a core that doesn't prefer or support any language by default.
Also javascript should be a plugin on it's own.
Plugin-System
We should think about a plugin structure so the core can load them on demand and provide lint messages for different langauges.
First idea would be to scan
node_modules
folder and search for packages like@linter/plugin-{lang}
andlinter-plugin-{lang}
.Keep in mind that there are also languages like
objective-c
, so there could be a plugin like@linter/plugin-objective-c
🤔The core collects all scoped files (with
glob
pattern) and then emit the files to the plugins.The plugins processes the received file and produces well defined linting information.
The core collects the results and provide these lint-information collection so a CLI or IDE/Editor extension can consume it.
Providers
This is NOT my idea! But I like the idea of provide providers for already existing linting tools. (like
eslint
,prettier
,stylelint
,htmllint
,pug-lint
, ...)These provides can be like a bridge between our tool and the specific linting tool.
The provider use the underlying tool and converts the information to our well defined linting information.
Core-API
The core API should "just" emit files and receive info objects and produce consumable lint-collections.
This collection can then consumed by the CLI or any IDE/Editor extension.
The core should also handle configuration (glob-pattern (include / exclude), rulesets and so on).
Editor-Extensions
We should create extensions for big IDEs/Editors like VSCode.
Each extension can use the
@linter/core
under the hood and use the collection object to display messages in the related GUI.Rules and Rule Severities
Rule structures should be well defined so they can generically consumed by the
core
.Rule structure are not related to a specific language (like HTML-rules are structured that way...) -> we define the standard / structure!
Rules could be categorized into:
Rules can have one of three severity levels:
off
,warn
anderror
.Idea: we could also define
info
🤔 (for stylistic)Documentation / Website to explain the concept
We should initiate a website (#8) to help customers to create plugins, rulesets, contribute to our repos and so on.
Focus on linting / hinting.
This should be a linting tool!
Formatting should be done by tools like
Prettier
.We should think and plan to support auto-fixing, but this could be done in a much later planned step.
We can provide a bridge for tools like
prettier
, but then only to hint/guide stylistic lint messages.Open Questions
How to provide different rulesets for the same langauge?
Because I'm not onboarded currently into the existing project, it would be helpful to get an explanation of what the project is currently doing / what direction was aimed.
Maybe I can merge some other ideas (like providers) also into my concept 🙂
Would someone working on a Golang, .Net, Rust, C++, PHP, etc. project install a javascript package for it's linting/formatting needs?
How will the config look like, will there be different config files for each language or will there be a single linter config for all languages?
Global vs local devDependency
Help Needed
Of course!
I never created emitters by my self, so this would be new to me.
Interessting task to tackle 🙂
Frequently Asked Questions
Currently none
Related Discussions
Currently none
The text was updated successfully, but these errors were encountered: