chore(v2): upgrade devDependencies (#2538)

* chore(v2): upgrade devDependencies

* chore(v2): upgrade devDependencies

* chore: prettier
This commit is contained in:
Yangshun Tay 2020-04-05 19:07:44 +08:00 committed by GitHub
parent ea8c916528
commit b07507c9cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
148 changed files with 2385 additions and 1975 deletions

View file

@ -7,7 +7,7 @@
const path = require('path');
module.exports = function() {
module.exports = function () {
return {
name: 'docusaurus-theme-live-codeblock',

View file

@ -55,7 +55,7 @@ const getHighlightDirectiveRegex = (
// to be more reliable, the opening and closing comment must match
const commentPattern = languages
.map(
lang =>
(lang) =>
`(?:${comments[lang].start}\\s*(${directives})\\s*${comments[lang].end})`,
)
.join('|');
@ -63,7 +63,7 @@ const getHighlightDirectiveRegex = (
return new RegExp(`^\\s*(?:${commentPattern})\\s*$`);
};
// select comment styles based on language
const highlightDirectiveRegex = lang => {
const highlightDirectiveRegex = (lang) => {
switch (lang) {
case 'js':
case 'javascript':
@ -127,7 +127,9 @@ export default ({
if (metastring && highlightLinesRangeRegex.test(metastring)) {
const highlightLinesRange = metastring.match(highlightLinesRangeRegex)[1];
highlightLines = rangeParser.parse(highlightLinesRange).filter(n => n > 0);
highlightLines = rangeParser
.parse(highlightLinesRange)
.filter((n) => n > 0);
}
if (metastring && codeBlockTitleRegex.test(metastring)) {

View file

@ -15,7 +15,7 @@ function Playground({children, theme, transformCode, ...props}) {
return (
<LiveProvider
code={children}
transformCode={transformCode || (code => `${code};`)}
transformCode={transformCode || ((code) => `${code};`)}
theme={theme}
{...props}>
<div