1.1.9 • Published 3 years ago

@modyqyw/prettier-config v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

DEPRECATED. Check @modyqyw/fabric.

@modyqyw/prettier-config

A prettier shareable config for JavaScript/TypeScript/CSS/LESS/SCSS.

Usage

npm i -D prettier@~2.1.2 @modyqyw/prettier-config@~1.1.9
# or
#yarn add -D prettier@~2.1.2 @modyqyw/prettier-config@~1.1.9

Set prettier field in ${PROJECT_DIR}/package.json.

{
  ...,
  "prettier": "@modyqyw/prettier-config",
  ...
}

Or use ${PROJECT_DIR}/prettier.config.js if you want to overwrite.

// ${PROJECT_DIR}/prettier.config.js
const config = require("@modyqyw/prettier-config");

module.exports = {
  ...config,
  // write your own rules here
  printWidth: 100,
};

VSCode

  • Install plugins.
  • Set up Settings.json. Then F1 => Format Document => F1 => File: Save.
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "files.eol": "\n",
  "files.associations": {
    "*.wxml": "html",
    "*.wxs": "javascript",
    "*.wxss": "css",
    "*.axml": "html",
    "*.sjs": "javascript",
    "*.acss": "css",
    "*.swan": "html",
    "*.ttml": "html",
    "*.ttss": "css",
    "*.jxml": "html",
    "*.jxss": "css",
    "*.wpy": "vue",
    "*.nvue": "vue",
    "*.ux": "vue"
  },
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  }
}

For auto formatting, use "editor.formatOnSave": true.

More Configs

@modyqyw/eslint-config and @modyqyw/stylelint-config do not use any Prettier config and plugin, while @modyqyw/fabric does.

License

MIT

Copyright (c) 2020-present MillCloud

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago