Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react", "es2015"],
"presets": ["react", "env"]
}
312 changes: 284 additions & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,42 +1,298 @@
{
"extends": [
"eslint:recommended",
"prettier"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"templateStrings": true,
"jsx": true
}
},
"rules": {
"semi": 2,
"no-unused-vars": 2,
"react/display-name": 2,
"react/jsx-key": 2,
"react/jsx-no-comment-textnodes": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-target-blank": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/no-children-prop": 2,
"react/no-danger-with-children": 2,
"react/no-deprecated": 2,
"react/no-direct-mutation-state": 2,
"react/no-find-dom-node": 2,
"react/no-is-mounted": 2,
"react/no-render-return-value": 2,
"react/no-string-refs": 2,
"react/no-unescaped-entities": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/react-in-jsx-scope": 2,
"react/require-render-return": 2,
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"jest": true,
"node": true
},
"globals": {
"jest": true
},
"plugins": [
"react"
"react",
"import"
],
"settings": {
"react": {
"version": "^15.6.1"
"overrides": [
{
"files": [
"**/*.percy.{js,jsx}"
],
"env": {
"react-percy/globals": true
}
}
],
"rules": {
"accessor-pairs": [
"error"
],
"block-scoped-var": [
"error"
],
"consistent-return": [
"error"
],
"curly": [
"error",
"all"
],
"default-case": [
"error"
],
"dot-location": [
"off"
],
"dot-notation": [
"error"
],
"eqeqeq": [
"error"
],
"guard-for-in": [
"off"
],
"import/named": [
"off"
],
"import/no-duplicates": [
"error"
],
"import/no-named-as-default": [
"error"
],
"new-cap": [
"error"
],
"no-alert": [
1
],
"no-caller": [
"error"
],
"no-case-declarations": [
"error"
],
"no-console": [
"error"
],
"no-div-regex": [
"error"
],
"no-dupe-keys": [
"error"
],
"no-else-return": [
"error"
],
"no-empty-pattern": [
"error"
],
"no-eq-null": [
"error"
],
"no-eval": [
"error"
],
"no-extend-native": [
"error"
],
"no-extra-bind": [
"error"
],
"no-extra-boolean-cast": [
"error"
],
"no-inline-comments": [
"error"
],
"no-implicit-coercion": [
"error"
],
"no-implied-eval": [
"error"
],
"no-inner-declarations": [
"off"
],
"no-invalid-this": [
"error"
],
"no-iterator": [
"error"
],
"no-labels": [
"error"
],
"no-lone-blocks": [
"error"
],
"no-loop-func": [
"error"
],
"no-multi-str": [
"error"
],
"no-native-reassign": [
"error"
],
"no-new": [
"error"
],
"no-new-func": [
"error"
],
"no-new-wrappers": [
"error"
],
"no-param-reassign": [
"error"
],
"no-process-env": [
"warn"
],
"no-proto": [
"error"
],
"no-redeclare": [
"error"
],
"no-return-assign": [
"error"
],
"no-script-url": [
"error"
],
"no-self-compare": [
"error"
],
"no-sequences": [
"error"
],
"no-shadow": [
"off"
],
"no-throw-literal": [
"error"
],
"no-undefined": [
"error"
],
"no-unused-expressions": [
"error"
],
"no-use-before-define": [
"error",
"nofunc"
],
"no-useless-call": [
"error"
],
"no-useless-concat": [
"error"
],
"no-with": [
"error"
],
"prefer-const": [
"error"
],
"radix": [
"error"
],
"react/jsx-no-duplicate-props": [
"error"
],
"react/jsx-no-undef": [
"error"
],
"react/jsx-uses-react": [
"error"
],
"react/jsx-uses-vars": [
"error"
],
"react/no-did-update-set-state": [
"error"
],
"react/no-direct-mutation-state": [
"error"
],
"react/no-is-mounted": [
"error"
],
"react/no-unknown-property": [
"error"
],
"react/prefer-es6-class": [
"error",
"always"
],
"react/prop-types": "error",
"valid-jsdoc": [
"error"
],
"yoda": [
"error"
],
"spaced-comment": [
"error",
"always",
{
"block": {
"exceptions": [
"*"
]
}
}
],
"no-unused-vars": [
"error",
{
"args": "after-used",
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^e$"
}
],
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true,
"ignore": [
-1,
0,
1,
2,
3,
100,
10,
0.5
]
}
],
"no-underscore-dangle": [
"off"
]
}
}
7 changes: 4 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"bracketSpacing": false,
"trailingComma": "es5"
"singleQuote": true,
"bracketSpacing": false,
"trailingComma": "es5",
"printWidth": 100
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react-plotly.js

![plotly-react-logo](https://static1.squarespace.com/static/5a5adfdea9db09d594a841f3/t/5a5af2c5e2c48307ed4a21b6/1515975253370/)
![plotly-react-logo](https://images.plot.ly/plotly-documentation/thumbnail/react.png)

> A [plotly.js](https://github.com/plotly/plotly.js) React component from
> [Plotly](https://plot.ly/). The basis of Plotly's
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"url": "https://github.com/plotly/react-plotly.js/issues"
},
"scripts": {
"make:lib": "mkdirp lib && babel src --out-dir=lib --ignore __tests__/*.js,__mocks__/*.js --presets=es2015,react --source-maps --plugins babel-plugin-add-module-exports && mv lib/* ./ && rmdir lib",
"make:dist": "mkdirp dist && browserify src/factory.js -o ./dist/create-plotly-component.js -t [ babelify --presets [ es2015 react ] --plugins add-module-exports ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/create-plotly-component.js --compress --mangle --output ./dist/create-plotly-component.min.js --source-map filename=dist/create-plotly-component.min.js.map",
"make:lib": "mkdirp lib && babel src --out-dir=lib --ignore __tests__/*.js,__mocks__/*.js --presets=env,react --source-maps --plugins babel-plugin-add-module-exports && mv lib/* ./ && rmdir lib",
"make:dist": "mkdirp dist && browserify src/factory.js -o ./dist/create-plotly-component.js -t [ babelify --presets [ env react ] --plugins add-module-exports ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/create-plotly-component.js --compress --mangle --output ./dist/create-plotly-component.min.js --source-map filename=dist/create-plotly-component.min.js.map",
"clean": "rimraf lib dist react-plotly.js react-plotly.js.map factory.js factory.js.map",
"prepublishOnly": "npm run clean && npm run make:lib && npm run make:dist",
"lint": "prettier --trailing-comma es5 --write \"src/**/*.js\" && eslint src",
Expand All @@ -33,9 +33,10 @@
],
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^10.0.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babelify": "^7.3.0",
"brfs": "^1.4.3",
Expand All @@ -45,6 +46,8 @@
"dependency-check": "^2.9.1",
"enzyme": "^2.9.1",
"eslint": "^4.8.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-react": "^7.4.0",
"event-emitter": "^0.3.5",
"jest": "^20.0.4",
Expand All @@ -63,7 +66,7 @@
},
"peerDependencies": {
"plotly.js": ">1.34.0",
"react": ">12.0.0"
"react": ">0.13.0"
},
"browserify-global-shim": {
"react": "React"
Expand Down
Loading