Skip to content

Commit

Permalink
Merge pull request #88 from guardian/pf/fix-npm-linting
Browse files Browse the repository at this point in the history
All workspaces should have a lint command
  • Loading branch information
bryophyta authored Nov 12, 2024
2 parents 5662ae6 + e3c1450 commit 999543a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"test-update": "jest -u",
"synth": "cdk synth --path-metadata false --version-reporting false",
"diff": "cdk diff --path-metadata false --version-reporting false",
"format": "prettier --write \"{lib,bin}/**/*.ts\""
"format": "prettier --write \"{lib,bin}/**/*.ts\"",
"lint": "eslint src/** --ext .ts --no-error-on-unmatched-pattern --fix",
"lint:ci": "eslint src/** --ext .ts --no-error-on-unmatched-pattern"
},
"devDependencies": {
"@guardian/cdk": "59.3.0",
Expand All @@ -21,7 +23,7 @@
"source-map-support": "0.5.20"
},
"prettier": "@guardian/prettier",
"jest": {
"jest": {
"testMatch": [
"<rootDir>/lib/**/*.test.ts"
],
Expand Down
4 changes: 3 additions & 1 deletion ingestion-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"dev": "tsx watch localRun.ts",
"typecheck": "tsc -noEmit",
"build": "esbuild src/handler.ts --bundle --minify --outfile=dist/handler.js --external:@aws-sdk --external:aws-sdk --platform=node",
"test": "jest --detectOpenHandles --config ../jest.config.js --selectProjects ingestion-lambda"
"test": "jest --detectOpenHandles --config ../jest.config.js --selectProjects ingestion-lambda",
"lint": "eslint src/** --ext .ts --no-error-on-unmatched-pattern --fix",
"lint:ci": "eslint src/** --ext .ts --no-error-on-unmatched-pattern"
},
"dependencies": {
"@aws-sdk/client-s3": "3.637.0",
Expand Down
1 change: 1 addition & 0 deletions ingestion-lambda/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const isCurlyQuoteFailure = (e: SyntaxError): boolean => {
return !!e.message.match(/Unexpected token '[]'/);
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we're not currently validating this, though there's WIP for doing so
const safeBodyParse = (body: string): any => {
try {
return JSON.parse(body);
Expand Down
3 changes: 3 additions & 0 deletions ingestion-lambda/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../tsconfig.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"typecheck": "npm run typecheck --workspaces",
"format": "prettier --write --ignore-path .gitignore \"./**/*{.js,.ts,.json,.md,.yml}\"",
"build": "npm run build --workspaces --if-present",
"lint": "npm run lint --workspaces --if-present",
"lint": "npm run lint --workspaces",
"dev": "npm run dev --workspace=ingestion-lambda"
},
"repository": {
Expand Down

0 comments on commit 999543a

Please sign in to comment.