Skip to content

Commit

Permalink
refactor: fix linting for ts directive
Browse files Browse the repository at this point in the history
In the recommended set, directives are forbidden. Allow them with comments and add a comment explaining the usage in the code
  • Loading branch information
dbartholomae committed Aug 29, 2020
1 parent 3b32ea8 commit 10797eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ module.exports = {
},
rules: {
"react/prop-types": 0,
"@typescript-eslint/ban-ts-comment": [
2,
{ "ts-expect-error": "allow-with-description" },
],
},
};
2 changes: 1 addition & 1 deletion src/render.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("render", () => {
});

it("throws an error if a lower-case component is used", () => {
// @ts-expect-error
// @ts-expect-error - lower-case element test does not exist
expect(() => render(<test>Test</test>)).toThrowError(
"No lower-case elements or class components supported, please make sure all your components start with an upper-case letter and are functions."
);
Expand Down

0 comments on commit 10797eb

Please sign in to comment.