Skip to content

Commit 7bca4d3

Browse files
authored
Change peer deps eslint ver from ^6.2.0 || ^7.0.0 || ^8.0.0-0 to ^6.2.0 || ^7.0.0 || ^8.0.0 and change to use ESLint v8. (#1654)
* Change peer deps eslint ver from `^6.2.0 || ^7.0.0 || ^8.0.0-0` to `^6.2.0 || ^7.0.0 || ^8.0.0` and change to use ESLint v8. * update * update
1 parent dc48d1c commit 7bca4d3

File tree

9 files changed

+62
-22
lines changed

9 files changed

+62
-22
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
command: npm version
6363
- checkout
6464
- run:
65-
name: Install @typescript-eslint/parser@4
65+
name: Install eslint@7 and @typescript-eslint/parser@4
6666
command: |
67-
npm install @typescript-eslint/parser@^4
67+
npm install eslint@7 @typescript-eslint/parser@^4
6868
- run:
6969
name: Install dependencies
7070
command: npm install

docs/.eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
module.exports = {
4+
parserOptions: {
5+
sourceType: 'module'
6+
}
7+
}

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,16 @@ export default {
122122
123123
async mounted() {
124124
// Load linter.
125-
const [{ default: Linter }, { default: coreRules }, { parseForESLint }] =
126-
await Promise.all([
127-
import('eslint4b/dist/linter'),
128-
import('eslint4b/dist/core-rules'),
129-
import('espree').then(() => import('vue-eslint-parser'))
130-
])
125+
const [{ Linter }, { parseForESLint }] = await Promise.all([
126+
import('eslint/lib/linter'),
127+
import('espree').then(() => import('vue-eslint-parser'))
128+
])
131129
132130
const linter = (this.linter = new Linter())
133131
134132
for (const ruleId of Object.keys(rules)) {
135133
linter.defineRule(`vue/${ruleId}`, rules[ruleId])
136134
}
137-
linter.defineRule('no-undef', coreRules['no-undef'])
138-
linter.defineRule('no-unused-vars', coreRules['no-unused-vars'])
139135
140136
linter.defineParser('vue-eslint-parser', { parseForESLint })
141137
}

docs/.vuepress/config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,15 @@ module.exports = {
124124
resolve: {
125125
alias: {
126126
module: require.resolve('./shim/module'),
127-
eslint: path.resolve(__dirname, './shim/eslint')
127+
eslint$: require.resolve('./shim/eslint'),
128+
esquery: path.resolve(
129+
__dirname,
130+
'../../node_modules/esquery/dist/esquery.min.js'
131+
),
132+
'@eslint/eslintrc/universal': path.resolve(
133+
__dirname,
134+
'../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs'
135+
)
128136
}
129137
}
130138
}

docs/.vuepress/enhanceApp.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* globals window */
2+
export default (
3+
// eslint-disable-next-line no-empty-pattern
4+
{
5+
// Vue, // the version of Vue being used in the VuePress app
6+
// options, // the options for the root Vue instance
7+
// router, // the router instance for the app
8+
// siteData, // site metadata
9+
}
10+
) => {
11+
if (typeof window !== 'undefined') {
12+
if (typeof window.process === 'undefined') {
13+
window.process = new Proxy(
14+
{
15+
env: {},
16+
cwd: () => undefined
17+
},
18+
{
19+
get(target, name) {
20+
// For debug
21+
// console.log(name)
22+
return target[name]
23+
}
24+
}
25+
)
26+
}
27+
}
28+
}

docs/.vuepress/shim/eslint.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { Linter } = require('eslint/lib/linter')
2+
module.exports = {
3+
Linter
4+
}

docs/.vuepress/shim/eslint/index.js

-2
This file was deleted.

docs/.vuepress/shim/eslint/lib/rules/index.js

Whitespace-only changes.

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"node": ">=8.10"
5252
},
5353
"peerDependencies": {
54-
"eslint": "^6.2.0 || ^7.0.0 || ^8.0.0-0"
54+
"eslint": "^6.2.0 || ^7.0.0 || ^8.0.0"
5555
},
5656
"dependencies": {
5757
"eslint-utils": "^2.1.0",
@@ -60,7 +60,7 @@
6060
"vue-eslint-parser": "^7.10.0"
6161
},
6262
"devDependencies": {
63-
"@types/eslint": "^7.2.0",
63+
"@types/eslint": "^7.28.1",
6464
"@types/eslint-visitor-keys": "^1.0.0",
6565
"@types/natural-compare": "^1.4.0",
6666
"@types/node": "^13.13.5",
@@ -69,20 +69,19 @@
6969
"@vuepress/plugin-pwa": "^1.4.1",
7070
"acorn": "^8.5.0",
7171
"env-cmd": "^10.1.0",
72-
"eslint": "^7.0.0",
72+
"eslint": "^8.0.0",
7373
"eslint-config-prettier": "^6.11.0",
7474
"eslint-plugin-eslint-plugin": "^3.5.3",
7575
"eslint-plugin-import": "^2.20.2",
7676
"eslint-plugin-prettier": "^3.1.3",
7777
"eslint-plugin-vue": "file:.",
78-
"eslint4b": "^7.0.0",
7978
"espree": "^9.0.0",
80-
"lodash": "^4.17.15",
79+
"lodash": "^4.17.21",
8180
"mocha": "^7.1.2",
82-
"nyc": "^15.0.1",
83-
"prettier": "^2.1.1",
84-
"typescript": "^4.3.4",
81+
"nyc": "^15.1.0",
82+
"prettier": "^2.4.1",
83+
"typescript": "^4.4.3",
8584
"vue-eslint-editor": "^1.1.0",
86-
"vuepress": "^1.4.1"
85+
"vuepress": "^1.8.2"
8786
}
8887
}

0 commit comments

Comments
 (0)