Skip to content

Commit

Permalink
fix(config): use correct package name
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Nov 1, 2018
1 parent 90fe70f commit a12d57f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ yarn add -D husky @endemolshinegroup/git-author-check
This package uses Cosmiconfig to load its' configuration, so you can add a
configuration file in one of the following ways:

- a `gitAuthorCheck` property in package.json
- a `gitauthorcheck` property in package.json

```json
{
"gitAuthorCheck": {
"gitauthorcheck": {
"allowedDomains": [
"endemolshine.com"
]
Expand Down
6 changes: 5 additions & 1 deletion src/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import TypeScriptLoader from '@endemolshinegroup/cosmiconfig-typescript-loader';
import cosmiconfig, { CosmiconfigResult } from 'cosmiconfig';

const pkg = require('../package.json');

export default (): CosmiconfigResult => {
const explorer = cosmiconfig('gitAuthorCheck', {
const moduleName = pkg.name.split('/')[1].replace(/-/g, '');

const explorer = cosmiconfig(moduleName, {
loaders: {
'.ts': {
async: TypeScriptLoader,
Expand Down

0 comments on commit a12d57f

Please sign in to comment.