2024-04-25 13:27:45 +00:00
|
|
|
import { FlatCompat } from '@eslint/eslintrc';
|
2024-04-25 14:39:14 +00:00
|
|
|
import pluginJs from '@eslint/js';
|
|
|
|
import pluginVue from 'eslint-plugin-vue';
|
|
|
|
import globals from 'globals';
|
2024-04-25 13:27:45 +00:00
|
|
|
import path from 'node:path';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
2024-04-25 14:57:20 +00:00
|
|
|
import tseslint from 'typescript-eslint';
|
2024-04-25 13:27:45 +00:00
|
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
|
|
|
|
const compat = new FlatCompat({
|
|
|
|
baseDirectory: __dirname,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default [
|
2024-04-25 14:39:14 +00:00
|
|
|
{ languageOptions: { globals: globals.browser } },
|
|
|
|
pluginJs.configs.recommended,
|
2024-04-25 14:57:20 +00:00
|
|
|
...tseslint.configs.recommended,
|
2024-04-25 14:39:14 +00:00
|
|
|
...pluginVue.configs['flat/recommended'],
|
2024-04-25 13:27:45 +00:00
|
|
|
...compat.extends('@vue/eslint-config-typescript/recommended'),
|
|
|
|
...compat.extends('@vue/eslint-config-prettier'),
|
|
|
|
{
|
2024-04-26 05:00:23 +00:00
|
|
|
languageOptions: {
|
|
|
|
parserOptions: {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
},
|
|
|
|
},
|
2024-04-25 13:27:45 +00:00
|
|
|
rules: {
|
2024-04-25 14:57:20 +00:00
|
|
|
// // disable eslint no-shadow as it's causing false positives on typescript enums
|
|
|
|
// 'no-shadow': 'off',
|
2024-04-25 13:27:45 +00:00
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
2024-08-07 05:00:04 +00:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
caughtErrors: 'all',
|
|
|
|
caughtErrorsIgnorePattern: '^err|^error',
|
|
|
|
},
|
|
|
|
],
|
2024-06-07 17:18:25 +00:00
|
|
|
// Custom vue rules
|
|
|
|
|
|
|
|
'vue/block-lang': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
script: {
|
|
|
|
lang: 'ts',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-06-07 17:40:03 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rules: {
|
2024-06-07 17:18:25 +00:00
|
|
|
'vue/component-api-style': ['error'],
|
|
|
|
'vue/component-name-in-template-casing': [
|
|
|
|
'error',
|
|
|
|
'PascalCase',
|
2024-07-05 10:32:00 +00:00
|
|
|
{ registeredComponentsOnly: false, ignores: ['/i-mdi-.*/'] },
|
2024-06-07 17:18:25 +00:00
|
|
|
],
|
2024-07-20 09:06:59 +00:00
|
|
|
'vue/block-lang': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
script: {
|
|
|
|
lang: 'ts',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-07-20 09:20:53 +00:00
|
|
|
'vue/define-emits-declaration': ['error'],
|
2024-07-20 09:13:33 +00:00
|
|
|
'vue/enforce-style-attribute': ['error'],
|
2024-07-30 04:23:27 +00:00
|
|
|
'vue/block-order': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
order: ['script', 'template', 'style'],
|
|
|
|
},
|
|
|
|
],
|
2024-04-25 13:27:45 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|