Skip to content

Commit

Permalink
chore: intentionally disable eslint on lines
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoes committed Apr 24, 2019
1 parent e388a47 commit 32a3254
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/mapbox/update-layer-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default curry(function updateLayerSource(mapbox, layer) {
if (source && data) {
source.setData(data)
} else {
!source && console.warn(`Source with id ${layer.id} could not be found`)
!data && console.warn('data property on layer could not be found', layer)
!source && console.warn(`Source with id ${layer.id} could not be found`) // eslint-disable-line
!data && console.warn('data property on layer could not be found', layer) // eslint-disable-line
}
})
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const applyTo = curry((fns, value) => fns.map(fn => fn(value)))
* tap(1) // console.logs: 1. returns 1
*/
export const tap = value => {
console.log(value)
console.log(value) // eslint-disable-line
return value
}

Expand All @@ -85,7 +85,7 @@ export const tap = value => {
* tapWith('prefix', 1) // console.logs: prefix: 1. returns 1
*/
export const tapWith = curry((prefix, value) => {
console.log(prefix, value)
console.log(prefix, value) // eslint-disable-line
return value
})

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lint:prod": "eslint --config .eslintrc.prod.js --ext .js,.vue --ignore-path .gitignore .",
"lint:fix": "eslint --ext .js,.vue --ignore-path .gitignore . --fix",
"test": "jest",
"mock-api": "json-mock-api --port 3001 --directory api-mock --middleware api-mock/cors-middleware.js,api-mock/redirect-middleware.js"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint:fix",
"pre-push": "npm run lint -- --config .eslintrc.prod.js && npm test"
"pre-push": "npm run lint:prod && npm test"
}
},
"dependencies": {
Expand Down
12 changes: 6 additions & 6 deletions test/unit/lib/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,25 @@ describe('applyTo', () => {

describe('tap', () => {
test('logs the value and returns it', () => {
console.log = jest.fn()
console.log = jest.fn() // eslint-disable-line
const result = utils.tap(1)
expect(console.log).toHaveBeenCalledWith(1)
expect(console.log).toHaveBeenCalledWith(1) // eslint-disable-line
expect(result).toBe(1)
})
})

describe('tapWith', () => {
test('logs the value prefixed with value and returns it', () => {
console.log = jest.fn()
console.log = jest.fn() // eslint-disable-line
const result = utils.tapWith('prefix', 1)
expect(console.log).toHaveBeenCalledWith('prefix', 1)
expect(console.log).toHaveBeenCalledWith('prefix', 1) // eslint-disable-line
expect(result).toBe(1)
})

test('can be called curried', () => {
console.log = jest.fn()
console.log = jest.fn() // eslint-disable-line
const result = utils.tapWith('prefix')(1)
expect(console.log).toHaveBeenCalledWith('prefix', 1)
expect(console.log).toHaveBeenCalledWith('prefix', 1) // eslint-disable-line
expect(result).toBe(1)
})
})
Expand Down

0 comments on commit 32a3254

Please sign in to comment.