From: Jérôme Benoit Date: Thu, 7 Mar 2024 18:37:34 +0000 (+0100) Subject: refactor(ui): cleanup eslint configuration X-Git-Tag: v1.3.0~29 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=84ec8d3464903cfa8259ff622bff2b19b5c47132;p=e-mobility-charging-stations-simulator.git refactor(ui): cleanup eslint configuration Signed-off-by: Jérôme Benoit --- diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d8bee504..26aed9cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -266,6 +266,9 @@ importers: eslint-plugin-import: specifier: ^2.29.1 version: 2.29.1(@typescript-eslint/parser@7.1.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-simple-import-sort: + specifier: ^12.0.0 + version: 12.0.0(eslint@8.57.0) eslint-plugin-vue: specifier: ^9.22.0 version: 9.22.0(eslint@8.57.0) @@ -5366,6 +5369,14 @@ packages: eslint: 8.57.0 dev: true + /eslint-plugin-simple-import-sort@12.0.0(eslint@8.57.0): + resolution: {integrity: sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==} + peerDependencies: + eslint: '>=5.0.0' + dependencies: + eslint: 8.57.0 + dev: true + /eslint-plugin-tsdoc@0.2.17: resolution: {integrity: sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==} dependencies: diff --git a/ui/web/.eslintrc.cjs b/ui/web/.eslintrc.cjs index 128bff5f..55c077bd 100644 --- a/ui/web/.eslintrc.cjs +++ b/ui/web/.eslintrc.cjs @@ -9,11 +9,12 @@ module.exports = defineConfig({ node: true }, - plugins: ['import'], + plugins: ['simple-import-sort', 'import'], extends: [ 'eslint:recommended', 'plugin:import/recommended', + 'plugin:import/typescript', 'plugin:vue/vue3-recommended', '@vue/eslint-config-typescript/recommended', '@vue/eslint-config-prettier' @@ -28,20 +29,15 @@ module.exports = defineConfig({ }, parserOptions: { + sourceType: 'module', ecmaVersion: 'latest' }, rules: { 'no-console': env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': env.NODE_ENV === 'production' ? 'warn' : 'off', - 'vue/require-v-for-key': 'off', - 'vue/multi-word-component-names': 'off', - 'sort-imports': [ - 'error', - { - ignoreDeclarationSort: true - } - ], - 'import/order': 'error' + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + 'vue/multi-word-component-names': 'off' } }) diff --git a/ui/web/package.json b/ui/web/package.json index ce4a83a8..c5bd79c5 100644 --- a/ui/web/package.json +++ b/ui/web/package.json @@ -52,6 +52,7 @@ "eslint-define-config": "^2.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-simple-import-sort": "^12.0.0", "eslint-plugin-vue": "^9.22.0", "jsdom": "^24.0.0", "prettier": "^3.2.5", diff --git a/ui/web/src/components/actions/AddChargingStations.vue b/ui/web/src/components/actions/AddChargingStations.vue index 6e3c2932..a95cba2b 100644 --- a/ui/web/src/components/actions/AddChargingStations.vue +++ b/ui/web/src/components/actions/AddChargingStations.vue @@ -6,6 +6,7 @@ @@ -95,6 +96,7 @@