* Add option to require @prettier or @format pragma Fixes #2397. Inspired by `eslint-plugin-prettier` and the discussion in #2397, this implements requiring a special comment pragma to be present in a file's first comment in order to be formatted. This will help large codebases gradually transition to prettier over time without tons of churn or large code reviews. I implemented this as a standard prettier "option", not just a typical `argv` flag, as it is relevant in both the cli and the api. This way it can be provided programmatically, on the command line, or standardized in a prettierrc file so like the style options, every user can use this setting consistently and only apply prettier to relevant files, no mattier their editor integration. This requires the pragma begin with `@` (in fact it's inserted if the user doesn't provide it). Currently the usage implies it must be "prettier" or "format", but it can technically be any value other than "none", which is similar to the `trailingCommas` option. cc @vjeux * Don't quote anything in runPrettier; this is usually handled by a shell * Make --require-pragma a boolean option * Use jest-docblock to find pragmas without parsing the ast * Clarify docs * includes -> indexOf * Move test out of integration
76 lines
2.3 KiB
JSON
76 lines
2.3 KiB
JSON
{
|
|
"name": "prettier",
|
|
"version": "1.6.1",
|
|
"description": "Prettier is an opinionated code formatter",
|
|
"bin": {
|
|
"prettier": "./bin/prettier.js"
|
|
},
|
|
"repository": "prettier/prettier",
|
|
"homepage": "https://prettier.io",
|
|
"author": "James Long",
|
|
"license": "MIT",
|
|
"main": "./index.js",
|
|
"dependencies": {
|
|
"babel-code-frame": "7.0.0-alpha.12",
|
|
"babylon": "7.0.0-beta.22",
|
|
"chalk": "2.1.0",
|
|
"cosmiconfig": "davidtheclark/cosmiconfig",
|
|
"dashify": "0.2.2",
|
|
"diff": "3.2.0",
|
|
"esutils": "2.0.2",
|
|
"flow-parser": "0.51.0",
|
|
"get-stream": "3.0.0",
|
|
"globby": "^6.1.0",
|
|
"graphql": "0.10.1",
|
|
"ignore": "^3.3.3",
|
|
"jest-docblock": "^21.0.2",
|
|
"jest-validate": "20.0.3",
|
|
"minimatch": "3.0.4",
|
|
"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/lydell/postcss-values-parser.git#af2c80b2bb558a6e7d61540d97f068f9fa162b38",
|
|
"strip-bom": "3.0.0",
|
|
"typescript": "2.5.1",
|
|
"typescript-eslint-parser": "git://github.com/eslint/typescript-eslint-parser.git#5576fb48c89165967557e867b9462d43431dcb10"
|
|
},
|
|
"devDependencies": {
|
|
"babel-cli": "6.24.1",
|
|
"babel-preset-es2015": "6.24.1",
|
|
"codecov": "2.2.0",
|
|
"cross-env": "5.0.1",
|
|
"eslint": "4.1.1",
|
|
"eslint-friendly-formatter": "3.0.0",
|
|
"eslint-plugin-import": "2.6.1",
|
|
"eslint-plugin-prettier": "2.1.2",
|
|
"eslint-plugin-react": "7.1.0",
|
|
"jest": "20.0.0",
|
|
"markdown-toc": "1.1.0",
|
|
"mkdirp": "^0.5.1",
|
|
"prettier": "1.6.0",
|
|
"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",
|
|
"shelljs": "0.7.8",
|
|
"sw-toolbox": "3.6.0",
|
|
"uglify-es": "3.0.15",
|
|
"webpack": "2.6.1"
|
|
},
|
|
"scripts": {
|
|
"test": "jest",
|
|
"test-integration": "jest tests_integration",
|
|
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
|
|
"build": "node ./scripts/build/build.js",
|
|
"toc": "node ./scripts/table-of-contents.js"
|
|
}
|
|
}
|