Update ab-testing linting and prettier settings#15742
Conversation
c3765da to
e95f362
Compare
|
Moving the I have a question regarding Prettier. Previously in Another question, we've removed the lint-staged step for all sub-directories in |
Prettier is only installed at the root level of the repo and is run from there. The prettier commands Prettier is run as part of the DCR CICD workflow at the moment which is run from the root level and not the sub-directory I think the repo might need some further adjustments in the future to ensure we check each part at the right level
It might be that we want to add ab-testing specific items to the husky hooks |
|
OK I think I understand! So Following this PR |
…installed and configured at ab-testing root and prettier installed at the repo root additionally remove lint-staged command from ab-testing package.json files, using root lint-staged command instead
…o separate general linting and testing from individual package actions
e95f362 to
235b1f0
Compare
What does this change?
Adds overall
@guardian/ab-testingpackage to cover linting for the various sub packages of theab-testingdirectoryeslint.config.mjsandtsconfig.jsonto theab-testingroot@guardian/eslintandeslintdependencies from ab-testing sub directories@guardian/prettierandprettierdependencies from ab-testing sub directoriesUpdates the
ab-testing-ciGithub workflow to run general linting and testing checks ahead of the jobs for each sub packageRemoves
.npmrclines which hoisteslintfrom within thedotcom-renderingsub directory up to the root level to allowab-testingto use itab-testingpackage.json and configured at this level so no need to continue hoistingTidies up
package.jsonfiles withinab-testingso that we only install what we need (removescdkand similar packages from noncdkdirectory and removessource-map-registeras this looks like a mistake)Why?
A temporary fix was added to the
.npmrcfile to hoist theeslintpackage from the innerdotcom-renderingdirectory to allow theab-testingdirectory to use it (#15723)Prettier is managed from the repository root but eslint is not. So we need to explicitly install and configure eslint within the
ab-testingdirectory and were previously relying on it being magically available at this level.This PR allows us to remove the temporary addition to the
.npmrcfile and better control the linting and formatting behaviour of packages within theab-testingdirectory as a whole