New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--print-config outputs empty config if called not from config file directory #6329
Comments
The test case may be simplified: call |
I'm really confused about showing the linting messages when the issue seems to be about
|
I've put the linting messages as a proving that without |
I've added a note before the linting message. Is it clear now? Sorry, my English is clumsy( |
Verified. Interesting. I though Test case: Running {
"globals": {
"__dirname": false,
"__filename": false,
"arguments": false,
"Buffer": false,
"clearImmediate": false,
"clearInterval": false,
"clearTimeout": false,
"console": false,
"exports": true,
"GLOBAL": false,
"global": false,
"Intl": false,
"module": false,
"process": false,
"require": false,
"root": false,
"setImmediate": false,
"setInterval": false,
"setTimeout": false
},
"env": {
"node": true
},
"rules": {
"no-alert": "error",
"no-array-constructor": "error",
"no-bitwise": "off",
"no-caller": "error",
"no-case-declarations": "error",
"no-catch-shadow": "off",
"no-class-assign": "error",
"no-cond-assign": "error",
"no-confusing-arrow": "off",
"no-console": "error",
"no-const-assign": "error",
"no-constant-condition": "error",
"no-continue": "off",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-div-regex": "off",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-dupe-args": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "off",
"no-else-return": "off",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-function": "off",
"no-empty-pattern": "error",
"no-eq-null": "off",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-boolean-cast": "error",
"no-extra-label": "off",
"no-extra-parens": "off",
"no-extra-semi": "error",
"no-fallthrough": "error",
"no-floating-decimal": "error",
"no-func-assign": "error",
"no-implicit-coercion": "off",
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-invalid-this": "error",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "off",
"no-loop-func": "error",
"no-mixed-requires": "error",
"no-mixed-spaces-and-tabs": [
"error",
false
],
"linebreak-style": "off",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": "off",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-restricted-globals": "off",
"no-restricted-imports": "off",
"no-restricted-modules": "off",
"no-restricted-syntax": "off",
"no-return-assign": "error",
"no-script-url": "error",
"no-self-assign": "error",
"no-self-compare": "off",
"no-sequences": "error",
"no-shadow": "error",
"no-shadow-restricted-names": "error",
"no-whitespace-before-property": "off",
"no-spaced-func": "error",
"no-sparse-arrays": "error",
"no-sync": "off",
"no-ternary": "off",
"no-trailing-spaces": "error",
"no-this-before-super": "error",
"no-throw-literal": "off",
"no-undef": "error",
"no-undef-init": "error",
"no-undefined": "error",
"no-unexpected-multiline": "error",
"no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "off",
"no-unreachable": "error",
"no-unsafe-finally": "off",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used"
}
],
"no-use-before-define": "error",
"no-useless-call": "off",
"no-useless-computed-key": "off",
"no-useless-concat": "error",
"no-useless-constructor": "off",
"no-useless-escape": "off",
"no-useless-rename": "off",
"no-void": "off",
"no-var": "off",
"no-warning-comments": "off",
"no-with": "error",
"no-magic-numbers": "off",
"array-bracket-spacing": "off",
"array-callback-return": "error",
"arrow-body-style": "off",
"arrow-parens": "off",
"arrow-spacing": "off",
"accessor-pairs": "off",
"block-scoped-var": "off",
"block-spacing": "error",
"brace-style": [
"error",
"1tbs"
],
"callback-return": [
"error",
[
"cb",
"callback",
"next"
]
],
"camelcase": [
"error",
{
"properties": "never"
}
],
"comma-dangle": "error",
"comma-spacing": "error",
"comma-style": [
"error",
"last"
],
"complexity": [
"off",
11
],
"computed-property-spacing": "off",
"consistent-return": "error",
"consistent-this": "off",
"constructor-super": "error",
"curly": [
"error",
"all"
],
"default-case": "error",
"dot-location": "off",
"dot-notation": [
"error",
{
"allowKeywords": true
}
],
"eol-last": "error",
"eqeqeq": "error",
"func-names": "off",
"func-style": [
"error",
"declaration"
],
"generator-star-spacing": "off",
"global-require": "off",
"guard-for-in": "error",
"handle-callback-err": [
"error",
"err"
],
"id-length": "off",
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"init-declarations": "off",
"jsx-quotes": "off",
"key-spacing": [
"error",
{
"beforeColon": false,
"afterColon": true
}
],
"keyword-spacing": "error",
"lines-around-comment": [
"error",
{
"beforeBlockComment": true,
"afterBlockComment": false,
"beforeLineComment": true,
"afterLineComment": false
}
],
"max-depth": "off",
"max-len": "off",
"max-nested-callbacks": "off",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"new-cap": "error",
"new-parens": "error",
"newline-after-var": "error",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"object-curly-spacing": [
"off",
"never"
],
"object-property-newline": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": "off",
"operator-linebreak": "off",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": [
"error",
"as-needed"
],
"quotes": [
"error",
"double"
],
"radix": "error",
"id-match": "off",
"id-blacklist": "off",
"require-jsdoc": "error",
"require-yield": "off",
"semi": "error",
"semi-spacing": [
"error",
{
"before": false,
"after": true
}
],
"sort-vars": "off",
"sort-imports": "off",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
"never"
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": [
"error",
{
"words": true,
"nonwords": false
}
],
"spaced-comment": [
"error",
"always",
{
"exceptions": [
"-"
]
}
],
"strict": [
"error",
"global"
],
"template-curly-spacing": "off",
"unicode-bom": "off",
"use-isnan": "error",
"valid-jsdoc": [
"error",
{
"prefer": {
"return": "returns"
}
}
],
"valid-typeof": "error",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "off",
"yoda": [
"error",
"never"
]
},
"parserOptions": {
"ecmaFeatures": {
"globalReturn": true
}
},
"ecmaFeatures": {},
"extends": "./packages/eslint-config-eslint/default.yml",
"root": true
} Running {
"globals": {},
"env": {},
"rules": {},
"parserOptions": {}
} |
I am working on this |
I'm a bit confused here - what are we saying is the bug? I'm pretty sure |
Does |
@nzakas |
@nzakas Here is a failing test case using a file, running from |
@platinumazure the bug depends not on path and not on relation between path and config file, but from relation between CWD and config file. If you call eslint for |
@nzakas That's what I assumed as well. However, that's not what is happening. |
What version of ESLint are you using?
2.11.1
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
e:\DOC\prg\js\node\.eslintrc.json
What did you do? Please include the actual source code causing the issue.
I have a simple test script in the subdirectory relative to the config directory:
e:\DOC\prg\js\node\-test\test.js
:eslint output (to be sure eslint really uses all the rules frome the additional configs):
I want to see all the config set via
eslint --print-config test.js
.What did you expect to happen?
All the rules from
.eslintrc.json
+eslint:recommended
+airbnb-base
should be shown.What actually happened? Please include the actual, raw output from ESLint.
The output is:
However, if I place
test.js
in the same directory with.eslintrc.json
, the output is a big proper rule set.The text was updated successfully, but these errors were encountered: