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
Add "deno lint" subcommand #1880
Comments
eslint and those plugins:
So in term of updates, Deno will update on major releases of Typescript / eslint? To stay as tied as the LTS version of those dependencies. |
Also, eslint needs access to TypeScript to perform its duties, currently the Deno runtime does not give access to TypeScript, it only exists in the compiler. |
Agree with @zekth, plus probably Also believe that if/when this is done, we can allow I almost always have autofix enabled, both when using through terminal and in vscode. So it picks the eslint config AND the prettier config to automatically fix and format everything. Great consistency. It doesn't even matter what I write and how I write it. I'm always a 1ms away from Ctrl+S or on pre-commit. I don't need to care or even know what tha heck I'm doing, the macine/tool/system is smart enough to correct me, help me and guide me if I'm wrong. |
The side thoughts: I'm going to market it and promote it more, probably in the beginning of next year, because I really think it at least worth reviews and discussions. All this should be build into "the language"/runtime, then easily write a thin wrapper arond the main CLI binary and voila you have editor integrations. From there, you have unlimited powered and amazing DX. |
Note about implementation: https://github.com/mysticatea/typescript-eslint-demo
ESLint doesn't support browser officially, but one of the eslint core contributers, @mysticatea (Toru Nagashima), maintains browser version of eslint engine at https://github.com/mysticatea/eslint4b . The above demo uses this module as eslint engine. Probably we can reuse this module in Deno and are able to perform eslint checks. |
I don't think we need "browser support"-ed eslint. Deno is not run in browser, but in server-side as cli. The only problem might be the size of Deno, which may increase drastically. For some time I'm thinking to bundle ESLint with |
This could be useful without eslint to replace |
I would suggest having the linting setup include preventing errors out of the box; perhaps extending {
"parserOptions": {
"ecmaVersion": X
},
"extends": [
"eslint:recommended"
]
} |
Is there any update on the plan for |
@nayeemrmn most likely it will be implemented in Rust using |
@bartlomieju how? |
Here I give my personal opinion: Do not allow the user to customize linter's rulersThe community has spent too much time arguing which style is better No need to waste more time on things like this The user has only one choice, with keeping the style consistent is important Otherwise, in the future, tools like and users are confused with "Which one should I choose?" |
@tunnckoCore swc wasn't for formatting, and along came dprint. |
@kitsonk sorry what? I'm not saying that. I understood that @bartlomieju's comment implies that |
@tunnckoCore I will write linter myself based on swc |
@axetroy If you say there are too many options, why build out a Unless a developer only writes backend code, they will still need to touch If a parallel lint tool must be built (are there really not better ways to improve deno?) then it MUST be able to consume existing eslint rules. Otherwise people will waste their time reinventing the wheel, writing duplicate rules for deno and frontend code rather than application code. Instead |
@bartlomieju, wooow. Interesting, please ping somewhere someday. :) I'm really digging into linting with node/deno/rust wrapper for eslint tho, because I already fixed the config resolving (partially implementing rfc#9) slowness from which comes the huge bottleneck in perf. The thing is that But I'm also thinking that thebest way would be to implement it like the TypeScript stuff is done. Instead of compiling it would pass the text to the linter api (my wrapper already exposes pretty good amount of APIs and its internals). |
Sure, I'll let you know.
Can you elaborate? I have JSON AST that is similar to Babel's, can you feed it to the API you're talking about? |
With that I meant, that the lint part can be done like the typescript part here in deno, like instead of using typescript use eslint there.
No. There are no publicly exposed methods in |
Update: linter is currently WIP and located at: https://github.com/denoland/deno_lint |
For linting files.
Probably should be implemented similar to how we've done
--fmt
... that is get eslint into deno_std, and then load from URL in core.The text was updated successfully, but these errors were encountered: