|
1 | 1 | // This is a workaround for https://github.com/eslint/eslint/issues/3458 |
2 | | -require('@rushstack/eslint-config/patch/modern-module-resolution'); |
| 2 | +require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); |
| 3 | +// This is a workaround for https://github.com/microsoft/rushstack/issues/3021 |
| 4 | +require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); |
3 | 5 |
|
4 | 6 | module.exports = { |
5 | | - extends: ['@rushstack/eslint-config/profile/node', '@rushstack/eslint-config/mixins/friendly-locals'], |
6 | | - parserOptions: { tsconfigRootDir: __dirname } |
| 7 | + extends: [ |
| 8 | + '@rushstack/heft-node-rig/profiles/default/includes/eslint/profile/node', |
| 9 | + '@rushstack/heft-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' |
| 10 | + ], |
| 11 | + parserOptions: { tsconfigRootDir: __dirname }, |
| 12 | + |
| 13 | + plugins: ['eslint-plugin-header'], |
| 14 | + overrides: [ |
| 15 | + { |
| 16 | + files: ['*.ts', '*.tsx'], |
| 17 | + rules: { |
| 18 | + // Rationale: Including the `type` annotation in the import statement for imports |
| 19 | + // only used as types prevents the import from being emitted in the compiled output. |
| 20 | + '@typescript-eslint/consistent-type-imports': [ |
| 21 | + 'warn', |
| 22 | + { prefer: 'type-imports', disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' } |
| 23 | + ], |
| 24 | + |
| 25 | + // Rationale: If all imports in an import statement are only used as types, |
| 26 | + // then the import statement should be omitted in the compiled JS output. |
| 27 | + '@typescript-eslint/no-import-type-side-effects': 'warn', |
| 28 | + |
| 29 | + 'header/header': [ |
| 30 | + 'warn', |
| 31 | + 'line', |
| 32 | + [ |
| 33 | + ' Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.', |
| 34 | + ' See LICENSE in the project root for license information.' |
| 35 | + ] |
| 36 | + ] |
| 37 | + } |
| 38 | + } |
| 39 | + ] |
7 | 40 | }; |
0 commit comments