techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.6K
active users

#prettier

0 posts0 participants0 posts today

Today I learned: If you have lots of files in your project that aren’t supported by Prettier, you can gain massive speed improvements by ignoring those files in addition to those already ignored by Git.

This skips a lot of computation Prettier has to do for parser inference. For my website this brought down the format checking from over 4 seconds to under 1.5 seconds.

github.com/mvsde/website/blob/

Personal website and playground for experiments. Contribute to mvsde/website development by creating an account on GitHub.
GitHubwebsite/.prettierignore at main · mvsde/websitePersonal website and playground for experiments. Contribute to mvsde/website development by creating an account on GitHub.

#WebDev question: Is it recommended to use the #editorconfig extension AND #prettier extension for visual studio code? marketplace.visualstudio.com/i

Or is the prettier extension enough?

(I have a repo with '.editorconfig' and '.prettierrc', I know that prettier parses editorconfig as well)

marketplace.visualstudio.comEditorConfig for VS Code - Visual Studio MarketplaceExtension for Visual Studio Code - EditorConfig Support for Visual Studio Code

How To Create An NPM Package | Total TypeScript

Detailed the steps to publish a fully production-ready package to npm, starting from an empty directory.

Topics: covered:
➡️ initializing a git repository
➡️ creating essential files like package.json, LICENSE, and README.md
➡️ setting up TypeScript, Prettier, and CI scripts
➡️ publishing the package to npm.

#Git #GitHub #TypeScript #npm #PackageManagement #Programming #Prettier

totaltypescript.com/how-to-cre

How To Create An NPM Package
Total TypeScriptHow To Create An NPM PackageLearn how to publish a package to npm with a complete setup including, TypeScript, Prettier, Vitest, GitHub Actions, and versioning with Changesets.

I wish Prettier did less mucking about with the code I write.

If I put parentheses around a bunch of math, I'm doing it so I can understand it at a glance. I don't want it ripping out the parens and forcing me to run through PEMDAS in my head. Wrapping things in parens makes it so much easier to just read expressions from left to right.

There's a difference between "opinionated" and "actively removing information".

Journey to find an auto-formatter for Twig which works in VSCode as well as PhpStorm continues (since prettier plugin development seems to be hard 🤓 )

Colleagues told me about #djlint, unfortunately it's not bundled yet into the VSCode plugin. Therefore installing python + installing the package is necessary manually. marketplace.visualstudio.com/i

And we found a new language server github.com/kaermorchen/twig-la

Journey continues ... 🚣

marketplace.visualstudio.comdjLint - Visual Studio MarketplaceExtension for Visual Studio Code - HTML template formatter and linter (Django, Jinja, Nunjucks, Twig, Handlebars, Mustache)
#twig#php#craftcms

Prettier accepts config files in TOML, which I prefer, but I have a line in my (JS) config that I can’t seem to translate:

`overrides: [{ files: "*.md", options: { tabWidth: 2 } }],`

In JS, overrides is an array of objects, so I assume the TOML equivalent would be an array of tables (`[[overrides]]`), but if each override table is a value, what is the key? In JS the objects in the array are just anonymous. Prettier docs don't give any examples of this pattern in TOML.