Skip to content

Commit

Permalink
Make defaults explicit (#2)
Browse files Browse the repository at this point in the history
* Start adding explicit defaults

* Be explicit about all defaults

* Diff view in readme for extra clarity
  • Loading branch information
MarcusCaspeco authored Apr 19, 2024
1 parent 640d3b8 commit bbe1c33
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ Shared config for prettier

Add the dependency and mapping for prettier configuration:

```
// package.json
{
"name": "my-project",
"version": "1.0.0",
"prettier": "@caspeco/prettier-config",
"devDependencies": {
"@caspeco/prettier-config": "github:caspeco/prettier-config#1.0.0",
}
}
```diff
// package.json
{
"name": "my-project",
"version": "1.0.0",
+ "prettier": "@caspeco/prettier-config",
"devDependencies": {
+ "@caspeco/prettier-config": "github:caspeco/prettier-config#1.0.0",
}
}
```

Run `npm install`.
Run `npm install`.
27 changes: 27 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
/**
* @type {import('prettier').Options}
*/
module.exports = {
// Overridden rules
useTabs: true,
printWidth: 110,

// Default rules from Prettier 3.2.5
tabWidth: 2,
semi: true,
singleQuote: false,
quoteProps: "as-needed",
jsxSingleQuote: false,
trailingComma: "all",
bracketSpacing: true,
bracketSameLine: false,
arrowParens: "always",
rangeStart: 0,
rangeEnd: Infinity,
// parser: undefined
// filepath: undefined,
requirePragma: false,
insertPragma: false,
proseWrap: "preserve",
htmlWhitespaceSensitivity: "css",
vueIndentScriptAndStyle: false,
endOfLine: "lf",
embeddedLanguageFormatting: "auto",
singleAttributePerLine: false,
};

0 comments on commit bbe1c33

Please sign in to comment.