Code Monkey home page Code Monkey logo

Comments (13)

im-martijn avatar im-martijn commented on May 17, 2024 1

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.

im-martijn avatar im-martijn commented on May 17, 2024 1

from prettier-eslint.

karlhorky avatar karlhorky commented on May 17, 2024 1

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.

kentcdodds avatar kentcdodds commented on May 17, 2024

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.

im-martijn avatar im-martijn commented on May 17, 2024

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.

kentcdodds avatar kentcdodds commented on May 17, 2024

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.

kentcdodds avatar kentcdodds commented on May 17, 2024

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.

karlhorky avatar karlhorky commented on May 17, 2024

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.

im-martijn avatar im-martijn commented on May 17, 2024

from prettier-eslint.

karlhorky avatar karlhorky commented on May 17, 2024

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.

im-martijn avatar im-martijn commented on May 17, 2024

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 $FileDir$. I did not set the working directory to anything at all. Well, it works for me.

from prettier-eslint.

zimme avatar zimme commented on May 17, 2024

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.

zimme avatar zimme commented on May 17, 2024

Ability to infer prettier config from eslint-plugin-prettiers prettier/prettier rule is supported since 5bd3684 and is release with 8.6.0.

from prettier-eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.