diff --git a/eslint.config.js b/eslint.config.js index 128a56b4..e631e318 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -10,6 +10,7 @@ import globals from 'globals'; import tsEslint from 'typescript-eslint'; import arrow from 'eslint-plugin-prefer-arrow-functions'; import hooks from 'eslint-plugin-react-hooks'; +import mochaPlugin from 'eslint-plugin-mocha'; const defaultRules = { 'no-useless-catch': 'off', @@ -68,5 +69,22 @@ export default defineConfig([ } }, files: ['src/client/**/*.tsx'], + }, + { + extends: [ + mochaPlugin.configs.recommended, + ], + languageOptions: { + globals: { + ...globals.node, + } + }, + files: ['src/backend/tests/**/*.ts'], + rules: { + ...defaultRules, + "prefer-arrow-functions/prefer-arrow-functions": ["off"], + "@typescript-eslint/no-unused-expressions": 'off', + 'mocha/max-top-level-suites': 'off' + }, } ]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9a45bb4f..b21afb94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,6 +171,7 @@ "clsx": "^2.1.1", "drizzle-kit": "^1.0.0-rc.2-c5a84d1", "eslint": "^10.6.0", + "eslint-plugin-mocha": "^11.3.0", "eslint-plugin-prefer-arrow-functions": "^3.2.4", "eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-storybook": "^10.3.6", @@ -10413,6 +10414,33 @@ } } }, + "node_modules/eslint-plugin-mocha": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-11.3.0.tgz", + "integrity": "sha512-anENwrIwmdvunmmssjMn5a4nTd+mYMkqBlwjksxOECcIThLNhefWJIiTWY7pY/arMQFjNwHQjVOZb6pQ9PrLjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.1", + "globals": "^15.14.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/eslint-plugin-mocha/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-prefer-arrow-functions": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow-functions/-/eslint-plugin-prefer-arrow-functions-3.9.1.tgz", diff --git a/package.json b/package.json index 48d66542..bfc32e4e 100644 --- a/package.json +++ b/package.json @@ -210,6 +210,7 @@ "clsx": "^2.1.1", "drizzle-kit": "^1.0.0-rc.2-c5a84d1", "eslint": "^10.6.0", + "eslint-plugin-mocha": "^11.3.0", "eslint-plugin-prefer-arrow-functions": "^3.2.4", "eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-storybook": "^10.3.6",