aws / aws/aws-appsync-community
[@aws-appsync/eslint-plugin] Missing Rules (date, callback, query object)
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
Similar to: https://github.com/aws/aws-appsync-community/issues/337
I have discovered some additional gaps in the current aws-appsync eslint plugin that if they would have existed, would have saved me a ton of investigation time.
- Do not allow "Date" `new Date(1234)` should use utils.time instead
- Do not allow passing callback functions `myFunc(things, (x) =>x.data)`
- I don't have a clear example to share, but I was trying to build up a sort key query condition and got the following error:
```
Ln 225, Col 46 Property 'eq' is missing in type '{ between: string[]; }' but required in type '{ eq: string; }'.
Ln 226, Col 32 Property 'eq' is missing in type '{ ge: string; }' but required in type '{ eq: string; }'.
Ln 227, Col 30 Property 'eq' is missing in type '{ le: string; }' but required in type '{ eq: string; }'.
Ln 228, Col 10 Property 'eq' is missing in type '{ beginsWith: string; }' but required in type '{ eq: string; }'.
Ln 229, Col 35 Property 'eq' is missing in type '{ beginsWith: string; }' but required in type '{ eq: string; }'.
```
The the explanation given by AI was
```
AppSync's type validator expects a consistent structure for the query object. When you dynamically add properties with different operator types (between, ge, le, beginsWith), it conflicts with the initial eq operator structure.
```
Contributor guide
Research direction
Start by reviewing the existing aws-appsync ESLint plugin and the related issue 337. The request covers rules for Date construction and callback arguments, plus a query-object typing problem, but names no files or tests. Done should define the intended behavior for each gap and include coverage for the agreed cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100