Skip to content

Commit 53ebe63

Browse files
committed
fix: resolve ESLint unused vars and jest globals errors
1 parent 5c18b9c commit 53ebe63

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

backend/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import globals from 'globals';
22
import pluginJs from '@eslint/js';
33

44
export default [
5-
{ languageOptions: { globals: globals.node } },
5+
{ languageOptions: { globals: { ...globals.node, ...globals.jest } } },
66
pluginJs.configs.recommended,
77
{
88
rules: {

backend/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ app.get('/api/products', (req, res) => {
1212
try {
1313
const products = db.prepare('SELECT * FROM products').all();
1414
res.json(products);
15-
} catch (err) {
15+
} catch {
1616
res.status(500).json({ error: 'Failed to fetch products' });
1717
}
1818
});
@@ -36,7 +36,7 @@ app.post('/api/checkout', (req, res) => {
3636

3737
// Simulate order success
3838
res.json({ message: 'Checkout successful', total, orderId: Date.now() });
39-
} catch (err) {
39+
} catch {
4040
res.status(500).json({ error: 'Checkout failed' });
4141
}
4242
});

backend/tests/db.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const Database = require('better-sqlite3');
2-
31
describe('Database Module', () => {
42
let db;
53

0 commit comments

Comments
 (0)