Skip to content

Commit

Permalink
fix: when using prettier, enforce line endings and max line length in…
Browse files Browse the repository at this point in the history
… EditorConfig too

Fixes #36
  • Loading branch information
haoqunjiang committed Nov 11, 2024
1 parent 7fe208c commit 4ed74c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default function createConfig({

const templateData = {
styleGuide,
needsPrettier,
fileExtensions,
configsBeforeVuePlugin,
configsAfterVuePlugin,
Expand Down
7 changes: 4 additions & 3 deletions templates/_editorconfig.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
<%_ if (styleGuide === 'airbnb') { _%>
<%# // standard doesn't have an opinion on line endings
<%_ if (styleGuide !== 'standard' || needsPrettier) { _%>
<%#
// standard doesn't have an opinion on line endings
// https://github.com/standard/standard/issues/140
// or maximum line length
// https://github.com/standard/standard/issues/1559
// so we only configure them for airbnb style
// Prettier enforces these things, though.
%>
end_of_line = lf
max_line_length = 100
Expand Down

0 comments on commit 4ed74c9

Please sign in to comment.