eslint-plugin-css-modules-es

0.1.0 • Public • Published

eslint-plugin-css-modules-es

Check no default import and camelCaseOnly use of css modules, visit this blog for more details.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-css-modules-es:

npm install eslint-plugin-css-modules-es --save-dev

Usage

Add css-modules-es to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "css-modules-es"
    ]
}

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

{
    "rules": {
        "css-modules-es/rule-name": 2
    }
}

Specifying file extensions

You can specify a list of file extensions to validate css modules via plugin settings in .eslintrc.

{
  "settings": {
    "css-modules-es": {
      "extensions": [".modules.css", ".modules.less"]
    }
  }
}

The default extensions is [".modules.css"]

Supported Rules

  • no-default-import-css-modules
  • only-camelcase-key-css-modules

📄 License

MIT license

Package Sidebar

Install

npm i eslint-plugin-css-modules-es

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

10.7 kB

Total Files

10

Last publish

Collaborators

  • csu-feizao