<commit_before>module.exports = {
    'extends': [
        'plugin:vue/essential', // where applicable
        'eslint:recommended',
        '@vue/standard', // where applicable
        'plugin:vue/strongly-recommended'
    ],
    rules: {
        'vue/html-closing-bracket-newline': [
            'error', {
                'singleline': 'never',
                'multiline': 'never'
            }
        ],
        'vue/html-indent': [
            'error', 4, {
                'attribute': 1,
                'baseIndent': 1,
                'closeBracket': 0,
                'alignAttributesVertically': true,
                'ignores': []
            }
        ],
        // These rules assume eslint recommended, if the rules is accepted from
        // eslint:recommended settings it is commented out and noted to the right of
        /*
         * the rule. This is intended to not overwrite any accepted rules.
         * 0 indicates no action, 1 is a warning, and 2 is an error.
         */
        /* possible error section */
        /*
         * 'for-direction': 0, // eslint:recommended
         * 'getter-return': 2, // eslint:recommended
         */
        'no-async-promise-executor': 2,
        'vue/attribute-hyphenation': 0,
        'no-await-in-loops': 0,
        /*
         * 'no-compare-neg-zero': 1, // eslint:recommended
         * 'no-cond-assign': 0, // eslint:recommended
         */
        'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'no-constant-condition': 2,
        // 'no-control-regex': 2, // eslint:recommended
        'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        /*
         * 'no-dupe-args': 2, // eslint:recommended
         * 'no-dupe-keys': 2 // eslint:recommended
         * 'no-duplicate-case': 2, // eslint:recommended
         * 'no-empty': 2, // eslint:recommended
         * 'no-empty-character-class': 2, // eslint:recommended
         * 'no-ex-assign': 2, // eslint:recommended
         * 'no-extra-boolean-cast': 2, // eslint:recommended
         * 'no-ex-assign': 2, // eslint:recommended
         */
        'import/no-webpack-loader-syntax': 0,
        'no-extra-parens': 2,
        'no-extra-semi': 2, // eslint:recommended
        /*
         * 'no-function-assign': 2, // eslint:recommended
         * 'no-invalid-regexp': 2, // eslint:recommended
         */
        'no-inner-declarations': 0, // eslint:recommended
        'no-irregular-whitespace': 2, // eslint:recommended
        /*
         * 'no-misleading-character-class': 0,
         * 'no-object-calls': 2, // eslint:recommended
         * 'no-protoype-bulletins': 0,
         * 'no-regex-spaces': 2, // eslint:recommended
         * 'no-sparse-arrays': 2, // eslint:recommended
         * 'no-template-curly-in-string': 2, // eslint:recommended
         * 'no-unexpected-multiline': 2, // eslint:recommended
         * 'no-unreachable': 2, // eslint:recommended
         * 'no-unsafe-funally': 2, // eslint:recommended
         * 'require-atomic-updates': 2, // eslint:recommended
         * 'use-isnan': 2, // eslint:recommended
         * 'valid-typeof': 2, // eslint:recommended
         */

        /** *** best practices *****/
        /*
         * 'accessor-pairs': 0,
         * 'array-callback-return': 0,
         * 'blocked-scoped-var': 0,
         * 'class-methods-use-this': 0,
         * 'complexity': 0,
         * 'consistent-return': 0,
         * 'curly': 2,  // eslint: recommended
         */
        'default-case': 2,
        'vue/valid-v-for':0,
        'vue/require-v-for-key':0,
        'vue/require-default-prop':0,
        /*
         * 'dot-location': 2 // eslint: recommended
         * 'dot-notation': 2 // eslint: recommended
         * 'eqeqeq': 2 // eslint: recommended
         * 'guard-for-in': 2, // ?? double check me - require for-in loops to include an if statement
         * 'max-classes-per-file': 0,
         * 'no-alert': 0,
         */
        'no-caller': 2, // Notes: deprecated
        /*
         * 'no-case-declarations': 2, // eslint: recommended
         * 'no-div-regex': 0,
         * 'no-else-return': 0,
         * 'no-empty-function': 0,
         * 'no-empty-pattern': 0, // eslint: recommended
         * 'no-eq-null': 0,
         */
        'no-eval': 1, // 5.8 Warning: Do not use the eval keyword without a really good reason.
        /*
         * 'no-extend-native': 2,  // ?? double check - disallow extending native types
         * 'no-extra-bind': 2,  // ?? double check - disallow unnecessary calls to .bind()
         * 'no-extra-label': 0,
         */
        'no-fallthrough': 1, // Set to warn: 5.7 allows fallthrough cases requires stated
        /*
         * 'no-floating-decimal': 0,
         * 'no-global-assign': 2, // eslint: recommended
         * 'no-implicit-coercion': 0,
         * 'no-implicit-globals': 0,
         * 'no-implied-eval': 0,
         * 'no-invalid-this': 2, // ?? double check - disallow this keywords outside of classes or class-like objects
         * 'no-iterator': 0,
         * 'no-labels': 0,
         * 'no-lone-blocks': 0,
         * 'no-loop-func: 0,
         * 'no-magic-numbers': 0,
         */
        'no-multi-spaces': 2, // Notes: disallow multiple spaces
        'no-multi-str': 2, // 4.6 Disallow Multiline Strings (no-multi-str)
        'no-redeclare': 0, // eslint: recommended
        'no-proto': 0,
        /*
         *'no-new': 0,
         * 'no-new-func': 0,
         * 'no-new-wrappers': 2,  // 5.8 Dissalowed
         * 'no-octal': 2, // eslint: recommended
         * 'no-octal-escape': 0,
         * 'no-param-reassign': 0,
         *
         *
         * 'no-restricted-properties': 0,
         * 'no-return-assign': 0,
         * 'no-return-await': 0,
         * 'no-script-url': 0,
         * 'no-self-assign': 2, // eslint: recommended
         * 'no-self-compare': 0,
         * 'no-sequences': 0,
         * 'no-throw-literal': 2, // notes: disallow throwing literals as exceptions
         * 'no-unified-loop-condition': 0,
         * 'no-unused-expressions': 0,
         * 'no-unused-labels': 2, // eslint: recommended
         * 'no-no-useless-call': 0,
         * 'no-useless-catch': 0,
         * 'no-useless-concat': 0,
         * 'no-useless-escape': 2, // eslint: recommended
         * 'no-useless-return': 0,
         * 'no-void': 0,
         * 'no-warning-comments': 0,
         */
        'no-with': 2,
        /*
         * 'no-prefer-promise-reject-errors': 2, notes: require using Error objects as Promise rejection reasons
         * 'no-radix': 0,
         * 'no-require-await': 0,
         * 'no-require-unicode-regexp': 0,
         * 'no-vars-on-top': 0,
         * 'no-wrap-life': 0,
         * 'no-yoda': 0,
         */

        /** ** strict mode ****/
        // 'strict': 0,

        /** ** variables ****/
        /*
         * 'init-declarations': 0,
         * 'no-delete-var': 2,   // eslint: recommended
         * 'no-label-var': 0,
         * 'no-restricted-globals': 0,
         * 'no-shadow': 0,
         * 'no-shadow-restricted-names': 0,
         *
         * 'no-indef-init': 0,
         * 'no-undefined': 0,
         */
        'no-undef': 0, // eslint: recommended
        'require-default-prop':0,
        'no-unused-vars': 1, // eslint: recommended --- check
        // 'no-use-before-define': 0,

        /* Node.js and CommonJS */
        /*
         * 'callback-return': 0,
         * 'global-require': 0,
         * 'handle-callback-err': 0,
         * 'no-buffer-constructor': 0,
         * 'no-mixed-requires': 0,
         * 'no-new-require': 0,
         * 'no-path-concat': 0,
         * 'no-process-env': 0,
         * 'no-process-exit': 0,
         * 'no-restricted-modules': 0,
         * 'no-sync': ,
         */

        /** ** stylistic ****/
        'array-bracket-newline': 2, // notes: 3.1
        /*
         * 'array-bracket-spacing': 0, // no rule: enforce consistent spacing inside array brackets
         * 'array-element-newline': 0, // no rule: enforce line breaks after each array element
         * 'block-spacing': 0, // no rule
         */
        'brace-style': 2, // Notes: The presumed 'one true brace style' seemds to fit  3.1
        'camelcase': [
            1, {
                properties: 'always'
            }
        ], // notes: double check properties, not mentioned in 1.1
        // 'capitalized-comments': 0, // no rule
        'comma-dangle': [2, 'never'], // 4.2
        'comma-spacing': [
            2, {
                'before': false,
                'after': true
            }
        ], // 3.6.2
        'comma-style': [2, 'last'], // 3.6.2
        'computed-property-spacing': [2, 'never'], // double check 3.6.2
        // 'consistent-this': 0,
        'eol-last': 0, // double check me not explictely stated from what I can see
        'func-call-spacing': [2, 'never'], // 3.6.2 trailing whitespace forbidden without exception
        /*
         * 'func-name-matching': 0,
         * 'func-names': 0,
         * 'function-paren-newline': 0, // notes: dependant on case
         * 'func-style': 0, // both allowed
         * 'id-blacklist': 0, // none for now
         * 'id-length': 0,
         * 'id-match': 0,
         */
        'indent': ['error', 4],
        // 'jsx-quotes': 0, // depends
        'key-spacing': 2, // 3.6.2
        'keyword-spacing': 2, // 3.6.2
        /*
         * 'line-comment-position': 0, // 3.6.2 above and below are accepted
         * 'linebreak-style': 2,
         * 'lines-around-comment': 0,
         * 'lines-between-class-members': 0,
         * 'max-depth': 0,
         */
        'max-len': [
            2, { // should we ignore urls or anything here?
                code: 2400,
                tabWidth: 4
            }
        ],
        /*
         * 'max-lines': 0,
         * 'max-lines-per-function': 0,
         * 'max-nested-callbacks': 0,
         * 'max-params': 0,
         * 'max-statements': 0,
         * 'max-statements-per-line': 0,
         * 'multiline-comment-style': [2, 'starred-block'],
        */
        /*
         * 'multiline-ternary': 0,
         * 'new-cap': 2, // use array declarative instead
         * 'new-parens': 0, // same as above
         * 'newline-per-chained-call': 0, // notes: we do this in cass with d3, but not explicitely stated
         */
        'no-array-constructor': 2, // use array declarative instead
        /*
         * 'no-bitwise': 0,
         * 'no-continue': 0,
         * 'no-inline-comments': 0,
         * 'no-lonely-if': 0,
         * 'no-mixed-operators': 0,
         */
        'no-mixed-spaces-and-tabs': 2, // eslint:recommended
        // 'no-multi-assign': 0,
        'no-multiple-empty-lines': [
            1, {
                max: 2
            }
        ], // 3.6.1 permitted but not encouraged set to warn
        /*
         * 'no-negated-condition': 0,
         * 'no-nested-ternary': 0,
         */
        'no-new-object': 2, // 4.3
        /*
         * 'no-plusplus': 0,
         * 'no-restricted-syntax': 0,
         */
        'no-tabs': 2,
        // 'no-ternary': 0,
        'no-trailing-spaces': 2,
        /*
         * 'no-underscore-dangle': 0,
         * 'no-unneeded-ternary': 0,
         * 'no-whitespace-before-property': 0,
         * 'nonblock-statement-body-position': 0,
         * 'object-curly-newline': 0,
         */
        'object-curly-spacing': [2, 'never'], // 3.6.2 double check exceptions
        // 'object-property-newline': 0,
        'one-var': [
            2, { // 4.1
                var: 'never',
                let: 'never',
                const: 'never'
            }
        ],
        /*
         * 'one-var-declaration-per-line': 2, // not required because of above rule
         * 'operator-assignment': 0,
         * 'operator-linebreak': 0,
         */
        'padded-blocks': [2, 'never'], // 3.6.1 implied?
        /*
         * 'padding-line-between-statements': 0,
         * 'prefer-object-spread': 0,
         * 'quote-props': [2, 'consistent'],   // 4.3 should we make this consistent by object but not by file?
         *
         */
        'quotes': [0, 'single', {
            allowTemplateLiterals: true
        }], // not reinforced
        'semi': [2, 'always'], // require semicol
        'semi-spacing': 2, // 3.6.2
        /*
         * 'semi-style': 0,
         * 'sort-keys': 0,
         * 'sort-vars': 0,
         */
        'space-before-blocks': 2, // 3.6.2
        'space-before-function-paren': [
            2, { // double check 3.6.2
                asyncArrow: 'never',
                anonymous: 'never',
                named: 'never'
            }
        ],
        /*
         * 'space-in-parens': 0,
         * 'space-infix-ops': 0,
         * 'space-unary-ops': 0,
         */
        'spaced-comment': [2, 'always'] // 2.3
        /*
         * 'switch-colon-spacing': 2, // 5.7.2 no rule
         * 'template-tag-spacing': 0,
         * 'unicode-bom': 0,
         * 'wrap-regex': 0,
         */

    },
    parserOptions: {
        parser: 'babel-eslint'
    }
};<commit_msg>Temporarily allow console logs to fix Travis build. Revert after CA-594<commit_after>module.exports = {
    'extends': [
        'plugin:vue/essential', // where applicable
        'eslint:recommended',
        '@vue/standard', // where applicable
        'plugin:vue/strongly-recommended'
    ],
    rules: {
        'vue/html-closing-bracket-newline': [
            'error', {
                'singleline': 'never',
                'multiline': 'never'
            }
        ],
        'vue/html-indent': [
            'error', 4, {
                'attribute': 1,
                'baseIndent': 1,
                'closeBracket': 0,
                'alignAttributesVertically': true,
                'ignores': []
            }
        ],
        // These rules assume eslint recommended, if the rules is accepted from
        // eslint:recommended settings it is commented out and noted to the right of
        /*
         * the rule. This is intended to not overwrite any accepted rules.
         * 0 indicates no action, 1 is a warning, and 2 is an error.
         */
        /* possible error section */
        /*
         * 'for-direction': 0, // eslint:recommended
         * 'getter-return': 2, // eslint:recommended
         */
        'no-async-promise-executor': 2,
        'vue/attribute-hyphenation': 0,
        'no-await-in-loops': 0,
        /*
         * 'no-compare-neg-zero': 1, // eslint:recommended
         * 'no-cond-assign': 0, // eslint:recommended
         */
        // Revert no-console once console statements are fixed
        // 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'no-console': 'off',
        'no-constant-condition': 2,
        // 'no-control-regex': 2, // eslint:recommended
        'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        /*
         * 'no-dupe-args': 2, // eslint:recommended
         * 'no-dupe-keys': 2 // eslint:recommended
         * 'no-duplicate-case': 2, // eslint:recommended
         * 'no-empty': 2, // eslint:recommended
         * 'no-empty-character-class': 2, // eslint:recommended
         * 'no-ex-assign': 2, // eslint:recommended
         * 'no-extra-boolean-cast': 2, // eslint:recommended
         * 'no-ex-assign': 2, // eslint:recommended
         */
        'import/no-webpack-loader-syntax': 0,
        'no-extra-parens': 2,
        'no-extra-semi': 2, // eslint:recommended
        /*
         * 'no-function-assign': 2, // eslint:recommended
         * 'no-invalid-regexp': 2, // eslint:recommended
         */
        'no-inner-declarations': 0, // eslint:recommended
        'no-irregular-whitespace': 2, // eslint:recommended
        /*
         * 'no-misleading-character-class': 0,
         * 'no-object-calls': 2, // eslint:recommended
         * 'no-protoype-bulletins': 0,
         * 'no-regex-spaces': 2, // eslint:recommended
         * 'no-sparse-arrays': 2, // eslint:recommended
         * 'no-template-curly-in-string': 2, // eslint:recommended
         * 'no-unexpected-multiline': 2, // eslint:recommended
         * 'no-unreachable': 2, // eslint:recommended
         * 'no-unsafe-funally': 2, // eslint:recommended
         * 'require-atomic-updates': 2, // eslint:recommended
         * 'use-isnan': 2, // eslint:recommended
         * 'valid-typeof': 2, // eslint:recommended
         */

        /** *** best practices *****/
        /*
         * 'accessor-pairs': 0,
         * 'array-callback-return': 0,
         * 'blocked-scoped-var': 0,
         * 'class-methods-use-this': 0,
         * 'complexity': 0,
         * 'consistent-return': 0,
         * 'curly': 2,  // eslint: recommended
         */
        'default-case': 2,
        'vue/valid-v-for':0,
        'vue/require-v-for-key':0,
        'vue/require-default-prop':0,
        /*
         * 'dot-location': 2 // eslint: recommended
         * 'dot-notation': 2 // eslint: recommended
         * 'eqeqeq': 2 // eslint: recommended
         * 'guard-for-in': 2, // ?? double check me - require for-in loops to include an if statement
         * 'max-classes-per-file': 0,
         * 'no-alert': 0,
         */
        'no-caller': 2, // Notes: deprecated
        /*
         * 'no-case-declarations': 2, // eslint: recommended
         * 'no-div-regex': 0,
         * 'no-else-return': 0,
         * 'no-empty-function': 0,
         * 'no-empty-pattern': 0, // eslint: recommended
         * 'no-eq-null': 0,
         */
        'no-eval': 1, // 5.8 Warning: Do not use the eval keyword without a really good reason.
        /*
         * 'no-extend-native': 2,  // ?? double check - disallow extending native types
         * 'no-extra-bind': 2,  // ?? double check - disallow unnecessary calls to .bind()
         * 'no-extra-label': 0,
         */
        'no-fallthrough': 1, // Set to warn: 5.7 allows fallthrough cases requires stated
        /*
         * 'no-floating-decimal': 0,
         * 'no-global-assign': 2, // eslint: recommended
         * 'no-implicit-coercion': 0,
         * 'no-implicit-globals': 0,
         * 'no-implied-eval': 0,
         * 'no-invalid-this': 2, // ?? double check - disallow this keywords outside of classes or class-like objects
         * 'no-iterator': 0,
         * 'no-labels': 0,
         * 'no-lone-blocks': 0,
         * 'no-loop-func: 0,
         * 'no-magic-numbers': 0,
         */
        'no-multi-spaces': 2, // Notes: disallow multiple spaces
        'no-multi-str': 2, // 4.6 Disallow Multiline Strings (no-multi-str)
        'no-redeclare': 0, // eslint: recommended
        'no-proto': 0,
        /*
         *'no-new': 0,
         * 'no-new-func': 0,
         * 'no-new-wrappers': 2,  // 5.8 Dissalowed
         * 'no-octal': 2, // eslint: recommended
         * 'no-octal-escape': 0,
         * 'no-param-reassign': 0,
         *
         *
         * 'no-restricted-properties': 0,
         * 'no-return-assign': 0,
         * 'no-return-await': 0,
         * 'no-script-url': 0,
         * 'no-self-assign': 2, // eslint: recommended
         * 'no-self-compare': 0,
         * 'no-sequences': 0,
         * 'no-throw-literal': 2, // notes: disallow throwing literals as exceptions
         * 'no-unified-loop-condition': 0,
         * 'no-unused-expressions': 0,
         * 'no-unused-labels': 2, // eslint: recommended
         * 'no-no-useless-call': 0,
         * 'no-useless-catch': 0,
         * 'no-useless-concat': 0,
         * 'no-useless-escape': 2, // eslint: recommended
         * 'no-useless-return': 0,
         * 'no-void': 0,
         * 'no-warning-comments': 0,
         */
        'no-with': 2,
        /*
         * 'no-prefer-promise-reject-errors': 2, notes: require using Error objects as Promise rejection reasons
         * 'no-radix': 0,
         * 'no-require-await': 0,
         * 'no-require-unicode-regexp': 0,
         * 'no-vars-on-top': 0,
         * 'no-wrap-life': 0,
         * 'no-yoda': 0,
         */

        /** ** strict mode ****/
        // 'strict': 0,

        /** ** variables ****/
        /*
         * 'init-declarations': 0,
         * 'no-delete-var': 2,   // eslint: recommended
         * 'no-label-var': 0,
         * 'no-restricted-globals': 0,
         * 'no-shadow': 0,
         * 'no-shadow-restricted-names': 0,
         *
         * 'no-indef-init': 0,
         * 'no-undefined': 0,
         */
        'no-undef': 0, // eslint: recommended
        'require-default-prop':0,
        'no-unused-vars': 1, // eslint: recommended --- check
        // 'no-use-before-define': 0,

        /* Node.js and CommonJS */
        /*
         * 'callback-return': 0,
         * 'global-require': 0,
         * 'handle-callback-err': 0,
         * 'no-buffer-constructor': 0,
         * 'no-mixed-requires': 0,
         * 'no-new-require': 0,
         * 'no-path-concat': 0,
         * 'no-process-env': 0,
         * 'no-process-exit': 0,
         * 'no-restricted-modules': 0,
         * 'no-sync': ,
         */

        /** ** stylistic ****/
        'array-bracket-newline': 2, // notes: 3.1
        /*
         * 'array-bracket-spacing': 0, // no rule: enforce consistent spacing inside array brackets
         * 'array-element-newline': 0, // no rule: enforce line breaks after each array element
         * 'block-spacing': 0, // no rule
         */
        'brace-style': 2, // Notes: The presumed 'one true brace style' seemds to fit  3.1
        'camelcase': [
            1, {
                properties: 'always'
            }
        ], // notes: double check properties, not mentioned in 1.1
        // 'capitalized-comments': 0, // no rule
        'comma-dangle': [2, 'never'], // 4.2
        'comma-spacing': [
            2, {
                'before': false,
                'after': true
            }
        ], // 3.6.2
        'comma-style': [2, 'last'], // 3.6.2
        'computed-property-spacing': [2, 'never'], // double check 3.6.2
        // 'consistent-this': 0,
        'eol-last': 0, // double check me not explictely stated from what I can see
        'func-call-spacing': [2, 'never'], // 3.6.2 trailing whitespace forbidden without exception
        /*
         * 'func-name-matching': 0,
         * 'func-names': 0,
         * 'function-paren-newline': 0, // notes: dependant on case
         * 'func-style': 0, // both allowed
         * 'id-blacklist': 0, // none for now
         * 'id-length': 0,
         * 'id-match': 0,
         */
        'indent': ['error', 4],
        // 'jsx-quotes': 0, // depends
        'key-spacing': 2, // 3.6.2
        'keyword-spacing': 2, // 3.6.2
        /*
         * 'line-comment-position': 0, // 3.6.2 above and below are accepted
         * 'linebreak-style': 2,
         * 'lines-around-comment': 0,
         * 'lines-between-class-members': 0,
         * 'max-depth': 0,
         */
        'max-len': [
            2, { // should we ignore urls or anything here?
                code: 2400,
                tabWidth: 4
            }
        ],
        /*
         * 'max-lines': 0,
         * 'max-lines-per-function': 0,
         * 'max-nested-callbacks': 0,
         * 'max-params': 0,
         * 'max-statements': 0,
         * 'max-statements-per-line': 0,
         * 'multiline-comment-style': [2, 'starred-block'],
        */
        /*
         * 'multiline-ternary': 0,
         * 'new-cap': 2, // use array declarative instead
         * 'new-parens': 0, // same as above
         * 'newline-per-chained-call': 0, // notes: we do this in cass with d3, but not explicitely stated
         */
        'no-array-constructor': 2, // use array declarative instead
        /*
         * 'no-bitwise': 0,
         * 'no-continue': 0,
         * 'no-inline-comments': 0,
         * 'no-lonely-if': 0,
         * 'no-mixed-operators': 0,
         */
        'no-mixed-spaces-and-tabs': 2, // eslint:recommended
        // 'no-multi-assign': 0,
        'no-multiple-empty-lines': [
            1, {
                max: 2
            }
        ], // 3.6.1 permitted but not encouraged set to warn
        /*
         * 'no-negated-condition': 0,
         * 'no-nested-ternary': 0,
         */
        'no-new-object': 2, // 4.3
        /*
         * 'no-plusplus': 0,
         * 'no-restricted-syntax': 0,
         */
        'no-tabs': 2,
        // 'no-ternary': 0,
        'no-trailing-spaces': 2,
        /*
         * 'no-underscore-dangle': 0,
         * 'no-unneeded-ternary': 0,
         * 'no-whitespace-before-property': 0,
         * 'nonblock-statement-body-position': 0,
         * 'object-curly-newline': 0,
         */
        'object-curly-spacing': [2, 'never'], // 3.6.2 double check exceptions
        // 'object-property-newline': 0,
        'one-var': [
            2, { // 4.1
                var: 'never',
                let: 'never',
                const: 'never'
            }
        ],
        /*
         * 'one-var-declaration-per-line': 2, // not required because of above rule
         * 'operator-assignment': 0,
         * 'operator-linebreak': 0,
         */
        'padded-blocks': [2, 'never'], // 3.6.1 implied?
        /*
         * 'padding-line-between-statements': 0,
         * 'prefer-object-spread': 0,
         * 'quote-props': [2, 'consistent'],   // 4.3 should we make this consistent by object but not by file?
         *
         */
        'quotes': [0, 'single', {
            allowTemplateLiterals: true
        }], // not reinforced
        'semi': [2, 'always'], // require semicol
        'semi-spacing': 2, // 3.6.2
        /*
         * 'semi-style': 0,
         * 'sort-keys': 0,
         * 'sort-vars': 0,
         */
        'space-before-blocks': 2, // 3.6.2
        'space-before-function-paren': [
            2, { // double check 3.6.2
                asyncArrow: 'never',
                anonymous: 'never',
                named: 'never'
            }
        ],
        /*
         * 'space-in-parens': 0,
         * 'space-infix-ops': 0,
         * 'space-unary-ops': 0,
         */
        'spaced-comment': [2, 'always'] // 2.3
        /*
         * 'switch-colon-spacing': 2, // 5.7.2 no rule
         * 'template-tag-spacing': 0,
         * 'unicode-bom': 0,
         * 'wrap-regex': 0,
         */

    },
    parserOptions: {
        parser: 'babel-eslint'
    }
};<|endoftext|>


<commit_before>// Components

const InputDate = FocusComponents.components.input.Date;

const locale = {
    format: 'L',
    months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
    monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
    weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
    weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
    weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
    longDateFormat : {
        LT : 'HH:mm',
        LTS : 'HH:mm:ss',
        L : 'DD/MM/YYYY',
        LL : 'D MMMM YYYY',
        LLL : 'D MMMM YYYY HH:mm',
        LLLL : 'dddd D MMMM YYYY HH:mm'
    },
    calendar : {
        sameDay: '[Aujourd\'hui à] LT',
        nextDay: '[Demain à] LT',
        nextWeek: 'dddd [à] LT',
        lastDay: '[Hier à] LT',
        lastWeek: 'dddd [dernier à] LT',
        sameElse: 'L'
    },
    relativeTime : {
        future : 'dans %s',
        past : 'il y a %s',
        s : 'quelques secondes',
        m : 'une minute',
        mm : '%d minutes',
        h : 'une heure',
        hh : '%d heures',
        d : 'un jour',
        dd : '%d jours',
        M : 'un mois',
        MM : '%d mois',
        y : 'un an',
        yy : '%d ans'
    },
    ordinalParse: /\d{1,2}(er|)/,
    ordinal : function (number) {
        return number + (number === 1 ? 'er' : '');
    },
    week : {
        dow : 1, // Monday is the first day of the week.
        doy : 4  // The week that contains Jan 4th is the first week of the year.
    }
}

class InputDateSample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            date1 : moment().toISOString()
        }
    }

    changeHandler = (id) => {
        return value => {
            const {isValid, message} = this.refs[`date${id}`].validate(value);
                this.setState({
                    [`date${id}`]: value,
                    [`error${id}`]: isValid ? null : message
                });
        }
    }

    render = () => {
        const {date1, error1} = this.state;
        return (

With value

                <InputDate error={error1} locale={locale} name='date1' onChange={this.changeHandler(1)} ref='date1' value={date1} />

        );
    }
}

return <InputDateSample/>;
<commit_msg>[date] Fix example<commit_after>// Components

const InputDate = FocusComponents.components.input.Date;

class InputDateSample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            date1 : moment().toISOString()
        }
    }

    changeHandler = (id) => {
        return value => {
            const {isValid, message} = this.refs[`date${id}`].validate();
                this.setState({
                    [`date${id}`]: value,
                    [`error${id}`]: isValid ? null : message
                });
        }
    }

    render = () => {
        const {date1, error1} = this.state;
        return (

With value

                <InputDate error={error1} format='DD/MM/YYYY' locale='fr' name='date1' onChange={this.changeHandler(1)} ref='date1' value={date1} />

        );
    }
}

return <InputDateSample/>;
<|endoftext|>


<commit_before>/*
 *  @module BaseObject
 *  @desc Represents a base object
 *  @copyright (C) SpilGames
 *  @license BSD 3-Clause License (see LICENSE file in project root)
 */
glue.module.create(
    'glue/baseobject', [
        'glue',
        'glue/math/vector',
        'glue/math/rectangle',
        'glue/math/dimension',
        'glue/math/matrix'
    ],
    function (Glue, Vector, Rectangle, Dimension, Matrix) {
        var Sugar = Glue.sugar,
            crossInstanceID = 0;
        return function () {
            var name,
                active = true,
                visible = true,
                mixins = Array.prototype.slice.call(arguments),
                mixin = null,
                position = Vector(0, 0),
                origin = Vector(0, 0),
                dimension = Dimension(0, 0),
                rectangle,
                l = mixins.length,
                i = 0,
                j = 0,
                typeRegistrants,
                typeRegistrantsLength,
                typeRegistrant,
                acceptedTypes = ['update', 'draw', 'pointerDown', 'pointerMove', 'pointerUp'],
                drawLast = ['animatable', 'spritable', 'spineable'],
                d,
                dLength = drawLast.length,
                drawRegistrant,
                registrants = {
                    destroy: {},
                    draw: {},
                    update: {},
                    pointerDown: {},
                    pointerMove: {},
                    pointerUp: {}
                },
                children = [],
                removedChildren = [],
                parent = null,
                uniqueID = ++crossInstanceID,
                callRegistrants = function (type, gameData) {
                    var registrant;
                    typeRegistrants = registrants[type];
                    for (registrant in typeRegistrants) {
                        if (type === 'draw' && Sugar.contains(drawLast, registrant)) {
                            continue;
                        }
                        typeRegistrants[registrant].call(module, gameData);
                    }
                },
                transformEvent = function (evt) {
                    // consideration: it might be too expensive to clone the event object
                    var e = Sugar.clone(evt),
                        positionVector = e.position.toMatrix(),
                        translateMatrix = Matrix(3, 3),
                        scaleMatrix = Matrix(3, 3),
                        rotateMatrix = Matrix(3, 3),
                        sin,
                        cos,
                        type;

                    /**
                     * reverse transformation
                     */
                    // construct a translation matrix and apply to position vector
                    translateMatrix.set(2, 0, -position.x);
                    translateMatrix.set(2, 1, -position.y);
                    positionVector.multiply(translateMatrix);
                    // only scale/rotatable if there is a component
                    for (type in registrants.draw) {
                        if (type === 'rotatable') {
                            // construct a rotation matrix and apply to position vector
                            sin = Math.sin(-module.rotatable.getAngleRadian());
                            cos = Math.cos(-module.rotatable.getAngleRadian());
                            rotateMatrix.set(0, 0, cos);
                            rotateMatrix.set(1, 0, -sin);
                            rotateMatrix.set(0, 1, sin);
                            rotateMatrix.set(1, 1, cos);
                            positionVector.multiply(rotateMatrix);
                        }
                        if (type === 'scalable') {
                            // construct a scaling matrix and apply to position vector
                            scaleMatrix.set(0, 0, 1 / module.scalable.getScale().x);
                            scaleMatrix.set(1, 1, 1 / module.scalable.getScale().y);
                            positionVector.multiply(scaleMatrix);
                        }
                    }

                    e.position.x = positionVector.get(0, 0);
                    e.position.y = positionVector.get(0, 1);

                    // pass parent
                    e.parent = evt;
                    return e;
                },
                removeChildren = function () {
                    var i, object;
                    for (i = 0; i < removedChildren.length; ++i) {
                        object = removedChildren[i];
                        if (Sugar.isFunction(object.destroy)) {
                            object.destroy();
                        }
                        Sugar.removeObject(children, object);
                    }
                    removedChildren.length = 0;
                },
                module = {
                    add: function (object) {
                        return Sugar.combine(this, object);
                    },
                    setName: function (value) {
                        name = value;
                    },
                    getName: function (value) {
                        return name;
                    },
                    update: function (gameData) {
                        var i,
                            l;
                        if (!active) {
                            return;
                        }
                        callRegistrants('update', gameData);
                        // clean up
                        removeChildren();
                        // update children
                        for (i = 0, l = children.length; i < l; ++i) {
                            children[i].update(gameData);
                        }

                    },
                    count: 0,
                    updateWhenPaused: false,
                    draw: function (gameData) {
                        var scroll = gameData.scroll || Vector(0, 0),
                            context = gameData.context,
                            i,
                            l;
                        if (!visible) {
                            return;
                        }
                        context.save();
                        context.translate(Math.round(position.x), Math.round(position.y));

                        // scroll (only applies to parent objects)
                        if (parent === null) {
                            context.translate(Math.round(-scroll.x), Math.round(-scroll.y));
                        }

                        // draws rotatable, scalable etc.
                        callRegistrants('draw', gameData);

                        // translate to origin
                        context.translate(Math.round(-origin.x), Math.round(-origin.y));

                        // draws animatable and spritable
                        for (d = 0; d < dLength; ++d) {
                            drawRegistrant = registrants.draw[drawLast[d]];
                            if (drawRegistrant) {
                                drawRegistrant(gameData);
                            }
                        }

                        // translate back from origin before drawing children
                        context.translate(Math.round(origin.x), Math.round(origin.y));
                        // draw children
                        for (i = 0, l = children.length; i < l; ++i) {
                            children[i].draw(gameData);
                        }

                        context.restore();
                    },
                    pointerDown: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerDown', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerDown(childEvent);
                            }
                        }
                    },
                    pointerMove: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerMove', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerMove(childEvent);
                            }
                        }
                    },
                    pointerUp: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerUp', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerUp(childEvent);
                            }
                        }
                    },
                    register: function (type, registrant, name) {
                        if (Sugar.contains(acceptedTypes, type) && Sugar.isFunction(registrant)) {
                            registrants[type][name] = registrant;
                        }
                    },
                    unregister: function (type, name) {
                        if (Sugar.contains(acceptedTypes, type) &&
                            Sugar.isFunction(registrants[type][name])) {
                            delete registrants[type][name];
                        }
                    },
                    getPosition: function () {
                        return position;
                    },
                    setPosition: function (value) {
                        if (Sugar.isVector(value)) {
                            position.x = value.x;
                            position.y = value.y;
                            this.updateBoundingBox();
                        }
                    },
                    setPositionObject: function (value) {
                        if (Sugar.isVector(value)) {
                            position = value;
                            this.updateBoundingBox();
                        }
                    },
                    getDimension: function () {
                        return dimension;
                    },
                    setDimension: function (value) {
                        if (Sugar.isDimension(value)) {
                            dimension = value;
                            this.updateBoundingBox();
                        }
                    },
                    getBoundingBox: function () {
                        return rectangle;
                    },
                    setBoundingBox: function (value) {
                        if (active) {
                            rectangle = value;
                        }
                    },
                    updateBoundingBox: function () {
                        var scale = module.scalable ? module.scalable.getScale() : Vector(1, 1),
                            x1 = position.x - origin.x * scale.x,
                            y1 = position.y - origin.y * scale.y,
                            x2 = position.x + (dimension.width - origin.x) * scale.x,
                            y2 = position.y + (dimension.height - origin.y) * scale.y;
                        if (!active) {
                            return;
                        }
                        // swap variables if scale is negative
                        if (scale.x < 0) {
                            x2 = [x1, x1 = x2][0];
                        }
                        if (scale.y < 0) {
                            y2 = [y1, y1 = y2][0];
                        }
                        rectangle = Rectangle(x1, y1, x2, y2);
                    },
                    setOrigin: function (value) {
                        if (Sugar.isVector(value)) {
                            origin.x = Sugar.isNumber(value.x) ? value.x : origin.x;
                            origin.y = Sugar.isNumber(value.y) ? value.y : origin.y;
                            this.updateBoundingBox();
                        }
                    },
                    getOrigin: function () {
                        return origin;
                    },
                    isActive: function () {
                        return active;
                    },
                    setActive: function (value) {
                        if (Sugar.isBoolean(value)) {
                            active = value;
                        } else {
                            throw "value should be a boolean";
                        }
                    },
                    isVisible: function () {
                        return visible;
                    },
                    setVisible: function (value) {
                        if (Sugar.isBoolean(value)) {
                            visible = value;
                        } else {
                            throw "value should be a boolean";
                        }
                    },
                    addChild: function (baseObject) {
                        children.push(baseObject);
                        baseObject.setParent(this);

                        if (baseObject.init) {
                            baseObject.init();
                        }
                    },
                    removeChild: function (baseObject) {
                        removedChildren.push(baseObject);
                    },
                    getChildren: function () {
                        return children;
                    },
                    setParent: function (obj) {
                        parent = obj;
                    },
                    getParent: function () {
                        return parent;
                    },
                    getID: function () {
                        return uniqueID;
                    }
                };

            for (i; i < l; ++i) {
                mixin = mixins[i];
                mixin(module);
            }
            return module;
        };
    }
);<commit_msg>Bounding box issue fixed<commit_after>/*
 *  @module BaseObject
 *  @desc Represents a base object
 *  @copyright (C) SpilGames
 *  @license BSD 3-Clause License (see LICENSE file in project root)
 */
glue.module.create(
    'glue/baseobject', [
        'glue',
        'glue/math/vector',
        'glue/math/rectangle',
        'glue/math/dimension',
        'glue/math/matrix'
    ],
    function (Glue, Vector, Rectangle, Dimension, Matrix) {
        var Sugar = Glue.sugar,
            crossInstanceID = 0;
        return function () {
            var name,
                active = true,
                visible = true,
                mixins = Array.prototype.slice.call(arguments),
                mixin = null,
                position = Vector(0, 0),
                origin = Vector(0, 0),
                dimension = Dimension(0, 0),
                rectangle,
                l = mixins.length,
                i = 0,
                j = 0,
                typeRegistrants,
                typeRegistrantsLength,
                typeRegistrant,
                acceptedTypes = ['update', 'draw', 'pointerDown', 'pointerMove', 'pointerUp'],
                drawLast = ['animatable', 'spritable', 'spineable'],
                d,
                dLength = drawLast.length,
                drawRegistrant,
                registrants = {
                    destroy: {},
                    draw: {},
                    update: {},
                    pointerDown: {},
                    pointerMove: {},
                    pointerUp: {}
                },
                children = [],
                removedChildren = [],
                parent = null,
                uniqueID = ++crossInstanceID,
                callRegistrants = function (type, gameData) {
                    var registrant;
                    typeRegistrants = registrants[type];
                    for (registrant in typeRegistrants) {
                        if (type === 'draw' && Sugar.contains(drawLast, registrant)) {
                            continue;
                        }
                        typeRegistrants[registrant].call(module, gameData);
                    }
                },
                transformEvent = function (evt) {
                    // consideration: it might be too expensive to clone the event object
                    var e = Sugar.clone(evt),
                        positionVector = e.position.toMatrix(),
                        translateMatrix = Matrix(3, 3),
                        scaleMatrix = Matrix(3, 3),
                        rotateMatrix = Matrix(3, 3),
                        sin,
                        cos,
                        type;

                    /**
                     * reverse transformation
                     */
                    // construct a translation matrix and apply to position vector
                    translateMatrix.set(2, 0, -position.x);
                    translateMatrix.set(2, 1, -position.y);
                    positionVector.multiply(translateMatrix);
                    // only scale/rotatable if there is a component
                    for (type in registrants.draw) {
                        if (type === 'rotatable') {
                            // construct a rotation matrix and apply to position vector
                            sin = Math.sin(-module.rotatable.getAngleRadian());
                            cos = Math.cos(-module.rotatable.getAngleRadian());
                            rotateMatrix.set(0, 0, cos);
                            rotateMatrix.set(1, 0, -sin);
                            rotateMatrix.set(0, 1, sin);
                            rotateMatrix.set(1, 1, cos);
                            positionVector.multiply(rotateMatrix);
                        }
                        if (type === 'scalable') {
                            // construct a scaling matrix and apply to position vector
                            scaleMatrix.set(0, 0, 1 / module.scalable.getScale().x);
                            scaleMatrix.set(1, 1, 1 / module.scalable.getScale().y);
                            positionVector.multiply(scaleMatrix);
                        }
                    }

                    e.position.x = positionVector.get(0, 0);
                    e.position.y = positionVector.get(0, 1);

                    // pass parent
                    e.parent = evt;
                    return e;
                },
                removeChildren = function () {
                    var i, object;
                    for (i = 0; i < removedChildren.length; ++i) {
                        object = removedChildren[i];
                        if (Sugar.isFunction(object.destroy)) {
                            object.destroy();
                        }
                        Sugar.removeObject(children, object);
                    }
                    removedChildren.length = 0;
                },
                module = {
                    add: function (object) {
                        return Sugar.combine(this, object);
                    },
                    setName: function (value) {
                        name = value;
                    },
                    getName: function (value) {
                        return name;
                    },
                    update: function (gameData) {
                        var i,
                            l;
                        if (!active) {
                            return;
                        }
                        callRegistrants('update', gameData);
                        // clean up
                        removeChildren();
                        // update children
                        for (i = 0, l = children.length; i < l; ++i) {
                            children[i].update(gameData);
                        }

                    },
                    count: 0,
                    updateWhenPaused: false,
                    draw: function (gameData) {
                        var scroll = gameData.scroll || Vector(0, 0),
                            context = gameData.context,
                            i,
                            l;
                        if (!visible) {
                            return;
                        }
                        context.save();
                        context.translate(Math.round(position.x), Math.round(position.y));

                        // scroll (only applies to parent objects)
                        if (parent === null) {
                            context.translate(Math.round(-scroll.x), Math.round(-scroll.y));
                        }

                        // draws rotatable, scalable etc.
                        callRegistrants('draw', gameData);

                        // translate to origin
                        context.translate(Math.round(-origin.x), Math.round(-origin.y));

                        // draws animatable and spritable
                        for (d = 0; d < dLength; ++d) {
                            drawRegistrant = registrants.draw[drawLast[d]];
                            if (drawRegistrant) {
                                drawRegistrant(gameData);
                            }
                        }

                        // translate back from origin before drawing children
                        context.translate(Math.round(origin.x), Math.round(origin.y));
                        // draw children
                        for (i = 0, l = children.length; i < l; ++i) {
                            children[i].draw(gameData);
                        }

                        context.restore();
                    },
                    pointerDown: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerDown', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerDown(childEvent);
                            }
                        }
                    },
                    pointerMove: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerMove', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerMove(childEvent);
                            }
                        }
                    },
                    pointerUp: function (e) {
                        var i,
                            l = children.length,
                            childEvent,
                            pos;
                        if (!active) {
                            return;
                        }
                        callRegistrants('pointerUp', e);

                        if (l) {
                            childEvent = transformEvent(e);
                            // pass through children
                            for (i = 0; i < l; ++i) {
                                children[i].pointerUp(childEvent);
                            }
                        }
                    },
                    register: function (type, registrant, name) {
                        if (Sugar.contains(acceptedTypes, type) && Sugar.isFunction(registrant)) {
                            registrants[type][name] = registrant;
                        }
                    },
                    unregister: function (type, name) {
                        if (Sugar.contains(acceptedTypes, type) &&
                            Sugar.isFunction(registrants[type][name])) {
                            delete registrants[type][name];
                        }
                    },
                    getPosition: function () {
                        return position;
                    },
                    setPosition: function (value) {
                        if (Sugar.isVector(value)) {
                            position.x = value.x;
                            position.y = value.y;
                            this.updateBoundingBox();
                        }
                    },
                    setPositionObject: function (value) {
                        if (Sugar.isVector(value)) {
                            position = value;
                            this.updateBoundingBox();
                        }
                    },
                    getDimension: function () {
                        return dimension;
                    },
                    setDimension: function (value) {
                        if (Sugar.isDimension(value)) {
                            dimension = value;
                            this.updateBoundingBox();
                        }
                    },
                    getBoundingBox: function () {
                        return rectangle;
                    },
                    setBoundingBox: function (value) {
                        rectangle = value;
                    },
                    updateBoundingBox: function () {
                        var scale = module.scalable ? module.scalable.getScale() : Vector(1, 1),
                            x1 = position.x - origin.x * scale.x,
                            y1 = position.y - origin.y * scale.y,
                            x2 = position.x + (dimension.width - origin.x) * scale.x,
                            y2 = position.y + (dimension.height - origin.y) * scale.y;

                        // swap variables if scale is negative
                        if (scale.x < 0) {
                            x2 = [x1, x1 = x2][0];
                        }
                        if (scale.y < 0) {
                            y2 = [y1, y1 = y2][0];
                        }
                        rectangle = Rectangle(x1, y1, x2, y2);
                    },
                    setOrigin: function (value) {
                        if (Sugar.isVector(value)) {
                            origin.x = Sugar.isNumber(value.x) ? value.x : origin.x;
                            origin.y = Sugar.isNumber(value.y) ? value.y : origin.y;
                            this.updateBoundingBox();
                        }
                    },
                    getOrigin: function () {
                        return origin;
                    },
                    isActive: function () {
                        return active;
                    },
                    setActive: function (value) {
                        if (Sugar.isBoolean(value)) {
                            active = value;
                        } else {
                            throw "value should be a boolean";
                        }
                    },
                    isVisible: function () {
                        return visible;
                    },
                    setVisible: function (value) {
                        if (Sugar.isBoolean(value)) {
                            visible = value;
                        } else {
                            throw "value should be a boolean";
                        }
                    },
                    addChild: function (baseObject) {
                        children.push(baseObject);
                        baseObject.setParent(this);

                        if (baseObject.init) {
                            baseObject.init();
                        }
                    },
                    removeChild: function (baseObject) {
                        removedChildren.push(baseObject);
                    },
                    getChildren: function () {
                        return children;
                    },
                    setParent: function (obj) {
                        parent = obj;
                    },
                    getParent: function () {
                        return parent;
                    },
                    getID: function () {
                        return uniqueID;
                    }
                };

            for (i; i < l; ++i) {
                mixin = mixins[i];
                mixin(module);
            }
            return module;
        };
    }
);<|endoftext|>


<commit_before>module.exports = {
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true,
        "mocha": true
    },
    "globals": {
        "FileTransfer": true,
        "cordova": true
    },
    "extends": "eslint:recommended",
    "rules": {
        "no-console": [
            "warn"
        ],
        "indent": [
            "error",
            "tab"
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "always"
        ]
    }
};<commit_msg>Added node to eslint<commit_after>module.exports = {
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true,
        "mocha": true,
        "node": true
    },
    "globals": {
        "FileTransfer": true,
        "cordova": true
    },
    "extends": "eslint:recommended",
    "rules": {
        "no-console": [
            "warn"
        ],
        "indent": [
            "error",
            "tab"
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "always"
        ]
    }
};
<|endoftext|>


<commit_before>// Copyright 2002-2013, University of Colorado Boulder

/**
 * Image plugin that loads an image dynamically from the file system at development time, but from base64 content after a build.
 * For development time, this is pretty similar to the image plugin at https://github.com/millermedeiros/requirejs-plugins
 *
 * The plugin code itself is excluded from the build by declaring it as a stubModule.
 *
 * @author Sam Reid
 */
define( function( require ) {
  'use strict';

  //Paths are relative to the requirejs config.js file
  var loadFileAsDataURI = require( '../../chipper/js/requirejs-plugins/loadFileAsDataURI' );
  var getProjectURL = require( '../../chipper/js/requirejs-plugins/getProjectURL' );

  //Keep track of the images that are used during dependency resolution so they can be converted to base64 at compile time
  var buildMap = {};

  return {
    load: function( name, parentRequire, onload, config ) {
      var imageName = name.substring( name.lastIndexOf( '/' ) );
      var path = getProjectURL( name, parentRequire ) + 'images' + imageName;

      if ( config.isBuild ) {
        buildMap[ name ] = path;
        onload( null );
      }
      else {
        var image = document.createElement( 'img' );
        image.onerror = function( error ) {
          console.log( 'failed to load image: ' + path );
          onload.error( error );
        };
        image.onload = function() {
          onload( image );
          delete image.onload;
        };
        image.src = path + '?' + config.urlArgs;
      }
    },

    //write method based on RequireJS official text plugin by James Burke
    //https://github.com/jrburke/requirejs/blob/master/text.js
    write: function( pluginName, moduleName, write ) {
      if ( moduleName in buildMap ) {
        var content = buildMap[ moduleName ];

        var base64 = loadFileAsDataURI( content );

        //Write code that will load the image and register with a global `phetImages` to make sure everything loaded, see SimLauncher.js
        write( 'define("' + pluginName + '!' + moduleName + '", function(){ ' +
               'var img = new Image();\n' +
               'window.phetImages = window.phetImages || []\n' +
               'window.phetImages.push(img);\n' +
               'img.src=\'' + base64 + '\';\n' +
               'return img;});\n' );
      }
    }

  };
} );
<commit_msg>Try-catch around deleting image.onload for Safari 6.1<commit_after>// Copyright 2002-2013, University of Colorado Boulder

/**
 * Image plugin that loads an image dynamically from the file system at development time, but from base64 content after a build.
 * For development time, this is pretty similar to the image plugin at https://github.com/millermedeiros/requirejs-plugins
 *
 * The plugin code itself is excluded from the build by declaring it as a stubModule.
 *
 * @author Sam Reid
 */
define( function( require ) {
  'use strict';

  //Paths are relative to the requirejs config.js file
  var loadFileAsDataURI = require( '../../chipper/js/requirejs-plugins/loadFileAsDataURI' );
  var getProjectURL = require( '../../chipper/js/requirejs-plugins/getProjectURL' );

  //Keep track of the images that are used during dependency resolution so they can be converted to base64 at compile time
  var buildMap = {};

  return {
    load: function( name, parentRequire, onload, config ) {
      var imageName = name.substring( name.lastIndexOf( '/' ) );
      var path = getProjectURL( name, parentRequire ) + 'images' + imageName;

      if ( config.isBuild ) {
        buildMap[ name ] = path;
        onload( null );
      }
      else {
        var image = document.createElement( 'img' );
        image.onerror = function( error ) {
          console.log( 'failed to load image: ' + path );
          onload.error( error );
        };
        image.onload = function() {
          onload( image );

          // try-catch for older browsers like Safari 6.1
          try {
            delete image.onload;
          }
          catch ( e ) {}
        };
        image.src = path + '?' + config.urlArgs;
      }
    },

    //write method based on RequireJS official text plugin by James Burke
    //https://github.com/jrburke/requirejs/blob/master/text.js
    write: function( pluginName, moduleName, write ) {
      if ( moduleName in buildMap ) {
        var content = buildMap[ moduleName ];

        var base64 = loadFileAsDataURI( content );

        //Write code that will load the image and register with a global `phetImages` to make sure everything loaded, see SimLauncher.js
        write( 'define("' + pluginName + '!' + moduleName + '", function(){ ' +
               'var img = new Image();\n' +
               'window.phetImages = window.phetImages || []\n' +
               'window.phetImages.push(img);\n' +
               'img.src=\'' + base64 + '\';\n' +
               'return img;});\n' );
      }
    }

  };
} );
<|endoftext|>


<commit_before>const globby = require("globby");
const fs = require("fs");
const path = require("path");

const ignoreFiles = globby.sync("src/packages/*/.eslintignore");

const ignorePatterns = flatten(
  flatten(
    ignoreFiles.map((f) => {
      const dir = path.dirname(f);
      return fs
        .readFileSync(f, "utf-8")
        .split("\n")
        .filter((l) => l.trim().length > 0)
        .map((l) => [l, `/${path.join(dir, l)}`]);
    })
  )
);

module.exports = {
  root: true,
  parser: "@typescript-eslint/parser",
  plugins: ["@typescript-eslint", "jest"],
  env: {
    node: true,
    es6: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:eslint-comments/recommended",
    "plugin:jest/recommended",
  ],
  parserOptions: {
    ecmaVersion: 2020,
    sourceType: "module",
    project: ["./src/packages/*/tsconfig.eslint.json"],
    // debugLevel: true,
  },
  ignorePatterns,
  overrides: [
    {
      files: ["*.ts"],
      extends: [
        "eslint:recommended",
        "plugin:@typescript-eslint/eslint-recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@typescript-eslint/recommended-requiring-type-checking",
        "plugin:prettier/recommended",
        "plugin:jest/recommended",
      ],
      rules: {
        "@typescript-eslint/no-use-before-define": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "no-useless-escape": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-var-requires": "off",
        "@typescript-eslint/no-unsafe-return": "off",
        // added at 2020/11/26
        "@typescript-eslint/no-unsafe-call": "off",
        "@typescript-eslint/no-unsafe-member-access": "off",
        "@typescript-eslint/no-unsafe-assignment": "off",
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "@typescript-eslint/ban-ts-comment": "off",
        "@typescript-eslint/no-empty-function": "off",
        "eslint-comments/no-unlimited-disable": "off",
        "eslint-comments/disable-enable-pair": "off",
        "@typescript-eslint/no-misused-promises": "off",
        "jest/expect-expect": "off",
        "no-empty": "off",
        "jest/valid-title": "off",
        "@typescript-eslint/no-unnecessary-type-assertion": "off",
        // low hanging fruits:
        "@typescript-eslint/ban-types": "off",
        "@typescript-eslint/restrict-plus-operands": "off",
        "@typescript-eslint/restrict-template-expressions": "off",
        "jest/no-conditional-expect": "off",
        "jest/no-try-expect": "off",
        "jest/no-export": "off",
        "@typescript-eslint/no-empty-interface": "off",
      },
    },
  ],
  settings: {
    jest: {
      version: 26,
    },
  },
};

function flatten(input) {
  const stack = [...input];
  const res = [];
  while (stack.length) {
    // pop value from stack
    const next = stack.pop();
    if (Array.isArray(next)) {
      // push back array items, won't modify the original input
      stack.push(...next);
    } else {
      res.push(next);
    }
  }
  // reverse to restore input order
  return res.reverse();
}
<commit_msg>chore: turn prettier errors into warnings for DX with GitHub UI edits (#7794)<commit_after>const globby = require("globby");
const fs = require("fs");
const path = require("path");

const ignoreFiles = globby.sync("src/packages/*/.eslintignore");

const ignorePatterns = flatten(
  flatten(
    ignoreFiles.map((f) => {
      const dir = path.dirname(f);
      return fs
        .readFileSync(f, "utf-8")
        .split("\n")
        .filter((l) => l.trim().length > 0)
        .map((l) => [l, `/${path.join(dir, l)}`]);
    })
  )
);

module.exports = {
  root: true,
  parser: "@typescript-eslint/parser",
  plugins: ["@typescript-eslint", "jest"],
  env: {
    node: true,
    es6: true,
  },
  extends: [
    "eslint:recommended",
    "plugin:eslint-comments/recommended",
    "plugin:jest/recommended",
  ],
  parserOptions: {
    ecmaVersion: 2020,
    sourceType: "module",
    project: ["./src/packages/*/tsconfig.eslint.json"],
    // debugLevel: true,
  },
  ignorePatterns,
  overrides: [
    {
      files: ["*.ts"],
      extends: [
        "eslint:recommended",
        "plugin:@typescript-eslint/eslint-recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:@typescript-eslint/recommended-requiring-type-checking",
        "plugin:prettier/recommended",
        "plugin:jest/recommended",
      ],
      rules: {
        "prettier/prettier": "warn",
        "@typescript-eslint/no-use-before-define": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "no-useless-escape": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-var-requires": "off",
        "@typescript-eslint/no-unsafe-return": "off",
        // added at 2020/11/26
        "@typescript-eslint/no-unsafe-call": "off",
        "@typescript-eslint/no-unsafe-member-access": "off",
        "@typescript-eslint/no-unsafe-assignment": "off",
        "@typescript-eslint/explicit-module-boundary-types": "off",
        "@typescript-eslint/ban-ts-comment": "off",
        "@typescript-eslint/no-empty-function": "off",
        "eslint-comments/no-unlimited-disable": "off",
        "eslint-comments/disable-enable-pair": "off",
        "@typescript-eslint/no-misused-promises": "off",
        "jest/expect-expect": "off",
        "no-empty": "off",
        "jest/valid-title": "off",
        "@typescript-eslint/no-unnecessary-type-assertion": "off",
        // low hanging fruits:
        "@typescript-eslint/ban-types": "off",
        "@typescript-eslint/restrict-plus-operands": "off",
        "@typescript-eslint/restrict-template-expressions": "off",
        "jest/no-conditional-expect": "off",
        "jest/no-try-expect": "off",
        "jest/no-export": "off",
        "@typescript-eslint/no-empty-interface": "off",
      },
    },
  ],
  settings: {
    jest: {
      version: 26,
    },
  },
};

function flatten(input) {
  const stack = [...input];
  const res = [];
  while (stack.length) {
    // pop value from stack
    const next = stack.pop();
    if (Array.isArray(next)) {
      // push back array items, won't modify the original input
      stack.push(...next);
    } else {
      res.push(next);
    }
  }
  // reverse to restore input order
  return res.reverse();
}
<|endoftext|>


<commit_before>import { Collection } from '../../../../lib/client'

const Todos = new Collection('todos')

window.Todos = Todos

export default Todos
<commit_msg>Remove from window<commit_after>import { Collection } from '../../../../lib/client'

export default new Collection('todos')
<|endoftext|>


<commit_before>module.exports = {
    "extends": "airbnb-base",
    "plugins": [
        "import"
    ]
};<commit_msg>old eslint config file deleted<commit_after><|endoftext|>