-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run yarn lint and prettier in CI #1674
Commits on Oct 14, 2024
-
We’ve had some trouble with different people’s editors disagreeing about formatting, so I’d like to make our formatting checks in CI to have it consistent. I expect this to fail initially, but hopefully it won’t take much work to get it passing.
Configuration menu - View commit details
-
Copy full SHA for d68c49e - Browse repository at this point
Copy the full SHA d68c49eView commit details -
Update @typescript-eslint/parser
I was getting a warning that our version of typescript is too new for our version of this package: updating removes the warning.
Configuration menu - View commit details
-
Copy full SHA for 7993d0d - Browse repository at this point
Copy the full SHA 7993d0dView commit details -
Replace tslint with typescript-eslint, updates
TSLint is deprecated, and the suggested replacement is typescript-eslint. This commit also updates eslint, prettier, and eslint-plugin-prettier, and adds eslint-config-prettier.
Configuration menu - View commit details
-
Copy full SHA for 72a455a - Browse repository at this point
Copy the full SHA 72a455aView commit details -
Run prettier directly rather than via eslint
Prettier’s docs [recommend it be run directly rather than via eslint](https://prettier.io/docs/en/integrating-with-linters.html), so this commit removes eslint-plugin-prettier and runs it directly within the lint scripts in package.json.
Configuration menu - View commit details
-
Copy full SHA for 1629bf8 - Browse repository at this point
Copy the full SHA 1629bf8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 638aa48 - Browse repository at this point
Copy the full SHA 638aa48View commit details -
Fix .prettierrc symlink in root
I’m guessing the path to fronts-client was updated, and the symlink wasn’t.
Configuration menu - View commit details
-
Copy full SHA for 74c3a12 - Browse repository at this point
Copy the full SHA 74c3a12View commit details -
Format everything with prettier
To produce this diff, I ran `yarn lint-fix`.
Configuration menu - View commit details
-
Copy full SHA for 309162a - Browse repository at this point
Copy the full SHA 309162aView commit details -
Update .editorconfig files to match prettier
The @guardian/prettier config uses tabs for indentation, so this commit changes the .editorconfig files to match. (Since the .prettierrc is linked at the root, I think I need to update both .editorconfig files.)
Configuration menu - View commit details
-
Copy full SHA for 01ed780 - Browse repository at this point
Copy the full SHA 01ed780View commit details -
Format tables nicely in readme
My editor has some auto-formatting that makes these tables much nicer to read in the markdown source: unless anyone objects I figure it’s an improvement?
Configuration menu - View commit details
-
Copy full SHA for 701df3e - Browse repository at this point
Copy the full SHA 701df3eView commit details -
- remove mentions of TSLint - recommend setting up editor integration for Prettier
Configuration menu - View commit details
-
Copy full SHA for 4bc374d - Browse repository at this point
Copy the full SHA 4bc374dView commit details -
Now that I’ve removed TSLint, this import is failing the build. To fix the build, this commit copies the definition of isError from my local node_modules. I took a look at #1277, which introduced this, and I didn’t see any explanation for this bit of code: it seems strange to import something from tslint (which is a dev dependency) for this, which makes me wonder if it was deliberate? Either way, I believe the check is necessary: I initially tried removing it, but that broke some tests.
Configuration menu - View commit details
-
Copy full SHA for cf98a63 - Browse repository at this point
Copy the full SHA cf98a63View commit details -
Now that we’re not using TSLint, these comments aren’t doing anything. I’ll reintroduce the equivalents for eslint if they’re required.
Configuration menu - View commit details
-
Copy full SHA for 5e05d71 - Browse repository at this point
Copy the full SHA 5e05d71View commit details -
Add formatting commit to .git-blame-ignore-revs
In a recent commit I ran prettier to format the code, which produced a very big diff. This diff can get in the way of blaming with git, so Iʼve recorded the commit ref in .git-blame-ignore-revs, which facilitates telling git (using the config option blame.ignoreRevsFile) to ignore the commit when blaming. (Iʼll add this config to the setup script shortly.)
Configuration menu - View commit details
-
Copy full SHA for f1aa439 - Browse repository at this point
Copy the full SHA f1aa439View commit details -
Configure git to use .git-blame-ignore-revs
This change configures git to ignore the commits listed in .git-blame-ignore-revs when blaming, which prevents formatting commits from obscuring more meaningful blame info.
Configuration menu - View commit details
-
Copy full SHA for 8f4af68 - Browse repository at this point
Copy the full SHA 8f4af68View commit details -
Apply eslint suggestion: single quotes
While I see it, this was being flagged by eslint as a non-breaking warning: might as well follow the suggestion to silence the warning.
Configuration menu - View commit details
-
Copy full SHA for 1bd8e9b - Browse repository at this point
Copy the full SHA 1bd8e9bView commit details