feature-sliced / eslint-config

🍰 Lint feature-sliced concepts by existing eslint plugins
https://npmjs.com/@feature-sliced/eslint-config
MIT License
119 stars 4 forks source link

Bug: false trigger on valid imports #60

Closed AlexandrHoroshih closed 2 years ago

AlexandrHoroshih commented 2 years ago

I have an app with react, effector, patronum, antd and bunch of other stuff

After i had added @feature-sliced/eslint-config, errors like this started to appear:

  2:26  error  Reaching to "effector-react/ssr" is not allowed  import/no-internal-modules
  3:23  error  Reaching to "patronum/delay" is not allowed      import/no-internal-modules

The problem is that imports like that are perfectly valid and intended by these libraries 🤷‍♂️ I suggest not to run import/no-internal-modules rule against imports from node_modules (or against non-feature-sliced paths at all)

Small reproduce: https://stackblitz.com/edit/fs-eslint-false-trigger?file=src/app/index.js Run npm run lint in the terminal to see the issue

azinit commented 2 years ago

Thanks for issue!

For a while you can customize your boundaries manually:

{
  "extends": [
    "@feature-sliced/eslint-config/rules/import-order",
    "@feature-sliced/eslint-config/rules/layers-slices", 
    // Related with bug =>  "@feature-sliced/eslint-config/rules/public-api",
  ]
}
azinit commented 2 years ago

@Krakazybik SLA 40 MIN, KARL! 🚀

image

azinit commented 2 years ago

@AlexandrHoroshih JFYI, I've published new patch version - 0.1.0-alpha.1

You can try to use it with this bugfix

azinit commented 2 years ago

If problem remained, reopen issue ✊