Skip to content

Commit

Permalink
chore: disable prettier for tables rather than mess with printwidth
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jul 8, 2019
1 parent d3c4cf2 commit 2e5d936
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@
"singleQuote": true,
"trailingComma": "all",
"overrides": [
{
"files": "**/*.md",
"options": {
"printWidth": 500
}
},
{
"excludeFiles": [
"e2e/__tests__/**/*",
Expand Down
13 changes: 11 additions & 2 deletions packages/pretty-format/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ console.log(prettyFormat(onClick, options));
*/
```

<!-- prettier-ignore -->
| key | type | default | description |
| :------------------ | :-------- | :--------- | :------------------------------------------------------ |
| `callToJSON` | `boolean` | `true` | call `toJSON` method (if it exists) on objects |
Expand Down Expand Up @@ -211,6 +212,7 @@ Write `serialize` to return a string, given the arguments:

### config

<!-- prettier-ignore -->
| key | type | description |
| :------------------ | :-------- | :------------------------------------------------------ |
| `callToJSON` | `boolean` | call `toJSON` method (if it exists) on objects |
Expand Down Expand Up @@ -252,7 +254,9 @@ function serializeItems(items, config, indentation, depth, refs, printer) {
config.spacingOuter +
items
.map(
item => indentationItems + printer(item, config, indentationItems, depth, refs), // callback
item =>
indentationItems +
printer(item, config, indentationItems, depth, refs), // callback
)
.join(SEPARATOR + config.spacingInner) +
(config.min ? '' : SEPARATOR) + // following the last item
Expand All @@ -267,7 +271,12 @@ const plugin = {
},
serialize(array, config, indentation, depth, refs, printer) {
const name = array.constructor.name;
return ++depth > config.maxDepth ? '[' + name + ']' : (config.min ? '' : name + ' ') + '[' + serializeItems(array, config, indentation, depth, refs, printer) + ']';
return ++depth > config.maxDepth
? '[' + name + ']'
: (config.min ? '' : name + ' ') +
'[' +
serializeItems(array, config, indentation, depth, refs, printer) +
']';
},
};
```
Expand Down

0 comments on commit 2e5d936

Please sign in to comment.