Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@guildeducationinc/prettier-config

Package Overview
Dependencies
Maintainers
30
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guildeducationinc/prettier-config

Guild Education's Prettier Config

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-11.48%
Maintainers
30
Weekly downloads
 
Created
Source

Guild Prettier Config

At Guid, we uses prettier to format our code javascript and typescript code in a standard way.

Install

yarn add -D @guildeducationinc/prettier-config

Usage

Make sure that you have prettier installed in your project. To learn how to do this, refer to prettier docs.

To use the Guild prettier config, simply add the following to your package.json.

{
  "name": "my-project-name",
  ...
+ "prettier": "@guildeducationinc/prettier-config"
}

Next, run

yarn prettier  --write "src/**/*.{ts,tsx,js,jsx}"

If you've just installed prettier, this runs prettier against the entire code base and formats it to match our standard config.

Optional: Add pre-commit hook

While optional, it's highly recommended to add a pre-commit hook so that prettier runs on all commits. This automates prettier and prevents any files from becoming out of sync with our formatting.

yarn add -D husky
yarn add -D lint-staged

Then, add to your package.json

{
  "name": "my-project-name",
  ...
+ "husky": {
+    "hooks": {
+     "pre-commit": "lint-staged"
+   }
+ },
+ "lint-staged": {
+   "src/**/*.{js,jsx,ts,tsx}": [
+     "prettier --write src/**/*.{js,jsx,ts,tsx}",
+     "git add"
+   ]
+ }
}

Or, add a prettier.config.js file in the root of your project with the following

  module.exports = {
    ...require('@guildeducationinc/prettier-config'),
  };

FAQ

Ignoring files

To ignore files, add a .prettierignore to the root of your project and add any glob patterns of files you'd like for prettier to ignore.

FAQs

Package last updated on 12 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc