Files

47 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2025-04-20 11:29:53 -07:00
import globals from "globals";
import pluginJs from "@eslint/js";
import mochaPlugin from "eslint-plugin-mocha";
2026-03-03 17:43:57 +00:00
import tseslint from "typescript-eslint";
2025-04-20 11:29:53 -07:00
/*
Please do not forget to look at the latest eslint configurations and rules.
ESlint v9 configuration is different than v8.
"https://eslint.org/docs/latest/use/configure/"
*/
/** @type {import('eslint').Linter.Config[]} */
export default [
2026-03-03 17:43:57 +00:00
{
2026-03-03 18:26:42 +00:00
ignores: ["dist/**", "node_modules/**", "coverage/**", "test/**"],
2026-03-03 17:43:57 +00:00
},
2025-04-20 11:29:53 -07:00
{
languageOptions: {
globals: {
...globals.node, // Add Node.js globals
...globals.chai, // Add Chai globals
},
ecmaVersion: 2023,
sourceType: "module",
},
},
pluginJs.configs.recommended, // Core JS rules
2026-03-03 17:43:57 +00:00
...tseslint.configs.recommended, // TypeScript recommended rules
2025-04-20 11:29:53 -07:00
mochaPlugin.configs.flat.recommended, // Mocha rules
{
2026-03-03 17:43:57 +00:00
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
2026-03-20 12:40:27 -07:00
projectService: {
allowDefaultProject: ["jest.config.ts"],
},
2026-03-03 17:43:57 +00:00
tsconfigRootDir: import.meta.dirname,
},
},
2025-04-20 11:29:53 -07:00
rules: {
2026-06-09 12:35:57 -07:00
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], // Ignore unused variables that start with '_'
2026-03-03 17:43:57 +00:00
"@typescript-eslint/no-explicit-any": "warn", // Warn on 'any' types
2025-04-20 11:29:53 -07:00
"mocha/max-top-level-suites": "warn", // Warn if there are too many top-level suites instead of failing
},
},
];