Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/something.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var a = 5; // Fails unused variable check
var b = 10; // Fails unused variable check

function add(a, b) {
// Fails unused function parameters check
return a + b;
}

console.log(add(a, b));

if (a = 10) {
// Fails incorrect use of the assignment operator
console.log('a is 10');
}

function divide(x, y) {
// Fails missing return in function
if (y === 0) {
return; // Fails inconsistent use of promises
}
return x / y;
}

console.log(divide(10, 2));

// Fails missing 'const', 'let', or 'var' declarations
c = 15;

// Fails undefined variable check
console.log(d);