Skip to content

Commit b6d8633

Browse files
authored
Added esltint configuration (#125)
1 parent 6fc400b commit b6d8633

File tree

138 files changed

+2338
-13268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2338
-13268
lines changed

.eslintrc.js

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,61 @@ module.exports = {
33
browser: true,
44
commonjs: true,
55
es2021: true,
6-
node: true,
6+
node: true
77
},
8-
extends: ['eslint:recommended', 'plugin:react/recommended'],
8+
extends: [
9+
'plugin:react/recommended',
10+
'standard-with-typescript'
11+
],
12+
overrides: [
13+
],
914
parserOptions: {
10-
ecmaFeatures: {
11-
jsx: true,
12-
},
15+
project: ['tsconfig.json'],
1316
ecmaVersion: 12,
14-
sourceType: 'module',
17+
sourceType: 'module'
18+
},
19+
plugins: [
20+
'react'
21+
],
22+
settings: {
23+
react: {
24+
version: 'detect'
25+
}
1526
},
16-
plugins: ['react'],
1727
rules: {
18-
indent: ['warn', 2],
28+
indent: ['error', 2, { SwitchCase: 1 }],
1929
'no-unused-vars': ['off', { vars: 'local' }],
2030
'prefer-const': 'warn',
2131
quotes: ['warn', 'single'],
22-
semi: ['warn', 'always'],
32+
semi: 'off',
2333
'space-infix-ops': 'warn',
2434
'no-console': 'off',
2535
'no-restricted-syntax': [
2636
'error',
2737
{
2838
selector:
29-
"CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
30-
message: 'Unexpected property on console object was called',
31-
},
39+
'CallExpression[callee.object.name=\'console\'][callee.property.name!=/^(log|warn|error|info|trace)$/]',
40+
message: 'Unexpected property on console object was called'
41+
}
3242
],
3343
'spaced-comment': [
3444
'error',
3545
'always',
3646
{
3747
line: {
3848
markers: ['/'],
39-
exceptions: ['-', '+'],
49+
exceptions: ['-', '+']
4050
},
4151
block: {
4252
markers: ['!'],
4353
exceptions: ['*'],
44-
balanced: true,
45-
},
46-
},
54+
balanced: true
55+
}
56+
}
4757
],
48-
},
58+
59+
// ---- TYPESCRIPT ---- //
60+
'@typescript-eslint/explicit-function-return-type': 'off',
61+
'@typescript-eslint/semi': ['warn', 'always']
62+
}
4963
};

.gitignore

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,16 @@
11
node_modules/
2-
security/
3-
thumbs.db
4-
.idea/
52
package-lock.json
6-
.webpack.config.js.icloud
7-
src/.index.js.icloud
8-
src/.store.js.icloud
9-
src/components/display/.RunningContainers.js.icloud
10-
src/components/display/.StoppedContainers.js.icloud
3+
yarn.lock
4+
5+
.history
6+
.gitignore
7+
.DS_Store
8+
119
src/database/docketeerdb
1210
server/database/docketeerdb
13-
.env
14-
.idea/
15-
thumbs.db
1611
dist/
17-
node_modules/
1812
security/
19-
thumbs.db
20-
.idea/
21-
package-lock.json
22-
.webpack.config.js.icloud
23-
src/.index.js.icloud
24-
src/.store.js.icloud
25-
src/components/display/.RunningContainers.js.icloud
26-
src/components/display/.StoppedContainers.js.icloud
27-
src/database/docketeerdb
2813
.env
29-
yarn.lock
14+
3015
coverage
3116

32-
.history
33-
src/.DS_Store
34-
.gitignore
35-
src/.DS_Store

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
{
2-
"workbench.localHistory.enabled": true
2+
"workbench.localHistory.enabled": true,
3+
"editor.tabSize": 2,
4+
"editor.formatOnSave": true,
5+
"editor.formatOnPaste": true,
6+
"editor.formatOnType": true,
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": true
9+
}
310
}

README.md

Lines changed: 19 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ awesome when someone starts to use it.
2323

2424
#
2525

26-
<!-- ![logo](https://user-images.githubusercontent.com/67434664/94055454-f7177a00-fdaa-11ea-95dd-1d4980400812.png) -->
27-
2826
![logo](assets/docketeer-title2.png)
2927

3028
## About
@@ -100,30 +98,6 @@ npm run dev
10098

10199
For now, the sign up function will create a System Admin user.
102100

103-
104-
## Returning Users: Version Update
105-
1. Navigate to the project directory and **add upstream** this [repository](https://github.com/open-source-labs/Docketeer.git) to your cloned fork.
106-
```
107-
git remote add upstream https://github.com/open-source-labs/Docketeer.git
108-
```
109-
110-
2. Pull down the updates.
111-
```
112-
git pull origin upstream
113-
```
114-
115-
3. Install new dependencies.
116-
```
117-
npm install
118-
```
119-
120-
4. You are all set! Now just enter the following command to start up Docketeer!
121-
```
122-
npm run dev
123-
```
124-
125-
126-
127101
## Twilio setup
128102
1. Follow documents found [here](https://www.twilio.com/docs/node/install) to download the helper library.
129103
2. In order to manage Twilio SMS notifications follow the [step plan](https://www.twilio.com/docs/notify/quickstart/sms#messagingservice).
@@ -191,24 +165,7 @@ npm run test
191165
Read our [contributing guide](https://github.com/open-source-labs/Docketeer/blob/master/CONTRIBUTING.md) for more information on how to purpose bugfixes and improvements to Docketeer.
192166

193167
### Authors
194-
- Nathan Cho [@nathanycho](https://github.com/nathanycho) | [LinkedIn](https://www.linkedin.com/in/nathanycho/)
195-
- Garima Bhatia [@GarimaB06](https://github.com/GarimaB06) | [LinkedIn](https://www.linkedin.com/in/garimab06/)
196-
- Eshaan Joshi [@eshaan32](https://github.com/eshaan32) | [LinkedIn](https://www.linkedin.com/in/eshaanjoshi/)
197-
- Jonathan Wong [@WongJonathann](https://github.com/WongJonathann) | [LinkedIn](https://www.linkedin.com/in/jon-wong-00/)
198-
- Sarah Moosa [@Sbethm](https://github.com/Sbethm) | [LinkedIn](https://www.linkedin.com/in/sarah-moosa-4b05721b6/)
199-
- Cedar Cooper [@CedarCooper](https://github.com/CedarCooper) | [LinkedIn](https://www.linkedin.com/in/cedar-cooper/)
200-
- Tiffany Chau [@tiffanynchau](https://github.com/tiffanynchau/) | [LinkedIn](https://www.linkedin.com/in/tiffanynchau/)
201-
- Jack Yuan [@jackyuan1](https://github.com/jackyuan1) | [LinkedIn](https://www.linkedin.com/in/jack-yuan-298244247/)
202-
- Drew Manley [@DrewManley](https://github.com/DrewManley) | [LinkedIn](https://www.linkedin.com/in/andrewmanley13/)
203-
- Abigail Gerig [@4estgirl](https://github.com/4estgirl) | [Linkedin](https://www.linkedin.com/in/abigail-gerig/)
204-
- Trine Medina [@TrineMedina](https://github.com/TrineMedina) | [Linkedin](https://www.linkedin.com/in/trinemedina/)
205-
- Christian Looff [@cmlooff](https://github.com/cmlooff) | [LinkedIn](https://www.linkedin.com/in/christian-looff/)
206-
- Reuel Warner-Rosen [@Ruliwr](https://github.com/Ruliwr) | [Linkedin](https://www.linkedin.com/in/Ruliwr/)
207-
- Matt Dias [@Schmang13](https://github.com/Schmang13) | [Linkedin](https://www.linkedin.com/in/matthew-j-dias/)
208-
- Christina Son [@cson17](https://github.com/cson17) | [Linkedin](https://www.linkedin.com/in/christinason17/)
209-
- Fernando Luna [@lunaf-github](https://github.com/lunaf-github) | [Linkedin](https://www.linkedin.com/in/fernando-luna)
210-
- Austin Andrews [@austinandrews](https://github.com/austinandrews) | [Linkedin](https://www.linkedin.com/in/austinandrews17/)
211-
- Eric Lay [@ericlay14](https://github.com/ericlay14) | [Linkedin](https://www.linkedin.com/in/ericlay14/)
168+
<!-- Most recent contributors please add your name to the BOTTOM of the list -->
212169
- Dan Lin [@DanLin91](https://github.com/DanLin91) | [Linkedin](https://www.linkedin.com/in/danlin91/)
213170
- Kadir Gundogdu [@kadirgund](https://github.com/kadirgund) | [Linkedin](https://www.linkedin.com/in/kadirgund/)
214171
- Minchan Jun [@MinchanJun](https://github.com/MinchanJun) | [Linkedin](https://www.linkedin.com/in/minchan-jun/)
@@ -232,6 +189,24 @@ Read our [contributing guide](https://github.com/open-source-labs/Docketeer/blob
232189
- Dylan Feldman [@dfeldman24](https://github.com/dfeldman24) | [Linkedin](https://www.linkedin.com/in/dylan-feldman)
233190
- Tre Hultzen [@THultz](https://github.com/THultz) | [Linkedin](https://www.linkedin.com/in/tre-hultzen/)
234191
- Kenneth Hui [@kennethhui121](https://github.com/kennethhui121) | [Linkedin](https://www.linkedin.com/in/kenneth-hui/)
192+
- Eric Lay [@ericlay14](https://github.com/ericlay14) | [Linkedin](https://www.linkedin.com/in/ericlay14/)
193+
- Austin Andrews [@austinandrews](https://github.com/austinandrews) | [Linkedin](https://www.linkedin.com/in/austinandrews17/)
194+
- Fernando Luna [@lunaf-github](https://github.com/lunaf-github) | [Linkedin](https://www.linkedin.com/in/fernando-luna)
195+
- Christina Son [@cson17](https://github.com/cson17) | [Linkedin](https://www.linkedin.com/in/christinason17/)
196+
- Christian Looff [@cmlooff](https://github.com/cmlooff) | [LinkedIn](https://www.linkedin.com/in/christian-looff/)
197+
- Reuel Warner-Rosen [@Ruliwr](https://github.com/Ruliwr) | [Linkedin](https://www.linkedin.com/in/Ruliwr/)
198+
- Trine Medina [@TrineMedina](https://github.com/TrineMedina) | [Linkedin](https://www.linkedin.com/in/trinemedina/)
199+
- Matt Dias [@Schmang13](https://github.com/Schmang13) | [Linkedin](https://www.linkedin.com/in/matthew-j-dias/)
200+
- Abigail Gerig [@4estgirl](https://github.com/4estgirl) | [Linkedin](https://www.linkedin.com/in/abigail-gerig/)
201+
- Jack Yuan [@jackyuan1](https://github.com/jackyuan1) | [LinkedIn](https://www.linkedin.com/in/jack-yuan-298244247/)
202+
- Sarah Moosa [@Sbethm](https://github.com/Sbethm) | [LinkedIn](https://www.linkedin.com/in/sarah-moosa-4b05721b6/)
203+
- Cedar Cooper [@CedarCooper](https://github.com/CedarCooper) | [LinkedIn](https://www.linkedin.com/in/cedar-cooper/)
204+
- Tiffany Chau [@tiffanynchau](https://github.com/tiffanynchau/) | [LinkedIn](https://www.linkedin.com/in/tiffanynchau/)
205+
- Drew Manley [@DrewManley](https://github.com/DrewManley) | [LinkedIn](https://www.linkedin.com/in/andrewmanley13/)
206+
- Eshaan Joshi [@eshaan32](https://github.com/eshaan32) | [LinkedIn](https://www.linkedin.com/in/eshaanjoshi/)
207+
- Garima Bhatia [@GarimaB06](https://github.com/GarimaB06) | [LinkedIn](https://www.linkedin.com/in/garimab06/)
208+
- Nathan Cho [@nathanycho](https://github.com/nathanycho) | [LinkedIn](https://www.linkedin.com/in/nathanycho/)
209+
- Jonathan Wong [@WongJonathann](https://github.com/WongJonathann) | [LinkedIn](https://www.linkedin.com/in/jon-wong-00/)
235210

236211
### License
237212
Docketeer is [MIT Licensed](https://github.com/open-source-labs/Docketeer/blob/master/LICENSE)

__tests__/ContainersTab.test.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import Containers from '../src/components/tabs/Containers';
3-
import {describe, beforeEach, expect, test, jest} from '@jest/globals';
3+
import { describe, beforeEach, expect, test, jest } from '@jest/globals';
44
import '@testing-library/jest-dom';
55
import ToggleDisplay from '../src/components/display/ToggleDisplay';
66
import { fireEvent, render, screen } from '@testing-library/react';
@@ -21,43 +21,40 @@ const props = {
2121
stoppedList: [
2222
{
2323
Names: 'zealous',
24-
ID: 'c902ec744095',
25-
Image: '84c5f6e03bf0',
26-
RunningFor: '2 days ago',
24+
ID: 'c902ec744095',
25+
Image: '84c5f6e03bf0',
26+
RunningFor: '2 days ago'
2727
}
2828
],
29-
container: {MemUsage:1},
29+
container: { MemUsage: 1 },
3030
stop: jest.fn(),
3131
remove: jest.fn(),
3232
runStopped: jest.fn()
3333
};
3434

35-
3635
describe('Containers', () => {
37-
38-
beforeEach(()=>{
36+
beforeEach(() => {
3937
render(<Containers {...props} />);
4038
});
4139

4240
describe('Running List containers', () => {
43-
4441
test('Should have render correct amount of running containers', () => {
45-
const runningContainers = screen.getByText('Running Containers', {exact:false});
42+
const runningContainers = screen.getByText('Running Containers', { exact: false });
4643
const text = runningContainers.innerHTML;
4744
expect(text).toEqual(`Running Containers: ${props.runningList.length}`);
4845
});
4946

50-
test('Name of container should properly display', ()=>{
47+
test('Name of container should properly display', () => {
5148
const h3 = screen.getAllByRole('heading', { level: 3 });
5249
const name = h3[0].innerHTML;
5350
expect(name).toEqual('blissful_matsumoto');
5451
});
5552

56-
test('Stop button is called', async () => {
53+
test('Stop button is called', async () => {
5754
const stopButton = document.querySelector('.stop-btn');
5855
await fireEvent.click(stopButton);
5956
});
60-
57+
6158
test('Toggle Display button works', () => {
6259
render(<ToggleDisplay {...props}/>);
6360
const button = screen.getAllByRole('button');
@@ -69,9 +66,8 @@ describe('Containers', () => {
6966
});
7067

7168
describe('Stopped List Containers', () => {
72-
7369
test('Should have render correct amount of containers', () => {
74-
const exitedContainers = screen.getByText('Exited Containers', {exact:false});
70+
const exitedContainers = screen.getByText('Exited Containers', { exact: false });
7571
const text = exitedContainers.innerHTML;
7672
expect(text).toEqual(`Exited Containers: ${props.stoppedList.length}`);
7773
});
@@ -91,5 +87,4 @@ describe('Containers', () => {
9187
expect(removeButton).toBeCalled;
9288
});
9389
});
94-
});
95-
90+
});

__tests__/ImageTab.test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Images from '../src/components/tabs/Images';
55
import {
66
fireEvent,
77
render,
8-
screen,
8+
screen
99
} from '@testing-library/react';
1010

1111
const props = {
@@ -14,16 +14,15 @@ const props = {
1414
imgid: '2718634043dc',
1515
size: '111 MB',
1616
reps: 'Redis',
17-
tag: 16.4,
18-
},
17+
tag: 16.4
18+
}
1919
],
2020
runIm: jest.fn(),
2121
removeIm: jest.fn(),
22-
onClick: jest.fn(),
22+
onClick: jest.fn()
2323
};
2424

2525
describe('Images', () => {
26-
2726
beforeEach(() => {
2827
render(<Images {...props} />);
2928
screen.debug();
@@ -48,7 +47,6 @@ describe('Images', () => {
4847
});
4948
});
5049

51-
5250
describe('Remove button on click', () => {
5351
test('Fires remove button functionality', async () => {
5452
const removeButton = screen.getByRole('button', { name: 'REMOVE' });
@@ -80,4 +78,4 @@ describe('Images', () => {
8078
expect(tag).toBeDefined;
8179
});
8280
});
83-
});
81+
});

0 commit comments

Comments
 (0)