Skip to content

Instantly share code, notes, and snippets.

@frontandrews
Created January 28, 2025 19:30
Show Gist options
  • Save frontandrews/8dd22277439f6e71abfeab56c69ed6e8 to your computer and use it in GitHub Desktop.
Save frontandrews/8dd22277439f6e71abfeab56c69ed6e8 to your computer and use it in GitHub Desktop.
Eslint config with cypress and vitest
import pluginVue from 'eslint-plugin-vue';
import vueTsEslintConfig from '@vue/eslint-config-typescript';
import tsEslint from 'typescript-eslint'
import pluginVitest from '@vitest/eslint-plugin';
import pluginCypress from 'eslint-plugin-cypress/flat';
export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},
{
name: 'app/files-to-ignore',
ignores: ['**/build/**', '**/coverage/**', '.yarn/**', '**/*.spec.ts', '.cache/**','.cache/Cypress/**'],
},
{
files: ['**/*.{ts,tsx,vue}'],
languageOptions: {
parser: tsEslint.parser,
},
},
...pluginVue.configs['flat/recommended'],
...vueTsEslintConfig(),
{
...pluginVitest.configs.recommended,
files: ['__tests__/*'],
},
{
...pluginCypress.configs.recommended,
files: [
'cypress/xxxx/**/*.{cy,spec}.{js,ts,jsx,tsx}',
],
},
{
rules: {
// Custom rules
},
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment