Skip to content

Instantly share code, notes, and snippets.

@trainiac
Created December 13, 2017 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trainiac/8bff6e49ffe04378e5700709b6ee838f to your computer and use it in GitHub Desktop.
Save trainiac/8bff6e49ffe04378e5700709b6ee838f to your computer and use it in GitHub Desktop.
/* eslint-disable no-magic-numbers */
// Add eslint-plugin-prettier once merged https://github.com/prettier/eslint-plugin-prettier/pull/70
module.exports = {
extends: ['standard', 'prettier', 'plugin:vue/recommended'],
plugins: ['compat'] /*, 'prettier' */,
globals: {
process: true,
},
env: {
jest: true,
browser: true,
},
settings: {
polyfills: ['promises'],
},
rules: {
'array-callback-return': 'error',
camelcase: ['error', { properties: 'always' }],
'compat/compat': 'error',
complexity: ['error', 10],
'consistent-return': 'error',
'consistent-this': ['error', 'self'],
'default-case': 'error',
eqeqeq: ['error', 'smart'],
'func-names': 'error',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'id-blacklist': ['error', 'cb', 'callback'],
'id-length': ['error', { exceptions: ['e', '_', '$'] }],
'max-depth': ['error', 4],
'max-nested-callbacks': ['error', 3],
'max-statements': ['error', 30],
'no-alert': 'error',
'no-bitwise': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-duplicate-imports': ['error', { includeExports: true }],
'no-div-regex': 'error',
'no-else-return': 'error',
'no-empty': 'error',
'no-empty-function': 'error',
'no-eq-null': 'off',
'no-extra-label': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-invalid-this': 'error',
'no-loop-func': 'error',
'no-lonely-if': 'error',
'no-magic-numbers': ['error', { ignore: [-1, 0, 1, 2, 4, 100] }],
'no-script-url': 'error',
'no-shadow': 'error',
'no-underscore-dangle': 'error',
'no-useless-concat': 'error',
'no-warning-comments': [
'warn',
{
terms: ['todo', 'fixme'],
location: 'start',
},
],
'no-var': 'error',
'object-shorthand': ['error', 'always'],
'operator-assignment': ['error', 'always'],
'prefer-const': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
// 'prettier/prettier': 'error',
'require-yield': 'error',
'spaced-comment': 'off',
'standard/computed-property-even-spacing': 'off',
'vue/attribute-hyphenation': ['error', 'never'],
'vue/html-quotes': ['error', 'single'],
'vue/max-attributes-per-line': [
'error',
{
singleline: 2,
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/require-default-prop': 'off',
},
parserOptions: {
parser: 'babel-eslint',
allowImportExportEverywhere: true,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment