Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jest-community/eslint-plugin-jest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v28.6.0
Choose a base ref
...
head repository: jest-community/eslint-plugin-jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v28.7.0
Choose a head ref
  • 19 commits
  • 12 files changed
  • 4 contributors

Commits on Jun 8, 2024

  1. ci: don't warn on unsupported typescript versions (#1607)

    G-Rath authored Jun 8, 2024
    Copy the full SHA
    b9a60a9 View commit details

Commits on Jun 10, 2024

  1. chore(deps): lock file maintenance

    renovate[bot] committed Jun 10, 2024
    1
    Copy the full SHA
    de442c6 View commit details
  2. Copy the full SHA
    0f9adcb View commit details

Commits on Jun 17, 2024

  1. chore(deps): lock file maintenance

    renovate[bot] committed Jun 17, 2024
    Copy the full SHA
    bd1b397 View commit details

Commits on Jun 21, 2024

  1. chore(deps): update yarn to v3.8.3 (#1618)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jun 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    202fefd View commit details

Commits on Jun 24, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5958a00 View commit details

Commits on Jul 1, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e496de5 View commit details

Commits on Jul 6, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    209e8f3 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6659a79 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    80f6397 View commit details
  4. chore(deps): update danger/danger-js action to v12.3.3 (#1617)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5573628 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    46d2b6a View commit details

Commits on Jul 8, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1bf3691 View commit details

Commits on Jul 15, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    61eb794 View commit details

Commits on Jul 22, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b38f0fa View commit details

Commits on Jul 29, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9854c8f View commit details

Commits on Aug 2, 2024

  1. Copy the full SHA
    1bc83b9 View commit details

Commits on Aug 3, 2024

  1. feat: allow @typescript-eslint v8 (#1636)

    * feat: allow `@typescript-eslint` v8
    
    * ci: test against `@typescript-eslint/utils` v8
    
    * chore: handle different rule names depending on `@typescript-eslint/eslint-plugin` version
    
    * test: only run `unbound-method` cases when using `@typescript-eslint` v7
    G-Rath authored Aug 3, 2024
    Copy the full SHA
    fb43171 View commit details
  2. Copy the full SHA
    1cd8c74 View commit details
Showing with 1,210 additions and 1,223 deletions.
  1. +30 −7 .eslintrc.js
  2. +1 −1 .github/workflows/lint.yml
  3. +7 −1 .github/workflows/nodejs.yml
  4. +181 −181 .yarn/releases/{yarn-3.8.2.cjs → yarn-3.8.3.cjs}
  5. +1 −1 .yarnrc.yml
  6. +7 −0 CHANGELOG.md
  7. +10 −10 jest.config.ts
  8. +5 −5 package.json
  9. +1 −1 src/rules/__tests__/test-utils.ts
  10. +1 −1 src/rules/prefer-jest-mocked.ts
  11. +2 −1 tsconfig.json
  12. +964 −1,014 yarn.lock
37 changes: 30 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
'use strict';

const {
version: typescriptESLintPluginVersion,
} = require('@typescript-eslint/eslint-plugin/package.json');
const semver = require('semver');
const globals = require('./src/globals.json');

const typescriptBanTypesRules = () => {
if (semver.major(typescriptESLintPluginVersion) === 8) {
return {
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',
};
}

return {
'@typescript-eslint/ban-types': 'error',
};
};

module.exports = {
parser: require.resolve('@typescript-eslint/parser'),
extends: [
'plugin:eslint-plugin/recommended',
'plugin:eslint-comments/recommended',
'plugin:@eslint-community/eslint-comments/recommended',
'plugin:n/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:prettier/recommended',
],
plugins: [
'eslint-plugin',
'eslint-comments',
'@eslint-community/eslint-comments',
'n',
'import',
'@typescript-eslint',
],
parserOptions: {
ecmaVersion: 2018,
warnOnUnsupportedTypeScriptVersion: false,
},
env: {
node: true,
@@ -28,15 +47,15 @@ module.exports = {
rules: {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
...typescriptBanTypesRules(),
'@typescript-eslint/consistent-type-imports': [
'error',
{ disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'eslint-comments/no-unused-disable': 'error',
'@eslint-community/eslint-comments/no-unused-disable': 'error',
'eslint-plugin/require-meta-docs-description': [
'error',
{ pattern: '^(Enforce|Require|Disallow|Suggest|Prefer)' },
@@ -46,8 +65,12 @@ module.exports = {
'no-negated-condition': 'error',
eqeqeq: ['error', 'smart'],
strict: 'error',
'prefer-template': 'warn',
'object-shorthand': ['warn', 'always', { avoidExplicitReturnArrows: true }],
'prefer-template': 'error',
'object-shorthand': [
'error',
'always',
{ avoidExplicitReturnArrows: true },
],
'prefer-destructuring': [
'error',
{ VariableDeclarator: { array: true, object: true } },
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -29,6 +29,6 @@ jobs:
with:
persist-credentials: false
- name: Danger
uses: danger/danger-js@12.3.1
uses: danger/danger-js@12.3.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -73,17 +73,23 @@ jobs:
matrix:
node-version: [16.x, 18.x, 20.x, 21.x, 22.x]
eslint-version: [7, 8, 9]
ts-eslint-plugin-version: [6, 7]
ts-eslint-plugin-version: [6, 7, 8]
exclude:
# ts-eslint/plugin@7 doesn't support node@16
- node-version: 16.x
ts-eslint-plugin-version: 7
# ts-eslint/plugin@8 doesn't support node@16
- node-version: 16.x
ts-eslint-plugin-version: 8
# eslint@9 doesn't support node@16
- node-version: 16.x
eslint-version: 9
# ts-eslint/plugin@7 doesn't support eslint@7
- eslint-version: 7
ts-eslint-plugin-version: 7
# ts-eslint/plugin@8 doesn't support eslint@7
- eslint-version: 7
ts-eslint-plugin-version: 8
runs-on: ubuntu-latest

steps:
362 changes: 181 additions & 181 deletions .yarn/releases/yarn-3.8.2.cjs → .yarn/releases/yarn-3.8.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'

yarnPath: .yarn/releases/yarn-3.8.2.cjs
yarnPath: .yarn/releases/yarn-3.8.3.cjs
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [28.7.0](https://github.com/jest-community/eslint-plugin-jest/compare/v28.6.0...v28.7.0) (2024-08-03)


### Features

* allow `[@typescript-eslint](https://github.com/typescript-eslint)` v8 ([#1636](https://github.com/jest-community/eslint-plugin-jest/issues/1636)) ([fb43171](https://github.com/jest-community/eslint-plugin-jest/commit/fb43171a150922524744194e023841af12b3f76b))

# [28.6.0](https://github.com/jest-community/eslint-plugin-jest/compare/v28.5.0...v28.6.0) (2024-06-06)


20 changes: 10 additions & 10 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -42,17 +42,17 @@ if (semver.major(eslintVersion) !== 8) {
config.projects = config.projects.filter(
({ displayName }) => displayName !== 'lint',
);
}

// jest/unbound-method doesn't work when using @typescript-eslint v6
if (semver.major(typescriptESLintPluginVersion) === 6) {
for (const project of config.projects) {
project.testPathIgnorePatterns.push(
'<rootDir>/src/rules/__tests__/unbound-method.test.ts',
);
project.coveragePathIgnorePatterns.push(
'<rootDir>/src/rules/unbound-method.ts',
);
}
// jest/unbound-method seems to only be happy with @typescript-eslint v7 right now...
if (semver.major(typescriptESLintPluginVersion) !== 7) {
for (const project of config.projects) {
project.testPathIgnorePatterns.push(
'<rootDir>/src/rules/__tests__/unbound-method.test.ts',
);
project.coveragePathIgnorePatterns.push(
'<rootDir>/src/rules/unbound-method.ts',
);
}
}

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-jest",
"version": "28.6.0",
"version": "28.7.0",
"description": "ESLint rules for Jest",
"keywords": [
"eslint",
@@ -58,7 +58,7 @@
]
},
"dependencies": {
"@typescript-eslint/utils": "^6.0.0 || ^7.0.0"
"@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
@@ -67,6 +67,7 @@
"@babel/preset-typescript": "^7.3.3",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
"@schemastore/package": "^0.0.10",
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/git": "^10.0.0",
@@ -83,7 +84,6 @@
"eslint": "^7.0.0 || ^8.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-doc-generator": "^1.0.0",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-eslint-plugin": "^6.0.0",
"eslint-plugin-import": "^2.25.1",
"eslint-plugin-n": "^17.0.0",
@@ -106,7 +106,7 @@
"typescript": "^5.0.4"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0",
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
"jest": "*"
},
@@ -118,7 +118,7 @@
"optional": true
}
},
"packageManager": "yarn@3.8.2",
"packageManager": "yarn@3.8.3",
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
},
2 changes: 1 addition & 1 deletion src/rules/__tests__/test-utils.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export class FlatCompatRuleTester extends TSESLint.RuleTester {

public override run<
TMessageIds extends string,
TOptions extends Readonly<unknown[]>,
TOptions extends readonly unknown[],
>(
ruleName: string,
rule: TSESLint.RuleModule<TMessageIds, TOptions>,
2 changes: 1 addition & 1 deletion src/rules/prefer-jest-mocked.ts
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ export default createRule({
);

context.report({
node: node,
node,
messageId: 'useJestMocked',
fix(fixer) {
return fixer.replaceText(node, `jest.mocked(${fnName})`);
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"skipLibCheck": false
// todo: required due to @typescript-eslint v7 - disable in new major
"skipLibCheck": true
},
"files": ["eslint-remote-tester.config.ts"],
"include": ["src/**/*"],
1,978 changes: 964 additions & 1,014 deletions yarn.lock

Large diffs are not rendered by default.