From b362e614e49340237d5dc7a3e7fcd870dae1a849 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 15 Aug 2022 09:12:36 +0100 Subject: [PATCH] DEV: Update eslint-config-discourse to introduce `sort-class-members` This enforces some ordering rules for properties/methods in native JS classes. Having enforced structure across our codebase will help developers to quickly get their bearings when reading different classes. The eslint-config-discourse update introduces an enforced ordering of: ```javascript "order": [ "[static-properties]", "[static-methods]", "[injected-services]", "[injected-controllers]", "[tracked-properties]", "[properties]", "[private-properties]", "constructor", "[everything-else]" ] ``` We may wish to introduce more strict ordering of getters/setters/methods in future. --- package.json | 2 +- yarn.lock | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f64b92dfa56..45794c4bbe2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "chart.js": "3.5.1", "chartjs-plugin-datalabels": "^2.0.0", "diffhtml": "^1.0.0-beta.20", - "eslint-config-discourse": "^3.2.0", + "eslint-config-discourse": "^3.3.0", "magnific-popup": "1.1.0", "markdown-it": "13.0.1", "moment": "2.29.2", diff --git a/yarn.lock b/yarn.lock index 59e29e35aae..7f61d29cc6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -999,10 +999,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-discourse@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-3.2.0.tgz#e48dfe9881845400d7acb7f4b8b867da8698254a" - integrity sha512-ckfLjFMfzzxN3VX7nB0DKPAOycVM7mbkAsytaU7rGJnlsMh1SQPBUUfIronQvAR9+f3Q6FQ3VA4T9DZYfWgyIw== +eslint-config-discourse@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-3.3.0.tgz#e521620b5dfbd53bbd8bf0413319b3c41cc52944" + integrity sha512-s+N5j8DNxAsr+9czYDA7CvVVi3vsMrPgokbHwDnlLug8RJ35f47B09cHNNiREwx1ITj2epPhMbzH52wc78UPMg== dependencies: "@babel/core" "^7.18.5" "@babel/eslint-parser" "^7.18.2" @@ -1014,6 +1014,7 @@ eslint-config-discourse@^3.2.0: eslint-plugin-ember "^10.6.1" eslint-plugin-lodash "^7.1.0" eslint-plugin-node "^11.1.0" + eslint-plugin-sort-class-members "^1.14.1" prettier "2.7.1" eslint-plugin-discourse-ember@latest: @@ -1062,6 +1063,11 @@ eslint-plugin-node@^11.1.0: resolve "^1.10.1" semver "^6.1.0" +eslint-plugin-sort-class-members@^1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-sort-class-members/-/eslint-plugin-sort-class-members-1.14.1.tgz#e701d6341e267ed0d0bf44c8293ff1e15b324e3c" + integrity sha512-/Q/cm3h4N9DBNYvJMQMhluucSmr3Yydr9U0BgGcXUQe/rgWdXKSymZ5Ewcf4vmAG0bbTmAYmekuMnYYrqlu9Rg== + eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"