Skip to content

Commit

Permalink
fix(unbound-method): don't suppress errors from base rule
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
G-Rath committed Aug 27, 2022
1 parent 5508c95 commit 5f07860
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
19 changes: 0 additions & 19 deletions src/rules/__tests__/unbound-method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,6 @@ describe('error handling', () => {
},
);
});

describe('when "project" is not set', () => {
const ruleTester = new ESLintUtils.RuleTester({
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
tsconfigRootDir: rootPath,
},
});

ruleTester.run(
'unbound-method jest edition without "project" property',
requireRule(false),
{
valid: validTestCases.concat(invalidTestCases.map(({ code }) => code)),
invalid: [],
},
);
});
});

ruleTester.run('unbound-method jest edition', requireRule(false), {
Expand Down
12 changes: 1 addition & 11 deletions src/rules/unbound-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ const baseRule = (() => {
}
})();

const tryCreateBaseRule = (
context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,
) => {
try {
return baseRule?.create(context);
} catch {
return null;
}
};

interface Config {
ignoreStatic: boolean;
}
Expand Down Expand Up @@ -75,7 +65,7 @@ export default createRule<Options, MessageIds>({
},
},
create(context) {
const baseSelectors = tryCreateBaseRule(context);
const baseSelectors = baseRule?.create(context);

if (!baseSelectors) {
return {};
Expand Down

0 comments on commit 5f07860

Please sign in to comment.