|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es6: true, |
| 5 | + node: true |
| 6 | + }, |
| 7 | + extends: ['prettier', 'prettier/@typescript-eslint'], |
| 8 | + parser: '@typescript-eslint/parser', |
| 9 | + parserOptions: { |
| 10 | + project: [ |
| 11 | + './src/tsconfig.json', |
| 12 | + './src/bp/ui-*/tsconfig.json', |
| 13 | + './src/bp/admin/ui/tsconfig.json', |
| 14 | + './modules/tsconfig*.eslint.json', |
| 15 | + './build/module-builder/tsconfig.json' |
| 16 | + ], |
| 17 | + tsconfigRootDir: __dirname, |
| 18 | + sourceType: 'module' |
| 19 | + }, |
| 20 | + ignorePatterns: ['**/index.d.ts', '**/global.d.ts', '**/*.scss.d.ts', '**/*.test.ts', '*.js'], |
| 21 | + plugins: ['eslint-plugin-import', 'eslint-plugin-jsdoc', '@typescript-eslint'], |
| 22 | + rules: { |
| 23 | + '@typescript-eslint/consistent-type-definitions': 'error', |
| 24 | + '@typescript-eslint/member-delimiter-style': [ |
| 25 | + 'error', |
| 26 | + { |
| 27 | + multiline: { |
| 28 | + delimiter: 'none', |
| 29 | + requireLast: true |
| 30 | + }, |
| 31 | + singleline: { |
| 32 | + delimiter: 'semi', |
| 33 | + requireLast: false |
| 34 | + } |
| 35 | + } |
| 36 | + ], |
| 37 | + '@typescript-eslint/no-floating-promises': 'error', |
| 38 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 39 | + '@typescript-eslint/quotes': [ |
| 40 | + 'error', |
| 41 | + 'single', |
| 42 | + { |
| 43 | + avoidEscape: true |
| 44 | + } |
| 45 | + ], |
| 46 | + '@typescript-eslint/semi': ['error', 'never'], |
| 47 | + '@typescript-eslint/type-annotation-spacing': 'error', |
| 48 | + 'brace-style': ['error', '1tbs'], |
| 49 | + curly: 'error', |
| 50 | + 'eol-last': 'error', |
| 51 | + eqeqeq: ['error', 'smart'], |
| 52 | + 'import/order': [ |
| 53 | + 'warn', |
| 54 | + { |
| 55 | + groups: [['builtin', 'external'], 'parent', 'index', 'sibling'], |
| 56 | + // TODO: Eventually enable this in the future for consistency |
| 57 | + // 'newlines-between': 'always', |
| 58 | + alphabetize: { |
| 59 | + order: 'asc', |
| 60 | + caseInsensitive: true |
| 61 | + }, |
| 62 | + pathGroups: [ |
| 63 | + { |
| 64 | + pattern: '~/**', |
| 65 | + group: 'external', |
| 66 | + position: 'after' |
| 67 | + } |
| 68 | + ], |
| 69 | + pathGroupsExcludedImportTypes: ['builtin'] |
| 70 | + } |
| 71 | + ], |
| 72 | + 'jsdoc/check-alignment': 'error', |
| 73 | + 'linebreak-style': ['error', 'unix'], |
| 74 | + 'no-console': [ |
| 75 | + 'warn', |
| 76 | + { |
| 77 | + allow: [ |
| 78 | + 'warn', |
| 79 | + 'dir', |
| 80 | + 'time', |
| 81 | + 'timeEnd', |
| 82 | + 'timeLog', |
| 83 | + 'trace', |
| 84 | + 'assert', |
| 85 | + 'clear', |
| 86 | + 'count', |
| 87 | + 'countReset', |
| 88 | + 'group', |
| 89 | + 'groupEnd', |
| 90 | + 'table', |
| 91 | + 'debug', |
| 92 | + 'info', |
| 93 | + 'dirxml', |
| 94 | + 'error', |
| 95 | + 'groupCollapsed', |
| 96 | + 'Console', |
| 97 | + 'profile', |
| 98 | + 'profileEnd', |
| 99 | + 'timeStamp', |
| 100 | + 'context' |
| 101 | + ] |
| 102 | + } |
| 103 | + ], |
| 104 | + 'no-duplicate-imports': 'error', |
| 105 | + 'no-return-await': 'error', |
| 106 | + 'no-trailing-spaces': 'error', |
| 107 | + 'no-var': 'error', |
| 108 | + 'object-shorthand': 'error', |
| 109 | + 'prefer-const': 'warn' |
| 110 | + } |
| 111 | +} |
0 commit comments