|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import {join} from 'path'; |
| 9 | +import {sync as globSync} from 'glob'; |
10 | 10 | import {TargetVersion} from './index';
|
11 | 11 |
|
12 | 12 | /** List of rules that need to be enabled when running the TSLint fix task. */
|
@@ -54,19 +54,7 @@ const upgradeRules = [
|
54 | 54 | ];
|
55 | 55 |
|
56 | 56 | /** List of absolute paths that refer to directories that contain the upgrade rules. */
|
57 |
| -const rulesDirectory = [ |
58 |
| - // TODO(devversion): consider automatically resolving rule directories. |
59 |
| - join(__dirname, 'rules/'), |
60 |
| - join(__dirname, 'rules/attribute-selectors'), |
61 |
| - join(__dirname, 'rules/class-names'), |
62 |
| - join(__dirname, 'rules/class-inheritance'), |
63 |
| - join(__dirname, 'rules/input-names'), |
64 |
| - join(__dirname, 'rules/output-names'), |
65 |
| - join(__dirname, 'rules/css-selectors'), |
66 |
| - join(__dirname, 'rules/element-selectors'), |
67 |
| - join(__dirname, 'rules/property-names'), |
68 |
| - join(__dirname, 'rules/method-calls'), |
69 |
| -]; |
| 57 | +const rulesDirectory = globSync('rules/**/', {cwd: __dirname, absolute: true}); |
70 | 58 |
|
71 | 59 | /**
|
72 | 60 | * Creates a TSLint configuration object that can be passed to the schematic `TSLintFixTask`.
|
|
0 commit comments