Skip to content

Commit

Permalink
Merging dev to master (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon authored Jul 3, 2018
1 parent 1e83642 commit fc4e638
Show file tree
Hide file tree
Showing 339 changed files with 19,744 additions and 15,928 deletions.
21 changes: 0 additions & 21 deletions .babelrc

This file was deleted.

18 changes: 18 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
presets: [
'@babel/react',
'@babel/flow',
['@babel/env', { modules: false, loose: true }],
],
plugins: [
['@babel/proposal-class-properties', { loose: true }],
['@babel/proposal-object-rest-spread', { loose: true }],
// used for stripping out the `invariant` messages in production builds
'dev-expression',
],
comments: false,
};

if (process.env.NODE_ENV === 'test') {
module.exports.plugins.push('@babel/transform-modules-commonjs');
}
132 changes: 0 additions & 132 deletions .eslintrc

This file was deleted.

92 changes: 92 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
module.exports = {
extends: [
'prettier',
'airbnb',
'plugin:flowtype/recommended',
'prettier/react',
'prettier/flowtype',
'plugin:jest/recommended',
'plugin:prettier/recommended',
],
parser: 'babel-eslint',
plugins: ['prettier', 'flowtype', 'react', 'import', 'jest'],
env: {
es6: true,
browser: true,
node: true,
'jest/globals': true,
},
globals: {
// flow globals
TimeoutID: true,
IntervalID: true,
AnimationFrameID: true,
},
rules: {
// Error on prettier violations
'prettier/prettier': 'error',

// New eslint style rules that is not disabled by prettier:
'lines-between-class-members': 'off',

// Allowing warning and error console logging
'no-console': ['error', { allow: ['warn', 'error'] }],

// Opting out of prefer destructuring (nicer with flow in lots of cases)
'prefer-destructuring': 'off',

// Disallowing the use of variables starting with `_` unless it called on `this`.
// Allowed: `this._secret = Symbol()`
// Not allowed: `const _secret = Symbol()`
'no-underscore-dangle': ['error', { allowAfterThis: true }],

// Cannot reassign function parameters but allowing modification
'no-param-reassign': ['error', { props: false }],

// Allowing ++ on numbers
'no-plusplus': 'off',

// Allowing Math.pow rather than forcing `**`
'no-restricted-properties': [
'off',
{
object: 'Math',
property: 'pow',
},
],

// Allowing jsx in files with any file extension (old components have jsx but not the extension)
'react/jsx-filename-extension': 'off',

// Not requiring default prop declarations all the time
'react/require-default-props': 'off',

// Opt out of preferring stateless functions
'react/prefer-stateless-function': 'off',

// Allowing files to have multiple components in it
'react/no-multi-comp': 'off',

// Sometimes we use the PropTypes.object PropType for simplicity
'react/forbid-prop-types': 'off',

// Allowing the non function setState approach
'react/no-access-state-in-setstate': 'off',

// Opting out of this
'react/destructuring-assignment': 'off',

// Adding 'skipShapeProps' as the rule has issues with correctly handling PropTypes.shape
'react/no-unused-prop-types': ['error', { skipShapeProps: true }],

// Require // @flow at the top of files
'flowtype/require-valid-file-annotation': [
'error',
'always',
{ annotationStyle: 'line' },
],

// Allowing importing from dev deps (for stories and tests)
'import/no-extraneous-dependencies': 'off',
},
};
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "all",
"semi": true,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true
}
27 changes: 16 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
{
"dist/react-beautiful-dnd.js": {
"bundled": 400507,
"minified": 151621,
"gzipped": 43147
"bundled": 350983,
"minified": 131579,
"gzipped": 36875
},
"dist/react-beautiful-dnd.min.js": {
"bundled": 358937,
"minified": 134847,
"gzipped": 38228
"bundled": 311656,
"minified": 114427,
"gzipped": 31353
},
"dist/react-beautiful-dnd.esm.js": {
"bundled": 177889,
"minified": 89747,
"gzipped": 22655,
"bundled": 180447,
"minified": 92592,
"gzipped": 22949,
"treeshaked": {
"rollup": 78234,
"webpack": 80006
"rollup": {
"code": 68627,
"import_statements": 668
},
"webpack": {
"code": 70911
}
}
}
}
12 changes: 12 additions & 0 deletions .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
"@babel/react",
"@babel/flow",
["@babel/env", { "modules": false, "loose": true }]
],
"plugins": [
["@babel/proposal-class-properties", { "loose": true }],
["@babel/proposal-object-rest-spread", { "loose": true }]
],
"comments": false
}
6 changes: 6 additions & 0 deletions .storybook/babel-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Babel

storybook looks for a root `.babelrc` in the project for its babel config. However, we are using `.babelrc.js` which is not supported. Rather than putting effort into this we are just having a custom `.babelrc` in this folder which is the same as `.babelrc.js`. This is lame, but we are looking to move away from storybook in the short term anyway.

- [Storybook babel docs](https://storybook.js.org/configurations/custom-babel-config/)
- [Storybook issue for supporting `babelrc.js`](https://github.com/storybooks/storybook/issues/2582)
10 changes: 8 additions & 2 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-standard",
"stylelint-config-styled-components"
]
"stylelint-config-styled-components",
"stylelint-config-prettier",
],
"rules": {
"declaration-empty-line-before": null,
"comment-empty-line-before": null,
"block-no-empty": null,
}
}
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
language: node_js
cache: yarn
node_js:
- '8.4'
- '8.11.3'
script:
- yarn run validate
- yarn run test
# Disabling bundle size check until we can get fuzzy thresholds
# - yarn run check-bundle-sizes
- yarn run bundle-size:check
# Currently disabled travis deploys
# deploy:
# provider: npm
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog

This project adheres to [Semantic Versioning 2.0](http://semver.org/).
All release notes and upgrade notes can be found on our [Github Releases](https://github.com/atlassian/react-beautiful-dnd/releases) page.
All release notes and upgrade notes can be found on our [Github Releases](https://github.com/atlassian/react-beautiful-dnd/releases) page.
Loading

0 comments on commit fc4e638

Please sign in to comment.