backend pretier, more linting rules

This commit is contained in:
Ulf Gebhardt 2019-05-18 15:07:02 +02:00
parent 9dda50cfd8
commit c69e5915f1
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3
4 changed files with 35 additions and 17 deletions

View File

@ -1,20 +1,26 @@
module.exports = {
"extends": "standard",
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
"jest/globals": true
env: {
es6: true,
node: true,
'jest/globals': true
},
"rules": {
"indent": [
"error",
2
],
"quotes": [
"error",
"single"
]
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'standard',
'plugin:vue/recommended',
'plugin:prettier/recommended'
],
plugins: [
'jest'
]
rules: {
'indent': [ 'error', 2 ],
'quotes': [ "error", "single"],
// 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-console': ['error'],
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'prettier/prettier': ['error'],
},
"plugins": ["jest"]
};

9
backend/.prettierrc.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = {
semi: false,
printWidth: 100,
singleQuote: true,
trailingComma: "all",
tabWidth: 2,
bracketSpacing: true
};

View File

@ -99,6 +99,7 @@
"eslint-plugin-import": "~2.17.2",
"eslint-plugin-jest": "~22.5.1",
"eslint-plugin-node": "~9.0.1",
"eslint-plugin-prettier": "~3.1.0",
"eslint-plugin-promise": "~4.1.1",
"eslint-plugin-standard": "~4.0.0",
"graphql-request": "~1.8.2",

View File

@ -8,6 +8,7 @@ module.exports = {
parser: 'babel-eslint'
},
extends: [
'standard',
'plugin:vue/recommended',
'plugin:prettier/recommended'
],
@ -18,7 +19,8 @@ module.exports = {
],
// add your custom rules here
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
//'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-console': ['error'],
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'prettier/prettier': ['error'],