Skip to content

Commit 0e06242

Browse files
Remove "trailingComma": "none", fix lint
1 parent 34e9ee7 commit 0e06242

7 files changed

Lines changed: 33 additions & 37 deletions

File tree

.eslintrc.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ module.exports = {
33
extends: [
44
"eslint:recommended",
55
"plugin:node/recommended",
6-
"plugin:prettier/recommended"
6+
"plugin:prettier/recommended",
77
],
88
plugins: ["prettier"],
99
env: {
10-
node: true
10+
node: true,
1111
},
1212
rules: {
13-
"prettier/prettier": ["error"]
13+
"prettier/prettier": ["error"],
1414
},
1515

1616
overrides: [
1717
{
1818
files: ["test/**/*-test.js", "test/helpers/rule-test-harness.js"],
1919
env: {
20-
mocha: true
21-
}
22-
}
23-
]
20+
mocha: true,
21+
},
22+
},
23+
],
2424
};

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

ember-template-lint-plugin-prettier.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ module.exports = {
55

66
configurations: {
77
recommended: {
8-
rules: require("./lib/config/recommended")
9-
}
8+
rules: require("./lib/config/recommended"),
9+
},
1010
},
1111

1212
rules: {
13-
prettier: PrettierRule
14-
}
13+
prettier: PrettierRule,
14+
},
1515
};

lib/config/recommended.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = {
66
"block-indentation": false,
77
"linebreak-style": false,
88
quotes: false,
9-
"self-closing-void-elements": false
9+
"self-closing-void-elements": false,
1010
};

lib/rules/prettier.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const {
44
showInvisibles,
5-
generateDifferences
5+
generateDifferences,
66
} = require("prettier-linter-helpers");
77

88
const getLocFromIndex = require("../utils/get-loc-from-index");
@@ -46,11 +46,11 @@ module.exports = class Prettier extends Rule {
4646
}
4747

4848
const prettierRcOptions = prettier.resolveConfig.sync(filepath, {
49-
editorconfig: true
49+
editorconfig: true,
5050
});
5151

5252
const prettierFileInfo = prettier.getFileInfo.sync(filepath, {
53-
ignorePath: ".prettierignore"
53+
ignorePath: ".prettierignore",
5454
});
5555

5656
// Skip if file is ignored using a .prettierignore file
@@ -63,7 +63,7 @@ module.exports = class Prettier extends Rule {
6363
{ parser: "glimmer" },
6464
prettierRcOptions,
6565
{
66-
filepath
66+
filepath,
6767
}
6868
);
6969

@@ -92,7 +92,7 @@ module.exports = class Prettier extends Rule {
9292
message,
9393
line: node.loc && node.loc.start.line,
9494
column: node.loc && node.loc.start.column,
95-
source
95+
source,
9696
});
9797

9898
return;
@@ -134,8 +134,8 @@ module.exports = class Prettier extends Rule {
134134
this.log({ message, line, column, source, isFixable: true });
135135
});
136136
}
137-
}
138-
}
137+
},
138+
},
139139
};
140140
}
141141
};

lib/utils/get-loc-from-index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = function getLocFromIndex(index, lines) {
1111
cumulated += length;
1212
return {
1313
cumulated,
14-
length
14+
length,
1515
};
1616
});
1717

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test
2222
2323
test
2424
25-
{{/my-component}}`
25+
{{/my-component}}`,
2626
],
2727

2828
bad: [
@@ -35,8 +35,8 @@ test
3535
line: 1,
3636
column: 34,
3737
source: "{{#my-component}}{{/my-component}}\n",
38-
isFixable: true
39-
}
38+
isFixable: true,
39+
},
4040
},
4141
{
4242
config: true,
@@ -54,8 +54,8 @@ test
5454
data-bar="lol"
5555
some-other-thing={{haha-morethaneightychars}}>
5656
</div>`,
57-
isFixable: true
58-
}
57+
isFixable: true,
58+
},
5959
},
6060
{
6161
config: true,
@@ -66,8 +66,8 @@ test
6666
line: 1,
6767
column: 4,
6868
source: "test\n",
69-
isFixable: true
70-
}
69+
isFixable: true,
70+
},
7171
},
7272
{
7373
config: true,
@@ -84,8 +84,8 @@ test
8484
line: 1,
8585
column: 18,
8686
source: "{{#my-component}}\n\ntest\n\n{{/my-component}}",
87-
isFixable: true
88-
}
87+
isFixable: true,
88+
},
8989
},
9090
{
9191
config: true,
@@ -102,8 +102,8 @@ test
102102
column: 7,
103103
source:
104104
'{{#my-component class="class1 class2"}}\n test\n\n{{/my-component}}',
105-
isFixable: true
106-
}
107-
}
108-
]
105+
isFixable: true,
106+
},
107+
},
108+
],
109109
});

0 commit comments

Comments
 (0)