Skip to content

.prettierignore entries containing path separators are ignored #126

@edmorley

Description

@edmorley

What version of eslint are you using?
5.9.0

What version of prettier are you using?
1.15.2

What version of eslint-plugin-prettier are you using?
3.0.0

Please paste any applicable config files that you're using (e.g. .prettierrc or .eslintrc files)
https://github.com/edmorley/testcase-eslint-plugin-prettier-ignore/blob/master/.eslintrc.js
https://github.com/edmorley/testcase-eslint-plugin-prettier-ignore/blob/master/.prettierignore

What source code are you linting?
https://github.com/edmorley/testcase-eslint-plugin-prettier-ignore/blob/master/src/not_pretty.js

Steps to reproduce

  1. Git clone https://github.com/edmorley/testcase-eslint-plugin-prettier-ignore
  2. yarn install
  3. yarn prettier:check # runs prettier
  4. yarn eslint:check # runs eslint and so eslint-plugin-prettier

What did you expect to happen?

  • No errors reported by either yarn prettier:check or yarn eslint:check, since the file with bad formatting is listed in .prettierignore.

What actually happened?

  • No errors reported by yarn prettier:check (as expected)
  • Formatting errors reported by yarn eslint:check:
$ yarn eslint:check
yarn run v1.12.3
$ eslint src

C:\Users\Ed\src\testcase-eslint-plugin-prettier-ignore\src\not_pretty.js
  1:12  error  Replace `⏎··'a'` with `"a"`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

Additional Notes

  • The error goes away if I edit the .prettierignore entry to not contain a path component (eg changing it to not_pretty.js)
  • The variations /src/not_pretty.js and ./src/not_pretty.js didn't help.
  • This reproduced on both Windows and Ubuntu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions