fix vulns and linting
This commit is contained in:
Родитель
2c2183da5e
Коммит
57230beb2a
|
@ -48,12 +48,12 @@
|
|||
"@babel/core": "^7.12.9",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@react-native-community/eslint-config": "^3.1.0",
|
||||
"@types/react-native": "^0.67.4",
|
||||
"@types/react-native": "^0.68.10",
|
||||
"@types/react-native-charts-wrapper": "^0.5.2",
|
||||
"@types/react-native-torch": "^1.1.0",
|
||||
"@types/react-native-version-check": "^3.4.4",
|
||||
"babel-jest": "^26.6.3",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"babel-plugin-module-resolver": "^5.0.0",
|
||||
"eslint": "^8.26.0",
|
||||
"jest": "^26.6.3",
|
||||
"metro-react-native-babel-preset": "^0.67.0",
|
||||
|
@ -4700,9 +4700,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/react-native": {
|
||||
"version": "0.67.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.17.tgz",
|
||||
"integrity": "sha512-HYo9XbYPwyf5L7FWhRjawbDQ4ma5k/bEzxrpDjG2olwLbXR/IR5ZghCmUUIcEtHB9KDg0QIAs+WriddtOKVmFg==",
|
||||
"version": "0.68.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.68.10.tgz",
|
||||
"integrity": "sha512-BFmi9wERGJutVg0rgkS63gV2w8yPoug2PeF3SmeOkW3c5TbfFLI74iPpAMu/wxcJSnlEuwkMp6RXatZZe8fulg==",
|
||||
"dependencies": {
|
||||
"@types/react": "^17"
|
||||
}
|
||||
|
@ -5570,19 +5570,59 @@
|
|||
}
|
||||
},
|
||||
"node_modules/babel-plugin-module-resolver": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.1.0.tgz",
|
||||
"integrity": "sha512-MlX10UDheRr3lb3P0WcaIdtCSRlxdQsB1sBqL7W0raF070bGl1HQQq5K3T2vf2XAYie+ww+5AKC/WrkjRO2knA==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.0.tgz",
|
||||
"integrity": "sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"find-babel-config": "^1.2.0",
|
||||
"glob": "^7.1.6",
|
||||
"find-babel-config": "^2.0.0",
|
||||
"glob": "^8.0.3",
|
||||
"pkg-up": "^3.1.0",
|
||||
"reselect": "^4.0.0",
|
||||
"resolve": "^1.13.1"
|
||||
"reselect": "^4.1.7",
|
||||
"resolve": "^1.22.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0.0"
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-module-resolver/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-module-resolver/node_modules/glob": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
||||
"integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^5.0.1",
|
||||
"once": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-module-resolver/node_modules/minimatch": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz",
|
||||
"integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-polyfill-corejs2": {
|
||||
|
@ -8102,25 +8142,25 @@
|
|||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
},
|
||||
"node_modules/find-babel-config": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.2.0.tgz",
|
||||
"integrity": "sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.0.0.tgz",
|
||||
"integrity": "sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"json5": "^0.5.1",
|
||||
"path-exists": "^3.0.0"
|
||||
"json5": "^2.1.1",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/find-babel-config/node_modules/json5": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
|
||||
"integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==",
|
||||
"node_modules/find-babel-config/node_modules/path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"json5": "lib/cli.js"
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/find-cache-dir": {
|
||||
|
@ -13686,6 +13726,7 @@
|
|||
"version": "1.1.1",
|
||||
"inBundle": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.x"
|
||||
}
|
||||
|
@ -13694,6 +13735,7 @@
|
|||
"version": "0.1.1",
|
||||
"inBundle": true,
|
||||
"license": "SEE LICENSE IN epl-v10",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"events": "^1.1.1"
|
||||
}
|
||||
|
@ -20195,9 +20237,9 @@
|
|||
}
|
||||
},
|
||||
"@types/react-native": {
|
||||
"version": "0.67.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.67.17.tgz",
|
||||
"integrity": "sha512-HYo9XbYPwyf5L7FWhRjawbDQ4ma5k/bEzxrpDjG2olwLbXR/IR5ZghCmUUIcEtHB9KDg0QIAs+WriddtOKVmFg==",
|
||||
"version": "0.68.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.68.10.tgz",
|
||||
"integrity": "sha512-BFmi9wERGJutVg0rgkS63gV2w8yPoug2PeF3SmeOkW3c5TbfFLI74iPpAMu/wxcJSnlEuwkMp6RXatZZe8fulg==",
|
||||
"requires": {
|
||||
"@types/react": "^17"
|
||||
}
|
||||
|
@ -20826,16 +20868,49 @@
|
|||
}
|
||||
},
|
||||
"babel-plugin-module-resolver": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.1.0.tgz",
|
||||
"integrity": "sha512-MlX10UDheRr3lb3P0WcaIdtCSRlxdQsB1sBqL7W0raF070bGl1HQQq5K3T2vf2XAYie+ww+5AKC/WrkjRO2knA==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.0.tgz",
|
||||
"integrity": "sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-babel-config": "^1.2.0",
|
||||
"glob": "^7.1.6",
|
||||
"find-babel-config": "^2.0.0",
|
||||
"glob": "^8.0.3",
|
||||
"pkg-up": "^3.1.0",
|
||||
"reselect": "^4.0.0",
|
||||
"resolve": "^1.13.1"
|
||||
"reselect": "^4.1.7",
|
||||
"resolve": "^1.22.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
||||
"integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^5.0.1",
|
||||
"once": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz",
|
||||
"integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"babel-plugin-polyfill-corejs2": {
|
||||
|
@ -22739,19 +22814,19 @@
|
|||
}
|
||||
},
|
||||
"find-babel-config": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.2.0.tgz",
|
||||
"integrity": "sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.0.0.tgz",
|
||||
"integrity": "sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"json5": "^0.5.1",
|
||||
"path-exists": "^3.0.0"
|
||||
"json5": "^2.1.1",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"json5": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
|
||||
"integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==",
|
||||
"path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -26967,11 +27042,13 @@
|
|||
"dependencies": {
|
||||
"events": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true
|
||||
"bundled": true,
|
||||
"peer": true
|
||||
},
|
||||
"react-native-paho-mqtt": {
|
||||
"version": "0.1.1",
|
||||
"bundled": true,
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"events": "^1.1.1"
|
||||
}
|
||||
|
|
|
@ -54,12 +54,12 @@
|
|||
"@babel/core": "^7.12.9",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@react-native-community/eslint-config": "^3.1.0",
|
||||
"@types/react-native": "^0.67.4",
|
||||
"@types/react-native": "^0.68.10",
|
||||
"@types/react-native-charts-wrapper": "^0.5.2",
|
||||
"@types/react-native-torch": "^1.1.0",
|
||||
"@types/react-native-version-check": "^3.4.4",
|
||||
"babel-jest": "^26.6.3",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"babel-plugin-module-resolver": "^5.0.0",
|
||||
"eslint": "^8.26.0",
|
||||
"jest": "^26.6.3",
|
||||
"metro-react-native-babel-preset": "^0.67.0",
|
||||
|
|
|
@ -128,9 +128,11 @@ const Navigation = React.memo(() => {
|
|||
}}>
|
||||
{/* @ts-ignore */}
|
||||
<Stack.Screen name={Pages.ROOT} component={Home} />
|
||||
{/* @ts-ignore */}
|
||||
<Stack.Screen name={Pages.REGISTRATION} component={Registration} />
|
||||
<Stack.Screen
|
||||
name={Pages.INSIGHT}
|
||||
//@ts-ignore
|
||||
component={Chart}
|
||||
options={({route}) => {
|
||||
let data = {};
|
||||
|
|
|
@ -217,7 +217,7 @@ const QRCodeScreen = React.memo<QRCodeScannerProps>(({connect, scannerRef}) => {
|
|||
const {screen, orientation} = useScreenDimensions();
|
||||
const {navigate} =
|
||||
useNavigation<
|
||||
StackNavigationProp<any, typeof screens[keyof typeof screens]>
|
||||
StackNavigationProp<any, (typeof screens)[keyof typeof screens]>
|
||||
>();
|
||||
|
||||
const onRead = useCallback(
|
||||
|
|
|
@ -33,7 +33,7 @@ interface ButtonGroupProps {
|
|||
const ButtonGroup = React.memo<ButtonGroupProps>(
|
||||
({items, onCheckedChange, defaultCheckedId, readonly, containerStyle}) => {
|
||||
const ids = items.map(i => i.id);
|
||||
const [checked, setChecked] = React.useState<typeof ids[number]>(
|
||||
const [checked, setChecked] = React.useState<(typeof ids)[number]>(
|
||||
defaultCheckedId ?? ids[0],
|
||||
);
|
||||
return (
|
||||
|
|
|
@ -22,4 +22,4 @@ export const AVAILABLE_PROPERTIES = {
|
|||
};
|
||||
|
||||
export type PropertyNames =
|
||||
typeof AVAILABLE_PROPERTIES[keyof typeof AVAILABLE_PROPERTIES];
|
||||
(typeof AVAILABLE_PROPERTIES)[keyof typeof AVAILABLE_PROPERTIES];
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
SensorTypes,
|
||||
} from 'react-native-sensors';
|
||||
import EventEmitter from 'events';
|
||||
import { Platform } from 'react-native';
|
||||
import {Platform} from 'react-native';
|
||||
|
||||
export default class Accelerometer extends EventEmitter implements ISensor {
|
||||
private enabled: boolean;
|
||||
|
@ -76,7 +76,7 @@ export default class Accelerometer extends EventEmitter implements ISensor {
|
|||
};
|
||||
}
|
||||
|
||||
return { x, y, z };
|
||||
return {x, y, z};
|
||||
}
|
||||
|
||||
async run() {
|
||||
|
@ -100,7 +100,11 @@ export default class Accelerometer extends EventEmitter implements ISensor {
|
|||
} else {
|
||||
this.currentRun = accelerometer.subscribe(
|
||||
function (this: Accelerometer, {x, y, z}: Vector) {
|
||||
this.emit(DATA_AVAILABLE_EVENT, this.id, this.getNormalizedData(x, y, z));
|
||||
this.emit(
|
||||
DATA_AVAILABLE_EVENT,
|
||||
this.id,
|
||||
this.getNormalizedData(x, y, z),
|
||||
);
|
||||
}.bind(this),
|
||||
function (this: Accelerometer, error: any) {
|
||||
if (error) {
|
||||
|
|
|
@ -27,7 +27,7 @@ export const AVAILABLE_SENSORS = {
|
|||
};
|
||||
|
||||
export type SensorNames =
|
||||
typeof AVAILABLE_SENSORS[keyof typeof AVAILABLE_SENSORS];
|
||||
(typeof AVAILABLE_SENSORS)[keyof typeof AVAILABLE_SENSORS];
|
||||
export {
|
||||
DATA_AVAILABLE_EVENT,
|
||||
SENSOR_UNAVAILABLE_EVENT,
|
||||
|
|
|
@ -57,8 +57,8 @@ export type valueof<T> = T[keyof T];
|
|||
*/
|
||||
export type Ref<T> = React.RefObject<T>;
|
||||
|
||||
export type ScreenNames = typeof Screens[keyof typeof Screens];
|
||||
export type PagesNames = typeof Pages[keyof typeof Pages];
|
||||
export type ScreenNames = (typeof Screens)[keyof typeof Screens];
|
||||
export type PagesNames = (typeof Pages)[keyof typeof Pages];
|
||||
/**
|
||||
* Defines type of screens
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче