Registry / testing / eslint-plugin-no-inline-styles

eslint-plugin-no-inline-styles

JSON →
library1.0.5jsnpmunverified

ESLint plugin (v1.0.5) that disallows inline styles in React JSX by flagging the style attribute. This is a minimal plugin with a single rule and no active maintenance; the last release dates from 2019. It offers no configuration beyond enabling/disabling and uses a simple regex check, which can be bypassed by using string literal style objects. Not recommended for production use; consider alternatives like eslint-plugin-react or stylelint.

npm install eslint-plugin-no-inline-styles
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NO-I
E
eslint-plugin-no-inline-styles
testingjavascriptv1.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-plugin-no-inline-styles
// In .eslintrc: {"plugins": ["no-inline-styles"]}
require('eslint-plugin-no-inline-styles')
ESLint plugins are configured in config files, not imported directly.
no-inline-styles/no-inline-styles
// In .eslintrc rules: {"no-inline-styles/no-inline-styles": "error"}
"inline-styles": "error"
The rule name includes the plugin namespace; omitting it will not work.
plugin
// ESM: import plugin from 'eslint-plugin-no-inline-styles' does NOT work; use plugins array in config.
import noInlineStyles from 'eslint-plugin-no-inline-styles'
This package does not export a usable module; it's purely a config-based ESLint plugin.

Install the plugin and configure ESLint to disallow inline styles in JSX.

// Install npm install --save-dev eslint eslint-plugin-no-inline-styles // .eslintrc.json { "plugins": ["no-inline-styles"], "rules": { "no-inline-styles/no-inline-styles": "error" } } // Example of violation: <div style={{ color: 'red' }} />
Debug
Known issues
deprecatedPackage is deprecated; no updates since 2019 and no support for modern ESLint versions.
fix
Use alternative rules like 'react/forbid-component-props' or 'react/jsx-no-style'.
affects: >=1.0.0
gotchaThe rule can be bypassed by using string literals for styles: <div style={{ "width": "100%" }}> passes the check.
fix
Add additional custom rule or use a more robust plugin that also checks string literals.
affects: >=1.0.0
breakingThe plugin does not work with ESLint 7+ due to changes in ESLint plugin API; compatible only with ESLint 6.x and below.
fix
Downgrade ESLint to 6.x or use a maintained plugin.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint encountered an error while loading plugin 'no-inline-styles'.
Plugin is incompatible with current ESLint version (7+).
fix
Uninstall this plugin and use a supported alternative.
Cannot find module 'eslint-plugin-no-inline-styles'
Plugin not installed or not in node_modules.
fix
npm install --save-dev eslint-plugin-no-inline-styles
Rule 'no-inline-styles/no-inline-styles' was not found
Plugin not correctly configured in plugins field.
fix
Add "no-inline-styles" to the plugins array in .eslintrc.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; ESLint is required as a plugin host
Agent activity
7 hits · last 30 days
node
6
Perplexity
1
Resources
eslint-plugin-no-inline-styles — npm install eslint-plugin-no-inline-styles · libregistry