Skip to content

Commit f11e517

Browse files
authored
refactor: simplify jsox usage (#427)
1 parent facf7ac commit f11e517

File tree

7 files changed

+50
-277
lines changed

7 files changed

+50
-277
lines changed

.changeset/eight-taxis-sell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"prettier-plugin-sql": minor
3+
---
4+
5+
chore(deps): bump `node-sql-parser` to v5

.changeset/five-chefs-move.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"prettier-plugin-sql": patch
3+
---
4+
5+
refactor: simplify jsox usage

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@types/mvdan-sh": "^0.10.9",
4444
"@types/node": "^22.14.0",
4545
"@types/react": "^19.1.0",
46-
"@types/react-dom": "^18.3.6",
46+
"@types/react-dom": "^19.1.1",
4747
"@types/web": "^0.0.216",
4848
"@vitejs/plugin-react-swc": "^3.8.1",
4949
"@vitest/coverage-istanbul": "^3.1.1",
@@ -70,7 +70,7 @@
7070
"tsx": "^4.19.3",
7171
"type-coverage": "^2.29.7",
7272
"typescript": "^5.8.3",
73-
"vite": "^5.4.17",
73+
"vite": "^6.2.5",
7474
"vitest": "^3.1.1",
7575
"yarn-berry-deduplicate": "^6.1.1"
7676
},

packages/pkg/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ Top-level keys are sorted according to a style commonly seen in the packages of
102102
"man",
103103
"bin",
104104
"main",
105+
"types",
106+
"typings",
107+
"typesVersions",
105108
"module",
106109
"imports",
107110
"exports",
@@ -119,9 +122,6 @@ Top-level keys are sorted according to a style commonly seen in the packages of
119122
"umd",
120123
"jsdelivr",
121124
"unpkg",
122-
"types",
123-
"typings",
124-
"typesVersions",
125125

126126
// contents and utils
127127
"directories",

packages/sql/shim.d.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
declare module 'jsox' {
2-
const JSOX: typeof JSON & { JSOX?: typeof JSON }
3-
4-
export = JSOX
2+
export const JSOX: typeof JSON
53
}

packages/sql/src/index.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path="../shim.d.ts" />
22

3-
import * as _JSOX from 'jsox'
3+
import { JSOX } from 'jsox'
44
import type { AST, Option } from 'node-sql-parser'
55
import nodeSqlParser from 'node-sql-parser'
66
import type { Options, ParserOptions, Plugin } from 'prettier'
@@ -14,9 +14,6 @@ import {
1414

1515
import { languages } from './languages.js'
1616

17-
// see #332 for more details
18-
const JSOX = _JSOX.JSOX || _JSOX
19-
2017
const parser = new nodeSqlParser.Parser()
2118

2219
const SQL_FORMATTER = 'sql-formatter'

0 commit comments

Comments
 (0)