lint: use React.JSX type instead of the deprecated global JSX namespace

This commit is contained in:
Dimitri POSTOLOV
2025-02-20 16:11:00 +07:00
parent e041720a41
commit 7b4a81fb6b
4 changed files with 18 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
lint: use `React.JSX` type instead of the deprecated global `JSX` namespace
@@ -1,4 +1,4 @@
import { useState, useMemo, useRef, type KeyboardEvent, useCallback } from 'react'; import { useState, useMemo, useRef, type KeyboardEvent, useCallback, JSX } from 'react';
import cc from 'classcat'; import cc from 'classcat';
import { shallow } from 'zustand/shallow'; import { shallow } from 'zustand/shallow';
import { import {
+1 -1
View File
@@ -1,4 +1,4 @@
import { type Ref, type RefAttributes, forwardRef } from 'react'; import { type Ref, type RefAttributes, forwardRef, JSX } from 'react';
import { isNodeBase, isEdgeBase } from '@xyflow/system'; import { isNodeBase, isEdgeBase } from '@xyflow/system';
import type { Edge, Node } from '../types'; import type { Edge, Node } from '../types';
+11
View File
@@ -29,4 +29,15 @@ module.exports = {
rules: { rules: {
'@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-non-null-assertion': 'off',
}, },
overrides: [
{
files: ['**/*.{ts,tsx,cts,mts}'],
parserOptions: {
projectService: true,
},
rules: {
'@typescript-eslint/no-deprecated': 'error',
},
},
],
}; };