eslint-plugin-th-rules 1.4.0 → 1.4.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 +42 -28
- package/README.md +8 -8
- package/bun.lockb +0 -0
- package/lib/index.js +12 -7
- package/lib/rules/{no-unamed-default-export.js → no-default-export.js} +3 -3
- package/lib/rules/{no-destruction.js → no-destructuring.js} +1 -1
- package/package.json +1 -1
- package/tests/lib/rules/{no-unamed-default-export.js → no-default-export.js} +1 -1
- package/tests/lib/rules/{no-destruction.js → no-destructuring.js} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.4.2](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.4.1...v1.4.2) (2024-02-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fixed name of no-destructuring rule ([30ab24a](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/30ab24aec8b84cda665c7fc43920f2625a2f8d83))
|
|
7
|
+
|
|
8
|
+
## [1.4.1](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.4.0...v1.4.1) (2024-02-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fixed a bug with the no-default-export auto fix ([fabd4bd](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/fabd4bdc51d7290baf6807e8255acdfd90e81f03))
|
|
14
|
+
|
|
1
15
|
# [1.4.0](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.3.2...v1.4.0) (2024-02-23)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -32,100 +46,100 @@
|
|
|
32
46
|
|
|
33
47
|
* :sparkles: Created a recommended configuration ([4c81e02](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/4c81e027ef00ab06a4c69ef32857093fcb06fb3b))
|
|
34
48
|
|
|
35
|
-
## [1.1.4](https://github.com/tomerh2001/eslint-plugin-
|
|
49
|
+
## [1.1.4](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.1.3...v1.1.4) (2024-02-23)
|
|
36
50
|
|
|
37
51
|
|
|
38
52
|
### Bug Fixes
|
|
39
53
|
|
|
40
|
-
* Update lib/index.js to import all rules in lib/rules ([d4f3183](https://github.com/tomerh2001/eslint-plugin-
|
|
54
|
+
* Update lib/index.js to import all rules in lib/rules ([d4f3183](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/d4f3183de27b530a7f62fc1670055915641d7533))
|
|
41
55
|
|
|
42
|
-
## [1.1.3](https://github.com/tomerh2001/eslint-plugin-
|
|
56
|
+
## [1.1.3](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.1.2...v1.1.3) (2024-02-23)
|
|
43
57
|
|
|
44
58
|
|
|
45
59
|
### Bug Fixes
|
|
46
60
|
|
|
47
|
-
* Remove "type" field from package.json ([aadbbb0](https://github.com/tomerh2001/eslint-plugin-
|
|
61
|
+
* Remove "type" field from package.json ([aadbbb0](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/aadbbb090a256e20e8437b5d9c7bf57cbfd0daf5))
|
|
48
62
|
|
|
49
|
-
## [1.1.2](https://github.com/tomerh2001/eslint-plugin-
|
|
63
|
+
## [1.1.2](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.1.1...v1.1.2) (2024-02-23)
|
|
50
64
|
|
|
51
65
|
|
|
52
66
|
### Bug Fixes
|
|
53
67
|
|
|
54
|
-
* changed back to CommonJS ([07174fc](https://github.com/tomerh2001/eslint-plugin-
|
|
68
|
+
* changed back to CommonJS ([07174fc](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/07174fce92e3a0b660fe76b4baa862fd0d33ee72))
|
|
55
69
|
|
|
56
|
-
## [1.1.1](https://github.com/tomerh2001/eslint-plugin-
|
|
70
|
+
## [1.1.1](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.1.0...v1.1.1) (2024-02-23)
|
|
57
71
|
|
|
58
72
|
|
|
59
73
|
### Bug Fixes
|
|
60
74
|
|
|
61
|
-
* changed index.js to ES ([d55351e](https://github.com/tomerh2001/eslint-plugin-
|
|
75
|
+
* changed index.js to ES ([d55351e](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/d55351ed380ceeb2c15d89f4b9db7e85c5250937))
|
|
62
76
|
|
|
63
|
-
# [1.1.0](https://github.com/tomerh2001/eslint-plugin-
|
|
77
|
+
# [1.1.0](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.7...v1.1.0) (2024-02-23)
|
|
64
78
|
|
|
65
79
|
|
|
66
80
|
### Bug Fixes
|
|
67
81
|
|
|
68
|
-
* Remove redundant Docker configuration ([2b1be8f](https://github.com/tomerh2001/eslint-plugin-
|
|
69
|
-
* Remove Dockerfile and update eslint rule ([63d6d03](https://github.com/tomerh2001/eslint-plugin-
|
|
82
|
+
* Remove redundant Docker configuration ([2b1be8f](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/2b1be8f41a1036c8237f689d2addf29beedaedea))
|
|
83
|
+
* Remove Dockerfile and update eslint rule ([63d6d03](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/63d6d033a3614be9a0e132e25ff5eb94b7448505))
|
|
70
84
|
|
|
71
85
|
|
|
72
86
|
### Features
|
|
73
87
|
|
|
74
|
-
* Added a rule to convert unnamed default exports to named default exports based on the file name ([cfda4c1](https://github.com/tomerh2001/eslint-plugin-
|
|
88
|
+
* Added a rule to convert unnamed default exports to named default exports based on the file name ([cfda4c1](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/cfda4c16bbba11b281a45deca8ca8742ecab23e9))
|
|
75
89
|
|
|
76
|
-
## [1.0.7](https://github.com/tomerh2001/eslint-plugin-
|
|
90
|
+
## [1.0.7](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.6...v1.0.7) (2024-02-22)
|
|
77
91
|
|
|
78
92
|
|
|
79
93
|
### Bug Fixes
|
|
80
94
|
|
|
81
|
-
* test ([99d8a4f](https://github.com/tomerh2001/eslint-plugin-
|
|
95
|
+
* test ([99d8a4f](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/99d8a4f325faaa425bc0ea0842567562441dcf2e))
|
|
82
96
|
|
|
83
|
-
## [1.0.6](https://github.com/tomerh2001/eslint-plugin-
|
|
97
|
+
## [1.0.6](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.5...v1.0.6) (2024-02-22)
|
|
84
98
|
|
|
85
99
|
|
|
86
100
|
### Bug Fixes
|
|
87
101
|
|
|
88
|
-
* 7 ([f397bee](https://github.com/tomerh2001/eslint-plugin-
|
|
102
|
+
* 7 ([f397bee](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/f397bee5676832b8b11e95dc52e0b8e83c5e5940))
|
|
89
103
|
|
|
90
|
-
## [1.0.5](https://github.com/tomerh2001/eslint-plugin-
|
|
104
|
+
## [1.0.5](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.4...v1.0.5) (2024-02-22)
|
|
91
105
|
|
|
92
106
|
|
|
93
107
|
### Bug Fixes
|
|
94
108
|
|
|
95
|
-
* 6 ([e4b80fd](https://github.com/tomerh2001/eslint-plugin-
|
|
109
|
+
* 6 ([e4b80fd](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/e4b80fdea4d224b880c114e8ac5c433131f46e58))
|
|
96
110
|
|
|
97
|
-
## [1.0.4](https://github.com/tomerh2001/eslint-plugin-
|
|
111
|
+
## [1.0.4](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.3...v1.0.4) (2024-02-22)
|
|
98
112
|
|
|
99
113
|
|
|
100
114
|
### Bug Fixes
|
|
101
115
|
|
|
102
|
-
* 3 ([de1546e](https://github.com/tomerh2001/eslint-plugin-
|
|
103
|
-
* 5 ([8d1b80d](https://github.com/tomerh2001/eslint-plugin-
|
|
116
|
+
* 3 ([de1546e](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/de1546eff2921718c6cfd6d6c4e8d6f82b178847))
|
|
117
|
+
* 5 ([8d1b80d](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/8d1b80d22129d1a5baaa7330f76645ef6e9f2cc9))
|
|
104
118
|
|
|
105
|
-
## [1.0.3](https://github.com/tomerh2001/eslint-plugin-
|
|
119
|
+
## [1.0.3](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.2...v1.0.3) (2024-02-22)
|
|
106
120
|
|
|
107
121
|
|
|
108
122
|
### Bug Fixes
|
|
109
123
|
|
|
110
|
-
* number 3 ([ac78e66](https://github.com/tomerh2001/eslint-plugin-
|
|
124
|
+
* number 3 ([ac78e66](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/ac78e6685fcda4551a18f93afc0e05ecb232185c))
|
|
111
125
|
|
|
112
|
-
## [1.0.2](https://github.com/tomerh2001/eslint-plugin-
|
|
126
|
+
## [1.0.2](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.1...v1.0.2) (2024-02-22)
|
|
113
127
|
|
|
114
128
|
|
|
115
129
|
### Bug Fixes
|
|
116
130
|
|
|
117
|
-
* Update package.json version to 1.0.6 ([1c5409c](https://github.com/tomerh2001/eslint-plugin-
|
|
131
|
+
* Update package.json version to 1.0.6 ([1c5409c](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/1c5409ce77ccc5fc4e35a975ffa328f59766c1d7))
|
|
118
132
|
|
|
119
|
-
## [1.0.1](https://github.com/tomerh2001/eslint-plugin-
|
|
133
|
+
## [1.0.1](https://github.com/tomerh2001/eslint-plugin-th-rules/compare/v1.0.0...v1.0.1) (2024-02-22)
|
|
120
134
|
|
|
121
135
|
|
|
122
136
|
### Bug Fixes
|
|
123
137
|
|
|
124
|
-
* semantic ([1e08f3d](https://github.com/tomerh2001/eslint-plugin-
|
|
138
|
+
* semantic ([1e08f3d](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/1e08f3ddb5f1432307ce7a1e50863c9325ddbbfc))
|
|
125
139
|
|
|
126
140
|
# 1.0.0 (2024-02-22)
|
|
127
141
|
|
|
128
142
|
|
|
129
143
|
### Bug Fixes
|
|
130
144
|
|
|
131
|
-
* Add ESLint configuration and rules ([0197c62](https://github.com/tomerh2001/eslint-plugin-
|
|
145
|
+
* Add ESLint configuration and rules ([0197c62](https://github.com/tomerh2001/eslint-plugin-th-rules/commit/0197c62d8d4be2f8fd5ae67ad4c3a83370d5d678))
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To add all of the rules into your project, add the following configuration into
|
|
|
17
17
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
|
20
|
-
"extends": ["plugin:
|
|
20
|
+
"extends": ["plugin:th-rules/all"]
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ To add all of the rules into your project, add the following configuration into
|
|
|
25
25
|
|
|
26
26
|
### 1. No-Destruction Rule
|
|
27
27
|
|
|
28
|
-
**Rule ID:** `
|
|
28
|
+
**Rule ID:** `th-rules/no-destructuring`
|
|
29
29
|
|
|
30
30
|
#### Description
|
|
31
31
|
|
|
@@ -44,14 +44,14 @@ This rule checks for:
|
|
|
44
44
|
```json
|
|
45
45
|
{
|
|
46
46
|
"rules": {
|
|
47
|
-
"
|
|
47
|
+
"th-rules/no-destructuring": ["error", { "maximumDestructuredVariables": 2, "maximumLineLength": 100 }]
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### 2. Name-Export Rule
|
|
53
53
|
|
|
54
|
-
**Rule ID:** `
|
|
54
|
+
**Rule ID:** `th-rules/no-default-export`
|
|
55
55
|
|
|
56
56
|
#### Description
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@ This rule targets unnamed default exports and automatically generates a named ex
|
|
|
65
65
|
```json
|
|
66
66
|
{
|
|
67
67
|
"rules": {
|
|
68
|
-
"
|
|
68
|
+
"no-default-export": "error"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
```
|
|
@@ -74,11 +74,11 @@ This rule targets unnamed default exports and automatically generates a named ex
|
|
|
74
74
|
```json
|
|
75
75
|
{
|
|
76
76
|
"plugins": [
|
|
77
|
-
"
|
|
77
|
+
"th-rules"
|
|
78
78
|
],
|
|
79
79
|
"rules": {
|
|
80
|
-
"
|
|
81
|
-
"
|
|
80
|
+
"no-destructuring": "error",
|
|
81
|
+
"no-default-export": "error"
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
```
|
package/bun.lockb
CHANGED
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/* eslint-disable n/no-path-concat */
|
|
2
|
+
/* eslint-disable unicorn/prefer-module */
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* @fileoverview A List of custom ESLint rules created by Tomer Horowitz
|
|
3
6
|
* @author Tomer Horowitz
|
|
@@ -15,13 +18,15 @@ const requireIndex = require('requireindex');
|
|
|
15
18
|
//------------------------------------------------------------------------------
|
|
16
19
|
|
|
17
20
|
// import all rules in lib/rules
|
|
18
|
-
module.exports
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
module.exports = {
|
|
22
|
+
rules: requireIndex(`${__dirname}/rules`),
|
|
23
|
+
configs: {
|
|
24
|
+
all: {
|
|
25
|
+
plugins: ['th-rules'],
|
|
26
|
+
rules: {
|
|
27
|
+
'th-rules/no-destructuring': 'error',
|
|
28
|
+
'th-rules/no-default-export': 'error',
|
|
29
|
+
},
|
|
25
30
|
},
|
|
26
31
|
},
|
|
27
32
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable unicorn/prefer-module */
|
|
2
|
+
|
|
1
3
|
const path = require('node:path');
|
|
2
4
|
|
|
3
5
|
const meta = {
|
|
@@ -22,9 +24,7 @@ function create(context) {
|
|
|
22
24
|
|
|
23
25
|
return match.toUpperCase();
|
|
24
26
|
})
|
|
25
|
-
.replaceAll(/[-_]/g, '')
|
|
26
|
-
.replaceAll('<', '')
|
|
27
|
-
.replaceAll('>', '');
|
|
27
|
+
.replaceAll(/[-_<>\\. ]/g, '');
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return {
|
package/package.json
CHANGED