https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38524

Jonathan Druart <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #176206|0                           |1
        is obsolete|                            |

--- Comment #11 from Jonathan Druart <[email protected]> ---
Created attachment 176642
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176642&action=edit
Bug 38524: Enable ESLint for .ts and .vue files

Test plan:
1. Apply only bug 38167 and it's dependency (assuming they are not in main)
2. Restart KTD or run
     sudo yarn install --modules-folder /kohadevbox/node_modules
3. Run the following and see that it doesn't lint
     eslint t/cypress/integration/AdditionalFields_spec.ts
     eslint
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportBuilder.vue
4. Apply the patches of this ticket
5. restart KTD
   (it tests that the provisionning works well to get all
   the JS libs)
6. Run the following and see that it lints
     eslint t/cypress/integration/AdditionalFields_spec.ts
     eslint ./t/cypress/integration/ERM/DataProviders_spec.ts
     eslint ./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts
     eslint
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsReportBuilder.vue
     eslint
./koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue

Various files tested here give an idea of the output, feel free to try others.
And report stuff that should obviously be silenced due to making too much
noise and having low value or being contrary to our current practices.
Non obvious stuff to fix might be put in a follow-up ticket.

---------

This was removed from config:
indent: ["error", 4],

Because this check was finding it redundant:
npx eslint-config-prettier
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue
check which is documented here:
https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#cli-helper-tool

To doubled check, I sabotaged some indentation in a .js/.ts section on these
files
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue
koha-tmpl/intranet-tmpl/prog/js/ajax.js
And without `indent: ["error", 4]` the prettier rule was still reporting the
issue.
And with `indent: ["error", 4]` the issue was reported twice.
This looks enough to confirm it's redundant to keep it.

----

For the same reason as above, the following was removed:
semi: ["error", "always"],
tested by removing a semicolon in
koha-tmpl/intranet-tmpl/prog/js/ajax.js
t/cypress/integration/Auth/csrf.ts

----

This was removed:
"linebreak-style": ["error", "unix"],

Because it's the default of prettier
https://prettier.io/docs/en/options.html#end-of-line

Signed-off-by: Martin Renvoize <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to