diff --git a/.github/renovate.json b/.github/renovate.json index 0b44c69..a1cdefe 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -26,6 +26,10 @@ "groupName": "eslint", "matchPackagePrefixes": ["@typescript-eslint/", "eslint"] }, + { + "groupName": "prettier", + "matchPackagePrefixes": ["prettier"] + }, { "groupName": "typescript", "matchPackageNames": ["typescript"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed6276c..943ce6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,27 @@ jobs: - name: Lint run: npx eslint . + format: + runs-on: ubuntu-latest + timeout-minutes: 5 + name: 'Format: node-18, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set node version to 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install deps + run: npm install + + - name: Format + run: npx prettier src --check + ts-check-tests: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..6e778b4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "trailingComma": "all", + "singleQuote": true +} diff --git a/package-lock.json b/package-lock.json index 0c7f418..d6d3783 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", "eslint": "^8.42.0", + "prettier": "^3.0.3", "typescript": "~5.0.4" } }, @@ -1298,6 +1299,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", diff --git a/package.json b/package.json index 5f2e168..c0bf94b 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "scripts": { "build": "tsc", + "format": "prettier src --write", "lint": "eslint .", "lint:fix": "eslint . --fix" }, @@ -31,6 +32,7 @@ "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", "eslint": "^8.42.0", + "prettier": "^3.0.3", "typescript": "~5.0.4" } } diff --git a/src/index.ts b/src/index.ts index bc28da1..3db3fd4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1 @@ -// todo write the application \ No newline at end of file +// todo write the application