Does prettier have an API that can show the detail for lint info
See original GitHub issueEnvironments:
- Prettier Version: 1.15.3
- Running Prettier via:
prettier.check(code, {parser: 'css', tabWidth: 4})
- Runtime: Node.js v9
- Operating System: macOS
Expected behavior:
I wanna use API to scan a file where doesn’t match the prettier
rules and returns me the info, but when I use prettier.check
, it just return a Boolean
, or if I use prettier.format
, it will only prompt where prettier
can’t format the code. I have read the docs in https://prettier.io/docs/en/api.html, but I can’t find the API which I needed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Integrating with Linters - Prettier
Linters usually contain not only code quality rules, but also stylistic rules. Most stylistic rules are unnecessary when using Prettier, but worse –...
Read more >Options - Prettier
You need to explicitly tell them what to do, while humans can make their own (implicit) judgements, ... See the strings rationale for...
Read more >API · Prettier
When Prettier loads configuration files and plugins, the file system structure is cached for performance. This function will clear the cache. Generally this...
Read more >What is Prettier? · Prettier
Prettier is an opinionated code formatter with support for: ... Prettier takes your code and reprints it from scratch by taking the line...
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
@j-f1 That’s ESLint… I think that’s just an example of what they wanted.
@xtx1130 We don’t generate that kind of information and do intend to do it. Since Prettier just parses the code, generates an AST and then prints everything we don’t really “monitor” what changed.
The eslint-plugin-prettier ESLint plugin, which allows you to run Prettier through ESLint, computes a diff and shows a ESLint error. The rule is always the same though
@duailibe Thanks for you detailed explanation of the problem, I got it.