Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Add TailwindCSS plugin for Prettier & ESLint #611

Merged
merged 4 commits into from
Aug 15, 2023
Merged

Conversation

MindTooth
Copy link
Collaborator

@MindTooth MindTooth commented Aug 12, 2023

prettier/prettier#15025

Prettier 3.0 introduced a new plugin system. This does not currently work with pre-commit. Hence, I removed the hook entirely.

@MindTooth MindTooth requested a review from tomrtk August 12, 2023 11:30
@MindTooth MindTooth self-assigned this Aug 12, 2023
@MindTooth MindTooth changed the title Add TailwindCSS plugin for Prettier Add TailwindCSS plugin for Prettier & ESLint Aug 12, 2023
@MindTooth
Copy link
Collaborator Author

I also added ESLint. 🤦🏻‍♂️

With the jQuery rules set, I get the following errors:


/Users/birgerjn/Developer/fish-code/src/ui/src/js/jstree.js
   7:10  error  Identifier 'attach_jstree' is not in camel case                        camelcase
  12:11  error  'calculatedUrl' is not defined                                         no-undef
  20:18  error  'calculatedUrl' is not defined                                         no-undef
  27:15  error  'tree' is not defined                                                  no-undef
  29:31  error  Expected '===' and instead saw '=='                                    eqeqeq
  30:17  error  'tree' is not defined                                                  no-undef
  31:17  error  'tree' is not defined                                                  no-undef
  66:11  error  Identifier 'selected_videos' is not in camel case                      camelcase
  69:11  error  Identifier 'selected_videos' is not in camel case                      camelcase
  72:7   error  Identifier 'selected_videos' is not in camel case                      camelcase
  72:7   error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  78:10  error  Identifier 'attach_jstree' is not in camel case                        camelcase

/Users/birgerjn/Developer/fish-code/src/ui/src/js/projects.js
   21:28  error  Read-only global 'jQuery' should not be modified                              no-global-assign
   23:10  error  Identifier 'attach_jstree' is not in camel case                               camelcase
   38:36  error  Identifier 'object_id' is not in camel case                                   camelcase
   45:36  error  Identifier 'object_id' is not in camel case                                   camelcase
   57:39  error  Identifier 'object_id' is not in camel case                                   camelcase
   60:19  error  Identifier 'object_id' is not in camel case                                   camelcase
   62:31  error  Identifier 'object_id' is not in camel case                                   camelcase
   83:3   error  'tree' is not defined                                                         no-undef
   88:3   error  'btn' is not defined                                                          no-undef
   90:7   error  'btn' is not defined                                                          no-undef
   90:38  error  'btn' is not defined                                                          no-undef
   91:5   error  'btn' is not defined                                                          no-undef
   98:11  error  'btn' is not defined                                                          no-undef
   99:11  error  'btn' is not defined                                                          no-undef
  100:11  error  'btn' is not defined                                                          no-undef
  102:31  error  'textStatus' is defined but never used. Allowed unused args must match /^_/u  no-unused-vars
  118:7   error  Identifier 'table_template' is not in camel case                              camelcase
  130:27  error  'data' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  130:33  error  'type' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  130:39  error  'row' is defined but never used. Allowed unused args must match /^_/u         no-unused-vars
  140:33  error  'type' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  140:39  error  'row' is defined but never used. Allowed unused args must match /^_/u         no-unused-vars
  152:27  error  'data' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  152:33  error  'type' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  152:44  error  'meta' is defined but never used. Allowed unused args must match /^_/u        no-unused-vars
  170:34  error  'index' is defined but never used. Allowed unused args must match /^_/u       no-unused-vars
  170:41  error  'tableLoop' is defined but never used. Allowed unused args must match /^_/u   no-unused-vars
  170:52  error  'rowLoop' is defined but never used. Allowed unused args must match /^_/u     no-unused-vars

✖ 40 problems (40 errors, 0 warnings)

I look into fixing this.

Copy link
Owner

@tomrtk tomrtk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add bulk style change commits to a .git-blame-ignore-revs file?

@MindTooth
Copy link
Collaborator Author

Should we add bulk style change commits to a .git-blame-ignore-revs file?

How does that combine with us using squash? A good idea for sure. Never been using it.

@MindTooth MindTooth merged commit def2bae into master Aug 15, 2023
9 checks passed
@MindTooth MindTooth deleted the chore/tweak_prettier branch August 15, 2023 17:13
@tomrtk
Copy link
Owner

tomrtk commented Aug 15, 2023

Should we add bulk style change commits to a .git-blame-ignore-revs file?

How does that combine with us using squash? A good idea for sure. Never been using it.

In cases like this, I think the cleanup should be done locally, one commit changing formatter and one commit applying the changes from the formatter, then rebase merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants