Skip to content

Commit 7ec1f91

Browse files
committed
feat(app): agrego configuracion de prettier, husky y commitlint
1 parent 3aa0c01 commit 7ec1f91

9 files changed

+4271
-1023
lines changed

Diff for: .eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"dist/",
1717
"vscode/",
1818
"src/vite-env.d.ts",
19-
"vite.config.ts"
19+
"vite.config.ts",
20+
"commitlint.config.js"
2021
],
2122
"parserOptions": {
2223
"ecmaVersion": "latest",

Diff for: .husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "${1}"

Diff for: .husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

Diff for: commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ["@commitlint/config-conventional"] };

Diff for: package-lock.json

+4,231-1,001
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
"name": "vamosacodearplanetas",
33
"private": true,
44
"version": "0.0.0",
5-
"type": "module",
65
"scripts": {
76
"dev": "vite",
87
"build": "tsc && vite build",
98
"preview": "vite preview",
109
"lint": "eslint --ignore-path .gitignore . --ext .js,.ts,.jsx,.tsx",
11-
"lint:fix": "npm run lint -- --fix"
10+
"format": "prettier --write '**/*.{ts,tsx,js,jsx}'",
11+
"lint:fix": "npm run lint -- --fix",
12+
"prepare": "husky install"
1213
},
1314
"dependencies": {
1415
"react": "18.2.0",
1516
"react-dom": "18.2.0",
1617
"wouter": "2.8.0-alpha.2"
1718
},
1819
"devDependencies": {
20+
"@commitlint/cli": "^17.0.3",
21+
"@commitlint/config-conventional": "^17.0.3",
1922
"@types/react": "18.0.17",
2023
"@types/react-dom": "18.0.6",
2124
"@typescript-eslint/eslint-plugin": "5.33.1",
@@ -28,6 +31,7 @@
2831
"eslint-plugin-n": "15.2.4",
2932
"eslint-plugin-promise": "6.0.0",
3033
"eslint-plugin-react": "7.30.1",
34+
"husky": "8.0.0",
3135
"lint-staged": "13.0.3",
3236
"postcss": "8.4.16",
3337
"prettier": "2.7.1",
@@ -36,6 +40,10 @@
3640
"vite": "3.0.7"
3741
},
3842
"lint-staged": {
39-
"*.(js|jsx|ts|tsx)": "npm run lint:fix"
43+
"*.(js|jsx|ts|tsx)": [
44+
"npm run lint:fix",
45+
"npm run format",
46+
"git add ."
47+
]
4048
}
4149
}

Diff for: src/App.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import './App.css'
1+
import { useState } from "react";
2+
import reactLogo from "./assets/react.svg";
3+
import "./App.css";
44

55
function App() {
6-
const [count, setCount] = useState(0)
6+
const [count, setCount] = useState(0);
77

88
return (
99
<div className="App">
1010
<div>
11-
<a href="https://vitejs.dev" target="_blank">
11+
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
1212
<img src="/vite.svg" className="logo" alt="Vite logo" />
1313
</a>
14-
<a href="https://reactjs.org" target="_blank">
14+
<a href="https://reactjs.org" target="_blank" rel="noreferrer">
1515
<img src={reactLogo} className="logo react" alt="React logo" />
1616
</a>
1717
</div>
@@ -28,7 +28,7 @@ function App() {
2828
Click on the Vite and React logos to learn more
2929
</p>
3030
</div>
31-
)
31+
);
3232
}
3333

34-
export default App
34+
export default App;

Diff for: src/main.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom/client'
3-
import App from './App'
4-
import './index.css'
1+
import React from "react";
2+
import ReactDOM from "react-dom/client";
3+
import App from "./App";
4+
import "./index.css";
55

6-
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
6+
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
77
<React.StrictMode>
88
<App />
99
</React.StrictMode>
10-
)
10+
);

Diff for: vite.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [react()]
7-
})
6+
plugins: [react()],
7+
});

0 commit comments

Comments
 (0)