115 lines
2.8 KiB
JavaScript
115 lines
2.8 KiB
JavaScript
import vueTsEslintConfig from "@vue/eslint-config-typescript";
|
|
import pluginImportX from "eslint-plugin-import-x";
|
|
import pluginVue from "eslint-plugin-vue";
|
|
|
|
export default [
|
|
// Global ignores
|
|
{
|
|
ignores: [
|
|
"webpack.mix.js",
|
|
"**/*.php",
|
|
"**/*.svg",
|
|
"**/vendor/**",
|
|
"node_modules/**",
|
|
"public/**",
|
|
]
|
|
},
|
|
// Vue (strongly-recommended)
|
|
...pluginVue.configs[
|
|
"flat/strongly-recommended"
|
|
],
|
|
// TypeScript via @vue/eslint-config-typescript
|
|
...vueTsEslintConfig(),
|
|
// Import plugin
|
|
pluginImportX.flatConfigs.recommended,
|
|
pluginImportX.flatConfigs.typescript,
|
|
// Global settings
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
},
|
|
settings: {"import-x/resolver": {typescript: { project: "./tsconfig.json",},},},
|
|
rules: {
|
|
// Base formatting
|
|
"indent": [
|
|
"error",
|
|
2,
|
|
{"SwitchCase": 1}
|
|
],
|
|
"linebreak-style": [
|
|
"error",
|
|
"unix"
|
|
],
|
|
"quotes": [
|
|
"error",
|
|
"double"
|
|
],
|
|
"semi": [
|
|
"error",
|
|
"always"
|
|
],
|
|
// Vue & TypeScript
|
|
"vue/one-component-per-file": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"max-len": [
|
|
"error",
|
|
{ comments: 160, code: 160, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true},
|
|
],
|
|
"object-curly-newline": [
|
|
"error",
|
|
{
|
|
ObjectExpression: { multiline: true, minProperties: 6},
|
|
ObjectPattern: { multiline: true, minProperties: 6},
|
|
ImportDeclaration: { multiline: true, minProperties: 6},
|
|
ExportDeclaration: { multiline: true, minProperties: 6},
|
|
},
|
|
],
|
|
// Import ordering
|
|
"import-x/order": [
|
|
"error",
|
|
{
|
|
groups: [
|
|
"builtin",
|
|
"external",
|
|
"internal",
|
|
"parent",
|
|
"sibling",
|
|
"index",
|
|
],
|
|
"newlines-between": "always",
|
|
alphabetize: { order: "asc", caseInsensitive: true},
|
|
pathGroups: [
|
|
{
|
|
pattern: "@angular/**",
|
|
group: "external",
|
|
position: "before",
|
|
},
|
|
{
|
|
pattern: "primeng?(/**)",
|
|
group: "external",
|
|
position: "before",
|
|
},
|
|
{
|
|
pattern: "@quezap/**",
|
|
group: "internal",
|
|
position: "after",
|
|
},
|
|
],
|
|
pathGroupsExcludedImportTypes: [
|
|
"builtin"
|
|
],
|
|
},
|
|
],
|
|
// Disable replaced rules
|
|
"import/order": "off",
|
|
},
|
|
},
|
|
];
|