Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

144 changes: 0 additions & 144 deletions .eslintrc.js

This file was deleted.

198 changes: 198 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
const js = require("@eslint/js");
const tseslint = require("@typescript-eslint/eslint-plugin");
const tsparser = require("@typescript-eslint/parser");
const prettier = require("eslint-plugin-prettier");
const promise = require("eslint-plugin-promise");
const security = require("eslint-plugin-security");
const prettierConfig = require("eslint-config-prettier");

module.exports = [
js.configs.recommended,
{
files: ["src/**/*.ts"],
languageOptions: {
parser: tsparser,
parserOptions: {
project: "./tsconfig.json",
},
globals: {
// Mocha globals for test files
describe: "readonly",
it: "readonly",
xit: "readonly",
before: "readonly",
beforeEach: "readonly",
after: "readonly",
afterEach: "readonly",
context: "readonly",
specify: "readonly",
xdescribe: "readonly",
xcontext: "readonly",
xspecify: "readonly",

// Node.js globals
console: "readonly",
__filename: "readonly",
__dirname: "readonly",
module: "readonly",
setTimeout: "readonly",
},
},
plugins: {
"@typescript-eslint": tseslint,
prettier,
promise,
security,
},
rules: {
// TypeScript ESLint rules
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "as" }],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
// Handle exported enum members correctly
args: "after-used",
vars: "all",
caughtErrors: "all",
},
],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/space-infix-ops": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/typedef": [
"error",
{
arrayDestructuring: true,
arrowParameter: true,
memberVariableDeclaration: true,
objectDestructuring: true,
parameter: true,
propertyDeclaration: true,
variableDeclaration: true,
},
],
"@typescript-eslint/unified-signatures": "error",

// Standard ESLint rules
"no-unused-vars": "off", // Disabled in favor of @typescript-eslint/no-unused-vars
"array-callback-return": "error",
"arrow-body-style": ["error", "as-needed"],
"constructor-super": "error",
curly: ["error", "all"],
"max-len": [
"warn",
{
code: 120,
ignorePattern: "^(?!.*/(/|\\*) .* .*).*$",
},
],
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-constant-condition": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-imports": "error",
"no-restricted-globals": "error",
"no-eval": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-irregular-whitespace": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loss-of-precision": "error",
"no-nested-ternary": "error",
"no-plusplus": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unreachable": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-private-class-members": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"object-shorthand": ["error", "always"],
"one-var": ["error", "never"],
"padding-line-between-statements": [
"warn",
{
blankLine: "always",
prev: "*",
next: [
"class",
"do",
"for",
"function",
"if",
"multiline-block-like",
"multiline-const",
"multiline-expression",
"multiline-let",
"multiline-var",
"switch",
"try",
"while",
],
},
{
blankLine: "always",
prev: [
"class",
"do",
"for",
"function",
"if",
"multiline-block-like",
"multiline-const",
"multiline-expression",
"multiline-let",
"multiline-var",
"switch",
"try",
"while",
],
next: "*",
},
{
blankLine: "always",
prev: "*",
next: ["continue", "return"],
},
],
"prefer-template": "error",
"prettier/prettier": "error",
"promise/prefer-await-to-then": "error",
"require-atomic-updates": "error",
"require-await": "warn",
"security/detect-non-literal-fs-filename": "off",
"security/detect-object-injection": "off",
"spaced-comment": ["warn", "always"],
"sort-imports": ["error", { allowSeparatedGroups: true, ignoreCase: true }],
},
},
prettierConfig,
];
Loading
Loading