4

Currently, I've got Prettier set up through ESLint using the following .eslintrc.json:

{
  "extends": ["react-app", "plugin:prettier/recommended"]
}

This works fine for linting and formatting JavaScript files.

However, when I'm trying to run ESLint (and thus Prettier) on Markdown and CSS files, errors like the following occur:

/Users/willem-aart/Code/foo/bar.md
  1:1  error  Parsing error: Unexpected character '#'

> 1 | ## foobar
    | ^

✖ 1 problem (1 error, 0 warnings)

It seems that ESLint cannot handle the file. On the other hand, Prettier – when run standalone – handles the file as expected.

Is it possible to format files other than JavaScript using Prettier through ESLint? Or am I better off using Prettier standalone?

I guess Prettier can be applied to a broader range of file formats than ESLint is intended for.

Willem-Aart
  • 2,200
  • 2
  • 19
  • 27
  • I'm interested in this as well. The benefit would be that there would be a single runner & output of everything related to formatting / linting. Otherwise, prettylint is a nice tool. – Borek Bernard Mar 01 '19 at 08:40

0 Answers0