mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1module.exports = {
2 root: true,
3 extends: [
4 '@react-native-community',
5 'plugin:react/recommended',
6 'plugin:react-native-a11y/ios',
7 'prettier',
8 ],
9 parser: '@typescript-eslint/parser',
10 plugins: [
11 '@typescript-eslint',
12 'react',
13 'lingui',
14 'simple-import-sort',
15 'bsky-internal',
16 'eslint-plugin-react-compiler',
17 ],
18 rules: {
19 // Temporary until https://github.com/facebook/react-native/pull/43756 gets into a release.
20 'prettier/prettier': 0,
21 'react/no-unescaped-entities': 0,
22 'react-native/no-inline-styles': 0,
23 'bsky-internal/avoid-unwrapped-text': [
24 'error',
25 {
26 impliedTextComponents: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P'],
27 impliedTextProps: [],
28 suggestedTextWrappers: {
29 Button: 'ButtonText',
30 'ToggleButton.Button': 'ToggleButton.ButtonText',
31 },
32 },
33 ],
34 'bsky-internal/use-exact-imports': 'error',
35 'bsky-internal/use-typed-gates': 'error',
36 'simple-import-sort/imports': [
37 'warn',
38 {
39 groups: [
40 // Side effect imports.
41 ['^\\u0000'],
42 // Node.js builtins prefixed with `node:`.
43 ['^node:'],
44 // Packages.
45 // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
46 // React/React Native priortized, followed by expo
47 // Followed by all packages excluding unprefixed relative ones
48 [
49 '^(react\\/(.*)$)|^(react$)|^(react-native(.*)$)',
50 '^(expo(.*)$)|^(expo$)',
51 '^(?!(?:alf|components|lib|locale|logger|platform|screens|state|view)(?:$|\\/))@?\\w',
52 ],
53 // Relative imports.
54 // Ideally, anything that starts with a dot or #
55 // due to unprefixed relative imports being used, we whitelist the relative paths we use
56 // (?:$|\\/) matches end of string or /
57 [
58 '^(?:#\\/)?(?:lib|state|logger|platform|locale)(?:$|\\/)',
59 '^(?:#\\/)?view(?:$|\\/)',
60 '^(?:#\\/)?screens(?:$|\\/)',
61 '^(?:#\\/)?alf(?:$|\\/)',
62 '^(?:#\\/)?components(?:$|\\/)',
63 '^#\\/',
64 '^\\.',
65 ],
66 // anything else - hopefully we don't have any of these
67 ['^'],
68 ],
69 },
70 ],
71 'simple-import-sort/exports': 'warn',
72 // TODO: Reenable when we figure out why it gets stuck on CI.
73 // 'react-compiler/react-compiler': 'error',
74 },
75 ignorePatterns: [
76 '**/__mocks__/*.ts',
77 'src/platform/polyfills.ts',
78 'src/third-party',
79 'ios',
80 'android',
81 'coverage',
82 '*.lock',
83 '.husky',
84 'patches',
85 'bskyweb',
86 '*.html',
87 'bskyweb',
88 'src/locale/locales/_build/',
89 'src/locale/locales/**/*.js',
90 ],
91 settings: {
92 componentWrapperFunctions: ['observer'],
93 },
94 parserOptions: {
95 sourceType: 'module',
96 ecmaVersion: 'latest',
97 },
98}