eslint-config-beslogic 2.3.0 → 2.3.1

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.
@@ -0,0 +1 @@
1
+ static-tests
package/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 2.3.1
4
+
5
+ <!-- dprint-ignore -->
6
+ - Fixed the following error when parsing `typescript`` config:\
7
+ `Configuration for rule "@typescript-eslint/prefer-string-starts-ends-with" is invalid: Value true should be string.`
8
+ - Added `no-restricted-syntax` rules to ensure that Angular optional dependencies are marked as optional in TypeScript and vice-versa
9
+ - Fixed Storybook custom `.ts` configuration not being applied
10
+ - Disabled `autofix/indent-legacy`
11
+
12
+ <!-- TODO: Validate that static-tests are not published -->
4
13
 
5
14
  ## 2.3.0
6
15
 
package/angular.js CHANGED
@@ -31,6 +31,17 @@ const noRestrictedSyntax = [
31
31
  "message":
32
32
  "Forbidden non-null property assertion. https://typescript-eslint.io/rules/no-non-null-assertion . " +
33
33
  "This is only allowed on required component @Input({ required:true }). https://angular.io/api/core/Input#required"
34
+ },
35
+ {
36
+ "selector":
37
+ "MethodDefinition[key.name=\"constructor\"]:has(TSParameterProperty:has(Decorator[expression.callee.name=\"Optional\"]):not(:has(Identifier[optional=true])))",
38
+ "message":
39
+ "Constructor parameter with @Optional decorator should be marked as optional using `?`."
40
+ },
41
+ {
42
+ "selector":
43
+ "ClassDeclaration:has(Decorator :matches([name=\"Component\"], [name=\"Injectable\"], [name=\"Directive\"], [name=\"Pipe\"])) MethodDefinition[key.name=\"constructor\"]:has(TSParameterProperty:has(Identifier[optional=true]):not(:has(Decorator[expression.callee.name=\"Optional\"])))",
44
+ "message": "Optional constructor parameter should have @Optional decorator."
34
45
  }
35
46
  ]
36
47
 
package/javascript.js CHANGED
@@ -90,7 +90,6 @@ module.exports = {
90
90
  "ignorePatterns": ["node_modules/"],
91
91
  // Useful when using experimental features and code transpiled by Babel
92
92
  "parser": "@babel/eslint-parser",
93
- "reportUnusedDisableDirectives": true,
94
93
  "overrides": [
95
94
  {
96
95
  "files": [
@@ -301,6 +300,9 @@ module.exports = {
301
300
  }
302
301
  ],
303
302
 
303
+ // indent-legacy is deprecated in favor of indent
304
+ "autofix/indent-legacy": "off",
305
+
304
306
  // Using simple-import-sort instead
305
307
  "autofix/sort-imports": "off",
306
308
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-beslogic",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "ESLint rules, plugins and configs used at Beslogic",
5
5
  "main": "index.js",
6
6
  "// dependencies": "Run for ourselves when we install dependencies w/o running npm i afterward",
@@ -10,6 +10,7 @@
10
10
  "lint:fix": "node ./node_modules/dprint/bin fmt && npm run eslint -- --fix",
11
11
  "upgrade": "npx npm-check-updates -u & npm i",
12
12
  "yalc": "yalc publish",
13
+ "prepack": "type .gitignore* > .npmignore",
13
14
  "postinstall": "node ./lib/patch-dependencies.js",
14
15
  "dependencies": "node ./lib/patch-dependencies.js"
15
16
  },
@@ -81,10 +82,17 @@
81
82
  "eslint-plugin-testing-library": "^6.0",
82
83
  "eslint-plugin-total-functions": ">=6.0"
83
84
  },
85
+ "// plugins": "Test against highest supported version to catch new breaking changes",
84
86
  "devDependencies": {
87
+ "@angular-eslint/eslint-plugin": ">=16.2",
88
+ "@angular-eslint/eslint-plugin-template": ">=16.2",
89
+ "@angular-eslint/template-parser": ">=16.2",
90
+ "@angular/core": ">=16.2",
85
91
  "@types/eslint": "^8.37.0",
86
92
  "@types/node": "^17.0",
87
93
  "eslint-plugin-eslint-plugin": "^4.1",
94
+ "eslint-plugin-storybook": "^0.6.10",
95
+ "eslint-plugin-total-functions": ">=6.0",
88
96
  "yalc": "^1.0.0-pre.53"
89
97
  }
90
98
  }
package/storybook.js CHANGED
@@ -13,7 +13,7 @@ module.exports = {
13
13
  ],
14
14
  "overrides": [
15
15
  {
16
- "files": [".ts"],
16
+ "files": ["*.ts"],
17
17
  "rules": {
18
18
  "no-restricted-syntax": [
19
19
  ...noRestrictedSyntax,
package/typescript.js CHANGED
@@ -398,7 +398,7 @@ module.exports = {
398
398
  "@typescript-eslint/prefer-readonly-parameter-types": "off",
399
399
  "@typescript-eslint/prefer-string-starts-ends-with": [
400
400
  "error",
401
- { "allowSingleElementEquality": true }
401
+ { "allowSingleElementEquality": "always" }
402
402
  ],
403
403
  "@typescript-eslint/promise-function-async": [
404
404
  "error",