Skip to content

Commit

Permalink
properly config eslint/prettier and fix files
Browse files Browse the repository at this point in the history
  • Loading branch information
vcapretz committed Jan 20, 2020
1 parent 60134e0 commit bcb169e
Show file tree
Hide file tree
Showing 13 changed files with 352 additions and 1,918 deletions.
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
static
16 changes: 14 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"extends": ["prettier"],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"plugins": ["prettier"],
"env": {
"es6": true,
"node": true,
"browser": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"prettier/prettier": "error"
"prettier/prettier": "error",
"react/prop-types": "off",
"react/display-name": "off"
},
"parserOptions": {
"ecmaVersion": 2018,
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
static
24 changes: 0 additions & 24 deletions dockest.js

This file was deleted.

5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
"scripts": {
"prepublishOnly": "rm -rf ./build && yarn build",
"prepare": "yarn build",
"test": "node ./dockest.js",
"build": "NODE_ENV=production webpack",
"build:watch": "NODE_ENV=production webpack --watch",
"lint": "prettier --check \"./**/*.js\" && eslint --ext .js .",
"start": "node example.js",
"start:dev": "concurrently \"yarn build:watch\" \"yarn start\"",
"start:example": "yarn build && yarn start"
},
"dependencies": {
Expand All @@ -42,13 +41,10 @@
"babel-preset-react-app": "^7.0.2",
"bull": "^3.12.1",
"bullmq": "^1.6.6",
"concurrently": "^4.1.2",
"css-loader": "^2.1.1",
"dockest": "^1.0.3",
"eslint": "^6.2.1",
"eslint-config-prettier": "^6.1.0",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.1",
"jest": "^24.9.0",
"eslint-plugin-react": "^7.18.0",
"prettier": "^1.18.2",
"react-dev-utils": "^8.0.0",
"style-loader": "^0.23.1",
Expand Down
19 changes: 0 additions & 19 deletions routes/queues.spec.js

This file was deleted.

2 changes: 1 addition & 1 deletion ui/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function App({ basePath }) {
retryJob,
retryAll,
cleanAllDelayed,
cleanAllFailed
cleanAllFailed,
} = useStore(basePath)

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const fieldComponents = {
</Highlight>
)
},
retry: ({ job, retryJob }) => {
retry: ({ retryJob }) => {
return <button onClick={retryJob}>Retry</button>
},
}
Expand Down
4 changes: 2 additions & 2 deletions ui/components/RedisStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getMemoryUsage(used_memory, total_system_memory) {
}

export default function RedisStats({ stats }) {
if (stats == null || Object.entries(queues).length == 0) {
if (stats == null || Object.entries(stats).length == 0) {
return 'No stats to display'
}

Expand All @@ -61,7 +61,7 @@ export default function RedisStats({ stats }) {
<div className="box">
Memory usage
<h2>{getMemoryUsage(used_memory, total_system_memory)}</h2>
{Boolean(total_system_memory) ? (
{total_system_memory ? (
<small>
{formatBytes(parseInt(used_memory))} of{' '}
{formatBytes(parseInt(total_system_memory))}
Expand Down
12 changes: 6 additions & 6 deletions ui/components/hooks/useStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export default function useStore(basePath) {
)

const cleanAllDelayed = queueName => () =>
fetch(`${basePath}/queues/${queueName}/clean/delayed`, { method: 'put' }).then(
update,
)
fetch(`${basePath}/queues/${queueName}/clean/delayed`, {
method: 'put',
}).then(update)

const cleanAllFailed = queueName => () =>
fetch(`${basePath}/queues/${queueName}/clean/failed`, { method: 'put' }).then(
update,
)
fetch(`${basePath}/queues/${queueName}/clean/failed`, {
method: 'put',
}).then(update)

return {
state,
Expand Down
Loading

0 comments on commit bcb169e

Please sign in to comment.