diff --git a/.eslintrc.json b/.eslintrc.json index 085362f..74206ca 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,6 +5,19 @@ "indent": ["error", "tab"], "linebreak-style": "off", "no-tabs": "off", - "react/jsx-filename-extension": "off" - } + "react/jsx-filename-extension": "off", + "react/no-deprecated": "off" + }, + "overrides": [ + { + "files": ["**/*.spec.js"], + "env": { + "jest": true + }, + "rules": { + "max-classes-per-file": "off", + "react/jsx-props-no-spreading": "off" + } + } + ] } diff --git a/.travis.yml b/.travis.yml index be9e7c1..c228a90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - "node" - - "6" + - "10" env: - REACT=0.13 - REACT=0.14 diff --git a/README.md b/README.md index 302a280..ea73b1f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Build Status](https://travis-ci.org/wimpyprogrammer/react-component-update.svg?branch=master)](https://travis-ci.org/wimpyprogrammer/react-component-update) [![codecov](https://codecov.io/gh/wimpyprogrammer/react-component-update/branch/master/graph/badge.svg)](https://codecov.io/gh/wimpyprogrammer/react-component-update) [![Known Vulnerabilities](https://snyk.io/test/github/wimpyprogrammer/react-component-update/badge.svg)](https://snyk.io/test/github/wimpyprogrammer/react-component-update) -[![Greenkeeper badge](https://badges.greenkeeper.io/wimpyprogrammer/react-component-update.svg)](https://greenkeeper.io/) Adds convenience lifecycle events to your React components. diff --git a/package.json b/package.json index 4de252c..63e3dc5 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,24 @@ { "name": "react-component-update", - "version": "1.4.1", + "version": "1.5.0", "description": "Extends the native React Component to streamline updates", "main": "lib/index.js", "files": [ "lib/**/!(*.spec).js" ], "engines": { - "node": ">=6" + "node": ">=10" }, "scripts": { "clean": "rimraf lib", "build": "npm run clean && babel src --out-dir lib", "build-and-test": "npm run test && npm run build", "install-react": "enzyme-adapter-react-install 16", - "lint": "eslint ./", + "lint": "eslint ./ --report-unused-disable-directives", "test": "jest", "travisci": "npm run install-react && npm run lint && npm run test && codecov", - "publish-please": "publish-please", - "prepublish": "publish-please guard" + "prepublish": "npx publish-please guard", + "publish-please": "npx publish-please" }, "repository": { "type": "git", @@ -35,7 +35,7 @@ "@babel/core": "^7.2.2", "@babel/preset-env": "^7.2.0", "@babel/preset-react": "^7.0.0", - "babel-jest": "^23.0.0", + "babel-jest": "^26.3.0", "chai": "^4.0.2", "codecov": "^3.0.0", "create-react-class": "^15.6.0", @@ -43,19 +43,18 @@ "enzyme": "^3.6.0", "enzyme-adapter-react-16": "^1.5.0", "enzyme-adapter-react-helper": "^1.3.0", - "eslint": "^5.0.1", - "eslint-config-airbnb": "^17.1.0", + "eslint": "^7.8.0", + "eslint-config-airbnb": "^18.2.0", "eslint-plugin-import": "^2.13.0", "eslint-plugin-jsx-a11y": "^6.1.0", "eslint-plugin-react": "^7.11.0", - "jest": "^24.3.1", + "jest": "^26.4.2", "lodash.uniqueid": "^4.0.1", - "publish-please": "^5.4.3", "react": "*", "react-dom": "*", "react-test-renderer": "*", - "rimraf": "^2.6.1", - "sinon": "^7.2.7", + "rimraf": "^3.0.2", + "sinon": "^9.0.3", "sinon-chai": "^3.0.0" }, "peerDependencies": { diff --git a/src/component.spec.js b/src/component.spec.js index 55060ae..0905d86 100644 --- a/src/component.spec.js +++ b/src/component.spec.js @@ -1,5 +1,3 @@ -/* eslint-env jest */ -/* eslint-disable react/no-multi-comp */ import chai, { expect } from 'chai'; import dirtyChai from 'dirty-chai'; import { shallow } from 'enzyme'; diff --git a/src/pureComponent.spec.js b/src/pureComponent.spec.js index c70a1e2..b27346a 100644 --- a/src/pureComponent.spec.js +++ b/src/pureComponent.spec.js @@ -1,5 +1,3 @@ -/* eslint-env jest */ -/* eslint-disable react/no-multi-comp */ import chai, { expect } from 'chai'; import dirtyChai from 'dirty-chai'; import { shallow } from 'enzyme'; @@ -26,7 +24,7 @@ function getUniqueProps() { const descriptor = React.PureComponent ? describe : describe.skip; descriptor('PureComponent extension', () => { - const { PureComponent } = require('./'); // eslint-disable-line global-require + const { PureComponent } = require('.'); // eslint-disable-line global-require class TestComponent extends PureComponent { constructor(props) { @@ -170,7 +168,7 @@ descriptor('PureComponent extension', () => { }); descriptor('PureComponent extension with overrides calling super()', () => { - const { PureComponent } = require('./'); // eslint-disable-line global-require + const { PureComponent } = require('.'); // eslint-disable-line global-require const userComponentWillMountBefore = sandbox.spy(); const userComponentWillMountAfter = sandbox.spy(); @@ -297,7 +295,7 @@ descriptor('PureComponent extension with overrides calling super()', () => { }); descriptor('Component extension with overrides not calling super()', () => { - const { PureComponent } = require('./'); // eslint-disable-line global-require + const { PureComponent } = require('.'); // eslint-disable-line global-require class TestComponentWithoutSuper extends PureComponent { componentWillMount() { } diff --git a/src/withEvents.spec.js b/src/withEvents.spec.js index 3f67c3d..2de602c 100644 --- a/src/withEvents.spec.js +++ b/src/withEvents.spec.js @@ -1,4 +1,3 @@ -/* eslint-env jest */ import chai, { expect } from 'chai'; import createReactClass from 'create-react-class'; import dirtyChai from 'dirty-chai'; diff --git a/test-setup.js b/test-setup.js index 185f503..20b4274 100644 --- a/test-setup.js +++ b/test-setup.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ import configure from 'enzyme-adapter-react-helper'; configure();