Skip to content

Commit

Permalink
Change peer deps eslint ver from ^6.2.0 || ^7.0.0 || ^8.0.0-0 to `^…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
ota-meshi committed Oct 12, 2021
1 parent dc48d1c commit 7bca4d3
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/.eslintrc.js
@@ -0,0 +1,7 @@
'use strict'

module.exports = {
parserOptions: {
sourceType: 'module'
}
}
12 changes: 4 additions & 8 deletions docs/.vuepress/components/eslint-code-block.vue
Expand Up @@ -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 })
}
Expand Down
10 changes: 9 additions & 1 deletion docs/.vuepress/config.js
Expand Up @@ -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'
)
}
}
}
Expand Down
28 changes: 28 additions & 0 deletions 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]
}
}
)
}
}
}
4 changes: 4 additions & 0 deletions docs/.vuepress/shim/eslint.js
@@ -0,0 +1,4 @@
const { Linter } = require('eslint/lib/linter')
module.exports = {
Linter
}
2 changes: 0 additions & 2 deletions docs/.vuepress/shim/eslint/index.js

This file was deleted.

Empty file.
17 changes: 8 additions & 9 deletions package.json
Expand Up @@ -51,7 +51,7 @@
"node": ">=8.10"
},
"peerDependencies": {
"eslint": "^6.2.0 || ^7.0.0 || ^8.0.0-0"
"eslint": "^6.2.0 || ^7.0.0 || ^8.0.0"
},
"dependencies": {
"eslint-utils": "^2.1.0",
Expand All @@ -60,7 +60,7 @@
"vue-eslint-parser": "^7.10.0"
},
"devDependencies": {
"@types/eslint": "^7.2.0",
"@types/eslint": "^7.28.1",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/natural-compare": "^1.4.0",
"@types/node": "^13.13.5",
Expand All @@ -69,20 +69,19 @@
"@vuepress/plugin-pwa": "^1.4.1",
"acorn": "^8.5.0",
"env-cmd": "^10.1.0",
"eslint": "^7.0.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-plugin": "^3.5.3",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "file:.",
"eslint4b": "^7.0.0",
"espree": "^9.0.0",
"lodash": "^4.17.15",
"lodash": "^4.17.21",
"mocha": "^7.1.2",
"nyc": "^15.0.1",
"prettier": "^2.1.1",
"typescript": "^4.3.4",
"nyc": "^15.1.0",
"prettier": "^2.4.1",
"typescript": "^4.4.3",
"vue-eslint-editor": "^1.1.0",
"vuepress": "^1.4.1"
"vuepress": "^1.8.2"
}
}

0 comments on commit 7bca4d3

Please sign in to comment.