From 52de2425ce4ef853655a96d65ff4addb59b490bc Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Tue, 4 Jun 2024 12:02:40 +0200 Subject: [PATCH] setup prettier for aws-lambda --- .github/workflows/aws-lambda.yml | 2 -- .github/workflows/node.js.yml | 2 +- aws-lambda/package-lock.json | 17 +++++++++++++++++ aws-lambda/package.json | 5 ++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws-lambda.yml b/.github/workflows/aws-lambda.yml index aea289a7..281ff869 100644 --- a/.github/workflows/aws-lambda.yml +++ b/.github/workflows/aws-lambda.yml @@ -24,5 +24,3 @@ jobs: working-directory: ./aws-lambda - run: npm run eslint working-directory: ./aws-lambda - -# TODO: Setup eslint and prettier for AWS Lambda project diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4277e370..91f5a789 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -51,5 +51,5 @@ jobs: # "dry" causes that if any file is modified, the job fails dry: True # "write" performs changes in place - prettier_options: --write lib/*.ts test/*.js examples/**/*.js + prettier_options: --write lib/*.ts test/*.js examples/**/*.js aws-lambda/lib/*.ts aws-lambda/test/*.js github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/aws-lambda/package-lock.json b/aws-lambda/package-lock.json index 530d7f8c..4a267708 100644 --- a/aws-lambda/package-lock.json +++ b/aws-lambda/package-lock.json @@ -18,6 +18,7 @@ "@stylistic/eslint-plugin-ts": "^2.0.0", "@types/node": "^20.12.8", "eslint": "^8.57.0", + "prettier": "^3.2.5", "tap": "^19.0.2", "ts-node": "^10.9.2", "typescript": "^5.4.5" @@ -4579,6 +4580,22 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", + "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", diff --git a/aws-lambda/package.json b/aws-lambda/package.json index 928ac64d..f69080e9 100644 --- a/aws-lambda/package.json +++ b/aws-lambda/package.json @@ -5,8 +5,10 @@ "main": "build/raygun.aws.js", "types": "build/raygun.aws.d.ts", "scripts": { - "//eslint": "performs static analysis over project files and examples", + "//eslint": "performs static analysis over project files", "eslint": "eslint --fix lib/*.ts test/*.js", + "//prettier": "performs code formatting over project files", + "prettier": "prettier --write lib/*.ts test/*.js", "//prepare": "prepare project for distribution", "prepare": "tsc", "//test": "runs tests on main project", @@ -18,6 +20,7 @@ "@stylistic/eslint-plugin-ts": "^2.0.0", "@types/node": "^20.12.8", "eslint": "^8.57.0", + "prettier": "^3.2.5", "tap": "^19.0.2", "ts-node": "^10.9.2", "typescript": "^5.4.5"