Skip to content

Commit

Permalink
feat(prettier): add support for prettier 2.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperITMan committed Mar 9, 2021
1 parent 4ed0a92 commit 533bd19
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("./lib/prettier/2.1.x/.prettierrc.js");
module.exports = require("./lib/prettier/2.2.x/.prettierrc.js");
80 changes: 80 additions & 0 deletions lib/prettier/2.2.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
module.exports = {
/**
* The line length where Prettier will try wrap.
* Default: `80`
*
* See: https://prettier.io/docs/en/options.html#print-width
*/
printWidth: 140,

/**
* Number of spaces per indentation level.
* Default: `2`
*
* See: https://prettier.io/docs/en/options.html#tab-width
*/
tabWidth: 4,

/**
* Indent with tabs instead of spaces.
* Default: `false`
*
* https://prettier.io/docs/en/options.html#tabs
*/
useTabs: true,

/**
* Print trailing commas wherever possible when multi-line.
* Default: `"es5"`
*
* See: https://prettier.io/docs/en/options.html#trailing-commas
*/
trailingComma: "none",

/**
* Print spaces between brackets.
* Default: `true`
*
* See: https://prettier.io/docs/en/options.html#bracket-spacing
*/
bracketSpacing: true,

/**
* Which end of line characters to apply.
* Default: `lf`
*
* See: https://prettier.io/docs/en/options.html#end-of-line
*/
endOfLine: "auto",

/**
* Include parentheses around a sole arrow function parameter.
* Default: `"always"`
*
* See: https://prettier.io/docs/en/options.html#arrow-function-parentheses
*/
arrowParens: "always",

/**
* Control how Prettier formats quoted code embedded in the file.
* Default: `"auto"`
*
* See: https://prettier.io/docs/en/options.html#embedded-language-formatting
*/
embeddedLanguageFormatting: "auto",
overrides: [
{
files: "*.{pcss,scss,css,json,md,yml}",
options: {
tabWidth: 2,
useTabs: false
}
},
{
files: "*.html",
options: {
parser: "angular"
}
}
]
};
15 changes: 15 additions & 0 deletions lib/prettier/2.2.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1 align="center">
code style - Prettier 2.2.x
</h1>

## About

This sub-package hosts the [Prettier](https://prettier.io) configuration for version 2.2.x.

## Usage

Create a `.prettierrc.js` file and copy the following content inside:

```js
module.exports = require("@nationalbankbelgium/code-style/prettier/2.2.x");
```
4 changes: 4 additions & 0 deletions lib/prettier/2.2.x/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@nationalbankbelgium/code-style/prettier/2.2.x",
"main": ".prettierrc.js"
}
3 changes: 2 additions & 1 deletion lib/prettier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ The following versions are available (based on **Prettier** version):
- 1.19.x - `@nationalbankbelgium/code-style/prettier/1.19.x`
- 2.0.x - `@nationalbankbelgium/code-style/prettier/2.0.x`
- 2.1.x - `@nationalbankbelgium/code-style/prettier/2.1.x`
- 2.2.x - `@nationalbankbelgium/code-style/prettier/2.2.x`

## Usage

Create a `.prettierrc.js` file and copy the following content inside:

```js
module.exports = require("@nationalbankbelgium/code-style/prettier/2.1.x");
module.exports = require("@nationalbankbelgium/code-style/prettier/2.2.x");
```

## Recommended Additional Configs
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cz-customizable": "^6.2.0",
"husky": "^4.2.1",
"lint-staged": "^10.0.7",
"prettier": "~2.1.2",
"prettier": "~2.2.1",
"release-it": "^14.2.0",
"stylelint": "~13.3.1",
"tslint": "~6.1.0",
Expand Down

0 comments on commit 533bd19

Please sign in to comment.