Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint code #246

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c688af5
lint code
MlondiMchunu Oct 30, 2024
89267b8
commit workflows
MlondiMchunu Oct 30, 2024
7426a1b
Delete .github/workflows/hello.yml
MlondiMchunu Oct 30, 2024
1d6d3fe
workflows
MlondiMchunu Oct 30, 2024
b579701
Update hello.yml
MlondiMchunu Oct 30, 2024
25fc51c
Create hello.yml
MlondiMchunu Oct 30, 2024
b641b23
deleted edundant workflow file
MlondiMchunu Oct 30, 2024
521b830
commit homepage changes
MlondiMchunu Dec 5, 2024
d22ac60
Delete .github/workflows/hello.yml
MlondiMchunu Dec 6, 2024
72c025a
Create workflows
MlondiMchunu Dec 6, 2024
a1e40fe
Delete .github directory
MlondiMchunu Dec 6, 2024
f66dbbb
Create workflows
MlondiMchunu Dec 6, 2024
76787d1
Delete .github/workflows
MlondiMchunu Dec 6, 2024
ba6ba49
Create hello.yml
MlondiMchunu Dec 6, 2024
9866772
latest
MlondiMchunu Dec 6, 2024
b850860
Update hello.yml
MlondiMchunu Dec 6, 2024
39cf76e
Update hello.yml
MlondiMchunu Dec 6, 2024
12c6326
Update hello.yml
MlondiMchunu Dec 6, 2024
36a899f
Update hello.yml
MlondiMchunu Dec 6, 2024
2b1e567
Update hello.yml
MlondiMchunu Dec 6, 2024
103c5e1
Update hello.yml
MlondiMchunu Dec 6, 2024
19b907c
Update hello.yml
MlondiMchunu Dec 6, 2024
ed9428f
Update hello.yml
MlondiMchunu Dec 6, 2024
6d5ddc3
Create pipeline.yml
MlondiMchunu Dec 6, 2024
9cb38c6
Update pipeline.yml
MlondiMchunu Dec 6, 2024
cb84976
Update pipeline.yml
MlondiMchunu Dec 6, 2024
10e7531
Update pipeline.yml
MlondiMchunu Dec 6, 2024
c2f7458
Update pipeline.yml
MlondiMchunu Dec 6, 2024
85e1a8b
Update pipeline.yml
MlondiMchunu Dec 6, 2024
af5b541
Update pipeline.yml
MlondiMchunu Dec 6, 2024
89e50e7
Update package.json
MlondiMchunu Dec 6, 2024
75af046
Update pipeline.yml
MlondiMchunu Dec 6, 2024
19f3c1a
Update package.json
MlondiMchunu Dec 6, 2024
e97c44c
Update pipeline.yml
MlondiMchunu Dec 6, 2024
63ba5cc
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
e046b84
Update pipeline.yml
MlondiMchunu Dec 6, 2024
230f43a
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
bb2e573
Update pipeline.yml
MlondiMchunu Dec 6, 2024
e5edbe1
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
fb8b47e
Update and rename .eslintrc.js to eslint.config.mjs
MlondiMchunu Dec 6, 2024
bce8e4b
Update pipeline.yml
MlondiMchunu Dec 6, 2024
c4d30fa
Update eslint.config.mjs
MlondiMchunu Dec 6, 2024
145178b
Update pipeline.yml
MlondiMchunu Dec 6, 2024
9878b31
Rename eslint.config.mjs to eslint.config.js
MlondiMchunu Dec 6, 2024
f24fbf8
Update pipeline.yml
MlondiMchunu Dec 6, 2024
581046e
Update and rename eslint.config.js to eslintrc.js
MlondiMchunu Dec 6, 2024
eaab69e
Update eslintrc.js
MlondiMchunu Dec 6, 2024
8e2b392
Update pipeline.yml
MlondiMchunu Dec 6, 2024
ac189a2
Rename eslintrc.js to .eslintrc.js
MlondiMchunu Dec 6, 2024
dc4214b
Update pipeline.yml
MlondiMchunu Dec 6, 2024
f06c601
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
e990da3
Update pipeline.yml
MlondiMchunu Dec 6, 2024
de345bd
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
3969d50
Update pipeline.yml
MlondiMchunu Dec 6, 2024
90742ea
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
84df30b
Update pipeline.yml
MlondiMchunu Dec 6, 2024
ec4fa76
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
c3974d4
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
d081208
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
5d7c57a
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
287b115
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
22667f2
Update pipeline.yml
MlondiMchunu Dec 6, 2024
1c7eb75
Update pipeline.yml
MlondiMchunu Dec 6, 2024
f90f7f8
Update .eslintrc.js
MlondiMchunu Dec 6, 2024
805396f
Update pipeline.yml
MlondiMchunu Dec 6, 2024
39c40c4
Update pipeline.yml
MlondiMchunu Dec 6, 2024
1ce21f0
Update PokemonPage.jsx
MlondiMchunu Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"jest/globals": true
'env': {
'browser': true,
'es6': true,
'jest/globals': true,
'node':true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
"ecmaVersion": 2018,
"sourceType": "module"
'ecmaVersion': 2018,
'sourceType': 'module'
},
"plugins": [
"react", "jest"
'plugins': [
'react', 'jest'
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
'rules': {
'indent': [
'error',
2
],
"quotes": [
"error",
"single"
'linebreak-style': [
'error',
'unix'
],
"semi": [
"error",
"never"
'quotes': [
'error',
'single'
],
"eqeqeq": "error",
"no-trailing-spaces": "error",
"object-curly-spacing": [
"error", "always"
'semi': [
'error',
'never'
],
"arrow-spacing": [
"error", { "before": true, "after": true }
'eqeqeq': 'error',
'no-trailing-spaces': 'warn',
'object-curly-spacing': [
'error', 'always'
],
"no-console": "error",
"react/prop-types": 0
'arrow-spacing': [
'error', { 'before': true, 'after': true }
],
'no-console': 'off',
'react/prop-types': 0,
'no-unused-vars':'warn'
}
}
22 changes: 22 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Hello World!
run-name: ${{github.actor }} is running GitHub Actions

on:
push:
branches:
- main

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"
- name: Print date
run: |
date
- name: Print directory
run: |
ls -a

25 changes: 25 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deployment pipeline

on:
push:
branches:
- main

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- run: npm install eslint @eslint/js --save-dev
- run: npx eslint --init
- run: npm run eslint
- name: build
run: npm run build
- name: test
run: npm run test

12 changes: 6 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const express = require("express");
const app = express();
const express = require('express')
const app = express()

// get the port from env variable
const PORT = process.env.PORT || 5000;
const PORT = process.env.PORT || 5000

app.use(express.static("dist"));
app.use(express.static('dist'))

app.listen(PORT, () => {
console.log(`server started on port ${PORT}`);
});
console.log(`server started on port ${PORT}`)
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"start-prod": "node app.js",
"test": "jest",
"eslint": "eslint './**/*.{js,jsx}'",
"build": "webpack --mode production"
"build": "webpack --mode production",
"dev":"nodemon node app.js"
},
"repository": {
"type": "git",
Expand Down
10 changes: 7 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Pokemon</title>
</head>

<body>
<div id="app"></div>
<footer>Pokémon and Pokémon character names are trademarks of Nintendo.</footer>
<h1>Pokemon Game</h1>
<div id="app"></div>
<footer>Pokémon and Pokémon character names are trademarks of Nintendo.</footer>
</body>
</html>

</html>
2 changes: 1 addition & 1 deletion src/PokemonPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const PokemonPage = ({ previous, next }) => {
<div className="links">
{previous && <Link to={`/pokemon/${previous.name}`}>Previous</Link>}
<Link to="/">Home</Link>
{next && <Link to={`/pokemon/${previous.name}`}>Next</Link>}
{next && <Link to={`/pokemon/${next.name}`}>Next</Link>}
</div>
<div className={`pokemon-page pokemon-type-${type.name}`}>
<div className="pokemon-image" style={{ backgroundImage: `url(${pokemon.sprites.front_default})` }} />
Expand Down