linter-eslint报错

零崎莲实
  • 683

在express项目中配置eslint
使用linter-eslint插件格式化代码时报错

Cannot read config file: /....../node_modules/.3.16.1@eslint/conf/eslint-recommended.js Error: ENOENT: no such file or directory, open '/....../node_modules/.3.16.1@eslint/conf/eslint-recommended.js' Referenced from: /....../.eslintrc

请问这是什么问题?

PS : 是按照这个配置的
node-express-mongoose-demo

package.json

"devDependencies": {

    "babel-eslint": "^7.2.1",
    "babel-preset-stage-0": "^6.22.0",
    "babel-tape-runner": "^2.0.1",
    "eslint": "^3.18.0",
    
}    

.eslintrc

{
  "parser": "babel-eslint",
  "extends": "eslint:recommended",
  "env": {
    "node": true,
    "mocha": true,
    "browser": false,
    "es6": true,
  },
}
回复
阅读 4.8k
1 个回答
{
    "env": {
        "browser": true,
        "es6": true,
        "node": true,
        "commonjs": true
    },
    "extends": "eslint:recommended",
    "installedESLint": true,
    "parserOptions": {
        "ecmaFeatures": {
            "experimentalObjectRestSpread": true,
            "jsx": true,
            "arrowFunctions": true,
            "classes": true,
            "modules": true,
            "defaultParams": true
        },
        "sourceType": "module"
    },
    "parser": "babel-eslint",
    "plugins": [
        "babel",
        "html"
    ],
    "rules": {
        "linebreak-style": [
            "error",
            "unix"
        ],
        "semi": ["error", "always"],
        "no-empty": 1,
        "eqeqeq": 1,
        "no-fallthrough": 1,
        "default-case": 1,
        "no-delete-var": 0,
        "no-invalid-regexp": 2,
        "comma-dangle": 0,
        "no-unused-vars": 1,
        "use-isnan": 0,
        "no-console": 0,
        "no-const-assign": 2,
        "no-dupe-class-members": 2,
        "no-duplicate-case": 2,
        "no-extra-parens": [2, "functions"],
        "no-self-compare": 2,
        "no-unused-vars": 1,
        "no-undef": 2,
        "no-useless-constructor": 1,
        "accessor-pairs": 2,
        "comma-spacing": [2, {
            "before": false,
            "after": true
        }],
        "constructor-super": 2,
        "new-cap": [2, {
            "newIsCap": true,
            "capIsNew": false
        }],
        "new-parens": 2,
        "no-array-constructor": 1,
        "no-class-assign": 2,
        "no-cond-assign": 2,
        "valid-typeof": 0
    }
}

你可以看看我的,我的没什么问题

宣传栏