Skip to content

Commit

Permalink
feat(prettier): add support for prettier 3.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperITMan committed Dec 12, 2023
1 parent 5d7b177 commit f924bdc
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 10 deletions.
93 changes: 93 additions & 0 deletions lib/prettier/3.1.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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",

/**
* Enforce single attribute per line in HTML, Vue and JSX.
* Default: `false`
*
* Valid options:
* - `false` - Do not enforce single attribute per line.
* - `true` - Enforce single attribute per line.
*
* See: https://prettier.io/docs/en/options#single-attribute-per-line
*/
singleAttributePerLine: false,

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/3.1.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1 align="center">
code style - Prettier 3.1.x
</h1>

## About

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

## Usage

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

```js
module.exports = require("@nationalbankbelgium/code-style/prettier/3.1.x");
```
4 changes: 4 additions & 0 deletions lib/prettier/3.1.x/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@nationalbankbelgium/code-style/prettier/3.1.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 @@ -22,13 +22,14 @@ The following versions are available (based on **Prettier** version):
- 2.7.x - `@nationalbankbelgium/code-style/prettier/2.7.x`
- 2.8.x - `@nationalbankbelgium/code-style/prettier/2.8.x`
- 3.0.x - `@nationalbankbelgium/code-style/prettier/3.0.x`
- 3.1.x - `@nationalbankbelgium/code-style/prettier/3.1.x`

## Usage

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

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

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

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"husky": "^7.0.1",
"lint-staged": "^12.3.5",
"pinst": "^2.1.6",
"prettier": "~3.0.0",
"prettier": "~3.1.0",
"release-it": "^14.2.0",
"stylelint": "~13.13.1",
"tslint": "~6.1.0",
Expand All @@ -70,7 +70,7 @@
},
"lint-staged": {
"*.{css,html,js,json,md,pcss,scss,ts,yml}": [
"prettier --write --html-whitespace-sensitivity strict"
"prettier --cache --write --html-whitespace-sensitivity strict"
]
},
"config": {
Expand Down

0 comments on commit f924bdc

Please sign in to comment.