Eslint flat config + feature-sliced.design + monorepo

119 Views Asked by At

Official FSD site provides FAQ on linting topic

I tried plugin, which is works perfectly inside one specific repo. But when I tried to put plugin in monorepo flat config, it started to behave improperly. In particular: layers-slices rule stopped to work.

I tried manually add plugin config and with FlatCompat

Inside my monorepo there are "packages/app{N}" that implements FSD, and "packages/lib" that don't. At the root there is eslint.config.js that perfectly lints TS in apps and lib.

Is there anyone made fsd in eslint flat config to work?

I tried suggested flat config

//imports

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const compat = new FlatCompat({
    baseDirectory: __dirname
})

export default {
  ...compat.extends("plugin:@conarti/feature-sliced/recommended"),
  //rest config
}

Also tried to link __dirname to one of the app{N} folder. No luck :)

0

There are 0 best solutions below