npm(prettier-config): add new sharable config
Summary: Docs: https://prettier.io/docs/en/configuration#sharing-configurations To be published @ npm and imported elsewhere. Signed-off-by: Yongmin Hong <revi@omglol.email> Test Plan: no test can be performed at this time; needs to be landed, published to npm, and then we can test from other tepo importing this. Reviewers: O1 revi & automations, revi Reviewed By: O1 revi & automations, revi Differential Revision: https://issuetracker.revi.xyz/D302
This commit is contained in:
parent
1a8f2aaccf
commit
8865e172f9
5 changed files with 101 additions and 13 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,5 +1,4 @@
|
||||||
* text=auto
|
* text=auto
|
||||||
*.sh text=auto eol=lf
|
|
||||||
|
|
||||||
*.asc binary
|
*.asc binary
|
||||||
*.gif binary
|
*.gif binary
|
||||||
|
|
26
npm/prettier-config/package.json
Normal file
26
npm/prettier-config/package.json
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/package.json",
|
||||||
|
"name": "@revi/prettier-config",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "@revi's prettier configs",
|
||||||
|
"main": "prettier.config.js",
|
||||||
|
"dependencies": {
|
||||||
|
"prettier": "^3.3.2"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/revi/sandbox/blob/master/npm-prettier-config"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://revi.xyz/new"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"p:c": "prettier --check"
|
||||||
|
},
|
||||||
|
"author": "revi",
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
}
|
40
npm/prettier-config/prettier.config.js
Normal file
40
npm/prettier-config/prettier.config.js
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
// @ts-check
|
||||||
|
/**
|
||||||
|
* @file revi's prettier config preset
|
||||||
|
* @see https://prettier.io/docs/en/configuration.html
|
||||||
|
* @type {import("prettier").Config}
|
||||||
|
* @copyright Hong Yongmin 2024
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
bracketSpacing: false,
|
||||||
|
bracketSameLine: true,
|
||||||
|
proseWrap: 'preserve',
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'all',
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: '.arcconfig',
|
||||||
|
options: {parser: 'json'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: '.arclint',
|
||||||
|
options: {parser: 'json'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: '.arcunit',
|
||||||
|
options: {parser: 'json'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: '.imgbotconfig',
|
||||||
|
options: {parser: 'json'},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: '.yamllint',
|
||||||
|
options: {parser: 'yaml'},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
37
package-lock.json
generated
37
package-lock.json
generated
|
@ -1,15 +1,23 @@
|
||||||
{
|
{
|
||||||
"name": "sandbox",
|
"name": "@revi/scripts",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "@revi/scripts",
|
||||||
|
"workspaces": [
|
||||||
|
"npm/prettier-config"
|
||||||
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"csslint": "^1.0.5",
|
"csslint": "^1.0.5",
|
||||||
"jshint": "^2.13.6",
|
"jshint": "^2.13.6",
|
||||||
"prettier": "^3.3.1"
|
"prettier": "^3.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@revi/prettier-config": {
|
||||||
|
"resolved": "npm/prettier-config",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
@ -321,10 +329,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||||
"integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==",
|
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin/prettier.cjs"
|
"prettier": "bin/prettier.cjs"
|
||||||
|
@ -375,9 +382,22 @@
|
||||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"npm/prettier-config": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"prettier": "^3.3.2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@revi/prettier-config": {
|
||||||
|
"version": "file:npm/prettier-config",
|
||||||
|
"requires": {
|
||||||
|
"prettier": "^3.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
|
@ -626,10 +646,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "3.3.1",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||||
"integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==",
|
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "1.1.14",
|
"version": "1.1.14",
|
||||||
|
|
10
package.json
10
package.json
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/package.json",
|
||||||
"name": "@revi/scripts",
|
"name": "@revi/scripts",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -7,7 +8,10 @@
|
||||||
"prettier": "^3.3.1"
|
"prettier": "^3.3.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"p:c": "prettier --check .",
|
"p:c": "prettier --check",
|
||||||
"p:w": "prettier --write ."
|
"p:w": "prettier --write"
|
||||||
}
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"npm/prettier-config"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue