eslint-plugin-th-rules 1.5.0 → 1.5.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.5.2](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.5.1...v1.5.2) (2024-02-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Update environment configuration in index.js ([277871c](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/277871cc4ff71659fa1e476fd463c39893878797))
7
+
8
+ ## [1.5.1](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.5.0...v1.5.1) (2024-02-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed ([9730e96](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/9730e96ff296ccd4afbc278fefd176f2684b89cb))
14
+
1
15
  # [1.5.0](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.4.2...v1.5.0) (2024-02-26)
2
16
 
3
17
 
package/README.md CHANGED
@@ -13,6 +13,7 @@ This repository contains custom ESLint rules to enhance code quality and consist
13
13
 
14
14
  ## Configurations
15
15
 
16
+ ### All
16
17
  To add all of the rules into your project, add the following configuration into your ESLint configuration file:
17
18
 
18
19
  ```json
@@ -21,6 +22,34 @@ To add all of the rules into your project, add the following configuration into
21
22
  }
22
23
  ```
23
24
 
25
+ ### All React
26
+ ```json
27
+ {
28
+ "extends": ["plugin:th-rules/all-react"]
29
+ }
30
+ ```
31
+
32
+ ### All React Native
33
+ ```json
34
+ {
35
+ "extends": ["plugin:th-rules/all-react-native"]
36
+ }
37
+ ```
38
+
39
+ ### Recommended
40
+ ```json
41
+ {
42
+ "extends": ["plugin:th-rules/recommended"]
43
+ }
44
+ ```
45
+
46
+ ### Basic
47
+ ```json
48
+ {
49
+ "extends": ["plugin:th-rules/basic"]
50
+ }
51
+ ```
52
+
24
53
  ## Rules
25
54
 
26
55
  ### 1. No-Destruction Rule
package/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-th-rules",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "A List of custom ESLint rules created by Tomer Horowitz",
5
5
  "keywords": [
6
6
  "eslint",
@@ -24,6 +24,7 @@
24
24
  "eslint-plugin-jsdoc": "^48.2.0",
25
25
  "eslint-plugin-react": "^7.33.2",
26
26
  "eslint-plugin-react-hooks": "^4.6.0",
27
+ "eslint-plugin-react-native": "^4.1.0",
27
28
  "requireindex": "^1.2.0"
28
29
  },
29
30
  "devDependencies": {
@@ -40,6 +41,7 @@
40
41
  "eslint-doc-generator": "^1.0.0",
41
42
  "eslint-plugin-eslint-plugin": "^5.0.0",
42
43
  "eslint-plugin-node": "^11.1.0",
44
+ "eslint-plugin-unicorn": "^51.0.1",
43
45
  "mocha": "^10.0.0",
44
46
  "npm-run-all": "^4.1.5",
45
47
  "xo": "^0.57.0"
package/src/index.js CHANGED
@@ -15,7 +15,7 @@ const requireIndex = require('requireindex');
15
15
  * @property {string[]} plugins - The list of plugins.
16
16
  * @property {string[]} extends - The list of extended configurations.
17
17
  * @property {Object} rules - The rules configuration.
18
- * @property {Object} envs - The environment configuration.
18
+ * @property {Object} env - The environment configuration.
19
19
  */
20
20
  const basic = {
21
21
  plugins: ['th-rules'],
@@ -24,7 +24,7 @@ const basic = {
24
24
  'th-rules/no-destructuring': 'error',
25
25
  'th-rules/no-default-export': 'error',
26
26
  },
27
- envs: {},
27
+ env: {},
28
28
  };
29
29
 
30
30
  /**
@@ -33,7 +33,7 @@ const basic = {
33
33
  */
34
34
  const recommended = {
35
35
  ...basic,
36
- envs: {
36
+ env: {
37
37
  node: true,
38
38
  ES2024: true,
39
39
  jest: true,
@@ -60,15 +60,15 @@ const all = {
60
60
  /**
61
61
  * Represents an object containing all React-related configurations.
62
62
  * @typedef {Object} allReact
63
- * @property {Object} envs - The environment configurations.
64
- * @property {boolean} envs.browser - Indicates if the browser environment is enabled.
63
+ * @property {Object} env - The environment configurations.
64
+ * @property {boolean} env.browser - Indicates if the browser environment is enabled.
65
65
  * @property {Object} rules - The rule configurations.
66
66
  * @property {string} rules['react/no-array-index-key'] - The configuration for the 'react/no-array-index-key' rule.
67
67
  * @property {string[]} extends - The list of extended configurations.
68
68
  */
69
69
  const allReact = {
70
70
  ...all,
71
- envs: {...all.envs, node: false, browser: true},
71
+ env: {...all.env, node: false, browser: true},
72
72
  rules: {...all.rules, 'react/no-array-index-key': 'off'},
73
73
  extends: [...all.extends, 'xo-react'],
74
74
  };