@aditosoftware/eslint-config-adito-platform 2.1.0 → 2.2.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/index.mjs +34 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 2.2.0
9
+
10
+ ### Added
11
+
12
+ - Enabled `no-duplicate-imports` (`warn`): each module may only be imported once, duplicated imports of the same module must be merged into a single import statement
13
+ - Enabled core rules (`warn`):
14
+ - `no-console` (with `allow: ["warn", "error"]`): catches forgotten debug logging, while `console.warn`/`console.error` stay legitimate
15
+ - `no-alert`: catches forgotten debugging dialogs
16
+ - `no-template-curly-in-string`: catches `"${x}"` inside plain strings (missing template literal)
17
+ - `no-self-compare`: catches `x === x`, which is almost always a typo
18
+ - `no-promise-executor-return`: the promise executor must call `resolve`/`reject`, returning a value is a mistake
19
+ - `no-constructor-return`: a `return` in a constructor has no effect
20
+ - `no-multi-str`: line continuations with `\` are error-prone, template literals should be used instead
21
+ - `no-new-wrappers`: `new String("x")` etc. instead of the primitive literal is a mistake
22
+ - `no-implicit-coercion`: forces readable conversions like `Boolean(x)`, `Number(x)`, `String(x)` instead of `!!x`, `+x`, `"" + x`
23
+ - `default-case-last`: the `default` clause must be the last case in a switch
24
+ - `no-else-return`: a `return` makes a following `else` redundant
25
+ - `object-shorthand`: `{ x: x }` can be shortened to `{ x }`
26
+
27
+ ### Changed
28
+
29
+ - Replaced the core rule `no-throw-literal` with `@typescript-eslint/only-throw-error` (`warn`): the TypeScript rule understands thrown class references (e.g. `new Error()`), which the core rule cannot
30
+
8
31
  ## 2.1.0
9
32
 
10
33
  ### Added
package/index.mjs CHANGED
@@ -241,7 +241,40 @@ export default [
241
241
  ],
242
242
  curly: "warn",
243
243
  eqeqeq: "warn",
244
- "no-throw-literal": "warn",
244
+ // each module may only be imported once (merge the specifiers instead)
245
+ "no-duplicate-imports": "warn",
246
+ // forgotten debug logging; warn/error are legitimate API error channels
247
+ "no-console": [
248
+ "warn",
249
+ {
250
+ allow: ["warn", "error"],
251
+ },
252
+ ],
253
+ // forgotten debugging dialogs (alert/confirm/prompt)
254
+ "no-alert": "warn",
255
+ // `"${x}"` in a plain string is almost always a missing template literal
256
+ "no-template-curly-in-string": "warn",
257
+ // `x === x` is almost always a typo for `x === y`
258
+ "no-self-compare": "warn",
259
+ // the executor must call resolve/reject, returning a value is a mistake
260
+ "no-promise-executor-return": "warn",
261
+ // a `return` in a constructor has no effect
262
+ "no-constructor-return": "warn",
263
+ // line continuations with `\` are error-prone; use template literals
264
+ "no-multi-str": "warn",
265
+ // `new String("x")` etc. instead of the primitive literal is a mistake
266
+ "no-new-wrappers": "warn",
267
+ // `!!x`, `+x`, `"" + x` are hard to read; use Boolean(), Number(), String()
268
+ "no-implicit-coercion": "warn",
269
+ // `default` must be the last case in a switch
270
+ "default-case-last": "warn",
271
+ // `return` makes `else` redundant and harder to read
272
+ "no-else-return": "warn",
273
+ // `{ x: x }` can be shortened to `{ x }`
274
+ "object-shorthand": "warn",
275
+ // the TS rule understands thrown class references (e.g. `new Error()`),
276
+ // which the core rule `no-throw-literal` cannot
277
+ "@typescript-eslint/only-throw-error": "warn",
245
278
  "tsdoc/syntax": "warn",
246
279
 
247
280
  "jsdoc/tag-lines": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aditosoftware/eslint-config-adito-platform",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "eslint configuration for the platform team of ADITO",
5
5
  "main": "index.mjs",
6
6
  "license": "MIT",