Skip to content

Commit

Permalink
feat!: add import sorting rule (#126)
Browse files Browse the repository at this point in the history
Lint import sorting, and support auto-fixing of import order. see ipfs/aegir#1178 for an example

---------

Co-authored-by: Alex Potsides <alex@achingbrain.net>
  • Loading branch information
SgtPooki and achingbrain committed Apr 5, 2023
1 parent 81d8ba3 commit 1462d09
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {
},
plugins: [
'no-only-tests',
'jsdoc'
'jsdoc',
'import'
],
rules: {
strict: ['error', 'safe'],
Expand Down Expand Up @@ -72,8 +73,19 @@ module.exports = {
// parse various forms correctly. For now warn on invalid type froms,
// should revisit once following issue is fixed:
// https://github.com/jsdoctypeparser/jsdoctypeparser/issues/50
'jsdoc/valid-types': 'off'

'jsdoc/valid-types': 'off',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: false
},
'newlines-between': 'always',
// the overall order of imports - anything not in this list is grouped together at the end
groups: ['builtin', 'external', 'type']
}
]
},
settings: {
jsdoc: {
Expand Down

0 comments on commit 1462d09

Please sign in to comment.