@faustt/prettier-config
Advanced tools
| var a=Object.create;var r=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var u=t=>r(t,"__esModule",{value:!0});var b=(t,e,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of n(e))!f.call(t,i)&&i!=="default"&&r(t,i,{get:()=>e[i],enumerable:!(o=m(e,i))||o.enumerable});return t},s=t=>b(u(r(t!=null?a(g(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var p=s(require("prettier-plugin-organize-imports")),l=s(require("prettier-plugin-svelte"));module.exports={plugins:[p.default,l.default],trailingComma:"all",singleQuote:!1,useTabs:!0,tabWidth:4,overrides:[{files:["*.yml","*.yaml"],options:{useTabs:!1,tabWidth:2}}]}; |
| var r=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);import o from"prettier-plugin-organize-imports";import s from"prettier-plugin-svelte";var p=r((n,e)=>{e.exports={plugins:[o,s],trailingComma:"all",singleQuote:!1,useTabs:!0,tabWidth:4,overrides:[{files:["*.yml","*.yaml"],options:{useTabs:!1,tabWidth:2}}]}});export default p(); |
+61
-80
| { | ||
| "name": "@faustt/prettier-config", | ||
| "version": "1.0.0", | ||
| "publishConfig": { | ||
| "registry": "https://registry.npmjs.org" | ||
| }, | ||
| "license": "MIT", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/FaustTobias/prettier-config.git" | ||
| }, | ||
| "author": "Tobias Faust <tobias@faustnet.de> (https://github.com/FaustTobias)", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "commit": "cz", | ||
| "lint": "yarn -s lint:prettier && yarn -s lint:lockfile", | ||
| "lint:fix": "yarn -s lint:prettier:fix", | ||
| "lint:lockfile": "lockfile-lint", | ||
| "lint:prettier": "prettier --check .", | ||
| "lint:prettier:fix": "prettier --write .", | ||
| "semantic-release": "semantic-release", | ||
| "update": "yarn -s update:readme", | ||
| "update:readme": "node scripts/update-readme.js" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "peerDependencies": { | ||
| "prettier": "^2.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "@trivago/prettier-plugin-sort-imports": "^1.4.1", | ||
| "prettier-plugin-package": "^1.3.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "14", | ||
| "@types/prettier": "^2.1.6", | ||
| "commitizen": "^4.2.3", | ||
| "common-tags": "^1.8.0", | ||
| "cz-conventional-changelog": "^3.3.0", | ||
| "husky": "^4.3.8", | ||
| "lint-staged": "^10.5.3", | ||
| "lockfile-lint": "^4.3.7", | ||
| "prettier": "^2.2.1", | ||
| "semantic-release": "^17.3.9", | ||
| "typescript": "^4.1.3" | ||
| }, | ||
| "config": { | ||
| "commitizen": { | ||
| "path": "cz-conventional-changelog" | ||
| } | ||
| }, | ||
| "husky": { | ||
| "hooks": { | ||
| "pre-commit": "yarn lint-staged && yarn update:readme" | ||
| } | ||
| }, | ||
| "lint-staged": { | ||
| "*.{js,ts,json,yml,yaml}": "prettier --write", | ||
| "{README.md,.editorconfig}": "yarn -s update:readme", | ||
| "yarn.lock": "lockfile-lint --" | ||
| }, | ||
| "lockfile-lint": { | ||
| "type": "yarn", | ||
| "path": "yarn.lock", | ||
| "allowedHosts": [ | ||
| "https://registry.npmjs.org" | ||
| ] | ||
| }, | ||
| "prettier": "./index.js", | ||
| "release": { | ||
| "branches": [ | ||
| "main", | ||
| { | ||
| "name": "pre", | ||
| "prerelease": true | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| "name": "@faustt/prettier-config", | ||
| "version": "2.0.1", | ||
| "main": "dist/index.cjs", | ||
| "module": "dist/index.mjs", | ||
| "scripts": { | ||
| "build": "concurrently --raw 'yarn:build:*'", | ||
| "build:transpile": "node --require esbuild-register scripts/build.ts", | ||
| "build:typecheck": "tsc", | ||
| "dev": "concurrently --raw 'yarn:dev:*'", | ||
| "dev:transpile": "node --require esbuild-register scripts/build.ts --watch", | ||
| "dev:typecheck": "tsc --watch", | ||
| "format": "prettier --write .", | ||
| "format:check": "prettier --check .", | ||
| "test": "ava", | ||
| "test:watch": "ava --watch" | ||
| }, | ||
| "files": [ | ||
| "dist/*" | ||
| ], | ||
| "peerDependencies": { | ||
| "prettier": "*", | ||
| "typescript": "*" | ||
| }, | ||
| "dependencies": { | ||
| "prettier-plugin-organize-imports": "^2.3.4", | ||
| "prettier-plugin-package": "^1.3.0", | ||
| "prettier-plugin-svelte": "^2.4.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@faustt/release": "^0.10.1", | ||
| "@types/common-tags": "^1", | ||
| "@types/concurrently": "^6", | ||
| "@types/prettier": "^2", | ||
| "ava": "^3.15.0", | ||
| "common-tags": "^1.8.0", | ||
| "concurrently": "^6.3.0", | ||
| "esbuild": "^0.13.3", | ||
| "esbuild-register": "^3.0.0", | ||
| "execa": "^5.1.1", | ||
| "node-dev": "^7.0.0", | ||
| "prettier": "^2.4.1", | ||
| "svelte": "^3.43.1", | ||
| "typescript": "^4.4.3" | ||
| }, | ||
| "ava": { | ||
| "files": [ | ||
| "test/**" | ||
| ], | ||
| "extensions": [ | ||
| "ts" | ||
| ], | ||
| "require": [ | ||
| "esbuild-register" | ||
| ] | ||
| }, | ||
| "prettier": "./dist/index.cjs", | ||
| "release": { | ||
| "initialVersion": "2.0.0" | ||
| }, | ||
| "source": "src/index.ts" | ||
| } |
+15
-61
@@ -5,3 +5,3 @@ <div align="center"> | ||
| [Prettier](https://github.com/prettier/prettier) configuration used by @faustt projects. | ||
| Consistent code formatting. | ||
@@ -12,7 +12,7 @@ </div> | ||
| This repository contains the prettier config for @faustt projects. | ||
| This is the prettier config used by @faustt projects. | ||
| ## Getting started | ||
| Install prettier and the config as dev dependency: | ||
| Install prettier and the config as a development dependency: | ||
@@ -23,74 +23,28 @@ ```bash | ||
| Add a `prettier.config.js` file: | ||
| Reference the config in your project: | ||
| ```js | ||
| module.exports = { | ||
| ...require("@faustt/prettier-config"), | ||
| }; | ||
| ``` | ||
| > package.json | ||
| Add a `.editorconfig` file: | ||
| <!-- BEGIN editorconfig --> | ||
| ```ini | ||
| root = true | ||
| [*] | ||
| indent_style = tab | ||
| indent_size = 4 | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| end_of_line = lf | ||
| [*.{yml,yaml}] | ||
| indent_size = 2 | ||
| indent_style = space | ||
| [*.md] | ||
| indent_size = 2 | ||
| [Makefile] | ||
| indent_style = tab | ||
| ``` | ||
| <!-- END editorconfig --> | ||
| ## Notes for VSCode users | ||
| You can add the following files inside a `.vscode` folder in the root of your project: | ||
| <!-- BEGIN vscode-settings --> | ||
| **.vscode/extensions.json** | ||
| ```json | ||
| { | ||
| "recommendations": ["prettier.prettier-vscode", "editorconfig.editorconfig"] | ||
| "prettier": "@faustt/prettier-config" | ||
| } | ||
| ``` | ||
| **.vscode/settings.json** | ||
| Add prettier to your vscode recommended extensions: | ||
| > .vscode/extensions.json | ||
| ```json | ||
| { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode" | ||
| "recommendations": ["esbenp.prettier-vscode"] | ||
| } | ||
| ``` | ||
| <!-- END vscode-settings --> | ||
| ## Plugins | ||
| ## Notes for Yarn users | ||
| This config comes with some prettier plugins pre-installed: | ||
| If you are using the [newest version of yarn](https://yarnpkg.com/) (which I highly recommend instead of classic), you currently need to tell vscode how to run prettier since the package resolution changed. | ||
| ```bash | ||
| yarn dlx @yarnpkg/pnpify --sdk vscode | ||
| ``` | ||
| This will add new recommended extensions to vscode, so make sure to install them. | ||
| ## Development | ||
| See the [development docs](./docs/development.md) for more information. | ||
| - [prettier-plugin-organize-imports](https://github.com/simonhaenisch/prettier-plugin-organize-imports): Sort imports in JavaScript and TypeScript code | ||
| - [prettier-plugin-package](https://github.com/shellscape/prettier-plugin-package): Sort fields in the package.json with an opinionated order | ||
| - [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte): Support for [svelte](https://svelte.dev/) files |
-8
| "use strict"; | ||
| module.exports = { | ||
| trailingComma: "all", | ||
| plugins: [ | ||
| require.resolve("prettier-plugin-package"), | ||
| require.resolve("@trivago/prettier-plugin-sort-imports"), | ||
| ], | ||
| }; |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No License Found
LicenseLicense information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4
33.33%3714
-0.62%5
66.67%14
27.27%1
Infinity%6
-25%2
100%3
200%48
-48.94%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed