Skip to content

Commit

Permalink
chore(lint): update lint config & add vscode settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Dec 28, 2024
1 parent 796d185 commit 57b7d13
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
20 changes: 20 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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'],
},
})

0 comments on commit 57b7d13

Please sign in to comment.