@hearthsim/eslint-config-typescript 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +27 -1
  2. package/index.js +0 -4
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,6 +4,32 @@ This repository contains the HearthSim common ESLint configuration with Typescri
4
4
 
5
5
  For included React support use [@HearthSim/eslint-config-typescript-react](https://github.com/HearthSim/eslint-config-typescript-react) instead.
6
6
 
7
+ ## Upgrading from v1
8
+
9
+ In versions v2.0.0 and later the React and React Hooks rules have moved to a separate package [@HearthSim/eslint-config-typescript-react](https://github.com/HearthSim/eslint-config-typescript-react).
10
+ It can be used as a drop-in replacement for v1 of @hearthsim/eslint-config-typescript (without -react).
11
+
12
+ To switch to the new package:
13
+
14
+ 1. Remove this package:
15
+ ```bash
16
+ $ yarn remove @hearthsim/eslint-config-typescript
17
+ ```
18
+
19
+ 2. Install the new React package:
20
+ ```bash
21
+ $ yarn add -D @hearthsim/eslint-config-typescript-react
22
+ ```
23
+
24
+ 3. Update your`.eslintrc.js`:
25
+ ```js
26
+ module.exports = {
27
+ //...
28
+ extends: ["@hearthsim/eslint-config-typescript-react"],
29
+ //...
30
+ };
31
+ ```
32
+
7
33
  ## Setup
8
34
 
9
35
  1. Install
@@ -17,7 +43,7 @@ Plugins are resolved relative to the final project and must thus installed expli
17
43
 
18
44
  ```bash
19
45
  $ yarn add -D \
20
- @typescript-eslint/eslint-plugin@5.4.0 \
46
+ @typescript-eslint/eslint-plugin@^5.4.0 \
21
47
  eslint-plugin-import@2.25.3 \
22
48
  eslint-plugin-jest@25.2.4
23
49
  ```
package/index.js CHANGED
@@ -24,8 +24,6 @@ module.exports = {
24
24
  "plugin:jest/recommended",
25
25
  ],
26
26
  rules: {
27
- // describe/it blocks will always breaks this
28
- "max-lines-per-function": "off",
29
27
  // enforce describe around "it" blocks
30
28
  "jest/require-top-level-describe": "error",
31
29
  // acceptable as long as it's only imported from other tests
@@ -72,8 +70,6 @@ module.exports = {
72
70
  "@typescript-eslint/no-unused-vars": "off",
73
71
  // while these aren't great, if someone explicitly uses them let's allow them
74
72
  "@typescript-eslint/ban-ts-comment": "off",
75
- // functions should be kept compact and logical
76
- "max-lines-per-function": ["warn", { max: 200, skipComments: true }],
77
73
  // no case declarations are not necessarily a bug, however they can lead to misused variables
78
74
  "no-case-declarations": "warn",
79
75
  "no-empty-pattern": "warn",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearthsim/eslint-config-typescript",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "HearthSim's presets for ESLint, with Typescript support.",
5
5
  "repository": "git@github.com:HearthSim/eslint-config-typescript.git",
6
6
  "author": "Benedict Etzel <benedict@hearthsim.net>",
@@ -10,7 +10,7 @@
10
10
  "format": "prettier --write *.js"
11
11
  },
12
12
  "peerDependencies": {
13
- "@typescript-eslint/eslint-plugin": "5.4.0",
13
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
14
14
  "eslint": "^6.8.0 || ^7.2.0 || ^8.0.0",
15
15
  "eslint-plugin-import": "^2.25.3",
16
16
  "eslint-plugin-jest": "^25.2.4",