Files
meeting-room/frontend/node_modules/eslint-plugin-jest/docs/rules/unbound-method.md
flying-hero 96f6318101 📦 添加虚拟环境和启动脚本
新增:
- backend/venv/ - Python 虚拟环境
- backend/start.sh - 启动脚本(使用虚拟环境)
- backend/requirements.txt - 依赖列表
- .gitignore - 忽略虚拟环境和缓存文件

说明:
- 每个项目使用独立虚拟环境
- 避免依赖冲突
- 启动脚本自动创建和激活虚拟环境
2026-04-04 18:29:02 +08:00

1.5 KiB

Enforces unbound methods are called with their expected scope (unbound-method)

Rule Details

This rule extends the base @typescript-eslint/unbound-method rule, meaning you must depend on @typescript-eslint/eslint-plugin for it to work. It adds support for understanding when it's ok to pass an unbound method to expect calls.

See the @typescript-eslint documentation for more details on the unbound-method rule.

Note that while this rule requires type information to work, it will fail silently when not available allowing you to safely enable it on projects that are not using TypeScript.

How to use

{
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    ecmaVersion: 2020,
    sourceType: 'module',
  },
  overrides: [
    {
      files: ['test/**'],
      plugins: ['jest'],
      rules: {
        // you should turn the original rule off *only* for test files
        '@typescript-eslint/unbound-method': 'off',
        'jest/unbound-method': 'error',
      },
    },
  ],
  rules: {
    '@typescript-eslint/unbound-method': 'error',
  },
}

This rule should be applied to your test files in place of the original rule, which should be applied to the rest of your codebase.

Options

See @typescript-eslint/unbound-method options.

Taken with ❤️ from @typescript-eslint core