Closed bosens-China closed 4 years ago
What version of babel-eslint are you using? What unexpected behaviour are you getting?
Also, you should add @babel/plugin-proposal-optional-chaining
to your Babel config.
What version of babel-eslint are you using? What unexpected behaviour are you getting?
Also, you should add
@babel/plugin-proposal-optional-chaining
to your Babel config.
"eslint": "^6.7.2",
"babel-eslint": "^10.0.3",
module.exports = {
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "usage",
corejs: 3,
modules: false
}
]
],
// 实验性语法
plugins: ["@babel/plugin-proposal-class-properties", '@babel/plugin-proposal-optional-chaining']
};
Expression expected.
Expected ':'.
Strange - 10.0.3 should have this plugin enabled.
Can't reproduce this locally... @bosens-China can you create a small repo that reproduces the problem?
Can't reproduce this locally... @bosens-China can you create a small repo that reproduces the problem?
Of course, this is the new warehouse https://github.com/bosens-China/Test-file
@bosens-China I cloned your repo, added eslint
to devDependencies
(it was missing), and was able to run npm run build
without any errors?
and just to verify, I modified src/main.js
with:
var a = {};
console.log(a?.b, c);
So it would force a lint error:
@bosens-China I cloned your repo, added
eslint
todevDependencies
(it was missing), and was able to runnpm run build
without any errors?and just to verify, I modified
src/main.js
with:var a = {}; console.log(a?.b, c);
So it would force a lint error:
Thank you very much.
The question of "the" Use the optional chaining operator prompt for an expression.
Reappear
config
Why is it so?
I tried to search for some questions. Some of them were downgraded to @ 8.2.1, which proved to be invalid. I want to know an exact answer