Socket
Socket
Sign inDemoInstall

remark-lint-no-file-name-irregular-characters

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-no-file-name-irregular-characters - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

2

index.d.ts

@@ -10,4 +10,4 @@ export default remarkLintNoFileNameIrregularCharacters

| boolean
| import('unified-lint-rule').Label
| import('unified-lint-rule').Severity
| import('unified-lint-rule').Label
),

@@ -14,0 +14,0 @@ Options

/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module no-file-name-irregular-characters
* @fileoverview
* Warn when file names contain irregular characters: characters other than
* alphanumericals (`a-zA-Z0-9`), hyphen-minus (`-`), and dots (`.`, full
* stops).
* ## When should I use this?
*
* Options: `RegExp` or `string`, default: `'\\.a-zA-Z0-9-'`.
* You can use this package to check that file names contain regular characters.
*
* If a string is given, it will be wrapped in
* `new RegExp('[^' + preferred + ']')`.
* ## API
*
* Any match by the wrapped or given expressions creates a message.
* The following options (default: `'\\.a-zA-Z0-9-'`) are accepted:
*
* * `string` (example `'\w\\.'`)
* — allowed characters, wrapped in `new RegExp('[^' + x + ']')`, make sure
* to double escape regexp characters
* * `RegExp` (example `/[^\.a-zA-Z0-9-]/`)
* — disallowed pattern
*
* @module no-file-name-irregular-characters
* @summary
* remark-lint rule to warn when file names contain irregular characters.
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @example

@@ -19,0 +23,0 @@ * {"name": "plug-ins.md"}

{
"name": "remark-lint-no-file-name-irregular-characters",
"version": "2.1.0",
"version": "2.1.1",
"description": "remark-lint rule to warn when file names contain irregular characters",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -13,13 +13,28 @@ <!--This file is generated-->

Warn when file names contain irregular characters: characters other than
alphanumericals (`a-zA-Z0-9`), hyphen-minus (`-`), and dots (`.`, full
stops).
[`remark-lint`][mono] rule to warn when file names contain irregular characters.
Options: `RegExp` or `string`, default: `'\\.a-zA-Z0-9-'`.
## Contents
If a string is given, it will be wrapped in
`new RegExp('[^' + preferred + ']')`.
* [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(remarkLintNoFileNameIrregularCharacters[, config])`](#unifieduseremarklintnofilenameirregularcharacters-config)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
Any match by the wrapped or given expressions creates a message.
## 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 names contain regular characters.
## Presets

@@ -33,4 +48,89 @@

## Example
## Install
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
```sh
npm install remark-lint-no-file-name-irregular-characters
```
In Deno with [Skypack][]:
```js
import remarkLintNoFileNameIrregularCharacters from 'https://cdn.skypack.dev/remark-lint-no-file-name-irregular-characters@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import remarkLintNoFileNameIrregularCharacters from 'https://cdn.skypack.dev/remark-lint-no-file-name-irregular-characters@2?min'
</script>
```
## Use
On the API:
```js
import {read} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {remark} from 'remark'
import remarkLint from 'remark-lint'
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
main()
async function main() {
const file = await remark()
.use(remarkLint)
.use(remarkLintNoFileNameIrregularCharacters)
.process(await read('example.md'))
console.error(reporter(file))
}
```
On the CLI:
```sh
remark --use remark-lint --use remark-lint-no-file-name-irregular-characters example.md
```
On the CLI in a config file (here a `package.json`):
```diff
"remarkConfig": {
"plugins": [
"remark-lint",
+ "remark-lint-no-file-name-irregular-characters",
]
}
```
## API
This package exports no identifiers.
The default export is `remarkLintNoFileNameIrregularCharacters`.
### `unified().use(remarkLintNoFileNameIrregularCharacters[, config])`
This rule supports standard configuration that all remark lint rules accept
(such as `false` to turn it off or `[1, options]` to configure it).
The following options (default: `'\\.a-zA-Z0-9-'`) are accepted:
* `string` (example `'\w\\.'`)
— allowed characters, wrapped in `new RegExp('[^' + x + ']')`, make sure
to double escape regexp characters
* `RegExp` (example `/[^\.a-zA-Z0-9-]/`)
— disallowed pattern
## Examples
##### `plug-ins.md`

@@ -74,56 +174,9 @@

## Install
## Compatibility
This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.
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.
[npm][]:
```sh
npm install remark-lint-no-file-name-irregular-characters
```
This package exports no identifiers.
The default export is `remarkLintNoFileNameIrregularCharacters`.
## Use
You probably want to use it on the CLI through a config file:
```diff
"remarkConfig": {
"plugins": [
"lint",
+ "lint-no-file-name-irregular-characters",
]
}
```
Or use it on the CLI directly
```sh
remark -u lint -u lint-no-file-name-irregular-characters readme.md
```
Or use this on the API:
```diff
import {remark} from 'remark'
import {reporter} from 'vfile-reporter'
import remarkLint from 'remark-lint'
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
remark()
.use(remarkLint)
+ .use(remarkLintNoFileNameIrregularCharacters)
.process('_Emphasis_ and **importance**')
.then((file) => {
console.error(reporter(file))
})
```
## Contribute

@@ -169,4 +222,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

@@ -176,7 +237,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

@@ -183,0 +244,0 @@ [license]: https://github.com/remarkjs/remark-lint/blob/main/license

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc