mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
Integrate eslint & precommit to codebase (#815)
* add eslint, precommit & refactor * fix exit code 127 * modify contributing.md & add package-lock * use .eslintrc.js
This commit is contained in:
parent
97eaaad744
commit
21dcea2a31
20 changed files with 4836 additions and 2139 deletions
|
@ -10,7 +10,6 @@ const CWD = process.cwd();
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const glob = require('glob');
|
||||
const chalk = require('chalk');
|
||||
|
||||
const metadataUtils = require('./metadataUtils');
|
||||
|
||||
|
@ -180,8 +179,6 @@ function generateMetadataDocs() {
|
|||
const docsDir = path.join(CWD, '../', getDocsPath());
|
||||
let files = glob.sync(CWD + '/../' + getDocsPath() + '/**');
|
||||
files.forEach(file => {
|
||||
let language = 'en';
|
||||
|
||||
const extension = path.extname(file);
|
||||
|
||||
if (extension === '.md' || extension === '.markdown') {
|
||||
|
@ -359,7 +356,7 @@ function generateMetadataBlog() {
|
|||
});
|
||||
|
||||
const sortedMetadatas = metadatas.sort(
|
||||
(a, b) => parseInt(b.seconds) - parseInt(a.seconds)
|
||||
(a, b) => parseInt(b.seconds, 10) - parseInt(a.seconds, 10)
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue