frequi_origin/eslint.config.mjs
2024-06-07 19:40:03 +02:00

57 lines
1.5 KiB
JavaScript

import { FlatCompat } from '@eslint/eslintrc';
import pluginJs from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import tseslint from 'typescript-eslint';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
...compat.extends('@vue/eslint-config-typescript/recommended'),
...compat.extends('@vue/eslint-config-prettier'),
{
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
rules: {
// // disable eslint no-shadow as it's causing false positives on typescript enums
// 'no-shadow': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// Custom vue rules
'vue/block-lang': [
'error',
{
script: {
lang: 'ts',
},
},
],
},
},
{
rules: {
'vue/component-api-style': ['error'],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{ registeredComponentsOnly: true },
],
},
},
];