Closed
Description
I want move commitlint.config.js to config directory, but I cannot found option like commitlint --config myapp/config/commitlint.config.js
.
Expected Behavior
$ commitlint --config myapp/config/commitlint.config.js
Current Behavior
$ commitlint --config myapp/config/commitlint.config.js
/home/xxx/myapp/node_modules/@commitlint/cli/lib/cli.js:50
throw new Error(`unknown flags: ${arg}`);
^
Error: unknown flags: --config
at Object.unknown [as unknownFn] (/home/xxx/myapp/node_modules/@commitlint/cli/lib/cli.js:50:9)
at setArg (/home/xxx/myapp/node_modules/meow/node_modules/minimist/index.js:56:23)
at module.exports (/home/xxx/myapp/node_modules/meow/node_modules/minimist/index.js:120:17)
at module.exports (/home/xxx/myapp/node_modules/meow/index.js:44:13)
at Object.<anonymous> (/home/xxx/myapp/node_modules/@commitlint/cli/lib/cli.js:54:11)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Affected packages
- clicorepromptconfig-angular
Activity
marionebl commentedon Jan 29, 2018
This is a reasonable request, thanks for bringing this up.
Want to lend a hand?
This could be implemented like this:
1. Extend CLI to accept a new flag
cli/src/cli.js#L15
2. Pass new flag to
core.load
cli/src/cli.js#L99
3. Pass
options.file
toloadConfig
incore.load
core/src/load.js#L81
**4. Pass
options.file
to cosmiconfig'sconfigPath
lc-soft commentedon Jan 29, 2018
@marionebl
OK, I will take some time to review the information you provided and try to solve this issue, but it may take a few days.
marionebl commentedon Jan 29, 2018
@lc-soft That is awesome, thank you. Do no hesitate to ask if you run into problems.
lc-soft commentedon Feb 1, 2018
@marionebl
npx yarn test
did not run successfully.Console output
lc-soft commentedon Feb 1, 2018
OK, need to run
npx yarn run build
.lc-soft commentedon Feb 1, 2018
Why do not these newline string, but direct display
\n
?lc-soft commentedon Feb 1, 2018
@marionebl
When I do not define an alias for "config" option, the
npx yarn run commitlint --help
command will to print errors. This is a bug?marionebl commentedon Feb 1, 2018
Jep, that is the internal help text generator miss-firing. Works with the g alias, right?
Not sure, might be lerna/yarn/ava interfering
I should document that, tripping over it myself everytime I touch
cli
marionebl commentedon Feb 3, 2018
Released via
6.1.0
, thanks @lc-soft!