---
title: "Eslint提示const关键字被保留"
author: "somefuture"
date: "2018-05-11T15:57:18Z"
tags: []
categories: ["Web前端"]
slug: "eslint-const"
draft: false
lastmod: "2018-05-11T15:57:18Z"
id: 2422565
url: "https://somefuture.iteye.com/blog/2422565"
---

如果在使用eslint的时候提示：
error Parsing error: The keyword 'const' is reserved

有可能是因为eslint默认审查的es5，需要明确让他审查es6.

在.eslintrc.yml中增加下面一行：
"parserOptions": {
   "ecmaVersion": 6
 }