|
| 1 | +module.exports = { |
| 2 | + // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy |
| 3 | + // This option interrupts the configuration hierarchy at this file |
| 4 | + // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) |
| 5 | + root: true, |
| 6 | + parserOptions: { |
| 7 | + parser: "@babel/eslint-parser", |
| 8 | + ecmaVersion: 2018, |
| 9 | + // Allows for the parsing of modern ECMAScript features |
| 10 | + sourceType: "module", // Allows for the use of imports |
| 11 | + }, |
| 12 | + env: { |
| 13 | + browser: true, |
| 14 | + 'cypress/globals': true |
| 15 | + }, |
| 16 | + // Rules order is important, please avoid shuffling them |
| 17 | + extends: [ |
| 18 | + "plugin:vue/vue3-essential", |
| 19 | + "plugin:vue/vue3-strongly-recommended", |
| 20 | + "plugin:vue/vue3-recommended", |
| 21 | + "prettier", |
| 22 | + "plugin:storybook/recommended", |
| 23 | + "eslint:recommended", |
| 24 | + "plugin:cypress/recommended", |
| 25 | + '@vue/standard' |
| 26 | + ], |
| 27 | + plugins: [ |
| 28 | + // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file |
| 29 | + // required to lint *.vue files |
| 30 | + "vue", // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674 |
| 31 | + "cypress" |
| 32 | + // Prettier has not been included as plugin to avoid performance impact |
| 33 | + // add it as an extension for your IDE |
| 34 | + ], |
| 35 | + globals: { |
| 36 | + ga: "readonly", |
| 37 | + // Google Analytics |
| 38 | + cordova: "readonly", |
| 39 | + __statics: "readonly", |
| 40 | + __QUASAR_SSR__: "readonly", |
| 41 | + __QUASAR_SSR_SERVER__: "readonly", |
| 42 | + __QUASAR_SSR_CLIENT__: "readonly", |
| 43 | + __QUASAR_SSR_PWA__: "readonly", |
| 44 | + process: true, |
| 45 | + Capacitor: "readonly", |
| 46 | + chrome: "readonly", |
| 47 | + }, |
| 48 | + // add your custom rules here |
| 49 | + rules: { |
| 50 | + // allow async-await |
| 51 | + // 'generator-star-spacing': 'off', |
| 52 | + // allow paren-less arrow functions |
| 53 | + 'arrow-parens': 'off', |
| 54 | + 'one-var': 'off', |
| 55 | + // "vue/require-explicit-emits": 'off', |
| 56 | + "vue/custom-event-name-casing": 'off', |
| 57 | + "vue/component-tags-order": ["error", { "order": ["template", "script", "style"] }], |
| 58 | + "vue/no-multi-spaces": [ |
| 59 | + "error", |
| 60 | + { |
| 61 | + ignoreProperties: false, |
| 62 | + }, |
| 63 | + ], |
| 64 | + "indent": ["error", 2], |
| 65 | + "semi": [2, "never"], |
| 66 | + "no-else-return": 1, |
| 67 | + "consistent-return": 2, |
| 68 | + "space-before-blocks": [2, "always"], |
| 69 | + "space-infix-ops": [2, { int32Hint: false }], |
| 70 | + "arrow-spacing": [2, { before: true, after: true }], |
| 71 | + "key-spacing": [2, { beforeColon: false, afterColon: true }], |
| 72 | + "eqeqeq": [2, "smart"], |
| 73 | + "comma-dangle": [2, "never"], |
| 74 | + "no-trailing-spaces": [2, { skipBlankLines: false }], |
| 75 | + "quotes": [2, "single", { avoidEscape: true }], |
| 76 | + "keyword-spacing": [2, { before: true, after: true }], |
| 77 | + "block-spacing": [2, "always"], |
| 78 | + "brace-style": [1, "1tbs", { allowSingleLine: true }], |
| 79 | + "space-before-function-paren": ["error", "always"], |
| 80 | + |
| 81 | + // 'import/first': 'off', |
| 82 | + // 'import/named': 'error', |
| 83 | + // 'import/namespace': 'error', |
| 84 | + // 'import/default': 'error', |
| 85 | + // 'import/export': 'error', |
| 86 | + // 'import/extensions': 'off', |
| 87 | + // 'import/no-unresolved': 'off', |
| 88 | + // 'import/no-extraneous-dependencies': 'off', |
| 89 | + "prefer-promise-reject-errors": "off", |
| 90 | + // allow debugger during development only |
| 91 | + "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", |
| 92 | + }, |
| 93 | + overrides: [ |
| 94 | + { |
| 95 | + // or whatever matches stories specified in .storybook/main.js |
| 96 | + files: ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"], |
| 97 | + rules: { |
| 98 | + // example of overriding a rule |
| 99 | + "storybook/hierarchy-separator": "error", |
| 100 | + // example of disabling a rule |
| 101 | + "storybook/default-exports": "off", |
| 102 | + }, |
| 103 | + }, |
| 104 | + ], |
| 105 | +}; |
0 commit comments