Ryu Kent
Ryu Kent

Reputation: 701

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:

TypeError: Cannot read property 'meta' of undefined

  1. Create new react native project using react-native CLI
  2. Install eslint and run ./node_modules/.bin/eslint --init
  3. Install eslint-plugin-jest
  4. Add jest to the plugin array in .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

[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)

Upvotes: 1

Views: 1037

Answers (1)

Ryu Kent
Ryu Kent

Reputation: 701

This was a temporary issue in 22.6 up to 22.6.2. It has now been fixed in 22.6.3 released today. Just need to update the package.

Upvotes: 1

Related Questions