@foray1010/eslint-config 7.9.0 → 7.11.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 CHANGED
@@ -3,6 +3,19 @@
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.11.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.10.0...@foray1010/eslint-config@7.11.0) (2022-10-18)
7
+
8
+ ### Features
9
+
10
+ - **eslint-config:** encourage to use JS standard #private in TSParameterProperty ([2f7b7f6](https://github.com/foray1010/common-presets/commit/2f7b7f6665f3fc520fc1a87878b2e5730e33b9aa))
11
+
12
+ ## [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)
13
+
14
+ ### Features
15
+
16
+ - **eslint-config:** do not allow usage of deprecated code ([ed21e5e](https://github.com/foray1010/common-presets/commit/ed21e5e671a67230453a682e9f80519bdcb0e551))
17
+ - **eslint-config:** encourage to use JS standard #private over TS private accessibility modifier ([5e913c8](https://github.com/foray1010/common-presets/commit/5e913c84e709a6d586fde790f122459170130a26))
18
+
6
19
  ## [7.9.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.8.0...@foray1010/eslint-config@7.9.0) (2022-10-07)
7
20
 
8
21
  ### 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.9.0",
4
+ "version": "7.11.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": {
@@ -29,6 +29,7 @@
29
29
  "confusing-browser-globals": "^1.0.10",
30
30
  "eslint-config-prettier": "^8.3.0",
31
31
  "eslint-plugin-compat": "^4.0.0",
32
+ "eslint-plugin-deprecation": "^1.3.2",
32
33
  "eslint-plugin-eslint-comments": "^3.2.0",
33
34
  "eslint-plugin-functional": "^4.4.1",
34
35
  "eslint-plugin-import": "^2.22.1",
@@ -57,5 +58,5 @@
57
58
  "publishConfig": {
58
59
  "access": "public"
59
60
  },
60
- "gitHead": "0b6e4b29bc99ab8523c726d33f5a8b8531c6ee56"
61
+ "gitHead": "084439e84e55f473a6f87f18f4b84c7df94d6a28"
61
62
  }
package/presets/base.js CHANGED
@@ -178,6 +178,7 @@ module.exports = {
178
178
  },
179
179
  plugins: [
180
180
  '@typescript-eslint/eslint-plugin',
181
+ 'eslint-plugin-deprecation',
181
182
  'eslint-plugin-functional',
182
183
  ],
183
184
  env: {
@@ -267,6 +268,8 @@ module.exports = {
267
268
  'error',
268
269
  { ignoreStatic: true },
269
270
  ],
271
+ // do not allow usage of deprecated code
272
+ 'deprecation/deprecation': 'error',
270
273
  // use with @typescript-eslint/prefer-readonly
271
274
  'functional/prefer-readonly-type': [
272
275
  'error',
@@ -281,6 +284,16 @@ module.exports = {
281
284
  ],
282
285
  // forbid unnecessary callback wrapper
283
286
  'functional/prefer-tacit': 'error',
287
+ 'no-restricted-syntax': [
288
+ 'error',
289
+ {
290
+ // 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
+ selector:
292
+ ':matches(PropertyDefinition, MethodDefinition, TSParameterProperty)[accessibility="private"]:not([kind="constructor"])',
293
+ message:
294
+ 'Use #private instead (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields)',
295
+ },
296
+ ],
284
297
  // @typescript-eslint/eslint-plugin suggests to disable it: https://github.com/typescript-eslint/typescript-eslint/blob/2588e9ea55f78352fdd6ae92a306135aabb49a1a/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
285
298
  // It is disabled in recommended config but re-enabled here to enforce a subset of global variables that supported by both node.js and browsers
286
299
  'no-undef': 'error',