Skip to content

Commit

Permalink
Add prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmasn committed Apr 10, 2021
1 parent 5c0ec81 commit 2b2990a
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*]
indent_size = 2
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,42 @@
# prettier-config
Reusable Prettier config
# @devsht/prettier-config

Reusable prettier config

## Installation

```bash
npm i -D @devsht/prettier-config
```

or

```
yarn add --dev @devsht/prettier-config
```

## Usage

Add a key in your **package.json** file.

```
"prettier": "@devsht/prettier-config"
```

**OR**

Create a **.prettierrc** , **.prettierrc.yaml** , **.prettierrc.yml** or **.prettierrc.json** file and export a string.

```
"@devsht/prettier-config"
```

**OR**

Create a **prettier.config.js** or **.prettierrc.js** file and export an object.

```
module.exports = {
...require("@devsht/prettier-config"),
tabWidth: 2,
};
```
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
arrowParens: "always",
bracketSpacing: true,
embeddedLanguageFormatting: "auto",
endOfLine: "lf",
htmlWhitespaceSensitivity: "css",
insertPragma: false,
jsxBracketSameLine: false,
jsxSingleQuote: false,
printWidth: 120, // Default: 80
proseWrap: "preserve",
quoteProps: "consistent", // Default: 'as-needed'
requirePragma: false,
semi: true,
singleQuote: true, // Default: false
tabWidth: 2,
trailingComma: "all", // Default 'es5'
useTabs: false,
};
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@devsht/prettier-config",
"version": "0.0.0",
"description": "Reusable prettier config",
"main": "index.js",
"repository": "[email protected]:devsht/prettier-config.git",
"author": "Michael Mason <[email protected]>",
"peerDependencies": {
"prettier": "*"
}
}

0 comments on commit 2b2990a

Please sign in to comment.