Skip to content

Commit

Permalink
Upgrade vulnerable MarkBind dependencies (#788)
Browse files Browse the repository at this point in the history
Upgrade vulnerable dependencies reported by npm audit:

    Live preview:
        * chokidar: 1.6.1 -> 2.1.5
        * live-server: 1.2.0 -> 1.2.1
    GitHub Pages deployment:
        * gh-pages: 1.1.0 -> 2.0.1
    Building pages:
        * fastmatter: 2.0.1 -> 2.1.0
        * nunjucks: 3.0.0 -> 3.2.0
        * markdown-it-table-of-contents: 0.3.2 -> 0.4.3
    Development tools:
        * eslint: 4.16.0 -> 5.15.3
        * jest: 22.4.3 -> 24.5.0
        * lodash: 4.17.5 -> 4.17.11

During the upgrade of eslint, there are rule specifications that has
changed or deprecated, so some configuration also needs to be updated.
Required upgrades to eslint configs:

    * eslint-config-airbnb-base: 12.1.0 -> 13.1.0
    * eslint-plugin-import: 2.8.0 -> 2.16.0a
    * eslint-plugin-lodash: 2.6.1 -> 5.1.0

Let's also disable new ESLint rules, `no-else-return` and
`implicit-arrow-linebreak`, to comply with existing styles, and
fix import order to match ESLint new sort-import rule.
  • Loading branch information
yamgent authored Mar 25, 2019
2 parents a58a410 + 767f1b0 commit 60adab6
Show file tree
Hide file tree
Showing 8 changed files with 3,812 additions and 4,091 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ module.exports = {
"rules": {
"array-bracket-newline": ["error", { "multiline": true }],
"func-names": "off",
"no-else-return": ["error", { "allowElseIf": true }],
"no-underscore-dangle": "off",
"function-paren-newline": "off",
"implicit-arrow-linebreak": "off",
"indent": [
"error",
2,
Expand Down
7,866 changes: 3,793 additions & 4,073 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
"bootswatch": "^4.3.1",
"chalk": "^1.1.3",
"cheerio": "^0.22.0",
"chokidar": "^1.6.1",
"chokidar": "^2.1.5",
"commander": "^2.9.0",
"ejs": "^2.5.5",
"fastmatter": "^2.0.1",
"fastmatter": "^2.1.0",
"figlet": "^1.2.0",
"find-up": "^2.1.0",
"fs-extra-promise": "^0.4.1",
"gh-pages": "^1.1.0",
"gh-pages": "^2.0.1",
"highlight.js": "^9.10.0",
"htmlparser2": "MarkBind/htmlparser2#v3.10.0-markbind.1",
"ignore": "^3.2.0",
"js-beautify": "^1.6.12",
"live-server": "^1.2.0",
"lodash": "^4.17.5",
"live-server": "^1.2.1",
"lodash": "^4.17.11",
"markdown-it": "^8.3.0",
"markdown-it-anchor": "^5.0.0",
"markdown-it-attrs": "^2.3.2",
Expand All @@ -46,10 +46,10 @@
"markdown-it-linkify-images": "^1.1.0",
"markdown-it-mark": "^2.0.0",
"markdown-it-regexp": "^0.4.0",
"markdown-it-table-of-contents": "^0.3.2",
"markdown-it-table-of-contents": "^0.4.3",
"markdown-it-task-lists": "^1.4.1",
"markdown-it-video": "^0.4.0",
"nunjucks": "^3.0.0",
"nunjucks": "^3.2.0",
"path-is-inside": "^1.0.2",
"progress": "^2.0.0",
"walk-sync": "^0.3.1",
Expand All @@ -76,11 +76,11 @@
},
"devDependencies": {
"diff": "^3.5.0",
"eslint": "^4.16.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-lodash": "^2.6.1",
"jest": "^22.4.3",
"eslint": "^5.15.3",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-lodash": "^5.1.0",
"jest": "^24.5.0",
"memfs": "^2.8.0"
}
}
2 changes: 1 addition & 1 deletion test/functional/testUtil/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const diffHtml = require('./diffHtml');
const fs = require('fs');
const path = require('path');
const walkSync = require('walk-sync');
const diffHtml = require('./diffHtml');

const _ = {};
_.isEqual = require('lodash/isEqual');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_site/testUtil/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const diffHtml = require('./diffHtml');
const fs = require('fs');
const path = require('path');
const walkSync = require('walk-sync');
const diffHtml = require('./diffHtml');

const _ = {};
_.isEqual = require('lodash/isEqual');
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Site.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Site = require('../../src/Site');
const path = require('path');
const fs = require('fs-extra-promise');
const ghpages = require('gh-pages');
const Site = require('../../src/Site');

const {
FOOTER_MD_DEFAULT,
Expand Down
3 changes: 1 addition & 2 deletions test/unit/cliUtil.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const cliUtil = require('../../src/util/cliUtil');
const fs = require('fs');
const path = require('path');

const cliUtil = require('../../src/util/cliUtil');
const { SITE_JSON_DEFAULT } = require('./utils/data');

jest.mock('fs');
Expand Down Expand Up @@ -56,4 +56,3 @@ test('findRootFolder without user specified root throws error if no parent dirs
})
.toThrow(`No config file found in parent directories of ${nestedDir}`);
});

2 changes: 1 addition & 1 deletion test/unit/parser.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const MarkBind = require('../../src/lib/markbind/src/parser.js');
const path = require('path');
const fs = require('fs');
const MarkBind = require('../../src/lib/markbind/src/parser.js');
const { USER_VARIABLES_DEFAULT } = require('./utils/data');

jest.mock('fs');
Expand Down

0 comments on commit 60adab6

Please sign in to comment.