Skip to content

Commit

Permalink
fix: wrong hooks where installed by default (#385)
Browse files Browse the repository at this point in the history
* fix: wrong hooks where installed by default

* fix: resolve d2style config from project over package
  • Loading branch information
varl authored Apr 22, 2021
1 parent de4a977 commit 3ac82f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions config/d2-style.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module.exports = {
hooks: {
'commit-msg': ['yarn d2-style commit check "$1"'],
'pre-commit': ['yarn d2-style check'],
'pre-push': ['yarn test'],
'commit-msg': ['yarn d2-style check commit "$1"'],
'pre-commit': ['yarn d2-style check --staged'],
},
tools: {
eslint: ['react'],
Expand Down
3 changes: 1 addition & 2 deletions src/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const log = require('@dhis2/cli-helpers-engine').reporter
const findup = require('find-up')
const { copy, fileExists, deleteFile } = require('./files.js')
const {
PACKAGE_ROOT,
PROJECT_ROOT,
CONFIG_DIR,
TEMPLATE_DIR,
Expand Down Expand Up @@ -113,7 +112,7 @@ const templateConfig = (tool, template) =>
const configured = (tool, template) => fileExists(projectConfig(tool, template))

const resolvedStyleConfig = findup.sync(STYLE_CONFIG_FILES, {
cwd: PACKAGE_ROOT,
cwd: PROJECT_ROOT,
type: 'file',
allowSymlinks: true,
})
Expand Down

0 comments on commit 3ac82f4

Please sign in to comment.