2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-04-08 14:58:32 +00:00
|
|
|
rules:
|
|
|
|
- id: ui-no-string-extensions
|
|
|
|
patterns:
|
|
|
|
- pattern: "$S.$FUNC()"
|
|
|
|
- metavariable-pattern:
|
|
|
|
metavariable: $FUNC
|
|
|
|
pattern-either:
|
|
|
|
- pattern: "w"
|
|
|
|
- pattern: "loc"
|
|
|
|
- pattern: "camelize"
|
|
|
|
- pattern: "decamelize"
|
|
|
|
- pattern: "dasherize"
|
|
|
|
- pattern: "underscore"
|
|
|
|
- pattern: "classify"
|
|
|
|
- pattern: "capitalize"
|
|
|
|
message: "Invalid call to string extension `$FUNC` in `$S.$FUNC()`"
|
|
|
|
languages:
|
|
|
|
- javascript
|
|
|
|
severity: ERROR
|
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- "ui/**/*.js"
|
|
|
|
exclude:
|
|
|
|
- "ui/node_modules"
|