ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
pnpm i -D @fbzn/eslint-config-basic # JavaScript only
# Or yarn add -D / npm install -D
pnpm i -D @fbzn/eslint-config-ts # JavaScript and TypeScript
pnpm i -D @fbzn/eslint-config-vue # JavaScript, TypeScript and Vue 2/3 (Auto detect)
pnpm i -D @fbzn/eslint-config-prettier # Prettier only
pnpm i -D @fbzn/eslint-config # JavaScript, TypeScript, Vue 2/3 and Prettier
pnpm i -D @fbzn/eslint-config
// .eslintrc.js
module.exports = {
root: true,
extends: ['@fbzn/eslint-config'],
rules: {
// Your custom rules
},
}
or
// .eslintrc.json
{
root: true,
extends: ['@fbzn/eslint-config'],
rules: {
// Your custom rules
},
}
// .prettierrc
{
"singleQuote": true,
"semi": true,
"arrowParens": "avoid",
"jsxSingleQuote": true,
"endOfLine": "lf",
"trailingComma": "es5"
}
// settings.json
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"html",
"vue",
"json",
"json5",
"jsonc",
"yaml"
],
"eslint.probe": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue",
"json",
"json5",
"jsonc",
"yaml"
]
}
// setting.json
{
"editor.tabSize": 2
}
or
create .editorconfig
file
Then install EditorConfig for VS Code
Plugin in VSCode
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
MIT License © 2021-PRESENT WQ