diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c484f42 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,49 @@ +{ + // 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", + "css", + "less", + "scss", + "pcss", + "postcss" + ] +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..cdfe6be --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,7 @@ +import antfu from '@antfu/eslint-config' + +export default antfu({ + formatters: true, + typescript: true, + vue: true +}) diff --git a/package.json b/package.json index 5c0d980..5406e75 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "0.0.0", "description": "Experience The Magic Of Animated Components. Crafted With Vue, TypeScript, TailwindCss And Vueuse Motion", "private": false, - "scripts": {}, + "scripts": { + "lint": "eslint .", + "lint:fix": "eslint . --fix" + }, "repository": { "type": "git", "url": "https://github.com/selemondev/spark-ui.git" @@ -27,6 +30,9 @@ "typescript": "^5.6.2" }, "devDependencies": { - "@types/node": "^22.7.4" + "@types/node": "^22.7.4", + "@antfu/eslint-config": "^3.7.3", + "eslint": "^9.11.1", + "eslint-plugin-format": "^0.1.2" } -} +} \ No newline at end of file