diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 3ced6a6d..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = { - env: { - browser: true, - jest: true - }, - parserOptions: { - ecmaVersion: 'latest' - }, - extends: [ - 'eslint-config-airbnb-base', - 'plugin:vue/vue3-recommended', - 'plugin:jsdoc/recommended' - ], - rules: { - 'linebreak-style': 'off', - 'vue/component-definition-name-casing': ['warn', 'kebab-case'], - 'vue/require-default-prop': 'off', - 'vue/attribute-hyphenation': ['warn', 'never'], - 'vue/v-on-event-hyphenation': ['warn', 'never'], - 'object-curly-newline': ['error', { consistent: true }], - 'function-paren-newline': ['error', 'multiline'], - 'operator-linebreak': ['error', 'before', { overrides: { '=': 'after' } }], - 'implicit-arrow-linebreak': ['off'], - 'comma-dangle': ['error', 'never'], - indent: ['error', 4, { SwitchCase: 1 }], - 'max-len': ['error', { code: 160 }], - 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], - 'vue/html-indent': 'off', - 'vue/html-closing-bracket-newline': ['error', { - singleline: 'never', - multiline: 'never' - }], - 'jsdoc/check-tag-names': ['error', { - definedTags: ['store', 'endpoint', 'category', 'subcategory', 'remarks'] - }], - 'jsdoc/require-jsdoc': 0, - 'vue/html-self-closing': ['error', { - html: { - void: 'any', - normal: 'any', - component: 'any' - }, - svg: 'always', - math: 'always' - }], - 'import/extensions': ['error', 'always', { js: 'ignorePackages' }], - 'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['item'] }], - 'no-restricted-syntax': ['off', 'ForOfStatement'], - 'no-return-await': 'off' - }, - settings: { - 'import/resolver': { - alias: { - map: [['@', './src/']], - extensions: ['.js', '.vue'] - } - } - } -}; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..de884494 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,143 @@ +import { globalIgnores } from 'eslint/config'; +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'; +import pluginVue from 'eslint-plugin-vue'; +//import pluginVitest from '@vitest/eslint-plugin'; +import js from '@eslint/js'; +import globals from 'globals'; +import stylistic from '@stylistic/eslint-plugin'; +import jsdoc from 'eslint-plugin-jsdoc'; + +export default defineConfigWithVueTs( + { + name: 'app/files-to-lint', + files: ['**/*.{vue,ts,js,mts,tsx}'], + }, + + js.configs.recommended, + jsdoc.configs['flat/recommended-mixed'], + + // Add @stylistic configuration + stylistic.configs.customize({ + indent: 4, + quotes: 'single', + semi: true, + // Add any other stylistic preferences here + }), + + ...pluginVue.configs['flat/essential'], + vueTsConfigs.recommended, + { + name: 'app/global-rules', + files: ['**/*.{js,ts,vue}'], + rules: { + 'eqeqeq': ['error', 'smart'], + 'no-nested-ternary': 'error', + 'no-param-reassign': 'error', + 'jsdoc/require-jsdoc': 'off', + '@stylistic/comma-dangle': 'off', + '@stylistic/max-len': ['error', { + code: 160, + tabWidth: 4, + ignoreUrls: true, + ignoreStrings: true, + ignoreTemplateLiterals: true + }], + + 'vue/max-len': ['error', { + code: 160, + template: 160, + tabWidth: 4, + ignoreUrls: true, + ignoreStrings: true, + ignoreTemplateLiterals: true, + ignoreHTMLTextContents: false + }], + } + }, + + { + name: 'app/custom-vue-rules', + files: ['**/*.vue'], + rules: { + 'vue/block-lang': ['error', { + script: { + lang: ['js', 'ts'], + allowNoLang: true // Still allow