diff --git a/.eslintrc.yml b/.eslintrc.yml index 05068e87..d6b27290 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -11,48 +11,21 @@ env: node: true rules: - arrow-body-style: error - arrow-parens: [error, always] - arrow-spacing: error block-scoped-var: error - block-spacing: [error, always] - brace-style: [error, 1tbs] - comma-dangle: - - error - - always-multiline curly: [error, all] - dot-location: [error, property] dot-notation: error - eol-last: error eqeqeq: error handle-callback-err: error - indent: [error, tab] - key-spacing: - - error - - beforeColon: false - afterColon: true - keyword-spacing: - - error - - before: true - after: true linebreak-style: [error, unix] no-alert: error no-catch-shadow: error - no-confusing-arrow: - - error - - allowParens: true no-control-regex: off no-console: error no-duplicate-imports: error no-else-return: error no-implicit-globals: error - no-multi-spaces: error - no-multiple-empty-lines: - - error - - max: 1 no-shadow: error no-template-curly-in-string: error - no-trailing-spaces: error no-unsafe-negation: error no-useless-computed-key: error no-useless-constructor: error @@ -61,12 +34,10 @@ rules: - error - functions: false no-var: error - object-curly-spacing: [error, never] object-shorthand: - error - methods - avoidExplicitReturnArrows: true - padded-blocks: [error, never] padding-line-between-statements: - error - blankLine: always @@ -82,31 +53,12 @@ rules: prefer-const: error prefer-rest-params: error prefer-spread: error - quote-props: [error, consistent-as-needed] - quotes: [error, double, avoid-escape] - rest-spread-spacing: error - semi-spacing: error - semi-style: [error, last] - semi: [error, always] - space-before-blocks: error - space-before-function-paren: - - error - - anonymous: never - named: never - asyncArrow: always # Otherwise requires `async()` - space-in-parens: [error, never] - space-infix-ops: error spaced-comment: [error, always] strict: off - template-curly-spacing: error yoda: error - vue/html-indent: [error, tab] vue/require-default-prop: off vue/no-v-html: off vue/no-use-v-if-with-v-for: off - vue/html-closing-bracket-newline: error - vue/multiline-html-element-content-newline: off - vue/singleline-html-element-content-newline: off plugins: - vue @@ -114,3 +66,5 @@ plugins: extends: - eslint:recommended - plugin:vue/recommended + - prettier + - prettier/vue diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 62ac1fcd..4f18191e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -31,3 +31,7 @@ your contributions. corner](https://github.com/thelounge/thelounge/wiki/Maintainers'-corner). - Please document any relevant changes in the documentation that can be found [in its own repository](https://github.com/thelounge/thelounge.chat). +- Note that we use prettier on the project. You can set up IDE plugins to format + on save ([see VS Code one here](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)). +- We have a git hook to automatically run prettier before commit, in case you don't install the plugin. +- If for any reason, prettier does not work for you, you can run `yarn format:prettier` and that should format everything. diff --git a/.prettierignore b/.prettierignore index 08d66ad2..c01534b0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -23,5 +23,3 @@ yarn.lock .gitattributes *.css -*.js -*.vue diff --git a/.prettierrc.yml b/.prettierrc.yml index 659327e6..4bad5750 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,5 +1,6 @@ arrowParens: always bracketSpacing: false +printWidth: 100 trailingComma: "es5" overrides: - files: "*.webmanifest" diff --git a/client/components/App.vue b/client/components/App.vue index 74e27533..76820e4d 100644 --- a/client/components/App.vue +++ b/client/components/App.vue @@ -1,8 +1,5 @@ diff --git a/client/components/Channel.vue b/client/components/Channel.vue index 100ad0e0..e48df51a 100644 --- a/client/components/Channel.vue +++ b/client/components/Channel.vue @@ -1,15 +1,9 @@