summaryrefslogtreecommitdiffstats
path: root/.eslintrc.js
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-26 10:33:27 +0200
committerJulius Härtl <jus@bitgrid.net>2018-10-26 10:33:27 +0200
commitf7ed53a5fba82f80457677f32a972bb0bab7e32c (patch)
treefc33ae951edda30e5ffd6f8f0bf5ec80b2a49a83 /.eslintrc.js
parenta25b0bc69e8f346cdb1f567c46c01e99338291c3 (diff)
Add proper eslint settings
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to '.eslintrc.js')
-rw-r--r--.eslintrc.js68
1 files changed, 66 insertions, 2 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index a5b82de4..340cc1cf 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,3 +1,67 @@
module.exports = {
- "extends": "standard"
-}; \ No newline at end of file
+ root: true,
+ env: {
+ browser: true,
+ es6: true,
+ node: true,
+ jest: true
+ },
+ globals: {
+ t: true,
+ n: true,
+ OC: true,
+ OCA: true,
+ Vue: true,
+ VueRouter: true
+ },
+ parserOptions: {
+ parser: 'babel-eslint',
+ ecmaVersion: 6
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:node/recommended',
+ 'plugin:vue/essential',
+ 'plugin:vue/recommended',
+ 'standard'
+ ],
+ plugins: ['vue', 'node'],
+ rules: {
+ // space before function ()
+ 'space-before-function-paren': ['error', 'never'],
+ // curly braces always space
+ 'object-curly-spacing': ['error', 'always'],
+ // stay consistent with array brackets
+ 'array-bracket-newline': ['error', 'consistent'],
+ // 1tbs brace style
+ 'brace-style': 'error',
+ // tabs only
+ indent: ['error', 'tab'],
+ 'no-tabs': 0,
+ 'vue/html-indent': ['error', 'tab'],
+ // only debug console
+ 'no-console': ['error', { allow: ['error', 'warn', 'debug'] }],
+ // classes blocks
+ 'padded-blocks': ['error', { classes: 'always' }],
+ // always have the operator in front
+ 'operator-linebreak': ['error', 'before'],
+ // ternary on multiline
+ 'multiline-ternary': ['error', 'always-multiline'],
+ // es6 import/export and require
+ 'node/no-unpublished-require': ['off'],
+ 'node/no-unsupported-features/es-syntax': ['off'],
+ // space before self-closing elements
+ 'vue/html-closing-bracket-spacing': 'error',
+ // code spacing with attributes
+ 'vue/max-attributes-per-line': [
+ 'error',
+ {
+ singleline: 3,
+ multiline: {
+ max: 3,
+ allowFirstLine: true
+ }
+ }
+ ]
+ }
+}