Skip to content

Commit

Permalink
add EC530 to javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirgon committed May 30, 2024
1 parent df4c4e2 commit 825ce94
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [#315](https://github.com/green-code-initiative/ecoCode/pull/315) Add rule EC530 for javascript

### Changed

### Deleted
Expand Down
8 changes: 0 additions & 8 deletions ecocode-rules-specifications/src/main/rules/EC530/EC530.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [
"sobriety",
"environment",
"ecocode",
"android",
"ios",
"eco-design"
],
"ecoScore": "0.4",
"defaultSeverity": "Major"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tags": [
"sobriety",
"environment",
"ecocode",
"android",
"eco-design"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
== Why is this an issue?

Turning on the torch mode programmatically with `react-native-torch` must absolutely be avoided because the flashlight is one of the most energy-intensive component.

## Non compliant Code Example

[source,js,data-diff-id="2",data-diff-type="noncompliant"]
----
import Torch from 'react-native-torch'; // Non-compliant
----

[source,js,data-diff-id="2",data-diff-type="compliant"]
----
import axios from 'axios'; // Compliant
----

== Resources

=== Documentation

- [CNUMR best practices mobile](https://github.com/cnumr/best-practices-mobile) - Torch free
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tags": [
"sobriety",
"environment",
"ecocode",
"react-native",
"eco-design"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tags": [
"sobriety",
"environment",
"ecocode",
"ios",
"eco-design"
]
}

0 comments on commit 825ce94

Please sign in to comment.