eslint-plugin-lucky-fsd v0.0.20
eslint-plugin-lucky-fsd
Plugin for Feature-Sliced Design(it was developed for Windows and may not work on Mac) 1. Checks that the paths inside the component are relative. Also supports checking with aliases. 2. Prohibits importing from non-public api 3. Prohibits import from overlying layers
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-lucky-fsd
:
npm install eslint-plugin-lucky-fsd --save-dev
Usage
Add lucky-fsd
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"lucky-fsd"
]
}
Then configure the rules you want to use under the rules section.
'lucky-fsd/path-checker' - checks that the paths inside the component are relative. Also supports checking with aliases. 'lucky-fsd/public-api-imports' - prohibits importing from non-public api 'lucky-fsd/layer-imports' - prohibits import from overlying layers
{
rules: {
'lucky-fsd/path-checker': ['error', { alias: '@' }],
'lucky-fsd/public-api-imports': [
'error',
{
alias: '@',
testFilesPatterns: ['**/*.test.*', '**/*.stories.*', '**/StoreDecorator.tsx'],
}
],
'lucky-fsd/layer-imports': [
'error',
{
alias: '@',
ignoreImportPatterns: [ '**/StoreProvider' ],
}
]
},
}
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago