moved to separate repo

This commit is contained in:
Rick van Lieshout 2022-08-14 22:26:00 +02:00
parent 2a0130323c
commit d277291741
4 changed files with 139 additions and 4 deletions

24
.editorconfig Normal file
View File

@ -0,0 +1,24 @@
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
[Makefile]
indent_style = tab
indent_size = 8
[{deps,tools,build}/**]
indent_style = ignore
indent_size = ignore
end_of_line = ignore
trim_trailing_whitespace = ignore
charset = ignore
[{test/fixtures,deps,build,tools/eslint,tools/gyp,tools/icu,tools/msvs}/**]
insert_final_newline = false

View File

@ -1,5 +1,47 @@
# mastermindzh-prettier-config
# @mastermindzh/prettier-config
@mastermindzh/prettier-config
My preferred prettier configuration.
My prettier config
## Table of contents
<!-- toc -->
- [Installation](#installation)
- [Configuration](#configuration)
- [package.json](#packagejson)
- [.prettierrc.js](#prettierrcjs)
<!-- tocstop -->
## Installation
Simply install the package with npm:
`npm install --save-dev @mastermindzh/prettier-config`
## Configuration
Configuring your project to use `@mastermindzh/prettier-config` can be done in several ways.
The easiest is the [package.json](#packagejson) solution, the most extensible is the [.prettierrc.js](#prettierrcjs) version.
### package.json
Simply add a "prettier" key with the package name:
```json
{
"prettier": "@mastermindzh/prettier-config"
}
```
### .prettierrc.js
This solution requires you to put a `.prettierrc.js` file at the root of your project with the following code:
```js
module.exports = {
...require("@mastermindzh/prettier-config"),
// optional overrides:
jsxBracketSameLine: true,
};
```

43
index.js Normal file
View File

@ -0,0 +1,43 @@
module.exports = {
// line length
printWidth: 100,
// indentation type
useTabs: false,
// whether to prefer ' over "
singleQuote: false,
// whether we want to quote props (only-if-they-have-a-dash)
quoteProps: "as-needed",
// add trailing comma's everywhere as long as it's supported by es5
trailingComma: "es5",
// space brackets method ( param1, param2 ) { }
bracketSpacing: true,
// places the > sign on a newline when closing a long html tag
bracketSameLine: false,
// always add parentheses on arrow functions (x) => { }
arrowParens: "always",
// ignore pragma, run prettier on all files
requirePragma: false,
// preserve markdown text as-is
proseWrap: "preserve",
// make css leading in whitespace sensitivity
htmlWhitespaceSensitivity: "css",
// always end lines with lf
endOfLine: "lf",
// tabs are 2 spaces.
tabWidth: 2,
// always end statements with a semicolon
semi: true,
};

26
package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "@mastermindzh/prettier-config",
"version": "1.0.0",
"description": "@mastermindzh/prettier-config",
"main": "index.js",
"scripts": {
"patch": "npm --no-git-tag-version version patch",
"minor": "npm --no-git-tag-version version minor",
"major": "npm --no-git-tag-version version major",
"release": "git add -A && git commit -m 'version bump and build' && npm publish --access public && echo 'All done, don't forget to push!'",
"release-patch": "npm run patch && npm run release",
"release-minor": "npm run minor && npm run release",
"release-major": "npm run major && npm run release",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.mastermindzh.tech:mastermindzh/mastermindzh-prettier-config.git"
},
"keywords": [
"prettier",
"mastermindzh"
],
"author": "Mastermindzh <info@rickvanlieshout.com> (http://rickvanlieshout.com/)",
"license": "MIT"
}