-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(eslint-plugin): add warning about superfluous rules with typescr…
…ipt (#7372) * fix: blog typo * Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com> * Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com> * Update 2023-07-09-announcing-typescript-eslint-v6.md * Update 2023-07-09-announcing-typescript-eslint-v6.md * Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md * docs: add typescript warning * Update package.json * Update 2023-07-09-announcing-typescript-eslint-v6.md * Update packages/eslint-plugin/docs/rules/no-dupe-class-members.md Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * Update packages/eslint-plugin/docs/rules/no-invalid-this.md Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * fix: weird whitespace * feat: typescript mdx component * fix: overlapping pr * fix: lint --------- Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com> Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
- Loading branch information
1 parent
2a64167
commit e0cb751
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/website/src/components/TypeScriptOverlap/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Admonition from '@theme/Admonition'; | ||
import React from 'react'; | ||
|
||
export default function TypeScriptOverlap({ | ||
strict, | ||
}: { | ||
strict?: string; | ||
}): React.JSX.Element { | ||
return ( | ||
<div> | ||
<Admonition type="danger"> | ||
<p> | ||
The code problem checked by this ESLint rule is automatically checked | ||
by the TypeScript compiler. Thus, it is not recommended to turn on | ||
this rule in new TypeScript projects. You only need to enable this | ||
rule if you prefer the ESLint error messages over the TypeScript | ||
compiler error messages. | ||
</p> | ||
{strict === undefined ? ( | ||
<></> | ||
) : ( | ||
<p> | ||
(Note that technically, TypeScript will only catch this if you have | ||
the <code>strict</code> or <code>noImplicitThis</code> flags | ||
enabled. These are enabled in most TypeScript projects, since they | ||
are considered to be best practice.) | ||
</p> | ||
)} | ||
</Admonition> | ||
</div> | ||
); | ||
} |