|
| 1 | +// eslint.config.js |
| 2 | +const angularEslintPlugin = require('@angular-eslint/eslint-plugin'); |
| 3 | +const angularEslintTemplatePlugin = require('@angular-eslint/eslint-plugin-template'); |
| 4 | +const angularTemplateParser = require('@angular-eslint/template-parser'); |
| 5 | +const tseslint = require('@typescript-eslint/eslint-plugin'); |
| 6 | +const tsParser = require('@typescript-eslint/parser'); |
| 7 | + |
| 8 | +module.exports = [ |
| 9 | + { |
| 10 | + ignores: ['projects/**/*'] |
| 11 | + }, |
| 12 | + |
| 13 | + // TS files configuration |
| 14 | + { |
| 15 | + files: ['**/*.ts'], |
| 16 | + languageOptions: { |
| 17 | + parser: tsParser, |
| 18 | + parserOptions: { |
| 19 | + project: [ |
| 20 | + 'tsconfig.json', |
| 21 | + 'e2e/tsconfig.json' |
| 22 | + ], |
| 23 | + createDefaultProgram: true |
| 24 | + } |
| 25 | + }, |
| 26 | + plugins: { |
| 27 | + '@angular-eslint': angularEslintPlugin, |
| 28 | + '@angular-eslint/template': angularEslintTemplatePlugin, |
| 29 | + '@typescript-eslint': tseslint |
| 30 | + }, |
| 31 | + rules: { |
| 32 | + // Angular recommended rules |
| 33 | + ...angularEslintPlugin.configs.recommended.rules, |
| 34 | + |
| 35 | + // Angular template inline rules |
| 36 | + ...angularEslintTemplatePlugin.configs['process-inline-templates'].rules, |
| 37 | + |
| 38 | + // Component selector rules |
| 39 | + '@angular-eslint/component-selector': [ |
| 40 | + 'error', |
| 41 | + { |
| 42 | + prefix: 'mifosx', |
| 43 | + style: 'kebab-case', |
| 44 | + type: 'element' |
| 45 | + } |
| 46 | + ], |
| 47 | + '@angular-eslint/directive-selector': [ |
| 48 | + 'error', |
| 49 | + { |
| 50 | + prefix: 'mifosx', |
| 51 | + style: 'camelCase', |
| 52 | + type: 'attribute' |
| 53 | + } |
| 54 | + ] |
| 55 | + } |
| 56 | + }, |
| 57 | + |
| 58 | + // HTML files configuration |
| 59 | + { |
| 60 | + files: ['**/*.html'], |
| 61 | + languageOptions: { |
| 62 | + parser: angularTemplateParser |
| 63 | + }, |
| 64 | + plugins: { |
| 65 | + '@angular-eslint': angularEslintPlugin, |
| 66 | + '@angular-eslint/template': angularEslintTemplatePlugin |
| 67 | + }, |
| 68 | + rules: { |
| 69 | + // Angular template recommended rules |
| 70 | + ...angularEslintTemplatePlugin.configs.recommended.rules |
| 71 | + } |
| 72 | + } |
| 73 | +]; |
0 commit comments