Skip to content

Commit

Permalink
Fix ESLint (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
SketchingDev authored Feb 28, 2024
1 parent 5a3055e commit f59156a
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 276 deletions.
29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
24 changes: 12 additions & 12 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: On Push
on: [push]

jobs:
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Setup Node
# uses: actions/setup-node@v1
# with:
# node-version: 16.x
# - run: yarn
# - run: yarn lint
# env:
# CI: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16.x
- run: yarn
- run: yarn lint
env:
CI: true

test-and-build:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions docs/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ESLint

ESLint is installed against each package using:

```shell
npx eslint --init
```
11 changes: 4 additions & 7 deletions examples/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"packageManager": "[email protected]",
"scripts": {
"lint": "eslint 'src/**/*.ts'",
"lint": "eslint -c ../../.eslintrc.json 'src/**/*.ts' '__tests__/**/*.ts'",
"test": "jest __tests__",
"test:js": "node ../api/src/js-script.js",
"test:ts": "node -r ts-node/register ../api/src/ts-script.ts"
Expand All @@ -13,13 +13,10 @@
"@ovotech/genesys-web-messaging-tester": "2.0.7",
"@types/jest": "^29.0.3",
"@types/node": "^14.14.2",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"dotenv": "^16.3.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.0.3",
"prettier": "^3.1.1",
"ts-jest": "^29.1.1",
Expand Down
11 changes: 4 additions & 7 deletions packages/genesys-web-messaging-tester-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"build": "rm -rf ./lib && tsc -p tsconfig.json",
"test": "jest __tests__/",
"lint": "eslint 'src/**/*.ts'",
"lint": "eslint -c ../../.eslintrc.json 'src/**/*.ts' '__tests__/**/*.ts'",
"test:execute:scripted": "ts-node src/index.ts scripted ../../examples/cli-scripted-tests/example.yml -id $DEPLOYMENT_ID -r $REGION -p 10",
"test:execute:scripted:help": "ts-node src/index.ts --help",
"test:execute:ai": "ts-node src/index.ts ai ../../examples/cli-ai-tests/chatgpt-example.yml -id $DEPLOYMENT_ID -r $REGION",
Expand Down Expand Up @@ -48,12 +48,9 @@
"@types/jest-when": "^3.5.2",
"@types/js-yaml": "^4.0.5",
"@types/node": "^14.14.2",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"get-port": "^5.1.1",
"jest": "^29.0.3",
"jest-when": "^3.5.0",
Expand Down
11 changes: 4 additions & 7 deletions packages/genesys-web-messaging-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "rm -rf ./lib && tsc -p tsconfig.json",
"build:readme": "cd ../.. && yarn build-readme ./packages/genesys-web-messaging-tester/README.md https://github.com/ovotech/genesys-web-messaging-tester/tree/main",
"test": "jest __tests__/",
"lint": "eslint 'src/**/*.ts'"
"lint": "eslint -c ../../.eslintrc.json 'src/**/*.ts' '__tests__/**/*.ts'"
},
"dependencies": {
"debug": "^4.3.3",
Expand All @@ -36,12 +36,9 @@
"@types/sinonjs__fake-timers": "^8.1.2",
"@types/uuid": "^9.0.2",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"get-port": "^5.1.1",
"jest": "^29.0.3",
"prettier": "^3.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { webMessagePayloads } from './webMessagePayloads';
export class WebMessageServerConnectionFixture {
constructor(private readonly ws: WebSocket) {}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
public async waitForMessage(): Promise<any> {
return new Promise((resolve, reject) => {
this.ws.on('message', function message(data) {
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"skipLibCheck": true,
"target": "es2019",
"module": "commonjs",
"target": "ES2021",
"module": "CommonJS",
"declaration": true,
"strict": true,
"noImplicitAny": true,
Expand All @@ -19,7 +19,7 @@
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"lib": [
"es2019"
"ES2021"
]
}
}
Loading

0 comments on commit f59156a

Please sign in to comment.