processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.4k stars 1.34k forks source link

Enhancement : Add a .prettierrc file to match with the .eslintrc #861

Closed siddhant1 closed 3 years ago

siddhant1 commented 5 years ago

We should add a .prettierrc file to match with the .eslintrc . I had my global prettierrc setup (which autoformats on save) which includes no-semicolon rule. But in this project the no-semicolon rule breaks the rules in .eslintrc To prevent this we should add local .prettierrc file that follows .eslintrc rules

@catarak you can create one using the playground https://prettier.io/playground/ and I will add that

catarak commented 5 years ago

this could be a nice to have! for another project i'm using EditorConfig and i'm not sure if that would be better, or if both would be great, or if only a prettier config would be good enough.

siddhant1 commented 5 years ago

https://stackoverflow.com/questions/48363647/editorconfig-vs-eslint-vs-prettier-is-it-worthwhile-to-use-them-all

catarak commented 5 years ago

thanks! my concern with adding this stuff is that it's another thing to install, which might be intimidating for new contributors. however, i guess adding these files to the project doesn't do any harm if you don't have these installed, and the linter will pick up the styling errors anyway.

siddhant1 commented 5 years ago

Can you create a .prettierrc to match with the code style I will configure eslint to work with it

siddhant1 commented 5 years ago

@catarak Can you see if this prettierrc works.

{
    "arrowParens": "avoid",
    "bracketSpacing": true,
    "htmlWhitespaceSensitivity": "css",
    "insertPragma": false,
    "jsxBracketSameLine": false,
    "jsxSingleQuote": false,
    "parser": "babylon",
    "printWidth": 80,
    "proseWrap": "never",
    "requirePragma": false,
    "semi": true,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  }
siddhant1 commented 5 years ago

@catarak can you help me close this one too

catarak commented 5 years ago

can you make a PR?

siddhant1 commented 5 years ago

Sure!