我使用原子文本编辑器。 以下是让我的linter使用React和ES6的步骤:
npm install --save eslint
eslint --init
,这有助于使用我在命令行回答的一系列问题创建文件)每次开始编写新项目时,我都不想创建.eslintrc。我想使用全局.eslintrc文件,我在以下时找到了该文件:
我怎样才能这样做,当我启动一个新文件并开始编码时,我已经获得了这个全局文件中定义的选项?
特别是,这是我在个别项目中使用的设置:
{
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"env": {
"es6": true
},
"plugins": [
"eslint-plugin-react"
]
}
我希望这是默认设置。
答案 0 :(得分:2)
转到设置 - >包裹 - > linter-eslint设置。在该菜单上,查找.eslintrc Path
选项。根据您的特殊偏好,您可以将~/.atom/packages/linter/.eslintrc
放在该字段中。您的.eslintrc
现在正在全球所有项目中使用。
答案 1 :(得分:1)
您可以使用配置级联来获得优势: http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
impl<T, U> PartialEq<U> for List<T>
where Vec<T>: PartialEq<U>
{
fn eq(&self, other: &U) -> bool {
self.memory.eq(other)
}
}
来自eslint文档: