Skip to content

Commit

Permalink
fix(toolchain/eslint-config): add 'sort-imports' to javascript rules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mpellegrini authored Mar 18, 2024
1 parent 3c6e584 commit 0323749
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/example-pkg/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { greetUser, type User } from './index.js'
import { type User, greetUser } from './index.js'

describe('greet user tests', () => {
const user: User = {
Expand Down
16 changes: 16 additions & 0 deletions toolchain/eslint-config/configs/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ export default defineFlatConfig([
rules: {
...js.configs.recommended.rules,

/**
* Enforce sorted import declarations within modules.
*
* 🔧 Fixable - https://eslint.org/docs/latest/rules/sort-imports
*/
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false,
},
],

/**
* Disallow empty functions.
*
Expand Down

0 comments on commit 0323749

Please sign in to comment.