Skip to content

Commit

Permalink
fix: revert retextPlugins, add notice about retext-sentence-spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 27, 2020
1 parent 5a6762a commit 0cdcd18
Show file tree
Hide file tree
Showing 3 changed files with 1,459 additions and 2,084 deletions.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)

> Turns off all rules that are unnecessary or might conflict with Prettier.
> Turns off all rules that are unnecessary or might conflict with [Prettier][].
## TOC <!-- omit in toc -->

Expand All @@ -26,6 +26,9 @@
- [Via ESLint(recommended)](#via-eslintrecommended)
- [Via remark-cli](#via-remark-cli)
- [Via Node API](#via-node-api)
- [[remark-retext][] issue](#remark-retext-issue)
- [Changelog](#changelog)
- [License](#license)

## Disabled remark-lint plugins

Expand Down Expand Up @@ -126,6 +129,49 @@ const file = remark()
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:

```js
// .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](./CHANGELOG.md).

## License

[MIT][] © [JounQin][]@[1stG.me][]

[1stg.me]: https://www.1stg.me
[eslint]: https://eslint.org
[eslint-plugin-mdx]: https://github.com/rx-ts/eslint-mdx
[jounqin]: https://GitHub.com/JounQin
[mit]: http://opensource.org/licenses/MIT
[prettier]: https://prettier.io
[remark]: https://github.com/remarkjs/remark
[remark-retext]: https://github.com/remarkjs/remark-retext
[retext]: https://github.com/retextjs/retext
[retext-sentence-spacing]: https://github.com/retextjs/retext-sentence-spacing
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remark-preset-prettier",
"version": "0.2.2",
"version": "0.4.0",
"description": "Turns off all rules that are unnecessary or might conflict with Prettier.",
"repository": "git@github.com:JounQin/remark-preset-prettier.git",
"author": "JounQin <admin@1stg.me>",
Expand All @@ -19,7 +19,7 @@
],
"scripts": {
"build": "run-p build:*",
"build:r": "r",
"build:r": "r -p",
"build:ts": "tsc -b",
"lint": "run-p lint:*",
"lint:es": "cross-env PARSER_NO_WATCH=true eslint . --cache --ext js,md,ts -f friendly",
Expand All @@ -31,11 +31,15 @@
"prettier": ">=1.0.0"
},
"devDependencies": {
"@1stg/lib-config": "^0.1.19",
"@1stg/lib-config": "^0.1.20",
"npm-run-all": "^4.1.5",
"type-coverage": "^2.4.0",
"typescript": "^3.7.5",
"unified": "^8.4.2"
"typescript": "^3.7.5"
},
"resolutions": {
"@babel/code-frame": "^7.0.0",
"@babel/core": "^7.8.3",
"@babel/helper-plugin-utils": "^7.8.3"
},
"typeCoverage": {
"atLeast": 100
Expand Down
Loading

0 comments on commit 0cdcd18

Please sign in to comment.