eslint-plugin-igor21v
v0.0.13
Published
plugin for eslint
Downloads
21
Maintainers
Readme
Eslint plugin для FSD
Плагин для Eslint предназначенный для строгого контроля главных архитектурных принципов Feature sliced design
Содержит 3 правила:
1. path-checker - запрещает использовать абсолютные импорты в рамках одного модуля
Возможна конфигурация в .eslintrc.js элиаса используемого в проекте перед указанием абсолютного пути:
'igor21v/path-checker': ['error', { alias: '@' }],
Имеет автофикс
2. layer-imports - проверяет корректность использования слоев с точки зрения FSD (например widgets нельзя использовать в features и entitites)
Возможна конфигурация в .eslintrc.js элиаса используемого в проекте перед указанием абсолютного пути а также добавление исключения из правила:
'igor21v/layer-imports': [
'error',
{
alias: '@',
ignoreImportPatterns: ['**/StoreProvider', '**/testing'],
},
],
3. public-api-imports - разрешает импорт из других модулей только из public api.
Возможна конфигурация в .eslintrc.js элиаса используемого в проекте перед указанием абсолютного пути а также добавление исключения из правила:
'igor21v/public-api-imports': [
'error',
{
alias: '@',
testFilesPatterns: [
'**/*.test.*',
'**/*.story.*',
'**/StoreDecorator.tsx',
'**/tests.ts',
],
},
],
Имеет автофикс