@ashstack/lint 0.5.0 → 0.5.1
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 +26 -0
- package/dist/lib/rule-types/core.d.ts +18 -14
- package/dist/lib/rule-types/react-native.d.ts +57 -54
- package/dist/lib/rule-types/react.d.ts +28 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,11 @@ export default defineConfig({
|
|
|
27
27
|
oxlint --type-aware --deny-warnings .
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
Keep the `defineConfig` wrapper. It is what types the `rules` block, so a wrong
|
|
31
|
+
rule option is a compile error and hovering a rule id shows what it does and
|
|
32
|
+
links to its section here. A bare `export default { ... }` gets neither, silently
|
|
33
|
+
— `satisfies OxlintConfig` works too if you would rather not wrap.
|
|
34
|
+
|
|
30
35
|
Type-aware rules need the `oxlint-tsgolint` peer. Node 22.18+.
|
|
31
36
|
|
|
32
37
|
Import the entry you use. There is no package root to import from, so nothing
|
|
@@ -43,6 +48,27 @@ import { reactNative } from "@ashstack/lint/react-native";
|
|
|
43
48
|
Each entry also has a default export, and carries its own options type
|
|
44
49
|
(`CoreOptions`, `ReactOptions`, `ReactNativeOptions`).
|
|
45
50
|
|
|
51
|
+
## Monorepos
|
|
52
|
+
|
|
53
|
+
A nested config replaces the one above it rather than merging, so each workspace
|
|
54
|
+
config extends an entry itself. Its own `plugins` array is unioned with the
|
|
55
|
+
entry's, never swapped for it:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
// apps/backend/oxlint.config.mts — a backend that also renders JSX templates
|
|
59
|
+
import { core } from "@ashstack/lint/core";
|
|
60
|
+
import { defineConfig } from "oxlint";
|
|
61
|
+
|
|
62
|
+
export default defineConfig({
|
|
63
|
+
extends: [core()],
|
|
64
|
+
plugins: ["react", "jsx-a11y"],
|
|
65
|
+
rules: { "react/jsx-key": "error" },
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Drop the `extends` and the workspace keeps only the rules it names, with no
|
|
70
|
+
diagnostic that the rest are gone.
|
|
71
|
+
|
|
46
72
|
## What each entry adds
|
|
47
73
|
|
|
48
74
|
`core()` is a strict eslint / typescript / unicorn / promise / import base plus the `@ashstack/core/` convention rules. `react()` adds react, jsx-a11y, React Compiler and you-might-not-need-an-effect. `react-native()` adds the generic `@ashstack/react-native/` rules: leaked renders, view nesting, iOS-only keyboard events, remote images.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AllowWarnDeny } from "oxlint";
|
|
2
|
+
/** A severity, or a severity followed by as many of the rule's options as you want to set. */
|
|
3
|
+
type RuleSetting<Options extends unknown[] = []> = AllowWarnDeny | [AllowWarnDeny, ...Partial<Options>];
|
|
2
4
|
/** Every rule id `core()` adds on top of the entry below it. */
|
|
3
5
|
export type CoreRuleId = "@ashstack/core/no-comments" | "@ashstack/core/no-naming-convention" | "@ashstack/core/no-packed-condition" | "@ashstack/core/use-design-system" | "@ashstack/core/components-tsx-only" | "@ashstack/core/hoist-intl" | "@ashstack/zod/prefer-enum";
|
|
4
6
|
declare module "oxlint" {
|
|
@@ -8,23 +10,25 @@ declare module "oxlint" {
|
|
|
8
10
|
*
|
|
9
11
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcoreno-comments
|
|
10
12
|
*/
|
|
11
|
-
"@ashstack/core/no-comments"?:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
"@ashstack/core/no-comments"?: RuleSetting<[
|
|
14
|
+
{
|
|
15
|
+
jsdoc?: "allow" | "report";
|
|
16
|
+
escapeHatch?: boolean;
|
|
17
|
+
budget?: number;
|
|
18
|
+
}
|
|
19
|
+
]>;
|
|
16
20
|
/**
|
|
17
21
|
* Require a variable, object property, type member or enum member to use one of the casings allowed for its kind.
|
|
18
22
|
*
|
|
19
23
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcoreno-naming-convention
|
|
20
24
|
*/
|
|
21
|
-
"@ashstack/core/no-naming-convention"?:
|
|
25
|
+
"@ashstack/core/no-naming-convention"?: RuleSetting;
|
|
22
26
|
/**
|
|
23
27
|
* Require a condition to be split into named booleans once it holds too many boolean operators and comparisons. The option says how many, defaulting to 5.
|
|
24
28
|
*
|
|
25
29
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcoreno-packed-condition
|
|
26
30
|
*/
|
|
27
|
-
"@ashstack/core/no-packed-condition"?:
|
|
31
|
+
"@ashstack/core/no-packed-condition"?: RuleSetting<[number]>;
|
|
28
32
|
/**
|
|
29
33
|
* Disallow importing a raw primitive your design system already wraps. Wrapped components come from scanning the design-system directory, plus the explicit `use` map for names, paths and source modules the scan cannot infer. Files under the design-system directory (or `exempt`) are skipped.
|
|
30
34
|
*
|
|
@@ -32,8 +36,7 @@ declare module "oxlint" {
|
|
|
32
36
|
*
|
|
33
37
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcoreuse-design-system
|
|
34
38
|
*/
|
|
35
|
-
"@ashstack/core/use-design-system"?:
|
|
36
|
-
AllowWarnDeny,
|
|
39
|
+
"@ashstack/core/use-design-system"?: RuleSetting<[
|
|
37
40
|
{
|
|
38
41
|
dir?: string;
|
|
39
42
|
alias?: string;
|
|
@@ -45,7 +48,7 @@ declare module "oxlint" {
|
|
|
45
48
|
}>;
|
|
46
49
|
exempt?: Array<string>;
|
|
47
50
|
}
|
|
48
|
-
]
|
|
51
|
+
]>;
|
|
49
52
|
/**
|
|
50
53
|
* Require every file under the components directory to render JSX or be a re-export barrel. `dir` says which directory, defaulting to `src/components`.
|
|
51
54
|
*
|
|
@@ -53,20 +56,21 @@ declare module "oxlint" {
|
|
|
53
56
|
*
|
|
54
57
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcorecomponents-tsx-only
|
|
55
58
|
*/
|
|
56
|
-
"@ashstack/core/components-tsx-only"?:
|
|
59
|
+
"@ashstack/core/components-tsx-only"?: RuleSetting<[{
|
|
57
60
|
dir?: string;
|
|
58
|
-
}]
|
|
61
|
+
}]>;
|
|
59
62
|
/**
|
|
60
63
|
* Disallow `new Intl.*` inside a function that renders JSX, unless the call already sits in `useMemo` or `useCallback`.
|
|
61
64
|
*
|
|
62
65
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackcorehoist-intl
|
|
63
66
|
*/
|
|
64
|
-
"@ashstack/core/hoist-intl"?:
|
|
67
|
+
"@ashstack/core/hoist-intl"?: RuleSetting;
|
|
65
68
|
/**
|
|
66
69
|
* Disallow `z.nativeEnum()` and any `z.union()` whose members are all `z.literal()` strings.
|
|
67
70
|
*
|
|
68
71
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackzodprefer-enum
|
|
69
72
|
*/
|
|
70
|
-
"@ashstack/zod/prefer-enum"?:
|
|
73
|
+
"@ashstack/zod/prefer-enum"?: RuleSetting;
|
|
71
74
|
}
|
|
72
75
|
}
|
|
76
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AllowWarnDeny } from "oxlint";
|
|
2
|
+
/** A severity, or a severity followed by as many of the rule's options as you want to set. */
|
|
3
|
+
type RuleSetting<Options extends unknown[] = []> = AllowWarnDeny | [AllowWarnDeny, ...Partial<Options>];
|
|
2
4
|
/** Every rule id `react-native()` adds on top of the entry below it. */
|
|
3
5
|
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
6
|
declare module "oxlint" {
|
|
@@ -8,55 +10,55 @@ declare module "oxlint" {
|
|
|
8
10
|
*
|
|
9
11
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-keyboard-will-events
|
|
10
12
|
*/
|
|
11
|
-
"@ashstack/react-native/no-keyboard-will-events"?:
|
|
13
|
+
"@ashstack/react-native/no-keyboard-will-events"?: RuleSetting;
|
|
12
14
|
/**
|
|
13
15
|
* Disallow a React state setter inside a scroll handler prop. Scroll fires every frame, and so would the re-render.
|
|
14
16
|
*
|
|
15
17
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-scroll-position-state
|
|
16
18
|
*/
|
|
17
|
-
"@ashstack/react-native/no-scroll-position-state"?:
|
|
19
|
+
"@ashstack/react-native/no-scroll-position-state"?: RuleSetting;
|
|
18
20
|
/**
|
|
19
21
|
* Disallow conditional and logical entries inside a JSX `style` array. A falsy entry leaves a hole that breaks the Unistyles C++ proxy.
|
|
20
22
|
*
|
|
21
23
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-conditional-style-array
|
|
22
24
|
*/
|
|
23
|
-
"@ashstack/react-native/no-conditional-style-array"?:
|
|
25
|
+
"@ashstack/react-native/no-conditional-style-array"?: RuleSetting;
|
|
24
26
|
/**
|
|
25
27
|
* 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
28
|
*
|
|
27
29
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-leaked-render
|
|
28
30
|
*/
|
|
29
|
-
"@ashstack/react-native/no-leaked-render"?:
|
|
31
|
+
"@ashstack/react-native/no-leaked-render"?: RuleSetting;
|
|
30
32
|
/**
|
|
31
33
|
* 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
34
|
*
|
|
33
35
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-rn-image-network-source
|
|
34
36
|
*/
|
|
35
|
-
"@ashstack/react-native/no-rn-image-network-source"?:
|
|
37
|
+
"@ashstack/react-native/no-rn-image-network-source"?: RuleSetting;
|
|
36
38
|
/**
|
|
37
39
|
* 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
40
|
*
|
|
39
41
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-redundant-view-nesting
|
|
40
42
|
*/
|
|
41
|
-
"@ashstack/react-native/no-redundant-view-nesting"?:
|
|
43
|
+
"@ashstack/react-native/no-redundant-view-nesting"?: RuleSetting;
|
|
42
44
|
/**
|
|
43
45
|
* 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
46
|
*
|
|
45
47
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-rn-namespace-import
|
|
46
48
|
*/
|
|
47
|
-
"@ashstack/react-native/no-rn-namespace-import"?:
|
|
49
|
+
"@ashstack/react-native/no-rn-namespace-import"?: RuleSetting;
|
|
48
50
|
/**
|
|
49
51
|
* 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
52
|
*
|
|
51
53
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-unlabeled-icon-pressable
|
|
52
54
|
*/
|
|
53
|
-
"@ashstack/react-native/no-unlabeled-icon-pressable"?:
|
|
55
|
+
"@ashstack/react-native/no-unlabeled-icon-pressable"?: RuleSetting;
|
|
54
56
|
/**
|
|
55
57
|
* 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
58
|
*
|
|
57
59
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativehoist-stateless-function
|
|
58
60
|
*/
|
|
59
|
-
"@ashstack/react-native/hoist-stateless-function"?:
|
|
61
|
+
"@ashstack/react-native/hoist-stateless-function"?: RuleSetting;
|
|
60
62
|
/**
|
|
61
63
|
* 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
64
|
*
|
|
@@ -64,270 +66,271 @@ declare module "oxlint" {
|
|
|
64
66
|
*
|
|
65
67
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-manual-memo
|
|
66
68
|
*/
|
|
67
|
-
"@ashstack/react-native/no-manual-memo"?:
|
|
69
|
+
"@ashstack/react-native/no-manual-memo"?: RuleSetting;
|
|
68
70
|
/**
|
|
69
71
|
* 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
72
|
*
|
|
71
73
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreact-nativeno-dynamic-import
|
|
72
74
|
*/
|
|
73
|
-
"@ashstack/react-native/no-dynamic-import"?:
|
|
75
|
+
"@ashstack/react-native/no-dynamic-import"?: RuleSetting;
|
|
74
76
|
/**
|
|
75
77
|
* A Reanimated worklet hook cannot see `useUnistyles()` theme changes on the UI thread. Read the shared value from `useAnimatedTheme()` there instead.
|
|
76
78
|
*
|
|
77
79
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesanimated-theme
|
|
78
80
|
*/
|
|
79
|
-
"@ashstack/unistyles/animated-theme"?:
|
|
81
|
+
"@ashstack/unistyles/animated-theme"?: RuleSetting;
|
|
80
82
|
/**
|
|
81
83
|
* A raw component never subscribes its `contentContainerStyle` to theme or `rt` updates. Wrap the component with `withUnistyles` when the style depends on either.
|
|
82
84
|
*
|
|
83
85
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylescontent-container
|
|
84
86
|
*/
|
|
85
|
-
"@ashstack/unistyles/content-container"?:
|
|
87
|
+
"@ashstack/unistyles/content-container"?: RuleSetting;
|
|
86
88
|
/**
|
|
87
89
|
* 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
90
|
*
|
|
89
91
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesin-sheet
|
|
90
92
|
*/
|
|
91
|
-
"@ashstack/unistyles/in-sheet"?:
|
|
93
|
+
"@ashstack/unistyles/in-sheet"?: RuleSetting;
|
|
92
94
|
/**
|
|
93
95
|
* Disallow passing `useSafeAreaInsets()` values into a dynamic style function or an inline JSX style object. Read `rt.insets` inside `StyleSheet.create` instead.
|
|
94
96
|
*
|
|
95
97
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesinsets
|
|
96
98
|
*/
|
|
97
|
-
"@ashstack/unistyles/insets"?:
|
|
99
|
+
"@ashstack/unistyles/insets"?: RuleSetting;
|
|
98
100
|
/**
|
|
99
101
|
* Disallow hex and CSS-function colors inside `StyleSheet.create`. A raw color skips dark mode and never changes with the theme.
|
|
100
102
|
*
|
|
101
103
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-hardcoded-color
|
|
102
104
|
*/
|
|
103
|
-
"@ashstack/unistyles/no-hardcoded-color"?:
|
|
105
|
+
"@ashstack/unistyles/no-hardcoded-color"?: RuleSetting;
|
|
104
106
|
/**
|
|
105
107
|
* Require `theme.spacing` or `theme.sizing.scale` for spacing, radius and type values inside `StyleSheet.create`, instead of raw numbers.
|
|
106
108
|
*
|
|
107
109
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-hardcoded-spacing
|
|
108
110
|
*/
|
|
109
|
-
"@ashstack/unistyles/no-hardcoded-spacing"?:
|
|
111
|
+
"@ashstack/unistyles/no-hardcoded-spacing"?: RuleSetting;
|
|
110
112
|
/**
|
|
111
113
|
* 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
114
|
*
|
|
113
115
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-margin
|
|
114
116
|
*/
|
|
115
|
-
"@ashstack/unistyles/no-margin"?:
|
|
117
|
+
"@ashstack/unistyles/no-margin"?: RuleSetting;
|
|
116
118
|
/**
|
|
117
119
|
* 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
120
|
*
|
|
119
121
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-style-spread
|
|
120
122
|
*/
|
|
121
|
-
"@ashstack/unistyles/no-style-spread"?:
|
|
123
|
+
"@ashstack/unistyles/no-style-spread"?: RuleSetting;
|
|
122
124
|
/**
|
|
123
125
|
* 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
126
|
*
|
|
125
127
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesno-unused-styles
|
|
126
128
|
*/
|
|
127
|
-
"@ashstack/unistyles/no-unused-styles"?:
|
|
129
|
+
"@ashstack/unistyles/no-unused-styles"?: RuleSetting;
|
|
128
130
|
/**
|
|
129
131
|
* Disallow passing `I18nManager.isRTL` from JSX into a dynamic style function. Unistyles tracks the dependency itself once the style reads `rt.rtl`.
|
|
130
132
|
*
|
|
131
133
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylesrtl-style-call
|
|
132
134
|
*/
|
|
133
|
-
"@ashstack/unistyles/rtl-style-call"?:
|
|
135
|
+
"@ashstack/unistyles/rtl-style-call"?: RuleSetting;
|
|
134
136
|
/**
|
|
135
137
|
* `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
138
|
*
|
|
137
139
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylestheme-screen-component
|
|
138
140
|
*/
|
|
139
|
-
"@ashstack/unistyles/theme-screen-component"?:
|
|
141
|
+
"@ashstack/unistyles/theme-screen-component"?: RuleSetting;
|
|
140
142
|
/**
|
|
141
143
|
* Theme-dependent values belong in `StyleSheet.create`, not in a JSX `style` prop that reads a `useUnistyles()` theme.
|
|
142
144
|
*
|
|
143
145
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackunistylestheme-style-attr
|
|
144
146
|
*/
|
|
145
|
-
"@ashstack/unistyles/theme-style-attr"?:
|
|
147
|
+
"@ashstack/unistyles/theme-style-attr"?: RuleSetting;
|
|
146
148
|
/**
|
|
147
149
|
* Require `keyExtractor` and an explicit `recycleItems` on a Legend List. Without a key extractor the list keys its rows by index.
|
|
148
150
|
*
|
|
149
151
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listrequired-props
|
|
150
152
|
*/
|
|
151
|
-
"@ashstack/legend-list/required-props"?:
|
|
153
|
+
"@ashstack/legend-list/required-props"?: RuleSetting;
|
|
152
154
|
/**
|
|
153
155
|
* 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
156
|
*
|
|
155
157
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-index-key-extractor
|
|
156
158
|
*/
|
|
157
|
-
"@ashstack/legend-list/no-index-key-extractor"?:
|
|
159
|
+
"@ashstack/legend-list/no-index-key-extractor"?: RuleSetting;
|
|
158
160
|
/**
|
|
159
161
|
* Disallow `key` on a Legend List, which remounts on any key change and loses its measurements and scroll position. Pass `dataKey` instead.
|
|
160
162
|
*
|
|
161
163
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-remount-key
|
|
162
164
|
*/
|
|
163
|
-
"@ashstack/legend-list/no-remount-key"?:
|
|
165
|
+
"@ashstack/legend-list/no-remount-key"?: RuleSetting;
|
|
164
166
|
/**
|
|
165
167
|
* 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
168
|
*
|
|
167
169
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-inline-render-item-props
|
|
168
170
|
*/
|
|
169
|
-
"@ashstack/legend-list/no-inline-render-item-props"?:
|
|
171
|
+
"@ashstack/legend-list/no-inline-render-item-props"?: RuleSetting;
|
|
170
172
|
/**
|
|
171
173
|
* 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
174
|
*
|
|
173
175
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-mixed-children
|
|
174
176
|
*/
|
|
175
|
-
"@ashstack/legend-list/no-mixed-children"?:
|
|
177
|
+
"@ashstack/legend-list/no-mixed-children"?: RuleSetting;
|
|
176
178
|
/**
|
|
177
179
|
* 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
180
|
*
|
|
179
181
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-flex-in-content-container
|
|
180
182
|
*/
|
|
181
|
-
"@ashstack/legend-list/no-flex-in-content-container"?:
|
|
183
|
+
"@ashstack/legend-list/no-flex-in-content-container"?: RuleSetting;
|
|
182
184
|
/**
|
|
183
185
|
* Require `getItemType` when a row branches on `item.type`. Without it every layout shares one recycling pool and one size average.
|
|
184
186
|
*
|
|
185
187
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listtyped-items-need-item-type
|
|
186
188
|
*/
|
|
187
|
-
"@ashstack/legend-list/typed-items-need-item-type"?:
|
|
189
|
+
"@ashstack/legend-list/typed-items-need-item-type"?: RuleSetting;
|
|
188
190
|
/**
|
|
189
191
|
* A `ScrollView` mounts every child up front, so a mapped collection does not belong in its children.
|
|
190
192
|
*
|
|
191
193
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-scrollview-map
|
|
192
194
|
*/
|
|
193
|
-
"@ashstack/legend-list/no-scrollview-map"?:
|
|
195
|
+
"@ashstack/legend-list/no-scrollview-map"?: RuleSetting;
|
|
194
196
|
/**
|
|
195
197
|
* 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
198
|
*
|
|
197
199
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-listno-unsupported-props
|
|
198
200
|
*/
|
|
199
|
-
"@ashstack/legend-list/no-unsupported-props"?:
|
|
201
|
+
"@ashstack/legend-list/no-unsupported-props"?: RuleSetting;
|
|
200
202
|
/**
|
|
201
203
|
* Write an observable with `.set(...)` or `.assign({...})`. Assigning or incrementing it with an operator is a silent no-op.
|
|
202
204
|
*
|
|
203
205
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-assignment
|
|
204
206
|
*/
|
|
205
|
-
"@ashstack/legend-state/no-assignment"?:
|
|
207
|
+
"@ashstack/legend-state/no-assignment"?: RuleSetting;
|
|
206
208
|
/**
|
|
207
209
|
* A variable initialized from `observable()` or `useObservable()` needs a trailing `$`. The other rules in this module key off that suffix.
|
|
208
210
|
*
|
|
209
211
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-statenaming
|
|
210
212
|
*/
|
|
211
|
-
"@ashstack/legend-state/naming"?:
|
|
213
|
+
"@ashstack/legend-state/naming"?: RuleSetting;
|
|
212
214
|
/**
|
|
213
215
|
* 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
216
|
*
|
|
215
217
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-nested-observable
|
|
216
218
|
*/
|
|
217
|
-
"@ashstack/legend-state/no-nested-observable"?:
|
|
219
|
+
"@ashstack/legend-state/no-nested-observable"?: RuleSetting;
|
|
218
220
|
/**
|
|
219
221
|
* Seeding `useState` from an observable's `get()` or `peek()` gives the value two owners. Read it with `useValue(...)` where it renders.
|
|
220
222
|
*
|
|
221
223
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-react-mirror
|
|
222
224
|
*/
|
|
223
|
-
"@ashstack/legend-state/no-react-mirror"?:
|
|
225
|
+
"@ashstack/legend-state/no-react-mirror"?: RuleSetting;
|
|
224
226
|
/**
|
|
225
227
|
* A `get()` placed directly in a JSX expression container is a plain read. The value renders once and never updates.
|
|
226
228
|
*
|
|
227
229
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-untracked-get-in-jsx
|
|
228
230
|
*/
|
|
229
|
-
"@ashstack/legend-state/no-untracked-get-in-jsx"?:
|
|
231
|
+
"@ashstack/legend-state/no-untracked-get-in-jsx"?: RuleSetting;
|
|
230
232
|
/**
|
|
231
233
|
* `peek()` never subscribes, so a selector or tracking callback that uses it never re-runs. Call `get()` there and keep `peek()` for handlers.
|
|
232
234
|
*
|
|
233
235
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-peek-in-selector
|
|
234
236
|
*/
|
|
235
|
-
"@ashstack/legend-state/no-peek-in-selector"?:
|
|
237
|
+
"@ashstack/legend-state/no-peek-in-selector"?: RuleSetting;
|
|
236
238
|
/**
|
|
237
239
|
* 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
240
|
*
|
|
239
241
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-object-selector
|
|
240
242
|
*/
|
|
241
|
-
"@ashstack/legend-state/no-object-selector"?:
|
|
243
|
+
"@ashstack/legend-state/no-object-selector"?: RuleSetting;
|
|
242
244
|
/**
|
|
243
245
|
* Calling `observable()` inside a component or hook makes a new observable on every render. Use `useObservable()` or a module-level store instead.
|
|
244
246
|
*
|
|
245
247
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacklegend-stateno-observable-in-component
|
|
246
248
|
*/
|
|
247
|
-
"@ashstack/legend-state/no-observable-in-component"?:
|
|
249
|
+
"@ashstack/legend-state/no-observable-in-component"?: RuleSetting;
|
|
248
250
|
/**
|
|
249
251
|
* 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
252
|
*
|
|
251
253
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-reaction-safety
|
|
252
254
|
*/
|
|
253
|
-
"@ashstack/reanimated/animated-reaction-safety"?:
|
|
255
|
+
"@ashstack/reanimated/animated-reaction-safety"?: RuleSetting;
|
|
254
256
|
/**
|
|
255
257
|
* An animated style only takes effect on an `Animated.*` component. A plain element applies it once at mount and then never updates.
|
|
256
258
|
*
|
|
257
259
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-style-needs-animated-component
|
|
258
260
|
*/
|
|
259
|
-
"@ashstack/reanimated/animated-style-needs-animated-component"?:
|
|
261
|
+
"@ashstack/reanimated/animated-style-needs-animated-component"?: RuleSetting;
|
|
260
262
|
/**
|
|
261
263
|
* An updater passed to `useAnimatedStyle` or `useAnimatedProps` must stay pure, so it may not write a shared value or call `scheduleOnRN`.
|
|
262
264
|
*
|
|
263
265
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedanimated-updater-purity
|
|
264
266
|
*/
|
|
265
|
-
"@ashstack/reanimated/animated-updater-purity"?:
|
|
267
|
+
"@ashstack/reanimated/animated-updater-purity"?: RuleSetting;
|
|
266
268
|
/**
|
|
267
269
|
* Animate `transform` and `opacity` in `useAnimatedStyle` and `useAnimatedProps`. Layout properties such as `width` or `margin` recalculate layout every frame.
|
|
268
270
|
*
|
|
269
271
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedgpu-properties-only
|
|
270
272
|
*/
|
|
271
|
-
"@ashstack/reanimated/gpu-properties-only"?:
|
|
273
|
+
"@ashstack/reanimated/gpu-properties-only"?: RuleSetting;
|
|
272
274
|
/**
|
|
273
275
|
* 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
276
|
*
|
|
275
277
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedhoist-layout-animation-builder
|
|
276
278
|
*/
|
|
277
|
-
"@ashstack/reanimated/hoist-layout-animation-builder"?:
|
|
279
|
+
"@ashstack/reanimated/hoist-layout-animation-builder"?: RuleSetting;
|
|
278
280
|
/**
|
|
279
281
|
* 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
282
|
*
|
|
281
283
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedinterpolate-needs-clamp
|
|
282
284
|
*/
|
|
283
|
-
"@ashstack/reanimated/interpolate-needs-clamp"?:
|
|
285
|
+
"@ashstack/reanimated/interpolate-needs-clamp"?: RuleSetting;
|
|
284
286
|
/**
|
|
285
287
|
* Shared values are read with `.get()` and written with `.set(...)`, never through `.value`. React Compiler cannot track a `.value` access.
|
|
286
288
|
*
|
|
287
289
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedno-shared-value-dot-value
|
|
288
290
|
*/
|
|
289
|
-
"@ashstack/reanimated/no-shared-value-dot-value"?:
|
|
291
|
+
"@ashstack/reanimated/no-shared-value-dot-value"?: RuleSetting;
|
|
290
292
|
/**
|
|
291
293
|
* 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
294
|
*
|
|
293
295
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedno-react-state-from-continuous-worklet
|
|
294
296
|
*/
|
|
295
|
-
"@ashstack/reanimated/no-react-state-from-continuous-worklet"?:
|
|
297
|
+
"@ashstack/reanimated/no-react-state-from-continuous-worklet"?: RuleSetting;
|
|
296
298
|
/**
|
|
297
299
|
* Pass a computed `useSharedValue` initial value as a function. An eager call runs on every render while only the first result is kept.
|
|
298
300
|
*
|
|
299
301
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedprefer-lazy-shared-value-initializer
|
|
300
302
|
*/
|
|
301
|
-
"@ashstack/reanimated/prefer-lazy-shared-value-initializer"?:
|
|
303
|
+
"@ashstack/reanimated/prefer-lazy-shared-value-initializer"?: RuleSetting;
|
|
302
304
|
/**
|
|
303
305
|
* `scheduleOnRN` takes a function declared in RN Runtime scope. An inline callback can end up created on the wrong runtime.
|
|
304
306
|
*
|
|
305
307
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedschedule-on-rn-scope
|
|
306
308
|
*/
|
|
307
|
-
"@ashstack/reanimated/schedule-on-rn-scope"?:
|
|
309
|
+
"@ashstack/reanimated/schedule-on-rn-scope"?: RuleSetting;
|
|
308
310
|
/**
|
|
309
311
|
* 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
312
|
*
|
|
311
313
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreanimatedshared-value-usage
|
|
312
314
|
*/
|
|
313
|
-
"@ashstack/reanimated/shared-value-usage"?:
|
|
315
|
+
"@ashstack/reanimated/shared-value-usage"?: RuleSetting;
|
|
314
316
|
/**
|
|
315
317
|
* 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
318
|
*
|
|
317
319
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackturbo-imagerequire-resize
|
|
318
320
|
*/
|
|
319
|
-
"@ashstack/turbo-image/require-resize"?:
|
|
321
|
+
"@ashstack/turbo-image/require-resize"?: RuleSetting;
|
|
320
322
|
/**
|
|
321
323
|
* 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
324
|
*
|
|
323
325
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackturbo-imagerequire-cache-policy
|
|
324
326
|
*/
|
|
325
|
-
"@ashstack/turbo-image/require-cache-policy"?:
|
|
327
|
+
"@ashstack/turbo-image/require-cache-policy"?: RuleSetting;
|
|
326
328
|
/**
|
|
327
329
|
* 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
330
|
*
|
|
329
331
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackskiacanvas-opaque
|
|
330
332
|
*/
|
|
331
|
-
"@ashstack/skia/canvas-opaque"?:
|
|
333
|
+
"@ashstack/skia/canvas-opaque"?: RuleSetting;
|
|
332
334
|
}
|
|
333
335
|
}
|
|
336
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AllowWarnDeny } from "oxlint";
|
|
2
|
+
/** A severity, or a severity followed by as many of the rule's options as you want to set. */
|
|
3
|
+
type RuleSetting<Options extends unknown[] = []> = AllowWarnDeny | [AllowWarnDeny, ...Partial<Options>];
|
|
2
4
|
/** Every rule id `react()` adds on top of the entry below it. */
|
|
3
5
|
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
6
|
declare module "oxlint" {
|
|
@@ -8,146 +10,147 @@ declare module "oxlint" {
|
|
|
8
10
|
*
|
|
9
11
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreactno-unlabeled-icon-button
|
|
10
12
|
*/
|
|
11
|
-
"@ashstack/react/no-unlabeled-icon-button"?:
|
|
13
|
+
"@ashstack/react/no-unlabeled-icon-button"?: RuleSetting;
|
|
12
14
|
/**
|
|
13
15
|
* 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
16
|
*
|
|
15
17
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackreactno-svg-without-title
|
|
16
18
|
*/
|
|
17
|
-
"@ashstack/react/no-svg-without-title"?:
|
|
19
|
+
"@ashstack/react/no-svg-without-title"?: RuleSetting;
|
|
18
20
|
/**
|
|
19
21
|
* Disallow a query key written as an array literal at the call site instead of coming from a keys factory.
|
|
20
22
|
*
|
|
21
23
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-inline-keys
|
|
22
24
|
*/
|
|
23
|
-
"@ashstack/query/no-inline-keys"?:
|
|
25
|
+
"@ashstack/query/no-inline-keys"?: RuleSetting;
|
|
24
26
|
/**
|
|
25
27
|
* 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
28
|
*
|
|
27
29
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-deprecated-filters
|
|
28
30
|
*/
|
|
29
|
-
"@ashstack/query/no-deprecated-filters"?:
|
|
31
|
+
"@ashstack/query/no-deprecated-filters"?: RuleSetting;
|
|
30
32
|
/**
|
|
31
33
|
* Require destructuring the result of a hook imported from an `@/api/*.queries` or `@/api/*.mutations` module.
|
|
32
34
|
*
|
|
33
35
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryrequire-destructured-hooks
|
|
34
36
|
*/
|
|
35
|
-
"@ashstack/query/require-destructured-hooks"?:
|
|
37
|
+
"@ashstack/query/require-destructured-hooks"?: RuleSetting;
|
|
36
38
|
/**
|
|
37
39
|
* Disallow a bare `fetch(` inside a `queryFn` or `mutationFn`.
|
|
38
40
|
*
|
|
39
41
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackqueryno-fetch-in-query-fn
|
|
40
42
|
*/
|
|
41
|
-
"@ashstack/query/no-fetch-in-query-fn"?:
|
|
43
|
+
"@ashstack/query/no-fetch-in-query-fn"?: RuleSetting;
|
|
42
44
|
/**
|
|
43
45
|
* Disallow `return null` in the body of a `getNextPageParam`.
|
|
44
46
|
*
|
|
45
47
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackquerynext-page-param-undefined
|
|
46
48
|
*/
|
|
47
|
-
"@ashstack/query/next-page-param-undefined"?:
|
|
49
|
+
"@ashstack/query/next-page-param-undefined"?: RuleSetting;
|
|
48
50
|
/**
|
|
49
51
|
* Require a selector on a store hook, rather than no arguments or `undefined` in its place.
|
|
50
52
|
*
|
|
51
53
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackzustandrequire-selector
|
|
52
54
|
*/
|
|
53
|
-
"@ashstack/zustand/require-selector"?:
|
|
55
|
+
"@ashstack/zustand/require-selector"?: RuleSetting;
|
|
54
56
|
/**
|
|
55
57
|
* Disallow a JSX element that carries no attributes and whose single child is plain literal text.
|
|
56
58
|
*
|
|
57
59
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-text
|
|
58
60
|
*/
|
|
59
|
-
"@ashstack/i18n/no-bare-text"?:
|
|
61
|
+
"@ashstack/i18n/no-bare-text"?: RuleSetting;
|
|
60
62
|
/**
|
|
61
63
|
* Disallow a plain string literal on a configurable list of user-visible JSX attributes, defaulting to placeholder, accessibilityLabel, accessibilityHint and title.
|
|
62
64
|
*
|
|
63
65
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-attrs
|
|
64
66
|
*/
|
|
65
|
-
"@ashstack/i18n/no-bare-attrs"?:
|
|
67
|
+
"@ashstack/i18n/no-bare-attrs"?: RuleSetting<[{
|
|
66
68
|
attributes?: Array<string>;
|
|
67
|
-
}]
|
|
69
|
+
}]>;
|
|
68
70
|
/**
|
|
69
71
|
* Disallow a `toast.*` call whose only argument is a string literal.
|
|
70
72
|
*
|
|
71
73
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacki18nno-bare-toast
|
|
72
74
|
*/
|
|
73
|
-
"@ashstack/i18n/no-bare-toast"?:
|
|
75
|
+
"@ashstack/i18n/no-bare-toast"?: RuleSetting;
|
|
74
76
|
/**
|
|
75
77
|
* 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
78
|
*
|
|
77
79
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktailwindprefer-cn
|
|
78
80
|
*/
|
|
79
|
-
"@ashstack/tailwind/prefer-cn"?:
|
|
81
|
+
"@ashstack/tailwind/prefer-cn"?: RuleSetting;
|
|
80
82
|
/**
|
|
81
83
|
* 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
84
|
*
|
|
83
85
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktailwinduse-logical-classes
|
|
84
86
|
*/
|
|
85
|
-
"@ashstack/tailwind/use-logical-classes"?:
|
|
87
|
+
"@ashstack/tailwind/use-logical-classes"?: RuleSetting;
|
|
86
88
|
/**
|
|
87
89
|
* 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
90
|
*
|
|
89
91
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktanstack-routerrequire-selector
|
|
90
92
|
*/
|
|
91
|
-
"@ashstack/tanstack-router/require-selector"?:
|
|
93
|
+
"@ashstack/tanstack-router/require-selector"?: RuleSetting;
|
|
92
94
|
/**
|
|
93
95
|
* 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
96
|
*
|
|
95
97
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstacktanstack-routerno-search-casts
|
|
96
98
|
*/
|
|
97
|
-
"@ashstack/tanstack-router/no-search-casts"?:
|
|
99
|
+
"@ashstack/tanstack-router/no-search-casts"?: RuleSetting;
|
|
98
100
|
/**
|
|
99
101
|
* 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
102
|
*
|
|
101
103
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-derived-state
|
|
102
104
|
*/
|
|
103
|
-
"@ashstack/effects/no-derived-state"?:
|
|
105
|
+
"@ashstack/effects/no-derived-state"?: RuleSetting;
|
|
104
106
|
/**
|
|
105
107
|
* Disallow chaining state changes in an effect. [Why](https://react.dev/learn/you-might-not-need-an-effect#chains-of-computations)
|
|
106
108
|
*
|
|
107
109
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-chain-state-updates
|
|
108
110
|
*/
|
|
109
|
-
"@ashstack/effects/no-chain-state-updates"?:
|
|
111
|
+
"@ashstack/effects/no-chain-state-updates"?: RuleSetting;
|
|
110
112
|
/**
|
|
111
113
|
* 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
114
|
*
|
|
113
115
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-event-handler
|
|
114
116
|
*/
|
|
115
|
-
"@ashstack/effects/no-event-handler"?:
|
|
117
|
+
"@ashstack/effects/no-event-handler"?: RuleSetting;
|
|
116
118
|
/**
|
|
117
119
|
* 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
120
|
*
|
|
119
121
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-adjust-state-on-prop-change
|
|
120
122
|
*/
|
|
121
|
-
"@ashstack/effects/no-adjust-state-on-prop-change"?:
|
|
123
|
+
"@ashstack/effects/no-adjust-state-on-prop-change"?: RuleSetting;
|
|
122
124
|
/**
|
|
123
125
|
* 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
126
|
*
|
|
125
127
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-reset-all-state-on-prop-change
|
|
126
128
|
*/
|
|
127
|
-
"@ashstack/effects/no-reset-all-state-on-prop-change"?:
|
|
129
|
+
"@ashstack/effects/no-reset-all-state-on-prop-change"?: RuleSetting;
|
|
128
130
|
/**
|
|
129
131
|
* 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
132
|
*
|
|
131
133
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-pass-live-state-to-parent
|
|
132
134
|
*/
|
|
133
|
-
"@ashstack/effects/no-pass-live-state-to-parent"?:
|
|
135
|
+
"@ashstack/effects/no-pass-live-state-to-parent"?: RuleSetting;
|
|
134
136
|
/**
|
|
135
137
|
* 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
138
|
*
|
|
137
139
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-pass-data-to-parent
|
|
138
140
|
*/
|
|
139
|
-
"@ashstack/effects/no-pass-data-to-parent"?:
|
|
141
|
+
"@ashstack/effects/no-pass-data-to-parent"?: RuleSetting;
|
|
140
142
|
/**
|
|
141
143
|
* 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
144
|
*
|
|
143
145
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-external-store-subscription
|
|
144
146
|
*/
|
|
145
|
-
"@ashstack/effects/no-external-store-subscription"?:
|
|
147
|
+
"@ashstack/effects/no-external-store-subscription"?: RuleSetting;
|
|
146
148
|
/**
|
|
147
149
|
* Disallow initializing state in an effect. [Why](https://tkdodo.eu/blog/avoiding-hydration-mismatches-with-use-sync-external-store)
|
|
148
150
|
*
|
|
149
151
|
* @see https://github.com/AlshehriAli0/ashStack/blob/main/packages/lint/RULES.md#ashstackeffectsno-initialize-state
|
|
150
152
|
*/
|
|
151
|
-
"@ashstack/effects/no-initialize-state"?:
|
|
153
|
+
"@ashstack/effects/no-initialize-state"?: RuleSetting;
|
|
152
154
|
}
|
|
153
155
|
}
|
|
156
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashstack/lint",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "ashStack shared oxlint configuration and custom rules. Entries: core, react, react-native, with per-library rule groups auto-detected from your dependencies. Consume from oxlint.config.mts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|