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',
|
|
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
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',
|
|
|
|
{ registeredComponentsOnly: true },
|
|
|
|
],
|
2024-04-25 13:27:45 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|