Skip to content

prettier-js-mode reformats file even when file is in .prettierignore #62

Description

@tamouse

I have the following in my emacs init.el:

(use-package prettier-js 
  :ensure t
  :config
  (add-hook 'web-mode-hook
	    #'(lambda ()
		(enable-minor-mode
		 '("\\.jsx?\\'" . prettier-js-mode)
		 ))
	    )
  (add-hook 'rjsx-mode-hook 'prettier-js-mode)
  )

In a project, I have this for .prettierignore:

*.spec.js
*.test.js

When I visit a file, src/score_to_grade.spec.js, it shows Prettier in the mode line, but on save, it reformats the file.

I seems that it's ignoring the ignore settings?

Additionally, if I use // prettier-ignore-start ... // prettier-ignore-end these are also not respected and the code between them is formatted in emacs prettier-js-mode.

If I run prettier from my terminal, both of these work as expected.

Versions:

  • Emacs: GNU Emacs 26.2
  • prettier-js: 20180109.726
  • prettier: 1.19.1 (latest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions