简体   繁体   English

eslintrc.js:4 "parserOptions": { ^ SyntaxError: Unexpected token ':' functions predeploy error: 命令以非零退出代码 2 终止

[英]eslintrc.js:4 "parserOptions": { ^ SyntaxError: Unexpected token ':' functions predeploy error: Command terminated with non-zero exit code 2

/* eslint disable */ { /* eslint 禁用 */ {

"parserOptions": { "parser": "@babel/eslint-parser", "requireConfigFile": false, // <== ADD THIS "ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features "sourceType": "module", // Allows for the use of imports "babelOptions": { "presets": ["@babel/preset-react"] } }, "root": true, "plugins": ["promise"], "extends": "eslint:recommended", "rules": { // Removed rule "disallow the use of console" from recommended eslint rules "no-console": "off", "parserOptions": { "parser": "@babel/eslint-parser", "requireConfigFile": false, // <== ADD THIS "ecmaVersion": 2018, // 允许解析现代 ECMAScript 特性 "sourceType" : "module", // 允许使用导入 "babelOptions": { "presets": ["@babel/preset-react"] } }, "root": true, "plugins": ["promise"] , "extends": "eslint:recommended", "rules": { // 从推荐的 eslint 规则中删除了规则 "disallow the use of console" "no-console": "off",

// Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules
"no-regex-spaces": "off",

// Removed rule "disallow the use of debugger" from recommended eslint rules
"no-debugger": "off",

// Removed rule "disallow unused variables" from recommended eslint rules
"no-unused-vars": "off",

// Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules
"no-mixed-spaces-and-tabs": "off",

// Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules
"no-undef": "off",

// Warn against template literal placeholder syntax in regular strings
"no-template-curly-in-string": 1,

// Warn if return statements do not either always or never specify values
"consistent-return": 0,

// Warn if no return statements in callbacks of array methods
"array-callback-return": 1,

// Require the use of === and !==
"eqeqeq": 2,

// Disallow the use of alert, confirm, and prompt
"no-alert": 2,

// Disallow the use of arguments.caller or arguments.callee
"no-caller": 2,

// Disallow null comparisons without type-checking operators
"no-eq-null": 2,

// Disallow the use of eval()
"no-eval": 2,

// Warn against extending native types
"no-extend-native": 1,

// Warn against unnecessary calls to .bind()
"no-extra-bind": 1,

// Warn against unnecessary labels
"no-extra-label": 1,

// Disallow leading or trailing decimal points in numeric literals
"no-floating-decimal": 2,

// Warn against shorthand type conversions
"no-implicit-coercion": 1,

// Warn against function declarations and expressions inside loop statements
"no-loop-func": 1,

// Disallow new operators with the Function object
"no-new-func": 2,

// Warn against new operators with the String, Number, and Boolean objects
"no-new-wrappers": 1,

// Disallow throwing literals as exceptions
"no-throw-literal": 2,

// Require using Error objects as Promise rejection reasons
"prefer-promise-reject-errors": 2,

// Enforce “for” loop update clause moving the counter in the right direction
"for-direction": 2,

// Enforce return statements in getters
"getter-return": 2,

// Disallow await inside of loops
"no-await-in-loop": 2,

// Disallow comparing against -0
"no-compare-neg-zero": 2,

// Warn against catch clause parameters from shadowing variables in the outer scope
"no-catch-shadow": 1,

// Disallow identifiers from shadowing restricted names
"no-shadow-restricted-names": 2,

// Enforce return statements in callbacks of array methods
"callback-return": 2,

// Require error handling in callbacks
"handle-callback-err": 2,

// Warn against string concatenation with __dirname and __filename
"no-path-concat": 1,

// Prefer using arrow functions for callbacks
"prefer-arrow-callback": 1,

// Return inside each then() to create readable and reusable Promise chains.
// Forces developers to return console logs and http calls in promises.
"promise/always-return": 2,

//Enforces the use of catch() on un-returned promises
"promise/catch-or-return": 2,

// Warn against nested then() or catch() statements
"promise/no-nesting": 1

} } } }

I change.eslintrs.js into.eslintrc.json solved the issue我将.eslintrs.js 更改为.eslintrc.json 解决了这个问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 以非零退出代码(项目路径中的空格)开头的部署错误 - Firebase deploy errors starting with non-zero exit code (space in project path) Firebase 云函数部署错误 - SyntaxError: Unexpected token '?' - Firebase Cloud Functions Deploy Error- SyntaxError: Unexpected token '?' 无法从源加载函数定义:无法从函数源生成清单:SyntaxError:意外的标记“。” - Failed to load function definition from source: Failed to generate manifest from function source: SyntaxError: Unexpected token '.' 如何修复节点中的“解析错误:意外的令牌 =&gt;”? - how to fix 'parsing error: Unexpected token =>' in node? 带有最新节点版本的异步 Function 上的“解析错误:意外令牌功能” - "Parsing Error: unexpected token function" on Async Function with a recent Node version 意外令牌导出 firebase-app.js:1590 - unexpected token export firebase-app.js:1590 完成错误:Gradle 任务 assembleDebug 失败,退出代码为 1 - Finished with error: Gradle task assembleDebug failed with exit code 1 运行 firebase 部署时,在 flutter 应用程序上 1:1 时解析错误意外令牌 '��' - Parse error Unexpected token '�' at 1:1 ��{ on flutter app when running firebase deploy 错误:由 Firebase 函数生成的意外注释。 这不应该发生 - Error: Unexpected annotation generated by the Firebase Functions. This should never happen 尝试导入 firebase 时 vue js 错误“Uncaught SyntaxError: import not found: default” - vue js error "Uncaught SyntaxError: import not found: default" when trying to import firebase
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM