简体   繁体   English

eslint-plugin-jest给出“ESLint堆栈跟踪:TypeError:无法读取未定义的属性'meta'”

[英]eslint-plugin-jest gives “ESLint stack trace: TypeError: Cannot read property 'meta' of undefined”

When adding the jest plugin to .eslintrc.js , I get the following stack error: jest插件添加到.eslintrc.js ,我收到以下堆栈错误:

TypeError: Cannot read property 'meta' of undefined

  1. Create new react native project using react-native CLI 使用react-native CLI创建新的react本机项目
  2. Install eslint and run ./node_modules/.bin/eslint --init 安装eslint并运行./node_modules/.bin/eslint --init
  3. Install eslint-plugin-jest 安装eslint-plugin-jest
  4. Add jest to the plugin array in .eslintrc.js .eslintrc.js为插件数组添加jest

.eslintrc.js .eslintrc.js

module.exports = {
  env: {
    browser: true,
    es6: true
  },
  extends: ["standard", "plugin:jest/recommended"],
  globals: {
    Atomics: "readonly",
    SharedArrayBuffer: "readonly"
  },
  parserOptions: {
    ecmaFeatures: {
      jsx: true
    },
    ecmaVersion: 2018,
    sourceType: "module"
  },
  plugins: ["react", "jest"],
  rules: {}
};

I expect that eslint picks up the eslint-plugin-jest plugin, but instead I get 我希望eslint能够获得eslint-plugin-jest插件,但我得到了

[Error - 18:38:16] ESLint stack trace:
[Error - 18:38:16] TypeError: Cannot read property 'meta' of undefined
    at c.isFunction.H.handled.has.p.getRules.forEach (/home/bob/.vscode/extensions/dbaeumer.vscode-eslint-1.9.0/server/out/eslintServer.js:1:55431)
    at Map.forEach (<anonymous>)
    at /home/bob/.vscode/extensions/dbaeumer.vscode-eslint-1.9.0/server/out/eslintServer.js:1:55413
    at W.E.get.N.then.n (/home/bob/.vscode/extensions/dbaeumer.vscode-eslint-1.9.0/server/out/eslintServer.js:1:55555)

This was a temporary issue in 22.6 up to 22.6.2. 这是22.6至22.6.2的临时问题。 It has now been fixed in 22.6.3 released today. 它现已在今天发布的22.6.3中得到修复。 Just need to update the package. 只需要更新包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型错误:无法读取未定义的属性“eslint” - TypeError: Cannot read property 'eslint' of undefined chrome扩展:堆栈跟踪:TypeError:无法读取未定义的属性“selectedtext” - chrome extension: Stack trace: TypeError: Cannot read property 'selectedtext' of undefined Jest - 测试给出错误类型错误:无法读取未定义的属性“then” - Jest - Test gives an error TypeError: Cannot read property 'then' of undefined JEST TypeError:无法读取未定义的属性“json” - JEST TypeError: Cannot read property 'json' of undefined 开玩笑-TypeError:无法读取未定义的属性“项目” - Jest - TypeError: Cannot read property 'projects' of undefined 开玩笑:TypeError:无法读取未定义的属性“长度” - Jest : TypeError: Cannot read property 'length' of undefined TypeError:无法读取未定义的 Jest 和 Nest 的属性“then” - TypeError: Cannot read property 'then' of undefined Jest and Nest JEST - TypeError:无法读取未定义的属性“then” - JEST - TypeError: Cannot read property 'then' of undefined Jest - TypeError:无法读取未定义的属性“fn” - Jest - TypeError: Cannot read property 'fn' of undefined Jest TypeError:无法读取未定义的属性“id” - Jest TypeError: Cannot read property 'id' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM