Skip to content

Commit

Permalink
Merge pull request #2 from MahboobehMohammadi/webpack-config
Browse files Browse the repository at this point in the history
Refactoring_2
  • Loading branch information
Aaron committed May 29, 2019
1 parent b43802a commit 890fe21
Show file tree
Hide file tree
Showing 16 changed files with 355 additions and 228 deletions.
50 changes: 12 additions & 38 deletions packages/deriv-bot/.babelrc
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions",
"ios_saf >= 8",
"not IE <= 10",
"chrome >= 49",
"firefox >= 49",
"> 1%"
]
},
"loose": true,
"useBuiltIns": "usage",
"corejs": "2.6.5",
}
]
],
"plugins": [
[
"@babel/plugin-proposal-object-rest-spread",
{
"useBuiltIns": "usage",
"corejs": "2.6.5",
}
],
[
"@babel/plugin-proposal-class-properties",
{
"useBuiltIns": "usage",
"corejs": "2.6.5",
}
]
]
}
"presets": [
["@babel/preset-env", {
"modules": false
}],
"@babel/preset-react"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-syntax-dynamic-import"],
["@babel/plugin-proposal-class-properties", { "loose" : true }],
]
}
94 changes: 0 additions & 94 deletions packages/deriv-bot/.eslintrc

This file was deleted.

76 changes: 76 additions & 0 deletions packages/deriv-bot/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
parser: 'babel-eslint',
env: {
es6 : true,
browser: true,
amd : true,
jquery : true,
mocha : true,
},
globals: {
Blockly: false,
trackJs: false,
jest: false,
dataLayer: false
},
rules: {
camelcase : 0,
semi : ['error', 'always'],
'array-callback-return' : 0,
'brace-style' : ['error', '1tbs', { allowSingleLine: true }],
'eol-last' : ['error', 'always'],
'func-names' : ['error', 'never'],
'keyword-spacing' : ['error', { after: true , before: true }],
'lines-between-class-members' : ['error', 'always', { exceptAfterSingleLine: true }],
'no-extra-semi' : 'error',
'no-console' : 'error',
'no-else-return' : ['error', { allowElseIf: true }],
'no-multi-assign' : 0,
'no-param-reassign' : ['error', { props: false }],
'no-restricted-globals' : 0,
'no-script-url' : 0,
'no-trailing-spaces' : ['error', { skipBlankLines: true }],
'object-curly-spacing' : ['error', 'always', { arraysInObjects: true, objectsInObjects: true }],
'one-var' : ['error', { initialized: 'never', uninitialized: 'always' }],
'prefer-destructuring' : 0,
'space-in-parens' : ['error', 'never'],
'space-infix-ops' : 'error',
'space-unary-ops' : 'error',
'no-multiple-empty-lines' : ['error', { 'max': 1, 'maxEOF': 1 }],

// import rules
'import/no-extraneous-dependencies' : [0, { extensions: ['.jsx'] }],
'import/no-useless-path-segments' : 'error',
'import/order' : ['error', { groups: [['builtin', 'external'], 'internal', 'sibling', 'parent'], 'newlines-between': 'ignore' }],
'import/prefer-default-export' : 0,

// react rules
'jsx-quotes' : ['error', 'prefer-single'],
'react/jsx-closing-bracket-location': ['error', { selfClosing: 'line-aligned', nonEmpty: 'line-aligned' }],
'react/jsx-closing-tag-location' : 'error',
'react/jsx-first-prop-new-line' : ['error', 'multiline-multiprop'],
'react/jsx-indent' : ['error', 4],
'react/jsx-indent-props' : ['error', 4],
'react/jsx-max-props-per-line' : ['error', { when: 'multiline' }],
'react/jsx-tag-spacing' : ['error', { closingSlash: 'never', beforeSelfClosing: 'always' }],
'react/prop-types' : 0,
'react/self-closing-comp' : 'error',
'react/sort-prop-types' : ['error', { ignoreCase: true, sortShapeProp: true }],
},
extends: [
'airbnb-base',
'binary',
'plugin:react/recommended',
],
parserOptions: {
ecmaVersion : 6,
ecmaFeatures: {
jsx: true,
},
},
settings: {
'import/resolver': {
'webpack': { 'config': 'webpack.config.js' }
}
},
};
3 changes: 2 additions & 1 deletion packages/deriv-bot/index.html