diff --git a/.eslintignore b/.eslintignore index a2d34c31..bf3d39bd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,6 +11,7 @@ /archive /mithril.js /mithril.min.js +/stream/stream.min.js # And the examples are ignored (for now). /examples diff --git a/.eslintrc.js b/.eslintrc.js index a38c5e1b..e0734315 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,229 +1,231 @@ +"use strict" + module.exports = { - "env": { - "browser": true, - "commonjs": true, - "es6": true, - "node": true + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true }, - "extends": "eslint:recommended", - "rules": { - "accessor-pairs": "error", - "array-bracket-spacing": [ - "error", - "never" - ], - "array-callback-return": "error", - "arrow-body-style": "error", - "arrow-parens": "error", - "arrow-spacing": "error", - "block-scoped-var": "off", - "block-spacing": "off", - "brace-style": "off", - "callback-return": "off", - "camelcase": [ - "error", - { - "properties": "never" - } - ], - "comma-dangle": [ - "error", - "only-multiline" - ], - "comma-spacing": "off", - "comma-style": [ - "error", - "last" - ], - "complexity": "off", - "computed-property-spacing": [ - "error", - "never" - ], - "consistent-return": "off", - "consistent-this": "off", - "curly": "off", - "default-case": "off", - "dot-location": [ - "error", - "property" - ], - "dot-notation": "off", - "eol-last": "off", - "eqeqeq": "off", - "func-names": "off", - "func-style": "off", - "generator-star-spacing": "error", - "global-require": "error", - "guard-for-in": "off", - "handle-callback-err": "error", - "id-blacklist": "error", - "id-length": "off", - "id-match": "error", - "indent": [ - "warn", - "tab", - { - "outerIIFEBody": 0, - "SwitchCase": 1 - } - ], - "init-declarations": "off", - "jsx-quotes": "error", - "key-spacing": "off", - "keyword-spacing": "off", - "linebreak-style": "off", - "lines-around-comment": "off", - "max-depth": "off", - "max-len": "off", - "max-nested-callbacks": "error", - "max-params": "off", - "max-statements": "off", - "max-statements-per-line": "off", - "new-parens": "off", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "no-alert": "error", - "no-array-constructor": "error", - "no-bitwise": "error", - "no-caller": "error", - "no-catch-shadow": "off", - "no-cond-assign": "off", - "no-confusing-arrow": "error", - "no-console": "off", - "no-continue": "off", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-else-return": "off", - "no-empty-function": "off", - "no-eq-null": "off", - "no-eval": "error", - "no-extend-native": "off", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-implicit-coercion": "error", - "no-implicit-globals": "error", - "no-implied-eval": "error", - "no-inline-comments": "off", - "no-invalid-this": "off", - "no-iterator": "error", - "no-label-var": "off", - "no-labels": "off", - "no-lone-blocks": "error", - "no-lonely-if": "off", - "no-loop-func": "off", - "no-magic-numbers": "off", - "no-mixed-requires": "error", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-multiple-empty-lines": "error", - "no-native-reassign": "error", - "no-negated-condition": "off", - "no-nested-ternary": "off", - "no-new": "off", - "no-new-func": "off", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-param-reassign": "off", - "no-path-concat": "off", - "no-plusplus": "off", - "no-process-env": "error", - "no-process-exit": "error", - "no-proto": "error", - "no-redeclare": "off", - "no-restricted-globals": "error", - "no-restricted-imports": "error", - "no-restricted-modules": "error", - "no-restricted-syntax": "error", - "no-return-assign": "off", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "off", - "no-shadow": "off", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sync": "off", - "no-ternary": "off", - "no-throw-literal": "off", - "no-trailing-spaces": [ - "error", - { - "skipBlankLines": true - } - ], - "no-undef-init": "error", - "no-undefined": "off", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "error", - "no-unneeded-ternary": "error", - "no-unused-expressions": "off", - "no-use-before-define": "off", - "no-useless-call": "error", - "no-useless-concat": "error", - "no-useless-constructor": "error", - "no-useless-escape": "off", - "no-var": "off", - "no-void": "off", - "no-warning-comments": "off", - "no-whitespace-before-property": "error", - "no-with": "error", - "object-curly-spacing": [ - "error", - "never" - ], - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "off", - "operator-assignment": [ - "error", - "always" - ], - "operator-linebreak": "off", - "padded-blocks": "off", - "prefer-arrow-callback": "off", - "prefer-const": "error", - "prefer-reflect": "off", - "prefer-rest-params": "off", - "prefer-spread": "off", - "prefer-template": "off", - "quote-props": "off", - "quotes": [ - "error", - "double", - {"avoidEscape": true} - ], - "radix": [ - "error", - "always" - ], - "require-jsdoc": "off", - "require-yield": "error", - "semi": "off", - "semi-spacing": "off", - "sort-imports": "error", - "sort-vars": "off", - "space-before-blocks": "off", - "space-before-function-paren": "off", - "space-in-parens": [ - "error", - "never" - ], - "space-infix-ops": "off", - "space-unary-ops": "error", - "spaced-comment": "off", - "strict": ["error", "global"], - "template-curly-spacing": "error", - "valid-jsdoc": "off", - "vars-on-top": "off", - "wrap-iife": "off", - "wrap-regex": "error", - "yield-star-spacing": "error", - "yoda": "off" - }, - "root": true + "extends": "eslint:recommended", + "rules": { + "accessor-pairs": "error", + "array-bracket-spacing": [ + "error", + "never" + ], + "array-callback-return": "error", + "arrow-body-style": "error", + "arrow-parens": "error", + "arrow-spacing": "error", + "block-scoped-var": "off", + "block-spacing": "off", + "brace-style": "off", + "callback-return": "off", + "camelcase": [ + "error", + { + "properties": "never" + } + ], + "comma-dangle": [ + "error", + "only-multiline" + ], + "comma-spacing": "off", + "comma-style": [ + "error", + "last" + ], + "complexity": "off", + "computed-property-spacing": [ + "error", + "never" + ], + "consistent-return": "off", + "consistent-this": "off", + "curly": "off", + "default-case": "off", + "dot-location": [ + "error", + "property" + ], + "dot-notation": "off", + "eol-last": "off", + "eqeqeq": "off", + "func-names": "off", + "func-style": "off", + "generator-star-spacing": "error", + "global-require": "error", + "guard-for-in": "off", + "handle-callback-err": "error", + "id-blacklist": "error", + "id-length": "off", + "id-match": "error", + "indent": [ + "warn", + "tab", + { + "outerIIFEBody": 0, + "SwitchCase": 1 + } + ], + "init-declarations": "off", + "jsx-quotes": "error", + "key-spacing": "off", + "keyword-spacing": "off", + "linebreak-style": "off", + "lines-around-comment": "off", + "max-depth": "off", + "max-len": "off", + "max-nested-callbacks": "error", + "max-params": "off", + "max-statements": "off", + "max-statements-per-line": "off", + "new-parens": "off", + "newline-after-var": "off", + "newline-before-return": "off", + "newline-per-chained-call": "off", + "no-alert": "error", + "no-array-constructor": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-catch-shadow": "off", + "no-cond-assign": "off", + "no-confusing-arrow": "error", + "no-console": "off", + "no-continue": "off", + "no-div-regex": "error", + "no-duplicate-imports": "error", + "no-else-return": "off", + "no-empty-function": "off", + "no-eq-null": "off", + "no-eval": "error", + "no-extend-native": "off", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-extra-parens": "off", + "no-floating-decimal": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-inline-comments": "off", + "no-invalid-this": "off", + "no-iterator": "error", + "no-label-var": "off", + "no-labels": "off", + "no-lone-blocks": "error", + "no-lonely-if": "off", + "no-loop-func": "off", + "no-magic-numbers": "off", + "no-mixed-requires": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-native-reassign": "error", + "no-negated-condition": "off", + "no-nested-ternary": "off", + "no-new": "off", + "no-new-func": "off", + "no-new-object": "error", + "no-new-require": "error", + "no-new-wrappers": "error", + "no-octal-escape": "error", + "no-param-reassign": "off", + "no-path-concat": "off", + "no-plusplus": "off", + "no-process-env": "error", + "no-process-exit": "error", + "no-proto": "error", + "no-redeclare": "off", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-modules": "error", + "no-restricted-syntax": "error", + "no-return-assign": "off", + "no-script-url": "error", + "no-self-compare": "error", + "no-sequences": "off", + "no-shadow": "off", + "no-shadow-restricted-names": "error", + "no-spaced-func": "error", + "no-sync": "off", + "no-ternary": "off", + "no-throw-literal": "off", + "no-trailing-spaces": [ + "error", + { + "skipBlankLines": true + } + ], + "no-undef-init": "error", + "no-undefined": "off", + "no-underscore-dangle": "off", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unused-expressions": "off", + "no-use-before-define": "off", + "no-useless-call": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "off", + "no-var": "off", + "no-void": "off", + "no-warning-comments": "off", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-spacing": [ + "error", + "never" + ], + "object-shorthand": "off", + "one-var": "off", + "one-var-declaration-per-line": "off", + "operator-assignment": [ + "error", + "always" + ], + "operator-linebreak": "off", + "padded-blocks": "off", + "prefer-arrow-callback": "off", + "prefer-const": "error", + "prefer-reflect": "off", + "prefer-rest-params": "off", + "prefer-spread": "off", + "prefer-template": "off", + "quote-props": "off", + "quotes": [ + "error", + "double", + {"avoidEscape": true} + ], + "radix": [ + "error", + "always" + ], + "require-jsdoc": "off", + "require-yield": "error", + "semi": "off", + "semi-spacing": "off", + "sort-imports": "error", + "sort-vars": "off", + "space-before-blocks": "off", + "space-before-function-paren": "off", + "space-in-parens": [ + "error", + "never" + ], + "space-infix-ops": "off", + "space-unary-ops": "error", + "spaced-comment": "off", + "strict": ["error", "global"], + "template-curly-spacing": "error", + "valid-jsdoc": "off", + "vars-on-top": "off", + "wrap-iife": "off", + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": "off" + }, + "root": true }; diff --git a/promise/.eslintrc.js b/promise/.eslintrc.js index 48e3a834..57fdcaba 100644 --- a/promise/.eslintrc.js +++ b/promise/.eslintrc.js @@ -1,13 +1,15 @@ +"use strict" + module.exports = { - "extends": "../.eslintrc.js", + "extends": "../.eslintrc.js", "env": { - "browser": null, - "es6": null, + "browser": null, + "es6": null, + }, + "parserOptions": { + "ecmaVersion": 5, + }, + "rules": { + "no-process-env": "off", }, - "parserOptions": { - "ecmaVersion": 5, - }, - "rules": { - "no-process-env": "off", - }, }; diff --git a/scripts/.eslintrc.js b/scripts/.eslintrc.js index f31bec11..444d2b5a 100644 --- a/scripts/.eslintrc.js +++ b/scripts/.eslintrc.js @@ -1,12 +1,14 @@ +"use strict" + module.exports = { - "extends": "../.eslintrc.js", + "extends": "../.eslintrc.js", "env": { - "browser": null, + "browser": null, + }, + "parserOptions": { + "ecmaVersion": 2019, + }, + "rules": { + "no-process-env": "off", }, - "parserOptions": { - "ecmaVersion": 2019, - }, - "rules": { - "no-process-env": "off", - }, }; diff --git a/test-utils/domMock.js b/test-utils/domMock.js index 7e26e9a8..0140a210 100644 --- a/test-utils/domMock.js +++ b/test-utils/domMock.js @@ -503,7 +503,7 @@ module.exports = function(options) { set: function(v) { if (this.getAttribute("type") !== "date") throw new Error("invalid state") var time = new Date(v).getTime() - return valueSetter(isNaN(time) ? "" : new Date(time).toUTCString()) + valueSetter(isNaN(time) ? "" : new Date(time).toUTCString()) }, enumerable: true, }) @@ -519,8 +519,8 @@ module.exports = function(options) { v = Number(v) if (!isNaN(v) && !isFinite(v)) throw new TypeError("infinite value") switch (this.getAttribute("type")) { - case "date": return valueSetter(isNaN(v) ? "" : new Date(v).toUTCString()) - case "number": return valueSetter(String(value)) + case "date": valueSetter(isNaN(v) ? "" : new Date(v).toUTCString()); break; + case "number": valueSetter(String(value)); break; default: throw new Error("invalid state") } },