Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linting] Use eslint to lint code. + minor refactoring + Travis CI setup #1020

Merged
merged 31 commits into from Feb 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2fa2742
[lint] use eslint + standard rules to lint marked.js
Feder1co5oave Jan 20, 2018
15bcca6
[lint] edit eslint rules to fit marked.js current code style
Feder1co5oave Jan 20, 2018
b2edbd6
[lint] refactor replace() with an OOP approach. ESlint is happier.
Feder1co5oave Jan 20, 2018
7e1836f
[lint] add parens to empty constructor calls
Feder1co5oave Jan 20, 2018
6f8922e
[lint] add eslint indent rule
Feder1co5oave Jan 20, 2018
1a19028
[lint] fix whitespace
Feder1co5oave Jan 20, 2018
d9c471e
[lint] fix var declarations
Feder1co5oave Jan 20, 2018
565b4a0
[lint] make the outer function a recognizable IIFE
Feder1co5oave Jan 20, 2018
3bbcc88
[lint] fix already declared/unused variables
Feder1co5oave Jan 20, 2018
d79bbb6
[lint] add amd environment to eslint to declare `define` global
Feder1co5oave Jan 20, 2018
e5527fb
[lint] auto-fix code style with `npm run lint`
Feder1co5oave Jan 20, 2018
560c5cb
Merge branch 'master' into lint
Feder1co5oave Jan 26, 2018
08e0873
add peer dependencies
UziTech Feb 2, 2018
05e770d
reformat text runner
UziTech Feb 2, 2018
2ab2baf
build minified file
UziTech Feb 2, 2018
d73174d
set showdown version to *
UziTech Feb 2, 2018
5c45ad6
use local copy of gulp to minify
Feder1co5oave Feb 2, 2018
6d2369d
revert, local modules are put in PATH by npm automatically
Feder1co5oave Feb 2, 2018
1bfed03
automatically lint test/index.js too
Feder1co5oave Feb 2, 2018
d4db0b2
[lint] remove unused variable
Feder1co5oave Feb 7, 2018
c345a82
lint es5 code only
Feder1co5oave Feb 8, 2018
a4644bf
[ci] update node versions in travis.yml
Feder1co5oave Feb 4, 2018
555d851
[ci] replace octal literal and don't lint on node 0.10 in travis
Feder1co5oave Feb 8, 2018
df01551
[ci] cache npm packages on travis
Feder1co5oave Feb 8, 2018
3b4e724
Merge remote-tracking branch 'marked/master' into lint
Feder1co5oave Feb 9, 2018
2e2f547
require node>=0.10 in package.json
Feder1co5oave Feb 11, 2018
9fd5192
fix test in browser. Remember to fix() beforehand.
Feder1co5oave Feb 13, 2018
d303e16
[lint] lint test/browser/index.js
Feder1co5oave Feb 13, 2018
ad6484b
!fixup 565b4a0e5b
Feder1co5oave Feb 13, 2018
55ab987
Merge branch 'master' into lint
Feder1co5oave Feb 23, 2018
dfe3d1d
[ci] add latest node stable to travis
Feder1co5oave Feb 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,27 @@
{
"extends": "standard",
"plugins": [
"standard"
],
"parserOptions": { "ecmaVersion": 5 },
"rules": {
"semi": "off",
"indent": ["warn", 2, {
"VariableDeclarator": { "var": 2 },
"SwitchCase": 1,
"outerIIFEBody": 0
}],
"space-before-function-paren": "off",
"operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }],
"no-cond-assign": "off",
"no-useless-escape": "off",
"no-return-assign": "off",
"one-var": "off",
"no-control-regex": "off"
},
"env": {
"node": true,
"browser": true,
"amd": true
}
}
15 changes: 13 additions & 2 deletions .travis.yml
@@ -1,5 +1,16 @@
language: node_js
node_js:
- "0.10"
- "0.8"
- "0.6"
- "4"
- "lts/*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably add node to the versions to get the latest stable version (Node 9.x right now)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. I wanna leave the lts in there too since it is required by the selenium-webdriver which is something I'm working with to do cross-browser tests on Browserstack 馃槈

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya the minimum I always test is lts/* and node

- "node"
script: |
if [ `node --version | cut -d . -f 1,2` = "v0.10" ]; then
sed -i s/0o755/0755/ test/index.js;
npm test;
else
npm run lint && npm test;
fi
cache:
directories:
- node_modules