-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
31 lines (29 loc) · 1.26 KB
/
Copy patheslint.config.js
File metadata and controls
31 lines (29 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-FileCopyrightText: 2026 MesTTo
//
// SPDX-License-Identifier: MIT
import tseslint from "typescript-eslint";
import prettier from "eslint-config-prettier";
export default tseslint.config(
{ ignores: ["**/dist/**", "**/*.config.*", "packages/*/src/prelude.ts", "docs/**", "corpus/**", "**/src/gen/**"] },
...tseslint.configs.recommended,
{
files: ["packages/*/src/**/*.ts"],
languageOptions: {
parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
},
rules: {
// Convention C2: every switch on a discriminated union is exhaustive (type-aware).
// A `default` clause counts as exhaustive (we use it for the catch-all cases).
"@typescript-eslint/switch-exhaustiveness-check": [
"error",
{ considerDefaultExhaustiveForUnions: true },
],
"@typescript-eslint/no-floating-promises": "error",
// C9/C8: we use `!` deliberately after explicit bounds checks in the hot path.
"@typescript-eslint/no-non-null-assertion": "off",
// C1: never delete a property (V8 dictionary mode).
"no-restricted-syntax": ["error", { selector: "UnaryExpression[operator='delete']", message: "Do not delete properties (V8 dictionary mode); set to undefined." }],
},
},
prettier,
);