Lint/check ignores local prettier.config.js config
See original GitHub issueThis leads to inconsistencies between with gts fix
, for example:
$ cat prettier.config.js
module.exports = {
singleQuote: true,
trailingComma: 'all',
};
$ node_modules/.bin/gts fix file.ts
Warning: The 'deprecation' rule requires type information.
Done in 2.06s.
$ node_modules/.bin/gts check file.ts
file.ts
Unnecessary trailing comma (trailing-comma)
44 | input: string,
45 | replacement: string,
> 46 | count: number,
| ^
47 | ): string {
48 | if (replacement == null) return input;
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Configuration File - Prettier
Prettier uses cosmiconfig for configuration file support. This means you can configure Prettier via (in order of precedence):.
Read more >Prettier vscode extension ignoring config files - Stack Overflow
In VS Code press Ctrl + shift + p to open command palette then chose. Preferences: Open Settings(JSON) and add the line among...
Read more >Prettier and ESLint Automation Cheat Sheet
Setup. Prettier; Eslint; StyleLint; Ability to validate code locally; Automatically run code validation with Husky and lint-staged ...
Read more >Supported hooks - pre-commit
setup -cfg-fmt - apply a consistent format to `setup.cfg` files ... shell-lint - Check Shell Syntax on ALL staged files with user friendly...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
The same JavaScript code in projectB/index.js gets formatted by Prettier using different local settings and ends up looking different.
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 FreeTop 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
Top GitHub Comments
Here’s another test I created that verifies the trailing comma option works as well:
It seems to pass. A reproducing test repo / gist would be needed to investigate this further.
The solutions seems to be using something like tslint-config-prettier. It removes conflicting style rules from the
tslint
config.