init: prettier & editorconfig

main
phga 2 years ago
commit 71d4dbaa3c
Signed by: phga
GPG Key ID: 5249548AA705F019

@ -0,0 +1,27 @@
# Some docs: https://EditorConfig.org
root = true # top-most EditorConfig file
[*]
end_of_line = lf # unix style line endings
insert_final_newline = false # newline at end of file
charset = utf-8 # encoding
max_line_length = 90 # Suggested maximum of 90 characters per line
[*.js?] # .js and .jsx
indent_style = space
indent_size = 2
quote_type = single
[*.ts?] # .ts and .tsx
indent_style = space
indent_size = 2
quote_type = single
[*.py]
indent_style = space
indent_size = 4
quote_type = single
[*.json]
indent_style = space
indent_size = 2

@ -0,0 +1,7 @@
{
"printWidth": 90,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"jsxSingleQuote": true
}

@ -0,0 +1,48 @@
* Example Configs for Several Useful Modes
For example configs take a look at the files provided in this repo.
** Editorconfig
Official Documentation: https://editorconfig.org/
The file ~.editorconfig~ can be placed somewhere in the directory tree above the files you
want the config to take affect in.
#+begin_example
├── .editorconfig
├── org1
│ └── my-app1
│ └──── index.html <- takes affect here
└── org2
└── my-app2
└──── index.html <- takes affect here as well
#+end_example
*** Requirements
#+begin_src emacs-lisp :results output scalar
(straight-use-package 'editorconfig)
(editorconfig-mode t)
#+end_src
** Prettier (JS/TS Code Formatter)
Official Documentation: https://prettier.io/
#+begin_example
├── .prettierrc.json
├── org1
│ └── my-app1
│ └──── index.tsx <- takes affect here
└── org2
└── my-app2
└──── index.jsx <- takes affect here as well
#+end_example
*** Requirements
#+begin_src emacs-lisp :results output scalar
(straight-use-package 'prettier-js)
(add-hook 'web-tide-mode-hook 'prettier-js-mode)
#+end_src
Loading…
Cancel
Save