Skip to content

Commit c6cab8b

Browse files
authored
eslint setup (#98)
* eslint & prettier setup with husky * eslint * added husky pre-commit script * execuatable file * configured * added node version manager file * upgraded node version in .nvmrc * upgraded node version in .nvmrc * removed eslint package
1 parent e9cfc73 commit c6cab8b

37 files changed

+13282
-5287
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/**

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true
5+
},
6+
"extends": ["plugin:react/recommended", "airbnb"],
7+
"globals": {
8+
"Atomics": "readonly",
9+
"SharedArrayBuffer": "readonly"
10+
},
11+
"parserOptions": {
12+
"ecmaFeatures": {
13+
"jsx": true
14+
},
15+
"ecmaVersion": 2018,
16+
"sourceType": "module"
17+
},
18+
"plugins": ["react"],
19+
"rules": {
20+
"trailing-comma": 0
21+
}
22+
}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint:test

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run prepush

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.17.0

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/build
2+
/coverage
3+
/node_modules/**

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": true,
4+
"singleQuote": false,
5+
"tabWidth": 2,
6+
"trailingComma": "all",
7+
"bracketSpacing": false
8+
}

package-lock.json

Lines changed: 11083 additions & 4081 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
"build": "react-scripts build && cp build/index.html build/404.html",
2626
"eject": "react-scripts eject",
2727
"netlify": "npm run build && netlify deploy --dir build && netlify deploy --prod --dir build",
28-
"deploy": "npm run netlify"
28+
"deploy": "npm run netlify",
29+
"lint:test": "eslint . --ext .js --ext .jsx",
30+
"lint:fix": "eslint . --ext .js --ext .jsx --fix",
31+
"prettier": "prettier src/**/*.{js, jsx} --write",
32+
"precommit": "npm run lint:fix && npm run prettier",
33+
"prepush": "npm run lint:test",
34+
"prepare": "husky install"
2935
},
3036
"eslintConfig": {
3137
"extends": "react-app"
@@ -41,5 +47,17 @@
4147
"last 1 firefox version",
4248
"last 1 safari version"
4349
]
50+
},
51+
"devDependencies": {
52+
"eslint-config-airbnb": "^19.0.4",
53+
"eslint-config-prettier": "^8.5.0",
54+
"eslint-plugin-import": "^2.26.0",
55+
"eslint-plugin-jsx-a11y": "^6.6.1",
56+
"eslint-plugin-prettier": "^4.2.1",
57+
"eslint-plugin-react": "^7.31.10",
58+
"eslint-plugin-react-hooks": "^4.6.0",
59+
"husky": "^8.0.1",
60+
"lint-staged": "^13.0.3",
61+
"prettier": "2.7.1"
4462
}
4563
}

src/Components/Footer.js

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@ import {
99
} from 'react-feather';
1010
import ReactTooltip from 'react-tooltip';
1111

12-
const Footer = () => {
12+
function Footer() {
1313
return (
14-
<footer className='footer'>
15-
<ReactTooltip type='light' />
16-
<p className='has-text-centered is-size-4 has-text-grey-light'>• • •</p>
17-
<div className='column'>
18-
<div className='buttons is-centered'>
14+
<footer className="footer">
15+
<ReactTooltip type="light" />
16+
<p className="has-text-centered is-size-4 has-text-grey-light">• • •</p>
17+
<div className="column">
18+
<div className="buttons is-centered">
1919
<a
20-
href='https://www.facebook.com/binu.kumar.90857'
21-
target='_blank'
22-
rel='noopener noreferrer'
23-
className='button button-special is-rounded box-shadow-lift'
24-
data-tip='connect on Facebook 🦸‍♂'
20+
href="https://www.facebook.com/binu.kumar.90857"
21+
target="_blank"
22+
rel="noopener noreferrer"
23+
className="button button-special is-rounded box-shadow-lift"
24+
data-tip="connect on Facebook 🦸‍♂"
2525
>
26-
<Facebook color='blue' className='icon' />
26+
<Facebook color="blue" className="icon" />
2727
</a>
2828
<a
29-
href='https://www.instagram.com/krbinu42/'
30-
target='_blank'
31-
rel='noopener noreferrer'
32-
className='button button-special is-rounded box-shadow-lift'
33-
data-tip='connect on Instagram 🎉'
29+
href="https://www.instagram.com/krbinu42/"
30+
target="_blank"
31+
rel="noopener noreferrer"
32+
className="button button-special is-rounded box-shadow-lift"
33+
data-tip="connect on Instagram 🎉"
3434
>
35-
<Instagram color='#C74B91' className='icon' />
35+
<Instagram color="#C74B91" className="icon" />
3636
</a>
3737
<a
38-
href='https://github.com/Binu42'
39-
target='_blank'
40-
rel='noopener noreferrer'
41-
className='button button-special is-rounded box-shadow-lift'
42-
data-tip='connect on Github ❤️'
38+
href="https://github.com/Binu42"
39+
target="_blank"
40+
rel="noopener noreferrer"
41+
className="button button-special is-rounded box-shadow-lift"
42+
data-tip="connect on Github ❤️"
4343
>
44-
<GitHub className='icon' />
44+
<GitHub className="icon" />
4545
</a>
4646
<a
47-
href='https://twitter.com/kbinu42'
48-
target='_blank'
49-
rel='noopener noreferrer'
50-
className='button button-special is-rounded box-shadow-lift'
51-
data-tip='connect on Twitter 🤷‍♂️'
47+
href="https://twitter.com/kbinu42"
48+
target="_blank"
49+
rel="noopener noreferrer"
50+
className="button button-special is-rounded box-shadow-lift"
51+
data-tip="connect on Twitter 🤷‍♂️"
5252
>
53-
<Twitter color='#1DA1F2' className='icon' />
53+
<Twitter color="#1DA1F2" className="icon" />
5454
</a>
5555
<a
56-
href='https://www.linkedin.com/in/binukumar/'
57-
target='_blank'
58-
rel='noopener noreferrer'
59-
className='is-hidden-touch button button-special is-rounded box-shadow-lift'
60-
data-tip='connect on Linkedin 👨‍⚖️'
56+
href="https://www.linkedin.com/in/binukumar/"
57+
target="_blank"
58+
rel="noopener noreferrer"
59+
className="is-hidden-touch button button-special is-rounded box-shadow-lift"
60+
data-tip="connect on Linkedin 👨‍⚖️"
6161
>
62-
<Linkedin color='#0077B5' className='icon' />
62+
<Linkedin color="#0077B5" className="icon" />
6363
</a>
6464
</div>
6565
</div>
@@ -68,22 +68,27 @@ const Footer = () => {
6868
This Project is just for Learning and teaching purposes.
6969
</p>
7070
</div> */}
71-
<div className='column has-text-centered'>
72-
<p className='menu-label'>
73-
Made with <Heart color='red' fill='red' size='15px' />{' '}
71+
<div className="column has-text-centered">
72+
<p className="menu-label">
73+
Made with
74+
{' '}
75+
<Heart color="red" fill="red" size="15px" />
76+
{' '}
7477
<a
75-
href='https://binu42.netlify.com'
76-
target='_blank'
77-
rel='noopener noreferrer'
78+
href="https://binu42.netlify.com"
79+
target="_blank"
80+
rel="noopener noreferrer"
7881
>
7982
By Binu Kumar
80-
</a>{' '}
83+
</a>
84+
{' '}
8185
<br />
82-
&copy;{new Date().getFullYear()}
86+
&copy;
87+
{new Date().getFullYear()}
8388
</p>
8489
</div>
8590
</footer>
8691
);
87-
};
92+
}
8893

8994
export default Footer;

0 commit comments

Comments
 (0)