@amedia/eslint-config-vitest 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +24 -2
- package/index.js +29 -0
- package/package.json +38 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @amedia/eslint-config-vitest
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 0e94998: Support Vitest and deprecate Jest. Most projects have moved to Vitest or the
|
|
8
|
+
Node.js test runner.
|
|
9
|
+
|
|
10
|
+
- Add `@amedia/eslint-config-vitest`, which bundles `@vitest/eslint-plugin`
|
|
11
|
+
with the same rules as the Jest config. It applies to `*.test.*` and
|
|
12
|
+
`*.spec.*` files in JavaScript and TypeScript, and declares the Vitest
|
|
13
|
+
globals for projects that run Vitest with `globals: true`.
|
|
14
|
+
- Add a `vitest` toggle to `eslintConfig`. Kragl turns it on when the
|
|
15
|
+
project depends on `vitest`, in both `kragl install` and the fallback
|
|
16
|
+
config.
|
|
17
|
+
- In `@amedia/biome-config`, apply the test-file override to TypeScript and
|
|
18
|
+
JSX tests too, and add the Vitest globals.
|
|
19
|
+
- Deprecate `@amedia/kragl-jest`, `@amedia/jest-config`,
|
|
20
|
+
`@amedia/eslint-config-jest` and the `jest` toggle. `kragl-jest` now
|
|
21
|
+
prints a deprecation warning when it runs. The Node.js test runner needs
|
|
22
|
+
no lint toggle, because `node:test` is imported like any other module.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @amedia/eslint-config-vitest
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ESLint flat config for Vitest test files. Bundles `@vitest/eslint-plugin`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --save-dev @amedia/eslint-config-vitest eslint
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
// eslint.config.js
|
|
15
|
+
import vitest from '@amedia/eslint-config-vitest';
|
|
16
|
+
|
|
17
|
+
export default [...vitest];
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
Requires Node 22+ and ESLint 10. Applies to `*.test.*` and `*.spec.*` files
|
|
23
|
+
and declares the Vitest globals, so projects running Vitest with
|
|
24
|
+
`globals: true` lint cleanly. Usually consumed via
|
|
25
|
+
[`@amedia/eslint-config`](../eslint-config) with `eslintConfig({ vitest: true })`.
|
package/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import vitest from '@vitest/eslint-plugin';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
files: ['**/*.{spec,test}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'],
|
|
6
|
+
plugins: { vitest },
|
|
7
|
+
languageOptions: {
|
|
8
|
+
// For projects that run Vitest with `globals: true`
|
|
9
|
+
globals: vitest.environments.env.globals,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
'vitest/consistent-test-it': [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
fn: 'it',
|
|
16
|
+
withinDescribe: 'it',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
'vitest/expect-expect': 'error',
|
|
20
|
+
'vitest/no-disabled-tests': 'warn',
|
|
21
|
+
'vitest/no-focused-tests': 'warn',
|
|
22
|
+
'vitest/no-identical-title': 'error',
|
|
23
|
+
'vitest/no-large-snapshots': ['warn', { maxSize: 300 }],
|
|
24
|
+
'vitest/prefer-strict-equal': 'error',
|
|
25
|
+
'vitest/prefer-to-have-length': 'error',
|
|
26
|
+
'vitest/valid-expect': 'error',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amedia/eslint-config-vitest",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ESLint configuration to be used by developers at Amedia",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"scripts": {},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/amedia/eslint-config-amedia.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"eslint",
|
|
19
|
+
"eslint-config",
|
|
20
|
+
"vitest"
|
|
21
|
+
],
|
|
22
|
+
"author": "Amedia",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/amedia/eslint-config-amedia/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/amedia/eslint-config-amedia#readme",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"eslint": "10.12.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@vitest/eslint-plugin": "1.6.27"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22"
|
|
39
|
+
}
|
|
40
|
+
}
|