Skip to content

Commit b00e214

Browse files
authored
Update to doctoc v2 & simplify call pattern (#469)
Fail in CI if ESLint or doctoc change anything in the repo.
1 parent 91b2689 commit b00e214

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ jobs:
3131
- uses: actions/setup-node@v3
3232
- run: npm install --legacy-peer-deps
3333
- run: npm run lint
34+
- run: npm run toc
35+
- run: git diff --stat --exit-code
3436
- run: npx prettier --check .
3537
- run: npm run coverage

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ and introduce yourself.
99

1010
---
1111

12-
<!-- `npm run toc` to regenerate the Table of Contents -->
12+
## Table of Contents
1313

1414
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1515
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1616

17-
## Table of Contents
18-
1917
- [Filing Issues](#filing-issues)
2018
- [Building From Source](#building-from-source)
2119
- [Submitting Pull Requests](#submitting-pull-requests)

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ This is a library to generate and consume the source map format
2424

2525
---
2626

27-
<!-- `npm run toc` to regenerate the Table of Contents -->
27+
## Table of Contents
2828

2929
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
3030
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3131

32-
## Table of Contents
33-
3432
- [Examples](#examples)
3533
- [Consuming a source map](#consuming-a-source-map)
3634
- [Generating a source map](#generating-a-source-map)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@
7070
"coverage": "nyc --reporter=text --reporter=html npm test",
7171
"prettier": "prettier --write .",
7272
"clean": "rm -rf coverage .nyc_output",
73-
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
73+
"toc": "doctoc --github --notitle README.md CONTRIBUTING.md"
7474
},
7575
"devDependencies": {
76-
"doctoc": "^1.3.1",
76+
"doctoc": "^2.2.1",
7777
"eslint": "^8.24.0",
7878
"eslint-config-prettier": "^8.5.0",
7979
"nyc": "^11.7.1",

0 commit comments

Comments
 (0)