JsPrettier does not properly configure parser for Less files
See original GitHub issueReopening #199.
When reporting an issue, please include the following information in your post:
- Explain the Issue and Expected Behavior
- Prettier version
- JsPrettier Plug-in Version
- Platform Details
- Generated Prettier command line arguments
- Is the same behavior observed when run against Prettier directly?
- The contents of your
User/JsPrettier.sublime-settings
file - The contents of your
<project_name>.sublime-project
file (if applicable) - Steps to reproduce the behavior
Explain the Issue and Expected Behavior
When prettying a Less file, it forces the parser to use CSS, which prevents Prettier from parsing and prettying the content properly. It should use SCSS instead.
Prettier version
1.19.1
JsPrettier Plug-in Version
1.28.5
Platform Details
- Sublime Text Version: 3.2.2
- Sublime Text Build: 3211
- Operating System Name: macOS
- Operating System Version: 10.15
Generated Prettier command line arguments
-----------------------------------------
JsPrettier DEBUG - Prettier CLI Command
-----------------------------------------
/Users/percyhanna/.config/yarn/global/node_modules/.bin/prettier \
--stdin \
--config /path/to/.prettierrc \
--config-precedence cli-override \
--parser css \
--use-tabs false \
--ignore-path /path/to/.prettierignore \
--stdin-filepath /path/to/file.less \
--loglevel debug \
--cursor-offset 6930
Prettier reported the following output:
[debug] normalized argv: {"_":[],"color":true,"editorconfig":true,"stdin":true,"use-tabs":false,"config":"/path/to/.prettierrc","config-precedence":"cli-override","parser":"css","ignore-path":"/path/to/.prettierignore","stdin-filepath":"/path/to/app/assets/stylesheets/landing_pages.less","loglevel":"debug","cursor-offset":6217,"plugin-search-dir":[],"plugin":[],"debug-repeat":0}
[debug] load config file from '/path/to/.prettierrc'
[debug] loaded options `{"jsxSingleQuote":true,"singleQuote":true,"trailingComma":"es5"}`
[debug] applied config-precedence (cli-override): {"filepath":"/path/to/app/assets/stylesheets/landing_pages.less","cursorOffset":6217,"jsxSingleQuote":true,"parser":"css","singleQuote":true,"trailingComma":"es5","useTabs":false}
Is the same behavior observed when run against Prettier directly?
If I remove --parser css
then it works as expected. Or, if I use --parser scss
.
The contents of your User/JsPrettier.sublime-settings
file
{
"debug": true,
"auto_format_on_save": true,
"prettier_cli_path": "/Users/percyhanna/.config/yarn/global/node_modules/.bin/prettier"
}
The contents of your <project_name>.sublime-project
file (if applicable)
n/a
Steps to reproduce the behavior
This issue is specifically related to this bug that has been fixed in prettier: https://github.com/prettier/prettier/pull/2034
If I save a .less
file with the &:extend
content, then it adds the space, thus breaking the syntax in less.
div {
&:extend(.something);
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to properly re-configure JSPrettier after an update with a ...
When I open the console to see what the error is it says: The system cannot find the path specified. (CR). The settings...
Read more >Options - Prettier
Parser. Specify which parser to use. Prettier automatically infers the parser from the input file path, so you shouldn't have to change this...
Read more >JsPrettier - Package Control
When Prettier configuration files are detected, options defined in Sublime Text are ignored, with the exception of parser , tabWidth and useTabs ....
Read more >fs_prettier - npm
There are no other projects in the npm registry using fs_prettier. ... You can also use --config if your configuration file lives somewhere ......
Read more >How to make ESLint work with Prettier avoiding conflicts and ...
With a proper configuration ESLint and Prettier can work side-by-side ... patterns or code that doesn't adhere to certain style guidelines.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jonlabelle I suppose it would be something like this: #209
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.