javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Better support for `test`, `tests`, and `spec` directories for `import/no-extraneous-dependencies` rule

Open moberegger opened this issue 3 years ago • 1 comments

Updates the globs for test, tests, and spec directories so that they will be picked up from anywhere in the project. This gets it to work identically to __tests__.

Right now the current rule will only pick up files in these directories if the directory is in the root of the project. If a project co-locates test directories with the source (ex: under /src/foo/test/foo.test.js), the rule does not take affect and you'll get linting errors when requireing or importing dev dependencies.

moberegger avatar Jul 08 '22 01:07 moberegger

I'm not comfortable making it easier to colocate tests.

ljharb avatar Jul 08 '22 03:07 ljharb