Skip to content

Commit

Permalink
add: jest plugin in eslint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
alecorvec committed Nov 7, 2024
1 parent f58619b commit 573c6e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@ import pluginJs from "@eslint/js";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";

import pluginJest from 'eslint-plugin-jest';

export default [
{
files: ["**/*.{js,mjs,cjs,jsx}"],
plugins: { jest: pluginJest },
languageOptions: {
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
languageOptions: {
ecmaVersion: 2021,
sourceType: "module",
parserOptions: {
ecmaFeatures: { jsx: true },
},
globals: {
...pluginJest.environments.globals.globals,
...globals.node,
...globals.browser,
},
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@eslint/compat": "^1.1.0",
"@testing-library/user-event": "^13.5.0",
"bcryptjs-react": "^2.4.6",
"eslint-plugin-jest": "^25.7.0",
"react": "^18.3.1",
"react-calculator-component": "^1.0.0",
"react-dom": "^18.3.1",
Expand Down

0 comments on commit 573c6e0

Please sign in to comment.