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
110 changes: 48 additions & 62 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,62 @@
import {
defineConfig,
globalIgnores,
} from "eslint/config";
import {defineConfig, globalIgnores} from "eslint/config";

import tsParser from "@typescript-eslint/parser";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import jest from "eslint-plugin-jest";
import globals from "globals";
import js from "@eslint/js";

import {
FlatCompat,
} from "@eslint/eslintrc";

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default defineConfig([{
extends: compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:eslint-plugin-jest/recommended",
"eslint-config-prettier",
),

languageOptions: {
parser: tsParser,

globals: {
...globals.node,
...jest.environments.globals.globals,
import prettier from "eslint-config-prettier";

export default defineConfig([
js.configs.recommended,
...typescriptEslint.configs["flat/recommended"],
jest.configs["flat/recommended"],
prettier,
{
languageOptions: {
parser: tsParser,

globals: {
...globals.node,
...jest.environments.globals.globals,
},
},
},

plugins: {
"@typescript-eslint": typescriptEslint,
jest,
},

rules: {
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
rules: {
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",

"@typescript-eslint/ban-ts-comment": ["error", {
"ts-ignore": "allow-with-description",
}],
"@typescript-eslint/ban-ts-comment": ["error", {
"ts-ignore": "allow-with-description",
}],

"no-console": "error",
"yoda": "error",
"no-console": "error",
"yoda": "error",

"prefer-const": ["error", {
destructuring: "all",
}],
"prefer-const": ["error", {
destructuring: "all",
}],

"no-control-regex": "off",
"no-control-regex": "off",

"no-constant-condition": ["error", {
checkLoops: false,
}],
},
}, {
files: ["**/*{test,spec}.ts"],
"no-constant-condition": ["error", {
checkLoops: false,
}],

rules: {
"@typescript-eslint/no-unused-vars": "off",
"jest/no-standalone-expect": "off",
"jest/no-conditional-expect": "off",
"no-console": "off",
},
}, globalIgnores(["**/dist/", "**/lib/", "**/node_modules/", "**/jest.config.mjs", "**/jest.setup.js"])]);
// Introduced in ESLint 10; the existing try/catch and switch
// patterns rely on defensive initializers. Kept off to avoid
// churning the bundled dist/ output for an unrelated audit fix.
"no-useless-assignment": "off",
},
}, {
files: ["**/*{test,spec}.ts"],

rules: {
"@typescript-eslint/no-unused-vars": "off",
"jest/no-standalone-expect": "off",
"jest/no-conditional-expect": "off",
"no-console": "off",
},
}, globalIgnores(["**/dist/", "**/lib/", "**/node_modules/", "**/jest.config.mjs", "**/jest.setup.js"])]);
Loading