ghost-portal/patches/eslint-plugin-simple-import-sort+6.0.1.patch
Ewa Kowalska 87505b1c59
Eslint imports (#4037)
* Add eslint configuration

* Patch eslint plugin for sorting imports

* Apply eslint rules for imports
2020-12-01 14:40:42 +01:00

23 lines
1.2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

diff --git a/node_modules/eslint-plugin-simple-import-sort/shared.js b/node_modules/eslint-plugin-simple-import-sort/shared.js
index 8012b59..4ed6327 100644
--- a/node_modules/eslint-plugin-simple-import-sort/shared.js
+++ b/node_modules/eslint-plugin-simple-import-sort/shared.js
@@ -713,13 +713,13 @@ function sortImportExportItems(items) {
? -1
: itemB.isSideEffectImport
? 1
- : // Compare the `from` part.
- compare(itemA.source.source, itemB.source.source) ||
+ : // Put type imports/exports before regular ones.
+ compare(itemA.source.kind, itemB.source.kind) ||
+ // Compare the `from` part.
+ // compare(itemA.source.source, itemB.source.source) ||
// The `.source` has been slightly tweaked. To stay fully deterministic,
// also sort on the original value.
compare(itemA.source.originalSource, itemB.source.originalSource) ||
- // Then put type imports/exports before regular ones.
- compare(itemA.source.kind, itemB.source.kind) ||
// Keep the original order if the sources are the same. It’s not worth
// trying to compare anything else, and you can use `import/no-duplicates`
// to get rid of the problem anyway.