@conarti/eslint-plugin-feature-sliced
Version:
Feature-sliced design methodology plugin
29 lines (28 loc) • 851 B
JavaScript
;
const config_1 = require("../../config");
const LAYERS_REVERSED = [...config_1.layers].reverse();
module.exports = {
plugins: [
'import',
],
rules: {
'import/order': [
2,
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'never',
pathGroups: LAYERS_REVERSED.map((layer) => ({
pattern: `**/?(*)${layer}{,/**}`,
group: 'internal',
position: 'after',
})),
distinctGroup: false,
pathGroupsExcludedImportTypes: ['builtin'],
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
},
],
},
};