Skip to content

Commit 0006360

Browse files
authored
Merge pull request #31 from psbanka/move-ember-template-lint-dependency
➖ Remove ember-template-lint as a direct devDependency
2 parents d2e30a7 + f1ecf62 commit 0006360

4 files changed

Lines changed: 251 additions & 69 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
For every release of eslint-plugin-hbs we provide notes as to what to expect.
44

5+
# 1.0.0
6+
* ➖ Remove hard-dependency on ember-template-lint; now requiring downstream projects to include it on their own.
7+
58
## 0.1.2
69
* ⬆️ Upgrade dependencies: eslint, ember-template-lint
710

lib/rules/check-hbs-template-literals.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* @author Peter Banka
44
*/
55
'use strict'
6-
const TemplateLinter = require('ember-template-lint')
76
const fs = require('fs')
87

98
//------------------------------------------------------------------------------
@@ -47,6 +46,13 @@ module.exports = {
4746
create: function(context) {
4847
let config = {}
4948
let linter
49+
let TemplateLinter
50+
try {
51+
TemplateLinter = require('ember-template-lint')
52+
} catch(e) {
53+
console.error('Could not import ember-template-lint. Please make sure that this is a dependency in your project')
54+
process.exit(1)
55+
}
5056
if (context.options.length > 1) {
5157
const extendedOptions = context.options[1]
5258
const filename = extendedOptions.ConfigFile
@@ -129,7 +135,7 @@ function unindentAndStripSafeNewlines(template) {
129135
}
130136
}
131137
} while (testChar)
132-
138+
133139
lines = lines.map(line => {
134140
return line.substr(countSame)
135141
})

0 commit comments

Comments
 (0)