Comments (13)
Yeah, that was it. Turned out I had an older prettier version installed globally (0.18) and in the package.json was prettier-eslint 4.1.1. I did have to tweak my Webstorm config a bit (a file watcher that runs prettier-eslint-cli on save of any js files). But it seems to work properly now!
from prettier-eslint.
from prettier-eslint.
Can you post a screenshot of your settings?
If you're using the CLI, this may be nice to document in the prettier-eslint-cli
docs too...
from prettier-eslint.
Could you update your version of prettier-eslint-cli
and run it again (without TRACE)? This should surface the underlying error now.
from prettier-eslint.
Thanks, I tried again. I get:
Validation Error:
Option "trailingComma" must be of type:
boolean
but instead received:
string
Example:
{
"trailingComma": false
}
I am using eslint-plugin-prettier also. Like I said, I have this rule in my .eslintrc:
"prettier/prettier": [
"error",
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120
}
]
I did give it a try using true instead of "all", but that doesn't help (and doesn't follow the prettier docs).
from prettier-eslint.
Huh, it looks like you have an old version of prettier
. Are you sure you upgraded to the latest version? In any case, you'll also want to note the technical details section because eslint-plugin-prettier
rules are not currently supported in the inference capabilities of prettier-eslint
. We should definitely support them though. Would you like to makeapullrequest.com?
from prettier-eslint.
Cool. Just so you know, prettier-eslint
is still unable to determine the best prettier options based on your config. Would you like to add support for inferring options from eslint-plugin-prettier
config?
from prettier-eslint.
I did have to tweak my Webstorm config a bit (a file watcher that runs prettier-eslint-cli on save of any js files)
@im-martijn How did you configure this exactly? This sounds like what we need...
from prettier-eslint.
from prettier-eslint.
Oh ok, so you're not using prettier-eslint-cli
right now? You're just using prettier
directly? I assume you set it up like this... https://github.com/prettier/prettier/blob/4babc032cbf98876ef97801238ce65f04ea6db14/editors/webstorm/README.md#using-file-watcher
In WebStorm does prettier
alone also integrate with eslint --fix
like in Atom?
from prettier-eslint.
That's more or less what I did. I also adapted the scope of files to watch. I also added arguments for single quotes, trailing commas, flow parser and print width. For the output paths to refresh I have
from prettier-eslint.
If we infer from eslint-plugin-prettier
I do think that prettier
configuration in prettier/prettier
should be used and the options not present in this rules' config should be inferred from the other rules.
This basically means that all functions that resolves an eslint
option to a prettier
option needs to look at prettier/prettier
first, unless i can do this check before this logic runs.
from prettier-eslint.
Ability to infer prettier config from eslint-plugin-prettier
s prettier/prettier
rule is supported since 5bd3684 and is release with 8.6.0.
from prettier-eslint.
Related Issues (20)
- how to integrate with prettier vscode extension? no longer has "prettier.eslintIntegration" option HOT 5
- ability to capture (non-fixable) eslint errors/warnings? HOT 5
- Integration with CI/CD (gitlab) HOT 1
- Error: Failed to load plugin '@next/next' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '' HOT 2
- Remove `--prettier-last` option because it's out scope HOT 2
- Support for `padded-blocks` corner cases HOT 3
- Error: `reportUnusedDisableDirectives` must be any of "error", "warn", "off", and null HOT 2
- prettier-eslint fails due to an eslint config error; eslint works if called directly. Typescript overrides issue? HOT 1
- Only Prettier (but not ESLint) formatting is applied to `.cjs` files HOT 7
- prettier-eslint installs vue-eslint-parser 8.30, instead of 9.1.0 HOT 3
- `prettier-eslint` command fails due to unknown environment key `jest/globals` HOT 4
- Configuring reportUnusedDisableDirectives to true in .eslintrc will cause prettier-eslint to not work properly. HOT 1
- TypeError: Expected `input` to be a `string`, got `object` HOT 5
- Is this tool still needed? HOT 1
- Shouldn't this be the other way around? "This formats your code via prettier, and then passes the result of that to eslint --fix." HOT 6
- Status of capturing eslint warnings/errors? HOT 1
- feat: support flat config with `FlatESLint` HOT 7
- [meta] a new OpenCollective home for all `prettier` + `eslint` integration tools HOT 6
- How to use it? HOT 1
- prettier-eslint default trailingComma is not the same as Prettier v3 default trailingComma
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-eslint.