Skip to content

Commit

Permalink
Updates eslint config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cintra committed Oct 22, 2024
1 parent 15204c1 commit 04fb948
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Console/InstallerTraits/FrontendPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
12 changes: 0 additions & 12 deletions stubs/stack-configs/.eslintrc.cjs

This file was deleted.

77 changes: 77 additions & 0 deletions stubs/stack-configs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -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/*']
}
]

0 comments on commit 04fb948

Please sign in to comment.