Skip to content

Commit

Permalink
Merge pull request #186 from SuperITMan/feature/improve-and-upgrade-p…
Browse files Browse the repository at this point in the history
…rettier-configuration

Feature/improve and upgrade prettier configuration
  • Loading branch information
nicanac authored Mar 9, 2021
2 parents ad1296d + 533bd19 commit 94d9261
Show file tree
Hide file tree
Showing 15 changed files with 396 additions and 14 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.0.x/.prettierrc.js");
module.exports = require("./lib/prettier/2.2.x/.prettierrc.js");
34 changes: 34 additions & 0 deletions lib/prettier/1.16.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
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,
overrides: [
{
Expand Down
34 changes: 34 additions & 0 deletions lib/prettier/1.17.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
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,
overrides: [
{
Expand Down
34 changes: 34 additions & 0 deletions lib/prettier/1.18.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
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,
overrides: [
{
Expand Down
34 changes: 34 additions & 0 deletions lib/prettier/1.19.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
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,
overrides: [
{
Expand Down
48 changes: 48 additions & 0 deletions lib/prettier/2.0.x/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,58 @@
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",
overrides: [
{
Expand Down
80 changes: 80 additions & 0 deletions lib/prettier/2.1.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.1.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1 align="center">
code style - Prettier 2.1.x
</h1>

## About

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

## Usage

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

```js
module.exports = require("@nationalbankbelgium/code-style/prettier/2.1.x");
```
4 changes: 4 additions & 0 deletions lib/prettier/2.1.x/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@nationalbankbelgium/code-style/prettier/2.1.x",
"main": ".prettierrc.js"
}
Loading

0 comments on commit 94d9261

Please sign in to comment.