You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: upgrade to prettier 3 (wip)
* fix: array tests (and potentially more?)
* fix: use getVisitorKeys instead of getCommentChildNodes
* fix: tests
* Move `getVisitorKeys` to correct location
* Workaround
* Use `jest-light-runner`
* Run test on Windows
---------
Co-authored-by: fisker <lionkay@gmail.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ yarn test tests/{folder of your choice}
15
15
16
16
Here's what you need to know about the tests:
17
17
18
-
* The tests use [Jest](https://facebook.github.io/jest/) snapshots.
19
-
* You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR.
20
-
* You can run `AST_COMPARE=1 yarn test` for a more robust test run. That formats each file, re-parses it, and compares the new AST with the original one and makes sure they are semantically equivalent.
18
+
- The tests use [Jest](https://facebook.github.io/jest/) snapshots.
19
+
- You can make changes and run `jest -u` (or `yarn test -u`) to update the snapshots. Then run `git diff` to take a look at what changed. Always update the snapshots when opening a PR.
20
+
- You can run `AST_COMPARE=1 yarn test` for a more robust test run. That formats each file, re-parses it, and compares the new AST with the original one and makes sure they are semantically equivalent.
21
21
22
22
Run `yarn lint --fix` to automatically format files.
23
23
@@ -31,16 +31,14 @@ Add the following configuration to `.vscode/launch.json`:
|`phpVersion`|`"7.0"`| Allows specifying the PHP version you're using. If you're using PHP 7.1 or later, setting this option will make use of modern language features in the printed output. If you're using PHP lower than 7.0, you'll have to set this option or Prettier will generate incompatible code. |
171
-
|`printWidth`|`80`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)) |
172
-
|`tabWidth`|`4`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)), The default is `4` based on the `PSR-2` coding standard. |
173
-
|`useTabs`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tabs)) |
174
-
|`singleQuote`|`false`| If set to `"true"`, strings that use double quotes but do not rely on the features they add, will be reformatted. Example: `"foo" -> 'foo'`, `"foo $bar" -> "foo $bar"`. |
175
-
|`trailingCommaPHP`|`true`| If set to `true`, trailing commas will be added wherever possible. <br> If set to `false`, no trailing commas are printed. |
176
-
|`braceStyle`|`"per-cs"`| If set to `"per-cs"`, prettier will move open brace for code blocks (classes, functions and methods) onto new line. <br> If set to `"1tbs"`, prettier will move open brace for code blocks (classes, functions and methods) onto same line. |
177
-
|`requirePragma`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)) |
178
-
|`insertPragma`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#insert-pragma)) |
171
+
|`printWidth`|`80`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)) |
172
+
|`tabWidth`|`4`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)), The default is `4` based on the `PSR-2` coding standard. |
173
+
|`useTabs`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tabs)) |
174
+
|`singleQuote`|`false`| If set to `"true"`, strings that use double quotes but do not rely on the features they add, will be reformatted. Example: `"foo" -> 'foo'`, `"foo $bar" -> "foo $bar"`. |
175
+
|`trailingCommaPHP`|`true`| If set to `true`, trailing commas will be added wherever possible. <br> If set to `false`, no trailing commas are printed. |
176
+
|`braceStyle`|`"per-cs"`| If set to `"per-cs"`, prettier will move open brace for code blocks (classes, functions and methods) onto new line. <br> If set to `"1tbs"`, prettier will move open brace for code blocks (classes, functions and methods) onto same line. |
177
+
|`requirePragma`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)) |
178
+
|`insertPragma`|`false`| Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#insert-pragma)) |
179
179
180
180
## Ignoring code
181
181
@@ -232,7 +232,7 @@ The official [prettier plugin for vscode](https://github.com/prettier/prettier-v
232
232
- Tick the On Save button, if you want your files formatting updated on file save
233
233
- Clock OK to save settings
234
234
235
-
_Note: Just pressing save does not reformat your current file unless the file has been modified in some way,
235
+
_Note: Just pressing save does not reformat your current file unless the file has been modified in some way,
236
236
alternatively you can use the Prettier shortcut Ctrl+Alt+Shift+P_
0 commit comments