New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-emotion

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-emotion - npm Package Compare versions

Comparing version 9.2.6 to 10.0.0-beta.0

docs/rules/import-from-emotion.md

14

package.json
{
"name": "eslint-plugin-emotion",
"version": "9.2.6",
"description": "Apply eslint rules to emotion.sh css-in-js",
"version": "10.0.0-beta.0",
"description": "ESLint rules for emotion",
"keywords": [

@@ -13,9 +13,9 @@ "eslint",

"main": "src/index.js",
"dependencies": {
"requireindex": "^1.1.0"
},
"engines": {
"node": ">=0.10.0"
"node": ">=6"
},
"license": "ISC"
"license": "ISC",
"publishConfig": {
"tag": "next"
}
}
# eslint-plugin-emotion
Apply eslint rules to emotion.sh css-in-js
> ESLint rules for emotion

@@ -27,9 +27,6 @@ ## Installation

{
"plugins": [
"emotion"
]
"plugins": ["emotion"]
}
```
Then configure the rules you want to use under the rules section.

@@ -39,15 +36,33 @@

{
"rules": {
"emotion/syntax-preference": [2, "string"]
}
"rules": {
"emotion/jsx": "error"
}
}
```
## Supported Rules
## Emotion 10 codemods
* [syntax-preference](docs/rules/syntax-preference.md)
The Emotion 10 codemods are contained in this package. To use them, enable the rules shown below. Keeping these rules after migrating is also useful to have `jsx` from `@emotion/core` automatically imported when the css prop is used and other such things. You may also want to not enable certain rules while you are migrating, such the `no-vanilla` rule.
```json
{
"rules": {
"emotion/jsx-import": "error",
"emotion/no-vanilla": "error",
"emotion/import-from-emotion": "error",
"emotion/styled-import": "error
}
}
```
> **Note:**
>
> These rules assume you are using React, if you are not using React, you should keeping only using the `emotion` package.
## Supported Rules
- [jsx-import](./docs/rules/jsx-import.md)
- [styled-import](./docs/rules/styled-import.md)
- [import-from-emotion](./docs/rules/import-from-emotion.md)
- [no-vanilla](./docs/rules/no-vanilla.md)
- [syntax-preference](./docs/rules/syntax-preference.md)

@@ -1,17 +0,7 @@

/**
* @fileoverview Apply eslint rules to emotion.sh css-in-js
* @author alex-pex
*/
// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------
const requireIndex = require('requireindex')
// ------------------------------------------------------------------------------
// Plugin Definition
// ------------------------------------------------------------------------------
// import all rules in src/rules
module.exports.rules = requireIndex(`${__dirname}/rules`)
exports.rules = {
'import-from-emotion': require('./rules/import-from-emotion'),
'no-vanilla': require('./rules/no-vanilla'),
'syntax-preference': require('./rules/syntax-preference'),
styled: require('./rules/styled'),
jsx: require('./rules/jsx')
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc