|
| 1 | +import js from '@eslint/js'; |
| 2 | +import globals from 'globals'; |
| 3 | +import pluginVue from 'eslint-plugin-vue'; |
| 4 | +import pluginCypress from 'eslint-plugin-cypress'; |
| 5 | +import pluginJest from 'eslint-plugin-jest'; |
| 6 | +import { defineConfig, globalIgnores } from 'eslint/config'; |
| 7 | + |
| 8 | +export default defineConfig([ |
| 9 | + js.configs.recommended, |
| 10 | + pluginVue.configs['flat/essential'], |
| 11 | + |
| 12 | + globalIgnores([ |
| 13 | + 'vendor/*', |
| 14 | + '_build/*', |
| 15 | + 'cypress_cache/*', |
| 16 | + 'public/assets/*', |
| 17 | + 'public/vendor/*', |
| 18 | + 'resources/js/angular/*', |
| 19 | + '**/__mocks__/**', |
| 20 | + ]), |
| 21 | + |
| 22 | + { |
| 23 | + files: ['**/*.{js,mjs,cjs,vue}'], |
| 24 | + languageOptions: { |
| 25 | + globals: { |
| 26 | + ...globals.browser, |
| 27 | + }, |
| 28 | + }, |
| 29 | + rules: { |
| 30 | + 'indent': ['error', 2], |
| 31 | + 'vue/no-v-html': 'off', |
| 32 | + 'vue/require-v-for-key': 'off', |
| 33 | + 'eqeqeq': ['error', 'always'], |
| 34 | + 'arrow-spacing': ['error'], |
| 35 | + 'block-spacing': ['error'], |
| 36 | + 'brace-style': ['error', 'stroustrup'], |
| 37 | + 'comma-dangle': ['error', 'always-multiline'], |
| 38 | + 'curly' : ['error'], |
| 39 | + 'default-param-last': ['error'], |
| 40 | + 'eol-last': ['error'], |
| 41 | + 'keyword-spacing': ['error', {'before': true, 'after': true}], |
| 42 | + 'space-before-blocks': ['error', 'always'], |
| 43 | + 'linebreak-style': ['error', 'unix'], |
| 44 | + 'no-trailing-spaces': ['error'], |
| 45 | + 'no-var': ['error'], |
| 46 | + 'prefer-arrow-callback': ['error'], |
| 47 | + 'prefer-const': ['error'], |
| 48 | + 'prefer-template': ['error'], |
| 49 | + 'quotes': ['error', 'single', {'avoidEscape': true}], |
| 50 | + 'semi': ['error', 'always'], |
| 51 | + 'semi-style': ['error', 'last'], |
| 52 | + 'template-curly-spacing': ['error', 'never'], |
| 53 | + }, |
| 54 | + }, |
| 55 | + { |
| 56 | + files: ['**/cypress/**/*.js'], |
| 57 | + ...pluginCypress.configs.globals, |
| 58 | + }, |
| 59 | + { |
| 60 | + files: ['**/*.spec.js'], |
| 61 | + plugins: { |
| 62 | + jest: pluginJest, |
| 63 | + }, |
| 64 | + languageOptions: { |
| 65 | + globals: { |
| 66 | + ...globals.node, |
| 67 | + ...pluginJest.environments.globals.globals, |
| 68 | + }, |
| 69 | + }, |
| 70 | + }, |
| 71 | + { |
| 72 | + files: [ |
| 73 | + '**/postcss.config.js', |
| 74 | + '**/babel.config.js', |
| 75 | + '**/jest.config.js', |
| 76 | + ], |
| 77 | + languageOptions: { |
| 78 | + globals: { |
| 79 | + ...globals.node, |
| 80 | + }, |
| 81 | + }, |
| 82 | + }, |
| 83 | + { |
| 84 | + files: [ |
| 85 | + '**/webpack.mix.js', |
| 86 | + '**/tailwind.config.js', |
| 87 | + '**/cypress.config.js', |
| 88 | + ], |
| 89 | + languageOptions: { |
| 90 | + sourceType: 'commonjs', |
| 91 | + globals: { |
| 92 | + ...globals.node, |
| 93 | + }, |
| 94 | + }, |
| 95 | + } |
| 96 | +]); |
0 commit comments