diff --git a/.github/workflows/manual_release.yml b/.github/workflows/manual_release.yml
index 787a4400a..e3d225726 100644
--- a/.github/workflows/manual_release.yml
+++ b/.github/workflows/manual_release.yml
@@ -89,27 +89,6 @@ jobs:
asset_path: lib/ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_name: ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar
asset_content_type: application/zip
- upload-javascript:
- name: Upload JavaScript Plugin
- runs-on: ubuntu-latest
- needs: build
- steps:
- - name: Import plugin JAR files
- id: import_jar_files
- uses: actions/download-artifact@v3
- with:
- name: ecocode-plugins
- path: lib
- - name: Upload Release Asset - JavaScript Plugin
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{needs.build.outputs.upload_url}}
- asset_path: lib/ecocode-javascript-plugin-${{ needs.build.outputs.last_tag }}.jar
- asset_name: ecocode-javascript-plugin-${{ needs.build.outputs.last_tag }}.jar
- asset_content_type: application/zip
upload-php:
name: Upload PHP Plugin
runs-on: ubuntu-latest
diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml
index 0d2f3d605..ff213b10c 100644
--- a/.github/workflows/tag_release.yml
+++ b/.github/workflows/tag_release.yml
@@ -69,27 +69,6 @@ jobs:
asset_path: lib/ecocode-java-plugin-${{ github.ref_name }}.jar
asset_name: ecocode-java-plugin-${{ github.ref_name }}.jar
asset_content_type: application/zip
- upload-javascript:
- name: Upload JavaScript Plugin
- runs-on: ubuntu-latest
- needs: build
- steps:
- - name: Import plugin JAR files
- id: import_jar_files
- uses: actions/download-artifact@v3
- with:
- name: ecocode-plugins
- path: lib
- - name: Upload Release Asset - JavaScript Plugin
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{needs.build.outputs.upload_url}}
- asset_path: lib/ecocode-javascript-plugin-${{ github.ref_name }}.jar
- asset_name: ecocode-javascript-plugin-${{ github.ref_name }}.jar
- asset_content_type: application/zip
upload-php:
name: Upload PHP Plugin
runs-on: ubuntu-latest
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42fc0e43e..a23dd8551 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deleted
+- [#211](https://github.com/green-code-initiative/ecoCode/pull/211) Move JavaScript plugin to its dedicated repository
+
## [1.3.0] - 2023-07-04
### Added
diff --git a/INSTALL.md b/INSTALL.md
index 716f51d09..46d6673fb 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -23,8 +23,6 @@ ecoCode # Root directory
|
+--java-plugin # JAVA
|
-+--javascript-plugin # JavaScript
-|
+--php-plugin # PHP
|
+--python-plugin # Python
@@ -38,6 +36,5 @@ Plugin-specific guides
----------------------
- [Java how-to](java-plugin/README.md)
-- [JavaScript how-to](javascript-plugin/README.md)
- [Python how-to](python-plugin/README.md)
- [PHP how-to](php-plugin/README.md)
diff --git a/README.md b/README.md
index 7b34c611b..7a7be356b 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ refer to the contribution section.
4 technologies are supported by ecoCode right now:
- [Java](java-plugin/)
-- [JavaScript](javascript-plugin/)
+- [JavaScript](https://github.com/green-code-initiative/ecoCode-javascript)
- [PHP](php-plugin/)
- [Python](python-plugin/)
@@ -48,8 +48,6 @@ For example, you’ll be able to access of all your `for` loop, to explore conte
To better understand AST structure, you can use the [AST Explorer](https://astexplorer.net/).
-JavaScript plugin works differently because it does not use AST. [More information here](javascript-plugin/README.md)
-
🚀 Getting Started
------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 76f87d1ce..6e1351794 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -18,9 +18,6 @@ services:
- type: bind
source: ./java-plugin/target/ecocode-java-plugin-1.3.1-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/ecocode-java-plugin-1.3.1-SNAPSHOT.jar
- - type: bind
- source: ./javascript-plugin/target/ecocode-javascript-plugin-1.3.1-SNAPSHOT.jar
- target: /opt/sonarqube/extensions/plugins/ecocode-javascript-plugin-1.3.1-SNAPSHOT.jar
- type: bind
source: ./php-plugin/target/ecocode-php-plugin-1.3.1-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/ecocode-php-plugin-1.3.1-SNAPSHOT.jar
diff --git a/javascript-plugin/README.md b/javascript-plugin/README.md
deleted file mode 100644
index b6095a6ea..000000000
--- a/javascript-plugin/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# ecoCode JavaScript plugin
-
-This plugin behaves differently from the others in the ecoCode project. Since version 8.9 of SonarQube, it is no longer
-possible to use an AST to implement a
-rule, [as explained here](https://github.com/SonarSource/sonar-custom-rules-examples/tree/master/javascript-custom-rules).
-In compliance with the SonarSource decision, the ecoCode project uses ESLint to implement the custom rules.
-
-Thus, the plugin does not implement any rules. Its purpose is to import the result of the ESLint analysis of the
-project made with the ecoCode linter, with the complete documentation of each rule. In this context, the rules are
-considered by SonarQube as external: they do not appear in the list of rules but are reported as real rules during the
-analysis ([click to learn more](https://docs.sonarqube.org/latest/analyzing-source-code/importing-external-issues/importing-third-party-issues/)).
-
-🚀 Getting Started
-------------------
-
-The installation is not much more complicated than another ecoCode plugin. In addition to the Sonar plugin, you will
-need to install the ESLint plugin in your JavaScript/TypeScript project to be analyzed:
-
-- Install the SonarQube plugin as described in the [ecoCode README](../README.md#-getting-started).
-- Install the ESLint plugin into your project as described
- in [ESLint project README](https://github.com/green-code-initiative/ecoCode-linter/blob/main/eslint-plugin/README.md#installation).\
- This guide also explains how to configure ESLint to import results into SonarQube.
diff --git a/javascript-plugin/pom.xml b/javascript-plugin/pom.xml
deleted file mode 100644
index d9d7e5519..000000000
--- a/javascript-plugin/pom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
This rule aims at reducing CPU consumption by telling the device to use a less accurate yet more eco friendly geolocation, when geolocation API is used.
\nExamples of non compliant code for this rule:
\nvar options = { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 };\nfunction success(pos) {\n console.log(pos.coords);\n}\n\nfunction error(err) {\n console.warn(err);\n}\n\nnavigator.geolocation.getCurrentPosition(success, error, options);\n
\nExamples of compliant code for this rule:
\n// enableHighAccuracy is false by default, so not declaring it is correct\nfunction success(pos) {\n console.log(pos);\n}\nnavigator.geolocation.getCurrentPosition(success);\n
\nvar options = { enableHighAccuracy: false, timeout: 5000, maximumAge: 0 };\nfunction success(pos) {\n console.log(pos.coords);\n}\n\nfunction error(err) {\n console.warn(err);\n}\n\nnavigator.geolocation.getCurrentPosition(success, error, options);\n
\nThis rule aims to reduce weight of programs by using only needed modules. Many libraries export only one module by\ndefault, but some of them are exporting ES modules or submodules. We should use them to select more precisly needed\nmodules and avoid unnecessarily overloading files weight.
\n\nExample with the well-known lodash library, if you only need "isEmpty" method.
\nYou can externally add your own libraries to be checked.\nTo add your own libraries you need to modify your .eslintrc.js by adding the following rule configuration:
\nmodule.exports = {\n ...yourConf,\n rules: {\n "no-import-all-from-library": [\n "warn",\n {\n notAllowedLibraries: ["some-lib"], // will check for -> import someLib from "some-lib"\n importByNamespaceNotAllowedLibraries: ["some-other-lib"], // will check for -> import * as someOtherLib from "some-other-lib"\n },\n ],\n },\n};\n
\nExamples of non-compliant code for this rule:
\n// Example with lodash\nimport lodash from "lodash";\nimport { isEmpty } from "lodash";\nimport * as lodash from "lodash";\n\n// Example with underscore\nimport _ from "underscore";\n
\nExamples of compliant code for this rule:
\n// Example with lodash (uses submodules)\nimport isEmpty from "lodash/isEmpty";\nimport intersect from "lodash/intersect";\n\n// Example with underscore (uses esm modules)\nimport map from "underscore/modules/map.js";\n
\nThis rule aims to reduce DOM access assigning its object to variable when access multiple time. It saves CPU cycles.
\nExamples of incorrect code for this rule:
\nvar el1 = document.getElementById("block1").test1;\nvar el2 = document.getElementById("block1").test2;\n
\nExamples of correct code for this rule:
\nvar blockElement = document.getElementById("block1");\nvar el1 = blockElement.test1;\nvar el2 = blockElement.test2;\n
\nThis rule aims to disallow batching multiple style changes at once.
\nTo limit the number of repaint/reflow, it is advised to batch style modifications by adding a class containing all style\nchanges that will generate a unique reflow.
\nExamples of non-compliant code for this rule:
\n<script>\n element.style.height = "800px";\n element.style.width = "600px";\n element.style.color = "red";\n</script>\n
\nExamples of compliant code for this rule:
\n<style>\n .in-error {\n color: red;\n height: 800px;\n width: 800px;\n }\n</style>\n\n<script>\n element.addClass("in-error");\n</script>\n
\nThis rule aims to reduce the size and thus the network weight of API returns that may contain many elements. This rule\nis built for the NestJS framework but can work with a controller @Controller() and a decorated method @Get().
\nExamples of non-compliant code for this rule:
\n@Controller()\nclass Test {\n @Get()\n public find(): Promise<string[]> {}\n}\n
\nExamples of compliant code for this rule:
\ninterface Pagination {\n items: string[];\n currentPage: number;\n totalPages: number;\n}\n\n@Controller()\nclass Test {\n @Get()\n public find(): Promise<Pagination> {}\n}\n
\n