2022-06-08 00:50:05 +02:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
2023-05-24 23:59:42 +02:00
|
|
|
extends: [
|
|
|
|
'@react-native-community',
|
2023-09-08 01:38:57 +02:00
|
|
|
'plugin:react/recommended',
|
2023-05-24 23:59:42 +02:00
|
|
|
'plugin:react-native-a11y/ios',
|
|
|
|
'prettier',
|
|
|
|
],
|
2022-06-08 00:50:05 +02:00
|
|
|
parser: '@typescript-eslint/parser',
|
2024-03-12 22:57:56 +01:00
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint',
|
|
|
|
'react',
|
|
|
|
'lingui',
|
|
|
|
'simple-import-sort',
|
2024-04-04 18:32:50 +02:00
|
|
|
'bsky-internal',
|
2024-05-22 19:46:45 +02:00
|
|
|
'eslint-plugin-react-compiler',
|
2024-03-12 22:57:56 +01:00
|
|
|
],
|
2023-09-07 03:06:07 +02:00
|
|
|
rules: {
|
2024-04-02 07:58:31 +02:00
|
|
|
// Temporary until https://github.com/facebook/react-native/pull/43756 gets into a release.
|
|
|
|
'prettier/prettier': 0,
|
2023-09-08 01:38:57 +02:00
|
|
|
'react/no-unescaped-entities': 0,
|
2023-09-07 03:06:07 +02:00
|
|
|
'react-native/no-inline-styles': 0,
|
2024-04-04 18:32:50 +02:00
|
|
|
'bsky-internal/avoid-unwrapped-text': [
|
|
|
|
'error',
|
|
|
|
{
|
2024-04-05 16:09:35 +02:00
|
|
|
impliedTextComponents: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P'],
|
2024-04-04 22:34:55 +02:00
|
|
|
impliedTextProps: [],
|
2024-04-05 16:09:35 +02:00
|
|
|
suggestedTextWrappers: {
|
|
|
|
Button: 'ButtonText',
|
|
|
|
'ToggleButton.Button': 'ToggleButton.ButtonText',
|
|
|
|
},
|
2024-04-04 18:32:50 +02:00
|
|
|
},
|
|
|
|
],
|
2024-04-10 20:36:37 +02:00
|
|
|
'bsky-internal/use-typed-gates': 'error',
|
2024-06-18 07:23:41 +02:00
|
|
|
'bsky-internal/keep-i18n-patch-in-sync': 'error',
|
2024-03-13 15:50:25 +01:00
|
|
|
'simple-import-sort/imports': [
|
2024-03-19 17:13:15 +01:00
|
|
|
'warn',
|
2024-03-13 15:50:25 +01:00
|
|
|
{
|
|
|
|
groups: [
|
|
|
|
// Side effect imports.
|
|
|
|
['^\\u0000'],
|
|
|
|
// Node.js builtins prefixed with `node:`.
|
|
|
|
['^node:'],
|
|
|
|
// Packages.
|
|
|
|
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
|
|
|
|
// React/React Native priortized, followed by expo
|
2024-03-13 16:49:24 +01:00
|
|
|
// Followed by all packages excluding unprefixed relative ones
|
2024-03-13 15:50:25 +01:00
|
|
|
[
|
2024-03-13 16:49:24 +01:00
|
|
|
'^(react\\/(.*)$)|^(react$)|^(react-native(.*)$)',
|
2024-03-13 15:50:25 +01:00
|
|
|
'^(expo(.*)$)|^(expo$)',
|
2024-03-13 16:49:24 +01:00
|
|
|
'^(?!(?:alf|components|lib|locale|logger|platform|screens|state|view)(?:$|\\/))@?\\w',
|
2024-03-13 15:50:25 +01:00
|
|
|
],
|
|
|
|
// Relative imports.
|
2024-03-13 16:51:55 +01:00
|
|
|
// Ideally, anything that starts with a dot or #
|
|
|
|
// due to unprefixed relative imports being used, we whitelist the relative paths we use
|
2024-03-13 16:49:24 +01:00
|
|
|
// (?:$|\\/) matches end of string or /
|
|
|
|
[
|
|
|
|
'^(?:#\\/)?(?:lib|state|logger|platform|locale)(?:$|\\/)',
|
|
|
|
'^(?:#\\/)?view(?:$|\\/)',
|
|
|
|
'^(?:#\\/)?screens(?:$|\\/)',
|
|
|
|
'^(?:#\\/)?alf(?:$|\\/)',
|
|
|
|
'^(?:#\\/)?components(?:$|\\/)',
|
|
|
|
'^#\\/',
|
|
|
|
'^\\.',
|
|
|
|
],
|
|
|
|
// anything else - hopefully we don't have any of these
|
|
|
|
['^'],
|
2024-03-13 15:50:25 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2024-03-19 17:13:15 +01:00
|
|
|
'simple-import-sort/exports': 'warn',
|
2024-05-22 20:04:28 +02:00
|
|
|
// TODO: Reenable when we figure out why it gets stuck on CI.
|
|
|
|
// 'react-compiler/react-compiler': 'error',
|
2023-09-07 03:06:07 +02:00
|
|
|
},
|
2023-01-24 18:03:18 +01:00
|
|
|
ignorePatterns: [
|
|
|
|
'**/__mocks__/*.ts',
|
2023-08-25 17:48:38 +02:00
|
|
|
'src/platform/polyfills.ts',
|
2023-07-14 02:39:43 +02:00
|
|
|
'src/third-party',
|
2023-01-24 18:03:18 +01:00
|
|
|
'ios',
|
|
|
|
'android',
|
|
|
|
'coverage',
|
2023-07-14 00:35:05 +02:00
|
|
|
'*.lock',
|
|
|
|
'.husky',
|
2023-07-28 17:29:37 +02:00
|
|
|
'patches',
|
2023-08-24 01:29:23 +02:00
|
|
|
'bskyweb',
|
2023-08-22 20:04:17 +02:00
|
|
|
'*.html',
|
2023-08-24 01:28:51 +02:00
|
|
|
'bskyweb',
|
2023-12-01 18:14:10 +01:00
|
|
|
'src/locale/locales/_build/',
|
|
|
|
'src/locale/locales/**/*.js',
|
2023-01-24 18:03:18 +01:00
|
|
|
],
|
2023-09-08 02:36:08 +02:00
|
|
|
settings: {
|
|
|
|
componentWrapperFunctions: ['observer'],
|
|
|
|
},
|
2024-03-12 22:57:56 +01:00
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
ecmaVersion: 'latest',
|
|
|
|
},
|
2022-06-09 20:03:25 +02:00
|
|
|
}
|