Skip to content

Commit

Permalink
Convert tests to use RuleTester instead of --report-unused-disable-di…
Browse files Browse the repository at this point in the history
…rectives

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
  • Loading branch information
jtbandes committed Aug 30, 2021
1 parent 2cb07e2 commit a5d3728
Show file tree
Hide file tree
Showing 14 changed files with 10,718 additions and 1,595 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Expand Up @@ -4,4 +4,12 @@ module.exports = {
parserOptions: {
project: "tsconfig.json",
},

overrides: [
{
files: ["*.ts", "*.tsx"],
extends: ["plugin:@foxglove/typescript"],
parserOptions: { project: "tsconfig.json" },
},
],
};
@@ -1,5 +1,6 @@
// Use --report-unused-disable-directives to validate errors

/* eslint-disable no-unused-expressions */
/* eslint-disable @typescript-eslint/no-unused-expressions */

void (async () => {
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
@@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
testMatch: ["<rootDir>/**/*.test.ts"],
};

0 comments on commit a5d3728

Please sign in to comment.