justmoon / node-extend

Simple function to extend objects
MIT License
341 stars 68 forks source link

Cannot read config file: node_modules/extend/.eslintrc #40

Closed davidbarratt closed 8 years ago

davidbarratt commented 8 years ago

Can we rename .eslintrc to .eslintrc.json to prevent .eslintrc from being parsed as YAML?

Cannot read config file: node_modules/extend/.eslintrc
Error: duplicated mapping key at line 45, column 30:
                "beforeLineComment": false,
                                 ^
YAMLException: Cannot read config file: node_modules/extend/.eslintrc
Error: duplicated mapping key at line 45, column 30:
                "beforeLineComment": false,
                                 ^
    at generateError (node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
    at throwError (node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
    at storeMappingPair (node_modules/js-yaml/lib/js-yaml/loader.js:305:7)
    at readFlowCollection (node_modules/js-yaml/lib/js-yaml/loader.js:720:7)
    at composeNode (node_modules/js-yaml/lib/js-yaml/loader.js:1327:11)
    at readFlowCollection (node_modules/js-yaml/lib/js-yaml/loader.js:704:5)
    at composeNode (node_modules/js-yaml/lib/js-yaml/loader.js:1327:11)
    at readFlowCollection (node_modules/js-yaml/lib/js-yaml/loader.js:715:7)
    at composeNode (node_modules/js-yaml/lib/js-yaml/loader.js:1327:11)
    at readFlowCollection (node_modules/js-yaml/lib/js-yaml/loader.js:715:7)
ljharb commented 8 years ago

I believe this is a bug in eslint or js-yaml - the default is json, so i'm not sure why it would attempt to parse it as yaml. (separately, it should only cause a problem when developing this very module, since eslint shouldn't be checking inside your own node_modules when this project is a dependency)

solsos commented 8 years ago

how did you fix it? I met the same issue~

joshfttb commented 8 years ago

Having the same problem.

ljharb commented 8 years ago

@joshfttb what version of eslint are you running?

joshfttb commented 7 years ago

Sorry, just saw this.

eslint@3.8.0

ljharb commented 7 years ago

@joshfttb if you could make a repro repo, it might be an eslint bug.