Skip to content

Commit

Permalink
temp: add remark-lint package
Browse files Browse the repository at this point in the history
  • Loading branch information
vanyauhalin committed Dec 6, 2024
1 parent d62b2bd commit b647397
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/remark-lint/lib/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {type TransformCallback} from "unified"
import {type Label, type Severity} from "unified-lint-rule"
import {type Node} from "unist"
import {type VFile} from "vfile"

export interface RemarkLintRule<
Tree extends Node = Node,
Option = unknown,
> {
(
config?:
string[] |
Label |
Severity |
[
level: Label | Severity,
option?: Option | undefined,
] |
undefined
):
(
(
tree: Tree,
file: VFile,
next: TransformCallback<Tree>,
) => undefined
) |
undefined

readonly name: string
}
17 changes: 17 additions & 0 deletions packages/remark-lint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@onlyoffice/remark-lint",
"type": "module",
"private": true,
"main": "lib/main.ts",
"scripts": {
"clean": "rimraf node_modules",
"test:types": "tsc",
"test": "pnpm test:types"
},
"dependencies": {
"@types/unist": "3.0.3",
"unified": "11.0.5",
"unified-lint-rule": "3.0.0",
"vfile": "6.0.1"
}
}
4 changes: 4 additions & 0 deletions packages/remark-lint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.base.json",
"include": ["lib"]
}
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b647397

Please sign in to comment.