Socket
Book a DemoInstallSign in
Socket

@open-wc/prettier-config

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@open-wc/prettier-config

Prettier config following open-wc recommendations

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
1.3K
2.93%
Maintainers
2
Weekly downloads
 
Created
Source

Linting Prettier

Use Prettier to format your JS, CSS and HTML code.

:Warning: this package is deprecated. We recommend using prettier v2 with the recommend config instead.

Setup

npm init @open-wc
# Upgrade > Linting

Manual

  • Install @open-wc/prettier-config
    npm add --save-dev @open-wc/prettier-config
    
  • Adjust your package.json with the following
    "scripts": {
      "lint:prettier": "prettier \"**/*.js\" --check --ignore-path .gitignore",
      "format:prettier": "prettier \"**/*.js\" --write --ignore-path .gitignore"
    },
    "devDependencies": {
      "@open-wc/prettier-config": "^0.1.10"
    },
    "eslintConfig": {
      "extends": [
        "eslint-config-prettier"
      ]
    },
    "prettier": "@open-wc/prettier-config"
    

What you get

  • Apply formatting to JS files
  • Apply formatting to HTML inside of html tagged template literals used by lit-html
  • Apply formatting to CSS inside of css tagged template literals used by lit-element
  • Integration with ESLint to prevent potentially conflicting rules

Usage

Run:

  • npm run lint:prettier to check if your files are correctly formatted
  • npm run format:prettier to auto format your files

Linting Error Examples

$ npm run lint:prettier

test/set-card.test.js
test/set-game.test.js
↑↑ these files are not prettier formatted ↑↑

Simply run npm run format:prettier to format your files automatically.

Keywords

prettier

FAQs

Package last updated on 20 Apr 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.