swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.31k stars 1.23k forks source link

Drop `es/lints` except critical lints #5218

Open kdy1 opened 2 years ago

kdy1 commented 2 years ago

We cannot replace eslint because of plugins and the conclusion of the discussion was to drop it

ArturAralin commented 2 years ago

Maybe I'll make own repo with non critical lints based on swc crate

alexander-akait commented 2 years ago

I think time to create swc_linters (i.e. swc_ecma_lint/swc_css_lint and maybe swc_html_lint in future), so it will be more scalable and will not distract the main swc repo and team (in future).

In long term I think we should replace eslint/stylelint, our parser and AST are great, perf is better, it will happen sooner or later anyway

kdy1 commented 2 years ago

I'll not remove rules from the repository, I'll just move it to @swc/lints

I'll review your PRs soon

Austaras commented 2 years ago

Is swc cureently bundling its own wasm runtime? Does that mean after seperation user need to keep two identical wasm runtime on disk?

kdy1 commented 2 years ago

No we don't bundle wasm

IWANABETHATGUY commented 2 years ago

Any plan to support code fix/code suggestion like eslint?

ArturAralin commented 2 years ago

@IWANABETHATGUY lints will not have any formatting checks

https://github.com/swc-project/swc/pull/3888#issuecomment-1061515898

IWANABETHATGUY commented 2 years ago

@IWANABETHATGUY lints will not have any formatting checks

#3888 (comment)

Nope, code fix not equals to formatting checks.

IWANABETHATGUY commented 2 years ago

@IWANABETHATGUY lints will not have any formatting checks

#3888 (comment)

But thanks for explaining.

IWANABETHATGUY commented 2 years ago

I mean something like this. image

Austaras commented 2 years ago

No we don't bundle wasm

Would #5350 result in final binary?

kdy1 commented 2 years ago

No, but we may replace native bindings for some platforms with wasm runtime. Until stabilizing it, we will bundle wasm runtime (@swc/wasm) for those platforms.

(Note: We bundle wasmer, which is also a wasm runtime. So we may need to distinguish them)

kdy1 commented 2 years ago

Oh, if you mean wasmer (for wasm runtime), the linter does not use wasm runtime at the moment.

Austaras commented 2 years ago

But if we're going to make @swc/lint a general purpose linter, plugin system is required. That would make it relies on wasmer too I guess

kdy1 commented 2 years ago

Yeah, but when we have enough resources for providing general plugins apis for linter, we may move it back to core Alternatively we can use a shared dylib, though