Skip to content

Commit

Permalink
Merge pull request #6 from nevissecurity/feature/NEVISACCESSAPP-5317-…
Browse files Browse the repository at this point in the history
…Extend-eslint-configuration

Feature/nevisaccessapp 5317 extend eslint configuration
  • Loading branch information
balazs-gerlei authored Nov 14, 2023
2 parents 173385d + 2040c59 commit 4c13df0
Show file tree
Hide file tree
Showing 19 changed files with 637 additions and 875 deletions.
32 changes: 27 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,38 @@
*/

module.exports = {
ignorePatterns: ['node_modules/'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
env: {
'jest': true,
'react-native/react-native': true,
},
plugins: ['@typescript-eslint', 'import', 'react', 'react-native'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:import/typescript',
'prettier',
],
ignorePatterns: ['node_modules/'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import'],
root: true,
settings: {
'import/resolver': {
typescript: true,
},
'react': {
version: 'detect',
},
},
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'import/no-unresolved': 'error',
// this is for sorting WITHIN an import
'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: true }],
Expand Down Expand Up @@ -48,5 +62,13 @@ module.exports = {
},
},
],
'react-native/no-unused-styles': 'error',
'react-native/split-platform-components': 'error',
'react-native/no-inline-styles': 'error',
'react-native/no-color-literals': 'error',
'react-native/no-raw-text': 'error',
'react-native/no-single-element-style-arrays': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
},
};
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ PODS:
- hermes-engine/Pre-built (= 0.72.6)
- hermes-engine/Pre-built (0.72.6)
- libevent (2.1.12)
- NevisMobileAuthentication (3.5.0)
- NevisMobileAuthentication-Debug (3.5.0)
- NevisMobileAuthentication (3.5.1)
- NevisMobileAuthentication-Debug (3.5.1)
- NevisMobileAuthenticationSdkReact (3.5.1):
- NevisMobileAuthentication (~> 3.5.0)
- NevisMobileAuthentication-Debug (~> 3.5.0)
Expand Down Expand Up @@ -713,8 +713,8 @@ SPEC CHECKSUMS:
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 8057e75cfc1437b178ac86c8654b24e7fead7f60
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
NevisMobileAuthentication: dccbc5e620b03030be502e8947cd5db8016ad794
NevisMobileAuthentication-Debug: 05424051bbc36156253ce3a2aeb041b8dfbc4bd9
NevisMobileAuthentication: 02c5e19e6bc5cbb4137270cd1438faf4e1e1e991
NevisMobileAuthentication-Debug: 08dfda6740b4aff50a2f63e2ca87404392cec94f
NevisMobileAuthenticationSdkReact: 16aefe5f8545c3d51b3a5ebbcce725218519841d
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
76EA5583CFB9A27E8DB2C148 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 937F514BF1F68AD180312238 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
97693AB7E66F390280F129CB /* libPods-nevis_mobile_authentication_sdk_example_app_react.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E1ED118B54345C39106A202B /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */; };
CBB8FB339F5833D866106DF8 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB52E7895CE414AA070B9D5 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */; };
E55AEA8EA594A1EDC0DA985D /* libPods-nevis_mobile_authentication_sdk_example_app_react.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AB4A54B4C09056304177F39 /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -38,28 +38,28 @@
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = nevis_mobile_authentication_sdk_example_app_react/main.m; sourceTree = "<group>"; };
2EA92124461BAE3009C4CBD5 /* Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.release.xcconfig"; path = "Target Support Files/Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests/Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.release.xcconfig"; sourceTree = "<group>"; };
3F9D222F4AE5FB29D37FDE58 /* Pods-nevis_mobile_authentication_sdk_example_app_react.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nevis_mobile_authentication_sdk_example_app_react.release.xcconfig"; path = "Target Support Files/Pods-nevis_mobile_authentication_sdk_example_app_react/Pods-nevis_mobile_authentication_sdk_example_app_react.release.xcconfig"; sourceTree = "<group>"; };
4AB4A54B4C09056304177F39 /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-nevis_mobile_authentication_sdk_example_app_react.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = nevis_mobile_authentication_sdk_example_app_react/LaunchScreen.storyboard; sourceTree = "<group>"; };
937F514BF1F68AD180312238 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C85B32E9BAE5B4719BF858BA /* Pods-nevis_mobile_authentication_sdk_example_app_react.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nevis_mobile_authentication_sdk_example_app_react.debug.xcconfig"; path = "Target Support Files/Pods-nevis_mobile_authentication_sdk_example_app_react/Pods-nevis_mobile_authentication_sdk_example_app_react.debug.xcconfig"; sourceTree = "<group>"; };
E1ED118B54345C39106A202B /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-nevis_mobile_authentication_sdk_example_app_react.a"; sourceTree = BUILT_PRODUCTS_DIR; };
EC6EB560E7A047E988D5963F /* Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.debug.xcconfig"; path = "Target Support Files/Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests/Pods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.debug.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
FCB52E7895CE414AA070B9D5 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
00E356EB1AD99517003FC87E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
76EA5583CFB9A27E8DB2C148 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a in Frameworks */,
CBB8FB339F5833D866106DF8 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
97693AB7E66F390280F129CB /* libPods-nevis_mobile_authentication_sdk_example_app_react.a in Frameworks */,
E55AEA8EA594A1EDC0DA985D /* libPods-nevis_mobile_authentication_sdk_example_app_react.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -100,8 +100,8 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
E1ED118B54345C39106A202B /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */,
937F514BF1F68AD180312238 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */,
4AB4A54B4C09056304177F39 /* libPods-nevis_mobile_authentication_sdk_example_app_react.a */,
FCB52E7895CE414AA070B9D5 /* libPods-nevis_mobile_authentication_sdk_example_app_react-nevis_mobile_authentication_sdk_example_app_reactTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/runtime": "^7.23.2",
"@react-native/eslint-config": "^0.74.0",
"@react-native/metro-config": "^0.74.0",
"@react-native-community/cli": "^11.3.10",
"@tsconfig/react-native": "^3.0.2",
Expand All @@ -51,10 +50,12 @@
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"babel-jest": "^29.7.0",
"eslint": "^8.52.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-native": "^4.1.0",
"jest": "29.7.0",
"metro-react-native-babel-preset": "0.76.8",
"pod-install": "0.1.39",
Expand Down
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';

import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

Expand Down
4 changes: 2 additions & 2 deletions src/components/CloseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';
import { memo } from 'react';
import { Text, TouchableOpacity } from 'react-native';

import { useDynamicValue } from 'react-native-dynamic';
Expand All @@ -18,4 +18,4 @@ function CloseButton({ onPress }: { onPress: () => void }) {
);
}

export default React.memo(CloseButton);
export default memo(CloseButton);
4 changes: 2 additions & 2 deletions src/components/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';
import { memo } from 'react';
import { type KeyboardTypeOptions, TextInput } from 'react-native';

import { useDynamicValue } from 'react-native-dynamic';
Expand Down Expand Up @@ -30,4 +30,4 @@ function InputField({
);
}

export default React.memo(InputField);
export default memo(InputField);
4 changes: 2 additions & 2 deletions src/components/OutlinedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';
import { memo } from 'react';
import { Text, TouchableOpacity } from 'react-native';

import { useDynamicValue } from 'react-native-dynamic';
Expand All @@ -18,4 +18,4 @@ function OutlinedButton({ text, onPress }: { text: string; onPress: () => void }
);
}

export default React.memo(OutlinedButton);
export default memo(OutlinedButton);
2 changes: 1 addition & 1 deletion src/screens/AuthCloudApiRegistrationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/DeviceInformationChangeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

import { type NativeStackScreenProps } from '@react-navigation/native-stack';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback, useEffect } from 'react';
import { useCallback, useEffect } from 'react';
import { Linking, SafeAreaView, ScrollView, Text, View } from 'react-native';

import { useFocusEffect } from '@react-navigation/native';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/PinScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/ReadQrCodeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { Platform, SafeAreaView, StyleSheet, Text, View } from 'react-native';

import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/ResultScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

import { type NativeStackScreenProps } from '@react-navigation/native-stack';
Expand Down
1 change: 0 additions & 1 deletion src/screens/SelectAccountScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';
import { FlatList, SafeAreaView, Text, TouchableOpacity, View } from 'react-native';

import { type NativeStackScreenProps } from '@react-navigation/native-stack';
Expand Down
1 change: 0 additions & 1 deletion src/screens/SelectAuthenticatorScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React from 'react';
import { FlatList, SafeAreaView, Text, TouchableOpacity, View } from 'react-native';

import { type NativeStackScreenProps } from '@react-navigation/native-stack';
Expand Down
6 changes: 3 additions & 3 deletions src/screens/TransactionConfirmationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, Text, View } from 'react-native';

import { type NativeStackScreenProps } from '@react-navigation/native-stack';
Expand All @@ -24,11 +24,11 @@ const TransactionConfirmationScreen = ({ route }: Props) => {

const onConfirm = useCallback(async () => {
await confirm(route.params.selectedUsername, route.params.accountSelectionHandler);
}, []);
}, [route.params.selectedUsername, route.params.accountSelectionHandler]);

const onCancel = useCallback(async () => {
await cancel(route.params.accountSelectionHandler);
}, []);
}, [route.params.accountSelectionHandler]);

return (
<SafeAreaView style={styles.container}>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/UsernamePasswordLoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/

import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { SafeAreaView, ScrollView, Text, View } from 'react-native';

import { useTranslation } from 'react-i18next';
Expand Down
Loading

0 comments on commit 4c13df0

Please sign in to comment.