Skip to content

Commit

Permalink
unified-lint-rule: rename RuleMeta type to Meta
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 15, 2023
1 parent be2650a commit 7ca5d3c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
10 changes: 0 additions & 10 deletions packages/unified-lint-rule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,8 @@
*
* Nothing (`Promise<undefined>` or `undefined`).
*
* ### `RuleMeta`
*
* Deprecated.
*
* <!-- To do: remove. -->
*
* [api-meta]: #meta
* [api-rule]: #rule
* [api-rule-meta]: #rulemeta
* [api-lint-rule]: #lintrulemeta-rule
* [github-unist-node]: https://github.com/syntax-tree/unist#node
* [github-unified-plugin]: https://github.com/unifiedjs/unified#plugin
Expand All @@ -94,9 +87,6 @@
*/

/**
* @typedef {import('./lib/index.js').Meta} RuleMeta
* To do: deprecate.
*
* @typedef {import('./lib/index.js').Meta} Meta
*/

Expand Down
14 changes: 2 additions & 12 deletions packages/unified-lint-rule/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* [`lintRule(meta, rule)`](#lintrulemeta-rule)
* [`Meta`](#meta)
* [`Rule`](#rule)
* [`RuleMeta`](#rulemeta)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
Expand Down Expand Up @@ -83,9 +82,8 @@ export default remarkLintFileExtension

This package exports the identifier
[`lintRule`][api-lint-rule].
It exports the [TypeScript][typescript] types
[`Meta`][api-meta] and
[`RuleMeta`][api-rule-meta].
It exports the [TypeScript][typescript] type
[`Meta`][api-meta].
There is no default export.

### `lintRule(meta, rule)`
Expand Down Expand Up @@ -131,12 +129,6 @@ Rule (TypeScript type).

Nothing (`Promise<undefined>` or `undefined`).

### `RuleMeta`

Deprecated.

<!-- To do: remove. -->

## Compatibility

Projects maintained by the unified collective are compatible with maintained
Expand Down Expand Up @@ -168,8 +160,6 @@ abide by its terms.

[api-rule]: #rule

[api-rule-meta]: #rulemeta

[author]: https://wooorm.com

[badge-build-image]: https://github.com/remarkjs/remark-lint/workflows/main/badge.svg
Expand Down
10 changes: 7 additions & 3 deletions script/build-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import {write} from 'to-vfile'
import {plugins, presets} from './info.js'
import {pipelinePackage} from './pipeline-package.js'

const results = await Promise.all(
[...plugins, ...presets].map(function (d) {
const results = await Promise.all([
pipelinePackage('unified-lint-rule'),
...plugins.map(function (d) {
return pipelinePackage(d.name)
}),
...presets.map(function (d) {
return pipelinePackage(d.name)
})
)
])

const files = results.flat()

Expand Down
12 changes: 5 additions & 7 deletions script/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export const presets = []
const names = await fs.readdir(packagesUrl)

for (const name of names) {
if (name.startsWith('remark-lint')) {
await addPlugin(name)
}

if (name.startsWith('remark-preset-lint-')) {
await addPreset(name)
} else if (name === 'unified-lint-rule') {
// Empty.
} else {
await addPlugin(name)
}
}

Expand All @@ -111,9 +111,7 @@ async function addPlugin(name) {
/** @type {string | undefined} */
let ruleId

if (name === 'remark-lint') {
// Empty.
} else {
if (name.startsWith('remark-lint-')) {
ruleId = name.slice('remark-lint-'.length)

const moduleTag = tags.find(function (d) {
Expand Down
3 changes: 2 additions & 1 deletion script/pipeline-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ async function generateReadme(state) {
return d.name === state.name
})
) {
const name = state.name === 'remark-lint' ? state.id : state.origin
const name = state.name.startsWith('remark-lint-') ? state.origin : state.id

assert(name)
if (
!('default' in indexModule) ||
Expand Down

0 comments on commit 7ca5d3c

Please sign in to comment.