Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-fb-flow

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-fb-flow - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

METADATA.bzl

6

CHANGELOG.md

@@ -0,3 +1,7 @@

# 0.0.5
- Added support for `AsExpression`s in rule `no-flow-enums-object-mapping`
- Updated README documentation
# 0.0.4
- Update README documentation
- Updated README documentation

@@ -4,0 +8,0 @@ # 0.0.3

4

index.js
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -11,0 +11,0 @@

{
"name": "eslint-plugin-fb-flow",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -20,3 +20,3 @@ "description": "This is a set of ESLint rules created and published by the Flow team. They are in addition to (not a replacement for) the rules of `eslint-plugin-flowtype` created and published by the open-source community.",

"eslint": "^7.30.0",
"hermes-eslint": "^0.4.8",
"hermes-eslint": "0.17.0",
"jest": "^27.0.6"

@@ -23,0 +23,0 @@ },

# eslint-plugin-fb-flow
This is a set of ESLint rules created and published by the Flow team. They are in addition to (not a replacement for) the rules of [`eslint-plugin-flowtype`](https://github.com/gajus/eslint-plugin-flowtype) created and published by the open-source community.
This is a set of ESLint rules created and published by the Flow team.
They are in addition to (not a replacement for) the rules of [`eslint-plugin-flowtype`](https://github.com/gajus/eslint-plugin-flowtype) created and published by the open-source community.
We recommend using the [hermes-eslint](https://www.npmjs.com/package/hermes-eslint) parser plugin for ESLint.
Read our docs on using [ESLint with Flow](https://flow.org/en/docs/tools/eslint/) in general.

@@ -152,3 +155,3 @@ ## Usage

You should use a function with a `switch` instead of an object literal to map [Flow Enums](https://flow.org/en/docs/enums/) to other values -
see the [docs](https://flow.org/en/docs/enums//using-enums/#toc-mapping-enums-to-other-values).
see the [docs](https://flow.org/en/docs/enums/using-enums/#toc-mapping-enums-to-other-values).
This avoids having to cast to `string` and [exhaustively checks the enum](https://flow.org/en/docs/enums/using-enums/#toc-exhaustively-checking-enums-with-a-switch).

@@ -155,0 +158,0 @@

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -11,0 +11,0 @@

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -77,4 +77,9 @@

);
} else if (node.type === 'AsExpression') {
const {typeAnnotation, expression} = node;
return (
typeAnnotation.type == 'StringTypeAnnotation' && isEnumAccess(expression)
);
}
return false;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -11,0 +11,0 @@

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -11,0 +11,0 @@

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -62,5 +62,4 @@

}
const tokenAfterOpeningAngleBracket = sourceCode.getTokenAfter(
openingAngleBracket,
);
const tokenAfterOpeningAngleBracket =
sourceCode.getTokenAfter(openingAngleBracket);
if (tokenAfterOpeningAngleBracket == null) {

@@ -67,0 +66,0 @@ return;

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

@@ -7,4 +7,4 @@ * This source code is licensed under the MIT license found in the

*
* @emails oncall+flow
* @format
* @oncall flow
*/

@@ -11,0 +11,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc