Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
1
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 1.0.1 to 1.0.2

25

index.js

@@ -34,21 +34,26 @@ /**

'use strict';
'use strict'
var rule = require('unified-lint-rule');
var rule = require('unified-lint-rule')
module.exports = rule('remark-lint:no-file-name-irregular-characters', noFileNameIrregularCharacters);
module.exports = rule(
'remark-lint:no-file-name-irregular-characters',
noFileNameIrregularCharacters
)
function noFileNameIrregularCharacters(ast, file, preferred) {
var expression = preferred || /[^\\.a-zA-Z0-9-]/;
var match;
var expression = /[^\\.a-zA-Z0-9-]/
if (typeof expression === 'string') {
expression = new RegExp('[^' + expression + ']');
function noFileNameIrregularCharacters(tree, file, pref) {
var style = pref || expression
var match
if (typeof style === 'string') {
style = new RegExp('[^' + style + ']')
}
match = file.stem && file.stem.match(expression);
match = file.stem && file.stem.match(style)
if (match) {
file.message('Do not use `' + match[0] + '` in a file name');
file.message('Do not use `' + match[0] + '` in a file name')
}
}

6

package.json
{
"name": "remark-lint-no-file-name-irregular-characters",
"version": "1.0.1",
"version": "1.0.2",
"description": "remark-lint rule to warn when file names contain irregular characters",

@@ -15,4 +15,4 @@ "license": "MIT",

],
"repository": "https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-no-file-name-irregular-characters",
"bugs": "https://github.com/wooorm/remark-lint/issues",
"repository": "https://github.com/remarkjs/remark-lint/tree/master/packages/remark-lint-no-file-name-irregular-characters",
"bugs": "https://github.com/remarkjs/remark-lint/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",

@@ -19,0 +19,0 @@ "contributors": [

@@ -21,3 +21,3 @@ <!--This file is generated-->

| ------ | ------- |
| [`remark-preset-lint-markdown-style-guide`](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide) | |
| [`remark-preset-lint-markdown-style-guide`](https://github.com/remarkjs/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide) | |

@@ -109,2 +109,2 @@ ## Example

[MIT](https://github.com/wooorm/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com)
[MIT](https://github.com/remarkjs/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com)
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