Skip to content

Instantly share code, notes, and snippets.

@Diomeh
Created November 14, 2022 15:23
Show Gist options
  • Save Diomeh/583ba23032a906a75988d02a7a803246 to your computer and use it in GitHub Desktop.
Save Diomeh/583ba23032a906a75988d02a7a803246 to your computer and use it in GitHub Desktop.
vue eslintrc
module.exports = {
env: {
commonjs: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-essential',
],
parserOptions: {
ecmaVersion: 'latest',
},
plugins: [
'vue',
],
ignorePatterns: [
'node_modules/*',
'*.min.*',
'*/vendor/*',
],
globals: {
'$': 'readonly',
'jQuery': 'readonly',
'Vue': 'readonly',
'moment': 'readonly',
},
rules: {
'no-prototype-builtins': 'off',
'linebreak-style': ['warn', 'unix'],
'no-console': 'warn',
'no-debugger': 'off',
'vue/no-deprecated-slot-attribute': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'arrow-spacing': ['warn', { before: true, after: true }],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['warn', 'always-multiline'],
'comma-spacing': 'warn',
'comma-style': 'warn',
'curly': ['warn', 'multi-line', 'consistent'],
'dot-location': ['warn', 'property'],
'eol-last': 'warn',
'handle-callback-err': 'off',
'import/no-named-default': 'off',
'key-spacing': 'off',
'keyword-spacing': 'warn',
'max-nested-callbacks': ['error', { max: 4 }],
'max-statements-per-line': ['warn', { max: 2 }],
'no-empty': 'warn',
'no-empty-function': 'warn',
'no-floating-decimal': 'warn',
'no-inline-comments': 'off',
'no-lonely-if': 'warn',
'no-multi-spaces': 'off',
'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 1, maxBOF: 0 }],
'no-shadow': ['warn', { allow: ['err', 'resolve', 'reject'] }],
'no-trailing-spaces': ['warn'],
'no-var': 'warn',
'no-unused-vars': ['warn', { vars: 'all', args: 'none', ignoreRestSiblings: false }],
'no-void': 'warn',
'object-curly-spacing': ['warn', 'always'],
'prefer-const': 'error',
'quotes': ['warn', 'single'],
'indent': ['warn', 4, { SwitchCase: 1 }],
'semi': ['warn', 'always'],
'space-before-blocks': 'warn',
'space-before-function-paren': 'off',
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
'yoda': 'warn',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment