Skip to content

Commit e1f3de0

Browse files
committed
Update dependencies
1 parent d2cd488 commit e1f3de0

File tree

4 files changed

+57
-51
lines changed

4 files changed

+57
-51
lines changed

cli.js

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ import fs from 'fs'
33
import notifier from 'update-notifier'
44
import supportsColor from 'supports-color'
55
import meow from 'meow'
6-
import engine from 'unified-engine'
7-
import unified from 'unified'
8-
import markdown from 'remark-parse'
9-
import html from 'rehype-parse'
10-
import frontmatter from 'remark-frontmatter'
11-
import mdx from 'remark-mdx'
12-
import english from 'retext-english'
13-
import remark2retext from 'remark-retext'
14-
import rehype2retext from 'rehype-retext'
15-
import defaultReporter from 'vfile-reporter'
16-
import equality from 'retext-equality'
17-
import profanities from 'retext-profanities'
18-
import diff from 'unified-diff'
6+
import {engine} from 'unified-engine'
7+
import {unified} from 'unified'
8+
import rehypeParse from 'rehype-parse'
9+
import remarkParse from 'remark-parse'
10+
import remarkFrontmatter from 'remark-frontmatter'
11+
import remarkGfm from 'remark-gfm'
12+
import remarkMdx from 'remark-mdx'
13+
import retextEnglish from 'retext-english'
14+
import remarkRetext from 'remark-retext'
15+
import rehypeRetext from 'rehype-retext'
16+
import vfileReporter from 'vfile-reporter'
17+
import retextEquality from 'retext-equality'
18+
import retextProfanities from 'retext-profanities'
19+
import unifiedDiff from 'unified-diff'
1920
import {filter} from './filter.js'
2021

2122
const pack = JSON.parse(
@@ -63,6 +64,7 @@ var cli = meow(
6364
' $ alex'
6465
].join('\n'),
6566
{
67+
importMeta: import.meta,
6668
flags: {
6769
version: {type: 'boolean', alias: 'v'},
6870
help: {type: 'boolean', alias: 'h'},
@@ -110,7 +112,7 @@ engine(
110112
rcName: '.alexrc',
111113
packageField: 'alex',
112114
color: supportsColor.stderr,
113-
reporter: cli.flags.reporter || defaultReporter,
115+
reporter: cli.flags.reporter || vfileReporter,
114116
reporterOptions: {
115117
verbose: cli.flags.why
116118
},
@@ -129,24 +131,25 @@ engine(
129131
function transform(options) {
130132
var settings = options || {}
131133
var plugins = [
132-
english,
133-
[profanities, {sureness: settings.profanitySureness}],
134-
[equality, {noBinary: settings.noBinary}]
134+
retextEnglish,
135+
[retextProfanities, {sureness: settings.profanitySureness}],
136+
[retextEquality, {noBinary: settings.noBinary}]
135137
]
136138

137139
if (cli.flags.html) {
138-
plugins = [html, [rehype2retext, unified().use({plugins: plugins})]]
140+
plugins = [rehypeParse, [rehypeRetext, unified().use({plugins: plugins})]]
139141
} else if (cli.flags.mdx) {
140142
plugins = [
141-
markdown,
142-
mdx,
143-
[remark2retext, unified().use({plugins: plugins})]
143+
remarkParse,
144+
remarkMdx,
145+
[remarkRetext, unified().use({plugins: plugins})]
144146
]
145147
} else if (!cli.flags.text) {
146148
plugins = [
147-
markdown,
148-
[frontmatter, ['yaml', 'toml']],
149-
[remark2retext, unified().use({plugins: plugins})]
149+
remarkParse,
150+
remarkGfm,
151+
[remarkFrontmatter, ['yaml', 'toml']],
152+
[remarkRetext, unified().use({plugins: plugins})]
150153
]
151154
}
152155

@@ -155,7 +158,7 @@ function transform(options) {
155158
// Hard to check.
156159
/* c8 ignore next 3 */
157160
if (cli.flags.diff) {
158-
plugins.push(diff)
161+
plugins.push(unifiedDiff)
159162
}
160163

161164
return {plugins: plugins}

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import VFile from 'vfile'
2-
import unified from 'unified'
1+
import {VFile} from 'vfile'
2+
import {unified} from 'unified'
33
import remarkParse from 'remark-parse'
4+
import remarkGfm from 'remark-gfm'
45
import remarkFrontmatter from 'remark-frontmatter'
56
import remarkMdx from 'remark-mdx'
67
import rehypeParse from 'rehype-parse'
@@ -9,7 +10,7 @@ import retextEquality from 'retext-equality'
910
import retextProfanities from 'retext-profanities'
1011
import remarkRetext from 'remark-retext'
1112
import rehypeRetext from 'rehype-retext'
12-
import sort from 'vfile-sort'
13+
import {sort} from 'vfile-sort'
1314
import {filter} from './filter.js'
1415

1516
function makeText(config) {
@@ -54,6 +55,7 @@ export function markdown(value, config) {
5455
config,
5556
unified()
5657
.use(remarkParse)
58+
.use(remarkGfm)
5759
.use(remarkFrontmatter, ['yaml', 'toml'])
5860
.use(remarkRetext, makeText(config))
5961
)

package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,25 @@
6464
"cli.js"
6565
],
6666
"dependencies": {
67-
"meow": "^7.0.0",
68-
"rehype-parse": "^7.0.0",
69-
"rehype-retext": "^2.0.1",
70-
"remark-frontmatter": "^2.0.0",
71-
"remark-mdx": "2.0.0-next.7",
72-
"remark-message-control": "^6.0.0",
73-
"remark-parse": "^8.0.0",
74-
"remark-retext": "^4.0.0",
75-
"retext-english": "^3.0.0",
76-
"retext-equality": "~5.5.0",
77-
"retext-profanities": "~6.1.0",
78-
"unified": "^9.0.0",
79-
"unified-diff": "^3.0.0",
80-
"unified-engine": "^8.0.0",
81-
"update-notifier": "^4.0.0",
82-
"vfile": "^4.0.0",
83-
"vfile-reporter": "^6.0.0",
84-
"vfile-sort": "^2.0.0"
67+
"meow": "^10.0.0",
68+
"rehype-parse": "^8.0.0",
69+
"rehype-retext": "^3.0.0",
70+
"remark-frontmatter": "^4.0.0",
71+
"remark-gfm": "^3.0.0",
72+
"remark-mdx": "2.0.0-rc.1",
73+
"remark-message-control": "^7.0.0",
74+
"remark-parse": "^10.0.0",
75+
"remark-retext": "^5.0.0",
76+
"retext-english": "^4.0.0",
77+
"retext-equality": "~6.3.0",
78+
"retext-profanities": "~7.1.0",
79+
"unified": "^10.0.0",
80+
"unified-diff": "^4.0.0",
81+
"unified-engine": "^9.0.0",
82+
"update-notifier": "^5.0.0",
83+
"vfile": "^5.0.0",
84+
"vfile-reporter": "^7.0.0",
85+
"vfile-sort": "^3.0.0"
8586
},
8687
"devDependencies": {
8788
"c8": "^7.10.0",

readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ We use [`cuss`][cuss], which has a dictionary of words that have a rating
264264
between 0 and 2 of how likely it is that a word or phrase is a profanity (not
265265
how “bad” it is):
266266

267-
| Rating | Use as a profanity | Use in clean text | Example |
268-
| ------ | ------------------ | ----------------- | ------- |
269-
| 2 | likely | unlikely | asshat |
270-
| 1 | maybe | maybe | addict |
271-
| 0 | unlikely | likely | beaver |
267+
| Rating | Use as a profanity | Use in clean text | Example |
268+
| ------ | ------------------ | ----------------- | -------- |
269+
| 2 | likely | unlikely | `asshat` |
270+
| 1 | maybe | maybe | `addict` |
271+
| 0 | unlikely | likely | `beaver` |
272272

273273
The `profanitySureness` field is the minimum rating (including) that you want to
274274
check for.

0 commit comments

Comments
 (0)