1 parent
f8c5b1fd1d
commit
b622578896
2798 files changed
+12
-12
No files matched your search
+1
-1
@@ -12,6 +12,6 @@
|
|||||||
/website/static/playground.js
|
/website/static/playground.js
|
||||||
/website/static/lib
|
/website/static/lib
|
||||||
.DS_Store
|
.DS_Store
|
||||||
coverage
|
/coverage
|
||||||
.idea
|
.idea
|
||||||
package-lock.json
|
package-lock.json
|
||||||
+1
-1
@@ -16,7 +16,7 @@ Here's what you need to know about the tests:
|
|||||||
- `AST_COMPARE` That formats each file, re-parses it, and compares the new AST with the original one and makes sure they are semantically equivalent.
|
- `AST_COMPARE` That formats each file, re-parses it, and compares the new AST with the original one and makes sure they are semantically equivalent.
|
||||||
- `DEEP_COMPARE` That formats each file, then formats the output again, and checks that the second output is the same as the first.
|
- `DEEP_COMPARE` That formats each file, then formats the output again, and checks that the second output is the same as the first.
|
||||||
- Each test folder has a `jsfmt.spec.js` that runs the tests. For JavaScript files, generally you can just put `run_spec(__dirname, ["babel", "flow", "typescript"]);` there. This will verify that the output using each parser is the same. You can also pass options as the third argument, like this: `run_spec(__dirname, ["babel"], { trailingComma: "es5" });`
|
- Each test folder has a `jsfmt.spec.js` that runs the tests. For JavaScript files, generally you can just put `run_spec(__dirname, ["babel", "flow", "typescript"]);` there. This will verify that the output using each parser is the same. You can also pass options as the third argument, like this: `run_spec(__dirname, ["babel"], { trailingComma: "es5" });`
|
||||||
- `tests/flow/` contains the Flow test suite, and is not supposed to be edited by hand. To update it, clone the Flow repo next to the Prettier repo and run: `node scripts/sync-flow-tests.js ../flow/tests/`.
|
- `tests/flow-repo/` contains the Flow test suite, and is not supposed to be edited by hand. To update it, clone the Flow repo next to the Prettier repo and run: `node scripts/sync-flow-tests.js ../flow/tests/`.
|
||||||
- If you would like to debug prettier locally, you can either debug it in Node or the browser. The easiest way to debug it in Node, is to create a local test file with some example code you want formatted and either run it in an editor like VS Code or run it directly via `./bin/prettier.js <your_test_file>`. The easiest way to debug it in the browser is to build Prettier's website locally (see `website/README.md`).
|
- If you would like to debug prettier locally, you can either debug it in Node or the browser. The easiest way to debug it in Node, is to create a local test file with some example code you want formatted and either run it in an editor like VS Code or run it directly via `./bin/prettier.js <your_test_file>`. The easiest way to debug it in the browser is to build Prettier's website locally (see `website/README.md`).
|
||||||
|
|
||||||
Run `yarn lint:eslint --fix` to automatically format files.
|
Run `yarn lint:eslint --fix` to automatically format files.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const rimraf = require("rimraf");
|
|||||||
|
|
||||||
const DEFAULT_SPEC_CONTENT = "run_spec(__dirname);\n";
|
const DEFAULT_SPEC_CONTENT = "run_spec(__dirname);\n";
|
||||||
const SPEC_FILE_NAME = "jsfmt.spec.js";
|
const SPEC_FILE_NAME = "jsfmt.spec.js";
|
||||||
const FLOW_TESTS_DIR = path.join(__dirname, "..", "tests", "flow");
|
const FLOW_TESTS_DIR = path.join(__dirname, "..", "tests", "flow-repo");
|
||||||
|
|
||||||
function tryParse(file, content) {
|
function tryParse(file, content) {
|
||||||
const ast = flowParser.parse(content, {
|
const ast = flowParser.parse(content, {
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 2798 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user