Skip to content

Commit 47ded86

Browse files
committed
chore: Fix build errors
1 parent 58d6f07 commit 47ded86

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [10.x, 12.x, 14.x]
15+
node-version: [22.x]
1616

1717
steps:
1818
- uses: actions/checkout@v2

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"description": "Command line interface for Ajv JSON schema validator",
55
"scripts": {
66
"build": "rimraf dist && tsc",
7-
"prepublish": "npm run build",
8-
"eslint": "eslint \"src/**/*.*s\" \"test/**/*.js\"",
7+
"lint": "eslint \"src/**/*.*s\" \"test/**/*.js\"",
98
"prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"",
109
"prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"",
1110
"test-spec": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha -r ts-node/register \"test/**/*.spec.{ts,js}\" -R spec",
@@ -64,7 +63,7 @@
6463
"nyc": "^15.0.1",
6564
"prettier": "^2.2.1",
6665
"rimraf": "^3.0.2",
67-
"ts-node": "^9.1.0",
66+
"ts-node": "^9.1.1",
6867
"typescript": "^4.1.2"
6968
},
7069
"peerDependencies": {

src/commands/ajv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default function (argv: ParsedArgs): AjvCore {
8484

8585
try {
8686
registerer = require("ts-node").register()
87-
} catch (err) {
87+
} catch (err: any) {
8888
/* istanbul ignore next */
8989
if (err.code === "MODULE_NOT_FOUND") {
9090
throw new Error(

src/commands/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function openFile(filename: string, suffix: string): any {
5151
} catch (e) {
5252
json = require(file)
5353
}
54-
} catch (err) {
54+
} catch (err: any) {
5555
const msg: string = err.message
5656
console.error(`error: ${msg.replace(" module", " " + suffix)}`)
5757
process.exit(2)
@@ -80,7 +80,7 @@ export function compile(ajv: Ajv, schemaFile: string): AnyValidateFunction {
8080
const schema = openFile(schemaFile, "schema")
8181
try {
8282
return ajv.compile(schema)
83-
} catch (err) {
83+
} catch (err: any) {
8484
console.error(`schema ${schemaFile} is invalid`)
8585
console.error(`error: ${err.message}`)
8686
process.exit(1)

0 commit comments

Comments
 (0)