Skip to content

Commit

Permalink
feat(deps): update eslint-plugin-jest to latest
Browse files Browse the repository at this point in the history
Fixes #183
  • Loading branch information
AndreaPontrandolfo committed Aug 14, 2024
1 parent 9a66082 commit a213c03
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 87 deletions.
2 changes: 1 addition & 1 deletion apps/sheriff-webservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-fsecond": "^1.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-lodash-f": "^7.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-fsecond": "^1.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-lodash-f": "^7.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-sheriff/src/getExportableConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const getExportableConfig = (

if (userConfigChoices.jest) {
exportableConfig.push(
getJestConfig(userConfigChoices.pathsOverrides?.tests),
...getJestConfig(userConfigChoices.pathsOverrides?.tests),
);
}

Expand Down
16 changes: 6 additions & 10 deletions packages/eslint-config-sheriff/src/getJestConfig.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import jest from 'eslint-plugin-jest';
import tseslint from 'typescript-eslint';
import { allJsExtensions } from '@sherifforg/constants';
import { jestHandPickedRules } from './handpickedRules/jestHandPickedRules';

export const getJestConfig = (pathsOverrides?: string[]) => {
return {
return tseslint.config({
files: pathsOverrides ?? [
`**/*.{test,spec}.{${allJsExtensions}}`,
`**/tests/**/*.{${allJsExtensions}}`,
`**/__tests__/**/*.{${allJsExtensions}}`,
],
plugins: {
jest,
},
languageOptions: {
globals: jest.environments.globals.globals,
},
extends: jest.configs['flat/style'],
// @ts-expect-error
rules: {
...jest.configs.style.rules,
...jestHandPickedRules,
'@typescript-eslint/unbound-method': 0, // see reference: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
'@typescript-eslint/unbound-method': 0,
},
};
});
};
Loading

0 comments on commit a213c03

Please sign in to comment.