Bluesky app fork with some witchin' additions 💫

Merge pull request #3189 from bluesky-social/samuel/sort-imports

Sort imports using eslint-plugin-simple-import-sort

authored by samuel.fm and committed by

GitHub 81bc3ed4 023e12bb

+53 -1
+47 -1
.eslintrc.js
··· 7 7 'prettier', 8 8 ], 9 9 parser: '@typescript-eslint/parser', 10 - plugins: ['@typescript-eslint', 'detox', 'react', 'lingui'], 10 + plugins: [ 11 + '@typescript-eslint', 12 + 'detox', 13 + 'react', 14 + 'lingui', 15 + 'simple-import-sort', 16 + ], 11 17 rules: { 12 18 'react/no-unescaped-entities': 0, 13 19 'react-native/no-inline-styles': 0, 20 + 'simple-import-sort/imports': [ 21 + 'warn', 22 + { 23 + groups: [ 24 + // Side effect imports. 25 + ['^\\u0000'], 26 + // Node.js builtins prefixed with `node:`. 27 + ['^node:'], 28 + // Packages. 29 + // Things that start with a letter (or digit or underscore), or `@` followed by a letter. 30 + // React/React Native priortized, followed by expo 31 + // Followed by all packages excluding unprefixed relative ones 32 + [ 33 + '^(react\\/(.*)$)|^(react$)|^(react-native(.*)$)', 34 + '^(expo(.*)$)|^(expo$)', 35 + '^(?!(?:alf|components|lib|locale|logger|platform|screens|state|view)(?:$|\\/))@?\\w', 36 + ], 37 + // Relative imports. 38 + // Ideally, anything that starts with a dot or # 39 + // due to unprefixed relative imports being used, we whitelist the relative paths we use 40 + // (?:$|\\/) matches end of string or / 41 + [ 42 + '^(?:#\\/)?(?:lib|state|logger|platform|locale)(?:$|\\/)', 43 + '^(?:#\\/)?view(?:$|\\/)', 44 + '^(?:#\\/)?screens(?:$|\\/)', 45 + '^(?:#\\/)?alf(?:$|\\/)', 46 + '^(?:#\\/)?components(?:$|\\/)', 47 + '^#\\/', 48 + '^\\.', 49 + ], 50 + // anything else - hopefully we don't have any of these 51 + ['^'], 52 + ], 53 + }, 54 + ], 55 + 'simple-import-sort/exports': 'warn', 14 56 }, 15 57 ignorePatterns: [ 16 58 '**/__mocks__/*.ts', ··· 30 72 ], 31 73 settings: { 32 74 componentWrapperFunctions: ['observer'], 75 + }, 76 + parserOptions: { 77 + sourceType: 'module', 78 + ecmaVersion: 'latest', 33 79 }, 34 80 }
+1
package.json
··· 237 237 "eslint-plugin-lingui": "^0.2.0", 238 238 "eslint-plugin-react": "^7.33.2", 239 239 "eslint-plugin-react-native-a11y": "^3.3.0", 240 + "eslint-plugin-simple-import-sort": "^12.0.0", 240 241 "html-webpack-plugin": "^5.5.0", 241 242 "husky": "^8.0.3", 242 243 "is-ci": "^3.0.1",
+5
yarn.lock
··· 11533 11533 semver "^6.3.1" 11534 11534 string.prototype.matchall "^4.0.8" 11535 11535 11536 + eslint-plugin-simple-import-sort@^12.0.0: 11537 + version "12.0.0" 11538 + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.0.0.tgz#3cfa05d74509bd4dc329a956938823812194dbb6" 11539 + integrity sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ== 11540 + 11536 11541 eslint-plugin-testing-library@^5.0.1: 11537 11542 version "5.11.1" 11538 11543 resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.11.1.tgz#5b46cdae96d4a78918711c0b4792f90088e62d20"