Skip to content

Commit

Permalink
feat(ts): enable jest/unbound-method (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanminkian committed Dec 15, 2022
1 parent 559f5f4 commit 2ad3503
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/typescript/index.js
Expand Up @@ -51,6 +51,15 @@ module.exports = {
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/unbound-method': 'error',
},
}, {
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
files: ['**/__tests__/**/*.ts', '**/*.spec.ts', '**/*.test.ts'],
plugins: ['jest'],
rules: {
// you should turn the original rule off *only* for test files
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
}],
),
rules: {
Expand Down
3 changes: 2 additions & 1 deletion packages/typescript/package.json
Expand Up @@ -19,7 +19,8 @@
"dependencies": {
"@antfu/eslint-config-basic": "workspace:*",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0"
"@typescript-eslint/parser": "^5.46.0",
"eslint-plugin-jest": "^27.1.6"
},
"devDependencies": {
"eslint": "^8.29.0"
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 2ad3503

Please sign in to comment.