mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 11:20:36 +08:00
Extracts the avatar components and the style tokens into shared/ui, which both apps consume as a workspace package, to try out ADR 2. Nix and the Docker setups are not updated yet.
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import { radicleConfig, restrictedGlobals } from "./eslint.base.js";
|
|
|
|
// Shared components get their data from props and report changes through
|
|
// callbacks; the apps own all I/O and navigation.
|
|
const sideEffects = ["fetch", "localStorage", "sessionStorage", "location"];
|
|
|
|
export default [
|
|
...radicleConfig({
|
|
rootDir: import.meta.dirname,
|
|
ignores: ["node_modules/**/*", "eslint.config.js", "eslint.base.js"],
|
|
}),
|
|
{
|
|
files: ["**/*.js", "**/*.ts", "**/*.svelte"],
|
|
rules: {
|
|
"no-restricted-globals": ["error", ...restrictedGlobals, ...sideEffects],
|
|
"no-restricted-properties": [
|
|
"error",
|
|
...["window", "globalThis", "self"].flatMap(object =>
|
|
sideEffects.map(property => ({ object, property })),
|
|
),
|
|
],
|
|
"no-restricted-imports": [
|
|
"error",
|
|
{
|
|
patterns: [
|
|
{
|
|
group: [
|
|
"@app/*",
|
|
"@bindings/*",
|
|
"@http-client",
|
|
"@http-client/*",
|
|
"@tauri-apps/*",
|
|
],
|
|
message:
|
|
"Shared code can't depend on either app; take the data as props instead.",
|
|
},
|
|
{
|
|
group: ["../../*"],
|
|
message: "Shared code can't import from outside shared/ui.",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|