[Bug] Prettier 1.19.1 CLI doesn't respect configuration
See original GitHub issueApologies if this is a duplicate. I searched and while I see other regression issues related to v1.19.1
, I’m not seeing anything that looks quite right.
This issue is similar, however:
- The solution did not work for me.
- My issue was primarily with the CLI, though the behavior was mirrored by the VSCode extension (tried
v2.3.0
andv3.11.0
)
Environments:
- Prettier Version:
v1.19.1
- Running Prettier via: CLI
- Runtime: Node.js
v12.13.0
- Operating System: macOS
v10.15.2
- prettylint:
v1.0.0
Steps to reproduce:
Running the npm
script:
"npm run lint": "prettylint 'src/**/*.{ts,tsx}'"
where my prettierrc.js
is:
module.exports = {
printWidth: 120,
tabWidth: 4,
useTabs: false,
semi: true,
singleQuote: false,
trailingComma: "all",
bracketSpacing: true,
arrowParens: "avoid",
proseWrap: "preserve",
};
Run it on a .tsx
file with the function:
export const configuration = createSelector(
[getState],
state => state.configuration,
);
And you’ll get the error
> @revolution/web@0.3.0 lint:prettylint /Users/stephen/_coding/remine/revolution/web
> prettylint 'src/**/*.{ts,tsx}' --config ../.prettierrc.js
<path to file>:4:44
⚠ 4:44 Replace ⏎····[getState],⏎····state·=>·state.configuration,⏎ with [getState],·state·=>·state.configuration prettier/prettier
Note, I added the --config ../.prettierrc.js
after confirming that that was the config identified for the file (it’s also the one I hoped would be used) with the --find-config-path
option (https://github.com/prettier/prettier/blob/master/docs/cli.md#--find-config-path-and---config).
Expected behavior:
Running prettier on this file should produce no errors.
Actual behavior:
Running prettier produced errors and when I tried running it with --fix
, it performed that action successfully.
Workaround:
Downgrade version to v1.18.2
All of my configurations were respected and I stopped getting conflicting error messages (conflicting between my configuration and Prettier).
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
A warning would have been nice, the stale bot does before closing old issues.