Skip to content

Commit

Permalink
feat!: Remove eslint-plugin-prettier (#7)
Browse files Browse the repository at this point in the history
* feat!: Upgrade @typescript-eslint dependencies

* Update naming-convention options

* Lock peer dependencies

* Update README dependencies

* Update with new defaults

* Remove prettier redundant rules

* Disable broken rules

* Disable broken rule

* Fix ban-types options

* Disable redundant rule

* Update ban-types

* Fix naming convention

* Update naming convention

* Fix naming convention

* Update naming convention

* Update naming

* Update naming

* Fix

* Fix

* Fix

* Add function

* feat!: Remove eslint-plugin-prettier

* Update README

* README
  • Loading branch information
AndKiel committed May 27, 2020
1 parent 654a6ce commit db1e850
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ Add `@deepcrawl/eslint-config` and its peer dependencies to your `package.json`:
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-no-loops": "^0.3.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-sonarjs": "^0.5.0",
"prettier": "^2.0.5"
"eslint-plugin-sonarjs": "^0.5.0"
}
}
```
Expand All @@ -36,6 +34,8 @@ Update your `.eslintrc` configuration:

## Recommendations

### TypeScript

Have these options enabled in your `tsconfig.json` file:

```json
Expand All @@ -48,3 +48,24 @@ Have these options enabled in your `tsconfig.json` file:
```

or enable `@typescript-eslint/typedef` rule.

### Prettier

Apart from ESLint, it is recommended to use the following Prettier configuration:

```json
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 120,
"quoteProps": "as-needed",
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
```

with `lint-staged` pre-commit hook done via `husky`.
20 changes: 1 addition & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
"plugin:eslint-plugin-import/recommended",
"plugin:eslint-plugin-import/typescript",
"plugin:eslint-plugin-jest/recommended",
"plugin:prettier/recommended",
"eslint-config-prettier",
"prettier/@typescript-eslint",
],
parser: "@typescript-eslint/parser",
Expand All @@ -17,7 +17,6 @@ module.exports = {
"eslint-plugin-no-loops",
"eslint-plugin-jest",
"eslint-plugin-sonarjs",
"prettier",
],
rules: {
"@typescript-eslint/array-type": [
Expand Down Expand Up @@ -155,7 +154,6 @@ module.exports = {
ignoreRestArgs: true,
},
],
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
Expand Down Expand Up @@ -221,22 +219,6 @@ module.exports = {
],
"jest/expect-expect": "error",
"no-loops/no-loops": "error",
"prettier/prettier": [
"error",
{
arrowParens: "avoid",
bracketSpacing: true,
printWidth: 120,
semi: true,
singleQuote: false,
tabWidth: 2,
trailingComma: "all",
useTabs: false,
},
{
usePrettierrc: false,
},
],
"sonarjs/cognitive-complexity": ["error", 8],
"sonarjs/max-switch-cases": "error",
"sonarjs/no-all-duplicated-branches": "error",
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-no-loops": "^0.3.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-sonarjs": "^0.5.0",
"prettier": ">=2.0.5",
"typescript": ">=3.8"
}
}

0 comments on commit db1e850

Please sign in to comment.