Skip to content

Commit 9c1dbf8

Browse files
authored
fix: compatibility with Node 12 (#253)
1 parent d84fa55 commit 9c1dbf8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ jobs:
106106
run: npm run build
107107

108108
- name: ▶️ Run test script
109-
run: npm run test
109+
run: |
110+
npm run test
111+
112+
# Load src/index.js to check for syntax errors.
113+
# This is because for some reason the exit code does not become 1 in Node.js 12.
114+
# See https://github.com/eslint-community/eslint-utils/pull/253
115+
node src/index.mjs
110116
111117
- name: ⬆️ Upload coverage report
112118
uses: codecov/codecov-action@v4

src/get-function-head-location.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export function getFunctionHeadLocation(node, sourceCode) {
5151
parent.type === "PropertyDefinition"
5252
) {
5353
start = /** @type {SourceLocation} */ (parent.loc).start
54-
end = getOpeningParenOfParams(node, sourceCode)?.loc.start
54+
end = getOpeningParenOfParams(node, sourceCode).loc.start
5555
} else {
5656
start = /** @type {SourceLocation} */ (node.loc).start
57-
end = getOpeningParenOfParams(node, sourceCode)?.loc.start
57+
end = getOpeningParenOfParams(node, sourceCode).loc.start
5858
}
5959

6060
return {

0 commit comments

Comments
 (0)