Skip to content

Commit

Permalink
chore: linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tompsota committed Oct 31, 2024
1 parent 59044eb commit 84ac287
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"build": "react-scripts build",
"verify": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"eslint": "eslint . --ext ts,.tsx.js.jsx",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
"typecheck": "tsc --noEmit",
"test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { IonApp, setupIonicReact } from '@ionic/react';
import MalwareDetectionDemo from './pages/FreeRaspDemo';
import MalwareDetectionDemo from './pages/MalwareDetectionDemo';

import { startFreeRASP, SuspiciousAppInfo } from 'capacitor-freerasp';

Expand Down
4 changes: 2 additions & 2 deletions src/components/ConfigModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import './ConfigModal.css';

const ConfigModal: React.FC<{
visible: boolean;
onClose: () => any;
onClose: () => void;
}> = ({ visible, onClose }) => {
return (
<IonModal isOpen={visible} className="modal-container">
Expand Down Expand Up @@ -59,7 +59,7 @@ const ConfigModal: React.FC<{
</IonItem>
<div className="option-text-extra">
{config.androidConfig.malwareConfig.blocklistedPermissions.map(
(permissionGroup: string[], index: number) => (
(permissionGroup: string[]) => (
<>
<p>{'['}</p>
{permissionGroup.map((permission, permIndex) => (
Expand Down
3 changes: 3 additions & 0 deletions src/components/MalwareItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ export const MalwareItem: React.FC<{ app: SuspiciousAppInfo }> = ({ app }) => {
const whitelistApp = async (packageName: string) => {
try {
const whitelistResponse = await addToWhitelist(packageName);
// eslint-disable-next-line no-console
console.info(
`Malware Whitelist response for ${app}: ${whitelistResponse}`,
);
alert('Restart app for whitelist to take effect');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
// eslint-disable-next-line no-console
console.info('Error while adding app to malware whitelist: ', error);
}
};
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import TalsecLogo from '../assets/talsec-logo.png';
import './FreeRaspDemo.css';
import './MalwareDetectionDemo.css';
import '../theme/variables.css';
import { IonHeader, IonImg, IonTitle, IonToolbar } from '@ionic/react';

Expand All @@ -25,10 +25,12 @@ const MalwareDetectionDemo: React.FC<{
appsToWhitelist.map(async app => {
try {
const whitelistResponse = await addToWhitelist(app);
// eslint-disable-next-line no-console
console.info(
`${app} stored to Malware Whitelist: ${whitelistResponse}`,
);
} catch (error) {
// eslint-disable-next-line no-console
console.info('Malware whitelist failed: ', error);
}
}),
Expand Down

0 comments on commit 84ac287

Please sign in to comment.