-
Notifications
You must be signed in to change notification settings - Fork 88
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
Wrong json-mode formatter chosen when specified in dir-locals file #328
Comments
Hm. When I create that What version of Emacs is this? I am testing with 28.1. |
I'm on 29.1.
|
Okay, I can reproduce this - |
Oh, okay. The problem is in Emacs 29 there is a builtin json-mode, but it's not called json-mode, it's called js-json-mode. Change your ((js-json-mode . ((apheleia-formatter . eslint)))
(json-mode . ((apheleia-formatter . prettier-json)))
(web-mode . ((apheleia-formatter . eslint)))) (or include entries for both mode names if you want to cover both versions). Meanwhile in Emacs 28 my json-mode is provided by an external package and is really called json-mode. |
OK, thanks! I was actually using |
I'm trying to specify different formatters for three different modes in
.dir-locals.el
file. Here's how the file looks like.js and web mode files are correctly using eslint formatter, but
json-mode
incorrectly uses eslint as well. When I delete the first line from the above dir-locals filejson-mode
correctly hasprettier-json
set in theapheleia-formatter
variable.I'm suspecting this is caused by the fact that
javascript-mode
isjson-mode
's parent, but don't have an idea how to fix it. Are there any ways around this?The text was updated successfully, but these errors were encountered: