You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
SonarJS rules for ESLint to detect bugs and suspicious patterns in your code.
3
+
SonarJS rules for ESLint to help developers produce [Clean Code](https://www.sonarsource.com/solutions/clean-code/) by detecting bugs and suspicious patterns.
4
4
5
5
## Rules
6
6
7
7
### Bug Detection :bug:
8
8
9
-
Rules in this category aim to find places in code which have a high chance of being bugs, i.e. don't work as intended.
9
+
Rules in this category aim to find places in code that have a high chance of being bugs, i.e. don't work as intended.
10
10
11
11
* All branches in a conditional structure should not have exactly the same implementation ([`no-all-duplicated-branches`])
12
12
* Collection elements should not be replaced unconditionally ([`no-element-overwrite`])
@@ -21,7 +21,7 @@ Rules in this category aim to find places in code which have a high chance of be
21
21
22
22
### Code Smell Detection :pig:
23
23
24
-
Code Smells, or maintainability issues, are raised for places of code which might be costly to change in the future. These rules also help to keep the high code quality and readability. And finally some rules report issues on different suspicious code patters.
24
+
Code Smells, or maintainability issues, are raised for places of code which might be costly to change in the future. These rules also help to keep the high code quality and readability. And finally, some rules report issues on different suspicious code patterns.
25
25
26
26
* Cognitive Complexity of functions should not be too high ([`cognitive-complexity`])
27
27
* "if ... else if" constructs should end with "else" clauses ([`elseif-without-else`]) (*disabled*)
@@ -87,7 +87,7 @@ Code Smells, or maintainability issues, are raised for places of code which migh
87
87
## Usage
88
88
89
89
* If you don't have ESLint yet configured for your project, follow [these instructions](https://github.com/eslint/eslint#installation-and-usage).
90
-
* Install `eslint-plugin-sonarjs` using `npm` (or `yarn`) for you project or globally:
90
+
* Install `eslint-plugin-sonarjs` using `npm` (or `yarn`) for your project or globally:
91
91
92
92
```sh
93
93
npm install eslint-plugin-sonarjs --save-dev # install for your project
This plugin provides only `recommended` configuration. Almost all rules are activated in this profile with a few exceptions (check `disabled` tag in the rules list). `recommended` configuration activates rules with `error` severity.
128
+
This plugin provides only a `recommended` configuration. Almost all rules are activated in this profile with a few exceptions (check the `disabled` tag in the rules list). The`recommended` configuration activates rules with `error` severity.
129
129
130
130
## ESLint and Sonar
131
131
132
-
This plugin exposes to ESLint users a subset of JS/TS rules from Sonar-* products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules which are not available in ESLint core or other ESLint plugins to be beneficial for ESLint community.
132
+
This plugin exposes to ESLint users a subset of JS/TS rules from Sonar-* products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules that are not available in ESLint core or other ESLint plugins to be beneficial for the ESLint community.
133
133
134
-
If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sonarcloud.io) user, to lint your code locally, we suggest to use[SonarLint](https://www.sonarlint.org) IDE extension (available for VSCode, JetBrains IDEs and Eclipse). You can connect SonarLint to your SonarQube/SonarCloud project to synchronize rules configuration, issue statuses, etc.
134
+
If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sonarcloud.io) user, to lint your code locally, we suggest using[SonarLint](https://www.sonarlint.org) IDE extension (available for VSCode, JetBrains IDEs and Eclipse). You can connect SonarLint to your SonarQube/SonarCloud project to synchronize rules configuration, issue statuses, etc.
135
135
136
136
## Contributing
137
137
138
-
You want to participate in the development of the project? Have a look at our [contributing](./docs/CONTRIBUTING.md) guide!
138
+
Do you want to participate in the development of the project? Have a look at our [contributing](./docs/CONTRIBUTING.md) guide!
0 commit comments