зеркало из https://github.com/nextcloud/push.git
103 строки
2.7 KiB
JavaScript
103 строки
2.7 KiB
JavaScript
/*
|
|
* Push - Nextcloud Push Service
|
|
*
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
* later. See the COPYING file.
|
|
*
|
|
* @author Maxence Lange <maxence@artificial-owl.com>
|
|
* @copyright 2019
|
|
* @license GNU AGPL version 3 or any later version
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
module.exports = {
|
|
root: true,
|
|
env: {
|
|
browser: true,
|
|
es6: true,
|
|
node: true,
|
|
jest: true
|
|
},
|
|
globals: {
|
|
t: true,
|
|
n: true,
|
|
OC: true,
|
|
OCA: true,
|
|
axios: true,
|
|
OCP: true,
|
|
Polling: true,
|
|
Vue: 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'],
|
|
// kebab case components for vuejs
|
|
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
|
|
// space before self-closing elements
|
|
'vue/html-closing-bracket-spacing': 'error',
|
|
// newline before closing bracket
|
|
'vue/html-closing-bracket-newline': ["error", {
|
|
"singleline": "never",
|
|
"multiline": "never"
|
|
}
|
|
],
|
|
// code spacing with attributes
|
|
'vue/max-attributes-per-line': [
|
|
'error',
|
|
{
|
|
singleline: 3,
|
|
multiline: {
|
|
max: 3,
|
|
allowFirstLine: true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|