mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Update eslint, jscs style guidelines
This commit is contained in:
parent
de65cd706f
commit
eb82bd9f98
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true
|
||||
},
|
||||
"rules": {
|
||||
"quotes": [2, "single"]
|
||||
}
|
||||
|
128
.jscs.json
128
.jscs.json
@ -8,8 +8,13 @@
|
||||
"remark-lint.js",
|
||||
"remark-lint.min.js"
|
||||
],
|
||||
"preset": "yandex",
|
||||
"requireQuotedKeysInObjects": true,
|
||||
"disallowQuotedKeysInObjects": false,
|
||||
"maximumLineLength": false,
|
||||
"jsDoc": {
|
||||
"checkAnnotations": "jsdoc3",
|
||||
"checkParamExistence": true,
|
||||
"checkParamNames": true,
|
||||
"checkRedundantAccess": true,
|
||||
"checkRedundantParams": true,
|
||||
@ -19,126 +24,9 @@
|
||||
"enforceExistence": true,
|
||||
"requireHyphenBeforeDescription": true,
|
||||
"requireNewlineAfterDescription": true,
|
||||
"requireParamTypes": true,
|
||||
"requireParamDescription": true,
|
||||
"requireParamTypes": true,
|
||||
"requireReturnDescription": true,
|
||||
"requireReturnTypes": true
|
||||
},
|
||||
"requireCurlyBraces": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireSpaceAfterKeywords": [
|
||||
"if",
|
||||
"else",
|
||||
"for",
|
||||
"while",
|
||||
"do",
|
||||
"switch",
|
||||
"return",
|
||||
"try",
|
||||
"catch"
|
||||
],
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true,
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true,
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireBlocksOnNewline": true,
|
||||
"disallowEmptyBlocks": true,
|
||||
"disallowSpacesInsideObjectBrackets": true,
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowDanglingUnderscores": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"requireOperatorBeforeLineBreak": [
|
||||
"?",
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"=",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!==",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<="
|
||||
],
|
||||
"requireSpaceBeforeBinaryOperators": [
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"=",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!=="
|
||||
],
|
||||
"requireSpaceAfterBinaryOperators": [
|
||||
"+",
|
||||
"-",
|
||||
"/",
|
||||
"*",
|
||||
"=",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!=="
|
||||
],
|
||||
"disallowSpaceAfterPrefixUnaryOperators": [
|
||||
"++",
|
||||
"--",
|
||||
"+",
|
||||
"-",
|
||||
"~",
|
||||
"!"
|
||||
],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": [
|
||||
"++",
|
||||
"--"
|
||||
],
|
||||
"disallowImplicitTypeConversion": [
|
||||
"numeric",
|
||||
"boolean",
|
||||
"binary",
|
||||
"string"
|
||||
],
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"disallowKeywords": [
|
||||
"with"
|
||||
],
|
||||
"disallowMultipleLineStrings": true,
|
||||
"disallowMultipleLineBreaks": true,
|
||||
"validateLineBreaks": "LF",
|
||||
"validateQuoteMarks": "'",
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowTrailingComma": true,
|
||||
"disallowKeywordsOnNewLine": [
|
||||
"else"
|
||||
],
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"requireCapitalizedConstructors": true,
|
||||
"safeContextKeyword": "self",
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true
|
||||
}
|
||||
}
|
||||
|
2
index.js
2
index.js
@ -8,4 +8,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
module.exports = require('./lib');
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
var position = require('mdast-util-position');
|
||||
var visit = require('unist-util-visit');
|
||||
|
||||
|
14
lib/index.js
14
lib/index.js
@ -9,6 +9,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -28,7 +30,13 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var exists = fs && fs.existsSync;
|
||||
var resolve = path && path.resolve;
|
||||
var cwd = process && process.cwd();
|
||||
var cwd;
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (typeof global !== 'undefined') {
|
||||
/* global global */
|
||||
cwd = global.process.cwd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory to create a plugin from a rule.
|
||||
@ -358,6 +366,10 @@ function lint(remark, options) {
|
||||
|
||||
/**
|
||||
* Transformer sort messages.
|
||||
*
|
||||
* @param {Node} node - Syntax tree.
|
||||
* @param {VFile} file - Virtual file.
|
||||
* @param {Function} next - Completion handler.
|
||||
*/
|
||||
return function (node, file, next) {
|
||||
sort(file);
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -46,6 +46,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Check file extensions.
|
||||
*
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when the list-item marker style of unordered lists
|
||||
* violate a given style.
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -47,6 +47,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Expose.
|
||||
*/
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -36,6 +36,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -45,7 +47,7 @@ var PROTOCOL = /^[a-z][a-z+.-]+:\/?/i;
|
||||
* Assert `node`s reference starts with a protocol.
|
||||
*
|
||||
* @param {Node} node - Node to test.
|
||||
* @return {boolean}
|
||||
* @return {boolean} - Whether `node` has a protocol.
|
||||
*/
|
||||
function hasProtocol(node) {
|
||||
return PROTOCOL.test(toString(node));
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -52,6 +54,7 @@ function noConsecutiveBlankLines(ast, file, preferred, done) {
|
||||
*
|
||||
* @param {Position} start - Initial.
|
||||
* @param {Position} end - Final.
|
||||
* @param {number} max - Threshold.
|
||||
*/
|
||||
function compare(start, end, max) {
|
||||
var diff = end.line - start.line;
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file name start with an article.
|
||||
*
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain consecutive dashes.
|
||||
*
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain characters other than
|
||||
* alpha-numericals, dashes, and dots (full-stops).
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when a file name uses mixed case: both upper- and
|
||||
* lower case characters.
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain initial or final dashes.
|
||||
*
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when hard-tabs instead of spaces are used.
|
||||
*
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -45,6 +45,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -92,6 +94,13 @@ function tableCellPadding(ast, file, preferred, done) {
|
||||
* Check a fence. Checks both its initial spacing
|
||||
* (between a cell and the fence), and its final
|
||||
* spacing (between the fence and the next cell).
|
||||
*
|
||||
* @param {number} initial - Starting index.
|
||||
* @param {number} final - Closing index.
|
||||
* @param {Node} cell - Table cell.
|
||||
* @param {Node?} next - Following cell.
|
||||
* @param {number} index - Position of `cell` in
|
||||
* its parent.
|
||||
*/
|
||||
function check(initial, final, cell, next, index) {
|
||||
var fence = contents.slice(initial, final);
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -55,6 +57,11 @@ function tablePipeAlignment(ast, file, preferred, done) {
|
||||
/**
|
||||
* Check all pipes after each column are at
|
||||
* aligned.
|
||||
*
|
||||
* @param {number} initial - Starting index.
|
||||
* @param {number} final - Closing index.
|
||||
* @param {number} index - Position of cell in
|
||||
* its parent.
|
||||
*/
|
||||
function check(initial, final, index) {
|
||||
var pos = initial + contents.slice(initial, final).indexOf('|') - offset + 1;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
145
remark-lint.js
145
remark-lint.js
@ -9,6 +9,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
module.exports = require('./lib');
|
||||
|
||||
},{"./lib":3}],2:[function(require,module,exports){
|
||||
@ -25,6 +27,8 @@ module.exports = require('./lib');
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
var position = require('mdast-util-position');
|
||||
var visit = require('unist-util-visit');
|
||||
|
||||
@ -162,6 +166,8 @@ module.exports = attacher;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -181,7 +187,13 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var exists = fs && fs.existsSync;
|
||||
var resolve = path && path.resolve;
|
||||
var cwd = process && process.cwd();
|
||||
var cwd;
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (typeof global !== 'undefined') {
|
||||
/* global global */
|
||||
cwd = global.process.cwd();
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory to create a plugin from a rule.
|
||||
@ -511,6 +523,10 @@ function lint(remark, options) {
|
||||
|
||||
/**
|
||||
* Transformer sort messages.
|
||||
*
|
||||
* @param {Node} node - Syntax tree.
|
||||
* @param {VFile} file - Virtual file.
|
||||
* @param {Function} next - Completion handler.
|
||||
*/
|
||||
return function (node, file, next) {
|
||||
sort(file);
|
||||
@ -556,6 +572,8 @@ module.exports = lint;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -684,6 +702,8 @@ module.exports = blockquoteIndentation;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -845,6 +865,8 @@ module.exports = checkboxCharacterStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -963,6 +985,8 @@ module.exports = checkboxContentIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1075,6 +1099,8 @@ module.exports = codeBlockStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1152,6 +1178,8 @@ module.exports = definitionCase;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1238,6 +1266,8 @@ module.exports = definitionSpacing;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1343,6 +1373,8 @@ module.exports = emphasisMarker;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1451,6 +1483,8 @@ module.exports = fencedCodeFlag;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1544,6 +1578,8 @@ module.exports = fencedCodeMarker;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Check file extensions.
|
||||
*
|
||||
@ -1595,6 +1631,8 @@ module.exports = fileExtension;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1664,6 +1702,8 @@ module.exports = finalDefinition;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when the list-item marker style of unordered lists
|
||||
* violate a given style.
|
||||
@ -1712,6 +1752,8 @@ module.exports = finalNewline;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1767,6 +1809,8 @@ module.exports = firstHeadingLevel;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1830,6 +1874,8 @@ module.exports = hardBreakSpaces;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1924,6 +1970,8 @@ module.exports = headingIncrement;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -1986,6 +2034,8 @@ module.exports = headingStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Expose.
|
||||
*/
|
||||
@ -2084,6 +2134,8 @@ module.exports = {
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2209,6 +2261,8 @@ module.exports = linkTitleStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2291,6 +2345,8 @@ module.exports = listItemBulletIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2429,6 +2485,8 @@ module.exports = listItemContentIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2574,6 +2632,8 @@ module.exports = listItemIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2679,6 +2739,8 @@ module.exports = listItemSpacing;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2753,6 +2815,8 @@ module.exports = maximumHeadingLength;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2926,6 +2990,8 @@ module.exports = maximumLineLength;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -2954,7 +3020,7 @@ var PROTOCOL = /^[a-z][a-z+.-]+:\/?/i;
|
||||
* Assert `node`s reference starts with a protocol.
|
||||
*
|
||||
* @param {Node} node - Node to test.
|
||||
* @return {boolean}
|
||||
* @return {boolean} - Whether `node` has a protocol.
|
||||
*/
|
||||
function hasProtocol(node) {
|
||||
return PROTOCOL.test(toString(node));
|
||||
@ -3015,6 +3081,8 @@ module.exports = noAutoLinkWithoutProtocol;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3104,6 +3172,8 @@ module.exports = noBlockquoteWithoutCaret;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3135,6 +3205,7 @@ function noConsecutiveBlankLines(ast, file, preferred, done) {
|
||||
*
|
||||
* @param {Position} start - Initial.
|
||||
* @param {Position} end - Final.
|
||||
* @param {number} max - Threshold.
|
||||
*/
|
||||
function compare(start, end, max) {
|
||||
var diff = end.line - start.line;
|
||||
@ -3231,6 +3302,8 @@ module.exports = noConsecutiveBlankLines;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3313,6 +3386,8 @@ module.exports = noDuplicateDefinitions;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3391,6 +3466,8 @@ module.exports = noDuplicateHeadings;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3464,6 +3541,8 @@ module.exports = noEmphasisAsHeading;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file name start with an article.
|
||||
*
|
||||
@ -3503,6 +3582,8 @@ module.exports = noFileNameArticles;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain consecutive dashes.
|
||||
*
|
||||
@ -3541,6 +3622,8 @@ module.exports = noFileNameConsecutiveDashes;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain characters other than
|
||||
* alpha-numericals, dashes, and dots (full-stops).
|
||||
@ -3582,6 +3665,8 @@ module.exports = noFileNameIrregularCharacters;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when a file name uses mixed case: both upper- and
|
||||
* lower case characters.
|
||||
@ -3622,6 +3707,8 @@ module.exports = noFileNameMixedCase;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when file names contain initial or final dashes.
|
||||
*
|
||||
@ -3671,6 +3758,8 @@ module.exports = noFileNameOuterDashes;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3801,6 +3890,8 @@ module.exports = noHeadingContentIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3902,6 +3993,8 @@ module.exports = noHeadingIndent;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -3965,6 +4058,8 @@ module.exports = noHeadingPunctuation;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4013,6 +4108,8 @@ module.exports = html;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4081,6 +4178,8 @@ module.exports = noInlinePadding;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4149,6 +4248,8 @@ module.exports = noLiteralURLs;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4234,6 +4335,8 @@ module.exports = noMissingBlankLines;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4309,6 +4412,8 @@ module.exports = noMultipleToplevelHeadings;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4400,6 +4505,8 @@ module.exports = noShellDollars;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4457,6 +4564,8 @@ module.exports = noShortcutReferenceImage;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4514,6 +4623,8 @@ module.exports = noShortcutReferenceLink;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4578,6 +4689,8 @@ module.exports = noTableIndentation;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when hard-tabs instead of spaces are used.
|
||||
*
|
||||
@ -4638,6 +4751,8 @@ module.exports = noTabs;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4773,6 +4888,8 @@ module.exports = orderedListMarkerStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -4909,6 +5026,8 @@ module.exports = orderedListMarkerValue;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -5011,6 +5130,8 @@ module.exports = ruleStyle;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -5103,6 +5224,8 @@ module.exports = strongMarker;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -5164,6 +5287,13 @@ function tableCellPadding(ast, file, preferred, done) {
|
||||
* Check a fence. Checks both its initial spacing
|
||||
* (between a cell and the fence), and its final
|
||||
* spacing (between the fence and the next cell).
|
||||
*
|
||||
* @param {number} initial - Starting index.
|
||||
* @param {number} final - Closing index.
|
||||
* @param {Node} cell - Table cell.
|
||||
* @param {Node?} next - Following cell.
|
||||
* @param {number} index - Position of `cell` in
|
||||
* its parent.
|
||||
*/
|
||||
function check(initial, final, cell, next, index) {
|
||||
var fence = contents.slice(initial, final);
|
||||
@ -5270,6 +5400,8 @@ module.exports = tableCellPadding;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -5306,6 +5438,11 @@ function tablePipeAlignment(ast, file, preferred, done) {
|
||||
/**
|
||||
* Check all pipes after each column are at
|
||||
* aligned.
|
||||
*
|
||||
* @param {number} initial - Starting index.
|
||||
* @param {number} final - Closing index.
|
||||
* @param {number} index - Position of cell in
|
||||
* its parent.
|
||||
*/
|
||||
function check(initial, final, index) {
|
||||
var pos = initial + contents.slice(initial, final).indexOf('|') - offset + 1;
|
||||
@ -5373,6 +5510,8 @@ module.exports = tablePipeAlignment;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
@ -5465,6 +5604,8 @@ module.exports = tablePipes;
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
2
remark-lint.min.js
vendored
2
remark-lint.min.js
vendored
File diff suppressed because one or more lines are too long
@ -10,6 +10,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
/*
|
||||
* Dependencies.
|
||||
*/
|
||||
|
@ -10,8 +10,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env node */
|
||||
|
||||
/*
|
||||
* Dpendencies.
|
||||
* Dependencies.
|
||||
*/
|
||||
|
||||
var visit = require('unist-util-visit');
|
||||
|
2
test/external/index.js
vendored
2
test/external/index.js
vendored
@ -8,6 +8,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/*
|
||||
* Expose.
|
||||
*/
|
||||
|
2
test/external/no-lorem.js
vendored
2
test/external/no-lorem.js
vendored
@ -15,6 +15,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env commonjs */
|
||||
|
||||
/**
|
||||
* Warn when `lorem` is used in a document.
|
||||
*
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/* eslint-env mocha */
|
||||
/* eslint-env node, mocha */
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
@ -35,7 +35,7 @@ var dequal = assert.deepEqual;
|
||||
* Create a `File` from a `filePath`.
|
||||
*
|
||||
* @param {string} filePath - Path to file.
|
||||
* @return {File}
|
||||
* @return {File} - Virtual file representation.
|
||||
*/
|
||||
function toFile(filePath) {
|
||||
var extension = extname(filePath);
|
||||
|
Loading…
Reference in New Issue
Block a user