|
| 1 | +import eslint from '@eslint/js' |
| 2 | +import eslintPluginUnicorn from 'eslint-plugin-unicorn' |
| 3 | +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' |
| 4 | +import eslintPluginVue from 'eslint-plugin-vue' |
| 5 | +import globals from 'globals' |
| 6 | +import typescriptEslint from 'typescript-eslint' |
| 7 | + |
| 8 | +export default typescriptEslint.config( |
| 9 | + { ignores: ['**/*.d.ts', '**/coverage', '**/dist', '**/docs', 'eslint.config.mjs'] }, |
| 10 | + { |
| 11 | + extends: [ |
| 12 | + eslint.configs.recommended, |
| 13 | + ...typescriptEslint.configs.recommended, |
| 14 | + ...eslintPluginVue.configs['flat/recommended'], |
| 15 | + eslintPluginUnicorn.configs['flat/recommended'], |
| 16 | + ], |
| 17 | + files: ['packages/**/src/**/*.{js,ts,tsx}'], |
| 18 | + languageOptions: { |
| 19 | + ecmaVersion: 'latest', |
| 20 | + sourceType: 'module', |
| 21 | + globals: globals.browser, |
| 22 | + parserOptions: { |
| 23 | + parser: typescriptEslint.parser, |
| 24 | + }, |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + 'no-console': 'off', |
| 28 | + 'no-debugger': 'off', |
| 29 | + 'unicorn/filename-case': 'off', |
| 30 | + 'unicorn/no-array-for-each': 'off', |
| 31 | + 'unicorn/no-null': 'off', |
| 32 | + 'unicorn/prefer-dom-node-append': 'off', |
| 33 | + 'unicorn/prefer-export-from': 'off', |
| 34 | + 'unicorn/prefer-query-selector': 'off', |
| 35 | + 'unicorn/prevent-abbreviations': 'off', |
| 36 | + 'vue/require-default-prop': 'off', |
| 37 | + }, |
| 38 | + }, |
| 39 | + { |
| 40 | + files: ['**/*.mjs'], |
| 41 | + languageOptions: { |
| 42 | + globals: { |
| 43 | + ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), |
| 44 | + ...globals.node, |
| 45 | + }, |
| 46 | + |
| 47 | + ecmaVersion: 5, |
| 48 | + sourceType: 'module', |
| 49 | + }, |
| 50 | + }, |
| 51 | + { |
| 52 | + files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], |
| 53 | + languageOptions: { |
| 54 | + globals: { |
| 55 | + ...globals.jest, |
| 56 | + }, |
| 57 | + }, |
| 58 | + }, |
| 59 | + { |
| 60 | + files: ['packages/docs/build/**'], |
| 61 | + languageOptions: { |
| 62 | + globals: { |
| 63 | + ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), |
| 64 | + ...globals.node, |
| 65 | + }, |
| 66 | + |
| 67 | + ecmaVersion: 5, |
| 68 | + sourceType: 'commonjs', |
| 69 | + }, |
| 70 | + rules: { |
| 71 | + 'no-console': 'off', |
| 72 | + strict: 'error', |
| 73 | + }, |
| 74 | + }, |
| 75 | + eslintPluginPrettierRecommended, |
| 76 | +) |
0 commit comments