Q
Q
quadabrashell2019-10-15 15:54:19
JavaScript
quadabrashell, 2019-10-15 15:54:19

ESlint doesn't understand Smart Pipelines?

const getErrorMessage = function (error) {
  if (typeof error.response.data.error === 'undefined')
    return error.message
  if (error.response.data.error.msg |> Array.isArray)
    return error.response.data.error.msg.join('<br>')
  if (typeof error.response.data.error.msg === 'object')
    return error.response.data.error.msg
      |> Object.values
      |> #.flat()
      |> #.map(v => v + '' === v ? v : Object.values(v))
      |> #.join('<br>')
}

w5jo4gwofppro1gbleos7gpzsfq.png
.eslintrc.js
module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'curly': 'off',
    'operator-linebreak': [ 'error', 'before' ]
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
}

.babelrc
{
  "presets": ["@vue/babel-preset-jsx"],
  "plugins": 
}

At the same time, the project is being assembled.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
quadabrashell, 2019-10-15
@quadabrashell

The problem was solved by updating babel-eslint to 11.0.0-beta.0
yarn upgrade [email protected]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question