All checks were successful
ci / ci (22) (push) Successful in 11m57s
- Added "check-types" script to package.json for type checking in both api and web apps. - Updated ESLint configuration to use a shared tooling package for consistent linting rules. - Refactored TypeScript configurations to extend from shared tooling configurations. - Improved code formatting and consistency in various files, including Vue components and TypeScript files. - Introduced CI workflow for automated linting, formatting checks, and type checking on push and pull request events. - Cleaned up unnecessary dependencies and updated existing ones for better performance and maintainability.
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
// @ts-check
|
|
import eslint from "@eslint/js";
|
|
import { defineConfig } from "eslint/config";
|
|
import stylistic from "@stylistic/eslint-plugin";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export { eslint, tseslint };
|
|
|
|
/** @type {import("eslint").Linter.RulesRecord} */
|
|
export const baseRules = {
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"no-constructor-return": "error",
|
|
"no-duplicate-imports": "error",
|
|
"no-unreachable-loop": "error",
|
|
"require-atomic-updates": "error",
|
|
"class-methods-use-this": "error",
|
|
complexity: "warn",
|
|
"max-params": "warn",
|
|
"max-depth": "warn",
|
|
"max-lines": "warn",
|
|
"max-lines-per-function": "warn",
|
|
"max-statements": "warn",
|
|
"max-nested-callbacks": "warn",
|
|
"no-magic-numbers": [
|
|
"warn",
|
|
{
|
|
ignore: [0, 1, 10, 100, 1000, 60, 200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 500],
|
|
ignoreArrayIndexes: true,
|
|
ignoreDefaultValues: true,
|
|
ignoreClassFieldInitialValues: true,
|
|
enforceConst: true,
|
|
detectObjects: true,
|
|
ignoreEnums: true,
|
|
ignoreNumericLiteralTypes: true,
|
|
ignoreReadonlyClassProperties: true,
|
|
ignoreTypeIndexes: true,
|
|
},
|
|
],
|
|
"no-eval": "error",
|
|
"no-implicit-coercion": "error",
|
|
"no-negated-condition": "warn",
|
|
"no-useless-rename": "error",
|
|
"no-var": "error",
|
|
"prefer-const": "error",
|
|
"@stylistic/quotes": ["error", "double"],
|
|
"@stylistic/semi": "off",
|
|
"@stylistic/comma-dangle": "off",
|
|
};
|
|
|
|
export const base = defineConfig(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, {
|
|
plugins: {
|
|
"@stylistic": stylistic,
|
|
},
|
|
rules: baseRules,
|
|
});
|