Skip to content

Instantly share code, notes, and snippets.

@phatnguyenuit
Created May 2, 2022 13:46
Show Gist options
  • Save phatnguyenuit/6b637503197def963d2349b873326f24 to your computer and use it in GitHub Desktop.
Save phatnguyenuit/6b637503197def963d2349b873326f24 to your computer and use it in GitHub Desktop.
How to sort imports like a pro in TypeScript | .eslintrc.js | sort-import rules
module.exports = {
// Extends the previous ESLint configuration by adding rules
// <--! Previous configuration comes here !-->
rules: {
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true, // don"t want to sort import lines, use eslint-plugin-import instead
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment