Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

remark-preset-prettier

un-ts73.8kMIT2.0.1TypeScript support: included

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

readme

remark-preset-prettier

GitHub Actions Language grade: JavaScript type-coverage npm GitHub release

Conventional Commits Renovate enabled JavaScript Style Guide Code Style: Prettier changesets

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

TOC

Notice

If you're not ready for native ESM, top level await or latest remark-lint plugins, please use versions <1, see #61 and #97 for more details.

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"
  ]
}

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

import report from 'vfile-reporter'
import remark from 'remark'
import consistent from 'remark-preset-lint-consistent'
import styleGuide from 'remark-preset-lint-markdown-style-guide'
import recommended from 'remark-preset-lint-recommended'
import prettier from 'remark-preset-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
import wooorm from 'retext-preset-wooorm'
import sentenceSpacing from 'retext-sentence-spacing'

export default {
  plugins: [
    'preset-wooorm', // other preset(s) or plugin(s)
    'preset-prettier',
    [
      'retext',
      unified()
        .use(wooorm) // retext preset(s)
        .use({
          plugins: [[sentenceSpacing, false]],
        }),
    ],
  ],
}

Changelog

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

License

MIT © JounQin@1stG.me

changelog

Changelog

2.0.1

Patch Changes

2.0.0

Major Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

  • 1895900 Thanks @JounQin! - chore: upgrade (dev)Dependencies, update node engine and exports settings

1.0.0

Major Changes

  • #62 965cdcb Thanks @JounQin! - feat: support native esm plugins

    If you're not ready for native esm or latest remark-lint plugins, please use versions <1, see #61 for more details.

    Or you can try something like yarn-deduplicate with yarn-deduplicate --strategy fewer without guarantee.

0.5.1

Patch Changes

0.5.0

Minor Changes

0.4.1 (2021-03-13)

Bug Fixes

  • remove unexpected dependencies after upgrading deps (458c23d)

0.4.0 (2020-01-27)

Bug Fixes

  • revert retextPlugins, add notice about retext-sentence-spacing (0cdcd18)

0.3.0 (2020-01-27)

Features

  • disable style related retext plugins (dab8e70)

0.2.2 (2019-09-25)

0.2.1 (2019-09-22)

Bug Fixes

  • deps: bump dependencies, simplify build usage (b39fb14)

0.2.0 (2019-09-07)

Features

  • simplify implement by reduce, test with preset-lint-consistent too (9122f95)

0.1.1 (2019-09-01)

Bug Fixes

  • toc for remark-cli usage incorrect (1735435)

0.1.0 (2019-09-01)

Features

  • first blood, should just work (ca9ac95)