Skip to content

Commit

Permalink
fix: Linting with eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSusa committed Aug 9, 2020
1 parent 0f04389 commit 00a8031
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"node": true,
"es6": true
},
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended"],
"extends": ["eslint:recommended", "plugin:react/recommended"],

"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
Expand Down Expand Up @@ -70,15 +70,15 @@
"import/named": 0,
"import/namespace": 0,
"import/no-unresolved": 0,
"import/no-named-as-default": 2,
// "import/no-named-as-default": 2,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"jsx-a11y/interactive-supports-focus": 1,
// "jsx-a11y/interactive-supports-focus": 1,
"max-len": 0,
"new-cap": [
0,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"webmidi": "2.5.1"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"chai": "4.2.0",
"concurrently": "^4.1.0",
"electron": "9.2.0",
Expand All @@ -42,6 +43,7 @@
"eslint-plugin-babel": "latest",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.20.5",
"eslint-plugin-react-hooks": "latest",
"eslint-plugin-unicorn": "latest",
"lerna": "^3.13.4",
Expand Down
3 changes: 0 additions & 3 deletions packages/midi-bricks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"analyze": "source-map-explorer build/static/js/main.*",
"precommit": "yarn test"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
Expand Down
10 changes: 5 additions & 5 deletions packages/midi-bricks/src/actions/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { merge, debounce } from 'lodash'

const {initMidiAccessPending, midiMessageArrived, initFailed, initMidiAccessOk} = Actions

export function initApp (mode) {
export function initApp () {
return function (dispatch, getState) {
return new Promise((resolve, reject) => {
WebMIDI.disable()
Expand Down Expand Up @@ -59,7 +59,7 @@ function findByElementType (arrayOfTypes, array) {
const cc = ((acc[driverNameInput] || [])[midiChannelInput] || [])
return merge(acc, {
[driverNameInput]: {
[midiChannelInput || 'None']: Array.from(new Set([...cc, ...listenToCc]))
[midiChannelInput || 'None']: [...new Set([...cc, ...listenToCc])]
}
})
}else {
Expand Down Expand Up @@ -97,7 +97,7 @@ function registerCcListeners (listenersObj, name, input, dispatch) {
dispatch(myAction(obj))
}
if (!input.hasListener('controlchange', midiChIn, debounce(midiEventMapper, 5))) {
console.log('ADDD LISTENERS CC', midiChIn, driverNameIn)
// console.log('ADDD LISTENERS CC', midiChIn, driverNameIn)
input.addListener(
'controlchange',
midiChIn,
Expand Down Expand Up @@ -129,7 +129,7 @@ function registerNoteListeners (notesObj, name, input, dispatch) {
dispatch(midiMessageArrived(obj))
}
if (!input.hasListener('noteon', midiChIn, debounce(midiEventNoteOnMapper, 5))) {
console.log('ADDD LISTENERS NOTE ON', midiChIn, driverNameIn)
// console.log('ADDD LISTENERS NOTE ON', midiChIn, driverNameIn)
input.addListener(
'noteon',
midiChIn,
Expand All @@ -150,7 +150,7 @@ function registerNoteListeners (notesObj, name, input, dispatch) {
}

if (!input.hasListener('noteoff', midiChIn, debounce(midiEventNoteOffMapper, 5))) {
console.log('ADDD LISTENERS NOTE OFF', midiChIn, driverNameIn)
// console.log('ADDD LISTENERS NOTE OFF', midiChIn, driverNameIn)
input.addListener(
'noteoff',
midiChIn,
Expand Down
34 changes: 30 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3660,6 +3660,15 @@ array.prototype.flat@^1.2.1:
es-abstract "^1.10.0"
function-bind "^1.1.1"

array.prototype.flatmap@^1.2.3:
version "1.2.3"
resolved "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz#1c13f84a178566042dd63de4414440db9222e443"
integrity sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.0-next.1"
function-bind "^1.1.1"

arrify@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
Expand Down Expand Up @@ -3802,7 +3811,7 @@ babel-code-frame@^6.22.0:
esutils "^2.0.2"
js-tokens "^3.0.2"

babel-eslint@10.1.0:
babel-eslint@10.1.0, babel-eslint@^10.1.0:
version "10.1.0"
resolved "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==
Expand Down Expand Up @@ -6616,6 +6625,23 @@ eslint-plugin-react@7.19.0:
string.prototype.matchall "^4.0.2"
xregexp "^4.3.0"

eslint-plugin-react@^7.20.5:
version "7.20.5"
resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.5.tgz#29480f3071f64a04b2c3d99d9b460ce0f76fb857"
integrity sha512-ajbJfHuFnpVNJjhyrfq+pH1C0gLc2y94OiCbAXT5O0J0YCKaFEHDV8+3+mDOr+w8WguRX+vSs1bM2BDG0VLvCw==
dependencies:
array-includes "^3.1.1"
array.prototype.flatmap "^1.2.3"
doctrine "^2.1.0"
has "^1.0.3"
jsx-ast-utils "^2.4.1"
object.entries "^1.1.2"
object.fromentries "^2.0.2"
object.values "^1.1.1"
prop-types "^15.7.2"
resolve "^1.17.0"
string.prototype.matchall "^4.0.2"

eslint-plugin-unicorn@latest:
version "12.0.1"
resolved "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-12.0.1.tgz#f902c3c80dbc027fb3bd4665713c3dcb1954bc6a"
Expand Down Expand Up @@ -9543,7 +9569,7 @@ jsx-ast-utils@^2.2.1:
array-includes "^3.0.3"
object.assign "^4.1.0"

jsx-ast-utils@^2.2.3:
jsx-ast-utils@^2.2.3, jsx-ast-utils@^2.4.1:
version "2.4.1"
resolved "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz#1114a4c1209481db06c690c2b4f488cc665f657e"
integrity sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==
Expand Down Expand Up @@ -10926,7 +10952,7 @@ object.entries@^1.0.4, object.entries@^1.1.0:
function-bind "^1.1.1"
has "^1.0.3"

object.entries@^1.1.1:
object.entries@^1.1.1, object.entries@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz#bc73f00acb6b6bb16c203434b10f9a7e797d3add"
integrity sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==
Expand Down Expand Up @@ -13416,7 +13442,7 @@ resolve@1.15.0:
dependencies:
path-parse "^1.0.6"

resolve@^1.1.6, resolve@^1.15.1:
resolve@^1.1.6, resolve@^1.15.1, resolve@^1.17.0:
version "1.17.0"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
Expand Down

0 comments on commit 00a8031

Please sign in to comment.