fix: Fix ESLint errors in JSONRepair files

- Fix trailing spaces in JSONRepair.mjs
- Convert single quotes to double quotes in test files
- Fix line ending style (CRLF to LF)
- All lint checks now pass
This commit is contained in:
maojunxyz 2025-08-08 18:27:13 +08:00
parent dd21b72193
commit 177791ae5d
2 changed files with 15 additions and 15 deletions

View File

@ -22,8 +22,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: valid JSON unchanged", name: "JSON Repair: valid JSON unchanged",
input: '{"name": "John", "age": 30}', input: "{\"name\": \"John\", \"age\": 30}",
expectedOutput: '{"name": "John", "age": 30}', expectedOutput: "{\"name\": \"John\", \"age\": 30}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -33,8 +33,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: missing quotes around keys", name: "JSON Repair: missing quotes around keys",
input: '{name: "John", age: 30}', input: "{name: \"John\", age: 30}",
expectedOutput: '{"name": "John", "age": 30}', expectedOutput: "{\"name\": \"John\", \"age\": 30}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -45,7 +45,7 @@ TestRegister.addTests([
{ {
name: "JSON Repair: single quotes to double quotes", name: "JSON Repair: single quotes to double quotes",
input: "{'name': 'John', 'age': 30}", input: "{'name': 'John', 'age': 30}",
expectedOutput: '{"name": "John", "age": 30}', expectedOutput: "{\"name\": \"John\", \"age\": 30}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -55,8 +55,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: trailing comma in object", name: "JSON Repair: trailing comma in object",
input: '{"name": "John", "age": 30,}', input: "{\"name\": \"John\", \"age\": 30,}",
expectedOutput: '{"name": "John", "age": 30}', expectedOutput: "{\"name\": \"John\", \"age\": 30}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -66,8 +66,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: trailing comma in array", name: "JSON Repair: trailing comma in array",
input: '[1, 2, 3,]', input: "[1, 2, 3,]",
expectedOutput: '[1, 2, 3]', expectedOutput: "[1, 2, 3]",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -77,8 +77,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: Python constants", name: "JSON Repair: Python constants",
input: '{"active": True, "data": None, "flag": False}', input: "{\"active\": True, \"data\": None, \"flag\": False}",
expectedOutput: '{"active": true, "data": null, "flag": false}', expectedOutput: "{\"active\": true, \"data\": null, \"flag\": false}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",
@ -143,7 +143,7 @@ TestRegister.addTests([
{ {
name: "JSON Repair: complex mixed issues", name: "JSON Repair: complex mixed issues",
input: `{ input: `{
name: 'John', // Person's name name: "John", // Person's name
age: 30, age: 30,
active: True, active: True,
data: None, data: None,
@ -163,8 +163,8 @@ TestRegister.addTests([
}, },
{ {
name: "JSON Repair: JSONP notation", name: "JSON Repair: JSONP notation",
input: 'callback({"name": "John", "age": 30})', input: "callback({\"name\": \"John\", \"age\": 30})",
expectedOutput: '{"name": "John", "age": 30}', expectedOutput: "{\"name\": \"John\", \"age\": 30}",
recipeConfig: [ recipeConfig: [
{ {
op: "JSON Repair", op: "JSON Repair",