diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d8f4bcde..7ecc73606 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,9 +62,9 @@ jobs: command: npm version - checkout - run: - name: Install @typescript-eslint/parser@4 + name: Install eslint@7 and @typescript-eslint/parser@4 command: | - npm install @typescript-eslint/parser@^4 + npm install eslint@7 @typescript-eslint/parser@^4 - run: name: Install dependencies command: npm install diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js new file mode 100644 index 000000000..1ec3b7eae --- /dev/null +++ b/docs/.eslintrc.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = { + parserOptions: { + sourceType: 'module' + } +} diff --git a/docs/.vuepress/components/eslint-code-block.vue b/docs/.vuepress/components/eslint-code-block.vue index 3c37c9234..2c6abd2cc 100644 --- a/docs/.vuepress/components/eslint-code-block.vue +++ b/docs/.vuepress/components/eslint-code-block.vue @@ -122,20 +122,16 @@ export default { async mounted() { // Load linter. - const [{ default: Linter }, { default: coreRules }, { parseForESLint }] = - await Promise.all([ - import('eslint4b/dist/linter'), - import('eslint4b/dist/core-rules'), - import('espree').then(() => import('vue-eslint-parser')) - ]) + const [{ Linter }, { parseForESLint }] = await Promise.all([ + import('eslint/lib/linter'), + import('espree').then(() => import('vue-eslint-parser')) + ]) const linter = (this.linter = new Linter()) for (const ruleId of Object.keys(rules)) { linter.defineRule(`vue/${ruleId}`, rules[ruleId]) } - linter.defineRule('no-undef', coreRules['no-undef']) - linter.defineRule('no-unused-vars', coreRules['no-unused-vars']) linter.defineParser('vue-eslint-parser', { parseForESLint }) } diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c0a406166..5bcb7913b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -124,7 +124,15 @@ module.exports = { resolve: { alias: { module: require.resolve('./shim/module'), - eslint: path.resolve(__dirname, './shim/eslint') + eslint$: require.resolve('./shim/eslint'), + esquery: path.resolve( + __dirname, + '../../node_modules/esquery/dist/esquery.min.js' + ), + '@eslint/eslintrc/universal': path.resolve( + __dirname, + '../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs' + ) } } } diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 000000000..dc7e30771 --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,28 @@ +/* globals window */ +export default ( + // eslint-disable-next-line no-empty-pattern + { + // Vue, // the version of Vue being used in the VuePress app + // options, // the options for the root Vue instance + // router, // the router instance for the app + // siteData, // site metadata + } +) => { + if (typeof window !== 'undefined') { + if (typeof window.process === 'undefined') { + window.process = new Proxy( + { + env: {}, + cwd: () => undefined + }, + { + get(target, name) { + // For debug + // console.log(name) + return target[name] + } + } + ) + } + } +} diff --git a/docs/.vuepress/shim/eslint.js b/docs/.vuepress/shim/eslint.js new file mode 100644 index 000000000..08af6dfcd --- /dev/null +++ b/docs/.vuepress/shim/eslint.js @@ -0,0 +1,4 @@ +const { Linter } = require('eslint/lib/linter') +module.exports = { + Linter +} diff --git a/docs/.vuepress/shim/eslint/index.js b/docs/.vuepress/shim/eslint/index.js deleted file mode 100644 index e32cb598f..000000000 --- a/docs/.vuepress/shim/eslint/index.js +++ /dev/null @@ -1,2 +0,0 @@ -const Linter = require('eslint4b') -module.exports = { Linter } diff --git a/docs/.vuepress/shim/eslint/lib/rules/index.js b/docs/.vuepress/shim/eslint/lib/rules/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/rules/README.md b/docs/rules/README.md index 544d24db7..e17125ee8 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -296,10 +296,13 @@ For example: | [vue/html-comment-content-spacing](./html-comment-content-spacing.md) | enforce unified spacing in HTML comments | :wrench: | | [vue/html-comment-indent](./html-comment-indent.md) | enforce consistent indentation in HTML comments | :wrench: | | [vue/match-component-file-name](./match-component-file-name.md) | require component name property to match its file name | | +| [vue/multi-word-component-names](./multi-word-component-names.md) | require component names to be always multi-word | | | [vue/new-line-between-multi-line-property](./new-line-between-multi-line-property.md) | enforce new lines between multi-line properties in Vue components | :wrench: | | [vue/next-tick-style](./next-tick-style.md) | enforce Promise or callback style in `nextTick` | :wrench: | | [vue/no-bare-strings-in-template](./no-bare-strings-in-template.md) | disallow the use of bare strings in `