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