- install eslint
npm i -g eslint
npm install --save-dev eslint
- config eslint
- config with airbnb
- install config (vanilla js)
npm install --save-dev eslint-config-airbnb-base
- install config (react/jsx)
npm install --save-dev eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y
- install config (vanilla js)
Last active
June 18, 2021 12:11
-
-
Save mikoloism/502529f69aa8b07fa727800522552386 to your computer and use it in GitHub Desktop.
all-in-one eslint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [airbnb-config] | |
# see : https://eslint.org/docs/user-guide/configuring/ | |
# see : https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb | |
--- | |
env: | |
# browser | |
browser: true | |
# ES6 | |
es6: true | |
# node | |
node: true | |
# use airbnb (eslint-config-airbnb) | |
extends: airbnb | |
parserOptions: | |
ecmaVersion: 6 | |
# ecmaFeature: | |
# jsx: true # react | jsx | |
rules: | |
# 0 = off | 1 = warn* | 2 = error | |
no-unused-vars: | |
- warn | |
- | |
args: none | |
vars: local | |
comma-dangle: | |
- warn | |
- always-multiline | |
# or | |
# - | |
# array: always-multiline | |
# objects: always-multiline | |
# imports: always-multiline | |
# exports: always-multiline | |
# functions: always-multiline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// [manual-config] | |
// see : https://eslint.org/docs/user-guide/configuring/ | |
{ | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"ecmaFeature": { | |
// "jsx": true, // for react or JSX | |
} | |
}, | |
"env": { | |
"node": true, | |
"browser": true, | |
"es6": true, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [manual-config] | |
# came : https://eslint.org/docs/user-guide/configuring/ | |
--- | |
extends: 'eslint:recommended' | |
parserOptions: | |
ecmaVersion: 6 | |
# ecmaFeature: | |
# jsx : true # react || jsx | |
env : | |
node: true # node | |
browser: true # browser | |
es6: true # ES6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment