chore: add lint rules, fix script\configs

This commit is contained in:
2026-10-08 04:51:15 +05:00
parent 76039f7bf3
commit 0e8c2478a1
32 changed files with 753 additions and 272 deletions
+9 -13
View File
@@ -1,18 +1,11 @@
/**
* Local ESLint plugin "conventions".
*
* Cross-cutting code conventions that the recommended rule sets don't enforce
* (and plain @typescript-eslint rules cannot express in one shot):
*
* - interface-props: Svelte 5 props always go through a local `interface
* Props` + `let { ... }: Props = $props()` (no inline generics, no inline
* type imports, no untyped destructuring);
* - no-string-union-alias: string-literal union aliases (`type Kind = 'a' |
* 'b'`) are banned in favor of a single `as const` object + indexed access,
* so literal sets live in exactly one place.
*
* Rules are AST-only (no filesystem), see the tests in eslint-plugins/__tests__.
* Local ESLint plugin "conventions": cross-cutting code conventions the
* recommended rule sets do not enforce. Rule details:
* web/eslint-plugins/README.md.
*/
import asciiOnly from "./ascii-only.js";
import commentFormat from "./comment-format.js";
import commentsEnglish from "./comments-english.js";
import interfaceProps from "./interface-props.js";
import noStringUnionAlias from "./no-string-union-alias.js";
@@ -22,6 +15,9 @@ export default {
version: "0.1.0",
},
rules: {
"ascii-only": asciiOnly,
"comment-format": commentFormat,
"comments-english": commentsEnglish,
"interface-props": interfaceProps,
"no-string-union-alias": noStringUnionAlias,
},