transloadit / uppy.io

The Uppy website
https://uppy.io
11 stars 27 forks source link

More strict eslint? #90

Open mifi opened 1 year ago

mifi commented 1 year ago

I noticed that eslint doesn't complain about almost anything, e.g. semicolons vs no semicolons, and it doesn't help us with missing react hooks dependencies. should we have more strict linting? maybe transloadit rules?

kvz commented 1 year ago

plus prettier i'd vote, same as we've been doing for other transloadit repos 👌

mifi commented 1 year ago

we already have prettier here but for some reason i think it's not working properly:

aduh95 commented 1 year ago
  • i cannot get it to run on save in vscode even if i have set editor.formatOnSave: true

That's on MDX files, right? I think that's because Prettier doesn't support them out of the box.

mifi commented 1 year ago

no, also examples.tsx

but I ran the "npm run format" command and it caused aws-s3.mdx to get modified by prettier: https://github.com/transloadit/uppy.io/pull/91/commits/bbba0e58f65dd4dcbed7c97111e16227d8e76f9a#diff-4c2bc38564b6cae2154e034b529fcd7788562662ff3b1121992c1d454eb8abc2 - a file that i hadn't touched

kvz commented 1 year ago

Perhaps we can set Prettier for filetypes that work well, but Remark for mdx since as reported Prettier adds newlines in wrong places there(?)

  "[markdown]": {
    "files.trimTrailingWhitespace": false,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[mdx]": {
    "editor.defaultFormatter": "<REMARK?>"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.formatOnSave": true,

@arturi is going to show @aduh95 where it breaks for him

Merlijn says we should install the MDX VS Code Extension