eslint-plugin-th-rules 1.8.0 → 1.9.0
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 +14 -0
- package/README.md +0 -52
- package/package.json +1 -1
- package/src/index.js +28 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.9.0](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.8.1...v1.9.0) (2024-06-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* created separate configs for typescript and non-typescript configs ([13f17df](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/13f17dfad0182c9437e38a51adb37c1b15153d71))
|
|
7
|
+
|
|
8
|
+
## [1.8.1](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.8.0...v1.8.1) (2024-06-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Disable TypeScript ESLint strict rules and unsafe checks ([bf186fb](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/bf186fbc8216a520b59e24e7861c47ee0f281680))
|
|
14
|
+
|
|
1
15
|
# [1.8.0](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.7.0...v1.8.0) (2024-06-15)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -11,45 +11,6 @@ This repository contains custom ESLint rules to enhance code quality and consist
|
|
|
11
11
|
|
|
12
12
|
This repository contains custom ESLint rules to enhance code quality and consistency across projects, created by Tomer Horowitz.
|
|
13
13
|
|
|
14
|
-
## Configurations
|
|
15
|
-
|
|
16
|
-
### All
|
|
17
|
-
To add all of the rules into your project, add the following configuration into your ESLint configuration file:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"extends": ["plugin:th-rules/all"]
|
|
22
|
-
}
|
|
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
|
-
|
|
53
14
|
## Rules
|
|
54
15
|
|
|
55
16
|
### 1. No-destructuring Rule
|
|
@@ -98,16 +59,3 @@ This rule targets unnamed default exports and automatically generates a named ex
|
|
|
98
59
|
}
|
|
99
60
|
}
|
|
100
61
|
```
|
|
101
|
-
|
|
102
|
-
## Installation
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"plugins": [
|
|
106
|
-
"th-rules"
|
|
107
|
-
],
|
|
108
|
-
"rules": {
|
|
109
|
-
"no-destructuring": "error",
|
|
110
|
-
"no-default-export": "error"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -4,27 +4,23 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
const requireIndex = require('requireindex');
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const configs = {};
|
|
8
|
+
configs.recommended = {
|
|
8
9
|
plugins: ['th-rules', 'sonarjs'],
|
|
9
10
|
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/strict-type-checked',
|
|
11
|
-
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
12
11
|
'plugin:sonarjs/recommended-legacy',
|
|
13
12
|
],
|
|
14
13
|
rules: {
|
|
15
14
|
'th-rules/no-destructuring': 'error',
|
|
16
15
|
'th-rules/no-default-export': 'error',
|
|
17
16
|
'unicorn/prefer-module': 'warn',
|
|
18
|
-
'@typescript-eslint/naming-convention': 'warn',
|
|
19
17
|
'unicorn/filename-case': 'off',
|
|
20
18
|
'unicorn/no-array-callback-reference': 'off',
|
|
21
19
|
'import/extensions': 'off',
|
|
22
|
-
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
23
20
|
'unicorn/no-static-only-class': 'off',
|
|
24
|
-
'@typescript-eslint/no-extraneous-class': 'off',
|
|
25
21
|
'unicorn/no-await-expression-member': 'off',
|
|
26
|
-
'@typescript-eslint/no-duplicate-type-constituents': 'off',
|
|
27
22
|
'new-cap': 'off',
|
|
23
|
+
'no-await-in-loop': 'off',
|
|
28
24
|
camelcase: 'warn',
|
|
29
25
|
},
|
|
30
26
|
env: {
|
|
@@ -34,9 +30,31 @@ const recommended = {
|
|
|
34
30
|
},
|
|
35
31
|
};
|
|
36
32
|
|
|
33
|
+
for (const configName of Object.keys(configs)) {
|
|
34
|
+
configs[configName + '-typescript'] = {
|
|
35
|
+
...configs[configName],
|
|
36
|
+
extends: [
|
|
37
|
+
'plugin:@typescript-eslint/strict-type-checked',
|
|
38
|
+
'plugin:@typescript-eslint/stylistic-type-checked',
|
|
39
|
+
...configs[configName].extends,
|
|
40
|
+
],
|
|
41
|
+
rules: {
|
|
42
|
+
...configs[configName].rules,
|
|
43
|
+
'@typescript-eslint/naming-convention': 'warn',
|
|
44
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
45
|
+
'@typescript-eslint/no-extraneous-class': 'off',
|
|
46
|
+
'@typescript-eslint/no-duplicate-type-constituents': 'off',
|
|
47
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
48
|
+
'@typescript-eslint/require-await': 'off',
|
|
49
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
50
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
51
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
52
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
37
57
|
module.exports = {
|
|
38
58
|
rules: requireIndex(`${__dirname}/rules`),
|
|
39
|
-
configs
|
|
40
|
-
recommended,
|
|
41
|
-
},
|
|
59
|
+
configs,
|
|
42
60
|
};
|