Coding Checklist
These items check the rules of the Coding Guidelines.
Not in the Check Sheet yet
This checklist cannot be judged in the Check Sheet or exported to the record sheet (Excel).
Checklist Items
| ID | Strength | Item | How to check |
|---|---|---|---|
CD-01 | MUST Related: CD-R01 | Core content and main navigation work with JavaScript disabled | Disable JavaScript in DevTools, reload, and confirm the body text and global navigation display and navigate |
CD-02 | MUST Related: CD-R02 | File and directory names use only lowercase letters, digits and hyphens | List every file and directory name (excluding node_modules) and confirm none contains a character other than lowercase letters, digits, hyphens, periods and underscores |
CD-03 | MUST Related: CD-R03, CD-R20 | JavaScript selects elements by data-* attributes, never by styling classes | Search the source for querySelector and querySelectorAll and confirm none selects an element by class name |
CD-04 | MUST Related: CD-R04 | State classes are always combined with their component class | Use stylelint selector-disallowed-list to forbid selectors made of only a class starting with is- or has-; no violations |
CD-05 | SHOULD Related: CD-R05 | Dynamic state is expressed with data-* attributes | Search the source for class selectors starting with is- or has- and confirm there are none |
CD-06 | SHOULD Related: CD-R06 | Spacing and position use logical properties | Add physical properties such as margin-left, padding-top and left to stylelint property-disallowed-list; no violations |
CD-07 | MUST Related: CD-R07 | Every animation or transition stops or is reduced under prefers-reduced-motion: reduce | Search the source for animation and transition, and confirm every matching file contains prefers-reduced-motion; emulate reduce in DevTools Rendering and confirm motion stops |
CD-08 | MUST Related: CD-R08 | Component roots set no outer margin, absolute position or grid placement | AI review: check that block root selectors have no margin, inset, grid-area or grid-column |
CD-09 | MUST Related: CD-R09 | No ID selectors; !important appears only in the utilities layer | stylelint selector-max-id (set to allow no ID selectors) and declaration-no-important (excluding utilities layer files) report no violations |
CD-10 | MUST Related: CD-R10 | Every color variable is defined in the default :root | Collect every declaration of a variable starting with --color- in the source and confirm each name is declared in the :root block |
CD-11 | MUST Related: CD-R11 | color-scheme is declared | Search the source for color-scheme and confirm at least one declaration on :root |
CD-12 | SHOULD Related: CD-R12 | No JavaScript reimplements what standard HTML/CSS provides (disclosure, dialog, smooth scroll, etc.) | AI review: look for code replaceable by <details>, <dialog>, scroll-behavior and similar |
CD-13 | MUST Related: CD-R13 | Comparisons use === / !== | ESLint eqeqeq reports no violations |
CD-14 | MUST Related: CD-R14 | Initialization functions return early when the target element is missing | AI review: confirm each init function starts with a guard that returns when the target element is missing |
CD-15 | MUST NOT Related: CD-R15 | No global variables are created | ESLint no-implicit-globals and no-undef report no violations |
CD-16 | MUST NOT Related: CD-R16 | var is not used | ESLint no-var reports no violations |
CD-17 | MUST NOT Related: CD-R17 | New projects include no jQuery or other legacy libraries | Search package.json and the HTML files for jQuery and confirm there are no hits |
CD-18 | SHOULD Related: CD-R18 | Scripts are loaded with <script type="module"> | Search the HTML for script elements and confirm every external script has type="module" |
CD-19 | SHOULD Related: CD-R19 | Variables that are never reassigned are declared with const | ESLint prefer-const reports no violations |
CD-20 | SHOULD Related: CD-R21 | Each module handles one feature and exports an init function that takes the root element | AI review: confirm each module exports a single-feature init function |
CD-21 | SHOULD Related: CD-R22 | Show/hide uses the hidden attribute or a state attribute | Search the source for style.display and confirm there are no hits |
CD-22 | MUST Related: CD-R23 | Custom components support keyboard operation, focus management and ARIA states | Following the pattern in Custom UI, operate with the keyboard only and confirm ARIA states change in the DevTools Accessibility panel |
CD-23 | MUST Related: CD-R24 | scroll and resize handlers are debounced or throttled | Search the source for addEventListener calls on scroll and resize, and check by AI review that each one is debounced or throttled |
CD-24 | MUST Related: CD-R25 | Listeners added to window or document are removed on teardown | Search the source for addEventListener on window and document, and confirm each has a matching removeEventListener or AbortController |
CD-25 | MUST NOT Related: CD-R26 | No render-blocking scripts in <head> | Search the HTML for script elements with src and confirm none lacks type="module", defer and async |
CD-26 | SHOULD Related: CD-R27 | Position and size are watched with IntersectionObserver / ResizeObserver | Search the source for getBoundingClientRect, offsetTop and scrollY, and confirm none is inside a scroll or resize handler |
CD-27 | SHOULD Related: CD-R28 | DOM reads are batched before writes | AI review: look for loops alternating reads such as offsetWidth / getBoundingClientRect() with style writes; DevTools Performance shows no "Forced reflow" warning |
CD-28 | MUST Related: CD-R29 | fetch is wrapped in try...catch and failures are shown to users | Search the source for fetch calls, and check by AI review that each has catch, a response.ok check and an on-screen message |
CD-29 | MUST Related: CD-R30 | Untrusted data is inserted with textContent | Search the source for innerHTML, outerHTML and insertAdjacentHTML, and confirm each value is a constant or sanitized |
CD-30 | MUST NOT Related: CD-R31 | No API secret keys or auth tokens in code | secretlint or gitleaks reports nothing |
CD-31 | MUST NOT Related: CD-R32 | No document.write(), eval() or HTML on* attributes | ESLint no-eval and no-implied-eval report nothing, and a search of the JS and HTML for document.write and attributes starting with on (such as onclick) finds nothing |
CD-32 | MUST NOT Related: CD-R33 | No alert(), confirm() or prompt() | ESLint no-alert reports no violations |
CD-33 | MUST NOT Related: CD-R34 | No branching on the User-Agent string | Search the source for userAgent and confirm there are no hits |
CD-34 | MUST NOT Related: CD-R35 | No console.log() or debugger in production code | ESLint no-console and no-debugger report no violations |
CD-35 | MUST Related: CD-R36 | Every <img> and art-direction <source> has width and height | Lighthouse does not report "Image elements do not have explicit width and height" |
CD-36 | SHOULD Related: CD-R37 | Every srcset has a sizes matching the rendered width | Search the HTML for srcset and confirm each has sizes; Lighthouse does not report "Properly size images" |
CD-37 | MUST Related: CD-R38 | Offscreen images have loading="lazy" | In the DevTools Elements panel, confirm every image outside the viewport has loading="lazy" |
CD-38 | MUST NOT Related: CD-R39 | Above-the-fold images do not have loading="lazy" | In the DevTools Elements panel, confirm no image within the first viewport has loading="lazy"; Lighthouse does not report "Largest Contentful Paint image was lazily loaded" |