# eslint-plugin-no-inline-styles

> ESLint for no inline styles allowed

Latest version **1.0.5** (published 2019-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-no-inline-styles
pnpm add eslint-plugin-no-inline-styles
yarn add eslint-plugin-no-inline-styles
bun add eslint-plugin-no-inline-styles
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-12-11 |
| First published | 2019-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | nmanthena |
| Maintainers | nmanthena18 |
| Keywords | eslint, eslintplugin, eslint-plugin, inline, styles, inline-styles |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-no-inline-styles
- Repository: https://github.com/nmanthena18/eslint-no-inline-styles
- Homepage: https://github.com/nmanthena18/eslint-no-inline-styles#readme
- Issues: https://github.com/nmanthena18/eslint-no-inline-styles/issues
- npm.io page: https://npm.io/package/eslint-plugin-no-inline-styles

## Dependencies (1)

- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2019-12-11
- 1.0.4 — 2019-12-11
- 1.0.3 — 2019-12-11
- 1.0.2 — 2019-12-11
- 1.0.1 — 2019-12-11
- 1.0.0 — 2019-12-11

## README

## ESLinting to avoid inline styles

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `npm i eslint-plugin-no-inline-styles`:

```
$ npm install eslint-plugin-no-inline-styles --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `npm i eslint-plugin-no-inline-styles` globally.

## Usage

Add `eslint-plugin-no-inline-styles` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "eslint-plugin-no-inline-styles"
    ]
}
```


Then configure the rules you want to use under the rules section.

```json
{
    "rules": {
        "no-inline-styles/no-inline-styles": 2
    }
}
```


You can change rule from 2 to 1 which is worning or you can disable with zero.

## Checks inline styles for React app

@no-inline-styles

This is a rule to dissallow inline styling. 


## Rule Details

This rule aims to dissallow inline styling where it appear in style attribute in react app.

Examples oforf **incorrect** code for this rule:

```jsx
class Component extends React.Component {
  render() {
    <div>
      <span style={{ height: 40 }}>I am having style attribute</span>
    </div>;
  }
}
```

Examples for **correct** code for this rule:

```jsx
class Component extends React.Component {
  render() {
    <div>
      <span className="classname">I don't have style attribute</span>
    </div>;
  }
}
```

Examples for hack the rule: use the string literals
```jsx
class Component extends React.Component {
  render() {
    <div>
      <span style={{ "width": "50%" }}>I am having style attribute but I can render now</span>
    </div>;
  }
}
```

---
_Source: https://npm.io/package/eslint-plugin-no-inline-styles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
