lib/cc/engine/analyzers/javascript/main.rb
Avoid comma after the last item of an array. Open
Open
"(Program _ ___)".freeze,
- Read upRead up
- Exclude checks
This cop checks for trailing comma in array and hash literals.
Example: EnforcedStyleForMultiline: consistent_comma
# bad
a = [1, 2,]
# good
a = [
1, 2,
3,
]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: comma
# bad
a = [1, 2,]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: no_comma (default)
# bad
a = [1, 2,]
# good
a = [
1,
2
]
Do not freeze immutable objects, as freezing them has no effect. Open
Open
"(NUKE ___)".freeze,
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Do not freeze immutable objects, as freezing them has no effect. Open
Open
"(Program _ ___)".freeze,
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Avoid comma after the last item of an array. Open
Open
"(VariableDeclarator _ (init (CallExpression (_ (Identifier require)) ___)))".freeze,
- Read upRead up
- Exclude checks
This cop checks for trailing comma in array and hash literals.
Example: EnforcedStyleForMultiline: consistent_comma
# bad
a = [1, 2,]
# good
a = [
1, 2,
3,
]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: comma
# bad
a = [1, 2,]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: no_comma (default)
# bad
a = [1, 2,]
# good
a = [
1,
2
]
Do not freeze immutable objects, as freezing them has no effect. Open
Open
"(VariableDeclarator _ (init (CallExpression (_ (Identifier require)) ___)))".freeze,
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Avoid comma after the last item of an array. Open
Open
"**/*.jsx",
- Read upRead up
- Exclude checks
This cop checks for trailing comma in array and hash literals.
Example: EnforcedStyleForMultiline: consistent_comma
# bad
a = [1, 2,]
# good
a = [
1, 2,
3,
]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: comma
# bad
a = [1, 2,]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: no_comma (default)
# bad
a = [1, 2,]
# good
a = [
1,
2
]
Do not freeze immutable objects, as freezing them has no effect. Open
Open
REQUEST_PATH = "/javascript".freeze
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Do not freeze immutable objects, as freezing them has no effect. Open
Open
"(directives (Directive (value (DirectiveLiteral ___))))".freeze,
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Do not freeze immutable objects, as freezing them has no effect. Open
Open
"(ImportDeclaration ___)".freeze,
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1