mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
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:
parent
fde7d65992
commit
6f5df113af
7 changed files with 8 additions and 8 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ declare_oxc_lint!(
|
||||||
/// ```javascript
|
/// ```javascript
|
||||||
/// ```
|
/// ```
|
||||||
Named,
|
Named,
|
||||||
nursery
|
correctness
|
||||||
);
|
);
|
||||||
|
|
||||||
impl Rule for Named {
|
impl Rule for Named {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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<'_>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue