Skip to content

Commit 7043752

Browse files
authored
Merge pull request #70 from ember-template-lint/drop-tl-1
Drop support for ember-template-lint@1
2 parents 2209741 + c097379 commit 7043752

5 files changed

Lines changed: 256 additions & 819 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
include:
3434
- stage: "Tests"
35-
name: "ember-template-lint 1.6.1"
35+
name: "ember-template-lint 2.1.0"
3636
install: yarn install --frozen-lockfile --non-interactive
3737

3838
- name: "ember-template-lint latest"

lib/rules/prettier.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function isFile(loc) {
2020
module.exports = class Prettier extends Rule {
2121
constructor(options) {
2222
super(options);
23-
this.filePath = options.moduleName + ".hbs";
23+
this.filePath = options.filePath;
2424
}
2525

2626
visitor() {
@@ -38,15 +38,7 @@ module.exports = class Prettier extends Rule {
3838
}
3939

4040
const source = this.sourceForNode(node);
41-
// Following
42-
// https://github.com/ember-template-lint/ember-template-lint/commit/a7bf55cf36ee90d0460e7cb94e7ca4731aaa4be7
43-
// `templateEnvironmentData` is deprecated (in v1.8.0).
44-
// This code aims at remaining compatible with
45-
// ember-template-lint@>=1.3.0. The ternary might be removed when
46-
// upgrading the peerDependency to ember-template-lint@2.
47-
let filepath = this.filePath
48-
? this.filePath
49-
: this.templateEnvironmentData.moduleName + ".hbs";
41+
let filepath = this.filePath;
5042

5143
if (!prettier) {
5244
// Prettier is expensive to load, so only load it if needed.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"license": "Apache-2.0",
2727
"private": false,
2828
"peerDependencies": {
29-
"ember-template-lint": "^1.6.1",
29+
"ember-template-lint": "^2.1.0",
3030
"prettier": "^1.18.2"
3131
},
3232
"devDependencies": {
33-
"ember-template-lint": "^1.6.1",
33+
"ember-template-lint": "^2.1.0",
3434
"eslint": "^6.0.1",
3535
"eslint-config-prettier": "^6.0.0",
3636
"eslint-plugin-node": "^11.0.0",

test/unit/rules/lint-prettier-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test
3030
config: true,
3131
template: "{{#my-component}}{{/my-component}}\n",
3232
result: {
33-
moduleId: "layout.hbs",
33+
moduleId: "layout",
3434
message: "Delete `⏎`",
3535
line: 1,
3636
column: 34,
@@ -41,7 +41,7 @@ test
4141
config: true,
4242
template: "test\n",
4343
result: {
44-
moduleId: "layout.hbs",
44+
moduleId: "layout",
4545
message: "Delete `⏎`",
4646
line: 1,
4747
column: 4,
@@ -56,7 +56,7 @@ test
5656
5757
{{/my-component}}`,
5858
result: {
59-
moduleId: "layout.hbs",
59+
moduleId: "layout",
6060
message: "Replace `⏎test⏎` with ` test`",
6161
line: 1,
6262
column: 18,
@@ -70,7 +70,7 @@ test
7070
7171
{{/my-component}}`,
7272
result: {
73-
moduleId: "layout.hbs",
73+
moduleId: "layout",
7474
message: "Delete `⏎`",
7575
line: 2,
7676
column: 7,

0 commit comments

Comments
 (0)