Bugzilla – Attachment 174429 Details for
Bug 38167
ESLint: migrate config to flat format + cleanup some node dependencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38167: Migrate ESLint config to new flat format
Bug-38167-Migrate-ESLint-config-to-new-flat-format.patch (text/plain), 2.83 KB, created by
Paul Derscheid
on 2024-11-12 17:20:48 UTC
(
hide
)
Description:
Bug 38167: Migrate ESLint config to new flat format
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-11-12 17:20:48 UTC
Size:
2.83 KB
patch
obsolete
>From 876d57692479a580adedf66d742c51d4a17464ad Mon Sep 17 00:00:00 2001 >From: Victor Grousset/tuxayo <victor@tuxayo.net> >Date: Mon, 14 Oct 2024 19:17:04 +0200 >Subject: [PATCH] Bug 38167: Migrate ESLint config to new flat format > >Test: >1. Do not apply >2. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js >3. It should fail >4. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js >5. It should work >6. Apply patches >7. Restart KTD to have a clean state of dependencies and check that > provisionning still works. >8. ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js >9. It should fail >10. eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js >11. It should work >12 Double check rspack still works: rspack build > Because we removed babel. > >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > .eslintrc.json | 30 ------------------------------ > eslint.config.mjs | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 34 insertions(+), 30 deletions(-) > delete mode 100644 .eslintrc.json > create mode 100644 eslint.config.mjs > >diff --git a/.eslintrc.json b/.eslintrc.json >deleted file mode 100644 >index e7f78af690..0000000000 >--- a/.eslintrc.json >+++ /dev/null >@@ -1,30 +0,0 @@ >-{ >- "env": { >- "browser": true, >- "jquery": true >- }, >- "extends": [ >- "eslint:recommended", >- "eslint-config-prettier" >- ], >- "plugins": [ >- "eslint-plugin-prettier" >- ], >- "rules": { >- "indent": [ >- "error", >- 4 >- ], >- "linebreak-style": [ >- "error", >- "unix" >- ], >- "semi": [ >- "error", >- "always" >- ], >- "prettier/prettier": [ >- "error" >- ] >- } >-} >diff --git a/eslint.config.mjs b/eslint.config.mjs >new file mode 100644 >index 0000000000..6de0fdf936 >--- /dev/null >+++ b/eslint.config.mjs >@@ -0,0 +1,34 @@ >+import prettier from "eslint-plugin-prettier"; >+import globals from "globals"; >+import path from "node:path"; >+import { fileURLToPath } from "node:url"; >+import js from "@eslint/js"; >+import { FlatCompat } from "@eslint/eslintrc"; >+ >+const __filename = fileURLToPath(import.meta.url); >+const __dirname = path.dirname(__filename); >+const compat = new FlatCompat({ >+ baseDirectory: __dirname, >+ recommendedConfig: js.configs.recommended, >+ allConfig: js.configs.all >+}); >+ >+export default [...compat.extends("eslint:recommended", "eslint-config-prettier"), { >+ plugins: { >+ prettier, >+ }, >+ >+ languageOptions: { >+ globals: { >+ ...globals.browser, >+ ...globals.jquery, >+ }, >+ }, >+ >+ rules: { >+ indent: ["error", 4], >+ "linebreak-style": ["error", "unix"], >+ semi: ["error", "always"], >+ "prettier/prettier": ["error"], >+ }, >+}]; >\ No newline at end of file >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38167
:
172754
|
172755
|
173070
|
173071
|
174429
|
174430
|
174431
|
174432
|
174855
|
174856
|
174857
|
174858
|
174859
|
175427
|
175428
|
175429
|
175430
|
175431
|
175897
|
175898
|
176195
|
176196
|
176693