Skip to content

Instantly share code, notes, and snippets.

@wys1203
Created April 13, 2024 07:53
Show Gist options
  • Select an option

  • Save wys1203/81c90e3de544eee562066beb4785469b to your computer and use it in GitHub Desktop.

Select an option

Save wys1203/81c90e3de544eee562066beb4785469b to your computer and use it in GitHub Desktop.
nuxtjs3 configs
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'@nuxtjs/eslint-config-typescript'
],
plugins: [
'@typescript-eslint'
],
// 自定義ESLint規則
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/html-self-closing': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'nuxt/no-cjs-in-config': 'off'
}
};
{
"semi": false,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"printWidth": 80,
"tabWidth": 2
}
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue"
],
"[javascript]": {
"editor.formatOnSave": false
},
"[vue]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"editor.tabSize": 2 // 設置縮進大小為2個空格
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment