45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
// @ts-check
|
|
|
|
import eslint from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import vue from 'eslint-plugin-vue';
|
|
import prettier from '@vue/eslint-config-prettier';
|
|
import globals from 'globals';
|
|
|
|
export default tseslint.config(
|
|
eslint.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...vue.configs['flat/vue3-essential'],
|
|
// This should be last to override other formatting rules
|
|
prettier,
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
// Vue compiler macros
|
|
'defineProps': 'readonly',
|
|
'defineEmits': 'readonly',
|
|
'defineExpose': 'readonly',
|
|
'withDefaults': 'readonly'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
// Limit linting to specific file types
|
|
files: ['src/**/*.vue', 'src/**/*.js', 'src/**/*.ts'],
|
|
},
|
|
{
|
|
// Ignore files from linting
|
|
ignores: [
|
|
'node_modules',
|
|
'dist',
|
|
'src/**/*.d.ts',
|
|
'*.config.js',
|
|
'*.config.cjs'
|
|
],
|
|
}
|
|
);
|