Skip to content

Commit be88ce0

Browse files
authored
feat(config/eslintrc): enable import/order and sort-imports rule
BREAKING CHANGE: sets `import/order` (with `alphabetize` set to `asc`) and `sort-imports` rules to `error`
1 parent 8dbc250 commit be88ce0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/config/helpers/build-eslint.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const buildConfig = ({withReact = false} = {}) => {
4040
ifReact('plugin:react-hooks/recommended'),
4141
].filter(Boolean),
4242
rules: {
43-
'prettier/prettier': 'error',
4443
'import/prefer-default-export': 'off',
4544
'import/no-extraneous-dependencies': [
4645
'error',
@@ -55,7 +54,21 @@ const buildConfig = ({withReact = false} = {}) => {
5554
optionalDependencies: false,
5655
},
5756
],
57+
'import/order': [
58+
'error',
59+
{
60+
alphabetize: {order: 'asc'},
61+
'newlines-between': 'always',
62+
pathGroups: [
63+
{pattern: 'src/**/*', group: 'parent', position: 'before'},
64+
{pattern: 'assets/**/*', group: 'parent', position: 'before'},
65+
],
66+
pathGroupsExcludedImportTypes: ['builtin'],
67+
},
68+
],
5869
'no-void': ['error', {allowAsStatement: true}],
70+
'prettier/prettier': 'error',
71+
'sort-imports': ['error', {ignoreDeclarationSort: true}],
5972
...parserRules(false, isReact),
6073
},
6174
overrides: [

0 commit comments

Comments
 (0)