New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sixfold/editor-config

Package Overview
Dependencies
Maintainers
48
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sixfold/editor-config

# How to use Prettier

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
48
Created
Source

editor-config

How to use Prettier

  1. Install the config and prettier:
yarn add @sixfold/editor-config prettier -D
  1. Add the following line in the target service's package.json:
"prettier": "@sixfold/editor-config/prettier"
  1. Add the following scripts to your package.json
  "prettier": "prettier \"./src/**/**\"",
  "prettier:check": "yarn prettier --check",
  "prettier:fix": "yarn prettier --write",
  1. Add a .prettierignore file at the source of the repository, containing at least the following:
package.json
.DS_Store

Make sure to include .prettierignore in your docker (test) if you check prettier formatting as part of the tests.

  1. Configure your IDE to use Prettier:
  • VS Code
  • WebStorm (Should be installed by default, but you need to configure it.)
  1. Add yarn prettier:check as part of the test or build script to ensure that code is consistently formatted

Using prettier config with prettier APIs

When generating code programmatically, same configuration can be used to format generated output:

import * as prettier from 'prettier';
import * as prettierConfig from '@sixfold/editor-config';

const source = 'function main(){console.log("Hello")};main()';

console.log(prettier.format(source, prettierConfig));

FAQs

Package last updated on 17 Jun 2022

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