prettier/prettier-eslint

Some rules don't correctly fail as expected

jdmwood opened this issue · 1 comments

Versions:

  • prettier-eslint version: 9.0.1
  • node version: 10.17.0
  • npm (or yarn) version: 6.11.3

Have you followed the debugging tips?

Yes

Relevant code or config

package.json:

{
  "name": "bug-test",
  "scripts": {
    "prettier": "prettier-eslint --write \"src/**/*.js\"",
    "eslint": "eslint \"src/**/*.js\""
  },
  "devDependencies": {
    "eslint": "6.4.0",
    "eslint-config-airbnb-base": "^14.0.0",
    "eslint-plugin-import": "^2.19.1",
    "prettier-eslint-cli": "^5.0.0"
  }
}

.eslintrc:

{
  "extends": ["airbnb-base"]
}

src/foo.js:

const foo = 1;

See bug.zip for a full zip including package-lock.

What I did:

npm install
npm run prettier

What happened:

I'd expect eslint to fail with a no-unused-vars error but instead it just silently passes:

$ npm run prettier

> bug-test@ prettier .../prettier-eslint-bug
> prettier-eslint --write "src/**/*.js"

1 file was unchanged

By way of comparison, if I run eslint directly, I do see the error:

$ npm run lint

> bug-test@ lint /.../prettier-eslint-bug
> eslint --fix "src/**/*.js"


.../src/foo.js
  1:7  error  'foo' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)

I have no idea if it's something special about this rule - this is just where we spotted the issue.

Reproduction repository:

See zip above

Problem description:

Suggested solution:

Oops sorry! I created this bug on the wrong repo...