https://github.com/tj-mc/eslint-plugin-no-styled-components
Prevent imports and usages of styled-components
https://github.com/tj-mc/eslint-plugin-no-styled-components
Last synced: 2 months ago
JSON representation
Prevent imports and usages of styled-components
- Host: GitHub
- URL: https://github.com/tj-mc/eslint-plugin-no-styled-components
- Owner: tj-mc
- License: mit
- Created: 2023-12-18T00:43:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-01T06:14:22.000Z (about 1 year ago)
- Last Synced: 2024-05-01T07:27:54.141Z (about 1 year ago)
- Language: JavaScript
- Size: 77.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-no-styled-components

Prevent imports and usages of styled-components.
## Installation
You'll first need to install [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```Next, install `eslint-plugin-no-styled-components`:
```sh
npm install eslint-plugin-no-styled-components --save-dev
```## Usage
Add `no-styled-components` to the plugins section of your `.eslintrc` configuration file as shown below. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"no-styled-components"
]
}
```Then configure the rules you want to use under the rules section.
You can choose to ban imports of `styled-components`, just their usages (e.g. `styled.div`), or both.
```json
{
"rules": {
"no-styled-components/imports": 2, // <-- 2 is error, 1 is warning, 0 is off
"no-styled-components/usages": 1
}
}
```