Files
trx-rs/src/trx-client/trx-frontend/trx-frontend-http/frontend/eslint.config.js
T

84 lines
2.7 KiB
JavaScript

// SPDX-FileCopyrightText: 2026 Stan Grams <sjg@haxx.space>
//
// SPDX-License-Identifier: GPL-2.0-or-later
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
"../assets/web/generated/**",
],
},
{
files: ["**/*.mjs"],
...eslint.configs.recommended,
languageOptions: {
globals: globals.node,
},
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
...config,
files: ["src/**/*.ts", "tests/**/*.ts"],
})),
{
files: ["src/**/*.ts", "tests/**/*.ts"],
ignores: ["src/decode-history-worker.ts"],
languageOptions: {
globals: globals.browser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"no-undef": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
},
},
{
// app.ts is the final migrated monolith. The compiler checks it with the
// full strict baseline; rules that require runtime schemas or broad async
// rewrites stay disabled here until those responsibilities are extracted.
files: ["src/app.ts"],
rules: {
"prefer-const": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-duplicate-type-constituents": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unnecessary-type-conversion": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/unbound-method": "off",
},
},
{
files: ["src/decode-history-worker.ts"],
languageOptions: {
globals: globals.worker,
parserOptions: {
project: "./tsconfig.worker.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"no-undef": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
},
},
);