Github action throws eslint error but build succeeds locally

Viewed 628

I am new to Github action. I am trying to deploy my Vue.js project to Azure static web app via Github Action.

While deploying it throws eslint error, but when I execute eslint fix locally on my Windows it says there is nothing to fix. The project is almost brand new, just added some extra settings (including line break settings), here is my eslint setting.

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    'plugin:vue/essential',
    '@vue/airbnb',
  ],
  parserOptions: {
    parser: 'babel-eslint',
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'eol-last': 0,
    'linebreak-style': ['error', 'windows'],
    "indent": [2, 2],
  },
};

I read this article and I am using airbnb setting, but there should be no problem since I am overwriting the rule with 'linebreak-style': ['error', 'windows']?

https://github.com/airbnb/javascript/pull/1224

Current runner version: '2.273.5'
Operating System
  Ubuntu
  18.04.5
  LTS
...
messageboard@0.1.0 build /github/workspace
vue-cli-service build

-  Building for production...
 ERROR  Build failed with errors.
 ERROR  Failed to compile with 7 errors2:31:51 PM

 error  in ./src/App.vue

Module Error (from ./node_modules/eslint-loader/index.js):

/github/workspace/src/App.vue
   1:11  error  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
   2:17  error  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
   3:19  error  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style

For whole error log see: https://github.com/simari1/MessageBoard/runs/1231832137?check_suite_focus=true

The problem seems to be that my pc is Windows but build server is Ubuntu? Is there some setting I am missing?

What I tried so far:

  • added github foloder to eslintignore
  • changed the content of npm run lint to fix

Thank you in advance.

0 Answers
Related