* Add JSON support This fixes https://github.com/prettier/prettier/issues/1973 by using [json-to-ast] to parse JSON, then converting the AST into a mostly-Babylon AST, so as to piggyback on the existing printer logic. Identifiers and literals are currently printed verbatim from the input, but this could be improved upon later (at least for literals, not sure about identifiers). [json-to-ast]: https://github.com/vtrushin/json-to-ast * Rename `json-to-ast` parser to `json` See https://github.com/prettier/prettier/pull/2173#discussion_r122574644 * json: Use createError to have a pretty error See https://github.com/prettier/prettier/pull/2173#discussion_r122574748 * json: Transform AST without mutations See https://github.com/prettier/prettier/pull/2173#discussion_r122574690
75 lines
2.1 KiB
JSON
75 lines
2.1 KiB
JSON
{
|
|
"name": "prettier",
|
|
"version": "1.4.4",
|
|
"description": "Prettier is an opinionated JavaScript formatter",
|
|
"bin": {
|
|
"prettier": "./bin/prettier.js"
|
|
},
|
|
"repository": "prettier/prettier",
|
|
"author": "James Long",
|
|
"license": "MIT",
|
|
"main": "./index.js",
|
|
"dependencies": {
|
|
"babel-code-frame": "7.0.0-alpha.12",
|
|
"babylon": "7.0.0-beta.10",
|
|
"chalk": "1.1.3",
|
|
"diff": "3.2.0",
|
|
"esutils": "2.0.2",
|
|
"flow-parser": "0.47.0",
|
|
"get-stream": "3.0.0",
|
|
"glob": "7.1.2",
|
|
"graphql": "0.10.1",
|
|
"jest-validate": "20.0.3",
|
|
"json-to-ast": "2.0.0-alpha1.2",
|
|
"minimist": "1.2.0",
|
|
"parse5": "3.0.2",
|
|
"postcss": "^6.0.1",
|
|
"postcss-less": "^1.0.0",
|
|
"postcss-media-query-parser": "0.2.3",
|
|
"postcss-scss": "1.0.0",
|
|
"postcss-selector-parser": "2.2.3",
|
|
"postcss-values-parser": "git://github.com/shellscape/postcss-values-parser.git#5e351360479116f3fe309602cdd15b0a233bc29f",
|
|
"typescript": "2.5.0-dev.20170617",
|
|
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#479b592c0ad84a6ec5170fbe1821ed5ca90c4ee1"
|
|
},
|
|
"devDependencies": {
|
|
"babel-cli": "6.24.1",
|
|
"babel-preset-es2015": "6.24.1",
|
|
"cross-spawn": "5.1.0",
|
|
"eslint": "3.19.0",
|
|
"eslint-plugin-prettier": "2.1.1",
|
|
"jest": "20.0.0",
|
|
"mkdirp": "^0.5.1",
|
|
"prettier": "1.4.2",
|
|
"rimraf": "2.6.1",
|
|
"rollup": "0.41.1",
|
|
"rollup-plugin-commonjs": "7.0.0",
|
|
"rollup-plugin-json": "2.1.0",
|
|
"rollup-plugin-node-builtins": "2.0.0",
|
|
"rollup-plugin-node-globals": "1.1.0",
|
|
"rollup-plugin-node-resolve": "2.0.0",
|
|
"rollup-plugin-replace": "1.1.1",
|
|
"uglify-es": "3.0.15",
|
|
"webpack": "2.6.1"
|
|
},
|
|
"scripts": {
|
|
"test": "jest",
|
|
"test-integration": "jest tests_integration",
|
|
"lint": "eslint .",
|
|
"build": "./scripts/build/build.sh"
|
|
},
|
|
"jest": {
|
|
"setupFiles": [
|
|
"<rootDir>/tests_config/run_spec.js"
|
|
],
|
|
"snapshotSerializers": [
|
|
"<rootDir>/tests_config/raw-serializer.js"
|
|
],
|
|
"testRegex": "jsfmt\\.spec\\.js$|__tests__/.*\\.js$",
|
|
"testPathIgnorePatterns": [
|
|
"tests/new_react",
|
|
"tests/more_react"
|
|
]
|
|
}
|
|
}
|