-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from viralganatra/feature/version2
feature/version2
- Loading branch information
Showing
36 changed files
with
5,269 additions
and
1,067 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,39 @@ | ||
{ | ||
"presets": [ | ||
"react", | ||
"es2015", | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"transform-runtime" | ||
] | ||
} | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
"react", | ||
["es2015", { | ||
"modules": false | ||
}], | ||
"stage-0" | ||
] | ||
}, | ||
"test": { | ||
"presets": [ | ||
"react", | ||
"es2015", | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"transform-runtime", | ||
"transform-react-remove-prop-types", | ||
"transform-react-constant-elements" | ||
] | ||
}, | ||
"production": { | ||
"presets": [ | ||
"react", | ||
["es2015", { | ||
"modules": false | ||
}], | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"transform-runtime", | ||
"transform-react-remove-prop-types", | ||
"transform-react-constant-elements" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module.exports = { | ||
'parser': 'babel-eslint', | ||
'extends': 'airbnb', | ||
'env': { | ||
'browser': true, | ||
'node': true, | ||
'jest/globals': true, | ||
}, | ||
'globals': { | ||
'shallow': true, | ||
'mount': true, | ||
'render': true, | ||
}, | ||
'rules': { | ||
'array-bracket-spacing': ['off'], | ||
'arrow-parens': ['error', 'always'], | ||
'class-methods-use-this': ['off'], | ||
'indent': ['error', 4], | ||
'no-unused-expressions': ['error', { 'allowShortCircuit': true }], | ||
'no-unused-vars': ['error', { 'ignoreRestSiblings': true }], | ||
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], | ||
|
||
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }], | ||
|
||
'react/no-unused-prop-types': ['error', { 'skipShapeProps': true }], | ||
'react/require-default-props': ['warn'], | ||
'react/no-array-index-key': ['warn'], | ||
|
||
'react/jsx-filename-extension': ['error', { 'extensions': ['.js', '.jsx'] }], | ||
'react/jsx-indent': ['error', 4], | ||
'react/jsx-indent-props': ['error', 4], | ||
'react/jsx-boolean-value': ['error', 'always'], | ||
'react/jsx-no-bind': ['error'], | ||
|
||
'react/sort-comp': ['error', { | ||
'order': [ | ||
'static-methods', | ||
'lifecycle', | ||
'/^on.+$/', | ||
'everything-else', | ||
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', | ||
'/^render.+$/', | ||
'render', | ||
], | ||
}], | ||
}, | ||
'plugins': [ | ||
'babel', | ||
'react', | ||
'jest', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules | ||
yarn-error.log | ||
lib | ||
npm-debug.log | ||
lib | ||
.DS_Store | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
src | ||
.babelrc | ||
.eslintrc | ||
.travis.yml | ||
.travis.yml | ||
example | ||
rollup-config.js | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Make Enzyme functions available in all test files without importing | ||
import Enzyme from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
global.shallow = Enzyme.shallow; | ||
global.render = Enzyme.render; | ||
global.mount = Enzyme.mount; | ||
|
||
console.error = (error) => { | ||
throw new Error(error); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import pkg from '../package.json'; | ||
|
||
export default [ | ||
{ | ||
input: 'src/index.js', | ||
output: [ | ||
{ file: pkg.main, format: 'cjs' }, | ||
{ file: pkg.module, format: 'es' }, | ||
], | ||
external: ['react', 'prop-types', 'invariant'], | ||
sourcemap: true, | ||
plugins: [ | ||
babel({ | ||
exclude: ['node_modules/**'], | ||
runtimeHelpers: true, | ||
}), | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"react", | ||
["es2015", { | ||
"modules": false | ||
}], | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"react-hot-loader/babel" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# React Click Outside Demo | ||
|
||
|
||
## Using | ||
|
||
To build this example, clone this repo and navigate to the example directory and run: | ||
|
||
```` | ||
npm run start | ||
```` | ||
|
||
And visit: | ||
|
||
http://localhost:3000 | ||
|
||
In your browser |
Oops, something went wrong.