diff --git a/.eslintrc.js b/.eslintrc.js index 9dd57a7..5d4943a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { root: true, extends: '@react-native', parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], + plugins: ['jest', '@typescript-eslint'], overrides: [ { files: ['*.ts', '*.tsx'], diff --git a/package.json b/package.json index ad1504c..37b97ff 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "babel-jest": "^29.6.3", "dotenv-cli": "^7.2.1", "eslint": "^8.19.0", + "eslint-plugin-jest": "^28.6.0", "jest": "^29.2.1", "prettier": "^2.8.8", "react-native-svg-app-icon": "^0.6.1", diff --git a/src/components/settings/SettingRange.tsx b/src/components/settings/SettingRange.tsx index 42be3c1..315c89d 100644 --- a/src/components/settings/SettingRange.tsx +++ b/src/components/settings/SettingRange.tsx @@ -3,12 +3,13 @@ // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import React, {useCallback} from 'react'; import {StyleSheet, Text} from 'react-native'; import SettingItem from './SettingItem'; import Slider from '@react-native-community/slider'; import debounce from 'lodash/debounce'; -import {useCallback} from 'react'; type Props = { title: string; @@ -30,6 +31,7 @@ const propDefaults = { }; const SettingRange = (props: Props) => { + // eslint-disable-next-line react-hooks/exhaustive-deps const onValueChange = useCallback( debounce(props.onValueChange, 25, {leading: true, trailing: true}), [props.onValueChange], diff --git a/yarn.lock b/yarn.lock index cdb2830..8c638a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,7 +3738,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:7.17.0": +"@typescript-eslint/utils@npm:7.17.0, @typescript-eslint/utils@npm:^6.0.0 || ^7.0.0": version: 7.17.0 resolution: "@typescript-eslint/utils@npm:7.17.0" dependencies: @@ -4355,6 +4355,7 @@ __metadata: babel-jest: ^29.6.3 dotenv-cli: ^7.2.1 eslint: ^8.19.0 + eslint-plugin-jest: ^28.6.0 jest: ^29.2.1 lodash: ^4.17.21 prettier: ^2.8.8 @@ -5721,6 +5722,24 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-jest@npm:^28.6.0": + version: 28.6.0 + resolution: "eslint-plugin-jest@npm:28.6.0" + dependencies: + "@typescript-eslint/utils": ^6.0.0 || ^7.0.0 + peerDependencies: + "@typescript-eslint/eslint-plugin": ^6.0.0 || ^7.0.0 + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + jest: "*" + peerDependenciesMeta: + "@typescript-eslint/eslint-plugin": + optional: true + jest: + optional: true + checksum: 5abcef6933445ae0017dcea6cafacb4aaab6619f8660d1097667dd040129b4efa3f1284ded1c2605c7d14c11c976c725912f660dcdec8278c6f6ce793ff9dab6 + languageName: node + linkType: hard + "eslint-plugin-prettier@npm:^4.2.1": version: 4.2.1 resolution: "eslint-plugin-prettier@npm:4.2.1"