Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用coffeescript eslintrc配置eslint_Coffeescript_Eslint_Eslintrc - Fatal编程技术网

使用coffeescript eslintrc配置eslint

使用coffeescript eslintrc配置eslint,coffeescript,eslint,eslintrc,Coffeescript,Eslint,Eslintrc,我正试图用一个带有以下代码的coffeescript文件配置eslint。但到目前为止,尚未正确读取配置 #.eslintrc.js 需要('coffeescript/register') 需要(“./.eslintrc.coffee”) #.eslintrc.coffee 配置= 根:是的 环境: 节点:true 扩展:[ '插件:更漂亮/推荐' '插件:vue/推荐' “@vue/standard” ] 解析选项: 解析器:“babel eslint” 规则: “更漂亮/更漂亮”:“错误”

我正试图用一个带有以下代码的coffeescript文件配置eslint。但到目前为止,尚未正确读取配置

#.eslintrc.js
需要('coffeescript/register')
需要(“./.eslintrc.coffee”)
#.eslintrc.coffee
配置=
根:是的
环境:
节点:true
扩展:[
'插件:更漂亮/推荐'
'插件:vue/推荐'
“@vue/standard”
]
解析选项:
解析器:“babel eslint”
规则:
“更漂亮/更漂亮”:“错误”
“无控制台”:如果process.env.NODE_env==“生产”,则为“错误”,否则为“关闭”
“无调试器”:如果process.env.NODE_env=='production',则为'error',否则为'off'
module.exports=config
不幸的是,这就是结果

$ ./node_modules/.bin/eslint --print-config test.js
{
  "env": {},
  "globals": {},
  "parser": null,
  "parserOptions": {},
  "plugins": [],
  "rules": {},
  "settings": {}
}
其他我尝试过但未成功的事情有:

#.eslintrc.js
需要('coffeescript/register')
module.exports=require(“./.eslintrc.coffee”)
#.eslintrc.coffee
配置=
根:是的
环境:
节点:true
扩展:[
'插件:更漂亮/推荐'
'插件:vue/推荐'
“@vue/standard”
]
解析选项:
解析器:“babel eslint”
规则:
“更漂亮/更漂亮”:“错误”
“无控制台”:如果process.env.NODE_env==“生产”,则为“错误”,否则为“关闭”
“无调试器”:如果process.env.NODE_env=='production',则为'error',否则为'off'

我正在发布答案,因为我在任何地方都找不到:

#.eslintrc.js
需要('coffeescript/register')
module.exports=require(“./.eslintrc.coffee”)
#.eslintrc.coffee
模块.出口=
根:是的
环境:
节点:true
扩展:[
'插件:更漂亮/推荐'
'插件:vue/推荐'
“@vue/standard”
]
解析选项:
解析器:“babel eslint”
规则:
“更漂亮/更漂亮”:“错误”
“无控制台”:如果process.env.NODE_env==“生产”,则为“错误”,否则为“关闭”
“无调试器”:如果process.env.NODE_env=='production',则为'error',否则为'off'
没错,需要两个
模块。导出

我已经学了太多其他语言,不知道为什么

$ ./node_modules/.bin/eslint --print-config test.js
{
  "env": {
    "node": true,
    "es6": true,
    "browser": true
  },
  "globals": {
    "document": false,
    "navigator": false,
    "window": false
  },
  "parser": "/home/worthlessjavascriptcomma/test/node_modules/vue-eslint-parser/index.js",
  "parserOptions": {
    "parser": "babel-eslint",
    "ecmaVersion": 2018,
    "ecmaFeatures": {
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": [
    "prettier",
    "vue",
    "standard",
    "promise",
    "node",
    "import"
  ],
  ...
有人有其他选择吗