Skip to content

Commit 40a6118

Browse files
committed
feat: Refactor code & include CD/CI deployment
1 parent b83622c commit 40a6118

File tree

13 files changed

+606
-322
lines changed

13 files changed

+606
-322
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.eslintignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Directorios de build
2+
/dist
3+
/build
4+
/coverage
5+
6+
# Node
7+
/node_modules
8+
9+
# Configuración
10+
*.config.js
11+
*.conf.js
12+
13+
# Otros
14+
*.min.js
15+
*.min.css
16+
*.spec.ts
17+
*.test.ts
18+
/e2e

.eslintrc.json

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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+
}

.github/workflows/main.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 23
20+
21+
- name: Install dependencies
22+
run: npm install

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
node_modules
22
package-lock.json
3-
4-
release
53
dist
64
coverage
7-
.vscode
5+
release
6+
*.log
87
.idea
9-
*.log
8+
.DS_Store

.prettierignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Directorios compilados
2+
/dist
3+
/build
4+
/coverage
5+
6+
# Node
7+
/node_modules
8+
9+
# Archivos generados
10+
*.min.js
11+
*.min.css
12+
13+
# Otros
14+
package-lock.json
15+
yarn.lock
16+
*.md

.prettierrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": true,
9+
"arrowParens": "avoid",
10+
"proseWrap": "always",
11+
"htmlWhitespaceSensitivity": "css",
12+
"endOfLine": "lf",
13+
"embeddedLanguageFormatting": "auto",
14+
"singleAttributePerLine": false,
15+
"bracketSameLine": true,
16+
"jsxSingleQuote": false
17+
}

.vscode/settings.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.activeBackground": "#fbed80",
4+
"activityBar.background": "#fbed80",
5+
"activityBar.foreground": "#15202b",
6+
"activityBar.inactiveForeground": "#15202b99",
7+
"activityBarBadge.background": "#06b9a5",
8+
"activityBarBadge.foreground": "#15202b",
9+
"commandCenter.border": "#15202b99",
10+
"sash.hoverBorder": "#fbed80",
11+
"statusBar.background": "#f9e64f",
12+
"statusBar.foreground": "#15202b",
13+
"statusBarItem.hoverBackground": "#f7df1e",
14+
"statusBarItem.remoteBackground": "#f9e64f",
15+
"statusBarItem.remoteForeground": "#15202b",
16+
"titleBar.activeBackground": "#f9e64f",
17+
"titleBar.activeForeground": "#15202b",
18+
"titleBar.inactiveBackground": "#f9e64f99",
19+
"titleBar.inactiveForeground": "#15202b99"
20+
},
21+
"peacock.color": "#f9e64f",
22+
"editor.formatOnSave": true,
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"editor.codeActionsOnSave": {
25+
"source.fixAll.eslint": "explicit"
26+
},
27+
"[typescript]": {
28+
"editor.defaultFormatter": "esbenp.prettier-vscode"
29+
},
30+
"[html]": {
31+
"editor.defaultFormatter": "esbenp.prettier-vscode"
32+
}
33+
}

0 commit comments

Comments
 (0)