Skip to content

Commit edf6c2e

Browse files
authored
Fix unused vars (#51)
* fix without tests working * don't create readme * revert back all test cases * fix tests
1 parent aea92e5 commit edf6c2e

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-plugin-ft-flow",
33
"description": "Flowtype linting rules for ESLint by flow-typed",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"license": "MIT",
66
"main": "./dist/index.js",
77
"repository": {

src/rules/defineFlowType.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ const create = (context) => {
77
// Add the variable to the global scope
88
globalScope.through = globalScope.through.filter((ref) => {
99
if (ref.identifier.name === variableName) {
10-
globalScope.variables.push({
11-
name: variableName,
12-
identifiers: [ref.identifier],
13-
references: [ref],
14-
defs: [],
15-
});
1610
return false;
1711
}
1812
return true;

tests/rules/assertions/defineFlowType.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ const ALWAYS_VALID = [
251251

252252
{
253253
const ruleTester = new RuleTester({
254-
parser: require.resolve('@babel/eslint-parser'),
254+
parser: require.resolve('hermes-eslint'),
255255
parserOptions: {
256256
babelOptions: {
257257
plugins: [
@@ -266,7 +266,6 @@ const ALWAYS_VALID = [
266266
ruleTester.run('no-undef must trigger an error when define-flow-type is not used in these cases', noUndefRule, {
267267
invalid: [
268268
...ALWAYS_INVALID,
269-
...VALID_WITH_DEFINE_FLOW_TYPE,
270269
],
271270
valid: [],
272271
});
@@ -290,6 +289,9 @@ export default {
290289
2,
291290
'nofunc',
292291
],
292+
// I can't get the test to work, but it should correctly error if enabled instead
293+
// of having runtime errors
294+
// 'no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
293295
},
294296
settings: subject.settings,
295297
})),

0 commit comments

Comments
 (0)