An ATproto social media client -- with an independent Appview.
1module.exports = {
2 root: true,
3 extends: [
4 '@react-native',
5 'plugin:react/recommended',
6 'plugin:react/jsx-runtime',
7 'plugin:react-native-a11y/ios',
8 'prettier',
9 ],
10 parser: '@typescript-eslint/parser',
11 plugins: [
12 '@typescript-eslint',
13 'react',
14 'lingui',
15 'simple-import-sort',
16 'bsky-internal',
17 'eslint-plugin-react-compiler',
18 'import',
19 ],
20 rules: {
21 'react/no-unescaped-entities': 0,
22 'react/prop-types': 0,
23 'react-native/no-inline-styles': 0,
24 'bsky-internal/avoid-unwrapped-text': [
25 'error',
26 {
27 impliedTextComponents: [
28 'H1',
29 'H2',
30 'H3',
31 'H4',
32 'H5',
33 'H6',
34 'P',
35 'Admonition',
36 'Admonition.Admonition',
37 'Toast.Action',
38 'AgeAssuranceAdmonition',
39 'Span',
40 'StackedButton',
41 ],
42 impliedTextProps: [],
43 suggestedTextWrappers: {
44 Button: 'ButtonText',
45 'ToggleButton.Button': 'ToggleButton.ButtonText',
46 },
47 },
48 ],
49 'bsky-internal/use-exact-imports': 'error',
50 'bsky-internal/use-typed-gates': 'error',
51 'bsky-internal/use-prefixed-imports': 'error',
52 'simple-import-sort/imports': [
53 'error',
54 {
55 groups: [
56 // Side effect imports.
57 ['^\\u0000'],
58 // Node.js builtins prefixed with `node:`.
59 ['^node:'],
60 // Packages.
61 // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
62 // React/React Native priortized, followed by expo
63 // Followed by all packages excluding unprefixed relative ones
64 [
65 '^(react\\/(.*)$)|^(react$)|^(react-native(.*)$)',
66 '^(expo(.*)$)|^(expo$)',
67 '^(?!(?:alf|components|lib|locale|logger|platform|screens|state|view)(?:$|\\/))@?\\w',
68 ],
69 // Relative imports.
70 // Ideally, anything that starts with a dot or #
71 // due to unprefixed relative imports being used, we whitelist the relative paths we use
72 // (?:$|\\/) matches end of string or /
73 [
74 '^(?:#\\/)?(?:lib|state|logger|platform|locale)(?:$|\\/)',
75 '^(?:#\\/)?view(?:$|\\/)',
76 '^(?:#\\/)?screens(?:$|\\/)',
77 '^(?:#\\/)?alf(?:$|\\/)',
78 '^(?:#\\/)?components(?:$|\\/)',
79 '^#\\/',
80 '^\\.',
81 ],
82 // anything else - hopefully we don't have any of these
83 ['^'],
84 ],
85 },
86 ],
87 'simple-import-sort/exports': 'error',
88 'react-compiler/react-compiler': 'warn',
89 'no-unused-vars': 'off',
90 '@typescript-eslint/no-unused-vars': [
91 'error',
92 {argsIgnorePattern: '^_', varsIgnorePattern: '^_.+'},
93 ],
94 '@typescript-eslint/consistent-type-imports': [
95 'warn',
96 {prefer: 'type-imports', fixStyle: 'inline-type-imports'},
97 ],
98 'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
99 },
100 ignorePatterns: [
101 '**/__mocks__/*.ts',
102 'src/platform/polyfills.ts',
103 'src/third-party',
104 'ios',
105 'android',
106 'coverage',
107 '*.lock',
108 '.husky',
109 'patches',
110 '*.html',
111 'bskyweb',
112 'bskyembed',
113 'src/locale/locales/_build/',
114 'src/locale/locales/**/*.js',
115 '*.e2e.ts',
116 '*.e2e.tsx',
117 ],
118 settings: {
119 componentWrapperFunctions: ['observer'],
120 },
121 parserOptions: {
122 sourceType: 'module',
123 ecmaVersion: 'latest',
124 },
125}