eslint-plugin-emotion
Advanced tools
Comparing version 9.2.6 to 10.0.0-beta.0
{ | ||
"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') | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
20722
0
19
604
67
2
1
- Removedrequireindex@^1.1.0
- Removedrequireindex@1.2.0(transitive)