Set up prettier on js/vue

This commit is contained in:
Alistair McKinlay 2019-07-17 10:32:26 +01:00
parent 7e5c2672b2
commit 48eeb11391
5 changed files with 17 additions and 50 deletions

View file

@ -11,48 +11,21 @@ env:
node: true node: true
rules: rules:
arrow-body-style: error
arrow-parens: [error, always]
arrow-spacing: error
block-scoped-var: error block-scoped-var: error
block-spacing: [error, always]
brace-style: [error, 1tbs]
comma-dangle:
- error
- always-multiline
curly: [error, all] curly: [error, all]
dot-location: [error, property]
dot-notation: error dot-notation: error
eol-last: error
eqeqeq: error eqeqeq: error
handle-callback-err: 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] linebreak-style: [error, unix]
no-alert: error no-alert: error
no-catch-shadow: error no-catch-shadow: error
no-confusing-arrow:
- error
- allowParens: true
no-control-regex: off no-control-regex: off
no-console: error no-console: error
no-duplicate-imports: error no-duplicate-imports: error
no-else-return: error no-else-return: error
no-implicit-globals: error no-implicit-globals: error
no-multi-spaces: error
no-multiple-empty-lines:
- error
- max: 1
no-shadow: error no-shadow: error
no-template-curly-in-string: error no-template-curly-in-string: error
no-trailing-spaces: error
no-unsafe-negation: error no-unsafe-negation: error
no-useless-computed-key: error no-useless-computed-key: error
no-useless-constructor: error no-useless-constructor: error
@ -61,12 +34,10 @@ rules:
- error - error
- functions: false - functions: false
no-var: error no-var: error
object-curly-spacing: [error, never]
object-shorthand: object-shorthand:
- error - error
- methods - methods
- avoidExplicitReturnArrows: true - avoidExplicitReturnArrows: true
padded-blocks: [error, never]
padding-line-between-statements: padding-line-between-statements:
- error - error
- blankLine: always - blankLine: always
@ -82,31 +53,12 @@ rules:
prefer-const: error prefer-const: error
prefer-rest-params: error prefer-rest-params: error
prefer-spread: 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] spaced-comment: [error, always]
strict: off strict: off
template-curly-spacing: error
yoda: error yoda: error
vue/html-indent: [error, tab]
vue/require-default-prop: off vue/require-default-prop: off
vue/no-v-html: off vue/no-v-html: off
vue/no-use-v-if-with-v-for: 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: plugins:
- vue - vue
@ -114,3 +66,5 @@ plugins:
extends: extends:
- eslint:recommended - eslint:recommended
- plugin:vue/recommended - plugin:vue/recommended
- prettier
- prettier/vue

View file

@ -23,5 +23,3 @@ yarn.lock
.gitattributes .gitattributes
*.css *.css
*.js
*.vue

View file

@ -1,5 +1,6 @@
arrowParens: always arrowParens: always
bracketSpacing: false bracketSpacing: false
printWidth: 100
trailingComma: "es5" trailingComma: "es5"
overrides: overrides:
- files: "*.webmanifest" - files: "*.webmanifest"

View file

@ -16,6 +16,7 @@
"coverage": "run-s test:{client,server} && nyc --nycrc-path=test/.nycrc-report.json report", "coverage": "run-s test:{client,server} && nyc --nycrc-path=test/.nycrc-report.json report",
"dev": "run-p watch start", "dev": "run-p watch start",
"format:prettier": "prettier --write \"**/*.*\"", "format:prettier": "prettier --write \"**/*.*\"",
"lint:check-eslint": "eslint --print-config .eslintrc.yml | eslint-config-prettier-check",
"lint:eslint": "eslint . --ext .js,.vue --report-unused-disable-directives --color", "lint:eslint": "eslint . --ext .js,.vue --report-unused-disable-directives --color",
"lint:prettier": "prettier --list-different \"**/*.*\"", "lint:prettier": "prettier --list-different \"**/*.*\"",
"lint:stylelint": "stylelint --color \"client/**/*.css\"", "lint:stylelint": "stylelint --color \"client/**/*.css\"",
@ -84,6 +85,7 @@
"css.escape": "1.5.1", "css.escape": "1.5.1",
"emoji-regex": "8.0.0", "emoji-regex": "8.0.0",
"eslint": "6.0.1", "eslint": "6.0.1",
"eslint-config-prettier": "4.0.0",
"eslint-plugin-vue": "5.2.3", "eslint-plugin-vue": "5.2.3",
"fuzzy": "0.1.3", "fuzzy": "0.1.3",
"graphql-request": "1.8.2", "graphql-request": "1.8.2",

View file

@ -2973,6 +2973,13 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
eslint-config-prettier@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.0.0.tgz#16cedeea0a56e74de60dcbbe3be0ab2c645405b9"
integrity sha512-kWuiJxzV5NwOwZcpyozTzDT5KJhBw292bbYro9Is7BWnbNMg15Gmpluc1CTetiCatF8DRkNvgPAOaSyg+bYr3g==
dependencies:
get-stdin "^6.0.0"
eslint-plugin-vue@5.2.3: eslint-plugin-vue@5.2.3:
version "5.2.3" version "5.2.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-5.2.3.tgz#3ee7597d823b5478804b2feba9863b1b74273961" resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-5.2.3.tgz#3ee7597d823b5478804b2feba9863b1b74273961"
@ -3577,6 +3584,11 @@ get-func-name@^2.0.0:
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"
integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=
get-stdin@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
get-stdin@^7.0.0: get-stdin@^7.0.0:
version "7.0.0" version "7.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6"