Contributing
Contributions are always welcome, no matter how small or large. This page covers what you need before your first pull request; the Overview has the architecture and project layout.
What to contribute
Section titled “What to contribute”- Bug fixes — always welcome.
- Accessibility improvements — the target is WCAG AAA.
- Translations — no code required. See Translating.
- Documentation — typo fixes, clarifications, new guides. The sources live in
docs/src/content/docs/. - Features — please open an issue first to discuss the approach.
You need Node.js 24 or later (CI runs the latest 24.x) and npm, which ships with it.
git clone https://github.com/potatosalad775/modernGraphTool.gitcd modernGraphToolnpm installnpm run dev # http://localhost:5173To run npm run lint, also install the docs site’s dependencies once with cd docs && npm ci. The
root lint reaches files under docs/, and ESLint resolves their config through
docs/tsconfig.json, which cannot load without docs/node_modules.
Code style
Section titled “Code style”Prettier and ESLint are authoritative: tabs, single quotes, no trailing commas, 100-character lines.
npm run lint # checknpm run format # fixCI runs npm run lint on Linux and Windows, so a PR that is not Prettier-clean will not merge.
App code under src/ is linted with typescript-eslint’s strict type-checked presets, and a warning
fails lint like an error. There is no suppressions file: fix a finding rather than recording it
with eslint --suppress-all. The
testing guide explains the rules that most often need a change
in how you write code.
Some rules are specific to this project: no import from static/ or defaults/, no Tailwind
palette class such as bg-zinc-800, no innerHTML, and no import that crosses a layer (a store
cannot import a service, for example). Each one’s error message says what to write instead. They
live in eslint.config.js, and a new project rule that a machine can check belongs there too.
Line endings
Section titled “Line endings”Every text file is LF, pinned by .gitattributes. That overrides core.autocrlf, which the Git
for Windows installer turns on by default, so there is nothing to configure locally. Just don’t
commit CRLF. .editorconfig tells your editor the same thing; install the EditorConfig extension if
your editor doesn’t read it natively.
git blame
Section titled “git blame”One commit reformatted the whole repository. To keep git blame pointing at real authorship rather
than that commit, run this once per clone:
git config blame.ignoreRevsFile .git-blame-ignore-revsGitHub’s blame view already honours the file.
Svelte 5 conventions
Section titled “Svelte 5 conventions”The project uses Svelte 5 runes, enforced globally:
| Use | Don’t use |
|---|---|
let x = $state(value) | writable(value) |
let y = $derived(expr) | $: y = expr |
$effect(() => { ... }) | afterUpdate |
let { prop } = $props() | export let prop |
Stores are reactive class instances in .svelte.ts files, not plain .ts. Some directories under
src/lib/ have an AGENTS.md with the rules specific to that area; read it before changing code
there.
Shared components
Section titled “Shared components”Build UI out of the wrappers in src/lib/components/atoms/, such as Button, Input, Switch,
Accordion, PopoverPanel, Dialog and ScrollArea, rather than the bare HTML
element. They carry the focus-visible ring, the transition, the disabled styling and the
operator-customizable palette. A raw <button> quietly opts out of all of that and drifts as
themes change.
Buttontakesvariantandsizeprops instead of a class list. Check whether a size already covers what you need (toolbar,icon,icon-sm,icon-xs) before writing padding classes by hand. Its requiredtitlealso becomes thearia-label, so keep the title and the visible text saying the same thing.- Anything passed to
Buttoninclassis merged with tailwind-merge, so an override beats the built-in style without a!modifier: writeclass="rounded-full", notclass="rounded-full!". On a raw element, conflicting utilities tie on specificity and!is still needed. - Checkboxes and radios are the exception. No atom covers them, so they stay raw. Elements bits-ui
owns through a
childsnippet stay as bits-ui renders them.
Colors always go through the semantic tokens (bg-base-100, text-base-content/60,
text-primary, …), never a literal palette value like text-zinc-500, so that operator themes stay
coherent.
Pull requests
Section titled “Pull requests”- Branch from
main, and keep each PR to a single concern. - Run the checks before pushing:
CI runs exactly these on Linux and Windows, plus builds of the app, the CDN distribution and the docs site. See Testing for the two test projects and the coverage ratchet.
Terminal window npm run check # TypeScript + Svelte type checkingnpm run lint # ESLint + Prettiernpm run test # all tests - Update the docs in the same PR when a change affects what users see, what operators configure, or how developers contribute.
- Open the PR with a clear description of what changed and why. Keep commit messages short; the reasoning belongs in the PR description.
By contributing, you agree that your contributions will be licensed under the MIT License.