1.1.0 • Published 7 years ago

eslint-plugin-demoforfix v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Minimal eslint plugin

Install

npm i -D eslint-plugin-demoforfix

Then add to .eslintrc

{
    "rules": {
        "demoforfix/no-string-classname": 2
    },
    "plugins": [
        "demoforfix"
    ],
}

And you wil recive error if try to use literall class name

INVALID

import React, { PureComponent } from 'react';

class Cart extends PureComponent {
  render() {
    return (<p className="Cart">cart</p>);
  }
}

export default Cart;

VALID

import React, { PureComponent } from 'react';
import styles from './Cart.pcss';

class Cart extends PureComponent {
    render() {
        return (<p className={styles.Cart}>cart</p>)
    }
}

export default Cart;