From 55147c4123cdbb9e2254f8120a9f45bcc0664537 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Thu, 11 Feb 2021 13:00:49 +0100 Subject: [PATCH] chore: refactor eslint config, now at root --- .circleci/config.yml | 2 +- .../vue-apollo/.eslintrc.js => .eslintrc.js | 11 +- package.json | 16 +- .../.vuepress/components/sponsor-button.vue | 13 +- packages/docs/src/.vuepress/config.js | 10 +- packages/test-e2e/.eslintignore | 2 - packages/test-e2e/.eslintrc.js | 31 - .../apollo-server/connectors/messages.js | 4 +- .../apollo-server/connectors/users.js | 8 +- packages/test-e2e/apollo-server/resolvers.js | 2 +- packages/test-e2e/package.json | 6 - .../test-e2e/src/components/ChannelView.vue | 2 +- packages/test-ssr/.eslintignore | 2 - packages/test-ssr/.eslintrc.js | 33 - packages/test-ssr/apollo-server/context.js | 2 +- packages/test-ssr/apollo-server/resolvers.js | 22 +- packages/test-ssr/apollo-server/utils/db.js | 2 +- .../test-ssr/apollo-server/utils/upload.js | 2 +- packages/test-ssr/apollo.config.js | 10 +- packages/test-ssr/babel.config.js | 4 +- packages/test-ssr/package.json | 9 +- packages/test-ssr/postcss.config.js | 4 +- packages/test-ssr/src/App.vue | 25 +- .../test-ssr/src/components/ApolloExample.vue | 8 +- .../test-ssr/src/components/ApolloLoading.vue | 13 +- .../test-ssr/src/components/HelloWorld.vue | 19 +- .../src/components/InlineTemplate.vue | 4 +- packages/test-ssr/src/entry-client.js | 6 +- packages/test-ssr/src/entry-server.js | 3 +- packages/test-ssr/src/main.js | 12 +- packages/test-ssr/src/router/index.js | 16 +- packages/test-ssr/src/views/Home.vue | 7 +- packages/test-ssr/src/vue-apollo.js | 8 +- packages/test-ssr/tests/e2e/.eslintrc.js | 8 +- packages/test-ssr/tests/e2e/plugins/index.js | 2 +- packages/test-ssr/vue.config.js | 10 +- packages/vue-apollo/package.json | 14 +- yarn.lock | 693 ++---------------- 38 files changed, 200 insertions(+), 845 deletions(-) rename packages/vue-apollo/.eslintrc.js => .eslintrc.js (86%) delete mode 100644 packages/test-e2e/.eslintignore delete mode 100644 packages/test-e2e/.eslintrc.js delete mode 100644 packages/test-ssr/.eslintignore delete mode 100644 packages/test-ssr/.eslintrc.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f2a3846..043bc553 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,8 +33,8 @@ jobs: key: v4-dependencies-{{ checksum "yarn.lock" }} # run tests! + - run: yarn lint - run: cd packages/vue-apollo && yarn build - - run: cd packages/vue-apollo && yarn test:eslint - run: cd packages/vue-apollo && yarn test:types - run: cd packages/vue-apollo && yarn test:unit - run: cd packages/test-e2e && yarn test:e2e diff --git a/packages/vue-apollo/.eslintrc.js b/.eslintrc.js similarity index 86% rename from packages/vue-apollo/.eslintrc.js rename to .eslintrc.js index a29fe96a..3e6af77e 100644 --- a/packages/vue-apollo/.eslintrc.js +++ b/.eslintrc.js @@ -51,7 +51,14 @@ module.exports = { }, }, { - files: ['tests/unit/*.js', 'ssr/*', 'build/*', 'lib/*'], + files: [ + '**/tests/unit/*.js', + '**/ssr/*', + '**/build/*', + '**/lib/*', + 'apollo.config.js', + '**/apollo-server/**/*', + ], rules: { '@typescript-eslint/no-var-requires': 'off', }, @@ -62,6 +69,6 @@ module.exports = { 'dist/', '!.*', 'schema.graphql', - 'types/test/*.js', + '**/types/test/*.js', ], } diff --git a/package.json b/package.json index 3e3e8dd3..79d47240 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,24 @@ ], "private": true, "scripts": { - "release": "lerna publish" + "lint": "eslint --ext .js,.ts,.vue .", + "release": "yarn lint && lerna publish" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^4.2.0", + "@typescript-eslint/parser": "^4.2.0", + "@vue/eslint-config-standard": "^6.0.0", + "@vue/eslint-config-typescript": "^7.0.0", "core-js": "^3.4.1", + "eslint": "^7.19.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^5.0.0", + "eslint-plugin-vue": "^7.5.0", "eslint-scope": "^5.0.0", - "lerna": "^3.18.4" + "lerna": "^3.18.4", + "typescript": "^4.1.3" }, "resolutions": { "eslint-scope": "^5.0.0", diff --git a/packages/docs/src/.vuepress/components/sponsor-button.vue b/packages/docs/src/.vuepress/components/sponsor-button.vue index 7eec310c..ec25b929 100644 --- a/packages/docs/src/.vuepress/components/sponsor-button.vue +++ b/packages/docs/src/.vuepress/components/sponsor-button.vue @@ -1,6 +1,11 @@