Skip to content

Commit ee14ffb

Browse files
committed
additional improvements
1 parent 6f250d9 commit ee14ffb

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ This project:
1313

1414
This repository also provides a **baseline Prettier configuration** that matches
1515
the rules exported by `eslint-config-scality` (4-space indentation, 120-character
16-
line length, single quotes, semicolons, trailing commas).
16+
line length, single quotes, semicolons, trailing commas, `quoteProps:
17+
consistent-as-needed`), with small overrides for non-JavaScript files.
1718

1819
The configuration lives in `prettier.config.cjs`.
1920

@@ -48,7 +49,9 @@ To use it in a project:
4849
Projects are free to override options locally (for example `tabWidth` or
4950
`printWidth`) if they have strong legacy constraints, but this configuration
5051
is intended to be the **default Scality baseline** for new or reformatted
51-
Node.js codebases.
52+
Node.js codebases. YAML/JSON/Markdown files default to a 2-space indentation
53+
and Markdown prose is left un-reflowed by default (`proseWrap: 'preserve'`),
54+
to avoid noisy diffs in existing documentation.
5255

5356
## Editor configuration
5457

prettier.config.cjs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module.exports = {
2828

2929
// Match `quotes: [1, 'single', 'avoid-escape']`
3030
singleQuote: true,
31+
// Match `quote-props: [2, 'consistent-as-needed']`
32+
quoteProps: 'consistent-as-needed',
3133

3234
// Match `semi: [2, 'always']`
3335
semi: true,
@@ -43,5 +45,22 @@ module.exports = {
4345

4446
// Normalise line endings across platforms while avoiding noisy diffs
4547
endOfLine: 'lf',
46-
};
4748

49+
// Per-language tweaks to align with common Scality usage and `.editorconfig`
50+
overrides: [
51+
{
52+
files: ['*.yml', '*.yaml', '*.json'],
53+
options: {
54+
tabWidth: 2,
55+
},
56+
},
57+
{
58+
files: ['*.md'],
59+
options: {
60+
tabWidth: 2,
61+
// Avoid reflowing existing prose by default
62+
proseWrap: 'preserve',
63+
},
64+
},
65+
],
66+
};

0 commit comments

Comments
 (0)