chore(v2): fix code style (revert previous changes)

This commit is contained in:
Alexey Pyltsyn 2020-04-05 17:38:12 +03:00
parent 1480a7eb80
commit 1f00d15c74
143 changed files with 457 additions and 458 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