@jkba/eslint-config-angular 1.0.1 → 1.1.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/README.md CHANGED
@@ -21,6 +21,7 @@ npm i -D \
21
21
  eslint-plugin-prettier \
22
22
  eslint-plugin-rxjs \
23
23
  eslint-plugin-rxjs-angular \
24
+ eslint-import-resolver-typescript \
24
25
  @jkba/eslint-config-angular
25
26
 
26
27
  ```
@@ -30,7 +31,7 @@ npm i -D \
30
31
 
31
32
  Extend your eslint configuration with `"@jkba/angular"`:
32
33
 
33
- ```javascript
34
+ ```js
34
35
  // .eslintrc.json
35
36
 
36
37
  {
@@ -49,14 +50,50 @@ module.exports = require('@jkba/eslint-config-angular/prettier.config');
49
50
 
50
51
  ### Modifying rules
51
52
 
52
- > :warning: Work in Progress
53
+ Modify (add/disable/override) specific rules via the `rules` property:
54
+
55
+ ```js
56
+ // .eslintrc.json
57
+
58
+ {
59
+ "extends": [ "@jkba/angular" ],
60
+ "rules": {
61
+ "@typescript-eslint/prefer-nullish-coalescing": "off", // Requires the `strictNullChecks` compiler option to be turned on to function correctly.
62
+ "@typescript-eslint/no-unnecessary-condition": "off", // Requires the `strictNullChecks` compiler option to be turned on to function correctly.
63
+ "@angular-eslint/template/click-events-have-key-events": "off", // Accessibility is not supported on this project
64
+ "@angular-eslint/template/interactive-supports-focus": "off", // Accessibility is not supported on this project
65
+ }
66
+ }
67
+ ```
68
+
69
+ or using the `overrides` property:
70
+
71
+ ```js
72
+ // .eslintrc.json
73
+
74
+ {
75
+ "extends": [ "@jkba/angular" ],
76
+ "overrides": [
77
+ {
78
+ "files": [ "*.html" ],
79
+ "parserOptions": { "parser": "@angular-eslint/template-parser" },
80
+ "rules": {
81
+ "@angular-eslint/template/i18n": "off" // i18n is not supported on this project
82
+ }
83
+ }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ Reference [Overriding Settings from Shareable Configs](https://eslint.org/docs/latest/extend/shareable-configs#overriding-settings-from-shareable-configs).
53
89
 
54
90
 
55
91
  ## Build
56
92
 
57
- > :warning: Work in Progress
93
+ Use `npm link` and then `npm link @jkba/eslint-config-angular` in your project.
94
+ PRs are welcome but keep in mind this is an opinionated configuration.
58
95
 
59
- Refer to https://eslint.org/docs/latest/extend/shareable-configs.
96
+ Reference [Share Configurations](https://eslint.org/docs/latest/extend/shareable-configs).
60
97
 
61
98
 
62
99
  ## License
package/eslint.config.js CHANGED
@@ -24,7 +24,7 @@ module.exports = {
24
24
  // This rule might intentionally disable some rules declared above due to conflicts
25
25
  'plugin:prettier/recommended',
26
26
  ],
27
- plugins: ['@typescript-eslint', '@angular-eslint', 'rxjs', 'rxjs-angular'],
27
+ plugins: ['@typescript-eslint', '@angular-eslint', 'rxjs', 'rxjs-angular', 'import'],
28
28
  settings: {
29
29
  // Reference https://www.npmjs.com/package/eslint-plugin-import
30
30
  'import/resolver': {
@@ -79,7 +79,13 @@ module.exports = {
79
79
  'import/order': [
80
80
  'error',
81
81
  {
82
- 'groups': ['builtin', 'external', 'parent', 'sibling', 'index'],
82
+ 'groups': [
83
+ ['builtin', 'external'],
84
+ 'internal',
85
+ 'parent',
86
+ 'sibling',
87
+ 'index',
88
+ ],
83
89
  'newlines-between': 'always',
84
90
  'alphabetize': {
85
91
  'order': 'asc',
@@ -87,6 +93,9 @@ module.exports = {
87
93
  }
88
94
  }
89
95
  ],
96
+ 'import/no-useless-path-segments': ['error', { noUselessIndex: true }],
97
+ // 'import/no-deprecated': 'error', // Throws false-positive for RxJS,
98
+ 'import/no-self-import': 'error',
90
99
  },
91
100
  },
92
101
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jkba/eslint-config-angular",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Opinionated ESLint config for Angular projects",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,18 +31,19 @@
31
31
  },
32
32
  "homepage": "https://github.com/jmeinlschmidt/eslint-config-angular#readme",
33
33
  "peerDependencies": {
34
- "eslint": ">=8",
35
- "typescript": ">=4",
36
- "prettier": ">=3",
37
34
  "@angular-eslint/eslint-plugin": ">=16",
38
35
  "@angular-eslint/eslint-plugin-template": ">=16",
39
36
  "@angular-eslint/template-parser": ">=16",
40
37
  "@typescript-eslint/eslint-plugin": ">=6",
41
38
  "@typescript-eslint/parser": ">=6",
42
- "eslint-plugin-import": ">=2.27.0",
39
+ "eslint": ">=8",
43
40
  "eslint-config-prettier": ">=8",
41
+ "eslint-plugin-import": ">=2.27.0",
44
42
  "eslint-plugin-prettier": ">=5",
45
43
  "eslint-plugin-rxjs": ">=5",
46
- "eslint-plugin-rxjs-angular": ">=2"
44
+ "eslint-plugin-rxjs-angular": ">=2",
45
+ "eslint-import-resolver-typescript": ">= 3.5.5",
46
+ "prettier": ">=3",
47
+ "typescript": ">=4"
47
48
  }
48
49
  }