You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-29Lines changed: 57 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,19 @@ Since the 0.0.4 release, some rules defined in [John Papa's Guideline](https://g
41
41
npm install --save-dev eslint-plugin-angular
42
42
```
43
43
44
-
3. Use the shareable config by adding it to your `.eslintrc`:
45
-
46
-
```yaml
47
-
extends: plugin:angular/johnpapa
44
+
3. Use the shareable config by adding it to your `eslintrc.config.mjs`:
45
+
46
+
```javascript
47
+
import angular from "eslint-plugin-angular";
48
+
49
+
export default defineConfig([{
50
+
plugins: {
51
+
angular
52
+
},
53
+
rules: {
54
+
...angular.configs.johnpapa.rules
55
+
}
56
+
}]);
48
57
```
49
58
50
59
@@ -63,19 +72,30 @@ Since the 0.0.4 release, some rules defined in [John Papa's Guideline](https://g
63
72
npm install --save-dev eslint-plugin-angular
64
73
```
65
74
66
-
3. Enable the plugin by adding it to your `.eslintrc`:
75
+
3. Enable the plugin by adding it to your `eslint.config.mjs`:
67
76
68
-
```yaml
69
-
plugins:
70
-
- angular
71
-
```
72
-
4. You can also configure these rules in your `.eslintrc`. All rules defined in this plugin have to be prefixed by 'angular/'
77
+
```javascript
78
+
import angular from "eslint-plugin-angular";
73
79
74
-
```yaml
75
-
plugins:
76
-
- angular
77
-
rules:
78
-
- angular/controller_name: 0
80
+
export default defineConfig([{
81
+
plugins: {
82
+
angular
83
+
}
84
+
}]);
85
+
```
86
+
4. You can also configure these rules in your `eslint.config.mjs`. All rules defined in this plugin have to be prefixed by 'angular/'
87
+
88
+
```javascript
89
+
import angular from "eslint-plugin-angular";
90
+
91
+
export default defineConfig([{
92
+
plugins: {
93
+
angular
94
+
},
95
+
rules: {
96
+
"angular/controller-name": "error"
97
+
}
98
+
}]);
79
99
```
80
100
81
101
----
@@ -248,20 +268,28 @@ There are some useful references for creating new rules. Specificly useful are:
248
268
249
269
We can use a property, defined in the ESLint configuration file, in order to know which version is used : Angular 1 or Angular 2. based on this property, you can create rules for each version.
0 commit comments