Skip to content
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

Fix inconsistencies between local and remote formatters #634

Merged
merged 4 commits into from
Jun 30, 2021

Conversation

0x2b3bfa0
Copy link
Member

Local formattter configuration

We use husky to configure pre-commit hooks so files are automatically linted and formatted with lint-staged on each commit. Unfortunately, prettier is not being used for files with the js extension due to a misconfiguration.

cml/package.json

Lines 47 to 51 in 1ed743d

"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},

cml/package.json

Lines 52 to 59 in 1ed743d

"lint-staged": {
"*.js": [
"eslint --fix"
],
"*.{md,yaml,yml}": [
"prettier --write"
]
},

Remote formattter configuration

Here we use prettier for all the extensions above plus the js and json ones. That's the issue behind #623 and company.

cml/.restyled.yaml

Lines 1 to 8 in 1ed743d

restylers:
- name: prettier
arguments: ['--write']
include:
- 'src/**/*.js'
- 'bin/**/*.js'
- 'assets/*.json'
- './**/*.{yaml,yml,md,json}'

Reorder file extension list on restyled.yml

Update .restyled.yaml
@0x2b3bfa0 0x2b3bfa0 added bug Something isn't working technical-debt Refactoring, linting & tidying testing Unit tests & debugging labels Jun 30, 2021
@0x2b3bfa0 0x2b3bfa0 self-assigned this Jun 30, 2021
@0x2b3bfa0 0x2b3bfa0 temporarily deployed to internal June 30, 2021 19:58 Inactive
@0x2b3bfa0 0x2b3bfa0 removed the bug Something isn't working label Jun 30, 2021
@casperdcl casperdcl temporarily deployed to internal June 30, 2021 21:18 Inactive
@0x2b3bfa0 0x2b3bfa0 temporarily deployed to internal June 30, 2021 22:44 Inactive
@0x2b3bfa0 0x2b3bfa0 force-pushed the fix-linter-issues branch from 623b0d0 to c815b0b Compare June 30, 2021 22:58
@0x2b3bfa0 0x2b3bfa0 temporarily deployed to internal June 30, 2021 22:58 Inactive
@0x2b3bfa0 0x2b3bfa0 linked an issue Jun 30, 2021 that may be closed by this pull request
@0x2b3bfa0 0x2b3bfa0 merged commit 71bed37 into master Jun 30, 2021
@0x2b3bfa0 0x2b3bfa0 deleted the fix-linter-issues branch June 30, 2021 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical-debt Refactoring, linting & tidying testing Unit tests & debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix/upgrade integration tests
2 participants