ultracite 7.3.0 → 7.3.1
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 +4 -0
- package/config/biome/core/biome.jsonc +9 -16
- package/config/biome/jest/biome.jsonc +21 -0
- package/config/biome/type-aware/biome.jsonc +19 -0
- package/config/biome/vitest/biome.jsonc +21 -0
- package/config/eslint/angular/eslint.config.mjs +1 -0
- package/config/eslint/astro/eslint.config.mjs +1 -0
- package/config/eslint/astro/rules/astro.mjs +1 -3
- package/config/eslint/core/eslint.config.mjs +21 -38
- package/config/eslint/core/rules/eslint-typescript.mjs +1 -1
- package/config/eslint/core/rules/eslint.mjs +1 -1
- package/config/eslint/core/rules/import.mjs +17 -17
- package/config/eslint/core/rules/n.mjs +2 -2
- package/config/eslint/core/rules/storybook.mjs +1 -3
- package/config/eslint/core/rules/typescript.mjs +20 -21
- package/config/eslint/core/rules/unicorn.mjs +2 -2
- package/config/eslint/jest/eslint.config.mjs +25 -0
- package/config/eslint/next/eslint.config.mjs +1 -0
- package/config/eslint/qwik/eslint.config.mjs +1 -0
- package/config/eslint/react/eslint.config.mjs +4 -3
- package/config/eslint/react/rules/jsx-a11y.mjs +2 -2
- package/config/eslint/react/rules/query.mjs +1 -3
- package/config/eslint/react/rules/react.mjs +7 -7
- package/config/eslint/remix/eslint.config.mjs +1 -0
- package/config/eslint/solid/eslint.config.mjs +1 -0
- package/config/eslint/svelte/eslint.config.mjs +1 -0
- package/config/eslint/vitest/eslint.config.mjs +19 -0
- package/config/eslint/vitest/rules/vitest.mjs +36 -0
- package/config/eslint/vue/eslint.config.mjs +1 -0
- package/config/oxlint/core/.oxlintrc.json +7 -65
- package/config/oxlint/jest/.oxlintrc.json +74 -0
- package/config/oxlint/vitest/.oxlintrc.json +65 -0
- package/config/prettier/prettier.config.mjs +6 -6
- package/config/stylelint/stylelint.config.mjs +3 -3
- package/dist/index.js +114 -114
- package/package.json +36 -35
- /package/config/eslint/{core → jest}/rules/jest.mjs +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable n/no-unpublished-import, n/no-extraneous-import, import/no-extraneous-dependencies, id-length */
|
|
2
|
+
|
|
3
|
+
import vitest from "@vitest/eslint-plugin";
|
|
4
|
+
|
|
5
|
+
import vitestRules from "./rules/vitest.mjs";
|
|
6
|
+
|
|
7
|
+
const config = [
|
|
8
|
+
{
|
|
9
|
+
files: ["**/*.test.{js,ts,jsx,tsx}", "tests/**/*.{js,ts,jsx,tsx}"],
|
|
10
|
+
plugins: {
|
|
11
|
+
vitest,
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
...vitestRules,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default config;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import plugin from "@vitest/eslint-plugin";
|
|
2
|
+
|
|
3
|
+
const { rules } = plugin;
|
|
4
|
+
|
|
5
|
+
const availableKeys = Object.keys(rules).filter(
|
|
6
|
+
(key) => !rules[key].meta.deprecated
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
const baseRules = Object.fromEntries(
|
|
10
|
+
availableKeys.map((key) => [`vitest/${key}`, "error"])
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const overrideRules = {
|
|
14
|
+
// Too strict — matching oxlint jest disabled rules
|
|
15
|
+
"vitest/no-conditional-in-test": "off",
|
|
16
|
+
"vitest/no-hooks": "off",
|
|
17
|
+
|
|
18
|
+
// Project-specific — depends on vitest globals config
|
|
19
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
20
|
+
|
|
21
|
+
// Conflicts with prefer-called-once (the original #604 issue)
|
|
22
|
+
"vitest/prefer-called-times": "off",
|
|
23
|
+
|
|
24
|
+
// Too strict for general use
|
|
25
|
+
"vitest/prefer-expect-assertions": "off",
|
|
26
|
+
"vitest/prefer-importing-vitest-globals": "off",
|
|
27
|
+
"vitest/prefer-to-have-been-called-times": "off",
|
|
28
|
+
|
|
29
|
+
// Too strict — matching oxlint jest disabled rules
|
|
30
|
+
"vitest/require-hook": "off",
|
|
31
|
+
"vitest/require-test-timeout": "off",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const config = Object.assign(baseRules, overrideRules);
|
|
35
|
+
|
|
36
|
+
export default config;
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"sort-imports": "off",
|
|
51
51
|
"no-duplicate-imports": ["error", { "allowSeparateTypeImports": true }],
|
|
52
52
|
|
|
53
|
+
"import/no-relative-parent-imports": "off",
|
|
53
54
|
"import/no-default-export": "off",
|
|
54
55
|
"import/exports-last": "off",
|
|
55
56
|
"import/no-named-export": "off",
|
|
@@ -98,76 +99,17 @@
|
|
|
98
99
|
},
|
|
99
100
|
"overrides": [
|
|
100
101
|
{
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
// so each rule must be listed explicitly.
|
|
102
|
+
// Shared test file overrides — framework-specific test rules
|
|
103
|
+
// are in separate jest/ and vitest/ configs to avoid conflicts.
|
|
104
104
|
"files": [
|
|
105
105
|
"**/*.{test,spec}.{ts,tsx,js,jsx}",
|
|
106
106
|
"**/__tests__/**/*.{ts,tsx,js,jsx}"
|
|
107
107
|
],
|
|
108
|
-
"plugins": ["jest", "vitest"],
|
|
109
108
|
"rules": {
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
"jest/no-alias-methods": "error",
|
|
115
|
-
"jest/no-commented-out-tests": "error",
|
|
116
|
-
"jest/no-conditional-expect": "error",
|
|
117
|
-
"jest/no-conditional-in-test": "error",
|
|
118
|
-
"jest/no-confusing-set-timeout": "error",
|
|
119
|
-
"jest/no-deprecated-functions": "error",
|
|
120
|
-
"jest/no-disabled-tests": "error",
|
|
121
|
-
"jest/no-done-callback": "error",
|
|
122
|
-
"jest/no-duplicate-hooks": "error",
|
|
123
|
-
"jest/no-export": "error",
|
|
124
|
-
"jest/no-focused-tests": "error",
|
|
125
|
-
"jest/no-hooks": "error",
|
|
126
|
-
"jest/no-identical-title": "error",
|
|
127
|
-
"jest/no-interpolation-in-snapshots": "error",
|
|
128
|
-
"jest/no-jasmine-globals": "error",
|
|
129
|
-
"jest/no-large-snapshots": "error",
|
|
130
|
-
"jest/no-mocks-import": "error",
|
|
131
|
-
"jest/no-restricted-jest-methods": "error",
|
|
132
|
-
"jest/no-restricted-matchers": "error",
|
|
133
|
-
"jest/no-standalone-expect": "error",
|
|
134
|
-
"jest/no-test-prefixes": "error",
|
|
135
|
-
"jest/no-test-return-statement": "error",
|
|
136
|
-
"jest/no-untyped-mock-factory": "error",
|
|
137
|
-
"jest/padding-around-test-blocks": "error",
|
|
138
|
-
"jest/prefer-called-with": "error",
|
|
139
|
-
"jest/prefer-comparison-matcher": "error",
|
|
140
|
-
"jest/prefer-each": "error",
|
|
141
|
-
"jest/prefer-equality-matcher": "error",
|
|
142
|
-
"jest/prefer-expect-resolves": "error",
|
|
143
|
-
"jest/prefer-hooks-in-order": "error",
|
|
144
|
-
"jest/prefer-hooks-on-top": "error",
|
|
145
|
-
"jest/prefer-jest-mocked": "error",
|
|
146
|
-
"jest/prefer-lowercase-title": "error",
|
|
147
|
-
"jest/prefer-mock-promise-shorthand": "error",
|
|
148
|
-
"jest/prefer-spy-on": "error",
|
|
149
|
-
"jest/prefer-strict-equal": "error",
|
|
150
|
-
"jest/prefer-to-be": "error",
|
|
151
|
-
"jest/prefer-to-contain": "error",
|
|
152
|
-
"jest/prefer-to-have-been-called": "error",
|
|
153
|
-
"jest/prefer-to-have-been-called-times": "error",
|
|
154
|
-
"jest/prefer-to-have-length": "error",
|
|
155
|
-
"jest/prefer-todo": "error",
|
|
156
|
-
"jest/require-hook": "error",
|
|
157
|
-
"jest/require-to-throw-message": "error",
|
|
158
|
-
"jest/require-top-level-describe": "error",
|
|
159
|
-
"jest/valid-describe-callback": "error",
|
|
160
|
-
"jest/valid-expect": "error",
|
|
161
|
-
"jest/valid-title": "error",
|
|
162
|
-
"vitest/consistent-test-filename": "error",
|
|
163
|
-
"vitest/consistent-vitest-vi": "error",
|
|
164
|
-
"vitest/no-conditional-tests": "error",
|
|
165
|
-
"vitest/no-import-node-test": "error",
|
|
166
|
-
"vitest/prefer-to-be-falsy": "error",
|
|
167
|
-
"vitest/prefer-to-be-object": "error",
|
|
168
|
-
"vitest/prefer-to-be-truthy": "error",
|
|
169
|
-
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
170
|
-
"vitest/warn-todo": "error"
|
|
109
|
+
// Disabled: mock callbacks often need empty functions
|
|
110
|
+
"no-empty-function": "off",
|
|
111
|
+
// Disabled: mock factories use Promise.resolve/reject (conflicts with require-await)
|
|
112
|
+
"promise/prefer-await-to-then": "off"
|
|
171
113
|
}
|
|
172
114
|
}
|
|
173
115
|
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"overrides": [
|
|
4
|
+
{
|
|
5
|
+
"files": [
|
|
6
|
+
"**/*.{test,spec}.{ts,tsx,js,jsx}",
|
|
7
|
+
"**/__tests__/**/*.{ts,tsx,js,jsx}"
|
|
8
|
+
],
|
|
9
|
+
"plugins": ["jest"],
|
|
10
|
+
"rules": {
|
|
11
|
+
// Disabled: bun:test mock.module() must be called at top level
|
|
12
|
+
"jest/require-hook": "off",
|
|
13
|
+
// Disabled: mock factories use conditionals for path-based routing
|
|
14
|
+
"jest/no-conditional-in-test": "off",
|
|
15
|
+
// Disabled: bun:test uses beforeEach hooks for mock.restore()
|
|
16
|
+
"jest/no-hooks": "off",
|
|
17
|
+
// Disabled: bun:test mock factories return Promise.resolve/reject
|
|
18
|
+
"promise/prefer-await-to-then": "off",
|
|
19
|
+
// Disabled: mock callbacks often need empty functions
|
|
20
|
+
"no-empty-function": "off",
|
|
21
|
+
|
|
22
|
+
"jest/consistent-test-it": "error",
|
|
23
|
+
"jest/expect-expect": "error",
|
|
24
|
+
"jest/max-expects": "error",
|
|
25
|
+
"jest/max-nested-describe": "error",
|
|
26
|
+
"jest/no-alias-methods": "error",
|
|
27
|
+
"jest/no-commented-out-tests": "error",
|
|
28
|
+
"jest/no-conditional-expect": "error",
|
|
29
|
+
"jest/no-confusing-set-timeout": "error",
|
|
30
|
+
"jest/no-deprecated-functions": "error",
|
|
31
|
+
"jest/no-disabled-tests": "error",
|
|
32
|
+
"jest/no-done-callback": "error",
|
|
33
|
+
"jest/no-duplicate-hooks": "error",
|
|
34
|
+
"jest/no-export": "error",
|
|
35
|
+
"jest/no-focused-tests": "error",
|
|
36
|
+
"jest/no-identical-title": "error",
|
|
37
|
+
"jest/no-interpolation-in-snapshots": "error",
|
|
38
|
+
"jest/no-jasmine-globals": "error",
|
|
39
|
+
"jest/no-large-snapshots": "error",
|
|
40
|
+
"jest/no-mocks-import": "error",
|
|
41
|
+
"jest/no-restricted-jest-methods": "error",
|
|
42
|
+
"jest/no-restricted-matchers": "error",
|
|
43
|
+
"jest/no-standalone-expect": "error",
|
|
44
|
+
"jest/no-test-prefixes": "error",
|
|
45
|
+
"jest/no-test-return-statement": "error",
|
|
46
|
+
"jest/no-untyped-mock-factory": "error",
|
|
47
|
+
"jest/padding-around-test-blocks": "error",
|
|
48
|
+
"jest/prefer-called-with": "error",
|
|
49
|
+
"jest/prefer-comparison-matcher": "error",
|
|
50
|
+
"jest/prefer-each": "error",
|
|
51
|
+
"jest/prefer-equality-matcher": "error",
|
|
52
|
+
"jest/prefer-expect-resolves": "error",
|
|
53
|
+
"jest/prefer-hooks-in-order": "error",
|
|
54
|
+
"jest/prefer-hooks-on-top": "error",
|
|
55
|
+
"jest/prefer-jest-mocked": "error",
|
|
56
|
+
"jest/prefer-lowercase-title": "error",
|
|
57
|
+
"jest/prefer-mock-promise-shorthand": "error",
|
|
58
|
+
"jest/prefer-spy-on": "error",
|
|
59
|
+
"jest/prefer-strict-equal": "error",
|
|
60
|
+
"jest/prefer-to-be": "error",
|
|
61
|
+
"jest/prefer-to-contain": "error",
|
|
62
|
+
"jest/prefer-to-have-been-called": "error",
|
|
63
|
+
"jest/prefer-to-have-been-called-times": "error",
|
|
64
|
+
"jest/prefer-to-have-length": "error",
|
|
65
|
+
"jest/prefer-todo": "error",
|
|
66
|
+
"jest/require-to-throw-message": "error",
|
|
67
|
+
"jest/require-top-level-describe": "error",
|
|
68
|
+
"jest/valid-describe-callback": "error",
|
|
69
|
+
"jest/valid-expect": "error",
|
|
70
|
+
"jest/valid-title": "error"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"overrides": [
|
|
4
|
+
{
|
|
5
|
+
"files": [
|
|
6
|
+
"**/*.{test,spec}.{ts,tsx,js,jsx}",
|
|
7
|
+
"**/__tests__/**/*.{ts,tsx,js,jsx}"
|
|
8
|
+
],
|
|
9
|
+
"plugins": ["vitest"],
|
|
10
|
+
"rules": {
|
|
11
|
+
// Disabled: mock callbacks often need empty functions
|
|
12
|
+
"no-empty-function": "off",
|
|
13
|
+
// Disabled: mock factories use Promise.resolve/reject (conflicts with require-await)
|
|
14
|
+
"promise/prefer-await-to-then": "off",
|
|
15
|
+
|
|
16
|
+
"vitest/consistent-test-filename": "error",
|
|
17
|
+
"vitest/consistent-vitest-vi": "error",
|
|
18
|
+
"vitest/expect-expect": "error",
|
|
19
|
+
"vitest/no-alias-methods": "error",
|
|
20
|
+
"vitest/no-commented-out-tests": "error",
|
|
21
|
+
"vitest/no-conditional-expect": "error",
|
|
22
|
+
"vitest/no-conditional-tests": "error",
|
|
23
|
+
"vitest/no-disabled-tests": "error",
|
|
24
|
+
"vitest/no-done-callback": "error",
|
|
25
|
+
"vitest/no-duplicate-hooks": "error",
|
|
26
|
+
"vitest/no-focused-tests": "error",
|
|
27
|
+
"vitest/no-identical-title": "error",
|
|
28
|
+
"vitest/no-import-node-test": "error",
|
|
29
|
+
"vitest/no-interpolation-in-snapshots": "error",
|
|
30
|
+
"vitest/no-large-snapshots": "error",
|
|
31
|
+
"vitest/no-mocks-import": "error",
|
|
32
|
+
"vitest/no-restricted-matchers": "error",
|
|
33
|
+
"vitest/no-restricted-vi-methods": "error",
|
|
34
|
+
"vitest/no-standalone-expect": "error",
|
|
35
|
+
"vitest/no-test-prefixes": "error",
|
|
36
|
+
"vitest/no-test-return-statement": "error",
|
|
37
|
+
"vitest/prefer-called-with": "error",
|
|
38
|
+
"vitest/prefer-comparison-matcher": "error",
|
|
39
|
+
"vitest/prefer-each": "error",
|
|
40
|
+
"vitest/prefer-equality-matcher": "error",
|
|
41
|
+
"vitest/prefer-expect-resolves": "error",
|
|
42
|
+
"vitest/prefer-hooks-in-order": "error",
|
|
43
|
+
"vitest/prefer-hooks-on-top": "error",
|
|
44
|
+
"vitest/prefer-lowercase-title": "error",
|
|
45
|
+
"vitest/prefer-mock-promise-shorthand": "error",
|
|
46
|
+
"vitest/prefer-spy-on": "error",
|
|
47
|
+
"vitest/prefer-strict-equal": "error",
|
|
48
|
+
"vitest/prefer-to-be": "error",
|
|
49
|
+
"vitest/prefer-to-be-falsy": "error",
|
|
50
|
+
"vitest/prefer-to-be-object": "error",
|
|
51
|
+
"vitest/prefer-to-be-truthy": "error",
|
|
52
|
+
"vitest/prefer-to-contain": "error",
|
|
53
|
+
"vitest/prefer-to-have-length": "error",
|
|
54
|
+
"vitest/prefer-todo": "error",
|
|
55
|
+
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
56
|
+
"vitest/require-to-throw-message": "error",
|
|
57
|
+
"vitest/require-top-level-describe": "error",
|
|
58
|
+
"vitest/valid-describe-callback": "error",
|
|
59
|
+
"vitest/valid-expect": "error",
|
|
60
|
+
"vitest/valid-title": "error",
|
|
61
|
+
"vitest/warn-todo": "error"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @type {import('prettier').Config} */
|
|
2
2
|
const config = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
arrowParens: "always",
|
|
4
|
+
bracketSpacing: true,
|
|
5
|
+
printWidth: 80,
|
|
6
|
+
proseWrap: "never",
|
|
5
7
|
semi: true,
|
|
6
8
|
singleQuote: false,
|
|
9
|
+
tabWidth: 2,
|
|
7
10
|
trailingComma: "es5",
|
|
8
|
-
|
|
9
|
-
arrowParens: "always",
|
|
10
|
-
proseWrap: "never",
|
|
11
|
-
printWidth: 80,
|
|
11
|
+
useTabs: false,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @type {import('stylelint').Config} */
|
|
2
2
|
const config = {
|
|
3
|
-
plugins: ["stylelint-prettier"],
|
|
4
3
|
extends: ["stylelint-config-standard", "stylelint-config-idiomatic-order"],
|
|
4
|
+
plugins: ["stylelint-prettier"],
|
|
5
5
|
rules: {
|
|
6
6
|
"at-rule-no-unknown": [
|
|
7
7
|
true,
|
|
@@ -18,14 +18,14 @@ const config = {
|
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
|
-
"declaration-property-value-no-unknown": true,
|
|
22
|
-
"no-descending-specificity": null,
|
|
23
21
|
"declaration-block-no-redundant-longhand-properties": [
|
|
24
22
|
true,
|
|
25
23
|
{
|
|
26
24
|
ignoreShorthands: ["/flex/"],
|
|
27
25
|
},
|
|
28
26
|
],
|
|
27
|
+
"declaration-property-value-no-unknown": true,
|
|
28
|
+
"no-descending-specificity": null,
|
|
29
29
|
"selector-pseudo-class-no-unknown": [
|
|
30
30
|
true,
|
|
31
31
|
{
|