|
| 1 | +// eslint.config.js |
| 2 | +import { defineConfig } from 'eslint/config'; |
| 3 | +import tinymceEslintPlugin from '@tinymce/eslint-plugin'; |
| 4 | +import js from '@eslint/js'; |
| 5 | + |
| 6 | +import pluginChaiFriendly from 'eslint-plugin-chai-friendly'; |
| 7 | + |
| 8 | +export default defineConfig([ |
| 9 | + { |
| 10 | + plugins: { |
| 11 | + '@tinymce': tinymceEslintPlugin |
| 12 | + }, |
| 13 | + extends: [ '@tinymce/standard' ], |
| 14 | + files: [ |
| 15 | + 'tinymce-angular-component/src/**/*.ts', |
| 16 | + 'stories/**/*.ts' |
| 17 | + ], |
| 18 | + ignores: [ |
| 19 | + 'src/demo/demo.ts' |
| 20 | + ], |
| 21 | + languageOptions: { |
| 22 | + parserOptions: { |
| 23 | + sourceType: 'module', |
| 24 | + project: [ |
| 25 | + './tsconfig.json' |
| 26 | + ] |
| 27 | + }, |
| 28 | + }, |
| 29 | + rules: { |
| 30 | + '@tinymce/prefer-fun': 'off', |
| 31 | + '@tinymce/prefer-fun': 'off', |
| 32 | + 'no-underscore-dangle': 'off', |
| 33 | + '@typescript-eslint/member-ordering': 'off' |
| 34 | + } |
| 35 | + }, |
| 36 | + { |
| 37 | + files: [ |
| 38 | + '**/*.js' |
| 39 | + ], |
| 40 | + env: { |
| 41 | + es6: true, |
| 42 | + node: true, |
| 43 | + browser: true |
| 44 | + }, |
| 45 | + plugins: { js }, |
| 46 | + extends: [ 'js/recommended' ], |
| 47 | + parser: 'espree', |
| 48 | + languageOptions: { |
| 49 | + parserOptions: { |
| 50 | + ecmaVersion: 2020, |
| 51 | + sourceType: 'module' |
| 52 | + }, |
| 53 | + }, |
| 54 | + rules: { |
| 55 | + 'indent': [ 'error', 2, { 'SwitchCase': 1 } ], |
| 56 | + 'no-shadow': 'error', |
| 57 | + 'no-unused-vars': [ 'error', { 'argsIgnorePattern': '^_' } ], |
| 58 | + 'object-curly-spacing': [ 'error', 'always', { 'arraysInObjects': false, 'objectsInObjects': false } ], |
| 59 | + 'quotes': [ 'error', 'single' ], |
| 60 | + 'semi': 'error' |
| 61 | + } |
| 62 | + }, |
| 63 | + { |
| 64 | + files: [ |
| 65 | + '**/*Test.ts', |
| 66 | + '**/test/**/*.ts' |
| 67 | + ], |
| 68 | + plugins: { |
| 69 | + 'chai-friendly': pluginChaiFriendly |
| 70 | + }, |
| 71 | + rules: { |
| 72 | + 'no-unused-expressions': 'off', |
| 73 | + 'no-console': 'off', |
| 74 | + 'max-classes-per-file': 'off', |
| 75 | + '@typescript-eslint/no-non-null-assertion': 'off' |
| 76 | + } |
| 77 | + } |
| 78 | +]); |
0 commit comments