|
| 1 | +/** |
| 2 | + * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. |
| 3 | + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options |
| 4 | + */ |
| 5 | + |
| 6 | +import globals from 'globals'; |
| 7 | +import { defineConfig } from 'eslint/config'; |
| 8 | +import ckeditor5Rules from 'eslint-plugin-ckeditor5-rules'; |
| 9 | +import ckeditor5Config from 'eslint-config-ckeditor5'; |
| 10 | +import pluginVue from 'eslint-plugin-vue'; |
| 11 | +import ts from 'typescript-eslint'; |
| 12 | + |
| 13 | +export default defineConfig( [ |
| 14 | + { |
| 15 | + ignores: [ |
| 16 | + 'coverage/**', |
| 17 | + 'dist/**', |
| 18 | + 'release/**' |
| 19 | + ] |
| 20 | + }, |
| 21 | + |
| 22 | + { |
| 23 | + extends: ckeditor5Config, |
| 24 | + |
| 25 | + languageOptions: { |
| 26 | + ecmaVersion: 'latest', |
| 27 | + sourceType: 'module', |
| 28 | + globals: { |
| 29 | + ...globals.browser |
| 30 | + } |
| 31 | + }, |
| 32 | + |
| 33 | + linterOptions: { |
| 34 | + reportUnusedDisableDirectives: 'warn', |
| 35 | + reportUnusedInlineConfigs: 'warn' |
| 36 | + }, |
| 37 | + |
| 38 | + plugins: { |
| 39 | + 'ckeditor5-rules': ckeditor5Rules |
| 40 | + }, |
| 41 | + |
| 42 | + rules: { |
| 43 | + 'ckeditor5-rules/license-header': [ 'error', { headerLines: [ |
| 44 | + '/**', |
| 45 | + ' * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.', |
| 46 | + ' * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options', |
| 47 | + ' */' |
| 48 | + ] } ], |
| 49 | + 'ckeditor5-rules/require-file-extensions-in-imports': [ |
| 50 | + 'error', |
| 51 | + { |
| 52 | + extensions: [ '.ts', '.js', '.json' ] |
| 53 | + } |
| 54 | + ], |
| 55 | + 'ckeditor5-rules/prevent-license-key-leak': 'error', |
| 56 | + 'no-unused-vars': 'off' |
| 57 | + } |
| 58 | + }, |
| 59 | + |
| 60 | + // Rules recommended by the Vue plugin that apply to all files. |
| 61 | + { |
| 62 | + extends: pluginVue.configs[ 'flat/recommended' ], |
| 63 | + |
| 64 | + rules: { |
| 65 | + 'vue/multi-word-component-names': 'off' |
| 66 | + } |
| 67 | + }, |
| 68 | + |
| 69 | + // Rules specific to `.vue` files. |
| 70 | + { |
| 71 | + files: [ '**/*.vue' ], |
| 72 | + |
| 73 | + languageOptions: { |
| 74 | + parserOptions: { |
| 75 | + parser: ts.parser |
| 76 | + } |
| 77 | + }, |
| 78 | + |
| 79 | + rules: { |
| 80 | + 'ckeditor5-rules/license-header': 'off' |
| 81 | + } |
| 82 | + }, |
| 83 | + |
| 84 | + // Rules specific to `scripts` folder. |
| 85 | + { |
| 86 | + files: [ 'scripts/**/*' ], |
| 87 | + |
| 88 | + languageOptions: { |
| 89 | + globals: { |
| 90 | + ...globals.node |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | +] ); |
0 commit comments