mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-03 16:04:30 +00:00
42 lines
824 B
YAML
42 lines
824 B
YAML
id: arrow-statement-to-function
|
|
language: JavaScript
|
|
severity: error
|
|
rule:
|
|
pattern: export const $GETTER = ($$$) => $BODY
|
|
constraints: { BODY: { kind: statement_block } }
|
|
fix: export function $GETTER() $BODY
|
|
|
|
---
|
|
|
|
id: arrow-call-expression-to-function
|
|
language: JavaScript
|
|
severity: error
|
|
rule:
|
|
pattern: export const $GETTER = ($$$) => $BODY
|
|
constraints:
|
|
BODY:
|
|
any:
|
|
- kind: call_expression
|
|
- kind: binary_expression
|
|
- kind: member_expression
|
|
- kind: arrow_function
|
|
- kind: parenthesized_expression
|
|
- kind: subscript_expression
|
|
fix: |-
|
|
export function $GETTER() {
|
|
return $BODY
|
|
}
|
|
|
|
---
|
|
|
|
id: strip-first-argument
|
|
language: JavaScript
|
|
severity: error
|
|
rule:
|
|
any:
|
|
- pattern: export function $GETTER ($$$) { $$$BODY }
|
|
fix: |-
|
|
export function $GETTER() {
|
|
$$$BODY
|
|
}
|