Expected linebreaks to be 'LF' but found 'CRLF'

从coding克隆下来的项目,运行报了这个错误。(之前是用mac开发)

解决方案:
1.只需在eslintrc文件里面将
/*eslint linebreak-style: ["error", "unix"]*/
改成
'linebreak-style': ["off", "windows"](我用的是windows)

module.exports = {

root:true,

parserOptions: {

parser:'babel-eslint'

  },

env: {

browser:true,

},

// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention

// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.

  extends: ['plugin:vue/essential','airbnb-base'],

// required to lint *.vue files

  plugins: [

'vue'

  ],

// check if imports actually resolve

  settings: {

'import/resolver': {

webpack: {

config:'build/webpack.base.conf.js'

      }

}

},

// add your custom rules here

  rules: {

// don't require .vue extension when importing

    'import/extensions': ['error','always', {

js:'never',

vue:'never'

    }],

// disallow reassignment of function parameters

// disallow parameter object manipulation except for specific exclusions

    'no-param-reassign': ['error', {

props:true,

ignorePropertyModificationsFor: [

'state',// for vuex state

        'acc',// for reduce accumulators

        'e' // for e.returnvalue

      ]

}],

// allow optionalDependencies

    'import/no-extraneous-dependencies': ['error', {

optionalDependencies: ['test/unit/index.js']

}],

// allow debugger during development

    'no-debugger':process.env.NODE_ENV ==='production' ?'error' :'off',

'linebreak-style': ["off","windows"]

}

}

你可能感兴趣的:(Expected linebreaks to be 'LF' but found 'CRLF')