Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

ESLint and Prettier introduced #19

Merged
merged 3 commits into from Dec 5, 2019
Merged

ESLint and Prettier introduced #19

merged 3 commits into from Dec 5, 2019

Conversation

psmyrek
Copy link
Contributor

@psmyrek psmyrek commented Dec 4, 2019

Closes #17.

ESLint and Prettier have been added to vsf-capybara. ESLint is configured to use eslint, vue and prettier recommended rules. Prettier is configured with own defaults (out of the box) but empty .prettierrc has been included in this repo to provide place for custom rules, if needed in the future.

I fixed all errors and warnings in capybara aka default theme basing on current ESLint and Prettier configuration:

  • most of them have been automatically fixed by calling eslint --ext .js,.vue ./ --fix:
    • attributes order and placement
    • component properties order
    • single quotes replaced by double quotes
    • code formatting
  • 100+ of them have to be investigated and fixed manually:
    • unused variables have been removed
    • all v-html have been replaced with v-text
    • all v-for used together with v-if have been replaced with equivalent computed properties
    • one issue has been temporarily "fixed" in pages/Category.vue by disabling require-atomic-updates rule due to pending fix in ESLint require-atomic-updates false positive聽eslint/eslint#11899
    • fixed dependencies in package.json for current capybara theme to match its real dependencies used in source code - it should be updated as soon as storefront-ui components are integrated and legacy code becomes unused

The lint script has been added to package.json and dev script now points to main repo (your vue-storefront) since there is no sense to just build theme without main vue-storefront project.

Now vsf-capybara is error and warning free and it just waits for actual start of development 馃槑

I have a lot of problems and conflicts with integration ESLint 6.x and it seems that it is quite common: microsoft/vscode-eslint#696 (it is in vscode repo but it looks like this is quite "global" issue). Finally, I had to downgrade to the latest 5.x version which works perfectly.

@psmyrek psmyrek self-assigned this Dec 4, 2019
@psmyrek psmyrek requested a review from qiqqq December 4, 2019 09:42
@psmyrek
Copy link
Contributor Author

psmyrek commented Dec 4, 2019

ESLint works:
eslint-is-working

Prettier works:
prettier-is-working

@rmakara
Copy link
Collaborator

rmakara commented Dec 4, 2019

Respect for description and screenshots :)

@qiqqq qiqqq merged commit 7db8c6f into vuestorefront:master Dec 5, 2019
mohammad-k8 pushed a commit to hotwax/vsf-capybara that referenced this pull request Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I want to have ESLint and Prettier configured So I can make sure the code is formatted properly
3 participants