Skip to content

Commit c7dc23d

Browse files
committed
fix: fix ESLint configs for backend and frontend
1 parent 573a233 commit c7dc23d

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

backend/eslint.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
const js = require('@eslint/js');
2+
const globals = require('globals');
23

34
module.exports = [
45
js.configs.recommended,
56
{
7+
files: ['**/*.js'],
8+
ignores: ['node_modules/**'],
9+
languageOptions: {
10+
globals: {
11+
...globals.node,
12+
},
13+
},
614
rules: {
715
'no-unused-vars': 'warn',
816
'no-console': 'off',
917
},
1018
},
19+
{
20+
files: ['tests/**/*.js'],
21+
languageOptions: {
22+
globals: {
23+
...globals.node,
24+
...globals.jest,
25+
},
26+
},
27+
},
1128
];

backend/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"type": "commonjs",
2020
"jest": {
2121
"testEnvironment": "node",
22-
"testMatch": ["**/tests/**/*.test.js"]
22+
"testMatch": [
23+
"**/tests/**/*.test.js"
24+
]
2325
},
2426
"bugs": {
2527
"url": "https://github.com/Mishra-coder/Zappify/issues"
@@ -38,6 +40,7 @@
3840
},
3941
"devDependencies": {
4042
"eslint": "^10.2.0",
43+
"globals": "^17.4.0",
4144
"jest": "^30.3.0",
4245
"nodemon": "^3.1.14",
4346
"supertest": "^7.2.2"

frontend/eslint.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@ import reactRefresh from 'eslint-plugin-react-refresh'
55
import { defineConfig, globalIgnores } from 'eslint/config'
66

77
export default defineConfig([
8-
globalIgnores(['dist']),
8+
globalIgnores(['dist', 'cypress']),
9+
{
10+
files: ['cypress.config.js'],
11+
languageOptions: {
12+
globals: { ...globals.node },
13+
sourceType: 'commonjs',
14+
},
15+
},
916
{
1017
files: ['**/*.{js,jsx}'],
18+
ignores: ['cypress.config.js'],
1119
extends: [
1220
js.configs.recommended,
1321
reactHooks.configs.flat.recommended,
@@ -23,7 +31,7 @@ export default defineConfig([
2331
},
2432
},
2533
rules: {
26-
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
34+
'no-unused-vars': ['warn', { varsIgnorePattern: '^[A-Z_]' }],
2735
},
2836
},
2937
])

0 commit comments

Comments
 (0)