2023-09-22 06:43:25 +03:00
|
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
|
|
import eslintJs from '@eslint/js'
|
|
|
|
import * as path from 'node:path'
|
|
|
|
import * as url from 'node:url'
|
|
|
|
|
|
|
|
const compat = new FlatCompat()
|
|
|
|
|
|
|
|
const DIR_NAME = path.dirname(url.fileURLToPath(import.meta.url))
|
|
|
|
|
|
|
|
const conf = [
|
|
|
|
{
|
2024-03-05 10:06:11 +03:00
|
|
|
ignores: [
|
|
|
|
'dist',
|
|
|
|
'templates',
|
2024-03-06 18:34:07 +03:00
|
|
|
'.histoire',
|
2024-03-05 10:06:11 +03:00
|
|
|
'playwright-report',
|
2024-04-24 14:40:42 +03:00
|
|
|
'test-results',
|
2024-08-22 17:09:17 +03:00
|
|
|
'**/*.timestamp-*.mjs',
|
2024-03-05 10:06:11 +03:00
|
|
|
],
|
2023-09-22 06:43:25 +03:00
|
|
|
},
|
|
|
|
...compat.extends('plugin:vue/vue3-recommended'),
|
|
|
|
eslintJs.configs.recommended,
|
|
|
|
...compat.extends('@vue/eslint-config-typescript', '@vue/eslint-config-prettier'),
|
|
|
|
{
|
|
|
|
// files: ['{**,src}/*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}'],
|
|
|
|
languageOptions: {
|
|
|
|
parserOptions: {
|
|
|
|
tsconfigRootDir: DIR_NAME,
|
|
|
|
ecmaVersion: 'latest',
|
2024-08-08 15:12:05 +03:00
|
|
|
project: ['./tsconfig.app.json', './tsconfig.node.json', './tsconfig.app.vitest.json'],
|
2023-09-22 06:43:25 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
camelcase: [1, { ignoreImports: true }],
|
|
|
|
'no-inner-declarations': 0,
|
2023-10-07 23:57:47 +03:00
|
|
|
'vue/attribute-hyphenation': [2, 'never'],
|
2023-09-22 06:43:25 +03:00
|
|
|
'vue/v-on-event-hyphenation': [2, 'never'],
|
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
1,
|
|
|
|
{
|
|
|
|
varsIgnorePattern: '^_',
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
},
|
|
|
|
],
|
2024-07-12 13:45:57 +03:00
|
|
|
'no-unused-labels': 0,
|
2023-09-22 06:43:25 +03:00
|
|
|
},
|
|
|
|
},
|
2023-10-29 22:02:07 +03:00
|
|
|
{
|
|
|
|
files: ['stories/*.vue'],
|
|
|
|
rules: {
|
|
|
|
'vue/multi-word-component-names': 0,
|
|
|
|
},
|
|
|
|
},
|
2024-03-05 10:06:11 +03:00
|
|
|
// We must make sure our E2E tests await all steps, otherwise they're flaky.
|
|
|
|
{
|
|
|
|
files: ['e2e/**/*.spec.ts'],
|
|
|
|
languageOptions: {
|
|
|
|
parser: await import('@typescript-eslint/parser'),
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/no-floating-promises': 2,
|
|
|
|
},
|
|
|
|
},
|
2023-09-22 06:43:25 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
export default conf
|