1- import js from '@eslint/js'
2- import globals from 'globals'
3- import pluginVue from 'eslint-plugin-vue'
4- import pluginQuasar from '@quasar/app-vite/eslint'
5- import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'
1+ import globals from 'globals' ;
2+ import tseslint from 'typescript-eslint' ;
3+ import pluginVue from 'eslint-plugin-vue' ;
4+ import pluginQuasar from '@quasar/app-vite/eslint' ;
5+ import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting' ;
66
7- export default [
7+ export default tseslint . config (
88 {
99 /**
1010 * Ignore the following files.
@@ -18,27 +18,30 @@ export default [
1818 } ,
1919
2020 ...pluginQuasar . configs . recommended ( ) ,
21- js . configs . recommended ,
2221
23- /**
24- * https://eslint.vuejs.org
25- *
26- * pluginVue.configs.base
27- * -> Settings and rules to enable correct ESLint parsing.
28- * pluginVue.configs[ 'flat/essential']
29- * -> base, plus rules to prevent errors or unintended behavior.
30- * pluginVue.configs["flat/strongly-recommended"]
31- * -> Above, plus rules to considerably improve code readability and/or dev experience.
32- * pluginVue.configs["flat/recommended"]
33- * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
34- */
35- ...pluginVue . configs [ 'flat/essential' ] ,
22+ // TypeScript and Vue base configurations
23+ ...tseslint . configs . recommended ,
24+ ...pluginVue . configs [ 'flat/essential' ] ,
3625
3726 {
27+ // This block configures the parser for .vue files
28+ files : [ '**/*.vue' ] ,
29+ languageOptions : {
30+ parserOptions : {
31+ // Use the TypeScript parser for <script> blocks in .vue files
32+ parser : tseslint . parser ,
33+ project : true ,
34+ tsconfigRootDir : import . meta. dirname ,
35+ extraFileExtensions : [ '.vue' ] ,
36+ } ,
37+ } ,
38+ } ,
39+
40+ {
41+ // General language options for all files
3842 languageOptions : {
3943 ecmaVersion : 'latest' ,
4044 sourceType : 'module' ,
41-
4245 globals : {
4346 ...globals . browser ,
4447 ...globals . node , // SSR, Electron, config files
@@ -48,27 +51,26 @@ export default [
4851 Capacitor : 'readonly' ,
4952 chrome : 'readonly' , // BEX related
5053 browser : 'readonly' , // BEX related
51- gtag : 'readonly' // Google Analytics
52- }
54+ gtag : 'readonly' , // Google Analytics
55+ } ,
5356 } ,
5457
55- // add your custom rules here
58+ // Add your custom rules here
5659 rules : {
5760 'prefer-promise-reject-errors' : 'off' ,
58-
5961 // allow debugger during development only
60- 'no-debugger' : process . env . NODE_ENV === 'production' ? 'error' : 'off'
61- }
62+ 'no-debugger' : process . env . NODE_ENV === 'production' ? 'error' : 'off' ,
63+ } ,
6264 } ,
6365
6466 {
65- files : [ 'src-pwa/custom-service-worker.js' ] ,
67+ files : [ 'src-pwa/custom-service-worker.js' ] ,
6668 languageOptions : {
6769 globals : {
68- ...globals . serviceworker
69- }
70- }
70+ ...globals . serviceworker ,
71+ } ,
72+ } ,
7173 } ,
7274
7375 prettierSkipFormatting
74- ]
76+ ) ;
0 commit comments