mirror of
https://github.com/ivuorinen/base-configs.git
synced 2026-03-01 15:53:53 +00:00
Initial commit
This commit is contained in:
3
packages/prettier-config/CHANGELOG.md
Normal file
3
packages/prettier-config/CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
21
packages/prettier-config/LICENSE
Normal file
21
packages/prettier-config/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Ismo Vuorinen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
73
packages/prettier-config/README.md
Normal file
73
packages/prettier-config/README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# @ivuorinen/prettier-config <!-- omit in toc -->
|
||||
|
||||
[![npm package][npm-badge]][npm-link]
|
||||
[![license MIT][license-badge]][license-link]
|
||||
[![ivuorinen's Code Style][style-badge]][style-link]
|
||||
|
||||
> ivuorinen's shareable configuration for [`Prettier`][prettier-link].
|
||||
|
||||
## Table of Contents <!-- omit in toc -->
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Documentations](#documentations)
|
||||
- [Contributing](#contributing)
|
||||
- [Changelog](#changelog)
|
||||
- [License](#license)
|
||||
|
||||
## Installation
|
||||
|
||||
Install `this config` as a _`devDependencies`_:
|
||||
|
||||
```sh
|
||||
# npm
|
||||
npm install @ivuorinen/prettier-config --save-dev
|
||||
|
||||
# Yarn
|
||||
yarn add @ivuorinen/prettier-config --dev
|
||||
```
|
||||
|
||||
After installing it, a _`.prettierrc.json`_ file will be created automatically in the project's root folder with the following configuration:
|
||||
|
||||
```json
|
||||
"@ivuorinen/prettier-config"
|
||||
```
|
||||
|
||||
> Note: This method does **not** offer a way to _extend_ the configuration to overwrite some properties from the shared configuration. If you need to do that, import the file in a _`.prettierrc.js`_ file and export the modifications, e.g:
|
||||
>
|
||||
> ```js
|
||||
> module.exports = {
|
||||
> ...require('@ivuorinen/prettier-config'),
|
||||
>
|
||||
> // Add custom options bellow:
|
||||
> semi: true
|
||||
> }
|
||||
> ```
|
||||
|
||||
## Documentations
|
||||
|
||||
Read the [Prettier docs][prettier-docs-link] for more information.
|
||||
|
||||
## Contributing
|
||||
|
||||
If you are interested in helping contribute, please take a look at our [contribution guidelines][contributing-link] and open an [issue][issue-link] or [pull request][pull-request-link].
|
||||
|
||||
## Changelog
|
||||
|
||||
See [CHANGELOG][changelog-link] for a human-readable history of changes.
|
||||
|
||||
## License
|
||||
|
||||
Distributed under the MIT License. See [LICENSE][license-link] for more information.
|
||||
|
||||
[changelog-link]: ./CHANGELOG.md
|
||||
[prettier-docs-link]: https://prettier.io
|
||||
[prettier-link]: https://github.com/prettier/prettier
|
||||
[contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
|
||||
[issue-link]: https://github.com/ivuorinen/base-configs/issues
|
||||
[license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
|
||||
[license-link]: ./LICENSE
|
||||
[npm-badge]: https://img.shields.io/npm/v/@ivuorinen/prettier-config?style=flat-square&labelColor=292a44&color=663399
|
||||
[npm-link]: https://www.npmjs.com/package/@ivuorinen/prettier-config
|
||||
[pull-request-link]: https://github.com/ivuorinen/base-configs/pulls
|
||||
[style-badge]: https://img.shields.io/badge/code_style-ivuorinen%E2%80%99s-663399.svg?labelColor=292a44&style=flat-square
|
||||
[style-link]: https://github.com/ivuorinen/base-configs
|
||||
17
packages/prettier-config/index.js
Normal file
17
packages/prettier-config/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
arrowParens: 'avoid',
|
||||
proseWrap: 'never',
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
trailingComma: 'none',
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.css', '*.scss'],
|
||||
options: {
|
||||
singleQuote: false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
43
packages/prettier-config/package.json
Normal file
43
packages/prettier-config/package.json
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@ivuorinen/prettier-config",
|
||||
"version": "0.1.0",
|
||||
"description": "ivuorinen's shareable configuration for Prettier.",
|
||||
"author": {
|
||||
"name": "Ismo Vuorinen",
|
||||
"url": "https://github.com/ivuorinen"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ivuorinen/base-configs/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12",
|
||||
"npm": ">= 6",
|
||||
"yarn": ">=1.20.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"scripts/*"
|
||||
],
|
||||
"homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/prettier-config#readme",
|
||||
"keywords": [
|
||||
"config",
|
||||
"ivuorinen",
|
||||
"prettier-config",
|
||||
"prettier"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ivuorinen/base-configs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node scripts/postinstall.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"prettier": "2.8.0"
|
||||
}
|
||||
}
|
||||
12
packages/prettier-config/scripts/postinstall.js
Normal file
12
packages/prettier-config/scripts/postinstall.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const filePath = path.join(process.env.INIT_CWD, '.prettierrc.json')
|
||||
|
||||
const fileConfigObject = '@ivuorinen/prettier-config'
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
|
||||
}
|
||||
8
packages/prettier-config/yarn.lock
Normal file
8
packages/prettier-config/yarn.lock
Normal file
@@ -0,0 +1,8 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
prettier@2.8.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9"
|
||||
integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==
|
||||
Reference in New Issue
Block a user