From e2a03786e18879e21c25ab45d0fabe59ce9da6e5 Mon Sep 17 00:00:00 2001 From: Arthur Abeilice Date: Mon, 4 May 2026 23:58:21 -0300 Subject: [PATCH] chore(eslint): scope rules via files instead of negated ignores --- eslint.config.js | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index fbef6b3..95b8f64 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,30 +2,18 @@ import pluginVue from 'eslint-plugin-vue'; import vueTsConfig from '@vue/eslint-config-typescript'; import vuePrettierConfig from '@vue/eslint-config-prettier'; +const sources = ['src/**/*.{ts,tsx,vue,js,mjs,cjs}', 'tests/**/*.{ts,tsx,vue,js,mjs,cjs}']; + export default [ + { ignores: ['src/generated.ts'] }, + ...pluginVue.configs['flat/essential'].map((c) => ({ ...c, files: sources })), + ...vueTsConfig().map((c) => ({ ...c, files: sources })), + { ...vuePrettierConfig, files: sources }, { - ignores: [ - '**', - '!src/**', - '!tests/**', - 'src/generated.ts', - ], - }, - ...pluginVue.configs['flat/essential'], - ...vueTsConfig(), - - // 1. Mantemos a config base do Prettier - vuePrettierConfig, - - { + files: sources, rules: { - // 2. Forçamos o ESLint a exigir aspas simples quotes: ['error', 'single', { avoidEscape: true }], - - // 3. IMPORTANTÍSSIMO: Forçamos o PRETTIER a também usar aspas simples - // Isso evita que um atropele o outro 'prettier/prettier': ['error', { singleQuote: true }], - '@typescript-eslint/no-unused-vars': [ 'warn', {