8000 chore: update to ESLint 9 by haoqunjiang · Pull Request #10705 · vuejs/core · GitHub
[go: up one dir, main page]

Skip to content

chore: update to ESLint 9 #10705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: migrate from eslint-plugin-jest to eslint-plugin-vitest
Also updates the lint-staged config.
Because it doesn't support the shell convention of expanding environment
variables, I had to add the `cross-env` package.

https://github.com/lint-staged/lint-staged#use-environment-variables-with-linting-commands
  • Loading branch information
haoqunjiang committed Apr 15, 2024
commit bc26bb4931e841679e7018b7087ca2e3d255957e
8 changes: 4 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
parserOptions: {
sourceType: 'module',
},
plugins: ['jest', 'import-x', '@typescript-eslint'],
plugins: ['vitest', 'import-x', '@typescript-eslint'],
rules: {
'no-debugger': 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
Expand Down Expand Up @@ -65,15 +65,15 @@ module.exports = {
'@typescript-eslint/no-import-type-side-effects': 'error',
},
overrides: [
// tests, no restrictions (runs in Node / jest with jsdom)
// tests, no restrictions (runs in Node / Vitest with jsdom)
{
files: ['**/__tests__/**', 'packages/dts-test/**'],
rules: {
'no-console': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'vitest/no-disabled-tests': 'error',
'vitest/no-focused-tests': 'error',
},
},
// shared, may be used in any env
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"prettier --write"
],
"*.ts?(x)": [
"eslint --fix",
"cross-env ESLINT_USE_FLAT_CONFIG=false eslint --fix",
"prettier --parser=typescript --write"
]
},
Expand All @@ -77,13 +77,14 @@
"@vitest/coverage-istanbul": "^1.4.0",
"@vue/consolidate": "1.0.0",
"conventional-changelog-cli": "^4.1.0",
"cross-env": "^7.0.3",
"enquirer": "^2.4.1",
"esbuild": "^0.20.2",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^9.0.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-import-x": "^0.5.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-vitest": "^0.5.3",
"estree-walker": "^2.0.2",
"execa": "^8.0.1",
"jsdom": "^24.0.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/compiler-core/__tests__/parse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
import { baseParse } from '../src/parser'
import type { Program } from '@babel/types'

/* eslint jest/no-disabled-tests: "off" */

describe('compiler: parse', () => {
describe('Text', () => {
test('simple text', () => {
Expand Down
162 changes: 80 additions & 82 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0