eslint / eslint

Find and fix problems in your JavaScript code.
https://eslint.org
MIT License
24.57k stars 4.44k forks source link

Different results on different environments #10070

Closed samcayford closed 6 years ago

samcayford commented 6 years ago

Tell us about your environment OSX 10.12.6 Node 9.7.1 docker image

What parser (default, Babel-ESLint, etc.) are you using? eslint

Please show your full configuration:

Configuration ``` module.exports = { // root forces this to be the last eslint config file looked for in the cascade "root": true, "extends": "eslint:recommended", "globals": { }, "rules": { "accessor-pairs": "error", "array-bracket-spacing": "error", "array-callback-return": "error", "arrow-body-style": "error", "arrow-parens": "error", "arrow-spacing": "error", "block-scoped-var": "error", "block-spacing": "error", "brace-style": [ "error", "stroustrup" ], "callback-return": "off", "camelcase": "error", "capitalized-comments": "off", "class-methods-use-this": "error", "comma-dangle": "error", "comma-spacing": [ "error", { "after": true, "before": false } ], "comma-style": [ "error", "last" ], "complexity": "error", "computed-property-spacing": [ "error", "never" ], "consistent-return": "off", "consistent-this": "off", "curly": "error", "default-case": "error", "dot-location": "error", "dot-notation": "error", "eol-last": "error", "eqeqeq": "error", "func-call-spacing": "error", "func-name-matching": "error", "func-names": [ "error", "never" ], "func-style": "error", "generator-star-spacing": "error", "global-require": "error", "guard-for-in": "error", "handle-callback-err": "error", "id-blacklist": "error", "id-length": "off", "id-match": "error", "indent": [ "error", 4, { "SwitchCase": 1 } ], "init-declarations": "off", "jsx-quotes": "error", "key-spacing": "error", "keyword-spacing": "error", "line-comment-position": "error", "linebreak-style": [ // this is a warning because our build system checks out on Linux // then copies to Windows causing the line endings to be mismatched "warn", (require("os").EOL === "\r\n" ? "windows" : "unix") ], "lines-around-comment": "off", "lines-around-directive": "off", "max-depth": "error", "max-len": "off", "max-lines": "off", "max-nested-callbacks": "error", "max-params": "off", "max-statements": "off", "max-statements-per-line": "error", "multiline-ternary": "off", "new-cap": "error", "new-parens": "error", "newline-after-var": [ "error", "always" ], "newline-before-return": "off", "newline-per-chained-call": "error", "no-alert": "error", "no-array-constructor": "error", "no-await-in-loop": "error", "no-bitwise": "error", "no-caller": "error", "no-catch-shadow": "error", "no-confusing-arrow": "error", "no-continue": "error", "no-div-regex": "error", "no-duplicate-imports": "error", "no-else-return": "error", "no-empty-function": "off", "no-eq-null": "error", "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-extra-label": "error", "no-extra-parens": "off", "no-floating-decimal": "error", "no-implicit-globals": "off", "no-implied-eval": "error", "no-inline-comments": "error", "no-invalid-this": "off", "no-iterator": "error", "no-label-var": "error", "no-labels": "error", "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", "no-magic-numbers": "off", "no-mixed-operators": "error", "no-mixed-requires": "off", "no-multi-assign": "off", "no-multi-spaces": "error", "no-multi-str": "error", "no-multiple-empty-lines": [ "error", { "max": 1, "maxBOF": 0, "maxEOF": 0 } ], "no-native-reassign": "error", "no-negated-condition": "off", "no-negated-in-lhs": "error", "no-nested-ternary": "off", "no-new": "error", "no-new-func": "error", "no-new-object": "error", "no-new-require": "error", "no-new-wrappers": "error", "no-octal-escape": "error", "no-param-reassign": "off", "no-path-concat": "error", "no-plusplus": "error", "no-process-env": "error", "no-process-exit": "error", "no-proto": "error", "no-prototype-builtins": "off", "no-restricted-globals": "error", "no-restricted-imports": "error", "no-restricted-modules": "error", "no-restricted-properties": "error", "no-restricted-syntax": "error", "no-return-assign": "error", "no-return-await": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-shadow": "off", "no-shadow-restricted-names": "error", "no-spaced-func": "error", "no-sync": "error", "no-tabs": "error", "no-template-curly-in-string": "error", "no-ternary": "off", "no-throw-literal": "error", "no-trailing-spaces": "error", "no-undef-init": "error", "no-undefined": "error", "no-underscore-dangle": "off", "no-unmodified-loop-condition": "error", "no-unneeded-ternary": "off", "no-unused-expressions": "error", "no-use-before-define": "error", "no-useless-call": "error", "no-useless-computed-key": "error", "no-useless-concat": "error", "no-useless-constructor": "error", "no-useless-escape": "off", "no-useless-rename": "error", "no-useless-return": "off", "no-var": "off", "no-void": "error", "no-warning-comments": "off", "no-whitespace-before-property": "error", "no-with": "error", "object-curly-newline": "off", "object-curly-spacing": "error", "object-property-newline": "error", "object-shorthand": "off", "one-var": "error", "one-var-declaration-per-line": "error", "operator-assignment": [ "error", "always" ], "operator-linebreak": [ "error", "before" ], "padded-blocks": "off", "prefer-arrow-callback": "off", "prefer-const": "error", "prefer-numeric-literals": "error", "prefer-promise-reject-errors": "error", "prefer-reflect": "off", "prefer-rest-params": "off", "prefer-spread": "off", "prefer-template": "off", "quote-props": "off", "quotes": [ "error", "double" ], "radix": "error", "require-await": "error", "require-jsdoc": "off", "rest-spread-spacing": "error", "semi": "error", "semi-spacing": [ "error", { "after": true, "before": false } ], "sort-imports": "error", "sort-keys": "off", "sort-vars": "off", "space-before-blocks": "error", "space-before-function-paren": "error", "space-in-parens": [ "error", "never" ], "space-infix-ops": "error", "spaced-comment": [ "error", "always" ], "strict": "error", "symbol-description": "error", "template-curly-spacing": "error", "template-tag-spacing": "error", "unicode-bom": [ "error", "never" ], "valid-jsdoc": "off", "vars-on-top": "off", "wrap-iife": "error", "wrap-regex": "off", "yield-star-spacing": "error", "yoda": [ "error", "never" ] } }; ```

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

test.js:


for(let i = 0; i < 1; i++)
{
    console.log("argh, true!");
}
eslint test.js

What did you expect to happen? Same result on both OSX and official Node docker image

What actually happened? Please include the actual, raw output from ESLint. Results on OSX:

  1:1   error  Too many blank lines at the beginning of file. Max of 0 allowed                no-multiple-empty-lines
  2:1   error  Use the global form of 'use strict'                                            strict
  2:1   error  Expected space(s) after "for"                                                  keyword-spacing
  2:23  error  Unary operator '++' used                                                       no-plusplus
  3:1   error  Opening curly brace does not appear on the same line as controlling statement  brace-style
  4:1   error  Expected indentation of 4 spaces but found 1 tab                               indent
  4:2   error  Unexpected tab character                                                       no-tabs
  4:2   error  Unexpected console statement                                                   no-console
  5:2   error  Newline required at end of file but not found                                  eol-last

Exit code: 1

Results on Node docker image: No errors/warnings/output. Exit code: 0

samcayford commented 6 years ago

Never mind. It was a higher up config file that was present on OSX and not mounted into docker. Sorry