Skip to content

Commit b188de3

Browse files
committed
2 parents 5bf9830 + 146bb47 commit b188de3

File tree

17 files changed

+190
-237
lines changed

17 files changed

+190
-237
lines changed

@commitlint/cli/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function getEditValue(flags: CliFlags) {
292292
if (flags.env) {
293293
if (!(flags.env in process.env)) {
294294
throw new Error(
295-
`Recieved '${flags.env}' as value for -E | --env, but environment variable '${flags.env}' is not available globally`
295+
`Received '${flags.env}' as value for -E | --env, but environment variable '${flags.env}' is not available globally`
296296
);
297297
}
298298
return process.env[flags.env];

@commitlint/config-conventional/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ echo "fix: some message" # passes
152152
- **condition**: `footer` should have a leading blank line
153153
- **rule**: `always`
154154
- level: `warning`
155-
- **value**
156-
157-
```
158-
100
159-
```
160155

161156
```sh
162157
echo "fix: some message
@@ -195,11 +190,6 @@ but still no line is too long" # passes
195190
- **condition**: `body` should have a leading blank line
196191
- **rule**: `always`
197192
- level: `warning`
198-
- **value**
199-
200-
```js
201-
100;
202-
```
203193

204194
```sh
205195
echo "fix: some message
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"lerna": "4",
3+
"version": "1.0.0",
4+
"packages": ["packages/*"]
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "basic",
3+
"version": "1.0.0",
4+
"devDependencies": {
5+
"lerna": "^4.0.0"
6+
}
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "a",
3+
"version": "1.0.0"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

@commitlint/config-lerna-scopes/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function getPackages(context) {
4949
.then((packages) => {
5050
return packages
5151
.map((pkg) => pkg.name)
52+
.filter(Boolean)
5253
.map((name) => (name.charAt(0) === '@' ? name.split('/')[1] : name));
5354
});
5455
}

@commitlint/config-lerna-scopes/index.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ test('returns expected value for basic lerna repository', async () => {
6060
expect(value).toEqual(['a', 'b']);
6161
});
6262

63+
test('returns expected value for lerna repository containing modules', async () => {
64+
const {'scope-enum': fn} = config.rules;
65+
const cwd = await lerna.bootstrap('modules', __dirname);
66+
67+
const [, , value] = await fn({cwd});
68+
expect(value).toEqual(['a']);
69+
});
70+
6371
test('returns expected value for scoped lerna repository', async () => {
6472
const {'scope-enum': fn} = config.rules;
6573
const cwd = await lerna.bootstrap('scoped', __dirname);

@commitlint/config-lerna-scopes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"globby": "^11.0.1",
3636
"import-from": "3.0.0",
3737
"resolve-pkg": "2.0.0",
38-
"semver": "7.3.4"
38+
"semver": "7.3.5"
3939
},
4040
"devDependencies": {
4141
"@commitlint/test": "^12.1.0",

@commitlint/is-ignored/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"dependencies": {
4343
"@commitlint/types": "^12.0.1",
44-
"semver": "7.3.4"
44+
"semver": "7.3.5"
4545
},
4646
"gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc"
4747
}

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ npx husky add .husky/commit-msg "npx --no-install commitlint --edit $1"
112112
yarn husky add .husky/commit-msg "yarn commitlint --edit $1"
113113
```
114114

115-
If the file `.husky/commit-msg` already exists, you can edit the file and put this:
116-
117-
```sh
118-
# .husky/commit-msg
119-
# ...
120-
npx --no-install commitlint --edit $1
121-
# or
122-
yarn commitlint --edit $1
123-
```
124-
125115
**Detailed Setup instructions**
126116

127117
- [Local setup](https://conventional-changelog.github.io/commitlint/#/guides-local-setup) - Lint messages on commit with husky

docs/guides-ci-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Enforce commit conventions with confidence by linting on your CI servers with `commitlint`.
44

5-
This guide assumes you have a already configured `commitlint` for local usage.
5+
This guide assumes you have already configured `commitlint` for local usage.
66

77
Follow the [Getting Started](./?id=getting-started) for basic installation and configuration instructions.
88

docs/guides-local-setup.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,9 @@ npx husky install
3333
yarn husky install
3434

3535
# Add hook
36-
npx husky add .husky/commit-msg "npx --no-install commitlint --edit $1"
36+
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
3737
# or
38-
yarn husky add .husky/commit-msg "yarn commitlint --edit $1"
39-
```
40-
41-
If the file `.husky/commit-msg` already exists, you can edit the file and put this:
42-
43-
```sh
44-
# .husky/commit-msg
45-
# ...
46-
npx --no-install commitlint --edit $1
47-
# or
48-
yarn commitlint --edit $1
38+
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'
4939
```
5040

5141
## Test

docs/guides-upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = {
9090
}
9191
```
9292

93-
Refer to the [Rules Referece](reference-rules.md) for a list of all avaiable configuration options.
93+
Refer to the [Rules Reference](reference-rules.md) for a list of all available configuration options.
9494

9595
There is also the [#commitlint](https://node-tooling.slack.com/messages/C7M8XJ4RL/) channel on the DevTools Slack workspace. Join us there and we'll do our best to help you with your migration.
9696

@@ -165,7 +165,7 @@ echo 'module.exports = {extends: ["@commitlint/config-conventional"]};';
165165

166166
### Breaking changes
167167

168-
#### Output on succesful commit will be ommited
168+
#### Output on successful commit will be omitted
169169

170170
- You can use the `--verbose` flag to get positive output
171171

docs/reference-rules.md

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -402,78 +402,3 @@ Infinity
402402
```
403403
'Signed-off-by:'
404404
```
405-
406-
### Deprecated rules
407-
408-
#### body-tense `deprecated`
409-
410-
- **condition**: `body` is verbalized in tense present in `value`
411-
- **rule**: `always`
412-
- **value**
413-
414-
```
415-
['present-imperative']
416-
```
417-
418-
- **possible values**
419-
420-
```
421-
[
422-
'past-tense', // did
423-
'present-imperative', // do
424-
'present-participle', // doing
425-
'present-third-person' // does
426-
]
427-
```
428-
429-
#### footer-tense `deprecated`
430-
431-
- **condition**: `footer` is verbalized in tense present in `value`
432-
- **rule**: `always`
433-
- **value**
434-
435-
```
436-
['present-imperative']
437-
```
438-
439-
- **possible values**
440-
441-
```
442-
[
443-
'past-tense', // did
444-
'present-imperative', // do
445-
'present-participle', // doing
446-
'present-third-person' // does
447-
]
448-
```
449-
450-
#### lang `deprecated`
451-
452-
- **condition**: `subject` is of language `value`
453-
- **rule**: `always`
454-
- **value**
455-
456-
```
457-
eng
458-
```
459-
460-
#### subject-tense `deprecated`
461-
462-
- **condition**: `subject` is verbalized in tense present in `value`
463-
- **rule**: `always`
464-
- **value**
465-
466-
```
467-
['present-imperative']
468-
```
469-
470-
- **possible values**
471-
472-
```
473-
[
474-
'past-tense', // did
475-
'present-imperative', // do
476-
'present-participle', // doing
477-
'present-third-person' // does
478-
]
479-
```

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
"@babel/core": "^7.12.10",
8787
"@babel/preset-env": "^7.12.11",
8888
"@lerna/project": "4.0.0",
89-
"@types/jest": "26.0.20",
90-
"@types/node": "12.20.5",
89+
"@types/jest": "26.0.21",
90+
"@types/node": "12.20.6",
9191
"@typescript-eslint/eslint-plugin": "^4.1.0",
9292
"@typescript-eslint/parser": "^4.1.0",
9393
"docsify-cli": "^4.4.0",
@@ -100,7 +100,7 @@
100100
"lerna": "^4.0.0",
101101
"lint-staged": "10.5.4",
102102
"prettier": "^2.0.5",
103-
"ts-jest": "26.5.3",
103+
"ts-jest": "26.5.4",
104104
"typescript": "4.2.3"
105105
},
106106
"resolutions": {

0 commit comments

Comments
 (0)