forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
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 'SegmentedControl.Item': 'SegmentedControl.ItemText',
47 },
48 },
49 ],
50 'bsky-internal/use-exact-imports': 'error',
51 'bsky-internal/use-typed-gates': 'error',
52 'bsky-internal/use-prefixed-imports': 'error',
53 'simple-import-sort/imports': [
54 'error',
55 {
56 groups: [
57 // Side effect imports.
58 ['^\\u0000'],
59 // Node.js builtins prefixed with `node:`.
60 ['^node:'],
61 // Packages.
62 // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
63 // React/React Native priortized, followed by expo
64 // Followed by all packages excluding unprefixed relative ones
65 [
66 '^(react\\/(.*)$)|^(react$)|^(react-native(.*)$)',
67 '^(expo(.*)$)|^(expo$)',
68 '^(?!(?:alf|components|lib|locale|logger|platform|screens|state|view)(?:$|\\/))@?\\w',
69 ],
70 // Relative imports.
71 // Ideally, anything that starts with a dot or #
72 // due to unprefixed relative imports being used, we whitelist the relative paths we use
73 // (?:$|\\/) matches end of string or /
74 [
75 '^(?:#\\/)?(?:lib|state|logger|platform|locale)(?:$|\\/)',
76 '^(?:#\\/)?view(?:$|\\/)',
77 '^(?:#\\/)?screens(?:$|\\/)',
78 '^(?:#\\/)?alf(?:$|\\/)',
79 '^(?:#\\/)?components(?:$|\\/)',
80 '^#\\/',
81 '^\\.',
82 ],
83 // anything else - hopefully we don't have any of these
84 ['^'],
85 ],
86 },
87 ],
88 'simple-import-sort/exports': 'error',
89 'react-compiler/react-compiler': 'warn',
90 'no-unused-vars': 'off',
91 '@typescript-eslint/no-unused-vars': [
92 'error',
93 {argsIgnorePattern: '^_', varsIgnorePattern: '^_.+'},
94 ],
95 '@typescript-eslint/consistent-type-imports': [
96 'warn',
97 {prefer: 'type-imports', fixStyle: 'inline-type-imports'},
98 ],
99 'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
100 },
101 ignorePatterns: [
102 '**/__mocks__/*.ts',
103 'src/platform/polyfills.ts',
104 'src/third-party',
105 'ios',
106 'android',
107 'coverage',
108 '*.lock',
109 '.husky',
110 'patches',
111 '*.html',
112 'bskyweb',
113 'bskyembed',
114 'src/locale/locales/_build/',
115 'src/locale/locales/**/*.js',
116 '*.e2e.ts',
117 '*.e2e.tsx',
118 ],
119 settings: {
120 componentWrapperFunctions: ['observer'],
121 },
122 parserOptions: {
123 sourceType: 'module',
124 ecmaVersion: 'latest',
125 },
126}