| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import js from "@eslint/js";
- import globals from "globals";
- import pluginVue from "eslint-plugin-vue";
- import pluginQuasar from "@quasar/app-vite/eslint";
- import vueI18n from "@intlify/eslint-plugin-vue-i18n";
- // the following is optional, if you want prettier too:
- import prettierSkipFormatting from "@vue/eslint-config-prettier/skip-formatting";
- export default [
- {
- /**
- * Ignore the following files.
- * Please note that pluginQuasar.configs.recommended() already ignores
- * the "node_modules" folder for you (and all other Quasar project
- * relevant folders and files).
- *
- * ESLint requires "ignores" key to be the only one in this object
- */
- ignores: [
- "/dist",
- "/src-capacitor",
- "/src-cordova",
- "/.quasar",
- "/node_modules",
- "/quasar.config.*.temporary.compiled*",
- ],
- },
- ...pluginQuasar.configs.recommended(),
- js.configs.recommended,
- /**
- * https://eslint.vuejs.org
- *
- * pluginVue.configs.base
- * -> Settings and rules to enable correct ESLint parsing.
- * pluginVue.configs[ 'flat/essential']
- * -> base, plus rules to prevent errors or unintended behavior.
- * pluginVue.configs["flat/strongly-recommended"]
- * -> Above, plus rules to considerably improve code readability and/or dev experience.
- * pluginVue.configs["flat/recommended"]
- * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
- */
- ...pluginVue.configs["flat/essential"],
- ...pluginVue.configs["flat/strongly-recommended"],
- ...pluginVue.configs["flat/recommended"],
- ...vueI18n.configs.recommended,
- {
- languageOptions: {
- ecmaVersion: "latest",
- sourceType: "module",
- globals: {
- ...globals.browser,
- ...globals.node, // SSR, Electron, config files
- process: "readonly", // process.env.*
- ga: "readonly", // Google Analytics
- cordova: "readonly",
- Capacitor: "readonly",
- chrome: "readonly", // BEX related
- browser: "readonly", // BEX related
- },
- },
- // add your custom rules here
- rules: {
- "vue/no-unused-vars": "warn",
- "vue/no-unused-components": "warn",
- "@intlify/vue-i18n/no-dynamic-keys": "off",
- "@intlify/vue-i18n/no-unused-keys": [
- "error",
- {
- extensions: [".js", ".vue"],
- },
- ],
- // allow debugger during development only
- "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
- },
- },
- {
- settings: {
- "vue-i18n": {
- localeDir: "./src/i18n/locales/*.{json,json5,yaml,yml}",
- messageSyntaxVersion: "^11.0.0",
- },
- },
- },
- {
- files: ["src-pwa/custom-service-worker.js"],
- languageOptions: {
- globals: {
- ...globals.serviceworker,
- },
- },
- },
- prettierSkipFormatting, // optional, if you want prettier
- ];
|