mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-01 05:28:49 +01:00
Add MD044 proper-names "Proper names should have the correct capitalization" (fixes #39).
This commit is contained in:
parent
46cbcfa55e
commit
d8975282dc
13 changed files with 185 additions and 5 deletions
|
|
@ -7,5 +7,10 @@
|
|||
"#### Header 2 {MD001}",
|
||||
"# Broken"
|
||||
]
|
||||
},
|
||||
"MD044": {
|
||||
"names": [
|
||||
"markdownlint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,3 +75,5 @@ code fence without language {MD040:73}
|
|||
```
|
||||
|
||||
[empty link]() {MD042}
|
||||
|
||||
markdownLint {MD044}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,10 @@
|
|||
"headers": [
|
||||
"# Header"
|
||||
]
|
||||
},
|
||||
"MD044": {
|
||||
"names": [
|
||||
"markdownlint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
Not a header
|
||||
|
||||
An [empty]() link
|
||||
|
||||
This is a test file for the MARKDOWNLINT package.
|
||||
|
|
|
|||
|
|
@ -18,12 +18,21 @@
|
|||
"errorRange": [4, 7]
|
||||
},
|
||||
{
|
||||
"lineNumber": 4,
|
||||
"lineNumber": 6,
|
||||
"ruleName": "MD043",
|
||||
"ruleAlias": "required-headers",
|
||||
"ruleDescription": "Required header structure",
|
||||
"errorDetail": null,
|
||||
"errorContext": "# Header",
|
||||
"errorRange": null
|
||||
},
|
||||
{
|
||||
"lineNumber": 5,
|
||||
"ruleName": "MD044",
|
||||
"ruleAlias": "proper-names",
|
||||
"ruleDescription": "Proper names should have the correct capitalization",
|
||||
"errorDetail": "Expected: markdownlint; Actual: MARKDOWNLINT",
|
||||
"errorContext": null,
|
||||
"errorRange": null
|
||||
}
|
||||
]
|
||||
|
|
@ -905,7 +905,7 @@ module.exports.missingStringValue = function missingStringValue(test) {
|
|||
};
|
||||
|
||||
module.exports.ruleNamesUpperCase = function ruleNamesUpperCase(test) {
|
||||
test.expect(39);
|
||||
test.expect(40);
|
||||
rules.forEach(function forRule(rule) {
|
||||
test.equal(rule.name, rule.name.toUpperCase(), "Rule name not upper-case.");
|
||||
});
|
||||
|
|
@ -913,7 +913,7 @@ module.exports.ruleNamesUpperCase = function ruleNamesUpperCase(test) {
|
|||
};
|
||||
|
||||
module.exports.uniqueAliases = function uniqueAliases(test) {
|
||||
test.expect(78);
|
||||
test.expect(80);
|
||||
var tags = [];
|
||||
rules.forEach(function forRule(rule) {
|
||||
Array.prototype.push.apply(tags, rule.tags);
|
||||
|
|
@ -930,7 +930,7 @@ module.exports.uniqueAliases = function uniqueAliases(test) {
|
|||
};
|
||||
|
||||
module.exports.readme = function readme(test) {
|
||||
test.expect(101);
|
||||
test.expect(104);
|
||||
var tagToRules = {};
|
||||
rules.forEach(function forRule(rule) {
|
||||
rule.tags.forEach(function forTag(tag) {
|
||||
|
|
@ -991,7 +991,7 @@ module.exports.readme = function readme(test) {
|
|||
};
|
||||
|
||||
module.exports.doc = function doc(test) {
|
||||
test.expect(295);
|
||||
test.expect(303);
|
||||
fs.readFile("doc/Rules.md", shared.utf8Encoding,
|
||||
function readFile(err, contents) {
|
||||
test.ifError(err);
|
||||
|
|
|
|||
13
test/proper-names.json
Normal file
13
test/proper-names.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD044": {
|
||||
"names": [
|
||||
"markdownlint",
|
||||
"JavaScript",
|
||||
"Node.js",
|
||||
"GitHub",
|
||||
"npm",
|
||||
"Internet Explorer"
|
||||
]
|
||||
}
|
||||
}
|
||||
45
test/proper-names.md
Normal file
45
test/proper-names.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# markdownlint test file
|
||||
|
||||
Markdownlint is a tool {MD044}
|
||||
|
||||
JavaScript is a language
|
||||
|
||||
JavaScript is not Java
|
||||
|
||||
Nor is it Javascript. {MD044}
|
||||
|
||||
markdownlint runs on Node.js via npm
|
||||
|
||||
Node is an environment
|
||||
|
||||
Install into it with NPM {MD044}
|
||||
|
||||
Node.JSX is not a real thing
|
||||
|
||||
Nor is nodesjs or NPMI
|
||||
|
||||
npm can npm stand npm for npm many npm things
|
||||
|
||||
Writing npm is right, but NPM is wrong {MD044}
|
||||
|
||||
Get excited about Github! {MD044}
|
||||
|
||||
Share code on GitHub via Git
|
||||
|
||||
Internet Explorer is a web browser
|
||||
|
||||
OTOH, "internet explorer" is a job {MD044}
|
||||
|
||||
## node.js instructions {MD044}
|
||||
|
||||
Code in `javascript` {MD044}
|
||||
|
||||
Execute `via the node.js engine` {MD044}
|
||||
|
||||
* Use NPM {MD044}
|
||||
|
||||
> Run Markdownlint on your README {MD044}
|
||||
|
||||
Upload the code (to github) {MD044}
|
||||
|
||||
Link to [github](https://github.com/). {MD044}
|
||||
Loading…
Add table
Add a link
Reference in a new issue