|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + node: true |
| 6 | + }, |
| 7 | + extends: [ |
| 8 | + '@nuxtjs/eslint-config-typescript', |
| 9 | + 'prettier', |
| 10 | + 'prettier/vue', |
| 11 | + 'plugin:prettier/recommended', |
| 12 | + 'plugin:nuxt/recommended' |
| 13 | + ], |
| 14 | + plugins: ['prettier'], |
| 15 | + // add your custom rules here |
| 16 | + rules: { |
| 17 | + 'prettier/prettier': 'error', |
| 18 | + semi: 0, |
| 19 | + 'space-before-function-paren': ['error', 'never'], |
| 20 | + 'no-unused-vars': 'off', // disable default |
| 21 | + '@typescript-eslint/no-unused-vars': [ |
| 22 | + 'error', |
| 23 | + { |
| 24 | + vars: 'all', |
| 25 | + args: 'after-used', |
| 26 | + ignoreRestSiblings: false |
| 27 | + } |
| 28 | + ], |
| 29 | + '@typescript-eslint/member-delimiter-style': 0, |
| 30 | + '@typescript-eslint/ban-ts-ignore': 'error', |
| 31 | + '@typescript-eslint/explicit-function-return-type': 'off', // disable default |
| 32 | + '@typescript-eslint/no-explicit-any': 'error', |
| 33 | + camelcase: 'off', |
| 34 | + '@typescript-eslint/camelcase': ['warn'] |
| 35 | + }, |
| 36 | + overrides: [ |
| 37 | + { |
| 38 | + // enable the rule specifically for TypeScript files |
| 39 | + files: ['*.ts', '*.tsx', '*.vue'], |
| 40 | + rules: { |
| 41 | + '@typescript-eslint/explicit-function-return-type': ['error'] |
| 42 | + } |
| 43 | + }, |
| 44 | + { |
| 45 | + // allow explicit any in these files and missing return type |
| 46 | + files: [ |
| 47 | + 'state.ts', |
| 48 | + 'getters.ts', |
| 49 | + 'repository.ts', |
| 50 | + '*.repository.ts', |
| 51 | + 'test/**/*' |
| 52 | + ], |
| 53 | + rules: { |
| 54 | + '@typescript-eslint/no-explicit-any': 'off', |
| 55 | + '@typescript-eslint/explicit-function-return-type': ['off'] |
| 56 | + } |
| 57 | + } |
| 58 | + ] |
| 59 | +} |
0 commit comments