1. 程式人生 > 實用技巧 >Expected space or tab after '//' in comment

Expected space or tab after '//' in comment

在使用vue的時候,各種報錯,找了很久,改了多遍,也解決不了問題。

如下:

  src\views\edu\teacher\list.vue:16:17
        total: 0, //總記錄數
                   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:17:23
        teacherQuery: {}, //條件封裝物件
                         ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:17:25
        teacherQuery: {}, //條件封裝物件
                           ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:18:6
      };
        ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:21:5
      //頁面渲染之前執行,一般呼叫methods定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:24:5
      //建立具體的方法,呼叫teacher.js定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:25:5
      //講師列表的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:29:17
          .then() //請求成功
                   ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:30:17
          .catch(); //請求失敗
                   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:30:19
          .catch(); //請求失敗
                     ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:31:6
      },
        ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:32:4
    },
      ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:33:2
  };
    ^


✘ 19 problems (19 errors, 0 warnings)


Errors:
  11  http://eslint.org/docs/rules/spaced-comment
   4  http://eslint.org/docs/rules/semi
   3  http://eslint.org/docs/rules/comma-dangle
   1  http://eslint.org/docs/rules/quotes

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.


 WAIT  Compiling...                                                                                                                                       下午6:03:34
 98% after emitting                                               

 WARNING  Compiled with 2 warnings                                                                                                                        下午6:03:34
Module Warning (from ./node_modules/eslint-loader/index.js):

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:4:1
      // 1 講師列表(條件查詢分頁)
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:5:1
      // current當前頁 limit每頁記錄數 teacherQuery條件物件
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:6:1
      getTeacherListPage(current, limit, teacherQuery) {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:7:1
          return request({
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:8:1
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:8:13
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:9:1
              url: '/eduservice/teacher/pageTeacherCondition/${current}/${limit}',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:10:1
              method: 'post',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:11:1
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:11:13
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:12:1
              //data表示把物件轉換json進行傳遞到接口裡面
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:12:13
              //data表示把物件轉換json進行傳遞到接口裡面
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:13:1
              data() {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:14:1
                  return {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 10 spaces but found 20
  src\api\edu\teacher.js:15:1
                      teacherQuery
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:16:1
                  }
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:17:1
              },
   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\api\edu\teacher.js:17:14
              },
                ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:18:1
          })
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:19:1
      }
   ^


✘ 20 problems (20 errors, 0 warnings)


Errors:
  16  http://eslint.org/docs/rules/indent
   3  http://eslint.org/docs/rules/spaced-comment
   1  http://eslint.org/docs/rules/comma-dangle

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

  ✘  http://eslint.org/docs/rules/quotes          Strings must use singlequote
  src\views\edu\teacher\list.vue:7:21
  import teacher from "@/api/edu/teacher";
                       ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:7:40
  import teacher from "@/api/edu/teacher";
                                          ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:11:5
      //定義變數和初始值
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:13:19
        list: null, //查詢之後介面返回集合
                     ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:14:16
        page: 1, //當前頁
                  ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:15:18
        limit: 10, //每頁記錄數
                    ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:16:17
        total: 0, //總記錄數
                   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:17:23
        teacherQuery: {}, //條件封裝物件
                         ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:17:25
        teacherQuery: {}, //條件封裝物件
                           ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:18:6
      };
        ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:21:5
      //頁面渲染之前執行,一般呼叫methods定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:24:5
      //建立具體的方法,呼叫teacher.js定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:25:5
      //講師列表的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:29:17
          .then() //請求成功
                   ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:30:17
          .catch(); //請求失敗
                   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:30:19
          .catch(); //請求失敗
                     ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:31:6
      },
        ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:32:4
    },
      ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:33:2
  };
    ^


✘ 19 problems (19 errors, 0 warnings)


Errors:
  11  http://eslint.org/docs/rules/spaced-comment
   4  http://eslint.org/docs/rules/semi
   3  http://eslint.org/docs/rules/comma-dangle
   1  http://eslint.org/docs/rules/quotes

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.


 WAIT  Compiling...                                                                                                                                       下午6:03:48
 98% after emitting                                               

 WARNING  Compiled with 2 warnings                                                                                                                        下午6:03:49
Module Warning (from ./node_modules/eslint-loader/index.js):

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:4:1
      // 1 講師列表(條件查詢分頁)
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:5:1
      // current當前頁 limit每頁記錄數 teacherQuery條件物件
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:6:1
      getTeacherListPage(current, limit, teacherQuery) {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:7:1
          return request({
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:8:1
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:8:13
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:9:1
              url: '/eduservice/teacher/pageTeacherCondition/${current}/${limit}',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:10:1
              method: 'post',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:11:1
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:11:13
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:12:1
              //data表示把物件轉換json進行傳遞到接口裡面
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:12:13
              //data表示把物件轉換json進行傳遞到接口裡面
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:13:1
              data() {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:14:1
                  return {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 10 spaces but found 20
  src\api\edu\teacher.js:15:1
                      teacherQuery
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:16:1
                  }
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:17:1
              },
   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\api\edu\teacher.js:17:14
              },
                ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:18:1
          })
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:19:1
      }
   ^


✘ 20 problems (20 errors, 0 warnings)


Errors:
  16  http://eslint.org/docs/rules/indent
   3  http://eslint.org/docs/rules/spaced-comment
   1  http://eslint.org/docs/rules/comma-dangle

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

  ✘  http://eslint.org/docs/rules/quotes          Strings must use singlequote
  src\views\edu\teacher\list.vue:7:21
  import teacher from "@/api/edu/teacher";
                       ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:7:40
  import teacher from "@/api/edu/teacher";
                                          ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:11:5
      //定義變數和初始值
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:13:19
        list: null, //查詢之後介面返回集合
                     ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:14:16
        page: 1, //當前頁
                  ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:15:18
        limit: 10, //每頁記錄數
                    ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:16:17
        total: 0, //總記錄數
                   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:17:23
        teacherQuery: {}, //條件封裝物件
                         ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:17:25
        teacherQuery: {}, //條件封裝物件
                           ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:18:6
      };
        ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:21:5
      //頁面渲染之前執行,一般呼叫methods定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:24:5
      //建立具體的方法,呼叫teacher.js定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:25:5
      //講師列表的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:29:17
          .then() //請求成功
                   ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:30:17
          .catch(); //請求失敗
                   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:30:19
          .catch(); //請求失敗
                     ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:31:6
      },
        ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:32:4
    },
      ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:33:2
  };
    ^


✘ 19 problems (19 errors, 0 warnings)


Errors:
  11  http://eslint.org/docs/rules/spaced-comment
   4  http://eslint.org/docs/rules/semi
   3  http://eslint.org/docs/rules/comma-dangle
   1  http://eslint.org/docs/rules/quotes

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.


 WAIT  Compiling...                                                                                                                                       下午6:07:40
 98% after emitting                                               

 WARNING  Compiled with 2 warnings                                                                                                                        下午6:07:41
Module Warning (from ./node_modules/eslint-loader/index.js):

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:4:1
      // 1 講師列表(條件查詢分頁)
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:5:1
      // current當前頁 limit每頁記錄數 teacherQuery條件物件
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:6:1
      getTeacherListPage(current, limit, teacherQuery) {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:7:1
          return request({
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:8:1
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:8:13
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:9:1
              url: '/eduservice/teacher/pageTeacherCondition/${current}/${limit}',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:10:1
              method: 'post',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:11:1
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:11:13
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:12:1
              //data表示把物件轉換json進行傳遞到接口裡面
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:12:13
              //data表示把物件轉換json進行傳遞到接口裡面
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:13:1
              data() {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:14:1
                  return {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 10 spaces but found 20
  src\api\edu\teacher.js:15:1
                      teacherQuery
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:16:1
                  }
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:17:1
              },
   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\api\edu\teacher.js:17:14
              },
                ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:18:1
          })
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:19:1
      }
   ^


✘ 20 problems (20 errors, 0 warnings)


Errors:
  16  http://eslint.org/docs/rules/indent
   3  http://eslint.org/docs/rules/spaced-comment
   1  http://eslint.org/docs/rules/comma-dangle

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

  ✘  http://eslint.org/docs/rules/quotes          Strings must use singlequote
  src\views\edu\teacher\list.vue:7:21
  import teacher from "@/api/edu/teacher";
                       ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:7:40
  import teacher from "@/api/edu/teacher";
                                          ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:11:5
      //定義變數和初始值
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:13:19
        list: null, //查詢之後介面返回集合
                     ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:14:16
        page: 1, //當前頁
                  ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:15:18
        limit: 10, //每頁記錄數
                    ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:16:17
        total: 0, //總記錄數
                   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:17:23
        teacherQuery: {}, //條件封裝物件
                         ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:17:25
        teacherQuery: {}, //條件封裝物件
                           ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:18:6
      };
        ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:21:5
      //頁面渲染之前執行,一般呼叫methods定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:24:5
      //建立具體的方法,呼叫teacher.js定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:25:5
      //講師列表的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:29:17
          .then() //請求成功
                   ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:30:17
          .catch(); //請求失敗
                   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:30:19
          .catch(); //請求失敗
                     ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:31:6
      },
        ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:32:4
    },
      ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:33:2
  };
    ^


✘ 19 problems (19 errors, 0 warnings)


Errors:
  11  http://eslint.org/docs/rules/spaced-comment
   4  http://eslint.org/docs/rules/semi
   3  http://eslint.org/docs/rules/comma-dangle
   1  http://eslint.org/docs/rules/quotes

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.


 WAIT  Compiling...                                                                                                                                       下午6:07:46
 98% after emitting                                               

 WARNING  Compiled with 2 warnings                                                                                                                        下午6:07:46
Module Warning (from ./node_modules/eslint-loader/index.js):

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:4:1
      // 1 講師列表(條件查詢分頁)
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:5:1
      // current當前頁 limit每頁記錄數 teacherQuery條件物件
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:6:1
      getTeacherListPage(current, limit, teacherQuery) {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:7:1
          return request({
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:8:1
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:8:13
              //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:9:1
              url: '/eduservice/teacher/pageTeacherCondition/${current}/${limit}',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:10:1
              method: 'post',
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:11:1
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:11:13
              //teacherQuery條件物件,後端使用teacherQuery獲取資料
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:12:1
              //data表示把物件轉換json進行傳遞到接口裡面
   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\api\edu\teacher.js:12:13
              //data表示把物件轉換json進行傳遞到接口裡面
               ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:13:1
              data() {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:14:1
                  return {
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 10 spaces but found 20
  src\api\edu\teacher.js:15:1
                      teacherQuery
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 8 spaces but found 16
  src\api\edu\teacher.js:16:1
                  }
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 6 spaces but found 12
  src\api\edu\teacher.js:17:1
              },
   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\api\edu\teacher.js:17:14
              },
                ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 4 spaces but found 8
  src\api\edu\teacher.js:18:1
          })
   ^

  ✘  http://eslint.org/docs/rules/indent          Expected indentation of 2 spaces but found 4
  src\api\edu\teacher.js:19:1
      }
   ^


✘ 20 problems (20 errors, 0 warnings)


Errors:
  16  http://eslint.org/docs/rules/indent
   3  http://eslint.org/docs/rules/spaced-comment
   1  http://eslint.org/docs/rules/comma-dangle

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

  ✘  http://eslint.org/docs/rules/quotes          Strings must use singlequote
  src\views\edu\teacher\list.vue:7:21
  import teacher from "@/api/edu/teacher";
                       ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:7:40
  import teacher from "@/api/edu/teacher";
                                          ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:11:5
      //定義變數和初始值
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:13:19
        list: null, //查詢之後介面返回集合
                     ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:14:16
        page: 1, //當前頁
                  ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:15:18
        limit: 10, //每頁記錄數
                    ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:16:17
        total: 0, //總記錄數
                   ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:17:23
        teacherQuery: {}, //條件封裝物件
                         ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:17:25
        teacherQuery: {}, //條件封裝物件
                           ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:18:6
      };
        ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:21:5
      //頁面渲染之前執行,一般呼叫methods定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:24:5
      //建立具體的方法,呼叫teacher.js定義的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:25:5
      //講師列表的方法
       ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:29:17
          .then() //請求成功
                   ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:30:17
          .catch(); //請求失敗
                   ^

  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment
  src\views\edu\teacher\list.vue:30:19
          .catch(); //請求失敗
                     ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:31:6
      },
        ^

  ✘  http://eslint.org/docs/rules/comma-dangle    Unexpected trailing comma
  src\views\edu\teacher\list.vue:32:4
    },
      ^

  ✘  http://eslint.org/docs/rules/semi            Extra semicolon
  src\views\edu\teacher\list.vue:33:2
  };
    ^

✘ 19 problems (19 errors, 0 warnings)


Errors:
  11  http://eslint.org/docs/rules/spaced-comment
   4  http://eslint.org/docs/rules/semi
   3  http://eslint.org/docs/rules/comma-dangle
   1  http://eslint.org/docs/rules/quotes
View Code

原來eslint是一個語法檢查工具,但是限制很嚴格,在我的vue檔案裡面很多空格都會導致紅線(紅線可以關閉提示),雖然可以關閉,但是在編譯的時候老是會跳出來,所以能關閉是最好的了。
關閉方法:在build/webpack.base.conf.js檔案中,註釋或者刪除掉:module->rules中有關eslint的規則:

然後再重新執行一下npm run dev或者構建命令 npm run build就可以啦。