From 143f642cd83ed6797fa8dd5fd7295e86580af49d Mon Sep 17 00:00:00 2001 From: DinaX Date: Fri, 24 Nov 2023 22:11:44 +0000 Subject: [PATCH 1/2] nova branch + pipeline com prettier --- .github/workflows/node.js.yml | 24 ++++++++++++++++++++++++ package-lock.json | 20 ++++++++++++++++++++ package.json | 1 + public/index.html | 24 ++---------------------- src/App.js | 18 ++---------------- src/logo.svg | 1 - 6 files changed, 49 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/node.js.yml delete mode 100644 src/logo.svg diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..854deea --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,24 @@ + +name: Node.js CI + +on: + push: + branches: ['**'] + pull_request: + branches: ['main'] + +jobs: + setup-inicial: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm install + - run: npx prettier . --write + - run: npx prettier . --check + - run: npm run lint diff --git a/package-lock.json b/package-lock.json index a0a4a8c..db74fd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "prettier": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", @@ -14339,6 +14340,20 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -27952,6 +27967,11 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, + "prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==" + }, "pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", diff --git a/package.json b/package.json index ceb5ce6..eb9ce4c 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "prettier": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", diff --git a/public/index.html b/public/index.html index aa069f2..e778602 100644 --- a/public/index.html +++ b/public/index.html @@ -10,34 +10,14 @@ content="Web site created using create-react-app" /> - + - - React App + MP2 Dinis Antunes
- diff --git a/src/App.js b/src/App.js index 3784575..8a4779a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,23 +1,9 @@ -import logo from './logo.svg'; -import './App.css'; +import "./App.css"; function App() { return (
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
+

boas mp2

); } diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From d247ff74e43dd6c14479c41e8d2c0ed5c66f48ef Mon Sep 17 00:00:00 2001 From: DinaX Date: Fri, 24 Nov 2023 22:16:55 +0000 Subject: [PATCH 2/2] eslint na pipeline --- package-lock.json | 3 +++ package.json | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index db74fd9..71558e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,9 @@ "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" + }, + "devDependencies": { + "eslint": "^8.54.0" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index eb9ce4c..cb576cc 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "lint": "eslint ." }, "eslintConfig": { "extends": [ @@ -35,5 +36,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "eslint": "^8.54.0" } }