From fd6b3e1f685b1fa8217bbadb44117f99d60aa890 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Sat, 9 May 2020 11:30:03 +0900 Subject: [PATCH] Supports ESLint v7.x (#1077) * Supports ESLint v7.x * update --- .circleci/config.yml | 21 ++++++++++++++++++- .eslintrc.js | 10 ++++----- package.json | 4 ++-- tests/lib/rules/attributes-order.js | 14 ++++++------- .../multiline-html-element-content-newline.js | 4 ++-- ...singleline-html-element-content-newline.js | 4 ++-- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60bfc8336..4dc127cba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,7 @@ workflows: - node-v8 - node-v10 - node-v12 + - node-v14 version: 2 jobs: @@ -31,9 +32,23 @@ jobs: command: npm test node-v8: - <<: *node-base docker: - image: node:8 + steps: + - run: + name: Versions + command: npm version + - checkout + - run: + name: Install eslint@6 + command: | + npm install -D eslint@6.0.0 + - run: + name: Install dependencies + command: npm install + - run: + name: Test + command: npm test node-v10: <<: *node-base docker: @@ -42,3 +57,7 @@ jobs: <<: *node-base docker: - image: node:12 + node-v14: + <<: *node-base + docker: + - image: node:14 diff --git a/.eslintrc.js b/.eslintrc.js index 2693499d0..e89fc7ff3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,12 +27,12 @@ module.exports = { overrides: [{ files: ['lib/rules/*.js'], rules: { - "consistent-docs-description": "error", - "no-invalid-meta": "error", - "no-invalid-meta-docs-categories": "error", + 'consistent-docs-description': 'error', + 'no-invalid-meta': 'error', + 'no-invalid-meta-docs-categories': 'error', 'eslint-plugin/require-meta-type': 'error', - "require-meta-docs-url": ["error", { - "pattern": `https://eslint.vuejs.org/rules/{{name}}.html` + 'require-meta-docs-url': ['error', { + 'pattern': `https://eslint.vuejs.org/rules/{{name}}.html` }] } }] diff --git a/package.json b/package.json index 1e7cb40b2..4be6eed17 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "node": ">=8.10" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0" + "eslint": "^6.0.0 || ^7.0.0" }, "dependencies": { "eslint-utils": "^2.0.0", @@ -62,7 +62,7 @@ "acorn": "^7.1.0", "babel-eslint": "^10.0.2", "chai": "^4.1.0", - "eslint": "^6.0.0", + "eslint": "^7.0.0", "eslint-plugin-eslint-plugin": "^2.0.1", "eslint-plugin-import": "^2.18.2", "eslint-plugin-vue": "file:.", diff --git a/tests/lib/rules/attributes-order.js b/tests/lib/rules/attributes-order.js index 5583c9a1c..74a38a870 100644 --- a/tests/lib/rules/attributes-order.js +++ b/tests/lib/rules/attributes-order.js @@ -625,23 +625,23 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "is" should go before "v-once".', - nodeType: 'VIdentifier' + type: 'VIdentifier' }, { message: 'Attribute "v-on:click" should go before "v-once".', - nodeType: 'VDirectiveKey' + type: 'VDirectiveKey' }, { message: 'Attribute "ref" should go before "v-once".', - nodeType: 'VIdentifier' + type: 'VIdentifier' }, { message: 'Attribute "id" should go before "v-text".', - nodeType: 'VIdentifier' + type: 'VIdentifier' }, { message: 'Attribute "myProp" should go before "v-text".', - nodeType: 'VIdentifier' + type: 'VIdentifier' } ] }, @@ -683,7 +683,7 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-if" should go before "class".', - nodeType: 'VIdentifier' + type: 'VDirectiveKey' } ] }, @@ -709,7 +709,7 @@ tester.run('attributes-order', rule, { errors: [ { message: 'Attribute "v-slot" should go before "v-model".', - nodeType: 'VIdentifier' + type: 'VDirectiveKey' } ] }, diff --git a/tests/lib/rules/multiline-html-element-content-newline.js b/tests/lib/rules/multiline-html-element-content-newline.js index 81786ecbe..63cf626a3 100644 --- a/tests/lib/rules/multiline-html-element-content-newline.js +++ b/tests/lib/rules/multiline-html-element-content-newline.js @@ -286,7 +286,7 @@ content message: 'Expected 1 line break after opening tag (`
`), but no line breaks found.', line: 5, column: 12, - nodeType: 'HTMLTagClose', + type: 'HTMLTagClose', endLine: 5, endColumn: 12 }, @@ -294,7 +294,7 @@ content message: 'Expected 1 line break before closing tag (`
`), but no line breaks found.', line: 5, column: 19, - nodeType: 'HTMLEndTagOpen', + type: 'HTMLEndTagOpen', endLine: 5, endColumn: 19 } diff --git a/tests/lib/rules/singleline-html-element-content-newline.js b/tests/lib/rules/singleline-html-element-content-newline.js index f8fb538c1..c47e9c573 100644 --- a/tests/lib/rules/singleline-html-element-content-newline.js +++ b/tests/lib/rules/singleline-html-element-content-newline.js @@ -227,7 +227,7 @@ content message: 'Expected 1 line break after opening tag (`
`), but no line breaks found.', line: 3, column: 30, - nodeType: 'HTMLTagClose', + type: 'HTMLTagClose', endLine: 3, endColumn: 30 }, @@ -235,7 +235,7 @@ content message: 'Expected 1 line break before closing tag (`
`), but no line breaks found.', line: 3, column: 37, - nodeType: 'HTMLEndTagOpen', + type: 'HTMLEndTagOpen', endLine: 3, endColumn: 37 }