This repository has been archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 687c6e7
Showing
27 changed files
with
1,718 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
*.log | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instrumentation: | ||
excludes: | ||
- lib/cli-engine.js | ||
- lib/cli.js | ||
- index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
{ | ||
"plugins": [ | ||
"jscs-jsdoc" | ||
], | ||
"jsDoc": { | ||
"checkAnnotations": "jsdoc3", | ||
"checkParamNames": true, | ||
"requireParamTypes": true, | ||
"checkRedundantParams": true, | ||
"checkReturnTypes": true, | ||
"checkRedundantReturns": true, | ||
"requireReturnTypes": true, | ||
"checkTypes": "strictNativeCase", | ||
"checkRedundantAccess": true, | ||
"enforceExistence": true, | ||
"requireHyphenBeforeDescription": 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, | ||
"disallowPaddingNewlinesInBlocks": 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, | ||
"maximumLineLength": 78, | ||
"requireCapitalizedConstructors": true, | ||
"safeContextKeyword": "self", | ||
"requireDotNotation": true, | ||
"disallowYodaConditions": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"checkRedundantParams": true, | ||
"requireParamTypes": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.* | ||
*.log | ||
*.sh | ||
*.png | ||
coverage/ | ||
doc/ | ||
node_modules/ | ||
script/ | ||
test/ | ||
History.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: node_js | ||
script: npm run-script test-travis | ||
node_js: | ||
- '0.10' | ||
- '0.11' | ||
after_script: npm install [email protected] && cat ./coverage/lcov.info | coveralls | ||
deploy: | ||
provider: npm | ||
email: [email protected] | ||
api_key: | ||
secure: Czw0zKRT+trt5ZccmdGvUDVnSlaRVD3C4Id0NMTeY8rmGq0tVfggjJgANGIIOMp9o5OpmEKdKG8XcrL7VgmVGUq5oyOh3Q5C+hke8VDTJvXb7lEltF0u7daXsZBLRbnLPBgxwlzToGhJWOa+oJllD/fX0IhE8MHI0IOqSqqo7y4= | ||
on: | ||
repo: wooorm/eslint-md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Hello World | ||
|
||
```javascript | ||
// Here is a tiny example of `eslint-md`: | ||
process.stdout.write('Linting JavaScript in Markdown?') | ||
|
||
document.title+='cool!!'; | ||
|
||
process.exit(1); | ||
``` | ||
|
||
|
||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(The MIT License) | ||
|
||
Copyright (c) 2015 Titus Wormer <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# eslint-md [![Build Status](https://img.shields.io/travis/wooorm/eslint-md.svg?style=flat)](https://travis-ci.org/wooorm/eslint-md) [![Coverage Status](https://img.shields.io/coveralls/wooorm/eslint-md.svg?style=flat)](https://coveralls.io/r/wooorm/eslint-md?branch=master) | ||
|
||
Lint JavaScript in markdown code blocks with [ESLint](https://github.com/eslint/eslint). | ||
|
||
**eslint-md** works exactly like **eslint** (such as supporting `.eslintrc` and `.eslintignore`), but lints the JavaScript code in Markdown code blocks (with a `js` or `javascript` code flag). | ||
|
||
- **eslint-md**\([1](http://en.wikipedia.org/wiki/Man_page#Manual_sections)\) functions like ESLint’s [Command Line Interface](http://eslint.org/docs/command-line-interface/); | ||
- **eslint-md**\([3](http://en.wikipedia.org/wiki/Man_page#Manual_sections)\) functions like ESLint’s [Node.js API](http://eslint.org/docs/developer-guide/nodejs-api.html). | ||
|
||
![Example Screenshot](https://raw.github.com/wooorm/eslint-md/master/screenshot.png) | ||
|
||
## Installation | ||
|
||
[npm](https://docs.npmjs.com/cli/install): | ||
|
||
```bash | ||
$ npm install eslint-md | ||
``` | ||
|
||
You probably want the CLI: | ||
|
||
```bash | ||
$ npm install --global eslint-md | ||
``` | ||
|
||
## Usage | ||
|
||
Refer to [ESLint’s docs](http://eslint.org/docs/) for more information regarding its functioning. | ||
|
||
```text | ||
Usage: eslint-md [options] file.md [file.md] [dir] | ||
Lint JavaScript in markdown code-blocks with ESLint. | ||
Options: | ||
-h, --help Show help | ||
-c, --config path::String Use configuration from this file | ||
--rulesdir [path::String] Use additional rules from this directory | ||
-f, --format String Use a specific output format - default: stylish | ||
-v, --version Outputs the version number | ||
--reset Set all default rules to off - default: false | ||
--no-eslintrc Disable use of configuration from .eslintrc | ||
--env [String] Specify environments | ||
--ext [String] Specify Markdown file extensions - default: .md, .markd, .markdown | ||
--plugin [String] Specify plugins | ||
--global [String] Define global variables | ||
--rule Object Specify rules | ||
--ignore-path path::String Specify path of ignore file | ||
--no-ignore Disable use of .eslintignore | ||
--no-color Disable color in piped output | ||
-o, --output-file path::String Specify file to write report to | ||
--quiet Report errors only - default: false | ||
--stdin Lint code provided on <STDIN> - default: false | ||
# All ESLint features, such as `.eslintrc` and `.eslintignore` work! | ||
Example: | ||
# Pass all markdown files through eslint with options | ||
$ eslint-md . --rule no-alert:false --global alert | ||
# Readme.md | ||
# 12:19 error Missing semicolon semi | ||
# | ||
# ✖ 1 problem (1 error, 0 warnings) | ||
``` | ||
|
||
## License | ||
|
||
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
/* This is an automatically generated script by `script/build.js` from `eslint`s source */ | ||
|
||
var concat = require("concat-stream"), | ||
cli = require("../lib/cli"); | ||
|
||
var exitCode = 0, | ||
useStdIn = (process.argv.indexOf("--stdin") > -1); | ||
|
||
if (useStdIn) { | ||
process.stdin.pipe(concat({ encoding: "string" }, function(text) { | ||
exitCode = cli.execute(process.argv, text); | ||
})); | ||
} else { | ||
exitCode = cli.execute(process.argv); | ||
} | ||
|
||
/* | ||
* Wait for the stdout buffer to drain. | ||
* See https://github.com/eslint/eslint/issues/317 | ||
*/ | ||
process.on("exit", function() { | ||
process.exit(exitCode); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# eslint-md(1) -- Lint JavaScript in markdown code-blocks | ||
|
||
## SYNOPSIS | ||
|
||
`eslint-md` [options] file.md [file.md] [dir] | ||
|
||
## DESCRIPTION | ||
|
||
**eslint-md** lints JavaScript in markdown code-blocks with ESLint. | ||
|
||
Logs verbose debugging information when `$DEBUG` is set to `"eslint:*"`. | ||
|
||
Options are as follows: | ||
|
||
* `-h`, `--help`: Show help; | ||
* `-c`, `--config` _path::String_: Use configuration from this file; | ||
* `--rulesdir` [_path::String_]: Use additional rules from this directory; | ||
* `-f`, `--format` _String_: Use a specific output format - default: stylish; | ||
* `-v`, `--version`: Outputs the version number; | ||
* `--reset`: Set all default rules to off - default: false; | ||
* `--no-eslintrc`: Disable use of configuration from .eslintrc; | ||
* `--env` [_String_]: Specify environments; | ||
* `--ext` [_String_]: Specify Markdown file extensions - default: .md, .markd, .markdown; | ||
* `--plugin` [_String_]: Specify plugins; | ||
* `--global` [_String_]: Define global variables; | ||
* `--rule` _Object_: Specify rules; | ||
* `--ignore-path` _path::String_: Specify path of ignore file; | ||
* `--no-ignore`: Disable use of .eslintignore; | ||
* `--no-color`: Disable color in piped output; | ||
* `-o`, `--output-file` _path::String_: Specify file to write report to; | ||
* `--quiet`: Report errors only - default: false; | ||
* `--stdin`: Lint code provided on <STDIN> - default: false. | ||
|
||
## BUGS | ||
|
||
<<https://github.com/wooorm/eslint-md/issues>> | ||
|
||
## AUTHOR | ||
|
||
Written by Titus Wormer <<[email protected]>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* This is an automatically generated script by `script/build.js` from `eslint`s source */ | ||
/** | ||
* @fileoverview Expose out ESLint and CLI to require. | ||
* @author Ian Christian Myers | ||
*/ | ||
|
||
"use strict"; | ||
|
||
module.exports = { | ||
linter: require("./lib/eslint-md"), | ||
cli: require("./lib/cli"), | ||
CLIEngine: require("./lib/cli-engine") | ||
}; |
Oops, something went wrong.