Improve linting

master
Joe Biellik 5 years ago
parent ecd0647250
commit 9561daced2

@ -8,6 +8,6 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[{*.json,*.yml,*.pug,*.md}]
[*.{json,yml,pug,md}]
indent_style = space
indent_size = 2

@ -1,26 +0,0 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 11
},
"extends": ["eslint:recommended"],
"rules": {
"comma-dangle": ["error"],
"indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"no-console": ["warn", { "allow": ["warn", "error"] }],
"no-extra-parens": ["error"],
"no-loss-of-precision": ["error"],
"no-promise-executor-return": ["error"],
"no-template-curly-in-string": ["error"],
"no-trailing-spaces": ["warn"],
"no-unreachable-loop": ["error"],
"no-useless-backreference": ["error"],
"quotes": ["error", "single", "avoid-escape"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", { "anonymous": "never", "named": "never", "asyncArrow": "always" }]
}
}

@ -0,0 +1,38 @@
{
"rules": {
"arrow-parens": ["error", "always"],
"curly": ["error", "multi-line"],
"new-cap": ["error", {
"capIsNew": false
}],
"no-console": ["error", {
"allow": ["warn", "error"]
}],
"object-curly-spacing": ["error", "always"],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never"
}],
"unicorn/prevent-abbreviations": "off",
"unicorn/catch-error-name": ["error", {
"name": "err"
}],
"import/no-unassigned-import": ["error", {
"allow": ["db"]
}],
"quotes": ["error", "single", {
"avoidEscape": true
}]
},
"overrides": [{
"files": "public/*.js",
"esnext": false,
"envs": ["browser", "jquery"],
"globals": ["autosize"],
"rules": {
"camelcase": ["error", {
"allow": ["buttondown_class", "buttonup_class"]
}]
}
}]
}

@ -19,7 +19,7 @@
"main": "server.js",
"scripts": {
"watch": "nodemon -L -e js,json,pug -i ./public",
"lint": "eslint . && pug-lint ./views"
"lint": "xo && pug-lint ./views && eclint ."
},
"dependencies": {
"bytes": "^3.1.0",
@ -40,8 +40,9 @@
"pug": "^3.0.0"
},
"devDependencies": {
"eslint": "^7.5.0",
"eclint": "^2.8.1",
"nodemon": "^2.0.4",
"pug-lint": "^2.6.0"
"xo": "^0.32.1"
}
}

Loading…
Cancel
Save