Skip to content

Commit

Permalink
chore(monorepo): remove more flow references (#8137)
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin authored Jul 26, 2021
1 parent 73bd30c commit c47f712
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
7 changes: 0 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ shared-data/python/**
**/build/**
**/venv/**

# flow
flow-typed/npm/**
discovery-client/flow-types/**
components/flow-types/**
shared-data/flow-types/**
step-generation/flow-types/**

# typescript
app-shell/lib/**
discovery-client/lib/**
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# notify those language communities
*.js @Opentrons/js
*.py @Opentrons/py
/flow-typed @Opentrons/js
*.d.ts @Opentrons/js
/webpack-config @Opentrons/js

# subprojects - those with clear team ownership should have appropriate notifications
Expand Down
19 changes: 6 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ To help with code quality and maintainability, we use a collection of tools that
- [stylelint][] - CSS linter
- [Typecheckers][type-check]
- Verify that the code is [type safe][type-safe]
- [typescript][]
- [mypy][] - Static type checker for Python
- [Flow][flow] - Static type checker for JavaScript
- Formatters
- (Re)format source code to adhere to a consistent [style][code-style]
- [Prettier][prettier] - Code formatter for JavaScript, JSON, Markdown, and YAML
Expand Down Expand Up @@ -282,7 +282,7 @@ make format
[eslint]: https://eslint.org/
[flake8]: https://flake8.pycqa.org
[stylelint]: https://stylelint.io/
[flow]: https://flow.org/
[typescript]: https://www.typescriptlang.org/
[mypy]: http://mypy-lang.org/
[prettier]: https://prettier.io/

Expand All @@ -294,7 +294,7 @@ Most, if not all, of the tools above have plugins available for your code editor
- ESLint - <https://eslint.org/docs/user-guide/integrations#editors>
- stylelint - <https://stylelint.io/user-guide/complementary-tools/#editor-plugins>
- mypy - Search your editor's package manager
- Flow - <https://flow.org/en/docs/editors/>
- TypeScript - <https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support>
- Prettier - <https://prettier.io/docs/en/editors.html>

### Adding dependencies
Expand All @@ -308,7 +308,7 @@ JavaScript dependencies are installed by [yarn][]. When calling yarn, you should
A development dependency is any dependency that is used only to help manage the project. Examples of development dependencies would be:

- Build tools (webpack, babel)
- Testing/linting/checking tools (jest, flow, eslint)
- Testing/linting/checking tools (jest, typescript, eslint)
- Libraries used only in support scripts (aws, express)

To add a development dependency:
Expand Down Expand Up @@ -336,16 +336,9 @@ yarn workspace <project_name> add <dependency_name>

##### Adding type definitions

After you have installed a dependency (development or project), you may find that you need to also install [flow][] type definitions. Without type definitions for our external dependencies, we are unable to typecheck anything we `import`. We use [flow-typed][] to install community-created type definitions. To add type definitions for an installed package:
After you have installed a dependency (development or project), you may find that you need to also install [typescript][] type definitions. Without type definitions for our external dependencies, we are unable to typecheck anything we `import`. If you are using a dependency that does not come with type definitions, see the [typescript consumption guide](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html) for how to find and use community-created type definitions.

```shell
yarn run flow-typed install <dependency_name>@<installed_version>
```

Not every JavaScript package has an available flow-typed definition. In this case, flow-typed will generate a stub file in the directory `flow-typed/npm/`. You may find it useful to fill out this stub; See the [flow-typed wiki][writing-flow-definitions] for a library definition writing guide.

[flow-typed]: https://github.com/flow-typed/flow-typed
[writing-flow-definitions]: https://github.com/flow-typed/flow-typed/wiki/Contributing-Library-Definitions
Not every JavaScript package has an available TypeScript definition. If you find yourself using such a library, you may need to create your own [ambient type declaration](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html).

#### Python

Expand Down
3 changes: 1 addition & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ module.exports = {
],
],
presets: [
'@babel/preset-flow',
'@babel/preset-react',
['@babel/preset-env', { modules: false, useBuiltIns: false }],
],
overrides: [
{
test: ['**/*.ts', '**/*.tsx'],
presets: [['@babel/preset-flow', false], '@babel/preset-typescript'],
presets: ['@babel/preset-typescript'],
},
{
test: 'app-shell/**/*',
Expand Down
7 changes: 1 addition & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ module.exports = {
'!**/test/**',
'!**/scripts/**',
],
testPathIgnorePatterns: [
'cypress/',
'/node_modules/',
'.*.d.ts',
'.*.flow.js',
],
testPathIgnorePatterns: ['cypress/', '/node_modules/', '.*.d.ts'],
coverageReporters: ['lcov', 'text-summary'],
snapshotSerializers: ['enzyme-to-json/serializer'],
watchPathIgnorePatterns: ['/node_modules/'],
Expand Down

0 comments on commit c47f712

Please sign in to comment.