Skip to content

Commit 4ed74c9

Browse files
committed
fix: when using prettier, enforce line endings and max line length in EditorConfig too
Fixes #36
1 parent 7fe208c commit 4ed74c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default function createConfig({
106106

107107
const templateData = {
108108
styleGuide,
109+
needsPrettier,
109110
fileExtensions,
110111
configsBeforeVuePlugin,
111112
configsAfterVuePlugin,

templates/_editorconfig.ejs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ indent_size = 2
44
indent_style = space
55
insert_final_newline = true
66
trim_trailing_whitespace = true
7-
<%_ if (styleGuide === 'airbnb') { _%>
8-
<%# // standard doesn't have an opinion on line endings
7+
<%_ if (styleGuide !== 'standard' || needsPrettier) { _%>
8+
<%#
9+
// standard doesn't have an opinion on line endings
910
// https://github.com/standard/standard/issues/140
1011
// or maximum line length
1112
// https://github.com/standard/standard/issues/1559
12-
// so we only configure them for airbnb style
13+
// Prettier enforces these things, though.
1314
%>
1415
end_of_line = lf
1516
max_line_length = 100

0 commit comments

Comments
 (0)