Skip to content

Commit 34e9ee7

Browse files
Update peerDependencies
1 parent 0a4344d commit 34e9ee7

6 files changed

Lines changed: 315 additions & 142 deletions

File tree

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "none"
3+
}
4+

lib/rules/prettier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = class Prettier extends Rule {
106106

107107
const differences = generateDifferences(source, prettierSource);
108108

109-
differences.forEach(difference => {
109+
differences.forEach((difference) => {
110110
let message = "";
111111
let { line, column } = getLocFromIndex(
112112
difference.offset,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"prettier": ">=1.18.1"
3333
},
3434
"devDependencies": {
35-
"ember-template-lint": "^2.10.0",
35+
"ember-template-lint": "^3.2.0",
3636
"eslint": "^7.1.0",
3737
"eslint-config-prettier": "^8.3.0",
3838
"eslint-plugin-node": "^11.0.0",
@@ -41,7 +41,7 @@
4141
"markdownlint-cli": "^0.27.1",
4242
"mocha": "^8.1.0",
4343
"npm-run-all": "^4.1.5",
44-
"prettier": "^1.19.0"
44+
"prettier": "^2.2.1"
4545
},
4646
"engines": {
4747
"node": "10.* || 12.* || >= 14.*"

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ test
3131
template: "{{#my-component}}{{/my-component}}\n",
3232
fixedTemplate: "{{#my-component}}{{/my-component}}",
3333
result: {
34-
moduleId: "layout",
3534
message: "Delete `⏎`",
3635
line: 1,
3736
column: 34,
@@ -48,7 +47,6 @@ test
4847
fixedTemplate: `<div data-foo data-bar="lol" some-other-thing={{haha-morethaneightychars}}>
4948
</div>`,
5049
result: {
51-
moduleId: "layout",
5250
message: 'Replace `⏎·data-bar="lol"⏎·····` with ` data-bar="lol"`',
5351
line: 1,
5452
column: 13,
@@ -64,7 +62,6 @@ test
6462
template: "test\n",
6563
fixedTemplate: "test",
6664
result: {
67-
moduleId: "layout",
6865
message: "Delete `⏎`",
6966
line: 1,
7067
column: 4,
@@ -83,7 +80,6 @@ test
8380
test
8481
{{/my-component}}`,
8582
result: {
86-
moduleId: "layout",
8783
message: "Replace `⏎test⏎` with ` test`",
8884
line: 1,
8985
column: 18,
@@ -101,7 +97,6 @@ test
10197
test
10298
{{/my-component}}`,
10399
result: {
104-
moduleId: "layout",
105100
message: "Delete `⏎`",
106101
line: 2,
107102
column: 7,

test/unit/utils/get-loc-from-index-test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
const assert = require("assert");
33
const getLocFromIndex = require("../../../lib/utils/get-loc-from-index");
44

5-
describe("getLocFromIndex()", function() {
6-
describe("when end-of-file === newline", function() {
7-
it("should compute the location (simplest case)", function() {
5+
describe("getLocFromIndex()", function () {
6+
describe("when end-of-file === newline", function () {
7+
it("should compute the location (simplest case)", function () {
88
const index = 6;
99
const lines = ["hey\n", "how\n", "are\n", "you\n", ""];
1010

@@ -14,7 +14,7 @@ describe("getLocFromIndex()", function() {
1414
assert.equal(column, 2, "right column");
1515
});
1616

17-
it("should compute location (on first line)", function() {
17+
it("should compute location (on first line)", function () {
1818
const index = 2;
1919
const lines = ["hey\n", "how\n", "are\n", "you\n", ""];
2020

@@ -24,7 +24,7 @@ describe("getLocFromIndex()", function() {
2424
assert.equal(column, 2, "right column");
2525
});
2626

27-
it("should compute location (on first line's newline)", function() {
27+
it("should compute location (on first line's newline)", function () {
2828
const index = 4;
2929
const lines = ["hey\n", "how\n", "are\n", "you\n", ""];
3030

@@ -34,7 +34,7 @@ describe("getLocFromIndex()", function() {
3434
assert.equal(column, 4, "right column");
3535
});
3636

37-
it("should compute location (on last line)", function() {
37+
it("should compute location (on last line)", function () {
3838
const index = 13;
3939
const lines = ["hey\n", "how\n", "are\n", "you\n", ""];
4040

@@ -44,7 +44,7 @@ describe("getLocFromIndex()", function() {
4444
assert.equal(column, 1, "right column");
4545
});
4646

47-
it("should compute location (on last line's newline)", function() {
47+
it("should compute location (on last line's newline)", function () {
4848
const index = 16;
4949
const lines = ["hey\n", "how\n", "are\n", "you\n", ""];
5050

@@ -55,8 +55,8 @@ describe("getLocFromIndex()", function() {
5555
});
5656
});
5757

58-
describe("when end-of-file !== newline", function() {
59-
it("should compute the location (simplest case)", function() {
58+
describe("when end-of-file !== newline", function () {
59+
it("should compute the location (simplest case)", function () {
6060
const index = 6;
6161
const lines = ["hey\n", "how\n", "are\n", "you"];
6262

@@ -66,7 +66,7 @@ describe("getLocFromIndex()", function() {
6666
assert.equal(column, 2, "right column");
6767
});
6868

69-
it("should compute location (on first line)", function() {
69+
it("should compute location (on first line)", function () {
7070
const index = 2;
7171
const lines = ["hey\n", "how\n", "are\n", "you"];
7272

@@ -76,7 +76,7 @@ describe("getLocFromIndex()", function() {
7676
assert.equal(column, 2, "right column");
7777
});
7878

79-
it("should compute location (on first line's newline)", function() {
79+
it("should compute location (on first line's newline)", function () {
8080
const index = 4;
8181
const lines = ["hey\n", "how\n", "are\n", "you"];
8282

@@ -86,7 +86,7 @@ describe("getLocFromIndex()", function() {
8686
assert.equal(column, 4, "right column");
8787
});
8888

89-
it("should compute location (on last line)", function() {
89+
it("should compute location (on last line)", function () {
9090
const index = 13;
9191
const lines = ["hey\n", "how\n", "are\n", "you"];
9292

@@ -96,7 +96,7 @@ describe("getLocFromIndex()", function() {
9696
assert.equal(column, 1, "right column");
9797
});
9898

99-
it("should fallback on last character if index is out of range", function() {
99+
it("should fallback on last character if index is out of range", function () {
100100
const index = 50;
101101
const lines = ["hey\n", "how\n", "are\n", "you"];
102102

0 commit comments

Comments
 (0)