Skip to content

Commit 5ce269f

Browse files
authored
refactor: add utils package (#227)
1 parent 9807377 commit 5ce269f

File tree

84 files changed

+604
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+604
-463
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ ESLint React does not accept contributions of a purely utilitarian nature.
5858

5959
- `@eslint-react/tools`: Std library and primitives.
6060
- `@eslint-react/types`: Type definitions.
61-
- `@eslint-react/shared`: Shared constants and utilities.
61+
- `@eslint-react/shared`: Shared data and constants.
62+
- `@eslint-react/utils`: Utilities for ESLint React.
6263
- `@eslint-react/ast`: TSESTree AST primitive utility module.
6364
- `@eslint-react/jsx`: TSESTree AST utility module for static analysis of JSX.
6465
- `@eslint-react/core`: ESLint utility module for static analysis of React core API and Patterns.

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## v0.9.7-beta.1 (Draft)
2+
3+
### Release Notes
4+
5+
---
6+
7+
#### 🏠 Internal
8+
9+
- `@eslint-react/shared`
10+
- Move utils from `@eslint-react/shared` to `@eslint-react/utils`.
11+
12+
- `@eslint-react/monorepo`
13+
- Add `@eslint-react/utils` package.
14+
15+
#### Authors: 1
16+
17+
- Eva1ent ([@Rel1cx](https://github.com/Rel1cx))
18+
19+
---
20+
121
## v0.9.7-beta.0 (Thu Dec 14 2023)
222

323
### Release Notes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.7-beta.0
1+
0.9.7-beta.1

examples/with-flat-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "with-flat-config",
3-
"version": "0.9.7-beta.0",
3+
"version": "0.9.7-beta.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

examples/with-legacy-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "with-legacy-config",
3-
"version": "0.9.7-beta.0",
3+
"version": "0.9.7-beta.1",
44
"private": true,
55
"scripts": {
66
"build": "tsc && vite build",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/monorepo",
3-
"version": "0.9.7-beta.0",
3+
"version": "0.9.7-beta.1",
44
"description": "ESLint React's monorepo. More than 50 ESLint rules to catch common mistakes and improve your React code. Built (mostly) from scratch.",
55
"keywords": [
66
"eslint",

packages/ast/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/ast",
3-
"version": "0.9.7-beta.0",
3+
"version": "0.9.7-beta.1",
44
"description": "ESLint React's TSESTree AST primitive utility module.",
55
"homepage": "https://github.com/rel1cx/eslint-react",
66
"bugs": {

packages/ast/src/construction/construction-detector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { RuleContext } from "@eslint-react/shared";
21
import { Data, M, O, P } from "@eslint-react/tools";
2+
import type * as ER from "@eslint-react/types";
33
import { DefinitionType } from "@typescript-eslint/scope-manager";
44
import type { TSESTree } from "@typescript-eslint/types";
55
import { isNil } from "rambda";
@@ -59,7 +59,7 @@ const None = Construction.None();
5959
* @param context The rule context
6060
* @returns A function that detects the construction of a given node
6161
*/
62-
export function constructionDetector<T extends RuleContext>(context: T): (node: TSESTree.Node) => Construction {
62+
export function constructionDetector<T extends ER.RuleContext>(context: T): (node: TSESTree.Node) => Construction {
6363
/**
6464
* Detect if a node is a constructed value.
6565
* @param node The AST node to detect the construction of

packages/core/docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ It will be removed in the future
614614

615615
### isMemberExpressionOfReactMember
616616

617-
**isMemberExpressionOfReactMember**(`pragmaMemberName`, `memberName`): (`node`: `TSESTree.MemberExpression`, `context`: `RuleContext`, `pragma?`: `string`) => `boolean`
617+
**isMemberExpressionOfReactMember**(`pragmaMemberName`, `memberName`): (`node`: `TSESTree.MemberExpression`, `context`: `ER.RuleContext`, `pragma?`: `string`) => `boolean`
618618

619619
#### Parameters
620620

@@ -634,7 +634,7 @@ It will be removed in the future
634634
| Name | Type |
635635
| :-------- | :-------------------------- |
636636
| `node` | `TSESTree.MemberExpression` |
637-
| `context` | `RuleContext` |
637+
| `context` | `ER.RuleContext` |
638638
| `pragma?` | `string` |
639639

640640
##### Returns

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/core",
3-
"version": "0.9.7-beta.0",
3+
"version": "0.9.7-beta.1",
44
"description": "ESLint React's ESLint utility module for static analysis of React core API and Patterns.",
55
"homepage": "https://github.com/rel1cx/eslint-react",
66
"bugs": {
@@ -47,6 +47,7 @@
4747
"@eslint-react/shared": "workspace:*",
4848
"@eslint-react/tools": "workspace:*",
4949
"@eslint-react/types": "workspace:*",
50+
"@eslint-react/utils": "workspace:*",
5051
"@typescript-eslint/scope-manager": "6.14.0",
5152
"@typescript-eslint/type-utils": "6.14.0",
5253
"@typescript-eslint/types": "6.14.0",

0 commit comments

Comments
 (0)