Closed nwhittaker closed 3 months ago
0.7.2
Given a mutable prop @Prop({ mutable: true }) that is mutated somewhere within the component, the strict-mutable rule:
@Prop({ mutable: true })
strict-mutable
The rule passes regardless of where the prop is mutated relative to where the prop is defined in the code file.
npm i
npm run lint
error @Prop() "fullName" should not be mutable @stencil-community/strict-mutable
src/components/my-component/my-component.tsx
@Prop({ mutable: true }) fullName: string;
[1] https://github.com/nwhittaker/stencil-component/tree/%40stencil-community/eslint-plugin/strict-mutable
https://github.com/nwhittaker/stencil-component/tree/%40stencil-community/eslint-plugin/strict-mutable
No response
Prerequisites
Stencil ESLint Version
0.7.2
Current Behavior
Given a mutable prop
@Prop({ mutable: true })
that is mutated somewhere within the component, thestrict-mutable
rule:Expected Behavior
The rule passes regardless of where the prop is mutated relative to where the prop is defined in the code file.
Steps to Reproduce
npm i
.npm run lint
. Should fail with:src/components/my-component/my-component.tsx
file.@Prop({ mutable: true }) fullName: string;
line to above line 25.npm run lint
. Should pass.[1] https://github.com/nwhittaker/stencil-component/tree/%40stencil-community/eslint-plugin/strict-mutable
Code Reproduction URL
https://github.com/nwhittaker/stencil-component/tree/%40stencil-community/eslint-plugin/strict-mutable
Additional Information
No response