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
Having .eslintrc in the root dir causes eslint tests to fail #6206
Comments
Can you share all the errors you're seeing? |
Right - I will paste the short 13-error version then: 1) Config findLocalConfigFiles() should return an empty array when an .eslintrc file is not found:
AssertionError: expected [ 'D:\\.eslintrc' ] to have a length of 0 but got 1
at Function.assert.lengthOf (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:150:20)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
2) Config findLocalConfigFiles() should return package.json only when no other config files are found:
AssertionError: expected [ Array(3) ] to have a length of 2 but got 3
at Function.assert.lengthOf (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:160:20)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
3) Config findLocalConfigFiles() should return the only one config file even if there are multiple found:
AssertionError: expected 2 to equal 1
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:172:20)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
4) Config findLocalConfigFiles() should return all possible files when multiple are found:
AssertionError: expected [ Array(4) ] to deeply equal [ Array(3) ]
+ expected - actual
[
"D:\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\subdir\\subsubdir\\.eslintrc.json"
"D:\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\subdir\\.eslintrc.yml"
"D:\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\.eslintrc.js"
- "D:\\.eslintrc"
]
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:186:20)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
5) Config findLocalConfigFiles() should return an empty array when a package.json file is not found:
AssertionError: expected [ 'D:\\.eslintrc' ] to have a length of 0 but got 1
at Function.assert.lengthOf (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:194:20)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
6) Config getConfig() should merge configs when local .eslintrc overrides parent .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:445:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
7) Config getConfig() should merge configs when local .eslintrc overrides parent and grandparent .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:466:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
8) Config getConfig() should merge command line config when config file adds to local .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:504:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
9) Config getConfig() should merge command line config when config file overrides local .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:527:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
10) Config getConfig() should merge command line config when config file adds to local and parent .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:552:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
11) Config getConfig() should merge command line config when config file overrides local and parent .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:576:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
12) Config getConfig() should merge command line config and rule when rule and config file overrides local .eslintrc:
AssertionError: expected { es6: true, node: true } to deeply equal { node: true }
+ expected - actual
{
- "es6": true
"node": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:602:13)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5)
13) Config getConfig() with env in a child configuration file should overwrite parserOptions of the parent with env of the child:
AssertionError: expected { es6: true, commonjs: true } to deeply equal { commonjs: true }
+ expected - actual
{
"commonjs": true
- "es6": true
}
at Function.assert.deepEqual (D:\Projects\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at assertConfigsEqual (D:\Projects\eslint\tests\lib\config.js:61:16)
at Context.<anonymous> (D:\Projects\eslint\tests\lib\config.js:732:17)
at callFn (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (D:\Projects\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (D:\Projects\eslint\node_modules\mocha\lib\runner.js:422:10)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:533:12
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:342:14)
at D:\Projects\eslint\node_modules\mocha\lib\runner.js:352:7
at next (D:\Projects\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (D:\Projects\eslint\node_modules\mocha\lib\runner.js:320:5) |
As you can see, the errors can be grouped into these categories:
|
@nzakas I can also post the 70-error version if it will help. |
While we should still add |
@btmills Oooh, I didn't know about that. Yes, I was using this as a fallback config for my new projects, thanks for the advice. |
I still think the original issue is correct and we should add |
Our project |
@gyandeeps Yes, I think I saw some error reports coming from files contained in Edit: |
When I tried on my machine (Windows 7), i got 11 errors but only 5 had error output 😕 10707 passing (46s)
11 failing
1) Config findLocalConfigFiles() should return an empty array when an .eslintrc file is not found:
AssertionError: expected [ 'C:\\Users\\gs025879\\.eslintrc' ] to have a length of 0 but got 1
at Function.assert.lengthOf (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (C:\Users\gs025879\Documents\webstrom\eslint\tests\lib\config.js:150:20)
at callFn (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:533:12
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:342:14)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:352:7
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:320:5)
2) Config findLocalConfigFiles() should return package.json only when no other config files are found:
AssertionError: expected [ Array(3) ] to have a length of 2 but got 3
at Function.assert.lengthOf (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (C:\Users\gs025879\Documents\webstrom\eslint\tests\lib\config.js:160:20)
at callFn (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:533:12
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:342:14)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:352:7
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:320:5)
3) Config findLocalConfigFiles() should return the only one config file even if there are multiple found:
AssertionError: expected 2 to equal 1
at Context.<anonymous> (C:\Users\gs025879\Documents\webstrom\eslint\tests\lib\config.js:172:20)
at callFn (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:533:12
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:342:14)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:352:7
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:320:5)
4) Config findLocalConfigFiles() should return all possible files when multiple are found:
AssertionError: expected [ Array(4) ] to deeply equal [ Array(3) ]
+ expected - actual
[
"C:\\Users\\gs025879\\AppData\\Local\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\subdir\\subsubdir\\.eslintrc.json"
"C:\\Users\\gs025879\\AppData\\Local\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\subdir\\.eslintrc.yml"
"C:\\Users\\gs025879\\AppData\\Local\\Temp\\eslint\\fixtures\\config-hierarchy\\fileexts\\.eslintrc.js"
- "C:\\Users\\gs025879\\.eslintrc"
]
at Function.assert.deepEqual (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\chai\lib\chai\interface\assert.js:216:32)
at Context.<anonymous> (C:\Users\gs025879\Documents\webstrom\eslint\tests\lib\config.js:186:20)
at callFn (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:533:12
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:342:14)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:352:7
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:320:5)
5) Config findLocalConfigFiles() should return an empty array when a package.json file is not found:
AssertionError: expected [ 'C:\\Users\\gs025879\\.eslintrc' ] to have a length of 0 but got 1
at Function.assert.lengthOf (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\chai\lib\chai\interface\assert.js:1086:37)
at Context.<anonymous> (C:\Users\gs025879\Documents\webstrom\eslint\tests\lib\config.js:194:20)
at callFn (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:315:21)
at Test.Runnable.run (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runnable.js:308:7)
at Runner.runTest (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:533:12
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:342:14)
at C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:352:7
at next (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:284:14)
at Immediate._onImmediate (C:\Users\gs025879\Documents\webstrom\eslint\node_modules\mocha\lib\runner.js:320:5) Used the same steps as @fatfisz mentioned above. |
Since the errors are limited to the |
I dont think just adding |
Ah, good point. |
So far https://github.com/tschaub/mock-fs looks promising as we can fake the directory structure rather than using the real directory structure. |
mock-fs is great! |
If someone wants to give it a try, go for it! I had a lot of trouble with mock-fs when I tried to use it in some tests previously, but it's entirely possible I didn't know what I was doing. :) |
Here I have a sample work done for With this change now the unit test are not failing using the same scenario as described in this issue. |
Very cool! Is there a way to split up that giant blob of data? Maybe each test can register just what it needs? |
Yes, ideally i want to create a json file for each kind of fixture and keep the file their. So the one I have is the exact json version of our fixtures/config-hierarchy (physical version). So basically reacd the json file and load it through mock-fs. Here is the dirty script which reads the physical version of the file structure and creates json version out of it: https://gist.github.com/gyandeeps/23a4c836b54f91d9d3cfed7ab37e7a0b |
I think we can probably start with just updating these few failing tests so we can unblock potential contributors. Agree that we should use mock-fs going forward. |
@gyandeeps Sure, I will probably do it over the weekend :) |
@gyandeeps Tried it right now and it worked (so Windows is ok with the changes). Great work! |
What version of ESLint are you using?
2.10.2
What did you do?
I cloned the
eslint
repo and ran tests.What did you expect to happen?
No errors.
What actually happened?
A few errors (about 70 or so).
I think I might be the only one that has such a troubling configuration, because I've already created a few PRs to other quite popular repos, which added
"root": true
to the.eslintrc
config file.The problem is this: I have a "global"
.eslintrc
file that sits in the root dir. So every project that useseslint
and doesn't have"root": true
set is also using my "global" config. It turns out thateslint
itself has this problem, or rathereslint
tests 😄Changing the name of my "global" config file to something random solved the problem (all tests passed).
The simplest way to reproduce this is to create an
.eslintrc
file in the root dir with this content:For me this caused 13 errors to emerge, for example:
and
The text was updated successfully, but these errors were encountered: