-
-
Notifications
You must be signed in to change notification settings - Fork 35
bug: strict-mutable rule impacted by order of source code #111
Copy link
Copy link
Closed
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil ESLint Version
0.7.2
Current Behavior
Given a mutable prop @Prop({ mutable: true }) that is mutated somewhere within the component, the strict-mutable rule:
- Will pass if the prop is mutated at a line in the code file below the line where the prop is defined.
- Will not pass if the prop is mutated at a line above the line where the prop is defined.
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
- Visit the reproduction repo and checkout the [@stencil-community/eslint-plugin/strict-mutable[1] branch.
- Run
npm i. - Run
npm run lint. Should fail with:error @Prop() "fullName" should not be mutable @stencil-community/strict-mutable - Open the
src/components/my-component/my-component.tsxfile. - Move the
@Prop({ mutable: true }) fullName: string;line to above line 25. - Run
npm run lint. Should pass.
Code Reproduction URL
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels