8000 Convert tests to use RuleTester instead of --report-unused-disable-di… · foxglove/eslint-plugin@a5d3728 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5d3728

Browse files
committed
Convert tests to use RuleTester instead of --report-unused-disable-directives
The RuleTester provides the ability to assert on specific error messages and fixes that rules produce. It's also more in line with how the upstream projects (eslint and typescript-eslint) test their rules, which will smooth the process if we decide to upstream these rules. The tests for (and changes to) no-meaningless-void-operator are changes I made based on feedback on my typescript-eslint PR: typescript-eslint/typescript-eslint#3641
1 parent 2cb07e2 commit a5d3728

14 files changed

+10718
-1595
lines changed

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ module.exports = {
44
parserOptions: {
55
project: "tsconfig.json",
66
},
7+
8+
overrides: [
9+
{
10+
files: ["*.ts", "*.tsx"],
11+
extends: ["plugin:@foxglove/typescript"],
12+
parserOptions: { project: "tsconfig.json" },
13+
},
14+
],
715
};

configs/typescript.test.ts renamed to configs/typescript.example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Use --report-unused-disable-directives to validate errors
22

3+
/* eslint-disable no-unused-expressions */
34
/* eslint-disable @typescript-eslint/no-unused-expressions */
45

56
void (async () => {

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testMatch: ["<rootDir>/**/*.test.ts"],
4+
};

0 commit comments

Comments
 (0)
0