eslint-config-halo

2019-08-15 admin

eslint-config-halo是什么

什么是eslint-config-halo,ESlint shareable config for Halo

eslint-config-halo使用教程帮助文档

eslint-config-halo NPM Version NPM Downloads NPM License

ESLint shareable config for Halo

This is for advanced users.

Note to self

keep eslint peer dep in the last version with new rules or options we support!

Install

$ yarn add eslint eslint-config-halo --dev

Usage

Add some ESLint config to your package.json:

{
    "name": "my-awesome-project",
    "eslintConfig": {
        "parser": "babel-eslint", // optional only if you need future js features
        "extends": "halo"
    }
}

Note: babel-eslint is way slower. Right now i need this for class properties initializers for auto bind callbacks in react.

Or to .eslintrc:

{
    "extends": "halo"
}

Configs available

halo // eslint only rules
halo:plugins // extends above and adds couple of plugins 
halo:react // extends above and adds react support
halo:preact // extends above overrides some rules for preact

Visual Studio Code

Install dbaeumer.vscode-eslint and esbenp.prettier-vscode

{
    "editor.formatOnType": true,
    "editor.formatOnSave": true,
    "prettier.eslintIntegration": true,
    "prettier.printWidth": 80,
    "prettier.tabWidth": 4,
    "prettier.useTabs": false,
    "prettier.semi": true,
    "prettier.singleQuote": true,
    "prettier.trailingComma": "none",
    "prettier.bracketSpacing": true,
    "prettier.jsxBracketSameLine": false,
    "prettier.cssEnable": [],
}

Use the default settings for vscode-eslint and these to auto format using prettier and eslint.

Related

License

MIT © Hugo Dias

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-72592.html

文章标题:eslint-config-halo

回到顶部