Skip to content

Commit 7565d20

Browse files
authored
Merge pull request #1 from DocSpring/feat/nx-cloud/setup
2 parents c4716cc + f30505c commit 7565d20

12 files changed

Lines changed: 2251 additions & 134 deletions

File tree

.cursor/rules/ultracite.mdc

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
---
2+
description: Ultracite Rules
3+
globs: "**/*.{ts,tsx,js,jsx}"
4+
alwaysApply: true
5+
---
6+
7+
- Don't use `accessKey` attribute on any HTML element.
8+
- Don't set `aria-hidden="true"` on focusable elements.
9+
- Don't add ARIA roles, states, and properties to elements that don't support them.
10+
- Don't use distracting elements like `<marquee>` or `<blink>`.
11+
- Only use the `scope` prop on `<th>` elements.
12+
- Don't assign non-interactive ARIA roles to interactive HTML elements.
13+
- Make sure label elements have text content and are associated with an input.
14+
- Don't assign interactive ARIA roles to non-interactive HTML elements.
15+
- Don't assign `tabIndex` to non-interactive HTML elements.
16+
- Don't use positive integers for `tabIndex` property.
17+
- Don't include "image", "picture", or "photo" in img `alt` prop.
18+
- Don't use explicit role property that's the same as the implicit/default role.
19+
- Make static elements with click handlers use a valid role attribute.
20+
- Always include a `title` element for SVG elements.
21+
- Give all elements requiring alt text meaningful information for screen readers.
22+
- Make sure anchors have content that's accessible to screen readers.
23+
- Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.
24+
- Include all required ARIA attributes for elements with ARIA roles.
25+
- Make sure ARIA properties are valid for the element's supported roles.
26+
- Always include a `type` attribute for button elements.
27+
- Make elements with interactive roles and handlers focusable.
28+
- Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).
29+
- Always include a `lang` attribute on the html element.
30+
- Always include a `title` attribute for iframe elements.
31+
- Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.
32+
- Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.
33+
- Include caption tracks for audio and video elements.
34+
- Use semantic elements instead of role attributes in JSX.
35+
- Make sure all anchors are valid and navigable.
36+
- Ensure all ARIA properties (`aria-*`) are valid.
37+
- Use valid, non-abstract ARIA roles for elements with ARIA roles.
38+
- Use valid ARIA state and property values.
39+
- Use valid values for the `autocomplete` attribute on input elements.
40+
- Use correct ISO language/country codes for the `lang` attribute.
41+
- Don't use consecutive spaces in regular expression literals.
42+
- Don't use the `arguments` object.
43+
- Don't use primitive type aliases or misleading types.
44+
- Don't use the comma operator.
45+
- Don't use empty type parameters in type aliases and interfaces.
46+
- Don't write functions that exceed a given Cognitive Complexity score.
47+
- Don't nest describe() blocks too deeply in test files.
48+
- Don't use unnecessary boolean casts.
49+
- Don't use unnecessary callbacks with flatMap.
50+
- Use for...of statements instead of Array.forEach.
51+
- Don't create classes that only have static members (like a static namespace).
52+
- Don't use this and super in static contexts.
53+
- Don't use unnecessary catch clauses.
54+
- Don't use unnecessary constructors.
55+
- Don't use unnecessary continue statements.
56+
- Don't export empty modules that don't change anything.
57+
- Don't use unnecessary escape sequences in regular expression literals.
58+
- Don't use unnecessary fragments.
59+
- Don't use unnecessary labels.
60+
- Don't use unnecessary nested block statements.
61+
- Don't rename imports, exports, and destructured assignments to the same name.
62+
- Don't use unnecessary string or template literal concatenation.
63+
- Don't use String.raw in template literals when there are no escape sequences.
64+
- Don't use useless case statements in switch statements.
65+
- Don't use ternary operators when simpler alternatives exist.
66+
- Don't use useless `this` aliasing.
67+
- Don't use any or unknown as type constraints.
68+
- Don't initialize variables to undefined.
69+
- Don't use void operators (they're not familiar).
70+
- Use arrow functions instead of function expressions.
71+
- Use Date.now() to get milliseconds since the Unix Epoch.
72+
- Use .flatMap() instead of map().flat() when possible.
73+
- Use literal property access instead of computed property access.
74+
- Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.
75+
- Use concise optional chaining instead of chained logical expressions.
76+
- Use regular expression literals instead of the RegExp constructor when possible.
77+
- Don't use number literal object member names that aren't base 10 or use underscore separators.
78+
- Remove redundant terms from logical expressions.
79+
- Use while loops instead of for loops when you don't need initializer and update expressions.
80+
- Don't pass children as props.
81+
- Don't reassign const variables.
82+
- Don't use constant expressions in conditions.
83+
- Don't use `Math.min` and `Math.max` to clamp values when the result is constant.
84+
- Don't return a value from a constructor.
85+
- Don't use empty character classes in regular expression literals.
86+
- Don't use empty destructuring patterns.
87+
- Don't call global object properties as functions.
88+
- Don't declare functions and vars that are accessible outside their block.
89+
- Make sure builtins are correctly instantiated.
90+
- Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.
91+
- Don't use variables and function parameters before they're declared.
92+
- Don't use 8 and 9 escape sequences in string literals.
93+
- Don't use literal numbers that lose precision.
94+
- Don't use the return value of React.render.
95+
- Don't assign a value to itself.
96+
- Don't return a value from a setter.
97+
- Don't compare expressions that modify string case with non-compliant values.
98+
- Don't use lexical declarations in switch clauses.
99+
- Don't use variables that haven't been declared in the document.
100+
- Don't write unreachable code.
101+
- Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.
102+
- Don't use control flow statements in finally blocks.
103+
- Don't use optional chaining where undefined values aren't allowed.
104+
- Don't have unused function parameters.
105+
- Don't have unused imports.
106+
- Don't have unused labels.
107+
- Don't have unused private class members.
108+
- Don't have unused variables.
109+
- Make sure void (self-closing) elements don't have children.
110+
- Don't return a value from a function that has a 'void' return type.
111+
- Make sure all dependencies are correctly specified in React hooks.
112+
- Make sure all React hooks are called from the top level of component functions.
113+
- Use isNaN() when checking for NaN.
114+
- Don't forget key props in iterators and collection literals.
115+
- Make sure "for" loop update clauses move the counter in the right direction.
116+
- Make sure typeof expressions are compared to valid values.
117+
- Make sure generator functions contain yield.
118+
- Don't use await inside loops.
119+
- Don't use bitwise operators.
120+
- Don't use expressions where the operation doesn't change the value.
121+
- Don't destructure props inside JSX components in Solid projects.
122+
- Make sure Promise-like statements are handled appropriately.
123+
- Don't use __dirname and __filename in the global scope.
124+
- Prevent import cycles.
125+
- Don't define React components inside other components.
126+
- Don't use event handlers on non-interactive elements.
127+
- Don't assign to React component props.
128+
- Don't use configured elements.
129+
- Don't hardcode sensitive data like API keys and tokens.
130+
- Don't let variable declarations shadow variables from outer scopes.
131+
- Don't use the TypeScript directive @ts-ignore.
132+
- Prevent duplicate polyfills from Polyfill.io.
133+
- Don't use useless backreferences in regular expressions that always match empty strings.
134+
- Don't use unnecessary escapes in string literals.
135+
- Don't use useless undefined.
136+
- Make sure getters and setters for the same property are next to each other in class and object definitions.
137+
- Make sure object literals are declared consistently (defaults to explicit definitions).
138+
- Use static Response methods instead of new Response() constructor when possible.
139+
- Make sure switch-case statements are exhaustive.
140+
- Make sure the `preconnect` attribute is used when using Google Fonts.
141+
- Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
142+
- Make sure iterable callbacks return consistent values.
143+
- Use `with { type: "json" }` for JSON module imports.
144+
- Use numeric separators in numeric literals.
145+
- Use object spread instead of `Object.assign()` when constructing new objects.
146+
- Always use the radix argument when using `parseInt()`.
147+
- Make sure JSDoc comment lines start with a single asterisk, except for the first one.
148+
- Include a description parameter for `Symbol()`.
149+
- Don't use spread (`...`) syntax on accumulators.
150+
- Don't use the `delete` operator.
151+
- Don't access namespace imports dynamically.
152+
- Don't use `<img>` elements in Next.js projects.
153+
- Don't use namespace imports.
154+
- Declare regex literals at the top level.
155+
- Don't use `target="_blank"` without `rel="noopener"`.
156+
- Don't use dangerous JSX props.
157+
- Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.
158+
- Don't use global `eval()`.
159+
- Don't use callbacks in asynchronous tests and hooks.
160+
- Don't use TypeScript enums.
161+
- Don't export imported variables.
162+
- Don't use `<head>` elements in Next.js projects.
163+
- Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.
164+
- Don't use TypeScript namespaces.
165+
- Don't use negation in `if` statements that have `else` clauses.
166+
- Don't use nested ternary expressions.
167+
- Don't use non-null assertions with the `!` postfix operator.
168+
- Don't reassign function parameters.
169+
- Don't use parameter properties in class constructors.
170+
- This rule lets you specify global variable names you don't want to use in your application.
171+
- Don't use specified modules when loaded by import or require.
172+
- Don't use user-defined types.
173+
- Don't use constants whose value is the upper-case version of their name.
174+
- Use `String.slice()` instead of `String.substr()` and `String.substring()`.
175+
- Don't use template literals if you don't need interpolation or special-character handling.
176+
- Don't use `else` blocks when the `if` block breaks early.
177+
- Don't use yoda expressions.
178+
- Don't use Array constructors.
179+
- Use `as const` instead of literal types and type annotations.
180+
- Use `at()` instead of integer index access.
181+
- Follow curly brace conventions.
182+
- Use `else if` instead of nested `if` statements in `else` clauses.
183+
- Use single `if` statements instead of nested `if` clauses.
184+
- Use either `T[]` or `Array<T>` consistently.
185+
- Use `new` for all builtins except `String`, `Number`, and `Boolean`.
186+
- Use consistent accessibility modifiers on class properties and methods.
187+
- Use `const` declarations for variables that are only assigned once.
188+
- Put default function parameters and optional function parameters last.
189+
- Include a `default` clause in switch statements.
190+
- Initialize each enum member value explicitly.
191+
- Use the `**` operator instead of `Math.pow`.
192+
- Use `export type` for types.
193+
- Use `for-of` loops when you need the index to extract an item from the iterated array.
194+
- Use `<>...</>` instead of `<Fragment>...</Fragment>`.
195+
- Use `import type` for types.
196+
- Make sure all enum members are literal values.
197+
- Use `node:assert/strict` over `node:assert`.
198+
- Use the `node:` protocol for Node.js builtin modules.
199+
- Use Number properties instead of global ones.
200+
- Don't add extra closing tags for components without children.
201+
- Use assignment operator shorthand where possible.
202+
- Use function types instead of object types with call signatures.
203+
- Use template literals over string concatenation.
204+
- Use `new` when throwing an error.
205+
- Don't throw non-Error values.
206+
- Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.
207+
- Use standard constants instead of approximated literals.
208+
- Don't use Array index in keys.
209+
- Don't assign values in expressions.
210+
- Don't use async functions as Promise executors.
211+
- Don't reassign exceptions in catch clauses.
212+
- Don't reassign class members.
213+
- Don't insert comments as text nodes.
214+
- Don't compare against -0.
215+
- Don't use labeled statements that aren't loops.
216+
- Don't use void type outside of generic or return types.
217+
- Don't use console.
218+
- Don't use TypeScript const enum.
219+
- Don't use control characters and escape sequences that match control characters in regular expression literals.
220+
- Don't use debugger.
221+
- Don't assign directly to document.cookie.
222+
- Don't import next/document outside of pages/_document.jsx in Next.js projects.
223+
- Use `===` and `!==`.
224+
- Don't use duplicate case labels.
225+
- Don't use duplicate class members.
226+
- Don't use duplicate conditions in if-else-if chains.
227+
- Don't assign JSX properties multiple times.
228+
- Don't use two keys with the same name inside objects.
229+
- Don't use duplicate function parameter names.
230+
- Don't have duplicate hooks in describe blocks.
231+
- Don't use empty block statements and static blocks.
232+
- Don't declare empty interfaces.
233+
- Don't let variables evolve into any type through reassignments.
234+
- Don't use the any type.
235+
- Don't use export or module.exports in test files.
236+
- Don't misuse the non-null assertion operator (!) in TypeScript files.
237+
- Don't let switch clauses fall through.
238+
- Don't use focused tests.
239+
- Don't reassign function declarations.
240+
- Don't allow assignments to native objects and read-only global variables.
241+
- Use Number.isFinite instead of global isFinite.
242+
- Use Number.isNaN instead of global isNaN.
243+
- Don't use the next/head module in pages/_document.js on Next.js projects.
244+
- Don't use implicit any type on variable declarations.
245+
- Don't assign to imported bindings.
246+
- Don't use irregular whitespace characters.
247+
- Don't use labels that share a name with a variable.
248+
- Don't use characters made with multiple code points in character class syntax.
249+
- Make sure to use new and constructor properly.
250+
- Make sure the assertion function, like expect, is placed inside an it() function call.
251+
- Don't use shorthand assign when the variable appears on both sides.
252+
- Don't use octal escape sequences in string literals.
253+
- Don't use Object.prototype builtins directly.
254+
- Don't redeclare variables, functions, classes, and types in the same scope.
255+
- Don't have redundant "use strict".
256+
- Don't compare things where both sides are exactly the same.
257+
- Don't let identifiers shadow restricted names.
258+
- Don't use disabled tests.
259+
- Don't use sparse arrays (arrays with holes).
260+
- Watch out for possible "wrong" semicolons inside JSX elements.
261+
- Don't use template literal placeholder syntax in regular strings.
262+
- Don't use the then property.
263+
- Don't merge interfaces and classes unsafely.
264+
- Don't use unsafe negation.
265+
- Don't use var.
266+
- Don't use with statements in non-strict contexts.
267+
- Don't use overload signatures that aren't next to each other.
268+
- Make sure async functions actually use await.
269+
- Make sure default clauses in switch statements come last.
270+
- Make sure to pass a message value when creating a built-in error.
271+
- Make sure get methods always return a value.
272+
- Use a recommended display strategy with Google Fonts.
273+
- Make sure for-in loops include an if statement.
274+
- Use Array.isArray() instead of instanceof Array.
275+
- Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.
276+
- Make sure to use the digits argument with Number#toFixed().
277+
- Make sure to use the "use strict" directive in script files.

0 commit comments

Comments
 (0)