feat(linter/import): move some rules out of nursery (#2841)

### Correctness
- named
- export
- default
- namespace
- no-unresolved

The above rules will prevent bugs or broken, so I changed these to
correctness

### Suspicious
- no-duplicates
- no-named-as-default-member
- no-named-as-default

I'm still not sure whether the `no-unresolved` rule should be changed to
`correctness`. Because I found that the rule reported a lot in the
AFFiNE. But in fact, they are all correct reports

---------

Co-authored-by: Boshen <boshenc@gmail.com>
This commit is contained in:
Dunqing 2024-05-04 18:51:26 +08:00 committed by GitHub
parent fde7d65992
commit 6f5df113af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@ mod import {
pub mod no_amd; pub mod no_amd;
pub mod no_cycle; pub mod no_cycle;
pub mod no_default_export; pub mod no_default_export;
pub mod no_deprecated; // pub mod no_deprecated;
pub mod no_duplicates; pub mod no_duplicates;
pub mod no_named_as_default; pub mod no_named_as_default;
pub mod no_named_as_default_member; pub mod no_named_as_default_member;
@ -643,7 +643,7 @@ oxc_macros::declare_all_lint_rules! {
import::namespace, import::namespace,
import::no_amd, import::no_amd,
import::no_cycle, import::no_cycle,
import::no_deprecated, // import::no_deprecated,
import::no_named_as_default, import::no_named_as_default,
import::no_named_as_default_member, import::no_named_as_default_member,
import::no_self_import, import::no_self_import,

View file

@ -32,7 +32,7 @@ declare_oxc_lint!(
/// import bar from './bar' // no default export found in ./bar /// import bar from './bar' // no default export found in ./bar
/// ``` /// ```
Default, Default,
nursery correctness
); );
impl Rule for Default { impl Rule for Default {

View file

@ -26,7 +26,7 @@ declare_oxc_lint!(
/// ```javascript /// ```javascript
/// ``` /// ```
Named, Named,
nursery correctness
); );
impl Rule for Named { impl Rule for Named {

View file

@ -47,7 +47,7 @@ declare_oxc_lint!(
/// Also, will report for computed references (i.e. foo["bar"]()). /// Also, will report for computed references (i.e. foo["bar"]()).
/// Reports on assignment to a member of an imported namespace. /// Reports on assignment to a member of an imported namespace.
Namespace, Namespace,
nursery correctness
); );
impl Rule for Namespace { impl Rule for Namespace {

View file

@ -16,7 +16,7 @@ declare_oxc_lint!(
/// ///
/// Reports if a resolved path is imported more than once. /// Reports if a resolved path is imported more than once.
NoDuplicates, NoDuplicates,
nursery suspicious
); );
impl Rule for NoDuplicates { impl Rule for NoDuplicates {

View file

@ -39,7 +39,7 @@ declare_oxc_lint!(
/// import bar from './foo.js'; /// import bar from './foo.js';
/// ``` /// ```
NoNamedAsDefault, NoNamedAsDefault,
nursery suspicious
); );
impl Rule for NoNamedAsDefault { impl Rule for NoNamedAsDefault {

View file

@ -43,7 +43,7 @@ declare_oxc_lint!(
/// const bar = foo.bar // trying to access named export via default /// const bar = foo.bar // trying to access named export via default
/// ``` /// ```
NoNamedAsDefaultMember, NoNamedAsDefaultMember,
nursery suspicious
); );
fn get_symbol_id_from_ident( fn get_symbol_id_from_ident(
ctx: &LintContext<'_>, ctx: &LintContext<'_>,