Skip to content

Commit

Permalink
Refactor: Improve import organization with type imports at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
EvandroLG committed Dec 26, 2024
1 parent bdf7a4f commit b857331
Show file tree
Hide file tree
Showing 10 changed files with 2,160 additions and 533 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'prefer-const': 'error',
Expand All @@ -25,5 +29,30 @@ module.exports = {
disallowTypeAnnotations: true,
},
],
'import/order': [
'error',
{
groups: [
['type'], // Type imports always at the top
['builtin', 'external'], // Node.js built-ins and external packages
['internal'], // Internal imports
['parent', 'sibling', 'index'], // Parent, sibling, and index files
],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
},
};
Loading

0 comments on commit b857331

Please sign in to comment.