DefinitelyTyped/types/ramda
Nathan Shively-Sanders 3d6e86fd92
Fix incorrect import/export clashes. (#38730)
* Fix incorrect import/export clashes.

A new error in Typescript 3.7 forbids name clashes like this:

```ts
import { X } from 'y'
export interface X { }
```

Previously they were incorrectly allowed. Typescript 3.7 will have a
beta version in the next day or two. In the meantime you can try
typescript@next -- the nightly build -- to see these errors.

* Missed a file!
2019-09-30 12:33:36 -07:00
..
es
src
test [ramda] improvements & urgent fixes (#38503) 2019-09-25 14:24:39 -07:00
index.d.ts [ramda] accurate types for mergeAll & a fix (#38632) 2019-09-26 11:26:47 -07:00
package.json Fix incorrect import/export clashes. (#38730) 2019-09-30 12:33:36 -07:00
ramda-tests.ts [ramda] accurate types for mergeAll & a fix (#38632) 2019-09-26 11:26:47 -07:00
README.md
tools.d.ts
tsconfig.json [ramda] split tests to separate modules: 'join' - 'mean' (#38570) 2019-09-25 14:11:26 -07:00
tslint.json

@types/ramda

Contributing

ramda is a popular library with a plethora of functions that can be mixed and matched in thousands of ways. Because of this, it can be a challenge to make changes to its types without breaking something. While sometimes breaking-changes are appropriate, we hope to keep them to a minimum.

Please read this guide in its entirety. Doing so helps ensure that the only breaking changes will be those that bring @types/ramda closer to representing the behavior of the underlying ramda package.

Tests

Tests are located in the test/ directory. Each ramda function has its own test file, named <function>-tests.ts. When editing types for a function, please update the corresponding tests to prove that the behavior you seek actually works. When adding a new function, add a corresponding test file with as many tests as you can to detail the function's behavior.

As a rule, the goal of each test file is to prove that the corresponding function's input and output types are correct. As such, each test file should only test its corresponding function as the top-most call.

For instance, the following:

R.pipe(
  R.add(2),
  R.add(3),
  R.add(4),
);

tests R.pipe, not R.add. So it belongs in test/pipe-tests.ts rather than test/map-tests.ts.

Use $ExpectType comments to test that a function returns the correct type:

// $ExpectType string[]
R.map((n: number) => n.toString(), [1, 2, 3]);

Use $ExpectError comments to test that using a function a certain way should result in a compiler error:

// $ExpectError
R.map((n: number) => n.toString(), ['1', '2', '3']);