@pob/eslint-config 67.11.0 → 67.12.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/lib/overrides/test.js
CHANGED
package/lib/oxlint.test.js
CHANGED
|
@@ -153,9 +153,25 @@ describe("oxlint/typescript.json", () => {
|
|
|
153
153
|
).toEqual([{ line: 1, rule: "typescript(no-floating-promises)" }]);
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
+
// the test files override replaces the options
|
|
157
|
+
it.each(["file.ts", "file.test.ts"])(
|
|
158
|
+
"reports promises ignored with void in %s",
|
|
159
|
+
async (fileName) => {
|
|
160
|
+
const diagnostics = await lint(
|
|
161
|
+
project.cwd,
|
|
162
|
+
"void Promise.resolve();\nexport {};\n",
|
|
163
|
+
fileName,
|
|
164
|
+
);
|
|
165
|
+
await rm(path.join(project.cwd, fileName));
|
|
166
|
+
expect(summarize(diagnostics)).toEqual([
|
|
167
|
+
{ line: 1, rule: "eslint(no-void)" },
|
|
168
|
+
{ line: 1, rule: "typescript(no-floating-promises)" },
|
|
169
|
+
]);
|
|
170
|
+
},
|
|
171
|
+
);
|
|
172
|
+
|
|
156
173
|
// oxlint applies type-aware rules to the .js files of a TypeScript project
|
|
157
174
|
it("scopes rules to TypeScript files", async () => {
|
|
158
|
-
await rm(path.join(project.cwd, "file.ts"));
|
|
159
175
|
expect(await lint(project.cwd, floatingPromise, "file.js")).toEqual([]);
|
|
160
176
|
});
|
|
161
177
|
});
|
|
@@ -86,6 +86,9 @@ export default {
|
|
|
86
86
|
// https://typescript-eslint.io/rules/no-confusing-non-null-assertion/
|
|
87
87
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
88
88
|
|
|
89
|
+
// https://typescript-eslint.io/rules/no-floating-promises/
|
|
90
|
+
"@typescript-eslint/no-floating-promises": ["error", { ignoreVoid: false }],
|
|
91
|
+
|
|
89
92
|
// https://typescript-eslint.io/rules/no-import-type-side-effects/
|
|
90
93
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
91
94
|
|
package/oxlint/typescript.json
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"typescript/no-empty-object-type": "error",
|
|
71
71
|
"typescript/no-explicit-any": "warn",
|
|
72
72
|
"typescript/no-extra-non-null-assertion": "error",
|
|
73
|
-
"typescript/no-floating-promises": "error",
|
|
73
|
+
"typescript/no-floating-promises": ["error", { "ignoreVoid": false }],
|
|
74
74
|
"typescript/no-for-in-array": "error",
|
|
75
75
|
"typescript/no-implied-eval": "error",
|
|
76
76
|
"typescript/no-import-type-side-effects": "error",
|
|
@@ -171,6 +171,7 @@
|
|
|
171
171
|
"typescript/no-floating-promises": [
|
|
172
172
|
"error",
|
|
173
173
|
{
|
|
174
|
+
"ignoreVoid": false,
|
|
174
175
|
"allowForKnownSafeCalls": [
|
|
175
176
|
{
|
|
176
177
|
"from": "package",
|