Skip to content

Commit 50b5b7d

Browse files
authored
Merge branch 'master' into master
2 parents 369ed57 + 1ffcd01 commit 50b5b7d

File tree

274 files changed

+15382
-763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+15382
-763
lines changed

.circleci/config.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ workflows:
55
- node-v8
66
- node-v10
77
- node-v12
8-
- node-v12-minimal
98

109
version: 2
1110
jobs:
@@ -43,32 +42,3 @@ jobs:
4342
<<: *node-base
4443
docker:
4544
- image: node:12
46-
47-
node-v12-minimal:
48-
docker:
49-
- image: node:12
50-
steps:
51-
- run:
52-
name: Versions
53-
command: npm version
54-
- checkout
55-
- restore_cache:
56-
keys:
57-
- v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
58-
- run:
59-
name: Install dependencies
60-
command: npm install
61-
- save_cache:
62-
key: v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
63-
paths:
64-
- node_modules
65-
- run:
66-
name: Install eslint 5
67-
command: |
68-
# We need to execute this command twice because of npm's bug.
69-
# See also: https://npm.community/t/error-node-modules-staging-eslint-e7cf6846-node-modules-eslint
70-
npm install [email protected] [email protected] --no-save
71-
npm install [email protected] [email protected] --no-save
72-
- run:
73-
name: Test
74-
command: npm test

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/coverage
33
/node_modules
44
/tests/fixtures
5-
/tests/integrations/*/node_modules
5+
/tests/integrations/eslint-plugin-import
66

77
!.vuepress
88
/docs/.vuepress/dist

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
rules: {
3030
"consistent-docs-description": "error",
3131
"no-invalid-meta": "error",
32+
"no-invalid-meta-docs-categories": "error",
3233
'eslint-plugin/require-meta-type': 'error',
3334
"require-meta-docs-url": ["error", {
3435
"pattern": `https://eslint.vuejs.org/rules/{{name}}.html`

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111

1212
See [the official website](https://eslint.vuejs.org).
1313

14+
> :exclamation: Attention - this is documentation for version `7.x` :exclamation:
15+
>
16+
> This branch contains `eslint-plugin-vue@next` which is a pre-released `7.0`, but it's not the default version that you get with `npm install eslint-plugin-vue`. In order to install this you need to specify either `"eslint-plugin-vue": "next"` in `package.json` or do `npm install eslint-plugin-vue@next`.
17+
>
18+
> Please try it and report any issues that you might have encountered.
19+
>
20+
> If you want to check previous releases [go here](https://github.com/vuejs/eslint-plugin-vue/releases).
21+
1422
## :anchor: Versioning Policy
1523

1624
This plugin is following [Semantic Versioning](https://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).

docs/.vuepress/components/eslint-code-block.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</template>
1919

2020
<script>
21-
// https://github.com/vuejs/vuepress/issues/451
22-
import EslintEditor from '../../../node_modules/vue-eslint-editor'
21+
import EslintEditor from 'vue-eslint-editor'
2322
import { rules, processors } from '../../../'
2423
2524
export default {

docs/.vuepress/config.js

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,47 @@
55
'use strict'
66

77
const rules = require('../../tools/lib/rules')
8-
const categories = require('../../tools/lib/categories')
98

10-
const uncategorizedRules = rules.filter(rule => !rule.meta.docs.category && !rule.meta.deprecated)
9+
const uncategorizedRules = rules.filter(rule => !rule.meta.docs.categories && !rule.meta.deprecated)
1110
const deprecatedRules = rules.filter(rule => rule.meta.deprecated)
1211

12+
const sidebarCategories = [
13+
{ title: 'Base Rules', categoryIds: ['base'] },
14+
{ title: 'Priority A: Essential', categoryIds: ['vue3-essential', 'essential'] },
15+
{ title: 'Priority A: Essential for Vue.js 3.x', categoryIds: ['vue3-essential'] },
16+
{ title: 'Priority A: Essential for Vue.js 2.x', categoryIds: ['essential'] },
17+
{ title: 'Priority B: Strongly Recommended', categoryIds: ['vue3-strongly-recommended', 'strongly-recommended'] },
18+
{ title: 'Priority B: Strongly Recommended for Vue.js 3.x', categoryIds: ['vue3-strongly-recommended'] },
19+
{ title: 'Priority B: Strongly Recommended for Vue.js 2.x', categoryIds: ['strongly-recommended'] },
20+
{ title: 'Priority C: Recommended', categoryIds: ['vue3-recommended', 'recommended'] },
21+
{ title: 'Priority C: Recommended for Vue.js 3.x', categoryIds: ['vue3-recommended'] },
22+
{ title: 'Priority C: Recommended for Vue.js 2.x', categoryIds: ['recommended'] }
23+
]
24+
25+
const categorizedRules = []
26+
for (const { title, categoryIds } of sidebarCategories) {
27+
const categoryRules = rules
28+
.filter(rule => rule.meta.docs.categories && !rule.meta.deprecated)
29+
.filter(rule => categoryIds
30+
.every(categoryId => rule.meta.docs.categories.includes(categoryId))
31+
)
32+
const children = categoryRules
33+
.filter(({ ruleId }) => {
34+
const exists = categorizedRules.some(({ children }) => children.some(([, alreadyRuleId]) => alreadyRuleId === ruleId))
35+
return !exists
36+
})
37+
.map(({ ruleId, name }) => [`/rules/${name}`, ruleId])
38+
39+
if (children.length === 0) {
40+
continue
41+
}
42+
categorizedRules.push({
43+
title,
44+
collapsable: false,
45+
children
46+
})
47+
}
48+
1349
const extraCategories = []
1450
if (uncategorizedRules.length > 0) {
1551
extraCategories.push({
@@ -30,22 +66,25 @@ module.exports = {
3066
base: '/',
3167
title: 'eslint-plugin-vue',
3268
description: 'Official ESLint plugin for Vue.js',
33-
serviceWorker: true,
3469
evergreen: true,
3570
head: [
3671
['link', { rel: 'icon', href: '/favicon.png' }]
3772
],
3873

74+
plugins: {
75+
'@vuepress/pwa': {
76+
serviceWorker: true,
77+
updatePopup: true
78+
}
79+
},
80+
3981
themeConfig: {
4082
repo: 'vuejs/eslint-plugin-vue',
4183
docsRepo: 'vuejs/eslint-plugin-vue',
4284
docsDir: 'docs',
4385
docsBranch: 'master',
4486
editLinks: true,
4587
lastUpdated: true,
46-
serviceWorker: {
47-
updatePopup: true
48-
},
4988

5089
nav: [
5190
{ text: 'User Guide', link: '/user-guide/' },
@@ -59,11 +98,7 @@ module.exports = {
5998
'/rules/',
6099

61100
// Rules in each category.
62-
...categories.map(({ title, rules }) => ({
63-
title: title.replace(/ \(.+?\)/, ''),
64-
collapsable: false,
65-
children: rules.map(({ ruleId, name }) => [`/rules/${name}`, ruleId])
66-
})),
101+
...categorizedRules,
67102

68103
// Rules in no category.
69104
...extraCategories

docs/.vuepress/style.styl renamed to docs/.vuepress/styles/index.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.theme-container.rule-details .content > h1 {
1+
.theme-container.rule-details .theme-default-content > h1 {
22
font-size: 1.8rem;
33

44
+ blockquote {

docs/.vuepress/theme/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extend: '@vuepress/theme-default'
3+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<BaseLayout
3+
v-bind="$attrs"
4+
v-on="$listeners">
5+
<slot
6+
name="sidebar-top"
7+
slot="sidebar-top"
8+
/>
9+
<slot
10+
name="sidebar-bottom"
11+
slot="sidebar-bottom"
12+
/>
13+
<template
14+
slot="page-top">
15+
<div class="theme-default-content beta-doc-description">
16+
<div class="warning custom-block">
17+
<p class="custom-block-title">Note</p>
18+
<p>This is a documentation for version <code>{{docVersion}}</code>.<template v-if="hasNotYetBeenReleased"> Also, this documentation may contain content that has not yet been released.</template><br>
19+
To check version <code>6.2.2</code> <a :href="v6DocLink">go here</a>.
20+
To check previous releases <a href="https://github.com/vuejs/eslint-plugin-vue/releases">go here</a>.</p>
21+
</div>
22+
</div>
23+
<slot
24+
name="page-top"
25+
/>
26+
</template>
27+
<slot
28+
name="page-bottom"
29+
slot="page-bottom"
30+
/>
31+
</BaseLayout>
32+
</template>
33+
34+
<script>
35+
/**
36+
* Layout definition to navigate to older versions of the document.
37+
*/
38+
import BaseLayout from '@vuepress/theme-default/layouts/Layout.vue'
39+
import semver from 'semver'
40+
const version = semver.parse(require('../../../../package.json').version)
41+
export default {
42+
name: 'MyLayout',
43+
components: {
44+
BaseLayout
45+
},
46+
computed: {
47+
docVersion () {
48+
if (version.major < 7) {
49+
return '7.x'
50+
}
51+
return version.raw
52+
},
53+
hasNotYetBeenReleased () {
54+
if (version.major < 7) {
55+
return true
56+
}
57+
return false
58+
},
59+
v6DocLink () {
60+
if (this.$page.path.endsWith('.html')) {
61+
return `https://github.com/vuejs/eslint-plugin-vue/blob/v6.2.2/docs${this.$page.path.replace(/\.html$/, '')}.md`
62+
}
63+
return `https://github.com/vuejs/eslint-plugin-vue/blob/v6.2.2/docs${this.$page.path}README.md`
64+
}
65+
}
66+
}
67+
</script>
68+
69+
<style scoped>
70+
.beta-doc-description {
71+
padding-bottom: 0;
72+
}
73+
* ::v-deep .theme-default-content ~ .theme-default-content {
74+
padding-top: 0;
75+
}
76+
* ::v-deep .theme-default-content:not(.custom) h1{
77+
margin-top: -3.1rem;
78+
}
79+
</style>

0 commit comments

Comments
 (0)