Skip to content

Commit

Permalink
Enable and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
SketchingDev committed Jul 21, 2023
1 parent 09f669e commit ff124e5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
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@v3
# - 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@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: yarn
- run: yarn lint
env:
CI: true

test-and-build:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions examples/api/src/ts-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import {
require('dotenv').config({ path: '../../.env' });

(async () => {
if (!process.env.DEPLOYMENT_ID || !process.env.REGION) {
throw new Error('Environment vars DEPLOYMENT_ID and REGION missing. They must be defined');
}

// << test-section
const session = new WebMessengerGuestSession({
deploymentId: process.env.DEPLOYMENT_ID!,
region: process.env.REGION!,
deploymentId: process.env.DEPLOYMENT_ID,
region: process.env.REGION,
});

new Transcriber(session).on('messageTranscribed', (i) => console.log(i.toString()));
Expand Down
3 changes: 3 additions & 0 deletions examples/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ export function createYamlFileReader(fsReadFileSync: typeof readFileSync): YamlF
try {
content = fsReadFileSync(path, 'utf8');
} catch (error) {
// @ts-ignore
throw new Error(`Failed to read file '${path}'. Reason: ${error.message}`);
throw new Error(`Failed to read file '${path}'. Reason: ${String(error)}`);
}

let yamlContent: unknown;
try {
yamlContent = yaml.load(content);
} catch (error) {
// @ts-ignore
throw new Error(`File '${path}' not valid YAML. Reason: ${error.message}`);
throw new Error(`File '${path}' not valid YAML. Reason: ${String(error)}`);
}

if (
Expand Down

0 comments on commit ff124e5

Please sign in to comment.