@liwo/eslint-config 0.0.7 → 0.1.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 +29 -1
- package/dist/index.d.ts +75 -111
- package/dist/index.js +4 -5
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# @liwo/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
[](https://npmjs.com/package/@liwo/eslint-config)
|
|
5
|
+
[](https://npmjs.com/package/@liwo/eslint-config)
|
|
6
|
+
[](https://github.com/liwonet/eslint-config/actions/workflows/ci.yml)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
It's an opinionated and aggressive eslint config.
|
|
4
11
|
|
|
5
12
|
## Install
|
|
6
13
|
|
|
@@ -8,6 +15,27 @@ Hard-forked from `@antfu/eslint-config`. It adopts a more opinionated and aggres
|
|
|
8
15
|
pnpm add -D eslint @liwo/eslint-config
|
|
9
16
|
```
|
|
10
17
|
|
|
18
|
+
Add `package.json` scripts.
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"scripts": {
|
|
23
|
+
"lint": "eslint .",
|
|
24
|
+
"format": "eslint --fix ."
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
pnpm run lint
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```shell
|
|
36
|
+
pnpm run format
|
|
37
|
+
```
|
|
38
|
+
|
|
11
39
|
## Acknowledgements
|
|
12
40
|
|
|
13
41
|
Thanks to the community and developers for their contributions!
|
package/dist/index.d.ts
CHANGED
|
@@ -2534,11 +2534,6 @@ interface RuleOptions {
|
|
|
2534
2534
|
* @see https://eslint.org/docs/latest/rules/radix
|
|
2535
2535
|
*/
|
|
2536
2536
|
'radix'?: Linter.RuleEntry<Radix>;
|
|
2537
|
-
/**
|
|
2538
|
-
* Disallow `children` in void DOM elements.
|
|
2539
|
-
* @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
2540
|
-
*/
|
|
2541
|
-
'react-dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]>;
|
|
2542
2537
|
/**
|
|
2543
2538
|
* Disallow `dangerouslySetInnerHTML`.
|
|
2544
2539
|
* @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
@@ -2570,7 +2565,7 @@ interface RuleOptions {
|
|
|
2570
2565
|
*/
|
|
2571
2566
|
'react-dom/no-missing-button-type'?: Linter.RuleEntry<[]>;
|
|
2572
2567
|
/**
|
|
2573
|
-
* Enforces explicit `sandbox`
|
|
2568
|
+
* Enforces explicit `sandbox` prop for `iframe` elements.
|
|
2574
2569
|
* @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
2575
2570
|
*/
|
|
2576
2571
|
'react-dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]>;
|
|
@@ -2594,6 +2589,11 @@ interface RuleOptions {
|
|
|
2594
2589
|
* @see https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
2595
2590
|
*/
|
|
2596
2591
|
'react-dom/no-script-url'?: Linter.RuleEntry<[]>;
|
|
2592
|
+
/**
|
|
2593
|
+
* Disallows the use of string style prop.
|
|
2594
|
+
* @see https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
2595
|
+
*/
|
|
2596
|
+
'react-dom/no-string-style-prop'?: Linter.RuleEntry<[]>;
|
|
2597
2597
|
/**
|
|
2598
2598
|
* Disallow unknown `DOM` property.
|
|
2599
2599
|
* @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
@@ -2620,60 +2620,15 @@ interface RuleOptions {
|
|
|
2620
2620
|
*/
|
|
2621
2621
|
'react-dom/no-void-elements-with-children'?: Linter.RuleEntry<[]>;
|
|
2622
2622
|
/**
|
|
2623
|
-
* Enforces
|
|
2624
|
-
* @see https://eslint-react.xyz/docs/rules/
|
|
2625
|
-
*/
|
|
2626
|
-
'react-hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]>;
|
|
2627
|
-
/**
|
|
2628
|
-
* Disallow unnecessary usage of `useCallback`.
|
|
2629
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
|
|
2623
|
+
* Enforces React Dom is imported via a namespace import.
|
|
2624
|
+
* @see https://eslint-react.xyz/docs/rules/dom-prefer-namespace-import
|
|
2630
2625
|
*/
|
|
2631
|
-
'react-
|
|
2632
|
-
/**
|
|
2633
|
-
* Disallow unnecessary usage of `useMemo`.
|
|
2634
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
|
|
2635
|
-
*/
|
|
2636
|
-
'react-hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]>;
|
|
2626
|
+
'react-dom/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
2637
2627
|
/**
|
|
2638
2628
|
* Disallow direct calls to the `set` function of `useState` in `useEffect`.
|
|
2639
2629
|
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
2640
2630
|
*/
|
|
2641
2631
|
'react-hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
|
|
2642
|
-
/**
|
|
2643
|
-
* Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`.
|
|
2644
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect
|
|
2645
|
-
*/
|
|
2646
|
-
'react-hooks-extra/no-direct-set-state-in-use-layout-effect'?: Linter.RuleEntry<[]>;
|
|
2647
|
-
/**
|
|
2648
|
-
* Enforces that a function with the `use` prefix should use at least one Hook inside of it.
|
|
2649
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
2650
|
-
*/
|
|
2651
|
-
'react-hooks-extra/no-redundant-custom-hook'?: Linter.RuleEntry<[]>;
|
|
2652
|
-
/**
|
|
2653
|
-
* Disallow unnecessary usage of `useCallback`.
|
|
2654
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback
|
|
2655
|
-
*/
|
|
2656
|
-
'react-hooks-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
|
|
2657
|
-
/**
|
|
2658
|
-
* Disallow unnecessary usage of `useMemo`.
|
|
2659
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo
|
|
2660
|
-
*/
|
|
2661
|
-
'react-hooks-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
|
|
2662
|
-
/**
|
|
2663
|
-
* Enforces that a function with the `use` prefix should use at least one Hook inside of it.
|
|
2664
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
2665
|
-
*/
|
|
2666
|
-
'react-hooks-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
2667
|
-
/**
|
|
2668
|
-
* Enforces that a function with the `use` prefix should use at least one Hook inside of it.
|
|
2669
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix
|
|
2670
|
-
*/
|
|
2671
|
-
'react-hooks-extra/no-useless-custom-hooks'?: Linter.RuleEntry<[]>;
|
|
2672
|
-
/**
|
|
2673
|
-
* Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
|
|
2674
|
-
* @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
|
|
2675
|
-
*/
|
|
2676
|
-
'react-hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
|
|
2677
2632
|
/**
|
|
2678
2633
|
* Verifies that automatic effect dependencies are compiled if opted-in
|
|
2679
2634
|
*/
|
|
@@ -2839,25 +2794,15 @@ interface RuleOptions {
|
|
|
2839
2794
|
*/
|
|
2840
2795
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
2841
2796
|
/**
|
|
2842
|
-
* Enforces
|
|
2843
|
-
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
|
|
2844
|
-
*/
|
|
2845
|
-
'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>;
|
|
2846
|
-
/**
|
|
2847
|
-
* Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax.
|
|
2848
|
-
* @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment
|
|
2849
|
-
*/
|
|
2850
|
-
'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>;
|
|
2851
|
-
/**
|
|
2852
|
-
* Disallow useless `forwardRef` calls on components that don't use `ref`s.
|
|
2853
|
-
* @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref
|
|
2854
|
-
*/
|
|
2855
|
-
'react/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]>;
|
|
2856
|
-
/**
|
|
2857
|
-
* Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.
|
|
2797
|
+
* Enforces that the 'key' prop is placed before the spread prop in JSX elements.
|
|
2858
2798
|
* @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
|
|
2859
2799
|
*/
|
|
2860
2800
|
'react/jsx-key-before-spread'?: Linter.RuleEntry<[]>;
|
|
2801
|
+
/**
|
|
2802
|
+
* Prevents comments from being inserted as text nodes.
|
|
2803
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
2804
|
+
*/
|
|
2805
|
+
'react/jsx-no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
2861
2806
|
/**
|
|
2862
2807
|
* Disallow duplicate props in JSX elements.
|
|
2863
2808
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
@@ -2873,6 +2818,16 @@ interface RuleOptions {
|
|
|
2873
2818
|
* @see https://eslint-react.xyz/docs/rules/jsx-no-undef
|
|
2874
2819
|
*/
|
|
2875
2820
|
'react/jsx-no-undef'?: Linter.RuleEntry<[]>;
|
|
2821
|
+
/**
|
|
2822
|
+
* Enforces shorthand syntax for boolean attributes.
|
|
2823
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-boolean
|
|
2824
|
+
*/
|
|
2825
|
+
'react/jsx-shorthand-boolean'?: Linter.RuleEntry<ReactJsxShorthandBoolean>;
|
|
2826
|
+
/**
|
|
2827
|
+
* Enforces shorthand syntax for fragments.
|
|
2828
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-shorthand-fragment
|
|
2829
|
+
*/
|
|
2830
|
+
'react/jsx-shorthand-fragment'?: Linter.RuleEntry<ReactJsxShorthandFragment>;
|
|
2876
2831
|
/**
|
|
2877
2832
|
* Marks React variables as used when JSX is used.
|
|
2878
2833
|
* @see https://eslint-react.xyz/docs/rules/jsx-uses-react
|
|
@@ -2933,21 +2888,6 @@ interface RuleOptions {
|
|
|
2933
2888
|
* @see https://eslint-react.xyz/docs/rules/no-clone-element
|
|
2934
2889
|
*/
|
|
2935
2890
|
'react/no-clone-element'?: Linter.RuleEntry<[]>;
|
|
2936
|
-
/**
|
|
2937
|
-
* Prevents comments from being inserted as text nodes.
|
|
2938
|
-
* @see https://eslint-react.xyz/docs/rules/no-comment-textnodes
|
|
2939
|
-
*/
|
|
2940
|
-
'react/no-comment-textnodes'?: Linter.RuleEntry<[]>;
|
|
2941
|
-
/**
|
|
2942
|
-
* Disallow complex conditional rendering in JSX expressions.
|
|
2943
|
-
* @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
|
|
2944
|
-
*/
|
|
2945
|
-
'react/no-complex-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
2946
|
-
/**
|
|
2947
|
-
* Disallow complex conditional rendering in JSX expressions.
|
|
2948
|
-
* @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering
|
|
2949
|
-
*/
|
|
2950
|
-
'react/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]>;
|
|
2951
2891
|
/**
|
|
2952
2892
|
* Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
|
|
2953
2893
|
* @see https://eslint-react.xyz/docs/rules/no-component-will-mount
|
|
@@ -2983,16 +2923,16 @@ interface RuleOptions {
|
|
|
2983
2923
|
* @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
2984
2924
|
*/
|
|
2985
2925
|
'react/no-direct-mutation-state'?: Linter.RuleEntry<[]>;
|
|
2986
|
-
/**
|
|
2987
|
-
* Disallow duplicate props in JSX elements.
|
|
2988
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
|
|
2989
|
-
*/
|
|
2990
|
-
'react/no-duplicate-jsx-props'?: Linter.RuleEntry<[]>;
|
|
2991
2926
|
/**
|
|
2992
2927
|
* Disallow duplicate `key` on elements in the same array or a list of `children`.
|
|
2993
2928
|
* @see https://eslint-react.xyz/docs/rules/no-duplicate-key
|
|
2994
2929
|
*/
|
|
2995
2930
|
'react/no-duplicate-key'?: Linter.RuleEntry<[]>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Disallow certain props on components.
|
|
2933
|
+
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
2934
|
+
*/
|
|
2935
|
+
'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>;
|
|
2996
2936
|
/**
|
|
2997
2937
|
* Replaces usages of `forwardRef` with passing `ref` as a prop.
|
|
2998
2938
|
* @see https://eslint-react.xyz/docs/rules/no-forward-ref
|
|
@@ -3033,11 +2973,6 @@ interface RuleOptions {
|
|
|
3033
2973
|
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
3034
2974
|
*/
|
|
3035
2975
|
'react/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
3036
|
-
/**
|
|
3037
|
-
* Disallow nesting component definitions inside other components.
|
|
3038
|
-
* @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
3039
|
-
*/
|
|
3040
|
-
'react/no-nested-components'?: Linter.RuleEntry<[]>;
|
|
3041
2976
|
/**
|
|
3042
2977
|
* Disallow nesting lazy component declarations inside other components.
|
|
3043
2978
|
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
@@ -3064,7 +2999,7 @@ interface RuleOptions {
|
|
|
3064
2999
|
*/
|
|
3065
3000
|
'react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]>;
|
|
3066
3001
|
/**
|
|
3067
|
-
*
|
|
3002
|
+
* Disallow calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
|
|
3068
3003
|
* @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
3069
3004
|
*/
|
|
3070
3005
|
'react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]>;
|
|
@@ -3073,6 +3008,26 @@ interface RuleOptions {
|
|
|
3073
3008
|
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
3074
3009
|
*/
|
|
3075
3010
|
'react/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
3011
|
+
/**
|
|
3012
|
+
* Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
|
|
3013
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
3014
|
+
*/
|
|
3015
|
+
'react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
3016
|
+
/**
|
|
3017
|
+
* Disallow unnecessary usage of `useCallback`.
|
|
3018
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
3019
|
+
*/
|
|
3020
|
+
'react/no-unnecessary-use-callback'?: Linter.RuleEntry<[]>;
|
|
3021
|
+
/**
|
|
3022
|
+
* Disallow unnecessary usage of `useMemo`.
|
|
3023
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
|
|
3024
|
+
*/
|
|
3025
|
+
'react/no-unnecessary-use-memo'?: Linter.RuleEntry<[]>;
|
|
3026
|
+
/**
|
|
3027
|
+
* Enforces that a function with the `use` prefix should use at least one Hook inside of it.
|
|
3028
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix
|
|
3029
|
+
*/
|
|
3030
|
+
'react/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]>;
|
|
3076
3031
|
/**
|
|
3077
3032
|
* Warns the usage of `UNSAFE_componentWillMount` in class components.
|
|
3078
3033
|
* @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount
|
|
@@ -3103,6 +3058,11 @@ interface RuleOptions {
|
|
|
3103
3058
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
3104
3059
|
*/
|
|
3105
3060
|
'react/no-unused-class-component-members'?: Linter.RuleEntry<[]>;
|
|
3061
|
+
/**
|
|
3062
|
+
* Warns component props that are defined but never used.
|
|
3063
|
+
* @see https://eslint-react.xyz/docs/rules/no-unused-props
|
|
3064
|
+
*/
|
|
3065
|
+
'react/no-unused-props'?: Linter.RuleEntry<[]>;
|
|
3106
3066
|
/**
|
|
3107
3067
|
* Warns unused class component state.
|
|
3108
3068
|
* @see https://eslint-react.xyz/docs/rules/no-unused-state
|
|
@@ -3130,29 +3090,19 @@ interface RuleOptions {
|
|
|
3130
3090
|
'react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]>;
|
|
3131
3091
|
/**
|
|
3132
3092
|
* Enforces React is imported via a namespace import.
|
|
3133
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-
|
|
3093
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-namespace-import
|
|
3134
3094
|
*/
|
|
3135
|
-
'react/prefer-
|
|
3095
|
+
'react/prefer-namespace-import'?: Linter.RuleEntry<[]>;
|
|
3136
3096
|
/**
|
|
3137
3097
|
* Enforces read-only props in components.
|
|
3138
3098
|
* @see https://eslint-react.xyz/docs/rules/prefer-read-only-props
|
|
3139
3099
|
*/
|
|
3140
3100
|
'react/prefer-read-only-props'?: Linter.RuleEntry<[]>;
|
|
3141
3101
|
/**
|
|
3142
|
-
* Enforces
|
|
3143
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-
|
|
3144
|
-
*/
|
|
3145
|
-
'react/prefer-shorthand-boolean'?: Linter.RuleEntry<[]>;
|
|
3146
|
-
/**
|
|
3147
|
-
* Enforces shorthand syntax for fragments.
|
|
3148
|
-
* @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
|
|
3149
|
-
*/
|
|
3150
|
-
'react/prefer-shorthand-fragment'?: Linter.RuleEntry<[]>;
|
|
3151
|
-
/**
|
|
3152
|
-
* Marks variables used in JSX elements as used.
|
|
3153
|
-
* @see https://eslint-react.xyz/docs/rules/jsx-uses-vars
|
|
3102
|
+
* Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
|
|
3103
|
+
* @see https://eslint-react.xyz/docs/rules/prefer-use-state-lazy-initialization
|
|
3154
3104
|
*/
|
|
3155
|
-
'react/use-
|
|
3105
|
+
'react/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]>;
|
|
3156
3106
|
/**
|
|
3157
3107
|
* disallow confusing quantifiers
|
|
3158
3108
|
* @see https://ota-meshi.github.io/eslint-plugin-regexp/rules/confusing-quantifier.html
|
|
@@ -11918,6 +11868,20 @@ type ReactRefreshOnlyExportComponents = [] | [{
|
|
|
11918
11868
|
customHOCs?: string[];
|
|
11919
11869
|
checkJS?: boolean;
|
|
11920
11870
|
}];
|
|
11871
|
+
// ----- react/jsx-shorthand-boolean -----
|
|
11872
|
+
type ReactJsxShorthandBoolean = [] | [(-1 | 1)];
|
|
11873
|
+
// ----- react/jsx-shorthand-fragment -----
|
|
11874
|
+
type ReactJsxShorthandFragment = [] | [(-1 | 1)];
|
|
11875
|
+
// ----- react/no-forbidden-props -----
|
|
11876
|
+
type ReactNoForbiddenProps = [] | [{
|
|
11877
|
+
forbid?: (string | {
|
|
11878
|
+
excludedNodes?: string[];
|
|
11879
|
+
prop: string;
|
|
11880
|
+
} | {
|
|
11881
|
+
includedNodes?: string[];
|
|
11882
|
+
prop: string;
|
|
11883
|
+
})[];
|
|
11884
|
+
}];
|
|
11921
11885
|
// ----- react/no-useless-fragment -----
|
|
11922
11886
|
type ReactNoUselessFragment = [] | [{
|
|
11923
11887
|
allowExpressions?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1043,6 +1043,7 @@ async function react(options = {}) {
|
|
|
1043
1043
|
},
|
|
1044
1044
|
name: "liwo/react/rules",
|
|
1045
1045
|
rules: {
|
|
1046
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
1046
1047
|
"react/jsx-no-duplicate-props": "warn",
|
|
1047
1048
|
"react/jsx-uses-vars": "warn",
|
|
1048
1049
|
"react/no-access-state-in-setstate": "error",
|
|
@@ -1053,7 +1054,6 @@ async function react(options = {}) {
|
|
|
1053
1054
|
"react/no-children-only": "warn",
|
|
1054
1055
|
"react/no-children-to-array": "warn",
|
|
1055
1056
|
"react/no-clone-element": "warn",
|
|
1056
|
-
"react/no-comment-textnodes": "warn",
|
|
1057
1057
|
"react/no-component-will-mount": "error",
|
|
1058
1058
|
"react/no-component-will-receive-props": "error",
|
|
1059
1059
|
"react/no-component-will-update": "error",
|
|
@@ -1072,6 +1072,7 @@ async function react(options = {}) {
|
|
|
1072
1072
|
"react/no-set-state-in-component-did-update": "warn",
|
|
1073
1073
|
"react/no-set-state-in-component-will-update": "warn",
|
|
1074
1074
|
"react/no-string-refs": "error",
|
|
1075
|
+
"react/no-unnecessary-use-prefix": "warn",
|
|
1075
1076
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1076
1077
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1077
1078
|
"react/no-unsafe-component-will-update": "warn",
|
|
@@ -1081,6 +1082,7 @@ async function react(options = {}) {
|
|
|
1081
1082
|
"react/no-unused-state": "warn",
|
|
1082
1083
|
"react/no-use-context": "warn",
|
|
1083
1084
|
"react/no-useless-forward-ref": "warn",
|
|
1085
|
+
"react/prefer-use-state-lazy-initialization": "warn",
|
|
1084
1086
|
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1085
1087
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1086
1088
|
"react-dom/no-find-dom-node": "error",
|
|
@@ -1096,11 +1098,8 @@ async function react(options = {}) {
|
|
|
1096
1098
|
"react-dom/no-unsafe-target-blank": "warn",
|
|
1097
1099
|
"react-dom/no-use-form-state": "error",
|
|
1098
1100
|
"react-dom/no-void-elements-with-children": "error",
|
|
1099
|
-
|
|
1100
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1101
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
1101
1102
|
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1102
|
-
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
1103
|
-
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
1104
1103
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
1105
1104
|
"react-web-api/no-leaked-interval": "warn",
|
|
1106
1105
|
"react-web-api/no-leaked-resize-observer": "warn",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liwo/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "ESLint config by Liwo",
|
|
6
6
|
"author": "Aoang <aoang@x2oe.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@antfu/install-pkg": "1.1.0",
|
|
50
50
|
"@clack/prompts": "0.11.0",
|
|
51
51
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
52
|
-
"@eslint-react/eslint-plugin": "
|
|
52
|
+
"@eslint-react/eslint-plugin": "2.2.4",
|
|
53
53
|
"@eslint/markdown": "7.5.0",
|
|
54
54
|
"@stylistic/eslint-plugin": "5.5.0",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "8.46.2",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"typescript": "^5.9.3",
|
|
107
107
|
"vitest": "^4.0.5",
|
|
108
108
|
"vue": "^3.5.22",
|
|
109
|
-
"@liwo/eslint-config": "0.0
|
|
109
|
+
"@liwo/eslint-config": "0.1.0"
|
|
110
110
|
},
|
|
111
111
|
"simple-git-hooks": {
|
|
112
112
|
"pre-commit": "npx lint-staged"
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"build:inspector": "pnpm build && npx @eslint/config-inspector build && tsx scripts/fixed-netlify.ts",
|
|
125
125
|
"watch": "tsdown --watch",
|
|
126
126
|
"lint": "eslint",
|
|
127
|
+
"format": "eslint --fix .",
|
|
127
128
|
"gen": "tsx scripts/typegen.ts",
|
|
128
129
|
"test": "vitest",
|
|
129
130
|
"release": "bumpp",
|