@foray1010/eslint-config 7.10.0 → 7.12.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 +12 -0
- package/package.json +2 -2
- package/presets/base.js +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.12.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.11.0...@foray1010/eslint-config@7.12.0) (2022-10-20)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** add checking on circular dependency and self import ([a42e38a](https://github.com/foray1010/common-presets/commit/a42e38a0a08de73265cf70185569b45587284a2f))
|
|
11
|
+
|
|
12
|
+
## [7.11.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.10.0...@foray1010/eslint-config@7.11.0) (2022-10-18)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **eslint-config:** encourage to use JS standard #private in TSParameterProperty ([2f7b7f6](https://github.com/foray1010/common-presets/commit/2f7b7f6665f3fc520fc1a87878b2e5730e33b9aa))
|
|
17
|
+
|
|
6
18
|
## [7.10.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.9.0...@foray1010/eslint-config@7.10.0) (2022-10-18)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/eslint-config",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.12.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "122e9b3aaffb9257c1c119d0f60352a8ca006414"
|
|
62
62
|
}
|
package/presets/base.js
CHANGED
|
@@ -102,6 +102,14 @@ module.exports = {
|
|
|
102
102
|
allowObject: false,
|
|
103
103
|
},
|
|
104
104
|
],
|
|
105
|
+
// no circular dependency
|
|
106
|
+
'import/no-cycle': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
// speed up linting time
|
|
110
|
+
ignoreExternal: true,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
105
113
|
// do not allow import packages that are not listed in dependencies or peerDependencies
|
|
106
114
|
'import/no-extraneous-dependencies': [
|
|
107
115
|
'error',
|
|
@@ -113,6 +121,8 @@ module.exports = {
|
|
|
113
121
|
],
|
|
114
122
|
},
|
|
115
123
|
],
|
|
124
|
+
// forbid a module from importing itself
|
|
125
|
+
'import/no-self-import': 'error',
|
|
116
126
|
// use the shortest path in import statement, but allow /index because it will be standard to omit index as default file in directory
|
|
117
127
|
'import/no-useless-path-segments': [
|
|
118
128
|
'error',
|
|
@@ -289,7 +299,7 @@ module.exports = {
|
|
|
289
299
|
{
|
|
290
300
|
// encourage to use JS standard #private over TS private accessibility modifier, but excluding constructor because it cannot be private in JS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields#description
|
|
291
301
|
selector:
|
|
292
|
-
':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]:not([kind="constructor"])',
|
|
302
|
+
':matches(PropertyDefinition, MethodDefinition, TSParameterProperty)[accessibility="private"]:not([kind="constructor"])',
|
|
293
303
|
message:
|
|
294
304
|
'Use #private instead (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields)',
|
|
295
305
|
},
|