diff --git a/src/Console/InstallerTraits/FrontendPackages.php b/src/Console/InstallerTraits/FrontendPackages.php index 9df05c8..067c878 100644 --- a/src/Console/InstallerTraits/FrontendPackages.php +++ b/src/Console/InstallerTraits/FrontendPackages.php @@ -58,7 +58,7 @@ protected function installFrontendPackages(): void copy(__DIR__.'/../../../stubs/stack-configs/tailwind.config.cjs', base_path('tailwind.config.cjs')); copy(__DIR__.'/../../../stubs/stack-configs/jsconfig.json', base_path('jsconfig.json')); copy(__DIR__.'/../../../stubs/stack-configs/vite.config.js', base_path('vite.config.js')); - copy(__DIR__.'/../../../stubs/stack-configs/.eslintrc.cjs', base_path('.eslintrc.cjs')); + copy(__DIR__.'/../../../stubs/stack-configs/eslint.config.js', base_path('eslint.config.js')); copy(__DIR__.'/../../../stubs/stack-configs/.prettierrc.json', base_path('.prettierrc.json')); (new Filesystem)->copyDirectory(__DIR__.'/../../../stubs/stack-configs/.vscode', base_path('.vscode')); diff --git a/stubs/stack-configs/.eslintrc.cjs b/stubs/stack-configs/.eslintrc.cjs deleted file mode 100644 index 1f59928..0000000 --- a/stubs/stack-configs/.eslintrc.cjs +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - extends: [ - // add more generic rulesets here, such as: - // "eslint:recommended", - 'plugin:vue/vue3-recommended', - 'prettier' - ], - rules: { - // override/add rules settings here, such as: - // 'vue/no-unused-vars': 'error' - } -} diff --git a/stubs/stack-configs/eslint.config.js b/stubs/stack-configs/eslint.config.js new file mode 100644 index 0000000..b9a1f16 --- /dev/null +++ b/stubs/stack-configs/eslint.config.js @@ -0,0 +1,77 @@ +import js from '@eslint/js' +import vue from 'eslint-plugin-vue' +import vueParser from 'vue-eslint-parser' +import prettierConfig from 'eslint-config-prettier' + +export default [ + // Base ESLint recommended rules + js.configs.recommended, + + // Vue plugin configuration + { + files: ['**/*.vue'], + languageOptions: { + parser: vueParser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + } + }, + plugins: { + vue + }, + rules: { + // Combine base and recommended Vue rules + ...vue.configs.base.rules, + ...vue.configs['vue3-recommended'].rules, + + // Disable specific Vue rules + 'vue/no-v-html': 'off', + 'vue/comment-directive': 'off' + + // You can add other Vue-specific rules here + } + }, + + // General JavaScript rules (for .js and .vue files) + { + files: ['**/*.{js,vue}'], + rules: { + // Disable general ESLint rules + // 'no-undef': 'off' + } + }, + + // Prettier configuration to disable conflicting rules + { + rules: { + ...prettierConfig.rules + } + }, + + // Custom rules (if any) + { + languageOptions: { + globals: { + document: 'readonly', + window: 'readonly', + FileReader: 'readonly', + FormData: 'readonly', + URLSearchParams: 'readonly', + localStorage: 'readonly', + fetch: 'readonly', + alert: 'readonly', + console: 'readonly', + route: 'readonly' + } + }, + rules: { + // Add your custom rules here + } + }, + + // Ignore patterns + { + ignores: ['node_modules/*', 'vendor/*', 'public/*'] + } +]