🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-plugin-emotion-utils

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-emotion-utils

Emotion eslint plugin helpful utils

1.0.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-emotion-utils Build Status

Emotion eslint plugin helpful utils. See the rules section for all available rules.

Caveat: This plugin doesn't check where the css or cx functions are defined so it's possible you get some false positives.

Install

yarn add --dev eslint-plugin-emotion-utils

or

npm install --dev eslint-plugin-emotion-utils

Usage

.eslintrc.js

plugins: ['eslint-plugin-emotion-utils'],
rules: {
  'emotion-utils/no-function-declaration-inside-css': [2, { message: 'My custom error message' }],
  'emotion-utils/no-function-call-inside-css': [2, [{ name: 'theme', message: 'My custom message' }]],
},

Rules

emotion-utils/no-function-declarations-inside-css

Disables function declarations inside of css helper.

const styles = css`
  ${() => css`display: block;`}

  ${function() {
    return css`display: block;`;
  }}
`;

emotion-utils/no-function-call-inside-css

Disables function calls inside of css helper. Second argument is array of function names to be considered as violation.

const theme = () => ({ theme }) => theme.display;
const styles = css`
  display: ${theme()};
`;

License

MIT

Keywords

eslint

FAQs

Package last updated on 11 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts