An open API service indexing awesome lists of open source software.

https://github.com/intility/no-inline-styles

Deno lint plugin that prevents inline styles in JSX/TSX, enforcing CSS class usage
https://github.com/intility/no-inline-styles

deno

Last synced: 12 days ago
JSON representation

Deno lint plugin that prevents inline styles in JSX/TSX, enforcing CSS class usage

Awesome Lists containing this project

README

          




@intility/no-inline-styles


A Deno lint plugin that prevents inline styles in JSX/TSX components. This helps maintain a consistent styling approach by encouraging the use of CSS classes instead of inline styles.


JSR
Publish to JSR

## Installation

Add the plugin to your `deno.json`:

```json
{
"lint": {
"plugins": ["jsr:@intility/no-inline-styles"],
"rules": {
"include": ["no-inline-styles/no-inline-styles"]
}
}
}
```

## Usage

Once configured, the plugin will flag any inline styles:

```tsx
// ❌ Error

Content

// ✅ Good

Content

```

## Ignoring Specific Cases

If you have legitimate use cases for inline styles, you can ignore specific lines:

```tsx
// deno-lint-ignore no-inline-styles/no-inline-styles

Content

```