Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,59 @@ module.exports = {
'react-native/sort-styles': 0,
'react-native/no-inline-styles': 1,
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
],
rules: {
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/strict-boolean-expressions': [
'warn',
{
allowNullableBoolean: true,
allowNullableString: true,
allowNullableNumber: true,
allowNullableObject: true,
},
],
// `void expr` (including as a concise arrow body, e.g.
// `onPress={() => void save()}`) is the idiomatic way to satisfy
// no-floating-promises for intentionally unawaited promises, which
// conflicts with the base config's blanket ban on `void`.
'no-void': 'off',
},
},
{
// react-navigation's ParamList generics require an object-literal
// `type` alias (not `interface`) to satisfy their implicit index
// signature constraint — https://reactnavigation.org/docs/typescript
files: ['src/navigation/*.ts', 'src/navigation/*.tsx'],
rules: {
'@typescript-eslint/consistent-type-definitions': 'off',
},
},
{
// @react-native-firebase/messaging is an optional peer dependency
// (see .env.example): a static `import` would be resolved by Metro at
// bundle time and fail hard when the package or native config is
// absent, whereas a synchronous `require()` inside try/catch can be
// caught and swapped for a no-op adapter, and is intercepted cleanly
// by jest.mock() in tests.
files: ['src/services/firebaseMessaging.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};
6 changes: 3 additions & 3 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ function AppSync() {
useEffect(() => {
const sub = AppState.addEventListener('change', (state: AppStateStatus) => {
if (state === 'active') {
syncPendingProofs();
void syncPendingProofs();
}
});
return () => sub.remove();
}, [syncPendingProofs]);

useEffect(() => {
registerForPushNotifications().then(token => {
void registerForPushNotifications().then(token => {
if (token) {
sendTokenToServer(token);
void sendTokenToServer(token);
}
});
}, []);
Expand Down
Loading
Loading