Ziya/.config/.eslintrc.json
2025-06-21 14:05:50 +07:00

124 lines
No EOL
2.6 KiB
JSON

// .eslintrc.json
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"globals": {
"MAIN_WINDOW_VITE_DEV_SERVER_URL": "readonly",
"MAIN_WINDOW_VITE_NAME": "readonly"
},
// 'positive' dirs in .vscode/settings.json
// "ignorePatterns" → .eslintignore
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/electron",
"plugin:import/typescript",
"plugin:vue/vue3-recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"extraFileExtensions": [
".vue"
]
},
"plugins": [
"@typescript-eslint"
],
"settings": {
"import/resolver": {
"typescript": { // REF www.npmjs.com/package/eslint-import-resolver-typescript#configuration
}
}
},
"overrides": [
{
"files": [
"*.vue"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"rules": {
"vue/html-closing-bracket-spacing": [
"error",
{
"selfClosingTag": "never"
}
]
}
},
{
"files": [
"src/*.d.ts"
],
"rules": {
"no-unused-vars": "off"
}
}
],
"rules": {
"semi": [
"warn",
"never",
{
"beforeStatementContinuationChars": "always"
}
],
"no-tabs": "error",
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"max-statements-per-line": [
"error",
{
"max": 1
}
],
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
// tolerate but do not enforce comma-dangle
"comma-dangle": "off",
// up to 3 blank lines is semantics for me
"no-multiple-empty-lines": [
"warn",
{
"max": 3,
"maxBOF": 1,
"maxEOF": 1
}
],
// not having to worry about danling commas is a blessing (either way)
"@typescript-eslint/comma-dangle": "off",
// handier for testing
"import/no-named-as-default-member": "off",
// writing the type can be clarifying at times, thus permit
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
]
}
}