Skip to content
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

[Feature]: optimize the ecma version check. #532

Closed
easy1090 opened this issue Sep 24, 2024 · 11 comments
Closed

[Feature]: optimize the ecma version check. #532

easy1090 opened this issue Sep 24, 2024 · 11 comments
Assignees
Milestone

Comments

@easy1090
Copy link
Contributor

easy1090 commented Sep 24, 2024

What problem does this feature solve?

  1. Support users in configuring the version number for ECMAScript testing.
  2. Support for ecma version 8.

What does the proposed API look like?

linter: {
        rules: {
          'ecma-version-check': [
            'Error',
            {
              checkVersion: 7, // enum, 6 | 7 | 8
              exclude: [] // exclude some files. 
            },
          ],
        },
    }
@nyqykk
Copy link
Member

nyqykk commented Nov 20, 2024

checkVersion maybe better changed to ES2015 and so on

@chenjiahan
Copy link
Member

@nyqykk How about align options with rsbuild-plugin-check-syntax:

https://github.com/rspack-contrib/rsbuild-plugin-check-syntax?tab=readme-ov-file#options

@nyqykk
Copy link
Member

nyqykk commented Nov 20, 2024

Good suggestion

@nyqykk How about align options with rsbuild-plugin-check-syntax:

https://github.com/rspack-contrib/rsbuild-plugin-check-syntax?tab=readme-ov-file#options

@easy1090 easy1090 added this to the 1.0.0 milestone Dec 3, 2024
@nyqykk
Copy link
Member

nyqykk commented Dec 4, 2024

we will add this feature after refactor Overview UI #615

@turnerguo
Copy link

I's better to directly use browserslist settings which provided by project, then consider to provide some config options to override it.

@easy1090
Copy link
Contributor Author

yes, our current plan is like this.

I's better to directly use browserslist settings which provided by project, then consider to provide some config options to override it.

@nyqykk
Copy link
Member

nyqykk commented Jan 15, 2025

support in v1.0 #655

@nyqykk nyqykk closed this as completed Jan 15, 2025
@nanianlisao
Copy link
Contributor

Can it support a specific syntax level? For example, Chrome 70? Through syntax checking, of course, this may be a hard job, and I haven’t seen any actual cases to do this. This is more intuitive and more useful

@nyqykk
Copy link
Member

nyqykk commented Jan 16, 2025

Can it support a specific syntax level? For example, Chrome 70? Through syntax checking, of course, this may be a hard job, and I haven’t seen any actual cases to do this. This is more intuitive and more useful

ofcource it supports that,like this https://github.com/rspack-contrib/rsbuild-plugin-check-syntax?tab=readme-ov-file#options

@nanianlisao
Copy link
Contributor

Great feature!

Can you list all the problems? For example, if I target chrome 70, can you list all the syntax checks that exceed chrome 70 to form a list. This will make it easier for me to modify it. Instead of just handling one and throwing an exception to terminate the whole process

In fact, most of the syntax outside the target is caused by skipping swc transform, such as npm package code under node_modules. I hope to be able to use this method to check and set the appropriate target and include. This is what rsdoctor can provide

@nyqykk
Copy link
Member

nyqykk commented Jan 16, 2025

It will list all files exceed syntax check but just throw the first error in each file even if it has multiple errors. Only by solving the first problem can the second problem be scanned

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

No branches or pull requests

5 participants