Skip to content

Commit 5a596e3

Browse files
authored
fix: fixed named export 'JsxEmit' not found, closes #1095 (#1096)
1 parent f9b6296 commit 5a596e3

File tree

15 files changed

+125
-56
lines changed

15 files changed

+125
-56
lines changed

.pkgs/configs/eslint.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ export const typescript = tseslint.config({
5454
"no-mixed-operators": "warn",
5555
"no-undef": "off",
5656
"prefer-object-has-own": "error",
57-
// "no-restricted-syntax": [
58-
// "error",
59-
// {
60-
// message: "no optional",
61-
// selector: "TSPropertySignature[optional=true]",
62-
// },
63-
// ],
57+
"no-restricted-syntax": [
58+
"error",
59+
{
60+
message: "no typescript named import",
61+
selector: "ImportDeclaration[source.value='typescript'] ImportSpecifier",
62+
},
63+
],
6464
"@typescript-eslint/ban-ts-comment": [
6565
"error",
6666
{

.pkgs/configs/eslint.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ export const typescript: ConfigArray = tseslint.config(
6464
"no-undef": "off",
6565
"prefer-object-has-own": "error",
6666

67-
// "no-restricted-syntax": [
68-
// "error",
69-
// {
70-
// message: "no optional",
71-
// selector: "TSPropertySignature[optional=true]",
72-
// },
73-
// ],
67+
"no-restricted-syntax": [
68+
"error",
69+
{
70+
message: "no typescript named import",
71+
selector: "ImportDeclaration[source.value='typescript'] ImportSpecifier",
72+
},
73+
],
7474

7575
"@typescript-eslint/ban-ts-comment": [
7676
"error",

packages/plugins/eslint-plugin-react-debug/src/rules/jsx.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { JsxConfig } from "@eslint-react/kit";
12
import { RuleTester } from "@typescript-eslint/rule-tester";
3+
24
import tsx from "dedent";
35

4-
import { JsxEmit } from "typescript";
56
import { defaultLanguageOptionsWithTypes, getProjectForJsxEmit } from "../../../../../test";
6-
77
import { stringify } from "../utils";
88
import rule, { RULE_NAME } from "./jsx";
99

@@ -12,7 +12,7 @@ const ruleTester = new RuleTester({
1212
...defaultLanguageOptionsWithTypes,
1313
parserOptions: {
1414
...defaultLanguageOptionsWithTypes.parserOptions,
15-
project: getProjectForJsxEmit(JsxEmit.ReactJSX),
15+
project: getProjectForJsxEmit(JsxConfig.JsxEmit.ReactJSX),
1616
projectService: false,
1717
},
1818
},

packages/plugins/eslint-plugin-react-debug/src/rules/jsx.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { flow } from "@eslint-react/eff";
55
import { JsxConfig, Reporter as RPT, type RuleContext, type RuleFeature } from "@eslint-react/kit";
66
import { AST_NODE_TYPES as T, type TSESTree } from "@typescript-eslint/types";
77
import { match, P } from "ts-pattern";
8-
import { JsxEmit } from "typescript";
98
import { createRule, stringify } from "../utils";
109

10+
const { JsxEmit } = JsxConfig;
11+
1112
export const RULE_NAME = "jsx";
1213

1314
export const RULE_FEATURES = [

packages/plugins/eslint-plugin-react-x/src/rules/jsx-uses-react.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { JsxConfig } from "@eslint-react/kit";
12
import { RuleTester } from "@typescript-eslint/rule-tester";
2-
import tsx from "dedent";
33

4-
import { JsxEmit } from "typescript";
4+
import tsx from "dedent";
55
import { defaultLanguageOptionsWithTypes, getProjectForJsxEmit } from "../../../../../test";
66
import rule, { RULE_NAME } from "./jsx-uses-react";
77

@@ -10,7 +10,7 @@ const ruleTester = new RuleTester({
1010
...defaultLanguageOptionsWithTypes,
1111
parserOptions: {
1212
...defaultLanguageOptionsWithTypes.parserOptions,
13-
project: getProjectForJsxEmit(JsxEmit.React),
13+
project: getProjectForJsxEmit(JsxConfig.JsxEmit.React),
1414
projectService: false,
1515
},
1616
},

packages/plugins/eslint-plugin-react-x/src/rules/jsx-uses-react.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import type { RuleListener } from "@typescript-eslint/utils/ts-eslint";
33

44
import type { CamelCase } from "string-ts";
55
import { JsxConfig, type RuleContext, type RuleFeature } from "@eslint-react/kit";
6-
import { JsxEmit } from "typescript";
76
import { createRule } from "../utils";
87

8+
const { JsxEmit } = JsxConfig;
9+
910
export const RULE_NAME = "jsx-uses-react";
1011

1112
export const RULE_FEATURES = [] as const satisfies RuleFeature[];

packages/utilities/kit/docs/@eslint-react/namespaces/JsxConfig/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77
# JsxConfig
88

9-
## Type Aliases
9+
## Interfaces
1010

11-
- [JsxConfig](type-aliases/JsxConfig.md)
11+
- [JsxConfig](interfaces/JsxConfig.md)
12+
13+
## Variables
14+
15+
- [JsxEmit](variables/JsxEmit.md)
1216

1317
## Functions
1418

packages/utilities/kit/docs/@eslint-react/namespaces/JsxConfig/functions/getFromAnnotation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Function: getFromAnnotation()
88

9-
> **getFromAnnotation**(`context`): [`JsxConfig`](../type-aliases/JsxConfig.md)
9+
> **getFromAnnotation**(`context`): [`JsxConfig`](../interfaces/JsxConfig.md)
1010
1111
Get JsxConfig from annotation
1212

@@ -20,6 +20,6 @@ The RuleContext
2020

2121
## Returns
2222

23-
[`JsxConfig`](../type-aliases/JsxConfig.md)
23+
[`JsxConfig`](../interfaces/JsxConfig.md)
2424

2525
JsxConfig

packages/utilities/kit/docs/@eslint-react/namespaces/JsxConfig/functions/getFromContext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ JsxConfig
2626

2727
### jsx
2828

29-
> **jsx**: `JsxEmit`
29+
> **jsx**: `4` \| `JsxEmit`
3030
3131
### jsxFactory
3232

packages/utilities/kit/docs/@eslint-react/namespaces/JsxConfig/functions/make.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
# Function: make()
88

9-
> **make**(): [`JsxConfig`](../type-aliases/JsxConfig.md)
9+
> **make**(): [`JsxConfig`](../interfaces/JsxConfig.md)
1010
1111
Create a JsxConfig object
1212

1313
## Returns
1414

15-
[`JsxConfig`](../type-aliases/JsxConfig.md)
15+
[`JsxConfig`](../interfaces/JsxConfig.md)
1616

1717
JsxConfig

0 commit comments

Comments
 (0)