Skip to content

Commit 9978d7b

Browse files
authored
build(deps-dev): replace standard with neostandard (#121)
1 parent 927c1d5 commit 9978d7b

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

README.md

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

33
[![CI](https://github.com/fastify/secure-json-parse/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/secure-json-parse/actions/workflows/ci.yml)
44
[![NPM version](https://img.shields.io/npm/v/secure-json-parse.svg?style=flat)](https://www.npmjs.com/package/secure-json-parse)
5-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
5+
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
66

77
`JSON.parse()` drop-in replacement with prototype poisoning protection.
88

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict'
2+
3+
module.exports = require('neostandard')({
4+
ignores: require('neostandard').resolveIgnoresFromGitignore(),
5+
ts: true
6+
})

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"types": "types/index.d.ts",
88
"scripts": {
99
"benchmark": "cd benchmarks && npm install && npm run all",
10-
"lint": "standard",
10+
"lint": "eslint",
11+
"lint:fix": "eslint --fix",
1112
"test": "nyc npm run test:unit && npm run test:typescript",
1213
"test:unit": "tape \"test/*.test.js\"",
1314
"test:typescript": "tsd",
@@ -34,9 +35,9 @@
3435
"@fastify/pre-commit": "^2.1.0",
3536
"airtap": "^5.0.0",
3637
"airtap-playwright": "^1.0.1",
38+
"neostandard": "^0.11.9",
3739
"nyc": "^17.0.0",
3840
"playwright": "^1.43.1",
39-
"standard": "^17.1.0",
4041
"tape": "^5.7.5",
4142
"tsd": "^0.31.0"
4243
}

types/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ declare namespace parse {
3939
* @param reviver The `JSON.parse()` optional `reviver` argument.
4040
* @returns The parsed object, or `null` if there was an error or if the JSON contained possibly insecure properties.
4141
*/
42-
export function safeParse(text: string | Buffer, reviver?: Reviver | null): any
42+
export function safeParse (text: string | Buffer, reviver?: Reviver | null): any
4343

4444
/**
4545
* Scans a given object for prototype properties.
@@ -48,11 +48,11 @@ declare namespace parse {
4848
* @param options Optional configuration object.
4949
* @returns The object, or `null` if onError is set to `nullify`
5050
*/
51-
export function scan(obj: { [key: string | number]: any }, options?: ParseOptions): any
51+
export function scan (obj: { [key: string | number]: any }, options?: ParseOptions): any
5252

53-
export { parse as default}
53+
export { parse as default }
5454
}
5555

56-
declare function parse(text: string | Buffer, options?: parse.ParseOptions): any
57-
declare function parse(text: string | Buffer, reviver?: parse.Reviver | null, options?: parse.ParseOptions): any
56+
declare function parse (text: string | Buffer, options?: parse.ParseOptions): any
57+
declare function parse (text: string | Buffer, reviver?: parse.Reviver | null, options?: parse.ParseOptions): any
5858
export = parse

types/index.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sjson.scan({}, { protoAction: 'remove' })
2121
sjson.scan({}, { protoAction: 'ignore' })
2222
sjson.scan({}, { constructorAction: 'error' })
2323
sjson.scan({}, { constructorAction: 'ignore' })
24-
sjson.scan(new Array(), {})
24+
sjson.scan([], {})
2525

2626
declare const input: Buffer
2727
sjson.parse(input)

0 commit comments

Comments
 (0)