diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..b3dfee7af --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..4cab1f4d2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..2ca56d8f0 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,6 @@ +/** + * @type {import('prettier').Config} + */ +module.exports = { + // defaults only so far +}; diff --git a/README.md b/README.md index db59a053d..ab0c2d668 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,16 @@ Note: This is only useful if you have access to a production running on Render.c 2. Copy generated files from output folder to gear-ids.ts file 3. Get .png from Lean's repository 4. Generate .avif image + +### Fix errors from the CI Pipeline + +If you change any files and the CI pipeline errors out on certain formatting/linting steps (e.g. the `Prettier` or `Stylelint` step), run this command in the repo's root directory: + +```sh +npm run cf +``` + +Before committing, if for some reason you see an abnormally high amount of files changed, simply run `git add --renormalize .` and it will fix the error. + +- Background info: this is caused by the line endings on your local repo not matching those with the remote repo's, which should remove the vast majority of unstaged files that appears to have no changes at all. +- Reference: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings