Diagnostic reference
Every error and warning Citry reports has a code, such as citry.template.unknown-variable. The editor shows it next to the message, and citry check prints it with each finding. Find the code below to see what went wrong and how to fix it.
The code always names the same mistake in every tool: the editor, citry check, citry format, and the template parser. The message can add details, such as the name you misspelled.
Some rules can be made stricter or turned off. Those entries say "Your application can change this severity". For the template lint rules, see Template linting.
Codes that start with citry.python. or citry.typescript. come from the Python and TypeScript type checkers. They are listed at the end of this page.
citry.parse.syntax
Invalid template syntax. The template has a syntax mistake, such as an unclosed element or an unfinished expression. Citry cannot read the template, so it does not render.
Example: Unclosed element
<section>
<p>Hello</p>Fix: Correct the template at the reported position. The message says what the parser expected there.
When this appears: The parser finds malformed markup, an incomplete expression, or another syntax error. Only the first syntax error in a template is reported.
Default severity: error. Reported by: template parser APIs, citry format, citry check, citry-lsp.
citry.parse.value
Invalid template value. Citry was given a value it cannot parse as a template. This is usually not a mistake in your template text.
Fix: If an extension adds its own template syntax, update it or report the message to its authors. Otherwise, report the message as a Citry bug.
When this appears: A parser API receives a value it cannot turn into template source, for example when an extension that adds its own template syntax reports positions that do not fit the template.
Default severity: error. Reported by: template parser APIs, citry format, citry check, citry-lsp.
citry.parse.too-deep
Template nested too deeply. The template nests tags deeper than Citry allows, so it does not render.
Example: Tags of any kind past the total limit
<div>
<div>
<!-- ... 510 more nested <div> tags ... -->
<p>Too deep</p>
</div>
</div>Example: Logic tags past the logic limit
<c-if cond="a">
<c-for each="item in items">
<!-- ... 254 more nested logic tags ... -->
<c-if cond="b">Too deep</c-if>
</c-for>
</c-if>Fix: Move the inner part into its own component's template, which starts counting from zero. Markup passed to a component between its tags still counts toward the template that writes it.
When this appears: A tag would sit more than 512 levels deep, or more than 256 Citry logic levels deep: every c- tag except <c-raw>, and each c-if=, c-elif=, c-else, c-for= or c-empty attribute. A template inside an attribute counts from the depth of the tag that holds it.
Default severity: error. Reported by: template parser APIs, citry format, citry check, citry-lsp.
citry.parse.configuration
Template parser setup failed. Citry could not set up the template parser for your application, so it cannot check this template.
Fix: Read the message for the rule that failed, and fix the application or extension that defines it.
When this appears: The tag rules that your application or its extensions add to the parser cannot be built or applied.
Default severity: error. Reported by: citry check, citry-lsp.
citry.template.unknown-variable
Unknown template variable. A template reads a variable that nothing provides, often because of a typo. Rendering then fails with a KeyError.
Messages:
Example: Unknown name in an interpolation
<p>{{ missing_name }}</p>Example: Unknown name in a dynamic attribute
<div c-title="missing_name"></div>Fix: Correct the name, or add it to the data that template_data() returns. If template_data() builds its result in a way Citry cannot read, such as by calling a helper function, list every key it returns in Lint.template_data_keys. If another integration provides the name, declare it in template_variables, or change rule_unknown_template_variable.
When this appears: A name in {{ ... }} or in a c-* attribute is not in the component's template data, a c-for or c-fill binding around it, template_globals, or the declared template_variables. In a template that several components share, every one of them must provide the name.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.undeclared-template-data-key
Key missing from template_data_keys. A component's template_data() returns a key that its Lint.template_data_keys does not list, so the list no longer names every key the method returns.
Message:
template_data() returns '{name}', but Lint.template_data_keys does not list it. Add '{name}' to the list so it names every key the method returns.Example: A key the list leaves out
class Card(Component):
class Lint:
template_data_keys = ("title",)
def template_data(self, kwargs, slots):
data = build_card(kwargs)
data["badge"] = "new"
return dataFix: Add the key to Lint.template_data_keys, or stop returning it.
When this appears: A component declares Lint.template_data_keys, and its template_data() writes a key as a literal, such as {"title": ...} or data["title"] = ..., that the list leaves out.
Default severity: warning. Reported by: citry check.
citry.template.unknown-component
Unknown component. A component tag names a component that your application does not register, often because of a typo. The template fails to render.
Message:
Component <{tag}> is not registered.Example: Unregistered component tag
<c-missing-card />Fix: Correct the tag name, or register the component with the application that Citry loaded.
When this appears: A <c-*> tag names no component in the selected application or library, counting built-in names and aliases.
Default severity: error. Reported by: citry check, citry-lsp.
citry.template.marker-name-invalid
Invalid <c-mark> tag. A <c-mark> tag, which marks part of a component that an event handler can replace, has no usable name, an extra attribute, or content it does not accept.
Messages:
Fix: Give the marker one literal name that starts with a letter and contains only letters, digits, _ or -. Remove other attributes and named fills.
When this appears: A <c-mark> tag has no name attribute, a dynamic or invalid name, any other attribute, or a named fill.
Default severity: error. Reported by: citry check, citry-lsp.
citry.template.alpine-attribute
Alpine attribute on an HTML element. An HTML element still has an Alpine x-* attribute, such as x-data or x-on:click. Citry uses Vue, so nothing reads it and it does nothing.
Message:
'{name}' is an Alpine attribute. Citry uses Vue, so nothing reads it. Replace it with its Vue form, or set rule_alpine_attribute to 'ignore' if a library on the page reads '{name}'.Example: Alpine state on an element
<div x-data="{ open: false }">
<button x-on:click="open = !open">Menu</button>
</div>Fix: Move the state into js_data() or $component, and write the listener in its Vue form, such as @click. If another library on the page reads x-* attributes, set rule_alpine_attribute to "ignore".
When this appears: An Alpine directive name, such as x-data, x-on:click, or x-intersect, sits on an HTML element or <c-element>, including inside nested templates. Other x-* names, such as x-webkit-airplay, are ordinary HTML. Component tags are not checked, because an x-* attribute there is a Python keyword argument. x-cloak is reported as citry.template.alpine-cloak.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.alpine-cloak
x-cloak hides an element for good. An HTML element still has x-cloak. Nothing removes it, so a [x-cloak] CSS rule hides the element for good.
Message:
Nothing in Citry removes 'x-cloak', so a '[x-cloak]' CSS rule keeps this element hidden. Delete 'x-cloak' and its '[x-cloak]' rule; the server-rendered HTML already shows the content.Example: Leftover x-cloak
<div x-cloak>{{ message }}</div>Fix: Delete x-cloak and its [x-cloak] CSS rule. The HTML from the server already shows the content.
When this appears: x-cloak, in any letter case, sits on an HTML element or <c-element>, including inside nested templates. Component tags are not checked.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.invalid-attribute-value
HTML attribute value the browser does not accept. An HTML attribute that accepts only certain keywords, such as draggable or type, has another value, or a boolean attribute such as disabled has a value other than empty or its own name, which still turns it on. The browser raises no error either way.
Messages:
Example: A misspelled keyword
<div draggable="treu">Drag me</div>Example: An input type the browser does not know
<input type="datetime" name="start">Example: A boolean attribute set to false
<button disabled="false">Search</button>Fix: Use one of the valid values the message lists. For a boolean attribute, write it with no value, leave it out, or bind a JavaScript boolean such as :disabled="saving". If a script on the page reads its own values from the attribute, set rule_invalid_attribute_value to "ignore" for that component.
When this appears: The value is not one of the keywords the HTML Standard lists for that attribute on that element. A boolean attribute, such as disabled or required, is on whenever it is present, so any value other than the empty string or the attribute's own name is reported, including "false" and "true". Letter case does not matter, except for list markers in type on <ol> and <li>. A Vue binding whose value is one JavaScript string, such as :dir="'rtl'", is checked too. Other bound values, component tags, <c-element>, custom elements, elements inside <svg> or <math>, and attributes that take a list of words, such as rel, are not checked. citry check --static and an editor that has not loaded your application report it as a warning unless the component's own Lint class sets the rule as a plain string, because they cannot read your LintSettings.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.misspelled-directive
Misspelled Citry directive. A c-* attribute on an HTML element looks like a Citry directive, such as c-iff for c-if, but is not one, so Citry renders it as an ordinary attribute and the directive never runs. Or a v-* attribute looks like a Vue directive, such as v-iff for v-if, so Vue looks for a custom directive of that name and the page fails.
Messages:
Example: A typo in c-if
<div c-iff="show">Details</div>Example: A directive name from Vue
<input c-model="query">Example: A typo in v-if
<p v-iff="open">Details</p>Fix: Use the directive the message names. For a custom directive, register it in the directives option of $component({...}). If the attribute really is meant for the browser, pass it through c-bind, such as c-bind="{'show': value}". For a directive a plugin registers, set rule_misspelled_directive to "ignore" for that component.
When this appears: The part after c- is not an HTML attribute that the element accepts, and it looks like a directive: if, elif, else, for, empty, or bind with two neighboring letters swapped, one letter typed twice, or one letter left out, such as c-fro, c-iff, or c-ele; one of those in other letter case, such as c-If; a spelled-out c-elif, such as c-else-if; c-show for c-if or c-model for v-model; or c-key or c-ignore without the #. A different letter, or an extra letter that is not a double, is not a typo, because it usually makes an ordinary word such as c-kind or c-form; neither are c-or, c-bid, c-bin, or a one-letter name. On a custom element, which can define its own attributes, the c-show, c-model, c-key, and c-ignore names are not reported. Only HTML elements, custom elements, and <c-element> are checked, not component tags or elements inside <svg> or <math>. A v-* name is reported on any element outside <svg>, <math>, and v-pre content, component tags included, when it is not a Vue directive and it is a typing slip (two neighboring letters swapped, one letter typed twice, or one letter left out) away from one, such as v-iff, v-shwo, or v-IFF, or is a spelled-out v-else-if, such as v-elif or v-elseif. A custom directive whose name is one slip from a Vue directive is not reported when every component that renders the template registers it in the directives option of $component({...}), under the name as written, its camelCase form, or that form with a capital first letter, such as directives: { iff: {...} } for v-iff or { myDir: {...} } for v-my-dir. Only citry check without --static and an editor that has loaded your application skip it. It is still reported when Citry cannot read that option, and for a directive that a plugin registers with Citry.vue.use(plugin), which no check can see. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.misspelled-attribute
Misspelled HTML attribute. An attribute on an HTML element looks like a typo of an attribute that element accepts, such as titel for title. The browser keeps it as an unknown attribute and ignores it, with no error.
Message:
'{name}' is not an attribute of <{element}>, so the browser ignores it. Did you mean '{suggestion}'?Example: A typo in title
<div titel="Board">...</div>Example: A typo in a Vue binding
<img :scr="avatarUrl">Fix: Use the attribute the message names. If a script on the page really reads an attribute with this name, write it as data-<name>, or set rule_misspelled_attribute to "ignore" for that component.
When this appears: The attribute is not one the HTML Standard lists for that element or for every element, and it is one typing slip from one that is: two neighboring letters swapped, one letter typed twice, or one letter left out, such as titel, clas, or herf. A binding such as :titel, v-bind:titel, or c-titel is checked by the attribute it sets. Letter case does not matter. Names with a hyphen or a colon, such as data-*, aria-*, or hx-*, bindings with a modifier such as .prop, component tags, custom elements, <c-element>, bindings on Vue's <slot>, and elements inside <svg> or <math> are not checked. A c-* name that looks like a misspelled directive, such as c-fro, is reported as citry.template.misspelled-directive instead. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.misspelled-element
Misspelled HTML element. A tag looks like a typo of an HTML element, such as <dvi> for <div>. The browser renders it as an unknown element with no styles or behavior, with no error.
Message:
<{tag}> is not an HTML element. Did you mean <{suggestion}>?Example: A typo in div
<dvi class="board">...</dvi>Fix: Use the element the message names. If a Vue plugin registers a component with this name, set rule_misspelled_element to "ignore" for that component.
When this appears: The tag is lowercase, has no hyphen and no c- prefix, is not an HTML, SVG, or obsolete HTML element or one of Vue's built-in tags such as <component>, and is one typing slip from an HTML element: two neighboring letters swapped, one letter typed twice, or one letter left out. Any other unknown lowercase tag is not reported, because a Vue plugin may register a component under that name. Elements inside <svg> or <math> are not checked. Outside <math>, a MathML name one slip from an HTML element, such as <min>, is reported, because there it is more likely a typo of <main>. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.unknown-aria-attribute
Unknown ARIA attribute. An aria-* attribute is not one that WAI-ARIA defines, often because of a typo such as aria-expandd. Browsers and screen readers ignore it, so the element loses the state or label it was meant to have.
Messages:
Example: A typo in aria-expanded
<button :aria-expandd="open">Menu</button>Fix: Use the ARIA attribute the message names, or the one you meant from the WAI-ARIA list. To keep a custom value on the element, store it in a data-* attribute.
When this appears: The attribute name, after any :, v-bind:, or c- prefix, starts with aria- and is not a WAI-ARIA 1.2 or 1.3 state or property. Letter case does not matter. ARIA lets no page invent its own aria-* names, so every unknown name is reported, not only typos. Component tags are not checked, because there the name is an input. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.invalid-nesting
Element the browser moves out of a paragraph. An element that starts a new block, such as <div> or <ul>, is inside a <p>. The browser closes the paragraph before that element, so the page has a different structure from the template, and a page that Vue renders fails to compile.
Message:
<{tag}> cannot be inside <p>. The browser closes the <p> before it, so the page structure differs from the template.Example: A div inside a paragraph
<p>Owner: <div>{{ owner.name }}</div></p>Fix: Change the <p> to a <div>, or change the inner element to an inline one such as <span>.
When this appears: A <p> is open around the element, directly or through inline elements, custom elements, c-if, c-elif, c-else, c-for, c-empty, or a <c-slot> fallback, and the element is one that the HTML Standard says closes an open <p>: address, article, aside, blockquote, details, dialog, div, dl, dd, dt, fieldset, figcaption, figure, footer, form, h1 to h6, header, hgroup, hr, li, main, menu, nav, ol, p, pre, search, section, summary, table, ul, and obsolete ones such as center and xmp. Content inside <button>, <table>, <template>, <noscript>, <svg>, <math>, a component tag, or <c-element> is not checked, because the browser keeps it inside or the check cannot see what renders there. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.duplicate-id
Duplicate element id. Two elements in one template always render with the same literal id. An id must be unique in the page, so a label's for attribute, aria-labelledby, URL fragments, and getElementById find only the first element.
Message:
Another element in this template already has id '{id}'. An id must be unique in the page.Example: The same id twice
<div id="board">
<h1 id="board">Board</h1>
</div>Fix: Give one of the elements another id.
When this appears: Two elements have the same static id value, and neither is inside a condition or a loop: c-if, c-elif, c-else, c-for, or c-empty, as a tag or as an attribute on the element or around it; v-if, v-else-if, v-else, or v-for; a c-fill, a <c-slot> fallback, the body of a component tag, or a <template>. Those may render an element zero or several times, so the check cannot know whether both appear. v-show does not count, because a hidden element is still in the page. The same id coming from two templates is not reported. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.missing-image-alt
Image without alt text. An <img> has no alt text. A screen reader then reads out the file name or nothing useful, and the image has no text when it fails to load.
Message:
<img> has no alt text. Describe the image in alt, or write alt="" for an image that only decorates the page.Example: An avatar without alt text
<img src="/static/avatar.svg" width="32" height="32">Fix: Describe the image in alt. For an image that only decorates the page, write alt="" so screen readers skip it.
When this appears: An <img> has no alt in any form (alt, c-alt, :alt, or v-bind:alt), no aria-label or aria-labelledby, and no role="none" or role="presentation". An image with a c-bind or v-bind spread is not reported, because the spread may add alt. Neither is an <img> that is a component's only top-level element, or the only element in each block of a top-level c-if, c-elif, and c-else chain, when the component may have browser code (JavaScript, js_data(), State, or event handlers), because Vue passes the alt that a parent writes on the component's tag to that element. A component whose JavaScript sets inheritAttrs: false in $component({...}) stops Vue from passing it, so that image is reported. citry check without --static, and an editor that has loaded your application, report that image when the component has no browser code or sets inheritAttrs: false. citry check --static and an editor that has not loaded your application report the other images too, but never a component's only top-level <img>, with the severity the component's own Lint class sets as a plain string.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.csp-incompatible
Breaks a strict Content Security Policy. The template writes something that a strict Content Security Policy blocks in the browser: an inline <script> or <style> element, an inline event attribute such as onclick, or a javascript: URL. Citry reports it only when security_csp is "warn" or "strict".
Messages:
Example: An inline click handler
<button onclick="save()">Save</button>Example: A javascript: URL
<a href="javascript:void(0)">Open</a>Fix: Move a script or style into the component's js or css, or into a Script or Style dependency. Replace an inline handler such as onclick with a Vue listener such as @click. Use a real URL, and a Vue listener for the action, instead of a javascript: URL. A custom attribute that starts with on, such as online, needs another name, for example data-online, because browsers and the policy treat every on* attribute as a possible event handler.
When this appears: Off by default. When the application sets security_csp to "warn", it is a warning; with "strict", an error. The template writes one of these directly: a <script> or <style> element; an attribute with a fixed value (not a binding such as :onclick) whose name is longer than two characters and starts with on, such as onclick or online; or an action, formaction, href, src, or xlink:href attribute, or data on <object>, whose value starts with javascript: once character references such as s are decoded. Letter case does not matter. The content of <c-raw> and of v-pre regions is checked the same way, and <c-element is="..."> is checked as the element it names. Citry bindings such as c-href and c-bind, and HTML passed to a component in an attribute, are checked when the page renders instead. Vue bindings such as :href and v-bind get their values in the browser, so neither check sees them. Attributes on component tags (including a capitalized tag such as <Card> that may be a Vue component) are not checked, and neither is the content of <noscript>, <xmp>, <iframe>, <noembed>, <noframes>, or <plaintext>, which the browser reads as text, or markup inside an SVG <title> or <style>. citry check --static and an editor that has not loaded your application do not report it, because they do not know security_csp.
Default severity: off (ignore). Your application can turn it on. Reported by: citry check, citry-lsp.
citry.template.unknown-url
Link to a missing page or file. A link, image, script, or form points at a path on your site that none of your app's routes or static files serves, so the browser gets a 404 Not Found.
Messages:
Example: A misspelled page path
<a href="/abuot">About</a>Fix: Correct the path, or add the route or file. If another server answers the path, set rule_unknown_url to "ignore" in the component's Lint class, or for the whole app in LintSettings.
When this appears: An HTML element's href, src, or action is a path that starts with a single /, such as /about or /static/logo.svg, and your web framework answers that it serves no such path. Citry asks the framework that mounts it: Flask's URL rules and static folders when you call citry.contrib.flask.mount(), the routes and StaticFiles mounts of a FastAPI or Starlette app when you call citry.contrib.fastapi.mount(), and Django's URL patterns and static file finders when you call citry.contrib.django.urlpatterns(). The query string and fragment are ignored. These are not checked: a URL with a scheme, such as https: or mailto:; a //host/... URL; a relative path; a value written as an expression, such as :href or c-href; a <base href> or a <link rel="preconnect"> or rel="dns-prefetch"; a path under the prefix Citry's own routes are mounted at; a parameter type that only the view checks, such as a FastAPI project_id: int argument; and, with Django, a path under MEDIA_URL. The rule runs in citry check with your application loaded, and in an editor that has loaded your application, and only when one of those calls runs while Citry imports the module that --app, or the editor's citry.app setting, names. The editor checks the paths your templates hold when it loads your application, so a path you add later is checked after the next load. A path that another server answers for your site, such as a reverse proxy, is reported too, which is why the rule is a warning.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.template.unknown-inject-key
Shared value read under a key nothing provides. A component reads a shared value with self.inject("key"), but no component above it provides that key, so rendering it raises KeyError.
Messages:
Example: A misspelled key
board = self.inject("bord") # the page provides "board"Fix: Correct the key to the one the page provides, or provide the key above the component. Pass a default, such as self.inject("key", None), when the value is optional. If the key comes from somewhere Citry cannot see, set rule_unknown_inject_key to "ignore" in the component's Lint class, or for the whole app in LintSettings.
When this appears: A method of a component class, or of a base class or mixin it extends, calls self.inject() with one string literal and no default, and no provider Citry can see gives that key to the component. Citry starts at each template that uses the component's tag, such as <c-card />, and walks up through the templates that use those components. A key counts when a <c-provide key="..."> wraps the tag; when a component on the way calls self.provide() with it; when the tag is slot content and the component whose <c-slot> shows it wraps that <c-slot> in <c-provide> or calls self.provide(); when a <c-component c-is="...">, which may render any component, sits inside a <c-provide> with the key or in a component that calls self.provide() with it; or when a render(provides={...}) call in your project's Python files passes it as a literal key, which counts for every component. A key written as a module-level string constant, also one imported from another module of the project, counts as that string. If the component appears in several places and one of them provides the key, nothing is reported. When no template uses the component's tag, because Python renders it or a <c-component c-is="..."> picks it, or when it is used only inside a group of templates that use each other and that no template outside the group uses, the key is compared with every key the app provides anywhere. Citry reports nothing for a call with a default, such as self.inject("key", None), a key written as a name or expression, or a call in a class from an installed package; below a <c-provide c-key="...">, a self.provide() key written as an expression, a tag inside a <c-component c-is="...">, markup in a component's attribute, or a component Python builds inside a component's methods or passes to another component, such as Layout(slots={"default": Widget()}); below a component whose Python source it cannot read and whose code calls provide(); and nothing at all while a registered template cannot be parsed or when the folder citry check runs from holds more than 20,000 Python files. A key the page does provide is reported when Citry cannot see the provider: a provides dictionary built elsewhere, a self.provide() call in a helper function, a template string rendered from Python, or a render(provides=...) call outside the folder you run citry check from. That is why the rule is a warning. The rule runs in citry check with your application loaded, and in an editor that has loaded your application; the editor checks the calls in the file you edit against the keys your app provided when it last loaded.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.js-data.unsupported-type
JsData field is not a JSON type. A JsData field has a type that cannot be sent to the browser as JSON, such as a set or a date. Editor help treats the value as any. A citry.Secret is reported too, because rendering refuses to send one.
Messages:
Example: Unsupported set value
class Card(Component):
class JsData:
selected_ids: set[int]Fix: Convert the value to JSON-friendly data in js_data(), such as a list, a string, or a dict of plain values, and change the JsData annotation to match. For a Secret, read its value on the server with get_secret_value() where you need it, and leave it out of js_data().
When this appears: A declared or inferred JsData field has a type that strict JSON cannot carry, such as bytes, a set, a callable, a date or time, or a whole class instance. A citry.Secret counts too: Citry never sends one to the browser, and rendering the component raises TypeError. With your application loaded, citry check also reads a module-level value that js_data() puts in its result, such as {"token": API_TOKEN} for API_TOKEN = Secret(...), and reports it when its value is not JSON. It reads such a value when it is the whole result, a value or item of a dict, list, or tuple literal in it, a name unpacked into a list such as [*TOKENS], either branch of a conditional expression, or the argument of Const(...); the value may be an attribute of a module-level name, such as config.API_TOKEN where config is a module or a plain class, when reading it runs no code: a property, or an object with a __getattr__ hook such as Django's lazy settings, is not read. A value read through an attribute is judged only when it is built from plain dicts, lists, tuples, strings, numbers, booleans, None, and Secrets. A module-level value holding another kind of object is reported only when that object's class could never pass the JSON check, so a lazy object or a dict subclass is skipped. A value nested too deeply to read is skipped. Without --types, a value that a call computes, such as get_token(), is not read. The editor and citry check --types also report a value that ty, the Python type checker Citry runs, types as a standard library type JSON cannot carry, such as PurePosixPath, datetime, Decimal, UUID, a set, or complex, or as a Secret.
Default severity: warning. Reported by: citry check, citry-lsp.
citry.js-data.public-name-collision
JsData field conflicts with a public instance name. A JsData field has the same name as something already on the component instance in the browser, such as a prop, a method, or a name Vue reserves.
Messages:
Fix: Rename the JsData field, or rename the Vue Options entry it collides with.
When this appears: A JsData field that Citry can see in the source uses a reserved browser name or the name of a Vue Options entry, such as a prop, method, or computed value.
Default severity: error. Reported by: citry-lsp.
citry.css.misspelled-variable
Misspelled css_data() variable. A component's CSS reads a custom property that is one typing slip from a key its css_data() returns, such as var(--acent) for accent. Nothing sets that property, so the CSS property that reads it gets its inherited or initial value.
Message:
Nothing sets --{name}, so this property gets its initial or inherited value. Did you mean --{suggestion}, from css_data()?Example: A dropped letter
h1 {
color: var(--acent);
}Fix: Use the key's exact name. If another stylesheet sets this property on purpose, add a fallback, as in var(--name, inherit), or set rule_misspelled_css_variable to "ignore" for this component.
When this appears: A var(--name) in the component's own css or css_file has no fallback value, the same CSS does not set --name itself, every key that css_data() or CssData returns is known, name is not one of them, and name is one typing slip from one of them: two neighboring letters swapped, one letter typed twice, or one letter left out. Properties that a parent component or a site stylesheet sets are not reported unless they are that close to a key. citry check needs your application for this rule.
Default severity: warning. Your application can change this severity. Reported by: citry check.
citry.css.misspelled-class
Misspelled CSS class. A class in a template is one typing slip from a class the component's own CSS styles, such as bord for board. No CSS that Citry reads styles the class as written, so the element renders without those styles.
Message:
No CSS that Citry reads styles the class '{name}'. Did you mean '{suggestion}', from this component's CSS?Example: A dropped letter
class Board(Component):
template = """
<div class="bord"></div>
"""
css = """
.board {
display: grid;
}
"""Fix: Use the class name the CSS styles. If a stylesheet that Citry does not read styles this class on purpose, set rule_misspelled_css_class to "ignore" for this component.
When this appears: A static class attribute in a component's template, on an HTML element or a component tag, holds a class of three or more characters that is one typing slip from a class selector in the component's own css or css_file: two neighboring letters swapped, one letter typed twice, or one letter left out. These slips usually name another class of the same family, so they do not count: one that moves, doubles, or drops a digit, such as col-1 for col-12; a missing final s after a letter other than s, such as tab for tabs; one of these short words, as the whole class or as its last word after a hyphen or underscore, next to its longer form: close (closed), collapse (collapsed), disable (disabled), enable (enabled), fade (faded), mute (muted), show (shown), slide (slider), and toggle (toggled or toggler), such as navbar-toggle for navbar-toggler; and one letter typed twice or left out in a first hyphen-separated part of one or two characters, such as p-4 for px-4 or m-auto for ml-auto. Two letters swapped in that part, such as iu-button for ui-button, are reported. The class is reported only when no CSS that Citry reads declares it: no selector in a registered component's css, css_file, inline or local-file Dependencies stylesheet, or template <style> element that holds CSS names it, and no attribute selector such as [class^="btn-"] matches it. Bound classes, such as :class, v-bind:class, and c-class, words inside {{ }} in a class attribute, and classes on tags that render no element, such as c-if or template, are not checked. citry check needs your application for this rule; the editor does not run it.
Default severity: warning. Your application can change this severity. Reported by: citry check.
citry.css.undeclared-class
Class that no CSS declares. A class in a template is not named by any CSS that Citry reads, so either nothing styles it or a stylesheet outside Citry does.
Message:
No CSS that Citry reads styles the class '{name}'.Example: A class without CSS
<div class="card-header">Title</div>Fix: Add CSS for the class to a component, or remove the class. For a component that uses classes from a stylesheet Citry does not read, set rule_undeclared_css_class to "ignore" in its Lint class.
When this appears: The rule is off by default, because it also reports classes from a site stylesheet or a CSS framework such as Tailwind, and classes used only by JavaScript or tests. With rule_undeclared_css_class set to "warning" or "error", it reports each class in a static class attribute, on an HTML element or a component tag, that no CSS Citry reads declares. A class counts as declared when a selector in a registered component's css, css_file, inline or local-file Dependencies stylesheet, or template <style> element that holds CSS names it anywhere, as in .name, .card .name, .name:hover, or :is(.name), including inside @media and nested rules, or when an attribute selector such as [class~="name"] or [class^="btn-"] matches it. Citry does not read stylesheets linked by URL, local files that cannot be read as UTF-8, sources written in another language through css_lang, or <link> tags in templates, so their classes are reported. Bound classes, words inside {{ }} in a class attribute, and classes on tags that render no element are not checked, and a class that citry.css.misspelled-class reports is not reported again. citry check needs your application for this rule; the editor does not run it.
Default severity: off (ignore). Your application can turn it on. Reported by: citry check.
citry.css.undeclared-variable
Custom property that nothing sets. A component's CSS reads a custom property with var(--name) and no fallback, and nothing that Citry reads sets it. Unless a stylesheet or script outside Citry sets it, the CSS property that reads it gets its inherited or initial value.
Message:
Nothing that Citry reads sets --{name}, so this property gets its initial or inherited value unless a stylesheet or script outside Citry sets it.Example: A property set nowhere
.card {
padding: var(--card-gap);
}Fix: Set the property in a component's CSS or css_data(), add a fallback, as in var(--name, 1rem), or, for a component that reads properties a stylesheet outside Citry sets, set rule_undeclared_css_variable to "ignore" in its Lint class.
When this appears: The rule is off by default, because it also reports properties that a site stylesheet, a design system, or a script outside Citry sets. With rule_undeclared_css_variable set to "warning" or "error", it reports each var(--name) without a fallback value in a component's own css or css_file when nothing that Citry reads sets --name. Citry counts as setting it: a --name: declaration or an @property --name rule in a registered component's css, css_file, inline or local-file Dependencies stylesheet, or template <style> element that holds CSS; a css_data() or CssData key called name on any registered component; a style attribute in a template that sets --name; and the text --name in quotes, or followed by a colon, in a :style or c-style binding, in a component's JavaScript, or in the Python module that defines a component. A component whose own css_data() keys Citry cannot all read is not checked, but a property that only such a component sets is still reported where another component reads it. A var() in a template's style attribute is not checked, and a var() that citry.css.misspelled-variable reports is not reported again. citry check needs your application for this rule; the editor does not run it.
Default severity: off (ignore). Your application can turn it on. Reported by: citry check.
citry.vue.unknown-variable
Unknown Vue variable. A Vue expression reads a name the component does not send to the browser, often because of a typo. Vue shows nothing, or the expression fails in the browser.
Messages:
Example: Unknown name in a Vue expression
<button :disabled="submitting1">Save</button>Fix: Correct the name, or send the value from js_data(). If it is a Python variable, pass it with a c- attribute instead. Declare names that come from outside Citry in vue_variables, or change rule_unknown_vue_variable. On <c-slot>, a c- attribute passes Python slot data, which the fill reads with data= rather than v-slot.
When this appears: A name in a Vue expression is not a JsData or js_data() key, a v-for or slot alias around it, a Vue or Citry helper, a browser global, or a declared vue_variables entry.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.vue.python-variable
Python variable read by a Vue expression. A Vue expression reads a Python c-for or c-fill variable. The browser never sees that variable, so the value is missing, or Vue shows a different browser value with the same name.
Messages:
Example: Python loop variable in a Vue binding
<li c-for="item in items" :title="item"></li>Fix: Pass the Python value with a c- attribute, such as c-title="item" instead of :title="item", or loop with Vue's v-for. If a browser value has the same name, rename one of them. On <c-slot>, a c- attribute passes Python slot data, which the fill reads with data= rather than v-slot.
When this appears: A Vue expression inside a c-for loop or c-fill binding reads the Python variable, and no Vue v-for or slot alias of that name is around it. When Citry knows every name the component sends to the browser and the name is not among them, it reports citry.vue.unknown-variable instead, unless that rule is set to ignore.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.vue.unknown-slot-prop
Unknown Vue slot prop. A <c-fill v-slot="{ ... }"> reads a name that the component's <c-slot> never passes as a Vue prop, such as :row. Vue sets the name to undefined without a warning, so the fill shows nothing for it, or fails in the browser when it reads a field of it.
Messages:
Example: A name the slot does not pass
{# The component's template #}
<c-slot name="item" :row="row" />
{# The caller #}
<c-Table>
<c-fill name="item" v-slot="{ item }">
<span v-text="item.title"></span>
</c-fill>
</c-Table>Fix: Use a prop name the slot passes, add the prop to the slot's <c-slot>, such as :row="row", or read the value as Python slot data with data= instead.
When this appears: A <c-fill> reads a name with v-slot="{ ... }", and no <c-slot> for that slot in the component's template passes that name as a Vue prop, such as :row or v-bind:row. Vue writes prop names in camelCase, so :row-data passes rowData. Citry checks only when it can read the component's template and every slot name involved is a plain name="...", not c-name or c-bind.
Default severity: warning. Reported by: citry check, citry-lsp.
citry.vue.invalid-expression
Vue expression with a syntax error. A Vue expression, such as the value of v-if, :title, or @click, is not valid JavaScript. Vue cannot compile the template, so the page fails when it renders.
Messages:
Example: An unfinished condition
<p v-if="open &&">Details</p>Fix: Complete or correct the expression, such as v-if="open && ready".
When this appears: The expression does not parse as JavaScript, after character references such as && are decoded the way Vue decodes them. Citry names the parser's error in the message and underlines the place it points to, such as the end of open &&. For an expression that holds a character reference, it underlines the whole expression and leaves the parser's error out of the message. A listener may also hold statements or a function expression. The arguments of a server call such as @c-click="save({...})" are checked too. A valueless :title, which Vue reads as :title="title", everything on or inside an element with v-pre, which Vue does not compile, and custom directive values are not checked, although Vue still fails on a custom directive value that is not valid JavaScript. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.vue.compile-error
Template that Vue's compiler rejects. Vue's compiler rejects the template, so a component that uses Vue fails to render. Most often the browser would build a different element tree from the one the template describes: a <div> directly inside a <table>, a <button> inside a <button>, a <form> inside a <form>, or an <a> inside an <a>. A v-else with no v-if right before it, and a component inside a Vue v-for, are reported too.
Message:
Vue cannot compile this template: {detail}Example: A div directly inside a table
<table>
<div>Row</div>
</table>Fix: Follow the compiler's message. For a table, put rows in <tr> and cells in <td> or <th>; for nested buttons, forms or links, close the outer one first or use another element; for v-else, put it on the element right after the one with v-if or v-else-if.
When this appears: Citry writes the Vue template that a render compiles, runs the same compiler on it, and reports each error at the text you wrote. Every c-if, c-elif and c-else branch, and the body of every c-for, is checked, but usually on its own, so a mistake that spans the c-if or c-for tag, such as a <div> in a c-for directly inside a <table>, may not be reported. A Vue expression with a syntax error is reported as citry.vue.invalid-expression, and a block element inside a <p> as citry.template.invalid-nesting, so this rule does not report them again, even when those rules are turned off. A component inside a Vue v-for is reported only by citry check with the application loaded, which can tell whether the component is transparent or simple; such a component renders into its caller's HTML and may sit inside a v-for. Content inside #c-ignore or <c-raw>, whether a <c-element>'s content fits the tag Python chooses, where a component tag sits, and attributes an extension handles, such as @c-click, are not checked, and a template that uses an extension's own template syntax is skipped. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.vue.misspelled-event
Misspelled DOM event. A listener on an HTML element names an event that looks like a typo of a DOM event, such as @clik for @click. No element fires that event, so the listener never runs.
Message:
'{event}' is not a DOM event, so this listener never runs. Did you mean '{suggestion}'?Example: A typo in click
<button @clik="toggle()">Show details</button>Fix: Use the event the message names. If the page dispatches a custom event with this name, set rule_misspelled_event to "ignore" for that component.
When this appears: The event name in @name or v-on:name, before any modifier, is all lowercase letters, is not a DOM event that the HTML Standard or Vue's types list, and is one typing slip from one that is: two neighboring letters swapped, one letter typed twice, or one letter left out. Names with a hyphen, a colon, or an uppercase letter, and a few ordinary words such as scrolled and touched, are not reported, because they are usually custom events. Component tags, custom elements, and v-pre content are not checked. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.component-js.unknown-variable
Unknown component JavaScript variable. Code inside $component reads a name that is not declared there, often a callback value you forgot to destructure. It fails in the browser.
Message:
Component JavaScript variable '{name}' is not defined.Example: Undeclared name in a callback
$component(({ component }) => {
component.ready = settings.ready;
});Fix: Declare or destructure the name, or read the value from the component instance. If a project script defines it as a global, declare it in component_js_globals, or change rule_unknown_component_js_variable.
When this appears: A name inside a $component initializer is not declared in that code, destructured from the callback's argument, a JavaScript or browser global, or a declared component_js_globals entry.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.component-js.unknown-member
Unknown component instance member. Component JavaScript reads this.<name> or component.<name>, and the component has no member with that name, often because of a typo. The value is undefined in the browser.
Message:
Component instance member '{name}' is not defined by this component.Example: Misspelled js_data() key in a callback
$component(({ component }) => {
console.log(component.missing_field);
});Fix: Correct the name, or define it on the component. A plugin that adds a property to every component should give it a $ prefix, such as $api.
When this appears: The name is not a js_data() key, prop, data() key, setup binding, method, computed value, or injection. Citry checks only when it can see every js_data() key and every Vue Options section in the source. It skips names that start with $ or _, bracket reads such as component[key], and code that uses mixins, extends, Object.assign, a class, or computed member names.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.invalid-state-binding-target
Invalid State binding target. A :c-* State binding is on an element that has no value to bind, such as a <div>, or an input type that cannot hold one, such as a file input.
Example: Binding on a non-control element
<head :c-query></head>Fix: Bind a form control that holds a value, such as <input>, <select>, or <textarea>. On a custom element, name its update event with .on:<event>. To react to an event on another element, use an @c-* binding instead.
When this appears: The element or input type cannot hold a bound value, or does not support the binding's direction or update event.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.invalid-model-target
v-model on an element that holds no value. v-model is on an element that has no value to bind, such as a <form> or a <div>. The component fails to render when Citry compiles it for Vue.
Message:
v-model does not work on <{tag}>, which holds no value. Put it on an <input>, <textarea>, or <select>, or on a component.Example: v-model on a form
<form v-model="query" @c-submit.prevent="search">
<input type="search" name="q">
</form>Fix: Move v-model to the <input>, <textarea>, or <select> that holds the value. For a custom element, bind its value property and listen for its change event instead.
When this appears: v-model, with or without modifiers such as .lazy, is on an HTML element other than <input>, <textarea>, or <select>, or on a custom element such as <my-picker>. Component tags, PascalCase Vue components, and <c-element> are not reported, because they decide what v-model binds; neither is v-pre content, which Vue does not compile. citry check --static and an editor that has not loaded your application report it too, with the severity the component's own Lint class sets as a plain string.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.unknown-state-field
Unknown State binding field. A :c-* State binding names a field the component's State does not have, often because of a typo.
Message:
State field '{name}' is not a public field of this component.Example: Unknown field in a State binding
<input :c-missing_field.debounce="refresh">Fix: Correct the field name, or add the field to the component's State class.
When this appears: A :c-* binding names a field that is not a public field of the component's State class. Bindings whose component or State class Citry cannot determine are not checked.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.unknown-server-event
Unknown server event. Browser code names a server event that the component has no handler for, often because of a typo.
Message:
Server event '{name}' is not declared by this component.Example: Unknown literal event
<button @click="sendEvent('missing')">Run</button>Example: Unknown declarative handler
<button @c-click="missing">Run</button>Example: Unknown loading handler
<span v-show="$loading('missing')">Saving</span>Fix: Correct the name, or add a public method with that name to the component's Events class.
When this appears: A template or component JavaScript calls sendEvent, $sendEvent, $loading, or $error with a string that names no handler, or an @c-* binding names no handler.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.undeclared-emit
Undeclared emitted event. Browser code emits a Vue event that the component's emits option does not list, often because of a typo. Parents listening for the declared name never hear it.
Message:
Event '{name}' is not declared in this component's emits option.Example: Misspelled event in a method
$component({
emits: ['drop-task'],
methods: {
drop() { this.$emit('drop-tsak'); },
},
});Example: Undeclared event in the template
<button @click="$emit('close')">Close</button>Fix: Correct the event name, or add it to emits.
When this appears: this.$emit, component.$emit, or $emit in the component's template uses a name that emits does not list and no on<Event> prop declares. Citry checks only when emits is an array of strings or an object with plain keys. A component without emits may emit any name, as in Vue.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.undeclared-component-event
Listener for an event the child component does not declare. A template listens on a child component for an event the child does not declare, often because of a typo. The listener usually never runs.
Messages:
Example: Misspelled child event
<c-Lane @drop-tsak="moveTask($event)"></c-Lane>Example: A lowercase typo
<c-Card @hdie="hideCard"></c-Card>Fix: Correct the event name, or add it to the child's emits. It is a warning by default; to make an undeclared listener fail citry check, set rule_undeclared_component_event to "error".
When this appears: An @name or v-on:name listener on a component tag names an event that the child's emits does not list and no on<Event> prop accepts. Vue then passes the listener to the child's root element, where it runs only for a DOM event of that name. A plain lowercase name, such as hdie, is reported only when it is not a DOM event that the HTML Standard or Vue's types list, such as click. Citry checks only when the child's emits is an array of strings or an object with plain keys. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: warning. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.missing-component-prop
Missing required Vue prop. A component tag leaves out a Vue prop that the child component marks as required.
Message:
Required Vue prop '{name}' is missing for <{tag}>.Example: Missing required prop
<c-card />Fix: Pass the prop on the tag, such as :count="total".
When this appears: A registered <c-*> tag has no Vue binding for a prop the child declares with required: true, and no spread binding could supply it.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.incompatible-component-prop
Incompatible Vue prop. A Vue prop on a component tag gets a value of a type the child component does not accept.
Message:
Vue prop '{name}' expects {expected}, but this binding is {actual}.Example: Wrong literal type
<c-card :count="'many'" />Example: A string for a Boolean prop
<c-status :open="open ? 'open' : 'closed'" />Fix: Pass a value of the type the child declares, or change the child's prop type.
When this appears: A :prop or v-bind:prop value on a component tag has a type Citry knows, from a literal, a condition whose two results are literals, JsData, or a loop binding, and the child's declared Vue prop type does not accept it. For a Boolean prop, Vue turns the string '' and the prop's own name, hyphenated, into true, so any other string literal is reported.
Default severity: error. Reported by: citry check, citry-lsp.
citry.browser.missing-component-key
Repeated component without #c-key. A component that a <c-for> loop repeats has no #c-key, on a page that uses Vue. The page fails to render as soon as the loop has two items.
Message:
<{tag}> repeats inside <c-for> but has no #c-key. This page uses Vue, and the render fails when the loop has two items.Example: A card per project
<c-for each="project in projects">
<c-Card c-title="project.title" />
</c-for>Fix: Add #c-key with a value that identifies each item and stays the same, such as #c-key="task.id".
When this appears: A registered component tag sits inside a <c-for> body, or carries c-for itself, and has no #c-key. It is reported when the template's component or the repeated component makes the page use Vue: it has component JavaScript, js_data() or JsData, an Events class, or a Vue attribute (v-*, @, or :) in its template. A transparent component and a simple=True component are not reported, because they render into their caller's HTML. Another component on the same page can also make it use Vue, which this check cannot see. citry check needs your application for this rule.
Default severity: error. Your application can change this severity. Reported by: citry check.
citry.browser.prop-assignment
Assignment to a Vue prop. A component changes a prop it receives from its parent. Vue props are read-only, so the assignment does not change the value and Vue logs a warning instead.
Messages:
Example: Closing from the child
<button @click="open = false">Close</button>Fix: Emit an event and let the parent change the value, as in $emit('close'), or copy the prop into the component's own data and change the copy.
When this appears: In the component's own template, a Vue expression assigns to one of the component's declared props with =, +=, or another assignment operator, or with ++ or --, or binds it with v-model. In the component's JavaScript, it is reported for an assignment or update through this or the $component context, such as this.open = false or this.count++. A write to a field of an object prop, such as open.count = 1, is not reported, and neither is a name that a v-for or slot binds. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.unknown-server-event-field
Unknown server event field. An @c-* binding sends an object with a key that the handler's data class does not declare. The server rejects the call, and the handler does not run.
Messages:
Example: A typo in a field name
<button @c-click="save({amont: 1})">Add</button>Fix: Correct the key, or add the field to the handler's data class.
When this appears: The arguments of an @c-* binding, such as @c-click="save({amont: 1})", are an object literal with a key the handler's data class does not declare, or the handler takes no data parameter. A key written next to a ... spread is still checked. A Pydantic data class is not checked, because Pydantic may ignore extra keys or read a field under another name. When several components share the template, it is checked only when they use the same data class for the handler. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.unknown-form-field
Unknown form field. A form sends its fields to a server event, and one of its controls has a name that the handler's data class does not declare. The server rejects each submit that sends that control, and the handler does not run.
Messages:
Example: A typo in a control's name
<form @c-submit.prevent="search">
<input name="qeury" />
</form>Fix: Correct the control's name, or add the field to the handler's data class.
When this appears: A <form> has an @c-submit binding that writes no arguments, such as @c-submit.prevent="search" or search(), so the browser sends the form's named controls, as a post without JavaScript does. An <input>, <select>, <textarea>, or submit <button> in the form has a static name the handler's data class does not declare, or the handler takes no data parameter. A submit button sends its name only when it is the one that submits the form, and a checkbox only when it is checked. A control is not checked when the browser may not send it with this form or may send it under another name: it is disabled, by its own disabled attribute, a bound :disabled, or a disabled <fieldset>; it is tied to another form by its form attribute; it is a file input, a button that cannot submit, or a button whose click is prevented, as in @click.prevent; its type or name is written as an expression; or it has an attribute spread such as v-bind="attrs". An image input sends where it was clicked, as x and y, or name.x and name.y, so those names are checked instead of its name. Neither are the host's CSRF field names that the server removes before it checks the data class, by default csrfmiddlewaretoken. A Pydantic data class is not checked, because Pydantic converts values and may read a field under another name. When several components share the template, it is checked only when they use the same data class for the handler. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.missing-form-field
Missing form field. A form sends its fields to a server event, but none of its controls is named after a field that the handler's data class requires. The server rejects every submit, and the handler does not run.
Message:
Server event '{event}' requires field '{name}', but no control in this form has that name, so the server rejects every submit.Example: A form without the required control
<form @c-submit.prevent="search">
<button>Search</button>
</form>Fix: Add a control with that name, or give the field a default in the handler's data class.
When this appears: A <form> has an @c-submit binding that writes no arguments, such as @c-submit.prevent="search" or search(), so the browser sends the form's named controls, as a post without JavaScript does. No <input>, <select>, <textarea>, or <button> in the form has the name of a field without a default. The rule runs only when the template shows every name the form can send: the form has no id, which a control elsewhere could name in its form attribute, and it holds no component, custom element, slot, <template>, loop, v-html, #c-ignore content, attribute spread, or name written as an expression. A Pydantic data class is not checked, because Pydantic converts values and may read a field under another name. When several components share the template, it is checked only when they use the same data class for the handler. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.missing-server-event-field
Missing server event field. An @c-* binding calls a server event without a field that the handler's data class requires. The server rejects the call, and the handler does not run.
Message:
Server event '{event}' requires field '{name}', which this call does not send, so the server rejects it.Example: No arguments for a required field
<button @c-click="save()">Add</button>Fix: Send the field, or give it a default in the handler's data class.
When this appears: The arguments of an @c-* binding are an object literal with no ... spread and no computed key, and they leave out a field that has no default; or the binding sends no arguments, as in save or save(), from an element that cannot contain a form, such as a button. A binding with no arguments on a <form>, or for the submit event, is not reported here, because the browser then sends the form's fields; citry.browser.missing-form-field checks those. A Pydantic data class is not checked. When several components share the template, it is checked only when they use the same data class for the handler. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.browser.incompatible-server-event-field
Wrong type for a server event field. An @c-* binding sends a literal value that the handler's data class does not accept for that field. The server rejects the call, and the handler does not run.
Message:
Server event '{event}' rejects this value for field '{name}': {detail}Example: A string for an int field
<button @c-click="save({amount: '1'})">Add</button>Fix: Send a value of the type the field declares, such as 1 instead of '1'.
When this appears: A key in the object literal of an @c-* binding has a literal value, such as '1', true, 2.5, or null, or a condition whose two results are literals, and the server's check for that field rejects it. The browser sends the arguments as JSON, which the server checks strictly: a string is not turned into a number. For a handler that accepts GET, the browser may send them as a query string instead, which the server reads as text, so a value is reported only when both ways fail. Values that are not literals are not checked. A Pydantic data class is not checked, because Pydantic converts values. When several components share the template, it is checked only when they use the same data class for the handler. citry check needs your application for this rule, and the editor reports it once it has loaded your application.
Default severity: error. Your application can change this severity. Reported by: citry check, citry-lsp.
citry.check.template-declaration
Template declaration unavailable. citry check could not read a component's template or template_file, for example because computing it raised an error.
Message:
Citry could not inspect this component's template declaration: {detail}Fix: Read the error in the message and fix the declaration or the code it runs.
When this appears: Reading the component's template or template_file declaration raises an error, or Citry cannot tell which declaration applies.
Default severity: error. Reported by: citry check.
citry.check.template-language-unsupported
Unsupported template language. The component sets template_lang to another template language. citry check reads only Citry templates, so it skipped this one.
Message:
Citry cannot check template_lang with a {type} value. This template was skipped.Fix: Nothing to fix if the other language is intended. Check that template with that language's own tools.
When this appears: A component's template_lang is not None.
Default severity: error. Reported by: citry check.
citry.check.template-value-invalid
Invalid template declaration value. A component's template or template_file has a value of the wrong type, so citry check skipped it.
Messages:
Example: Non-string inline template
class Card(Component):
template = build_template()Fix: Set template to a string, or template_file to a string or Path.
When this appears: Component.template is not a string, or Component.template_file is neither a string nor a pathlib.Path.
Default severity: error. Reported by: citry check.
citry.check.template-file-not-found
Template file not found. The file named in template_file does not exist in any place Citry looks.
Message:
Template file '{path}' was not found. Searched: {locations}.Example: Missing template file
class Card(Component):
template_file = "missing.html"Fix: Correct the path, or move the file to one of the searched locations the message lists.
When this appears: template_file points to a path that is not in the component's directory or any configured template directory.
Default severity: error. Reported by: citry check.
citry.check.template-file-unreadable
Template file could not be read. The template file exists, but Citry could not open it or read it as UTF-8 text.
Message:
Citry could not read this template file: {detail}Fix: Check the file's permissions, and save it as UTF-8.
When this appears: Citry finds the template_file but cannot open it, or it is not valid UTF-8.
Default severity: error. Reported by: citry check.
citry.check.template-namespace-unavailable
Template variables unavailable. citry check could not work out which variables a component's template receives, so it cannot check them.
Message:
Citry could not inspect this template's variables: {detail}Fix: Read the error in the message and fix the template data declaration or the code it runs.
When this appears: Reading the component's declared or inferred template data raises an error.
Default severity: error. Reported by: citry check.
citry.check.template-not-checked
Template checked only with the application. A class sets a template, but it extends a class from another module of your project, so Citry cannot tell from the file alone that it is a component. Its template is checked only when Citry loads your application and finds the class there.
Message:
Citry cannot tell from this file that {component} is a component, because it extends {base}, which comes from another module, so this template is checked only when Citry loads your application and finds {component} there.Example: A base class from another module
from app.base import BaseCard
class Card(BaseCard):
template = """
<article>{{ title }}</article>
"""Fix: Nothing is wrong with the code. To check the template, load your application: run citry check with it, as in citry --app module:engine check, and give the editor the same module:engine path, in the citry.app setting in VS Code. For a class you added or renamed, the message stays until the editor loads the application again, which VS Code does when you save a Python file.
When this appears: A class in a Python file sets template to a string literal that contains a tag, Citry cannot prove from that file that the class is a component, and it extends a class imported from a module of your project, directly or through a class defined in the same file. A class from an installed package does not count. citry check --static lists it as a note. The editor shows it as information on the class name while it has not loaded your application, and for a class added or renamed since it loaded the application. citry check with your application loaded, citry check --types, and an editor that has loaded the application find the class in the component registry and check its template, so they do not report it.
Default severity: information. Reported by: citry check, citry-lsp.
citry.check.url-checker-missing
Links not checked. citry check did not check the link paths in your templates, because no web framework integration told Citry which paths your app serves.
Message:
Links such as '{path}' were not checked, because no web framework integration told Citry which paths your app serves. Point --app at the module that calls citry.contrib.flask.mount(), citry.contrib.fastapi.mount(), or citry.contrib.django.urlpatterns(), or set rule_unknown_url to "ignore".Fix: Point --app at a module that mounts Citry when it is imported, such as app.main:citry_app when app/main.py calls mount(app, citry_app), or config.urls:citry_app, with DJANGO_SETTINGS_MODULE set, for a Django project whose urls.py calls urlpatterns(). To stop checking links, set rule_unknown_url to "ignore".
When this appears: A template has an href, src, or action path that starts with a single /, rule_unknown_url is not "ignore" for it, and no citry.contrib.flask.mount(), citry.contrib.fastapi.mount(), or citry.contrib.django.urlpatterns() call ran while citry check loaded your application. This happens when the module the --app option names only creates the Citry instance and nothing imports the module that mounts it, or when you serve Citry with citry.contrib.asgi or citry.contrib.wsgi, which do not know your app's routes. citry check lists it once, as a note, and it never fails the check.
Default severity: information. Reported by: citry check.
citry.check.url-checker-failed
Link check failed. Your web framework raised an error while citry check asked whether your app serves a link path, so citry check skipped that link.
Messages:
Fix: Fix the error the message shows. It comes from your framework's routing code, such as a URL pattern module that fails to import. Until it is fixed, citry check skips those links.
When this appears: The path checker that citry.contrib.flask.mount(), citry.contrib.fastapi.mount(), or citry.contrib.django.urlpatterns() registered raises an error for one or more link paths. Each of those paths is skipped, and citry check lists one note with the error for the skipped path that sorts first. The note never fails the check.
Default severity: information. Reported by: citry check.
citry.check.python-source-unreadable
Python source could not be analyzed. A Python file could not be read or parsed, so its components were not checked.
Message:
Citry could not analyze this Python source: {detail}Fix: Fix the Python syntax error or encoding problem in the file the message names.
When this appears: citry check --static reaches a Python file it cannot read, decode, or parse.
Default severity: error. Reported by: citry check.
citry.i18n.catalog-invalid
Invalid Fluent catalog source. A messages block or Fluent catalog file has invalid Fluent syntax or another translation source mistake.
Fix: Correct the Fluent source at the reported position. The message says what is wrong.
When this appears: A messages block or catalog file has invalid Fluent syntax, an unsupported @param type, or another source error.
Default severity: error. Reported by: citry check, citry-lsp.
citry.i18n.unknown-message
Unknown i18n message. Code asks for a translation message that no catalog defines, often because of a typo in the message ID.
Fix: Correct the message ID, or add the message to the component's messages or a catalog.
When this appears: A tr() call, <c-trans> tag, $c-tr binding, or browser bind() call with a literal ID names a message or attribute that no component or configured catalog package defines.
Default severity: error. Reported by: citry check, citry-lsp.
citry.i18n.argument-invalid
Invalid i18n argument. A translation call passes the wrong inputs: a missing, extra, or mistyped argument, an unknown format profile, or wrong <c-trans> values or fills.
Fix: Match the arguments to the message's @param declarations, which hover shows, or correct the profile name.
When this appears: A literal i18n call or $c-tr binding is malformed, its message inputs do not match the message's @param declarations, it names an unknown formatter or parser profile, or a <c-trans> tag supplies the wrong values or fills.
Default severity: error. Reported by: citry check, citry-lsp.
citry.i18n.missing-param-type
Message variable without a type. A message uses a variable that has no # @param comment, so Citry cannot check the type of the value that callers pass in.
Fix: Add a comment such as # @param {str} $name above the message, naming the type the variable really takes. Set rule_i18n_missing_param_type to "error" to make a missing type fail catalog compilation, or to "ignore" to hide this warning.
When this appears: A source-language message uses a variable such as { $name } in its value or an attribute, has no # @param comment declaring its type, and rule_i18n_missing_param_type is "warning". A variable used in a selector or a formatting function without a type fails catalog compilation and is reported as citry.i18n.catalog-invalid.
Default severity: warning. Your application can change this severity. Reported by: citry check.
citry.i18n.cross-language-fallback
Text from a fallback language. A translation is missing for some locales, so this text appears in another language there. The page still renders, but the text sits inside an element marked with the requested language, so a screen reader may read it with the wrong pronunciation.
Fix: Add the missing translations; the i18n coverage command lists them. To show fallback text with its own language, call self.i18n.resolve() and put its locale and direction on an element, as the i18n guide's Language direction and accessibility page shows. Set rule_i18n_cross_language_fallback to "error" to require complete translations, or to "ignore" to hide this warning.
When this appears: A tr() call or self.i18n.tr() call with a literal message ID, or a message listed in Component.I18n.client_messages, has no translation in some selectable locale and resolves to another locale through the configured fallbacks or the message's source locale.
Default severity: warning. Your application can change this severity. Reported by: citry check.
citry.i18n.rich-message-fallback
Rich message without a translation. A <c-trans> message has no translation in some locale. Rendering it in that locale raises I18nRuntimeUnavailableError, because <c-trans> adds no element that could mark text from a fallback language.
Fix: Add a translation for each locale the finding lists. Plain text messages may fall back; only <c-trans> needs every translation.
When this appears: A <c-trans> tag names a message or attribute that has no translation in some selectable locale, so it would resolve to another locale through the configured fallbacks or the message's source locale.
Default severity: error. Reported by: citry check.
citry.i18n.client-message-invalid
Unknown client i18n message. Component.I18n.client_messages names a message that does not exist, so the browser cannot load it.
Fix: Correct the name in client_messages, or add the message.
When this appears: Component.I18n.client_messages names a message ID that no component or configured catalog package defines.
Default severity: error. Reported by: citry check.
citry.format.syntax
Invalid template syntax. The template has a syntax error, so the formatter left it unchanged.
Fix: Fix the syntax error, then format again.
When this appears: A format command receives a template with a Citry syntax error.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.suppression
Invalid formatter directive. A fmt: on, fmt: off, or fmt: skip comment has no matching partner or sits where it cannot apply.
Example: Unmatched formatter enable directive
{# fmt: on #}
<div></div>Fix: Pair each fmt: off with a fmt: on in the same scope, or remove the stray directive.
When this appears: A formatter directive has no valid scope at the place it is written, such as a fmt: on without an earlier fmt: off.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.invariant
Formatter safety check failed. The formatter's own safety check failed, so it refused to change the file. Your template is not at fault.
Fix: The file is unchanged. Report the template and message as a Citry bug.
When this appears: The formatted result fails one of Citry's safety checks, for example formatting it a second time would change it again.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.unsupported
Formatting shape unsupported. The template is valid, but the formatter cannot rewrite this shape safely, so it left it unchanged.
Fix: Nothing to fix. Format that part by hand, or wrap it in fmt: off and fmt: on.
When this appears: The template's structure is outside what the formatter can rewrite.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.provider-invalid
Embedded formatter returned invalid output. The JavaScript or CSS formatter returned a change that does not fit the code it was asked to format, so Citry discarded it.
Fix: The file is unchanged. Try another formatter for that language, or report the message.
When this appears: An external JavaScript or CSS formatter returns an edit outside the region Citry sent it.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.embedded-suppressed
Embedded formatting suppressed. A fmt: off or fmt: skip comment kept a JavaScript or CSS region unformatted, as requested.
Fix: Nothing to fix. Remove the directive if you want the region formatted.
When this appears: A fmt: off or fmt: skip directive covers an embedded JavaScript or CSS region.
Default severity: information. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.embedded-language-unsupported
Embedded language unsupported. A <script> or <style> region declares a language Citry has no formatter for, so it was left unchanged.
Fix: Nothing to fix. Format that region with its own tools.
When this appears: An embedded script or style region declares a language that no Citry formatter handles.
Default severity: warning. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.embedded-interpolation-unsupported
Embedded interpolation unsupported. A JavaScript or CSS region contains Citry interpolation, such as {{ title }}, so it was left unchanged.
Example: Citry interpolation inside JavaScript
<script>
const title = "{{ title }}";
</script>Fix: Pass the value through js_data() or css_data() instead of interpolating it, or leave the region unformatted.
When this appears: An embedded JavaScript or CSS region contains Citry interpolation, which an external formatter cannot handle safely.
Default severity: warning. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.provider-unavailable
Embedded formatter unavailable. No JavaScript or CSS formatter answered, so that region was left unchanged.
Fix: In VS Code, check that Prettier for VS Code is installed and enabled for the language, or disable it so Citry uses its own copy of Prettier.
When this appears: Citry asks the editor to format embedded JavaScript or CSS, and no installed formatter returns an edit.
Default severity: warning. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.host-syntax
Invalid Python host syntax. The Python file has a syntax error, so Citry could not find the component strings to format.
Fix: Fix the Python syntax error, then format again.
When this appears: A format command targets a Python file that is not valid Python.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.ineligible
Document is not eligible for formatting. The file or cursor position is not inside a Citry template, script, or style, so there is nothing to format.
Fix: Place the cursor inside a template, js, or css string, or open the template file itself.
When this appears: Citry cannot tell that the document or cursor position belongs to a template, js, or css string, or a standalone Citry template.
Default severity: error. Reported by: citry format, citry-lsp, the Citry VS Code extension.
citry.format.stale-document
Document changed during formatting. The document changed while Citry was formatting it, so the result was discarded.
Fix: Run the format command again.
When this appears: The document changes after Citry prepares the edit and before the editor applies it.
Default severity: error. Reported by: citry-lsp, the Citry VS Code extension.
citry.format.cancelled
Formatting cancelled. Formatting was cancelled before Citry applied it.
Fix: Nothing to fix. Run the format command again if needed.
When this appears: The editor or you cancel a format request before Citry applies its edits.
Default severity: information. Reported by: the Citry VS Code extension.
Codes from the type checkers
citry.python.*
Reported by: ty. Python type errors in template expressions and c-* values, such as a value of the wrong type for a component input. They come from ty, the Python type checker Citry runs. The part after citry.python. is ty's rule name, and the message is ty's.
citry.typescript.*
Reported by: TypeScript. TypeScript errors in component JavaScript and Vue expressions, such as a wrong argument type, an unknown member, or a wrong number of arguments. The part after citry.typescript. is TypeScript's error number, such as ts2322, and the message is TypeScript's. When one of Citry's own diagnostics already reports the same mistake, Citry shows only its own.