@ashstack/lint 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/core/index.d.ts +7 -3
- package/dist/core/index.js +1 -1
- package/dist/core/rules/core/no-comments.js +1 -1
- package/dist/lib/ast.js +1 -1
- package/dist/lib/effect-plugin.js +1 -0
- package/dist/lib/module.js +1 -1
- package/dist/lib/registry.js +1 -0
- package/dist/lib/rule-types/core.d.ts +72 -0
- package/dist/lib/rule-types/core.js +1 -0
- package/dist/lib/rule-types/react-native.d.ts +333 -0
- package/dist/lib/rule-types/react-native.js +1 -0
- package/dist/lib/rule-types/react.d.ts +153 -0
- package/dist/lib/rule-types/react.js +1 -0
- package/dist/lib/types.d.ts +39 -11
- package/dist/modules.js +1 -0
- package/dist/react/index.d.ts +6 -1
- package/dist/react/index.js +1 -1
- package/dist/react/rules/query/next-page-param-undefined.js +1 -1
- package/dist/react/rules/query/no-fetch-in-query-fn.js +1 -1
- package/dist/react/rules/query/no-inline-keys.js +1 -1
- package/dist/react/rules/react/index.js +1 -0
- package/dist/react/rules/react/no-svg-without-title.js +1 -0
- package/dist/react/rules/react/no-unlabeled-icon-button.js +1 -0
- package/dist/react/rules/react/shared.js +1 -0
- package/dist/react/rules/tailwind/index.js +1 -0
- package/dist/react/rules/tailwind/prefer-cn.js +1 -0
- package/dist/react/rules/tailwind/shared.js +1 -0
- package/dist/react/rules/tailwind/use-logical-classes.js +1 -0
- package/dist/react/rules/tanstack-router/index.js +1 -0
- package/dist/react/rules/tanstack-router/no-search-casts.js +1 -0
- package/dist/react/rules/tanstack-router/require-selector.js +1 -0
- package/dist/react/rules/tanstack-router/shared.js +1 -0
- package/dist/react-native/index.d.ts +7 -1
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/rules/legend-list/index.js +1 -1
- package/dist/react-native/rules/react-native/no-manual-memo.js +1 -1
- package/package.json +6 -10
- package/vendor/react-effect/LICENSE +21 -0
- package/vendor/react-effect/README.md +25 -0
- package/vendor/react-effect/index.mjs +559 -0
- package/dist/core/rules/core/components-tsx-only.d.ts +0 -2
- package/dist/core/rules/core/hoist-intl.d.ts +0 -2
- package/dist/core/rules/core/index.d.ts +0 -2
- package/dist/core/rules/core/no-comments.d.ts +0 -2
- package/dist/core/rules/core/no-naming-convention.d.ts +0 -2
- package/dist/core/rules/core/no-packed-condition.d.ts +0 -2
- package/dist/core/rules/core/use-design-system.d.ts +0 -2
- package/dist/core/rules/zod/index.d.ts +0 -2
- package/dist/core/rules/zod/prefer-enum.d.ts +0 -2
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -1
- package/dist/lib/ast.d.ts +0 -44
- package/dist/lib/detect.d.ts +0 -9
- package/dist/lib/merge.d.ts +0 -9
- package/dist/lib/module.d.ts +0 -19
- package/dist/react/rules/i18n/index.d.ts +0 -2
- package/dist/react/rules/i18n/no-bare-attrs.d.ts +0 -2
- package/dist/react/rules/i18n/no-bare-text.d.ts +0 -2
- package/dist/react/rules/i18n/no-bare-toast.d.ts +0 -2
- package/dist/react/rules/query/index.d.ts +0 -2
- package/dist/react/rules/query/next-page-param-undefined.d.ts +0 -2
- package/dist/react/rules/query/no-deprecated-filters.d.ts +0 -2
- package/dist/react/rules/query/no-fetch-in-query-fn.d.ts +0 -2
- package/dist/react/rules/query/no-inline-keys.d.ts +0 -2
- package/dist/react/rules/query/require-destructured-hooks.d.ts +0 -2
- package/dist/react/rules/query/shared.d.ts +0 -2
- package/dist/react/rules/query/shared.js +0 -1
- package/dist/react/rules/zustand/index.d.ts +0 -2
- package/dist/react/rules/zustand/require-selector.d.ts +0 -2
- package/dist/react-native/rules/keyboard/index.d.ts +0 -2
- package/dist/react-native/rules/legend-list/index.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-flex-in-content-container.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-index-key-extractor.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-inline-data.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-inline-data.js +0 -1
- package/dist/react-native/rules/legend-list/no-inline-extra-data.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-inline-extra-data.js +0 -1
- package/dist/react-native/rules/legend-list/no-inline-render-item-props.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-mixed-children.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-remount-key.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-scrollview-map.d.ts +0 -2
- package/dist/react-native/rules/legend-list/no-unsupported-props.d.ts +0 -2
- package/dist/react-native/rules/legend-list/required-props.d.ts +0 -2
- package/dist/react-native/rules/legend-list/shared.d.ts +0 -19
- package/dist/react-native/rules/legend-list/typed-items-need-item-type.d.ts +0 -2
- package/dist/react-native/rules/legend-state/index.d.ts +0 -2
- package/dist/react-native/rules/legend-state/naming.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-assignment.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-nested-observable.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-object-selector.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-observable-in-component.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-peek-in-selector.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-react-mirror.d.ts +0 -2
- package/dist/react-native/rules/legend-state/no-untracked-get-in-jsx.d.ts +0 -2
- package/dist/react-native/rules/legend-state/shared.d.ts +0 -9
- package/dist/react-native/rules/react-native/hoist-stateless-function.d.ts +0 -2
- package/dist/react-native/rules/react-native/index.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-conditional-style-array.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-dynamic-import.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-keyboard-will-events.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-leaked-render.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-manual-memo.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-redundant-view-nesting.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-rn-image-network-source.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-rn-namespace-import.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-scroll-position-state.d.ts +0 -2
- package/dist/react-native/rules/react-native/no-unlabeled-icon-pressable.d.ts +0 -2
- package/dist/react-native/rules/reanimated/animated-reaction-safety.d.ts +0 -2
- package/dist/react-native/rules/reanimated/animated-style-needs-animated-component.d.ts +0 -2
- package/dist/react-native/rules/reanimated/animated-updater-purity.d.ts +0 -2
- package/dist/react-native/rules/reanimated/gpu-properties-only.d.ts +0 -2
- package/dist/react-native/rules/reanimated/hoist-layout-animation-builder.d.ts +0 -2
- package/dist/react-native/rules/reanimated/index.d.ts +0 -2
- package/dist/react-native/rules/reanimated/interpolate-needs-clamp.d.ts +0 -2
- package/dist/react-native/rules/reanimated/no-react-state-from-continuous-worklet.d.ts +0 -2
- package/dist/react-native/rules/reanimated/no-shared-value-dot-value.d.ts +0 -2
- package/dist/react-native/rules/reanimated/prefer-lazy-shared-value-initializer.d.ts +0 -2
- package/dist/react-native/rules/reanimated/schedule-on-rn-scope.d.ts +0 -2
- package/dist/react-native/rules/reanimated/shared-value-usage.d.ts +0 -2
- package/dist/react-native/rules/reanimated/shared.d.ts +0 -5
- package/dist/react-native/rules/skia/canvas-opaque.d.ts +0 -2
- package/dist/react-native/rules/skia/index.d.ts +0 -2
- package/dist/react-native/rules/turbo-image/index.d.ts +0 -2
- package/dist/react-native/rules/turbo-image/require-cache-policy.d.ts +0 -2
- package/dist/react-native/rules/turbo-image/require-resize.d.ts +0 -2
- package/dist/react-native/rules/unistyles/animated-theme.d.ts +0 -2
- package/dist/react-native/rules/unistyles/content-container.d.ts +0 -2
- package/dist/react-native/rules/unistyles/in-sheet.d.ts +0 -2
- package/dist/react-native/rules/unistyles/index.d.ts +0 -2
- package/dist/react-native/rules/unistyles/insets.d.ts +0 -2
- package/dist/react-native/rules/unistyles/no-hardcoded-color.d.ts +0 -2
- package/dist/react-native/rules/unistyles/no-hardcoded-spacing.d.ts +0 -2
- package/dist/react-native/rules/unistyles/no-margin.d.ts +0 -2
- package/dist/react-native/rules/unistyles/no-style-spread.d.ts +0 -2
- package/dist/react-native/rules/unistyles/no-unused-styles.d.ts +0 -2
- package/dist/react-native/rules/unistyles/rtl-style-call.d.ts +0 -2
- package/dist/react-native/rules/unistyles/shared.d.ts +0 -16
- package/dist/react-native/rules/unistyles/theme-screen-component.d.ts +0 -2
- package/dist/react-native/rules/unistyles/theme-style-attr.d.ts +0 -2
- package/dist/react-native/stylesheet.d.ts +0 -11
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import type { AllowWarnDeny } from "oxlint";
|
|
2
|
+
/** Every rule id `react-native()` adds on top of the entry below it. */
|
|
3
|
+
export type ReactNativeRuleId = "@ashstack/react-native/no-keyboard-will-events" | "@ashstack/react-native/no-scroll-position-state" | "@ashstack/react-native/no-conditional-style-array" | "@ashstack/react-native/no-leaked-render" | "@ashstack/react-native/no-rn-image-network-source" | "@ashstack/react-native/no-redundant-view-nesting" | "@ashstack/react-native/no-rn-namespace-import" | "@ashstack/react-native/no-unlabeled-icon-pressable" | "@ashstack/react-native/hoist-stateless-function" | "@ashstack/react-native/no-manual-memo" | "@ashstack/react-native/no-dynamic-import" | "@ashstack/unistyles/animated-theme" | "@ashstack/unistyles/content-container" | "@ashstack/unistyles/in-sheet" | "@ashstack/unistyles/insets" | "@ashstack/unistyles/no-hardcoded-color" | "@ashstack/unistyles/no-hardcoded-spacing" | "@ashstack/unistyles/no-margin" | "@ashstack/unistyles/no-style-spread" | "@ashstack/unistyles/no-unused-styles" | "@ashstack/unistyles/rtl-style-call" | "@ashstack/unistyles/theme-screen-component" | "@ashstack/unistyles/theme-style-attr" | "@ashstack/legend-list/required-props" | "@ashstack/legend-list/no-index-key-extractor" | "@ashstack/legend-list/no-remount-key" | "@ashstack/legend-list/no-inline-render-item-props" | "@ashstack/legend-list/no-mixed-children" | "@ashstack/legend-list/no-flex-in-content-container" | "@ashstack/legend-list/typed-items-need-item-type" | "@ashstack/legend-list/no-scrollview-map" | "@ashstack/legend-list/no-unsupported-props" | "@ashstack/legend-state/no-assignment" | "@ashstack/legend-state/naming" | "@ashstack/legend-state/no-nested-observable" | "@ashstack/legend-state/no-react-mirror" | "@ashstack/legend-state/no-untracked-get-in-jsx" | "@ashstack/legend-state/no-peek-in-selector" | "@ashstack/legend-state/no-object-selector" | "@ashstack/legend-state/no-observable-in-component" | "@ashstack/reanimated/animated-reaction-safety" | "@ashstack/reanimated/animated-style-needs-animated-component" | "@ashstack/reanimated/animated-updater-purity" | "@ashstack/reanimated/gpu-properties-only" | "@ashstack/reanimated/hoist-layout-animation-builder" | "@ashstack/reanimated/interpolate-needs-clamp" | "@ashstack/reanimated/no-shared-value-dot-value" | "@ashstack/reanimated/no-react-state-from-continuous-worklet" | "@ashstack/reanimated/prefer-lazy-shared-value-initializer" | "@ashstack/reanimated/schedule-on-rn-scope" | "@ashstack/reanimated/shared-value-usage" | "@ashstack/turbo-image/require-resize" | "@ashstack/turbo-image/require-cache-policy" | "@ashstack/skia/canvas-opaque";
|
|
4
|
+
declare module "oxlint" {
|
|
5
|
+
interface DummyRuleMap {
|
|
6
|
+
/**
|
|
7
|
+
* Disallow the `keyboardWill*` event names. They are iOS-only, so on Android the listener registers and never fires.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-keyboard-will-events
|
|
10
|
+
*/
|
|
11
|
+
"@ashstack/react-native/no-keyboard-will-events"?: AllowWarnDeny | [AllowWarnDeny];
|
|
12
|
+
/**
|
|
13
|
+
* Disallow a React state setter inside a scroll handler prop. Scroll fires every frame, and so would the re-render.
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-scroll-position-state
|
|
16
|
+
*/
|
|
17
|
+
"@ashstack/react-native/no-scroll-position-state"?: AllowWarnDeny | [AllowWarnDeny];
|
|
18
|
+
/**
|
|
19
|
+
* Disallow conditional and logical entries inside a JSX `style` array. A falsy entry leaves a hole that breaks the Unistyles C++ proxy.
|
|
20
|
+
*
|
|
21
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-conditional-style-array
|
|
22
|
+
*/
|
|
23
|
+
"@ashstack/react-native/no-conditional-style-array"?: AllowWarnDeny | [AllowWarnDeny];
|
|
24
|
+
/**
|
|
25
|
+
* Disallow a `&&` guard in JSX on a value this rule can see is a number or a string — a `.length`, a `.size`, arithmetic, a literal. The falsy left operand leaks into the output, and a bare `0` crashes React Native with "Text strings must be rendered within a <Text> component".
|
|
26
|
+
*
|
|
27
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-leaked-render
|
|
28
|
+
*/
|
|
29
|
+
"@ashstack/react-native/no-leaked-render"?: AllowWarnDeny | [AllowWarnDeny];
|
|
30
|
+
/**
|
|
31
|
+
* Disallow a react-native `<Image>` with a network `{ uri }` source. It has no disk cache and no decode sizing, so the image re-downloads at full size on every cold start.
|
|
32
|
+
*
|
|
33
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-rn-image-network-source
|
|
34
|
+
*/
|
|
35
|
+
"@ashstack/react-native/no-rn-image-network-source"?: AllowWarnDeny | [AllowWarnDeny];
|
|
36
|
+
/**
|
|
37
|
+
* Disallow a View or Animated.View that wraps an identical view when neither carries anything but a style. Every extra host view is a real node in the native tree.
|
|
38
|
+
*
|
|
39
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-redundant-view-nesting
|
|
40
|
+
*/
|
|
41
|
+
"@ashstack/react-native/no-redundant-view-nesting"?: AllowWarnDeny | [AllowWarnDeny];
|
|
42
|
+
/**
|
|
43
|
+
* Disallow a namespace import of react-native and a re-export of its `Platform`. Both defeat Metro's platform shaking, so dead `Platform.OS` branches ship in both bundles.
|
|
44
|
+
*
|
|
45
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-rn-namespace-import
|
|
46
|
+
*/
|
|
47
|
+
"@ashstack/react-native/no-rn-namespace-import"?: AllowWarnDeny | [AllowWarnDeny];
|
|
48
|
+
/**
|
|
49
|
+
* Require an accessible name on an icon-only touchable or an icon-only Expo UI `<Button>`. Without a label, hint or visible text, a screen reader cannot reach the control.
|
|
50
|
+
*
|
|
51
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-unlabeled-icon-pressable
|
|
52
|
+
*/
|
|
53
|
+
"@ashstack/react-native/no-unlabeled-icon-pressable"?: AllowWarnDeny | [AllowWarnDeny];
|
|
54
|
+
/**
|
|
55
|
+
* Require module scope for a non-component function that reads nothing from the component around it. Out there it is created once, keeps a stable identity, and can be tested without rendering.
|
|
56
|
+
*
|
|
57
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativehoist-stateless-function
|
|
58
|
+
*/
|
|
59
|
+
"@ashstack/react-native/hoist-stateless-function"?: AllowWarnDeny | [AllowWarnDeny];
|
|
60
|
+
/**
|
|
61
|
+
* Require a `// why:` line above every kept `useMemo`, `useCallback` and `memo`. The React Compiler memoises on a best-effort basis, not a guarantee, so a memo is allowed where the cost is real: something rendered per list row, or a computation measured as heavy. The `// why:` line names which of the two applies. `@ashstack/core/no-comments` keeps that line and never counts it against its `budget`, so both rules run together.
|
|
62
|
+
*
|
|
63
|
+
* Enabled only when one of `babel-plugin-react-compiler`, `react-compiler-runtime`, `react-compiler-marker` is a dependency.
|
|
64
|
+
*
|
|
65
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-manual-memo
|
|
66
|
+
*/
|
|
67
|
+
"@ashstack/react-native/no-manual-memo"?: AllowWarnDeny | [AllowWarnDeny];
|
|
68
|
+
/**
|
|
69
|
+
* Disallow dynamic `import()` outside a `React.lazy` or `dynamic` wrapper. Metro inlines it into the same bundle, so nothing is deferred and the module is hidden from the typechecker.
|
|
70
|
+
*
|
|
71
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-dynamic-import
|
|
72
|
+
*/
|
|
73
|
+
"@ashstack/react-native/no-dynamic-import"?: AllowWarnDeny | [AllowWarnDeny];
|
|
74
|
+
/**
|
|
75
|
+
* A Reanimated worklet hook cannot see `useUnistyles()` theme changes on the UI thread. Read the shared value from `useAnimatedTheme()` there instead.
|
|
76
|
+
*
|
|
77
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesanimated-theme
|
|
78
|
+
*/
|
|
79
|
+
"@ashstack/unistyles/animated-theme"?: AllowWarnDeny | [AllowWarnDeny];
|
|
80
|
+
/**
|
|
81
|
+
* A raw component never subscribes its `contentContainerStyle` to theme or `rt` updates. Wrap the component with `withUnistyles` when the style depends on either.
|
|
82
|
+
*
|
|
83
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylescontent-container
|
|
84
|
+
*/
|
|
85
|
+
"@ashstack/unistyles/content-container"?: AllowWarnDeny | [AllowWarnDeny];
|
|
86
|
+
/**
|
|
87
|
+
* Inside `StyleSheet.create`, require `rt` and theme values rather than Dimensions, PixelRatio, Appearance, I18nManager, StatusBar or `UnistylesRuntime`. It also covers logical spacing, `boxShadow`, `borderCurve` and a redundant `as const`.
|
|
88
|
+
*
|
|
89
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesin-sheet
|
|
90
|
+
*/
|
|
91
|
+
"@ashstack/unistyles/in-sheet"?: AllowWarnDeny | [AllowWarnDeny];
|
|
92
|
+
/**
|
|
93
|
+
* Disallow passing `useSafeAreaInsets()` values into a dynamic style function or an inline JSX style object. Read `rt.insets` inside `StyleSheet.create` instead.
|
|
94
|
+
*
|
|
95
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesinsets
|
|
96
|
+
*/
|
|
97
|
+
"@ashstack/unistyles/insets"?: AllowWarnDeny | [AllowWarnDeny];
|
|
98
|
+
/**
|
|
99
|
+
* Disallow hex and CSS-function colors inside `StyleSheet.create`. A raw color skips dark mode and never changes with the theme.
|
|
100
|
+
*
|
|
101
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-hardcoded-color
|
|
102
|
+
*/
|
|
103
|
+
"@ashstack/unistyles/no-hardcoded-color"?: AllowWarnDeny | [AllowWarnDeny];
|
|
104
|
+
/**
|
|
105
|
+
* Require `theme.spacing` or `theme.sizing.scale` for spacing, radius and type values inside `StyleSheet.create`, instead of raw numbers.
|
|
106
|
+
*
|
|
107
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-hardcoded-spacing
|
|
108
|
+
*/
|
|
109
|
+
"@ashstack/unistyles/no-hardcoded-spacing"?: AllowWarnDeny | [AllowWarnDeny];
|
|
110
|
+
/**
|
|
111
|
+
* Disallow non-negative `margin` inside `StyleSheet.create`; `gap` on the parent or `padding` on the element spaces children without leaving a hole when one is removed.
|
|
112
|
+
*
|
|
113
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-margin
|
|
114
|
+
*/
|
|
115
|
+
"@ashstack/unistyles/no-margin"?: AllowWarnDeny | [AllowWarnDeny];
|
|
116
|
+
/**
|
|
117
|
+
* Disallow spreading a stylesheet style into another object. The spread reads through the Unistyles C++ proxy once, so the result stops reacting to the theme.
|
|
118
|
+
*
|
|
119
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-style-spread
|
|
120
|
+
*/
|
|
121
|
+
"@ashstack/unistyles/no-style-spread"?: AllowWarnDeny | [AllowWarnDeny];
|
|
122
|
+
/**
|
|
123
|
+
* Disallow stylesheet keys that nothing in the file reads. A computed key, a computed read, or a sheet that leaves the module skips the whole file.
|
|
124
|
+
*
|
|
125
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-unused-styles
|
|
126
|
+
*/
|
|
127
|
+
"@ashstack/unistyles/no-unused-styles"?: AllowWarnDeny | [AllowWarnDeny];
|
|
128
|
+
/**
|
|
129
|
+
* Disallow passing `I18nManager.isRTL` from JSX into a dynamic style function. Unistyles tracks the dependency itself once the style reads `rt.rtl`.
|
|
130
|
+
*
|
|
131
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesrtl-style-call
|
|
132
|
+
*/
|
|
133
|
+
"@ashstack/unistyles/rtl-style-call"?: AllowWarnDeny | [AllowWarnDeny];
|
|
134
|
+
/**
|
|
135
|
+
* `theme.screen.*` is a snapshot taken at module initialization, so a component that reads it never sees the current size. `useUnistyles().rt.screen` and `useWindowDimensions` do.
|
|
136
|
+
*
|
|
137
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylestheme-screen-component
|
|
138
|
+
*/
|
|
139
|
+
"@ashstack/unistyles/theme-screen-component"?: AllowWarnDeny | [AllowWarnDeny];
|
|
140
|
+
/**
|
|
141
|
+
* Theme-dependent values belong in `StyleSheet.create`, not in a JSX `style` prop that reads a `useUnistyles()` theme.
|
|
142
|
+
*
|
|
143
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylestheme-style-attr
|
|
144
|
+
*/
|
|
145
|
+
"@ashstack/unistyles/theme-style-attr"?: AllowWarnDeny | [AllowWarnDeny];
|
|
146
|
+
/**
|
|
147
|
+
* Require `keyExtractor` and an explicit `recycleItems` on a Legend List. Without a key extractor the list keys its rows by index.
|
|
148
|
+
*
|
|
149
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listrequired-props
|
|
150
|
+
*/
|
|
151
|
+
"@ashstack/legend-list/required-props"?: AllowWarnDeny | [AllowWarnDeny];
|
|
152
|
+
/**
|
|
153
|
+
* Disallow a `keyExtractor` that uses its index parameter. Cached sizes and recycled row state hang off the key, so a prepend points every measurement at the wrong item.
|
|
154
|
+
*
|
|
155
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-index-key-extractor
|
|
156
|
+
*/
|
|
157
|
+
"@ashstack/legend-list/no-index-key-extractor"?: AllowWarnDeny | [AllowWarnDeny];
|
|
158
|
+
/**
|
|
159
|
+
* Disallow `key` on a Legend List, which remounts on any key change and loses its measurements and scroll position. Pass `dataKey` instead.
|
|
160
|
+
*
|
|
161
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-remount-key
|
|
162
|
+
*/
|
|
163
|
+
"@ashstack/legend-list/no-remount-key"?: AllowWarnDeny | [AllowWarnDeny];
|
|
164
|
+
/**
|
|
165
|
+
* Disallow inline object and array literals on props nested inside `renderItem`. A row whose props take a new identity every render can never be skipped.
|
|
166
|
+
*
|
|
167
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-inline-render-item-props
|
|
168
|
+
*/
|
|
169
|
+
"@ashstack/legend-list/no-inline-render-item-props"?: AllowWarnDeny | [AllowWarnDeny];
|
|
170
|
+
/**
|
|
171
|
+
* Disallow passing both `data` and real children to a Legend List. The combination is unsupported and one of the two is dropped without a warning.
|
|
172
|
+
*
|
|
173
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-mixed-children
|
|
174
|
+
*/
|
|
175
|
+
"@ashstack/legend-list/no-mixed-children"?: AllowWarnDeny | [AllowWarnDeny];
|
|
176
|
+
/**
|
|
177
|
+
* Disallow `flex` in a Legend List's `contentContainerStyle`, where it sizes the scrolled content to the viewport and the list ends up measuring zero height.
|
|
178
|
+
*
|
|
179
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-flex-in-content-container
|
|
180
|
+
*/
|
|
181
|
+
"@ashstack/legend-list/no-flex-in-content-container"?: AllowWarnDeny | [AllowWarnDeny];
|
|
182
|
+
/**
|
|
183
|
+
* Require `getItemType` when a row branches on `item.type`. Without it every layout shares one recycling pool and one size average.
|
|
184
|
+
*
|
|
185
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listtyped-items-need-item-type
|
|
186
|
+
*/
|
|
187
|
+
"@ashstack/legend-list/typed-items-need-item-type"?: AllowWarnDeny | [AllowWarnDeny];
|
|
188
|
+
/**
|
|
189
|
+
* A `ScrollView` mounts every child up front, so a mapped collection does not belong in its children.
|
|
190
|
+
*
|
|
191
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-scrollview-map
|
|
192
|
+
*/
|
|
193
|
+
"@ashstack/legend-list/no-scrollview-map"?: AllowWarnDeny | [AllowWarnDeny];
|
|
194
|
+
/**
|
|
195
|
+
* Disallow FlashList and FlatList props that Legend List v3 does not have. It ignores them rather than rejecting them, so the feature looks broken.
|
|
196
|
+
*
|
|
197
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-unsupported-props
|
|
198
|
+
*/
|
|
199
|
+
"@ashstack/legend-list/no-unsupported-props"?: AllowWarnDeny | [AllowWarnDeny];
|
|
200
|
+
/**
|
|
201
|
+
* Write an observable with `.set(...)` or `.assign({...})`. Assigning or incrementing it with an operator is a silent no-op.
|
|
202
|
+
*
|
|
203
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-assignment
|
|
204
|
+
*/
|
|
205
|
+
"@ashstack/legend-state/no-assignment"?: AllowWarnDeny | [AllowWarnDeny];
|
|
206
|
+
/**
|
|
207
|
+
* A variable initialized from `observable()` or `useObservable()` needs a trailing `$`. The other rules in this module key off that suffix.
|
|
208
|
+
*
|
|
209
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-statenaming
|
|
210
|
+
*/
|
|
211
|
+
"@ashstack/legend-state/naming"?: AllowWarnDeny | [AllowWarnDeny];
|
|
212
|
+
/**
|
|
213
|
+
* Never pass an observable to `observable()` or `useObservable()`. The wrapper is a second node, and reads and writes on it never reach the original.
|
|
214
|
+
*
|
|
215
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-nested-observable
|
|
216
|
+
*/
|
|
217
|
+
"@ashstack/legend-state/no-nested-observable"?: AllowWarnDeny | [AllowWarnDeny];
|
|
218
|
+
/**
|
|
219
|
+
* Seeding `useState` from an observable's `get()` or `peek()` gives the value two owners. Read it with `useValue(...)` where it renders.
|
|
220
|
+
*
|
|
221
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-react-mirror
|
|
222
|
+
*/
|
|
223
|
+
"@ashstack/legend-state/no-react-mirror"?: AllowWarnDeny | [AllowWarnDeny];
|
|
224
|
+
/**
|
|
225
|
+
* A `get()` placed directly in a JSX expression container is a plain read. The value renders once and never updates.
|
|
226
|
+
*
|
|
227
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-untracked-get-in-jsx
|
|
228
|
+
*/
|
|
229
|
+
"@ashstack/legend-state/no-untracked-get-in-jsx"?: AllowWarnDeny | [AllowWarnDeny];
|
|
230
|
+
/**
|
|
231
|
+
* `peek()` never subscribes, so a selector or tracking callback that uses it never re-runs. Call `get()` there and keep `peek()` for handlers.
|
|
232
|
+
*
|
|
233
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-peek-in-selector
|
|
234
|
+
*/
|
|
235
|
+
"@ashstack/legend-state/no-peek-in-selector"?: AllowWarnDeny | [AllowWarnDeny];
|
|
236
|
+
/**
|
|
237
|
+
* A `useValue` selector that builds a new object or array returns a fresh identity every run. The component then re-renders on every store change.
|
|
238
|
+
*
|
|
239
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-object-selector
|
|
240
|
+
*/
|
|
241
|
+
"@ashstack/legend-state/no-object-selector"?: AllowWarnDeny | [AllowWarnDeny];
|
|
242
|
+
/**
|
|
243
|
+
* Calling `observable()` inside a component or hook makes a new observable on every render. Use `useObservable()` or a module-level store instead.
|
|
244
|
+
*
|
|
245
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-observable-in-component
|
|
246
|
+
*/
|
|
247
|
+
"@ashstack/legend-state/no-observable-in-component"?: AllowWarnDeny | [AllowWarnDeny];
|
|
248
|
+
/**
|
|
249
|
+
* A `useAnimatedReaction` result callback loops forever if it writes a shared value the prepare callback reads. Guard `scheduleOnRN` there on the current result differing from the previous one.
|
|
250
|
+
*
|
|
251
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-reaction-safety
|
|
252
|
+
*/
|
|
253
|
+
"@ashstack/reanimated/animated-reaction-safety"?: AllowWarnDeny | [AllowWarnDeny];
|
|
254
|
+
/**
|
|
255
|
+
* An animated style only takes effect on an `Animated.*` component. A plain element applies it once at mount and then never updates.
|
|
256
|
+
*
|
|
257
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-style-needs-animated-component
|
|
258
|
+
*/
|
|
259
|
+
"@ashstack/reanimated/animated-style-needs-animated-component"?: AllowWarnDeny | [AllowWarnDeny];
|
|
260
|
+
/**
|
|
261
|
+
* An updater passed to `useAnimatedStyle` or `useAnimatedProps` must stay pure, so it may not write a shared value or call `scheduleOnRN`.
|
|
262
|
+
*
|
|
263
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-updater-purity
|
|
264
|
+
*/
|
|
265
|
+
"@ashstack/reanimated/animated-updater-purity"?: AllowWarnDeny | [AllowWarnDeny];
|
|
266
|
+
/**
|
|
267
|
+
* Animate `transform` and `opacity` in `useAnimatedStyle` and `useAnimatedProps`. Layout properties such as `width` or `margin` recalculate layout every frame.
|
|
268
|
+
*
|
|
269
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedgpu-properties-only
|
|
270
|
+
*/
|
|
271
|
+
"@ashstack/reanimated/gpu-properties-only"?: AllowWarnDeny | [AllowWarnDeny];
|
|
272
|
+
/**
|
|
273
|
+
* A layout animation belongs at module scope, or inside a memo when it depends on component values. The `entering`/`exiting`/`layout` props otherwise rebuild it on every render.
|
|
274
|
+
*
|
|
275
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedhoist-layout-animation-builder
|
|
276
|
+
*/
|
|
277
|
+
"@ashstack/reanimated/hoist-layout-animation-builder"?: AllowWarnDeny | [AllowWarnDeny];
|
|
278
|
+
/**
|
|
279
|
+
* Give `interpolate()` a fourth argument that clamps. Without one, or with `EXTEND` or `IDENTITY`, the output keeps going past the ends of the input range.
|
|
280
|
+
*
|
|
281
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedinterpolate-needs-clamp
|
|
282
|
+
*/
|
|
283
|
+
"@ashstack/reanimated/interpolate-needs-clamp"?: AllowWarnDeny | [AllowWarnDeny];
|
|
284
|
+
/**
|
|
285
|
+
* Shared values are read with `.get()` and written with `.set(...)`, never through `.value`. React Compiler cannot track a `.value` access.
|
|
286
|
+
*
|
|
287
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedno-shared-value-dot-value
|
|
288
|
+
*/
|
|
289
|
+
"@ashstack/reanimated/no-shared-value-dot-value"?: AllowWarnDeny | [AllowWarnDeny];
|
|
290
|
+
/**
|
|
291
|
+
* A worklet that runs every frame must not send a React state setter through `scheduleOnRN`. That puts a Fabric commit on an animation frame.
|
|
292
|
+
*
|
|
293
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedno-react-state-from-continuous-worklet
|
|
294
|
+
*/
|
|
295
|
+
"@ashstack/reanimated/no-react-state-from-continuous-worklet"?: AllowWarnDeny | [AllowWarnDeny];
|
|
296
|
+
/**
|
|
297
|
+
* Pass a computed `useSharedValue` initial value as a function. An eager call runs on every render while only the first result is kept.
|
|
298
|
+
*
|
|
299
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedprefer-lazy-shared-value-initializer
|
|
300
|
+
*/
|
|
301
|
+
"@ashstack/reanimated/prefer-lazy-shared-value-initializer"?: AllowWarnDeny | [AllowWarnDeny];
|
|
302
|
+
/**
|
|
303
|
+
* `scheduleOnRN` takes a function declared in RN Runtime scope. An inline callback can end up created on the wrong runtime.
|
|
304
|
+
*
|
|
305
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedschedule-on-rn-scope
|
|
306
|
+
*/
|
|
307
|
+
"@ashstack/reanimated/schedule-on-rn-scope"?: AllowWarnDeny | [AllowWarnDeny];
|
|
308
|
+
/**
|
|
309
|
+
* Destructuring a shared value or mutating what its `get()` returned detaches it from Reanimated reactivity. Reading or writing one while JSX evaluates also makes render impure.
|
|
310
|
+
*
|
|
311
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedshared-value-usage
|
|
312
|
+
*/
|
|
313
|
+
"@ashstack/reanimated/shared-value-usage"?: AllowWarnDeny | [AllowWarnDeny];
|
|
314
|
+
/**
|
|
315
|
+
* Require `resize` on a TurboImage so the native decoder downsamples before the bitmap reaches memory. A full-resolution decode wastes tens of megabytes and stalls the first frame.
|
|
316
|
+
*
|
|
317
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackturbo-imagerequire-resize
|
|
318
|
+
*/
|
|
319
|
+
"@ashstack/turbo-image/require-resize"?: AllowWarnDeny | [AllowWarnDeny];
|
|
320
|
+
/**
|
|
321
|
+
* Require `cachePolicy` on a TurboImage. Without one the image is re-fetched over the network on every cold start, so an already-scrolled feed costs its bandwidth again.
|
|
322
|
+
*
|
|
323
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackturbo-imagerequire-cache-policy
|
|
324
|
+
*/
|
|
325
|
+
"@ashstack/turbo-image/require-cache-policy"?: AllowWarnDeny | [AllowWarnDeny];
|
|
326
|
+
/**
|
|
327
|
+
* Require an explicit `opaque` prop on a Skia `<Canvas>`. A fullscreen animated canvas wants it on; anything that needs transparency or a view transform wants it off.
|
|
328
|
+
*
|
|
329
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackskiacanvas-opaque
|
|
330
|
+
*/
|
|
331
|
+
"@ashstack/skia/canvas-opaque"?: AllowWarnDeny | [AllowWarnDeny];
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { AllowWarnDeny } from "oxlint";
|
|
2
|
+
/** Every rule id `react()` adds on top of the entry below it. */
|
|
3
|
+
export type ReactRuleId = "@ashstack/react/no-unlabeled-icon-button" | "@ashstack/react/no-svg-without-title" | "@ashstack/query/no-inline-keys" | "@ashstack/query/no-deprecated-filters" | "@ashstack/query/require-destructured-hooks" | "@ashstack/query/no-fetch-in-query-fn" | "@ashstack/query/next-page-param-undefined" | "@ashstack/zustand/require-selector" | "@ashstack/i18n/no-bare-text" | "@ashstack/i18n/no-bare-attrs" | "@ashstack/i18n/no-bare-toast" | "@ashstack/tailwind/prefer-cn" | "@ashstack/tailwind/use-logical-classes" | "@ashstack/tanstack-router/require-selector" | "@ashstack/tanstack-router/no-search-casts" | "@ashstack/effects/no-derived-state" | "@ashstack/effects/no-chain-state-updates" | "@ashstack/effects/no-event-handler" | "@ashstack/effects/no-adjust-state-on-prop-change" | "@ashstack/effects/no-reset-all-state-on-prop-change" | "@ashstack/effects/no-pass-live-state-to-parent" | "@ashstack/effects/no-pass-data-to-parent" | "@ashstack/effects/no-external-store-subscription" | "@ashstack/effects/no-initialize-state";
|
|
4
|
+
declare module "oxlint" {
|
|
5
|
+
interface DummyRuleMap {
|
|
6
|
+
/**
|
|
7
|
+
* Require an accessible name on an icon-only `<button>` or `<Button>`. Without a label, visible text or image alt text, a screen reader cannot reach the control.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreactno-unlabeled-icon-button
|
|
10
|
+
*/
|
|
11
|
+
"@ashstack/react/no-unlabeled-icon-button"?: AllowWarnDeny | [AllowWarnDeny];
|
|
12
|
+
/**
|
|
13
|
+
* Require an accessible name on an inline `<svg>`: a `<title>` child with content, an `aria-label`, or a marker that it is decorative. Every child counts, and a self-closing `<svg />` reports.
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreactno-svg-without-title
|
|
16
|
+
*/
|
|
17
|
+
"@ashstack/react/no-svg-without-title"?: AllowWarnDeny | [AllowWarnDeny];
|
|
18
|
+
/**
|
|
19
|
+
* Disallow a query key written as an array literal at the call site instead of coming from a keys factory.
|
|
20
|
+
*
|
|
21
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-inline-keys
|
|
22
|
+
*/
|
|
23
|
+
"@ashstack/query/no-inline-keys"?: AllowWarnDeny | [AllowWarnDeny];
|
|
24
|
+
/**
|
|
25
|
+
* Disallow the positional key argument that TanStack Query v5 removed from `invalidateQueries` and its sibling methods. The suggestion rewrites it to the filter-object form.
|
|
26
|
+
*
|
|
27
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-deprecated-filters
|
|
28
|
+
*/
|
|
29
|
+
"@ashstack/query/no-deprecated-filters"?: AllowWarnDeny | [AllowWarnDeny];
|
|
30
|
+
/**
|
|
31
|
+
* Require destructuring the result of a hook imported from an `@/api/*.queries` or `@/api/*.mutations` module.
|
|
32
|
+
*
|
|
33
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryrequire-destructured-hooks
|
|
34
|
+
*/
|
|
35
|
+
"@ashstack/query/require-destructured-hooks"?: AllowWarnDeny | [AllowWarnDeny];
|
|
36
|
+
/**
|
|
37
|
+
* Disallow a bare `fetch(` inside a `queryFn` or `mutationFn`.
|
|
38
|
+
*
|
|
39
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-fetch-in-query-fn
|
|
40
|
+
*/
|
|
41
|
+
"@ashstack/query/no-fetch-in-query-fn"?: AllowWarnDeny | [AllowWarnDeny];
|
|
42
|
+
/**
|
|
43
|
+
* Disallow `return null` in the body of a `getNextPageParam`.
|
|
44
|
+
*
|
|
45
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackquerynext-page-param-undefined
|
|
46
|
+
*/
|
|
47
|
+
"@ashstack/query/next-page-param-undefined"?: AllowWarnDeny | [AllowWarnDeny];
|
|
48
|
+
/**
|
|
49
|
+
* Require a selector on a store hook, rather than no arguments or `undefined` in its place.
|
|
50
|
+
*
|
|
51
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackzustandrequire-selector
|
|
52
|
+
*/
|
|
53
|
+
"@ashstack/zustand/require-selector"?: AllowWarnDeny | [AllowWarnDeny];
|
|
54
|
+
/**
|
|
55
|
+
* Disallow a JSX element that carries no attributes and whose single child is plain literal text.
|
|
56
|
+
*
|
|
57
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-text
|
|
58
|
+
*/
|
|
59
|
+
"@ashstack/i18n/no-bare-text"?: AllowWarnDeny | [AllowWarnDeny];
|
|
60
|
+
/**
|
|
61
|
+
* Disallow a plain string literal on a configurable list of user-visible JSX attributes, defaulting to placeholder, accessibilityLabel, accessibilityHint and title.
|
|
62
|
+
*
|
|
63
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-attrs
|
|
64
|
+
*/
|
|
65
|
+
"@ashstack/i18n/no-bare-attrs"?: AllowWarnDeny | [AllowWarnDeny] | [AllowWarnDeny, {
|
|
66
|
+
attributes?: Array<string>;
|
|
67
|
+
}];
|
|
68
|
+
/**
|
|
69
|
+
* Disallow a `toast.*` call whose only argument is a string literal.
|
|
70
|
+
*
|
|
71
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-toast
|
|
72
|
+
*/
|
|
73
|
+
"@ashstack/i18n/no-bare-toast"?: AllowWarnDeny | [AllowWarnDeny];
|
|
74
|
+
/**
|
|
75
|
+
* Require a dynamic class value to go through `cn(...)` before it reaches a `class`, `className` or `*ClassName` prop. Reports both where the value reaches the prop and where a variable named after classes is declared.
|
|
76
|
+
*
|
|
77
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktailwindprefer-cn
|
|
78
|
+
*/
|
|
79
|
+
"@ashstack/tailwind/prefer-cn"?: AllowWarnDeny | [AllowWarnDeny];
|
|
80
|
+
/**
|
|
81
|
+
* Require a logical Tailwind utility over its physical left/right twin, so a right-to-left layout mirrors. Reads class props and bindings named after classes, through variant prefixes and the `!` and `-` modifiers.
|
|
82
|
+
*
|
|
83
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktailwinduse-logical-classes
|
|
84
|
+
*/
|
|
85
|
+
"@ashstack/tailwind/use-logical-classes"?: AllowWarnDeny | [AllowWarnDeny];
|
|
86
|
+
/**
|
|
87
|
+
* Require a `select` on `useLocation`, `useRouterState` and non-strict `useSearch`, so a component reads the smallest router value it needs instead of re-rendering on every navigation.
|
|
88
|
+
*
|
|
89
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktanstack-routerrequire-selector
|
|
90
|
+
*/
|
|
91
|
+
"@ashstack/tanstack-router/require-selector"?: AllowWarnDeny | [AllowWarnDeny];
|
|
92
|
+
/**
|
|
93
|
+
* Disallow an `as` assertion on a `useSearch()` result or on `router.state.location.search`. The route's `validateSearch` schema is what supplies the type.
|
|
94
|
+
*
|
|
95
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktanstack-routerno-search-casts
|
|
96
|
+
*/
|
|
97
|
+
"@ashstack/tanstack-router/no-search-casts"?: AllowWarnDeny | [AllowWarnDeny];
|
|
98
|
+
/**
|
|
99
|
+
* Disallow storing derived state in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state)
|
|
100
|
+
*
|
|
101
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-derived-state
|
|
102
|
+
*/
|
|
103
|
+
"@ashstack/effects/no-derived-state"?: AllowWarnDeny | [AllowWarnDeny];
|
|
104
|
+
/**
|
|
105
|
+
* Disallow chaining state changes in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations)
|
|
106
|
+
*
|
|
107
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-chain-state-updates
|
|
108
|
+
*/
|
|
109
|
+
"@ashstack/effects/no-chain-state-updates"?: AllowWarnDeny | [AllowWarnDeny];
|
|
110
|
+
/**
|
|
111
|
+
* Disallow using state and an effect as an event handler. [Why](https://react.dev/learn/you-might-not-need-an-effect#sharing-logic-between-event-handlers)
|
|
112
|
+
*
|
|
113
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-event-handler
|
|
114
|
+
*/
|
|
115
|
+
"@ashstack/effects/no-event-handler"?: AllowWarnDeny | [AllowWarnDeny];
|
|
116
|
+
/**
|
|
117
|
+
* Disallow adjusting state in an effect when a prop changes. [Why](https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes)
|
|
118
|
+
*
|
|
119
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-adjust-state-on-prop-change
|
|
120
|
+
*/
|
|
121
|
+
"@ashstack/effects/no-adjust-state-on-prop-change"?: AllowWarnDeny | [AllowWarnDeny];
|
|
122
|
+
/**
|
|
123
|
+
* Disallow resetting all state in an effect when a prop changes. [Why](https://react.dev/learn/you-might-not-need-an-effect#resetting-all-state-when-a-prop-changes)
|
|
124
|
+
*
|
|
125
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-reset-all-state-on-prop-change
|
|
126
|
+
*/
|
|
127
|
+
"@ashstack/effects/no-reset-all-state-on-prop-change"?: AllowWarnDeny | [AllowWarnDeny];
|
|
128
|
+
/**
|
|
129
|
+
* Disallow passing live state to parents in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#notifying-parent-components-about-state-changes)
|
|
130
|
+
*
|
|
131
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-pass-live-state-to-parent
|
|
132
|
+
*/
|
|
133
|
+
"@ashstack/effects/no-pass-live-state-to-parent"?: AllowWarnDeny | [AllowWarnDeny];
|
|
134
|
+
/**
|
|
135
|
+
* Disallow passing data to parents in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#passing-data-to-the-parent)
|
|
136
|
+
*
|
|
137
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-pass-data-to-parent
|
|
138
|
+
*/
|
|
139
|
+
"@ashstack/effects/no-pass-data-to-parent"?: AllowWarnDeny | [AllowWarnDeny];
|
|
140
|
+
/**
|
|
141
|
+
* Disallow subscribing to an external store in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#subscribing-to-an-external-store)
|
|
142
|
+
*
|
|
143
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-external-store-subscription
|
|
144
|
+
*/
|
|
145
|
+
"@ashstack/effects/no-external-store-subscription"?: AllowWarnDeny | [AllowWarnDeny];
|
|
146
|
+
/**
|
|
147
|
+
* Disallow initializing state in an effect. [Why](https://tkdodo.eu/blog/avoiding-hydration-mismatches-with-use-sync-external-store)
|
|
148
|
+
*
|
|
149
|
+
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-initialize-state
|
|
150
|
+
*/
|
|
151
|
+
"@ashstack/effects/no-initialize-state"?: AllowWarnDeny | [AllowWarnDeny];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -69,22 +69,49 @@ export interface ModuleManifest {
|
|
|
69
69
|
/** import bans that ship with (and only with) this module */
|
|
70
70
|
restrictedImports?: RestrictedImports;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* What a config needs from a module: the plugin file to hand oxlint, and the
|
|
74
|
+
* two flags per rule that decide whether it is on. Generated into
|
|
75
|
+
* `lib/registry.ts` from the manifests, so a config never imports rule code
|
|
76
|
+
* that oxlint is going to load from the path anyway.
|
|
77
|
+
*/
|
|
78
|
+
export interface ModuleMeta {
|
|
79
|
+
meta: {
|
|
80
|
+
name: `@ashstack/${string}`;
|
|
81
|
+
};
|
|
82
|
+
/** Absolute URL of the module's plugin file. */
|
|
83
|
+
url: string;
|
|
84
|
+
/** Enable when one of these is a dependency; absent = always on. */
|
|
85
|
+
packages?: string[];
|
|
86
|
+
/** Key in the entry options that forces the module on/off; absent = auto-only. */
|
|
87
|
+
option?: string;
|
|
88
|
+
restrictedImports?: RestrictedImports;
|
|
89
|
+
/** Rule name to the flags that gate it: off unless asked for, or gated on its own dependency. */
|
|
90
|
+
rules: Record<string, {
|
|
91
|
+
defaultOff?: boolean;
|
|
92
|
+
packages?: string[];
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
72
95
|
/** A ban-only group: import bans gated on a library, with no rules of its own. */
|
|
73
96
|
export interface BanGroup {
|
|
74
97
|
packages: string[];
|
|
75
98
|
restrictedImports: RestrictedImports;
|
|
76
99
|
}
|
|
77
100
|
export type CoreOptions = {
|
|
78
|
-
/** `@ashstack/zod/` rules — detected from `zod` */
|
|
101
|
+
/** [`@ashstack/zod/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackzod) — detected from `zod` */
|
|
79
102
|
zod?: boolean;
|
|
80
103
|
};
|
|
81
104
|
export type ReactOptions = CoreOptions & {
|
|
82
|
-
/** `@ashstack/query/` rules — detected from `@tanstack/react-query` */
|
|
105
|
+
/** [`@ashstack/query/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackquery) — detected from `@tanstack/react-query` */
|
|
83
106
|
query?: boolean;
|
|
84
|
-
/** `@ashstack/zustand/` rules — detected from `zustand` */
|
|
107
|
+
/** [`@ashstack/zustand/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackzustand) — detected from `zustand` */
|
|
85
108
|
zustand?: boolean;
|
|
86
|
-
/** `@ashstack/i18n/` rules — detected from i18next/lingui/react-intl/use-intl/next-intl/expo-localization */
|
|
109
|
+
/** [`@ashstack/i18n/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18n) — detected from i18next/lingui/react-intl/use-intl/next-intl/expo-localization */
|
|
87
110
|
i18n?: boolean;
|
|
111
|
+
/** [`@ashstack/tailwind/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktailwind) — detected from `tailwindcss` */
|
|
112
|
+
tailwind?: boolean;
|
|
113
|
+
/** [`@ashstack/tanstack-router/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktanstack-router) — detected from `@tanstack/react-router` */
|
|
114
|
+
tanstackRouter?: boolean;
|
|
88
115
|
};
|
|
89
116
|
/**
|
|
90
117
|
* Every toggle is a rule module — one rule namespace each. Import bans and
|
|
@@ -92,23 +119,24 @@ export type ReactOptions = CoreOptions & {
|
|
|
92
119
|
* by name in your `rules` block.
|
|
93
120
|
*/
|
|
94
121
|
export type ReactNativeOptions = ReactOptions & {
|
|
95
|
-
/** `@ashstack/unistyles/` rules + StyleSheet/Dimensions/SafeArea import bans — `react-native-unistyles` */
|
|
122
|
+
/** [`@ashstack/unistyles/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistyles) + StyleSheet/Dimensions/SafeArea import bans — `react-native-unistyles` */
|
|
96
123
|
unistyles?: boolean;
|
|
97
|
-
/** `@ashstack/legend-list/` rules + FlatList/FlashList bans — `@legendapp/list` */
|
|
124
|
+
/** [`@ashstack/legend-list/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-list) + FlatList/FlashList bans — `@legendapp/list` */
|
|
98
125
|
legendList?: boolean;
|
|
99
|
-
/** `@ashstack/legend-state/` rules + use$/useSelector ban — `@legendapp/state` */
|
|
126
|
+
/** [`@ashstack/legend-state/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-state) + use$/useSelector ban — `@legendapp/state` */
|
|
100
127
|
legendState?: boolean;
|
|
101
|
-
/** `@ashstack/reanimated/` rules + Animated/runOnJS bans — `react-native-reanimated` */
|
|
128
|
+
/** [`@ashstack/reanimated/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimated) + Animated/runOnJS bans — `react-native-reanimated` */
|
|
102
129
|
reanimated?: boolean;
|
|
103
|
-
/** `@ashstack/turbo-image/` rules — `react-native-turbo-image` */
|
|
130
|
+
/** [`@ashstack/turbo-image/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackturbo-image) — `react-native-turbo-image` */
|
|
104
131
|
turboImage?: boolean;
|
|
105
|
-
/** `@ashstack/skia/` rules — `@shopify/react-native-skia` */
|
|
132
|
+
/** [`@ashstack/skia/` rules](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackskia) — `@shopify/react-native-skia` */
|
|
106
133
|
skia?: boolean;
|
|
107
|
-
/** `@ashstack/keyboard` import bans — `react-native-keyboard-controller` */
|
|
134
|
+
/** [`@ashstack/keyboard` import bans](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackkeyboard) — `react-native-keyboard-controller` */
|
|
108
135
|
keyboard?: boolean;
|
|
109
136
|
};
|
|
110
137
|
/** The config object an entry returns: oxlint's own shape, so `defineConfig({ extends: [core()] })` typechecks. */
|
|
111
138
|
export type OxlintConfig = OxlintNativeConfig;
|
|
112
139
|
/** The `rules` block of a config: oxlint's own map, so a built-in rule's options are checked. */
|
|
113
140
|
export type RuleMap = NonNullable<OxlintConfig["rules"]>;
|
|
141
|
+
export type JsPlugin = NonNullable<OxlintConfig["jsPlugins"]>[number];
|
|
114
142
|
export {};
|
package/dist/modules.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./core/rules/core/index.js";import r from"./core/rules/zod/index.js";import e from"./react-native/rules/keyboard/index.js";import t from"./react-native/rules/legend-list/index.js";import m from"./react-native/rules/legend-state/index.js";import d from"./react-native/rules/react-native/index.js";import i from"./react-native/rules/reanimated/index.js";import u from"./react-native/rules/skia/index.js";import l from"./react-native/rules/turbo-image/index.js";import p from"./react-native/rules/unistyles/index.js";import M from"./react/rules/i18n/index.js";import a from"./react/rules/query/index.js";import f from"./react/rules/react/index.js";import s from"./react/rules/tailwind/index.js";import n from"./react/rules/tanstack-router/index.js";import c from"./react/rules/zustand/index.js";export const coreModules=[o,r],reactModules=[f,a,c,M,s,n],reactNativeModules=[d,p,t,m,i,l,u,e];
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { OxlintConfig, ReactOptions } from "../lib/types.js";
|
|
2
|
-
export declare const reactModules: import("../lib/types.js").ModuleManifest[];
|
|
3
2
|
/**
|
|
4
3
|
* React (web) entry — everything in core plus react, jsx-a11y, React Compiler
|
|
5
4
|
* diagnostics, you-might-not-need-an-effect, and the auto-detected library
|
|
6
5
|
* modules (query, zustand, i18n).
|
|
6
|
+
*
|
|
7
|
+
* @see [every rule `react()` sets](https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#react)
|
|
7
8
|
*/
|
|
8
9
|
declare const react: (options?: ReactOptions) => OxlintConfig;
|
|
10
|
+
export { react };
|
|
11
|
+
export type { CoreRuleId } from "../lib/rule-types/core.js";
|
|
12
|
+
export type { ReactRuleId } from "../lib/rule-types/react.js";
|
|
13
|
+
export type { ReactOptions, ModuleManifest } from "../lib/types.js";
|
|
9
14
|
export default react;
|