mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update eslint dependency to 1.5.1, update code for new rules.
This commit is contained in:
parent
bf07e3b845
commit
7af794bb21
5 changed files with 46 additions and 39 deletions
71
.eslintrc
71
.eslintrc
|
@ -1,35 +1,31 @@
|
||||||
{
|
{
|
||||||
"ecmaFeatures": {},
|
|
||||||
"parser": "espree",
|
|
||||||
"env": {
|
"env": {
|
||||||
"browser": false,
|
"node": true
|
||||||
"node": true,
|
|
||||||
"amd": false,
|
|
||||||
"mocha": false,
|
|
||||||
"jasmine": false
|
|
||||||
},
|
},
|
||||||
|
"parser": "espree",
|
||||||
|
"ecmaFeatures": {},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-alert": 2,
|
"no-alert": 2,
|
||||||
"no-array-constructor": 2,
|
"no-array-constructor": 2,
|
||||||
"no-bitwise": 0,
|
"no-bitwise": 0,
|
||||||
"no-caller": 2,
|
"no-caller": 2,
|
||||||
"no-catch-shadow": 2,
|
"no-catch-shadow": 2,
|
||||||
"no-comma-dangle": 2,
|
"no-class-assign": 2,
|
||||||
"no-cond-assign": 2,
|
"no-cond-assign": 2,
|
||||||
"no-console": 2,
|
"no-console": 2,
|
||||||
|
"no-const-assign": 2,
|
||||||
"no-constant-condition": 2,
|
"no-constant-condition": 2,
|
||||||
"no-continue": 2,
|
"no-continue": 2,
|
||||||
"no-control-regex": 2,
|
"no-control-regex": 2,
|
||||||
"no-debugger": 2,
|
"no-debugger": 2,
|
||||||
"no-delete-var": 2,
|
"no-delete-var": 2,
|
||||||
"no-div-regex": 2,
|
"no-div-regex": 2,
|
||||||
|
"no-dupe-class-members": 2,
|
||||||
"no-dupe-keys": 2,
|
"no-dupe-keys": 2,
|
||||||
"no-dupe-args": 2,
|
"no-dupe-args": 2,
|
||||||
"no-duplicate-case": 2,
|
"no-duplicate-case": 2,
|
||||||
"no-else-return": 2,
|
"no-else-return": 2,
|
||||||
"no-empty": 2,
|
"no-empty": 2,
|
||||||
"no-empty-class": 2,
|
|
||||||
"no-empty-character-class": 2,
|
"no-empty-character-class": 2,
|
||||||
"no-empty-label": 2,
|
"no-empty-label": 2,
|
||||||
"no-eq-null": 2,
|
"no-eq-null": 2,
|
||||||
|
@ -40,14 +36,15 @@
|
||||||
"no-extra-boolean-cast": 2,
|
"no-extra-boolean-cast": 2,
|
||||||
"no-extra-parens": 0,
|
"no-extra-parens": 0,
|
||||||
"no-extra-semi": 2,
|
"no-extra-semi": 2,
|
||||||
"no-extra-strict": 2,
|
|
||||||
"no-fallthrough": 2,
|
"no-fallthrough": 2,
|
||||||
"no-floating-decimal": 2,
|
"no-floating-decimal": 2,
|
||||||
"no-func-assign": 2,
|
"no-func-assign": 2,
|
||||||
|
"no-implicit-coercion": 0,
|
||||||
"no-implied-eval": 2,
|
"no-implied-eval": 2,
|
||||||
"no-inline-comments": 2,
|
"no-inline-comments": 2,
|
||||||
"no-inner-declarations": [2, "functions"],
|
"no-inner-declarations": [2, "functions"],
|
||||||
"no-invalid-regexp": 2,
|
"no-invalid-regexp": 2,
|
||||||
|
"no-invalid-this": 0,
|
||||||
"no-irregular-whitespace": 2,
|
"no-irregular-whitespace": 2,
|
||||||
"no-iterator": 2,
|
"no-iterator": 2,
|
||||||
"no-label-var": 2,
|
"no-label-var": 2,
|
||||||
|
@ -55,7 +52,7 @@
|
||||||
"no-lone-blocks": 2,
|
"no-lone-blocks": 2,
|
||||||
"no-lonely-if": 2,
|
"no-lonely-if": 2,
|
||||||
"no-loop-func": 2,
|
"no-loop-func": 2,
|
||||||
"no-mixed-requires": [2, true],
|
"no-mixed-requires": [2, false],
|
||||||
"no-mixed-spaces-and-tabs": [2, false],
|
"no-mixed-spaces-and-tabs": [2, false],
|
||||||
"linebreak-style": [0, "unix"],
|
"linebreak-style": [0, "unix"],
|
||||||
"no-multi-spaces": 2,
|
"no-multi-spaces": 2,
|
||||||
|
@ -80,15 +77,14 @@
|
||||||
"no-proto": 2,
|
"no-proto": 2,
|
||||||
"no-redeclare": 2,
|
"no-redeclare": 2,
|
||||||
"no-regex-spaces": 2,
|
"no-regex-spaces": 2,
|
||||||
"no-reserved-keys": 2,
|
"no-restricted-modules": 2,
|
||||||
"no-restricted-modules": 0,
|
"no-restricted-syntax": 2,
|
||||||
"no-return-assign": 2,
|
"no-return-assign": 2,
|
||||||
"no-script-url": 2,
|
"no-script-url": 2,
|
||||||
"no-self-compare": 2,
|
"no-self-compare": 2,
|
||||||
"no-sequences": 2,
|
"no-sequences": 2,
|
||||||
"no-shadow": 2,
|
"no-shadow": 2,
|
||||||
"no-shadow-restricted-names": 2,
|
"no-shadow-restricted-names": 2,
|
||||||
"no-space-before-semi": 2,
|
|
||||||
"no-spaced-func": 2,
|
"no-spaced-func": 2,
|
||||||
"no-sparse-arrays": 2,
|
"no-sparse-arrays": 2,
|
||||||
"no-sync": 0,
|
"no-sync": 0,
|
||||||
|
@ -106,17 +102,21 @@
|
||||||
"no-unused-expressions": 2,
|
"no-unused-expressions": 2,
|
||||||
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
|
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
|
||||||
"no-use-before-define": 2,
|
"no-use-before-define": 2,
|
||||||
|
"no-useless-call": 2,
|
||||||
|
"no-useless-concat": 2,
|
||||||
"no-void": 2,
|
"no-void": 2,
|
||||||
"no-var": 0,
|
"no-var": 0,
|
||||||
"prefer-const": 2,
|
"no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
|
||||||
"no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "anywhere" }],
|
|
||||||
"no-with": 2,
|
"no-with": 2,
|
||||||
"no-wrap-func": 2,
|
|
||||||
|
|
||||||
"array-bracket-spacing": [2, "always"],
|
"array-bracket-spacing": [2, "always"],
|
||||||
|
"arrow-parens": 2,
|
||||||
|
"arrow-spacing": 2,
|
||||||
"accessor-pairs": 2,
|
"accessor-pairs": 2,
|
||||||
"block-scoped-var": 2,
|
"block-scoped-var": 2,
|
||||||
|
"block-spacing": 2,
|
||||||
"brace-style": [2, "1tbs"],
|
"brace-style": [2, "1tbs"],
|
||||||
|
"callback-return": 0,
|
||||||
"camelcase": 2,
|
"camelcase": 2,
|
||||||
"comma-dangle": [2, "never"],
|
"comma-dangle": [2, "never"],
|
||||||
"comma-spacing": 2,
|
"comma-spacing": 2,
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
"complexity": [2, 11],
|
"complexity": [2, 11],
|
||||||
"computed-property-spacing": [2, "never"],
|
"computed-property-spacing": [2, "never"],
|
||||||
"consistent-return": 2,
|
"consistent-return": 2,
|
||||||
"consistent-this": [2, "self"],
|
"consistent-this": [2, "that"],
|
||||||
"constructor-super": 2,
|
"constructor-super": 2,
|
||||||
"curly": [2, "all"],
|
"curly": [2, "all"],
|
||||||
"default-case": 2,
|
"default-case": 2,
|
||||||
|
@ -134,16 +134,18 @@
|
||||||
"eqeqeq": 2,
|
"eqeqeq": 2,
|
||||||
"func-names": 2,
|
"func-names": 2,
|
||||||
"func-style": [2, "declaration"],
|
"func-style": [2, "declaration"],
|
||||||
"generator-star": 2,
|
|
||||||
"generator-star-spacing": 2,
|
"generator-star-spacing": 2,
|
||||||
"global-strict": [2, "always"],
|
"global-require": 0,
|
||||||
"guard-for-in": 2,
|
"guard-for-in": 2,
|
||||||
"handle-callback-err": 2,
|
"handle-callback-err": 2,
|
||||||
"indent": [2, 2],
|
"id-length": 0,
|
||||||
|
"indent": [2, 2, {"SwitchCase": 1}],
|
||||||
|
"init-declarations": 2,
|
||||||
|
"jsx-quotes": [2, "prefer-double"],
|
||||||
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
|
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
|
||||||
"lines-around-comment": 0,
|
"lines-around-comment": 0,
|
||||||
"max-depth": [2, 4],
|
"max-depth": [2, 4],
|
||||||
"max-len": [2, 80, 2],
|
"max-len": [2, 80, 4],
|
||||||
"max-nested-callbacks": [2, 3],
|
"max-nested-callbacks": [2, 3],
|
||||||
"max-params": [2, 5],
|
"max-params": [2, 5],
|
||||||
"max-statements": [2, 20],
|
"max-statements": [2, 20],
|
||||||
|
@ -152,29 +154,34 @@
|
||||||
"newline-after-var": 0,
|
"newline-after-var": 0,
|
||||||
"object-curly-spacing": [2, "always"],
|
"object-curly-spacing": [2, "always"],
|
||||||
"object-shorthand": 0,
|
"object-shorthand": 0,
|
||||||
"one-var": 0,
|
"one-var": [2, "never"],
|
||||||
"operator-assignment": [2, "always"],
|
"operator-assignment": [2, "always"],
|
||||||
"operator-linebreak": 2,
|
"operator-linebreak": [2, "after"],
|
||||||
"padded-blocks": [2, "never"],
|
"padded-blocks": 0,
|
||||||
|
"prefer-arrow-callback": 0,
|
||||||
|
"prefer-const": 0,
|
||||||
|
"prefer-spread": 0,
|
||||||
|
"prefer-reflect": 0,
|
||||||
|
"prefer-template": 0,
|
||||||
"quote-props": 2,
|
"quote-props": 2,
|
||||||
"quotes": [2, "double"],
|
"quotes": [2, "double"],
|
||||||
"radix": 2,
|
"radix": 2,
|
||||||
|
"id-match": 2,
|
||||||
|
"require-jsdoc": 0,
|
||||||
|
"require-yield": 2,
|
||||||
"semi": 2,
|
"semi": 2,
|
||||||
"semi-spacing": [2, {"before": false, "after": true}],
|
"semi-spacing": [2, {"before": false, "after": true}],
|
||||||
"sort-vars": 0,
|
"sort-vars": 0,
|
||||||
"space-after-function-name": [2, "never"],
|
|
||||||
"space-after-keywords": [2, "always"],
|
"space-after-keywords": [2, "always"],
|
||||||
|
"space-before-keywords": [2, "always"],
|
||||||
"space-before-blocks": [2, "always"],
|
"space-before-blocks": [2, "always"],
|
||||||
"space-before-function-paren": [2, "never"],
|
"space-before-function-paren": [2, "never"],
|
||||||
"space-before-function-parentheses": [2, "never"],
|
|
||||||
"space-in-brackets": [2, "always", { "propertyName": false }],
|
|
||||||
"space-in-parens": [2, "never"],
|
"space-in-parens": [2, "never"],
|
||||||
"space-infix-ops": 2,
|
"space-infix-ops": 2,
|
||||||
"space-return-throw-case": 2,
|
"space-return-throw-case": 2,
|
||||||
"space-unary-ops": [2, { "words": true, "nonwords": false }],
|
"space-unary-ops": [2, { "words": true, "nonwords": false }],
|
||||||
"spaced-comment": 0,
|
"spaced-comment": 2,
|
||||||
"spaced-line-comment": [2, "always"],
|
"strict": [2, "global"],
|
||||||
"strict": 2,
|
|
||||||
"use-isnan": 2,
|
"use-isnan": 2,
|
||||||
"valid-jsdoc": 2,
|
"valid-jsdoc": 2,
|
||||||
"valid-typeof": 2,
|
"valid-typeof": 2,
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
markdown.addEventListener("input", onMarkdownInput);
|
markdown.addEventListener("input", onMarkdownInput);
|
||||||
violations.addEventListener("click", onLineNumberClick, true);
|
violations.addEventListener("click", onLineNumberClick, true);
|
||||||
|
|
||||||
/*eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
markdown.value = [
|
markdown.value = [
|
||||||
"## Introduction",
|
"## Introduction",
|
||||||
"",
|
"",
|
||||||
|
@ -140,6 +140,6 @@
|
||||||
"",
|
"",
|
||||||
"[`markdownlint/Ruby`](https://github.com/mivok/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!"
|
"[`markdownlint/Ruby`](https://github.com/mivok/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!"
|
||||||
].join("\n");
|
].join("\n");
|
||||||
/*eslint-enable max-len */
|
/* eslint-enable max-len */
|
||||||
onMarkdownInput();
|
onMarkdownInput();
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -29,10 +29,10 @@ rules.forEach(function forRule(rule) {
|
||||||
// Class for results with toString for pretty display
|
// Class for results with toString for pretty display
|
||||||
function Results() { }
|
function Results() { }
|
||||||
Results.prototype.toString = function resultsToString() {
|
Results.prototype.toString = function resultsToString() {
|
||||||
var self = this;
|
var that = this;
|
||||||
var results = [];
|
var results = [];
|
||||||
Object.keys(self).forEach(function forFile(file) {
|
Object.keys(that).forEach(function forFile(file) {
|
||||||
var fileResults = self[file];
|
var fileResults = that[file];
|
||||||
Object.keys(fileResults).forEach(function forRule(rule) {
|
Object.keys(fileResults).forEach(function forRule(rule) {
|
||||||
var ruleResults = fileResults[rule];
|
var ruleResults = fileResults[rule];
|
||||||
ruleResults.forEach(function forLine(lineNumber) {
|
ruleResults.forEach(function forLine(lineNumber) {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^11.2.0",
|
"browserify": "^11.2.0",
|
||||||
"cpy": "^3.4.1",
|
"cpy": "^3.4.1",
|
||||||
"eslint": "^0.24.1",
|
"eslint": "^1.5.1",
|
||||||
"istanbul": "^0.3.21",
|
"istanbul": "^0.3.21",
|
||||||
"nodeunit": "^0.9.1",
|
"nodeunit": "^0.9.1",
|
||||||
"q": "^1.4.0",
|
"q": "^1.4.0",
|
||||||
|
|
|
@ -41,7 +41,7 @@ function createTestForFile(file) {
|
||||||
var results = {};
|
var results = {};
|
||||||
lines.forEach(function forLine(line, lineNum) {
|
lines.forEach(function forLine(line, lineNum) {
|
||||||
var regex = /\{(MD\d+)(?::(\d+))?\}/g;
|
var regex = /\{(MD\d+)(?::(\d+))?\}/g;
|
||||||
var match;
|
var match = null;
|
||||||
while ((match = regex.exec(line))) {
|
while ((match = regex.exec(line))) {
|
||||||
var rule = match[1];
|
var rule = match[1];
|
||||||
var errors = results[rule] || [];
|
var errors = results[rule] || [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue