oxlint-appsync 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Oxlint (and ESLint-compatible) plugin that enforces [AWS AppSync JavaScript runtime restrictions](https://docs.aws.amazon.com/appsync/latest/devguide/supported-features.html).
4
4
 
5
- Use it to catch unsupported syntax in AppSync resolver code before deployment. See [docs/code-generation-appsync.md](docs/code-generation-appsync.md) for the project-specific summary of limitations.
5
+ Use it to catch unsupported syntax in AppSync resolver code before deployment.
6
6
 
7
7
  ## Install
8
8
 
@@ -71,47 +71,75 @@ export default [
71
71
 
72
72
  ## Rules
73
73
 
74
- | Rule | Description |
75
- | ------------------------------- | ------------------------------------------------------------------------------------------------ |
76
- | `appsync/no-global-constructor` | Disallow global constructor calls (`String()`, `Number()`, `Boolean()`, `Date()`, etc.) |
77
- | `appsync/no-async-await` | Disallow `async`/`await` and async functions |
78
- | `appsync/no-classes` | Disallow `class` declarations and expressions |
79
- | `appsync/no-instanceof` | Disallow `instanceof` |
80
- | `appsync/no-for-loop` | Disallow C-style `for` loops (`for-in` / `for-of` allowed) |
81
- | `appsync/no-while` | Disallow `while` loops |
82
- | `appsync/no-do-while` | Disallow `do-while` loops |
83
- | `appsync/no-try` | Disallow `try`/`catch`/`finally` |
84
- | `appsync/no-throw` | Disallow `throw` |
85
- | `appsync/no-continue` | Disallow `continue` |
86
- | `appsync/no-labeled-statement` | Disallow labeled statements |
87
- | `appsync/no-new` | Disallow the `new` operator |
88
- | `appsync/no-generators` | Disallow generator functions |
89
- | `appsync/no-this` | Disallow `this` |
90
- | `appsync/no-update-operators` | Disallow `++` and `--` |
91
- | `appsync/no-bitwise-not` | Disallow bitwise NOT (`~`) |
92
- | `appsync/no-in-operator` | Disallow `in` (use `Object.hasOwn`) |
93
- | `appsync/no-function-arguments` | Disallow passing function references as call arguments (inline arrow callbacks are allowed) |
94
- | `appsync/no-appsync-globals` | Disallow AppSync-only globals (`util`, `extensions`, `runtime`) — opt-in, included in `portable` |
74
+ | Rule | Description |
75
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
76
+ | `appsync/no-global-constructor` | Disallow global constructor calls (`String()`, `Number()`, `Boolean()`, `Date()`, etc.) |
77
+ | `appsync/no-async-await` | Disallow `async`/`await` and async functions |
78
+ | `appsync/no-classes` | Disallow `class` declarations and expressions |
79
+ | `appsync/no-context-reassignment` | Disallow reassigning `context` and its base properties |
80
+ | `appsync/no-instanceof` | Disallow `instanceof` |
81
+ | `appsync/no-for-loop` | Disallow C-style `for` loops (`for-in` / `for-of` allowed) |
82
+ | `appsync/no-while` | Disallow `while` loops |
83
+ | `appsync/no-do-while` | Disallow `do-while` loops |
84
+ | `appsync/no-disallowed-methods` | Disallow unsupported methods (`call`, `apply`, `bind`) |
85
+ | `appsync/no-try` | Disallow `try`/`catch`/`finally` |
86
+ | `appsync/no-throw` | Disallow `throw` |
87
+ | `appsync/no-continue` | Disallow `continue` |
88
+ | `appsync/no-labeled-statement` | Disallow labeled statements |
89
+ | `appsync/no-new` | Disallow the `new` operator |
90
+ | `appsync/no-regex` | Disallow regex literals (`/pattern/`) |
91
+ | `appsync/no-promise` | Disallow `Promise` usage |
92
+ | `appsync/no-recursion` | Disallow recursive function calls |
93
+ | `appsync/no-generators` | Disallow generator functions |
94
+ | `appsync/no-this` | Disallow `this` |
95
+ | `appsync/no-update-operators` | Disallow `++` and `--` |
96
+ | `appsync/no-bitwise-not` | Disallow bitwise NOT (`~`) |
97
+ | `appsync/no-in-operator` | Disallow `in` (use `Object.hasOwn`) |
98
+ | `appsync/no-function-arguments` | Disallow passing functions as call arguments (parity with AWS `no-function-passing`; inline arrows allowed only on allowlisted Array methods like `map`, `filter`) |
99
+ | `appsync/no-function-reassign` | Disallow reassigning function variables |
100
+ | `appsync/no-function-return` | Disallow returning functions from functions |
101
+ | `appsync/no-appsync-globals` | Disallow AppSync-only globals (`util`, `extensions`, `runtime`) — opt-in, included in `portable` |
95
102
 
96
103
  ## Migration
97
104
 
105
+ ### 0.3.1 → 0.4.0
106
+
107
+ Seven new rules are enabled in the `recommended` and `portable` presets for parity with `@aws-appsync/eslint-plugin`:
108
+
109
+ - `appsync/no-regex` — regex literals (`/pattern/`) are not supported; use string patterns for `replace`, `split`, etc.
110
+ - `appsync/no-promise` — `Promise` usage is not supported.
111
+ - `appsync/no-context-reassignment` — reassigning `context` or its base properties is not supported.
112
+ - `appsync/no-disallowed-methods` — `call`, `apply`, and `bind` are not supported.
113
+ - `appsync/no-recursion` — recursive function calls are not supported.
114
+ - `appsync/no-function-reassign` — reassigning function variables is not supported.
115
+ - `appsync/no-function-return` — returning functions from functions is not supported.
116
+
117
+ ### 0.3.0 → 0.3.1
118
+
119
+ `appsync/no-function-arguments` now matches AWS `no-function-passing` more closely:
120
+
121
+ - Inline arrow functions are allowed only on allowlisted `Array` methods (`map`, `filter`, `find`, `some`, `every`, `reduce`, and similar).
122
+ - `Array.prototype.sort()` with a comparator (inline or by reference) is reported.
123
+ - Passing arrow functions to non-allowlisted calls (e.g. `run(() => 1)`) is reported.
124
+
98
125
  ### 0.1.x → 0.2.0
99
126
 
100
127
  `appsync/no-string-constructor` was removed. Use `appsync/no-global-constructor` instead — it covers `String()` and other global constructor calls (`Boolean()`, `Number()`, `Date()`, etc.).
101
128
 
102
129
  ## Development
103
130
 
131
+ Requires [Bun](https://bun.sh/).
132
+
104
133
  ```bash
105
- npm install
106
- npm run build
107
- npm test
134
+ bun install
135
+ bun run build
136
+ bun test
108
137
  ```
109
138
 
110
139
  ## References
111
140
 
112
141
  - [Writing Oxlint JS plugins](https://oxc.rs/docs/guide/usage/linter/writing-js-plugins.html)
113
142
  - [AWS AppSync supported runtime features](https://docs.aws.amazon.com/appsync/latest/devguide/supported-features.html)
114
- - [Project AppSync code generation rules](docs/code-generation-appsync.md)
115
143
 
116
144
  ## License
117
145
 
package/dist/index.d.ts CHANGED
@@ -1,33 +1,33 @@
1
1
  import * as _oxlint_plugins0 from "@oxlint/plugins";
2
- import { Rule } from "eslint";
3
2
 
4
- //#region src/rules/types.d.ts
5
- type AppsyncRuleModule = {
6
- meta: Rule.RuleMetaData;
7
- createOnce: (context: Rule.RuleContext) => Rule.RuleListener;
8
- };
9
- //#endregion
10
3
  //#region src/rules/index.d.ts
11
4
  declare const rules: {
12
- "no-appsync-globals": AppsyncRuleModule;
13
- "no-async-await": AppsyncRuleModule;
14
- "no-bitwise-not": AppsyncRuleModule;
15
- "no-classes": AppsyncRuleModule;
16
- "no-continue": AppsyncRuleModule;
17
- "no-do-while": AppsyncRuleModule;
18
- "no-for-loop": AppsyncRuleModule;
19
- "no-function-arguments": AppsyncRuleModule;
20
- "no-generators": AppsyncRuleModule;
21
- "no-in-operator": AppsyncRuleModule;
22
- "no-instanceof": AppsyncRuleModule;
23
- "no-labeled-statement": AppsyncRuleModule;
24
- "no-new": AppsyncRuleModule;
25
- "no-global-constructor": AppsyncRuleModule;
26
- "no-this": AppsyncRuleModule;
27
- "no-throw": AppsyncRuleModule;
28
- "no-try": AppsyncRuleModule;
29
- "no-update-operators": AppsyncRuleModule;
30
- "no-while": AppsyncRuleModule;
5
+ "no-appsync-globals": _oxlint_plugins0.CreateOnceRule;
6
+ "no-async-await": _oxlint_plugins0.CreateOnceRule;
7
+ "no-bitwise-not": _oxlint_plugins0.CreateOnceRule;
8
+ "no-classes": _oxlint_plugins0.CreateOnceRule;
9
+ "no-context-reassignment": _oxlint_plugins0.CreateOnceRule;
10
+ "no-continue": _oxlint_plugins0.CreateOnceRule;
11
+ "no-do-while": _oxlint_plugins0.CreateOnceRule;
12
+ "no-disallowed-methods": _oxlint_plugins0.CreateOnceRule;
13
+ "no-for-loop": _oxlint_plugins0.CreateOnceRule;
14
+ "no-function-arguments": _oxlint_plugins0.CreateOnceRule;
15
+ "no-function-reassign": _oxlint_plugins0.CreateOnceRule;
16
+ "no-function-return": _oxlint_plugins0.CreateOnceRule;
17
+ "no-generators": _oxlint_plugins0.CreateOnceRule;
18
+ "no-in-operator": _oxlint_plugins0.CreateOnceRule;
19
+ "no-instanceof": _oxlint_plugins0.CreateOnceRule;
20
+ "no-labeled-statement": _oxlint_plugins0.CreateOnceRule;
21
+ "no-new": _oxlint_plugins0.CreateOnceRule;
22
+ "no-promise": _oxlint_plugins0.CreateOnceRule;
23
+ "no-recursion": _oxlint_plugins0.CreateOnceRule;
24
+ "no-regex": _oxlint_plugins0.CreateOnceRule;
25
+ "no-global-constructor": _oxlint_plugins0.CreateOnceRule;
26
+ "no-this": _oxlint_plugins0.CreateOnceRule;
27
+ "no-throw": _oxlint_plugins0.CreateOnceRule;
28
+ "no-try": _oxlint_plugins0.CreateOnceRule;
29
+ "no-update-operators": _oxlint_plugins0.CreateOnceRule;
30
+ "no-while": _oxlint_plugins0.CreateOnceRule;
31
31
  };
32
32
  //#endregion
33
33
  //#region src/plugin.d.ts
@@ -38,15 +38,22 @@ declare const portable: {
38
38
  readonly "appsync/no-async-await": "error";
39
39
  readonly "appsync/no-bitwise-not": "error";
40
40
  readonly "appsync/no-classes": "error";
41
+ readonly "appsync/no-context-reassignment": "error";
41
42
  readonly "appsync/no-continue": "error";
42
43
  readonly "appsync/no-do-while": "error";
44
+ readonly "appsync/no-disallowed-methods": "error";
43
45
  readonly "appsync/no-for-loop": "error";
44
46
  readonly "appsync/no-function-arguments": "error";
47
+ readonly "appsync/no-function-reassign": "error";
48
+ readonly "appsync/no-function-return": "error";
45
49
  readonly "appsync/no-generators": "error";
46
50
  readonly "appsync/no-in-operator": "error";
47
51
  readonly "appsync/no-instanceof": "error";
48
52
  readonly "appsync/no-labeled-statement": "error";
49
53
  readonly "appsync/no-new": "error";
54
+ readonly "appsync/no-promise": "error";
55
+ readonly "appsync/no-recursion": "error";
56
+ readonly "appsync/no-regex": "error";
50
57
  readonly "appsync/no-global-constructor": "error";
51
58
  readonly "appsync/no-this": "error";
52
59
  readonly "appsync/no-throw": "error";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rules/types.ts","../src/rules/index.ts","../src/plugin.ts"],"mappings":";;;;KAEY,iBAAA;QACJ,IAAA,CAAK;wBACW,IAAA,CAAK,gBAAgB,IAAA,CAAK;AAFlD,CAAA;;;cCmBM;;;EDnBM,gBAAA,mBAAiB;EAAA,YAAA,mBAAA;eAChB,mBAAA;eACgB,mBAAA;eAAqB,mBAAA;EAAY,uBAAA,mBAAA;;;;ECiBxD,sBAoBuC,mBAAA;EAAA,QAAA,mBAAA;;;;;;;;;;cCpChC,QAKX,gBAAA,CALiB;cAON,aAIR,kBAAkB,qBAAqB;cAE/B;EFhBD,SAAA,4BAAiB,EAAA,OAAA;EAAA,SAAA,wBAAA,EAAA,OAAA;WAChB,wBAAA,EAAA,OAAA;WACgB,oBAAA,EAAA,OAAA;WAAqB,qBAAA,EAAA,OAAA;EAAY,SAAA,qBAAA,EAAA,OAAA;;;;ECiBxD,SAoBuC,wBAAA,EAAA,OAAA;EAAA,SAAA,uBAAA,EAAA,OAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rules/index.ts","../src/plugin.ts"],"mappings":";;;cA4BM;wBA2BuC,gBAAA,CAAA;;EA3BvC,gBA2BuC,iCAAA;EAAA,YAAA,iCAAA;EAAA,yBAAA,iCAAA;;;;;;;;;;;;;;;;;;;;;;;;;cClDhC,QAKX,gBAAA,CALiB;cAON,aAIR,kBAAkB,qBAAqB;ADYtC,cCVO,QDqCgC,EAAA;EAAA,SAAA,4BAAA,EAAA,OAAA;EAAA,SAAA,wBAAA,EAAA,OAAA"}
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { eslintCompatPlugin } from "@oxlint/plugins";
2
- //#region src/rules/appsync-globals.ts
2
+ //#region src/lib/appsync-globals.ts
3
3
  const APPSYNC_GLOBAL_NAMES = /* @__PURE__ */ new Set([
4
4
  "util",
5
5
  "extensions",
6
6
  "runtime"
7
7
  ]);
8
8
  //#endregion
9
- //#region src/rules/types.ts
9
+ //#region src/lib/rule-types.ts
10
10
  function defineAppsyncRule(rule) {
11
11
  return rule;
12
12
  }
@@ -57,7 +57,10 @@ var no_appsync_globals_default = defineAppsyncRule({
57
57
  }
58
58
  });
59
59
  //#endregion
60
- //#region src/rules/utils.ts
60
+ //#region src/lib/utils.ts
61
+ function isIdentifier(node, name) {
62
+ return node?.type === "Identifier" && node.name === name;
63
+ }
61
64
  function reportDefault(context, node, messageId = "default") {
62
65
  context.report({
63
66
  node,
@@ -123,6 +126,25 @@ var no_classes_default = defineAppsyncRule({
123
126
  }
124
127
  });
125
128
  //#endregion
129
+ //#region src/rules/no-context-reassignment.ts
130
+ function isContextAssignmentTarget(node) {
131
+ if (isIdentifier(node, "context")) return true;
132
+ return node.type === "MemberExpression" && isIdentifier(node.object, "context");
133
+ }
134
+ var no_context_reassignment_default = defineAppsyncRule({
135
+ meta: {
136
+ type: "problem",
137
+ docs: { description: "Disallow reassigning context and its base properties in AppSync resolvers" },
138
+ messages: { default: "Reassigning context and base properties of context is not supported in the AppSync JS runtime" },
139
+ schema: []
140
+ },
141
+ createOnce(context) {
142
+ return { AssignmentExpression(node) {
143
+ if (isContextAssignmentTarget(node.left)) reportDefault(context, node.left);
144
+ } };
145
+ }
146
+ });
147
+ //#endregion
126
148
  //#region src/rules/no-continue.ts
127
149
  var no_continue_default = defineAppsyncRule({
128
150
  meta: {
@@ -138,6 +160,66 @@ var no_continue_default = defineAppsyncRule({
138
160
  }
139
161
  });
140
162
  //#endregion
163
+ //#region src/lib/disallowed-methods.ts
164
+ const DISALLOWED_METHOD_NAMES = /* @__PURE__ */ new Set([
165
+ "apply",
166
+ "bind",
167
+ "call"
168
+ ]);
169
+ //#endregion
170
+ //#region src/lib/function-utils.ts
171
+ function getMemberPropertyName(property) {
172
+ if (property.type === "Identifier") return property.name;
173
+ if (property.type === "Literal" && typeof property.value === "string") return property.value;
174
+ return null;
175
+ }
176
+ function definitionCreatesFunction(def) {
177
+ if (def.type === "FunctionName") return true;
178
+ if (def.type === "Variable" && def.node.type === "VariableDeclarator") {
179
+ const init = def.node.init;
180
+ if (!init) return false;
181
+ return init.type === "FunctionExpression" || init.type === "ArrowFunctionExpression";
182
+ }
183
+ return false;
184
+ }
185
+ function isFunctionNode(node) {
186
+ return node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
187
+ }
188
+ function isFunctionLikeNode(node, context) {
189
+ if (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") return true;
190
+ if (node.type !== "Identifier") return false;
191
+ return variableHoldsFunction(node.name, context, node);
192
+ }
193
+ function variableHoldsFunction(name, context, referenceNode) {
194
+ let scope = context.sourceCode.getScope(referenceNode);
195
+ while (scope) {
196
+ if (scope.set.get(name)?.defs.some(definitionCreatesFunction)) return true;
197
+ scope = scope.upper;
198
+ }
199
+ return false;
200
+ }
201
+ //#endregion
202
+ //#region src/rules/no-disallowed-methods.ts
203
+ var no_disallowed_methods_default = defineAppsyncRule({
204
+ meta: {
205
+ type: "problem",
206
+ docs: { description: "Disallow unsupported method calls such as call, apply, and bind" },
207
+ messages: { default: "The {{method}}() method is not supported in the AppSync JS runtime" },
208
+ schema: []
209
+ },
210
+ createOnce(context) {
211
+ return { CallExpression(node) {
212
+ if (node.callee.type !== "MemberExpression") return;
213
+ const method = getMemberPropertyName(node.callee.property);
214
+ if (method && DISALLOWED_METHOD_NAMES.has(method)) context.report({
215
+ node,
216
+ messageId: "default",
217
+ data: { method }
218
+ });
219
+ } };
220
+ }
221
+ });
222
+ //#endregion
141
223
  //#region src/rules/no-do-while.ts
142
224
  var no_do_while_default = defineAppsyncRule({
143
225
  meta: {
@@ -168,43 +250,89 @@ var no_for_loop_default = defineAppsyncRule({
168
250
  }
169
251
  });
170
252
  //#endregion
253
+ //#region src/lib/callback-accepting-methods.ts
254
+ const CALLBACK_ACCEPTING_METHODS = /* @__PURE__ */ new Set([
255
+ "map",
256
+ "find",
257
+ "filter",
258
+ "findIndex",
259
+ "findLast",
260
+ "findLastIndex",
261
+ "forEach",
262
+ "reduce",
263
+ "reduceRight",
264
+ "every",
265
+ "some",
266
+ "flatMap"
267
+ ]);
268
+ //#endregion
171
269
  //#region src/rules/no-function-arguments.ts
172
- function definitionCreatesFunction(def) {
173
- if (def.type === "FunctionName") return true;
174
- if (def.type === "Variable" && def.node.type === "VariableDeclarator") {
175
- const init = def.node.init;
176
- if (!init) return false;
177
- return init.type === "FunctionExpression" || init.type === "ArrowFunctionExpression";
178
- }
179
- return false;
270
+ function isCallbackAcceptingCall(callee) {
271
+ if (callee.type !== "MemberExpression") return false;
272
+ const propertyName = getMemberPropertyName(callee.property);
273
+ return propertyName !== null && CALLBACK_ACCEPTING_METHODS.has(propertyName);
180
274
  }
181
- function isFunctionReference(node, context) {
182
- if (node.type === "FunctionExpression") return true;
275
+ function isFunctionLikeArgument(node, context) {
276
+ if (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") return true;
183
277
  if (node.type !== "Identifier") return false;
184
278
  let scope = context.sourceCode.getScope(node);
185
279
  while (scope) {
186
280
  if (scope.set.get(node.name)?.defs.some(definitionCreatesFunction)) return true;
187
- scope = scope.upper;
281
+ scope = scope.upper ?? null;
188
282
  }
189
283
  return false;
190
284
  }
191
285
  var no_function_arguments_default = defineAppsyncRule({
192
286
  meta: {
193
287
  type: "problem",
194
- docs: { description: "Disallow passing function references as call arguments in AppSync resolvers" },
195
- messages: { default: "Passing a function reference as an argument is not supported in the AppSync JS runtime; use an inline arrow function instead" },
288
+ docs: { description: "Disallow passing functions as call arguments except to allowlisted Array methods" },
289
+ messages: { default: "Functions can not be passed as an argument" },
196
290
  schema: []
197
291
  },
198
292
  createOnce(context) {
199
293
  return { CallExpression(node) {
294
+ const allowsCallbacks = isCallbackAcceptingCall(node.callee);
200
295
  for (const argument of node.arguments) {
201
296
  if (argument.type === "SpreadElement") continue;
202
- if (isFunctionReference(argument, context)) reportDefault(context, argument);
297
+ if (argument.type === "ArrowFunctionExpression" && allowsCallbacks) continue;
298
+ if (isFunctionLikeArgument(argument, context)) reportDefault(context, argument);
203
299
  }
204
300
  } };
205
301
  }
206
302
  });
207
303
  //#endregion
304
+ //#region src/rules/no-function-reassign.ts
305
+ var no_function_reassign_default = defineAppsyncRule({
306
+ meta: {
307
+ type: "problem",
308
+ docs: { description: "Disallow reassigning function variables in AppSync resolvers" },
309
+ messages: { default: "Functions cannot be reassigned in the AppSync JS runtime" },
310
+ schema: []
311
+ },
312
+ createOnce(context) {
313
+ return { AssignmentExpression(node) {
314
+ if (node.left.type !== "Identifier") return;
315
+ if (variableHoldsFunction(node.left.name, context, node.left)) reportDefault(context, node.left);
316
+ } };
317
+ }
318
+ });
319
+ //#endregion
320
+ //#region src/rules/no-function-return.ts
321
+ var no_function_return_default = defineAppsyncRule({
322
+ meta: {
323
+ type: "problem",
324
+ docs: { description: "Disallow returning functions from functions in AppSync resolvers" },
325
+ messages: { default: "Functions cannot be the return value of functions in the AppSync JS runtime" },
326
+ schema: []
327
+ },
328
+ createOnce(context) {
329
+ return { ReturnStatement(node) {
330
+ if (!node.argument) return;
331
+ if (isFunctionLikeNode(node.argument, context)) reportDefault(context, node.argument);
332
+ } };
333
+ }
334
+ });
335
+ //#endregion
208
336
  //#region src/rules/no-generators.ts
209
337
  var no_generators_default = defineAppsyncRule({
210
338
  meta: {
@@ -224,7 +352,7 @@ var no_generators_default = defineAppsyncRule({
224
352
  }
225
353
  });
226
354
  //#endregion
227
- //#region src/rules/global-constructors.ts
355
+ //#region src/lib/global-constructors.ts
228
356
  const GLOBAL_CONSTRUCTOR_NAMES = /* @__PURE__ */ new Set([
229
357
  "String",
230
358
  "Boolean",
@@ -257,67 +385,172 @@ var no_global_constructor_default = defineAppsyncRule({
257
385
  }
258
386
  });
259
387
  //#endregion
388
+ //#region src/rules/no-in-operator.ts
389
+ var no_in_operator_default = defineAppsyncRule({
390
+ meta: {
391
+ type: "problem",
392
+ docs: { description: "Disallow the in operator in AppSync resolvers" },
393
+ messages: { default: "The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead" },
394
+ schema: []
395
+ },
396
+ createOnce(context) {
397
+ return { BinaryExpression(node) {
398
+ if (node.operator === "in") reportDefault(context, node);
399
+ } };
400
+ }
401
+ });
402
+ //#endregion
403
+ //#region src/rules/no-instanceof.ts
404
+ var no_instanceof_default = defineAppsyncRule({
405
+ meta: {
406
+ type: "problem",
407
+ docs: { description: "Disallow the instanceof operator in AppSync resolvers" },
408
+ messages: { default: "The instanceof operator is not supported in the AppSync JS runtime" },
409
+ schema: []
410
+ },
411
+ createOnce(context) {
412
+ return { BinaryExpression(node) {
413
+ if (node.operator === "instanceof") reportDefault(context, node);
414
+ } };
415
+ }
416
+ });
417
+ //#endregion
418
+ //#region src/rules/no-labeled-statement.ts
419
+ var no_labeled_statement_default = defineAppsyncRule({
420
+ meta: {
421
+ type: "problem",
422
+ docs: { description: "Disallow labeled statements in AppSync resolvers" },
423
+ messages: { default: "Labeled statements are not supported in the AppSync JS runtime" },
424
+ schema: []
425
+ },
426
+ createOnce(context) {
427
+ return { LabeledStatement(node) {
428
+ reportDefault(context, node);
429
+ } };
430
+ }
431
+ });
432
+ //#endregion
433
+ //#region src/rules/no-new.ts
434
+ var no_new_default = defineAppsyncRule({
435
+ meta: {
436
+ type: "problem",
437
+ docs: { description: "Disallow the new operator in AppSync resolvers" },
438
+ messages: { default: "The new operator is not supported in the AppSync JS runtime" },
439
+ schema: []
440
+ },
441
+ createOnce(context) {
442
+ return { NewExpression(node) {
443
+ reportDefault(context, node);
444
+ } };
445
+ }
446
+ });
447
+ //#endregion
448
+ //#region src/rules/no-promise.ts
449
+ var no_promise_default = defineAppsyncRule({
450
+ meta: {
451
+ type: "problem",
452
+ docs: { description: "Disallow Promise usage in AppSync resolvers" },
453
+ messages: { default: "Promises are not supported in the AppSync JS runtime" },
454
+ schema: []
455
+ },
456
+ createOnce(context) {
457
+ return {
458
+ CallExpression(node) {
459
+ const { callee } = node;
460
+ if (isIdentifier(callee, "Promise") || callee.type === "MemberExpression" && isIdentifier(callee.object, "Promise")) reportDefault(context, node);
461
+ },
462
+ NewExpression(node) {
463
+ if (isIdentifier(node.callee, "Promise")) reportDefault(context, node);
464
+ },
465
+ VariableDeclarator(node) {
466
+ if (node.init && isIdentifier(node.init, "Promise")) reportDefault(context, node.init);
467
+ },
468
+ AssignmentExpression(node) {
469
+ if (isIdentifier(node.right, "Promise")) reportDefault(context, node.right);
470
+ }
471
+ };
472
+ }
473
+ });
474
+ //#endregion
475
+ //#region src/rules/no-recursion.ts
476
+ function getEnclosingBindingNames(node, context) {
477
+ const names = /* @__PURE__ */ new Set();
478
+ if ((node.type === "FunctionDeclaration" || node.type === "FunctionExpression") && node.id?.type === "Identifier") names.add(node.id.name);
479
+ let scope = context.sourceCode.getScope(node).upper;
480
+ while (scope) {
481
+ for (const variable of scope.variables) for (const def of variable.defs) if (def.type === "Variable" && def.node.type === "VariableDeclarator" && def.node.init === node) names.add(variable.name);
482
+ scope = scope.upper;
483
+ }
484
+ return names;
485
+ }
486
+ //#endregion
260
487
  //#region src/rules/index.ts
261
488
  const rules = {
262
489
  "no-appsync-globals": no_appsync_globals_default,
263
490
  "no-async-await": no_async_await_default,
264
491
  "no-bitwise-not": no_bitwise_not_default,
265
492
  "no-classes": no_classes_default,
493
+ "no-context-reassignment": no_context_reassignment_default,
266
494
  "no-continue": no_continue_default,
267
495
  "no-do-while": no_do_while_default,
496
+ "no-disallowed-methods": no_disallowed_methods_default,
268
497
  "no-for-loop": no_for_loop_default,
269
498
  "no-function-arguments": no_function_arguments_default,
499
+ "no-function-reassign": no_function_reassign_default,
500
+ "no-function-return": no_function_return_default,
270
501
  "no-generators": no_generators_default,
271
- "no-in-operator": defineAppsyncRule({
502
+ "no-in-operator": no_in_operator_default,
503
+ "no-instanceof": no_instanceof_default,
504
+ "no-labeled-statement": no_labeled_statement_default,
505
+ "no-new": no_new_default,
506
+ "no-promise": no_promise_default,
507
+ "no-recursion": defineAppsyncRule({
272
508
  meta: {
273
509
  type: "problem",
274
- docs: { description: "Disallow the in operator in AppSync resolvers" },
275
- messages: { default: "The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead" },
510
+ docs: { description: "Disallow recursive function calls in AppSync resolvers" },
511
+ messages: { default: "Recursive function calls are not supported in the AppSync JS runtime" },
276
512
  schema: []
277
513
  },
278
514
  createOnce(context) {
279
- return { BinaryExpression(node) {
280
- if (node.operator === "in") reportDefault(context, node);
281
- } };
515
+ const enclosingBindingNames = [];
516
+ const enterFunction = (node) => {
517
+ if (!isFunctionNode(node)) return;
518
+ enclosingBindingNames.push(getEnclosingBindingNames(node, context));
519
+ };
520
+ const exitFunction = (node) => {
521
+ if (!isFunctionNode(node)) return;
522
+ enclosingBindingNames.pop();
523
+ };
524
+ return {
525
+ FunctionDeclaration: enterFunction,
526
+ "FunctionDeclaration:exit": exitFunction,
527
+ FunctionExpression: enterFunction,
528
+ "FunctionExpression:exit": exitFunction,
529
+ ArrowFunctionExpression: enterFunction,
530
+ "ArrowFunctionExpression:exit": exitFunction,
531
+ CallExpression(node) {
532
+ if (node.callee.type !== "Identifier") return;
533
+ if (enclosingBindingNames[enclosingBindingNames.length - 1]?.has(node.callee.name)) reportDefault(context, node);
534
+ }
535
+ };
282
536
  }
283
537
  }),
284
- "no-instanceof": defineAppsyncRule({
538
+ "no-regex": defineAppsyncRule({
285
539
  meta: {
286
540
  type: "problem",
287
- docs: { description: "Disallow the instanceof operator in AppSync resolvers" },
288
- messages: { default: "The instanceof operator is not supported in the AppSync JS runtime" },
541
+ docs: { description: "Disallow regex literals in AppSync resolvers" },
542
+ messages: { default: "Regex literals are not supported in the AppSync JS runtime" },
289
543
  schema: []
290
544
  },
291
545
  createOnce(context) {
292
- return { BinaryExpression(node) {
293
- if (node.operator === "instanceof") reportDefault(context, node);
294
- } };
295
- }
296
- }),
297
- "no-labeled-statement": defineAppsyncRule({
298
- meta: {
299
- type: "problem",
300
- docs: { description: "Disallow labeled statements in AppSync resolvers" },
301
- messages: { default: "Labeled statements are not supported in the AppSync JS runtime" },
302
- schema: []
303
- },
304
- createOnce(context) {
305
- return { LabeledStatement(node) {
306
- reportDefault(context, node);
307
- } };
308
- }
309
- }),
310
- "no-new": defineAppsyncRule({
311
- meta: {
312
- type: "problem",
313
- docs: { description: "Disallow the new operator in AppSync resolvers" },
314
- messages: { default: "The new operator is not supported in the AppSync JS runtime" },
315
- schema: []
316
- },
317
- createOnce(context) {
318
- return { NewExpression(node) {
319
- reportDefault(context, node);
320
- } };
546
+ return {
547
+ Literal(node) {
548
+ if ("regex" in node && node.regex) reportDefault(context, node);
549
+ },
550
+ RegExpLiteral(node) {
551
+ reportDefault(context, node);
552
+ }
553
+ };
321
554
  }
322
555
  }),
323
556
  "no-global-constructor": no_global_constructor_default,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["noAppsyncGlobals","noAsyncAwait","noBitwiseNot","noClasses","noContinue","noDoWhile","noForLoop","noFunctionArguments","noGenerators","noInOperator","noInstanceof","noLabeledStatement","noNew","noGlobalConstructor","noThis","noThrow","noTry","noUpdateOperators","noWhile"],"sources":["../src/rules/appsync-globals.ts","../src/rules/types.ts","../src/rules/no-appsync-globals.ts","../src/rules/utils.ts","../src/rules/no-async-await.ts","../src/rules/no-bitwise-not.ts","../src/rules/no-classes.ts","../src/rules/no-continue.ts","../src/rules/no-do-while.ts","../src/rules/no-for-loop.ts","../src/rules/no-function-arguments.ts","../src/rules/no-generators.ts","../src/rules/global-constructors.ts","../src/rules/no-global-constructor.ts","../src/rules/no-in-operator.ts","../src/rules/no-instanceof.ts","../src/rules/no-labeled-statement.ts","../src/rules/no-new.ts","../src/rules/no-this.ts","../src/rules/no-throw.ts","../src/rules/no-try.ts","../src/rules/no-update-operators.ts","../src/rules/no-while.ts","../src/rules/index.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["export const APPSYNC_GLOBAL_NAMES = new Set([\n \"util\",\n \"extensions\",\n \"runtime\",\n]);\n","import type { Rule } from \"eslint\";\n\nexport type AppsyncRuleModule = {\n meta: Rule.RuleMetaData;\n createOnce: (context: Rule.RuleContext) => Rule.RuleListener;\n};\n\nexport function defineAppsyncRule(rule: AppsyncRuleModule): AppsyncRuleModule {\n return rule;\n}\n","import type { Rule } from \"eslint\";\nimport { APPSYNC_GLOBAL_NAMES } from \"./appsync-globals.js\";\nimport { defineAppsyncRule } from \"./types.js\";\n\nfunction isBindingPosition(node: Rule.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (\n parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"FunctionExpression\" ||\n parent.type === \"ClassDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ImportSpecifier\" ||\n parent.type === \"ImportDefaultSpecifier\" ||\n parent.type === \"ImportNamespaceSpecifier\"\n ) {\n return parent.local === node;\n }\n\n if (parent.type === \"CatchClause\") {\n return parent.param === node;\n }\n\n return false;\n}\n\nfunction isNonReferencePosition(node: Rule.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (parent.type === \"Property\" && parent.key === node && !parent.computed) {\n return true;\n }\n\n if (\n parent.type === \"MemberExpression\" &&\n parent.property === node &&\n !parent.computed\n ) {\n return true;\n }\n\n return isBindingPosition(node);\n}\n\nfunction hasLocalBinding(\n node: Rule.Node & { type: \"Identifier\"; name: string },\n context: Rule.RuleContext,\n): boolean {\n let scope: Rule.Scope.Scope | null = context.sourceCode.getScope(node);\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable && variable.defs.length > 0) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow AppSync-only globals in code that must run outside the AppSync runtime\",\n },\n messages: {\n default:\n \"AppSync global `{{name}}` is not available outside the AppSync runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Identifier(node) {\n if (!APPSYNC_GLOBAL_NAMES.has(node.name)) {\n return;\n }\n\n if (isNonReferencePosition(node)) {\n return;\n }\n\n if (hasLocalBinding(node, context)) {\n return;\n }\n\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.name },\n });\n },\n };\n },\n});\n","import type { Rule } from \"eslint\";\n\ntype NodeWithType = { type: string };\n\nexport function isIdentifier(\n node: NodeWithType | null | undefined,\n name: string,\n): boolean {\n return node?.type === \"Identifier\" && (node as { name: string }).name === name;\n}\n\nexport function reportDefault(\n context: Rule.RuleContext,\n node: Rule.Node,\n messageId = \"default\",\n): void {\n context.report({ node, messageId });\n}\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow async functions and await expressions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Promises and async/await are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportAsyncFunction = (node: { async?: boolean }) => {\n if (node.async) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n AwaitExpression(node) {\n reportDefault(context, node);\n },\n FunctionDeclaration: reportAsyncFunction,\n FunctionExpression: reportAsyncFunction,\n ArrowFunctionExpression: reportAsyncFunction,\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the bitwise NOT (~) operator in AppSync resolvers\",\n },\n messages: {\n default: \"The ~ operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UnaryExpression(node) {\n if (node.operator === \"~\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow class declarations and expressions in AppSync resolvers\",\n },\n messages: {\n default: \"Classes are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ClassDeclaration(node) {\n reportDefault(context, node);\n },\n ClassExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow continue statements in AppSync resolvers\",\n },\n messages: {\n default: \"continue statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ContinueStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow do-while loops in AppSync resolvers\",\n },\n messages: {\n default: \"do-while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n DoWhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow C-style for loops in AppSync resolvers (for-in and for-of are allowed)\",\n },\n messages: {\n default:\n \"Only for-in and for-of loops are supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ForStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import type { Rule } from \"eslint\";\nimport { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nfunction definitionCreatesFunction(def: Rule.Scope.Definition): boolean {\n if (def.type === \"FunctionName\") {\n return true;\n }\n\n if (def.type === \"Variable\" && def.node.type === \"VariableDeclarator\") {\n const init = def.node.init;\n if (!init) {\n return false;\n }\n\n return (\n init.type === \"FunctionExpression\" ||\n init.type === \"ArrowFunctionExpression\"\n );\n }\n\n return false;\n}\n\nfunction isFunctionReference(\n node: Rule.Node,\n context: Rule.RuleContext,\n): boolean {\n if (node.type === \"FunctionExpression\") {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n let scope: Rule.Scope.Scope | null = context.sourceCode.getScope(node);\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow passing function references as call arguments in AppSync resolvers\",\n },\n messages: {\n default:\n \"Passing a function reference as an argument is not supported in the AppSync JS runtime; use an inline arrow function instead\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n for (const argument of node.arguments) {\n if (argument.type === \"SpreadElement\") {\n continue;\n }\n\n if (isFunctionReference(argument, context)) {\n reportDefault(context, argument);\n }\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow generator functions in AppSync resolvers\",\n },\n messages: {\n default: \"Generators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportGenerator = (node: { generator?: boolean }) => {\n if (node.generator) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n FunctionDeclaration: reportGenerator,\n FunctionExpression: reportGenerator,\n };\n },\n});\n","export const GLOBAL_CONSTRUCTOR_NAMES = new Set([\n \"String\",\n \"Boolean\",\n \"Number\",\n \"BigInt\",\n \"Symbol\",\n \"Date\",\n \"Object\",\n \"Array\",\n \"Function\",\n \"RegExp\",\n]);\n","import { GLOBAL_CONSTRUCTOR_NAMES } from \"./global-constructors.js\";\nimport { defineAppsyncRule } from \"./types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow calling global constructor functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Do not use `{{name}}()` as a constructor in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (\n node.callee.type === \"Identifier\" &&\n GLOBAL_CONSTRUCTOR_NAMES.has(node.callee.name)\n ) {\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.callee.name },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the in operator in AppSync resolvers\",\n },\n messages: {\n default:\n \"The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"in\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the instanceof operator in AppSync resolvers\",\n },\n messages: {\n default: \"The instanceof operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"instanceof\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow labeled statements in AppSync resolvers\",\n },\n messages: {\n default: \"Labeled statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n LabeledStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the new operator in AppSync resolvers\",\n },\n messages: {\n default: \"The new operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n NewExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow this expressions in AppSync resolvers\",\n },\n messages: {\n default: \"this is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThisExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow throw statements in AppSync resolvers\",\n },\n messages: {\n default: \"throw statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThrowStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow try/catch/finally statements in AppSync resolvers\",\n },\n messages: {\n default:\n \"try/catch/finally statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TryStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow ++ and -- operators in AppSync resolvers\",\n },\n messages: {\n default: \"++ and -- operators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UpdateExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"./types.js\";\nimport { reportDefault } from \"./utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow while loops in AppSync resolvers\",\n },\n messages: {\n default: \"while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n WhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import noAppsyncGlobals from \"./no-appsync-globals.js\";\nimport noAsyncAwait from \"./no-async-await.js\";\nimport noBitwiseNot from \"./no-bitwise-not.js\";\nimport noClasses from \"./no-classes.js\";\nimport noContinue from \"./no-continue.js\";\nimport noDoWhile from \"./no-do-while.js\";\nimport noForLoop from \"./no-for-loop.js\";\nimport noFunctionArguments from \"./no-function-arguments.js\";\nimport noGenerators from \"./no-generators.js\";\nimport noGlobalConstructor from \"./no-global-constructor.js\";\nimport noInOperator from \"./no-in-operator.js\";\nimport noInstanceof from \"./no-instanceof.js\";\nimport noLabeledStatement from \"./no-labeled-statement.js\";\nimport noNew from \"./no-new.js\";\nimport noThis from \"./no-this.js\";\nimport noThrow from \"./no-throw.js\";\nimport noTry from \"./no-try.js\";\nimport noUpdateOperators from \"./no-update-operators.js\";\nimport noWhile from \"./no-while.js\";\nimport type { AppsyncRuleModule } from \"./types.js\";\n\nconst rules = {\n \"no-appsync-globals\": noAppsyncGlobals,\n \"no-async-await\": noAsyncAwait,\n \"no-bitwise-not\": noBitwiseNot,\n \"no-classes\": noClasses,\n \"no-continue\": noContinue,\n \"no-do-while\": noDoWhile,\n \"no-for-loop\": noForLoop,\n \"no-function-arguments\": noFunctionArguments,\n \"no-generators\": noGenerators,\n \"no-in-operator\": noInOperator,\n \"no-instanceof\": noInstanceof,\n \"no-labeled-statement\": noLabeledStatement,\n \"no-new\": noNew,\n \"no-global-constructor\": noGlobalConstructor,\n \"no-this\": noThis,\n \"no-throw\": noThrow,\n \"no-try\": noTry,\n \"no-update-operators\": noUpdateOperators,\n \"no-while\": noWhile,\n} satisfies Record<string, AppsyncRuleModule>;\n\nexport type AppsyncRuleName = keyof typeof rules;\n\nexport default rules;\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\nimport rules from \"./rules/index.js\";\n\nconst OPT_IN_RULES = new Set([\"no-appsync-globals\"]);\n\nexport const plugin = eslintCompatPlugin({\n meta: {\n name: \"appsync\",\n },\n rules,\n});\n\nexport const recommended = Object.fromEntries(\n Object.keys(rules)\n .filter((ruleName) => !OPT_IN_RULES.has(ruleName))\n .map((ruleName) => [`appsync/${ruleName}`, \"error\"]),\n) as Record<`appsync/${Exclude<keyof typeof rules, \"no-appsync-globals\">}`, \"error\">;\n\nexport const portable = {\n ...recommended,\n \"appsync/no-appsync-globals\": \"error\",\n} as const;\n","import { plugin, portable, recommended } from \"./plugin.js\";\n\nexport { plugin, portable, recommended };\nexport default plugin;\n"],"mappings":";;AAAA,MAAa,uCAAuB,IAAI,IAAI;CAC1C;CACA;CACA;AACF,CAAC;;;ACGD,SAAgB,kBAAkB,MAA4C;CAC5E,OAAO;AACT;;;ACLA,SAAS,kBAAkB,MAA0B;CACnD,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IACE,OAAO,SAAS,wBAChB,OAAO,SAAS,yBAChB,OAAO,SAAS,wBAChB,OAAO,SAAS,oBAEhB,OAAO,OAAO,OAAO;CAGvB,IACE,OAAO,SAAS,qBAChB,OAAO,SAAS,4BAChB,OAAO,SAAS,4BAEhB,OAAO,OAAO,UAAU;CAG1B,IAAI,OAAO,SAAS,eAClB,OAAO,OAAO,UAAU;CAG1B,OAAO;AACT;AAEA,SAAS,uBAAuB,MAA0B;CACxD,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,OAAO,SAAS,cAAc,OAAO,QAAQ,QAAQ,CAAC,OAAO,UAC/D,OAAO;CAGT,IACE,OAAO,SAAS,sBAChB,OAAO,aAAa,QACpB,CAAC,OAAO,UAER,OAAO;CAGT,OAAO,kBAAkB,IAAI;AAC/B;AAEA,SAAS,gBACP,MACA,SACS;CACT,IAAI,QAAiC,QAAQ,WAAW,SAAS,IAAI;CACrE,OAAO,OAAO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,CAAC,oBAAoB,CAAC;AAEnD,MAAa,SAAS,mBAAmB;CACvC,MAAM,EACJ,MAAM,UACR;CACA;AACF,CAAC;AAED,MAAa,cAAc,OAAO,YAChC,OAAO,KAAK,KAAK,CAAC,CACf,QAAQ,aAAa,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC,CACjD,KAAK,aAAa,CAAC,WAAW,YAAY,OAAO,CAAC,CACvD;AAEA,MAAa,WAAW;CACtB,GAAG;CACH,8BAA8B;AAChC;;;AClBA,IAAA,cAAe"}
1
+ {"version":3,"file":"index.js","names":["member","noAppsyncGlobals","noAsyncAwait","noBitwiseNot","noClasses","noContextReassignment","noContinue","noDoWhile","noDisallowedMethods","noForLoop","noFunctionArguments","noFunctionReassign","noFunctionReturn","noGenerators","noInOperator","noInstanceof","noLabeledStatement","noNew","noPromise","noRecursion","noRegex","noGlobalConstructor","noThis","noThrow","noTry","noUpdateOperators","noWhile"],"sources":["../src/lib/appsync-globals.ts","../src/lib/rule-types.ts","../src/rules/no-appsync-globals.ts","../src/lib/utils.ts","../src/rules/no-async-await.ts","../src/rules/no-bitwise-not.ts","../src/rules/no-classes.ts","../src/rules/no-context-reassignment.ts","../src/rules/no-continue.ts","../src/lib/disallowed-methods.ts","../src/lib/function-utils.ts","../src/rules/no-disallowed-methods.ts","../src/rules/no-do-while.ts","../src/rules/no-for-loop.ts","../src/lib/callback-accepting-methods.ts","../src/rules/no-function-arguments.ts","../src/rules/no-function-reassign.ts","../src/rules/no-function-return.ts","../src/rules/no-generators.ts","../src/lib/global-constructors.ts","../src/rules/no-global-constructor.ts","../src/rules/no-in-operator.ts","../src/rules/no-instanceof.ts","../src/rules/no-labeled-statement.ts","../src/rules/no-new.ts","../src/rules/no-promise.ts","../src/rules/no-recursion.ts","../src/rules/no-regex.ts","../src/rules/no-this.ts","../src/rules/no-throw.ts","../src/rules/no-try.ts","../src/rules/no-update-operators.ts","../src/rules/no-while.ts","../src/rules/index.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["export const APPSYNC_GLOBAL_NAMES = new Set([\n \"util\",\n \"extensions\",\n \"runtime\",\n]);\n","import type { CreateOnceRule } from \"@oxlint/plugins\";\n\nexport type AppsyncRuleModule = CreateOnceRule;\n\nexport function defineAppsyncRule(rule: AppsyncRuleModule): AppsyncRuleModule {\n return rule;\n}\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { APPSYNC_GLOBAL_NAMES } from \"../lib/appsync-globals.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nfunction isBindingPosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (\n parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"FunctionExpression\" ||\n parent.type === \"ClassDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ImportSpecifier\" ||\n parent.type === \"ImportDefaultSpecifier\" ||\n parent.type === \"ImportNamespaceSpecifier\"\n ) {\n return parent.local === node;\n }\n\n if (parent.type === \"CatchClause\") {\n return parent.param === node;\n }\n\n return false;\n}\n\nfunction isNonReferencePosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (parent.type === \"Property\" && parent.key === node && !parent.computed) {\n return true;\n }\n\n if (\n parent.type === \"MemberExpression\" &&\n parent.property === node &&\n !parent.computed\n ) {\n return true;\n }\n\n return isBindingPosition(node);\n}\n\nfunction hasLocalBinding(\n node: { name: string },\n context: Context,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(\n node as ESTree.IdentifierReference,\n );\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable && variable.defs.length > 0) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow AppSync-only globals in code that must run outside the AppSync runtime\",\n },\n messages: {\n default:\n \"AppSync global `{{name}}` is not available outside the AppSync runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Identifier(node) {\n if (!APPSYNC_GLOBAL_NAMES.has(node.name)) {\n return;\n }\n\n if (isNonReferencePosition(node)) {\n return;\n }\n\n if (hasLocalBinding(node, context)) {\n return;\n }\n\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.name },\n });\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\n\ntype NodeWithType = { type: string };\n\nexport function isIdentifier(\n node: NodeWithType | null | undefined,\n name: string,\n): boolean {\n return (\n node?.type === \"Identifier\" &&\n (node as unknown as { name: string }).name === name\n );\n}\n\nexport function reportDefault(\n context: Context,\n node: ESTree.Node,\n messageId = \"default\",\n): void {\n context.report({ node, messageId });\n}\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow async functions and await expressions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Promises and async/await are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportAsyncFunction = (node: { async?: boolean }) => {\n if (node.async) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n AwaitExpression(node) {\n reportDefault(context, node);\n },\n FunctionDeclaration: reportAsyncFunction,\n FunctionExpression: reportAsyncFunction,\n ArrowFunctionExpression: reportAsyncFunction,\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the bitwise NOT (~) operator in AppSync resolvers\",\n },\n messages: {\n default: \"The ~ operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UnaryExpression(node) {\n if (node.operator === \"~\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow class declarations and expressions in AppSync resolvers\",\n },\n messages: {\n default: \"Classes are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ClassDeclaration(node) {\n reportDefault(context, node);\n },\n ClassExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nfunction isContextAssignmentTarget(node: ESTree.Node): boolean {\n if (isIdentifier(node, \"context\")) {\n return true;\n }\n\n return (\n node.type === \"MemberExpression\" && isIdentifier(node.object, \"context\")\n );\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow reassigning context and its base properties in AppSync resolvers\",\n },\n messages: {\n default:\n \"Reassigning context and base properties of context is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (isContextAssignmentTarget(node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow continue statements in AppSync resolvers\",\n },\n messages: {\n default: \"continue statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ContinueStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const DISALLOWED_METHOD_NAMES = new Set([\"apply\", \"bind\", \"call\"]);\n","import type { Context, Definition, ESTree, Scope } from \"@oxlint/plugins\";\n\ntype FunctionNode = ESTree.Node & {\n type:\n | \"FunctionDeclaration\"\n | \"FunctionExpression\"\n | \"ArrowFunctionExpression\";\n id?: { name: string } | null;\n};\n\nexport function getMemberPropertyName(\n property: ESTree.Node & { type: string },\n): string | null {\n if (property.type === \"Identifier\") {\n return (property as unknown as { name: string }).name;\n }\n\n if (property.type === \"Literal\" && typeof property.value === \"string\") {\n return property.value;\n }\n\n return null;\n}\n\nexport function definitionCreatesFunction(def: Definition): boolean {\n if (def.type === \"FunctionName\") {\n return true;\n }\n\n if (def.type === \"Variable\" && def.node.type === \"VariableDeclarator\") {\n const init = def.node.init;\n if (!init) {\n return false;\n }\n\n return (\n init.type === \"FunctionExpression\" ||\n init.type === \"ArrowFunctionExpression\"\n );\n }\n\n return false;\n}\n\nexport function isFunctionNode(node: ESTree.Node): node is FunctionNode {\n return (\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n );\n}\n\nexport function isFunctionLikeNode(\n node: ESTree.Node,\n context: Context,\n): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n return variableHoldsFunction(node.name, context, node);\n}\n\nexport function variableHoldsFunction(\n name: string,\n context: Context,\n referenceNode: ESTree.Node,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(referenceNode);\n while (scope) {\n const variable = scope.set.get(name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n","import { DISALLOWED_METHOD_NAMES } from \"../lib/disallowed-methods.js\";\nimport { getMemberPropertyName } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow unsupported method calls such as call, apply, and bind\",\n },\n messages: {\n default:\n \"The {{method}}() method is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type !== \"MemberExpression\") {\n return;\n }\n\n const method = getMemberPropertyName(node.callee.property);\n if (method && DISALLOWED_METHOD_NAMES.has(method)) {\n context.report({\n node,\n messageId: \"default\",\n data: { method },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow do-while loops in AppSync resolvers\",\n },\n messages: {\n default: \"do-while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n DoWhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow C-style for loops in AppSync resolvers (for-in and for-of are allowed)\",\n },\n messages: {\n default:\n \"Only for-in and for-of loops are supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ForStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const CALLBACK_ACCEPTING_METHODS = new Set([\n \"map\",\n \"find\",\n \"filter\",\n \"findIndex\",\n \"findLast\",\n \"findLastIndex\",\n \"forEach\",\n \"reduce\",\n \"reduceRight\",\n \"every\",\n \"some\",\n \"flatMap\",\n]);\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { CALLBACK_ACCEPTING_METHODS } from \"../lib/callback-accepting-methods.js\";\nimport {\n definitionCreatesFunction,\n getMemberPropertyName,\n} from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction isCallbackAcceptingCall(callee: ESTree.Node): boolean {\n if (callee.type !== \"MemberExpression\") {\n return false;\n }\n\n const member = callee as\n | ESTree.StaticMemberExpression\n | ESTree.ComputedMemberExpression;\n const propertyName = getMemberPropertyName(member.property);\n return propertyName !== null && CALLBACK_ACCEPTING_METHODS.has(propertyName);\n}\n\nfunction isFunctionLikeArgument(node: ESTree.Node, context: Context): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n let scope: Scope | null = context.sourceCode.getScope(node);\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper ?? null;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow passing functions as call arguments except to allowlisted Array methods\",\n },\n messages: {\n default: \"Functions can not be passed as an argument\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const allowsCallbacks = isCallbackAcceptingCall(node.callee);\n\n for (const argument of node.arguments) {\n if (argument.type === \"SpreadElement\") {\n continue;\n }\n\n if (argument.type === \"ArrowFunctionExpression\" && allowsCallbacks) {\n continue;\n }\n\n if (isFunctionLikeArgument(argument, context)) {\n reportDefault(context, argument);\n }\n }\n },\n };\n },\n});\n","import { variableHoldsFunction } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow reassigning function variables in AppSync resolvers\",\n },\n messages: {\n default: \"Functions cannot be reassigned in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (node.left.type !== \"Identifier\") {\n return;\n }\n\n if (variableHoldsFunction(node.left.name, context, node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { isFunctionLikeNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow returning functions from functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Functions cannot be the return value of functions in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ReturnStatement(node) {\n if (!node.argument) {\n return;\n }\n\n if (isFunctionLikeNode(node.argument, context)) {\n reportDefault(context, node.argument);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow generator functions in AppSync resolvers\",\n },\n messages: {\n default: \"Generators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportGenerator = (node: { generator?: boolean }) => {\n if (node.generator) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n FunctionDeclaration: reportGenerator,\n FunctionExpression: reportGenerator,\n };\n },\n});\n","export const GLOBAL_CONSTRUCTOR_NAMES = new Set([\n \"String\",\n \"Boolean\",\n \"Number\",\n \"BigInt\",\n \"Symbol\",\n \"Date\",\n \"Object\",\n \"Array\",\n \"Function\",\n \"RegExp\",\n]);\n","import { GLOBAL_CONSTRUCTOR_NAMES } from \"../lib/global-constructors.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow calling global constructor functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Do not use `{{name}}()` as a constructor in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (\n node.callee.type === \"Identifier\" &&\n GLOBAL_CONSTRUCTOR_NAMES.has(node.callee.name)\n ) {\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.callee.name },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the in operator in AppSync resolvers\",\n },\n messages: {\n default:\n \"The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"in\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the instanceof operator in AppSync resolvers\",\n },\n messages: {\n default: \"The instanceof operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"instanceof\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow labeled statements in AppSync resolvers\",\n },\n messages: {\n default: \"Labeled statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n LabeledStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the new operator in AppSync resolvers\",\n },\n messages: {\n default: \"The new operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n NewExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Promise usage in AppSync resolvers\",\n },\n messages: {\n default: \"Promises are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const { callee } = node;\n\n if (\n isIdentifier(callee, \"Promise\") ||\n (callee.type === \"MemberExpression\" &&\n isIdentifier(callee.object, \"Promise\"))\n ) {\n reportDefault(context, node);\n }\n },\n NewExpression(node) {\n if (isIdentifier(node.callee, \"Promise\")) {\n reportDefault(context, node);\n }\n },\n VariableDeclarator(node) {\n if (node.init && isIdentifier(node.init, \"Promise\")) {\n reportDefault(context, node.init);\n }\n },\n AssignmentExpression(node) {\n if (isIdentifier(node.right, \"Promise\")) {\n reportDefault(context, node.right);\n }\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\nimport { isFunctionNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction getEnclosingBindingNames(\n node: ESTree.Node,\n context: Context,\n): Set<string> {\n const names = new Set<string>();\n\n if (\n (node.type === \"FunctionDeclaration\" || node.type === \"FunctionExpression\") &&\n node.id?.type === \"Identifier\"\n ) {\n names.add(node.id.name);\n }\n\n let scope = context.sourceCode.getScope(node).upper;\n while (scope) {\n for (const variable of scope.variables) {\n for (const def of variable.defs) {\n if (\n def.type === \"Variable\" &&\n def.node.type === \"VariableDeclarator\" &&\n def.node.init === node\n ) {\n names.add(variable.name);\n }\n }\n }\n scope = scope.upper;\n }\n\n return names;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow recursive function calls in AppSync resolvers\",\n },\n messages: {\n default: \"Recursive function calls are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const enclosingBindingNames: Set<string>[] = [];\n\n const enterFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.push(getEnclosingBindingNames(node, context));\n };\n\n const exitFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.pop();\n };\n\n return {\n FunctionDeclaration: enterFunction,\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression: enterFunction,\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression: enterFunction,\n \"ArrowFunctionExpression:exit\": exitFunction,\n CallExpression(node) {\n if (node.callee.type !== \"Identifier\") {\n return;\n }\n\n const currentBindings =\n enclosingBindingNames[enclosingBindingNames.length - 1];\n if (currentBindings?.has(node.callee.name)) {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow regex literals in AppSync resolvers\",\n },\n messages: {\n default: \"Regex literals are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Literal(node) {\n if (\"regex\" in node && node.regex) {\n reportDefault(context, node);\n }\n },\n RegExpLiteral(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow this expressions in AppSync resolvers\",\n },\n messages: {\n default: \"this is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThisExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow throw statements in AppSync resolvers\",\n },\n messages: {\n default: \"throw statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThrowStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow try/catch/finally statements in AppSync resolvers\",\n },\n messages: {\n default:\n \"try/catch/finally statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TryStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow ++ and -- operators in AppSync resolvers\",\n },\n messages: {\n default: \"++ and -- operators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UpdateExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow while loops in AppSync resolvers\",\n },\n messages: {\n default: \"while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n WhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import noAppsyncGlobals from \"./no-appsync-globals.js\";\nimport noAsyncAwait from \"./no-async-await.js\";\nimport noBitwiseNot from \"./no-bitwise-not.js\";\nimport noClasses from \"./no-classes.js\";\nimport noContextReassignment from \"./no-context-reassignment.js\";\nimport noContinue from \"./no-continue.js\";\nimport noDisallowedMethods from \"./no-disallowed-methods.js\";\nimport noDoWhile from \"./no-do-while.js\";\nimport noForLoop from \"./no-for-loop.js\";\nimport noFunctionArguments from \"./no-function-arguments.js\";\nimport noFunctionReassign from \"./no-function-reassign.js\";\nimport noFunctionReturn from \"./no-function-return.js\";\nimport noGenerators from \"./no-generators.js\";\nimport noGlobalConstructor from \"./no-global-constructor.js\";\nimport noInOperator from \"./no-in-operator.js\";\nimport noInstanceof from \"./no-instanceof.js\";\nimport noLabeledStatement from \"./no-labeled-statement.js\";\nimport noNew from \"./no-new.js\";\nimport noPromise from \"./no-promise.js\";\nimport noRecursion from \"./no-recursion.js\";\nimport noRegex from \"./no-regex.js\";\nimport noThis from \"./no-this.js\";\nimport noThrow from \"./no-throw.js\";\nimport noTry from \"./no-try.js\";\nimport noUpdateOperators from \"./no-update-operators.js\";\nimport noWhile from \"./no-while.js\";\nimport type { AppsyncRuleModule } from \"../lib/rule-types.js\";\n\nconst rules = {\n \"no-appsync-globals\": noAppsyncGlobals,\n \"no-async-await\": noAsyncAwait,\n \"no-bitwise-not\": noBitwiseNot,\n \"no-classes\": noClasses,\n \"no-context-reassignment\": noContextReassignment,\n \"no-continue\": noContinue,\n \"no-do-while\": noDoWhile,\n \"no-disallowed-methods\": noDisallowedMethods,\n \"no-for-loop\": noForLoop,\n \"no-function-arguments\": noFunctionArguments,\n \"no-function-reassign\": noFunctionReassign,\n \"no-function-return\": noFunctionReturn,\n \"no-generators\": noGenerators,\n \"no-in-operator\": noInOperator,\n \"no-instanceof\": noInstanceof,\n \"no-labeled-statement\": noLabeledStatement,\n \"no-new\": noNew,\n \"no-promise\": noPromise,\n \"no-recursion\": noRecursion,\n \"no-regex\": noRegex,\n \"no-global-constructor\": noGlobalConstructor,\n \"no-this\": noThis,\n \"no-throw\": noThrow,\n \"no-try\": noTry,\n \"no-update-operators\": noUpdateOperators,\n \"no-while\": noWhile,\n} satisfies Record<string, AppsyncRuleModule>;\n\nexport type AppsyncRuleName = keyof typeof rules;\n\nexport default rules;\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\nimport rules from \"./rules/index.js\";\n\nconst OPT_IN_RULES = new Set([\"no-appsync-globals\"]);\n\nexport const plugin = eslintCompatPlugin({\n meta: {\n name: \"appsync\",\n },\n rules,\n});\n\nexport const recommended = Object.fromEntries(\n Object.keys(rules)\n .filter((ruleName) => !OPT_IN_RULES.has(ruleName))\n .map((ruleName) => [`appsync/${ruleName}`, \"error\"]),\n) as Record<`appsync/${Exclude<keyof typeof rules, \"no-appsync-globals\">}`, \"error\">;\n\nexport const portable = {\n ...recommended,\n \"appsync/no-appsync-globals\": \"error\",\n} as const;\n","import { plugin, portable, recommended } from \"./plugin.js\";\n\nexport { plugin, portable, recommended };\nexport default plugin;\n"],"mappings":";;AAAA,MAAa,uCAAuB,IAAI,IAAI;CAC1C;CACA;CACA;AACF,CAAC;;;ACAD,SAAgB,kBAAkB,MAA4C;CAC5E,OAAO;AACT;;;ACFA,SAAS,kBAAkB,MAA4B;CACrD,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IACE,OAAO,SAAS,wBAChB,OAAO,SAAS,yBAChB,OAAO,SAAS,wBAChB,OAAO,SAAS,oBAEhB,OAAO,OAAO,OAAO;CAGvB,IACE,OAAO,SAAS,qBAChB,OAAO,SAAS,4BAChB,OAAO,SAAS,4BAEhB,OAAO,OAAO,UAAU;CAG1B,IAAI,OAAO,SAAS,eAClB,OAAO,OAAO,UAAU;CAG1B,OAAO;AACT;AAEA,SAAS,uBAAuB,MAA4B;CAC1D,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,OAAO,SAAS,cAAc,OAAO,QAAQ,QAAQ,CAAC,OAAO,UAC/D,OAAO;CAGT,IACE,OAAO,SAAS,sBAChB,OAAO,aAAa,QACpB,CAAC,OAAO,UAER,OAAO;CAGT,OAAO,kBAAkB,IAAI;AAC/B;AAEA,SAAS,gBACP,MACA,SACS;CACT,IAAI,QAAsB,QAAQ,WAAW,SAC3C,IACF;CACA,OAAO,OAAO;EACZ,MAAM,WAAW,MAAM,IAAI,IAAI,KAAK,IAAI;EACxC,IAAI,YAAY,SAAS,KAAK,SAAS,GACrC,OAAO;EAET,QAAQ,MAAM;CAChB;CAEA,OAAO;AACT;AAEA,IAAA,6BAAe,kBAAkB;CAC/B,MAAM;EACJ,MAAM;EACN,MAAM,EACJ,aACE,kFACJ;EACA,UAAU,EACR,SACE,yEACJ;EACA,QAAQ,CAAC;CACX;CACA,WAAW,SAAS;EAClB,OAAO,EACL,WAAW,MAAM;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"version": "0.4.0",
4
4
  "description": "Oxlint plugin that enforces AWS AppSync JavaScript runtime restrictions",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,11 +31,13 @@
31
31
  },
32
32
  "scripts": {
33
33
  "build": "tsdown",
34
- "prepublishOnly": "npm test",
35
- "test": "npm run build && vitest run",
34
+ "prepublishOnly": "bun run test",
35
+ "test": "bun run build && vitest run",
36
36
  "test:unit": "vitest run tests/rules",
37
- "lint": "oxlint src tests/helpers tests/smoke.test.ts vitest.config.ts tsdown.config.ts"
37
+ "lint": "oxlint src tests/helpers tests/smoke.test.ts vitest.config.ts tsdown.config.ts",
38
+ "typecheck": "tsc --noEmit"
38
39
  },
40
+ "packageManager": "bun@1.3.12",
39
41
  "dependencies": {
40
42
  "@oxlint/plugins": "^1.42.0"
41
43
  },