Skip to content

Commit 99ca23b

Browse files
committed
test(lint): switch to eslint 9 and antfu config
1 parent f2578cb commit 99ca23b

File tree

170 files changed

+3944
-1879
lines changed

Some content is hidden

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

170 files changed

+3944
-1879
lines changed

.github/workflows/pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Check PR title"
1+
name: Check PR title
22

33
on:
44
pull_request_target:

.github/workflows/release-notes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Create release
33
on:
44
push:
55
tags:
6-
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
77

88
jobs:
99
build:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
node_modules/
33
dist/
44
cache/
5+
.eslintcache

eslint.config.mjs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// eslint.config.mjs
2+
import antfu from '@antfu/eslint-config'
3+
4+
export default antfu({
5+
ignores: [
6+
'node_modules/',
7+
'dist/',
8+
'generated/',
9+
'!.*',
10+
'schema.graphql',
11+
'.test-todo/',
12+
'**/types/test/',
13+
],
14+
15+
rules: {
16+
'ts/no-use-before-define': 'warn',
17+
'unused-imports/no-unused-vars': 'warn',
18+
'accessor-pairs': 'off',
19+
},
20+
}, {
21+
files: [
22+
'packages/docs/**',
23+
],
24+
rules: {
25+
'no-dupe-keys': 'off',
26+
'no-new': 'off',
27+
'no-console': 'off',
28+
},
29+
}, {
30+
files: [
31+
'packages/test-*/**',
32+
'**/*.test.*',
33+
],
34+
rules: {
35+
'antfu/no-top-level-await': 'off',
36+
'no-console': 'off',
37+
'unused-imports/no-unused-vars': 'off',
38+
'node/prefer-global/process': 'off',
39+
'import/no-mutable-exports': 'off',
40+
},
41+
42+
languageOptions: {
43+
globals: {
44+
cy: false,
45+
expect: false,
46+
describe: false,
47+
it: false,
48+
before: false,
49+
},
50+
},
51+
}, {
52+
files: [
53+
'**/tests/types/**',
54+
],
55+
rules: {
56+
'ts/no-unused-expressions': 'off',
57+
},
58+
})

.eslintrc.js renamed to meow.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ module.exports = {
3737
'@typescript-eslint/no-use-before-define': 'off',
3838
'comma-dangle': ['error', 'always-multiline'],
3939
'vue/no-multiple-template-root': 'off',
40-
indent: 'off',
40+
'indent': 'off',
4141
'@typescript-eslint/indent': ['error', 2],
42-
quotes: ['error', 'single', { allowTemplateLiterals: true }],
42+
'quotes': ['error', 'single', { allowTemplateLiterals: true }],
4343
'no-use-before-define': 'warn',
4444
'accessor-pairs': 'off',
4545
'no-async-promise-executor': 'off',
@@ -73,7 +73,7 @@ module.exports = {
7373
'packages/*/types/test/**/*.ts',
7474
],
7575
rules: {
76-
camelcase: 'off',
76+
'camelcase': 'off',
7777
'no-unused-expressions': 'off',
7878
'array-callback-return': 'warn',
7979
},

package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
"name": "vue-apollo-monorepo",
33
"version": "4.2.1",
44
"private": true,
5+
"packageManager": "[email protected]+sha512.40ee09af407fa9fbb5fbfb8e1cb40fbb74c0af0c3e10e9224d7b53c7658528615b2c92450e74cfad91e3a2dcafe3ce4050d80bda71d757756d2ce2b66213e9a3",
56
"scripts": {
67
"build": "pnpm run -r --filter \"vue-apollo*\" --filter \"@vue/apollo*\" build",
78
"test": "pnpm run -r --sequential test",
89
"test:unit": "pnpm run -r test:unit",
910
"test:types": "pnpm run -r test:types",
10-
"lint": "eslint . --ext js,vue,ts",
11+
"lint": "eslint . --cache",
1112
"release": "pnpm run build && pnpm run test && sheep release -b v4",
1213
"docs:dev": "pnpm run -r --filter \"private-vue-apollo-docs\" dev"
1314
},
14-
"resolutions": {
15-
"js-yaml": "^3.13.1"
16-
},
1715
"devDependencies": {
1816
"@akryum/sheep": "^0.5.1",
17+
"@antfu/eslint-config": "^4.7.0",
1918
"@typescript-eslint/eslint-plugin": "^4.33.0",
2019
"@typescript-eslint/parser": "^4.33.0",
2120
"@vue/eslint-config-standard": "^6.1.0",
@@ -24,15 +23,9 @@
2423
"core-js": "^3.23.2",
2524
"esbuild": "^0.25.0",
2625
"esbuild-node-externals": "^1.18.0",
27-
"eslint": "^7.32.0",
28-
"eslint-plugin-import": "^2.26.0",
29-
"eslint-plugin-node": "^11.1.0",
30-
"eslint-plugin-promise": "^4.3.1",
31-
"eslint-plugin-standard": "^5.0.0",
32-
"eslint-plugin-vue": "^7.20.0",
26+
"eslint": "^9.21.0",
3327
"typescript": "^5.8.2"
3428
},
35-
"packageManager": "[email protected]+sha512.40ee09af407fa9fbb5fbfb8e1cb40fbb74c0af0c3e10e9224d7b53c7658528615b2c92450e74cfad91e3a2dcafe3ce4050d80bda71d757756d2ce2b66213e9a3",
3629
"pnpm": {
3730
"overrides": {
3831
"eslint-scope": "^5",
@@ -58,5 +51,8 @@
5851
"vue": "*"
5952
}
6053
}
54+
},
55+
"resolutions": {
56+
"js-yaml": "^3.13.1"
6157
}
6258
}

packages/docs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "private-vue-apollo-docs",
3+
"type": "module",
34
"version": "4.0.0-alpha.16",
45
"private": true,
5-
"type": "module",
66
"scripts": {
77
"dev": "vitepress dev src",
88
"build": "vitepress build src"
99
},
10-
"devDependencies": {
11-
"vitepress": "^1.0.0-rc.36"
12-
},
1310
"dependencies": {
1411
"vue-github-button": "^3.0.3"
12+
},
13+
"devDependencies": {
14+
"vitepress": "^1.0.0-rc.36"
1515
}
1616
}

packages/docs/src/.vitepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default defineConfig({
327327
},
328328

329329
locales: {
330-
root: {
330+
'root': {
331331
label: 'English',
332332
lang: 'en-US',
333333
title: 'Vue Apollo',

packages/docs/src/.vitepress/theme/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import './styles/index.pcss'
55

66
export default {
77
...DefaultTheme,
8-
enhanceApp ({ app }) {
8+
enhanceApp({ app }) {
99
app.component('SponsorButton', SponsorButton)
1010
},
1111
}

packages/docs/src/api/apollo-mutation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ See [apollo context](https://www.apollographql.com/docs/react/api/link/apollo-li
209209
Signature:
210210

211211
```ts
212-
mutate(options = null): Promise<FetchResult>
212+
function mutate(options = null): Promise<FetchResult>
213213
```
214214

215215
- `options`: [mutation options](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.mutate).

0 commit comments

Comments
 (0)