Skip to content

Commit

Permalink
installed antuf eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser committed Mar 30, 2024
1 parent 4a1b10a commit 1181b29
Show file tree
Hide file tree
Showing 6 changed files with 4,305 additions and 7,923 deletions.
39 changes: 0 additions & 39 deletions .eslintrc

This file was deleted.

51 changes: 37 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[js]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[ts]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"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" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"vue"
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"gql",
"graphql"
]
}
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import antfu from '@antfu/eslint-config'

const ignores = [
'.nuxt',
'**/.nuxt/**',
'.output',
'**/.output/**',
'node_modules',
'**/node_modules/**',
'public',
'**/public/**',
]

export default antfu({
// .eslintignore is no longer supported in Flat config, use ignores instead
ignores,

// Stylistic formatting rules
stylistic: {
indent: 2,
quotes: 'single',
},

// TypeScript and Vue are auto-detected, you can also explicitly enable them
typescript: true,
vue: true,

// Disable jsonc and yaml support
jsonc: false,
yaml: false,

// Overwrite certain rules to your preference
rules: {
'no-console': ['error', {
allow: ['info', 'warn', 'trace', 'error', 'group', 'groupEnd'],
}],
'style/comma-dangle': 'off',
'curly': ['error', 'all'],
'node/prefer-global/process': ['error', 'always'],
},
})
Loading

0 comments on commit 1181b29

Please sign in to comment.