frequi_origin/eslint.config.mjs

77 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2024-04-25 14:39:14 +00:00
import pluginJs from '@eslint/js';
2024-10-09 16:23:45 +00:00
import prettierConfig from '@vue/eslint-config-prettier';
import vueEslintConfig from '@vue/eslint-config-typescript';
2024-04-25 14:39:14 +00:00
import pluginVue from 'eslint-plugin-vue';
import globals from 'globals';
2024-04-25 14:57:20 +00:00
import tseslint from 'typescript-eslint';
2024-04-25 13:27:45 +00:00
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'],
...vueEslintConfig({
extends: [
'recommended',
// 'strict',
2024-10-09 16:23:45 +00:00
],
}),
prettierConfig,
2024-04-25 13:27:45 +00:00
{
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: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^err|^error',
},
],
// Custom vue rules
'vue/block-lang': [
'error',
{
script: {
lang: 'ts',
},
},
],
2024-06-07 17:40:03 +00:00
},
},
{
rules: {
'vue/component-api-style': ['error'],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{ registeredComponentsOnly: false, ignores: ['/i-mdi-.*/'] },
],
'vue/block-lang': [
'error',
{
script: {
lang: 'ts',
},
},
],
'vue/define-emits-declaration': ['error'],
2024-07-20 09:13:33 +00:00
'vue/enforce-style-attribute': ['error'],
'vue/block-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],
2024-04-25 13:27:45 +00:00
},
},
];