-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Comments
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. |
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. |
Hi, @arpowers I found that this issue might caused by But we could use I'm not sure if it's the best workaround, at least it works for me. Also, I don't know how to override the import settings in import { combine, javascript, renamePluginInConfigs, typescript } from '@antfu/eslint-config';
import { FlatCompat } from '@eslint/eslintrc';
import importPlugin from 'eslint-plugin-import-x';
const compat = new FlatCompat({});
export default combine(
javascript(),
typescript(),
// rename the `import-x` to `import` to keep sync with antfu default naming
renamePluginInConfigs([...compat.config(importPlugin.configs.recommended), importPlugin.configs.typescript], { 'import-x': 'import' }),
[{
rules: {
'import/no-cycle': 'error',
},
}],
); |
|
Hi @SukkaW You are right. Adding these settings into antfu config also makes the import/no-cycle rule work. {
settings: {
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import-x/resolver': {
node: {
extensions: ['.ts'],
},
},
},
} |
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:
Reproduction
https://github.com/arpowers/eslint-testing
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: