Skip to content

linter: import/no-cycle false positive #11646

@MisterJimson

Description

@MisterJimson

What version of Oxlint are you using?

1.1.0

What command did you run?

pnpm oxlint --max-warnings=0

What does your .oxlintrc.json config file look like?

{
  "plugins": ["import"],
  "rules": {
    "no-await-in-promise-methods": "off",
    "no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^_",
        "varsIgnorePattern": "^_",
        "caughtErrorsIgnorePattern": "^_"
      }
    ],
    "import/no-cycle": [
      "error",
      { "ignoreExternal": true, "ignoreTypes": true }
    ]
  },
  "ignorePatterns": [
    "vendor",
    "test/snapshots/**",
    "test.js",
    "vite.config.ts",
    "codegen",
    "sst-env.d.ts",
    "packages/generated/schemas",
    "packages/generated/sdks",
    "packages/sdk/src/generated",
    "packages/specs",
    "docs-public",
    "node_modules"
  ]
}

What happened?

We have the following pattern in our codebase:

export function example1() {
  return 1;
}

export function example2() {
  return 2;
}

export * as Example from './test';

import/no-cycle triggers on the last line with oxlint, but not with eslint with the eslint version of the plugin. This is not an import cycle.

Dependency cycle detected\nhelp: These paths form a cycle: \n-> ./test - packages/core/test.ts

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions