diff --git a/.editorconfig b/.editorconfig index 0aa45e0..ce9c056 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 13a5d36..0000000 --- a/.eslintrc.json +++ /dev/null @@ -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" }] - } -} diff --git a/.xo-config.json b/.xo-config.json new file mode 100644 index 0000000..dc76327 --- /dev/null +++ b/.xo-config.json @@ -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"] + }] + } + }] +} diff --git a/package.json b/package.json index 0a54000..1a43d15 100644 --- a/package.json +++ b/package.json @@ -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" } }