Skip to content

Commit

Permalink
Add ESLint and the ESLint import plugin
Browse files Browse the repository at this point in the history
Add the ESLint import plugin to automatically sort Vue.js imports in
the Dashboard code.

After installing ESLint I ran `npx eslint --fix .` to auto-format files
where possible.
  • Loading branch information
djjuhasz committed Feb 11, 2025
1 parent 5a55da7 commit 299fc84
Show file tree
Hide file tree
Showing 50 changed files with 5,422 additions and 734 deletions.
42 changes: 42 additions & 0 deletions dashboard/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import pluginImport from "eslint-plugin-import";

/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts,vue}"] },
{
settings: {
"import/resolver": {
typescript: { project: "tsconfig*.json" },
},
},
},
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
pluginImport.flatConfigs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/essential"],
{
files: ["**/*.{ts,vue}"],
languageOptions: { parserOptions: { parser: tseslint.parser } },
rules: {
"import/no-unresolved": [
"error",
{
ignore: ["~icons"], // ignore unplugin-icon auto import paths.
},
],
"vue/multi-word-component-names": "off", // doesn't work with auto-router paths.
"import/order": [
"error",
{
alphabetize: { order: "asc" },
"newlines-between": "always",
},
],
},
},
];
Loading

0 comments on commit 299fc84

Please sign in to comment.