build: add frontend TypeScript toolchain
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// 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/**",
|
||||
// Removed file-by-file as the legacy sources are converted to TypeScript.
|
||||
"src/**/*.js",
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ["**/*.mjs"],
|
||||
...eslint.configs.recommended,
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
},
|
||||
},
|
||||
...tseslint.configs.strictTypeChecked.map((config) => ({
|
||||
...config,
|
||||
files: ["src/**/*.ts", "tests/**/*.ts"],
|
||||
})),
|
||||
{
|
||||
files: ["src/**/*.ts", "tests/**/*.ts"],
|
||||
languageOptions: {
|
||||
globals: globals.browser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"no-undef": "off",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
},
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user