eslint-plugin-react-compat
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -0,1 +1,8 @@ | ||
# 0.1.0 (2018-03-21) | ||
* Update development dependencies to latest versions. | ||
* Configure continuous integration. | ||
* Change minimum Node version to 6. | ||
* Add code of conduct. | ||
## 0.0.3 | ||
@@ -2,0 +9,0 @@ |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
module.exports = { | ||
@@ -2,0 +4,0 @@ configs: { |
@@ -10,13 +10,13 @@ "use strict"; | ||
var REACT_COMPONENT_EXPORT_NAME = 'Component'; | ||
var REACT_COMPONENT_RENDER_FUNCTION_NAME = 'render'; | ||
var REACT_MODULE_NAME = 'react'; | ||
var REACT_PURE_COMPONENT_EXPORT_NAME = 'PureComponent'; | ||
const REACT_COMPONENT_EXPORT_NAME = 'Component'; | ||
const REACT_COMPONENT_RENDER_FUNCTION_NAME = 'render'; | ||
const REACT_MODULE_NAME = 'react'; | ||
const REACT_PURE_COMPONENT_EXPORT_NAME = 'PureComponent'; | ||
var _default = function _default(context) { | ||
var classStack = []; | ||
var functionStack = []; | ||
var componentImportedAs; | ||
var pureComponentImportedAs; | ||
var reactImportedAs; | ||
var _default = context => { | ||
const classStack = []; | ||
const functionStack = []; | ||
let componentImportedAs; | ||
let pureComponentImportedAs; | ||
let reactImportedAs; | ||
return { | ||
@@ -32,8 +32,8 @@ ArrowFunctionExpression() { | ||
ImportDeclaration(node) { | ||
var source = node.source, | ||
specifiers = node.specifiers; | ||
const source = node.source, | ||
specifiers = node.specifiers; | ||
if (source.value === REACT_MODULE_NAME && Array.isArray(specifiers)) { | ||
for (var i = 0; i < specifiers.length; i++) { | ||
var specifier = specifiers[i]; | ||
for (let i = 0; i < specifiers.length; i++) { | ||
const specifier = specifiers[i]; | ||
@@ -58,3 +58,3 @@ if ((0, _types.isImportDefaultSpecifier)(specifier) || (0, _types.isImportNamespaceSpecifier)(specifier)) { | ||
ClassDeclaration(node) { | ||
var superClass = node.superClass; | ||
const superClass = node.superClass; | ||
@@ -100,5 +100,5 @@ if (superClass) { | ||
if (classStack[0] && functionStack[0] || reactImportedAs && classStack.length === 0 && functionStack.length === 1) { | ||
var argument = node.argument; | ||
const argument = node.argument; | ||
if ((0, _types.isArrayExpression)(argument) && argument.elements.some(function (element) { | ||
if ((0, _types.isArrayExpression)(argument) && argument.elements.some(element => { | ||
return (0, _types.isJSXElement)(element); | ||
@@ -105,0 +105,0 @@ })) { |
{ | ||
"name": "eslint-plugin-react-compat", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Make sure your React code is compatible with Inferno and Preact.", | ||
@@ -30,3 +30,3 @@ "main": "lib/index.js", | ||
"preact", | ||
"qaulity", | ||
"quality", | ||
"react", | ||
@@ -44,8 +44,8 @@ "render", | ||
"devDependencies": { | ||
"babel-jest": "22.1.0", | ||
"babel-core": "^7.0.0-0", | ||
"babel-jest": "23.0.0-alpha.0", | ||
"codecov": "3.0.0", | ||
"flow-bin": "0.64.0", | ||
"jest-cli": "22.1.4", | ||
"lintly": "0.0.18", | ||
"nodely": "0.0.25" | ||
"jest-cli": "23.0.0-alpha.0", | ||
"lintly": "0.1.0", | ||
"nodely": "0.1.0" | ||
}, | ||
@@ -71,2 +71,2 @@ "jest": { | ||
} | ||
} | ||
} |
@@ -5,2 +5,10 @@ # eslint-plugin-react-compat [![NPM][npm-img]][npm-url] [![Coverage][cov-img]][cov-url] | ||
## Table of Contents | ||
* [Installation](#installation) | ||
* [Documentation](#documentation) | ||
* [Code of Conduct](#code-of-conduct) | ||
* [Contributing](#contributing) | ||
* [License](#license) | ||
## Installation | ||
@@ -20,3 +28,3 @@ | ||
## Usage | ||
## Documentation | ||
@@ -27,2 +35,3 @@ Add the following to your [ESLint configuration file][eslint-config-url]: | ||
{ | ||
"extends": ["plugin:react-compat/recommended"], | ||
"plugins": ["react-compat"] | ||
@@ -32,2 +41,14 @@ } | ||
## Code of Conduct | ||
Please see the [code of conduct](CODE_OF_CONDUCT.md). | ||
## Contributing | ||
Please see the [contributing guide](CONTRIBUTING.md). | ||
## License | ||
[MIT](LICENSE.md) | ||
[cov-img]: https://img.shields.io/codecov/c/github/dogma-io/eslint-plugin-react-compat.svg "Code Coverage" | ||
@@ -34,0 +55,0 @@ [cov-url]: https://codecov.io/gh/dogma-io/eslint-plugin-react-compat |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8026
103
61
1