X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=ui%2Fweb%2F.eslintrc.js;h=d82d3c5f6ef9cc228dcb52606aedad0e61433f8b;hb=693d96db15a0606afc3bbd03f56089998fbafbed;hp=cb3df6e3af4ecd8c845b8375074d440014095b6f;hpb=a0ede750688dddb78cebdb2f459f71001484128d;p=e-mobility-charging-stations-simulator.git diff --git a/ui/web/.eslintrc.js b/ui/web/.eslintrc.js index cb3df6e3..d82d3c5f 100644 --- a/ui/web/.eslintrc.js +++ b/ui/web/.eslintrc.js @@ -1,3 +1,4 @@ +const { env } = require('node:process'); const { defineConfig } = require('eslint-define-config'); module.exports = defineConfig({ @@ -7,30 +8,39 @@ module.exports = defineConfig({ node: true, }, + plugins: ['import'], + extends: [ - 'plugin:vue/vue3-essential', 'eslint:recommended', - '@vue/eslint-config-typescript/recommended', + 'plugin:import/recommended', + 'plugin:vue/vue3-recommended', '@vue/eslint-config-prettier', + '@vue/eslint-config-typescript/recommended', ], + settings: { + 'import/resolver': { + typescript: { + project: './tsconfig.json', + }, + }, + }, + parserOptions: { ecmaVersion: 'latest', }, rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + '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', - }, - - overrides: [ - { - files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], - env: { - mocha: true, + 'sort-imports': [ + 'error', + { + ignoreDeclarationSort: true, }, - }, - ], + ], + 'import/order': 'error', + }, });