103 lines
2.2 KiB
JavaScript
103 lines
2.2 KiB
JavaScript
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
import vue from 'eslint-plugin-vue';
|
|
import globals from 'globals';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import js from '@eslint/js';
|
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
});
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'**/*.d.ts',
|
|
'!src/**/*.d.ts',
|
|
'build/*',
|
|
'es/*',
|
|
'dist/*',
|
|
'**/*.js',
|
|
'**/*.test.js',
|
|
'node_modules/*',
|
|
'./node_modules/**/*',
|
|
'**/node_modules/**/*',
|
|
],
|
|
},
|
|
...compat.extends(
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:vue/vue3-essential',
|
|
'plugin:prettier/recommended'
|
|
),
|
|
{
|
|
plugins: {
|
|
'@typescript-eslint': typescriptEslint,
|
|
vue,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
|
|
parserOptions: {
|
|
parser: '@typescript-eslint/parser',
|
|
extraFileExtensions: ['.vue'],
|
|
jsxPragma: 'h',
|
|
jsxFragmentName: 'Fragment',
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
'prettier/prettier': [
|
|
'error',
|
|
{},
|
|
{
|
|
usePrettierrc: true,
|
|
},
|
|
],
|
|
|
|
'arrow-body-style': 'off',
|
|
'prefer-arrow-callback': 'off',
|
|
'no-console': 'off',
|
|
'no-debugger': 'off',
|
|
'vue/multi-word-component-names': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
args: 'all',
|
|
argsIgnorePattern: '^_',
|
|
caughtErrors: 'all',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
destructuredArrayIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
ignoreRestSiblings: true,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['**/.eslintrc.{js,cjs}'],
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
|
|
ecmaVersion: 5,
|
|
sourceType: 'commonjs',
|
|
},
|
|
},
|
|
];
|