remark-lint-no-file-name-mixed-case
Advanced tools
Comparing version 2.1.0 to 2.1.1
export default remarkLintNofileNameMixedCase | ||
export type Root = import('mdast').Root | ||
declare const remarkLintNofileNameMixedCase: import('unified').Plugin< | ||
| void[] | ||
| [unknown] | ||
| void[] | ||
| [ | ||
( | ||
| boolean | ||
| import('unified-lint-rule').Label | ||
| import('unified-lint-rule').Severity | ||
| import('unified-lint-rule').Label | ||
), | ||
@@ -12,0 +12,0 @@ unknown |
16
index.js
/** | ||
* ## When should I use this? | ||
* | ||
* You can use this package to check that file name casing is consistent | ||
* (either lowercase or uppercase). | ||
* | ||
* ## API | ||
* | ||
* There are no options. | ||
* | ||
* @module no-file-name-mixed-case | ||
* @summary | ||
* remark-lint rule to warn when file name casing is inconsistent. | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer | ||
* @license MIT | ||
* @module no-file-name-mixed-case | ||
* @fileoverview | ||
* Warn when file names use mixed case: both upper- and lowercase characters. | ||
* | ||
* @example | ||
@@ -10,0 +18,0 @@ * {"name": "README.md"} |
{ | ||
"name": "remark-lint-no-file-name-mixed-case", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "remark-lint rule to warn when file names use mixed case", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
157
readme.md
@@ -13,4 +13,29 @@ <!--This file is generated--> | ||
Warn when file names use mixed case: both upper- and lowercase characters. | ||
[`remark-lint`][mono] rule to warn when file name casing is inconsistent. | ||
## Contents | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Presets](#presets) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`unified().use(remarkLintNoFileNameMixedCase[, config])`](#unifieduseremarklintnofilenamemixedcase-config) | ||
* [Examples](#examples) | ||
* [Compatibility](#compatibility) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
## What is this? | ||
This package is a [unified][] ([remark][]) plugin, specifically a `remark-lint` | ||
rule. | ||
Lint rules check markdown code style. | ||
## When should I use this? | ||
You can use this package to check that file name casing is consistent | ||
(either lowercase or uppercase). | ||
## Presets | ||
@@ -24,42 +49,56 @@ | ||
## Example | ||
## Install | ||
##### `README.md` | ||
This package is [ESM only][esm]. | ||
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]: | ||
###### Out | ||
```sh | ||
npm install remark-lint-no-file-name-mixed-case | ||
``` | ||
No messages. | ||
In Deno with [Skypack][]: | ||
##### `readme.md` | ||
```js | ||
import remarkLintNoFileNameMixedCase from 'https://cdn.skypack.dev/remark-lint-no-file-name-mixed-case@2?dts' | ||
``` | ||
###### Out | ||
In browsers with [Skypack][]: | ||
No messages. | ||
```html | ||
<script type="module"> | ||
import remarkLintNoFileNameMixedCase from 'https://cdn.skypack.dev/remark-lint-no-file-name-mixed-case@2?min' | ||
</script> | ||
``` | ||
##### `Readme.md` | ||
## Use | ||
###### Out | ||
On the API: | ||
```text | ||
1:1: Do not mix casing in file names | ||
``` | ||
```js | ||
import {read} from 'to-vfile' | ||
import {reporter} from 'vfile-reporter' | ||
import {remark} from 'remark' | ||
import remarkLint from 'remark-lint' | ||
import remarkLintNoFileNameMixedCase from 'remark-lint-no-file-name-mixed-case' | ||
## Install | ||
main() | ||
This package is [ESM only][esm]: | ||
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d. | ||
async function main() { | ||
const file = await remark() | ||
.use(remarkLint) | ||
.use(remarkLintNoFileNameMixedCase) | ||
.process(await read('example.md')) | ||
[npm][]: | ||
console.error(reporter(file)) | ||
} | ||
``` | ||
On the CLI: | ||
```sh | ||
npm install remark-lint-no-file-name-mixed-case | ||
remark --use remark-lint --use remark-lint-no-file-name-mixed-case example.md | ||
``` | ||
This package exports no identifiers. | ||
The default export is `remarkLintNoFileNameMixedCase`. | ||
On the CLI in a config file (here a `package.json`): | ||
## Use | ||
You probably want to use it on the CLI through a config file: | ||
```diff | ||
@@ -70,4 +109,4 @@ … | ||
… | ||
"lint", | ||
+ "lint-no-file-name-mixed-case", | ||
"remark-lint", | ||
+ "remark-lint-no-file-name-mixed-case", | ||
… | ||
@@ -79,25 +118,43 @@ ] | ||
Or use it on the CLI directly | ||
## API | ||
```sh | ||
remark -u lint -u lint-no-file-name-mixed-case readme.md | ||
``` | ||
This package exports no identifiers. | ||
The default export is `remarkLintNoFileNameMixedCase`. | ||
Or use this on the API: | ||
### `unified().use(remarkLintNoFileNameMixedCase[, config])` | ||
```diff | ||
import {remark} from 'remark' | ||
import {reporter} from 'vfile-reporter' | ||
import remarkLint from 'remark-lint' | ||
import remarkLintNoFileNameMixedCase from 'remark-lint-no-file-name-mixed-case' | ||
This rule supports standard configuration that all remark lint rules accept | ||
(such as `false` to turn it off or `[1, options]` to configure it). | ||
remark() | ||
.use(remarkLint) | ||
+ .use(remarkLintNoFileNameMixedCase) | ||
.process('_Emphasis_ and **importance**') | ||
.then((file) => { | ||
console.error(reporter(file)) | ||
}) | ||
There are no options. | ||
## Examples | ||
##### `README.md` | ||
###### Out | ||
No messages. | ||
##### `readme.md` | ||
###### Out | ||
No messages. | ||
##### `Readme.md` | ||
###### Out | ||
```text | ||
1:1: Do not mix casing in file names | ||
``` | ||
## Compatibility | ||
Projects maintained by the unified collective are compatible with all maintained | ||
versions of Node.js. | ||
As of now, that is Node.js 12.20+, 14.14+, and 16.0+. | ||
Our projects sometimes work with older versions, but this is not guaranteed. | ||
## Contribute | ||
@@ -143,4 +200,12 @@ | ||
[unified]: https://github.com/unifiedjs/unified | ||
[remark]: https://github.com/remarkjs/remark | ||
[mono]: https://github.com/remarkjs/remark-lint | ||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c | ||
[skypack]: https://www.skypack.dev | ||
[npm]: https://docs.npmjs.com/cli/install | ||
@@ -150,7 +215,7 @@ | ||
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md | ||
[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md | ||
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md | ||
[support]: https://github.com/remarkjs/.github/blob/main/support.md | ||
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md | ||
[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md | ||
@@ -157,0 +222,0 @@ [license]: https://github.com/remarkjs/remark-lint/blob/main/license |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8153
61
219