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

"No cycle" rule isn't working #373

Open
5 tasks done
arpowers opened this issue Dec 23, 2023 · 2 comments
Open
5 tasks done

"No cycle" rule isn't working #373

arpowers opened this issue Dec 23, 2023 · 2 comments

Comments

@arpowers
Copy link

Describe the bug

One of the handiest eslint rules is the no-cycle rule which detects circular imports (because these can be such a nightmare)

However, the rule doesn't appear to be working inside this library.

Config:

// @ts-check
import antfu from "@antfu/eslint-config";

export default antfu(
  {
    typescript: {
      tsconfigPath: "./tsconfig.json",
      parserOptions: {
        project: "./tsconfig.json",
        extraFileExtensions: [".vue", ".json"],
      },
    },
    rules: {
      eqeqeq: "warn",

      "import/no-cycle": [
        "error",
        {
          maxDepth: 5,
          ignoreExternal: true,
        },
      ],
      "ts/no-floating-promises": "error",
    },
  },
  {
    ignores: [
      "**/.ref/**/*",
      "**/__*",
      "node_modules",
      "dist",
      "**/.factor/**",
      ".pnpmfile.cjs",
    ],
  }
);

Reproduction

https://github.com/arpowers/eslint-testing

System Info

MacOS

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@arpowers
Copy link
Author

arpowers commented Feb 6, 2024

any update on this? @antfu as a work around, if there is a better way to make sure there are no circular imports I'm interested.

@antfu
Copy link
Owner

antfu commented Feb 6, 2024

I don't know. I am not using that rule and not sure if it's a problem with this config or the plugin - Investigating yourself might get your problem solved faster.

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

No branches or pull requests

2 participants