1+ {
2+ "root" : true ,
3+ "ignorePatterns" : [" projects/**/*" ],
4+ "plugins" : [" @typescript-eslint" , " prettier" , " jsdoc" ],
5+ "overrides" : [
6+ {
7+ "files" : [" *.ts" ],
8+ "parserOptions" : {
9+ "project" : [" tsconfig.json" ],
10+ "createDefaultProgram" : true
11+ },
12+ "extends" : [" plugin:@typescript-eslint/recommended" , " plugin:prettier/recommended" ],
13+ "rules" : {
14+ // Formato y estilo
15+ "max-len" : [
16+ " error" ,
17+ {
18+ "code" : 140 ,
19+ "ignoreUrls" : true ,
20+ "ignoreStrings" : true ,
21+ "ignoreTemplateLiterals" : true ,
22+ "ignoreRegExpLiterals" : true
23+ }
24+ ],
25+ "semi" : [" error" , " always" ],
26+ "quotes" : [" error" , " single" ],
27+ "indent" : [" error" , 2 ],
28+
29+ // Espaciado y formato
30+ "array-bracket-spacing" : [" error" , " never" ],
31+ "object-curly-spacing" : [" error" , " always" ],
32+ "comma-dangle" : [" error" , " always-multiline" ],
33+ "no-multiple-empty-lines" : [" error" , { "max" : 1 }],
34+
35+ // Buenas prácticas
36+ "no-console" : [" warn" , { "allow" : [" warn" , " error" ] }],
37+ "no-debugger" : " warn" ,
38+ "no-unused-vars" : " off" , // Usar la versión TypeScript
39+ "@typescript-eslint/no-unused-vars" : [" error" ],
40+ "eqeqeq" : [" error" , " always" ],
41+ "curly" : " error" ,
42+
43+ // Reglas específicas de TypeScript
44+ "@typescript-eslint/explicit-function-return-type" : [
45+ " warn" ,
46+ {
47+ "allowExpressions" : true ,
48+ "allowTypedFunctionExpressions" : true
49+ }
50+ ],
51+ "@typescript-eslint/explicit-member-accessibility" : [
52+ " error" ,
53+ {
54+ "accessibility" : " explicit" ,
55+ "overrides" : {
56+ "constructors" : " no-public"
57+ }
58+ }
59+ ],
60+ "@typescript-eslint/member-ordering" : [
61+ " error" ,
62+ {
63+ "default" : {
64+ "memberTypes" : [
65+ " public-field" ,
66+ " public-method" ,
67+ " protected-field" ,
68+ " protected-method" ,
69+ " private-field" ,
70+ " private-method"
71+ ]
72+ }
73+ }
74+ ],
75+ "@typescript-eslint/no-explicit-any" : " warn" ,
76+ "@typescript-eslint/naming-convention" : [
77+ " error" ,
78+ {
79+ "selector" : " interface" ,
80+ "format" : [" PascalCase" ],
81+ "prefix" : [" I" ]
82+ },
83+ {
84+ "selector" : " enum" ,
85+ "format" : [" PascalCase" ]
86+ }
87+ ],
88+
89+ // Reglas de importación
90+ "sort-imports" : [
91+ " error" ,
92+ {
93+ "ignoreCase" : true ,
94+ "ignoreDeclarationSort" : true
95+ }
96+ ],
97+
98+ // Reglas de Angular
99+ "@angular-eslint/component-class-suffix" : " error" ,
100+ "@angular-eslint/directive-class-suffix" : " error" ,
101+ "@angular-eslint/no-empty-lifecycle-method" : " error" ,
102+ "@angular-eslint/use-pipe-transform-interface" : " error" ,
103+ "@angular-eslint/component-selector" : [
104+ " error" ,
105+ {
106+ "type" : " element" ,
107+ "prefix" : " app" ,
108+ "style" : " kebab-case"
109+ }
110+ ],
111+ "@angular-eslint/directive-selector" : [
112+ " error" ,
113+ {
114+ "type" : " attribute" ,
115+ "prefix" : " app" ,
116+ "style" : " camelCase"
117+ }
118+ ],
119+
120+ // Complejidad y mantenibilidad
121+ "complexity" : [" warn" , 10 ],
122+ "max-depth" : [" warn" , 4 ],
123+ "max-lines-per-function" : [
124+ " warn" ,
125+ {
126+ "max" : 50 ,
127+ "skipBlankLines" : true ,
128+ "skipComments" : true
129+ }
130+ ],
131+ "max-params" : [" warn" , 4 ],
132+ "jsdoc/require-jsdoc" : [
133+ " error" ,
134+ {
135+ "require" : {
136+ "FunctionDeclaration" : true ,
137+ "MethodDefinition" : true ,
138+ "ClassDeclaration" : true ,
139+ "ArrowFunctionExpression" : true ,
140+ "FunctionExpression" : true
141+ }
142+ }
143+ ],
144+ "jsdoc/require-param" : " error" ,
145+ "jsdoc/require-param-type" : " error" ,
146+ "jsdoc/require-param-description" : " error" ,
147+ "jsdoc/require-returns" : " error" ,
148+ "jsdoc/require-returns-type" : " error" ,
149+ "jsdoc/require-returns-description" : " error"
150+ }
151+ },
152+ {
153+ "files" : [" *.html" ],
154+ "extends" : [" plugin:@angular-eslint/template/recommended" ],
155+ "rules" : {
156+ "max-len" : [" error" , { "code" : 140 }]
157+ }
158+ }
159+ ]
160+ }
0 commit comments