Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(eslint-plugin): add docs for signal-state-no-arrays-at-root-level #4549

Merged

Conversation

iErKy
Copy link
Contributor

@iErKy iErKy commented Oct 3, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #4501

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x ] No

Other information

Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 29f9475
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/66fef72fc7601b0008ddf4a4
😎 Deploy Preview https://deploy-preview-4549--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @iErKy .
You can ignore the failing build, this is something not related to this PR.


## Rule Details

This rule ensure that a Signal State shouldn't accept an array type at root level.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This rule ensure that a Signal State shouldn't accept an array type at root level.
This rule ensure that a Signal State shouldn't accept an array type at the root level.

```ts
const store = withState({ foo: 'bar' })
```
```ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting:

Suggested change
```ts
```ts

Comment on lines 30 to 42
```ts
const store = withState([1, 2, 3]);
```
```ts
const store = withState([{ foo: 'bar' }]);
```
```ts
const store = withState<string[]>([]);
```
```ts
const initialState = [];
const store = withState(initialState);
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting:

Suggested change
```ts
const store = withState([1, 2, 3]);
```
```ts
const store = withState([{ foo: 'bar' }]);
```
```ts
const store = withState<string[]>([]);
```
```ts
const initialState = [];
const store = withState(initialState);
```
```ts
const store = withState([1, 2, 3]);
const store = withState([{ foo: 'bar' }]);
const store = withState<string[]>([]);
const initialState = [];
const store = withState(initialState);

@iErKy
Copy link
Contributor Author

iErKy commented Oct 3, 2024

@timdeschryver will fix comments and push changes.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @iErKy

@brandonroberts brandonroberts merged commit 806c1d1 into ngrx:main Oct 9, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for the ESLint rule signal-state-no-arrays-at-root-level
3 participants