init eslint project
npx eslint --init
init eslint project
npx eslint --init
node eslint
// package.json
"devDependencies": {
"eslint": "^7.2.0",
"eslint-plugin-node": "^11.1.0"
}
// .eslintrc.json
{
"extends": [
"eslint:recommended",
"plugin:node/recommended"
],
"parserOptions": {
// Only ESLint 6.2.0 and later support ES2020.
"ecmaVersion": 2020
},
"rules": {
"node/exports-style": ["error", "module.exports"],
"node/file-extension-in-import": ["error", "always"],
"node/prefer-global/buffer": ["error", "always"],
"node/prefer-global/console": ["error", "always"],
"node/prefer-global/process": ["error", "always"],
"node/prefer-global/url-search-params": ["error", "always"],
"node/prefer-global/url": ["error", "always"],
"node/prefer-promises/dns": "error",
"node/prefer-promises/fs": "error"
}
}
eslint init
yarn eslint --init
3 > To check syntax, find problems, and enforce code style
2 > Javascript modules (import/export)
3 > None of these
2 > Apenas NODE
1 > Use a popular style guide
1 > Airbnb
1 > JavaScript
Y > Yes, (instalar with npm)
remover arquivo do npm: package-lock.json
yarn //atualizar as dependencias
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us