Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
remark-preset-prettier
Advanced tools
Turns off all rules that are unnecessary or might conflict with Prettier.
Turns off all rules that are unnecessary or might conflict with Prettier.
# yarn
yarn add -D remark-preset-prettier
# npm
npm i -D remark-preset-prettier
.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"
}
remark . --use preset-lint-consistent preset-lint-markdown-style-guide preset-lint-recommended preset-prettier
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))
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]],
}),
],
],
}
Detailed changes for each release are documented in CHANGELOG.md.
FAQs
Turns off all rules that are unnecessary or might conflict with Prettier.
The npm package remark-preset-prettier receives a total of 17,362 weekly downloads. As such, remark-preset-prettier popularity was classified as popular.
We found that remark-preset-prettier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.