Skip to content

Commit ce60cce

Browse files
authored
Updated linting for project. (#107)
1 parent 2bcac6e commit ce60cce

File tree

129 files changed

+2176
-2073
lines changed

Some content is hidden

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

129 files changed

+2176
-2073
lines changed

.eslintrc.js

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,64 @@ module.exports = {
44
commonjs: true,
55
es2021: true,
66
node: true,
7+
'jest/globals': true,
78
},
8-
extends: ['eslint:recommended', 'plugin:react/recommended'],
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
12+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
13+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
14+
],
15+
plugins: ['react', '@typescript-eslint', 'jest', 'prettier'],
16+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
917
parserOptions: {
18+
ecmaVersion: 2020,
19+
sourceType: 'module',
1020
ecmaFeatures: {
11-
jsx: true,
21+
jsx: true, // Allows for the parsing of JSX
22+
},
23+
},
24+
settings: {
25+
react: {
26+
// Tells eslint-plugin-react to automatically detect the version of React to use
27+
version: 'detect',
1228
},
13-
ecmaVersion: 12,
14-
sourceType: 'module',
1529
},
16-
plugins: ['react'],
30+
// any directories/files to ignore goes here; node_modules ignore by default
31+
ignorePatterns: [],
1732
rules: {
18-
indent: ['warn', 2],
19-
'no-unused-vars': ['off', { vars: 'local' }],
33+
/**
34+
* Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
35+
* e.g. "@typescript-eslint/explicit-function-return-type": "off",
36+
*
37+
* "off" or 0 - turn the rule off
38+
* "warn" or 1 - turn the rule on as a warning(doesn’ t affect exit code)
39+
* "error" or 2 - turn the rule on as an error(exit code is 1 when triggered)
40+
**/
41+
42+
indent: 0, // set to 0 as eslint and prettier will conflict
2043
'prefer-const': 'warn',
21-
quotes: ['warn', 'single'],
22-
semi: ['warn', 'always'],
44+
quotes: [
45+
2,
46+
'single',
47+
{
48+
avoidEscape: true,
49+
allowTemplateLiterals: true,
50+
},
51+
],
52+
semi: 2,
2353
'space-infix-ops': 'warn',
2454
'no-console': 'off',
55+
// ----- REACT ----- //
56+
'react/prop-types': 0, // remove with TS usage
57+
58+
// ----- TYPESCRIPT ----- //
59+
'@typescript-eslint/no-var-requires': 0,
60+
61+
// ----- PRETTIER ----- //
62+
'prettier/prettier': ['error', { singleQuote: true }],
63+
64+
// ----- MISC ----- //
2565
'no-restricted-syntax': [
2666
'error',
2767
{
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.gitignore

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
.DS_Store
1+
node_modules/
22
build/
3+
coverage
4+
.DS_Store
5+
.env
6+
.idea/
7+
thumbs.db
38
dist/
4-
node_modules/
59
security/
6-
thumbs.db
7-
.idea/
8-
package-lock.json
9-
.webpack.config.js.icloud
10-
src/.index.js.icloud
11-
src/.store.js.icloud
12-
src/components/display/.RunningContainers.js.icloud
13-
src/components/display/.StoppedContainers.js.icloud
1410
src/database/docketeerdb
15-
.env
11+
package-lock.json
1612
yarn.lock

.husky/commit-msg

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

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
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

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
printWidth: 80,
3+
tabWidth: 2,
4+
singleQuote: true,
5+
trailingComma: "es5",
6+
bracketSpacing: true,
7+
semi: true,
8+
useTabs: false,
9+
};

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22

33
node_js:
44
- 16
5-
5+
66
env:
77
global: PATH=/opt/python/3.7.1/bin:$PATH
88

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.formatOnPaste": true,
3+
"editor.formatOnSave": true,
4+
"editor.formatOnType": true,
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": true
7+
}
8+
}

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

0 commit comments

Comments
 (0)