Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest-runner-eslint disagreeing with command line eslint and editor #69

Open
samselikoff opened this issue Jul 30, 2019 · 4 comments
Open

Comments

@samselikoff
Copy link

I'm trying to get jest-runner-eslint setup but its results are disagreeing with the results from running eslint from the command line (as well as my editor).

It does seem like both jest and eslint (and editor) are using .eslintrc.js, because if I change them both runners are affected. But I can't get the two to agree on certain files.

For example I have a file response.js, and my editor shows these errors:

image

image

When I run eslint lib/response.js I get

image

But when I run jest, I get

image


Here's my configs:

// jest.config.js
let eslint = {
  displayName: "lint",
  runner: "jest-runner-eslint",
  testMatch: ["<rootDir>/lib/response.js"]
};

module.exports = {
  projects: [eslint]
};
// .eslintrc.js
module.exports = {
  root: true,
  parser: "babel-eslint",
  plugins: ["jest"],
  extends: [
    "eslint:recommended",
    "plugin:jest/recommended",
    "plugin:jest/style"
  ],
  env: {
    "jest/globals": true,
    es6: true
  },
  rules: {
    camelcase: 0,
    "object-curly-spacing": 0,
    quotes: 0,
    "array-bracket-spacing": 0,
    "no-var": 0,
    "object-shorthand": 0,
    "arrow-parens": 0,
    "no-unused-vars": ["error", { args: "none" }]
  },
  overrides: [
    {
      files: ["jest.config.js", "babel.config.js"],
      env: {
        browser: false,
        node: true
      }
    },
    {
      files: ["__tests__/**"],
      env: {
        browser: true
      }
    }
  ]
};
@SimenB
Copy link
Member

SimenB commented Jul 30, 2019

Could you put together a reproduction we could pull down and see the error? We just use eslint's programmatic api, so different results sounds weird

@samselikoff
Copy link
Author

@luizcieslak
Copy link

@samselikoff did you manage to solve this? Got the same issue here

@samselikoff
Copy link
Author

@luizcieslak haven't come back to it again so I don't think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants