mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 18:07:00 +02:00
chore(v2): fix code style
This commit is contained in:
parent
b07507c9cc
commit
6965a668cd
143 changed files with 458 additions and 457 deletions
|
@ -8,9 +8,9 @@
|
|||
const npmToYarn = require('npm-to-yarn');
|
||||
|
||||
// E.g. global install: 'npm i' -> 'yarn'
|
||||
const convertNpmToYarn = (npmCode) => npmToYarn(npmCode, 'yarn');
|
||||
const convertNpmToYarn = npmCode => npmToYarn(npmCode, 'yarn');
|
||||
|
||||
const transformNode = (node) => {
|
||||
const transformNode = node => {
|
||||
const npmCode = node.value;
|
||||
const yarnCode = convertNpmToYarn(node.value);
|
||||
return [
|
||||
|
@ -46,7 +46,7 @@ const transformNode = (node) => {
|
|||
];
|
||||
};
|
||||
|
||||
const matchNode = (node) => node.type === 'code' && node.meta === 'npm2yarn';
|
||||
const matchNode = node => node.type === 'code' && node.meta === 'npm2yarn';
|
||||
const nodeForImport = {
|
||||
type: 'import',
|
||||
value:
|
||||
|
@ -55,7 +55,7 @@ const nodeForImport = {
|
|||
|
||||
module.exports = () => {
|
||||
let transformed = false;
|
||||
const transformer = (node) => {
|
||||
const transformer = node => {
|
||||
if (matchNode(node)) {
|
||||
transformed = true;
|
||||
return transformNode(node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue