Socket
Socket
Sign inDemoInstall

remark-preset-prettier

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-preset-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.


Version published
Weekly downloads
18K
increased by10%
Maintainers
2
Weekly downloads
 
Created
Source

remark-preset-prettier

Travis Codacy Grade type-coverage npm GitHub release

David Peer David David Dev

Conventional Commits JavaScript Style Guide Code Style: Prettier codechecks.io

Turns off all rules that are unnecessary or might conflict with Prettier.

TOC

Disabled remark-lint plugins

  1. blank-lines-1-0-2
  2. blockquote-indentation
  3. books-links
  4. checkbox-character-style
  5. code-block-style
  6. definition-case
  7. definition-spacing
  8. emphasis-marker
  9. fenced-code-marker
  10. final-newline
  11. hard-break-spaces
  12. heading-style
  13. heading-whitespace
  14. link-title-style
  15. list-item-bullet-indent
  16. list-item-content-indent
  17. list-item-indent
  18. list-item-spacing
  19. maximum-line-length
  20. no-blockquote-without-marker
  21. no-consecutive-blank-lines
  22. no-heading-content-indent
  23. no-inline-padding
  24. no-long-code
  25. no-table-indentation
  26. ordered-list-marker-style
  27. ordered-list-marker-value
  28. rule-style
  29. spaces-around-number
  30. spaces-around-word
  31. strong-marker
  32. table-cell-padding
  33. table-pipe-alignment
  34. table-pipes
  35. unordered-list-marker-style

Install

# yarn
yarn add -D remark-preset-prettier

# npm
npm i -D remark-preset-prettier

Usage

Via config like .remarkrc

{
  "plugins": [
    "preset-lint-consistent",
    "preset-lint-markdown-style-guide",
    "preset-lint-recommended",
    "preset-prettier"
  ]
}

Via ESLint(recommended)

Please use eslint-plugin-mdx which works perfectly with ESLint and Remark both together.

{
  "extends": "plugin:mdx/recommended"
}

Via remark-cli

remark . --use preset-lint-consistent preset-lint-markdown-style-guide preset-lint-recommended preset-prettier

Via Node API

const report = require('vfile-reporter')
const remark = require('remark')
const consistent = require('remark-preset-lint-consistent')
const styleGuide = require('remark-preset-lint-markdown-style-guide')
const recommended = require('remark-preset-lint-recommended')
const prettier = require('remark-preset-lint-prettier')

const file = remark()
  .use(consistent)
  .use(styleGuide)
  .use(recommended)
  .use(prettier)
  .processSync('_Hello world_')

console.log(report(file))

remark-retext issue

retext-sentence-spacing is a plugin of retext, and remark-retext makes it possible to use retext plugins together with remark, and retext-sentence-spacing may conflict with Prettier.

However, remark-retext can only be enabled once what means we can not simply disable rule retext-sentence-spacing in this preset which is actually meaningless.

If you do have problems between retext-sentence-spacing and Prettier, you have to override the whole configuration of remark-retext like following:

// .remarkrc.js
const wooorm = require('retext-preset-wooorm')

module.exports = {
  plugins: [
    'preset-wooorm', // other preset(s) or plugin(s)
    'preset-prettier',
    [
      'retext',
      unified()
        .use(wooorm) // retext preset(s)
        .use({
          plugins: [[require('retext-sentence-spacing'), false]],
        }),
    ],
  ],
}

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT © JounQin@1stG.me

FAQs

Package last updated on 13 Mar 2021

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