1
1
mirror of https://github.com/theoludwig/eslint-config-conventions.git synced 2024-12-18 21:45:04 +01:00

test: ensure we do not use deprecated rules

This commit is contained in:
Théo LUDWIG 2024-09-18 00:20:22 +02:00
parent 19f74fc6a2
commit 2db017e805
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
2 changed files with 11 additions and 1 deletions

View File

@ -129,7 +129,6 @@
"no-var": "error",
"no-void": ["error", { "allowAsStatement": true }],
"no-with": "error",
"no-return-await": "error",
"object-shorthand": ["error", "properties"],
"one-var": ["error", { "initialized": "never" }],
"prefer-const": ["error", { "destructuring": "all" }],

View File

@ -20,6 +20,17 @@ test("ensure we validate correctly JavaScript files", async () => {
assert.strictEqual(withErrors?.errorCount, 3)
})
test("ensure we do not use deprecated rules", async () => {
const [javascriptLintResult] = await eslint.lintFiles(
"test/fixtures/javascript-no-errors.js",
)
const [typescriptLintResult] = await eslint.lintFiles(
"test/fixtures/typescript-no-errors.ts",
)
assert.strictEqual(javascriptLintResult.usedDeprecatedRules.length, 0)
assert.strictEqual(typescriptLintResult.usedDeprecatedRules.length, 0)
})
test("ensure we validate correctly TypeScript files", async () => {
const [noErrors] = await eslint.lintFiles(
"test/fixtures/typescript-no-errors.ts",