From 18a73f0c56188b3cb3fc9480d1f42428c0f3c13e Mon Sep 17 00:00:00 2001 From: Gabriel Bull Date: Mon, 17 Apr 2017 21:17:40 -0400 Subject: [PATCH] Fixed eslint warning about imports --- .eslintrc | 57 ------------------------- .eslintrc.yml | 53 +++++++++++++++++++++++ CHANGELOG.md | 4 ++ package.json | 3 +- src/navPane/windows/item/title/title.js | 3 +- src/os.js | 2 +- src/radio/macOs/radio.js | 3 +- src/radio/windows/radio.js | 3 +- src/titleBar/windows/controls/close.js | 3 +- test/tests/index.js | 3 +- 10 files changed, 65 insertions(+), 69 deletions(-) delete mode 100755 .eslintrc create mode 100755 .eslintrc.yml diff --git a/.eslintrc b/.eslintrc deleted file mode 100755 index 2824c31d..00000000 --- a/.eslintrc +++ /dev/null @@ -1,57 +0,0 @@ -{ - "parser": "babel-eslint", - "plugins": [ - "react" - ], - "env": { - "browser": true, - "node": true, - "es6": true, - "mocha": true - }, - "globals": { - "__DEV__": true, - "__SERVER__": true - }, - "ecmaFeatures": { - "jsx": true - }, - "rules": { - // Strict mode - "strict": [2, "never"], - - // Code style - "indent": [2, 2], - "quotes": [2, "single"], - "no-unused-vars": 1, - "no-undef": 1, - "object-curly-spacing": [2, "always"], - - // JSX - "jsx-quotes": 1, - - // React - "react/display-name": 0, - "react/jsx-boolean-value": 1, - "react/jsx-closing-bracket-location": 1, - "react/jsx-curly-spacing": 1, - "react/jsx-max-props-per-line": 0, - "react/jsx-indent-props": 0, - "react/jsx-no-duplicate-props": 1, - "react/jsx-no-undef": 1, - "react/jsx-sort-prop-types": 0, - "react/jsx-sort-props": 0, - "react/jsx-uses-react": 1, - "react/jsx-uses-vars": 1, - "react/no-danger": 0, - "react/no-set-state": 0, - "react/no-did-mount-set-state": 1, - "react/no-did-update-set-state": 1, - "react/no-multi-comp": 0, - "react/no-unknown-property": 1, - //"react/prop-types": 1, // does not work with inherited propTypes - "react/require-extension": 1, - "react/self-closing-comp": 1, - "react/wrap-multilines": 1 - } -} diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100755 index 00000000..5190c671 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,53 @@ +parser: babel-eslint + +extends: + - plugin:import/errors + - plugin:import/warnings + +plugins: + - react + +env: + browser: true + node: true + es6: true + mocha: true + +ecmaFeatures: + jsx: true + +rules: + # Strict mode + strict: [2, never] + + # Code style + indent: [2, 2] + quotes: [2, single] + no-unused-vars: 1 + no-undef: 1 + object-curly-spacing: [2, always] + + # JSX + jsx-quotes: 1 + + # React + react/display-name: 0 + react/jsx-boolean-value: 1 + react/jsx-closing-bracket-location: 1 + react/jsx-curly-spacing: 1 + react/jsx-max-props-per-line: 0 + react/jsx-indent-props: 0 + react/jsx-no-duplicate-props: 1 + react/jsx-no-undef: 1 + react/jsx-sort-prop-types: 0 + react/jsx-sort-props: 0 + react/jsx-uses-react: 1 + react/jsx-uses-vars: 1 + react/no-danger: 0 + react/no-set-state: 0 + react/no-did-mount-set-state: 1 + react/no-did-update-set-state: 1 + react/no-multi-comp: 0 + react/no-unknown-property: 1 + react/self-closing-comp: 1 + react/jsx-wrap-multilines: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9f079f..4b905119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.3.0 (April 17th, 2017) + +- Added prop-types dependency to avoid deprecation in React 16 + ## 0.2.19 (March 14th, 2017) - Removed rubber band effect from list view diff --git a/package.json b/package.json index 6e8a2133..72060e63 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-desktop", "author": "Gabriel Bull", - "version": "0.2.19", + "version": "0.3.0", "description": "React UI Components for macOS Sierra and Windows 10", "main": "./index.js", "keywords": [ @@ -52,6 +52,7 @@ "babel-preset-stage-0": "^6.24.1", "chai": "^3.5.0", "eslint": "^3.19.0", + "eslint-plugin-import": "^2.2.0", "eslint-plugin-react": "^6.10.3", "html-webpack-plugin": "^2.28.0", "jsdom": "^9.12.0", diff --git a/src/navPane/windows/item/title/title.js b/src/navPane/windows/item/title/title.js index 58c91d6b..3decb8ef 100644 --- a/src/navPane/windows/item/title/title.js +++ b/src/navPane/windows/item/title/title.js @@ -1,8 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { keyframes } from 'radium'; +import Radium, { keyframes } from 'radium'; import styles from '../../style/windows10'; -import Radium from 'radium'; var appear = keyframes({ '0%': { diff --git a/src/os.js b/src/os.js index c4e07f39..a19e781f 100644 --- a/src/os.js +++ b/src/os.js @@ -5,7 +5,7 @@ export default function os() { // explicitly set these to avoid issues const w = window || null; const n = navigator || null; - const p = process || (window && window.process) || null; + const p = process || (w && w.process) || null; // via node if (p && p.platform) { diff --git a/src/radio/macOs/radio.js b/src/radio/macOs/radio.js index 1f0739d7..1b077ec8 100644 --- a/src/radio/macOs/radio.js +++ b/src/radio/macOs/radio.js @@ -1,11 +1,10 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Hidden, { hiddenPropTypes } from '../../style/hidden'; -import { getState } from 'radium'; +import Radium, { getState } from 'radium'; import styles from './styles/10.11'; import Text from '../../text/macOs/text'; import Circle from './circle'; -import Radium from 'radium'; import ValueRef from '../../ValueRef'; import WindowFocus from '../../windowFocus'; diff --git a/src/radio/windows/radio.js b/src/radio/windows/radio.js index 21c421cc..fd4d5cc4 100644 --- a/src/radio/windows/radio.js +++ b/src/radio/windows/radio.js @@ -1,12 +1,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { getState } from 'radium'; +import Radium, { getState } from 'radium'; import styles from './styles/windows'; import Text from '../../text/windows/text'; import { ThemeContext, themePropTypes, themeContextTypes } from '../../style/theme/windows'; import Hidden, { hiddenPropTypes } from '../../style/hidden'; import { ColorContext, colorPropTypes, colorContextTypes } from '../../style/color/windows'; -import Radium from 'radium'; import ValueRef from '../../ValueRef'; @ValueRef() diff --git a/src/titleBar/windows/controls/close.js b/src/titleBar/windows/controls/close.js index 1cdf3b9e..a43f9d90 100644 --- a/src/titleBar/windows/controls/close.js +++ b/src/titleBar/windows/controls/close.js @@ -1,10 +1,9 @@ import React, { Component } from 'react'; -import { getState } from 'radium'; +import Radium, { getState } from 'radium'; import WindowFocus from '../../../windowFocus'; import { themeContextTypes } from '../../../style/theme/windows'; import { backgroundContextTypes } from '../../../style/background/windows'; import { isDarkColor } from '../../../color'; -import Radium from 'radium' const styles = { button: { diff --git a/test/tests/index.js b/test/tests/index.js index 9817269c..5fa0ea16 100644 --- a/test/tests/index.js +++ b/test/tests/index.js @@ -1,11 +1,10 @@ import { expect } from 'chai'; -import { os } from '../../index'; import { MACOS, WINDOWS } from '../../src/os'; import * as components from '../../index' describe('index', () => { it('detect os', () => { - expect(os()).to.be.oneOf([MACOS, WINDOWS]); + expect(components.os()).to.be.oneOf([MACOS, WINDOWS]); }); it('should be exported', () => {