import cypress from 'eslint-plugin-cypress'; import eslint from 'eslint-plugin-import'; // Import eslint from '@eslint/eslintrc'; import globals from 'globals'; // Import path from 'node:path'; // Import { fileURLToPath } from 'node:url'; import js from '@eslint/js'; import vue from 'eslint-plugin-vue'; // Import { FlatCompat } from ''; // Const compat = new FlatCompat({ // BaseDirectory: import.meta.url, // RecommendedConfig: js.configs.recommended, // AllConfig: js.configs.all, // Cypress: cypress.configs.recommended, // }); export default { // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy // This option interrupts the configuration hierarchy at this file // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) plugins: { vue, eslint, cypress }, languageOptions: { globals: { ...globals.node, ...globals.browser, ...vue.environments['setup-compiler-macros']['setup-compiler-macros'], ...cypress.environments.globals.globals, ga: 'readonly', cordova: 'readonly', __statics: 'readonly', __QUASAR_SSR__: 'readonly', __QUASAR_SSR_SERVER__: 'readonly', __QUASAR_SSR_CLIENT__: 'readonly', __QUASAR_SSR_PWA__: 'readonly', process: 'readonly', Capacitor: 'readonly', chrome: 'readonly', }, ecmaVersion: 2020, sourceType: 'module', parserOptions: { parser: '@babel/eslint-parser', }, }, // Files: ['test/cypress/**/*.*'], // Rules: { // Semi: 'error', // 'space-before-function-paren': 0, // 'prefer-promise-reject-errors': 0, // 'vue/no-multiple-template-root': 0, // }, rules: { ...js.configs.recommended.rules, 'generator-star-spacing': 'off', 'arrow-parens': 'off', 'one-var': 'off', 'no-void': 'off', 'multiline-ternary': 'off', 'js/first': 'off', 'vue/prefer-import-from-vue': 'error', 'eslint/first': 'off', 'eslint/dynamic-import-chunkname': 'off', 'no-restricted-imports': 'off', 'no-import-assign': 'off', 'no-duplicate-imports': 'off', 'no-useless-rename': 'off', 'no-named-as-default': 'off', 'no-named-as-default-member': 'off', 'eslint/named': 'off', 'no-unsafe-optional-chaining': 'off', 'eslint/namespace': 'error', 'eslint/default': 'error', 'eslint/export': 'error', 'eslint/extensions': 'off', 'eslint/no-unresolved': 'off', 'eslint/no-extraneous-dependencies': 'off', 'eslint/no-import-module-exports': 'off', 'eslint/no-self-import': 'off', semi: 'off', 'space-before-function-paren': 'off', 'no-undef': 'error', 'no-unused-vars': 'warn', 'no-console': 'error', 'no-debugger': 'off', 'no-useless-escape': 'error', 'no-prototype-builtins': 'error', 'no-async-promise-executor': 'error', 'no-irregular-whitespace': 'error', 'no-constant-condition': 'error', 'no-unsafe-finally': 'error', 'no-extend-native': 'error', 'vue/no-unused-components': 'error', 'vue/no-unused-properties': 'error', 'vue/no-multiple-template-root': 'error', 'vue/no-v-html': 'error', 'vue/no-v-model-argument': 'error', 'vue/no-parsing-error': 'error', 'vue/no-deprecated-slot-attribute': 'error', 'prefer-promise-reject-errors': 'error', // }, // { // }, }, // LinterOptions: { // ReportUnusedInlineConfigs: 'error', // }, ignores: [ '/dist', '/src-capacitor', '/src-cordova', '/.quasar', '/node_modules', '.eslintrc.js', ], // Rules order is important, please avoid shuffling them // Extends: [ // 'standard', // // Base ESLint recommended rules // 'eslint:recommended', // // Uncomment any of the lines below to choose desired strictness, // // but leave only one uncommented! // // See https://eslint.vuejs.org/rules/#available-rules // // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) // // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) // // https://github.com/prettier/eslint-config-prettier#installation // // usage with Prettier, provided by 'eslint-config-prettier'. // 'prettier', // ], // Plugins: [ // // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files // // required to lint *.vue files // 'vue', // // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674 // // Prettier has not been included as plugin to avoid performance impact // // add it as an extension for your IDE // ], // Globals: {}, // Add your custom rules here // Rules: { // // allow async-await // 'generator-star-spacing': 'error', // // allow paren-less arrow functions // 'arrow-parens': 'error', // 'one-var': 'error', // 'no-void': 'error', // 'multiline-ternary': 'error', // 'import/first': 'error', // 'import/named': 'error', // 'import/namespace': 'error', // 'import/default': 'error', // 'import/export': 'error', // 'import/extensions': 'error', // 'import/no-unresolved': 'error', // 'import/no-extraneous-dependencies': 'error', // Semi: 'error', // 'space-before-function-paren': 'error', // 'no-undef': 'error', // 'no-unused-vars': 'warn', // 'no-console': 'error', // 'no-debugger': 'error', // 'no-useless-escape': 'error', // 'no-prototype-builtins': 'error', // 'no-async-promise-executor': 'error', // 'no-irregular-whitespace': 'error', // 'no-constant-condition': 'error', // 'no-unsafe-finally': 'error', // 'no-extend-native': 'error', // 'vue/no-unused-components': 'error', // 'vue/no-unused-properties': 'error', // 'vue/no-multiple-template-root': 'error', // 'vue/no-v-html': 'error', // 'vue/no-v-model-argument': 'error', // 'vue/no-parsing-error': 'error', // 'vue/no-deprecated-slot-attribute': 'error', // 'prefer-promise-reject-errors': 'error', // // allow debugger during development only // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'error', // }, // Overrides: [ // { // Files: ['test/cypress/**/*.*'], // Extends: [ // // Add Cypress-specific lint rules, globals and Cypress plugin // // See https://github.com/cypress-io/eslint-plugin-cypress#rules // 'plugin:cypress/recommended', // ], // Rules: { // Semi: 'error', // 'space-before-function-paren': 'error', // 'prefer-promise-reject-errors': 'error', // 'vue/no-multiple-template-root': 'error', // }, // }, // ], };