S
S
Sergey Topolov2019-06-30 00:37:03
JavaScript
Sergey Topolov, 2019-06-30 00:37:03

How to make optional-chaining and eslint friends?

Babel accepted the entry normally when he installed the plug-in for the operator
x.b?.func_C()
, but EsLint first wrote the
unexpected token .
config if the lint looked briefly - so

...
extends: ['airbnb', 'plugin:prettier/recommended', 'prettier/react'],
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    jest: true,
    node: true,
  },
...

then he added more, he began to swear at 2 rules, and stopped at unexpected token
parser: 'babel-eslint'
no-unused-expressions
camelcase

in the end - put them 0
is not so scary,
but maybe someone already uses it, so as not to make exceptions in the rules

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2019-06-30
@Vlad_IT

ESLint, as far as I know, does not understand language features that currently have the "draft" status. For this there is https://github.com/babel/babel-eslint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question