Skip to content

Commit

Permalink
Core js (#26)
Browse files Browse the repository at this point in the history
* added core-js to fix problems with IE and upgraded node_modules and babel config and eslint config

* bump version 0.3.42

* improved webpack config

* added override for dom-serializer since 0.2.1 breaks the build due to UglifyJS not being able to parse const keyword
  • Loading branch information
whirmill authored Oct 23, 2019
1 parent 6f6a3d8 commit dc307f9
Show file tree
Hide file tree
Showing 15 changed files with 2,360 additions and 1,708 deletions.
45 changes: 34 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,56 @@
"plugins": [
// Stage 0
"@babel/plugin-proposal-function-bind",

// Stage 1
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
["@babel/plugin-proposal-optional-chaining", { "loose": false }],
["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }],
["@babel/plugin-proposal-nullish-coalescing-operator", { "loose": false }],
[
"@babel/plugin-proposal-optional-chaining",
{
"loose": false
}
],
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
[
"@babel/plugin-proposal-nullish-coalescing-operator",
{
"loose": false
}
],
"@babel/plugin-proposal-do-expressions",

// Stage 2
["@babel/plugin-proposal-decorators", { "legacy": true }],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",

// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }],
[
"@babel/plugin-proposal-class-properties",
{
"loose": false
}
],
"@babel/plugin-proposal-json-strings",

"@babel/plugin-proposal-object-rest-spread"
"@babel/plugin-proposal-object-rest-spread"
],
"env": {
"development": {
"plugins": ["react-hot-loader/babel"]
"plugins": [
"react-hot-loader/babel"
]
}
}
}
42 changes: 0 additions & 42 deletions .eslintrc

This file was deleted.

209 changes: 209 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
---
# http:#eslint.org/docs/rules/
parser: babel-eslint
parserOptions:
ecmaFeatures:
binaryLiterals: false # enable binary literals
blockBindings: true # enable let and const (aka block bindings)
defaultParams: true # enable default function parameters
forOf: true # enable for-of loops
generators: false # enable generators
objectLiteralComputedProperties: true # enable computed object literal property names
objectLiteralDuplicateProperties: false # enable duplicate object literal properties in strict mode
objectLiteralShorthandMethods: false # enable object literal shorthand methods
objectLiteralShorthandProperties: false # enable object literal shorthand properties
octalLiterals: false # enable octal literals
regexUFlag: false # enable the regular expression u flag
regexYFlag: false # enable the regular expression y flag
templateStrings: true # enable template strings
unicodeCodePointEscapes: false # enable code point escapes
jsx: true # enable JSX
modules: true
experimentalObjectRestSpread: true
sourceType: module
allowImportExportEverywhere: false
codeFrame: false
env:
browser: true
node: false
amd: false
mocha: true
jasmine: false
phantomjs: false
jquery: false
prototypejs: false
shelljs: false
es6: true
#globals: # e.g. "angular": true
plugins:
- react
- prettier
rules:
prettier/prettier:
- error
- singleQuote: true
semi: false
trailingComma: none
react/jsx-uses-vars: 1
no-comma-dangle: 0
no-cond-assign: 1
no-console: 0
no-constant-condition: 0
no-control-regex: 0
no-debugger: 0
no-dupe-keys: 1
no-empty: 0
no-empty-class: 0
no-ex-assign: 0
no-extra-boolean-cast: 0
no-extra-parens: 0
no-extra-semi: 1
no-func-assign: 1
no-inner-declarations: 0
no-invalid-regexp: 0
no-irregular-whitespace: 0
no-negated-in-lhs: 0
no-obj-calls: 0
no-regex-spaces: 0
no-reserved-keys: 0
no-sparse-arrays: 0
no-unreachable: 1
use-isnan: 1
valid-jsdoc: 1
valid-typeof: 1
block-scoped-var: 1
complexity: 0
consistent-return: 0
curly: 0
default-case: 0
dot-notation: 1
eqeqeq: 1
guard-for-in: 0
no-alert: 0
no-caller: 0
no-div-regex: 0
no-else-return: 0
no-empty-label: 0
no-eq-null: 0
no-eval: 1
no-extend-native: 0
no-extra-bind: 0
no-fallthrough: 0
no-floating-decimal: 0
no-implied-eval: 1
no-iterator: 0
no-labels: 0
no-lone-blocks: 0
no-loop-func: 1
no-multi-spaces: 1
no-multi-str: 0
no-native-reassign: 0
no-new: 0
no-new-func: 0
no-new-wrappers: 1
no-octal: 0
no-octal-escape: 0
no-process-env: 0
no-proto: 0
no-redeclare: 1
no-return-assign: 0
no-script-url: 1
no-self-compare: 1
no-sequences: 0
no-unused-expressions: 0
no-void: 0
no-warning-comments: 0
no-with: 0
radix: 0
vars-on-top: 0
wrap-iife: 0
yoda: 0
global-strict: 0
no-extra-strict: 0
strict: 0
no-catch-shadow: 0
no-delete-var: 0
no-label-var: 0
no-shadow: 1
no-shadow-restricted-names: 0
no-undef: 0
no-undef-init: 0
no-undefined: 0
no-unused-vars:
- error
- varsIgnorePattern: '^React$'
no-use-before-define:
- error
- functions: false
classes: false
variables: false
prefer-const:
- error
- destructuring: any
ignoreReadBeforeAssign: false
handle-callback-err: 0
no-mixed-requires: 0
no-new-require: 0
no-path-concat: 0
no-process-exit: 0
no-restricted-modules: 0
no-sync: 0
brace-style:
- error
- 1tbs
- allowSingleLine: true
camelcase: 1
comma-spacing: 0
comma-style: 0
consistent-this: 0
eol-last: 1
func-names: 0
prefer-arrow-callback: error
key-spacing: 0
max-nested-callbacks: 0
new-cap: 1
new-parens: 1
no-array-constructor: 1
no-inline-comments: 0
no-lonely-if: 0
no-mixed-spaces-and-tabs: 1
no-multiple-empty-lines: 0
no-nested-ternary: 1
no-new-object: 1
no-space-before-semi: 0
no-spaced-func: 0
no-ternary: 0
no-trailing-spaces: 1
no-underscore-dangle: 0
no-wrap-func: 0
one-var: 0
operator-assignment: 0
padded-blocks: 0
quote-props: 0
semi:
- 2
- never
sort-vars: 0
space-after-function-name: 0
space-after-keywords: 0
space-before-blocks: 0
space-in-brackets: 0
space-in-parens: 0
space-infix-ops: 0
space-return-throw-case: 0
space-unary-ops: 0
spaced-line-comment: 0
wrap-regex: 0
space-before-function-paren:
- error
- anonymous: always
named: never
asyncArrow: always
no-var: 1
generator-star: 0
max-depth: 0
max-len: 0
max-params: 0
max-statements: 0
no-bitwise: 0
no-plusplus: 0
11 changes: 3 additions & 8 deletions cfg/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ const srcPath = path.join(__dirname, '/../src')
const vendorPath = path.join(__dirname, '/../vendor')

const postCssOptions = {
plugins: () => [
autoprefixer({
browsers: ['last 5 versions', 'ie 6-11']
})
]
plugins: () => [autoprefixer()]
}

function getDefaultModules() {
Expand Down Expand Up @@ -44,8 +40,7 @@ function getDefaultModules() {
{
loader: 'sass-loader',
options: {
outputStyle: 'expanded',
indentedSyntax: true
sassOptions: { outputStyle: 'expanded', indentedSyntax: true }
}
}
]
Expand All @@ -62,7 +57,7 @@ function getDefaultModules() {
{
loader: 'sass-loader',
options: {
outputStyle: 'expanded'
sassOptions: { outputStyle: 'expanded' }
}
}
]
Expand Down
1 change: 1 addition & 0 deletions cfg/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Dotenv = require('dotenv-webpack')

const config = Object.assign({}, baseConfig, {
entry: [
'core-js/stable',
'webpack-dev-server/client?http://127.0.0.1:' + defaultSettings.port,
'webpack/hot/only-dev-server',
'./src/index'
Expand Down
4 changes: 3 additions & 1 deletion cfg/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ const config = Object.assign({}, baseConfig, {
optimization: {
minimizer: [
new UglifyJsPlugin({
// cache: true,
// parallel: true,
sourceMap: true,
uglifyOptions: {
mangle: true,
warnings: false,
screw_ie8: true, // eslint-disable-line camelcase
conditionals: true,
unused: true,
comparisons: true,
sourceMap: true,
sequences: true,
dead_code: true, // eslint-disable-line camelcase
evaluate: true,
Expand Down
Loading

0 comments on commit dc307f9

Please sign in to comment.