Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-radar

es-joy23.1kLGPL-3.0-onlydeprecated0.2.1TypeScript support: included

This project is no longer being maintained as eslint-plugin-sonarjs has resumed maintenance and should be used instead

Radar rules for ESLint

radar, sonarjs, eslint, eslintplugin

readme

eslint-plugin-radar npm version Build Status Quality Gate Coverage

Radar rules for ESLint to detect bugs and suspicious patterns in your code.

This is a currently maintained fork of SonarJS.

Rules

Bug Detection :bug:

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.

Code Smell Detection :pig:

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.

Prerequisites

Node.js (>=6.x).

Usage

  • If you don't have ESLint yet configured for your project, follow these instructions.
  • Install eslint-plugin-radar using npm (or yarn) for you project or globally:
npm install eslint-plugin-radar --save-dev # install for your project
npm install eslint-plugin-radar -g         # or install globally
  • Add eslint-plugin-radar to the plugins option of your .eslintrc:
{
  "plugins": ["radar"]
}
  • Add plugin:radar/recommended to the extends option to enable all recommended rules:
{
  "extends": ["plugin:radar/recommended"]
}
  • or enable only some rules manually:
{
  "rules": {
    "radar/cognitive-complexity": "error",
    "radar/no-identical-expressions": "error"
    // etc.
  }
}

Contributing

You want to participate in the development of the project? Have a look at our contributing guide!

changelog

CHANGES for eslint-plugin-radar

0.2.1

Dev-focused:

  • Linting: Apply prettier to MD files and reapply latest to whole project
  • npm: Revert back to using fixed rather than self-referential version of eslint-plugin-radar for self-linting (was adding to file space)

0.2.0

  • Enhancement: add meta.docs (@Loxos)
  • License: Rename file name to reflect license type (LGPL-3) and add extension
  • Docs: Add CHANGES.md

Dev-focused:

  • Travis: Check Node 15

0.1.0

  • Forked from https://github.com/SonarSource/eslint-plugin-sonarjs
  • License: Add headers to hidden files
  • npm: Add ESLint 7 to peerDeps.
  • npm: Bump engines to avoid EOL versions (Node >=10)
  • npm: Use repository URL (accepted in npm, package.json linter doesn't complain, and allows IDEs to auto-open in browser (e.g., on cmd-O)
  • npm: Add recommended/optional fields, author, contributors to satisfy linter

Dev-focused:

  • Optimization: Add "use strict" for CJS eslint files
  • Linting: Apply latest prettier (adding .prettierignore to avoid applying to test sources); apply latest eslint-plugin-import
  • Linting: Check hidden files
  • Linting: Check all files by default, ignoring test sources and lib
  • Linting: Create separate ignore file for ruling (which lints nested node_modules)
  • Testing: Ensure test-ci script runs (now that Node 8 is removed)
  • Travis: Bump Node versions to 12 and 14
  • Travis: Avoid comment about "nodejs 6" being cause of failure; the need for jest-sonar-reporter is due to it not being in devDeps.
  • Properties: Point to non-deprecated travis-ci.com
  • npm: Reorder scripts so main scripts at bottom; switch test to check coverage and add jest script for non-coverage testing
  • npm: Add .ncurc.js file to prevent npm-check-updates auto-updating peerDeps.
  • npm: Self-reference current version of sonarjs, so can apply latest linting to own repository
  • npm: Update lint-staged, removing git add
  • npm: Update devDeps.
  • yarn: Upgrade