1.5.3 • Published 4 months ago
eslint-plugin-dubious-plugin v1.5.3
eslint-plugin-dubious-plugin
Check import paths according to FSD
The plugin contain 5 rules:
- different-layer-absolute-import (Prevents the use of relative import to import from other layers)
- underlying-layer-imports (Prevents to import a layer from underlying layer)
- public-api-import-slice (Check if a module was imported using a public API)
- different-layer-export (Prevents exporting a module from another layer)
- same-slice-local-import (Prevents the use of absolute import within one slice)
Rule options
First 4 rules (different-layer-absolute-import, underlying-layer-imports, public-api-import-slice, different-layer-export) have all the options below. The last one (same-slice-local-import) has only alias option. Also public-api-import-slice, public-api-import-slice and same-slice-local-import rules have autofix.
{
alias: string, // alias for absolute import folder (e.g. "src" or "@")
ignoreFiles: string[], // ignored files to check with the given pattern (e.g. '**/*.test.*')
ignoreImportPatterns: string[] // ignored import declaration string to check with the given pattern (e.g. '**/StoreProvider/**')
},
Example of use
// .eslintrc.js
{
'dubious-plugin/public-api-import-slice': [
'error',
{ alias: 'src', ignoreFiles: ['**/*.test.*', '**/*.stories.*'] },
],
'dubious-plugin/underlying-layer-imports': [
'error',
{
alias: 'src',
ignoreImportPatterns: ['**.scss', '**/StoreProvider/**'],
ignoreFiles: ['**/*.test.*', '**/*.stories.*'],
},
],
'dubious-plugin/different-layer-absolute-import': [
'error',
{
alias: 'src',
ignoreFiles: ['**/*.test.*', '**/*.stories.*'],
},
],
},
1.5.3
4 months ago
1.5.2
4 months ago
1.5.1
4 months ago
1.5.0
4 months ago
1.2.0
4 months ago
1.1.1
4 months ago
1.1.0
4 months ago
1.4.6
4 months ago
1.4.5
4 months ago
1.0.9
4 months ago
1.4.4
4 months ago
1.4.3
4 months ago
1.1.6
4 months ago
1.4.2
4 months ago
1.1.5
4 months ago
1.4.1
4 months ago
1.2.3
4 months ago
1.1.4
4 months ago
1.4.0
4 months ago
1.2.2
4 months ago
1.1.3
4 months ago
1.3.0
4 months ago
1.2.1
4 months ago
1.1.2
4 months ago
1.0.2
5 months ago
1.0.1
5 months ago
1.0.0
5 months ago
1.0.8
5 months ago
1.0.7
5 months ago
1.0.6
5 months ago
1.0.5
5 months ago
1.0.4
5 months ago
1.0.3
5 months ago
0.0.0
5 months ago