Skip to content

Commit 744fe1a

Browse files
committed
feat: lint the examples
1 parent 6590d73 commit 744fe1a

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

.eslintrc-examples.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
ignorePatterns: ["examples/disabled_deno-prerecorded/index.js"],
3+
root: true,
4+
extends: ["eslint:recommended"],
5+
parserOptions: {
6+
ecmaVersion: 2020,
7+
},
8+
env: {
9+
node: true,
10+
es6: true,
11+
},
12+
rules: {
13+
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
14+
},
15+
};

examples/node-live/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ const live = async () => {
5959
}
6060
});
6161

62-
connection.on(LiveTranscriptionEvents.UtteranceEnd, (data) => {
62+
connection.on(LiveTranscriptionEvents.UtteranceEnd, (_data) => {
6363
const utterance = is_finals.join(" ");
6464
console.log(`Deepgram UtteranceEnd: ${utterance}`);
6565
is_finals = [];
6666
});
6767

68-
connection.on(LiveTranscriptionEvents.SpeechStarted, (data) => {
68+
connection.on(LiveTranscriptionEvents.SpeechStarted, (_data) => {
6969
// console.log("Deepgram SpeechStarted");
7070
});
7171

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"build:main": "tsc -p tsconfig.json",
4545
"build:module": "tsc -p tsconfig.module.json",
4646
"build:umd": "webpack --mode=production",
47+
"lint:js": "eslint --no-eslintrc -c .eslintrc-examples.js examples --max-warnings 0",
4748
"lint:ts": "eslint src --max-warnings 0",
4849
"watch": "nodemon -e ts --watch src --exec \"npm run build\"",
4950
"test": "mocha -r ts-node/register test/*test.ts test/**/*test.ts --inspect --exit",

0 commit comments

Comments
 (0)