1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +02:00

lint & example fixes (#3160)

* fix import extensions of eslint

* revert next.config.cjs

* fix eslint globbing

* add migrating to docs’ sidebar

* fix prettier error on Contributing.md

* put quotes for glob matching for windows user

* remove type: module from  package.json
This commit is contained in:
Irwan Fario Subastian
2019-11-29 16:16:39 +11:00
committed by Ian Storm Taylor
parent ac21510597
commit cedc7dc2a5
11 changed files with 8 additions and 11 deletions

23
site/next.config.js Normal file
View File

@@ -0,0 +1,23 @@
const fs = require('fs')
const path = require('path')
module.exports = {
exportPathMap: async (defaultPathMap, config) => {
const { dir } = config
const examples = fs.readdirSync(path.resolve(dir, 'examples'))
const pages = {
'/': { page: '/' },
}
for (const file of examples) {
if (!file.endsWith('.js')) {
continue
}
const example = file.replace('.js', '')
pages[`/examples/${example}`] = { page: '/examples/[example]', example }
}
return pages
},
}