Socket
Book a DemoInstallSign in
Socket

remark-preset-prettier

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

remark-preset-prettier

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

2.0.2
latest
Source
npmnpm
Version published
Weekly downloads
9.2K
-21.85%
Maintainers
2
Weekly downloads
 
Created
Source

remark-preset-prettier

GitHub Actions Workflow Status type-coverage CodeRabbit Pull Request Reviews 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

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

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]],
        }),
    ],
  ],
}

Sponsors

Sponsors

1stGRxTSUnTS
1stG Open Collective sponsorsRxTS Open Collective sponsorsUnTS Open Collective sponsors

Backers

1stGRxTSUnTS
1stG Open Collective backersRxTS Open Collective backersUnTS Open Collective backers

Changelog

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

License

MIT © JounQin@1stG.me

FAQs

Package last updated on 03 Apr 2025

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.