Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyoncy/eslint-plugin-jsx-dollar
Eslint plugin that check JSXText's unnecessary template literal `$` character.
https://github.com/kyoncy/eslint-plugin-jsx-dollar
eslint eslint-plugin jsx template-literals
Last synced: about 16 hours ago
JSON representation
Eslint plugin that check JSXText's unnecessary template literal `$` character.
- Host: GitHub
- URL: https://github.com/kyoncy/eslint-plugin-jsx-dollar
- Owner: kyoncy
- Created: 2021-02-11T12:32:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T08:29:34.000Z (almost 4 years ago)
- Last Synced: 2024-10-02T18:18:53.264Z (about 2 months ago)
- Topics: eslint, eslint-plugin, jsx, template-literals
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/eslint-plugin-jsx-dollar
- Size: 93.8 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-plugin-jsx-dollar
Eslint plugin that check JSXText's unnecessary template literal `$` character.[![npm version](https://img.shields.io/npm/v/eslint-plugin-jsx-dollar.svg)](https://www.npmjs.com/package/eslint-plugin-jsx-dollar)
[![minified size](https://img.shields.io/bundlephobia/min/eslint-plugin-jsx-dollar/latest)](https://bundlephobia.com/result?p=eslint-plugin-jsx-dollar)
[![minzipped size](https://img.shields.io/bundlephobia/minzip/eslint-plugin-jsx-dollar/latest)](https://bundlephobia.com/result?p=eslint-plugin-jsx-dollar)## Install
```
yarn add -D eslint-plugin-jsx-dollar
````.eslintrc.js`
```js
module.exports = {
"plugins": [
...,
"jsx-dollar"
],
"rules": [
...,
"jsx-dollar/jsxDollar": "error",
]
...,
}
```## Example
When using JavaScript template literals, use `` `${expression}` ``.
But, we rarely typo `` ${} `` in JSX text.Details are shown below.
```tsx
const text = "sample";export const Success: React.FC = () => {
return (
{`${text}`}
// Equals sample
);
};export const Failed: React.FC = () => {
return (
${text}
// Equals $sample
);
};
```## Lisence
MIT