diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..42a133ba8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +*.html +*.md +*.yml +libraries/* +docs/* \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index db1ddda27..dd1212179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,6 +156,7 @@ "jsdoc": "4.0.4", "lorem-ipsum": "2.0.8", "nodemon": "3.1.9", + "prettier": "3.4.2", "rcedit": "4.0.1", "rimraf": "6.0.1", "ts-node": "10.9.2", @@ -14696,6 +14697,22 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/print-this": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/print-this/-/print-this-2.0.0.tgz", diff --git a/package.json b/package.json index 2f9a9ef47..9c5d0b3bf 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,9 @@ "integration-mem-db": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", "integration-mem-db-dev": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts", "generate-document": "cross-env nodemon src/tools/generate_document.ts 1000", - "ci-update-nightly-version": "tsx ./bin/update-nightly-version.ts" + "ci-update-nightly-version": "tsx ./bin/update-nightly-version.ts", + "prettier-check": "prettier . --check", + "prettier-fix": "prettier . --write" }, "dependencies": { "@braintree/sanitize-url": "7.1.1", @@ -196,6 +198,7 @@ "jsdoc": "4.0.4", "lorem-ipsum": "2.0.8", "nodemon": "3.1.9", + "prettier": "3.4.2", "rcedit": "4.0.1", "rimraf": "6.0.1", "ts-node": "10.9.2",