"仓位"是什么意思以及如何找到仓位



今天当我在powershell中运行npx eslint --fix ./时,它会在.eslintrc.json.So 中记录Unexpected token } in JSON at position 93,我完全必须在这里提问: 1."位置93"是什么意思以及如何在我的代码中找到确切的位置,因为我不知道93,我曾经在控制台记录错误时找到位置,错误位于哪一行(列(。 2.好像我的.eslintrc.json没有语法错误,你们能帮我找到问题吗?

{
"env": {
"node": true,
"commonjs": true,
"es6": true,
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}

请删除第"es6": true,行中的comma

应将 json 粘贴到工具检查验证 json 格式中。

例如:https://jsoneditoronline.org/是工具json格式在线

如果给出单个数字。这意味着它是文件中的字符索引。例如:

//Hello
"The following dot is in position 52"
console.log('test');
^
|___ this is position 52 (or 54 if your file contains "rn" as newlines)

是的,您需要将行尾计算为一个或两个字节,具体取决于天气,它具有Windows行尾(CRLF(或Unix行尾(LF(。

不过,有趣的是,多字节 unicode 字符被计为一个字符而不是多个字节(这是因为与多字节字符不同,"\r"和""都是单独的字符(。

如果给出两个数字,有时中间有一个:,则第一个数字是行号,第二个是列号(行首的字符索引(。因此,上面的点有时被称为position 3:7line 3 position 7line 3 column 7.

最新更新