Skip to content

Commit f657a68

Browse files
committed
refctor
1 parent 3573cef commit f657a68

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lib/index.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import prettier from "./configs/prettier"
99
// backward compatibility
1010
import {
1111
parseForESLint,
12+
parseJSON,
1213
traverseNodes,
1314
AST,
1415
getStaticJSONValue,
@@ -50,24 +51,3 @@ export {
5051
// types
5152
AST,
5253
}
53-
54-
/**
55-
* Parse JSON source code
56-
*/
57-
function parseJSON(code: string, options?: any): AST.JSONProgram {
58-
const parserOptions = Object.assign(
59-
{ filePath: "<input>", ecmaVersion: 2019 },
60-
options || {},
61-
{
62-
loc: true,
63-
range: true,
64-
raw: true,
65-
tokens: true,
66-
comment: true,
67-
eslintVisitorKeys: true,
68-
eslintScopeManager: true,
69-
},
70-
)
71-
72-
return parseForESLint(code, parserOptions).ast as never
73-
}

0 commit comments

Comments
 (0)