@meadowlark-software/angular-config 0.1.0 → 0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @meadowlark-software/angular-config changelog
2
+
3
+ Each entry starts with **Added**, **Changed**, **Fixed**, **Removed** or **Upgrading**; an **Upgrading** entry says
4
+ what a consumer changes to take the version. Changes waiting for a release are under **Unreleased**.
5
+
6
+ ## Unreleased
7
+
8
+ - **Changed** `@typescript-eslint/strict-boolean-expressions` rejects strings and numbers as conditions, since `''` and
9
+ `0` would pass for missing.
10
+ - **Changed** Prettier wraps at 160 columns instead of 120.
11
+ - **Upgrading** Compare strings and numbers explicitly in conditions, such as `name !== ''` or `count > 0`, and run
12
+ Prettier to rewrap.
13
+
14
+ ## 0.1.0
15
+
16
+ The changes up to this version are in the repository's commit history.
package/README.md CHANGED
@@ -34,5 +34,6 @@ Its peer dependencies (`eslint`, `@eslint/js`, `typescript-eslint`, `angular-esl
34
34
  ```
35
35
 
36
36
  Beyond the recommended rules, the lint settings ban browser APIs newer than Angular's target browsers, reading the time
37
- anywhere but `Clock` from `@meadowlark-software/angular`, `Math.random`, a `default` arm on a switch over a union, a file over 300 lines and a
38
- message looked up by a computed key.
37
+ anywhere but `Clock` from `@meadowlark-software/angular`, `Math.random`, a `default` arm on a switch over a union, a file over 300 lines, a
38
+ message looked up by a computed key, and a string or number as a condition: write `name !== ''` or `count !== 0`, since
39
+ `''` and `0` are rarely meant as missing. Prettier wraps at 160 columns.
package/eslint.js CHANGED
@@ -20,15 +20,10 @@ const notYetInTarget = [
20
20
  ['Promise', 'withResolvers'],
21
21
  ['Array', 'fromAsync'],
22
22
  ].map(([object, property]) => ({ object, property, message: `${object}.${property} ${NOT_YET_IN_TARGET}` })),
23
- ...[
24
- 'union',
25
- 'intersection',
26
- 'difference',
27
- 'symmetricDifference',
28
- 'isSubsetOf',
29
- 'isSupersetOf',
30
- 'isDisjointFrom',
31
- ].map((property) => ({ property, message: `Set.prototype.${property} ${NOT_YET_IN_TARGET}` })),
23
+ ...['union', 'intersection', 'difference', 'symmetricDifference', 'isSubsetOf', 'isSupersetOf', 'isDisjointFrom'].map((property) => ({
24
+ property,
25
+ message: `Set.prototype.${property} ${NOT_YET_IN_TARGET}`,
26
+ })),
32
27
  ];
33
28
 
34
29
  // Only the clock's own implementation reads the time, with a suppression saying so.
@@ -57,24 +52,11 @@ function angularConfig({ tsconfigRootDir, prefix = 'app', ignores = [] }) {
57
52
  return defineConfig([
58
53
  {
59
54
  // src/paraglide is compiled from messages/, and src/app/api is generated from the OpenAPI document
60
- ignores: [
61
- '.angular/**',
62
- 'dist/**',
63
- 'coverage/**',
64
- 'node_modules/**',
65
- 'src/paraglide/**',
66
- 'src/app/api/**',
67
- ...ignores,
68
- ],
55
+ ignores: ['.angular/**', 'dist/**', 'coverage/**', 'node_modules/**', 'src/paraglide/**', 'src/app/api/**', ...ignores],
69
56
  },
70
57
  {
71
58
  files: ['**/*.ts'],
72
- extends: [
73
- eslint.configs.recommended,
74
- tseslint.configs.strictTypeChecked,
75
- tseslint.configs.stylisticTypeChecked,
76
- angular.configs.tsRecommended,
77
- ],
59
+ extends: [eslint.configs.recommended, tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, angular.configs.tsRecommended],
78
60
  processor: angular.processInlineTemplates,
79
61
  plugins: { paraglide },
80
62
  languageOptions: {
@@ -94,7 +76,8 @@ function angularConfig({ tsconfigRootDir, prefix = 'app', ignores = [] }) {
94
76
  '@typescript-eslint/no-extraneous-class': ['error', { allowWithDecorator: true }],
95
77
  '@typescript-eslint/no-floating-promises': 'error',
96
78
  '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
97
- '@typescript-eslint/strict-boolean-expressions': 'error',
79
+ // a string or number as a condition treats '' and 0 as missing, which is rarely what was meant
80
+ '@typescript-eslint/strict-boolean-expressions': ['error', { allowString: false, allowNumber: false }],
98
81
  // a default arm would hide a new case of a union
99
82
  '@typescript-eslint/switch-exhaustiveness-check': [
100
83
  'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meadowlark-software/angular-config",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "The compiler, lint and format settings every Meadowlark Angular client builds with.",
5
5
  "license": "MIT",
6
6
  "author": "Meadowlark Software",
@@ -28,6 +28,7 @@
28
28
  "tsconfig.json",
29
29
  "prettier.json",
30
30
  "README.md",
31
+ "CHANGELOG.md",
31
32
  "LICENSE"
32
33
  ],
33
34
  "peerDependencies": {
package/prettier.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "printWidth": 120,
2
+ "printWidth": 160,
3
3
  "singleQuote": true,
4
4
  "tabWidth": 4,
5
5
  "overrides": [