Skip to content

Add strict rules to allowImportsFrom #35

Answered by chertik77
chertik77 asked this question in Help
Discussion options

You must be logged in to vote

I bumped to eslint 9 to be able to createEntities and dynamic rules, thank you so much for your help!

I've created something like this:

/**
 * @param {string} folderName
 */
const createEntityRule = folderName => ({
  name: `${folderName} folder`,
  pattern: `src/entities/${folderName}/**`,
  allowImportsFrom: [
    '{family_3}/**',
    'src/shared/**',
    `src/entities/**/@x/${folderName}.ts`
  ]
})
    createEntityRule('auth'),
    createEntityRule('user'),
    createEntityRule('board'),
    createEntityRule('column'),
    createEntityRule('card'),
    createEntityRule('dnd'),

it work great, but requires to add another entity everytime

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Igorkowalski94
Comment options

@Igorkowalski94
Comment options

@Igorkowalski94
Comment options

@chertik77
Comment options

Answer selected by Igorkowalski94
@Igorkowalski94
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants