mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
chore: add cSpell for spell checking (#6456)
* chore: Add cSpell for spell checking * chore: exclude map files and remove dups * chore: exclude more binary files * chore: remove MD headings * Update .cspell.json * fix a few spellings * fix more * fix Signed-off-by: Joshua Chen <sidachen2003@gmail.com> * fix a few * oops Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
a41a5c328c
commit
521eb119a7
64 changed files with 852 additions and 142 deletions
|
@ -165,7 +165,7 @@ export default function transformer(file: string): string {
|
|||
return root.toSource();
|
||||
}
|
||||
|
||||
function getDefaultImportDeclarators(rootAst: Collection) {
|
||||
function getDefaultImportDeclarations(rootAst: Collection) {
|
||||
// var ... = require('y')
|
||||
return rootAst
|
||||
.find(VariableDeclarator, {
|
||||
|
@ -178,7 +178,7 @@ function getDefaultImportDeclarators(rootAst: Collection) {
|
|||
.filter((variableDeclarator) => !!variableDeclarator.value);
|
||||
}
|
||||
|
||||
function getNamedImportDeclarators(rootAst: Collection) {
|
||||
function getNamedImportDeclarations(rootAst: Collection) {
|
||||
// var ... = require('y').x
|
||||
return rootAst.find(VariableDeclarator, {
|
||||
init: {
|
||||
|
@ -192,9 +192,9 @@ function getNamedImportDeclarators(rootAst: Collection) {
|
|||
}
|
||||
|
||||
function getImportDeclaratorPaths(variableDeclaration: Collection) {
|
||||
const defaultImports = getDefaultImportDeclarators(variableDeclaration);
|
||||
const defaultImports = getDefaultImportDeclarations(variableDeclaration);
|
||||
|
||||
const namedImports = getNamedImportDeclarators(variableDeclaration);
|
||||
const namedImports = getNamedImportDeclarations(variableDeclaration);
|
||||
|
||||
return [...defaultImports.paths(), ...namedImports.paths()];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue