Skip to content

Commit fc3ef9b

Browse files
committed
main 🧊 disable react lint 19 rules
1 parent 0f79533 commit fc3ef9b

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

‎packages/core/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default eslint(
2020
'react-dom/no-flush-sync': 'warn',
2121
'jsdoc/no-defaults': 'off',
2222
'react-hooks/rules-of-hooks': 'warn',
23-
'react/no-context-provider': 'warn'
23+
'react/no-use-context': 'off',
24+
'react/no-context-provider': 'off'
2425
}
2526
},
2627
{

‎packages/core/src/bundle/helpers/createContext/createContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { jsx as _jsx } from 'react/jsx-runtime';
2-
import { createContext as createReactContext, use, useMemo, useState } from 'react';
2+
import { createContext as createReactContext, useContext, useMemo, useState } from 'react';
33
/**
44
* @name createContext
55
* @description - Creates a typed context with additional utilities
@@ -20,7 +20,7 @@ export const createContext = (defaultValue = undefined, options = {}) => {
2020
});
2121
Context.displayName = options.name;
2222
function useSelect(selector) {
23-
const context = use(Context);
23+
const context = useContext(Context);
2424
if (!context && options.strict) {
2525
throw new Error(`Context hook ${options.name} must be used inside a Provider`);
2626
}

‎packages/core/src/bundle/helpers/createReactiveContext/createReactiveContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
createContext,
33
createElement,
44
startTransition,
5-
use,
5+
useContext,
66
useMemo,
77
useRef,
88
useState
@@ -33,7 +33,7 @@ const createProvider = (originalProvider) => {
3333
return Provider;
3434
};
3535
const createReactiveContextSelector = (Context, selector, options = {}) => {
36-
const context = use(Context);
36+
const context = useContext(Context);
3737
if (!context && options.strict) {
3838
throw new Error(`Context hook ${options.name} must be used inside a Provider`);
3939
}

‎packages/core/src/helpers/createContext/createContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { JSX, ReactNode } from 'react';
22

3-
import { createContext as createReactContext, use, useMemo, useState } from 'react';
3+
import { createContext as createReactContext, useContext, useMemo, useState } from 'react';
44

55
/** The create context options type */
66
export interface CreateContextOptions {
@@ -69,7 +69,7 @@ export const createContext = <Value,>(
6969
function useSelect(): ContextValue<Value>;
7070
function useSelect<Selected>(selector: (value: Value) => Selected): Selected;
7171
function useSelect<Selected>(selector?: (value: Value) => Selected) {
72-
const context = use(Context);
72+
const context = useContext(Context);
7373

7474
if (!context && options.strict) {
7575
throw new Error(`Context hook ${options.name} must be used inside a Provider`);

‎packages/core/src/helpers/createReactiveContext/createReactiveContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
createContext,
55
createElement,
66
startTransition,
7-
use,
7+
useContext,
88
useMemo,
99
useRef,
1010
useState
@@ -73,7 +73,7 @@ const createReactiveContextSelector = <Value, Selected>(
7373
selector: (state: Value) => Selected,
7474
options: CreateReactiveContextOptions = {}
7575
) => {
76-
const context = use(Context);
76+
const context = useContext(Context);
7777

7878
if (!context && options.strict) {
7979
throw new Error(`Context hook ${options.name} must be used inside a Provider`);

0 commit comments

Comments
 (0)