-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from green-code-initiative/javascript-plugin
JavaScript plugin
- Loading branch information
Showing
14 changed files
with
382 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
- [Installation notes / requirements](#installation-notes--requirements) | ||
- [Project structure](#project-structure) | ||
- [Links](#links) | ||
- [Plugin-specific guides](#plugin-specific-guides) | ||
|
||
Installation notes / requirements | ||
--------------------------------- | ||
|
||
Please read common [INSTALL.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md) in `ecoCode-common` repository. | ||
Please read common [INSTALL.md](https://github.com/green-code-initiative/ecoCode-common/blob/main/doc/INSTALL.md) | ||
in `ecoCode-common` repository. Please follow the specific guides below for additional information on installing the | ||
desired plugins. | ||
|
||
Project structure | ||
----------------- | ||
|
||
Here is a preview of project tree : | ||
|
||
```txt | ||
ecoCode # Root directory | ||
ecoCode # Root directory | ||
| | ||
+--java-plugin # JAVA | ||
+--java-plugin # JAVA | ||
| | ||
+--php-plugin # PHP | ||
+--javascript-plugin # JavaScript | ||
| | ||
+--python-plugin # Python | ||
+--php-plugin # PHP | ||
| | ||
+--python-plugin # Python | ||
| | ||
\--docker-compose.yml # Docker compose file | ||
``` | ||
|
||
You will find more information about the plugins’ architecture in their folders | ||
|
||
Links | ||
----- | ||
Plugin-specific guides | ||
---------------------- | ||
|
||
- Java how-to : https://github.com/SonarSource/sonar-java/blob/master/docs/CUSTOM_RULES_101.md | ||
- Python how-to : https://github.com/SonarSource/sonar-custom-rules-examples/tree/master/python-custom-rules | ||
- PHP how-to : https://github.com/SonarSource/sonar-custom-rules-examples/tree/master/php-custom-rules | ||
- [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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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. |
Oops, something went wrong.