@dfinity/eslint-config-oisy-wallet 0.1.5 → 0.1.6
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/README.md +30 -1
- package/configs/eslint.rules.mjs +6 -1
- package/package.json +7 -1
- package/svelte.mjs +1 -0
- package/vitest.mjs +9 -0
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ module.exports = {
|
|
|
36
36
|
};
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
For Svelte Projects:
|
|
39
|
+
For [Svelte](https://svelte.dev/) Projects:
|
|
40
40
|
|
|
41
41
|
1. Create an `.eslintrc.js` file in your project root and extend the Svelte-specific configuration:
|
|
42
42
|
|
|
@@ -46,6 +46,35 @@ module.exports = {
|
|
|
46
46
|
};
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
For [vitest](https://vitest.dev/) test suites:
|
|
50
|
+
|
|
51
|
+
1. Create an `.eslintrc.js` file in your project root and extend the vitest-specific configuration:
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
module.exports = {
|
|
55
|
+
extends: ["@dfinity/eslint-config-oisy-wallet/vitest"],
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. If the rules must apply ONLY to test files, they can be configured as:
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
module.exports = {
|
|
63
|
+
overrides: [
|
|
64
|
+
{
|
|
65
|
+
// Specify the test files and/or folders
|
|
66
|
+
files: [
|
|
67
|
+
"**/*.test.{ts,js}",
|
|
68
|
+
"**/*.spec.{ts,js}",
|
|
69
|
+
"**/tests/**/*.{ts,js}",
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
extends: ["@dfinity/eslint-config-oisy-wallet/vitest"],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
49
78
|
Finally, create an `eslint-local-rules.cjs` file at the root of your project containing the following:
|
|
50
79
|
|
|
51
80
|
```javascript
|
package/configs/eslint.rules.mjs
CHANGED
|
@@ -29,7 +29,12 @@ export const eslintRules = [
|
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
rules: {
|
|
32
|
-
"@typescript-eslint/consistent-type-
|
|
32
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
33
|
+
"error",
|
|
34
|
+
{
|
|
35
|
+
fixStyle: "separate-type-imports",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
33
38
|
|
|
34
39
|
// TODO: Disabled for now to allow the migration of ESLint v9 in OISY, as the rule is not yet enforced.
|
|
35
40
|
// It should also be introduced as an optional rule.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/eslint-config-oisy-wallet",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Shared ESLint configurations from the Oisy Wallet team",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"LICENSE",
|
|
17
17
|
"index.mjs",
|
|
18
18
|
"svelte.mjs",
|
|
19
|
+
"vitest.mjs",
|
|
19
20
|
"configs",
|
|
20
21
|
"eslint-local-rules.cjs",
|
|
21
22
|
"rules/**/*.cjs"
|
|
@@ -29,6 +30,10 @@
|
|
|
29
30
|
"import": "./svelte.mjs",
|
|
30
31
|
"require": "./svelte.mjs"
|
|
31
32
|
},
|
|
33
|
+
"./vitest": {
|
|
34
|
+
"import": "./vitest.mjs",
|
|
35
|
+
"require": "./vitest.mjs"
|
|
36
|
+
},
|
|
32
37
|
"./eslint-local-rules": {
|
|
33
38
|
"import": "./eslint-local-rules.cjs",
|
|
34
39
|
"require": "./eslint-local-rules.cjs"
|
|
@@ -62,6 +67,7 @@
|
|
|
62
67
|
"@eslint/eslintrc": "^3.2.0",
|
|
63
68
|
"@eslint/js": "^9.20.0",
|
|
64
69
|
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
70
|
+
"@vitest/eslint-plugin": "^1.1.39",
|
|
65
71
|
"eslint": "^9.20.1",
|
|
66
72
|
"eslint-config-love": "^118.0.0",
|
|
67
73
|
"eslint-config-prettier": "^10.0.1",
|
package/svelte.mjs
CHANGED
package/vitest.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import vitest from "@vitest/eslint-plugin";
|
|
2
|
+
import { languageOptions } from "./configs/eslint.language.mjs";
|
|
3
|
+
import { eslintCoreConfig } from "./configs/eslint.core.mjs";
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
...eslintCoreConfig,
|
|
7
|
+
...vitest.configs.recommended,
|
|
8
|
+
languageOptions(),
|
|
9
|
+
];
|