|
1 | 1 | "use strict"; |
| 2 | +const path = require('path'); |
2 | 3 |
|
3 | 4 | /** |
4 | 5 | * AureliaTemplateLinter config |
5 | 6 | */ |
6 | 7 | const aureliaTemplateLinter = function (options) { |
7 | | - return { |
8 | | - module: { |
9 | | - preLoaders: [ |
10 | | - { |
11 | | - test: /\.html$/, |
12 | | - loader: 'aurelia-template-lint-loader' |
13 | | - } |
14 | | - ] |
15 | | - }, |
16 | | - aureliaTemplateLinter: { |
17 | | - configuration: options && options.config, |
| 8 | + return { |
| 9 | + module: { |
| 10 | + rules: [ |
| 11 | + { |
| 12 | + test: /\.html$/, |
| 13 | + loader: 'aurelia-template-lint-loader', |
| 14 | + enforce: 'pre', |
| 15 | + exclude: [path.join(options.rootDir, 'node_modules')] |
| 16 | + } |
| 17 | + ] |
| 18 | + }, |
| 19 | + aureliaTemplateLinter: { |
| 20 | + configuration: options && options.config, |
18 | 21 |
|
19 | | - // aurelia errors are displayed by default as warnings |
20 | | - // set emitErrors to true to display them as errors |
21 | | - emitErrors: false, |
| 22 | + // aurelia errors are displayed by default as warnings |
| 23 | + // set emitErrors to true to display them as errors |
| 24 | + emitErrors: false, |
22 | 25 |
|
23 | | - // aurelia does not interrupt the compilation by default |
24 | | - // if you want any file with aurelia errors to fail |
25 | | - // set failOnHint to true |
26 | | - failOnHint: options.failOnHint, |
| 26 | + // aurelia does not interrupt the compilation by default |
| 27 | + // if you want any file with aurelia errors to fail |
| 28 | + // set failOnHint to true |
| 29 | + failOnHint: options.failOnHint, |
27 | 30 |
|
28 | | - typeChecking: options.typeChecking, |
29 | | - fileGlob: options.sourceDir |
30 | | - } |
31 | | - }; |
| 31 | + typeChecking: options.typeChecking, |
| 32 | + fileGlob: options.sourceDir |
| 33 | + } |
| 34 | + }; |
32 | 35 | }; |
| 36 | + |
33 | 37 | module.exports = aureliaTemplateLinter; |
0 commit comments