From 91c4f364917c8d6ea8d4d86cda690fc0c2451104 Mon Sep 17 00:00:00 2001 From: Masoud Ghorbani Date: Sat, 20 Jul 2024 17:29:33 +0200 Subject: [PATCH] chore: reconfigure prettier, eslint, package.json --- .mocharc.json | 16 +- .prettierrc.js | 5 + .prettierrc.json | 1 - eslint.config.js => eslint.config.cjs | 0 package.json | 215 +++++++++++++------------- 5 files changed, 124 insertions(+), 113 deletions(-) create mode 100644 .prettierrc.js delete mode 100644 .prettierrc.json rename eslint.config.js => eslint.config.cjs (100%) diff --git a/.mocharc.json b/.mocharc.json index fe3a2e9..de82d14 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,11 +1,19 @@ { "$schema": "https://json.schemastore.org/mocharc.json", - "import": ["tsx"], + "import": [ + "tsx" + ], "reporter": "spec", "timeout": 5000, "forbidOnly": true, - "watch-files": ["src"], - "watch-extensions": ["ts"], + "watch-files": [ + "src" + ], + "watch-extensions": [ + "ts" + ], "ui": "bdd", - "spec": ["src/**/*.test.ts", "src/**/*.spec.ts"] + "spec": [ + "src/**/*.test.ts" + ] } diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2a39314 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +import oclifConfig from "@oclif/prettier-config"; + +export default { + ...oclifConfig, +}; diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 6314335..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -"@oclif/prettier-config" diff --git a/eslint.config.js b/eslint.config.cjs similarity index 100% rename from eslint.config.js rename to eslint.config.cjs diff --git a/package.json b/package.json index 9e636a5..ea8d7f1 100644 --- a/package.json +++ b/package.json @@ -1,110 +1,109 @@ { - "name": "ovm", - "description": "Obsidian Vaults Manager", - "version": "0.1.0-b.3", - "author": "Masoud Ghorbani", - "bin": { - "ovm": "./bin/run.js" - }, - "bugs": "https://github.com/w/ovm/issues", - "dependencies": { - "@inquirer/core": "^9.0.3", - "@inquirer/prompts": "^5.1.3", - "@inquirer/type": "^1.4.0", - "@oclif/core": "^4.0.12", - "@oclif/plugin-help": "^6.2.6", - "@oclif/plugin-not-found": "^3.2.11", - "@oclif/plugin-plugins": "^5.3.7", - "ansi-escapes": "^7.0.0", - "async": "^3.2.5", - "glob": "^11.0.0", - "inquirer": "^10.0.1", - "node-fetch-cache": "^4.1.2", - "obsidian-utils": "^0.10.2", - "winston": "^3.13.1", - "yoctocolors-cjs": "^2.1.2", - "zod": "^3.23.8" - }, - "devDependencies": { - "@istanbuljs/nyc-config-typescript": "^1.0.2", - "@oclif/prettier-config": "^0.2.1", - "@oclif/test": "^4.0.4", - "@total-typescript/ts-reset": "^0.5.1", - "@types/async": "^3.2.24", - "@types/chai": "^4.3.16", - "@types/inquirer": "^9.0.7", - "@types/mocha": "^10.0.7", - "@types/mock-fs": "^4.13.4", - "@types/node": "^20.14.10", - "@types/sinon": "^17.0.3", - "@types/validator": "^13.12.0", - "chai": "^5.1.1", - "eslint": "^9.7.0", - "eslint-config-oclif": "^5.2.0", - "eslint-config-oclif-typescript": "^3.1.8", - "eslint-config-prettier": "^9.1.0", - "globals": "^15.8.0", - "mocha": "^10.6.0", - "mock-fs": "^5.2.0", - "nyc": "^17.0.0", - "obsidian": "1.6.6", - "oclif": "^4.14.5", - "prettier": "^3.3.3", - "shx": "^0.3.4", - "sinon": "^18.0.0", - "ts-node": "^10.9.2", - "tsx": "^4.16.2", - "typescript": "^5.5.3", - "typescript-eslint": "^7.16.1" - }, - "engines": { - "node": ">=18.0.0" - }, - "files": [ - "/bin", - "/dist", - "/oclif.manifest.json" - ], - "homepage": "https://github.com/msudgh/ovm", - "keywords": [ - "oclif" - ], - "license": "MIT", - "main": "dist/index.js", - "oclif": { - "bin": "ovm", - "dirname": "ovm", - "commands": "./dist/commands", - "plugins": [ - "@oclif/plugin-help", - "@oclif/plugin-not-found" - ], - "topicSeparator": " ", - "topics": { - "plugins": { - "description": "Manage plugins of the vaults" - }, - "reports": { - "description": "Reports on vaults" - } - } - }, - "repository": "https://github.com/musdgh/ovm.git", - "scripts": { - "build": "shx rm -rf dist && tsc -p tsconfig.json", - "build:watch": "shx rm -rf dist && tsc -p tsconfig.json -w", - "build:release": "shx rm -rf dist && tsc -p tsconfig.release.json", - "lint": "eslint .", - "lint:fix": "eslint . --fix", - "format": "prettier --write \"**/*.{ts,json}\"", - "postpack": "shx rm -f oclif.manifest.json", - "posttest": "pnpm run lint", - "prepack": "oclif manifest && pnpm run build:release && pnpm run test", - "test": "mocha", - "coverage": "nyc --reporter=lcov npm run test" - }, - "types": "dist/index.d.ts", - "publishConfig": { - "registry": "https://npm.pkg.github.com" - } + "name": "ovm", + "description": "Obsidian Vaults Manager", + "type": "module", + "version": "0.1.0-b.3", + "license": "MIT", + "author": "Masoud Ghorbani", + "homepage": "https://github.com/msudgh/ovm", + "bugs": "https://github.com/w/ovm/issues", + "repository": "https://github.com/musdgh/ovm.git", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "shx rm -rf dist && tsc -p tsconfig.json", + "build:watch": "shx rm -rf dist && tsc -p tsconfig.json -w", + "build:release": "shx rm -rf dist && tsc -p tsconfig.release.json", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format:check": "prettier -c \"src/**/*.ts\"", + "format:write": "prettier -w \"**/*.{ts}\"", + "postpack": "shx rm -f oclif.manifest.json", + "posttest": "pnpm run lint", + "prepack": "oclif manifest && pnpm run build:release && pnpm run test", + "test": "mocha", + "coverage": "nyc --reporter=lcov npm run test" + }, + "keywords": [ + "oclif" + ], + "bin": { + "ovm": "./bin/run.js" + }, + "engines": { + "node": ">=18.0.0" + }, + "oclif": { + "bin": "ovm", + "dirname": "ovm", + "commands": "./dist/commands", + "plugins": [ + "@oclif/plugin-help", + "@oclif/plugin-not-found" + ], + "topicSeparator": " ", + "topics": { + "plugins": { + "description": "Manage plugins of the vaults" + }, + "reports": { + "description": "Reports on vaults" + } + } + }, + "files": [ + "/bin", + "/dist", + "/oclif.manifest.json" + ], + "dependencies": { + "@inquirer/core": "^9.0.3", + "@inquirer/prompts": "^5.1.3", + "@inquirer/type": "^1.4.0", + "@oclif/core": "^4.0.12", + "@oclif/plugin-help": "^6.2.6", + "@oclif/plugin-not-found": "^3.2.11", + "@oclif/plugin-plugins": "^5.3.7", + "ansi-escapes": "^7.0.0", + "async": "^3.2.5", + "glob": "^11.0.0", + "inquirer": "^10.0.1", + "node-fetch-cache": "^4.1.2", + "obsidian-utils": "^0.10.2", + "winston": "^3.13.1", + "yoctocolors-cjs": "^2.1.2", + "zod": "^3.23.8" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.2", + "@oclif/prettier-config": "^0.2.1", + "@oclif/test": "^4.0.4", + "@total-typescript/ts-reset": "^0.5.1", + "@types/async": "^3.2.24", + "@types/chai": "^4.3.16", + "@types/inquirer": "^9.0.7", + "@types/mocha": "^10.0.7", + "@types/mock-fs": "^4.13.4", + "@types/node": "^20.14.10", + "@types/sinon": "^17.0.3", + "@types/validator": "^13.12.0", + "chai": "^5.1.1", + "eslint": "^9.7.0", + "eslint-config-oclif": "^5.2.0", + "eslint-config-oclif-typescript": "^3.1.8", + "eslint-config-prettier": "^9.1.0", + "globals": "^15.8.0", + "mocha": "^10.6.0", + "mock-fs": "^5.2.0", + "nyc": "^17.0.0", + "obsidian": "1.6.6", + "oclif": "^4.14.5", + "prettier": "^3.3.3", + "shx": "^0.3.4", + "sinon": "^18.0.0", + "ts-node": "^10.9.2", + "tsx": "^4.16.2", + "typescript": "^5.5.3", + "typescript-eslint": "^7.16.1" + } }