Skip to content

Commit

Permalink
Merge pull request #5 from gius/feature/v2fixes
Browse files Browse the repository at this point in the history
Added sonarjs rules
  • Loading branch information
Strnadj authored Dec 14, 2020
2 parents 490e592 + 2a32517 commit 3bb43c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ This package contains shared rules for ESlint with TypeScript and Prettier.

Inspired by https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb

## Versions

eslint-config v2 requires ESlint 7.

Use eslint-config v1 for ESlint 6 + TSlint.

## Usage

Install ESlint:
Expand Down
3 changes: 2 additions & 1 deletion eslint-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ module.exports = {
jsx: true, // Allows for the parsing of JSX
},
},
plugins: ["@typescript-eslint"],
plugins: ["@typescript-eslint", "sonarjs"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:sonarjs/recommended",
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
Expand Down
16 changes: 4 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@emanprague/eslint-config",
"version": "2.0.0",
"version": "2.1.0",
"description": "ESlint and prettier configurations",
"main": "eslint-config.js",
"repository": "https://github.com/eManPrague/eslint-config.git",
Expand All @@ -12,7 +12,7 @@
"dist": "rm -rf dist && mkdir dist && cp prettier-config.js dist/ && cp eslint-default.js dist/"
},
"keywords": [
"tslint",
"eslint",
"shared",
"rules"
],
Expand All @@ -25,7 +25,7 @@
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-typescript": "^0.14.0"
"eslint-plugin-sonarjs": "^0.5.0"
},
"peerDependencies": {
"eslint": "^7.15.0",
Expand Down

0 comments on commit 3bb43c4

Please sign in to comment.