Skip to content

Commit

Permalink
Update component import lines in styleguidist
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Sep 7, 2020
1 parent f38b0ef commit b4aac60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions styleguidist/styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,16 @@ module.exports = {
* @default false
*/
defaultExample: false,

/**
* Returns the value of the import statement below a components name.
* @function
* @example import ItemTable from ./component/ItemTable/
* @override
*/
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '.js')
const dir = path.dirname(componentPath)
return `import ${name} from '${dir}/';`
}
}

0 comments on commit b4aac60

Please sign in to comment.