|
| 1 | +const path = require('path'); |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + root: true, |
| 5 | + parser: 'vue-eslint-parser', |
| 6 | + parserOptions: { |
| 7 | + // Parser that checks the content of the <script> tag |
| 8 | + parser: '@typescript-eslint/parser', |
| 9 | + sourceType: 'module', |
| 10 | + ecmaVersion: 2020, |
| 11 | + ecmaFeatures: { |
| 12 | + jsx: true, |
| 13 | + }, |
| 14 | + }, |
| 15 | + env: { |
| 16 | + 'browser': true, |
| 17 | + 'node': true, |
| 18 | + 'vue/setup-compiler-macros': true, |
| 19 | + }, |
| 20 | + plugins: ['@typescript-eslint'], |
| 21 | + extends: [ |
| 22 | + // Airbnb JavaScript Style Guide https://github.com/airbnb/javascript |
| 23 | + 'airbnb-base', |
| 24 | + 'plugin:@typescript-eslint/recommended', |
| 25 | + 'plugin:import/recommended', |
| 26 | + 'plugin:import/typescript', |
| 27 | + 'plugin:vue/vue3-recommended', |
| 28 | + 'plugin:prettier/recommended', |
| 29 | + ], |
| 30 | + settings: { |
| 31 | + 'import/resolver': { |
| 32 | + typescript: { |
| 33 | + project: path.resolve(__dirname, './tsconfig.json'), |
| 34 | + }, |
| 35 | + }, |
| 36 | + }, |
| 37 | + globals: { |
| 38 | + browser: true, |
| 39 | + node: true, |
| 40 | + Blob: true, |
| 41 | + document: 'readonly', |
| 42 | + window: 'readonly', |
| 43 | + }, |
| 44 | + rules: { |
| 45 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 46 | + 'no-unused-expressions': 'off', |
| 47 | + 'import/prefer-default-export': 'off', |
| 48 | + 'global-require': 0, |
| 49 | + 'prefer-const': 'off', |
| 50 | + 'prettier/prettier': 'off', |
| 51 | + // Vue: Recommended rules to be closed or modify |
| 52 | + 'vue/require-default-prop': 0, |
| 53 | + 'vue/singleline-html-element-content-newline': 0, |
| 54 | + 'vue/max-attributes-per-line': 0, |
| 55 | + // Vue: Add extra rules |
| 56 | + 'vue/custom-event-name-casing': [2, 'camelCase'], |
| 57 | + 'vue/no-v-text': 1, |
| 58 | + 'vue/padding-line-between-blocks': 1, |
| 59 | + 'vue/require-direct-export': 1, |
| 60 | + 'vue/multi-word-component-names': 0, |
| 61 | + // Allow @ts-ignore comment |
| 62 | + '@typescript-eslint/ban-ts-comment': 0, |
| 63 | + '@typescript-eslint/no-unused-vars': 0, |
| 64 | + '@typescript-eslint/no-empty-function': 1, |
| 65 | + '@typescript-eslint/no-explicit-any': 0, |
| 66 | + 'no-use-before-define': 'off', |
| 67 | + '@typescript-eslint/no-use-before-define': 'off', |
| 68 | + 'import/extensions': [ |
| 69 | + 2, |
| 70 | + 'ignorePackages', |
| 71 | + { |
| 72 | + js: 'never', |
| 73 | + jsx: 'never', |
| 74 | + ts: 'never', |
| 75 | + tsx: 'never', |
| 76 | + }, |
| 77 | + ], |
| 78 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, |
| 79 | + 'no-param-reassign': 0, |
| 80 | + 'prefer-regex-literals': 0, |
| 81 | + 'import/no-extraneous-dependencies': 0, |
| 82 | + }, |
| 83 | +}; |
0 commit comments