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',
|
|
|
|
'detox',
|
|
|
|
'react',
|
|
|
|
'lingui',
|
|
|
|
'simple-import-sort',
|
|
|
|
],
|
2023-09-07 03:06:07 +02:00
|
|
|
rules: {
|
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-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',
|
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
|
|
|
}
|