about summary refs log tree commit diff
path: root/.eslintrc.js
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-03-13 14:50:25 +0000
committerSamuel Newman <mozzius@protonmail.com>2024-03-13 14:50:25 +0000
commit70c76a76a0d0285c28fa456c3af7741ad7a727cb (patch)
treec1e3480f2b0ce18842cd2a0eec85ae1fdd4b32b5 /.eslintrc.js
parent125ef1c75610c7add79f6a917bfa058f9265d5d4 (diff)
downloadvoidsky-70c76a76a0d0285c28fa456c3af7741ad7a727cb.tar.zst
add custom import order
Diffstat (limited to '.eslintrc.js')
-rw-r--r--.eslintrc.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index b26bee1ba..c1592b76a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -17,7 +17,29 @@ module.exports = {
   rules: {
     'react/no-unescaped-entities': 0,
     'react-native/no-inline-styles': 0,
-    'simple-import-sort/imports': 'error',
+    'simple-import-sort/imports': [
+      'error',
+      {
+        groups: [
+          // Side effect imports.
+          ['^\\u0000'],
+          // Node.js builtins prefixed with `node:`.
+          ['^node:'],
+          // Packages.
+          // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
+          // React/React Native priortized, followed by expo
+          [
+            '^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
+            '^(expo(.*)$)|^(expo$)',
+            '^@?\\w',
+            '^',
+          ],
+          // Relative imports.
+          // Anything that starts with a dot or a #
+          ['^#', '^\\.'],
+        ],
+      },
+    ],
     'simple-import-sort/exports': 'error',
   },
   ignorePatterns: [