diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e3dd158 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,50 @@ +{ + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off", "fixable": true }, + { "rule": "format/*", "severity": "off", "fixable": true }, + { "rule": "*-indent", "severity": "off", "fixable": true }, + { "rule": "*-spacing", "severity": "off", "fixable": true }, + { "rule": "*-spaces", "severity": "off", "fixable": true }, + { "rule": "*-order", "severity": "off", "fixable": true }, + { "rule": "*-dangle", "severity": "off", "fixable": true }, + { "rule": "*-newline", "severity": "off", "fixable": true }, + { "rule": "*quotes", "severity": "off", "fixable": true }, + { "rule": "*semi", "severity": "off", "fixable": true } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro", + "svelte", + "css", + "less", + "scss", + "pcss", + "postcss" + ] +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..5837c8b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +const antfu = require('@antfu/eslint-config').default; + +module.exports = antfu({ + ignores: ['dist/**/*', '.output/**/*', '.nuxt/**/*', '*.css', '*.md'], + stylistic: { + semi: true, + comma: 'all', + }, + rules: { + 'antfu/if-newline': 'off', + 'new-cap': 'off', + 'vue/static-class-names-order': 'off', + 'vue/multi-word-component-names': 'off', + 'vue/require-component-is': 'off', + 'vue/no-multiple-template-root': 'off', + 'vue/no-v-text-v-html-on-component': 'off', + 'unused-imports/no-unused-vars': 'off', + 'style/semi': ['error', 'never'], + }, +})