Skip to content

Commit 422c923

Browse files
authored
refactor: improve settings schema (#235)
1 parent 8e5a1f2 commit 422c923

File tree

14 files changed

+288
-114
lines changed

14 files changed

+288
-114
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ module.exports = defineConfig({
6161
"@typescript-eslint/prefer-readonly": "warn",
6262
"@typescript-eslint/prefer-nullish-coalescing": "warn",
6363
"@typescript-eslint/strict-boolean-expressions": "error",
64+
"@typescript-eslint/no-empty-interface": "off",
65+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
6466
"@susisu/safe-typescript/no-unsafe-object-property-check": "off",
6567
"import-access/jsdoc": ["error"],
6668
"jsdoc/require-jsdoc": "off",

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## v0.9.7-beta.2 (Sat Dec 16 2023)
2+
3+
### Release Notes
4+
5+
#### Update default rule option in `named-convention/filename` to `PascalCase`
6+
7+
---
8+
9+
#### 📝 Documentation
10+
11+
- `@eslint-react/eslint-plugin-naming-convention`
12+
- Update default rule option in `named-convention/filename` to `PascalCase`.
13+
14+
#### 🏠 Internal
15+
16+
- `@eslint-react/shared`
17+
- ⚠️ Change `ESLintReactSettingsSchema`.
18+
19+
- `@eslint-react/monorepo`
20+
- Add `format:package-json` script.
21+
- Minor improvements.
22+
23+
#### Authors: 1
24+
25+
- Eva1ent ([@Rel1cx](https://github.com/Rel1cx))
26+
27+
---
28+
129
## v0.9.7-beta.1 (Thu Dec 14 2023)
230

331
### Release Notes

packages/core/docs/README.md

Lines changed: 22 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44

55
## Table of contents
66

7+
### Interfaces
8+
9+
- [ERClassComponent](interfaces/ERClassComponent.md)
10+
- [ERFunctionComponent](interfaces/ERFunctionComponent.md)
11+
- [ERHook](interfaces/ERHook.md)
12+
713
### Type Aliases
814

9-
- [ERClassComponent](README.md#erclasscomponent)
1015
- [ERClassComponentFlag](README.md#erclasscomponentflag)
1116
- [ERComponent](README.md#ercomponent)
1217
- [ERComponentCollectorHint](README.md#ercomponentcollectorhint)
1318
- [ERComponentInitPath](README.md#ercomponentinitpath)
1419
- [ERComponentKind](README.md#ercomponentkind)
15-
- [ERFunctionComponent](README.md#erfunctioncomponent)
1620
- [ERFunctionComponentFlag](README.md#erfunctioncomponentflag)
17-
- [ERHook](README.md#erhook)
1821

1922
### Variables
2023

@@ -78,25 +81,6 @@
7881

7982
## Type Aliases
8083

81-
### ERClassComponent
82-
83-
Ƭ **ERClassComponent**: `Object`
84-
85-
#### Type declaration
86-
87-
| Name | Type |
88-
| :------------ | :--------------------------------------------------------------- |
89-
| `_` | `string` |
90-
| `displayName` | `O.Option`\<`TSESTree.Expression`\> |
91-
| `flag` | [`ERClassComponentFlag`](README.md#erclasscomponentflag-1) |
92-
| `id` | `O.Option`\<`TSESTree.Identifier`\> |
93-
| `kind` | `"class"` |
94-
| `methods` | (`TSESTree.MethodDefinition` \| `TSESTree.PropertyDefinition`)[] |
95-
| `name` | `O.Option`\<`string`\> |
96-
| `node` | `TSESTreeClass` |
97-
98-
---
99-
10084
### ERClassComponentFlag
10185

10286
Ƭ **ERClassComponentFlag**: `bigint`
@@ -105,7 +89,7 @@
10589

10690
### ERComponent
10791

108-
Ƭ **ERComponent**: [`ERClassComponent`](README.md#erclasscomponent) \| [`ERFunctionComponent`](README.md#erfunctioncomponent)
92+
Ƭ **ERComponent**: [`ERClassComponent`](interfaces/ERClassComponent.md) \| [`ERFunctionComponent`](interfaces/ERFunctionComponent.md)
10993

11094
---
11195

@@ -127,47 +111,10 @@
127111

128112
---
129113

130-
### ERFunctionComponent
131-
132-
Ƭ **ERFunctionComponent**: `Object`
133-
134-
#### Type declaration
135-
136-
| Name | Type |
137-
| :------------ | :------------------------------------------------------------------- |
138-
| `_` | `string` |
139-
| `displayName` | `O.Option`\<`TSESTree.Expression`\> |
140-
| `flag` | [`ERFunctionComponentFlag`](README.md#erfunctioncomponentflag-1) |
141-
| `hint` | [`ERComponentCollectorHint`](README.md#ercomponentcollectorhint-1) |
142-
| `hookCalls` | `TSESTree.CallExpression`[] |
143-
| `id` | `O.Option`\<`TSESTree.Identifier` \| `TSESTree.Identifier`[]\> |
144-
| `initPath` | `O.Option`\<[`ERComponentInitPath`](README.md#ercomponentinitpath)\> |
145-
| `kind` | `"function"` |
146-
| `name` | `O.Option`\<`string`\> |
147-
| `node` | `TSESTreeFunction` |
148-
149-
---
150-
151114
### ERFunctionComponentFlag
152115

153116
Ƭ **ERFunctionComponentFlag**: `bigint`
154117

155-
---
156-
157-
### ERHook
158-
159-
Ƭ **ERHook**: `Object`
160-
161-
#### Type declaration
162-
163-
| Name | Type |
164-
| :---------- | :-------------------------- |
165-
| `_` | `string` |
166-
| `hookCalls` | `TSESTree.CallExpression`[] |
167-
| `id` | `TSESTree.Identifier` |
168-
| `name` | `string` |
169-
| `node` | `TSESTreeFunction` |
170-
171118
## Variables
172119

173120
### DEFAULT\_COMPONENT\_COLLECTOR\_HINT
@@ -262,7 +209,7 @@ hints for component collector
262209

263210
| Name | Type |
264211
| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
265-
| `ctx` | \{ `getCurrentFunction`: () => `Option`\<[`TSESTreeFunction`, `boolean`, `CallExpression`[]]\> ; `getAllComponents`: (`_`: `Program`) => `Map`\<`string`, [`ERFunctionComponent`](README.md#erfunctioncomponent)\> ; `getCurrentComponents`: () => `Map`\<`string`, [`ERFunctionComponent`](README.md#erfunctioncomponent)\> ; `getCurrentFunctionStack`: () => [`TSESTreeFunction`, `boolean`, `CallExpression`[]][] } |
212+
| `ctx` | \{ `getCurrentFunction`: () => `Option`\<[`TSESTreeFunction`, `boolean`, `CallExpression`[]]\> ; `getAllComponents`: (`_`: `Program`) => `Map`\<`string`, [`ERFunctionComponent`](interfaces/ERFunctionComponent.md)\> ; `getCurrentComponents`: () => `Map`\<`string`, [`ERFunctionComponent`](interfaces/ERFunctionComponent.md)\> ; `getCurrentFunctionStack`: () => [`TSESTreeFunction`, `boolean`, `CallExpression`[]][] } |
266213
| `ctx.getCurrentFunction` | () => `Option`\<[`TSESTreeFunction`, `boolean`, `CallExpression`[]]\> |
267214
| `ctx.getAllComponents` | [object Object] |
268215
| `ctx.getCurrentComponents` | [object Object] |
@@ -291,14 +238,14 @@ hints for component collector
291238

292239
`Object`
293240

294-
| Name | Type |
295-
| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
296-
| `ctx` | \{ `getAllComponents`: (`_`: `Program`) => `Map`\<`string`, [`ERClassComponent`](README.md#erclasscomponent)\> ; `getCurrentComponents`: () => `Map`\<`string`, [`ERClassComponent`](README.md#erclasscomponent)\> } |
297-
| `ctx.getAllComponents` | [object Object] |
298-
| `ctx.getCurrentComponents` | [object Object] |
299-
| `listeners` | \{ `ClassDeclaration`: (`node`: `TSESTreeClass`) => `void` = collect; `ClassExpression`: (`node`: `TSESTreeClass`) => `void` = collect } |
300-
| `listeners.ClassDeclaration` | (`node`: `TSESTreeClass`) => `void` |
301-
| `listeners.ClassExpression` | (`node`: `TSESTreeClass`) => `void` |
241+
| Name | Type |
242+
| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
243+
| `ctx` | \{ `getAllComponents`: (`_`: `Program`) => `Map`\<`string`, [`ERClassComponent`](interfaces/ERClassComponent.md)\> ; `getCurrentComponents`: () => `Map`\<`string`, [`ERClassComponent`](interfaces/ERClassComponent.md)\> } |
244+
| `ctx.getAllComponents` | [object Object] |
245+
| `ctx.getCurrentComponents` | [object Object] |
246+
| `listeners` | \{ `ClassDeclaration`: (`node`: `TSESTreeClass`) => `void` = collect; `ClassExpression`: (`node`: `TSESTreeClass`) => `void` = collect } |
247+
| `listeners.ClassDeclaration` | (`node`: `TSESTreeClass`) => `void` |
248+
| `listeners.ClassExpression` | (`node`: `TSESTreeClass`) => `void` |
302249

303250
---
304251

@@ -426,12 +373,12 @@ It will be removed in the future
426373

427374
`Object`
428375

429-
| Name | Type |
430-
| :-------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
431-
| `ctx` | \{ `getAllHooks`: (`_`: `Program`) => `Map`\<`string`, [`ERHook`](README.md#erhook)\> ; `getCurrentHooks`: () => `Map`\<`string`, [`ERHook`](README.md#erhook)\> } |
432-
| `ctx.getAllHooks` | [object Object] |
433-
| `ctx.getCurrentHooks` | [object Object] |
434-
| `listeners` | `ESLintUtils.RuleListener` |
376+
| Name | Type |
377+
| :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
378+
| `ctx` | \{ `getAllHooks`: (`_`: `Program`) => `Map`\<`string`, [`ERHook`](interfaces/ERHook.md)\> ; `getCurrentHooks`: () => `Map`\<`string`, [`ERHook`](interfaces/ERHook.md)\> } |
379+
| `ctx.getAllHooks` | [object Object] |
380+
| `ctx.getCurrentHooks` | [object Object] |
381+
| `listeners` | `ESLintUtils.RuleListener` |
435382

436383
---
437384

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[@eslint-react/core](../README.md) / ERClassComponent
2+
3+
# Interface: ERClassComponent
4+
5+
## Table of contents
6+
7+
### Properties
8+
9+
- [\_](ERClassComponent.md#_)
10+
- [displayName](ERClassComponent.md#displayname)
11+
- [flag](ERClassComponent.md#flag)
12+
- [id](ERClassComponent.md#id)
13+
- [kind](ERClassComponent.md#kind)
14+
- [methods](ERClassComponent.md#methods)
15+
- [name](ERClassComponent.md#name)
16+
- [node](ERClassComponent.md#node)
17+
18+
## Properties
19+
20+
### \_
21+
22+
**\_**: `string`
23+
24+
---
25+
26+
### displayName
27+
28+
**displayName**: `Option`\<`Expression`\>
29+
30+
---
31+
32+
### flag
33+
34+
**flag**: `bigint`
35+
36+
---
37+
38+
### id
39+
40+
**id**: `Option`\<`Identifier`\>
41+
42+
---
43+
44+
### kind
45+
46+
**kind**: `"class"`
47+
48+
---
49+
50+
### methods
51+
52+
**methods**: (`MethodDefinition` \| `PropertyDefinition`)[]
53+
54+
---
55+
56+
### name
57+
58+
**name**: `Option`\<`string`\>
59+
60+
---
61+
62+
### node
63+
64+
**node**: `TSESTreeClass`
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[@eslint-react/core](../README.md) / ERFunctionComponent
2+
3+
# Interface: ERFunctionComponent
4+
5+
## Table of contents
6+
7+
### Properties
8+
9+
- [\_](ERFunctionComponent.md#_)
10+
- [displayName](ERFunctionComponent.md#displayname)
11+
- [flag](ERFunctionComponent.md#flag)
12+
- [hint](ERFunctionComponent.md#hint)
13+
- [hookCalls](ERFunctionComponent.md#hookcalls)
14+
- [id](ERFunctionComponent.md#id)
15+
- [initPath](ERFunctionComponent.md#initpath)
16+
- [kind](ERFunctionComponent.md#kind)
17+
- [name](ERFunctionComponent.md#name)
18+
- [node](ERFunctionComponent.md#node)
19+
20+
## Properties
21+
22+
### \_
23+
24+
**\_**: `string`
25+
26+
---
27+
28+
### displayName
29+
30+
**displayName**: `Option`\<`Expression`\>
31+
32+
---
33+
34+
### flag
35+
36+
**flag**: `bigint`
37+
38+
---
39+
40+
### hint
41+
42+
**hint**: `bigint`
43+
44+
---
45+
46+
### hookCalls
47+
48+
**hookCalls**: `CallExpression`[]
49+
50+
---
51+
52+
### id
53+
54+
**id**: `Option`\<`Identifier` \| `Identifier`[]\>
55+
56+
---
57+
58+
### initPath
59+
60+
**initPath**: `Option`\<[`ERComponentInitPath`](../README.md#ercomponentinitpath)\>
61+
62+
---
63+
64+
### kind
65+
66+
**kind**: `"function"`
67+
68+
---
69+
70+
### name
71+
72+
**name**: `Option`\<`string`\>
73+
74+
---
75+
76+
### node
77+
78+
**node**: `TSESTreeFunction`
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[@eslint-react/core](../README.md) / ERHook
2+
3+
# Interface: ERHook
4+
5+
## Table of contents
6+
7+
### Properties
8+
9+
- [\_](ERHook.md#_)
10+
- [hookCalls](ERHook.md#hookcalls)
11+
- [id](ERHook.md#id)
12+
- [name](ERHook.md#name)
13+
- [node](ERHook.md#node)
14+
15+
## Properties
16+
17+
### \_
18+
19+
**\_**: `string`
20+
21+
---
22+
23+
### hookCalls
24+
25+
**hookCalls**: `CallExpression`[]
26+
27+
---
28+
29+
### id
30+
31+
**id**: `Identifier`
32+
33+
---
34+
35+
### name
36+
37+
**name**: `string`
38+
39+
---
40+
41+
### node
42+
43+
**node**: `TSESTreeFunction`

0 commit comments

Comments
 (0)