oxc-project / oxc

⚓ A collection of JavaScript tools written in Rust.
https://oxc.rs
MIT License
12.01k stars 435 forks source link

linter: the regression error caused by the no-duplicates rule #6844

Open shulaoda opened 2 hours ago

shulaoda commented 2 hours ago
          I just upgraded to oxlint 0.10.2 and this seems to have broken things for me, unless I misunderstand the rule. I have a huge number of reported breaks in my project now, like:
app/javascript/src/pages/Accounts/useAccountContext.tsx:1:39: Module '@apollo/client' is imported more than once in this file [Error]
app/javascript/src/pages/Accounts/useAccountContext.tsx:8:8: Modules should not be imported multiple times in the same file [Error]

My full import declaration for that file is:

import { QueryResult, useQuery } from "@apollo/client";
import {
  AccountRight,
  GetAccountDocument,
  GetAccountQuery,
  GetAccountQueryVariables,
  GrantRole,
} from "@app/graphql-codegen";
import { notEmpty } from "@app/utils";
import { Context } from "react";
import { useHistory } from "react-router-dom";

Downgrading to 0.10.0 (but not 0.10.1) causes the errors to disappear.

Originally posted by @cheald in https://github.com/oxc-project/oxc/issues/6748#issuecomment-2433177892

shulaoda commented 2 hours ago

Let me further investigate.