mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Remove superfluous regex escapes
This commit is contained in:
parent
a7000bcf4f
commit
e16665140a
@ -29,7 +29,7 @@ var position = require('unist-util-position');
|
||||
module.exports = definitionCase;
|
||||
|
||||
/* Expressions. */
|
||||
var LABEL = /^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;
|
||||
var LABEL = /^\s*\[((?:\\[\s\S]|[^[\]])+)]/;
|
||||
|
||||
/**
|
||||
* Warn when definitions are not placed at the end of the
|
||||
|
@ -29,7 +29,7 @@ var position = require('unist-util-position');
|
||||
module.exports = definitionSpacing;
|
||||
|
||||
/* Expressions. */
|
||||
var LABEL = /^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;
|
||||
var LABEL = /^\s*\[((?:\\[\s\S]|[^[\]])+)]/;
|
||||
|
||||
/**
|
||||
* Warn when consecutive white space is used in a
|
||||
|
@ -128,7 +128,7 @@ function listItemIndent(ast, file, preferred) {
|
||||
marker = contents.slice(initial, final);
|
||||
|
||||
/* Support checkboxes. */
|
||||
marker = marker.replace(/\[[x ]?\]\s*$/i, '');
|
||||
marker = marker.replace(/\[[x ]?]\s*$/i, '');
|
||||
|
||||
bulletSize = marker.trimRight().length;
|
||||
tab = Math.ceil(bulletSize / 4) * 4;
|
||||
|
@ -49,7 +49,7 @@ module.exports = noFileNameIrregularCharacters;
|
||||
* characters which should not be allowed.
|
||||
*/
|
||||
function noFileNameIrregularCharacters(ast, file, preferred) {
|
||||
var expression = preferred || /[^\\\.a-zA-Z0-9-]/;
|
||||
var expression = preferred || /[^\\.a-zA-Z0-9-]/;
|
||||
var match;
|
||||
|
||||
if (typeof expression === 'string') {
|
||||
|
@ -106,7 +106,7 @@ function orderedListMarkerStyle(ast, file, preferred) {
|
||||
marker = contents.slice(initial, final).replace(/\s|\d/g, '');
|
||||
|
||||
/* Support checkboxes. */
|
||||
marker = marker.replace(/\[[x ]?\]\s*$/i, '');
|
||||
marker = marker.replace(/\[[x ]?]\s*$/i, '');
|
||||
|
||||
if (!preferred) {
|
||||
preferred = marker;
|
||||
|
@ -143,10 +143,10 @@ function orderedListMarkerValue(ast, file, preferred) {
|
||||
return;
|
||||
}
|
||||
|
||||
marker = contents.slice(initial, final).replace(/[\s\.\)]/g, '');
|
||||
marker = contents.slice(initial, final).replace(/[\s.)]/g, '');
|
||||
|
||||
/* Support checkboxes. */
|
||||
marker = Number(marker.replace(/\[[x ]?\]\s*$/i, ''));
|
||||
marker = Number(marker.replace(/\[[x ]?]\s*$/i, ''));
|
||||
|
||||
if (marker !== shouldBe) {
|
||||
file.message('Marker should be `' + shouldBe + '`, was `' + marker + '`', item);
|
||||
|
@ -101,7 +101,7 @@ function unorderedListMarkerStyle(ast, file, preferred) {
|
||||
marker = contents.slice(initial, final).replace(/\s/g, '');
|
||||
|
||||
/* Support checkboxes. */
|
||||
marker = marker.replace(/\[[x ]?\]\s*$/i, '');
|
||||
marker = marker.replace(/\[[x ]?]\s*$/i, '');
|
||||
|
||||
if (!preferred) {
|
||||
preferred = marker;
|
||||
|
Loading…
Reference in New Issue
Block a user