eslint-config-angular-strict 0.1.1 → 0.1.5

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/README.md +34 -23
  2. package/package.json +6 -5
  3. package/typescript.js +3 -6
package/README.md CHANGED
@@ -2,26 +2,6 @@
2
2
 
3
3
  Stricts rules to enforce a consistent code style for **Angular** development
4
4
 
5
- ## Tsconfig
6
-
7
- For better consistency, please add this options to your `tsconfig.json` :
8
-
9
- ```javascript
10
- {
11
- "compilerOptions": {
12
- "forceConsistentCasingInFileNames": true, // Ensure that casing is correct in imports
13
- "noImplicitAny": true, // Enable error reporting for expressions and declarations with an implied any type
14
- "noImplicitOverride": true, // Ensure overriding members in derived classes are marked with an override modifier
15
- "strict": true // Enable all strict type checking options
16
- },
17
- "angularCompilerOptions": {
18
- "strictInjectionParameters": true, // Reports an error for a supplied parameter whose injection type cannot be determined
19
- "strictInputAccessModifiers": true, // Whether access modifiers such as private/protected/readonly are honored when assigning a binding expression to an @Input()
20
- "strictTemplates": true // Enables strict template type checking
21
- }
22
- }
23
- ```
24
-
25
5
  ## Installation
26
6
 
27
7
  ```sh
@@ -36,15 +16,46 @@ yarn add eslint-config-angular-strict --dev
36
16
 
37
17
  ## Configure ESLint
38
18
 
39
- In `.eslintec.json`:
19
+ Within your **ESLint** config file:
40
20
 
41
21
  ```json
42
22
  {
43
- "extends": ["eslint-config-angular-strict"]
23
+ "root": true,
24
+ "overrides": [
25
+ {
26
+ "extends": ["angular-strict/typescript"],
27
+ "files": ["*.ts"]
28
+ },
29
+ {
30
+ "extends": ["angular-strict/template"],
31
+ "files": ["*.html"]
32
+ }
33
+ ]
44
34
  }
45
35
  ```
46
36
 
47
- ℹ️ All `eslint` dependencies are included, so you can remove all `eslint` related dependencies from your project.
37
+ ℹ️ `eslint` dependencies are included, so you can remove all `eslint` related dependencies from your project.
38
+
39
+ ## Tsconfig
40
+
41
+ For better consistency, please add this options to your `tsconfig.json`:
42
+
43
+ ```javascript
44
+ {
45
+ "compilerOptions": {
46
+ (...),
47
+ "forceConsistentCasingInFileNames": true, // Ensure that casing is correct in imports
48
+ "noImplicitAny": true, // Enable error reporting for expressions and declarations with an implied any type
49
+ "noImplicitOverride": true, // Ensure overriding members in derived classes are marked with an override modifier
50
+ "strict": true // Enable all strict type checking options
51
+ },
52
+ "angularCompilerOptions": {
53
+ "strictInjectionParameters": true, // Reports an error for a supplied parameter whose injection type cannot be determined
54
+ "strictInputAccessModifiers": true, // Whether access modifiers such as private/protected/readonly are honored when assigning a binding expression to an @Input()
55
+ "strictTemplates": true // Enables strict template type checking
56
+ }
57
+ }
58
+ ```
48
59
 
49
60
  ## Extends
50
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-angular-strict",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "Stricts rules to enforce a consistent code style for Angular development",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,7 @@
9
9
  "keywords": [
10
10
  "angular",
11
11
  "eslint",
12
+ "eslint-plugin",
12
13
  "linting-rules",
13
14
  "stricts-rules",
14
15
  "typescript"
@@ -27,15 +28,15 @@
27
28
  "@angular-eslint/eslint-plugin": "13.2.1",
28
29
  "@angular-eslint/eslint-plugin-template": "13.2.1",
29
30
  "@angular-eslint/template-parser": "13.2.1",
30
- "@typescript-eslint/eslint-plugin": "5.27.0",
31
- "@typescript-eslint/parser": "5.27.0",
32
- "eslint": "8.16.0",
31
+ "@typescript-eslint/eslint-plugin": "5.27.1",
32
+ "@typescript-eslint/parser": "5.27.1",
33
+ "eslint": "8.17.0",
33
34
  "eslint-config-airbnb-base": "15.0.0",
34
35
  "eslint-config-airbnb-typescript": "17.0.0",
35
36
  "eslint-import-resolver-typescript": "2.7.1",
36
37
  "eslint-plugin-import": "2.26.0"
37
38
  },
38
39
  "devDependencies": {
39
- "typescript": "^4.0.0"
40
+ "typescript": "^4.7.3"
40
41
  }
41
42
  }
package/typescript.js CHANGED
@@ -20,10 +20,11 @@ module.exports = {
20
20
  '@typescript-eslint/no-non-null-assertion': 'off',
21
21
  '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
22
22
 
23
+ 'import/no-import-module-exports': 'off',
23
24
  'import/prefer-default-export': 'off',
24
25
 
25
26
  'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
26
- 'class-methods-use-this': ['error', { exceptMethods: ['transform'] }],
27
+ 'class-methods-use-this': ['error', { exceptMethods: ['get', 'transform'] }],
27
28
  'max-len': ['error', 180],
28
29
  'no-param-reassign': ['error', { props: false }],
29
30
  'no-plusplus': 'off',
@@ -40,9 +41,5 @@ module.exports = {
40
41
  ],
41
42
  'padded-blocks': 'off',
42
43
  radix: ['error', 'as-needed'],
43
- },
44
- settings: {
45
- 'import/parsers': { '@typescript-eslint/parser': ['.ts'] },
46
- 'import/resolver': { typescript: {} },
47
- },
44
+ }
48
45
  };