diff --git a/.eslintrc.js b/.eslintrc.js index 7dff5e0..95efa66 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,10 +5,11 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended', + 'plugin:jest/recommended', 'prettier' ], parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'react', 'react-hooks'], + plugins: ['@typescript-eslint', 'react', 'react-hooks', 'jest'], env: { browser: true, es2021: true, @@ -24,6 +25,11 @@ module.exports = { 'react/react-in-jsx-scope': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'warn', - '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }] + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'jest/expect-expect': 'warn', + 'jest/no-disabled-tests': 'warn', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + 'jest/valid-expect': 'error' } }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6983b26..dc6a2a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@typescript-eslint/parser": "^6.21.0", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^28.10.0", "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^5.1.0", "husky": "^8.0.3", @@ -9946,6 +9947,32 @@ "node": "*" } }, + "node_modules/eslint-plugin-jest": { + "version": "28.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.10.0.tgz", + "integrity": "sha512-hyMWUxkBH99HpXT3p8hc7REbEZK3D+nk8vHXGgpB+XXsi0gO4PxMSP+pjfUzb67GnV9yawV9a53eUmcde1CCZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "engines": { + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "jest": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", diff --git a/package.json b/package.json index ff6e2af..5106434 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@typescript-eslint/parser": "^6.21.0", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^28.10.0", "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^5.1.0", "husky": "^8.0.3",