-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Updated the prettier config to also sort imports.
- Loading branch information
Showing
3 changed files
with
50 additions
and
122 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
// TODO: Re-add this plugin once it's fixed, https://github.com/peerigon/eslint-config-peerigon/issues/141 | ||
// This plugin breaks with import attributes like `import ... with { type: "json" } | ||
// See https://github.com/trivago/prettier-plugin-sort-imports/issues/270 | ||
// plugins: ["@trivago/prettier-plugin-sort-imports"], | ||
// importOrder: ["^node:", "<THIRD_PARTY_MODULES>", "^[./]"], | ||
plugins: ["@ianvs/prettier-plugin-sort-imports"], | ||
// Overwriting the default configuration because of "importAttributes". | ||
// TODO: Remove this once "importAttributes" is added to the default configuration. | ||
importOrderParserPlugins: [ | ||
"typescript", | ||
"jsx", | ||
"decorators", | ||
"importAttributes", | ||
], | ||
// Overwrites the default TS version of "1.0.0". | ||
// It's a little bit annoying to specify the TS version here as we don't know | ||
// the project's TS version (and we also don't want to update this file every time). | ||
// Specifying the most major version should be enough for now. | ||
importOrderTypeScriptVersion: "5.0.0", | ||
}; |